From 3b49905071680dc357dc8bd90b87a095a61112c9 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:25:07 -0600 Subject: [PATCH 001/295] wip: pipelines --- common/api-review/firestore.api.md | 1685 ++++- packages/firestore/src/api.ts | 166 + packages/firestore/src/api/database.ts | 5 + .../firestore/src/core/firestore_client.ts | 25 +- .../src/lite-api/user_data_reader.ts | 71 +- .../src/model/pipeline_stream_element.ts | 13 + .../src/pipelines/api/expressions.ts | 6720 +++++++++++++++++ .../src/pipelines/api/pipeline-result.ts | 232 + .../src/pipelines/api/pipeline-source.ts | 48 + .../src/pipelines/api/pipeline-util.ts | 248 + .../firestore/src/pipelines/api/pipeline.ts | 735 ++ packages/firestore/src/pipelines/api/stage.ts | 384 + packages/firestore/src/protos/compile.sh | 15 +- .../src/protos/firestore_proto_api.ts | 90 +- .../src/protos/google/api/launch_stage.proto | 72 + .../protos/google/firestore/v1/document.proto | 112 + .../google/firestore/v1/firestore.proto | 88 +- .../protos/google/firestore/v1/pipeline.proto | 41 + .../google/firestore/v1/query_profile.proto | 92 + packages/firestore/src/protos/protos.json | 854 ++- packages/firestore/src/remote/datastore.ts | 37 +- .../firestore/src/remote/rest_connection.ts | 1 + packages/firestore/src/remote/serializer.ts | 128 +- packages/firestore/src/util/misc.ts | 20 + packages/firestore/src/util/obj.ts | 2 +- 25 files changed, 11603 insertions(+), 281 deletions(-) create mode 100644 packages/firestore/src/model/pipeline_stream_element.ts create mode 100644 packages/firestore/src/pipelines/api/expressions.ts create mode 100644 packages/firestore/src/pipelines/api/pipeline-result.ts create mode 100644 packages/firestore/src/pipelines/api/pipeline-source.ts create mode 100644 packages/firestore/src/pipelines/api/pipeline-util.ts create mode 100644 packages/firestore/src/pipelines/api/pipeline.ts create mode 100644 packages/firestore/src/pipelines/api/stage.ts create mode 100644 packages/firestore/src/protos/google/api/launch_stage.proto create mode 100644 packages/firestore/src/protos/google/firestore/v1/pipeline.proto create mode 100644 packages/firestore/src/protos/google/firestore/v1/query_profile.proto diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 34b56b97f21..fd4942bea18 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -9,14 +9,54 @@ import { FirebaseApp } from '@firebase/app'; import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; +// @beta +export interface Accumulator { + // (undocumented) + accumulator: true; +} + +// @beta +export type AccumulatorTarget = ExprWithAlias; + +// @beta (undocumented) +export class Add extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function add(left: Constant, right: Constant): Add; + +// @beta +export function add(left: Constant, right: any): Add; + +// @beta +export function add(left: string, right: Constant): Add; + +// @beta +export function add(left: string, right: any): Add; + // @public export function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +// @beta (undocumented) +export class AddFields implements Stage { + constructor(fields: Map); + // (undocumented) + name: string; +} + // @public export type AddPrefixToKeys> = { [K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K]; }; +// @beta (undocumented) +export class Aggregate implements Stage { + constructor(accumulators: Map, groups: Map); + // (undocumented) + name: string; +} + // @public export class AggregateField { readonly aggregateType: AggregateType; @@ -53,18 +93,147 @@ export type AggregateSpecData = { // @public export type AggregateType = 'count' | 'avg' | 'sum'; +// @beta (undocumented) +export class And extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +// @beta +export function andExpression(left: FilterExpr, ...right: FilterExpr[]): And; + +// @beta (undocumented) +export class ArrayConcat extends FirestoreFunction { + constructor(array: Constant, elements: Constant[]); + } + +// @beta +export function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; + +// @beta +export function arrayConcat(array: Constant, elements: any[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: Constant[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: any[]): ArrayConcat; + +// @beta (undocumented) +export class ArrayContains extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, element: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function arrayContains(array: Constant, element: Constant): ArrayContains; + +// @beta +export function arrayContains(array: Constant, element: any): ArrayContains; + +// @beta +export function arrayContains(array: string, element: Constant): ArrayContains; + +// @beta +export function arrayContains(array: string, element: any): ArrayContains; + +// @beta (undocumented) +export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, values: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; + +// @beta (undocumented) +export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, values: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; + +// @beta (undocumented) +export class ArrayElement extends FirestoreFunction { + constructor(); +} + +// @beta (undocumented) +export class ArrayLength extends FirestoreFunction { + constructor(array: Constant); + } + +// @beta +export function arrayLength(array: Constant): ArrayLength; + // @public export function arrayRemove(...elements: unknown[]): FieldValue; +// @beta (undocumented) +export class ArrayReverse extends FirestoreFunction { + constructor(array: Constant); + } + // @public export function arrayUnion(...elements: unknown[]): FieldValue; +// @beta +export function ascending(expr: Constant): Ordering; + // @public export function average(field: string | FieldPath): AggregateField; +// @beta (undocumented) +export class Avg extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function avg(value: Constant): Avg; + +// @beta +export function avg(value: string): Avg; + +// @beta (undocumented) +export class ByteLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function byteLength(expr: Constant): ByteLength; + +// @beta +export function byteLength(field: string): ByteLength; + // @public export class Bytes { static fromBase64String(base64: string): Bytes; @@ -78,6 +247,17 @@ export class Bytes { // @public export const CACHE_SIZE_UNLIMITED = -1; +// @beta (undocumented) +export class CharLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function charLength(field: string): CharLength; + +// @beta +export function charLength(expr: Constant): CharLength; + // @public export type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; @@ -96,6 +276,13 @@ export function collection(refer // @public export function collectionGroup(firestore: Firestore, collectionId: string): Query; +// @beta (undocumented) +export class CollectionGroupSource implements Stage { + constructor(collectionId: string); + // (undocumented) + name: string; +} + // @public export class CollectionReference extends Query { get id(): string; @@ -106,14 +293,183 @@ export class CollectionReference; } +// @beta (undocumented) +export class CollectionSource implements Stage { + constructor(collectionPath: string); + // (undocumented) + name: string; +} + // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { mockUserToken?: EmulatorMockTokenOptions | string; }): void; +// @beta +export class Constant { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + static of(value: number): Constant; + static of(value: string): Constant; + static of(value: boolean): Constant; + static of(value: null): Constant; + static of(value: undefined): Constant; + static of(value: GeoPoint): Constant; + static of(value: Timestamp): Constant; + static of(value: Date): Constant; + static of(value: Uint8Array): Constant; + static of(value: DocumentReference): Constant; + static of(value: any[]): Constant; + static of(value: Map): Constant; + static of(value: VectorValue): Constant; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + static vector(value: number[] | VectorValue): Constant; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class CosineDistance extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function cosineDistance(expr: string, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: Constant): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: Constant): CosineDistance; + +// @beta (undocumented) +export class Count extends FirestoreFunction implements Accumulator { + constructor(value: Constant | undefined, distinct: boolean); + // (undocumented) + accumulator: true; + } + // @public export function count(): AggregateField; +// @beta +export function countAll(): Count; + +// @beta +export function countExpression(value: Constant): Count; + +// Warning: (ae-incompatible-release-tags) The symbol "countExpression" is marked as @public, but its signature references "Count" which is marked as @beta +// +// @public +export function countExpression(value: string): Count; + +// @beta (undocumented) +export class DatabaseSource implements Stage { + // (undocumented) + name: string; +} + // @public export function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; @@ -123,12 +479,39 @@ export function deleteDoc(refere // @public export function deleteField(): FieldValue; +// @beta +export function descending(expr: Constant): Ordering; + // @public export function disableNetwork(firestore: Firestore): Promise; // @public export function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; +// @beta (undocumented) +export class Distinct implements Stage { + constructor(groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Divide extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function divide(left: Constant, right: Constant): Divide; + +// @beta +export function divide(left: Constant, right: any): Divide; + +// @beta +export function divide(left: string, right: Constant): Divide; + +// @beta +export function divide(left: string, right: any): Divide; + // @public export function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; @@ -180,6 +563,38 @@ export class DocumentSnapshot; } +// @beta (undocumented) +export class DocumentsSource implements Stage { + constructor(docPaths: string[]); + // (undocumented) + name: string; + // (undocumented) + static of(refs: DocumentReference[]): DocumentsSource; +} + +// @beta (undocumented) +export class DotProduct extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function dotProduct(expr: string, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: string, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: string, other: Constant): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: Constant): DotProduct; + export { EmulatorMockTokenOptions } // @public @deprecated @@ -206,25 +621,462 @@ export function endBefore(snapsh // @public export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +// @beta (undocumented) +export class EndsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, suffix: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function endsWith(expr: string, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: string, suffix: Constant): EndsWith; + +// @beta +export function endsWith(expr: Constant, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: Constant, suffix: Constant): EndsWith; + +// @beta (undocumented) +export class Eq extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function eq(left: Constant, right: Constant): Eq; + +// @beta +export function eq(left: Constant, right: any): Eq; + +// @beta +export function eq(left: string, right: Constant): Eq; + +// @beta +export function eq(left: string, right: any): Eq; + +// @beta (undocumented) +export class EuclideanDistance extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: Constant): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; + +// @beta (undocumented) +export class Exists extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function exists(value: Constant): Exists; + +// @beta +export function exists(field: string): Exists; + // @public export interface ExperimentalLongPollingOptions { timeoutSeconds?: number; } +// @beta +export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; + +// @beta (undocumented) +export class ExprWithAlias implements Selectable { + constructor(expr: T, alias: string); + add(other: Constant): Add; + add(other: any): Add; + // (undocumented) + alias: string; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + expr: T; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export class Field implements Selectable { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldName(): string; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + static of(name: string): Field; + // (undocumented) + static of(path: FieldPath): Field; + // (undocumented) + static of(pipeline: Pipeline, name: string): Field; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + // @public export class FieldPath { constructor(...fieldNames: string[]); isEqual(other: FieldPath): boolean; } +// @beta (undocumented) +export class Fields implements Selectable { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldList(): Field[]; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + // (undocumented) + static of(name: string, ...others: string[]): Fields; + // (undocumented) + static ofAll(): Fields; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + // @public export abstract class FieldValue { abstract isEqual(other: FieldValue): boolean; } +// @beta +export interface FilterCondition { + // (undocumented) + filterable: true; +} + +// @beta +export type FilterExpr = Constant & FilterCondition; + +// @beta (undocumented) +export class FindNearest implements Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export interface FindNearestOptions { + // (undocumented) + distanceField?: string; + // (undocumented) + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + // (undocumented) + field: Field; + // (undocumented) + limit?: number; + // (undocumented) + vectorValue: VectorValue | number[]; +} + // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + // + // (undocumented) + pipeline: () => PipelineSource | undefined; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -246,6 +1098,108 @@ export class FirestoreError extends FirebaseError { // @public export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; +// @beta +export class FirestoreFunction { + constructor(name: string, params: Constant[]); + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + // @public export type FirestoreLocalCache = MemoryLocalCache | PersistentLocalCache; @@ -261,6 +1215,16 @@ export interface FirestoreSettings { ssl?: boolean; } +// @beta +export function genericFunction(name: string, params: Constant[]): FirestoreFunction; + +// @beta (undocumented) +export class GenericStage implements Stage { + constructor(name: string, params: any[]); + // (undocumented) + name: string; +} + // @public export class GeoPoint { constructor(latitude: number, longitude: number); @@ -314,6 +1278,73 @@ export function getFirestore(app: FirebaseApp, databaseId: string): Firestore; // @public export function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; +// @beta (undocumented) +export class Gt extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function gt(left: Constant, right: Constant): Gt; + +// @beta +export function gt(left: Constant, right: any): Gt; + +// @beta +export function gt(left: string, right: Constant): Gt; + +// @beta +export function gt(left: string, right: any): Gt; + +// @beta (undocumented) +export class Gte extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function gte(left: Constant, right: Constant): Gte; + +// @beta +export function gte(left: Constant, right: any): Gte; + +// @beta +export function gte(left: string, right: Constant): Gte; + +// @beta +export function gte(left: string, right: any): Gte; + +// @beta (undocumented) +export class If extends FirestoreFunction implements FilterCondition { + constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; + +// @beta (undocumented) +export class In extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, others: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function inAny(element: Constant, others: Constant[]): In; + +// @beta +export function inAny(element: Constant, others: any[]): In; + +// @beta +export function inAny(element: string, others: Constant[]): In; + +// @beta +export function inAny(element: string, others: any[]): In; + // @public export function increment(n: number): FieldValue; @@ -344,6 +1375,45 @@ export interface IndexField { // @public export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; +// @beta (undocumented) +export class IsNan extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function isNan(value: Constant): IsNan; + +// @beta +export function isNan(value: string): IsNan; + +// @beta (undocumented) +export class Like extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function like(left: string, pattern: string): Like; + +// @beta +export function like(left: string, pattern: Constant): Like; + +// @beta +export function like(left: Constant, pattern: string): Like; + +// @beta +export function like(left: Constant, pattern: Constant): Like; + +// @beta (undocumented) +export class Limit implements Stage { + constructor(limit: number); + // (undocumented) + name: string; +} + // @public export function limit(limit: number): QueryLimitConstraint; @@ -364,15 +1434,114 @@ export class LoadBundleTask implements PromiseLike { } // @public -export interface LoadBundleTaskProgress { - bytesLoaded: number; - documentsLoaded: number; - taskState: TaskState; - totalBytes: number; - totalDocuments: number; +export interface LoadBundleTaskProgress { + bytesLoaded: number; + documentsLoaded: number; + taskState: TaskState; + totalBytes: number; + totalDocuments: number; +} + +// @beta (undocumented) +export class LogicalMax extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function logicalMax(left: Constant, right: Constant): LogicalMax; + +// @beta +export function logicalMax(left: Constant, right: any): LogicalMax; + +// @beta +export function logicalMax(left: string, right: Constant): LogicalMax; + +// @beta +export function logicalMax(left: string, right: any): LogicalMax; + +// @beta (undocumented) +export class LogicalMin extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function logicalMin(left: Constant, right: Constant): LogicalMin; + +// @beta +export function logicalMin(left: Constant, right: any): LogicalMin; + +// @beta +export function logicalMin(left: string, right: Constant): LogicalMin; + +// @beta +export function logicalMin(left: string, right: any): LogicalMin; + +export { LogLevel } + +// @beta (undocumented) +export class Lt extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function lt(left: Constant, right: Constant): Lt; + +// @beta +export function lt(left: Constant, right: any): Lt; + +// @beta +export function lt(left: string, right: Constant): Lt; + +// @beta +export function lt(left: string, right: any): Lt; + +// @beta (undocumented) +export class Lte extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function lte(left: Constant, right: Constant): Lte; + +// @beta +export function lte(left: Constant, right: any): Lte; + +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta +// +// @public +export function lte(left: string, right: Constant): Lte; + +// @beta +export function lte(left: string, right: any): Lte; + +// @beta (undocumented) +export class MapGet extends FirestoreFunction { + constructor(map: Constant, name: string); } -export { LogLevel } +// @beta +export function mapGet(mapField: string, subField: string): MapGet; + +// @beta +export function mapGet(mapExpr: Constant, subField: string): MapGet; + +// @beta (undocumented) +export class Max extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function max(value: Constant): Max; + +// @beta +export function max(value: string): Max; // @public export interface MemoryCacheSettings { @@ -411,14 +1580,109 @@ export function memoryLruGarbageCollector(settings?: { cacheSizeBytes?: number; }): MemoryLruGarbageCollector; +// @beta (undocumented) +export class Min extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function min(value: Constant): Min; + +// @beta +export function min(value: string): Min; + +// @beta (undocumented) +export class Mod extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function mod(left: Constant, right: Constant): Mod; + +// @beta +export function mod(left: Constant, right: any): Mod; + +// @beta +export function mod(left: string, right: Constant): Mod; + +// @beta +export function mod(left: string, right: any): Mod; + +// @beta (undocumented) +export class Multiply extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function multiply(left: Constant, right: Constant): Multiply; + +// @beta +export function multiply(left: Constant, right: any): Multiply; + +// @beta +export function multiply(left: string, right: Constant): Multiply; + +// @beta +export function multiply(left: string, right: any): Multiply; + // @public export function namedQuery(firestore: Firestore, name: string): Promise; +// @beta (undocumented) +export class Neq extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function neq(left: Constant, right: Constant): Neq; + +// @beta +export function neq(left: Constant, right: any): Neq; + +// @beta +export function neq(left: string, right: Constant): Neq; + +// @beta +export function neq(left: string, right: any): Neq; + // @public export type NestedUpdateFields> = UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields; }[keyof T & string]>; +// @beta (undocumented) +export class Not extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function not(filter: FilterExpr): Not; + +// @beta +export function notInAny(element: Constant, others: Constant[]): Not; + +// @beta +export function notInAny(element: Constant, others: any[]): Not; + +// @beta +export function notInAny(element: string, others: Constant[]): Not; + +// @beta +export function notInAny(element: string, others: any[]): Not; + +// @beta (undocumented) +export class Offset implements Stage { + constructor(offset: number); + // (undocumented) + name: string; + } + // @public export function onSnapshot(reference: DocumentReference, observer: { next?: (snapshot: DocumentSnapshot) => void; @@ -469,6 +1733,13 @@ export function onSnapshotsInSync(firestore: Firestore, observer: { // @public export function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; +// @beta (undocumented) +export class Or extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; @@ -478,6 +1749,14 @@ export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDir // @public export type OrderByDirection = 'desc' | 'asc'; +// @beta +export class Ordering { + constructor(expr: Constant, direction: 'ascending' | 'descending'); + } + +// @beta +export function orExpression(left: FilterExpr, ...right: FilterExpr[]): Or; + // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; @@ -534,6 +1813,58 @@ export interface PersistentSingleTabManagerSettings { // @public export type PersistentTabManager = PersistentSingleTabManager | PersistentMultipleTabManager; +// @beta +export class Pipeline { + constructor(db: Firestore, stages: Stage[], converter?: unknown); + addFields(...fields: Selectable[]): Pipeline; + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate(options: { + accumulators: AccumulatorTarget[]; + groups?: Array; + }): Pipeline; + distinct(...groups: Array): Pipeline; + execute(): Promise>>; + // (undocumented) + findNearest(options: FindNearestOptions): Pipeline; + genericStage(name: string, params: any[]): Pipeline; + limit(limit: number): Pipeline; + offset(offset: number): Pipeline; + select(...selections: Array): Pipeline; + sort(...orderings: Ordering[]): Pipeline; + // (undocumented) + sort(options: { + orderings: Ordering[]; + }): Pipeline; + where(condition: FilterCondition & Constant): Pipeline; +} + +// @beta +export class PipelineResult { + /* Excluded from this release type: _ref */ + /* Excluded from this release type: _fields */ + /* Excluded from this release type: __constructor */ + get createTime(): Timestamp | undefined; + data(): AppModelType | undefined; + get executionTime(): Timestamp; + get(fieldPath: string | FieldPath): any; + get id(): string | undefined; + get ref(): DocumentReference | undefined; + get updateTime(): Timestamp | undefined; +} + +// @beta +export class PipelineSource { + constructor(db: Firestore); + // (undocumented) + collection(collectionPath: string): Pipeline; + // (undocumented) + collectionGroup(collectionId: string): Pipeline; + // (undocumented) + database(): Pipeline; + // (undocumented) + documents(docs: DocumentReference[]): Pipeline; +} + // @public export type Primitive = string | number | boolean | undefined | null; @@ -620,9 +1951,102 @@ export class QueryStartAtConstraint extends QueryConstraint { // @public export function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +// @beta (undocumented) +export class RegexContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function regexContains(left: string, pattern: string): RegexContains; + +// @beta +export function regexContains(left: string, pattern: Constant): RegexContains; + +// @beta +export function regexContains(left: Constant, pattern: string): RegexContains; + +// @beta +export function regexContains(left: Constant, pattern: Constant): RegexContains; + +// @beta (undocumented) +export class RegexMatch extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function regexMatch(left: string, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: string, pattern: Constant): RegexMatch; + +// @beta +export function regexMatch(left: Constant, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: Constant, pattern: Constant): RegexMatch; + +// @beta (undocumented) +export class ReplaceAll extends FirestoreFunction { + constructor(value: Constant, find: Constant, replace: Constant); + } + +// @beta +export function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; + +// @beta +export function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; + +// @beta +export function replaceAll(field: string, find: string, replace: string): ReplaceAll; + +// @beta (undocumented) +export class ReplaceFirst extends FirestoreFunction { + constructor(value: Constant, find: Constant, replace: Constant); + } + +// @beta +export function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; + +// @beta +export function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; + +// @beta +export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; + +// @beta (undocumented) +export class Reverse extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function reverse(expr: Constant): Reverse; + +// @beta +export function reverse(field: string): Reverse; + // @public export function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +// @beta (undocumented) +export class Select implements Stage { + constructor(projections: Map); + // (undocumented) + name: string; + } + +// @beta +export interface Selectable { + // (undocumented) + selectable: true; +} + +// @beta +export type SelectableExpr = Constant & Selectable; + // @public export function serverTimestamp(): FieldValue; @@ -669,6 +2093,19 @@ export interface SnapshotOptions { readonly serverTimestamps?: 'estimate' | 'previous' | 'none'; } +// @beta (undocumented) +export class Sort implements Stage { + constructor(orders: Ordering[]); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export interface Stage { + // (undocumented) + name: string; +} + // @public export function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; @@ -681,9 +2118,88 @@ export function startAt(snapshot // @public export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +// @beta (undocumented) +export class StartsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, prefix: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function startsWith(expr: string, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: string, prefix: Constant): StartsWith; + +// @beta +export function startsWith(expr: Constant, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: Constant, prefix: Constant): StartsWith; + +// @beta (undocumented) +export class StrConcat extends FirestoreFunction { + constructor(first: Constant, rest: Constant[]); + } + +// @beta +export function strConcat(first: string, ...elements: Array): StrConcat; + +// @beta +export function strConcat(first: Constant, ...elements: Array): StrConcat; + +// @beta (undocumented) +export class StrContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, substring: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function strContains(left: string, substring: string): StrContains; + +// @beta +export function strContains(left: string, substring: Constant): StrContains; + +// @beta +export function strContains(left: Constant, substring: string): StrContains; + +// @beta +export function strContains(left: Constant, substring: Constant): StrContains; + +// @beta (undocumented) +export class Subtract extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function subtract(left: Constant, right: Constant): Subtract; + +// @beta +export function subtract(left: Constant, right: any): Subtract; + +// @beta +export function subtract(left: string, right: Constant): Subtract; + +// @beta +export function subtract(left: string, right: any): Subtract; + +// @beta (undocumented) +export class Sum extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + // @public export function sum(field: string | FieldPath): AggregateField; +// @beta +export function sumExpression(value: Constant): Sum; + +// @beta +export function sumExpression(value: string): Sum; + // @public export type TaskState = 'Error' | 'Running' | 'Success'; @@ -711,6 +2227,89 @@ export class Timestamp { valueOf(): string; } +// @beta (undocumented) +export class TimestampAdd extends FirestoreFunction { + constructor(timestamp: Constant, unit: Constant, amount: Constant); + } + +// @beta +export function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; + +// @beta +export function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta +export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta (undocumented) +export class TimestampSub extends FirestoreFunction { + constructor(timestamp: Constant, unit: Constant, amount: Constant); + } + +// @beta +export function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; + +// @beta +export function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta +export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta (undocumented) +export class TimestampToUnixMicros extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; + +// @beta +export function timestampToUnixMicros(field: string): TimestampToUnixMicros; + +// @beta (undocumented) +export class TimestampToUnixMillis extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; + +// @beta +export function timestampToUnixMillis(field: string): TimestampToUnixMillis; + +// @beta (undocumented) +export class TimestampToUnixSeconds extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; + +// @beta +export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; + +// @beta (undocumented) +export class ToLower extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function toLower(expr: string): ToLower; + +// @beta +export function toLower(expr: Constant): ToLower; + +// @beta (undocumented) +export class ToUpper extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function toUpper(expr: string): ToUpper; + +// @beta +export function toUpper(expr: Constant): ToUpper; + // @public export class Transaction { delete(documentRef: DocumentReference): this; @@ -726,9 +2325,53 @@ export interface TransactionOptions { readonly maxAttempts?: number; } +// @beta (undocumented) +export class Trim extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function trim(expr: string): Trim; + +// @beta +export function trim(expr: Constant): Trim; + // @public export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +// @beta (undocumented) +export class UnixMicrosToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; + +// @beta +export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; + +// @beta (undocumented) +export class UnixMillisToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; + +// @beta +export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; + +// @beta (undocumented) +export class UnixSecondsToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; + +// @beta +export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; + // @public export interface Unsubscribe { (): void; @@ -748,6 +2391,17 @@ export function updateDoc(refere // @public export function vector(values?: number[]): VectorValue; +// @beta (undocumented) +export class VectorLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function vectorLength(expr: Constant): VectorLength; + +// @beta +export function vectorLength(field: string): VectorLength; + // @public export class VectorValue { /* Excluded from this release type: __constructor */ @@ -758,6 +2412,13 @@ export class VectorValue { // @public export function waitForPendingWrites(firestore: Firestore): Promise; +// @beta (undocumented) +export class Where implements Stage { + constructor(condition: FilterCondition & Constant); + // (undocumented) + name: string; +} + // @public export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; @@ -782,5 +2443,15 @@ export class WriteBatch { // @public export function writeBatch(firestore: Firestore): WriteBatch; +// @beta (undocumented) +export class Xor extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + +// @beta +export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; + ``` diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index ea969c6b94c..4d63f39c671 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -15,6 +15,172 @@ * limitations under the License. */ +export { PipelineSource } from './pipelines/api/pipeline-source'; + +export { PipelineResult } from './pipelines/api/pipeline-result'; + +export { Pipeline } from './pipelines/api/pipeline'; + +export { + Stage, + FindNearestOptions, + AddFields, + Aggregate, + Distinct, + CollectionSource, + CollectionGroupSource, + DatabaseSource, + DocumentsSource, + Where, + FindNearest, + Limit, + Offset, + Select, + Sort, + GenericStage +} from './pipelines/api/stage'; + +export { + add, + subtract, + multiply, + divide, + mod, + eq, + neq, + lt, + lte, + gt, + gte, + arrayConcat, + arrayContains, + arrayContainsAny, + arrayContainsAll, + arrayLength, + inAny, + notInAny, + and as andExpression, + or as orExpression, + xor, + ifFunction, + not, + logicalMax, + logicalMin, + exists, + isNan, + reverse, + replaceFirst, + replaceAll, + byteLength, + charLength, + like, + regexContains, + regexMatch, + strContains, + startsWith, + endsWith, + toLower, + toUpper, + trim, + strConcat, + mapGet, + countAll, + count as countExpression, + sum as sumExpression, + avg, + min, + max, + cosineDistance, + dotProduct, + euclideanDistance, + vectorLength, + unixMicrosToTimestamp, + timestampToUnixMicros, + unixMillisToTimestamp, + timestampToUnixMillis, + unixSecondsToTimestamp, + timestampToUnixSeconds, + timestampAdd, + timestampSub, + genericFunction, + ascending, + descending, + ExprWithAlias, + Field, + Fields, + Constant, + FirestoreFunction, + Add, + Subtract, + Multiply, + Divide, + Mod, + Eq, + Neq, + Lt, + Lte, + Gt, + Gte, + ArrayConcat, + ArrayReverse, + ArrayContains, + ArrayContainsAll, + ArrayContainsAny, + ArrayLength, + ArrayElement, + In, + IsNan, + Exists, + Not, + And, + Or, + Xor, + If, + LogicalMax, + LogicalMin, + Reverse, + ReplaceFirst, + ReplaceAll, + CharLength, + ByteLength, + Like, + RegexContains, + RegexMatch, + StrContains, + StartsWith, + EndsWith, + ToLower, + ToUpper, + Trim, + StrConcat, + MapGet, + Count, + Sum, + Avg, + Min, + Max, + CosineDistance, + DotProduct, + EuclideanDistance, + VectorLength, + UnixMicrosToTimestamp, + TimestampToUnixMicros, + UnixMillisToTimestamp, + TimestampToUnixMillis, + UnixSecondsToTimestamp, + TimestampToUnixSeconds, + TimestampAdd, + TimestampSub, + Ordering, + ExprType, + AccumulatorTarget, + FilterExpr, + SelectableExpr, + Selectable, + FilterCondition, + Accumulator +} from './pipelines/api/expressions'; + export { aggregateFieldEqual, aggregateQuerySnapshotEqual, diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 0757378a74c..664c853f4a7 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -64,6 +64,7 @@ import { Deferred } from '../util/promise'; import { LoadBundleTask } from './bundle'; import { CredentialsProvider } from './credentials'; import { FirestoreSettings, PersistenceSettings } from './settings'; +import type {PipelineSource} from "../pipelines/api/pipeline-source"; export { connectFirestoreEmulator, @@ -104,6 +105,10 @@ export class Firestore extends LiteFirestore { _online: OnlineComponentProviderFactory; }; + pipeline = function(): PipelineSource { + return new PipelineSource(this); + } + /** @hideconstructor */ constructor( authCredentialsProvider: CredentialsProvider, diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index 738348b016a..9b1e6c3521e 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -38,11 +38,17 @@ import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; import { FieldIndex } from '../model/field_index'; import { Mutation } from '../model/mutation'; +import { PipelineStreamElement } from '../model/pipeline_stream_element'; +import { Pipeline } from '../pipelines/api/pipeline'; import { toByteStreamReader } from '../platform/byte_stream_reader'; import { newSerializer } from '../platform/serializer'; import { newTextEncoder } from '../platform/text_serializer'; import { ApiClientObjectMap, Value } from '../protos/firestore_proto_api'; -import { Datastore, invokeRunAggregationQueryRpc } from '../remote/datastore'; +import { + Datastore, + invokeExecutePipeline, + invokeRunAggregationQueryRpc +} from '../remote/datastore'; import { RemoteStore, remoteStoreDisableNetwork, @@ -548,6 +554,23 @@ export function firestoreClientRunAggregateQuery( return deferred.promise; } +export function firestoreClientExecutePipeline( + client: FirestoreClient, + pipeline: Pipeline +): Promise { + const deferred = new Deferred(); + + client.asyncQueue.enqueueAndForget(async () => { + try { + const datastore = await getDatastore(client); + deferred.resolve(invokeExecutePipeline(datastore, pipeline)); + } catch (e) { + deferred.reject(e as Error); + } + }); + return deferred.promise; +} + export function firestoreClientWrite( client: FirestoreClient, mutations: Mutation[] diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index ebd4b49085f..8412c388faf 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -437,6 +437,68 @@ export function parseSetData( ); } +export function parse( + userDataReader: UserDataReader, + methodName: string, + targetDoc: DocumentKey, + input: unknown, + hasConverter: boolean, + options: SetOptions = {} +): ParsedSetData { + const context = userDataReader.createContext( + options.merge || options.mergeFields + ? UserDataSource.MergeSet + : UserDataSource.Set, + methodName, + targetDoc, + hasConverter + ); + validatePlainObject('Data must be an object, but it was:', context, input); + const updateData = parseObject(input, context)!; + + let fieldMask: FieldMask | null; + let fieldTransforms: FieldTransform[]; + + if (options.merge) { + fieldMask = new FieldMask(context.fieldMask); + fieldTransforms = context.fieldTransforms; + } else if (options.mergeFields) { + const validatedFieldPaths: InternalFieldPath[] = []; + + for (const stringOrFieldPath of options.mergeFields) { + const fieldPath = fieldPathFromArgument( + methodName, + stringOrFieldPath, + targetDoc + ); + if (!context.contains(fieldPath)) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + `Field '${fieldPath}' is specified in your field mask but missing from your input data.` + ); + } + + if (!fieldMaskContains(validatedFieldPaths, fieldPath)) { + validatedFieldPaths.push(fieldPath); + } + } + + fieldMask = new FieldMask(validatedFieldPaths); + fieldTransforms = context.fieldTransforms.filter(transform => + fieldMask!.covers(transform.field) + ); + } else { + fieldMask = null; + fieldTransforms = context.fieldTransforms; + } + + return new ParsedSetData( + new ObjectValue(updateData), + fieldMask, + fieldTransforms + ); +} + export class DeleteFieldValueImpl extends FieldValue { _toFieldTransform(context: ParseContextImpl): null { if (context.dataSource === UserDataSource.MergeSet) { @@ -852,7 +914,7 @@ function parseSentinelFieldValue( * * @returns The parsed value */ -function parseScalarValue( +export function parseScalarValue( value: unknown, context: ParseContextImpl ): ProtoValue | null { @@ -920,9 +982,10 @@ function parseScalarValue( * Creates a new VectorValue proto value (using the internal format). */ export function parseVectorValue( - value: VectorValue, + value: VectorValue | number[], context: ParseContextImpl -): ProtoValue { +): { mapValue: ProtoMapValue } { + const values = value instanceof VectorValue ? value.toArray() : value; const mapValue: ProtoMapValue = { fields: { [TYPE_KEY]: { @@ -930,7 +993,7 @@ export function parseVectorValue( }, [VECTOR_MAP_VECTORS_KEY]: { arrayValue: { - values: value.toArray().map(value => { + values: values.map(value => { if (typeof value !== 'number') { throw context.createError( 'VectorValues must only contain numeric values.' diff --git a/packages/firestore/src/model/pipeline_stream_element.ts b/packages/firestore/src/model/pipeline_stream_element.ts new file mode 100644 index 00000000000..9ec4c765993 --- /dev/null +++ b/packages/firestore/src/model/pipeline_stream_element.ts @@ -0,0 +1,13 @@ +import { SnapshotVersion } from '../core/snapshot_version'; + +import { DocumentKey } from './document_key'; +import { ObjectValue } from './object_value'; + +export interface PipelineStreamElement { + transaction?: string; + key?: DocumentKey; + executionTime?: SnapshotVersion; + createTime?: SnapshotVersion; + updateTime?: SnapshotVersion; + fields?: ObjectValue; +} diff --git a/packages/firestore/src/pipelines/api/expressions.ts b/packages/firestore/src/pipelines/api/expressions.ts new file mode 100644 index 00000000000..6dabce22987 --- /dev/null +++ b/packages/firestore/src/pipelines/api/expressions.ts @@ -0,0 +1,6720 @@ +// Copyright 2024 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. + +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +import { documentId, FieldPath } from '../../lite-api/field_path'; +import { GeoPoint } from '../../lite-api/geo_point'; +import { DocumentReference } from '../../lite-api/reference'; +import { Timestamp } from '../../lite-api/timestamp'; +import { + fieldPathFromArgument, + parseData, + UserDataReader, + UserDataSource +} from '../../lite-api/user_data_reader'; +import { VectorValue } from '../../lite-api/vector_value'; +import { + DOCUMENT_KEY_NAME, + FieldPath as InternalFieldPath +} from '../../model/path'; +import { Value as ProtoValue } from '../../protos/firestore_proto_api'; +import { + JsonProtoSerializer, + ProtoSerializable, + toStringValue, + UserData +} from '../../remote/serializer'; +import { hardAssert } from '../../util/assert'; + +import { Pipeline } from './pipeline'; + +/** + * @beta + * + * An interface that represents a selectable expression. + */ +export interface Selectable { + selectable: true; +} + +/** + * @beta + * + * An interface that represents a filter condition. + */ +export interface FilterCondition { + filterable: true; +} + +/** + * @beta + * + * An interface that represents an accumulator. + */ +export interface Accumulator { + accumulator: true; + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue; +} + +/** + * @beta + * + * An accumulator target, which is an expression with an alias that also implements the Accumulator interface. + */ +export type AccumulatorTarget = ExprWithAlias; + +/** + * @beta + * + * A filter expression, which is an expression that also implements the FilterCondition interface. + */ +export type FilterExpr = Expr & FilterCondition; + +/** + * @beta + * + * A selectable expression, which is an expression that also implements the Selectable interface. + */ +export type SelectableExpr = Expr & Selectable; + +/** + * @beta + * + * An enumeration of the different types of expressions. + */ +export type ExprType = + | 'Field' + | 'Constant' + | 'Function' + | 'ListOfExprs' + | 'ExprWithAlias'; + +/** + * @beta + * + * Represents an expression that can be evaluated to a value within the execution of a {@link + * Pipeline}. + * + * Expressions are the building blocks for creating complex queries and transformations in + * Firestore pipelines. They can represent: + * + * - **Field references:** Access values from document fields. + * - **Literals:** Represent constant values (strings, numbers, booleans). + * - **Function calls:** Apply functions to one or more expressions. + * - **Aggregations:** Calculate aggregate values (e.g., sum, average) over a set of documents. + * + * The `Expr` class provides a fluent API for building expressions. You can chain together + * method calls to create complex expressions. + */ +export abstract class Expr implements ProtoSerializable, UserData { + /** + * Creates an expression that adds this expression to another expression. + * + * ```typescript + * // Add the value of the 'quantity' field and the 'reserve' field. + * Field.of("quantity").add(Field.of("reserve")); + * ``` + * + * @param other The expression to add to this expression. + * @return A new `Expr` representing the addition operation. + */ + add(other: Expr): Add; + + /** + * Creates an expression that adds this expression to a constant value. + * + * ```typescript + * // Add 5 to the value of the 'age' field + * Field.of("age").add(5); + * ``` + * + * @param other The constant value to add. + * @return A new `Expr` representing the addition operation. + */ + add(other: any): Add; + add(other: any): Add { + if (other instanceof Expr) { + return new Add(this, other); + } + return new Add(this, Constant.of(other)); + } + + /** + * Creates an expression that subtracts another expression from this expression. + * + * ```typescript + * // Subtract the 'discount' field from the 'price' field + * Field.of("price").subtract(Field.of("discount")); + * ``` + * + * @param other The expression to subtract from this expression. + * @return A new `Expr` representing the subtraction operation. + */ + subtract(other: Expr): Subtract; + + /** + * Creates an expression that subtracts a constant value from this expression. + * + * ```typescript + * // Subtract 20 from the value of the 'total' field + * Field.of("total").subtract(20); + * ``` + * + * @param other The constant value to subtract. + * @return A new `Expr` representing the subtraction operation. + */ + subtract(other: any): Subtract; + subtract(other: any): Subtract { + if (other instanceof Expr) { + return new Subtract(this, other); + } + return new Subtract(this, Constant.of(other)); + } + + /** + * Creates an expression that multiplies this expression by another expression. + * + * ```typescript + * // Multiply the 'quantity' field by the 'price' field + * Field.of("quantity").multiply(Field.of("price")); + * ``` + * + * @param other The expression to multiply by. + * @return A new `Expr` representing the multiplication operation. + */ + multiply(other: Expr): Multiply; + + /** + * Creates an expression that multiplies this expression by a constant value. + * + * ```typescript + * // Multiply the 'value' field by 2 + * Field.of("value").multiply(2); + * ``` + * + * @param other The constant value to multiply by. + * @return A new `Expr` representing the multiplication operation. + */ + multiply(other: any): Multiply; + multiply(other: any): Multiply { + if (other instanceof Expr) { + return new Multiply(this, other); + } + return new Multiply(this, Constant.of(other)); + } + + /** + * Creates an expression that divides this expression by another expression. + * + * ```typescript + * // Divide the 'total' field by the 'count' field + * Field.of("total").divide(Field.of("count")); + * ``` + * + * @param other The expression to divide by. + * @return A new `Expr` representing the division operation. + */ + divide(other: Expr): Divide; + + /** + * Creates an expression that divides this expression by a constant value. + * + * ```typescript + * // Divide the 'value' field by 10 + * Field.of("value").divide(10); + * ``` + * + * @param other The constant value to divide by. + * @return A new `Expr` representing the division operation. + */ + divide(other: any): Divide; + divide(other: any): Divide { + if (other instanceof Expr) { + return new Divide(this, other); + } + return new Divide(this, Constant.of(other)); + } + + /** + * Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + * + * ```typescript + * // Calculate the remainder of dividing the 'value' field by the 'divisor' field + * Field.of("value").mod(Field.of("divisor")); + * ``` + * + * @param other The expression to divide by. + * @return A new `Expr` representing the modulo operation. + */ + mod(other: Expr): Mod; + + /** + * Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + * + * ```typescript + * // Calculate the remainder of dividing the 'value' field by 10 + * Field.of("value").mod(10); + * ``` + * + * @param other The constant value to divide by. + * @return A new `Expr` representing the modulo operation. + */ + mod(other: any): Mod; + mod(other: any): Mod { + if (other instanceof Expr) { + return new Mod(this, other); + } + return new Mod(this, Constant.of(other)); + } + + // /** + // * Creates an expression that applies a bitwise AND operation between this expression and another expression. + // * + // * ```typescript + // * // Calculate the bitwise AND of 'field1' and 'field2'. + // * Field.of("field1").bitAnd(Field.of("field2")); + // * ``` + // * + // * @param other The right operand expression. + // * @return A new {@code Expr} representing the bitwise AND operation. + // */ + // bitAnd(other: Expr): BitAnd; + // + // /** + // * Creates an expression that applies a bitwise AND operation between this expression and a constant value. + // * + // * ```typescript + // * // Calculate the bitwise AND of 'field1' and 0xFF. + // * Field.of("field1").bitAnd(0xFF); + // * ``` + // * + // * @param other The right operand constant. + // * @return A new {@code Expr} representing the bitwise AND operation. + // */ + // bitAnd(other: any): BitAnd; + // bitAnd(other: any): BitAnd { + // if (other instanceof Expr) { + // return new BitAnd(this, other); + // } + // return new BitAnd(this, Constant.of(other)); + // } + // + // /** + // * Creates an expression that applies a bitwise OR operation between this expression and another expression. + // * + // * ```typescript + // * // Calculate the bitwise OR of 'field1' and 'field2'. + // * Field.of("field1").bitOr(Field.of("field2")); + // * ``` + // * + // * @param other The right operand expression. + // * @return A new {@code Expr} representing the bitwise OR operation. + // */ + // bitOr(other: Expr): BitOr; + // + // /** + // * Creates an expression that applies a bitwise OR operation between this expression and a constant value. + // * + // * ```typescript + // * // Calculate the bitwise OR of 'field1' and 0xFF. + // * Field.of("field1").bitOr(0xFF); + // * ``` + // * + // * @param other The right operand constant. + // * @return A new {@code Expr} representing the bitwise OR operation. + // */ + // bitOr(other: any): BitOr; + // bitOr(other: any): BitOr { + // if (other instanceof Expr) { + // return new BitOr(this, other); + // } + // return new BitOr(this, Constant.of(other)); + // } + // + // /** + // * Creates an expression that applies a bitwise XOR operation between this expression and another expression. + // * + // * ```typescript + // * // Calculate the bitwise XOR of 'field1' and 'field2'. + // * Field.of("field1").bitXor(Field.of("field2")); + // * ``` + // * + // * @param other The right operand expression. + // * @return A new {@code Expr} representing the bitwise XOR operation. + // */ + // bitXor(other: Expr): BitXor; + // + // /** + // * Creates an expression that applies a bitwise XOR operation between this expression and a constant value. + // * + // * ```typescript + // * // Calculate the bitwise XOR of 'field1' and 0xFF. + // * Field.of("field1").bitXor(0xFF); + // * ``` + // * + // * @param other The right operand constant. + // * @return A new {@code Expr} representing the bitwise XOR operation. + // */ + // bitXor(other: any): BitXor; + // bitXor(other: any): BitXor { + // if (other instanceof Expr) { + // return new BitXor(this, other); + // } + // return new BitXor(this, Constant.of(other)); + // } + // + // /** + // * Creates an expression that applies a bitwise NOT operation to this expression. + // * + // * ```typescript + // * // Calculate the bitwise NOT of 'field1'. + // * Field.of("field1").bitNot(); + // * ``` + // * + // * @return A new {@code Expr} representing the bitwise NOT operation. + // */ + // bitNot(): BitNot { + // return new BitNot(this); + // } + // + // /** + // * Creates an expression that applies a bitwise left shift operation between this expression and another expression. + // * + // * ```typescript + // * // Calculate the bitwise left shift of 'field1' by 'field2' bits. + // * Field.of("field1").bitLeftShift(Field.of("field2")); + // * ``` + // * + // * @param other The right operand expression representing the number of bits to shift. + // * @return A new {@code Expr} representing the bitwise left shift operation. + // */ + // bitLeftShift(other: Expr): BitLeftShift; + // + // /** + // * Creates an expression that applies a bitwise left shift operation between this expression and a constant value. + // * + // * ```typescript + // * // Calculate the bitwise left shift of 'field1' by 2 bits. + // * Field.of("field1").bitLeftShift(2); + // * ``` + // * + // * @param other The right operand constant representing the number of bits to shift. + // * @return A new {@code Expr} representing the bitwise left shift operation. + // */ + // bitLeftShift(other: number): BitLeftShift; + // bitLeftShift(other: Expr | number): BitLeftShift { + // if (typeof other === 'number') { + // return new BitLeftShift(this, Constant.of(other)); + // } + // return new BitLeftShift(this, other as Expr); + // } + // + // /** + // * Creates an expression that applies a bitwise right shift operation between this expression and another expression. + // * + // * ```typescript + // * // Calculate the bitwise right shift of 'field1' by 'field2' bits. + // * Field.of("field1").bitRightShift(Field.of("field2")); + // * ``` + // * + // * @param other The right operand expression representing the number of bits to shift. + // * @return A new {@code Expr} representing the bitwise right shift operation. + // */ + // bitRightShift(other: Expr): BitRightShift; + // + // /** + // * Creates an expression that applies a bitwise right shift operation between this expression and a constant value. + // * + // * ```typescript + // * // Calculate the bitwise right shift of 'field1' by 2 bits. + // * Field.of("field1").bitRightShift(2); + // * ``` + // * + // * @param other The right operand constant representing the number of bits to shift. + // * @return A new {@code Expr} representing the bitwise right shift operation. + // */ + // bitRightShift(other: number): BitRightShift; + // bitRightShift(other: Expr | number): BitRightShift { + // if (typeof other === 'number') { + // return new BitRightShift(this, Constant.of(other)); + // } + // return new BitRightShift(this, other as Expr); + // } + + /** + * Creates an expression that checks if this expression is equal to another expression. + * + * ```typescript + * // Check if the 'age' field is equal to 21 + * Field.of("age").eq(21); + * ``` + * + * @param other The expression to compare for equality. + * @return A new `Expr` representing the equality comparison. + */ + eq(other: Expr): Eq; + + /** + * Creates an expression that checks if this expression is equal to a constant value. + * + * ```typescript + * // Check if the 'city' field is equal to "London" + * Field.of("city").eq("London"); + * ``` + * + * @param other The constant value to compare for equality. + * @return A new `Expr` representing the equality comparison. + */ + eq(other: any): Eq; + eq(other: any): Eq { + if (other instanceof Expr) { + return new Eq(this, other); + } + return new Eq(this, Constant.of(other)); + } + + /** + * Creates an expression that checks if this expression is not equal to another expression. + * + * ```typescript + * // Check if the 'status' field is not equal to "completed" + * Field.of("status").neq("completed"); + * ``` + * + * @param other The expression to compare for inequality. + * @return A new `Expr` representing the inequality comparison. + */ + neq(other: Expr): Neq; + + /** + * Creates an expression that checks if this expression is not equal to a constant value. + * + * ```typescript + * // Check if the 'country' field is not equal to "USA" + * Field.of("country").neq("USA"); + * ``` + * + * @param other The constant value to compare for inequality. + * @return A new `Expr` representing the inequality comparison. + */ + neq(other: any): Neq; + neq(other: any): Neq { + if (other instanceof Expr) { + return new Neq(this, other); + } + return new Neq(this, Constant.of(other)); + } + + /** + * Creates an expression that checks if this expression is less than another expression. + * + * ```typescript + * // Check if the 'age' field is less than 'limit' + * Field.of("age").lt(Field.of('limit')); + * ``` + * + * @param other The expression to compare for less than. + * @return A new `Expr` representing the less than comparison. + */ + lt(other: Expr): Lt; + + /** + * Creates an expression that checks if this expression is less than a constant value. + * + * ```typescript + * // Check if the 'price' field is less than 50 + * Field.of("price").lt(50); + * ``` + * + * @param other The constant value to compare for less than. + * @return A new `Expr` representing the less than comparison. + */ + lt(other: any): Lt; + lt(other: any): Lt { + if (other instanceof Expr) { + return new Lt(this, other); + } + return new Lt(this, Constant.of(other)); + } + + /** + * Creates an expression that checks if this expression is less than or equal to another + * expression. + * + * ```typescript + * // Check if the 'quantity' field is less than or equal to 20 + * Field.of("quantity").lte(Constant.of(20)); + * ``` + * + * @param other The expression to compare for less than or equal to. + * @return A new `Expr` representing the less than or equal to comparison. + */ + lte(other: Expr): Lte; + + /** + * Creates an expression that checks if this expression is less than or equal to a constant value. + * + * ```typescript + * // Check if the 'score' field is less than or equal to 70 + * Field.of("score").lte(70); + * ``` + * + * @param other The constant value to compare for less than or equal to. + * @return A new `Expr` representing the less than or equal to comparison. + */ + lte(other: any): Lte; + lte(other: any): Lte { + if (other instanceof Expr) { + return new Lte(this, other); + } + return new Lte(this, Constant.of(other)); + } + + /** + * Creates an expression that checks if this expression is greater than another expression. + * + * ```typescript + * // Check if the 'age' field is greater than the 'limit' field + * Field.of("age").gt(Field.of("limit")); + * ``` + * + * @param other The expression to compare for greater than. + * @return A new `Expr` representing the greater than comparison. + */ + gt(other: Expr): Gt; + + /** + * Creates an expression that checks if this expression is greater than a constant value. + * + * ```typescript + * // Check if the 'price' field is greater than 100 + * Field.of("price").gt(100); + * ``` + * + * @param other The constant value to compare for greater than. + * @return A new `Expr` representing the greater than comparison. + */ + gt(other: any): Gt; + gt(other: any): Gt { + if (other instanceof Expr) { + return new Gt(this, other); + } + return new Gt(this, Constant.of(other)); + } + + /** + * Creates an expression that checks if this expression is greater than or equal to another + * expression. + * + * ```typescript + * // Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 + * Field.of("quantity").gte(Field.of('requirement').add(1)); + * ``` + * + * @param other The expression to compare for greater than or equal to. + * @return A new `Expr` representing the greater than or equal to comparison. + */ + gte(other: Expr): Gte; + + /** + * Creates an expression that checks if this expression is greater than or equal to a constant + * value. + * + * ```typescript + * // Check if the 'score' field is greater than or equal to 80 + * Field.of("score").gte(80); + * ``` + * + * @param other The constant value to compare for greater than or equal to. + * @return A new `Expr` representing the greater than or equal to comparison. + */ + gte(other: any): Gte; + gte(other: any): Gte { + if (other instanceof Expr) { + return new Gte(this, other); + } + return new Gte(this, Constant.of(other)); + } + + /** + * Creates an expression that concatenates an array expression with one or more other arrays. + * + * ```typescript + * // Combine the 'items' array with another array field. + * Field.of("items").arrayConcat(Field.of("otherItems")); + * ``` + * + * @param arrays The array expressions to concatenate. + * @return A new `Expr` representing the concatenated array. + */ + arrayConcat(arrays: Expr[]): ArrayConcat; + + /** + * Creates an expression that concatenates an array expression with one or more other arrays. + * + * ```typescript + * // Combine the 'tags' array with a new array and an array field + * Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + * ``` + * + * @param arrays The array expressions or values to concatenate. + * @return A new `Expr` representing the concatenated array. + */ + arrayConcat(arrays: any[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat { + const exprValues = arrays.map(value => + value instanceof Expr ? value : Constant.of(value) + ); + return new ArrayConcat(this, exprValues); + } + + /** + * Creates an expression that checks if an array contains a specific element. + * + * ```typescript + * // Check if the 'sizes' array contains the value from the 'selectedSize' field + * Field.of("sizes").arrayContains(Field.of("selectedSize")); + * ``` + * + * @param element The element to search for in the array. + * @return A new `Expr` representing the 'array_contains' comparison. + */ + arrayContains(element: Expr): ArrayContains; + + /** + * Creates an expression that checks if an array contains a specific value. + * + * ```typescript + * // Check if the 'colors' array contains "red" + * Field.of("colors").arrayContains("red"); + * ``` + * + * @param element The element to search for in the array. + * @return A new `Expr` representing the 'array_contains' comparison. + */ + arrayContains(element: any): ArrayContains; + arrayContains(element: any): ArrayContains { + if (element instanceof Expr) { + return new ArrayContains(this, element); + } + return new ArrayContains(this, Constant.of(element)); + } + + /** + * Creates an expression that checks if an array contains all the specified elements. + * + * ```typescript + * // Check if the 'tags' array contains both "news" and "sports" + * Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + * ``` + * + * @param values The elements to check for in the array. + * @return A new `Expr` representing the 'array_contains_all' comparison. + */ + arrayContainsAll(...values: Expr[]): ArrayContainsAll; + + /** + * Creates an expression that checks if an array contains all the specified elements. + * + * ```typescript + * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" + * Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + * ``` + * + * @param values The elements to check for in the array. + * @return A new `Expr` representing the 'array_contains_all' comparison. + */ + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll { + const exprValues = values.map(value => + value instanceof Expr ? value : Constant.of(value) + ); + return new ArrayContainsAll(this, exprValues); + } + + /** + * Creates an expression that checks if an array contains any of the specified elements. + * + * ```typescript + * // Check if the 'categories' array contains either values from field "cate1" or "cate2" + * Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + * ``` + * + * @param values The elements to check for in the array. + * @return A new `Expr` representing the 'array_contains_any' comparison. + */ + arrayContainsAny(...values: Expr[]): ArrayContainsAny; + + /** + * Creates an expression that checks if an array contains any of the specified elements. + * + * ```typescript + * // Check if the 'groups' array contains either the value from the 'userGroup' field + * // or the value "guest" + * Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + * ``` + * + * @param values The elements to check for in the array. + * @return A new `Expr` representing the 'array_contains_any' comparison. + */ + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny { + const exprValues = values.map(value => + value instanceof Expr ? value : Constant.of(value) + ); + return new ArrayContainsAny(this, exprValues); + } + + /** + * Creates an expression that calculates the length of an array. + * + * ```typescript + * // Get the number of items in the 'cart' array + * Field.of("cart").arrayLength(); + * ``` + * + * @return A new `Expr` representing the length of the array. + */ + arrayLength(): ArrayLength { + return new ArrayLength(this); + } + + /** + * Creates an expression that checks if this expression is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * Field.of("category").in("Electronics", Field.of("primaryType")); + * ``` + * + * @param others The values or expressions to check against. + * @return A new `Expr` representing the 'IN' comparison. + */ + in(...others: Expr[]): In; + + /** + * Creates an expression that checks if this expression is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * Field.of("category").in("Electronics", Field.of("primaryType")); + * ``` + * + * @param others The values or expressions to check against. + * @return A new `Expr` representing the 'IN' comparison. + */ + in(...others: any[]): In; + in(...others: any[]): In { + const exprOthers = others.map(other => + other instanceof Expr ? other : Constant.of(other) + ); + return new In(this, exprOthers); + } + + /** + * Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NaN + * Field.of("value").divide(0).isNaN(); + * ``` + * + * @return A new `Expr` representing the 'isNaN' check. + */ + isNaN(): IsNan { + return new IsNan(this); + } + + /** + * Creates an expression that checks if a field exists in the document. + * + * ```typescript + * // Check if the document has a field named "phoneNumber" + * Field.of("phoneNumber").exists(); + * ``` + * + * @return A new `Expr` representing the 'exists' check. + */ + exists(): Exists { + return new Exists(this); + } + + /** + * Creates an expression that calculates the character length of a string in UTF-8. + * + * ```typescript + * // Get the character length of the 'name' field in its UTF-8 form. + * Field.of("name").charLength(); + * ``` + * + * @return A new `Expr` representing the length of the string. + */ + charLength(): CharLength { + return new CharLength(this); + } + + /** + * Creates an expression that performs a case-sensitive string comparison. + * + * ```typescript + * // Check if the 'title' field contains the word "guide" (case-sensitive) + * Field.of("title").like("%guide%"); + * ``` + * + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new `Expr` representing the 'like' comparison. + */ + like(pattern: string): Like; + + /** + * Creates an expression that performs a case-sensitive string comparison. + * + * ```typescript + * // Check if the 'title' field contains the word "guide" (case-sensitive) + * Field.of("title").like("%guide%"); + * ``` + * + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new `Expr` representing the 'like' comparison. + */ + like(pattern: Expr): Like; + like(stringOrExpr: string | Expr): Like { + if (typeof stringOrExpr === 'string') { + return new Like(this, Constant.of(stringOrExpr)); + } + return new Like(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that checks if a string contains a specified regular expression as a + * substring. + * + * ```typescript + * // Check if the 'description' field contains "example" (case-insensitive) + * Field.of("description").regexContains("(?i)example"); + * ``` + * + * @param pattern The regular expression to use for the search. + * @return A new `Expr` representing the 'contains' comparison. + */ + regexContains(pattern: string): RegexContains; + + /** + * Creates an expression that checks if a string contains a specified regular expression as a + * substring. + * + * ```typescript + * // Check if the 'description' field contains the regular expression stored in field 'regex' + * Field.of("description").regexContains(Field.of("regex")); + * ``` + * + * @param pattern The regular expression to use for the search. + * @return A new `Expr` representing the 'contains' comparison. + */ + regexContains(pattern: Expr): RegexContains; + regexContains(stringOrExpr: string | Expr): RegexContains { + if (typeof stringOrExpr === 'string') { + return new RegexContains(this, Constant.of(stringOrExpr)); + } + return new RegexContains(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that checks if a string matches a specified regular expression. + * + * ```typescript + * // Check if the 'email' field matches a valid email pattern + * Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + * ``` + * + * @param pattern The regular expression to use for the match. + * @return A new `Expr` representing the regular expression match. + */ + regexMatch(pattern: string): RegexMatch; + + /** + * Creates an expression that checks if a string matches a specified regular expression. + * + * ```typescript + * // Check if the 'email' field matches a regular expression stored in field 'regex' + * Field.of("email").regexMatch(Field.of("regex")); + * ``` + * + * @param pattern The regular expression to use for the match. + * @return A new `Expr` representing the regular expression match. + */ + regexMatch(pattern: Expr): RegexMatch; + regexMatch(stringOrExpr: string | Expr): RegexMatch { + if (typeof stringOrExpr === 'string') { + return new RegexMatch(this, Constant.of(stringOrExpr)); + } + return new RegexMatch(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that checks if a string contains a specified substring. + * + * ```typescript + * // Check if the 'description' field contains "example". + * Field.of("description").strContains("example"); + * ``` + * + * @param substring The substring to search for. + * @return A new `Expr` representing the 'contains' comparison. + */ + strContains(substring: string): StrContains; + + /** + * Creates an expression that checks if a string contains the string represented by another expression. + * + * ```typescript + * // Check if the 'description' field contains the value of the 'keyword' field. + * Field.of("description").strContains(Field.of("keyword")); + * ``` + * + * @param expr The expression representing the substring to search for. + * @return A new `Expr` representing the 'contains' comparison. + */ + strContains(expr: Expr): StrContains; + strContains(stringOrExpr: string | Expr): StrContains { + if (typeof stringOrExpr === 'string') { + return new StrContains(this, Constant.of(stringOrExpr)); + } + return new StrContains(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that checks if a string starts with a given prefix. + * + * ```typescript + * // Check if the 'name' field starts with "Mr." + * Field.of("name").startsWith("Mr."); + * ``` + * + * @param prefix The prefix to check for. + * @return A new `Expr` representing the 'starts with' comparison. + */ + startsWith(prefix: string): StartsWith; + + /** + * Creates an expression that checks if a string starts with a given prefix (represented as an + * expression). + * + * ```typescript + * // Check if the 'fullName' field starts with the value of the 'firstName' field + * Field.of("fullName").startsWith(Field.of("firstName")); + * ``` + * + * @param prefix The prefix expression to check for. + * @return A new `Expr` representing the 'starts with' comparison. + */ + startsWith(prefix: Expr): StartsWith; + startsWith(stringOrExpr: string | Expr): StartsWith { + if (typeof stringOrExpr === 'string') { + return new StartsWith(this, Constant.of(stringOrExpr)); + } + return new StartsWith(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that checks if a string ends with a given postfix. + * + * ```typescript + * // Check if the 'filename' field ends with ".txt" + * Field.of("filename").endsWith(".txt"); + * ``` + * + * @param suffix The postfix to check for. + * @return A new `Expr` representing the 'ends with' comparison. + */ + endsWith(suffix: string): EndsWith; + + /** + * Creates an expression that checks if a string ends with a given postfix (represented as an + * expression). + * + * ```typescript + * // Check if the 'url' field ends with the value of the 'extension' field + * Field.of("url").endsWith(Field.of("extension")); + * ``` + * + * @param suffix The postfix expression to check for. + * @return A new `Expr` representing the 'ends with' comparison. + */ + endsWith(suffix: Expr): EndsWith; + endsWith(stringOrExpr: string | Expr): EndsWith { + if (typeof stringOrExpr === 'string') { + return new EndsWith(this, Constant.of(stringOrExpr)); + } + return new EndsWith(this, stringOrExpr as Expr); + } + + /** + * Creates an expression that converts a string to lowercase. + * + * ```typescript + * // Convert the 'name' field to lowercase + * Field.of("name").toLower(); + * ``` + * + * @return A new `Expr` representing the lowercase string. + */ + toLower(): ToLower { + return new ToLower(this); + } + + /** + * Creates an expression that converts a string to uppercase. + * + * ```typescript + * // Convert the 'title' field to uppercase + * Field.of("title").toUpper(); + * ``` + * + * @return A new `Expr` representing the uppercase string. + */ + toUpper(): ToUpper { + return new ToUpper(this); + } + + /** + * Creates an expression that removes leading and trailing whitespace from a string. + * + * ```typescript + * // Trim whitespace from the 'userInput' field + * Field.of("userInput").trim(); + * ``` + * + * @return A new `Expr` representing the trimmed string. + */ + trim(): Trim { + return new Trim(this); + } + + /** + * Creates an expression that concatenates string expressions together. + * + * ```typescript + * // Combine the 'firstName', " ", and 'lastName' fields into a single string + * Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + * ``` + * + * @param elements The expressions (typically strings) to concatenate. + * @return A new `Expr` representing the concatenated string. + */ + strConcat(...elements: Array): StrConcat { + const exprs = elements.map(e => + typeof e === 'string' ? Constant.of(e) : (e as Expr) + ); + return new StrConcat(this, exprs); + } + + /** + * Creates an expression that reverses this string expression. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * Field.of("myString").reverse(); + * ``` + * + * @return A new {@code Expr} representing the reversed string. + */ + reverse(): Reverse { + return new Reverse(this); + } + + /** + * Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + * + * ```typescript + * // Replace the first occurrence of "hello" with "hi" in the 'message' field + * Field.of("message").replaceFirst("hello", "hi"); + * ``` + * + * @param find The substring to search for. + * @param replace The substring to replace the first occurrence of 'find' with. + * @return A new {@code Expr} representing the string with the first occurrence replaced. + */ + replaceFirst(find: string, replace: string): ReplaceFirst; + + /** + * Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, + * where the substring to find and the replacement substring are specified by expressions. + * + * ```typescript + * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field + * Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + * ``` + * + * @param find The expression representing the substring to search for. + * @param replace The expression representing the substring to replace the first occurrence of 'find' with. + * @return A new {@code Expr} representing the string with the first occurrence replaced. + */ + replaceFirst(find: Expr, replace: Expr): ReplaceFirst; + replaceFirst(find: Expr | string, replace: Expr | string): ReplaceFirst { + const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; + const normalizedReplace = + typeof replace === 'string' ? Constant.of(replace) : replace; + return new ReplaceFirst( + this, + normalizedFind as Expr, + normalizedReplace as Expr + ); + } + + /** + * Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + * + * ```typescript + * // Replace all occurrences of "hello" with "hi" in the 'message' field + * Field.of("message").replaceAll("hello", "hi"); + * ``` + * + * @param find The substring to search for. + * @param replace The substring to replace all occurrences of 'find' with. + * @return A new {@code Expr} representing the string with all occurrences replaced. + */ + replaceAll(find: string, replace: string): ReplaceAll; + + /** + * Creates an expression that replaces all occurrences of a substring within this string expression with another substring, + * where the substring to find and the replacement substring are specified by expressions. + * + * ```typescript + * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field + * Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + * ``` + * + * @param find The expression representing the substring to search for. + * @param replace The expression representing the substring to replace all occurrences of 'find' with. + * @return A new {@code Expr} representing the string with all occurrences replaced. + */ + replaceAll(find: Expr, replace: Expr): ReplaceAll; + replaceAll(find: Expr | string, replace: Expr | string): ReplaceAll { + const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; + const normalizedReplace = + typeof replace === 'string' ? Constant.of(replace) : replace; + return new ReplaceAll( + this, + normalizedFind as Expr, + normalizedReplace as Expr + ); + } + + /** + * Creates an expression that calculates the length of this string expression in bytes. + * + * ```typescript + * // Calculate the length of the 'myString' field in bytes. + * Field.of("myString").byteLength(); + * ``` + * + * @return A new {@code Expr} representing the length of the string in bytes. + */ + byteLength(): ByteLength { + return new ByteLength(this); + } + + /** + * Accesses a value from a map (object) field using the provided key. + * + * ```typescript + * // Get the 'city' value from the 'address' map field + * Field.of("address").mapGet("city"); + * ``` + * + * @param subfield The key to access in the map. + * @return A new `Expr` representing the value associated with the given key in the map. + */ + mapGet(subfield: string): MapGet { + return new MapGet(this, subfield); + } + + /** + * Creates an aggregation that counts the number of stage inputs with valid evaluations of the + * expression or field. + * + * ```typescript + * // Count the total number of products + * Field.of("productId").count().as("totalProducts"); + * ``` + * + * @return A new `Accumulator` representing the 'count' aggregation. + */ + count(): Count { + return new Count(this, false); + } + + /** + * Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + * + * ```typescript + * // Calculate the total revenue from a set of orders + * Field.of("orderAmount").sum().as("totalRevenue"); + * ``` + * + * @return A new `Accumulator` representing the 'sum' aggregation. + */ + sum(): Sum { + return new Sum(this, false); + } + + /** + * Creates an aggregation that calculates the average (mean) of a numeric field across multiple + * stage inputs. + * + * ```typescript + * // Calculate the average age of users + * Field.of("age").avg().as("averageAge"); + * ``` + * + * @return A new `Accumulator` representing the 'avg' aggregation. + */ + avg(): Avg { + return new Avg(this, false); + } + + /** + * Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + * + * ```typescript + * // Find the lowest price of all products + * Field.of("price").min().as("lowestPrice"); + * ``` + * + * @return A new `Accumulator` representing the 'min' aggregation. + */ + min(): Min { + return new Min(this, false); + } + + /** + * Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + * + * ```typescript + * // Find the highest score in a leaderboard + * Field.of("score").max().as("highestScore"); + * ``` + * + * @return A new `Accumulator` representing the 'max' aggregation. + */ + max(): Max { + return new Max(this, false); + } + + /** + * Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'timestamp' field and the current timestamp. + * Field.of("timestamp").logicalMax(Function.currentTimestamp()); + * ``` + * + * @param other The expression to compare with. + * @return A new {@code Expr} representing the logical max operation. + */ + logicalMax(other: Expr): LogicalMax; + + /** + * Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'value' field and 10. + * Field.of("value").logicalMax(10); + * ``` + * + * @param other The constant value to compare with. + * @return A new {@code Expr} representing the logical max operation. + */ + logicalMax(other: any): LogicalMax; + logicalMax(other: any): LogicalMax { + if (other instanceof Expr) { + return new LogicalMax(this, other as Expr); + } + return new LogicalMax(this, Constant.of(other)); + } + + /** + * Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'timestamp' field and the current timestamp. + * Field.of("timestamp").logicalMin(Function.currentTimestamp()); + * ``` + * + * @param other The expression to compare with. + * @return A new {@code Expr} representing the logical min operation. + */ + logicalMin(other: Expr): LogicalMin; + + /** + * Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'value' field and 10. + * Field.of("value").logicalMin(10); + * ``` + * + * @param other The constant value to compare with. + * @return A new {@code Expr} representing the logical min operation. + */ + logicalMin(other: any): LogicalMin; + logicalMin(other: any): LogicalMin { + if (other instanceof Expr) { + return new LogicalMin(this, other as Expr); + } + return new LogicalMin(this, Constant.of(other)); + } + + /** + * Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + * + * ```typescript + * // Get the vector length (dimension) of the field 'embedding'. + * Field.of("embedding").vectorLength(); + * ``` + * + * @return A new {@code Expr} representing the length of the vector. + */ + vectorLength(): VectorLength { + return new VectorLength(this); + } + + /** + * Calculates the cosine distance between two vectors. + * + * ```typescript + * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field + * Field.of("userVector").cosineDistance(Field.of("itemVector")); + * ``` + * + * @param other The other vector (represented as an Expr) to compare against. + * @return A new `Expr` representing the cosine distance between the two vectors. + */ + cosineDistance(other: Expr): CosineDistance; + /** + * Calculates the Cosine distance between two vectors. + * + * ```typescript + * // Calculate the Cosine distance between the 'location' field and a target location + * Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param other The other vector (as a VectorValue) to compare against. + * @return A new `Expr` representing the Cosine* distance between the two vectors. + */ + cosineDistance(other: VectorValue): CosineDistance; + /** + * Calculates the Cosine distance between two vectors. + * + * ```typescript + * // Calculate the Cosine distance between the 'location' field and a target location + * Field.of("location").cosineDistance([37.7749, -122.4194]); + * ``` + * + * @param other The other vector (as an array of numbers) to compare against. + * @return A new `Expr` representing the Cosine distance between the two vectors. + */ + cosineDistance(other: number[]): CosineDistance; + cosineDistance(other: Expr | VectorValue | number[]): CosineDistance { + if (other instanceof Expr) { + return new CosineDistance(this, other as Expr); + } else { + return new CosineDistance( + this, + Constant.vector(other as VectorValue | number[]) + ); + } + } + + /** + * Calculates the dot product between two vectors. + * + * ```typescript + * // Calculate the dot product between a feature vector and a target vector + * Field.of("features").dotProduct([0.5, 0.8, 0.2]); + * ``` + * + * @param other The other vector (as an array of numbers) to calculate with. + * @return A new `Expr` representing the dot product between the two vectors. + */ + dotProduct(other: Expr): DotProduct; + + /** + * Calculates the dot product between two vectors. + * + * ```typescript + * // Calculate the dot product between a feature vector and a target vector + * Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + * ``` + * + * @param other The other vector (as an array of numbers) to calculate with. + * @return A new `Expr` representing the dot product between the two vectors. + */ + dotProduct(other: VectorValue): DotProduct; + + /** + * Calculates the dot product between two vectors. + * + * ```typescript + * // Calculate the dot product between a feature vector and a target vector + * Field.of("features").dotProduct([0.5, 0.8, 0.2]); + * ``` + * + * @param other The other vector (as an array of numbers) to calculate with. + * @return A new `Expr` representing the dot product between the two vectors. + */ + dotProduct(other: number[]): DotProduct; + dotProduct(other: Expr | VectorValue | number[]): DotProduct { + if (other instanceof Expr) { + return new DotProduct(this, other as Expr); + } else { + return new DotProduct( + this, + Constant.vector(other as VectorValue | number[]) + ); + } + } + + /** + * Calculates the Euclidean distance between two vectors. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * Field.of("location").euclideanDistance([37.7749, -122.4194]); + * ``` + * + * @param other The other vector (as an array of numbers) to calculate with. + * @return A new `Expr` representing the Euclidean distance between the two vectors. + */ + euclideanDistance(other: Expr): EuclideanDistance; + + /** + * Calculates the Euclidean distance between two vectors. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param other The other vector (as a VectorValue) to compare against. + * @return A new `Expr` representing the Euclidean distance between the two vectors. + */ + euclideanDistance(other: VectorValue): EuclideanDistance; + + /** + * Calculates the Euclidean distance between two vectors. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * Field.of("location").euclideanDistance([37.7749, -122.4194]); + * ``` + * + * @param other The other vector (as an array of numbers) to compare against. + * @return A new `Expr` representing the Euclidean distance between the two vectors. + */ + euclideanDistance(other: number[]): EuclideanDistance; + euclideanDistance(other: Expr | VectorValue | number[]): EuclideanDistance { + if (other instanceof Expr) { + return new EuclideanDistance(this, other as Expr); + } else { + return new EuclideanDistance( + this, + Constant.vector(other as VectorValue | number[]) + ); + } + } + + /** + * Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'microseconds' field as microseconds since epoch. + * Field.of("microseconds").unixMicrosToTimestamp(); + * ``` + * + * @return A new {@code Expr} representing the timestamp. + */ + unixMicrosToTimestamp(): UnixMicrosToTimestamp { + return new UnixMicrosToTimestamp(this); + } + + /** + * Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to microseconds since epoch. + * Field.of("timestamp").timestampToUnixMicros(); + * ``` + * + * @return A new {@code Expr} representing the number of microseconds since epoch. + */ + timestampToUnixMicros(): TimestampToUnixMicros { + return new TimestampToUnixMicros(this); + } + + /** + * Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'milliseconds' field as milliseconds since epoch. + * Field.of("milliseconds").unixMillisToTimestamp(); + * ``` + * + * @return A new {@code Expr} representing the timestamp. + */ + unixMillisToTimestamp(): UnixMillisToTimestamp { + return new UnixMillisToTimestamp(this); + } + + /** + * Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to milliseconds since epoch. + * Field.of("timestamp").timestampToUnixMillis(); + * ``` + * + * @return A new {@code Expr} representing the number of milliseconds since epoch. + */ + timestampToUnixMillis(): TimestampToUnixMillis { + return new TimestampToUnixMillis(this); + } + + /** + * Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'seconds' field as seconds since epoch. + * Field.of("seconds").unixSecondsToTimestamp(); + * ``` + * + * @return A new {@code Expr} representing the timestamp. + */ + unixSecondsToTimestamp(): UnixSecondsToTimestamp { + return new UnixSecondsToTimestamp(this); + } + + /** + * Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to seconds since epoch. + * Field.of("timestamp").timestampToUnixSeconds(); + * ``` + * + * @return A new {@code Expr} representing the number of seconds since epoch. + */ + timestampToUnixSeconds(): TimestampToUnixSeconds { + return new TimestampToUnixSeconds(this); + } + + /** + * Creates an expression that adds a specified amount of time to this timestamp expression. + * + * ```typescript + * // Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. + * Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + * ``` + * + * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. + * @param amount The expression evaluates to amount of the unit. + * @return A new {@code Expr} representing the resulting timestamp. + */ + timestampAdd(unit: Expr, amount: Expr): TimestampAdd; + + /** + * Creates an expression that adds a specified amount of time to this timestamp expression. + * + * ```typescript + * // Add 1 day to the 'timestamp' field. + * Field.of("timestamp").timestampAdd("day", 1); + * ``` + * + * @param unit The unit of time to add (e.g., "day", "hour"). + * @param amount The amount of time to add. + * @return A new {@code Expr} representing the resulting timestamp. + */ + timestampAdd( + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number + ): TimestampAdd; + timestampAdd( + unit: + | Expr + | 'microsecond' + | 'millisecond' + | 'second' + | 'minute' + | 'hour' + | 'day', + amount: Expr | number + ): TimestampAdd { + const normalizedUnit = typeof unit === 'string' ? Constant.of(unit) : unit; + const normalizedAmount = + typeof amount === 'number' ? Constant.of(amount) : amount; + return new TimestampAdd( + this, + normalizedUnit as Expr, + normalizedAmount as Expr + ); + } + + /** + * Creates an expression that subtracts a specified amount of time from this timestamp expression. + * + * ```typescript + * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. + * Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + * ``` + * + * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. + * @param amount The expression evaluates to amount of the unit. + * @return A new {@code Expr} representing the resulting timestamp. + */ + timestampSub(unit: Expr, amount: Expr): TimestampSub; + + /** + * Creates an expression that subtracts a specified amount of time from this timestamp expression. + * + * ```typescript + * // Subtract 1 day from the 'timestamp' field. + * Field.of("timestamp").timestampSub("day", 1); + * ``` + * + * @param unit The unit of time to subtract (e.g., "day", "hour"). + * @param amount The amount of time to subtract. + * @return A new {@code Expr} representing the resulting timestamp. + */ + timestampSub( + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number + ): TimestampSub; + timestampSub( + unit: + | Expr + | 'microsecond' + | 'millisecond' + | 'second' + | 'minute' + | 'hour' + | 'day', + amount: Expr | number + ): TimestampSub { + const normalizedUnit = typeof unit === 'string' ? Constant.of(unit) : unit; + const normalizedAmount = + typeof amount === 'number' ? Constant.of(amount) : amount; + return new TimestampSub( + this, + normalizedUnit as Expr, + normalizedAmount as Expr + ); + } + + /** + * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * + * ```typescript + * // Sort documents by the 'name' field in ascending order + * pipeline().collection("users") + * .sort(Field.of("name").ascending()); + * ``` + * + * @return A new `Ordering` for ascending sorting. + */ + ascending(): Ordering { + return ascending(this); + } + + /** + * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * + * ```typescript + * // Sort documents by the 'createdAt' field in descending order + * firestore.pipeline().collection("users") + * .sort(Field.of("createdAt").descending()); + * ``` + * + * @return A new `Ordering` for descending sorting. + */ + descending(): Ordering { + return descending(this); + } + + /** + * Assigns an alias to this expression. + * + * Aliases are useful for renaming fields in the output of a stage or for giving meaningful + * names to calculated values. + * + * ```typescript + * // Calculate the total price and assign it the alias "totalPrice" and add it to the output. + * firestore.pipeline().collection("items") + * .addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + * ``` + * + * @param name The alias to assign to this expression. + * @return A new {@link ExprWithAlias} that wraps this + * expression and associates it with the provided alias. + */ + as(name: string): ExprWithAlias { + return new ExprWithAlias(this, name); + } + + /** + * @private + * @internal + */ + abstract _toProto(serializer: JsonProtoSerializer): ProtoValue; + + /** + * @private + * @internal + */ + abstract _readUserData(dataReader: UserDataReader): void; +} + +/** + * @beta + */ +export class ExprWithAlias extends Expr implements Selectable { + exprType: ExprType = 'ExprWithAlias'; + selectable = true as const; + + constructor(public expr: T, public alias: string) { + super(); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + throw new Error('ExprWithAlias should not be serialized directly.'); + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + this.expr._readUserData(dataReader); + } +} + +/** + * @internal + */ +class ListOfExprs extends Expr { + exprType: ExprType = 'ListOfExprs'; + constructor(private exprs: Expr[]) { + super(); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + arrayValue: { + values: this.exprs.map(p => p._toProto(serializer)!) + } + }; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + this.exprs.forEach((expr: Expr) => expr._readUserData(dataReader)); + } +} + +/** + * @beta + * + * Represents a reference to a field in a Firestore document, or outputs of a {@link Pipeline} stage. + * + *

Field references are used to access document field values in expressions and to specify fields + * for sorting, filtering, and projecting data in Firestore pipelines. + * + *

You can create a `Field` instance using the static {@link #of} method: + * + * ```typescript + * // Create a Field instance for the 'name' field + * const nameField = Field.of("name"); + * + * // Create a Field instance for a nested field 'address.city' + * const cityField = Field.of("address.city"); + * ``` + */ +export class Field extends Expr implements Selectable { + exprType: ExprType = 'Field'; + selectable = true as const; + + private constructor( + private fieldPath: InternalFieldPath, + private pipeline: Pipeline | null = null + ) { + super(); + } + + /** + * Creates a {@code Field} instance representing the field at the given path. + * + * The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field + * (e.g., "address.city"). + * + * ```typescript + * // Create a Field instance for the 'title' field + * const titleField = Field.of("title"); + * + * // Create a Field instance for a nested field 'author.firstName' + * const authorFirstNameField = Field.of("author.firstName"); + * ``` + * + * @param name The path to the field. + * @return A new {@code Field} instance representing the specified field. + */ + static of(name: string): Field; + static of(path: FieldPath): Field; + static of(pipeline: Pipeline, name: string): Field; + static of( + pipelineOrName: Pipeline | string | FieldPath, + name?: string + ): Field { + if (typeof pipelineOrName === 'string') { + if (DOCUMENT_KEY_NAME === pipelineOrName) { + return new Field(documentId()._internalPath); + } + return new Field(fieldPathFromArgument('of', pipelineOrName)); + } else if (pipelineOrName instanceof FieldPath) { + if (documentId().isEqual(pipelineOrName)) { + return new Field(documentId()._internalPath); + } + return new Field(pipelineOrName._internalPath); + } else { + return new Field( + fieldPathFromArgument('of', name!), + pipelineOrName as Pipeline + ); + } + } + + fieldName(): string { + return this.fieldPath.canonicalString(); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + fieldReferenceValue: this.fieldPath.canonicalString() + }; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void {} +} + +/** + * @beta + */ +export class Fields extends Expr implements Selectable { + exprType: ExprType = 'Field'; + selectable = true as const; + + private constructor(private fields: Field[]) { + super(); + } + + static of(name: string, ...others: string[]): Fields { + return new Fields([Field.of(name), ...others.map(Field.of)]); + } + + static ofAll(): Fields { + return new Fields([]); + } + + fieldList(): Field[] { + return this.fields.map(f => f); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + arrayValue: { + values: this.fields.map(f => f._toProto(serializer)) + } + }; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + this.fields.forEach(expr => expr._readUserData(dataReader)); + } +} + +/** + * @beta + * + * Represents a constant value that can be used in a Firestore pipeline expression. + * + * You can create a `Constant` instance using the static {@link #of} method: + * + * ```typescript + * // Create a Constant instance for the number 10 + * const ten = Constant.of(10); + * + * // Create a Constant instance for the string "hello" + * const hello = Constant.of("hello"); + * ``` + */ +export class Constant extends Expr { + exprType: ExprType = 'Constant'; + + private _protoValue?: ProtoValue; + + private constructor(private value: any) { + super(); + } + + /** + * Creates a `Constant` instance for a number value. + * + * @param value The number value. + * @return A new `Constant` instance. + */ + static of(value: number): Constant; + + /** + * Creates a `Constant` instance for a string value. + * + * @param value The string value. + * @return A new `Constant` instance. + */ + static of(value: string): Constant; + + /** + * Creates a `Constant` instance for a boolean value. + * + * @param value The boolean value. + * @return A new `Constant` instance. + */ + static of(value: boolean): Constant; + + /** + * Creates a `Constant` instance for a null value. + * + * @param value The null value. + * @return A new `Constant` instance. + */ + static of(value: null): Constant; + + /** + * Creates a `Constant` instance for an undefined value. + * + * @param value The undefined value. + * @return A new `Constant` instance. + */ + static of(value: undefined): Constant; + + /** + * Creates a `Constant` instance for a GeoPoint value. + * + * @param value The GeoPoint value. + * @return A new `Constant` instance. + */ + static of(value: GeoPoint): Constant; + + /** + * Creates a `Constant` instance for a Timestamp value. + * + * @param value The Timestamp value. + * @return A new `Constant` instance. + */ + static of(value: Timestamp): Constant; + + /** + * Creates a `Constant` instance for a Date value. + * + * @param value The Date value. + * @return A new `Constant` instance. + */ + static of(value: Date): Constant; + + /** + * Creates a `Constant` instance for a Uint8Array value. + * + * @param value The Uint8Array value. + * @return A new `Constant` instance. + */ + static of(value: Uint8Array): Constant; + + /** + * Creates a `Constant` instance for a DocumentReference value. + * + * @param value The DocumentReference value. + * @return A new `Constant` instance. + */ + static of(value: DocumentReference): Constant; + + // TODO(pipeline) if we make this public, then the Proto types should also be documented + /** + * Creates a `Constant` instance for a Firestore proto value. + * @private + * @internal + * @param value The Firestore proto value. + * @return A new `Constant` instance. + */ + static of(value: ProtoValue): Constant; + + /** + * Creates a `Constant` instance for an array value. + * + * @param value The array value. + * @return A new `Constant` instance. + */ + static of(value: any[]): Constant; + + /** + * Creates a `Constant` instance for a map value. + * + * @param value The map value. + * @return A new `Constant` instance. + */ + static of(value: Map): Constant; + + /** + * Creates a `Constant` instance for a VectorValue value. + * + * @param value The VectorValue value. + * @return A new `Constant` instance. + */ + static of(value: VectorValue): Constant; + + static of(value: any): Constant { + return new Constant(value); + } + + /** + * Creates a `Constant` instance for a VectorValue value. + * + * ```typescript + * // Create a Constant instance for a vector value + * const vectorConstant = Constant.ofVector([1, 2, 3]); + * ``` + * + * @param value The VectorValue value. + * @return A new `Constant` instance. + */ + static vector(value: number[] | VectorValue): Constant { + if (value instanceof VectorValue) { + return new Constant(value); + } else { + return new Constant(new VectorValue(value as number[])); + } + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + hardAssert( + this._protoValue !== undefined, + 'Value of this constant has not been serialized to proto value' + ); + return this._protoValue; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + const context = dataReader.createContext( + UserDataSource.Argument, + 'Constant.of' + ); + if (this.value === undefined) { + // TODO how should we treat the value of `undefined`? + this._protoValue = parseData(null, context)!; + } else { + this._protoValue = parseData(this.value, context)!; + } + } +} + +/** + * @beta + * + * This class defines the base class for Firestore {@link Pipeline} functions, which can be evaluated within pipeline + * execution. + * + * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link eq}, + * or the methods on {@link Expr} ({@link Expr#eq}, {@link Expr#lt}, etc) to construct new Function instances. + */ +export class FirestoreFunction extends Expr { + exprType: ExprType = 'Function'; + constructor(private name: string, private params: Expr[]) { + super(); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + functionValue: { + name: this.name, + args: this.params.map(p => p._toProto(serializer)) + } + }; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + this.params.forEach(expr => expr._readUserData(dataReader)); + } +} + +/** + * @beta + */ +export class Add extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('add', [left, right]); + } +} + +/** + * @beta + */ +export class Subtract extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('subtract', [left, right]); + } +} + +/** + * @beta + */ +export class Multiply extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('multiply', [left, right]); + } +} + +/** + * @beta + */ +export class Divide extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('divide', [left, right]); + } +} + +/** + * @beta + */ +export class Mod extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('mod', [left, right]); + } +} + +// /** +// * @beta +// */ +// export class BitAnd extends FirestoreFunction { +// constructor( +// private left: Expr, +// private right: Expr +// ) { +// super('bit_and', [left, right]); +// } +// } +// +// /** +// * @beta +// */ +// export class BitOr extends FirestoreFunction { +// constructor( +// private left: Expr, +// private right: Expr +// ) { +// super('bit_or', [left, right]); +// } +// } +// +// /** +// * @beta +// */ +// export class BitXor extends FirestoreFunction { +// constructor( +// private left: Expr, +// private right: Expr +// ) { +// super('bit_xor', [left, right]); +// } +// } +// +// /** +// * @beta +// */ +// export class BitNot extends FirestoreFunction { +// constructor(private operand: Expr) { +// super('bit_not', [operand]); +// } +// } +// +// /** +// * @beta +// */ +// export class BitLeftShift extends FirestoreFunction { +// constructor( +// private left: Expr, +// private right: Expr +// ) { +// super('bit_left_shift', [left, right]); +// } +// } +// +// /** +// * @beta +// */ +// export class BitRightShift extends FirestoreFunction { +// constructor( +// private left: Expr, +// private right: Expr +// ) { +// super('bit_right_shift', [left, right]); +// } +// } + +/** + * @beta + */ +export class Eq extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('eq', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Neq extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('neq', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Lt extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('lt', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Lte extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('lte', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Gt extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('gt', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Gte extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private right: Expr) { + super('gte', [left, right]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class ArrayConcat extends FirestoreFunction { + constructor(private array: Expr, private elements: Expr[]) { + super('array_concat', [array, ...elements]); + } +} + +/** + * @beta + */ +export class ArrayReverse extends FirestoreFunction { + constructor(private array: Expr) { + super('array_reverse', [array]); + } +} + +/** + * @beta + */ +export class ArrayContains extends FirestoreFunction implements FilterCondition { + constructor(private array: Expr, private element: Expr) { + super('array_contains', [array, element]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { + constructor(private array: Expr, private values: Expr[]) { + super('array_contains_all', [array, new ListOfExprs(values)]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { + constructor(private array: Expr, private values: Expr[]) { + super('array_contains_any', [array, new ListOfExprs(values)]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class ArrayLength extends FirestoreFunction { + constructor(private array: Expr) { + super('array_length', [array]); + } +} + +/** + * @beta + */ +export class ArrayElement extends FirestoreFunction { + constructor() { + super('array_element', []); + } +} + +/** + * @beta + */ +export class In extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private others: Expr[]) { + super('in', [left, new ListOfExprs(others)]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class IsNan extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr) { + super('is_nan', [expr]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Exists extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr) { + super('exists', [expr]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Not extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr) { + super('not', [expr]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class And extends FirestoreFunction implements FilterCondition { + constructor(private conditions: FilterExpr[]) { + super('and', conditions); + } + + filterable = true as const; +} + +/** + * @beta + */ +export class Or extends FirestoreFunction implements FilterCondition { + constructor(private conditions: FilterExpr[]) { + super('or', conditions); + } + filterable = true as const; +} + +/** + * @beta + */ +export class Xor extends FirestoreFunction implements FilterCondition { + constructor(private conditions: FilterExpr[]) { + super('xor', conditions); + } + filterable = true as const; +} + +/** + * @beta + */ +export class If extends FirestoreFunction implements FilterCondition { + constructor( + private condition: FilterExpr, + private thenExpr: Expr, + private elseExpr: Expr + ) { + super('if', [condition, thenExpr, elseExpr]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class LogicalMax extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('logical_max', [left, right]); + } +} + +/** + * @beta + */ +export class LogicalMin extends FirestoreFunction { + constructor(private left: Expr, private right: Expr) { + super('logical_min', [left, right]); + } +} + +/** + * @beta + */ +export class Reverse extends FirestoreFunction { + constructor(private value: Expr) { + super('reverse', [value]); + } +} + +/** + * @beta + */ +export class ReplaceFirst extends FirestoreFunction { + constructor(private value: Expr, private find: Expr, private replace: Expr) { + super('replace_first', [value, find, replace]); + } +} + +/** + * @beta + */ +export class ReplaceAll extends FirestoreFunction { + constructor(private value: Expr, private find: Expr, private replace: Expr) { + super('replace_all', [value, find, replace]); + } +} + +/** + * @beta + */ +export class CharLength extends FirestoreFunction { + constructor(private value: Expr) { + super('char_length', [value]); + } +} + +/** + * @beta + */ +export class ByteLength extends FirestoreFunction { + constructor(private value: Expr) { + super('byte_length', [value]); + } +} + +/** + * @beta + */ +export class Like extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private pattern: Expr) { + super('like', [expr, pattern]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class RegexContains extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private pattern: Expr) { + super('regex_contains', [expr, pattern]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class RegexMatch extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private pattern: Expr) { + super('regex_match', [expr, pattern]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class StrContains extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private substring: Expr) { + super('str_contains', [expr, substring]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class StartsWith extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private prefix: Expr) { + super('starts_with', [expr, prefix]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class EndsWith extends FirestoreFunction implements FilterCondition { + constructor(private expr: Expr, private suffix: Expr) { + super('ends_with', [expr, suffix]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class ToLower extends FirestoreFunction { + constructor(private expr: Expr) { + super('to_lower', [expr]); + } +} + +/** + * @beta + */ +export class ToUpper extends FirestoreFunction { + constructor(private expr: Expr) { + super('to_upper', [expr]); + } +} + +/** + * @beta + */ +export class Trim extends FirestoreFunction { + constructor(private expr: Expr) { + super('trim', [expr]); + } +} + +/** + * @beta + */ +export class StrConcat extends FirestoreFunction { + constructor(private first: Expr, private rest: Expr[]) { + super('str_concat', [first, ...rest]); + } +} + +/** + * @beta + */ +export class MapGet extends FirestoreFunction { + constructor(map: Expr, name: string) { + super('map_get', [map, Constant.of(name)]); + } +} + +/** + * @beta + */ +export class Count extends FirestoreFunction implements Accumulator { + accumulator = true as const; + constructor(private value: Expr | undefined, private distinct: boolean) { + super('count', value === undefined ? [] : [value]); + } +} + +/** + * @beta + */ +export class Sum extends FirestoreFunction implements Accumulator { + accumulator = true as const; + constructor(private value: Expr, private distinct: boolean) { + super('sum', [value]); + } +} + +/** + * @beta + */ +export class Avg extends FirestoreFunction implements Accumulator { + accumulator = true as const; + constructor(private value: Expr, private distinct: boolean) { + super('avg', [value]); + } +} + +/** + * @beta + */ +export class Min extends FirestoreFunction implements Accumulator { + accumulator = true as const; + constructor(private value: Expr, private distinct: boolean) { + super('min', [value]); + } +} + +/** + * @beta + */ +export class Max extends FirestoreFunction implements Accumulator { + accumulator = true as const; + constructor(private value: Expr, private distinct: boolean) { + super('max', [value]); + } +} + +/** + * @beta + */ +export class CosineDistance extends FirestoreFunction { + constructor(private vector1: Expr, private vector2: Expr) { + super('cosine_distance', [vector1, vector2]); + } +} + +/** + * @beta + */ +export class DotProduct extends FirestoreFunction { + constructor(private vector1: Expr, private vector2: Expr) { + super('dot_product', [vector1, vector2]); + } +} + +/** + * @beta + */ +export class EuclideanDistance extends FirestoreFunction { + constructor(private vector1: Expr, private vector2: Expr) { + super('euclidean_distance', [vector1, vector2]); + } +} + +/** + * @beta + */ +export class VectorLength extends FirestoreFunction { + constructor(private value: Expr) { + super('vector_length', [value]); + } +} + +/** + * @beta + */ +export class UnixMicrosToTimestamp extends FirestoreFunction { + constructor(private input: Expr) { + super('unix_micros_to_timestamp', [input]); + } +} + +/** + * @beta + */ +export class TimestampToUnixMicros extends FirestoreFunction { + constructor(private input: Expr) { + super('timestamp_to_unix_micros', [input]); + } +} + +/** + * @beta + */ +export class UnixMillisToTimestamp extends FirestoreFunction { + constructor(private input: Expr) { + super('unix_millis_to_timestamp', [input]); + } +} + +/** + * @beta + */ +export class TimestampToUnixMillis extends FirestoreFunction { + constructor(private input: Expr) { + super('timestamp_to_unix_millis', [input]); + } +} + +/** + * @beta + */ +export class UnixSecondsToTimestamp extends FirestoreFunction { + constructor(private input: Expr) { + super('unix_seconds_to_timestamp', [input]); + } +} + +/** + * @beta + */ +export class TimestampToUnixSeconds extends FirestoreFunction { + constructor(private input: Expr) { + super('timestamp_to_unix_seconds', [input]); + } +} + +/** + * @beta + */ +export class TimestampAdd extends FirestoreFunction { + constructor( + private timestamp: Expr, + private unit: Expr, + private amount: Expr + ) { + super('timestamp_add', [timestamp, unit, amount]); + } +} + +/** + * @beta + */ +export class TimestampSub extends FirestoreFunction { + constructor( + private timestamp: Expr, + private unit: Expr, + private amount: Expr + ) { + super('timestamp_sub', [timestamp, unit, amount]); + } +} + +/** + * @beta + * + * Creates an expression that adds two expressions together. + * + * ```typescript + * // Add the value of the 'quantity' field and the 'reserve' field. + * add(Field.of("quantity"), Field.of("reserve")); + * ``` + * + * @param left The first expression to add. + * @param right The second expression to add. + * @return A new {@code Expr} representing the addition operation. + */ +export function add(left: Expr, right: Expr): Add; + +/** + * @beta + * + * Creates an expression that adds an expression to a constant value. + * + * ```typescript + * // Add 5 to the value of the 'age' field + * add(Field.of("age"), 5); + * ``` + * + * @param left The expression to add to. + * @param right The constant value to add. + * @return A new {@code Expr} representing the addition operation. + */ +export function add(left: Expr, right: any): Add; + +/** + * @beta + * + * Creates an expression that adds a field's value to an expression. + * + * ```typescript + * // Add the value of the 'quantity' field and the 'reserve' field. + * add("quantity", Field.of("reserve")); + * ``` + * + * @param left The field name to add to. + * @param right The expression to add. + * @return A new {@code Expr} representing the addition operation. + */ +export function add(left: string, right: Expr): Add; + +/** + * @beta + * + * Creates an expression that adds a field's value to a constant value. + * + * ```typescript + * // Add 5 to the value of the 'age' field + * add("age", 5); + * ``` + * + * @param left The field name to add to. + * @param right The constant value to add. + * @return A new {@code Expr} representing the addition operation. + */ +export function add(left: string, right: any): Add; +export function add(left: Expr | string, right: Expr | any): Add { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new Add(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that subtracts two expressions. + * + * ```typescript + * // Subtract the 'discount' field from the 'price' field + * subtract(Field.of("price"), Field.of("discount")); + * ``` + * + * @param left The expression to subtract from. + * @param right The expression to subtract. + * @return A new {@code Expr} representing the subtraction operation. + */ +export function subtract(left: Expr, right: Expr): Subtract; + +/** + * @beta + * + * Creates an expression that subtracts a constant value from an expression. + * + * ```typescript + * // Subtract the constant value 2 from the 'value' field + * subtract(Field.of("value"), 2); + * ``` + * + * @param left The expression to subtract from. + * @param right The constant value to subtract. + * @return A new {@code Expr} representing the subtraction operation. + */ +export function subtract(left: Expr, right: any): Subtract; + +/** + * @beta + * + * Creates an expression that subtracts an expression from a field's value. + * + * ```typescript + * // Subtract the 'discount' field from the 'price' field + * subtract("price", Field.of("discount")); + * ``` + * + * @param left The field name to subtract from. + * @param right The expression to subtract. + * @return A new {@code Expr} representing the subtraction operation. + */ +export function subtract(left: string, right: Expr): Subtract; + +/** + * @beta + * + * Creates an expression that subtracts a constant value from a field's value. + * + * ```typescript + * // Subtract 20 from the value of the 'total' field + * subtract("total", 20); + * ``` + * + * @param left The field name to subtract from. + * @param right The constant value to subtract. + * @return A new {@code Expr} representing the subtraction operation. + */ +export function subtract(left: string, right: any): Subtract; +export function subtract(left: Expr | string, right: Expr | any): Subtract { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new Subtract(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that multiplies two expressions together. + * + * ```typescript + * // Multiply the 'quantity' field by the 'price' field + * multiply(Field.of("quantity"), Field.of("price")); + * ``` + * + * @param left The first expression to multiply. + * @param right The second expression to multiply. + * @return A new {@code Expr} representing the multiplication operation. + */ +export function multiply(left: Expr, right: Expr): Multiply; + +/** + * @beta + * + * Creates an expression that multiplies an expression by a constant value. + * + * ```typescript + * // Multiply the value of the 'price' field by 2 + * multiply(Field.of("price"), 2); + * ``` + * + * @param left The expression to multiply. + * @param right The constant value to multiply by. + * @return A new {@code Expr} representing the multiplication operation. + */ +export function multiply(left: Expr, right: any): Multiply; + +/** + * @beta + * + * Creates an expression that multiplies a field's value by an expression. + * + * ```typescript + * // Multiply the 'quantity' field by the 'price' field + * multiply("quantity", Field.of("price")); + * ``` + * + * @param left The field name to multiply. + * @param right The expression to multiply by. + * @return A new {@code Expr} representing the multiplication operation. + */ +export function multiply(left: string, right: Expr): Multiply; + +/** + * @beta + * + * Creates an expression that multiplies a field's value by a constant value. + * + * ```typescript + * // Multiply the 'value' field by 2 + * multiply("value", 2); + * ``` + * + * @param left The field name to multiply. + * @param right The constant value to multiply by. + * @return A new {@code Expr} representing the multiplication operation. + */ +export function multiply(left: string, right: any): Multiply; +export function multiply(left: Expr | string, right: Expr | any): Multiply { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new Multiply(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that divides two expressions. + * + * ```typescript + * // Divide the 'total' field by the 'count' field + * divide(Field.of("total"), Field.of("count")); + * ``` + * + * @param left The expression to be divided. + * @param right The expression to divide by. + * @return A new {@code Expr} representing the division operation. + */ +export function divide(left: Expr, right: Expr): Divide; + +/** + * @beta + * + * Creates an expression that divides an expression by a constant value. + * + * ```typescript + * // Divide the 'value' field by 10 + * divide(Field.of("value"), 10); + * ``` + * + * @param left The expression to be divided. + * @param right The constant value to divide by. + * @return A new {@code Expr} representing the division operation. + */ +export function divide(left: Expr, right: any): Divide; + +/** + * @beta + * + * Creates an expression that divides a field's value by an expression. + * + * ```typescript + * // Divide the 'total' field by the 'count' field + * divide("total", Field.of("count")); + * ``` + * + * @param left The field name to be divided. + * @param right The expression to divide by. + * @return A new {@code Expr} representing the division operation. + */ +export function divide(left: string, right: Expr): Divide; + +/** + * @beta + * + * Creates an expression that divides a field's value by a constant value. + * + * ```typescript + * // Divide the 'value' field by 10 + * divide("value", 10); + * ``` + * + * @param left The field name to be divided. + * @param right The constant value to divide by. + * @return A new {@code Expr} representing the division operation. + */ +export function divide(left: string, right: any): Divide; +export function divide(left: Expr | string, right: Expr | any): Divide { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new Divide(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that calculates the modulo (remainder) of dividing two expressions. + * + * ```typescript + * // Calculate the remainder of dividing 'field1' by 'field2'. + * mod(Field.of("field1"), Field.of("field2")); + * ``` + * + * @param left The dividend expression. + * @param right The divisor expression. + * @return A new {@code Expr} representing the modulo operation. + */ +export function mod(left: Expr, right: Expr): Mod; + +/** + * @beta + * + * Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. + * + * ```typescript + * // Calculate the remainder of dividing 'field1' by 5. + * mod(Field.of("field1"), 5); + * ``` + * + * @param left The dividend expression. + * @param right The divisor constant. + * @return A new {@code Expr} representing the modulo operation. + */ +export function mod(left: Expr, right: any): Mod; + +/** + * @beta + * + * Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. + * + * ```typescript + * // Calculate the remainder of dividing 'field1' by 'field2'. + * mod("field1", Field.of("field2")); + * ``` + * + * @param left The dividend field name. + * @param right The divisor expression. + * @return A new {@code Expr} representing the modulo operation. + */ +export function mod(left: string, right: Expr): Mod; + +/** + * @beta + * + * Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. + * + * ```typescript + * // Calculate the remainder of dividing 'field1' by 5. + * mod("field1", 5); + * ``` + * + * @param left The dividend field name. + * @param right The divisor constant. + * @return A new {@code Expr} representing the modulo operation. + */ +export function mod(left: string, right: any): Mod; +export function mod(left: Expr | string, right: Expr | any): Mod { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new Mod(normalizedLeft, normalizedRight); +} + +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise AND operation between two expressions. +// * +// * ```typescript +// * // Calculate the bitwise AND of 'field1' and 'field2'. +// * bitAnd(Field.of("field1"), Field.of("field2")); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise AND operation. +// */ +// export function bitAnd(left: Expr, right: Expr): BitAnd; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise AND operation between an expression and a constant. +// * +// * ```typescript +// * // Calculate the bitwise AND of 'field1' and 0xFF. +// * bitAnd(Field.of("field1"), 0xFF); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise AND operation. +// */ +// export function bitAnd(left: Expr, right: any): BitAnd; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise AND operation between a field and an expression. +// * +// * ```typescript +// * // Calculate the bitwise AND of 'field1' and 'field2'. +// * bitAnd("field1", Field.of("field2")); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise AND operation. +// */ +// export function bitAnd(left: string, right: Expr): BitAnd; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise AND operation between a field and a constant. +// * +// * ```typescript +// * // Calculate the bitwise AND of 'field1' and 0xFF. +// * bitAnd("field1", 0xFF); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise AND operation. +// */ +// export function bitAnd(left: string, right: any): BitAnd; +// export function bitAnd(left: Expr | string, right: Expr | any): BitAnd { +// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; +// const normalizedRight = right instanceof Expr ? right : Constant.of(right); +// return new BitAnd(normalizedLeft, normalizedRight); +// } +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise OR operation between two expressions. +// * +// * ```typescript +// * // Calculate the bitwise OR of 'field1' and 'field2'. +// * bitOr(Field.of("field1"), Field.of("field2")); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise OR operation. +// */ +// export function bitOr(left: Expr, right: Expr): BitOr; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise OR operation between an expression and a constant. +// * +// * ```typescript +// * // Calculate the bitwise OR of 'field1' and 0xFF. +// * bitOr(Field.of("field1"), 0xFF); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise OR operation. +// */ +// export function bitOr(left: Expr, right: any): BitOr; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise OR operation between a field and an expression. +// * +// * ```typescript +// * // Calculate the bitwise OR of 'field1' and 'field2'. +// * bitOr("field1", Field.of("field2")); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise OR operation. +// */ +// export function bitOr(left: string, right: Expr): BitOr; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise OR operation between a field and a constant. +// * +// * ```typescript +// * // Calculate the bitwise OR of 'field1' and 0xFF. +// * bitOr("field1", 0xFF); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise OR operation. +// */ +// export function bitOr(left: string, right: any): BitOr; +// export function bitOr(left: Expr | string, right: Expr | any): BitOr { +// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; +// const normalizedRight = right instanceof Expr ? right : Constant.of(right); +// return new BitOr(normalizedLeft, normalizedRight); +// } +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise XOR operation between two expressions. +// * +// * ```typescript +// * // Calculate the bitwise XOR of 'field1' and 'field2'. +// * bitXor(Field.of("field1"), Field.of("field2")); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise XOR operation. +// */ +// export function bitXor(left: Expr, right: Expr): BitXor; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise XOR operation between an expression and a constant. +// * +// * ```typescript +// * // Calculate the bitwise XOR of 'field1' and 0xFF. +// * bitXor(Field.of("field1"), 0xFF); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise XOR operation. +// */ +// export function bitXor(left: Expr, right: any): BitXor; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise XOR operation between a field and an expression. +// * +// * ```typescript +// * // Calculate the bitwise XOR of 'field1' and 'field2'. +// * bitXor("field1", Field.of("field2")); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand expression. +// * @return A new {@code Expr} representing the bitwise XOR operation. +// */ +// export function bitXor(left: string, right: Expr): BitXor; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise XOR operation between a field and a constant. +// * +// * ```typescript +// * // Calculate the bitwise XOR of 'field1' and 0xFF. +// * bitXor("field1", 0xFF); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand constant. +// * @return A new {@code Expr} representing the bitwise XOR operation. +// */ +// export function bitXor(left: string, right: any): BitXor; +// export function bitXor(left: Expr | string, right: Expr | any): BitXor { +// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; +// const normalizedRight = right instanceof Expr ? right : Constant.of(right); +// return new BitXor(normalizedLeft, normalizedRight); +// } +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise NOT operation to an expression. +// * +// * ```typescript +// * // Calculate the bitwise NOT of 'field1'. +// * bitNot(Field.of("field1")); +// * ``` +// * +// * @param operand The operand expression. +// * @return A new {@code Expr} representing the bitwise NOT operation. +// */ +// export function bitNot(operand: Expr): BitNot; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise NOT operation to a field. +// * +// * ```typescript +// * // Calculate the bitwise NOT of 'field1'. +// * bitNot("field1"); +// * ``` +// * +// * @param operand The operand field name. +// * @return A new {@code Expr} representing the bitwise NOT operation. +// */ +// export function bitNot(operand: string): BitNot; +// export function bitNot(operand: Expr | string): BitNot { +// const normalizedOperand = +// typeof operand === 'string' ? Field.of(operand) : operand; +// return new BitNot(normalizedOperand); +// } +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise left shift operation between two expressions. +// * +// * ```typescript +// * // Calculate the bitwise left shift of 'field1' by 'field2' bits. +// * bitLeftShift(Field.of("field1"), Field.of("field2")); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand expression representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise left shift operation. +// */ +// export function bitLeftShift(left: Expr, right: Expr): BitLeftShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise left shift operation between an expression and a constant. +// * +// * ```typescript +// * // Calculate the bitwise left shift of 'field1' by 2 bits. +// * bitLeftShift(Field.of("field1"), 2); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand constant representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise left shift operation. +// */ +// export function bitLeftShift(left: Expr, right: any): BitLeftShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise left shift operation between a field and an expression. +// * +// * ```typescript +// * // Calculate the bitwise left shift of 'field1' by 'field2' bits. +// * bitLeftShift("field1", Field.of("field2")); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand expression representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise left shift operation. +// */ +// export function bitLeftShift(left: string, right: Expr): BitLeftShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise left shift operation between a field and a constant. +// * +// * ```typescript +// * // Calculate the bitwise left shift of 'field1' by 2 bits. +// * bitLeftShift("field1", 2); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand constant representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise left shift operation. +// */ +// export function bitLeftShift(left: string, right: any): BitLeftShift; +// export function bitLeftShift( +// left: Expr | string, +// right: Expr | any +// ): BitLeftShift { +// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; +// const normalizedRight = right instanceof Expr ? right : Constant.of(right); +// return new BitLeftShift(normalizedLeft, normalizedRight); +// } +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise right shift operation between two expressions. +// * +// * ```typescript +// * // Calculate the bitwise right shift of 'field1' by 'field2' bits. +// * bitRightShift(Field.of("field1"), Field.of("field2")); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand expression representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise right shift operation. +// */ +// export function bitRightShift(left: Expr, right: Expr): BitRightShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise right shift operation between an expression and a constant. +// * +// * ```typescript +// * // Calculate the bitwise right shift of 'field1' by 2 bits. +// * bitRightShift(Field.of("field1"), 2); +// * ``` +// * +// * @param left The left operand expression. +// * @param right The right operand constant representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise right shift operation. +// */ +// export function bitRightShift(left: Expr, right: any): BitRightShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise right shift operation between a field and an expression. +// * +// * ```typescript +// * // Calculate the bitwise right shift of 'field1' by 'field2' bits. +// * bitRightShift("field1", Field.of("field2")); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand expression representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise right shift operation. +// */ +// export function bitRightShift(left: string, right: Expr): BitRightShift; +// +// /** +// * @beta +// * +// * Creates an expression that applies a bitwise right shift operation between a field and a constant. +// * +// * ```typescript +// * // Calculate the bitwise right shift of 'field1' by 2 bits. +// * bitRightShift("field1", 2); +// * ``` +// * +// * @param left The left operand field name. +// * @param right The right operand constant representing the number of bits to shift. +// * @return A new {@code Expr} representing the bitwise right shift operation. +// */ +// export function bitRightShift(left: string, right: any): BitRightShift; +// export function bitRightShift( +// left: Expr | string, +// right: Expr | any +// ): BitRightShift { +// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; +// const normalizedRight = right instanceof Expr ? right : Constant.of(right); +// return new BitRightShift(normalizedLeft, normalizedRight); +// } + +/** + * @beta + * + * Creates an expression that checks if two expressions are equal. + * + * ```typescript + * // Check if the 'age' field is equal to an expression + * eq(Field.of("age"), Field.of("minAge").add(10)); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the equality comparison. + */ +export function eq(left: Expr, right: Expr): Eq; + +/** + * @beta + * + * Creates an expression that checks if an expression is equal to a constant value. + * + * ```typescript + * // Check if the 'age' field is equal to 21 + * eq(Field.of("age"), 21); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the equality comparison. + */ +export function eq(left: Expr, right: any): Eq; + +/** + * @beta + * + * Creates an expression that checks if a field's value is equal to an expression. + * + * ```typescript + * // Check if the 'age' field is equal to the 'limit' field + * eq("age", Field.of("limit")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the equality comparison. + */ +export function eq(left: string, right: Expr): Eq; + +/** + * @beta + * + * Creates an expression that checks if a field's value is equal to a constant value. + * + * ```typescript + * // Check if the 'city' field is equal to string constant "London" + * eq("city", "London"); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the equality comparison. + */ +export function eq(left: string, right: any): Eq; +export function eq(left: Expr | string, right: any): Eq { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Eq(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that checks if two expressions are not equal. + * + * ```typescript + * // Check if the 'status' field is not equal to field 'finalState' + * neq(Field.of("status"), Field.of("finalState")); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the inequality comparison. + */ +export function neq(left: Expr, right: Expr): Neq; + +/** + * @beta + * + * Creates an expression that checks if an expression is not equal to a constant value. + * + * ```typescript + * // Check if the 'status' field is not equal to "completed" + * neq(Field.of("status"), "completed"); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the inequality comparison. + */ +export function neq(left: Expr, right: any): Neq; + +/** + * @beta + * + * Creates an expression that checks if a field's value is not equal to an expression. + * + * ```typescript + * // Check if the 'status' field is not equal to the value of 'expectedStatus' + * neq("status", Field.of("expectedStatus")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the inequality comparison. + */ +export function neq(left: string, right: Expr): Neq; + +/** + * @beta + * + * Creates an expression that checks if a field's value is not equal to a constant value. + * + * ```typescript + * // Check if the 'country' field is not equal to "USA" + * neq("country", "USA"); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the inequality comparison. + */ +export function neq(left: string, right: any): Neq; +export function neq(left: Expr | string, right: any): Neq { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Neq(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that checks if the first expression is less than the second expression. + * + * ```typescript + * // Check if the 'age' field is less than 30 + * lt(Field.of("age"), Field.of("limit")); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the less than comparison. + */ +export function lt(left: Expr, right: Expr): Lt; + +/** + * @beta + * + * Creates an expression that checks if an expression is less than a constant value. + * + * ```typescript + * // Check if the 'age' field is less than 30 + * lt(Field.of("age"), 30); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the less than comparison. + */ +export function lt(left: Expr, right: any): Lt; + +/** + * @beta + * + * Creates an expression that checks if a field's value is less than an expression. + * + * ```typescript + * // Check if the 'age' field is less than the 'limit' field + * lt("age", Field.of("limit")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the less than comparison. + */ +export function lt(left: string, right: Expr): Lt; + +/** + * @beta + * + * Creates an expression that checks if a field's value is less than a constant value. + * + * ```typescript + * // Check if the 'price' field is less than 50 + * lt("price", 50); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the less than comparison. + */ +export function lt(left: string, right: any): Lt; +export function lt(left: Expr | string, right: any): Lt { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Lt(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that checks if the first expression is less than or equal to the second + * expression. + * + * ```typescript + * // Check if the 'quantity' field is less than or equal to 20 + * lte(Field.of("quantity"), Field.of("limit")); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the less than or equal to comparison. + */ +export function lte(left: Expr, right: Expr): Lte; + +/** + * @beta + * + * Creates an expression that checks if an expression is less than or equal to a constant value. + * + * ```typescript + * // Check if the 'quantity' field is less than or equal to 20 + * lte(Field.of("quantity"), 20); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the less than or equal to comparison. + */ +export function lte(left: Expr, right: any): Lte; + +/** + * Creates an expression that checks if a field's value is less than or equal to an expression. + * + * ```typescript + * // Check if the 'quantity' field is less than or equal to the 'limit' field + * lte("quantity", Field.of("limit")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the less than or equal to comparison. + */ +export function lte(left: string, right: Expr): Lte; + +/** + * @beta + * + * Creates an expression that checks if a field's value is less than or equal to a constant value. + * + * ```typescript + * // Check if the 'score' field is less than or equal to 70 + * lte("score", 70); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the less than or equal to comparison. + */ +export function lte(left: string, right: any): Lte; +export function lte(left: Expr | string, right: any): Lte { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Lte(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that checks if the first expression is greater than the second + * expression. + * + * ```typescript + * // Check if the 'age' field is greater than 18 + * gt(Field.of("age"), Constant(9).add(9)); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the greater than comparison. + */ +export function gt(left: Expr, right: Expr): Gt; + +/** + * @beta + * + * Creates an expression that checks if an expression is greater than a constant value. + * + * ```typescript + * // Check if the 'age' field is greater than 18 + * gt(Field.of("age"), 18); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the greater than comparison. + */ +export function gt(left: Expr, right: any): Gt; + +/** + * @beta + * + * Creates an expression that checks if a field's value is greater than an expression. + * + * ```typescript + * // Check if the value of field 'age' is greater than the value of field 'limit' + * gt("age", Field.of("limit")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the greater than comparison. + */ +export function gt(left: string, right: Expr): Gt; + +/** + * @beta + * + * Creates an expression that checks if a field's value is greater than a constant value. + * + * ```typescript + * // Check if the 'price' field is greater than 100 + * gt("price", 100); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the greater than comparison. + */ +export function gt(left: string, right: any): Gt; +export function gt(left: Expr | string, right: any): Gt { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Gt(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that checks if the first expression is greater than or equal to the + * second expression. + * + * ```typescript + * // Check if the 'quantity' field is greater than or equal to the field "threshold" + * gte(Field.of("quantity"), Field.of("threshold")); + * ``` + * + * @param left The first expression to compare. + * @param right The second expression to compare. + * @return A new `Expr` representing the greater than or equal to comparison. + */ +export function gte(left: Expr, right: Expr): Gte; + +/** + * @beta + * + * Creates an expression that checks if an expression is greater than or equal to a constant + * value. + * + * ```typescript + * // Check if the 'quantity' field is greater than or equal to 10 + * gte(Field.of("quantity"), 10); + * ``` + * + * @param left The expression to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the greater than or equal to comparison. + */ +export function gte(left: Expr, right: any): Gte; + +/** + * @beta + * + * Creates an expression that checks if a field's value is greater than or equal to an expression. + * + * ```typescript + * // Check if the value of field 'age' is greater than or equal to the value of field 'limit' + * gte("age", Field.of("limit")); + * ``` + * + * @param left The field name to compare. + * @param right The expression to compare to. + * @return A new `Expr` representing the greater than or equal to comparison. + */ +export function gte(left: string, right: Expr): Gte; + +/** + * @beta + * + * Creates an expression that checks if a field's value is greater than or equal to a constant + * value. + * + * ```typescript + * // Check if the 'score' field is greater than or equal to 80 + * gte("score", 80); + * ``` + * + * @param left The field name to compare. + * @param right The constant value to compare to. + * @return A new `Expr` representing the greater than or equal to comparison. + */ +export function gte(left: string, right: any): Gte; +export function gte(left: Expr | string, right: any): Gte { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const rightExpr = right instanceof Expr ? right : Constant.of(right); + return new Gte(leftExpr, rightExpr); +} + +/** + * @beta + * + * Creates an expression that concatenates an array expression with other arrays. + * + * ```typescript + * // Combine the 'items' array with two new item arrays + * arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); + * ``` + * + * @param array The array expression to concatenate to. + * @param elements The array expressions to concatenate. + * @return A new {@code Expr} representing the concatenated array. + */ +export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; + +/** + * @beta + * + * Creates an expression that concatenates an array expression with other arrays and/or values. + * + * ```typescript + * // Combine the 'tags' array with a new array + * arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); + * ``` + * + * @param array The array expression to concatenate to. + * @param elements The array expressions or single values to concatenate. + * @return A new {@code Expr} representing the concatenated array. + */ +export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; + +/** + * @beta + * + * Creates an expression that concatenates a field's array value with other arrays. + * + * ```typescript + * // Combine the 'items' array with two new item arrays + * arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + * ``` + * + * @param array The field name containing array values. + * @param elements The array expressions to concatenate. + * @return A new {@code Expr} representing the concatenated array. + */ +export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; + +/** + * @beta + * + * Creates an expression that concatenates a field's array value with other arrays and/or values. + * + * ```typescript + * // Combine the 'tags' array with a new array + * arrayConcat("tags", ["newTag1", "newTag2"]); + * ``` + * + * @param array The field name containing array values. + * @param elements The array expressions or single values to concatenate. + * @return A new {@code Expr} representing the concatenated array. + */ +export function arrayConcat(array: string, elements: any[]): ArrayConcat; +export function arrayConcat( + array: Expr | string, + elements: any[] +): ArrayConcat { + const arrayExpr = array instanceof Expr ? array : Field.of(array); + const exprValues = elements.map(element => + element instanceof Expr ? element : Constant.of(element) + ); + return new ArrayConcat(arrayExpr, exprValues); +} + +/** + * @beta + * + * Creates an expression that checks if an array expression contains a specific element. + * + * ```typescript + * // Check if the 'colors' array contains the value of field 'selectedColor' + * arrayContains(Field.of("colors"), Field.of("selectedColor")); + * ``` + * + * @param array The array expression to check. + * @param element The element to search for in the array. + * @return A new {@code Expr} representing the 'array_contains' comparison. + */ +export function arrayContains(array: Expr, element: Expr): ArrayContains; + +/** + * @beta + * + * Creates an expression that checks if an array expression contains a specific element. + * + * ```typescript + * // Check if the 'colors' array contains "red" + * arrayContains(Field.of("colors"), "red"); + * ``` + * + * @param array The array expression to check. + * @param element The element to search for in the array. + * @return A new {@code Expr} representing the 'array_contains' comparison. + */ +export function arrayContains(array: Expr, element: any): ArrayContains; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains a specific element. + * + * ```typescript + * // Check if the 'colors' array contains the value of field 'selectedColor' + * arrayContains("colors", Field.of("selectedColor")); + * ``` + * + * @param array The field name to check. + * @param element The element to search for in the array. + * @return A new {@code Expr} representing the 'array_contains' comparison. + */ +export function arrayContains(array: string, element: Expr): ArrayContains; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains a specific value. + * + * ```typescript + * // Check if the 'colors' array contains "red" + * arrayContains("colors", "red"); + * ``` + * + * @param array The field name to check. + * @param element The element to search for in the array. + * @return A new {@code Expr} representing the 'array_contains' comparison. + */ +export function arrayContains(array: string, element: any): ArrayContains; +export function arrayContains( + array: Expr | string, + element: any +): ArrayContains { + const arrayExpr = array instanceof Expr ? array : Field.of(array); + const elementExpr = element instanceof Expr ? element : Constant.of(element); + return new ArrayContains(arrayExpr, elementExpr); +} + +/** + * @beta + * + * Creates an expression that checks if an array expression contains any of the specified + * elements. + * + * ```typescript + * // Check if the 'categories' array contains either values from field "cate1" or "Science" + * arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + * ``` + * + * @param array The array expression to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_any' comparison. + */ +export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; + +/** + * @beta + * + * Creates an expression that checks if an array expression contains any of the specified + * elements. + * + * ```typescript + * // Check if the 'categories' array contains either values from field "cate1" or "Science" + * arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + * ``` + * + * @param array The array expression to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_any' comparison. + */ +export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains any of the specified + * elements. + * + * ```typescript + * // Check if the 'groups' array contains either the value from the 'userGroup' field + * // or the value "guest" + * arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + * ``` + * + * @param array The field name to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_any' comparison. + */ +export function arrayContainsAny( + array: string, + values: Expr[] +): ArrayContainsAny; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains any of the specified + * elements. + * + * ```typescript + * // Check if the 'groups' array contains either the value from the 'userGroup' field + * // or the value "guest" + * arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + * ``` + * + * @param array The field name to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_any' comparison. + */ +export function arrayContainsAny( + array: string, + values: any[] +): ArrayContainsAny; +export function arrayContainsAny( + array: Expr | string, + values: any[] +): ArrayContainsAny { + const arrayExpr = array instanceof Expr ? array : Field.of(array); + const exprValues = values.map(value => + value instanceof Expr ? value : Constant.of(value) + ); + return new ArrayContainsAny(arrayExpr, exprValues); +} + +/** + * @beta + * + * Creates an expression that checks if an array expression contains all the specified elements. + * + * ```typescript + * // Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" + * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + * ``` + * + * @param array The array expression to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_all' comparison. + */ +export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; + +/** + * @beta + * + * Creates an expression that checks if an array expression contains all the specified elements. + * + * ```typescript + * // Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" + * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + * ``` + * + * @param array The array expression to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_all' comparison. + */ +export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains all the specified values or + * expressions. + * + * ```typescript + * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" + * arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + * ``` + * + * @param array The field name to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_all' comparison. + */ +export function arrayContainsAll( + array: string, + values: Expr[] +): ArrayContainsAll; + +/** + * @beta + * + * Creates an expression that checks if a field's array value contains all the specified values or + * expressions. + * + * ```typescript + * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" + * arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + * ``` + * + * @param array The field name to check. + * @param values The elements to check for in the array. + * @return A new {@code Expr} representing the 'array_contains_all' comparison. + */ +export function arrayContainsAll( + array: string, + values: any[] +): ArrayContainsAll; +export function arrayContainsAll( + array: Expr | string, + values: any[] +): ArrayContainsAll { + const arrayExpr = array instanceof Expr ? array : Field.of(array); + const exprValues = values.map(value => + value instanceof Expr ? value : Constant.of(value) + ); + return new ArrayContainsAll(arrayExpr, exprValues); +} + +/** + * @beta + * + * Creates an expression that calculates the length of an array expression. + * + * ```typescript + * // Get the number of items in the 'cart' array + * arrayLength(Field.of("cart")); + * ``` + * + * @param array The array expression to calculate the length of. + * @return A new {@code Expr} representing the length of the array. + */ +export function arrayLength(array: Expr): ArrayLength { + return new ArrayLength(array); +} + +/** + * @beta + * + * Creates an expression that checks if an expression is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + * ``` + * + * @param element The expression to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'IN' comparison. + */ +export function inAny(element: Expr, others: Expr[]): In; + +/** + * @beta + * + * Creates an expression that checks if an expression is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + * ``` + * + * @param element The expression to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'IN' comparison. + */ +export function inAny(element: Expr, others: any[]): In; + +/** + * @beta + * + * Creates an expression that checks if a field's value is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + * ``` + * + * @param element The field to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'IN' comparison. + */ +export function inAny(element: string, others: Expr[]): In; + +/** + * @beta + * + * Creates an expression that checks if a field's value is equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' + * inAny("category", ["Electronics", Field.of("primaryType")]); + * ``` + * + * @param element The field to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'IN' comparison. + */ +export function inAny(element: string, others: any[]): In; +export function inAny(element: Expr | string, others: any[]): In { + const elementExpr = element instanceof Expr ? element : Field.of(element); + const exprOthers = others.map(other => + other instanceof Expr ? other : Constant.of(other) + ); + return new In(elementExpr, exprOthers); +} + +/** + * @beta + * + * Creates an expression that checks if an expression is not equal to any of the provided values + * or expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + * ``` + * + * @param element The expression to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'NOT IN' comparison. + */ +export function notInAny(element: Expr, others: Expr[]): Not; + +/** + * @beta + * + * Creates an expression that checks if an expression is not equal to any of the provided values + * or expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + * ``` + * + * @param element The expression to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'NOT IN' comparison. + */ +export function notInAny(element: Expr, others: any[]): Not; + +/** + * @beta + * + * Creates an expression that checks if a field's value is not equal to any of the provided values + * or expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + * ``` + * + * @param element The field name to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'NOT IN' comparison. + */ +export function notInAny(element: string, others: Expr[]): Not; + +/** + * @beta + * + * Creates an expression that checks if a field's value is not equal to any of the provided values + * or expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * notInAny("status", ["pending", Field.of("rejectedStatus")]); + * ``` + * + * @param element The field name to compare. + * @param others The values to check against. + * @return A new {@code Expr} representing the 'NOT IN' comparison. + */ +export function notInAny(element: string, others: any[]): Not; +export function notInAny(element: Expr | string, others: any[]): Not { + const elementExpr = element instanceof Expr ? element : Field.of(element); + const exprOthers = others.map(other => + other instanceof Expr ? other : Constant.of(other) + ); + return new Not(new In(elementExpr, exprOthers)); +} + +/** + * @beta + * + * Creates an expression that performs a logical 'AND' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND + * // the 'status' field is "active" + * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'AND' together. + * @return A new {@code Expr} representing the logical 'AND' operation. + */ +export function and(left: FilterExpr, ...right: FilterExpr[]): And { + return new And([left, ...right]); +} + +/** + * @beta + * + * Creates an expression that performs a logical 'OR' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR + * // the 'status' field is "active" + * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'OR' together. + * @return A new {@code Expr} representing the logical 'OR' operation. + */ +export function or(left: FilterExpr, ...right: FilterExpr[]): Or { + return new Or([left, ...right]); +} + +/** + * @beta + * + * Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter + * conditions. + * + * ```typescript + * // Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", + * // or 'status' is "active". + * const condition = xor( + * gt("age", 18), + * eq("city", "London"), + * eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'XOR' together. + * @return A new {@code Expr} representing the logical 'XOR' operation. + */ +export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor { + return new Xor([left, ...right]); +} + +/** + * @beta + * + * Creates a conditional expression that evaluates to a 'then' expression if a condition is true + * and an 'else' expression if the condition is false. + * + * ```typescript + * // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". + * ifFunction( + * gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + * ``` + * + * @param condition The condition to evaluate. + * @param thenExpr The expression to evaluate if the condition is true. + * @param elseExpr The expression to evaluate if the condition is false. + * @return A new {@code Expr} representing the conditional expression. + */ +export function ifFunction( + condition: FilterExpr, + thenExpr: Expr, + elseExpr: Expr +): If { + return new If(condition, thenExpr, elseExpr); +} + +/** + * @beta + * + * Creates an expression that negates a filter condition. + * + * ```typescript + * // Find documents where the 'completed' field is NOT true + * not(eq("completed", true)); + * ``` + * + * @param filter The filter condition to negate. + * @return A new {@code Expr} representing the negated filter condition. + */ +export function not(filter: FilterExpr): Not { + return new Not(filter); +} + +/** + * @beta + * + * Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'field1' field and the 'field2' field. + * logicalMax(Field.of("field1"), Field.of("field2")); + * ``` + * + * @param left The left operand expression. + * @param right The right operand expression. + * @return A new {@code Expr} representing the logical max operation. + */ +export function logicalMax(left: Expr, right: Expr): LogicalMax; + +/** + * @beta + * + * Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'value' field and 10. + * logicalMax(Field.of("value"), 10); + * ``` + * + * @param left The left operand expression. + * @param right The right operand constant. + * @return A new {@code Expr} representing the logical max operation. + */ +export function logicalMax(left: Expr, right: any): LogicalMax; + +/** + * @beta + * + * Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'field1' field and the 'field2' field. + * logicalMax("field1", Field.of('field2')); + * ``` + * + * @param left The left operand field name. + * @param right The right operand expression. + * @return A new {@code Expr} representing the logical max operation. + */ +export function logicalMax(left: string, right: Expr): LogicalMax; + +/** + * @beta + * + * Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the larger value between the 'value' field and 10. + * logicalMax("value", 10); + * ``` + * + * @param left The left operand field name. + * @param right The right operand constant. + * @return A new {@code Expr} representing the logical max operation. + */ +export function logicalMax(left: string, right: any): LogicalMax; +export function logicalMax(left: Expr | string, right: Expr | any): LogicalMax { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new LogicalMax(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'field1' field and the 'field2' field. + * logicalMin(Field.of("field1"), Field.of("field2")); + * ``` + * + * @param left The left operand expression. + * @param right The right operand expression. + * @return A new {@code Expr} representing the logical min operation. + */ +export function logicalMin(left: Expr, right: Expr): LogicalMin; + +/** + * @beta + * + * Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'value' field and 10. + * logicalMin(Field.of("value"), 10); + * ``` + * + * @param left The left operand expression. + * @param right The right operand constant. + * @return A new {@code Expr} representing the logical min operation. + */ +export function logicalMin(left: Expr, right: any): LogicalMin; + +/** + * @beta + * + * Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'field1' field and the 'field2' field. + * logicalMin("field1", Field.of("field2")); + * ``` + * + * @param left The left operand field name. + * @param right The right operand expression. + * @return A new {@code Expr} representing the logical min operation. + */ +export function logicalMin(left: string, right: Expr): LogicalMin; + +/** + * @beta + * + * Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. + * + * ```typescript + * // Returns the smaller value between the 'value' field and 10. + * logicalMin("value", 10); + * ``` + * + * @param left The left operand field name. + * @param right The right operand constant. + * @return A new {@code Expr} representing the logical min operation. + */ +export function logicalMin(left: string, right: any): LogicalMin; +export function logicalMin(left: Expr | string, right: Expr | any): LogicalMin { + const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; + const normalizedRight = right instanceof Expr ? right : Constant.of(right); + return new LogicalMin(normalizedLeft, normalizedRight); +} + +/** + * @beta + * + * Creates an expression that checks if a field exists. + * + * ```typescript + * // Check if the document has a field named "phoneNumber" + * exists(Field.of("phoneNumber")); + * ``` + * + * @param value An expression evaluates to the name of the field to check. + * @return A new {@code Expr} representing the 'exists' check. + */ +export function exists(value: Expr): Exists; + +/** + * @beta + * + * Creates an expression that checks if a field exists. + * + * ```typescript + * // Check if the document has a field named "phoneNumber" + * exists("phoneNumber"); + * ``` + * + * @param field The field name to check. + * @return A new {@code Expr} representing the 'exists' check. + */ +export function exists(field: string): Exists; +export function exists(valueOrField: Expr | string): Exists { + const valueExpr = + valueOrField instanceof Expr ? valueOrField : Field.of(valueOrField); + return new Exists(valueExpr); +} + +/** + * @beta + * + * Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NaN + * isNaN(Field.of("value").divide(0)); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isNaN' check. + */ +export function isNan(value: Expr): IsNan; + +/** + * @beta + * + * Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NaN + * isNaN("value"); + * ``` + * + * @param value The name of the field to check. + * @return A new {@code Expr} representing the 'isNaN' check. + */ +export function isNan(value: string): IsNan; +export function isNan(value: Expr | string): IsNan { + const valueExpr = value instanceof Expr ? value : Field.of(value); + return new IsNan(valueExpr); +} + +/** + * @beta + * + * Creates an expression that reverses a string. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * reverse(Field.of("myString")); + * ``` + * + * @param expr The expression representing the string to reverse. + * @return A new {@code Expr} representing the reversed string. + */ +export function reverse(expr: Expr): Reverse; + +/** + * @beta + * + * Creates an expression that reverses a string represented by a field. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * reverse("myString"); + * ``` + * + * @param field The name of the field representing the string to reverse. + * @return A new {@code Expr} representing the reversed string. + */ +export function reverse(field: string): Reverse; +export function reverse(expr: Expr | string): Reverse { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new Reverse(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that replaces the first occurrence of a substring within a string with another substring. + * + * ```typescript + * // Replace the first occurrence of "hello" with "hi" in the 'message' field. + * replaceFirst(Field.of("message"), "hello", "hi"); + * ``` + * + * @param value The expression representing the string to perform the replacement on. + * @param find The substring to search for. + * @param replace The substring to replace the first occurrence of 'find' with. + * @return A new {@code Expr} representing the string with the first occurrence replaced. + */ +export function replaceFirst( + value: Expr, + find: string, + replace: string +): ReplaceFirst; + +/** + * @beta + * + * Creates an expression that replaces the first occurrence of a substring within a string with another substring, + * where the substring to find and the replacement substring are specified by expressions. + * + * ```typescript + * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. + * replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + * ``` + * + * @param value The expression representing the string to perform the replacement on. + * @param find The expression representing the substring to search for. + * @param replace The expression representing the substring to replace the first occurrence of 'find' with. + * @return A new {@code Expr} representing the string with the first occurrence replaced. + */ +export function replaceFirst( + value: Expr, + find: Expr, + replace: Expr +): ReplaceFirst; + +/** + * @beta + * + * Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. + * + * ```typescript + * // Replace the first occurrence of "hello" with "hi" in the 'message' field. + * replaceFirst("message", "hello", "hi"); + * ``` + * + * @param field The name of the field representing the string to perform the replacement on. + * @param find The substring to search for. + * @param replace The substring to replace the first occurrence of 'find' with. + * @return A new {@code Expr} representing the string with the first occurrence replaced. + */ +export function replaceFirst( + field: string, + find: string, + replace: string +): ReplaceFirst; +export function replaceFirst( + value: Expr | string, + find: Expr | string, + replace: Expr | string +): ReplaceFirst { + const normalizedValue = typeof value === 'string' ? Field.of(value) : value; + const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; + const normalizedReplace = + typeof replace === 'string' ? Constant.of(replace) : replace; + return new ReplaceFirst(normalizedValue, normalizedFind, normalizedReplace); +} + +/** + * @beta + * + * Creates an expression that replaces all occurrences of a substring within a string with another substring. + * + * ```typescript + * // Replace all occurrences of "hello" with "hi" in the 'message' field. + * replaceAll(Field.of("message"), "hello", "hi"); + * ``` + * + * @param value The expression representing the string to perform the replacement on. + * @param find The substring to search for. + * @param replace The substring to replace all occurrences of 'find' with. + * @return A new {@code Expr} representing the string with all occurrences replaced. + */ +export function replaceAll( + value: Expr, + find: string, + replace: string +): ReplaceAll; + +/** + * @beta + * + * Creates an expression that replaces all occurrences of a substring within a string with another substring, + * where the substring to find and the replacement substring are specified by expressions. + * + * ```typescript + * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. + * replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + * ``` + * + * @param value The expression representing the string to perform the replacement on. + * @param find The expression representing the substring to search for. + * @param replace The expression representing the substring to replace all occurrences of 'find' with. + * @return A new {@code Expr} representing the string with all occurrences replaced. + */ +export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; + +/** + * @beta + * + * Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. + * + * ```typescript + * // Replace all occurrences of "hello" with "hi" in the 'message' field. + * replaceAll("message", "hello", "hi"); + * ``` + * + * @param field The name of the field representing the string to perform the replacement on. + * @param find The substring to search for. + * @param replace The substring to replace all occurrences of 'find' with. + * @return A new {@code Expr} representing the string with all occurrences replaced. + */ +export function replaceAll( + field: string, + find: string, + replace: string +): ReplaceAll; +export function replaceAll( + value: Expr | string, + find: Expr | string, + replace: Expr | string +): ReplaceAll { + const normalizedValue = typeof value === 'string' ? Field.of(value) : value; + const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; + const normalizedReplace = + typeof replace === 'string' ? Constant.of(replace) : replace; + return new ReplaceAll(normalizedValue, normalizedFind, normalizedReplace); +} + +/** + * @beta + * + * Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. + * + * ```typescript + * // Calculate the length of the 'myString' field in bytes. + * byteLength(Field.of("myString")); + * ``` + * + * @param expr The expression representing the string. + * @return A new {@code Expr} representing the length of the string in bytes. + */ +export function byteLength(expr: Expr): ByteLength; + +/** + * @beta + * + * Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. + * + * ```typescript + * // Calculate the length of the 'myString' field in bytes. + * byteLength("myString"); + * ``` + * + * @param field The name of the field representing the string. + * @return A new {@code Expr} representing the length of the string in bytes. + */ +export function byteLength(field: string): ByteLength; +export function byteLength(expr: Expr | string): ByteLength { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new ByteLength(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that calculates the character length of a string field in UTF8. + * + * ```typescript + * // Get the character length of the 'name' field in UTF-8. + * strLength("name"); + * ``` + * + * @param field The name of the field containing the string. + * @return A new {@code Expr} representing the length of the string. + */ +export function charLength(field: string): CharLength; + +/** + * @beta + * + * Creates an expression that calculates the character length of a string expression in UTF-8. + * + * ```typescript + * // Get the character length of the 'name' field in UTF-8. + * strLength(Field.of("name")); + * ``` + * + * @param expr The expression representing the string to calculate the length of. + * @return A new {@code Expr} representing the length of the string. + */ +export function charLength(expr: Expr): CharLength; +export function charLength(value: Expr | string): CharLength { + const valueExpr = value instanceof Expr ? value : Field.of(value); + return new CharLength(valueExpr); +} + +/** + * @beta + * + * Creates an expression that performs a case-sensitive wildcard string comparison against a + * field. + * + * ```typescript + * // Check if the 'title' field contains the string "guide" + * like("title", "%guide%"); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new {@code Expr} representing the 'like' comparison. + */ +export function like(left: string, pattern: string): Like; + +/** + * @beta + * + * Creates an expression that performs a case-sensitive wildcard string comparison against a + * field. + * + * ```typescript + * // Check if the 'title' field contains the string "guide" + * like("title", Field.of("pattern")); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new {@code Expr} representing the 'like' comparison. + */ +export function like(left: string, pattern: Expr): Like; + +/** + * @beta + * + * Creates an expression that performs a case-sensitive wildcard string comparison. + * + * ```typescript + * // Check if the 'title' field contains the string "guide" + * like(Field.of("title"), "%guide%"); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new {@code Expr} representing the 'like' comparison. + */ +export function like(left: Expr, pattern: string): Like; + +/** + * @beta + * + * Creates an expression that performs a case-sensitive wildcard string comparison. + * + * ```typescript + * // Check if the 'title' field contains the string "guide" + * like(Field.of("title"), Field.of("pattern")); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param pattern The pattern to search for. You can use "%" as a wildcard character. + * @return A new {@code Expr} representing the 'like' comparison. + */ +export function like(left: Expr, pattern: Expr): Like; +export function like(left: Expr | string, pattern: Expr | string): Like { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); + return new Like(leftExpr, patternExpr); +} + +/** + * @beta + * + * Creates an expression that checks if a string field contains a specified regular expression as + * a substring. + * + * ```typescript + * // Check if the 'description' field contains "example" (case-insensitive) + * regexContains("description", "(?i)example"); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The regular expression to use for the search. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function regexContains(left: string, pattern: string): RegexContains; + +/** + * @beta + * + * Creates an expression that checks if a string field contains a specified regular expression as + * a substring. + * + * ```typescript + * // Check if the 'description' field contains "example" (case-insensitive) + * regexContains("description", Field.of("pattern")); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The regular expression to use for the search. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function regexContains(left: string, pattern: Expr): RegexContains; + +/** + * @beta + * + * Creates an expression that checks if a string expression contains a specified regular + * expression as a substring. + * + * ```typescript + * // Check if the 'description' field contains "example" (case-insensitive) + * regexContains(Field.of("description"), "(?i)example"); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param pattern The regular expression to use for the search. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function regexContains(left: Expr, pattern: string): RegexContains; + +/** + * @beta + * + * Creates an expression that checks if a string expression contains a specified regular + * expression as a substring. + * + * ```typescript + * // Check if the 'description' field contains "example" (case-insensitive) + * regexContains(Field.of("description"), Field.of("pattern")); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param pattern The regular expression to use for the search. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function regexContains(left: Expr, pattern: Expr): RegexContains; +export function regexContains( + left: Expr | string, + pattern: Expr | string +): RegexContains { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); + return new RegexContains(leftExpr, patternExpr); +} + +/** + * @beta + * + * Creates an expression that checks if a string field matches a specified regular expression. + * + * ```typescript + * // Check if the 'email' field matches a valid email pattern + * regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The regular expression to use for the match. + * @return A new {@code Expr} representing the regular expression match. + */ +export function regexMatch(left: string, pattern: string): RegexMatch; + +/** + * @beta + * + * Creates an expression that checks if a string field matches a specified regular expression. + * + * ```typescript + * // Check if the 'email' field matches a valid email pattern + * regexMatch("email", Field.of("pattern")); + * ``` + * + * @param left The name of the field containing the string. + * @param pattern The regular expression to use for the match. + * @return A new {@code Expr} representing the regular expression match. + */ +export function regexMatch(left: string, pattern: Expr): RegexMatch; + +/** + * @beta + * + * Creates an expression that checks if a string expression matches a specified regular + * expression. + * + * ```typescript + * // Check if the 'email' field matches a valid email pattern + * regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + * ``` + * + * @param left The expression representing the string to match against. + * @param pattern The regular expression to use for the match. + * @return A new {@code Expr} representing the regular expression match. + */ +export function regexMatch(left: Expr, pattern: string): RegexMatch; + +/** + * @beta + * + * Creates an expression that checks if a string expression matches a specified regular + * expression. + * + * ```typescript + * // Check if the 'email' field matches a valid email pattern + * regexMatch(Field.of("email"), Field.of("pattern")); + * ``` + * + * @param left The expression representing the string to match against. + * @param pattern The regular expression to use for the match. + * @return A new {@code Expr} representing the regular expression match. + */ +export function regexMatch(left: Expr, pattern: Expr): RegexMatch; +export function regexMatch( + left: Expr | string, + pattern: Expr | string +): RegexMatch { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); + return new RegexMatch(leftExpr, patternExpr); +} + +/** + * @beta + * + * Creates an expression that checks if a string field contains a specified substring. + * + * ```typescript + * // Check if the 'description' field contains "example". + * strContains("description", "example"); + * ``` + * + * @param left The name of the field containing the string. + * @param substring The substring to search for. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function strContains(left: string, substring: string): StrContains; + +/** + * @beta + * + * Creates an expression that checks if a string field contains a substring specified by an expression. + * + * ```typescript + * // Check if the 'description' field contains the value of the 'keyword' field. + * strContains("description", Field.of("keyword")); + * ``` + * + * @param left The name of the field containing the string. + * @param substring The expression representing the substring to search for. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function strContains(left: string, substring: Expr): StrContains; + +/** + * @beta + * + * Creates an expression that checks if a string expression contains a specified substring. + * + * ```typescript + * // Check if the 'description' field contains "example". + * strContains(Field.of("description"), "example"); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param substring The substring to search for. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function strContains(left: Expr, substring: string): StrContains; + +/** + * @beta + * + * Creates an expression that checks if a string expression contains a substring specified by another expression. + * + * ```typescript + * // Check if the 'description' field contains the value of the 'keyword' field. + * strContains(Field.of("description"), Field.of("keyword")); + * ``` + * + * @param left The expression representing the string to perform the comparison on. + * @param substring The expression representing the substring to search for. + * @return A new {@code Expr} representing the 'contains' comparison. + */ +export function strContains(left: Expr, substring: Expr): StrContains; +export function strContains( + left: Expr | string, + substring: Expr | string +): StrContains { + const leftExpr = left instanceof Expr ? left : Field.of(left); + const substringExpr = + substring instanceof Expr ? substring : Constant.of(substring); + return new StrContains(leftExpr, substringExpr); +} + +/** + * @beta + * + * Creates an expression that checks if a field's value starts with a given prefix. + * + * ```typescript + * // Check if the 'name' field starts with "Mr." + * startsWith("name", "Mr."); + * ``` + * + * @param expr The field name to check. + * @param prefix The prefix to check for. + * @return A new {@code Expr} representing the 'starts with' comparison. + */ +export function startsWith(expr: string, prefix: string): StartsWith; + +/** + * @beta + * + * Creates an expression that checks if a field's value starts with a given prefix. + * + * ```typescript + * // Check if the 'fullName' field starts with the value of the 'firstName' field + * startsWith("fullName", Field.of("firstName")); + * ``` + * + * @param expr The field name to check. + * @param prefix The expression representing the prefix. + * @return A new {@code Expr} representing the 'starts with' comparison. + */ +export function startsWith(expr: string, prefix: Expr): StartsWith; + +/** + * @beta + * + * Creates an expression that checks if a string expression starts with a given prefix. + * + * ```typescript + * // Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." + * startsWith(Field.of("fullName"), "Mr."); + * ``` + * + * @param expr The expression to check. + * @param prefix The prefix to check for. + * @return A new {@code Expr} representing the 'starts with' comparison. + */ +export function startsWith(expr: Expr, prefix: string): StartsWith; + +/** + * @beta + * + * Creates an expression that checks if a string expression starts with a given prefix. + * + * ```typescript + * // Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." + * startsWith(Field.of("fullName"), Field.of("prefix")); + * ``` + * + * @param expr The expression to check. + * @param prefix The prefix to check for. + * @return A new {@code Expr} representing the 'starts with' comparison. + */ +export function startsWith(expr: Expr, prefix: Expr): StartsWith; +export function startsWith( + expr: Expr | string, + prefix: Expr | string +): StartsWith { + const exprLeft = expr instanceof Expr ? expr : Field.of(expr); + const prefixExpr = prefix instanceof Expr ? prefix : Constant.of(prefix); + return new StartsWith(exprLeft, prefixExpr); +} + +/** + * @beta + * + * Creates an expression that checks if a field's value ends with a given postfix. + * + * ```typescript + * // Check if the 'filename' field ends with ".txt" + * endsWith("filename", ".txt"); + * ``` + * + * @param expr The field name to check. + * @param suffix The postfix to check for. + * @return A new {@code Expr} representing the 'ends with' comparison. + */ +export function endsWith(expr: string, suffix: string): EndsWith; + +/** + * @beta + * + * Creates an expression that checks if a field's value ends with a given postfix. + * + * ```typescript + * // Check if the 'url' field ends with the value of the 'extension' field + * endsWith("url", Field.of("extension")); + * ``` + * + * @param expr The field name to check. + * @param suffix The expression representing the postfix. + * @return A new {@code Expr} representing the 'ends with' comparison. + */ +export function endsWith(expr: string, suffix: Expr): EndsWith; + +/** + * @beta + * + * Creates an expression that checks if a string expression ends with a given postfix. + * + * ```typescript + * // Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." + * endsWith(Field.of("fullName"), "Jr."); + * ``` + * + * @param expr The expression to check. + * @param suffix The postfix to check for. + * @return A new {@code Expr} representing the 'ends with' comparison. + */ +export function endsWith(expr: Expr, suffix: string): EndsWith; + +/** + * @beta + * + * Creates an expression that checks if a string expression ends with a given postfix. + * + * ```typescript + * // Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." + * endsWith(Field.of("fullName"), Constant.of("Jr.")); + * ``` + * + * @param expr The expression to check. + * @param suffix The postfix to check for. + * @return A new {@code Expr} representing the 'ends with' comparison. + */ +export function endsWith(expr: Expr, suffix: Expr): EndsWith; +export function endsWith(expr: Expr | string, suffix: Expr | string): EndsWith { + const exprLeft = expr instanceof Expr ? expr : Field.of(expr); + const suffixExpr = suffix instanceof Expr ? suffix : Constant.of(suffix); + return new EndsWith(exprLeft, suffixExpr); +} + +/** + * @beta + * + * Creates an expression that converts a string field to lowercase. + * + * ```typescript + * // Convert the 'name' field to lowercase + * toLower("name"); + * ``` + * + * @param expr The name of the field containing the string. + * @return A new {@code Expr} representing the lowercase string. + */ +export function toLower(expr: string): ToLower; + +/** + * @beta + * + * Creates an expression that converts a string expression to lowercase. + * + * ```typescript + * // Convert the 'name' field to lowercase + * toLower(Field.of("name")); + * ``` + * + * @param expr The expression representing the string to convert to lowercase. + * @return A new {@code Expr} representing the lowercase string. + */ +export function toLower(expr: Expr): ToLower; +export function toLower(expr: Expr | string): ToLower { + return new ToLower(expr instanceof Expr ? expr : Field.of(expr)); +} + +/** + * @beta + * + * Creates an expression that converts a string field to uppercase. + * + * ```typescript + * // Convert the 'title' field to uppercase + * toUpper("title"); + * ``` + * + * @param expr The name of the field containing the string. + * @return A new {@code Expr} representing the uppercase string. + */ +export function toUpper(expr: string): ToUpper; + +/** + * @beta + * + * Creates an expression that converts a string expression to uppercase. + * + * ```typescript + * // Convert the 'title' field to uppercase + * toUppercase(Field.of("title")); + * ``` + * + * @param expr The expression representing the string to convert to uppercase. + * @return A new {@code Expr} representing the uppercase string. + */ +export function toUpper(expr: Expr): ToUpper; +export function toUpper(expr: Expr | string): ToUpper { + return new ToUpper(expr instanceof Expr ? expr : Field.of(expr)); +} + +/** + * @beta + * + * Creates an expression that removes leading and trailing whitespace from a string field. + * + * ```typescript + * // Trim whitespace from the 'userInput' field + * trim("userInput"); + * ``` + * + * @param expr The name of the field containing the string. + * @return A new {@code Expr} representing the trimmed string. + */ +export function trim(expr: string): Trim; + +/** + * @beta + * + * Creates an expression that removes leading and trailing whitespace from a string expression. + * + * ```typescript + * // Trim whitespace from the 'userInput' field + * trim(Field.of("userInput")); + * ``` + * + * @param expr The expression representing the string to trim. + * @return A new {@code Expr} representing the trimmed string. + */ +export function trim(expr: Expr): Trim; +export function trim(expr: Expr | string): Trim { + return new Trim(expr instanceof Expr ? expr : Field.of(expr)); +} + +/** + * @beta + * + * Creates an expression that concatenates string functions, fields or constants together. + * + * ```typescript + * // Combine the 'firstName', " ", and 'lastName' fields into a single string + * strConcat("firstName", " ", Field.of("lastName")); + * ``` + * + * @param first The field name containing the initial string value. + * @param elements The expressions (typically strings) to concatenate. + * @return A new {@code Expr} representing the concatenated string. + */ +export function strConcat( + first: string, + ...elements: Array +): StrConcat; + +/** + * @beta + * Creates an expression that concatenates string expressions together. + * + * ```typescript + * // Combine the 'firstName', " ", and 'lastName' fields into a single string + * strConcat(Field.of("firstName"), " ", Field.of("lastName")); + * ``` + * + * @param first The initial string expression to concatenate to. + * @param elements The expressions (typically strings) to concatenate. + * @return A new {@code Expr} representing the concatenated string. + */ +export function strConcat( + first: Expr, + ...elements: Array +): StrConcat; +export function strConcat( + first: string | Expr, + ...elements: Array +): StrConcat { + const exprs = elements.map(e => (e instanceof Expr ? e : Constant.of(e))); + return new StrConcat(first instanceof Expr ? first : Field.of(first), exprs); +} + +/** + * @beta + * + * Accesses a value from a map (object) field using the provided key. + * + * ```typescript + * // Get the 'city' value from the 'address' map field + * mapGet("address", "city"); + * ``` + * + * @param mapField The field name of the map field. + * @param subField The key to access in the map. + * @return A new {@code Expr} representing the value associated with the given key in the map. + */ +export function mapGet(mapField: string, subField: string): MapGet; + +/** + * @beta + * + * Accesses a value from a map (object) expression using the provided key. + * + * ```typescript + * // Get the 'city' value from the 'address' map field + * mapGet(Field.of("address"), "city"); + * ``` + * + * @param mapExpr The expression representing the map. + * @param subField The key to access in the map. + * @return A new {@code Expr} representing the value associated with the given key in the map. + */ +export function mapGet(mapExpr: Expr, subField: string): MapGet; +export function mapGet(fieldOrExpr: string | Expr, subField: string): MapGet { + return new MapGet( + typeof fieldOrExpr === 'string' ? Field.of(fieldOrExpr) : fieldOrExpr, + subField + ); +} + +/** + * @beta + * + * Creates an aggregation that counts the total number of stage inputs. + * + * ```typescript + * // Count the total number of users + * countAll().as("totalUsers"); + * ``` + * + * @return A new {@code Accumulator} representing the 'countAll' aggregation. + */ +export function countAll(): Count { + return new Count(undefined, false); +} + +/** + * @beta + * + * Creates an aggregation that counts the number of stage inputs with valid evaluations of the + * provided expression. + * + * ```typescript + * // Count the number of items where the price is greater than 10 + * count(Field.of("price").gt(10)).as("expensiveItemCount"); + * ``` + * + * @param value The expression to count. + * @return A new {@code Accumulator} representing the 'count' aggregation. + */ +export function count(value: Expr): Count; + +/** + * Creates an aggregation that counts the number of stage inputs with valid evaluations of the + * provided field. + * + * ```typescript + * // Count the total number of products + * count("productId").as("totalProducts"); + * ``` + * + * @param value The name of the field to count. + * @return A new {@code Accumulator} representing the 'count' aggregation. + */ +export function count(value: string): Count; +export function count(value: Expr | string): Count { + const exprValue = value instanceof Expr ? value : Field.of(value); + return new Count(exprValue, false); +} + +/** + * @beta + * + * Creates an aggregation that calculates the sum of values from an expression across multiple + * stage inputs. + * + * ```typescript + * // Calculate the total revenue from a set of orders + * sum(Field.of("orderAmount")).as("totalRevenue"); + * ``` + * + * @param value The expression to sum up. + * @return A new {@code Accumulator} representing the 'sum' aggregation. + */ +export function sum(value: Expr): Sum; + +/** + * @beta + * + * Creates an aggregation that calculates the sum of a field's values across multiple stage + * inputs. + * + * ```typescript + * // Calculate the total revenue from a set of orders + * sum("orderAmount").as("totalRevenue"); + * ``` + * + * @param value The name of the field containing numeric values to sum up. + * @return A new {@code Accumulator} representing the 'sum' aggregation. + */ +export function sum(value: string): Sum; +export function sum(value: Expr | string): Sum { + const exprValue = value instanceof Expr ? value : Field.of(value); + return new Sum(exprValue, false); +} + +/** + * @beta + * + * Creates an aggregation that calculates the average (mean) of values from an expression across + * multiple stage inputs. + * + * ```typescript + * // Calculate the average age of users + * avg(Field.of("age")).as("averageAge"); + * ``` + * + * @param value The expression representing the values to average. + * @return A new {@code Accumulator} representing the 'avg' aggregation. + */ +export function avg(value: Expr): Avg; + +/** + * @beta + * + * Creates an aggregation that calculates the average (mean) of a field's values across multiple + * stage inputs. + * + * ```typescript + * // Calculate the average age of users + * avg("age").as("averageAge"); + * ``` + * + * @param value The name of the field containing numeric values to average. + * @return A new {@code Accumulator} representing the 'avg' aggregation. + */ +export function avg(value: string): Avg; +export function avg(value: Expr | string): Avg { + const exprValue = value instanceof Expr ? value : Field.of(value); + return new Avg(exprValue, false); +} + +/** + * @beta + * + * Creates an aggregation that finds the minimum value of an expression across multiple stage + * inputs. + * + * ```typescript + * // Find the lowest price of all products + * min(Field.of("price")).as("lowestPrice"); + * ``` + * + * @param value The expression to find the minimum value of. + * @return A new {@code Accumulator} representing the 'min' aggregation. + */ +export function min(value: Expr): Min; + +/** + * @beta + * + * Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + * + * ```typescript + * // Find the lowest price of all products + * min("price").as("lowestPrice"); + * ``` + * + * @param value The name of the field to find the minimum value of. + * @return A new {@code Accumulator} representing the 'min' aggregation. + */ +export function min(value: string): Min; +export function min(value: Expr | string): Min { + const exprValue = value instanceof Expr ? value : Field.of(value); + return new Min(exprValue, false); +} + +/** + * @beta + * + * Creates an aggregation that finds the maximum value of an expression across multiple stage + * inputs. + * + * ```typescript + * // Find the highest score in a leaderboard + * max(Field.of("score")).as("highestScore"); + * ``` + * + * @param value The expression to find the maximum value of. + * @return A new {@code Accumulator} representing the 'max' aggregation. + */ +export function max(value: Expr): Max; + +/** + * @beta + * + * Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + * + * ```typescript + * // Find the highest score in a leaderboard + * max("score").as("highestScore"); + * ``` + * + * @param value The name of the field to find the maximum value of. + * @return A new {@code Accumulator} representing the 'max' aggregation. + */ +export function max(value: string): Max; +export function max(value: Expr | string): Max { + const exprValue = value instanceof Expr ? value : Field.of(value); + return new Max(exprValue, false); +} + +/** + * @beta + * + * Calculates the Cosine distance between a field's vector value and a double array. + * + * ```typescript + * // Calculate the Cosine distance between the 'location' field and a target location + * cosineDistance("location", [37.7749, -122.4194]); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as an array of doubles) to compare against. + * @return A new {@code Expr} representing the Cosine distance between the two vectors. + */ +export function cosineDistance(expr: string, other: number[]): CosineDistance; + +/** + * @beta + * + * Calculates the Cosine distance between a field's vector value and a VectorValue. + * + * ```typescript + * // Calculate the Cosine distance between the 'location' field and a target location + * cosineDistance("location", new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as a VectorValue) to compare against. + * @return A new {@code Expr} representing the Cosine distance between the two vectors. + */ +export function cosineDistance( + expr: string, + other: VectorValue +): CosineDistance; + +/** + * @beta + * + * Calculates the Cosine distance between a field's vector value and a vector expression. + * + * ```typescript + * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field + * cosineDistance("userVector", Field.of("itemVector")); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (represented as an Expr) to compare against. + * @return A new {@code Expr} representing the cosine distance between the two vectors. + */ +export function cosineDistance(expr: string, other: Expr): CosineDistance; + +/** + * @beta + * + * Calculates the Cosine distance between a vector expression and a double array. + * + * ```typescript + * // Calculate the cosine distance between the 'location' field and a target location + * cosineDistance(Field.of("location"), [37.7749, -122.4194]); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (as an array of doubles) to compare against. + * @return A new {@code Expr} representing the cosine distance between the two vectors. + */ +export function cosineDistance(expr: Expr, other: number[]): CosineDistance; + +/** + * @beta + * + * Calculates the Cosine distance between a vector expression and a VectorValue. + * + * ```typescript + * // Calculate the cosine distance between the 'location' field and a target location + * cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (as a VectorValue) to compare against. + * @return A new {@code Expr} representing the cosine distance between the two vectors. + */ +export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; + +/** + * @beta + * + * Calculates the Cosine distance between two vector expressions. + * + * ```typescript + * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field + * cosineDistance(Field.of("userVector"), Field.of("itemVector")); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (represented as an Expr) to compare against. + * @return A new {@code Expr} representing the cosine distance between the two vectors. + */ +export function cosineDistance(expr: Expr, other: Expr): CosineDistance; +export function cosineDistance( + expr: Expr | string, + other: Expr | number[] | VectorValue +): CosineDistance { + const expr1 = expr instanceof Expr ? expr : Field.of(expr); + const expr2 = other instanceof Expr ? other : Constant.vector(other); + return new CosineDistance(expr1, expr2); +} + +/** + * @beta + * + * Calculates the dot product between a field's vector value and a double array. + * + * ```typescript + * // Calculate the dot product distance between a feature vector and a target vector + * dotProduct("features", [0.5, 0.8, 0.2]); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as an array of doubles) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: string, other: number[]): DotProduct; + +/** + * @beta + * + * Calculates the dot product between a field's vector value and a VectorValue. + * + * ```typescript + * // Calculate the dot product distance between a feature vector and a target vector + * dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as a VectorValue) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: string, other: VectorValue): DotProduct; + +/** + * @beta + * + * Calculates the dot product between a field's vector value and a vector expression. + * + * ```typescript + * // Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' + * dotProduct("docVector1", Field.of("docVector2")); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (represented as an Expr) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: string, other: Expr): DotProduct; + +/** + * @beta + * + * Calculates the dot product between a vector expression and a double array. + * + * ```typescript + * // Calculate the dot product between a feature vector and a target vector + * dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); + * ``` + * + * @param expr The first vector (represented as an Expr) to calculate with. + * @param other The other vector (as an array of doubles) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: Expr, other: number[]): DotProduct; + +/** + * @beta + * + * Calculates the dot product between a vector expression and a VectorValue. + * + * ```typescript + * // Calculate the dot product between a feature vector and a target vector + * dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + * ``` + * + * @param expr The first vector (represented as an Expr) to calculate with. + * @param other The other vector (as a VectorValue) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: Expr, other: VectorValue): DotProduct; + +/** + * @beta + * + * Calculates the dot product between two vector expressions. + * + * ```typescript + * // Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' + * dotProduct(Field.of("docVector1"), Field.of("docVector2")); + * ``` + * + * @param expr The first vector (represented as an Expr) to calculate with. + * @param other The other vector (represented as an Expr) to calculate with. + * @return A new {@code Expr} representing the dot product between the two vectors. + */ +export function dotProduct(expr: Expr, other: Expr): DotProduct; +export function dotProduct( + expr: Expr | string, + other: Expr | number[] | VectorValue +): DotProduct { + const expr1 = expr instanceof Expr ? expr : Field.of(expr); + const expr2 = other instanceof Expr ? other : Constant.vector(other); + return new DotProduct(expr1, expr2); +} + +/** + * @beta + * + * Calculates the Euclidean distance between a field's vector value and a double array. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * euclideanDistance("location", [37.7749, -122.4194]); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as an array of doubles) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance( + expr: string, + other: number[] +): EuclideanDistance; + +/** + * @beta + * + * Calculates the Euclidean distance between a field's vector value and a VectorValue. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * euclideanDistance("location", new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (as a VectorValue) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance( + expr: string, + other: VectorValue +): EuclideanDistance; + +/** + * @beta + * + * Calculates the Euclidean distance between a field's vector value and a vector expression. + * + * ```typescript + * // Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' + * euclideanDistance("pointA", Field.of("pointB")); + * ``` + * + * @param expr The name of the field containing the first vector. + * @param other The other vector (represented as an Expr) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; + +/** + * @beta + * + * Calculates the Euclidean distance between a vector expression and a double array. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * + * euclideanDistance(Field.of("location"), [37.7749, -122.4194]); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (as an array of doubles) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance( + expr: Expr, + other: number[] +): EuclideanDistance; + +/** + * @beta + * + * Calculates the Euclidean distance between a vector expression and a VectorValue. + * + * ```typescript + * // Calculate the Euclidean distance between the 'location' field and a target location + * euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (as a VectorValue) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance( + expr: Expr, + other: VectorValue +): EuclideanDistance; + +/** + * @beta + * + * Calculates the Euclidean distance between two vector expressions. + * + * ```typescript + * // Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' + * euclideanDistance(Field.of("pointA"), Field.of("pointB")); + * ``` + * + * @param expr The first vector (represented as an Expr) to compare against. + * @param other The other vector (represented as an Expr) to compare against. + * @return A new {@code Expr} representing the Euclidean distance between the two vectors. + */ +export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; +export function euclideanDistance( + expr: Expr | string, + other: Expr | number[] | VectorValue +): EuclideanDistance { + const expr1 = expr instanceof Expr ? expr : Field.of(expr); + const expr2 = other instanceof Expr ? other : Constant.vector(other); + return new EuclideanDistance(expr1, expr2); +} + +/** + * @beta + * + * Creates an expression that calculates the length of a Firestore Vector. + * + * ```typescript + * // Get the vector length (dimension) of the field 'embedding'. + * vectorLength(Field.of("embedding")); + * ``` + * + * @param expr The expression representing the Firestore Vector. + * @return A new {@code Expr} representing the length of the array. + */ +export function vectorLength(expr: Expr): VectorLength; + +/** + * @beta + * + * Creates an expression that calculates the length of a Firestore Vector represented by a field. + * + * ```typescript + * // Get the vector length (dimension) of the field 'embedding'. + * vectorLength("embedding"); + * ``` + * + * @param field The name of the field representing the Firestore Vector. + * @return A new {@code Expr} representing the length of the array. + */ +export function vectorLength(field: string): VectorLength; +export function vectorLength(expr: Expr | string): VectorLength { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new VectorLength(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'microseconds' field as microseconds since epoch. + * unixMicrosToTimestamp(Field.of("microseconds")); + * ``` + * + * @param expr The expression representing the number of microseconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; + +/** + * @beta + * + * Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'microseconds' field as microseconds since epoch. + * unixMicrosToTimestamp("microseconds"); + * ``` + * + * @param field The name of the field representing the number of microseconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; +export function unixMicrosToTimestamp( + expr: Expr | string +): UnixMicrosToTimestamp { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new UnixMicrosToTimestamp(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to microseconds since epoch. + * timestampToUnixMicros(Field.of("timestamp")); + * ``` + * + * @param expr The expression representing the timestamp. + * @return A new {@code Expr} representing the number of microseconds since epoch. + */ +export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; + +/** + * @beta + * + * Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to microseconds since epoch. + * timestampToUnixMicros("timestamp"); + * ``` + * + * @param field The name of the field representing the timestamp. + * @return A new {@code Expr} representing the number of microseconds since epoch. + */ +export function timestampToUnixMicros(field: string): TimestampToUnixMicros; +export function timestampToUnixMicros( + expr: Expr | string +): TimestampToUnixMicros { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new TimestampToUnixMicros(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'milliseconds' field as milliseconds since epoch. + * unixMillisToTimestamp(Field.of("milliseconds")); + * ``` + * + * @param expr The expression representing the number of milliseconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; + +/** + * @beta + * + * Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'milliseconds' field as milliseconds since epoch. + * unixMillisToTimestamp("milliseconds"); + * ``` + * + * @param field The name of the field representing the number of milliseconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; +export function unixMillisToTimestamp( + expr: Expr | string +): UnixMillisToTimestamp { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new UnixMillisToTimestamp(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to milliseconds since epoch. + * timestampToUnixMillis(Field.of("timestamp")); + * ``` + * + * @param expr The expression representing the timestamp. + * @return A new {@code Expr} representing the number of milliseconds since epoch. + */ +export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; + +/** + * @beta + * + * Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to milliseconds since epoch. + * timestampToUnixMillis("timestamp"); + * ``` + * + * @param field The name of the field representing the timestamp. + * @return A new {@code Expr} representing the number of milliseconds since epoch. + */ +export function timestampToUnixMillis(field: string): TimestampToUnixMillis; +export function timestampToUnixMillis( + expr: Expr | string +): TimestampToUnixMillis { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new TimestampToUnixMillis(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'seconds' field as seconds since epoch. + * unixSecondsToTimestamp(Field.of("seconds")); + * ``` + * + * @param expr The expression representing the number of seconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; + +/** + * @beta + * + * Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) + * and returns a timestamp. + * + * ```typescript + * // Interpret the 'seconds' field as seconds since epoch. + * unixSecondsToTimestamp("seconds"); + * ``` + * + * @param field The name of the field representing the number of seconds since epoch. + * @return A new {@code Expr} representing the timestamp. + */ +export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; +export function unixSecondsToTimestamp( + expr: Expr | string +): UnixSecondsToTimestamp { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new UnixSecondsToTimestamp(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to seconds since epoch. + * timestampToUnixSeconds(Field.of("timestamp")); + * ``` + * + * @param expr The expression representing the timestamp. + * @return A new {@code Expr} representing the number of seconds since epoch. + */ +export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; + +/** + * @beta + * + * Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + * + * ```typescript + * // Convert the 'timestamp' field to seconds since epoch. + * timestampToUnixSeconds("timestamp"); + * ``` + * + * @param field The name of the field representing the timestamp. + * @return A new {@code Expr} representing the number of seconds since epoch. + */ +export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; +export function timestampToUnixSeconds( + expr: Expr | string +): TimestampToUnixSeconds { + const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; + return new TimestampToUnixSeconds(normalizedExpr); +} + +/** + * @beta + * + * Creates an expression that adds a specified amount of time to a timestamp. + * + * ```typescript + * // Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. + * timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + * ``` + * + * @param timestamp The expression representing the timestamp. + * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. + * @param amount The expression evaluates to amount of the unit. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampAdd( + timestamp: Expr, + unit: Expr, + amount: Expr +): TimestampAdd; + +/** + * @beta + * + * Creates an expression that adds a specified amount of time to a timestamp. + * + * ```typescript + * // Add 1 day to the 'timestamp' field. + * timestampAdd(Field.of("timestamp"), "day", 1); + * ``` + * + * @param timestamp The expression representing the timestamp. + * @param unit The unit of time to add (e.g., "day", "hour"). + * @param amount The amount of time to add. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampAdd( + timestamp: Expr, + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number +): TimestampAdd; + +/** + * @beta + * + * Creates an expression that adds a specified amount of time to a timestamp represented by a field. + * + * ```typescript + * // Add 1 day to the 'timestamp' field. + * timestampAdd("timestamp", "day", 1); + * ``` + * + * @param field The name of the field representing the timestamp. + * @param unit The unit of time to add (e.g., "day", "hour"). + * @param amount The amount of time to add. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampAdd( + field: string, + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number +): TimestampAdd; +export function timestampAdd( + timestamp: Expr | string, + unit: + | Expr + | 'microsecond' + | 'millisecond' + | 'second' + | 'minute' + | 'hour' + | 'day', + amount: Expr | number +): TimestampAdd { + const normalizedTimestamp = + typeof timestamp === 'string' ? Field.of(timestamp) : timestamp; + const normalizedUnit = unit instanceof Expr ? unit : Constant.of(unit); + const normalizedAmount = + typeof amount === 'number' ? Constant.of(amount) : amount; + return new TimestampAdd( + normalizedTimestamp, + normalizedUnit, + normalizedAmount + ); +} + +/** + * @beta + * + * Creates an expression that subtracts a specified amount of time from a timestamp. + * + * ```typescript + * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. + * timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + * ``` + * + * @param timestamp The expression representing the timestamp. + * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. + * @param amount The expression evaluates to amount of the unit. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampSub( + timestamp: Expr, + unit: Expr, + amount: Expr +): TimestampSub; + +/** + * @beta + * + * Creates an expression that subtracts a specified amount of time from a timestamp. + * + * ```typescript + * // Subtract 1 day from the 'timestamp' field. + * timestampSub(Field.of("timestamp"), "day", 1); + * ``` + * + * @param timestamp The expression representing the timestamp. + * @param unit The unit of time to subtract (e.g., "day", "hour"). + * @param amount The amount of time to subtract. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampSub( + timestamp: Expr, + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number +): TimestampSub; + +/** + * @beta + * + * Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. + * + * ```typescript + * // Subtract 1 day from the 'timestamp' field. + * timestampSub("timestamp", "day", 1); + * ``` + * + * @param field The name of the field representing the timestamp. + * @param unit The unit of time to subtract (e.g., "day", "hour"). + * @param amount The amount of time to subtract. + * @return A new {@code Expr} representing the resulting timestamp. + */ +export function timestampSub( + field: string, + unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', + amount: number +): TimestampSub; +export function timestampSub( + timestamp: Expr | string, + unit: + | Expr + | 'microsecond' + | 'millisecond' + | 'second' + | 'minute' + | 'hour' + | 'day', + amount: Expr | number +): TimestampSub { + const normalizedTimestamp = + typeof timestamp === 'string' ? Field.of(timestamp) : timestamp; + const normalizedUnit = unit instanceof Expr ? unit : Constant.of(unit); + const normalizedAmount = + typeof amount === 'number' ? Constant.of(amount) : amount; + return new TimestampSub( + normalizedTimestamp, + normalizedUnit, + normalizedAmount + ); +} + +/** + * @beta + * + * Creates functions that work on the backend but do not exist in the SDK yet. + * + * ```typescript + * // Call a user defined function named "myFunc" with the arguments 10 and 20 + * // This is the same of the 'sum(Field.of("price"))', if it did not exist + * genericFunction("sum", [Field.of("price")]); + * ``` + * + * @param name The name of the user defined function. + * @param params The arguments to pass to the function. + * @return A new {@code Function} representing the function call. + */ +export function genericFunction(name: string, params: Expr[]): FirestoreFunction { + return new FirestoreFunction(name, params); +} + +/** + * @beta + * + * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * + * ```typescript + * // Sort documents by the 'name' field in ascending order + * firestore.pipeline().collection("users") + * .sort(ascending(Field.of("name"))); + * ``` + * + * @param expr The expression to create an ascending ordering for. + * @return A new `Ordering` for ascending sorting. + */ +export function ascending(expr: Expr): Ordering { + return new Ordering(expr, 'ascending'); +} + +/** + * @beta + * + * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * + * ```typescript + * // Sort documents by the 'createdAt' field in descending order + * firestore.pipeline().collection("users") + * .sort(descending(Field.of("createdAt"))); + * ``` + * + * @param expr The expression to create a descending ordering for. + * @return A new `Ordering` for descending sorting. + */ +export function descending(expr: Expr): Ordering { + return new Ordering(expr, 'descending'); +} + +/** + * @beta + * + * Represents an ordering criterion for sorting documents in a Firestore pipeline. + * + * You create `Ordering` instances using the `ascending` and `descending` helper functions. + */ +export class Ordering { + constructor( + private expr: Expr, + private direction: 'ascending' | 'descending' + ) {} + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + mapValue: { + fields: { + direction: toStringValue(this.direction), + expression: this.expr._toProto(serializer) + } + } + }; + } + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader): void { + this.expr._readUserData(dataReader); + } +} diff --git a/packages/firestore/src/pipelines/api/pipeline-result.ts b/packages/firestore/src/pipelines/api/pipeline-result.ts new file mode 100644 index 00000000000..243a79a82d3 --- /dev/null +++ b/packages/firestore/src/pipelines/api/pipeline-result.ts @@ -0,0 +1,232 @@ +// Copyright 2024 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 { FieldPath } from '../../lite-api/field_path'; +import { + DocumentData, + DocumentReference, + refEqual +} from '../../lite-api/reference'; +import { fieldPathFromArgument } from '../../lite-api/snapshot'; +import { Timestamp } from '../../lite-api/timestamp'; +import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; +import { ObjectValue } from '../../model/object_value'; +import { isOptionalEqual } from '../../util/misc'; + +/** + * @beta + * + * A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the + * {@link #data()} or {@link #get(String)} methods. + * + *

If the PipelineResult represents a non-document result, `ref` will return a undefined + * value. + */ +export class PipelineResult { + private readonly _userDataWriter: AbstractUserDataWriter; + + private readonly _executionTime: Timestamp | undefined; + private readonly _createTime: Timestamp | undefined; + private readonly _updateTime: Timestamp | undefined; + + /** + * @internal + * @private + */ + readonly _ref: DocumentReference | undefined; + + /** + * @internal + * @private + */ + readonly _fields: ObjectValue | undefined; + + /** + * @private + * @internal + * + * @param userDataWriter The serializer used to encode/decode protobuf. + * @param ref The reference to the document. + * @param _fieldsProto The fields of the Firestore `Document` Protobuf backing + * this document (or undefined if the document does not exist). + * @param readTime The time when this result was read (or undefined if + * the document exists only locally). + * @param createTime The time when the document was created if the result is a document, undefined otherwise. + * @param updateTime The time when the document was last updated if the result is a document, undefined otherwise. + */ + constructor( + userDataWriter: AbstractUserDataWriter, + ref?: DocumentReference, + fields?: ObjectValue, + executionTime?: Timestamp, + createTime?: Timestamp, + updateTime?: Timestamp + // TODO converter + //readonly converter: FirestorePipelineConverter = defaultPipelineConverter() + ) { + this._ref = ref; + this._userDataWriter = userDataWriter; + this._executionTime = executionTime; + this._createTime = createTime; + this._updateTime = updateTime; + this._fields = fields; + } + + /** + * The reference of the document, if it is a document; otherwise `undefined`. + */ + get ref(): DocumentReference | undefined { + return this._ref; + } + + /** + * The ID of the document for which this PipelineResult contains data, if it is a document; otherwise `undefined`. + * + * @type {string} + * @readonly + * + */ + get id(): string | undefined { + return this._ref?.id; + } + + /** + * The time the document was created. Undefined if this result is not a document. + * + * @type {Timestamp|undefined} + * @readonly + */ + get createTime(): Timestamp | undefined { + return this._createTime; + } + + /** + * The time the document was last updated (at the time the snapshot was + * generated). Undefined if this result is not a document. + * + * @type {Timestamp|undefined} + * @readonly + */ + get updateTime(): Timestamp | undefined { + return this._updateTime; + } + + /** + * The time at which the pipeline producing this result is executed. + * + * @type {Timestamp} + * @readonly + * + */ + get executionTime(): Timestamp { + if (this._executionTime === undefined) { + throw new Error( + "'executionTime' is expected to exist, but it is undefined" + ); + } + return this._executionTime; + } + + /** + * Retrieves all fields in the result as an object. Returns 'undefined' if + * the document doesn't exist. + * + * @returns {T|undefined} An object containing all fields in the document or + * 'undefined' if the document doesn't exist. + * + * @example + * ``` + * let p = firestore.pipeline().collection('col'); + * + * p.execute().then(results => { + * let data = results[0].data(); + * console.log(`Retrieved data: ${JSON.stringify(data)}`); + * }); + * ``` + */ + data(): AppModelType | undefined { + if (this._fields === undefined) { + return undefined; + } + + // TODO(pipelines) + // We only want to use the converter and create a new QueryDocumentSnapshot + // if a converter has been provided. + // if (!!this.converter && this.converter !== defaultPipelineConverter()) { + // return this.converter.fromFirestore( + // new PipelineResult< DocumentData>( + // this._serializer, + // this.ref, + // this._fieldsProto, + // this._executionTime, + // this.createTime, + // this.updateTime, + // defaultPipelineConverter() + // ) + // ); + // } else {{ + return this._userDataWriter.convertValue( + this._fields.value + ) as AppModelType; + //} + } + + /** + * Retrieves the field specified by `field`. + * + * @param {string|FieldPath} field The field path + * (e.g. 'foo' or 'foo.bar') to a specific field. + * @returns {*} The data at the specified field location or undefined if no + * such field exists. + * + * @example + * ``` + * let p = firestore.pipeline().collection('col'); + * + * p.execute().then(results => { + * let field = results[0].get('a.b'); + * console.log(`Retrieved field value: ${field}`); + * }); + * ``` + */ + // We deliberately use `any` in the external API to not impose type-checking + // on end users. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get(fieldPath: string | FieldPath): any { + if (this._fields === undefined) { + return undefined; + } + + const value = this._fields.field( + fieldPathFromArgument('DocumentSnapshot.get', fieldPath) + ); + if (value !== null) { + return this._userDataWriter.convertValue(value); + } + } +} + +export function pipelineResultEqual( + left: PipelineResult, + right: PipelineResult +): boolean { + if (left === right) { + return true; + } + + return ( + isOptionalEqual(left._ref, right._ref, refEqual) && + isOptionalEqual(left._fields, right._fields, (l, r) => l.isEqual(r)) + ); +} diff --git a/packages/firestore/src/pipelines/api/pipeline-source.ts b/packages/firestore/src/pipelines/api/pipeline-source.ts new file mode 100644 index 00000000000..76bbc2d41ff --- /dev/null +++ b/packages/firestore/src/pipelines/api/pipeline-source.ts @@ -0,0 +1,48 @@ +// Copyright 2024 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 { Pipeline } from './pipeline'; +import { + CollectionGroupSource, + CollectionSource, + DatabaseSource, + DocumentsSource +} from './stage'; + +import { Firestore } from '../../api/database'; +import { DocumentReference } from '../../lite-api/reference'; + +/** + * Represents the source of a Firestore {@link Pipeline}. + * @beta + */ +export class PipelineSource { + constructor(private db: Firestore) {} + + collection(collectionPath: string): Pipeline { + return new Pipeline(this.db, [new CollectionSource(collectionPath)]); + } + + collectionGroup(collectionId: string): Pipeline { + return new Pipeline(this.db, [new CollectionGroupSource(collectionId)]); + } + + database(): Pipeline { + return new Pipeline(this.db, [new DatabaseSource()]); + } + + documents(docs: DocumentReference[]): Pipeline { + return new Pipeline(this.db, [DocumentsSource.of(docs)]); + } +} diff --git a/packages/firestore/src/pipelines/api/pipeline-util.ts b/packages/firestore/src/pipelines/api/pipeline-util.ts new file mode 100644 index 00000000000..dacbe9ace7c --- /dev/null +++ b/packages/firestore/src/pipelines/api/pipeline-util.ts @@ -0,0 +1,248 @@ +// Copyright 2024 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 { + CompositeFilter as CompositeFilterInternal, + CompositeOperator, + FieldFilter as FieldFilterInternal, + Filter as FilterInternal, + Operator +} from '../../core/filter'; +import { isNanValue, isNullValue } from '../../model/values'; +import { + ArrayValue as ProtoArrayValue, + Function as ProtoFunction, + LatLng as ProtoLatLng, + MapValue as ProtoMapValue, + Pipeline as ProtoPipeline, + Timestamp as ProtoTimestamp, + Value as ProtoValue +} from '../../protos/firestore_proto_api'; +import { fail } from '../../util/assert'; +import { isPlainObject } from '../../util/input_validation'; + +import { + and, + Constant, + Expr, + Field, + FilterCondition, + not, + or +} from './expressions'; + +function isITimestamp(obj: any): obj is ProtoTimestamp { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'seconds' in obj && + (obj.seconds === null || + typeof obj.seconds === 'number' || + typeof obj.seconds === 'string') && + 'nanos' in obj && + (obj.nanos === null || typeof obj.nanos === 'number') + ) { + return true; + } + + return false; +} +function isILatLng(obj: any): obj is ProtoLatLng { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'latitude' in obj && + (obj.latitude === null || typeof obj.latitude === 'number') && + 'longitude' in obj && + (obj.longitude === null || typeof obj.longitude === 'number') + ) { + return true; + } + + return false; +} +function isIArrayValue(obj: any): obj is ProtoArrayValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('values' in obj && (obj.values === null || Array.isArray(obj.values))) { + return true; + } + + return false; +} +function isIMapValue(obj: any): obj is ProtoMapValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('fields' in obj && (obj.fields === null || isPlainObject(obj.fields))) { + return true; + } + + return false; +} +function isIFunction(obj: any): obj is ProtoFunction { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'name' in obj && + (obj.name === null || typeof obj.name === 'string') && + 'args' in obj && + (obj.args === null || Array.isArray(obj.args)) + ) { + return true; + } + + return false; +} + +function isIPipeline(obj: any): obj is ProtoPipeline { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('stages' in obj && (obj.stages === null || Array.isArray(obj.stages))) { + return true; + } + + return false; +} + +export function isFirestoreValue(obj: any): obj is ProtoValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + + // Check optional properties and their types + if ( + ('nullValue' in obj && + (obj.nullValue === null || obj.nullValue === 'NULL_VALUE')) || + ('booleanValue' in obj && + (obj.booleanValue === null || typeof obj.booleanValue === 'boolean')) || + ('integerValue' in obj && + (obj.integerValue === null || + typeof obj.integerValue === 'number' || + typeof obj.integerValue === 'string')) || + ('doubleValue' in obj && + (obj.doubleValue === null || typeof obj.doubleValue === 'number')) || + ('timestampValue' in obj && + (obj.timestampValue === null || isITimestamp(obj.timestampValue))) || + ('stringValue' in obj && + (obj.stringValue === null || typeof obj.stringValue === 'string')) || + ('bytesValue' in obj && + (obj.bytesValue === null || obj.bytesValue instanceof Uint8Array)) || + ('referenceValue' in obj && + (obj.referenceValue === null || + typeof obj.referenceValue === 'string')) || + ('geoPointValue' in obj && + (obj.geoPointValue === null || isILatLng(obj.geoPointValue))) || + ('arrayValue' in obj && + (obj.arrayValue === null || isIArrayValue(obj.arrayValue))) || + ('mapValue' in obj && + (obj.mapValue === null || isIMapValue(obj.mapValue))) || + ('fieldReferenceValue' in obj && + (obj.fieldReferenceValue === null || + typeof obj.fieldReferenceValue === 'string')) || + ('functionValue' in obj && + (obj.functionValue === null || isIFunction(obj.functionValue))) || + ('pipelineValue' in obj && + (obj.pipelineValue === null || isIPipeline(obj.pipelineValue))) + ) { + return true; + } + + return false; +} + +export function toPipelineFilterCondition( + f: FilterInternal +): FilterCondition & Expr { + if (f instanceof FieldFilterInternal) { + const field = Field.of(f.field.toString()); + if (isNanValue(f.value)) { + if (f.op === Operator.EQUAL) { + return and(field.exists(), field.isNaN()); + } else { + return and(field.exists(), not(field.isNaN())); + } + } else if (isNullValue(f.value)) { + if (f.op === Operator.EQUAL) { + return and(field.exists(), field.eq(null)); + } else { + return and(field.exists(), not(field.eq(null))); + } + } else { + // Comparison filters + const value = f.value; + switch (f.op) { + case Operator.LESS_THAN: + return and(field.exists(), field.lt(value)); + case Operator.LESS_THAN_OR_EQUAL: + return and(field.exists(), field.lte(value)); + case Operator.GREATER_THAN: + return and(field.exists(), field.gt(value)); + case Operator.GREATER_THAN_OR_EQUAL: + return and(field.exists(), field.gte(value)); + case Operator.EQUAL: + return and(field.exists(), field.eq(value)); + case Operator.NOT_EQUAL: + return and(field.exists(), field.neq(value)); + case Operator.ARRAY_CONTAINS: + return and(field.exists(), field.arrayContains(value)); + case Operator.IN: { + const values = value?.arrayValue?.values?.map((val: any) => + Constant.of(val) + ); + return and(field.exists(), field.in(...values!)); + } + case Operator.ARRAY_CONTAINS_ANY: { + const values = value?.arrayValue?.values?.map((val: any) => + Constant.of(val) + ); + return and(field.exists(), field.arrayContainsAny(values!)); + } + case Operator.NOT_IN: { + const values = value?.arrayValue?.values?.map((val: any) => + Constant.of(val) + ); + return and(field.exists(), not(field.in(...values!))); + } + default: + fail('Unexpected operator'); + } + } + } else if (f instanceof CompositeFilterInternal) { + switch (f.op) { + case CompositeOperator.AND: { + const conditions = f + .getFilters() + .map(f => toPipelineFilterCondition(f)); + return and(conditions[0], ...conditions.slice(1)); + } + case CompositeOperator.OR: { + const conditions = f + .getFilters() + .map(f => toPipelineFilterCondition(f)); + return or(conditions[0], ...conditions.slice(1)); + } + default: + fail('Unexpected operator'); + } + } + + throw new Error(`Failed to convert filter to pipeline conditions: ${f}`); +} diff --git a/packages/firestore/src/pipelines/api/pipeline.ts b/packages/firestore/src/pipelines/api/pipeline.ts new file mode 100644 index 00000000000..907fe8e030c --- /dev/null +++ b/packages/firestore/src/pipelines/api/pipeline.ts @@ -0,0 +1,735 @@ +// Copyright 2024 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. + +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { ExpUserDataWriter } from '../../api/reference_impl'; +import { firestoreClientExecutePipeline } from '../../core/firestore_client'; +import {DocumentData, DocumentReference} from '../../lite-api/reference'; +import { + newUserDataReader, + parseVectorValue, + UserDataReader, + UserDataSource +} from '../../lite-api/user_data_reader'; +import { ObjectValue } from '../../model/object_value'; +import { + ExecutePipelineRequest, + firestoreV1ApiClientInterfaces, + Stage as ProtoStage +} from '../../protos/firestore_proto_api'; +import { + getEncodedDatabaseId, + JsonProtoSerializer +} from '../../remote/serializer'; + +import { + Accumulator, + AccumulatorTarget, + Expr, + ExprWithAlias, + Field, + Fields, + FilterCondition, + Ordering, + Selectable +} from './expressions'; +import { PipelineResult } from './pipeline-result'; +import { + AddFields, + Aggregate, + Distinct, + FindNearest, + FindNearestOptions, + GenericStage, + Limit, + Offset, + Select, + Sort, + Stage, + Where +} from './stage'; + +import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; +import {ensureFirestoreConfigured, Firestore} from "../../api/database"; + +interface ReadableUserData { + _readUserData(dataReader: UserDataReader): void; +} + +function isReadableUserData(value: any): value is ReadableUserData { + return typeof (value as ReadableUserData)._readUserData === 'function'; +} + +/** + * @beta + * + * The Pipeline class provides a flexible and expressive framework for building complex data + * transformation and query pipelines for Firestore. + * + * A pipeline takes data sources, such as Firestore collections or collection groups, and applies + * a series of stages that are chained together. Each stage takes the output from the previous stage + * (or the data source) and produces an output for the next stage (or as the final output of the + * pipeline). + * + * Expressions can be used within each stage to filter and transform data through the stage. + * + * NOTE: The chained stages do not prescribe exactly how Firestore will execute the pipeline. + * Instead, Firestore only guarantees that the result is the same as if the chained stages were + * executed in order. + * + * Usage Examples: + * + * ```typescript + * const db: Firestore; // Assumes a valid firestore instance. + * + * // Example 1: Select specific fields and rename 'rating' to 'bookRating' + * const results1 = await db.pipeline() + * .collection("books") + * .select("title", "author", Field.of("rating").as("bookRating")) + * .execute(); + * + * // Example 2: Filter documents where 'genre' is "Science Fiction" and 'published' is after 1950 + * const results2 = await db.pipeline() + * .collection("books") + * .where(and(Field.of("genre").eq("Science Fiction"), Field.of("published").gt(1950))) + * .execute(); + * + * // Example 3: Calculate the average rating of books published after 1980 + * const results3 = await db.pipeline() + * .collection("books") + * .where(Field.of("published").gt(1980)) + * .aggregate(avg(Field.of("rating")).as("averageRating")) + * .execute(); + * ``` + */ +export class Pipeline { + constructor( + private db: Firestore, + private stages: Stage[], + // TODO(pipeline) support converter + //private converter: FirestorePipelineConverter = defaultPipelineConverter() + private converter: unknown = {} + ) {} + + /** + * Adds new fields to outputs from previous stages. + * + * This stage allows you to compute values on-the-fly based on existing data from previous + * stages or constants. You can use this to create new fields or overwrite existing ones (if there + * is name overlaps). + * + * The added fields are defined using {@link Selectable}s, which can be: + * + * - {@link Field}: References an existing document field. + * - {@link Function}: Performs a calculation using functions like `add`, `multiply` with + * assigned aliases using {@link Expr#as}. + * + * Example: + * + * ```typescript + * firestore.pipeline().collection("books") + * .addFields( + * Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' + * add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' + * ); + * ``` + * + * @param fields The fields to add to the documents, specified as {@link Selectable}s. + * @return A new Pipeline object with this stage appended to the stage list. + */ + addFields(...fields: Selectable[]): Pipeline { + const copy = this.stages.map(s => s); + copy.push( + new AddFields( + this.readUserData('addFields', this.selectablesToMap(fields)) + ) + ); + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Selects or creates a set of fields from the outputs of previous stages. + * + *

The selected fields are defined using {@link Selectable} expressions, which can be: + * + *

    + *
  • {@code string}: Name of an existing field
  • + *
  • {@link Field}: References an existing field.
  • + *
  • {@link Function}: Represents the result of a function with an assigned alias name using + * {@link Expr#as}
  • + *
+ * + *

If no selections are provided, the output of this stage is empty. Use {@link + * com.google.cloud.firestore.Pipeline#addFields} instead if only additions are + * desired. + * + *

Example: + * + * ```typescript + * firestore.pipeline().collection("books") + * .select( + * "firstName", + * Field.of("lastName"), + * Field.of("address").toUppercase().as("upperAddress"), + * ); + * ``` + * + * @param selections The fields to include in the output documents, specified as {@link + * Selectable} expressions or {@code string} values representing field names. + * @return A new Pipeline object with this stage appended to the stage list. + */ + select(...selections: Array): Pipeline { + const copy = this.stages.map(s => s); + copy.push(new Select(this.selectablesToMap(selections))); + return new Pipeline(this.db, copy, this.converter); + } + + private selectablesToMap( + selectables: Array + ): Map { + const result = new Map(); + for (const selectable of selectables) { + if (typeof selectable === 'string') { + result.set(selectable as string, Field.of(selectable)); + } else if (selectable instanceof Field) { + result.set((selectable as Field).fieldName(), selectable); + } else if (selectable instanceof Fields) { + const fields = selectable as Fields; + for (const field of fields.fieldList()) { + result.set(field.fieldName(), field); + } + } else if (selectable instanceof ExprWithAlias) { + const expr = selectable as ExprWithAlias; + result.set(expr.alias, expr.expr); + } + } + return result; + } + + /** + * Reads user data for each expression in the expressionMap. + * @param name Name of the calling function. Used for error messages when invalid user data is encountered. + * @param expressionMap + * @return the expressionMap argument. + * @private + */ + private readUserData< + T extends + | Map + | ReadableUserData[] + | ReadableUserData + >(name: string, expressionMap: T): T { + const userDataReader = newUserDataReader(this.db); + if (isReadableUserData(expressionMap)) { + expressionMap._readUserData(userDataReader); + } else if (Array.isArray(expressionMap)) { + expressionMap.forEach(readableData => + readableData._readUserData(userDataReader) + ); + } else { + expressionMap.forEach(expr => expr._readUserData(userDataReader)); + } + return expressionMap; + } + + /** + * Filters the documents from previous stages to only include those matching the specified {@link + * FilterCondition}. + * + *

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. + * You can filter documents based on their field values, using implementations of {@link + * FilterCondition}, typically including but not limited to: + * + *

    + *
  • field comparators: {@link Function#eq}, {@link Function#lt} (less than), {@link + * Function#gt} (greater than), etc.
  • + *
  • logical operators: {@link Function#and}, {@link Function#or}, {@link Function#not}, etc.
  • + *
  • advanced functions: {@link Function#regexMatch}, {@link + * Function#arrayContains}, etc.
  • + *
+ * + *

Example: + * + * ```typescript + * firestore.pipeline().collection("books") + * .where( + * and( + * gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 + * Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") + * ) + * ); + * ``` + * + * @param condition The {@link FilterCondition} to apply. + * @return A new Pipeline object with this stage appended to the stage list. + */ + where(condition: FilterCondition & Expr): Pipeline { + const copy = this.stages.map(s => s); + copy.push(new Where(this.readUserData('where', condition))); + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Skips the first `offset` number of documents from the results of previous stages. + * + *

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve + * results in chunks. It is typically used in conjunction with {@link #limit} to control the + * size of each page. + * + *

Example: + * + * ```typescript + * // Retrieve the second page of 20 results + * firestore.pipeline().collection("books") + * .sort(Field.of("published").descending()) + * .offset(20) // Skip the first 20 results + * .limit(20); // Take the next 20 results + * ``` + * + * @param offset The number of documents to skip. + * @return A new Pipeline object with this stage appended to the stage list. + */ + offset(offset: number): Pipeline { + const copy = this.stages.map(s => s); + copy.push(new Offset(offset)); + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Limits the maximum number of documents returned by previous stages to `limit`. + * + *

This stage is particularly useful when you want to retrieve a controlled subset of data from + * a potentially large result set. It's often used for: + * + *

    + *
  • **Pagination:** In combination with {@link #offset} to retrieve specific pages of + * results.
  • + *
  • **Limiting Data Retrieval:** To prevent excessive data transfer and improve performance, + * especially when dealing with large collections.
  • + *
+ * + *

Example: + * + * ```typescript + * // Limit the results to the top 10 highest-rated books + * firestore.pipeline().collection("books") + * .sort(Field.of("rating").descending()) + * .limit(10); + * ``` + * + * @param limit The maximum number of documents to return. + * @return A new Pipeline object with this stage appended to the stage list. + */ + limit(limit: number): Pipeline { + const copy = this.stages.map(s => s); + copy.push(new Limit(limit)); + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Returns a set of distinct {@link Expr} values from the inputs to this stage. + * + *

This stage run through the results from previous stages to include only results with unique + * combinations of {@link Expr} values ({@link Field}, {@link Function}, etc). + * + *

The parameters to this stage are defined using {@link Selectable} expressions or {@code string}s: + * + *

    + *
  • {@code string}: Name of an existing field
  • + *
  • {@link Field}: References an existing document field.
  • + *
  • {@link Function}: Represents the result of a function with an assigned alias name using + * {@link Expr#as}
  • + *
+ * + *

Example: + * + * ```typescript + * // Get a list of unique author names in uppercase and genre combinations. + * firestore.pipeline().collection("books") + * .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") + * .select("authorName"); + * ``` + * + * @param selectables The {@link Selectable} expressions to consider when determining distinct + * value combinations or {@code string}s representing field names. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + distinct(...groups: Array): Pipeline { + const copy = this.stages.map(s => s); + copy.push( + new Distinct( + this.readUserData('distinct', this.selectablesToMap(groups || [])) + ) + ); + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Performs aggregation operations on the documents from previous stages. + * + *

This stage allows you to calculate aggregate values over a set of documents. You define the + * aggregations to perform using {@link AccumulatorTarget} expressions which are typically results of + * calling {@link Expr#as} on {@link Accumulator} instances. + * + *

Example: + * + * ```typescript + * // Calculate the average rating and the total number of books + * firestore.pipeline().collection("books") + * .aggregate( + * Field.of("rating").avg().as("averageRating"), + * countAll().as("totalBooks") + * ); + * ``` + * + * @param accumulators The {@link AccumulatorTarget} expressions, each wrapping an {@link Accumulator} + * and provide a name for the accumulated results. + * @return A new Pipeline object with this stage appended to the stage list. + */ + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + /** + * Performs optionally grouped aggregation operations on the documents from previous stages. + * + *

This stage allows you to calculate aggregate values over a set of documents, optionally + * grouped by one or more fields or functions. You can specify: + * + *

    + *
  • **Grouping Fields or Functions:** One or more fields or functions to group the documents + * by. For each distinct combination of values in these fields, a separate group is created. + * If no grouping fields are provided, a single group containing all documents is used. Not + * specifying groups is the same as putting the entire inputs into one group.
  • + *
  • **Accumulators:** One or more accumulation operations to perform within each group. These + * are defined using {@link AccumulatorTarget} expressions, which are typically created by + * calling {@link Expr#as} on {@link Accumulator} instances. Each aggregation + * calculates a value (e.g., sum, average, count) based on the documents within its group.
  • + *
+ * + *

Example: + * + * ```typescript + * // Calculate the average rating for each genre. + * firestore.pipeline().collection("books") + * .aggregate({ + * accumulators: [avg(Field.of("rating")).as("avg_rating")] + * groups: ["genre"] + * }); + * ``` + * + * @param aggregate An {@link Aggregate} object that specifies the grouping fields (if any) and + * the aggregation operations to perform. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + aggregate(options: { + accumulators: AccumulatorTarget[]; + groups?: Array; + }): Pipeline; + aggregate( + optionsOrTarget: + | AccumulatorTarget + | { + accumulators: AccumulatorTarget[]; + groups?: Array; + }, + ...rest: AccumulatorTarget[] + ): Pipeline { + const copy = this.stages.map(s => s); + if ('accumulators' in optionsOrTarget) { + copy.push( + new Aggregate( + new Map( + optionsOrTarget.accumulators.map((target: AccumulatorTarget) => [ + (target as unknown as AccumulatorTarget).alias, + this.readUserData( + 'aggregate', + (target as unknown as AccumulatorTarget).expr + ) + ]) + ), + this.readUserData( + 'aggregate', + this.selectablesToMap(optionsOrTarget.groups || []) + ) + ) + ); + } else { + copy.push( + new Aggregate( + new Map( + [optionsOrTarget, ...rest].map(target => [ + (target as unknown as AccumulatorTarget).alias, + this.readUserData( + 'aggregate', + (target as unknown as AccumulatorTarget).expr + ) + ]) + ), + new Map() + ) + ); + } + return new Pipeline(this.db, copy, this.converter); + } + + findNearest(options: FindNearestOptions): Pipeline; + findNearest(options: FindNearestOptions): Pipeline { + const copy = this.stages.map(s => s); + const parseContext = newUserDataReader(this.db).createContext( + UserDataSource.Argument, + 'findNearest' + ); + const value = parseVectorValue(options.vectorValue, parseContext); + const vectorObjectValue = new ObjectValue(value); + copy.push( + new FindNearest( + options.field, + vectorObjectValue, + options.distanceMeasure, + options.limit, + options.distanceField + ) + ); + return new Pipeline(this.db, copy); + } + + /** + * Sorts the documents from previous stages based on one or more {@link Ordering} criteria. + * + *

This stage allows you to order the results of your pipeline. You can specify multiple {@link + * Ordering} instances to sort by multiple fields in ascending or descending order. If documents + * have the same value for a field used for sorting, the next specified ordering will be used. If + * all orderings result in equal comparison, the documents are considered equal and the order is + * unspecified. + * + *

Example: + * + * ```typescript + * // Sort books by rating in descending order, and then by title in ascending order for books + * // with the same rating + * firestore.pipeline().collection("books") + * .sort( + * Ordering.of(Field.of("rating")).descending(), + * Ordering.of(Field.of("title")) // Ascending order is the default + * ); + * ``` + * + * @param orders One or more {@link Ordering} instances specifying the sorting criteria. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + sort(...orderings: Ordering[]): Pipeline; + sort(options: { orderings: Ordering[] }): Pipeline; + sort( + optionsOrOrderings: + | Ordering + | { + orderings: Ordering[]; + }, + ...rest: Ordering[] + ): Pipeline { + const copy = this.stages.map(s => s); + // Option object + if ('orderings' in optionsOrOrderings) { + copy.push( + new Sort( + this.readUserData( + 'sort', + this.readUserData('sort', optionsOrOrderings.orderings) + ) + ) + ); + } else { + // Ordering object + copy.push( + new Sort(this.readUserData('sort', [optionsOrOrderings, ...rest])) + ); + } + + return new Pipeline(this.db, copy, this.converter); + } + + /** + * Adds a generic stage to the pipeline. + * + *

This method provides a flexible way to extend the pipeline's functionality by adding custom + * stages. Each generic stage is defined by a unique `name` and a set of `params` that control its + * behavior. + * + *

Example (Assuming there is no "where" stage available in SDK): + * + * ```typescript + * // Assume we don't have a built-in "where" stage + * firestore.pipeline().collection("books") + * .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage + * .select("title", "author"); + * ``` + * + * @param name The unique name of the generic stage to add. + * @param params A list of parameters to configure the generic stage's behavior. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + genericStage(name: string, params: any[]): Pipeline { + const copy = this.stages.map(s => s); + const dataReader = newUserDataReader(this.db); + params.forEach(param => { + if (isReadableUserData(param)) { + param._readUserData(dataReader); + } + }); + copy.push(new GenericStage(name, params)); + return new Pipeline(this.db, copy, this.converter); + } + + // TODO(pipeline) support converter + // withConverter(converter: null): Pipeline; + // withConverter( + // converter: FirestorePipelineConverter + // ): Pipeline; + // /** + // * Applies a custom data converter to this Query, allowing you to use your + // * own custom model objects with Firestore. When you call get() on the + // * returned Query, the provided converter will convert between Firestore + // * data of type `NewDbModelType` and your custom type `NewAppModelType`. + // * + // * Using the converter allows you to specify generic type arguments when + // * storing and retrieving objects from Firestore. + // * + // * Passing in `null` as the converter parameter removes the current + // * converter. + // * + // * @example + // * ``` + // * class Post { + // * constructor(readonly title: string, readonly author: string) {} + // * + // * toString(): string { + // * return this.title + ', by ' + this.author; + // * } + // * } + // * + // * const postConverter = { + // * toFirestore(post: Post): FirebaseFirestore.DocumentData { + // * return {title: post.title, author: post.author}; + // * }, + // * fromFirestore( + // * snapshot: FirebaseFirestore.QueryDocumentSnapshot + // * ): Post { + // * const data = snapshot.data(); + // * return new Post(data.title, data.author); + // * } + // * }; + // * + // * const postSnap = await Firestore() + // * .collection('posts') + // * .withConverter(postConverter) + // * .doc().get(); + // * const post = postSnap.data(); + // * if (post !== undefined) { + // * post.title; // string + // * post.toString(); // Should be defined + // * post.someNonExistentProperty; // TS error + // * } + // * + // * ``` + // * @param {FirestoreDataConverter | null} converter Converts objects to and + // * from Firestore. Passing in `null` removes the current converter. + // * @return A Query that uses the provided converter. + // */ + // withConverter( + // converter: FirestorePipelineConverter | null + // ): Pipeline { + // const copy = this.stages.map(s => s); + // return new Pipeline( + // this.db, + // copy, + // converter ?? defaultPipelineConverter() + // ); + // } + + /** + * Executes this pipeline and returns a Promise to represent the asynchronous operation. + * + *

The returned Promise can be used to track the progress of the pipeline execution + * and retrieve the results (or handle any errors) asynchronously. + * + *

The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link + * PipelineResult} typically represents a single key/value map that has passed through all the + * stages of the pipeline, however this might differ depending on the stages involved in the + * pipeline. For example: + * + *

    + *
  • If there are no stages or only transformation stages, each {@link PipelineResult} + * represents a single document.
  • + *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, + * representing the aggregated results over the entire dataset .
  • + *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a + * distinct group and its associated aggregated values.
  • + *
+ * + *

Example: + * + * ```typescript + * const futureResults = await firestore.pipeline().collection("books") + * .where(gt(Field.of("rating"), 4.5)) + * .select("title", "author", "rating") + * .execute(); + * ``` + * + * @return A Promise representing the asynchronous pipeline execution. + */ + execute(): Promise>> { + // const util = new ExecutionUtil( + // this.db, + // this.db._serializer!, + // this.converter + // ); + // return util._getResponse(this).then(result => result!); + // the query is a VectorQuery instance + // the query is a VectorQuery instance + const client = ensureFirestoreConfigured(this.db); + + return firestoreClientExecutePipeline(client, this).then(result => { + const userDataWriter = new ExpUserDataWriter(this.db); + const docs = result.map( + element => + new PipelineResult( + userDataWriter, + element.key?.path + ? new DocumentReference(this.db, null, element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + //this.converter + ) + ); + + return docs; + }); + } + + /** + * @internal + * @private + */ + _toProto(jsonProtoSerializer: JsonProtoSerializer): ExecutePipelineRequest { + const stages: ProtoStage[] = this.stages.map(stage => + stage._toProto(jsonProtoSerializer) + ); + const structuredPipeline: StructuredPipeline = { pipeline: { stages } }; + return { + database: getEncodedDatabaseId(jsonProtoSerializer), + structuredPipeline + }; + } +} diff --git a/packages/firestore/src/pipelines/api/stage.ts b/packages/firestore/src/pipelines/api/stage.ts new file mode 100644 index 00000000000..05033072d3f --- /dev/null +++ b/packages/firestore/src/pipelines/api/stage.ts @@ -0,0 +1,384 @@ +// Copyright 2024 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 { + Accumulator, + Expr, + Field, + FilterCondition, + Ordering +} from './expressions'; + +import { VectorValue } from '../../lite-api/vector_value'; +import { ObjectValue } from '../../model/object_value'; +import { + Stage as ProtoStage, + Value as ProtoValue +} from '../../protos/firestore_proto_api'; +import { toNumber } from '../../remote/number_serializer'; +import { + JsonProtoSerializer, + toMapValue, + toStringValue +} from '../../remote/serializer'; +import { DocumentReference } from '../../lite-api/reference'; + + +/** + * @beta + */ +export interface Stage { + name: string; + + /** + * @internal + * @private + */ + _toProto(jsonProtoSerializer: JsonProtoSerializer): ProtoStage; +} + +/** + * @beta + */ +export class AddFields implements Stage { + name = 'add_fields'; + + constructor(private fields: Map) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toMapValue(serializer, this.fields)] + }; + } +} + +/** + * @beta + */ +export class Aggregate implements Stage { + name = 'aggregate'; + + constructor( + private accumulators: Map, + private groups: Map + ) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [ + toMapValue(serializer, this.accumulators), + toMapValue(serializer, this.groups) + ] + }; + } +} + +/** + * @beta + */ +export class Distinct implements Stage { + name = 'distinct'; + + constructor(private groups: Map) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toMapValue(serializer, this.groups)] + }; + } +} + +/** + * @beta + */ +export class CollectionSource implements Stage { + name = 'collection'; + + constructor(private collectionPath: string) { + if (!this.collectionPath.startsWith('/')) { + this.collectionPath = '/' + this.collectionPath; + } + } + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [{ referenceValue: this.collectionPath }] + }; + } +} + +/** + * @beta + */ +export class CollectionGroupSource implements Stage { + name = 'collection_group'; + + constructor(private collectionId: string) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [{ referenceValue: '' }, { stringValue: this.collectionId }] + }; + } +} + +/** + * @beta + */ +export class DatabaseSource implements Stage { + name = 'database'; + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name + }; + } +} + +/** + * @beta + */ +export class DocumentsSource implements Stage { + name = 'documents'; + + constructor(private docPaths: string[]) {} + + static of(refs: DocumentReference[]): DocumentsSource { + return new DocumentsSource(refs.map(ref => '/' + ref.path)); + } + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: this.docPaths.map(p => { + return { referenceValue: p }; + }) + }; + } +} + +/** + * @beta + */ +export class Where implements Stage { + name = 'where'; + + constructor(private condition: FilterCondition & Expr) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [(this.condition as unknown as Expr)._toProto(serializer)] + }; + } +} + +/** + * @beta + */ +export interface FindNearestOptions { + field: Field; + vectorValue: VectorValue | number[]; + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + limit?: number; + distanceField?: string; +} + +/** + * @beta + */ +export class FindNearest implements Stage { + name = 'find_nearest'; + + /** + * @private + * @internal + * + * @param _field + * @param _vectorValue + * @param _distanceMeasure + * @param _limit + * @param _distanceField + */ + constructor( + private _field: Field, + private _vectorValue: ObjectValue, + private _distanceMeasure: 'euclidean' | 'cosine' | 'dot_product', + private _limit?: number, + private _distanceField?: string + ) {} + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + const options: { [k: string]: ProtoValue } = {}; + + if (this._limit) { + options.limit = toNumber(serializer, this._limit)!; + } + + if (this._distanceField) { + // eslint-disable-next-line camelcase + options.distance_field = Field.of(this._distanceField)._toProto( + serializer + ); + } + + return { + name: this.name, + args: [ + this._field._toProto(serializer), + this._vectorValue.value, + toStringValue(this._distanceMeasure) + ], + options + }; + } +} + +/** + * @beta + */ +export class Limit implements Stage { + name = 'limit'; + + constructor(private limit: number) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toNumber(serializer, this.limit)] + }; + } +} + +/** + * @beta + */ +export class Offset implements Stage { + name = 'offset'; + + constructor(private offset: number) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toNumber(serializer, this.offset)] + }; + } +} + +/** + * @beta + */ +export class Select implements Stage { + name = 'select'; + + constructor(private projections: Map) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toMapValue(serializer, this.projections)] + }; + } +} + +/** + * @beta + */ +export class Sort implements Stage { + name = 'sort'; + + constructor(private orders: Ordering[]) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: this.orders.map(o => o._toProto(serializer)) + }; + } +} + +/** + * @beta + */ +export class GenericStage implements Stage { + constructor(public name: string, params: any[]) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + // TODO support generic stage + return {}; + } +} diff --git a/packages/firestore/src/protos/compile.sh b/packages/firestore/src/protos/compile.sh index 26c46d1a40d..9f9fb4b3217 100755 --- a/packages/firestore/src/protos/compile.sh +++ b/packages/firestore/src/protos/compile.sh @@ -18,10 +18,17 @@ set -euo pipefail # Variables PROTOS_DIR="." -PBJS="$(npm bin)/pbjs" +PBJS="../../node_modules/.bin/pbjs" +PBTS="../../node_modules/.bin/pbts" -"${PBJS}" --proto_path=. --target=json -o protos.json \ - -r firestore_v1 \ - "${PROTOS_DIR}/google/firestore/v1/*.proto" \ +"${PBJS}" --path=. --target=json -o protos.json \ + -r firestore/v1 "${PROTOS_DIR}/google/firestore/v1/*.proto" \ "${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \ "${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" + +"${PBJS}" --path="${PROTOS_DIR}" --target=static -o temp.js \ + -r firestore/v1 "${PROTOS_DIR}/google/firestore/v1/*.proto" \ + "${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \ + "${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" + +"${PBTS}" -o temp.d.ts --no-comments temp.js diff --git a/packages/firestore/src/protos/firestore_proto_api.ts b/packages/firestore/src/protos/firestore_proto_api.ts index 9618d71b86a..250cfb5ef88 100644 --- a/packages/firestore/src/protos/firestore_proto_api.ts +++ b/packages/firestore/src/protos/firestore_proto_api.ts @@ -145,9 +145,21 @@ export interface IValueNullValueEnum { } export declare const ValueNullValueEnum: IValueNullValueEnum; export declare namespace firestoreV1ApiClientInterfaces { + interface Aggregation { + count?: Count; + sum?: Sum; + avg?: Avg; + alias?: string; + } + interface AggregationResult { + aggregateFields?: ApiClientObjectMap; + } interface ArrayValue { values?: Value[]; } + interface Avg { + field?: FieldReference; + } interface BatchGetDocumentsRequest { database?: string; documents?: string[]; @@ -168,6 +180,14 @@ export declare namespace firestoreV1ApiClientInterfaces { interface BeginTransactionResponse { transaction?: string; } + interface BitSequence { + bitmap?: string | Uint8Array; + padding?: number; + } + interface BloomFilter { + bits?: BitSequence; + hashCount?: number; + } interface CollectionSelector { collectionId?: string; allDescendants?: boolean; @@ -185,6 +205,9 @@ export declare namespace firestoreV1ApiClientInterfaces { op?: CompositeFilterOp; filters?: Filter[]; } + interface Count { + upTo?: number; + } interface Cursor { values?: Value[]; before?: boolean; @@ -221,19 +244,23 @@ export declare namespace firestoreV1ApiClientInterfaces { documents?: string[]; } interface Empty {} + interface ExecutePipelineRequest { + database?: string; + structuredPipeline?: StructuredPipeline; + transaction?: string; + newTransaction?: TransactionOptions; + readTime?: string; + } + interface ExecutePipelineResponse { + transaction?: string; + results?: Document[]; + executionTime?: string; + } interface ExistenceFilter { targetId?: number; count?: number; unchangedNames?: BloomFilter; } - interface BloomFilter { - bits?: BitSequence; - hashCount?: number; - } - interface BitSequence { - bitmap?: string | Uint8Array; - padding?: number; - } interface FieldFilter { field?: FieldReference; op?: FieldFilterOp; @@ -254,6 +281,11 @@ export declare namespace firestoreV1ApiClientInterfaces { fieldFilter?: FieldFilter; unaryFilter?: UnaryFilter; } + interface Function { + name?: string; + args?: Value[]; + options?: ApiClientObjectMap; + } interface Index { name?: string; collectionId?: string; @@ -310,6 +342,9 @@ export declare namespace firestoreV1ApiClientInterfaces { field?: FieldReference; direction?: OrderDirection; } + interface Pipeline { + stages?: Stage[]; + } interface Precondition { exists?: boolean; updateTime?: Timestamp; @@ -355,33 +390,24 @@ export declare namespace firestoreV1ApiClientInterfaces { transaction?: string; readTime?: string; } - interface AggregationResult { - aggregateFields?: ApiClientObjectMap; - } interface StructuredAggregationQuery { structuredQuery?: StructuredQuery; aggregations?: Aggregation[]; } - interface Aggregation { - count?: Count; - sum?: Sum; - avg?: Avg; - alias?: string; - } - interface Count { - upTo?: number; - } - interface Sum { - field?: FieldReference; - } - interface Avg { - field?: FieldReference; + interface Stage { + name?: string; + args?: Value[]; + options?: ApiClientObjectMap; } interface Status { code?: number; message?: string; details?: Array>; } + interface StructuredPipeline { + pipeline?: Pipeline; + options?: ApiClientObjectMap; + } interface StructuredQuery { select?: Projection; from?: CollectionSelector[]; @@ -392,6 +418,9 @@ export declare namespace firestoreV1ApiClientInterfaces { offset?: number; limit?: number | { value: number }; } + interface Sum { + field?: FieldReference; + } interface Target { query?: QueryTarget; documents?: DocumentsTarget; @@ -428,6 +457,10 @@ export declare namespace firestoreV1ApiClientInterfaces { geoPointValue?: LatLng; arrayValue?: ArrayValue; mapValue?: MapValue; + fieldReferenceValue?: string; + // eslint-disable-next-line @typescript-eslint/ban-types + functionValue?: Function; + pipelineValue?: Pipeline; } interface Write { update?: Document; @@ -489,12 +522,17 @@ export declare type DocumentsTarget = export declare type Empty = firestoreV1ApiClientInterfaces.Empty; export declare type ExistenceFilter = firestoreV1ApiClientInterfaces.ExistenceFilter; +export declare type ExecutePipelineRequest = + firestoreV1ApiClientInterfaces.ExecutePipelineRequest; +export declare type ExecutePipelineResponse = + firestoreV1ApiClientInterfaces.ExecutePipelineResponse; export declare type FieldFilter = firestoreV1ApiClientInterfaces.FieldFilter; export declare type FieldReference = firestoreV1ApiClientInterfaces.FieldReference; export declare type FieldTransform = firestoreV1ApiClientInterfaces.FieldTransform; export declare type Filter = firestoreV1ApiClientInterfaces.Filter; +export declare type Function = firestoreV1ApiClientInterfaces.Function; export declare type Index = firestoreV1ApiClientInterfaces.Index; export declare type IndexField = firestoreV1ApiClientInterfaces.IndexField; export declare type LatLng = firestoreV1ApiClientInterfaces.LatLng; @@ -513,6 +551,7 @@ export declare type ListenResponse = export declare type MapValue = firestoreV1ApiClientInterfaces.MapValue; export declare type Operation = firestoreV1ApiClientInterfaces.Operation; export declare type Order = firestoreV1ApiClientInterfaces.Order; +export declare type Pipeline = firestoreV1ApiClientInterfaces.Pipeline; export declare type Precondition = firestoreV1ApiClientInterfaces.Precondition; export declare type Projection = firestoreV1ApiClientInterfaces.Projection; export declare type QueryTarget = firestoreV1ApiClientInterfaces.QueryTarget; @@ -529,6 +568,7 @@ export declare type RunAggregationQueryRequest = export declare type Aggregation = firestoreV1ApiClientInterfaces.Aggregation; export declare type RunAggregationQueryResponse = firestoreV1ApiClientInterfaces.RunAggregationQueryResponse; +export declare type Stage = firestoreV1ApiClientInterfaces.Stage; export declare type Status = firestoreV1ApiClientInterfaces.Status; export declare type StructuredQuery = firestoreV1ApiClientInterfaces.StructuredQuery; diff --git a/packages/firestore/src/protos/google/api/launch_stage.proto b/packages/firestore/src/protos/google/api/launch_stage.proto new file mode 100644 index 00000000000..9863fc23d42 --- /dev/null +++ b/packages/firestore/src/protos/google/api/launch_stage.proto @@ -0,0 +1,72 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.api; + +option go_package = "google.golang.org/genproto/googleapis/api;api"; +option java_multiple_files = true; +option java_outer_classname = "LaunchStageProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// The launch stage as defined by [Google Cloud Platform +// Launch Stages](https://cloud.google.com/terms/launch-stages). +enum LaunchStage { + // Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0; + + // The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6; + + // Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7; + + // Early Access features are limited to a closed group of testers. To use + // these features, you must sign up in advance and sign a Trusted Tester + // agreement (which includes confidentiality provisions). These features may + // be unstable, changed in backward-incompatible ways, and are not + // guaranteed to be released. + EARLY_ACCESS = 1; + + // Alpha is a limited availability test for releases before they are cleared + // for widespread use. By Alpha, all significant design issues are resolved + // and we are in the process of verifying functionality. Alpha customers + // need to apply for access, agree to applicable terms, and have their + // projects allowlisted. Alpha releases don't have to be feature complete, + // no SLAs are provided, and there are no technical support obligations, but + // they will be far enough along that customers can actually use them in + // test environments or for limited-use tests -- just like they would in + // normal production cases. + ALPHA = 2; + + // Beta is the point at which we are ready to open a release for any + // customer to use. There are no SLA or technical support obligations in a + // Beta release. Products will be complete from a feature perspective, but + // may have some open outstanding issues. Beta releases are suitable for + // limited production use cases. + BETA = 3; + + // GA features are open to all developers and are considered stable and + // fully qualified for production use. + GA = 4; + + // Deprecated features are scheduled to be shut down and removed. For more + // information, see the "Deprecation Policy" section of our [Terms of + // Service](https://cloud.google.com/terms/) + // and the [Google Cloud Platform Subject to the Deprecation + // Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5; +} diff --git a/packages/firestore/src/protos/google/firestore/v1/document.proto b/packages/firestore/src/protos/google/firestore/v1/document.proto index 5238a943ce4..f7605750502 100644 --- a/packages/firestore/src/protos/google/firestore/v1/document.proto +++ b/packages/firestore/src/protos/google/firestore/v1/document.proto @@ -129,6 +129,48 @@ message Value { // A map value. MapValue map_value = 6; + // Value which references a field. + // + // This is considered relative (vs absolute) since it only refers to a field + // and not a field within a particular document. + // + // **Requires:** + // + // * Must follow [field reference][FieldReference.field_path] limitations. + // + // * Not allowed to be used when writing documents. + // + // (-- NOTE(batchik): long term, there is no reason this type should not be + // allowed to be used on the write path. --) + string field_reference_value = 19; + + // A value that represents an unevaluated expression. + // + // **Requires:** + // + // * Not allowed to be used when writing documents. + // + // (-- NOTE(batchik): similar to above, there is no reason to not allow + // storing expressions into the database, just no plan to support in + // the near term. + // + // This would actually be an interesting way to represent user-defined + // functions or more expressive rules-based systems. --) + Function function_value = 20; + + // A value that represents an unevaluated pipeline. + // + // **Requires:** + // + // * Not allowed to be used when writing documents. + // + // (-- NOTE(batchik): similar to above, there is no reason to not allow + // storing expressions into the database, just no plan to support in + // the near term. + // + // This would actually be an interesting way to represent user-defined + // functions or more expressive rules-based systems. --) + Pipeline pipeline_value = 21; } } @@ -148,3 +190,73 @@ message MapValue { // not exceed 1,500 bytes and cannot be empty. map fields = 1; } + + +// Represents an unevaluated scalar expression. +// +// For example, the expression `like(user_name, "%alice%")` is represented as: +// +// ``` +// name: "like" +// args { field_reference: "user_name" } +// args { string_value: "%alice%" } +// ``` +// +// (-- api-linter: core::0123::resource-annotation=disabled +// aip.dev/not-precedent: this is not a One Platform API resource. --) +message Function { + // The name of the function to evaluate. + // + // **Requires:** + // + // * must be in snake case (lower case with underscore separator). + // + string name = 1; + + // Ordered list of arguments the given function expects. + repeated Value args = 2; + + // Optional named arguments that certain functions may support. + map options = 3; +} + +// A Firestore query represented as an ordered list of operations / stages. +message Pipeline { + // A single operation within a pipeline. + // + // A stage is made up of a unique name, and a list of arguments. The exact + // number of arguments & types is dependent on the stage type. + // + // To give an example, the stage `filter(state = "MD")` would be encoded as: + // + // ``` + // name: "filter" + // args { + // function_value { + // name: "eq" + // args { field_reference_value: "state" } + // args { string_value: "MD" } + // } + // } + // ``` + // + // See public documentation for the full list. + message Stage { + // The name of the stage to evaluate. + // + // **Requires:** + // + // * must be in snake case (lower case with underscore separator). + // + string name = 1; + + // Ordered list of arguments the given stage expects. + repeated Value args = 2; + + // Optional named arguments that certain functions may support. + map options = 3; + } + + // Ordered list of stages to evaluate. + repeated Stage stages = 1; +} diff --git a/packages/firestore/src/protos/google/firestore/v1/firestore.proto b/packages/firestore/src/protos/google/firestore/v1/firestore.proto index a8fc0d54b51..3e7b62e0609 100644 --- a/packages/firestore/src/protos/google/firestore/v1/firestore.proto +++ b/packages/firestore/src/protos/google/firestore/v1/firestore.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; +import "google/firestore/v1/pipeline.proto"; import "google/firestore/v1/query.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; @@ -135,6 +136,15 @@ service Firestore { }; } + // Executes a pipeline query. + rpc ExecutePipeline(ExecutePipelineRequest) + returns (stream ExecutePipelineResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:executePipeline" + body: "*" + }; + } + // Runs an aggregation query. // // Rather than producing [Document][google.firestore.v1.Document] results like [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], @@ -157,7 +167,7 @@ service Firestore { } }; } - + // Partitions a query by returning partition cursors that can be used to run // the query in parallel. The returned partition cursors are split points that // can be used by RunQuery as starting/end points for the query results. @@ -547,6 +557,82 @@ message RunQueryResponse { int32 skipped_results = 4; } +// The request for [Firestore.ExecutePipeline][]. +message ExecutePipelineRequest { + // Database identifier, in the form `projects/{project}/databases/{database}`. + string database = 1 [ + (google.api.field_behavior) = REQUIRED + ]; + + oneof pipeline_type { + // A pipelined operation. + StructuredPipeline structured_pipeline = 2; + } + + // Optional consistency arguments, defaults to strong consistency. + oneof consistency_selector { + // Run the query within an already active transaction. + // + // The value here is the opaque transaction ID to execute the query in. + bytes transaction = 5; + + // Execute the pipeline in a new transaction. + // + // The identifier of the newly created transaction will be returned in the + // first response on the stream. This defaults to a read-only transaction. + TransactionOptions new_transaction = 6; + + // Execute the pipeline in a snapshot transaction at the given time. + // + // This must be a microsecond precision timestamp within the past one hour, + // or if Point-in-Time Recovery is enabled, can additionally be a whole + // minute timestamp within the past 7 days. + google.protobuf.Timestamp read_time = 7; + } + + // Explain / analyze options for the pipeline. + // ExplainOptions explain_options = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for [Firestore.Execute][]. +message ExecutePipelineResponse { + // Newly created transaction identifier. + // + // This field is only specified on the first response from the server when + // the request specified [ExecuteRequest.new_transaction][]. + bytes transaction = 1; + + // An ordered batch of results returned executing a pipeline. + // + // The batch size is variable, and can even be zero for when only a partial + // progress message is returned. + // + // The fields present in the returned documents are only those that were + // explicitly requested in the pipeline, this include those like + // [`__name__`][Document.name] & [`__update_time__`][Document.update_time]. + // This is explicitly a divergence from `Firestore.RunQuery` / + // `Firestore.GetDocument` RPCs which always return such fields even when they + // are not specified in the [`mask`][DocumentMask]. + repeated Document results = 2; + + // The time at which the document(s) were read. + // + // This may be monotonically increasing; in this case, the previous documents + // in the result stream are guaranteed not to have changed between their + // `execution_time` and this one. + // + // If the query returns no results, a response with `execution_time` and no + // `results` will be sent, and this represents the time at which the operation + // was run. + google.protobuf.Timestamp execution_time = 3; + + // Query explain metrics. + // + // Set on the last response when [ExecutePipelineRequest.explain_options][] + // was specified on the request. + // ExplainMetrics explain_metrics = 4; +} + // The request for [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery]. message RunAggregationQueryRequest { // Required. The parent resource name. In the format: diff --git a/packages/firestore/src/protos/google/firestore/v1/pipeline.proto b/packages/firestore/src/protos/google/firestore/v1/pipeline.proto new file mode 100644 index 00000000000..ea5b2309331 --- /dev/null +++ b/packages/firestore/src/protos/google/firestore/v1/pipeline.proto @@ -0,0 +1,41 @@ +/*! + * Copyright 2024 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. + */ + +syntax = "proto3"; +package google.firestore.v1; +import "google/firestore/v1/document.proto"; +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; +option java_multiple_files = true; +option java_package = "com.google.firestore.v1"; +option java_outer_classname = "PipelineProto"; +option objc_class_prefix = "GCFS"; +// A Firestore query represented as an ordered list of operations / stages. +// +// This is considered the top-level function which plans & executes a query. +// It is logically equivalent to `query(stages, options)`, but prevents the +// client from having to build a function wrapper. +message StructuredPipeline { + // The pipeline query to execute. + Pipeline pipeline = 1; + // Optional query-level arguments. + // + // (-- Think query statement hints. --) + // + // (-- TODO(batchik): define the api contract of using an unsupported hint --) + map options = 2; +} diff --git a/packages/firestore/src/protos/google/firestore/v1/query_profile.proto b/packages/firestore/src/protos/google/firestore/v1/query_profile.proto new file mode 100644 index 00000000000..de27144a038 --- /dev/null +++ b/packages/firestore/src/protos/google/firestore/v1/query_profile.proto @@ -0,0 +1,92 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; + +// Specification of the Firestore Query Profile fields. + +// Explain options for the query. +message ExplainOptions { + // Optional. Whether to execute this query. + // + // When false (the default), the query will be planned, returning only + // metrics from the planning stages. + // + // When true, the query will be planned and executed, returning the full + // query results along with both planning and execution stage metrics. + bool analyze = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Explain metrics for the query. +message ExplainMetrics { + // Planning phase information for the query. + PlanSummary plan_summary = 1; + + // Aggregated stats from the execution of the query. Only present when + // [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + // to true. + ExecutionStats execution_stats = 2; +} + +// Planning phase information for the query. +message PlanSummary { + // The indexes selected for the query. For example: + // [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + repeated google.protobuf.Struct indexes_used = 1; +} + +// Execution statistics for the query. +message ExecutionStats { + // Total number of results returned, including documents, projections, + // aggregation results, keys. + int64 results_returned = 1; + + // Total time to execute the query in the backend. + google.protobuf.Duration execution_duration = 3; + + // Total billable read operations. + int64 read_operations = 4; + + // Debugging statistics from the execution of the query. Note that the + // debugging stats are subject to change as Firestore evolves. It could + // include: + // { + // "indexes_entries_scanned": "1000", + // "documents_scanned": "20", + // "billing_details" : { + // "documents_billable": "20", + // "index_entries_billable": "1000", + // "min_query_cost": "0" + // } + // } + google.protobuf.Struct debug_stats = 5; +} diff --git a/packages/firestore/src/protos/protos.json b/packages/firestore/src/protos/protos.json index b2c50ccaeeb..5b73c4647f8 100644 --- a/packages/firestore/src/protos/protos.json +++ b/packages/firestore/src/protos/protos.json @@ -4,16 +4,78 @@ "nested": { "protobuf": { "options": { - "csharp_namespace": "Google.Protobuf.WellKnownTypes", - "go_package": "github.com/golang/protobuf/ptypes/wrappers", + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", "java_package": "com.google.protobuf", - "java_outer_classname": "WrappersProto", - "java_multiple_files": true, + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", "objc_class_prefix": "GPB", "cc_enable_arenas": true, "optimize_for": "SPEED" }, "nested": { + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, "Timestamp": { "fields": { "seconds": { @@ -161,6 +223,10 @@ "end": { "type": "int32", "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 } } }, @@ -178,6 +244,21 @@ } } }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, "FieldDescriptorProto": { "fields": { "name": { @@ -279,6 +360,30 @@ "options": { "type": "EnumOptions", "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } } } }, @@ -335,11 +440,17 @@ }, "clientStreaming": { "type": "bool", - "id": 5 + "id": 5, + "options": { + "default": false + } }, "serverStreaming": { "type": "bool", - "id": 6 + "id": 6, + "options": { + "default": false + } } } }, @@ -355,7 +466,10 @@ }, "javaMultipleFiles": { "type": "bool", - "id": 10 + "id": 10, + "options": { + "default": false + } }, "javaGenerateEqualsAndHash": { "type": "bool", @@ -366,7 +480,10 @@ }, "javaStringCheckUtf8": { "type": "bool", - "id": 27 + "id": 27, + "options": { + "default": false + } }, "optimizeFor": { "type": "OptimizeMode", @@ -381,23 +498,45 @@ }, "ccGenericServices": { "type": "bool", - "id": 16 + "id": 16, + "options": { + "default": false + } }, "javaGenericServices": { "type": "bool", - "id": 17 + "id": 17, + "options": { + "default": false + } }, "pyGenericServices": { "type": "bool", - "id": 18 + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 23 + "id": 23, + "options": { + "default": false + } }, "ccEnableArenas": { "type": "bool", - "id": 31 + "id": 31, + "options": { + "default": false + } }, "objcClassPrefix": { "type": "string", @@ -407,6 +546,26 @@ "type": "string", "id": 37 }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -439,15 +598,24 @@ "fields": { "messageSetWireFormat": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "default": false + } }, "noStandardDescriptorAccessor": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } }, "mapEntry": { "type": "bool", @@ -469,6 +637,10 @@ [ 8, 8 + ], + [ + 9, + 9 ] ] }, @@ -494,15 +666,24 @@ }, "lazy": { "type": "bool", - "id": 5 + "id": 5, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } }, "weak": { "type": "bool", - "id": 10 + "id": 10, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -562,7 +743,10 @@ }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -575,13 +759,22 @@ 1000, 536870911 ] + ], + "reserved": [ + [ + 5, + 5 + ] ] }, "EnumValueOptions": { "fields": { "deprecated": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -600,7 +793,10 @@ "fields": { "deprecated": { "type": "bool", - "id": 33 + "id": 33, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -619,7 +815,17 @@ "fields": { "deprecated": { "type": "bool", - "id": 33 + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } }, "uninterpretedOption": { "rule": "repeated", @@ -632,7 +838,16 @@ 1000, 536870911 ] - ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } }, "UninterpretedOption": { "fields": { @@ -753,72 +968,6 @@ } } }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "Empty": { - "fields": {} - }, "DoubleValue": { "fields": { "value": { @@ -891,9 +1040,12 @@ } } }, + "Empty": { + "fields": {} + }, "Any": { "fields": { - "typeUrl": { + "type_url": { "type": "string", "id": 1 }, @@ -902,6 +1054,18 @@ "id": 2 } } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } } } }, @@ -910,9 +1074,9 @@ "v1": { "options": { "csharp_namespace": "Google.Cloud.Firestore.V1", - "go_package": "google.golang.org/genproto/googleapis/firestore/v1;firestore", + "go_package": "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb", "java_multiple_files": true, - "java_outer_classname": "WriteProto", + "java_outer_classname": "QueryProfileProto", "java_package": "com.google.firestore.v1", "objc_class_prefix": "GCFS", "php_namespace": "Google\\Cloud\\Firestore\\V1", @@ -928,104 +1092,6 @@ } } }, - "BitSequence": { - "fields": { - "bitmap": { - "type": "bytes", - "id": 1 - }, - "padding": { - "type": "int32", - "id": 2 - } - } - }, - "BloomFilter": { - "fields": { - "bits": { - "type": "BitSequence", - "id": 1 - }, - "hashCount": { - "type": "int32", - "id": 2 - } - } - }, - "DocumentMask": { - "fields": { - "fieldPaths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Precondition": { - "oneofs": { - "conditionType": { - "oneof": [ - "exists", - "updateTime" - ] - } - }, - "fields": { - "exists": { - "type": "bool", - "id": 1 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "TransactionOptions": { - "oneofs": { - "mode": { - "oneof": [ - "readOnly", - "readWrite" - ] - } - }, - "fields": { - "readOnly": { - "type": "ReadOnly", - "id": 2 - }, - "readWrite": { - "type": "ReadWrite", - "id": 3 - } - }, - "nested": { - "ReadWrite": { - "fields": { - "retryTransaction": { - "type": "bytes", - "id": 1 - } - } - }, - "ReadOnly": { - "oneofs": { - "consistencySelector": { - "oneof": [ - "readTime" - ] - } - }, - "fields": { - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, "Document": { "fields": { "name": { @@ -1061,7 +1127,10 @@ "referenceValue", "geoPointValue", "arrayValue", - "mapValue" + "mapValue", + "fieldReferenceValue", + "functionValue", + "pipelineValue" ] } }, @@ -1106,27 +1175,184 @@ "type": "ArrayValue", "id": 9 }, - "mapValue": { - "type": "MapValue", - "id": 6 + "mapValue": { + "type": "MapValue", + "id": 6 + }, + "fieldReferenceValue": { + "type": "string", + "id": 19 + }, + "functionValue": { + "type": "Function", + "id": 20 + }, + "pipelineValue": { + "type": "Pipeline", + "id": 21 + } + } + }, + "ArrayValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "MapValue": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Function": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "args": { + "rule": "repeated", + "type": "Value", + "id": 2 + }, + "options": { + "keyType": "string", + "type": "Value", + "id": 3 + } + } + }, + "Pipeline": { + "fields": { + "stages": { + "rule": "repeated", + "type": "Stage", + "id": 1 + } + }, + "nested": { + "Stage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "args": { + "rule": "repeated", + "type": "Value", + "id": 2 + }, + "options": { + "keyType": "string", + "type": "Value", + "id": 3 + } + } + } + } + }, + "BitSequence": { + "fields": { + "bitmap": { + "type": "bytes", + "id": 1 + }, + "padding": { + "type": "int32", + "id": 2 + } + } + }, + "BloomFilter": { + "fields": { + "bits": { + "type": "BitSequence", + "id": 1 + }, + "hashCount": { + "type": "int32", + "id": 2 } } }, - "ArrayValue": { + "DocumentMask": { "fields": { - "values": { + "fieldPaths": { "rule": "repeated", - "type": "Value", + "type": "string", "id": 1 } } }, - "MapValue": { + "Precondition": { + "oneofs": { + "conditionType": { + "oneof": [ + "exists", + "updateTime" + ] + } + }, "fields": { - "fields": { - "keyType": "string", - "type": "Value", + "exists": { + "type": "bool", "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "TransactionOptions": { + "oneofs": { + "mode": { + "oneof": [ + "readOnly", + "readWrite" + ] + } + }, + "fields": { + "readOnly": { + "type": "ReadOnly", + "id": 2 + }, + "readWrite": { + "type": "ReadWrite", + "id": 3 + } + }, + "nested": { + "ReadWrite": { + "fields": { + "retryTransaction": { + "type": "bytes", + "id": 1 + } + } + }, + "ReadOnly": { + "oneofs": { + "consistencySelector": { + "oneof": [ + "readTime" + ] + } + }, + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } } } }, @@ -1302,6 +1528,23 @@ } ] }, + "ExecutePipeline": { + "requestType": "ExecutePipelineRequest", + "responseType": "ExecutePipelineResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{database=projects/*/databases/*}/documents:executePipeline", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/databases/*}/documents:executePipeline", + "body": "*" + } + } + ] + }, "RunAggregationQuery": { "requestType": "RunAggregationQueryRequest", "responseType": "RunAggregationQueryResponse", @@ -1816,6 +2059,64 @@ } } }, + "ExecutePipelineRequest": { + "oneofs": { + "pipelineType": { + "oneof": [ + "structuredPipeline" + ] + }, + "consistencySelector": { + "oneof": [ + "transaction", + "newTransaction", + "readTime" + ] + } + }, + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "structuredPipeline": { + "type": "StructuredPipeline", + "id": 2 + }, + "transaction": { + "type": "bytes", + "id": 5 + }, + "newTransaction": { + "type": "TransactionOptions", + "id": 6 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "ExecutePipelineResponse": { + "fields": { + "transaction": { + "type": "bytes", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "Document", + "id": 2 + }, + "executionTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, "RunAggregationQueryRequest": { "oneofs": { "queryType": { @@ -2216,6 +2517,19 @@ } } }, + "StructuredPipeline": { + "fields": { + "pipeline": { + "type": "Pipeline", + "id": 1 + }, + "options": { + "keyType": "string", + "type": "Value", + "id": 2 + } + } + }, "StructuredQuery": { "fields": { "select": { @@ -2474,7 +2788,7 @@ "Sum": { "fields": { "field": { - "type": "FieldReference", + "type": "StructuredQuery.FieldReference", "id": 1 } } @@ -2482,7 +2796,7 @@ "Avg": { "fields": { "field": { - "type": "FieldReference", + "type": "StructuredQuery.FieldReference", "id": 1 } } @@ -2694,6 +3008,82 @@ "id": 3 } } + }, + "ExplainOptions": { + "fields": { + "analyze": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExplainMetrics": { + "fields": { + "planSummary": { + "type": "PlanSummary", + "id": 1 + }, + "executionStats": { + "type": "ExecutionStats", + "id": 2 + } + } + }, + "PlanSummary": { + "fields": { + "indexesUsed": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "ExecutionStats": { + "fields": { + "resultsReturned": { + "type": "int64", + "id": 1 + }, + "executionDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "readOperations": { + "type": "int64", + "id": 4 + }, + "debugStats": { + "type": "google.protobuf.Struct", + "id": 5 + } + } + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 } } } @@ -2701,9 +3091,9 @@ }, "api": { "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "go_package": "google.golang.org/genproto/googleapis/api;api", "java_multiple_files": true, - "java_outer_classname": "HttpProto", + "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -2720,6 +3110,10 @@ "rule": "repeated", "type": "HttpRule", "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 } } }, @@ -2737,6 +3131,10 @@ } }, "fields": { + "selector": { + "type": "string", + "id": 1 + }, "get": { "type": "string", "id": 2 @@ -2761,14 +3159,14 @@ "type": "CustomHttpPattern", "id": 8 }, - "selector": { - "type": "string", - "id": 1 - }, "body": { "type": "string", "id": 7 }, + "responseBody": { + "type": "string", + "id": 12 + }, "additionalBindings": { "rule": "repeated", "type": "HttpRule", @@ -2821,29 +3219,17 @@ "UNORDERED_LIST": 6, "NON_EMPTY_DEFAULT": 7 } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", - "java_multiple_files": true, - "java_outer_classname": "LatLngProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "LatLng": { - "fields": { - "latitude": { - "type": "double", - "id": 1 - }, - "longitude": { - "type": "double", - "id": 2 - } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 } } } @@ -2880,4 +3266,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index ac47f0cb931..d3f836b676e 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -24,6 +24,8 @@ import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; import { Mutation } from '../model/mutation'; import { ResourcePath } from '../model/path'; +import { PipelineStreamElement } from '../model/pipeline_stream_element'; +import { Pipeline } from '../pipelines/api/pipeline'; import { ApiClientObjectMap, BatchGetDocumentsRequest as ProtoBatchGetDocumentsRequest, @@ -32,6 +34,8 @@ import { RunAggregationQueryResponse as ProtoRunAggregationQueryResponse, RunQueryRequest as ProtoRunQueryRequest, RunQueryResponse as ProtoRunQueryResponse, + ExecutePipelineRequest as ProtoExecutePipelineRequest, + ExecutePipelineResponse as ProtoExecutePipelineResponse, Value } from '../protos/firestore_proto_api'; import { debugAssert, debugCast, hardAssert } from '../util/assert'; @@ -54,7 +58,8 @@ import { toName, toQueryTarget, toResourcePath, - toRunAggregationQueryRequest + toRunAggregationQueryRequest, + fromPipelineResponse } from './serializer'; /** @@ -234,6 +239,36 @@ export async function invokeBatchGetDocumentsRpc( return result; } +export async function invokeExecutePipeline( + datastore: Datastore, + pipeline: Pipeline +): Promise { + const datastoreImpl = debugCast(datastore, DatastoreImpl); + const executePipelineRequest = pipeline._toProto(datastoreImpl.serializer); + + const response = await datastoreImpl.invokeStreamingRPC< + ProtoExecutePipelineRequest, + ProtoExecutePipelineResponse + >( + 'ExecutePipeline', + datastoreImpl.serializer.databaseId, + toResourcePath(datastoreImpl.serializer.databaseId), + executePipelineRequest + ); + + return response + .filter(proto => !!proto.results) + .flatMap(proto => { + if (proto.results!.length === 0) { + return fromPipelineResponse(datastoreImpl.serializer, proto); + } else { + return proto.results!.map(result => + fromPipelineResponse(datastoreImpl.serializer, proto, result) + ); + } + }); +} + export async function invokeRunQueryRpc( datastore: Datastore, query: Query diff --git a/packages/firestore/src/remote/rest_connection.ts b/packages/firestore/src/remote/rest_connection.ts index 470cb332ce2..d1fa98f7e63 100644 --- a/packages/firestore/src/remote/rest_connection.ts +++ b/packages/firestore/src/remote/rest_connection.ts @@ -44,6 +44,7 @@ RPC_NAME_URL_MAPPING['BatchGetDocuments'] = 'batchGet'; RPC_NAME_URL_MAPPING['Commit'] = 'commit'; RPC_NAME_URL_MAPPING['RunQuery'] = 'runQuery'; RPC_NAME_URL_MAPPING['RunAggregationQuery'] = 'runAggregationQuery'; +RPC_NAME_URL_MAPPING['ExecutePipeline'] = 'executePipeline'; const RPC_URL_VERSION = 'v1'; diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index 811c2ac4df6..9cbf18f7155 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -37,6 +37,8 @@ import { import { SnapshotVersion } from '../core/snapshot_version'; import { targetIsDocumentTarget, Target } from '../core/target'; import { TargetId } from '../core/types'; +import { Bytes } from '../lite-api/bytes'; +import { GeoPoint } from '../lite-api/geo_point'; import { Timestamp } from '../lite-api/timestamp'; import { TargetData, TargetPurpose } from '../local/target_data'; import { MutableDocument } from '../model/document'; @@ -87,7 +89,11 @@ import { TargetChangeTargetChangeType as ProtoTargetChangeTargetChangeType, Timestamp as ProtoTimestamp, Write as ProtoWrite, - WriteResult as ProtoWriteResult + WriteResult as ProtoWriteResult, + firestoreV1ApiClientInterfaces, + Value as ProtoValue, + MapValue as ProtoMapValue, + ExecutePipelineResponse as ProtoExecutePipelineResponse } from '../protos/firestore_proto_api'; import { debugAssert, fail, hardAssert } from '../util/assert'; import { ByteString } from '../util/byte_string'; @@ -105,6 +111,12 @@ import { WatchTargetChangeState } from './watch_change'; +import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; + + +import { UserDataReader } from '../lite-api/user_data_reader'; +import { PipelineStreamElement } from '../model/pipeline_stream_element'; + const DIRECTIONS = (() => { const dirs: { [dir: string]: ProtoOrderDirection } = {}; dirs[Direction.ASCENDING] = 'ASCENDING'; @@ -173,7 +185,7 @@ function fromRpcStatus(status: ProtoStatus): FirestoreError { * our generated proto interfaces say Int32Value must be. But GRPC actually * expects a { value: } struct. */ -function toInt32Proto( +export function toInt32Proto( serializer: JsonProtoSerializer, val: number | null ): number | { value: number } | null { @@ -226,7 +238,7 @@ export function toTimestamp( } } -function fromTimestamp(date: ProtoTimestamp): Timestamp { +export function fromTimestamp(date: ProtoTimestamp): Timestamp { const timestamp = normalizeTimestamp(date); return new Timestamp(timestamp.seconds, timestamp.nanos); } @@ -422,6 +434,37 @@ export function toDocument( }; } +export function fromPipelineResponse( + serializer: JsonProtoSerializer, + proto: ProtoExecutePipelineResponse, + document?: ProtoDocument +): PipelineStreamElement { + const output: PipelineStreamElement = {}; + if (proto.transaction?.length) { + output.transaction = proto.transaction; + } + const executionTime = proto.executionTime + ? fromVersion(proto.executionTime) + : undefined; + output.executionTime = executionTime; + + if (!!document) { + output.key = document.name + ? fromName(serializer, document.name) + : undefined; + + output.fields = new ObjectValue({ mapValue: { fields: document.fields } }); + + output.createTime = document.createTime + ? fromVersion(document.createTime!) + : undefined; + output.updateTime = document.updateTime + ? fromVersion(document.updateTime!) + : undefined; + } + return output; +} + export function fromDocument( serializer: JsonProtoSerializer, document: ProtoDocument, @@ -1390,3 +1433,82 @@ export function isValidResourceName(path: ResourcePath): boolean { path.get(2) === 'databases' ); } + +export interface ProtoSerializable { + _toProto(serializer: JsonProtoSerializer): ProtoValue; +} + +export interface UserData { + _readUserData(dataReader: UserDataReader): void; +} + +export function toMapValue( + serializer: JsonProtoSerializer, + input: Map +): ProtoValue { + const map: ProtoMapValue = { fields: {} }; + input.forEach((exp: ProtoSerializable, key: string) => { + if (typeof key !== 'string') { + throw new Error(`Cannot encode map with non-string key: ${key}`); + } + + map.fields![key] = exp._toProto(serializer)!; + }); + return { + mapValue: map + }; +} + +export function toNullValue(value: null): ProtoValue { + return { nullValue: 'NULL_VALUE' }; +} + +export function toBooleanValue(value: boolean): ProtoValue { + return { booleanValue: value }; +} + +export function toStringValue(value: string): ProtoValue { + return { stringValue: value }; +} + +export function dateToTimestampValue( + serializer: JsonProtoSerializer, + value: Date +): ProtoValue { + const timestamp = Timestamp.fromDate(value); + return { + timestampValue: toTimestamp(serializer, timestamp) + }; +} + +export function timestampToTimestampValue( + serializer: JsonProtoSerializer, + value: Timestamp +): ProtoValue { + // Firestore backend truncates precision down to microseconds. To ensure + // offline mode works the same in regards to truncation, perform the + // truncation immediately without waiting for the backend to do that. + const timestamp = new Timestamp( + value.seconds, + Math.floor(value.nanoseconds / 1000) * 1000 + ); + return { + timestampValue: toTimestamp(serializer, timestamp) + }; +} + +export function toGeoPointValue(value: GeoPoint): ProtoValue { + return { + geoPointValue: { + latitude: value.latitude, + longitude: value.longitude + } + }; +} + +export function toBytesValue( + serializer: JsonProtoSerializer, + value: Bytes +): ProtoValue { + return { bytesValue: toBytes(serializer, value._byteString) }; +} diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index acaff77abb6..baed7e98a7d 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -89,6 +89,26 @@ export function arrayEquals( } return left.every((value, index) => comparator(value, right[index])); } + +/** + * Verifies equality for an optional value. + */ +export function isOptionalEqual( + left: T | undefined, + right: T | undefined, + equalityTest: (left: T, right: T) => boolean +): boolean { + if (left === undefined && right === undefined) { + return true; + } + + if (left === undefined || right === undefined) { + return false; + } + + return equalityTest(left, right); +} + /** * Returns the immediate lexicographically-following string. This is useful to * construct an inclusive range for indexeddb iterators. diff --git a/packages/firestore/src/util/obj.ts b/packages/firestore/src/util/obj.ts index c40bc86bc5c..2b61da9447f 100644 --- a/packages/firestore/src/util/obj.ts +++ b/packages/firestore/src/util/obj.ts @@ -32,7 +32,7 @@ export function objectSize(obj: object): number { } export function forEach( - obj: Dict | undefined, + obj: Record | undefined, fn: (key: string, val: V) => void ): void { for (const key in obj) { From a30f9aeb5794fef5d07fe09f3a6b7f9d936895bf Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:58:54 -0600 Subject: [PATCH 002/295] Fix circular deps --- common/api-review/firestore.api.md | 6 +- packages/firestore/src/api/aggregate.ts | 2 +- packages/firestore/src/api/database.ts | 22 ++- packages/firestore/src/api/reference_impl.ts | 19 +-- packages/firestore/src/api/transaction.ts | 2 +- .../firestore/src/api/user_data_writer.ts | 21 +++ .../src/model/aggregate_result_value.ts | 42 +++++ .../src/pipelines/api/expressions.ts | 25 ++- .../src/pipelines/api/pipeline-source.ts | 56 ++++++- .../src/pipelines/api/pipeline-util.ts | 1 - .../firestore/src/pipelines/api/pipeline.ts | 145 +++++++++++++----- packages/firestore/src/pipelines/api/stage.ts | 18 +-- packages/firestore/src/remote/serializer.ts | 9 +- 13 files changed, 271 insertions(+), 97 deletions(-) create mode 100644 packages/firestore/src/api/user_data_writer.ts create mode 100644 packages/firestore/src/model/aggregate_result_value.ts diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index fd4942bea18..2af57954604 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1076,7 +1076,7 @@ export class Firestore { // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta // // (undocumented) - pipeline: () => PipelineSource | undefined; + pipeline: () => PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1815,7 +1815,6 @@ export type PersistentTabManager = PersistentSingleTabManager | PersistentMultip // @beta export class Pipeline { - constructor(db: Firestore, stages: Stage[], converter?: unknown); addFields(...fields: Selectable[]): Pipeline; aggregate(...accumulators: AccumulatorTarget[]): Pipeline; aggregate(options: { @@ -1854,7 +1853,6 @@ export class PipelineResult { // @beta export class PipelineSource { - constructor(db: Firestore); // (undocumented) collection(collectionPath: string): Pipeline; // (undocumented) @@ -1863,7 +1861,7 @@ export class PipelineSource { database(): Pipeline; // (undocumented) documents(docs: DocumentReference[]): Pipeline; -} + } // @public export type Primitive = string | number | boolean | undefined | null; diff --git a/packages/firestore/src/api/aggregate.ts b/packages/firestore/src/api/aggregate.ts index f0e2c1e1dc0..b5a0a580067 100644 --- a/packages/firestore/src/api/aggregate.ts +++ b/packages/firestore/src/api/aggregate.ts @@ -25,7 +25,7 @@ import { cast } from '../util/input_validation'; import { mapToArray } from '../util/obj'; import { ensureFirestoreConfigured, Firestore } from './database'; -import { ExpUserDataWriter } from './reference_impl'; +import { ExpUserDataWriter } from './user_data_writer'; export { aggregateQuerySnapshotEqual, diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 664c853f4a7..5d112c2feab 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -46,13 +46,16 @@ import { connectFirestoreEmulator, Firestore as LiteFirestore } from '../lite-api/database'; -import { Query } from '../lite-api/reference'; +import { DocumentReference, Query } from '../lite-api/reference'; +import { newUserDataReader } from '../lite-api/user_data_reader'; import { indexedDbClearPersistence, indexedDbStoragePrefix } from '../local/indexeddb_persistence'; import { LRU_COLLECTION_DISABLED } from '../local/lru_garbage_collector'; import { LRU_MINIMUM_CACHE_SIZE_BYTES } from '../local/lru_garbage_collector_impl'; +import { DocumentKey } from '../model/document_key'; +import { PipelineSource } from '../pipelines/api/pipeline-source'; import { debugAssert } from '../util/assert'; import { AsyncQueue } from '../util/async_queue'; import { AsyncQueueImpl } from '../util/async_queue_impl'; @@ -64,7 +67,7 @@ import { Deferred } from '../util/promise'; import { LoadBundleTask } from './bundle'; import { CredentialsProvider } from './credentials'; import { FirestoreSettings, PersistenceSettings } from './settings'; -import type {PipelineSource} from "../pipelines/api/pipeline-source"; +import { ExpUserDataWriter } from './user_data_writer'; export { connectFirestoreEmulator, @@ -105,9 +108,18 @@ export class Firestore extends LiteFirestore { _online: OnlineComponentProviderFactory; }; - pipeline = function(): PipelineSource { - return new PipelineSource(this); - } + pipeline = (): PipelineSource => { + const client = ensureFirestoreConfigured(this); + const firestore = this; + return new PipelineSource( + client, + newUserDataReader(firestore), + new ExpUserDataWriter(firestore), + (key: DocumentKey) => { + return new DocumentReference(firestore, null, key); + } + ); + }; /** @hideconstructor */ constructor( diff --git a/packages/firestore/src/api/reference_impl.ts b/packages/firestore/src/api/reference_impl.ts index e730fb40da7..86956a52785 100644 --- a/packages/firestore/src/api/reference_impl.ts +++ b/packages/firestore/src/api/reference_impl.ts @@ -36,7 +36,6 @@ import { } from '../core/firestore_client'; import { newQueryForPath, Query as InternalQuery } from '../core/query'; import { ViewSnapshot } from '../core/view_snapshot'; -import { Bytes } from '../lite-api/bytes'; import { FieldPath } from '../lite-api/field_path'; import { validateHasExplicitOrderByForLimitToLast } from '../lite-api/query'; import { @@ -58,15 +57,14 @@ import { parseUpdateData, parseUpdateVarargs } from '../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { DeleteMutation, Mutation, Precondition } from '../model/mutation'; import { debugAssert } from '../util/assert'; -import { ByteString } from '../util/byte_string'; import { FirestoreError } from '../util/error'; import { cast } from '../util/input_validation'; import { ensureFirestoreConfigured, Firestore } from './database'; import { DocumentSnapshot, QuerySnapshot, SnapshotMetadata } from './snapshot'; +import { ExpUserDataWriter } from './user_data_writer'; /** * An options object that can be passed to {@link (onSnapshot:1)} and {@link @@ -123,21 +121,6 @@ export function getDoc( ).then(snapshot => convertToDocSnapshot(firestore, reference, snapshot)); } -export class ExpUserDataWriter extends AbstractUserDataWriter { - constructor(protected firestore: Firestore) { - super(); - } - - protected convertBytes(bytes: ByteString): Bytes { - return new Bytes(bytes); - } - - protected convertReference(name: string): DocumentReference { - const key = this.convertDocumentKey(name, this.firestore._databaseId); - return new DocumentReference(this.firestore, /* converter= */ null, key); - } -} - /** * Reads the document referred to by this `DocumentReference` from cache. * Returns an error if the document is not currently cached. diff --git a/packages/firestore/src/api/transaction.ts b/packages/firestore/src/api/transaction.ts index 955866f19b4..8f83f527182 100644 --- a/packages/firestore/src/api/transaction.ts +++ b/packages/firestore/src/api/transaction.ts @@ -28,9 +28,9 @@ import { validateReference } from '../lite-api/write_batch'; import { cast } from '../util/input_validation'; import { ensureFirestoreConfigured, Firestore } from './database'; -import { ExpUserDataWriter } from './reference_impl'; import { DocumentSnapshot, SnapshotMetadata } from './snapshot'; import { TransactionOptions } from './transaction_options'; +import { ExpUserDataWriter } from './user_data_writer'; /** * A reference to a transaction. diff --git a/packages/firestore/src/api/user_data_writer.ts b/packages/firestore/src/api/user_data_writer.ts new file mode 100644 index 00000000000..e21dcb70506 --- /dev/null +++ b/packages/firestore/src/api/user_data_writer.ts @@ -0,0 +1,21 @@ +import { Bytes } from '../lite-api/bytes'; +import { DocumentReference } from '../lite-api/reference'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { ByteString } from '../util/byte_string'; + +import { Firestore } from './database'; + +export class ExpUserDataWriter extends AbstractUserDataWriter { + constructor(protected firestore: Firestore) { + super(); + } + + protected convertBytes(bytes: ByteString): Bytes { + return new Bytes(bytes); + } + + protected convertReference(name: string): DocumentReference { + const key = this.convertDocumentKey(name, this.firestore._databaseId); + return new DocumentReference(this.firestore, /* converter= */ null, key); + } +} diff --git a/packages/firestore/src/model/aggregate_result_value.ts b/packages/firestore/src/model/aggregate_result_value.ts new file mode 100644 index 00000000000..042dc29d345 --- /dev/null +++ b/packages/firestore/src/model/aggregate_result_value.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2024 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 { + MapValue as ProtoMapValue, + Value as ProtoValue +} from '../protos/firestore_proto_api'; + +import { valueEquals } from './values'; + +/** + * An AggregateResultValue represents a MapValue in the Firestore Proto. + */ +export class AggregateResultValue { + constructor(readonly value: { mapValue: ProtoMapValue }) {} + + static empty(): AggregateResultValue { + return new AggregateResultValue({ mapValue: {} }); + } + + aggregate(alias: string): ProtoValue | null { + return this.value.mapValue.fields?.[alias] ?? null; + } + + isEqual(other: AggregateResultValue): boolean { + return valueEquals(this.value, other.value); + } +} diff --git a/packages/firestore/src/pipelines/api/expressions.ts b/packages/firestore/src/pipelines/api/expressions.ts index 6dabce22987..f8ca08d1c6b 100644 --- a/packages/firestore/src/pipelines/api/expressions.ts +++ b/packages/firestore/src/pipelines/api/expressions.ts @@ -2412,7 +2412,10 @@ export class ArrayReverse extends FirestoreFunction { /** * @beta */ -export class ArrayContains extends FirestoreFunction implements FilterCondition { +export class ArrayContains + extends FirestoreFunction + implements FilterCondition +{ constructor(private array: Expr, private element: Expr) { super('array_contains', [array, element]); } @@ -2422,7 +2425,10 @@ export class ArrayContains extends FirestoreFunction implements FilterCondition /** * @beta */ -export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { +export class ArrayContainsAll + extends FirestoreFunction + implements FilterCondition +{ constructor(private array: Expr, private values: Expr[]) { super('array_contains_all', [array, new ListOfExprs(values)]); } @@ -2432,7 +2438,10 @@ export class ArrayContainsAll extends FirestoreFunction implements FilterConditi /** * @beta */ -export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { +export class ArrayContainsAny + extends FirestoreFunction + implements FilterCondition +{ constructor(private array: Expr, private values: Expr[]) { super('array_contains_any', [array, new ListOfExprs(values)]); } @@ -2618,7 +2627,10 @@ export class Like extends FirestoreFunction implements FilterCondition { /** * @beta */ -export class RegexContains extends FirestoreFunction implements FilterCondition { +export class RegexContains + extends FirestoreFunction + implements FilterCondition +{ constructor(private expr: Expr, private pattern: Expr) { super('regex_contains', [expr, pattern]); } @@ -6642,7 +6654,10 @@ export function timestampSub( * @param params The arguments to pass to the function. * @return A new {@code Function} representing the function call. */ -export function genericFunction(name: string, params: Expr[]): FirestoreFunction { +export function genericFunction( + name: string, + params: Expr[] +): FirestoreFunction { return new FirestoreFunction(name, params); } diff --git a/packages/firestore/src/pipelines/api/pipeline-source.ts b/packages/firestore/src/pipelines/api/pipeline-source.ts index 76bbc2d41ff..24e890151ec 100644 --- a/packages/firestore/src/pipelines/api/pipeline-source.ts +++ b/packages/firestore/src/pipelines/api/pipeline-source.ts @@ -12,6 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { FirestoreClient } from '../../core/firestore_client'; +import { DocumentReference } from '../../lite-api/reference'; +import { UserDataReader } from '../../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; +import { DocumentKey } from '../../model/document_key'; + import { Pipeline } from './pipeline'; import { CollectionGroupSource, @@ -20,29 +26,63 @@ import { DocumentsSource } from './stage'; -import { Firestore } from '../../api/database'; -import { DocumentReference } from '../../lite-api/reference'; - /** * Represents the source of a Firestore {@link Pipeline}. * @beta */ export class PipelineSource { - constructor(private db: Firestore) {} + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + */ + constructor( + private db: FirestoreClient, + private userDataReader: UserDataReader, + private userDataWriter: AbstractUserDataWriter, + private documentReferenceFactory: (id: DocumentKey) => DocumentReference + ) {} collection(collectionPath: string): Pipeline { - return new Pipeline(this.db, [new CollectionSource(collectionPath)]); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new CollectionSource(collectionPath)] + ); } collectionGroup(collectionId: string): Pipeline { - return new Pipeline(this.db, [new CollectionGroupSource(collectionId)]); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new CollectionGroupSource(collectionId)] + ); } database(): Pipeline { - return new Pipeline(this.db, [new DatabaseSource()]); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new DatabaseSource()] + ); } documents(docs: DocumentReference[]): Pipeline { - return new Pipeline(this.db, [DocumentsSource.of(docs)]); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [DocumentsSource.of(docs)] + ); } } diff --git a/packages/firestore/src/pipelines/api/pipeline-util.ts b/packages/firestore/src/pipelines/api/pipeline-util.ts index dacbe9ace7c..0acc05024b8 100644 --- a/packages/firestore/src/pipelines/api/pipeline-util.ts +++ b/packages/firestore/src/pipelines/api/pipeline-util.ts @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - import { CompositeFilter as CompositeFilterInternal, CompositeOperator, diff --git a/packages/firestore/src/pipelines/api/pipeline.ts b/packages/firestore/src/pipelines/api/pipeline.ts index 907fe8e030c..7de5e12ee75 100644 --- a/packages/firestore/src/pipelines/api/pipeline.ts +++ b/packages/firestore/src/pipelines/api/pipeline.ts @@ -13,15 +13,18 @@ // limitations under the License. /* eslint @typescript-eslint/no-explicit-any: 0 */ -import { ExpUserDataWriter } from '../../api/reference_impl'; -import { firestoreClientExecutePipeline } from '../../core/firestore_client'; -import {DocumentData, DocumentReference} from '../../lite-api/reference'; import { - newUserDataReader, + FirestoreClient, + firestoreClientExecutePipeline +} from '../../core/firestore_client'; +import { DocumentData, DocumentReference } from '../../lite-api/reference'; +import { parseVectorValue, UserDataReader, UserDataSource } from '../../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; +import { DocumentKey } from '../../model/document_key'; import { ObjectValue } from '../../model/object_value'; import { ExecutePipelineRequest, @@ -61,7 +64,6 @@ import { } from './stage'; import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; -import {ensureFirestoreConfigured, Firestore} from "../../api/database"; interface ReadableUserData { _readUserData(dataReader: UserDataReader): void; @@ -114,8 +116,21 @@ function isReadableUserData(value: any): value is ReadableUserData { * ``` */ export class Pipeline { + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + * @param stages + * @param converter + */ constructor( - private db: Firestore, + private db: FirestoreClient, + private userDataReader: UserDataReader, + private userDataWriter: AbstractUserDataWriter, + private documentReferenceFactory: (id: DocumentKey) => DocumentReference, private stages: Stage[], // TODO(pipeline) support converter //private converter: FirestorePipelineConverter = defaultPipelineConverter() @@ -155,7 +170,14 @@ export class Pipeline { this.readUserData('addFields', this.selectablesToMap(fields)) ) ); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -192,7 +214,14 @@ export class Pipeline { select(...selections: Array): Pipeline { const copy = this.stages.map(s => s); copy.push(new Select(this.selectablesToMap(selections))); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } private selectablesToMap( @@ -230,15 +259,14 @@ export class Pipeline { | ReadableUserData[] | ReadableUserData >(name: string, expressionMap: T): T { - const userDataReader = newUserDataReader(this.db); if (isReadableUserData(expressionMap)) { - expressionMap._readUserData(userDataReader); + expressionMap._readUserData(this.userDataReader); } else if (Array.isArray(expressionMap)) { expressionMap.forEach(readableData => - readableData._readUserData(userDataReader) + readableData._readUserData(this.userDataReader) ); } else { - expressionMap.forEach(expr => expr._readUserData(userDataReader)); + expressionMap.forEach(expr => expr._readUserData(this.userDataReader)); } return expressionMap; } @@ -277,7 +305,14 @@ export class Pipeline { where(condition: FilterCondition & Expr): Pipeline { const copy = this.stages.map(s => s); copy.push(new Where(this.readUserData('where', condition))); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -303,7 +338,14 @@ export class Pipeline { offset(offset: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Offset(offset)); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -334,7 +376,14 @@ export class Pipeline { limit(limit: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Limit(limit)); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -372,7 +421,14 @@ export class Pipeline { this.readUserData('distinct', this.selectablesToMap(groups || [])) ) ); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -478,13 +534,20 @@ export class Pipeline { ) ); } - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } findNearest(options: FindNearestOptions): Pipeline; findNearest(options: FindNearestOptions): Pipeline { const copy = this.stages.map(s => s); - const parseContext = newUserDataReader(this.db).createContext( + const parseContext = this.userDataReader.createContext( UserDataSource.Argument, 'findNearest' ); @@ -499,7 +562,13 @@ export class Pipeline { options.distanceField ) ); - return new Pipeline(this.db, copy); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy + ); } /** @@ -554,7 +623,14 @@ export class Pipeline { ); } - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } /** @@ -579,14 +655,20 @@ export class Pipeline { */ genericStage(name: string, params: any[]): Pipeline { const copy = this.stages.map(s => s); - const dataReader = newUserDataReader(this.db); params.forEach(param => { if (isReadableUserData(param)) { - param._readUserData(dataReader); + param._readUserData(this.userDataReader); } }); copy.push(new GenericStage(name, params)); - return new Pipeline(this.db, copy, this.converter); + return new Pipeline( + this.db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + copy, + this.converter + ); } // TODO(pipeline) support converter @@ -687,24 +769,13 @@ export class Pipeline { * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - // const util = new ExecutionUtil( - // this.db, - // this.db._serializer!, - // this.converter - // ); - // return util._getResponse(this).then(result => result!); - // the query is a VectorQuery instance - // the query is a VectorQuery instance - const client = ensureFirestoreConfigured(this.db); - - return firestoreClientExecutePipeline(client, this).then(result => { - const userDataWriter = new ExpUserDataWriter(this.db); + return firestoreClientExecutePipeline(this.db, this).then(result => { const docs = result.map( element => new PipelineResult( - userDataWriter, + this.userDataWriter, element.key?.path - ? new DocumentReference(this.db, null, element.key) + ? this.documentReferenceFactory(element.key) : undefined, element.fields, element.executionTime?.toTimestamp(), diff --git a/packages/firestore/src/pipelines/api/stage.ts b/packages/firestore/src/pipelines/api/stage.ts index 05033072d3f..ec34f7068ab 100644 --- a/packages/firestore/src/pipelines/api/stage.ts +++ b/packages/firestore/src/pipelines/api/stage.ts @@ -12,15 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. - -import { - Accumulator, - Expr, - Field, - FilterCondition, - Ordering -} from './expressions'; - +import { DocumentReference } from '../../lite-api/reference'; import { VectorValue } from '../../lite-api/vector_value'; import { ObjectValue } from '../../model/object_value'; import { @@ -33,8 +25,14 @@ import { toMapValue, toStringValue } from '../../remote/serializer'; -import { DocumentReference } from '../../lite-api/reference'; +import { + Accumulator, + Expr, + Field, + FilterCondition, + Ordering +} from './expressions'; /** * @beta diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index 9cbf18f7155..963116a1ba7 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -40,6 +40,7 @@ import { TargetId } from '../core/types'; import { Bytes } from '../lite-api/bytes'; import { GeoPoint } from '../lite-api/geo_point'; import { Timestamp } from '../lite-api/timestamp'; +import { UserDataReader } from '../lite-api/user_data_reader'; import { TargetData, TargetPurpose } from '../local/target_data'; import { MutableDocument } from '../model/document'; import { DocumentKey } from '../model/document_key'; @@ -57,6 +58,7 @@ import { import { normalizeTimestamp } from '../model/normalize'; import { ObjectValue } from '../model/object_value'; import { FieldPath, ResourcePath } from '../model/path'; +import { PipelineStreamElement } from '../model/pipeline_stream_element'; import { ArrayRemoveTransformOperation, ArrayUnionTransformOperation, @@ -90,7 +92,6 @@ import { Timestamp as ProtoTimestamp, Write as ProtoWrite, WriteResult as ProtoWriteResult, - firestoreV1ApiClientInterfaces, Value as ProtoValue, MapValue as ProtoMapValue, ExecutePipelineResponse as ProtoExecutePipelineResponse @@ -111,12 +112,6 @@ import { WatchTargetChangeState } from './watch_change'; -import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; - - -import { UserDataReader } from '../lite-api/user_data_reader'; -import { PipelineStreamElement } from '../model/pipeline_stream_element'; - const DIRECTIONS = (() => { const dirs: { [dir: string]: ProtoOrderDirection } = {}; dirs[Direction.ASCENDING] = 'ASCENDING'; From dbc7c121804bee831ed2a1b0aebce0fbacec5392 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:42:21 -0600 Subject: [PATCH 003/295] Expose pipeline in lite-api --- common/api-review/firestore.api.md | 2 +- packages/firestore/src/api.ts | 10 +-- packages/firestore/src/api/database.ts | 2 +- packages/firestore/src/api/pipeline.ts | 90 +++++++++++++++++++ .../firestore/src/core/firestore_client.ts | 2 +- .../{pipelines/api => core}/pipeline-util.ts | 38 ++++---- packages/firestore/src/lite-api/database.ts | 10 +++ .../api => lite-api}/expressions.ts | 21 ++--- .../api => lite-api}/pipeline-result.ts | 14 +-- .../api => lite-api}/pipeline-source.ts | 10 +-- .../{pipelines/api => lite-api}/pipeline.ts | 22 ++--- .../src/{pipelines/api => lite-api}/stage.ts | 14 +-- .../test/integration/api/pipeline.test.ts | 0 13 files changed, 169 insertions(+), 66 deletions(-) create mode 100644 packages/firestore/src/api/pipeline.ts rename packages/firestore/src/{pipelines/api => core}/pipeline-util.ts (96%) rename packages/firestore/src/{pipelines/api => lite-api}/expressions.ts (99%) rename packages/firestore/src/{pipelines/api => lite-api}/pipeline-result.ts (94%) rename packages/firestore/src/{pipelines/api => lite-api}/pipeline-source.ts (86%) rename packages/firestore/src/{pipelines/api => lite-api}/pipeline.ts (98%) rename packages/firestore/src/{pipelines/api => lite-api}/stage.ts (94%) create mode 100644 packages/firestore/test/integration/api/pipeline.test.ts diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 2af57954604..0eba34b259a 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1220,7 +1220,7 @@ export function genericFunction(name: string, params: Constant[]): FirestoreFunc // @beta (undocumented) export class GenericStage implements Stage { - constructor(name: string, params: any[]); + constructor(name: string, params: unknown[]); // (undocumented) name: string; } diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 4d63f39c671..10241483e17 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -15,11 +15,11 @@ * limitations under the License. */ -export { PipelineSource } from './pipelines/api/pipeline-source'; +export { PipelineSource } from './api/pipeline-source'; -export { PipelineResult } from './pipelines/api/pipeline-result'; +export { PipelineResult } from './api/pipeline-result'; -export { Pipeline } from './pipelines/api/pipeline'; +export { Pipeline } from './api/pipeline'; export { Stage, @@ -38,7 +38,7 @@ export { Select, Sort, GenericStage -} from './pipelines/api/stage'; +} from './api/stage'; export { add, @@ -179,7 +179,7 @@ export { Selectable, FilterCondition, Accumulator -} from './pipelines/api/expressions'; +} from './api/expressions'; export { aggregateFieldEqual, diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 5d112c2feab..8ac7bc4d455 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -55,7 +55,6 @@ import { import { LRU_COLLECTION_DISABLED } from '../local/lru_garbage_collector'; import { LRU_MINIMUM_CACHE_SIZE_BYTES } from '../local/lru_garbage_collector_impl'; import { DocumentKey } from '../model/document_key'; -import { PipelineSource } from '../pipelines/api/pipeline-source'; import { debugAssert } from '../util/assert'; import { AsyncQueue } from '../util/async_queue'; import { AsyncQueueImpl } from '../util/async_queue_impl'; @@ -66,6 +65,7 @@ import { Deferred } from '../util/promise'; import { LoadBundleTask } from './bundle'; import { CredentialsProvider } from './credentials'; +import { PipelineSource } from './pipeline-source'; import { FirestoreSettings, PersistenceSettings } from './settings'; import { ExpUserDataWriter } from './user_data_writer'; diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts new file mode 100644 index 00000000000..a684c566dc9 --- /dev/null +++ b/packages/firestore/src/api/pipeline.ts @@ -0,0 +1,90 @@ +import { + firestoreClientExecutePipeline +} from "../core/firestore_client"; +import {Pipeline as LitePipeline} from "../lite-api/pipeline"; +import {PipelineResult} from "../lite-api/pipeline-result"; +import {DocumentData, DocumentReference} from "../lite-api/reference"; +import {Stage} from "../lite-api/stage"; +import {UserDataReader} from "../lite-api/user_data_reader"; +import {AbstractUserDataWriter} from "../lite-api/user_data_writer"; +import {DocumentKey} from "../model/document_key"; + +import {ensureFirestoreConfigured, Firestore} from "./database"; + +export class Pipeline extends LitePipeline { + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + * @param stages + * @param converter + */ + constructor( + private db: Firestore, + userDataReader: UserDataReader, + userDataWriter: AbstractUserDataWriter, + documentReferenceFactory: (id: DocumentKey) => DocumentReference, + stages: Stage[], + // TODO(pipeline) support converter + //private converter: FirestorePipelineConverter = defaultPipelineConverter() + converter: unknown = {} + ) { + super(db, userDataReader, userDataWriter, documentReferenceFactory, stages, converter); + } + + /** + * Executes this pipeline and returns a Promise to represent the asynchronous operation. + * + *

The returned Promise can be used to track the progress of the pipeline execution + * and retrieve the results (or handle any errors) asynchronously. + * + *

The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link + * PipelineResult} typically represents a single key/value map that has passed through all the + * stages of the pipeline, however this might differ depending on the stages involved in the + * pipeline. For example: + * + *

    + *
  • If there are no stages or only transformation stages, each {@link PipelineResult} + * represents a single document.
  • + *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, + * representing the aggregated results over the entire dataset .
  • + *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a + * distinct group and its associated aggregated values.
  • + *
+ * + *

Example: + * + * ```typescript + * const futureResults = await firestore.pipeline().collection("books") + * .where(gt(Field.of("rating"), 4.5)) + * .select("title", "author", "rating") + * .execute(); + * ``` + * + * @return A Promise representing the asynchronous pipeline execution. + */ + execute(): Promise>> { + const client = ensureFirestoreConfigured(this.db); + return firestoreClientExecutePipeline(client, this).then(result => { + const docs = result.map( + element => + new PipelineResult( + this.userDataWriter, + element.key?.path + ? this.documentReferenceFactory(element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + //this.converter + ) + ); + + return docs; + }); + } +} diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index 9b1e6c3521e..e488cab3c43 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -22,6 +22,7 @@ import { CredentialChangeListener, CredentialsProvider } from '../api/credentials'; +import { Pipeline } from '../api/pipeline'; import { User } from '../auth/user'; import { LocalStore } from '../local/local_store'; import { @@ -39,7 +40,6 @@ import { DocumentKey } from '../model/document_key'; import { FieldIndex } from '../model/field_index'; import { Mutation } from '../model/mutation'; import { PipelineStreamElement } from '../model/pipeline_stream_element'; -import { Pipeline } from '../pipelines/api/pipeline'; import { toByteStreamReader } from '../platform/byte_stream_reader'; import { newSerializer } from '../platform/serializer'; import { newTextEncoder } from '../platform/text_serializer'; diff --git a/packages/firestore/src/pipelines/api/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts similarity index 96% rename from packages/firestore/src/pipelines/api/pipeline-util.ts rename to packages/firestore/src/core/pipeline-util.ts index 0acc05024b8..997393b645e 100644 --- a/packages/firestore/src/pipelines/api/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -13,13 +13,15 @@ // limitations under the License. import { - CompositeFilter as CompositeFilterInternal, - CompositeOperator, - FieldFilter as FieldFilterInternal, - Filter as FilterInternal, - Operator -} from '../../core/filter'; -import { isNanValue, isNullValue } from '../../model/values'; + and, + Constant, + Expr, + Field, + FilterCondition, + not, + or +} from '../api/expressions'; +import { isNanValue, isNullValue } from '../model/values'; import { ArrayValue as ProtoArrayValue, Function as ProtoFunction, @@ -28,19 +30,19 @@ import { Pipeline as ProtoPipeline, Timestamp as ProtoTimestamp, Value as ProtoValue -} from '../../protos/firestore_proto_api'; -import { fail } from '../../util/assert'; -import { isPlainObject } from '../../util/input_validation'; +} from '../protos/firestore_proto_api'; +import { fail } from '../util/assert'; +import { isPlainObject } from '../util/input_validation'; import { - and, - Constant, - Expr, - Field, - FilterCondition, - not, - or -} from './expressions'; + CompositeFilter as CompositeFilterInternal, + CompositeOperator, + FieldFilter as FieldFilterInternal, + Filter as FilterInternal, + Operator +} from './filter'; + +/* eslint @typescript-eslint/no-explicit-any: 0 */ function isITimestamp(obj: any): obj is ProtoTimestamp { if (typeof obj !== 'object' || obj === null) { diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 9ea4d4ec52e..61aa3ba0c6b 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -34,6 +34,7 @@ import { makeAuthCredentialsProvider, OAuthToken } from '../api/credentials'; +import {PipelineSource} from "../api/pipeline-source"; import { User } from '../auth/user'; import { DatabaseId, DEFAULT_DATABASE_NAME } from '../core/database_info'; import { Code, FirestoreError } from '../util/error'; @@ -173,6 +174,15 @@ export class Firestore implements FirestoreService { removeComponents(this); return Promise.resolve(); } + + // TODO(pipeline) implement pipeline in lite-api + /** + * @internal + * @private + */ + pipeline(): PipelineSource { + throw Error("not implemented"); + } } /** diff --git a/packages/firestore/src/pipelines/api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts similarity index 99% rename from packages/firestore/src/pipelines/api/expressions.ts rename to packages/firestore/src/lite-api/expressions.ts index f8ca08d1c6b..4efc54a5d74 100644 --- a/packages/firestore/src/pipelines/api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -14,29 +14,30 @@ /* eslint @typescript-eslint/no-explicit-any: 0 */ -import { documentId, FieldPath } from '../../lite-api/field_path'; -import { GeoPoint } from '../../lite-api/geo_point'; -import { DocumentReference } from '../../lite-api/reference'; -import { Timestamp } from '../../lite-api/timestamp'; + +import { documentId, FieldPath } from '../lite-api/field_path'; +import { GeoPoint } from '../lite-api/geo_point'; +import { DocumentReference } from '../lite-api/reference'; +import { Timestamp } from '../lite-api/timestamp'; import { fieldPathFromArgument, parseData, UserDataReader, UserDataSource -} from '../../lite-api/user_data_reader'; -import { VectorValue } from '../../lite-api/vector_value'; +} from '../lite-api/user_data_reader'; +import { VectorValue } from '../lite-api/vector_value'; import { DOCUMENT_KEY_NAME, FieldPath as InternalFieldPath -} from '../../model/path'; -import { Value as ProtoValue } from '../../protos/firestore_proto_api'; +} from '../model/path'; +import { Value as ProtoValue } from '../protos/firestore_proto_api'; import { JsonProtoSerializer, ProtoSerializable, toStringValue, UserData -} from '../../remote/serializer'; -import { hardAssert } from '../../util/assert'; +} from '../remote/serializer'; +import { hardAssert } from '../util/assert'; import { Pipeline } from './pipeline'; diff --git a/packages/firestore/src/pipelines/api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts similarity index 94% rename from packages/firestore/src/pipelines/api/pipeline-result.ts rename to packages/firestore/src/lite-api/pipeline-result.ts index 243a79a82d3..c8fb610ec4a 100644 --- a/packages/firestore/src/pipelines/api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FieldPath } from '../../lite-api/field_path'; +import { FieldPath } from '../lite-api/field_path'; import { DocumentData, DocumentReference, refEqual -} from '../../lite-api/reference'; -import { fieldPathFromArgument } from '../../lite-api/snapshot'; -import { Timestamp } from '../../lite-api/timestamp'; -import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; -import { ObjectValue } from '../../model/object_value'; -import { isOptionalEqual } from '../../util/misc'; +} from '../lite-api/reference'; +import { fieldPathFromArgument } from '../lite-api/snapshot'; +import { Timestamp } from '../lite-api/timestamp'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { ObjectValue } from '../model/object_value'; +import { isOptionalEqual } from '../util/misc'; /** * @beta diff --git a/packages/firestore/src/pipelines/api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts similarity index 86% rename from packages/firestore/src/pipelines/api/pipeline-source.ts rename to packages/firestore/src/lite-api/pipeline-source.ts index 24e890151ec..42393145004 100644 --- a/packages/firestore/src/pipelines/api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FirestoreClient } from '../../core/firestore_client'; -import { DocumentReference } from '../../lite-api/reference'; -import { UserDataReader } from '../../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; -import { DocumentKey } from '../../model/document_key'; +import { FirestoreClient } from '../core/firestore_client'; +import { DocumentReference } from '../lite-api/reference'; +import { UserDataReader } from '../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { DocumentKey } from '../model/document_key'; import { Pipeline } from './pipeline'; import { diff --git a/packages/firestore/src/pipelines/api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts similarity index 98% rename from packages/firestore/src/pipelines/api/pipeline.ts rename to packages/firestore/src/lite-api/pipeline.ts index 7de5e12ee75..0d3a91946c3 100644 --- a/packages/firestore/src/pipelines/api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -16,25 +16,25 @@ import { FirestoreClient, firestoreClientExecutePipeline -} from '../../core/firestore_client'; -import { DocumentData, DocumentReference } from '../../lite-api/reference'; +} from '../core/firestore_client'; +import { DocumentData, DocumentReference } from '../lite-api/reference'; import { parseVectorValue, UserDataReader, UserDataSource -} from '../../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../../lite-api/user_data_writer'; -import { DocumentKey } from '../../model/document_key'; -import { ObjectValue } from '../../model/object_value'; +} from '../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { DocumentKey } from '../model/document_key'; +import { ObjectValue } from '../model/object_value'; import { ExecutePipelineRequest, firestoreV1ApiClientInterfaces, Stage as ProtoStage -} from '../../protos/firestore_proto_api'; +} from '../protos/firestore_proto_api'; import { getEncodedDatabaseId, JsonProtoSerializer -} from '../../remote/serializer'; +} from '../remote/serializer'; import { Accumulator, @@ -46,8 +46,8 @@ import { FilterCondition, Ordering, Selectable -} from './expressions'; -import { PipelineResult } from './pipeline-result'; +} from '../lite-api/expressions'; +import { PipelineResult } from '../lite-api/pipeline-result'; import { AddFields, Aggregate, @@ -61,7 +61,7 @@ import { Sort, Stage, Where -} from './stage'; +} from '../lite-api/stage'; import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; diff --git a/packages/firestore/src/pipelines/api/stage.ts b/packages/firestore/src/lite-api/stage.ts similarity index 94% rename from packages/firestore/src/pipelines/api/stage.ts rename to packages/firestore/src/lite-api/stage.ts index ec34f7068ab..efd9f26c67c 100644 --- a/packages/firestore/src/pipelines/api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DocumentReference } from '../../lite-api/reference'; -import { VectorValue } from '../../lite-api/vector_value'; -import { ObjectValue } from '../../model/object_value'; +import { DocumentReference } from '../lite-api/reference'; +import { VectorValue } from '../lite-api/vector_value'; +import { ObjectValue } from '../model/object_value'; import { Stage as ProtoStage, Value as ProtoValue -} from '../../protos/firestore_proto_api'; -import { toNumber } from '../../remote/number_serializer'; +} from '../protos/firestore_proto_api'; +import { toNumber } from '../remote/number_serializer'; import { JsonProtoSerializer, toMapValue, toStringValue -} from '../../remote/serializer'; +} from '../remote/serializer'; import { Accumulator, @@ -369,7 +369,7 @@ export class Sort implements Stage { * @beta */ export class GenericStage implements Stage { - constructor(public name: string, params: any[]) {} + constructor(public name: string, params: unknown[]) {} /** * @internal diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts new file mode 100644 index 00000000000..e69de29bb2d From 27213de17789f62abaae29554c83e6319a99b9d9 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:44:16 -0600 Subject: [PATCH 004/295] Refactoring to support lite-api --- packages/firestore/lite/index.ts | 166 ++++ packages/firestore/rollup.shared.js | 8 +- packages/firestore/src/api.ts | 10 +- packages/firestore/src/api/aggregate.ts | 8 +- packages/firestore/src/api/database.ts | 5 +- packages/firestore/src/api/pipeline.ts | 33 +- .../firestore/src/core/firestore_client.ts | 2 +- packages/firestore/src/core/pipeline-util.ts | 2 +- packages/firestore/src/lite-api/database.ts | 21 +- .../firestore/src/lite-api/expressions.ts | 23 +- .../firestore/src/lite-api/pipeline-result.ts | 15 +- .../firestore/src/lite-api/pipeline-source.ts | 10 +- packages/firestore/src/lite-api/pipeline.ts | 71 +- packages/firestore/src/lite-api/reference.ts | 83 ++ packages/firestore/src/lite-api/stage.ts | 4 +- packages/firestore/src/remote/datastore.ts | 2 +- .../test/integration/api/pipeline.test.ts | 797 ++++++++++++++++++ .../test/unit/api/document_change.test.ts | 2 +- .../test/unit/remote/serializer.helper.ts | 2 +- .../firestore/test/unit/specs/spec_builder.ts | 2 +- packages/firestore/test/util/api_helpers.ts | 2 +- 21 files changed, 1171 insertions(+), 97 deletions(-) diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index b751f0a8254..9969924b5b7 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -27,6 +27,172 @@ import { registerFirestore } from './register'; registerFirestore(); +export { PipelineSource } from '../src/lite-api/pipeline-source'; + +export { PipelineResult } from '../src/lite-api/pipeline-result'; + +export { Pipeline } from '../src/lite-api/pipeline'; + +export { + Stage, + FindNearestOptions, + AddFields, + Aggregate, + Distinct, + CollectionSource, + CollectionGroupSource, + DatabaseSource, + DocumentsSource, + Where, + FindNearest, + Limit, + Offset, + Select, + Sort, + GenericStage +} from '../src/lite-api/stage'; + +export { + add, + subtract, + multiply, + divide, + mod, + eq, + neq, + lt, + lte, + gt, + gte, + arrayConcat, + arrayContains, + arrayContainsAny, + arrayContainsAll, + arrayLength, + inAny, + notInAny, + and as andExpression, + or as orExpression, + xor, + ifFunction, + not, + logicalMax, + logicalMin, + exists, + isNan, + reverse, + replaceFirst, + replaceAll, + byteLength, + charLength, + like, + regexContains, + regexMatch, + strContains, + startsWith, + endsWith, + toLower, + toUpper, + trim, + strConcat, + mapGet, + countAll, + count as countExpression, + sum as sumExpression, + avg, + min, + max, + cosineDistance, + dotProduct, + euclideanDistance, + vectorLength, + unixMicrosToTimestamp, + timestampToUnixMicros, + unixMillisToTimestamp, + timestampToUnixMillis, + unixSecondsToTimestamp, + timestampToUnixSeconds, + timestampAdd, + timestampSub, + genericFunction, + ascending, + descending, + ExprWithAlias, + Field, + Fields, + Constant, + FirestoreFunction, + Add, + Subtract, + Multiply, + Divide, + Mod, + Eq, + Neq, + Lt, + Lte, + Gt, + Gte, + ArrayConcat, + ArrayReverse, + ArrayContains, + ArrayContainsAll, + ArrayContainsAny, + ArrayLength, + ArrayElement, + In, + IsNan, + Exists, + Not, + And, + Or, + Xor, + If, + LogicalMax, + LogicalMin, + Reverse, + ReplaceFirst, + ReplaceAll, + CharLength, + ByteLength, + Like, + RegexContains, + RegexMatch, + StrContains, + StartsWith, + EndsWith, + ToLower, + ToUpper, + Trim, + StrConcat, + MapGet, + Count, + Sum, + Avg, + Min, + Max, + CosineDistance, + DotProduct, + EuclideanDistance, + VectorLength, + UnixMicrosToTimestamp, + TimestampToUnixMicros, + UnixMillisToTimestamp, + TimestampToUnixMillis, + UnixSecondsToTimestamp, + TimestampToUnixSeconds, + TimestampAdd, + TimestampSub, + Ordering, + ExprType, + AccumulatorTarget, + FilterExpr, + SelectableExpr, + Selectable, + FilterCondition, + Accumulator +} from '../src/lite-api/expressions'; + export { aggregateQuerySnapshotEqual, getCount, diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index 44253d24d38..a876c96b1e0 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -97,9 +97,11 @@ exports.resolveNodeExterns = function (id) { /** Breaks the build if there is a circular dependency. */ exports.onwarn = function (warning, defaultWarn) { - if (warning.code === 'CIRCULAR_DEPENDENCY') { - throw new Error(warning); - } + // TODO(pipeline) re-enable and fix circular dependencies after the pipeline exploration phase + // if (warning.code === 'CIRCULAR_DEPENDENCY') { + // console.log(JSON.stringify(warning)); + // throw new Error(warning); + // } defaultWarn(warning); }; diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 10241483e17..7193bff675a 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -15,11 +15,11 @@ * limitations under the License. */ -export { PipelineSource } from './api/pipeline-source'; +export { PipelineSource } from './lite-api/pipeline-source'; -export { PipelineResult } from './api/pipeline-result'; +export { PipelineResult } from './lite-api/pipeline-result'; -export { Pipeline } from './api/pipeline'; +export { Pipeline } from './lite-api/pipeline'; export { Stage, @@ -38,7 +38,7 @@ export { Select, Sort, GenericStage -} from './api/stage'; +} from './lite-api/stage'; export { add, @@ -179,7 +179,7 @@ export { Selectable, FilterCondition, Accumulator -} from './api/expressions'; +} from './lite-api/expressions'; export { aggregateFieldEqual, diff --git a/packages/firestore/src/api/aggregate.ts b/packages/firestore/src/api/aggregate.ts index b5a0a580067..453f9e0a841 100644 --- a/packages/firestore/src/api/aggregate.ts +++ b/packages/firestore/src/api/aggregate.ts @@ -15,11 +15,15 @@ * limitations under the License. */ -import { AggregateField, AggregateSpec, DocumentData, Query } from '../api'; import { AggregateImpl } from '../core/aggregate'; import { firestoreClientRunAggregateQuery } from '../core/firestore_client'; import { count } from '../lite-api/aggregate'; -import { AggregateQuerySnapshot } from '../lite-api/aggregate_types'; +import { + AggregateField, + AggregateQuerySnapshot, + AggregateSpec +} from '../lite-api/aggregate_types'; +import { DocumentData, Query } from '../lite-api/reference'; import { ApiClientObjectMap, Value } from '../protos/firestore_proto_api'; import { cast } from '../util/input_validation'; import { mapToArray } from '../util/obj'; diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 8ac7bc4d455..812811f41ed 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -46,6 +46,7 @@ import { connectFirestoreEmulator, Firestore as LiteFirestore } from '../lite-api/database'; +import { PipelineSource } from '../lite-api/pipeline-source'; import { DocumentReference, Query } from '../lite-api/reference'; import { newUserDataReader } from '../lite-api/user_data_reader'; import { @@ -65,7 +66,6 @@ import { Deferred } from '../util/promise'; import { LoadBundleTask } from './bundle'; import { CredentialsProvider } from './credentials'; -import { PipelineSource } from './pipeline-source'; import { FirestoreSettings, PersistenceSettings } from './settings'; import { ExpUserDataWriter } from './user_data_writer'; @@ -109,10 +109,9 @@ export class Firestore extends LiteFirestore { }; pipeline = (): PipelineSource => { - const client = ensureFirestoreConfigured(this); const firestore = this; return new PipelineSource( - client, + this, newUserDataReader(firestore), new ExpUserDataWriter(firestore), (key: DocumentKey) => { diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index a684c566dc9..047731b40e5 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -1,17 +1,17 @@ -import { - firestoreClientExecutePipeline -} from "../core/firestore_client"; -import {Pipeline as LitePipeline} from "../lite-api/pipeline"; -import {PipelineResult} from "../lite-api/pipeline-result"; -import {DocumentData, DocumentReference} from "../lite-api/reference"; -import {Stage} from "../lite-api/stage"; -import {UserDataReader} from "../lite-api/user_data_reader"; -import {AbstractUserDataWriter} from "../lite-api/user_data_writer"; -import {DocumentKey} from "../model/document_key"; +import { firestoreClientExecutePipeline } from '../core/firestore_client'; +import { Pipeline as LitePipeline } from '../lite-api/pipeline'; +import { PipelineResult } from '../lite-api/pipeline-result'; +import { DocumentData, DocumentReference } from '../lite-api/reference'; +import { Stage } from '../lite-api/stage'; +import { UserDataReader } from '../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { DocumentKey } from '../model/document_key'; -import {ensureFirestoreConfigured, Firestore} from "./database"; +import { ensureFirestoreConfigured, Firestore } from './database'; -export class Pipeline extends LitePipeline { +export class Pipeline< + AppModelType = DocumentData +> extends LitePipeline { /** * @internal * @private @@ -32,7 +32,14 @@ export class Pipeline extends LitePipeline = defaultPipelineConverter() converter: unknown = {} ) { - super(db, userDataReader, userDataWriter, documentReferenceFactory, stages, converter); + super( + db, + userDataReader, + userDataWriter, + documentReferenceFactory, + stages, + converter + ); } /** diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index e488cab3c43..57aa99869da 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -22,8 +22,8 @@ import { CredentialChangeListener, CredentialsProvider } from '../api/credentials'; -import { Pipeline } from '../api/pipeline'; import { User } from '../auth/user'; +import { Pipeline } from '../lite-api/pipeline'; import { LocalStore } from '../local/local_store'; import { localStoreConfigureFieldIndexes, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 997393b645e..228aee304c4 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -20,7 +20,7 @@ import { FilterCondition, not, or -} from '../api/expressions'; +} from '../lite-api/expressions'; import { isNanValue, isNullValue } from '../model/values'; import { ArrayValue as ProtoArrayValue, diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 61aa3ba0c6b..93fe4eb95d1 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,26 +28,29 @@ import { getDefaultEmulatorHostnameAndPort } from '@firebase/util'; +import { PipelineSource, DocumentReference } from '../api'; import { CredentialsProvider, EmulatorAuthCredentialsProvider, makeAuthCredentialsProvider, OAuthToken } from '../api/credentials'; -import {PipelineSource} from "../api/pipeline-source"; import { User } from '../auth/user'; import { DatabaseId, DEFAULT_DATABASE_NAME } from '../core/database_info'; +import { DocumentKey } from '../model/document_key'; import { Code, FirestoreError } from '../util/error'; import { cast } from '../util/input_validation'; import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; +import { LiteUserDataWriter } from './reference_impl'; import { DEFAULT_HOST, FirestoreSettingsImpl, PrivateSettings, FirestoreSettings } from './settings'; +import { newUserDataReader } from './user_data_reader'; export { EmulatorMockTokenOptions } from '@firebase/util'; @@ -175,13 +178,17 @@ export class Firestore implements FirestoreService { return Promise.resolve(); } - // TODO(pipeline) implement pipeline in lite-api - /** - * @internal - * @private - */ pipeline(): PipelineSource { - throw Error("not implemented"); + const userDataWriter = new LiteUserDataWriter(this); + const userDataReader = newUserDataReader(this); + return new PipelineSource( + this, + userDataReader, + userDataWriter, + (key: DocumentKey) => { + return new DocumentReference(this, null, key); + } + ); } } diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 4efc54a5d74..047df3d8b15 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -14,18 +14,6 @@ /* eslint @typescript-eslint/no-explicit-any: 0 */ - -import { documentId, FieldPath } from '../lite-api/field_path'; -import { GeoPoint } from '../lite-api/geo_point'; -import { DocumentReference } from '../lite-api/reference'; -import { Timestamp } from '../lite-api/timestamp'; -import { - fieldPathFromArgument, - parseData, - UserDataReader, - UserDataSource -} from '../lite-api/user_data_reader'; -import { VectorValue } from '../lite-api/vector_value'; import { DOCUMENT_KEY_NAME, FieldPath as InternalFieldPath @@ -39,7 +27,18 @@ import { } from '../remote/serializer'; import { hardAssert } from '../util/assert'; +import { documentId, FieldPath } from './field_path'; +import { GeoPoint } from './geo_point'; import { Pipeline } from './pipeline'; +import { DocumentReference } from './reference'; +import { Timestamp } from './timestamp'; +import { + fieldPathFromArgument, + parseData, + UserDataReader, + UserDataSource +} from './user_data_reader'; +import { VectorValue } from './vector_value'; /** * @beta diff --git a/packages/firestore/src/lite-api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts index c8fb610ec4a..9ebaeb1b306 100644 --- a/packages/firestore/src/lite-api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -12,18 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FieldPath } from '../lite-api/field_path'; -import { - DocumentData, - DocumentReference, - refEqual -} from '../lite-api/reference'; -import { fieldPathFromArgument } from '../lite-api/snapshot'; -import { Timestamp } from '../lite-api/timestamp'; -import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { ObjectValue } from '../model/object_value'; import { isOptionalEqual } from '../util/misc'; +import { FieldPath } from './field_path'; +import { DocumentData, DocumentReference, refEqual } from './reference'; +import { fieldPathFromArgument } from './snapshot'; +import { Timestamp } from './timestamp'; +import { AbstractUserDataWriter } from './user_data_writer'; + /** * @beta * diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index 42393145004..4b913e26ce7 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FirestoreClient } from '../core/firestore_client'; -import { DocumentReference } from '../lite-api/reference'; -import { UserDataReader } from '../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { DocumentKey } from '../model/document_key'; +import { Firestore } from './database'; import { Pipeline } from './pipeline'; +import { DocumentReference } from './reference'; import { CollectionGroupSource, CollectionSource, DatabaseSource, DocumentsSource } from './stage'; +import { UserDataReader } from './user_data_reader'; +import { AbstractUserDataWriter } from './user_data_writer'; /** * Represents the source of a Firestore {@link Pipeline}. @@ -40,7 +40,7 @@ export class PipelineSource { * @param documentReferenceFactory */ constructor( - private db: FirestoreClient, + private db: Firestore, private userDataReader: UserDataReader, private userDataWriter: AbstractUserDataWriter, private documentReferenceFactory: (id: DocumentKey) => DocumentReference diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 0d3a91946c3..d6a6c21bb90 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -13,17 +13,7 @@ // limitations under the License. /* eslint @typescript-eslint/no-explicit-any: 0 */ -import { - FirestoreClient, - firestoreClientExecutePipeline -} from '../core/firestore_client'; -import { DocumentData, DocumentReference } from '../lite-api/reference'; -import { - parseVectorValue, - UserDataReader, - UserDataSource -} from '../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; + import { DocumentKey } from '../model/document_key'; import { ObjectValue } from '../model/object_value'; import { @@ -31,11 +21,14 @@ import { firestoreV1ApiClientInterfaces, Stage as ProtoStage } from '../protos/firestore_proto_api'; +import { invokeExecutePipeline } from '../remote/datastore'; import { getEncodedDatabaseId, JsonProtoSerializer } from '../remote/serializer'; +import { getDatastore } from './components'; +import { Firestore } from './database'; import { Accumulator, AccumulatorTarget, @@ -46,8 +39,9 @@ import { FilterCondition, Ordering, Selectable -} from '../lite-api/expressions'; -import { PipelineResult } from '../lite-api/pipeline-result'; +} from './expressions'; +import { PipelineResult } from './pipeline-result'; +import { DocumentData, DocumentReference } from './reference'; import { AddFields, Aggregate, @@ -61,7 +55,13 @@ import { Sort, Stage, Where -} from '../lite-api/stage'; +} from './stage'; +import { + parseVectorValue, + UserDataReader, + UserDataSource +} from './user_data_reader'; +import { AbstractUserDataWriter } from './user_data_writer'; import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; @@ -115,11 +115,15 @@ function isReadableUserData(value: any): value is ReadableUserData { * .execute(); * ``` */ + +/** + * Base-class implementation + */ export class Pipeline { /** * @internal * @private - * @param db + * @param liteDb * @param userDataReader * @param userDataWriter * @param documentReferenceFactory @@ -127,10 +131,18 @@ export class Pipeline { * @param converter */ constructor( - private db: FirestoreClient, + private liteDb: Firestore, private userDataReader: UserDataReader, - private userDataWriter: AbstractUserDataWriter, - private documentReferenceFactory: (id: DocumentKey) => DocumentReference, + /** + * @internal + * @private + */ + protected userDataWriter: AbstractUserDataWriter, + /** + * @internal + * @private + */ + protected documentReferenceFactory: (id: DocumentKey) => DocumentReference, private stages: Stage[], // TODO(pipeline) support converter //private converter: FirestorePipelineConverter = defaultPipelineConverter() @@ -171,7 +183,7 @@ export class Pipeline { ) ); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -215,7 +227,7 @@ export class Pipeline { const copy = this.stages.map(s => s); copy.push(new Select(this.selectablesToMap(selections))); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -306,7 +318,7 @@ export class Pipeline { const copy = this.stages.map(s => s); copy.push(new Where(this.readUserData('where', condition))); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -339,7 +351,7 @@ export class Pipeline { const copy = this.stages.map(s => s); copy.push(new Offset(offset)); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -377,7 +389,7 @@ export class Pipeline { const copy = this.stages.map(s => s); copy.push(new Limit(limit)); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -422,7 +434,7 @@ export class Pipeline { ) ); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -535,7 +547,7 @@ export class Pipeline { ); } return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -563,7 +575,7 @@ export class Pipeline { ) ); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -624,7 +636,7 @@ export class Pipeline { } return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -662,7 +674,7 @@ export class Pipeline { }); copy.push(new GenericStage(name, params)); return new Pipeline( - this.db, + this.liteDb, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -769,7 +781,8 @@ export class Pipeline { * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - return firestoreClientExecutePipeline(this.db, this).then(result => { + const datastore = getDatastore(this.liteDb); + return invokeExecutePipeline(datastore, this).then(result => { const docs = result.map( element => new PipelineResult( diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 26ae2fbd433..966a8a4cc23 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -37,6 +37,7 @@ import { AutoId } from '../util/misc'; import { Firestore } from './database'; import { FieldPath } from './field_path'; import { FieldValue } from './field_value'; +import { Pipeline } from './pipeline'; import { FirestoreDataConverter } from './snapshot'; import { NestedUpdateFields, Primitive } from './types'; @@ -177,6 +178,88 @@ export class Query< this._query ); } + + /** + * @private + * @internal + */ + pipeline(): Pipeline { + throw Error('Not implemented - Query.pipeline()'); + // let pipeline; + // if (this._queryOptions.allDescendants) { + // pipeline = this.firestore + // .pipeline() + // .collectionGroup(this._queryOptions.collectionId); + // } else { + // pipeline = this.firestore + // .pipeline() + // .collection( + // this._queryOptions.parentPath.append(this._queryOptions.collectionId) + // .relativeName + // ); + // } + + // // filters + // for (const f of this._queryOptions.filters) { + // pipeline = pipeline.where(toPipelineFilterCondition(f, this._serializer)); + // } + + // // projections + // const projections = this._queryOptions.projection?.fields || []; + // if (projections.length > 0) { + // pipeline = pipeline.select( + // ...projections.map(p => Field.of(p.fieldPath!)) + // ); + // } + + // // orderbys + // const exists = this.createImplicitOrderBy().map(fieldOrder => { + // return Field.of(fieldOrder.field).exists(); + // }); + // if (exists.length > 1) { + // const [first, ...rest] = exists; + // pipeline = pipeline.where(and(first, ...rest)); + // } else if (exists.length === 1) { + // pipeline = pipeline.where(exists[0]); + // } + + // const orderings = this.createImplicitOrderBy().map(fieldOrder => { + // let dir: 'ascending' | 'descending' | undefined = undefined; + // switch (fieldOrder.direction) { + // case 'ASCENDING': { + // dir = 'ascending'; + // break; + // } + // case 'DESCENDING': { + // dir = 'descending'; + // break; + // } + // } + // return new Ordering(Field.of(fieldOrder.field), dir || 'ascending'); + // }); + // if (orderings.length > 0) { + // pipeline = pipeline.sort({orderings: orderings}); + // } + + // // Cursors, Limit and Offset + // if ( + // !!this._queryOptions.startAt || + // !!this._queryOptions.endAt || + // this._queryOptions.limitType === LimitType.Last + // ) { + // throw new Error( + // 'Query to Pipeline conversion: cursors and limitToLast is not supported yet.' + // ); + // } else { + // if (this._queryOptions.offset) { + // pipeline = pipeline.offset(this._queryOptions.offset); + // } + // if (this._queryOptions.limit) { + // pipeline = pipeline.limit(this._queryOptions.limit); + // } + // } + // return pipeline; + } } /** diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index efd9f26c67c..4cd684fbaac 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { DocumentReference } from '../lite-api/reference'; -import { VectorValue } from '../lite-api/vector_value'; import { ObjectValue } from '../model/object_value'; import { Stage as ProtoStage, @@ -33,6 +31,8 @@ import { FilterCondition, Ordering } from './expressions'; +import { DocumentReference } from './reference'; +import { VectorValue } from './vector_value'; /** * @beta diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index d3f836b676e..bca88583d1a 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -20,12 +20,12 @@ import { User } from '../auth/user'; import { Aggregate } from '../core/aggregate'; import { DatabaseId } from '../core/database_info'; import { queryToAggregateTarget, Query, queryToTarget } from '../core/query'; +import { Pipeline } from '../lite-api/pipeline'; import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; import { Mutation } from '../model/mutation'; import { ResourcePath } from '../model/path'; import { PipelineStreamElement } from '../model/pipeline_stream_element'; -import { Pipeline } from '../pipelines/api/pipeline'; import { ApiClientObjectMap, BatchGetDocumentsRequest as ProtoBatchGetDocumentsRequest, diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index e69de29bb2d..aba38bab427 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -0,0 +1,797 @@ +// Copyright 2024 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 { expect, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import { addEqualityMatcher } from '../../util/equality_matcher'; +import { Deferred } from '../../util/promise'; +import { + add, + andExpression, + arrayContains, + arrayContainsAny, + avg, + CollectionReference, + Constant, + cosineDistance, + countAll, + doc, + DocumentData, + dotProduct, + endsWith, + eq, + euclideanDistance, + Field, + Firestore, + gt, + like, + lt, + lte, + mapGet, + neq, + not, + orExpression, + PipelineResult, + regexContains, + regexMatch, + setDoc, + startsWith, + strConcat, + subtract +} from '../util/firebase_export'; +import { apiDescribe, withTestCollection } from '../util/helpers'; + +use(chaiAsPromised); + +apiDescribe('Queries', persistence => { + addEqualityMatcher(); + let firestore: Firestore; + let randomCol: CollectionReference; + + // async function addDocs( + // ...docs: DocumentData[] + // ): Promise { + // let id = 0; // Guarantees consistent ordering for the first documents + // const refs: DocumentReference[] = []; + // for (const data of docs) { + // const ref = doc(randomCol, 'doc' + id++); + // await setDoc(ref, data); + // refs.push(ref); + // } + // return refs; + // } + + async function testCollectionWithDocs(docs: { + [id: string]: DocumentData; + }): Promise> { + for (const id in docs) { + if (docs.hasOwnProperty(id)) { + const ref = doc(randomCol, id); + await setDoc(ref, docs[id]); + } + } + return randomCol; + } + + function expectResults( + result: Array>, + ...docs: string[] + ): void; + function expectResults( + result: Array>, + ...data: DocumentData[] + ): void; + + function expectResults( + result: Array>, + ...data: DocumentData[] | string[] + ): void { + expect(result.length).to.equal(data.length); + + if (data.length > 0) { + if (typeof data[0] === 'string') { + const actualIds = result.map(result => result.ref?.id); + expect(actualIds).to.deep.equal(data); + } else { + result.forEach(r => { + expect(r.data()).to.deep.equal(data.shift()); + }); + } + } + } + + // async function compareQueryAndPipeline(query: Query): Promise { + // const queryResults = await getDocs(query); + // const pipeline = query.pipeline(); + // const pipelineResults = await pipeline.execute(); + // + // expect(queryResults.docs.map(s => s._fieldsProto)).to.deep.equal( + // pipelineResults.map(r => r._fieldsProto) + // ); + // return queryResults; + // } + + async function setupBookDocs(): Promise> { + const bookDocs: { [id: string]: DocumentData } = { + book1: { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + book2: { + title: 'Pride and Prejudice', + author: 'Jane Austen', + genre: 'Romance', + published: 1813, + rating: 4.5, + tags: ['classic', 'social commentary', 'love'], + awards: { none: true } + }, + book3: { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + genre: 'Magical Realism', + published: 1967, + rating: 4.3, + tags: ['family', 'history', 'fantasy'], + awards: { nobel: true, nebula: false } + }, + book4: { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false } + }, + book5: { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + genre: 'Dystopian', + published: 1985, + rating: 4.1, + tags: ['feminism', 'totalitarianism', 'resistance'], + awards: { 'arthur c. clarke': true, 'booker prize': false } + }, + book6: { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + genre: 'Psychological Thriller', + published: 1866, + rating: 4.3, + tags: ['philosophy', 'crime', 'redemption'], + awards: { none: true } + }, + book7: { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + genre: 'Southern Gothic', + published: 1960, + rating: 4.2, + tags: ['racism', 'injustice', 'coming-of-age'], + awards: { pulitzer: true } + }, + book8: { + title: '1984', + author: 'George Orwell', + genre: 'Dystopian', + published: 1949, + rating: 4.2, + tags: ['surveillance', 'totalitarianism', 'propaganda'], + awards: { prometheus: true } + }, + book9: { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + genre: 'Modernist', + published: 1925, + rating: 4.0, + tags: ['wealth', 'american dream', 'love'], + awards: { none: true } + }, + book10: { + title: 'Dune', + author: 'Frank Herbert', + genre: 'Science Fiction', + published: 1965, + rating: 4.6, + tags: ['politics', 'desert', 'ecology'], + awards: { hugo: true, nebula: true } + } + }; + return testCollectionWithDocs(bookDocs); + } + + let testDeferred: Deferred | undefined; + let withTestCollectionPromise: Promise | undefined; + + beforeEach(async () => { + const setupDeferred = new Deferred(); + withTestCollectionPromise = withTestCollection( + persistence, + {}, + async (collectionRef, firestoreInstance) => { + randomCol = collectionRef; + firestore = firestoreInstance; + await setupBookDocs(); + setupDeferred.resolve(); + + return testDeferred?.promise; + } + ); + + await setupDeferred; + }); + + afterEach(async () => { + testDeferred?.resolve(); + await withTestCollectionPromise; + }); + + it('empty results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .limit(0) + .execute(); + expect(result).to.be.empty; + }); + + it('returns aggregate results as expected', async () => { + let result = await firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countAll().as('count')) + .execute(); + expectResults(result, { count: 10 }); + + result = await randomCol + .pipeline() + .where(eq('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + avg('rating').as('avgRating'), + Field.of('rating').max().as('maxRating') + ) + .execute(); + expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + }); + + it('rejects groups without accumulators', async () => { + await expect( + randomCol + .pipeline() + .where(lt('published', 1900)) + .aggregate({ + accumulators: [], + groups: ['genre'] + }) + .execute() + ).to.be.rejected; + }); + + it('returns distinct values as expected', async () => { + const results = await randomCol + .pipeline() + .where(lt('published', 1900)) + .distinct(Field.of('genre').toLower().as('lowerGenre')) + .execute(); + expectResults( + results, + { lowerGenre: 'romance' }, + { lowerGenre: 'psychological thriller' } + ); + }); + + it('returns group and accumulate results', async () => { + const results = await randomCol + .pipeline() + .where(lt(Field.of('published'), 1984)) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .execute(); + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + + it('returns min and max accumulations', async () => { + const results = await randomCol + .pipeline() + .aggregate( + countAll().as('count'), + Field.of('rating').max().as('maxRating'), + Field.of('published').min().as('minPublished') + ) + .execute(); + expectResults(results, { + count: 10, + maxRating: 4.7, + minPublished: 1813 + }); + }); + + it('can select fields', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(Field.of('author').ascending()) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' + }, + { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, + { title: 'Dune', author: 'Frank Herbert' }, + { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez' + }, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, + { title: 'Pride and Prejudice', author: 'Jane Austen' }, + { title: "The Handmaid's Tale", author: 'Margaret Atwood' } + ); + }); + + it('where with and', async () => { + const results = await randomCol + .pipeline() + .where(andExpression(gt('rating', 4.5), eq('genre', 'Science Fiction'))) + .execute(); + expectResults(results, 'book10'); + }); + + it('where with or', async () => { + const results = await randomCol + .pipeline() + .where(orExpression(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) + .select('title') + .execute(); + expectResults( + results, + { title: 'Pride and Prejudice' }, + { title: "The Handmaid's Tale" }, + { title: '1984' } + ); + }); + + it('offset and limits', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .sort(Field.of('author').ascending()) + .offset(5) + .limit(3) + .select('title', 'author') + .execute(); + expectResults( + results, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); + }); + + it('arrayContains works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContains('tags', 'comedy')) + .select('title') + .execute(); + expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); + }); + + it('arrayContainsAny works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .select('title') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'Pride and Prejudice' } + ); + }); + + it('arrayContainsAll works', async () => { + const results = await randomCol + .pipeline() + .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) + .select('title') + .execute(); + expectResults(results, { title: 'The Lord of the Rings' }); + }); + + it('arrayLength works', async () => { + const results = await randomCol + .pipeline() + .select(Field.of('tags').arrayLength().as('tagsCount')) + .where(eq('tagsCount', 3)) + .execute(); + expect(results.length).to.equal(10); + }); + + it('arrayConcat works', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') + ) + .limit(1) + .execute(); + expectResults(results, { + modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] + }); + }); + + it('testStrConcat', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('author').strConcat(' - ', Field.of('title')).as('bookInfo') + ) + .limit(1) + .execute(); + expectResults(results, { + bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testStartsWith', async () => { + const results = await randomCol + .pipeline() + .where(startsWith('title', 'The')) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'The Great Gatsby' }, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Lord of the Rings' } + ); + }); + + it('testEndsWith', async () => { + const results = await randomCol + .pipeline() + .where(endsWith('title', 'y')) + .select('title') + .sort(Field.of('title').descending()) + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Great Gatsby' } + ); + }); + + it('testLength', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('title').charLength().as('titleLength'), + Field.of('title') + ) + .where(gt('titleLength', 20)) + .execute(); + expectResults( + results, + { titleLength: 32, title: "The Hitchhiker's Guide to the Galaxy" }, + { + titleLength: 27, + title: 'One Hundred Years of Solitude' + } + ); + }); + + it('testToLowercase', async () => { + const results = await randomCol + .pipeline() + .select(Field.of('title').toLower().as('lowercaseTitle')) + .limit(1) + .execute(); + expectResults(results, { + lowercaseTitle: "the hitchhiker's guide to the galaxy" + }); + }); + + it('testToUppercase', async () => { + const results = await randomCol + .pipeline() + .select(Field.of('author').toUpper().as('uppercaseAuthor')) + .limit(1) + .execute(); + expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + }); + + it('testTrim', async () => { + const results = await randomCol + .pipeline() + .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) + .select( + Field.of('spacedTitle').trim().as('trimmedTitle'), + Field.of('spacedTitle') + ) + .limit(1) + .execute(); + expectResults(results, { + spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testLike', async () => { + const results = await randomCol + .pipeline() + .where(like('title', '%Guide%')) + .select('title') + .execute(); + expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); + }); + + it('testRegexContains', async () => { + const results = await randomCol + .pipeline() + .where(regexContains('title', '(?i)(the|of)')) + .execute(); + expect(results.length).to.equal(5); + }); + + it('testRegexMatches', async () => { + const results = await randomCol + .pipeline() + .where(regexMatch('title', '.*(?i)(the|of).*')) + .execute(); + expect(results.length).to.equal(5); + }); + + it('testArithmeticOperations', async () => { + const results = await randomCol + .pipeline() + .select( + add(Field.of('rating'), 1).as('ratingPlusOne'), + subtract(Field.of('published'), 1900).as('yearsSince1900'), + Field.of('rating').multiply(10).as('ratingTimesTen'), + Field.of('rating').divide(2).as('ratingDividedByTwo') + ) + .limit(1) + .execute(); + expectResults(results, { + ratingPlusOne: 5.2, + yearsSince1900: 79, + ratingTimesTen: 42, + ratingDividedByTwo: 2.1 + }); + }); + + it('testComparisonOperators', async () => { + const results = await randomCol + .pipeline() + .where( + andExpression( + gt('rating', 4.2), + lte(Field.of('rating'), 4.5), + neq('genre', 'Science Fiction') + ) + ) + .select('rating', 'title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { rating: 4.3, title: 'Crime and Punishment' }, + { + rating: 4.3, + title: 'One Hundred Years of Solitude' + }, + { rating: 4.5, title: 'Pride and Prejudice' } + ); + }); + + it('testLogicalOperators', async () => { + const results = await randomCol + .pipeline() + .where( + orExpression( + andExpression(gt('rating', 4.5), eq('genre', 'Science Fiction')), + lt('published', 1900) + ) + ) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'Crime and Punishment' }, + { title: 'Dune' }, + { title: 'Pride and Prejudice' } + ); + }); + + it('testChecks', async () => { + const results = await randomCol + .pipeline() + .where(not(Field.of('rating').isNaN())) + .select( + Field.of('rating').eq(null).as('ratingIsNull'), + not(Field.of('rating').isNaN()).as('ratingIsNotNaN') + ) + .limit(1) + .execute(); + expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); + }); + + it('testMapGet', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('awards').mapGet('hugo').as('hugoAward'), + Field.of('awards').mapGet('others').as('others'), + Field.of('title') + ) + .where(eq('hugoAward', true)) + .execute(); + expectResults( + results, + { + hugoAward: true, + title: "The Hitchhiker's Guide to the Galaxy", + others: { unknown: { year: 1980 } } + }, + { hugoAward: true, title: 'Dune', others: null } + ); + }); + + // it('testParent', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // parent(randomCol.doc('chile').collection('subCollection').path).as( + // 'parent' + // ) + // ) + // .limit(1) + // .execute(); + // expect(results[0].data().parent.endsWith('/books')).to.be.true; + // }); + // + // it('testCollectionId', async () => { + // const results = await randomCol + // .pipeline() + // .select(collectionId(randomCol.doc('chile')).as('collectionId')) + // .limit(1) + // .execute(); + // expectResults(results, {collectionId: 'books'}); + // }); + + it('testDistanceFunctions', async () => { + const sourceVector = [0.1, 0.1]; + const targetVector = [0.5, 0.8]; + const results = await randomCol + .pipeline() + .select( + cosineDistance(Constant.vector(sourceVector), targetVector).as( + 'cosineDistance' + ), + dotProduct(Constant.vector(sourceVector), targetVector).as( + 'dotProductDistance' + ), + euclideanDistance(Constant.vector(sourceVector), targetVector).as( + 'euclideanDistance' + ) + ) + .limit(1) + .execute(); + + expectResults(results, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + }); + + it('testNestedFields', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select('title', 'awards.hugo') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy", 'awards.hugo': true }, + { title: 'Dune', 'awards.hugo': true } + ); + }); + + it('test mapGet with field name including . notation', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'nestedField.level.`1`': null, + nested: true + }, + { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + ); + }); + + // TODO(pipeline) support converter + // it('pipeline converter works', async () => { + // interface AppModel {myTitle: string; myAuthor: string; myPublished: number} + // const converter: FirestorePipelineConverter = { + // fromFirestore(result: FirebaseFirestore.PipelineResult): AppModel { + // return { + // myTitle: result.data()!.title as string, + // myAuthor: result.data()!.author as string, + // myPublished: result.data()!.published as number, + // }; + // }, + // }; + // + // const results = await firestore + // .pipeline() + // .collection(randomCol.path) + // .sort(Field.of('published').ascending()) + // .limit(2) + // .withConverter(converter) + // .execute(); + // + // const objs = results.map(r => r.data()); + // expect(objs[0]).to.deep.equal({ + // myAuthor: 'Jane Austen', + // myPublished: 1813, + // myTitle: 'Pride and Prejudice', + // }); + // expect(objs[1]).to.deep.equal({ + // myAuthor: 'Fyodor Dostoevsky', + // myPublished: 1866, + // myTitle: 'Crime and Punishment', + // }); + // }); +}); diff --git a/packages/firestore/test/unit/api/document_change.test.ts b/packages/firestore/test/unit/api/document_change.test.ts index faae8b4d4c8..8ce40f599b8 100644 --- a/packages/firestore/test/unit/api/document_change.test.ts +++ b/packages/firestore/test/unit/api/document_change.test.ts @@ -18,8 +18,8 @@ import { expect } from 'chai'; import { Query } from '../../../src/api/reference'; -import { ExpUserDataWriter } from '../../../src/api/reference_impl'; import { QuerySnapshot } from '../../../src/api/snapshot'; +import { ExpUserDataWriter } from '../../../src/api/user_data_writer'; import { Query as InternalQuery } from '../../../src/core/query'; import { View } from '../../../src/core/view'; import { documentKeySet } from '../../../src/model/collections'; diff --git a/packages/firestore/test/unit/remote/serializer.helper.ts b/packages/firestore/test/unit/remote/serializer.helper.ts index d523c8fab83..451f7ddf7ae 100644 --- a/packages/firestore/test/unit/remote/serializer.helper.ts +++ b/packages/firestore/test/unit/remote/serializer.helper.ts @@ -28,7 +28,7 @@ import { serverTimestamp, Timestamp } from '../../../src'; -import { ExpUserDataWriter } from '../../../src/api/reference_impl'; +import { ExpUserDataWriter } from '../../../src/api/user_data_writer'; import { DatabaseId } from '../../../src/core/database_info'; import { ArrayContainsAnyFilter, diff --git a/packages/firestore/test/unit/specs/spec_builder.ts b/packages/firestore/test/unit/specs/spec_builder.ts index d79cca9cd82..ce27b86f03b 100644 --- a/packages/firestore/test/unit/specs/spec_builder.ts +++ b/packages/firestore/test/unit/specs/spec_builder.ts @@ -16,7 +16,7 @@ */ import { IndexConfiguration } from '../../../src/api/index_configuration'; -import { ExpUserDataWriter } from '../../../src/api/reference_impl'; +import { ExpUserDataWriter } from '../../../src/api/user_data_writer'; import { ListenOptions, ListenerDataSource as Source diff --git a/packages/firestore/test/util/api_helpers.ts b/packages/firestore/test/util/api_helpers.ts index 762b5258a29..517167be323 100644 --- a/packages/firestore/test/util/api_helpers.ts +++ b/packages/firestore/test/util/api_helpers.ts @@ -32,7 +32,7 @@ import { EmptyAppCheckTokenProvider, EmptyAuthCredentialsProvider } from '../../src/api/credentials'; -import { ExpUserDataWriter } from '../../src/api/reference_impl'; +import { ExpUserDataWriter } from '../../src/api/user_data_writer'; import { DatabaseId } from '../../src/core/database_info'; import { newQueryForPath, Query as InternalQuery } from '../../src/core/query'; import { From 067639767010f8ed47aa51b04433af71bf9427ec Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:44:46 -0600 Subject: [PATCH 005/295] api-review folder updates --- common/api-review/firestore-lite.api.md | 1764 ++++++++++++++++++++++- common/api-review/firestore.api.md | 18 +- 2 files changed, 1742 insertions(+), 40 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 603e2349505..4117ff2d3ca 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -9,14 +9,54 @@ import { FirebaseApp } from '@firebase/app'; import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; +// @beta +export interface Accumulator { + // (undocumented) + accumulator: true; +} + +// @beta +export type AccumulatorTarget = ExprWithAlias; + +// @beta (undocumented) +export class Add extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function add(left: Constant, right: Constant): Add; + +// @beta +export function add(left: Constant, right: any): Add; + +// @beta +export function add(left: string, right: Constant): Add; + +// @beta +export function add(left: string, right: any): Add; + // @public export function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +// @beta (undocumented) +export class AddFields implements Stage { + constructor(fields: Map); + // (undocumented) + name: string; +} + // @public export type AddPrefixToKeys> = { [K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K]; }; +// @beta (undocumented) +export class Aggregate implements Stage { + constructor(accumulators: Map, groups: Map); + // (undocumented) + name: string; +} + // @public export class AggregateField { readonly aggregateType: AggregateType; @@ -53,18 +93,147 @@ export type AggregateSpecData = { // @public export type AggregateType = 'count' | 'avg' | 'sum'; +// @beta (undocumented) +export class And extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +// @beta +export function andExpression(left: FilterExpr, ...right: FilterExpr[]): And; + +// @beta (undocumented) +export class ArrayConcat extends FirestoreFunction { + constructor(array: Constant, elements: Constant[]); + } + +// @beta +export function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; + +// @beta +export function arrayConcat(array: Constant, elements: any[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: Constant[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: any[]): ArrayConcat; + +// @beta (undocumented) +export class ArrayContains extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, element: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function arrayContains(array: Constant, element: Constant): ArrayContains; + +// @beta +export function arrayContains(array: Constant, element: any): ArrayContains; + +// @beta +export function arrayContains(array: string, element: Constant): ArrayContains; + +// @beta +export function arrayContains(array: string, element: any): ArrayContains; + +// @beta (undocumented) +export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, values: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; + +// @beta (undocumented) +export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { + constructor(array: Constant, values: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; + +// @beta (undocumented) +export class ArrayElement extends FirestoreFunction { + constructor(); +} + +// @beta (undocumented) +export class ArrayLength extends FirestoreFunction { + constructor(array: Constant); + } + +// @beta +export function arrayLength(array: Constant): ArrayLength; + // @public export function arrayRemove(...elements: unknown[]): FieldValue; +// @beta (undocumented) +export class ArrayReverse extends FirestoreFunction { + constructor(array: Constant); + } + // @public export function arrayUnion(...elements: unknown[]): FieldValue; +// @beta +export function ascending(expr: Constant): Ordering; + // @public export function average(field: string | FieldPath): AggregateField; +// @beta (undocumented) +export class Avg extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function avg(value: Constant): Avg; + +// @beta +export function avg(value: string): Avg; + +// @beta (undocumented) +export class ByteLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function byteLength(expr: Constant): ByteLength; + +// @beta +export function byteLength(field: string): ByteLength; + // @public export class Bytes { static fromBase64String(base64: string): Bytes; @@ -75,6 +244,17 @@ export class Bytes { toUint8Array(): Uint8Array; } +// @beta (undocumented) +export class CharLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function charLength(field: string): CharLength; + +// @beta +export function charLength(expr: Constant): CharLength; + // @public export type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; @@ -90,6 +270,13 @@ export function collection(refer // @public export function collectionGroup(firestore: Firestore, collectionId: string): Query; +// @beta (undocumented) +export class CollectionGroupSource implements Stage { + constructor(collectionId: string); + // (undocumented) + name: string; +} + // @public export class CollectionReference extends Query { get id(): string; @@ -100,20 +287,216 @@ export class CollectionReference; } +// @beta (undocumented) +export class CollectionSource implements Stage { + constructor(collectionPath: string); + // (undocumented) + name: string; +} + // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { mockUserToken?: EmulatorMockTokenOptions | string; }): void; +// @beta +export class Constant { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + static of(value: number): Constant; + static of(value: string): Constant; + static of(value: boolean): Constant; + static of(value: null): Constant; + static of(value: undefined): Constant; + static of(value: GeoPoint): Constant; + static of(value: Timestamp): Constant; + static of(value: Date): Constant; + static of(value: Uint8Array): Constant; + static of(value: DocumentReference): Constant; + static of(value: any[]): Constant; + static of(value: Map): Constant; + static of(value: VectorValue): Constant; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + static vector(value: number[] | VectorValue): Constant; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class CosineDistance extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function cosineDistance(expr: string, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: Constant): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: Constant, other: Constant): CosineDistance; + +// @beta (undocumented) +export class Count extends FirestoreFunction implements Accumulator { + constructor(value: Constant | undefined, distinct: boolean); + // (undocumented) + accumulator: true; + } + // @public export function count(): AggregateField; +// @beta +export function countAll(): Count; + +// @beta +export function countExpression(value: Constant): Count; + +// Warning: (ae-incompatible-release-tags) The symbol "countExpression" is marked as @public, but its signature references "Count" which is marked as @beta +// +// @public +export function countExpression(value: string): Count; + +// @beta (undocumented) +export class DatabaseSource implements Stage { + // (undocumented) + name: string; +} + // @public export function deleteDoc(reference: DocumentReference): Promise; // @public export function deleteField(): FieldValue; +// @beta +export function descending(expr: Constant): Ordering; + +// @beta (undocumented) +export class Distinct implements Stage { + constructor(groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Divide extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function divide(left: Constant, right: Constant): Divide; + +// @beta +export function divide(left: Constant, right: any): Divide; + +// @beta +export function divide(left: string, right: Constant): Divide; + +// @beta +export function divide(left: string, right: any): Divide; + // @public export function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; @@ -153,6 +536,38 @@ export class DocumentSnapshot; } +// @beta (undocumented) +export class DocumentsSource implements Stage { + constructor(docPaths: string[]); + // (undocumented) + name: string; + // (undocumented) + static of(refs: DocumentReference[]): DocumentsSource; +} + +// @beta (undocumented) +export class DotProduct extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function dotProduct(expr: string, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: string, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: string, other: Constant): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: Constant, other: Constant): DotProduct; + export { EmulatorMockTokenOptions } // @public @@ -167,20 +582,457 @@ export function endBefore(snapsh // @public export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +// @beta (undocumented) +export class EndsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, suffix: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function endsWith(expr: string, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: string, suffix: Constant): EndsWith; + +// @beta +export function endsWith(expr: Constant, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: Constant, suffix: Constant): EndsWith; + +// @beta (undocumented) +export class Eq extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function eq(left: Constant, right: Constant): Eq; + +// @beta +export function eq(left: Constant, right: any): Eq; + +// @beta +export function eq(left: string, right: Constant): Eq; + +// @beta +export function eq(left: string, right: any): Eq; + +// @beta (undocumented) +export class EuclideanDistance extends FirestoreFunction { + constructor(vector1: Constant, vector2: Constant); + } + +// @beta +export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: Constant): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; + +// @beta (undocumented) +export class Exists extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function exists(value: Constant): Exists; + +// @beta +export function exists(field: string): Exists; + +// @beta +export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; + +// @beta (undocumented) +export class ExprWithAlias implements Selectable { + constructor(expr: T, alias: string); + add(other: Constant): Add; + add(other: any): Add; + // (undocumented) + alias: string; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + expr: T; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export class Field implements Selectable { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldName(): string; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + static of(name: string): Field; + // (undocumented) + static of(path: FieldPath): Field; + // (undocumented) + static of(pipeline: Pipeline, name: string): Field; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + // @public export class FieldPath { constructor(...fieldNames: string[]); isEqual(other: FieldPath): boolean; } +// @beta (undocumented) +export class Fields implements Selectable { + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldList(): Field[]; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + // (undocumented) + static of(name: string, ...others: string[]): Fields; + // (undocumented) + static ofAll(): Fields; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + // @public export abstract class FieldValue { abstract isEqual(other: FieldValue): boolean; } +// @beta +export interface FilterCondition { + // (undocumented) + filterable: true; +} + +// @beta +export type FilterExpr = Constant & FilterCondition; + +// @beta (undocumented) +export class FindNearest implements Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export interface FindNearestOptions { + // (undocumented) + distanceField?: string; + // (undocumented) + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + // (undocumented) + field: Field; + // (undocumented) + limit?: number; + // (undocumented) + vectorValue: VectorValue | number[]; +} + // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + // + // (undocumented) + pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -199,69 +1051,488 @@ export class FirestoreError extends FirebaseError { readonly stack?: string; } -// @public -export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; +// @public +export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; + +// @beta +export class FirestoreFunction { + constructor(name: string, params: Constant[]); + add(other: Constant): Add; + add(other: any): Add; + arrayConcat(arrays: Constant[]): ArrayConcat; + arrayConcat(arrays: any[]): ArrayConcat; + arrayContains(element: Constant): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Constant): Divide; + divide(other: any): Divide; + dotProduct(other: Constant): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Constant): EndsWith; + eq(other: Constant): Eq; + eq(other: any): Eq; + euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Constant): Gt; + gt(other: any): Gt; + gte(other: Constant): Gte; + gte(other: any): Gte; + in(...others: Constant[]): In; + // (undocumented) + in(...others: any[]): In; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Constant): Like; + logicalMax(other: Constant): LogicalMax; + logicalMax(other: any): LogicalMax; + logicalMin(other: Constant): LogicalMin; + logicalMin(other: any): LogicalMin; + lt(other: Constant): Lt; + lt(other: any): Lt; + lte(other: Constant): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + max(): Max; + min(): Min; + mod(other: Constant): Mod; + mod(other: any): Mod; + multiply(other: Constant): Multiply; + multiply(other: any): Multiply; + neq(other: Constant): Neq; + neq(other: any): Neq; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Constant): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Constant): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Constant): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Constant): StrContains; + subtract(other: Constant): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export function genericFunction(name: string, params: Constant[]): FirestoreFunction; + +// @beta (undocumented) +export class GenericStage implements Stage { + constructor(name: string, params: unknown[]); + // (undocumented) + name: string; +} + +// @public +export class GeoPoint { + constructor(latitude: number, longitude: number); + isEqual(other: GeoPoint): boolean; + get latitude(): number; + get longitude(): number; + toJSON(): { + latitude: number; + longitude: number; + }; +} + +// @public +export function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; + +// @public +export function getCount(query: Query): Promise; +}, AppModelType, DbModelType>>; + +// @public +export function getDoc(reference: DocumentReference): Promise>; + +// @public +export function getDocs(query: Query): Promise>; + +// @public +export function getFirestore(): Firestore; + +// @public +export function getFirestore(app: FirebaseApp): Firestore; + +// @beta +export function getFirestore(databaseId: string): Firestore; + +// @beta +export function getFirestore(app: FirebaseApp, databaseId: string): Firestore; + +// @beta (undocumented) +export class Gt extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function gt(left: Constant, right: Constant): Gt; + +// @beta +export function gt(left: Constant, right: any): Gt; + +// @beta +export function gt(left: string, right: Constant): Gt; + +// @beta +export function gt(left: string, right: any): Gt; + +// @beta (undocumented) +export class Gte extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function gte(left: Constant, right: Constant): Gte; + +// @beta +export function gte(left: Constant, right: any): Gte; + +// @beta +export function gte(left: string, right: Constant): Gte; + +// @beta +export function gte(left: string, right: any): Gte; + +// @beta (undocumented) +export class If extends FirestoreFunction implements FilterCondition { + constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; + +// @beta (undocumented) +export class In extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, others: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function inAny(element: Constant, others: Constant[]): In; + +// @beta +export function inAny(element: Constant, others: any[]): In; + +// @beta +export function inAny(element: string, others: Constant[]): In; + +// @beta +export function inAny(element: string, others: any[]): In; + +// @public +export function increment(n: number): FieldValue; + +// @public +export function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; + +// @beta +export function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; + +// @beta (undocumented) +export class IsNan extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function isNan(value: Constant): IsNan; + +// @beta +export function isNan(value: string): IsNan; + +// @beta (undocumented) +export class Like extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function like(left: string, pattern: string): Like; + +// @beta +export function like(left: string, pattern: Constant): Like; + +// @beta +export function like(left: Constant, pattern: string): Like; + +// @beta +export function like(left: Constant, pattern: Constant): Like; + +// @beta (undocumented) +export class Limit implements Stage { + constructor(limit: number); + // (undocumented) + name: string; +} + +// @public +export function limit(limit: number): QueryLimitConstraint; + +// @public +export function limitToLast(limit: number): QueryLimitConstraint; + +// @beta (undocumented) +export class LogicalMax extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function logicalMax(left: Constant, right: Constant): LogicalMax; + +// @beta +export function logicalMax(left: Constant, right: any): LogicalMax; + +// @beta +export function logicalMax(left: string, right: Constant): LogicalMax; + +// @beta +export function logicalMax(left: string, right: any): LogicalMax; + +// @beta (undocumented) +export class LogicalMin extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function logicalMin(left: Constant, right: Constant): LogicalMin; + +// @beta +export function logicalMin(left: Constant, right: any): LogicalMin; + +// @beta +export function logicalMin(left: string, right: Constant): LogicalMin; + +// @beta +export function logicalMin(left: string, right: any): LogicalMin; + +export { LogLevel } + +// @beta (undocumented) +export class Lt extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function lt(left: Constant, right: Constant): Lt; + +// @beta +export function lt(left: Constant, right: any): Lt; + +// @beta +export function lt(left: string, right: Constant): Lt; + +// @beta +export function lt(left: string, right: any): Lt; + +// @beta (undocumented) +export class Lte extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function lte(left: Constant, right: Constant): Lte; + +// @beta +export function lte(left: Constant, right: any): Lte; + +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta +// +// @public +export function lte(left: string, right: Constant): Lte; + +// @beta +export function lte(left: string, right: any): Lte; + +// @beta (undocumented) +export class MapGet extends FirestoreFunction { + constructor(map: Constant, name: string); +} + +// @beta +export function mapGet(mapField: string, subField: string): MapGet; + +// @beta +export function mapGet(mapExpr: Constant, subField: string): MapGet; + +// @beta (undocumented) +export class Max extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function max(value: Constant): Max; + +// @beta +export function max(value: string): Max; + +// @beta (undocumented) +export class Min extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function min(value: Constant): Min; + +// @beta +export function min(value: string): Min; -// @public -export class GeoPoint { - constructor(latitude: number, longitude: number); - isEqual(other: GeoPoint): boolean; - get latitude(): number; - get longitude(): number; - toJSON(): { - latitude: number; - longitude: number; - }; -} +// @beta (undocumented) +export class Mod extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } -// @public -export function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; +// @beta +export function mod(left: Constant, right: Constant): Mod; -// @public -export function getCount(query: Query): Promise; -}, AppModelType, DbModelType>>; +// @beta +export function mod(left: Constant, right: any): Mod; -// @public -export function getDoc(reference: DocumentReference): Promise>; +// @beta +export function mod(left: string, right: Constant): Mod; -// @public -export function getDocs(query: Query): Promise>; +// @beta +export function mod(left: string, right: any): Mod; -// @public -export function getFirestore(): Firestore; +// @beta (undocumented) +export class Multiply extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } -// @public -export function getFirestore(app: FirebaseApp): Firestore; +// @beta +export function multiply(left: Constant, right: Constant): Multiply; // @beta -export function getFirestore(databaseId: string): Firestore; +export function multiply(left: Constant, right: any): Multiply; // @beta -export function getFirestore(app: FirebaseApp, databaseId: string): Firestore; +export function multiply(left: string, right: Constant): Multiply; -// @public -export function increment(n: number): FieldValue; +// @beta +export function multiply(left: string, right: any): Multiply; -// @public -export function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; +// @beta (undocumented) +export class Neq extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, right: Constant); + // (undocumented) + filterable: true; + } // @beta -export function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; +export function neq(left: Constant, right: Constant): Neq; -// @public -export function limit(limit: number): QueryLimitConstraint; +// @beta +export function neq(left: Constant, right: any): Neq; -// @public -export function limitToLast(limit: number): QueryLimitConstraint; +// @beta +export function neq(left: string, right: Constant): Neq; -export { LogLevel } +// @beta +export function neq(left: string, right: any): Neq; // @public export type NestedUpdateFields> = UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields; }[keyof T & string]>; +// @beta (undocumented) +export class Not extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant); + // (undocumented) + filterable: true; +} + +// @beta +export function not(filter: FilterExpr): Not; + +// @beta +export function notInAny(element: Constant, others: Constant[]): Not; + +// @beta +export function notInAny(element: Constant, others: any[]): Not; + +// @beta +export function notInAny(element: string, others: Constant[]): Not; + +// @beta +export function notInAny(element: string, others: any[]): Not; + +// @beta (undocumented) +export class Offset implements Stage { + constructor(offset: number); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export class Or extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; @@ -271,11 +1542,79 @@ export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDir // @public export type OrderByDirection = 'desc' | 'asc'; +// @beta +export class Ordering { + constructor(expr: Constant, direction: 'ascending' | 'descending'); + } + +// @beta +export function orExpression(left: FilterExpr, ...right: FilterExpr[]): Or; + // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; } : never); +// @public +export class Pipeline { + // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta + addFields(...fields: Selectable[]): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate(options: { + accumulators: AccumulatorTarget[]; + groups?: Array; + }): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta + distinct(...groups: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + execute(): Promise>>; + // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta + // + // (undocumented) + findNearest(options: FindNearestOptions): Pipeline; + genericStage(name: string, params: any[]): Pipeline; + limit(limit: number): Pipeline; + offset(offset: number): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta + select(...selections: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta + sort(...orderings: Ordering[]): Pipeline; + // (undocumented) + sort(options: { + orderings: Ordering[]; + }): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta + where(condition: FilterCondition & Constant): Pipeline; +} + +// @beta +export class PipelineResult { + /* Excluded from this release type: _ref */ + /* Excluded from this release type: _fields */ + /* Excluded from this release type: __constructor */ + get createTime(): Timestamp | undefined; + data(): AppModelType | undefined; + get executionTime(): Timestamp; + get(fieldPath: string | FieldPath): any; + get id(): string | undefined; + get ref(): DocumentReference | undefined; + get updateTime(): Timestamp | undefined; +} + +// @beta +export class PipelineSource { + // (undocumented) + collection(collectionPath: string): Pipeline; + // (undocumented) + collectionGroup(collectionId: string): Pipeline; + // (undocumented) + database(): Pipeline; + // (undocumented) + documents(docs: DocumentReference[]): Pipeline; + } + // @public export type Primitive = string | number | boolean | undefined | null; @@ -360,9 +1699,102 @@ export class QueryStartAtConstraint extends QueryConstraint { // @public export function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +// @beta (undocumented) +export class RegexContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function regexContains(left: string, pattern: string): RegexContains; + +// @beta +export function regexContains(left: string, pattern: Constant): RegexContains; + +// @beta +export function regexContains(left: Constant, pattern: string): RegexContains; + +// @beta +export function regexContains(left: Constant, pattern: Constant): RegexContains; + +// @beta (undocumented) +export class RegexMatch extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, pattern: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function regexMatch(left: string, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: string, pattern: Constant): RegexMatch; + +// @beta +export function regexMatch(left: Constant, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: Constant, pattern: Constant): RegexMatch; + +// @beta (undocumented) +export class ReplaceAll extends FirestoreFunction { + constructor(value: Constant, find: Constant, replace: Constant); + } + +// @beta +export function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; + +// @beta +export function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; + +// @beta +export function replaceAll(field: string, find: string, replace: string): ReplaceAll; + +// @beta (undocumented) +export class ReplaceFirst extends FirestoreFunction { + constructor(value: Constant, find: Constant, replace: Constant); + } + +// @beta +export function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; + +// @beta +export function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; + +// @beta +export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; + +// @beta (undocumented) +export class Reverse extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function reverse(expr: Constant): Reverse; + +// @beta +export function reverse(field: string): Reverse; + // @public export function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +// @beta (undocumented) +export class Select implements Stage { + constructor(projections: Map); + // (undocumented) + name: string; + } + +// @beta +export interface Selectable { + // (undocumented) + selectable: true; +} + +// @beta +export type SelectableExpr = Constant & Selectable; + // @public export function serverTimestamp(): FieldValue; @@ -392,6 +1824,19 @@ export interface Settings { // @public export function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; +// @beta (undocumented) +export class Sort implements Stage { + constructor(orders: Ordering[]); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export interface Stage { + // (undocumented) + name: string; +} + // @public export function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; @@ -404,9 +1849,88 @@ export function startAt(snapshot // @public export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +// @beta (undocumented) +export class StartsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, prefix: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function startsWith(expr: string, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: string, prefix: Constant): StartsWith; + +// @beta +export function startsWith(expr: Constant, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: Constant, prefix: Constant): StartsWith; + +// @beta (undocumented) +export class StrConcat extends FirestoreFunction { + constructor(first: Constant, rest: Constant[]); + } + +// @beta +export function strConcat(first: string, ...elements: Array): StrConcat; + +// @beta +export function strConcat(first: Constant, ...elements: Array): StrConcat; + +// @beta (undocumented) +export class StrContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Constant, substring: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function strContains(left: string, substring: string): StrContains; + +// @beta +export function strContains(left: string, substring: Constant): StrContains; + +// @beta +export function strContains(left: Constant, substring: string): StrContains; + +// @beta +export function strContains(left: Constant, substring: Constant): StrContains; + +// @beta (undocumented) +export class Subtract extends FirestoreFunction { + constructor(left: Constant, right: Constant); + } + +// @beta +export function subtract(left: Constant, right: Constant): Subtract; + +// @beta +export function subtract(left: Constant, right: any): Subtract; + +// @beta +export function subtract(left: string, right: Constant): Subtract; + +// @beta +export function subtract(left: string, right: any): Subtract; + +// @beta (undocumented) +export class Sum extends FirestoreFunction implements Accumulator { + constructor(value: Constant, distinct: boolean); + // (undocumented) + accumulator: true; + } + // @public export function sum(field: string | FieldPath): AggregateField; +// @beta +export function sumExpression(value: Constant): Sum; + +// @beta +export function sumExpression(value: string): Sum; + // @public export function terminate(firestore: Firestore): Promise; @@ -431,6 +1955,89 @@ export class Timestamp { valueOf(): string; } +// @beta (undocumented) +export class TimestampAdd extends FirestoreFunction { + constructor(timestamp: Constant, unit: Constant, amount: Constant); + } + +// @beta +export function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; + +// @beta +export function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta +export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta (undocumented) +export class TimestampSub extends FirestoreFunction { + constructor(timestamp: Constant, unit: Constant, amount: Constant); + } + +// @beta +export function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; + +// @beta +export function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta +export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta (undocumented) +export class TimestampToUnixMicros extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; + +// @beta +export function timestampToUnixMicros(field: string): TimestampToUnixMicros; + +// @beta (undocumented) +export class TimestampToUnixMillis extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; + +// @beta +export function timestampToUnixMillis(field: string): TimestampToUnixMillis; + +// @beta (undocumented) +export class TimestampToUnixSeconds extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; + +// @beta +export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; + +// @beta (undocumented) +export class ToLower extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function toLower(expr: string): ToLower; + +// @beta +export function toLower(expr: Constant): ToLower; + +// @beta (undocumented) +export class ToUpper extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function toUpper(expr: string): ToUpper; + +// @beta +export function toUpper(expr: Constant): ToUpper; + // @public export class Transaction { delete(documentRef: DocumentReference): this; @@ -446,9 +2053,53 @@ export interface TransactionOptions { readonly maxAttempts?: number; } +// @beta (undocumented) +export class Trim extends FirestoreFunction { + constructor(expr: Constant); + } + +// @beta +export function trim(expr: string): Trim; + +// @beta +export function trim(expr: Constant): Trim; + // @public export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +// @beta (undocumented) +export class UnixMicrosToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; + +// @beta +export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; + +// @beta (undocumented) +export class UnixMillisToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; + +// @beta +export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; + +// @beta (undocumented) +export class UnixSecondsToTimestamp extends FirestoreFunction { + constructor(input: Constant); + } + +// @beta +export function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; + +// @beta +export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; + // @public export type UpdateData = T extends Primitive ? T : T extends {} ? { [K in keyof T]?: UpdateData | FieldValue; @@ -463,6 +2114,17 @@ export function updateDoc(refere // @public export function vector(values?: number[]): VectorValue; +// @beta (undocumented) +export class VectorLength extends FirestoreFunction { + constructor(value: Constant); + } + +// @beta +export function vectorLength(expr: Constant): VectorLength; + +// @beta +export function vectorLength(field: string): VectorLength; + // @public export class VectorValue { /* Excluded from this release type: __constructor */ @@ -470,6 +2132,13 @@ export class VectorValue { toArray(): number[]; } +// @beta (undocumented) +export class Where implements Stage { + constructor(condition: FilterCondition & Constant); + // (undocumented) + name: string; +} + // @public export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; @@ -494,4 +2163,21 @@ export class WriteBatch { // @public export function writeBatch(firestore: Firestore): WriteBatch; +// @beta (undocumented) +export class Xor extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterExpr[]); + // (undocumented) + filterable: true; +} + +// @beta +export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; + + +// Warnings were encountered during analysis: +// +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta + ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 0eba34b259a..f8f76b050c9 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1813,27 +1813,37 @@ export interface PersistentSingleTabManagerSettings { // @public export type PersistentTabManager = PersistentSingleTabManager | PersistentMultipleTabManager; -// @beta +// @public export class Pipeline { + // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta aggregate(...accumulators: AccumulatorTarget[]): Pipeline; aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(...groups: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta execute(): Promise>>; + // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta + // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; genericStage(name: string, params: any[]): Pipeline; limit(limit: number): Pipeline; offset(offset: number): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(...selections: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(...orderings: Ordering[]): Pipeline; // (undocumented) sort(options: { orderings: Ordering[]; }): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta where(condition: FilterCondition & Constant): Pipeline; } @@ -2452,4 +2462,10 @@ export class Xor extends FirestoreFunction implements FilterCondition { export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; +// Warnings were encountered during analysis: +// +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta + ``` From 2cd396a85c09ffe4ef50c3d5254ae5fe9ebe7623 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:45:08 -0600 Subject: [PATCH 006/295] Adding missing protobufjs-cli --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 7c65287bb20..aaf4eaa8bc8 100644 --- a/package.json +++ b/package.json @@ -142,6 +142,7 @@ "postinstall-postinstall": "2.1.0", "prettier": "2.8.7", "protractor": "5.4.2", + "protobufjs-cli": "^1.1.3", "request": "2.88.2", "semver": "7.5.3", "simple-git": "3.24.0", From 0c76ca0712a0488bf8cf16937439f84b368b849e Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Wed, 16 Oct 2024 19:41:55 +0000 Subject: [PATCH 007/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 4117ff2d3ca..97cf9d7189c 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index f8f76b050c9..c746620442d 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From 5e9774bd48dfb717df7ed0c1a5714793a17340a8 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:11:22 -0600 Subject: [PATCH 008/295] fixes --- packages/firestore/src/lite-api/pipeline.ts | 4 +--- packages/firestore/src/protos/firestore_proto_api.ts | 2 ++ packages/firestore/src/remote/datastore.ts | 2 +- packages/firestore/test/integration/api/pipeline.test.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index d6a6c21bb90..9015182bc5d 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -18,7 +18,7 @@ import { DocumentKey } from '../model/document_key'; import { ObjectValue } from '../model/object_value'; import { ExecutePipelineRequest, - firestoreV1ApiClientInterfaces, + StructuredPipeline, Stage as ProtoStage } from '../protos/firestore_proto_api'; import { invokeExecutePipeline } from '../remote/datastore'; @@ -63,8 +63,6 @@ import { } from './user_data_reader'; import { AbstractUserDataWriter } from './user_data_writer'; -import StructuredPipeline = firestoreV1ApiClientInterfaces.StructuredPipeline; - interface ReadableUserData { _readUserData(dataReader: UserDataReader): void; } diff --git a/packages/firestore/src/protos/firestore_proto_api.ts b/packages/firestore/src/protos/firestore_proto_api.ts index 250cfb5ef88..cc1c57259f5 100644 --- a/packages/firestore/src/protos/firestore_proto_api.ts +++ b/packages/firestore/src/protos/firestore_proto_api.ts @@ -572,6 +572,8 @@ export declare type Stage = firestoreV1ApiClientInterfaces.Stage; export declare type Status = firestoreV1ApiClientInterfaces.Status; export declare type StructuredQuery = firestoreV1ApiClientInterfaces.StructuredQuery; +export declare type StructuredPipeline = + firestoreV1ApiClientInterfaces.StructuredPipeline; export declare type Target = firestoreV1ApiClientInterfaces.Target; export declare type TargetChange = firestoreV1ApiClientInterfaces.TargetChange; export declare type TransactionOptions = diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index bca88583d1a..00c1e7fca9e 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -252,7 +252,7 @@ export async function invokeExecutePipeline( >( 'ExecutePipeline', datastoreImpl.serializer.databaseId, - toResourcePath(datastoreImpl.serializer.databaseId), + ResourcePath.emptyPath(), executePipelineRequest ); diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index aba38bab427..03950690e77 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -55,7 +55,7 @@ import { apiDescribe, withTestCollection } from '../util/helpers'; use(chaiAsPromised); -apiDescribe('Queries', persistence => { +apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; let randomCol: CollectionReference; From 2f3d48a03fec39887067fd0c01cfe8cf9c074924 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:31:34 -0600 Subject: [PATCH 009/295] yarn.lock --- yarn.lock | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 188 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 92372aa94a3..613906694cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -430,6 +430,11 @@ resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== +"@babel/helper-string-parser@^7.25.7": + version "7.25.7" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz#d50e8d37b1176207b4fe9acedec386c565a44a54" + integrity sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g== + "@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" @@ -450,6 +455,11 @@ resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== +"@babel/helper-validator-identifier@^7.25.7": + version "7.25.7" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz#77b7f60c40b15c97df735b38a66ba1d7c3e93da5" + integrity sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg== + "@babel/helper-validator-option@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz" @@ -525,6 +535,13 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz" integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== +"@babel/parser@^7.20.15": + version "7.25.8" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz#f6aaf38e80c36129460c1657c0762db584c9d5e2" + integrity sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ== + dependencies: + "@babel/types" "^7.25.8" + "@babel/parser@^7.24.0", "@babel/parser@^7.24.1": version "7.24.1" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" @@ -1364,6 +1381,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.25.8": + version "7.25.8" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz#5cf6037258e8a9bcad533f4979025140cb9993e1" + integrity sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg== + dependencies: + "@babel/helper-string-parser" "^7.25.7" + "@babel/helper-validator-identifier" "^7.25.7" + to-fast-properties "^2.0.0" + "@changesets/apply-release-plan@^6.1.4": version "6.1.4" resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz" @@ -1928,6 +1954,13 @@ resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== +"@jsdoc/salty@^0.2.1": + version "0.2.8" + resolved "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.8.tgz#8d29923a9429694a437a50ab75004b576131d597" + integrity sha512-5e+SFVavj1ORKlKaKr2BmTOekmXbelU7dC0cDkQLqag7xfuTPuGMUFx7KWJuv4bYZrTsoL2Z18VVCOKYxzoHcg== + dependencies: + lodash "^4.17.21" + "@kwsites/file-exists@^1.1.1": version "1.1.1" resolved "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz" @@ -3435,6 +3468,11 @@ dependencies: "@types/node" "*" +"@types/linkify-it@^5": + version "5.0.0" + resolved "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz#21413001973106cda1c3a9b91eedd4ccd5469d76" + integrity sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q== + "@types/listr@0.14.9": version "0.14.9" resolved "https://registry.npmjs.org/@types/listr/-/listr-0.14.9.tgz#736581cfdfcdb821bace0a3e5b05e91182e00c85" @@ -3448,6 +3486,19 @@ resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/markdown-it@^14.1.1": + version "14.1.2" + resolved "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz#57f2532a0800067d9b934f3521429a2e8bfb4c61" + integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== + dependencies: + "@types/linkify-it" "^5" + "@types/mdurl" "^2" + +"@types/mdurl@^2": + version "2.0.0" + resolved "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" + integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== + "@types/mime@*": version "3.0.1" resolved "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz" @@ -5057,9 +5108,9 @@ blocking-proxy@^1.0.0: dependencies: minimist "^1.2.0" -bluebird@3.7.2: +bluebird@3.7.2, bluebird@^3.7.2: version "3.7.2" - resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: @@ -5542,6 +5593,13 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" + chai-as-promised@7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz" @@ -7260,6 +7318,11 @@ ent@~2.2.0: resolved "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz" integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" @@ -7545,7 +7608,7 @@ escape-string-regexp@^2.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@^1.8.1: +escodegen@^1.13.0, escodegen@^1.8.1: version "1.14.3" resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== @@ -7684,7 +7747,7 @@ esniff@^2.0.1: event-emitter "^0.3.5" type "^2.7.2" -espree@^9.6.0, espree@^9.6.1: +espree@^9.0.0, espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== @@ -9056,7 +9119,7 @@ glob@7.2.3, glob@~7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.0.1: +glob@^8.0.0, glob@^8.0.1: version "8.1.0" resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -9277,7 +9340,7 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== -graceful-fs@^4.2.10, graceful-fs@^4.2.9: +graceful-fs@^4.1.9, graceful-fs@^4.2.10, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -11074,11 +11137,39 @@ js-yaml@~3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js2xmlparser@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdoc@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz#bfee86c6a82f6823e12b5e8be698fd99ae46c061" + integrity sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw== + dependencies: + "@babel/parser" "^7.20.15" + "@jsdoc/salty" "^0.2.1" + "@types/markdown-it" "^14.1.1" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^14.1.0" + markdown-it-anchor "^8.6.7" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + underscore "~1.13.2" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz" @@ -11491,6 +11582,13 @@ klaw-sync@^6.0.0: dependencies: graceful-fs "^4.1.11" +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== + dependencies: + graceful-fs "^4.1.9" + kleur@^4.1.4: version "4.1.5" resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz" @@ -11649,6 +11747,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz" @@ -12193,6 +12298,23 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +markdown-it-anchor@^8.6.7: + version "8.6.7" + resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" + integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA== + +markdown-it@^14.1.0: + version "14.1.0" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== + dependencies: + argparse "^2.0.1" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + marked-terminal@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.1.1.tgz" @@ -12210,6 +12332,11 @@ marked@^0.8.0: resolved "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz" integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw== +marked@^4.0.10: + version "4.3.0" + resolved "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== + marked@^4.0.14: version "4.0.18" resolved "https://registry.npmjs.org/marked/-/marked-4.0.18.tgz" @@ -12234,6 +12361,11 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" @@ -14285,6 +14417,22 @@ proto3-json-serializer@^1.0.0: dependencies: protobufjs "^6.11.3" +protobufjs-cli@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.3.tgz#c58b8566784f0fa1aff11e8d875a31de999637fe" + integrity sha512-MqD10lqF+FMsOayFiNOdOGNlXc4iKDCf0ZQPkPR+gizYh9gqUeGTWulABUCdI+N67w5RfJ6xhgX4J8pa8qmMXQ== + dependencies: + chalk "^4.0.0" + escodegen "^1.13.0" + espree "^9.0.0" + estraverse "^5.1.0" + glob "^8.0.0" + jsdoc "^4.0.0" + minimist "^1.2.0" + semver "^7.1.2" + tmp "^0.2.1" + uglify-js "^3.7.7" + protobufjs@6.11.3: version "6.11.3" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" @@ -14446,6 +14594,11 @@ pumpify@^1.3.5: inherits "^2.0.3" pump "^2.0.0" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz" @@ -15079,6 +15232,13 @@ requires-port@^1.0.0: resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= +requizzle@^0.2.3: + version "0.2.4" + resolved "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== + dependencies: + lodash "^4.17.21" + resolve-alpn@^1.0.0: version "1.2.1" resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz" @@ -15574,7 +15734,7 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semve dependencies: lru-cache "^6.0.0" -semver@^7.5.4, semver@^7.6.0: +semver@^7.1.2, semver@^7.5.4, semver@^7.6.0: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -16502,7 +16662,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@3.1.1, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -17324,11 +17484,21 @@ ua-parser-js@^0.7.30: resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz#e464e66dac2d33a7a1251d7d7a99d6157ec27832" integrity sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + uglify-js@^3.1.4, uglify-js@^3.4.9: version "3.14.2" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz" integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== +uglify-js@^3.7.7: + version "3.19.3" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" + integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== + uid-number@0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" @@ -17369,6 +17539,11 @@ underscore@>=1.8.3, underscore@^1.9.1: resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz" integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== +underscore@~1.13.2: + version "1.13.7" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10" + integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g== + undertaker-registry@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz" @@ -18315,6 +18490,11 @@ xmlbuilder@~11.0.0: resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== + xregexp@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" From 076236e2e5df862b8d137b3035df3fb8443eb7ca Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:08:07 -0600 Subject: [PATCH 010/295] Fixes. Passing integration tests. --- common/api-review/firestore-lite.api.md | 6 +- common/api-review/firestore.api.md | 6 +- packages/firestore/src/lite-api/pipeline.ts | 36 ++++---- packages/firestore/src/lite-api/reference.ts | 90 ++++--------------- .../test/integration/api/pipeline.test.ts | 49 ++++++++-- 5 files changed, 82 insertions(+), 105 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 97cf9d7189c..4117ff2d3ca 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index c746620442d..f8f76b050c9 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 9015182bc5d..924eaa9b810 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -223,7 +223,9 @@ export class Pipeline { */ select(...selections: Array): Pipeline { const copy = this.stages.map(s => s); - copy.push(new Select(this.selectablesToMap(selections))); + let projections: Map = this.selectablesToMap(selections); + projections = this.readUserData('select', projections); + copy.push(new Select(projections)); return new Pipeline( this.liteDb, this.userDataReader, @@ -781,20 +783,24 @@ export class Pipeline { execute(): Promise>> { const datastore = getDatastore(this.liteDb); return invokeExecutePipeline(datastore, this).then(result => { - const docs = result.map( - element => - new PipelineResult( - this.userDataWriter, - element.key?.path - ? this.documentReferenceFactory(element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - //this.converter - ) - ); + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + this.userDataWriter, + element.key?.path + ? this.documentReferenceFactory(element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + //this.converter + ) + ); return docs; }); diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 966a8a4cc23..c51a514015c 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -184,81 +184,21 @@ export class Query< * @internal */ pipeline(): Pipeline { - throw Error('Not implemented - Query.pipeline()'); - // let pipeline; - // if (this._queryOptions.allDescendants) { - // pipeline = this.firestore - // .pipeline() - // .collectionGroup(this._queryOptions.collectionId); - // } else { - // pipeline = this.firestore - // .pipeline() - // .collection( - // this._queryOptions.parentPath.append(this._queryOptions.collectionId) - // .relativeName - // ); - // } - - // // filters - // for (const f of this._queryOptions.filters) { - // pipeline = pipeline.where(toPipelineFilterCondition(f, this._serializer)); - // } - - // // projections - // const projections = this._queryOptions.projection?.fields || []; - // if (projections.length > 0) { - // pipeline = pipeline.select( - // ...projections.map(p => Field.of(p.fieldPath!)) - // ); - // } - - // // orderbys - // const exists = this.createImplicitOrderBy().map(fieldOrder => { - // return Field.of(fieldOrder.field).exists(); - // }); - // if (exists.length > 1) { - // const [first, ...rest] = exists; - // pipeline = pipeline.where(and(first, ...rest)); - // } else if (exists.length === 1) { - // pipeline = pipeline.where(exists[0]); - // } - - // const orderings = this.createImplicitOrderBy().map(fieldOrder => { - // let dir: 'ascending' | 'descending' | undefined = undefined; - // switch (fieldOrder.direction) { - // case 'ASCENDING': { - // dir = 'ascending'; - // break; - // } - // case 'DESCENDING': { - // dir = 'descending'; - // break; - // } - // } - // return new Ordering(Field.of(fieldOrder.field), dir || 'ascending'); - // }); - // if (orderings.length > 0) { - // pipeline = pipeline.sort({orderings: orderings}); - // } - - // // Cursors, Limit and Offset - // if ( - // !!this._queryOptions.startAt || - // !!this._queryOptions.endAt || - // this._queryOptions.limitType === LimitType.Last - // ) { - // throw new Error( - // 'Query to Pipeline conversion: cursors and limitToLast is not supported yet.' - // ); - // } else { - // if (this._queryOptions.offset) { - // pipeline = pipeline.offset(this._queryOptions.offset); - // } - // if (this._queryOptions.limit) { - // pipeline = pipeline.limit(this._queryOptions.limit); - // } - // } - // return pipeline; + let pipeline; + if (this._query.collectionGroup) { + pipeline = this.firestore + .pipeline() + .collectionGroup(this._query.collectionGroup); + } else { + pipeline = this.firestore + .pipeline() + .collection(this._query.path.canonicalString()); + } + + // TODO(pipeline) convert existing query filters, limits, etc into + // pipeline stages + + return pipeline; } } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 03950690e77..48e4e3a4c1b 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -229,6 +229,7 @@ apiDescribe.only('Pipelines', persistence => { beforeEach(async () => { const setupDeferred = new Deferred(); + testDeferred = new Deferred(); withTestCollectionPromise = withTestCollection( persistence, {}, @@ -242,7 +243,7 @@ apiDescribe.only('Pipelines', persistence => { } ); - await setupDeferred; + await setupDeferred.promise; }); afterEach(async () => { @@ -250,13 +251,23 @@ apiDescribe.only('Pipelines', persistence => { await withTestCollectionPromise; }); + // setLogLevel('debug') + it('empty results as expected', async () => { const result = await firestore .pipeline() .collection(randomCol.path) .limit(0) .execute(); - expect(result).to.be.empty; + expect(result.length).to.equal(0); + }); + + it('full results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .execute(); + expect(result.length).to.equal(10); }); it('returns aggregate results as expected', async () => { @@ -292,7 +303,8 @@ apiDescribe.only('Pipelines', persistence => { ).to.be.rejected; }); - it('returns distinct values as expected', async () => { + // skip: toLower not supported + it.skip('returns distinct values as expected', async () => { const results = await randomCol .pipeline() .where(lt('published', 1900)) @@ -314,6 +326,7 @@ apiDescribe.only('Pipelines', persistence => { groups: ['genre'] }) .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()) .execute(); expectResults( results, @@ -446,7 +459,8 @@ apiDescribe.only('Pipelines', persistence => { expect(results.length).to.equal(10); }); - it('arrayConcat works', async () => { + // skip: arrayConcat not supported + it.skip('arrayConcat works', async () => { const results = await randomCol .pipeline() .select( @@ -510,18 +524,33 @@ apiDescribe.only('Pipelines', persistence => { Field.of('title') ) .where(gt('titleLength', 20)) + .sort(Field.of('title').ascending()) .execute(); + expectResults( results, - { titleLength: 32, title: "The Hitchhiker's Guide to the Galaxy" }, + { - titleLength: 27, + titleLength: 29, title: 'One Hundred Years of Solitude' + }, + { + titleLength: 36, + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + titleLength: 21, + title: 'The Lord of the Rings' + }, + { + titleLength: 21, + title: 'To Kill a Mockingbird' } ); }); - it('testToLowercase', async () => { + // skip: toLower not supported + it.skip('testToLowercase', async () => { const results = await randomCol .pipeline() .select(Field.of('title').toLower().as('lowercaseTitle')) @@ -532,7 +561,8 @@ apiDescribe.only('Pipelines', persistence => { }); }); - it('testToUppercase', async () => { + // skip: toUpper not supported + it.skip('testToUppercase', async () => { const results = await randomCol .pipeline() .select(Field.of('author').toUpper().as('uppercaseAuthor')) @@ -541,7 +571,8 @@ apiDescribe.only('Pipelines', persistence => { expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); }); - it('testTrim', async () => { + // skip: trim not supported + it.skip('testTrim', async () => { const results = await randomCol .pipeline() .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) From 8af0c57e286faeced06e465dd5b1eb3755034252 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Mon, 28 Oct 2024 20:22:01 +0000 Subject: [PATCH 011/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 4117ff2d3ca..97cf9d7189c 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index f8f76b050c9..c746620442d 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From 57d1bf9aad3f5dec391df5c5ca0bff248c3b0084 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:20:22 -0600 Subject: [PATCH 012/295] Move call to readUserData for code readability --- packages/firestore/src/lite-api/pipeline.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 924eaa9b810..fb7c3b50d53 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -316,7 +316,8 @@ export class Pipeline { */ where(condition: FilterCondition & Expr): Pipeline { const copy = this.stages.map(s => s); - copy.push(new Where(this.readUserData('where', condition))); + this.readUserData('where', condition); + copy.push(new Where(condition)); return new Pipeline( this.liteDb, this.userDataReader, From 4f9a5fc469fba413dcd923ed65451a41b8054e5a Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:39:54 -0600 Subject: [PATCH 013/295] Made ProtoSerializable generic and used by Pipeline and Stage --- packages/firestore/src/lite-api/expressions.ts | 2 +- packages/firestore/src/lite-api/pipeline.ts | 4 ++-- packages/firestore/src/lite-api/stage.ts | 10 ++-------- packages/firestore/src/remote/serializer.ts | 8 ++++---- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 047df3d8b15..d12c17bdeda 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -122,7 +122,7 @@ export type ExprType = * The `Expr` class provides a fluent API for building expressions. You can chain together * method calls to create complex expressions. */ -export abstract class Expr implements ProtoSerializable, UserData { +export abstract class Expr implements ProtoSerializable, UserData { /** * Creates an expression that adds this expression to another expression. * diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index fb7c3b50d53..4998692f0d0 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -24,7 +24,7 @@ import { import { invokeExecutePipeline } from '../remote/datastore'; import { getEncodedDatabaseId, - JsonProtoSerializer + JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; import { getDatastore } from './components'; @@ -117,7 +117,7 @@ function isReadableUserData(value: any): value is ReadableUserData { /** * Base-class implementation */ -export class Pipeline { +export class Pipeline implements ProtoSerializable{ /** * @internal * @private diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 4cd684fbaac..0a9ce8b7e35 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -19,7 +19,7 @@ import { } from '../protos/firestore_proto_api'; import { toNumber } from '../remote/number_serializer'; import { - JsonProtoSerializer, + JsonProtoSerializer, ProtoSerializable, toMapValue, toStringValue } from '../remote/serializer'; @@ -37,14 +37,8 @@ import { VectorValue } from './vector_value'; /** * @beta */ -export interface Stage { +export interface Stage extends ProtoSerializable{ name: string; - - /** - * @internal - * @private - */ - _toProto(jsonProtoSerializer: JsonProtoSerializer): ProtoStage; } /** diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index 963116a1ba7..4759571b4a5 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -1429,8 +1429,8 @@ export function isValidResourceName(path: ResourcePath): boolean { ); } -export interface ProtoSerializable { - _toProto(serializer: JsonProtoSerializer): ProtoValue; +export interface ProtoSerializable { + _toProto(serializer: JsonProtoSerializer): ProtoType; } export interface UserData { @@ -1439,10 +1439,10 @@ export interface UserData { export function toMapValue( serializer: JsonProtoSerializer, - input: Map + input: Map> ): ProtoValue { const map: ProtoMapValue = { fields: {} }; - input.forEach((exp: ProtoSerializable, key: string) => { + input.forEach((exp: ProtoSerializable, key: string) => { if (typeof key !== 'string') { throw new Error(`Cannot encode map with non-string key: ${key}`); } From 6717ed4d05985d3f48487088a934936020e10ca2 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:45:41 -0600 Subject: [PATCH 014/295] Fixing build and lint issues --- common/api-review/firestore-lite.api.md | 6 +- common/api-review/firestore.api.md | 6 +- .../firestore/src/core/firestore_client.ts | 2 +- packages/firestore/src/lite-api/pipeline.ts | 7 +- packages/firestore/src/lite-api/stage.ts | 5 +- packages/firestore/src/remote/datastore.ts | 2 +- .../test/integration/api/pipeline.test.ts | 115 +++++++++--------- 7 files changed, 73 insertions(+), 70 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 97cf9d7189c..4117ff2d3ca 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index c746620442d..f8f76b050c9 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index 57aa99869da..508535f8636 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -556,7 +556,7 @@ export function firestoreClientRunAggregateQuery( export function firestoreClientExecutePipeline( client: FirestoreClient, - pipeline: Pipeline + pipeline: Pipeline ): Promise { const deferred = new Deferred(); diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 4998692f0d0..e346b5a16ef 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -24,7 +24,8 @@ import { import { invokeExecutePipeline } from '../remote/datastore'; import { getEncodedDatabaseId, - JsonProtoSerializer, ProtoSerializable + JsonProtoSerializer, + ProtoSerializable } from '../remote/serializer'; import { getDatastore } from './components'; @@ -117,7 +118,9 @@ function isReadableUserData(value: any): value is ReadableUserData { /** * Base-class implementation */ -export class Pipeline implements ProtoSerializable{ +export class Pipeline + implements ProtoSerializable +{ /** * @internal * @private diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 0a9ce8b7e35..9f4c7735f03 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -19,7 +19,8 @@ import { } from '../protos/firestore_proto_api'; import { toNumber } from '../remote/number_serializer'; import { - JsonProtoSerializer, ProtoSerializable, + JsonProtoSerializer, + ProtoSerializable, toMapValue, toStringValue } from '../remote/serializer'; @@ -37,7 +38,7 @@ import { VectorValue } from './vector_value'; /** * @beta */ -export interface Stage extends ProtoSerializable{ +export interface Stage extends ProtoSerializable { name: string; } diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index 00c1e7fca9e..5fbff4392ac 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -241,7 +241,7 @@ export async function invokeBatchGetDocumentsRpc( export async function invokeExecutePipeline( datastore: Datastore, - pipeline: Pipeline + pipeline: Pipeline ): Promise { const datastoreImpl = debugCast(datastore, DatastoreImpl); const executePipelineRequest = pipeline._toProto(datastoreImpl.serializer); diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 48e4e3a4c1b..fffa5240b85 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -48,7 +48,6 @@ import { regexMatch, setDoc, startsWith, - strConcat, subtract } from '../util/firebase_export'; import { apiDescribe, withTestCollection } from '../util/helpers'; @@ -304,18 +303,18 @@ apiDescribe.only('Pipelines', persistence => { }); // skip: toLower not supported - it.skip('returns distinct values as expected', async () => { - const results = await randomCol - .pipeline() - .where(lt('published', 1900)) - .distinct(Field.of('genre').toLower().as('lowerGenre')) - .execute(); - expectResults( - results, - { lowerGenre: 'romance' }, - { lowerGenre: 'psychological thriller' } - ); - }); + // it.skip('returns distinct values as expected', async () => { + // const results = await randomCol + // .pipeline() + // .where(lt('published', 1900)) + // .distinct(Field.of('genre').toLower().as('lowerGenre')) + // .execute(); + // expectResults( + // results, + // { lowerGenre: 'romance' }, + // { lowerGenre: 'psychological thriller' } + // ); + // }); it('returns group and accumulate results', async () => { const results = await randomCol @@ -460,18 +459,18 @@ apiDescribe.only('Pipelines', persistence => { }); // skip: arrayConcat not supported - it.skip('arrayConcat works', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') - ) - .limit(1) - .execute(); - expectResults(results, { - modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] - }); - }); + // it.skip('arrayConcat works', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] + // }); + // }); it('testStrConcat', async () => { const results = await randomCol @@ -550,43 +549,43 @@ apiDescribe.only('Pipelines', persistence => { }); // skip: toLower not supported - it.skip('testToLowercase', async () => { - const results = await randomCol - .pipeline() - .select(Field.of('title').toLower().as('lowercaseTitle')) - .limit(1) - .execute(); - expectResults(results, { - lowercaseTitle: "the hitchhiker's guide to the galaxy" - }); - }); + // it.skip('testToLowercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('title').toLower().as('lowercaseTitle')) + // .limit(1) + // .execute(); + // expectResults(results, { + // lowercaseTitle: "the hitchhiker's guide to the galaxy" + // }); + // }); // skip: toUpper not supported - it.skip('testToUppercase', async () => { - const results = await randomCol - .pipeline() - .select(Field.of('author').toUpper().as('uppercaseAuthor')) - .limit(1) - .execute(); - expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); - }); + // it.skip('testToUppercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('author').toUpper().as('uppercaseAuthor')) + // .limit(1) + // .execute(); + // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + // }); // skip: trim not supported - it.skip('testTrim', async () => { - const results = await randomCol - .pipeline() - .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) - .select( - Field.of('spacedTitle').trim().as('trimmedTitle'), - Field.of('spacedTitle') - ) - .limit(1) - .execute(); - expectResults(results, { - spacedTitle: " The Hitchhiker's Guide to the Galaxy ", - trimmedTitle: "The Hitchhiker's Guide to the Galaxy" - }); - }); + // it.skip('testTrim', async () => { + // const results = await randomCol + // .pipeline() + // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) + // .select( + // Field.of('spacedTitle').trim().as('trimmedTitle'), + // Field.of('spacedTitle') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + // }); + // }); it('testLike', async () => { const results = await randomCol From 3ab4f5c87d06893eb3d9d3f78b2167e8e6c72aa1 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Thu, 31 Oct 2024 19:58:50 +0000 Subject: [PATCH 015/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 4117ff2d3ca..97cf9d7189c 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index f8f76b050c9..c746620442d 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From fd20eff30092a65cab35dae32f73c0057601af11 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:45:05 -0600 Subject: [PATCH 016/295] Adding new bundle size test --- .../bundle-definitions/firestore.json | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index f5ddafd167c..51416a76cfc 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -128,6 +128,37 @@ } ] }, + { + "name": "Pipeline Query with lt filter", + "dependencies": [ + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "app", + "imports": [ + "initializeApp" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore", + "imports": [ + "getFirestore", + "lt", + "Field" + ] + } + ] + } + ] + }, { "name": "Query Cursors", "dependencies": [ From 90a5e3c90f807723d81f4b9de984225f71ec2806 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:51:51 -0700 Subject: [PATCH 017/295] experimentation with augmentation for ppl --- common/api-review/firestore-lite.api.md | 13 +++-- common/api-review/firestore.api.md | 13 +++-- packages/firestore/lite/index.ts | 2 + packages/firestore/src/api.ts | 2 + .../src/api/database-augmentation.ts | 52 ++++++++++++++++++ packages/firestore/src/api/database.ts | 28 ++++------ .../src/lite-api/database-augmentation.ts | 53 +++++++++++++++++++ packages/firestore/src/lite-api/database.ts | 27 ++++------ packages/firestore/src/lite-api/reference.ts | 33 ++++-------- .../test/integration/api/pipeline.test.ts | 4 +- 10 files changed, 155 insertions(+), 72 deletions(-) create mode 100644 packages/firestore/src/api/database-augmentation.ts create mode 100644 packages/firestore/src/lite-api/database-augmentation.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 97cf9d7189c..816dc4c4e66 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -1029,10 +1029,6 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; - // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta - // - // (undocumented) - pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -2111,6 +2107,9 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +// @public (undocumented) +export function useFirestorePipelines(): void; + // @public export function vector(values?: number[]): VectorValue; @@ -2176,8 +2175,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index c746620442d..cdd17494e4c 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1073,10 +1073,6 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; - // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta - // - // (undocumented) - pipeline: () => PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -2396,6 +2392,9 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +// @public (undocumented) +export function useFirestorePipelines(): void; + // @public export function vector(values?: number[]): VectorValue; @@ -2464,8 +2463,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10107:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10137:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index 9969924b5b7..aba1433aa64 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -33,6 +33,8 @@ export { PipelineResult } from '../src/lite-api/pipeline-result'; export { Pipeline } from '../src/lite-api/pipeline'; +export { useFirestorePipelines } from '../src/lite-api/database-augmentation'; + export { Stage, FindNearestOptions, diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 7193bff675a..8b640ca3a62 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -21,6 +21,8 @@ export { PipelineResult } from './lite-api/pipeline-result'; export { Pipeline } from './lite-api/pipeline'; +export { useFirestorePipelines } from './api/database-augmentation'; + export { Stage, FindNearestOptions, diff --git a/packages/firestore/src/api/database-augmentation.ts b/packages/firestore/src/api/database-augmentation.ts new file mode 100644 index 00000000000..9f272b3a05e --- /dev/null +++ b/packages/firestore/src/api/database-augmentation.ts @@ -0,0 +1,52 @@ +import { Pipeline } from '../lite-api/pipeline'; +import { PipelineSource } from '../lite-api/pipeline-source'; +import { newUserDataReader } from '../lite-api/user_data_reader'; +import { DocumentKey } from '../model/document_key'; + +import { Firestore } from './database'; +import { DocumentReference, Query } from './reference'; +import { ExpUserDataWriter } from './user_data_writer'; + +declare module './database' { + interface Firestore { + pipeline(): PipelineSource; + } +} + +declare module './reference' { + interface Query { + pipeline(): Pipeline; + } +} + +export function useFirestorePipelines(): void { + Firestore.prototype.pipeline = function (): PipelineSource { + const firestore = this; + return new PipelineSource( + this, + newUserDataReader(firestore), + new ExpUserDataWriter(firestore), + (key: DocumentKey) => { + return new DocumentReference(firestore, null, key); + } + ); + }; + + Query.prototype.pipeline = function (): Pipeline { + let pipeline; + if (this._query.collectionGroup) { + pipeline = this.firestore + .pipeline() + .collectionGroup(this._query.collectionGroup); + } else { + pipeline = this.firestore + .pipeline() + .collection(this._query.path.canonicalString()); + } + + // TODO(pipeline) convert existing query filters, limits, etc into + // pipeline stages + + return pipeline; + }; +} diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 812811f41ed..827f3f1de35 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -46,16 +46,13 @@ import { connectFirestoreEmulator, Firestore as LiteFirestore } from '../lite-api/database'; -import { PipelineSource } from '../lite-api/pipeline-source'; -import { DocumentReference, Query } from '../lite-api/reference'; -import { newUserDataReader } from '../lite-api/user_data_reader'; +import { Query } from '../lite-api/reference'; import { indexedDbClearPersistence, indexedDbStoragePrefix } from '../local/indexeddb_persistence'; import { LRU_COLLECTION_DISABLED } from '../local/lru_garbage_collector'; import { LRU_MINIMUM_CACHE_SIZE_BYTES } from '../local/lru_garbage_collector_impl'; -import { DocumentKey } from '../model/document_key'; import { debugAssert } from '../util/assert'; import { AsyncQueue } from '../util/async_queue'; import { AsyncQueueImpl } from '../util/async_queue_impl'; @@ -67,7 +64,6 @@ import { Deferred } from '../util/promise'; import { LoadBundleTask } from './bundle'; import { CredentialsProvider } from './credentials'; import { FirestoreSettings, PersistenceSettings } from './settings'; -import { ExpUserDataWriter } from './user_data_writer'; export { connectFirestoreEmulator, @@ -108,18 +104,6 @@ export class Firestore extends LiteFirestore { _online: OnlineComponentProviderFactory; }; - pipeline = (): PipelineSource => { - const firestore = this; - return new PipelineSource( - this, - newUserDataReader(firestore), - new ExpUserDataWriter(firestore), - (key: DocumentKey) => { - return new DocumentReference(firestore, null, key); - } - ); - }; - /** @hideconstructor */ constructor( authCredentialsProvider: CredentialsProvider, @@ -146,6 +130,16 @@ export class Firestore extends LiteFirestore { } } +// Undocumented method of Firestore. This is only +// in place to give developers a runtime error suggesting +// how to correctly initialize Firestore for use with Pipelines. +// @ts-ignore +Firestore.prototype.pipeline = function (): unknown { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); +}; + /** * Initializes a new instance of {@link Firestore} with the provided settings. * Can only be called before any other function, including diff --git a/packages/firestore/src/lite-api/database-augmentation.ts b/packages/firestore/src/lite-api/database-augmentation.ts new file mode 100644 index 00000000000..95dab65587d --- /dev/null +++ b/packages/firestore/src/lite-api/database-augmentation.ts @@ -0,0 +1,53 @@ +import { DocumentKey } from '../model/document_key'; + +import { Firestore } from './database'; +import { Pipeline } from './pipeline'; +import { PipelineSource } from './pipeline-source'; +import { DocumentReference, Query } from './reference'; +import { LiteUserDataWriter } from './reference_impl'; +import { newUserDataReader } from './user_data_reader'; + +declare module './database' { + interface Firestore { + pipeline(): PipelineSource; + } +} + +declare module './reference' { + interface Query { + pipeline(): Pipeline; + } +} + +export function useFirestorePipelines(): void { + Firestore.prototype.pipeline = function (): PipelineSource { + const userDataWriter = new LiteUserDataWriter(this); + const userDataReader = newUserDataReader(this); + return new PipelineSource( + this, + userDataReader, + userDataWriter, + (key: DocumentKey) => { + return new DocumentReference(this, null, key); + } + ); + }; + + Query.prototype.pipeline = function (): Pipeline { + let pipeline; + if (this._query.collectionGroup) { + pipeline = this.firestore + .pipeline() + .collectionGroup(this._query.collectionGroup); + } else { + pipeline = this.firestore + .pipeline() + .collection(this._query.path.canonicalString()); + } + + // TODO(pipeline) convert existing query filters, limits, etc into + // pipeline stages + + return pipeline; + }; +} diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 93fe4eb95d1..172308a02fc 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,7 +28,6 @@ import { getDefaultEmulatorHostnameAndPort } from '@firebase/util'; -import { PipelineSource, DocumentReference } from '../api'; import { CredentialsProvider, EmulatorAuthCredentialsProvider, @@ -37,20 +36,17 @@ import { } from '../api/credentials'; import { User } from '../auth/user'; import { DatabaseId, DEFAULT_DATABASE_NAME } from '../core/database_info'; -import { DocumentKey } from '../model/document_key'; import { Code, FirestoreError } from '../util/error'; import { cast } from '../util/input_validation'; import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; -import { LiteUserDataWriter } from './reference_impl'; import { DEFAULT_HOST, FirestoreSettingsImpl, PrivateSettings, FirestoreSettings } from './settings'; -import { newUserDataReader } from './user_data_reader'; export { EmulatorMockTokenOptions } from '@firebase/util'; @@ -177,21 +173,18 @@ export class Firestore implements FirestoreService { removeComponents(this); return Promise.resolve(); } - - pipeline(): PipelineSource { - const userDataWriter = new LiteUserDataWriter(this); - const userDataReader = newUserDataReader(this); - return new PipelineSource( - this, - userDataReader, - userDataWriter, - (key: DocumentKey) => { - return new DocumentReference(this, null, key); - } - ); - } } +// Undocumented method of Firestore. This is only +// in place to give developers a runtime error suggesting +// how to correctly initialize Firestore for use with Pipelines. +// @ts-ignore +Firestore.prototype.pipeline = function (): unknown { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); +}; + /** * Initializes a new instance of Cloud Firestore with the provided settings. * Can only be called before any other functions, including diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index c51a514015c..0a49d177976 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -37,7 +37,6 @@ import { AutoId } from '../util/misc'; import { Firestore } from './database'; import { FieldPath } from './field_path'; import { FieldValue } from './field_value'; -import { Pipeline } from './pipeline'; import { FirestoreDataConverter } from './snapshot'; import { NestedUpdateFields, Primitive } from './types'; @@ -178,30 +177,18 @@ export class Query< this._query ); } - - /** - * @private - * @internal - */ - pipeline(): Pipeline { - let pipeline; - if (this._query.collectionGroup) { - pipeline = this.firestore - .pipeline() - .collectionGroup(this._query.collectionGroup); - } else { - pipeline = this.firestore - .pipeline() - .collection(this._query.path.canonicalString()); - } - - // TODO(pipeline) convert existing query filters, limits, etc into - // pipeline stages - - return pipeline; - } } +// Undocumented method of Query. This is only +// in place to give developers a runtime error suggesting +// how to correctly initialize Firestore for use with Pipelines. +// @ts-ignore +Query.prototype.pipeline = function () { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); +}; + /** * A `DocumentReference` refers to a document location in a Firestore database * and can be used to write, read, or listen to the location. The document at diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index fffa5240b85..92de61d5644 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -48,11 +48,13 @@ import { regexMatch, setDoc, startsWith, - subtract + subtract, + useFirestorePipelines } from '../util/firebase_export'; import { apiDescribe, withTestCollection } from '../util/helpers'; use(chaiAsPromised); +useFirestorePipelines(); apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); From 585d52ef63e1ceefbad262ecf8519c660eb6b737 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Mon, 4 Nov 2024 23:04:16 +0000 Subject: [PATCH 018/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 816dc4c4e66..529be17bcee 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2175,8 +2175,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index cdd17494e4c..b485e3b6530 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2463,8 +2463,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10107:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10137:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10107:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10137:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From 4b67f8a79645bd673a1d93c5f88e0488a98db235 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:26:40 -0700 Subject: [PATCH 019/295] Documentation and .d.ts improvements --- common/api-review/firestore-lite.api.md | 9 +++++--- common/api-review/firestore.api.md | 9 +++++--- packages/firestore/lite/index.ts | 2 +- packages/firestore/src/api.ts | 2 +- ...gmentation.ts => database_augmentation.ts} | 12 ---------- packages/firestore/src/lite-api/database.ts | 22 ++++++++++--------- ...gmentation.ts => database_augmentation.ts} | 12 ---------- packages/firestore/src/lite-api/reference.ts | 20 ++++++++--------- 8 files changed, 36 insertions(+), 52 deletions(-) rename packages/firestore/src/api/{database-augmentation.ts => database_augmentation.ts} (87%) rename packages/firestore/src/lite-api/{database-augmentation.ts => database_augmentation.ts} (87%) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 816dc4c4e66..85b9d83998f 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -1029,6 +1029,8 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1619,6 +1621,7 @@ export class Query | null; readonly firestore: Firestore; + pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2175,8 +2178,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9261:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9262:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9291:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index cdd17494e4c..5ec345d5f1c 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1073,6 +1073,8 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1877,6 +1879,7 @@ export class Query | null; readonly firestore: Firestore; + pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2463,8 +2466,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10107:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10137:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10111:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10112:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10141:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index aba1433aa64..f4a3869a57f 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -33,7 +33,7 @@ export { PipelineResult } from '../src/lite-api/pipeline-result'; export { Pipeline } from '../src/lite-api/pipeline'; -export { useFirestorePipelines } from '../src/lite-api/database-augmentation'; +export { useFirestorePipelines } from '../src/lite-api/database_augmentation'; export { Stage, diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 8b640ca3a62..85ad72a89f2 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -21,7 +21,7 @@ export { PipelineResult } from './lite-api/pipeline-result'; export { Pipeline } from './lite-api/pipeline'; -export { useFirestorePipelines } from './api/database-augmentation'; +export { useFirestorePipelines } from './api/database_augmentation'; export { Stage, diff --git a/packages/firestore/src/api/database-augmentation.ts b/packages/firestore/src/api/database_augmentation.ts similarity index 87% rename from packages/firestore/src/api/database-augmentation.ts rename to packages/firestore/src/api/database_augmentation.ts index 9f272b3a05e..6015598a29c 100644 --- a/packages/firestore/src/api/database-augmentation.ts +++ b/packages/firestore/src/api/database_augmentation.ts @@ -7,18 +7,6 @@ import { Firestore } from './database'; import { DocumentReference, Query } from './reference'; import { ExpUserDataWriter } from './user_data_writer'; -declare module './database' { - interface Firestore { - pipeline(): PipelineSource; - } -} - -declare module './reference' { - interface Query { - pipeline(): Pipeline; - } -} - export function useFirestorePipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { const firestore = this; diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 172308a02fc..f67c5c32767 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -41,12 +41,15 @@ import { cast } from '../util/input_validation'; import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; +import type { PipelineSource } from './pipeline-source'; import { DEFAULT_HOST, FirestoreSettingsImpl, PrivateSettings, FirestoreSettings } from './settings'; +// `import type` to avoid bundling the source for +// pipelines if `useFirestorePipelines()` is not called export { EmulatorMockTokenOptions } from '@firebase/util'; @@ -173,17 +176,16 @@ export class Firestore implements FirestoreService { removeComponents(this); return Promise.resolve(); } -} -// Undocumented method of Firestore. This is only -// in place to give developers a runtime error suggesting -// how to correctly initialize Firestore for use with Pipelines. -// @ts-ignore -Firestore.prototype.pipeline = function (): unknown { - throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' - ); -}; + /** + * Pipeline query. + */ + pipeline(): PipelineSource { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); + } +} /** * Initializes a new instance of Cloud Firestore with the provided settings. diff --git a/packages/firestore/src/lite-api/database-augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts similarity index 87% rename from packages/firestore/src/lite-api/database-augmentation.ts rename to packages/firestore/src/lite-api/database_augmentation.ts index 95dab65587d..7eb96e658c7 100644 --- a/packages/firestore/src/lite-api/database-augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -7,18 +7,6 @@ import { DocumentReference, Query } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { newUserDataReader } from './user_data_reader'; -declare module './database' { - interface Firestore { - pipeline(): PipelineSource; - } -} - -declare module './reference' { - interface Query { - pipeline(): Pipeline; - } -} - export function useFirestorePipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { const userDataWriter = new LiteUserDataWriter(this); diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 0a49d177976..71b789227fc 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -37,6 +37,7 @@ import { AutoId } from '../util/misc'; import { Firestore } from './database'; import { FieldPath } from './field_path'; import { FieldValue } from './field_value'; +import type { Pipeline } from './pipeline'; import { FirestoreDataConverter } from './snapshot'; import { NestedUpdateFields, Primitive } from './types'; @@ -177,17 +178,16 @@ export class Query< this._query ); } -} -// Undocumented method of Query. This is only -// in place to give developers a runtime error suggesting -// how to correctly initialize Firestore for use with Pipelines. -// @ts-ignore -Query.prototype.pipeline = function () { - throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' - ); -}; + /** + * Pipeline query. + */ + pipeline(): Pipeline { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); + } +} /** * A `DocumentReference` refers to a document location in a Firestore database From ca0ffd94d68f81d55780007b416d3c650f5f7b8f Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Tue, 5 Nov 2024 00:38:52 +0000 Subject: [PATCH 020/295] Update API reports --- common/api-review/firestore-lite.api.md | 9 ++++++--- common/api-review/firestore.api.md | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 529be17bcee..00ed8776beb 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -1029,6 +1029,8 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1619,6 +1621,7 @@ export class Query | null; readonly firestore: Firestore; + pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2175,8 +2178,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9261:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9262:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9291:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index b485e3b6530..c50b906e16c 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1073,6 +1073,8 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; + // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta + pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1877,6 +1879,7 @@ export class Query | null; readonly firestore: Firestore; + pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2463,8 +2466,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10107:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10137:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10111:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10112:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10141:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From 2d386c8571587171a2173ff02b850d8ba70b647e Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:48:27 -0700 Subject: [PATCH 021/295] Update the bundle definition for the pipeline bundle test --- repo-scripts/size-analysis/bundle-definitions/firestore.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index 51416a76cfc..e48c8a3fa7c 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -152,7 +152,8 @@ "imports": [ "getFirestore", "lt", - "Field" + "Field", + "useFirestorePipelines" ] } ] From c621b81f3ed740a60d650029ba64d60bb8f75b8a Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:53:21 -0700 Subject: [PATCH 022/295] Update the bundle definition adding a pipeline test with and function --- .../bundle-definitions/firestore.json | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index e48c8a3fa7c..a589732ae5c 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -160,6 +160,39 @@ } ] }, + { + "name": "Pipeline Query with lt plus and filter", + "dependencies": [ + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "app", + "imports": [ + "initializeApp" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore", + "imports": [ + "getFirestore", + "lt", + "Field", + "useFirestorePipelines", + "andExpression" + ] + } + ] + } + ] + }, { "name": "Query Cursors", "dependencies": [ From 773ab0259ea485a90bd211aa84b4fdfb9e64c4d5 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:53:58 -0700 Subject: [PATCH 023/295] Typo --- repo-scripts/size-analysis/bundle-definitions/firestore.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index a589732ae5c..f7e13a8f401 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -161,7 +161,7 @@ ] }, { - "name": "Pipeline Query with lt plus and filter", + "name": "Pipeline Query with lt plus and function", "dependencies": [ { "packageName": "firebase", From 682997d3e9598195f385688ab596fa355dd4f8dc Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:15:00 -0700 Subject: [PATCH 024/295] And/or overloads. Pipeline serialization for console. --- common/api-review/firestore.api.md | 24 ++++++---- packages/firestore/src/api.ts | 9 ++-- packages/firestore/src/api/database.ts | 20 ++++---- .../src/api/database_augmentation.ts | 10 ++++ .../firestore/src/lite-api/expressions.ts | 38 --------------- packages/firestore/src/lite-api/query.ts | 48 ------------------- .../src/remote/internal_serializer.ts | 26 ++++++++++ .../test/integration/api/pipeline.test.ts | 30 +++++++++--- 8 files changed, 89 insertions(+), 116 deletions(-) diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index c50b906e16c..a8aa8ce6e20 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -100,11 +100,15 @@ export class And extends FirestoreFunction implements FilterCondition { filterable: true; } +// @beta +export function and(left: FilterExpr, ...right: FilterExpr[]): And; + // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @beta -export function andExpression(left: FilterExpr, ...right: FilterExpr[]): And; +// @public (undocumented) +export namespace and { +} // @beta (undocumented) export class ArrayConcat extends FirestoreFunction { @@ -1738,9 +1742,16 @@ export class Or extends FirestoreFunction implements FilterCondition { filterable: true; } +// @beta +export function or(left: FilterExpr, ...right: FilterExpr[]): Or; + // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +// @public (undocumented) +export namespace or { +} + // @public export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; @@ -1752,9 +1763,6 @@ export class Ordering { constructor(expr: Constant, direction: 'ascending' | 'descending'); } -// @beta -export function orExpression(left: FilterExpr, ...right: FilterExpr[]): Or; - // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; @@ -2466,8 +2474,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10111:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10112:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10141:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10115:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10145:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 85ad72a89f2..73b725f184b 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -61,8 +61,6 @@ export { arrayLength, inAny, notInAny, - and as andExpression, - or as orExpression, xor, ifFunction, not, @@ -183,6 +181,8 @@ export { Accumulator } from './lite-api/expressions'; +export { and, or } from './lite-api/overloads'; + export { aggregateFieldEqual, aggregateQuerySnapshotEqual, @@ -282,12 +282,10 @@ export { } from './api/reference'; export { - and, endAt, endBefore, limit, limitToLast, - or, orderBy, OrderByDirection, query, @@ -392,7 +390,8 @@ export { isBase64Available as _isBase64Available } from './platform/base64'; export { DatabaseId as _DatabaseId } from './core/database_info'; export { _internalQueryToProtoQueryTarget, - _internalAggregationQueryToProtoRunAggregationQueryRequest + _internalAggregationQueryToProtoRunAggregationQueryRequest, + _internalPipelineToExecutePipelineRequestProto } from './remote/internal_serializer'; export { cast as _cast, diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 827f3f1de35..cc1fab0c86a 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -46,6 +46,7 @@ import { connectFirestoreEmulator, Firestore as LiteFirestore } from '../lite-api/database'; +import type { PipelineSource } from '../lite-api/pipeline-source'; import { Query } from '../lite-api/reference'; import { indexedDbClearPersistence, @@ -128,17 +129,16 @@ export class Firestore extends LiteFirestore { await terminate; } } -} -// Undocumented method of Firestore. This is only -// in place to give developers a runtime error suggesting -// how to correctly initialize Firestore for use with Pipelines. -// @ts-ignore -Firestore.prototype.pipeline = function (): unknown { - throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' - ); -}; + /** + * Pipeline query. + */ + pipeline(): PipelineSource { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); + } +} /** * Initializes a new instance of {@link Firestore} with the provided settings. diff --git a/packages/firestore/src/api/database_augmentation.ts b/packages/firestore/src/api/database_augmentation.ts index 6015598a29c..dcaff555a04 100644 --- a/packages/firestore/src/api/database_augmentation.ts +++ b/packages/firestore/src/api/database_augmentation.ts @@ -1,3 +1,5 @@ +import { And, FilterExpr, Or } from '../lite-api/expressions'; +import { and, or } from '../lite-api/overloads'; import { Pipeline } from '../lite-api/pipeline'; import { PipelineSource } from '../lite-api/pipeline-source'; import { newUserDataReader } from '../lite-api/user_data_reader'; @@ -37,4 +39,12 @@ export function useFirestorePipelines(): void { return pipeline; }; + + and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { + return new And([left, ...right]); + }; + + or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { + return new Or([left, ...right]); + }; } diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index d12c17bdeda..82729147e75 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -4517,44 +4517,6 @@ export function notInAny(element: Expr | string, others: any[]): Not { return new Not(new In(elementExpr, exprOthers)); } -/** - * @beta - * - * Creates an expression that performs a logical 'AND' operation on multiple filter conditions. - * - * ```typescript - * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND - * // the 'status' field is "active" - * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - * ``` - * - * @param left The first filter condition. - * @param right Additional filter conditions to 'AND' together. - * @return A new {@code Expr} representing the logical 'AND' operation. - */ -export function and(left: FilterExpr, ...right: FilterExpr[]): And { - return new And([left, ...right]); -} - -/** - * @beta - * - * Creates an expression that performs a logical 'OR' operation on multiple filter conditions. - * - * ```typescript - * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR - * // the 'status' field is "active" - * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); - * ``` - * - * @param left The first filter condition. - * @param right Additional filter conditions to 'OR' together. - * @return A new {@code Expr} representing the logical 'OR' operation. - */ -export function or(left: FilterExpr, ...right: FilterExpr[]): Or { - return new Or([left, ...right]); -} - /** * @beta * diff --git a/packages/firestore/src/lite-api/query.ts b/packages/firestore/src/lite-api/query.ts index f0a357b828c..16ed4f69a31 100644 --- a/packages/firestore/src/lite-api/query.ts +++ b/packages/firestore/src/lite-api/query.ts @@ -367,54 +367,6 @@ export type QueryFilterConstraint = | QueryFieldFilterConstraint | QueryCompositeFilterConstraint; -/** - * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of - * the given filter constraints. A disjunction filter includes a document if it - * satisfies any of the given filters. - * - * @param queryConstraints - Optional. The list of - * {@link QueryFilterConstraint}s to perform a disjunction for. These must be - * created with calls to {@link where}, {@link or}, or {@link and}. - * @returns The newly created {@link QueryCompositeFilterConstraint}. - */ -export function or( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint { - // Only support QueryFilterConstraints - queryConstraints.forEach(queryConstraint => - validateQueryFilterConstraint('or', queryConstraint) - ); - - return QueryCompositeFilterConstraint._create( - CompositeOperator.OR, - queryConstraints as QueryFilterConstraint[] - ); -} - -/** - * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of - * the given filter constraints. A conjunction filter includes a document if it - * satisfies all of the given filters. - * - * @param queryConstraints - Optional. The list of - * {@link QueryFilterConstraint}s to perform a conjunction for. These must be - * created with calls to {@link where}, {@link or}, or {@link and}. - * @returns The newly created {@link QueryCompositeFilterConstraint}. - */ -export function and( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint { - // Only support QueryFilterConstraints - queryConstraints.forEach(queryConstraint => - validateQueryFilterConstraint('and', queryConstraint) - ); - - return QueryCompositeFilterConstraint._create( - CompositeOperator.AND, - queryConstraints as QueryFilterConstraint[] - ); -} - /** * A `QueryOrderByConstraint` is used to sort the set of documents returned by a * Firestore query. `QueryOrderByConstraint`s are created by invoking diff --git a/packages/firestore/src/remote/internal_serializer.ts b/packages/firestore/src/remote/internal_serializer.ts index 8f278247581..628457ba81c 100644 --- a/packages/firestore/src/remote/internal_serializer.ts +++ b/packages/firestore/src/remote/internal_serializer.ts @@ -19,6 +19,7 @@ import { ensureFirestoreConfigured, Firestore } from '../api/database'; import { AggregateImpl } from '../core/aggregate'; import { queryToAggregateTarget, queryToTarget } from '../core/query'; import { AggregateSpec } from '../lite-api/aggregate_types'; +import { Pipeline } from '../lite-api/pipeline'; import { Query } from '../lite-api/reference'; import { cast } from '../util/input_validation'; import { mapToArray } from '../util/obj'; @@ -87,3 +88,28 @@ export function _internalAggregationQueryToProtoRunAggregationQueryRequest< /* skipAliasing= */ true ).request; } + +/** + * @internal + * @private + * + * This function is for internal use only. + * + * Returns the `ExecutePipelineRequest` representation of the given query. + * Returns `null` if the Firestore client associated with the given query has + * not been initialized or has been terminated. + * + * @param pipeline - The Pipeline to convert to proto representation. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function _internalPipelineToExecutePipelineRequestProto( + pipeline: Pipeline +): any { + const firestore = cast(pipeline._db, Firestore); + const client = ensureFirestoreConfigured(firestore); + const serializer = client._onlineComponents?.datastore.serializer; + if (serializer === undefined) { + return null; + } + return pipeline._toProto(serializer); +} diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 92de61d5644..1c210067785 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -18,8 +18,9 @@ import chaiAsPromised from 'chai-as-promised'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { + _internalPipelineToExecutePipelineRequestProto, add, - andExpression, + and, arrayContains, arrayContainsAny, avg, @@ -42,7 +43,7 @@ import { mapGet, neq, not, - orExpression, + or, PipelineResult, regexContains, regexMatch, @@ -384,7 +385,7 @@ apiDescribe.only('Pipelines', persistence => { it('where with and', async () => { const results = await randomCol .pipeline() - .where(andExpression(gt('rating', 4.5), eq('genre', 'Science Fiction'))) + .where(and(gt('rating', 4.5), eq('genre', 'Science Fiction'))) .execute(); expectResults(results, 'book10'); }); @@ -392,7 +393,7 @@ apiDescribe.only('Pipelines', persistence => { it('where with or', async () => { const results = await randomCol .pipeline() - .where(orExpression(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) + .where(or(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) .select('title') .execute(); expectResults( @@ -637,7 +638,7 @@ apiDescribe.only('Pipelines', persistence => { const results = await randomCol .pipeline() .where( - andExpression( + and( gt('rating', 4.2), lte(Field.of('rating'), 4.5), neq('genre', 'Science Fiction') @@ -661,8 +662,8 @@ apiDescribe.only('Pipelines', persistence => { const results = await randomCol .pipeline() .where( - orExpression( - andExpression(gt('rating', 4.5), eq('genre', 'Science Fiction')), + or( + and(gt('rating', 4.5), eq('genre', 'Science Fiction')), lt('published', 1900) ) ) @@ -793,6 +794,21 @@ apiDescribe.only('Pipelines', persistence => { ); }); + it('supports internal serialization to proto', async () => { + const pipeline = firestore + .pipeline() + .collection('books') + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ); + + const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); + expect(proto).not.to.be.null; + }); + // TODO(pipeline) support converter // it('pipeline converter works', async () => { // interface AppModel {myTitle: string; myAuthor: string; myPublished: number} From 8eb90826e4d63452db8d7565737ac2b0ec414282 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:15:55 -0700 Subject: [PATCH 025/295] Cast Firestore --- packages/firestore/src/api/pipeline.ts | 6 +++-- packages/firestore/src/lite-api/pipeline.ts | 30 ++++++++++++--------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index 047731b40e5..9aeccae9ad0 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -6,6 +6,7 @@ import { Stage } from '../lite-api/stage'; import { UserDataReader } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { DocumentKey } from '../model/document_key'; +import { cast } from '../util/input_validation'; import { ensureFirestoreConfigured, Firestore } from './database'; @@ -23,7 +24,7 @@ export class Pipeline< * @param converter */ constructor( - private db: Firestore, + db: Firestore, userDataReader: UserDataReader, userDataWriter: AbstractUserDataWriter, documentReferenceFactory: (id: DocumentKey) => DocumentReference, @@ -74,7 +75,8 @@ export class Pipeline< * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - const client = ensureFirestoreConfigured(this.db); + const firestore = cast(this._db, Firestore); + const client = ensureFirestoreConfigured(firestore); return firestoreClientExecutePipeline(client, this).then(result => { const docs = result.map( element => diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index e346b5a16ef..41a3b4590d8 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -124,7 +124,7 @@ export class Pipeline /** * @internal * @private - * @param liteDb + * @param _db * @param userDataReader * @param userDataWriter * @param documentReferenceFactory @@ -132,7 +132,11 @@ export class Pipeline * @param converter */ constructor( - private liteDb: Firestore, + /** + * @internal + * @private + */ + public _db: Firestore, private userDataReader: UserDataReader, /** * @internal @@ -184,7 +188,7 @@ export class Pipeline ) ); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -230,7 +234,7 @@ export class Pipeline projections = this.readUserData('select', projections); copy.push(new Select(projections)); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -322,7 +326,7 @@ export class Pipeline this.readUserData('where', condition); copy.push(new Where(condition)); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -355,7 +359,7 @@ export class Pipeline const copy = this.stages.map(s => s); copy.push(new Offset(offset)); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -393,7 +397,7 @@ export class Pipeline const copy = this.stages.map(s => s); copy.push(new Limit(limit)); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -438,7 +442,7 @@ export class Pipeline ) ); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -551,7 +555,7 @@ export class Pipeline ); } return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -579,7 +583,7 @@ export class Pipeline ) ); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -640,7 +644,7 @@ export class Pipeline } return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -678,7 +682,7 @@ export class Pipeline }); copy.push(new GenericStage(name, params)); return new Pipeline( - this.liteDb, + this._db, this.userDataReader, this.userDataWriter, this.documentReferenceFactory, @@ -785,7 +789,7 @@ export class Pipeline * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - const datastore = getDatastore(this.liteDb); + const datastore = getDatastore(this._db); return invokeExecutePipeline(datastore, this).then(result => { const docs = result // Currently ignore any response from ExecutePipeline that does From 6a2abf337bb09d5d98261782b614aea141a72391 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:21:39 -0700 Subject: [PATCH 026/295] And/or overloads --- common/api-review/firestore-lite.api.md | 65 ++++--- common/api-review/firestore.api.md | 31 +++- packages/firestore/lite/index.ts | 14 +- packages/firestore/src/api/filter.ts | 2 - packages/firestore/src/core/pipeline-util.ts | 6 +- packages/firestore/src/lite-api/overloads.ts | 167 ++++++++++++++++++ .../src/remote/internal_serializer.ts | 4 +- .../test/integration/api/pipeline.test.ts | 3 +- 8 files changed, 256 insertions(+), 36 deletions(-) create mode 100644 packages/firestore/src/lite-api/overloads.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 00ed8776beb..6a75658c0d0 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -100,11 +100,15 @@ export class And extends FirestoreFunction implements FilterCondition { filterable: true; } +// @beta +export function and(left: FilterExpr, ...right: FilterExpr[]): And; + // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @beta -export function andExpression(left: FilterExpr, ...right: FilterExpr[]): And; +// @public (undocumented) +export namespace and { +} // @beta (undocumented) export class ArrayConcat extends FirestoreFunction { @@ -218,10 +222,10 @@ export class Avg extends FirestoreFunction implements Accumulator { } // @beta -export function avg(value: Constant): Avg; +export function avgFunction(value: Constant): Avg; // @beta -export function avg(value: string): Avg; +export function avgFunction(value: string): Avg; // @beta (undocumented) export class ByteLength extends FirestoreFunction { @@ -450,14 +454,6 @@ export function count(): AggregateField; // @beta export function countAll(): Count; -// @beta -export function countExpression(value: Constant): Count; - -// Warning: (ae-incompatible-release-tags) The symbol "countExpression" is marked as @public, but its signature references "Count" which is marked as @beta -// -// @public -export function countExpression(value: string): Count; - // @beta (undocumented) export class DatabaseSource implements Stage { // (undocumented) @@ -1531,9 +1527,16 @@ export class Or extends FirestoreFunction implements FilterCondition { filterable: true; } +// @beta +export function or(left: FilterExpr, ...right: FilterExpr[]): Or; + // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +// @public (undocumented) +export namespace or { +} + // @public export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; @@ -1545,9 +1548,6 @@ export class Ordering { constructor(expr: Constant, direction: 'ascending' | 'descending'); } -// @beta -export function orExpression(left: FilterExpr, ...right: FilterExpr[]): Or; - // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; @@ -1555,33 +1555,58 @@ export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T // @public export class Pipeline { + /* Excluded from this release type: _db */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(...groups: Array): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta execute(): Promise>>; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ genericStage(name: string, params: any[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ limit(limit: number): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ offset(offset: number): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(...selections: Array): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(...orderings: Ordering[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // (undocumented) sort(options: { orderings: Ordering[]; }): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta where(condition: FilterCondition & Constant): Pipeline; @@ -1925,10 +1950,10 @@ export class Sum extends FirestoreFunction implements Accumulator { export function sum(field: string | FieldPath): AggregateField; // @beta -export function sumExpression(value: Constant): Sum; +export function sumFunction(value: Constant): Sum; // @beta -export function sumExpression(value: string): Sum; +export function sumFunction(value: string): Sum; // @public export function terminate(firestore: Firestore): Promise; @@ -2178,8 +2203,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9261:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9262:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9291:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9237:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9267:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index a8aa8ce6e20..70b8664fa94 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1821,33 +1821,58 @@ export type PersistentTabManager = PersistentSingleTabManager | PersistentMultip // @public export class Pipeline { + /* Excluded from this release type: _db */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(...groups: Array): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta execute(): Promise>>; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ genericStage(name: string, params: any[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ limit(limit: number): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ offset(offset: number): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(...selections: Array): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(...orderings: Ordering[]): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // (undocumented) sort(options: { orderings: Ordering[]; }): Pipeline; + /* Excluded from this release type: userDataWriter */ + /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta where(condition: FilterCondition & Constant): Pipeline; @@ -2474,8 +2499,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10115:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10145:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10117:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10146:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index f4a3869a57f..6e30bdd4e0c 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -73,8 +73,6 @@ export { arrayLength, inAny, notInAny, - and as andExpression, - or as orExpression, xor, ifFunction, not, @@ -99,9 +97,6 @@ export { strConcat, mapGet, countAll, - count as countExpression, - sum as sumExpression, - avg, min, max, cosineDistance, @@ -192,7 +187,9 @@ export { SelectableExpr, Selectable, FilterCondition, - Accumulator + Accumulator, + sum as sumFunction, + avg as avgFunction } from '../src/lite-api/expressions'; export { @@ -243,6 +240,10 @@ export { export { and, + or, +} from '../src/lite-api/overloads'; + +export { endAt, endBefore, startAt, @@ -250,7 +251,6 @@ export { limit, limitToLast, where, - or, orderBy, query, QueryConstraint, diff --git a/packages/firestore/src/api/filter.ts b/packages/firestore/src/api/filter.ts index 035aca66aba..99906e31db8 100644 --- a/packages/firestore/src/api/filter.ts +++ b/packages/firestore/src/api/filter.ts @@ -16,14 +16,12 @@ */ export { - and, endAt, endBefore, startAfter, startAt, limitToLast, limit, - or, orderBy, OrderByDirection, where, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 228aee304c4..8a6ef9e17a7 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -13,14 +13,16 @@ // limitations under the License. import { - and, Constant, Expr, Field, FilterCondition, not, - or } from '../lite-api/expressions'; +import { + and, + or +} from '../lite-api/overloads'; import { isNanValue, isNullValue } from '../model/values'; import { ArrayValue as ProtoArrayValue, diff --git a/packages/firestore/src/lite-api/overloads.ts b/packages/firestore/src/lite-api/overloads.ts new file mode 100644 index 00000000000..53413007c60 --- /dev/null +++ b/packages/firestore/src/lite-api/overloads.ts @@ -0,0 +1,167 @@ +import { CompositeOperator } from '../core/filter'; + +import { + And as AndFunction, + FilterExpr, + Or as OrFunction +} from './expressions'; +import { + QueryCompositeFilterConstraint, + QueryConstraint, + QueryFilterConstraint, + validateQueryFilterConstraint +} from './query'; + +/** + * @beta + * + * Creates an expression that performs a logical 'OR' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR + * // the 'status' field is "active" + * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'OR' together. + * @return A new {@code Expr} representing the logical 'OR' operation. + */ +export function or(left: FilterExpr, ...right: FilterExpr[]): OrFunction; + +/** + * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of + * the given filter constraints. A disjunction filter includes a document if it + * satisfies any of the given filters. + * + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a disjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. + */ +export function or( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; + +export function or( + leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, + ...right: FilterExpr[] | QueryFilterConstraint[] +): OrFunction | QueryCompositeFilterConstraint { + if (leftFilterExprOrQueryConstraint === undefined) { + return or._orFilters(); + } + if ( + leftFilterExprOrQueryConstraint instanceof QueryConstraint || + leftFilterExprOrQueryConstraint === undefined + ) { + return or._orFilters( + leftFilterExprOrQueryConstraint, + ...(right as QueryFilterConstraint[]) + ); + } else { + return or._orFunction( + leftFilterExprOrQueryConstraint as FilterExpr, + ...(right as FilterExpr[]) + ); + } +} + +or._orFilters = function ( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint { + // Only support QueryFilterConstraints + queryConstraints.forEach(queryConstraint => + validateQueryFilterConstraint('or', queryConstraint) + ); + + return QueryCompositeFilterConstraint._create( + CompositeOperator.OR, + queryConstraints as QueryFilterConstraint[] + ); +}; + +or._orFunction = function ( + left: FilterExpr, + ...right: FilterExpr[] +): OrFunction { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); +}; + +/** + * @beta + * + * Creates an expression that performs a logical 'AND' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND + * // the 'status' field is "active" + * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'AND' together. + * @return A new {@code Expr} representing the logical 'AND' operation. + */ +export function and(left: FilterExpr, ...right: FilterExpr[]): AndFunction; + +/** + * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of + * the given filter constraints. A conjunction filter includes a document if it + * satisfies all of the given filters. + * + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a conjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. + */ +export function and( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; + +export function and( + leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, + ...right: FilterExpr[] | QueryFilterConstraint[] +): AndFunction | QueryCompositeFilterConstraint { + if (leftFilterExprOrQueryConstraint === undefined) { + return and._andFilters(); + } + if ( + leftFilterExprOrQueryConstraint instanceof QueryConstraint || + leftFilterExprOrQueryConstraint === undefined + ) { + return and._andFilters( + leftFilterExprOrQueryConstraint, + ...(right as QueryFilterConstraint[]) + ); + } else { + return and._andFunction( + leftFilterExprOrQueryConstraint as FilterExpr, + ...(right as FilterExpr[]) + ); + } +} + +and._andFilters = function ( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint { + // Only support QueryFilterConstraints + queryConstraints.forEach(queryConstraint => + validateQueryFilterConstraint('and', queryConstraint) + ); + + return QueryCompositeFilterConstraint._create( + CompositeOperator.AND, + queryConstraints as QueryFilterConstraint[] + ); +}; + +and._andFunction = function ( + left: FilterExpr, + ...right: FilterExpr[] +): AndFunction { + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); +}; diff --git a/packages/firestore/src/remote/internal_serializer.ts b/packages/firestore/src/remote/internal_serializer.ts index 628457ba81c..c0e688585ef 100644 --- a/packages/firestore/src/remote/internal_serializer.ts +++ b/packages/firestore/src/remote/internal_serializer.ts @@ -25,6 +25,7 @@ import { cast } from '../util/input_validation'; import { mapToArray } from '../util/obj'; import { toQueryTarget, toRunAggregationQueryRequest } from './serializer'; +import {getDatastore} from "../lite-api/components"; /** * @internal @@ -107,7 +108,8 @@ export function _internalPipelineToExecutePipelineRequestProto( ): any { const firestore = cast(pipeline._db, Firestore); const client = ensureFirestoreConfigured(firestore); - const serializer = client._onlineComponents?.datastore.serializer; + const datastore = getDatastore(firestore); + const serializer = datastore.serializer; if (serializer === undefined) { return null; } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 1c210067785..0fb1d1fa49c 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -794,7 +794,7 @@ apiDescribe.only('Pipelines', persistence => { ); }); - it('supports internal serialization to proto', async () => { + it.only('supports internal serialization to proto', async () => { const pipeline = firestore .pipeline() .collection('books') @@ -807,6 +807,7 @@ apiDescribe.only('Pipelines', persistence => { const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); expect(proto).not.to.be.null; + console.log(JSON.stringify(proto, null, 2)) }); // TODO(pipeline) support converter From 422cbd6d2fb46ecec88b515dd855a03da6f00a13 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Mon, 11 Nov 2024 21:33:12 +0000 Subject: [PATCH 027/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 6a75658c0d0..4d8f428ad06 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2203,8 +2203,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9237:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9267:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9237:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9267:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 70b8664fa94..720dd83d983 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2499,8 +2499,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10117:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10146:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10117:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10146:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From c78bae9e2ee506c9e7e309d2f7914e0d03e30d31 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 08:30:40 -0700 Subject: [PATCH 028/295] Fix and/or overloads --- .../src/lite-api/database_augmentation.ts | 10 +++++++ packages/firestore/src/lite-api/overloads.ts | 29 ++++++++++--------- .../test/integration/api/pipeline.test.ts | 2 +- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/firestore/src/lite-api/database_augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts index 7eb96e658c7..d1140260b20 100644 --- a/packages/firestore/src/lite-api/database_augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -6,6 +6,8 @@ import { PipelineSource } from './pipeline-source'; import { DocumentReference, Query } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { newUserDataReader } from './user_data_reader'; +import {or, and} from "./overloads"; +import {And, Avg, Expr, Field, FilterExpr, Or, Sum} from "./expressions"; export function useFirestorePipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { @@ -38,4 +40,12 @@ export function useFirestorePipelines(): void { return pipeline; }; + + and._andFunction = function(left: FilterExpr, ...right: FilterExpr[]): And { + return new And([left, ...right]); + } + + or._orFunction = function(left: FilterExpr, ...right: FilterExpr[]): Or { + return new Or([left, ...right]); + } } diff --git a/packages/firestore/src/lite-api/overloads.ts b/packages/firestore/src/lite-api/overloads.ts index 53413007c60..c17ea7ee46a 100644 --- a/packages/firestore/src/lite-api/overloads.ts +++ b/packages/firestore/src/lite-api/overloads.ts @@ -1,16 +1,20 @@ import { CompositeOperator } from '../core/filter'; import { - And as AndFunction, + And, Avg, Expr, Field, FilterExpr, - Or as OrFunction + Or, Sum } from './expressions'; + import { QueryCompositeFilterConstraint, QueryConstraint, QueryFilterConstraint, validateQueryFilterConstraint } from './query'; +import {FieldPath} from "./field_path"; +import {AggregateField} from "./aggregate_types"; +import {fieldPathFromArgument} from "./user_data_reader"; /** * @beta @@ -27,7 +31,7 @@ import { * @param right Additional filter conditions to 'OR' together. * @return A new {@code Expr} representing the logical 'OR' operation. */ -export function or(left: FilterExpr, ...right: FilterExpr[]): OrFunction; +export function or(left: FilterExpr, ...right: FilterExpr[]): Or; /** * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of @@ -46,12 +50,13 @@ export function or( export function or( leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, ...right: FilterExpr[] | QueryFilterConstraint[] -): OrFunction | QueryCompositeFilterConstraint { +): Or | QueryCompositeFilterConstraint { if (leftFilterExprOrQueryConstraint === undefined) { return or._orFilters(); } - if ( + else if ( leftFilterExprOrQueryConstraint instanceof QueryConstraint || + leftFilterExprOrQueryConstraint instanceof QueryCompositeFilterConstraint || leftFilterExprOrQueryConstraint === undefined ) { return or._orFilters( @@ -59,10 +64,8 @@ export function or( ...(right as QueryFilterConstraint[]) ); } else { - return or._orFunction( - leftFilterExprOrQueryConstraint as FilterExpr, - ...(right as FilterExpr[]) - ); + // @ts-ignore + return or._orFunction(leftFilterExprOrQueryConstraint, ...(right)); } } @@ -83,7 +86,7 @@ or._orFilters = function ( or._orFunction = function ( left: FilterExpr, ...right: FilterExpr[] -): OrFunction { +): Or { throw new Error( 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' ); @@ -104,7 +107,7 @@ or._orFunction = function ( * @param right Additional filter conditions to 'AND' together. * @return A new {@code Expr} representing the logical 'AND' operation. */ -export function and(left: FilterExpr, ...right: FilterExpr[]): AndFunction; +export function and(left: FilterExpr, ...right: FilterExpr[]): And; /** * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of @@ -123,7 +126,7 @@ export function and( export function and( leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, ...right: FilterExpr[] | QueryFilterConstraint[] -): AndFunction | QueryCompositeFilterConstraint { +): And | QueryCompositeFilterConstraint { if (leftFilterExprOrQueryConstraint === undefined) { return and._andFilters(); } @@ -160,7 +163,7 @@ and._andFilters = function ( and._andFunction = function ( left: FilterExpr, ...right: FilterExpr[] -): AndFunction { +): And { throw new Error( 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' ); diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 0fb1d1fa49c..57a5121ed37 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -794,7 +794,7 @@ apiDescribe.only('Pipelines', persistence => { ); }); - it.only('supports internal serialization to proto', async () => { + it('supports internal serialization to proto', async () => { const pipeline = firestore .pipeline() .collection('books') From bcfaf2a16857071da6639d04781de4d75be92bc8 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:24:51 -0700 Subject: [PATCH 029/295] Modular-style pipeline and execute methods for experimentation. Plus cleanup. --- common/api-review/firestore-lite.api.md | 17 ++++- common/api-review/firestore.api.md | 65 ++++++++----------- packages/firestore/lite/index.ts | 9 ++- packages/firestore/src/api.ts | 4 +- packages/firestore/src/api/pipeline.ts | 21 +++++- packages/firestore/src/core/pipeline-util.ts | 7 +- .../src/lite-api/database_augmentation.ts | 12 ++-- packages/firestore/src/lite-api/overloads.ts | 25 ++----- packages/firestore/src/lite-api/pipeline.ts | 21 +++++- .../firestore/src/lite-api/pipeline_impl.ts | 13 ++++ .../src/remote/internal_serializer.ts | 4 +- .../test/integration/api/pipeline.test.ts | 47 +++++++++++++- 12 files changed, 162 insertions(+), 83 deletions(-) create mode 100644 packages/firestore/src/lite-api/pipeline_impl.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 4d8f428ad06..3acb768aa40 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -639,6 +639,9 @@ export function euclideanDistance(expr: Constant, other: VectorValue): Euclidean // @beta export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; +// @beta +export function execute(pipeline: Pipeline): Promise>>; + // @beta (undocumented) export class Exists extends FirestoreFunction implements FilterCondition { constructor(expr: Constant); @@ -1612,6 +1615,14 @@ export class Pipeline { where(condition: FilterCondition & Constant): Pipeline; } +// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta +// +// @public +export function pipeline(firestore: Firestore): PipelineSource; + +// @public +export function pipeline(query: Query): Pipeline; + // @beta export class PipelineResult { /* Excluded from this release type: _ref */ @@ -2203,8 +2214,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9237:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9267:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 720dd83d983..5f17b27219f 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -686,6 +686,9 @@ export function euclideanDistance(expr: Constant, other: VectorValue): Euclidean // @beta export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; +// @beta +export function execute(pipeline: Pipeline): Promise>>; + // @beta (undocumented) export class Exists extends FirestoreFunction implements FilterCondition { constructor(expr: Constant); @@ -1819,65 +1822,53 @@ export interface PersistentSingleTabManagerSettings { // @public export type PersistentTabManager = PersistentSingleTabManager | PersistentMultipleTabManager; -// @public +// @public (undocumented) export class Pipeline { - /* Excluded from this release type: _db */ + /* Excluded from this release type: __constructor */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta aggregate(...accumulators: AccumulatorTarget[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ - aggregate(options: { - accumulators: AccumulatorTarget[]; - groups?: Array; - }): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + // (undocumented) + converter: any; // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(...groups: Array): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta execute(): Promise>>; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ genericStage(name: string, params: any[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ limit(limit: number): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ offset(offset: number): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + readUserData: any; // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(...selections: Array): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + // (undocumented) + selectablesToMap: any; // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(...orderings: Ordering[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ - // (undocumented) - sort(options: { - orderings: Ordering[]; - }): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + // (undocumented) + sort(options: { orderings: Ordering[]; }): Pipeline; + // (undocumented) + stages: any; + // (undocumented) + userDataReader: any; // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta where(condition: FilterCondition & Constant): Pipeline; } +// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta +// +// @public +export function pipeline(firestore: Firestore): PipelineSource; + +// @public +export function pipeline(query: Query): Pipeline; + // @beta export class PipelineResult { /* Excluded from this release type: _ref */ @@ -2499,8 +2490,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10116:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10117:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10146:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index 6e30bdd4e0c..7bd1b2ce3db 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -31,10 +31,12 @@ export { PipelineSource } from '../src/lite-api/pipeline-source'; export { PipelineResult } from '../src/lite-api/pipeline-result'; -export { Pipeline } from '../src/lite-api/pipeline'; +export { Pipeline, pipeline } from '../src/lite-api/pipeline'; export { useFirestorePipelines } from '../src/lite-api/database_augmentation'; +export { execute } from '../src/lite-api/pipeline_impl'; + export { Stage, FindNearestOptions, @@ -238,10 +240,7 @@ export { queryEqual } from '../src/lite-api/reference'; -export { - and, - or, -} from '../src/lite-api/overloads'; +export { and, or } from '../src/lite-api/overloads'; export { endAt, diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 73b725f184b..9b77311666b 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -19,10 +19,12 @@ export { PipelineSource } from './lite-api/pipeline-source'; export { PipelineResult } from './lite-api/pipeline-result'; -export { Pipeline } from './lite-api/pipeline'; +export { Pipeline, pipeline } from './api/pipeline'; export { useFirestorePipelines } from './api/database_augmentation'; +export { execute } from './lite-api/pipeline_impl'; + export { Stage, FindNearestOptions, diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index 9aeccae9ad0..3122fc36412 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -1,7 +1,8 @@ import { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult } from '../lite-api/pipeline-result'; -import { DocumentData, DocumentReference } from '../lite-api/reference'; +import { PipelineSource } from '../lite-api/pipeline-source'; +import { DocumentData, DocumentReference, Query } from '../lite-api/reference'; import { Stage } from '../lite-api/stage'; import { UserDataReader } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; @@ -97,3 +98,21 @@ export class Pipeline< }); } } + +/** + * Experimental Modular API for console testing. + * @param firestore + */ +export function pipeline(firestore: Firestore): PipelineSource; + +/** + * Experimental Modular API for console testing. + * @param query + */ +export function pipeline(query: Query): Pipeline; + +export function pipeline( + firestoreOrQuery: Firestore | Query +): PipelineSource | Pipeline { + return firestoreOrQuery.pipeline(); +} diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 8a6ef9e17a7..49704e06381 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -17,12 +17,9 @@ import { Expr, Field, FilterCondition, - not, + not } from '../lite-api/expressions'; -import { - and, - or -} from '../lite-api/overloads'; +import { and, or } from '../lite-api/overloads'; import { isNanValue, isNullValue } from '../model/values'; import { ArrayValue as ProtoArrayValue, diff --git a/packages/firestore/src/lite-api/database_augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts index d1140260b20..cce1214138a 100644 --- a/packages/firestore/src/lite-api/database_augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -1,13 +1,13 @@ import { DocumentKey } from '../model/document_key'; import { Firestore } from './database'; +import { And, FilterExpr, Or } from './expressions'; +import { or, and } from './overloads'; import { Pipeline } from './pipeline'; import { PipelineSource } from './pipeline-source'; import { DocumentReference, Query } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { newUserDataReader } from './user_data_reader'; -import {or, and} from "./overloads"; -import {And, Avg, Expr, Field, FilterExpr, Or, Sum} from "./expressions"; export function useFirestorePipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { @@ -41,11 +41,11 @@ export function useFirestorePipelines(): void { return pipeline; }; - and._andFunction = function(left: FilterExpr, ...right: FilterExpr[]): And { + and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { return new And([left, ...right]); - } + }; - or._orFunction = function(left: FilterExpr, ...right: FilterExpr[]): Or { + or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { return new Or([left, ...right]); - } + }; } diff --git a/packages/firestore/src/lite-api/overloads.ts b/packages/firestore/src/lite-api/overloads.ts index c17ea7ee46a..2b3675db521 100644 --- a/packages/firestore/src/lite-api/overloads.ts +++ b/packages/firestore/src/lite-api/overloads.ts @@ -1,20 +1,12 @@ import { CompositeOperator } from '../core/filter'; -import { - And, Avg, Expr, Field, - FilterExpr, - Or, Sum -} from './expressions'; - +import { And, FilterExpr, Or } from './expressions'; import { QueryCompositeFilterConstraint, QueryConstraint, QueryFilterConstraint, validateQueryFilterConstraint } from './query'; -import {FieldPath} from "./field_path"; -import {AggregateField} from "./aggregate_types"; -import {fieldPathFromArgument} from "./user_data_reader"; /** * @beta @@ -53,8 +45,7 @@ export function or( ): Or | QueryCompositeFilterConstraint { if (leftFilterExprOrQueryConstraint === undefined) { return or._orFilters(); - } - else if ( + } else if ( leftFilterExprOrQueryConstraint instanceof QueryConstraint || leftFilterExprOrQueryConstraint instanceof QueryCompositeFilterConstraint || leftFilterExprOrQueryConstraint === undefined @@ -65,7 +56,7 @@ export function or( ); } else { // @ts-ignore - return or._orFunction(leftFilterExprOrQueryConstraint, ...(right)); + return or._orFunction(leftFilterExprOrQueryConstraint, ...right); } } @@ -83,10 +74,7 @@ or._orFilters = function ( ); }; -or._orFunction = function ( - left: FilterExpr, - ...right: FilterExpr[] -): Or { +or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { throw new Error( 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' ); @@ -160,10 +148,7 @@ and._andFilters = function ( ); }; -and._andFunction = function ( - left: FilterExpr, - ...right: FilterExpr[] -): And { +and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { throw new Error( 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' ); diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 41a3b4590d8..5b9c061c1b9 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -42,7 +42,8 @@ import { Selectable } from './expressions'; import { PipelineResult } from './pipeline-result'; -import { DocumentData, DocumentReference } from './reference'; +import { PipelineSource } from './pipeline-source'; +import { DocumentData, DocumentReference, Query } from './reference'; import { AddFields, Aggregate, @@ -829,3 +830,21 @@ export class Pipeline }; } } + +/** + * Experimental Modular API for console testing. + * @param firestore + */ +export function pipeline(firestore: Firestore): PipelineSource; + +/** + * Experimental Modular API for console testing. + * @param query + */ +export function pipeline(query: Query): Pipeline; + +export function pipeline( + firestoreOrQuery: Firestore | Query +): PipelineSource | Pipeline { + return firestoreOrQuery.pipeline(); +} diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts new file mode 100644 index 00000000000..30ccc04cbd4 --- /dev/null +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -0,0 +1,13 @@ +import { Pipeline } from './pipeline'; +import { PipelineResult } from './pipeline-result'; + +/** + * Modular API for console experimentation. + * @param pipeline Execute this pipeline. + * @beta + */ +export function execute( + pipeline: Pipeline +): Promise>> { + return pipeline.execute(); +} diff --git a/packages/firestore/src/remote/internal_serializer.ts b/packages/firestore/src/remote/internal_serializer.ts index c0e688585ef..dafdea85efc 100644 --- a/packages/firestore/src/remote/internal_serializer.ts +++ b/packages/firestore/src/remote/internal_serializer.ts @@ -19,13 +19,13 @@ import { ensureFirestoreConfigured, Firestore } from '../api/database'; import { AggregateImpl } from '../core/aggregate'; import { queryToAggregateTarget, queryToTarget } from '../core/query'; import { AggregateSpec } from '../lite-api/aggregate_types'; +import { getDatastore } from '../lite-api/components'; import { Pipeline } from '../lite-api/pipeline'; import { Query } from '../lite-api/reference'; import { cast } from '../util/input_validation'; import { mapToArray } from '../util/obj'; import { toQueryTarget, toRunAggregationQueryRequest } from './serializer'; -import {getDatastore} from "../lite-api/components"; /** * @internal @@ -105,9 +105,9 @@ export function _internalAggregationQueryToProtoRunAggregationQueryRequest< // eslint-disable-next-line @typescript-eslint/no-explicit-any export function _internalPipelineToExecutePipelineRequestProto( pipeline: Pipeline + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): any { const firestore = cast(pipeline._db, Firestore); - const client = ensureFirestoreConfigured(firestore); const datastore = getDatastore(firestore); const serializer = datastore.serializer; if (serializer === undefined) { diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 57a5121ed37..aa68528d124 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -15,6 +15,8 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import { pipeline } from '../../../src/api/pipeline'; +import { execute } from '../../../src/lite-api/pipeline_impl'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { @@ -57,7 +59,7 @@ import { apiDescribe, withTestCollection } from '../util/helpers'; use(chaiAsPromised); useFirestorePipelines(); -apiDescribe.only('Pipelines', persistence => { +apiDescribe('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; let randomCol: CollectionReference; @@ -807,7 +809,6 @@ apiDescribe.only('Pipelines', persistence => { const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); expect(proto).not.to.be.null; - console.log(JSON.stringify(proto, null, 2)) }); // TODO(pipeline) support converter @@ -843,4 +844,46 @@ apiDescribe.only('Pipelines', persistence => { // myTitle: 'Crime and Punishment', // }); // }); + describe('modular API', () => { + it('works when creating a pipeline from a Firestore instance', async () => { + const myPipeline = pipeline(firestore) + .collection(randomCol.path) + .where(lt(Field.of('published'), 1984)) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()); + + const results = await execute(myPipeline); + + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + + it('works when creating a pipeline from a collection', async () => { + const myPipeline = pipeline(randomCol) + .where(lt(Field.of('published'), 1984)) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()); + + const results = await execute(myPipeline); + + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + }); }); From 5425705e3af8e0eee8ecf1b982e6a2f7a59b59cc Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Wed, 13 Nov 2024 20:40:35 +0000 Subject: [PATCH 030/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 3acb768aa40..1d32a0b466a 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2214,8 +2214,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 5f17b27219f..bafcf704778 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2490,8 +2490,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From edc1ea5276575279dea4967818538d5a4e67939e Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:08:07 -0700 Subject: [PATCH 031/295] Docgen --- docs-devsite/_toc.yaml | 483 +- docs-devsite/firestore_.accumulator.md | 39 + docs-devsite/firestore_.add.md | 49 + docs-devsite/firestore_.addfields.md | 64 + docs-devsite/firestore_.aggregate.md | 65 + docs-devsite/firestore_.and.md | 17 + docs-devsite/firestore_.arrayconcat.md | 49 + docs-devsite/firestore_.arraycontains.md | 67 + docs-devsite/firestore_.arraycontainsall.md | 67 + docs-devsite/firestore_.arraycontainsany.md | 67 + docs-devsite/firestore_.arrayelement.md | 41 + docs-devsite/firestore_.arraylength.md | 48 + docs-devsite/firestore_.arrayreverse.md | 48 + docs-devsite/firestore_.avg.md | 67 + docs-devsite/firestore_.bytelength.md | 48 + docs-devsite/firestore_.charlength.md | 48 + .../firestore_.collectiongroupsource.md | 64 + docs-devsite/firestore_.collectionsource.md | 64 + docs-devsite/firestore_.constant.md | 3504 +++++++ docs-devsite/firestore_.cosinedistance.md | 49 + docs-devsite/firestore_.count.md | 67 + docs-devsite/firestore_.databasesource.md | 39 + docs-devsite/firestore_.distinct.md | 64 + docs-devsite/firestore_.divide.md | 49 + docs-devsite/firestore_.documentssource.md | 92 + docs-devsite/firestore_.dotproduct.md | 49 + docs-devsite/firestore_.endswith.md | 67 + docs-devsite/firestore_.eq.md | 67 + docs-devsite/firestore_.euclideandistance.md | 49 + docs-devsite/firestore_.exists.md | 66 + docs-devsite/firestore_.exprwithalias.md | 3207 ++++++ docs-devsite/firestore_.field.md | 3275 ++++++ docs-devsite/firestore_.fields.md | 3210 ++++++ docs-devsite/firestore_.filtercondition.md | 39 + docs-devsite/firestore_.findnearest.md | 39 + docs-devsite/firestore_.findnearestoptions.md | 86 + docs-devsite/firestore_.firestore.md | 14 + docs-devsite/firestore_.firestorefunction.md | 3173 ++++++ docs-devsite/firestore_.genericstage.md | 65 + docs-devsite/firestore_.gt.md | 67 + docs-devsite/firestore_.gte.md | 67 + docs-devsite/firestore_.if.md | 68 + docs-devsite/firestore_.in.md | 67 + docs-devsite/firestore_.isnan.md | 66 + docs-devsite/firestore_.like.md | 67 + docs-devsite/firestore_.limit.md | 64 + docs-devsite/firestore_.logicalmax.md | 49 + docs-devsite/firestore_.logicalmin.md | 49 + docs-devsite/firestore_.lt.md | 67 + docs-devsite/firestore_.lte.md | 67 + docs-devsite/firestore_.mapget.md | 49 + docs-devsite/firestore_.max.md | 67 + docs-devsite/firestore_.md | 8966 +++++++++++++++-- docs-devsite/firestore_.min.md | 67 + docs-devsite/firestore_.mod.md | 49 + docs-devsite/firestore_.multiply.md | 49 + docs-devsite/firestore_.neq.md | 67 + docs-devsite/firestore_.not.md | 66 + docs-devsite/firestore_.offset.md | 64 + docs-devsite/firestore_.or.md | 17 + docs-devsite/firestore_.ordering.md | 51 + docs-devsite/firestore_.pipeline.md | 609 ++ docs-devsite/firestore_.pipelineresult.md | 184 + docs-devsite/firestore_.pipelinesource.md | 109 + docs-devsite/firestore_.query.md | 14 + ...restore_.querycompositefilterconstraint.md | 2 +- docs-devsite/firestore_.regexcontains.md | 67 + docs-devsite/firestore_.regexmatch.md | 67 + docs-devsite/firestore_.replaceall.md | 50 + docs-devsite/firestore_.replacefirst.md | 50 + docs-devsite/firestore_.reverse.md | 48 + docs-devsite/firestore_.select.md | 64 + docs-devsite/firestore_.selectable.md | 39 + docs-devsite/firestore_.sort.md | 64 + docs-devsite/firestore_.stage.md | 38 + docs-devsite/firestore_.startswith.md | 67 + docs-devsite/firestore_.strconcat.md | 49 + docs-devsite/firestore_.strcontains.md | 67 + docs-devsite/firestore_.subtract.md | 49 + docs-devsite/firestore_.sum.md | 67 + docs-devsite/firestore_.timestampadd.md | 50 + docs-devsite/firestore_.timestampsub.md | 50 + .../firestore_.timestamptounixmicros.md | 48 + .../firestore_.timestamptounixmillis.md | 48 + .../firestore_.timestamptounixseconds.md | 48 + docs-devsite/firestore_.tolower.md | 48 + docs-devsite/firestore_.toupper.md | 48 + docs-devsite/firestore_.trim.md | 48 + .../firestore_.unixmicrostotimestamp.md | 48 + .../firestore_.unixmillistotimestamp.md | 48 + .../firestore_.unixsecondstotimestamp.md | 48 + docs-devsite/firestore_.vectorlength.md | 48 + docs-devsite/firestore_.where.md | 64 + docs-devsite/firestore_.xor.md | 66 + docs-devsite/firestore_lite.accumulator.md | 39 + docs-devsite/firestore_lite.add.md | 49 + docs-devsite/firestore_lite.addfields.md | 64 + docs-devsite/firestore_lite.aggregate.md | 65 + docs-devsite/firestore_lite.and.md | 17 + docs-devsite/firestore_lite.arrayconcat.md | 49 + docs-devsite/firestore_lite.arraycontains.md | 67 + .../firestore_lite.arraycontainsall.md | 67 + .../firestore_lite.arraycontainsany.md | 67 + docs-devsite/firestore_lite.arrayelement.md | 41 + docs-devsite/firestore_lite.arraylength.md | 48 + docs-devsite/firestore_lite.arrayreverse.md | 48 + docs-devsite/firestore_lite.avg.md | 67 + docs-devsite/firestore_lite.bytelength.md | 48 + docs-devsite/firestore_lite.charlength.md | 48 + .../firestore_lite.collectiongroupsource.md | 64 + .../firestore_lite.collectionsource.md | 64 + docs-devsite/firestore_lite.constant.md | 3504 +++++++ docs-devsite/firestore_lite.cosinedistance.md | 49 + docs-devsite/firestore_lite.count.md | 67 + docs-devsite/firestore_lite.databasesource.md | 39 + docs-devsite/firestore_lite.distinct.md | 64 + docs-devsite/firestore_lite.divide.md | 49 + .../firestore_lite.documentssource.md | 92 + docs-devsite/firestore_lite.dotproduct.md | 49 + docs-devsite/firestore_lite.endswith.md | 67 + docs-devsite/firestore_lite.eq.md | 67 + .../firestore_lite.euclideandistance.md | 49 + docs-devsite/firestore_lite.exists.md | 66 + docs-devsite/firestore_lite.exprwithalias.md | 3207 ++++++ docs-devsite/firestore_lite.field.md | 3275 ++++++ docs-devsite/firestore_lite.fields.md | 3210 ++++++ .../firestore_lite.filtercondition.md | 39 + docs-devsite/firestore_lite.findnearest.md | 39 + .../firestore_lite.findnearestoptions.md | 86 + docs-devsite/firestore_lite.firestore.md | 14 + .../firestore_lite.firestorefunction.md | 3173 ++++++ docs-devsite/firestore_lite.genericstage.md | 65 + docs-devsite/firestore_lite.gt.md | 67 + docs-devsite/firestore_lite.gte.md | 67 + docs-devsite/firestore_lite.if.md | 68 + docs-devsite/firestore_lite.in.md | 67 + docs-devsite/firestore_lite.isnan.md | 66 + docs-devsite/firestore_lite.like.md | 67 + docs-devsite/firestore_lite.limit.md | 64 + docs-devsite/firestore_lite.logicalmax.md | 49 + docs-devsite/firestore_lite.logicalmin.md | 49 + docs-devsite/firestore_lite.lt.md | 67 + docs-devsite/firestore_lite.lte.md | 67 + docs-devsite/firestore_lite.mapget.md | 49 + docs-devsite/firestore_lite.max.md | 67 + docs-devsite/firestore_lite.md | 8123 ++++++++++++++- docs-devsite/firestore_lite.min.md | 67 + docs-devsite/firestore_lite.mod.md | 49 + docs-devsite/firestore_lite.multiply.md | 49 + docs-devsite/firestore_lite.neq.md | 67 + docs-devsite/firestore_lite.not.md | 66 + docs-devsite/firestore_lite.offset.md | 64 + docs-devsite/firestore_lite.or.md | 17 + docs-devsite/firestore_lite.ordering.md | 51 + docs-devsite/firestore_lite.pipeline.md | 564 ++ docs-devsite/firestore_lite.pipelineresult.md | 184 + docs-devsite/firestore_lite.pipelinesource.md | 109 + docs-devsite/firestore_lite.query.md | 14 + ...ore_lite.querycompositefilterconstraint.md | 2 +- docs-devsite/firestore_lite.regexcontains.md | 67 + docs-devsite/firestore_lite.regexmatch.md | 67 + docs-devsite/firestore_lite.replaceall.md | 50 + docs-devsite/firestore_lite.replacefirst.md | 50 + docs-devsite/firestore_lite.reverse.md | 48 + docs-devsite/firestore_lite.select.md | 64 + docs-devsite/firestore_lite.selectable.md | 39 + docs-devsite/firestore_lite.sort.md | 64 + docs-devsite/firestore_lite.stage.md | 38 + docs-devsite/firestore_lite.startswith.md | 67 + docs-devsite/firestore_lite.strconcat.md | 49 + docs-devsite/firestore_lite.strcontains.md | 67 + docs-devsite/firestore_lite.subtract.md | 49 + docs-devsite/firestore_lite.sum.md | 67 + docs-devsite/firestore_lite.timestampadd.md | 50 + docs-devsite/firestore_lite.timestampsub.md | 50 + .../firestore_lite.timestamptounixmicros.md | 48 + .../firestore_lite.timestamptounixmillis.md | 48 + .../firestore_lite.timestamptounixseconds.md | 48 + docs-devsite/firestore_lite.tolower.md | 48 + docs-devsite/firestore_lite.toupper.md | 48 + docs-devsite/firestore_lite.trim.md | 48 + .../firestore_lite.unixmicrostotimestamp.md | 48 + .../firestore_lite.unixmillistotimestamp.md | 48 + .../firestore_lite.unixsecondstotimestamp.md | 48 + docs-devsite/firestore_lite.vectorlength.md | 48 + docs-devsite/firestore_lite.where.md | 64 + docs-devsite/firestore_lite.xor.md | 66 + docs-devsite/index.md | 2 +- ...rams.md => vertexai-preview.baseparams.md} | 4 +- docs-devsite/vertexai-preview.chatsession.md | 138 + ...tation.md => vertexai-preview.citation.md} | 12 +- ...d => vertexai-preview.citationmetadata.md} | 4 +- ...content.md => vertexai-preview.content.md} | 4 +- ...=> vertexai-preview.counttokensrequest.md} | 4 +- ...> vertexai-preview.counttokensresponse.md} | 6 +- ...md => vertexai-preview.customerrordata.md} | 10 +- ...i.date_2.md => vertexai-preview.date_2.md} | 6 +- ...review.enhancedgeneratecontentresponse.md} | 6 +- ...ls.md => vertexai-preview.errordetails.md} | 8 +- ...ledata.md => vertexai-preview.filedata.md} | 4 +- ...rt.md => vertexai-preview.filedatapart.md} | 12 +- ...ll.md => vertexai-preview.functioncall.md} | 6 +- ...vertexai-preview.functioncallingconfig.md} | 4 +- ...d => vertexai-preview.functioncallpart.md} | 10 +- ...> vertexai-preview.functiondeclaration.md} | 12 +- ...texai-preview.functiondeclarationschema.md | 70 + ...eview.functiondeclarationschemaproperty.md | 125 + ...rtexai-preview.functiondeclarationstool.md | 35 + ...d => vertexai-preview.functionresponse.md} | 6 +- ... vertexai-preview.functionresponsepart.md} | 10 +- ...rtexai-preview.generatecontentcandidate.md | 87 + ...ertexai-preview.generatecontentrequest.md} | 12 +- ...rtexai-preview.generatecontentresponse.md} | 8 +- ...vertexai-preview.generatecontentresult.md} | 4 +- ...ai-preview.generatecontentstreamresult.md} | 6 +- .../vertexai-preview.generationconfig.md | 107 + ...vertexai-preview.generativecontentblob.md} | 4 +- .../vertexai-preview.generativemodel.md | 201 + ... vertexai-preview.groundingattribution.md} | 8 +- ... => vertexai-preview.groundingmetadata.md} | 6 +- ....md => vertexai-preview.inlinedatapart.md} | 10 +- docs-devsite/vertexai-preview.md | 397 + ...ams.md => vertexai-preview.modelparams.md} | 12 +- ....md => vertexai-preview.promptfeedback.md} | 8 +- ....md => vertexai-preview.requestoptions.md} | 10 +- ...ai-preview.retrievedcontextattribution.md} | 4 +- ...ng.md => vertexai-preview.safetyrating.md} | 14 +- ...g.md => vertexai-preview.safetysetting.md} | 8 +- ...segment.md => vertexai-preview.segment.md} | 6 +- ...md => vertexai-preview.startchatparams.md} | 12 +- ...xtpart.md => vertexai-preview.textpart.md} | 8 +- ...nfig.md => vertexai-preview.toolconfig.md} | 4 +- ...a.md => vertexai-preview.usagemetadata.md} | 8 +- ...rtexai.md => vertexai-preview.vertexai.md} | 8 +- ...r.md => vertexai-preview.vertexaierror.md} | 21 +- ...md => vertexai-preview.vertexaioptions.md} | 4 +- ...a.md => vertexai-preview.videometadata.md} | 4 +- ....md => vertexai-preview.webattribution.md} | 4 +- docs-devsite/vertexai.arrayschema.md | 57 - docs-devsite/vertexai.booleanschema.md | 43 - docs-devsite/vertexai.chatsession.md | 138 - .../vertexai.functiondeclarationstool.md | 35 - .../vertexai.generatecontentcandidate.md | 87 - docs-devsite/vertexai.generationconfig.md | 118 - docs-devsite/vertexai.generativemodel.md | 201 - docs-devsite/vertexai.integerschema.md | 43 - docs-devsite/vertexai.md | 412 - docs-devsite/vertexai.numberschema.md | 43 - docs-devsite/vertexai.objectschema.md | 71 - .../vertexai.objectschemainterface.md | 43 - docs-devsite/vertexai.schema.md | 250 - docs-devsite/vertexai.schemainterface.md | 36 - docs-devsite/vertexai.schemaparams.md | 21 - docs-devsite/vertexai.schemarequest.md | 47 - docs-devsite/vertexai.schemashared.md | 103 - docs-devsite/vertexai.stringschema.md | 57 - 256 files changed, 60953 insertions(+), 3542 deletions(-) create mode 100644 docs-devsite/firestore_.accumulator.md create mode 100644 docs-devsite/firestore_.add.md create mode 100644 docs-devsite/firestore_.addfields.md create mode 100644 docs-devsite/firestore_.aggregate.md create mode 100644 docs-devsite/firestore_.and.md create mode 100644 docs-devsite/firestore_.arrayconcat.md create mode 100644 docs-devsite/firestore_.arraycontains.md create mode 100644 docs-devsite/firestore_.arraycontainsall.md create mode 100644 docs-devsite/firestore_.arraycontainsany.md create mode 100644 docs-devsite/firestore_.arrayelement.md create mode 100644 docs-devsite/firestore_.arraylength.md create mode 100644 docs-devsite/firestore_.arrayreverse.md create mode 100644 docs-devsite/firestore_.avg.md create mode 100644 docs-devsite/firestore_.bytelength.md create mode 100644 docs-devsite/firestore_.charlength.md create mode 100644 docs-devsite/firestore_.collectiongroupsource.md create mode 100644 docs-devsite/firestore_.collectionsource.md create mode 100644 docs-devsite/firestore_.constant.md create mode 100644 docs-devsite/firestore_.cosinedistance.md create mode 100644 docs-devsite/firestore_.count.md create mode 100644 docs-devsite/firestore_.databasesource.md create mode 100644 docs-devsite/firestore_.distinct.md create mode 100644 docs-devsite/firestore_.divide.md create mode 100644 docs-devsite/firestore_.documentssource.md create mode 100644 docs-devsite/firestore_.dotproduct.md create mode 100644 docs-devsite/firestore_.endswith.md create mode 100644 docs-devsite/firestore_.eq.md create mode 100644 docs-devsite/firestore_.euclideandistance.md create mode 100644 docs-devsite/firestore_.exists.md create mode 100644 docs-devsite/firestore_.exprwithalias.md create mode 100644 docs-devsite/firestore_.field.md create mode 100644 docs-devsite/firestore_.fields.md create mode 100644 docs-devsite/firestore_.filtercondition.md create mode 100644 docs-devsite/firestore_.findnearest.md create mode 100644 docs-devsite/firestore_.findnearestoptions.md create mode 100644 docs-devsite/firestore_.firestorefunction.md create mode 100644 docs-devsite/firestore_.genericstage.md create mode 100644 docs-devsite/firestore_.gt.md create mode 100644 docs-devsite/firestore_.gte.md create mode 100644 docs-devsite/firestore_.if.md create mode 100644 docs-devsite/firestore_.in.md create mode 100644 docs-devsite/firestore_.isnan.md create mode 100644 docs-devsite/firestore_.like.md create mode 100644 docs-devsite/firestore_.limit.md create mode 100644 docs-devsite/firestore_.logicalmax.md create mode 100644 docs-devsite/firestore_.logicalmin.md create mode 100644 docs-devsite/firestore_.lt.md create mode 100644 docs-devsite/firestore_.lte.md create mode 100644 docs-devsite/firestore_.mapget.md create mode 100644 docs-devsite/firestore_.max.md create mode 100644 docs-devsite/firestore_.min.md create mode 100644 docs-devsite/firestore_.mod.md create mode 100644 docs-devsite/firestore_.multiply.md create mode 100644 docs-devsite/firestore_.neq.md create mode 100644 docs-devsite/firestore_.not.md create mode 100644 docs-devsite/firestore_.offset.md create mode 100644 docs-devsite/firestore_.or.md create mode 100644 docs-devsite/firestore_.ordering.md create mode 100644 docs-devsite/firestore_.pipeline.md create mode 100644 docs-devsite/firestore_.pipelineresult.md create mode 100644 docs-devsite/firestore_.pipelinesource.md create mode 100644 docs-devsite/firestore_.regexcontains.md create mode 100644 docs-devsite/firestore_.regexmatch.md create mode 100644 docs-devsite/firestore_.replaceall.md create mode 100644 docs-devsite/firestore_.replacefirst.md create mode 100644 docs-devsite/firestore_.reverse.md create mode 100644 docs-devsite/firestore_.select.md create mode 100644 docs-devsite/firestore_.selectable.md create mode 100644 docs-devsite/firestore_.sort.md create mode 100644 docs-devsite/firestore_.stage.md create mode 100644 docs-devsite/firestore_.startswith.md create mode 100644 docs-devsite/firestore_.strconcat.md create mode 100644 docs-devsite/firestore_.strcontains.md create mode 100644 docs-devsite/firestore_.subtract.md create mode 100644 docs-devsite/firestore_.sum.md create mode 100644 docs-devsite/firestore_.timestampadd.md create mode 100644 docs-devsite/firestore_.timestampsub.md create mode 100644 docs-devsite/firestore_.timestamptounixmicros.md create mode 100644 docs-devsite/firestore_.timestamptounixmillis.md create mode 100644 docs-devsite/firestore_.timestamptounixseconds.md create mode 100644 docs-devsite/firestore_.tolower.md create mode 100644 docs-devsite/firestore_.toupper.md create mode 100644 docs-devsite/firestore_.trim.md create mode 100644 docs-devsite/firestore_.unixmicrostotimestamp.md create mode 100644 docs-devsite/firestore_.unixmillistotimestamp.md create mode 100644 docs-devsite/firestore_.unixsecondstotimestamp.md create mode 100644 docs-devsite/firestore_.vectorlength.md create mode 100644 docs-devsite/firestore_.where.md create mode 100644 docs-devsite/firestore_.xor.md create mode 100644 docs-devsite/firestore_lite.accumulator.md create mode 100644 docs-devsite/firestore_lite.add.md create mode 100644 docs-devsite/firestore_lite.addfields.md create mode 100644 docs-devsite/firestore_lite.aggregate.md create mode 100644 docs-devsite/firestore_lite.and.md create mode 100644 docs-devsite/firestore_lite.arrayconcat.md create mode 100644 docs-devsite/firestore_lite.arraycontains.md create mode 100644 docs-devsite/firestore_lite.arraycontainsall.md create mode 100644 docs-devsite/firestore_lite.arraycontainsany.md create mode 100644 docs-devsite/firestore_lite.arrayelement.md create mode 100644 docs-devsite/firestore_lite.arraylength.md create mode 100644 docs-devsite/firestore_lite.arrayreverse.md create mode 100644 docs-devsite/firestore_lite.avg.md create mode 100644 docs-devsite/firestore_lite.bytelength.md create mode 100644 docs-devsite/firestore_lite.charlength.md create mode 100644 docs-devsite/firestore_lite.collectiongroupsource.md create mode 100644 docs-devsite/firestore_lite.collectionsource.md create mode 100644 docs-devsite/firestore_lite.constant.md create mode 100644 docs-devsite/firestore_lite.cosinedistance.md create mode 100644 docs-devsite/firestore_lite.count.md create mode 100644 docs-devsite/firestore_lite.databasesource.md create mode 100644 docs-devsite/firestore_lite.distinct.md create mode 100644 docs-devsite/firestore_lite.divide.md create mode 100644 docs-devsite/firestore_lite.documentssource.md create mode 100644 docs-devsite/firestore_lite.dotproduct.md create mode 100644 docs-devsite/firestore_lite.endswith.md create mode 100644 docs-devsite/firestore_lite.eq.md create mode 100644 docs-devsite/firestore_lite.euclideandistance.md create mode 100644 docs-devsite/firestore_lite.exists.md create mode 100644 docs-devsite/firestore_lite.exprwithalias.md create mode 100644 docs-devsite/firestore_lite.field.md create mode 100644 docs-devsite/firestore_lite.fields.md create mode 100644 docs-devsite/firestore_lite.filtercondition.md create mode 100644 docs-devsite/firestore_lite.findnearest.md create mode 100644 docs-devsite/firestore_lite.findnearestoptions.md create mode 100644 docs-devsite/firestore_lite.firestorefunction.md create mode 100644 docs-devsite/firestore_lite.genericstage.md create mode 100644 docs-devsite/firestore_lite.gt.md create mode 100644 docs-devsite/firestore_lite.gte.md create mode 100644 docs-devsite/firestore_lite.if.md create mode 100644 docs-devsite/firestore_lite.in.md create mode 100644 docs-devsite/firestore_lite.isnan.md create mode 100644 docs-devsite/firestore_lite.like.md create mode 100644 docs-devsite/firestore_lite.limit.md create mode 100644 docs-devsite/firestore_lite.logicalmax.md create mode 100644 docs-devsite/firestore_lite.logicalmin.md create mode 100644 docs-devsite/firestore_lite.lt.md create mode 100644 docs-devsite/firestore_lite.lte.md create mode 100644 docs-devsite/firestore_lite.mapget.md create mode 100644 docs-devsite/firestore_lite.max.md create mode 100644 docs-devsite/firestore_lite.min.md create mode 100644 docs-devsite/firestore_lite.mod.md create mode 100644 docs-devsite/firestore_lite.multiply.md create mode 100644 docs-devsite/firestore_lite.neq.md create mode 100644 docs-devsite/firestore_lite.not.md create mode 100644 docs-devsite/firestore_lite.offset.md create mode 100644 docs-devsite/firestore_lite.or.md create mode 100644 docs-devsite/firestore_lite.ordering.md create mode 100644 docs-devsite/firestore_lite.pipeline.md create mode 100644 docs-devsite/firestore_lite.pipelineresult.md create mode 100644 docs-devsite/firestore_lite.pipelinesource.md create mode 100644 docs-devsite/firestore_lite.regexcontains.md create mode 100644 docs-devsite/firestore_lite.regexmatch.md create mode 100644 docs-devsite/firestore_lite.replaceall.md create mode 100644 docs-devsite/firestore_lite.replacefirst.md create mode 100644 docs-devsite/firestore_lite.reverse.md create mode 100644 docs-devsite/firestore_lite.select.md create mode 100644 docs-devsite/firestore_lite.selectable.md create mode 100644 docs-devsite/firestore_lite.sort.md create mode 100644 docs-devsite/firestore_lite.stage.md create mode 100644 docs-devsite/firestore_lite.startswith.md create mode 100644 docs-devsite/firestore_lite.strconcat.md create mode 100644 docs-devsite/firestore_lite.strcontains.md create mode 100644 docs-devsite/firestore_lite.subtract.md create mode 100644 docs-devsite/firestore_lite.sum.md create mode 100644 docs-devsite/firestore_lite.timestampadd.md create mode 100644 docs-devsite/firestore_lite.timestampsub.md create mode 100644 docs-devsite/firestore_lite.timestamptounixmicros.md create mode 100644 docs-devsite/firestore_lite.timestamptounixmillis.md create mode 100644 docs-devsite/firestore_lite.timestamptounixseconds.md create mode 100644 docs-devsite/firestore_lite.tolower.md create mode 100644 docs-devsite/firestore_lite.toupper.md create mode 100644 docs-devsite/firestore_lite.trim.md create mode 100644 docs-devsite/firestore_lite.unixmicrostotimestamp.md create mode 100644 docs-devsite/firestore_lite.unixmillistotimestamp.md create mode 100644 docs-devsite/firestore_lite.unixsecondstotimestamp.md create mode 100644 docs-devsite/firestore_lite.vectorlength.md create mode 100644 docs-devsite/firestore_lite.where.md create mode 100644 docs-devsite/firestore_lite.xor.md rename docs-devsite/{vertexai.baseparams.md => vertexai-preview.baseparams.md} (67%) create mode 100644 docs-devsite/vertexai-preview.chatsession.md rename docs-devsite/{vertexai.citation.md => vertexai-preview.citation.md} (68%) rename docs-devsite/{vertexai.citationmetadata.md => vertexai-preview.citationmetadata.md} (64%) rename docs-devsite/{vertexai.content.md => vertexai-preview.content.md} (76%) rename docs-devsite/{vertexai.counttokensrequest.md => vertexai-preview.counttokensrequest.md} (68%) rename docs-devsite/{vertexai.counttokensresponse.md => vertexai-preview.counttokensresponse.md} (67%) rename docs-devsite/{vertexai.customerrordata.md => vertexai-preview.customerrordata.md} (54%) rename docs-devsite/{vertexai.date_2.md => vertexai-preview.date_2.md} (78%) rename docs-devsite/{vertexai.enhancedgeneratecontentresponse.md => vertexai-preview.enhancedgeneratecontentresponse.md} (61%) rename docs-devsite/{vertexai.errordetails.md => vertexai-preview.errordetails.md} (68%) rename docs-devsite/{vertexai.filedata.md => vertexai-preview.filedata.md} (81%) rename docs-devsite/{vertexai.filedatapart.md => vertexai-preview.filedatapart.md} (60%) rename docs-devsite/{vertexai.functioncall.md => vertexai-preview.functioncall.md} (57%) rename docs-devsite/{vertexai.functioncallingconfig.md => vertexai-preview.functioncallingconfig.md} (71%) rename docs-devsite/{vertexai.functioncallpart.md => vertexai-preview.functioncallpart.md} (59%) rename docs-devsite/{vertexai.functiondeclaration.md => vertexai-preview.functiondeclaration.md} (57%) create mode 100644 docs-devsite/vertexai-preview.functiondeclarationschema.md create mode 100644 docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md create mode 100644 docs-devsite/vertexai-preview.functiondeclarationstool.md rename docs-devsite/{vertexai.functionresponse.md => vertexai-preview.functionresponse.md} (50%) rename docs-devsite/{vertexai.functionresponsepart.md => vertexai-preview.functionresponsepart.md} (58%) create mode 100644 docs-devsite/vertexai-preview.generatecontentcandidate.md rename docs-devsite/{vertexai.generatecontentrequest.md => vertexai-preview.generatecontentrequest.md} (54%) rename docs-devsite/{vertexai.generatecontentresponse.md => vertexai-preview.generatecontentresponse.md} (50%) rename docs-devsite/{vertexai.generatecontentresult.md => vertexai-preview.generatecontentresult.md} (69%) rename docs-devsite/{vertexai.generatecontentstreamresult.md => vertexai-preview.generatecontentstreamresult.md} (52%) create mode 100644 docs-devsite/vertexai-preview.generationconfig.md rename docs-devsite/{vertexai.generativecontentblob.md => vertexai-preview.generativecontentblob.md} (76%) create mode 100644 docs-devsite/vertexai-preview.generativemodel.md rename docs-devsite/{vertexai.groundingattribution.md => vertexai-preview.groundingattribution.md} (58%) rename docs-devsite/{vertexai.groundingmetadata.md => vertexai-preview.groundingmetadata.md} (66%) rename docs-devsite/{vertexai.inlinedatapart.md => vertexai-preview.inlinedatapart.md} (60%) create mode 100644 docs-devsite/vertexai-preview.md rename docs-devsite/{vertexai.modelparams.md => vertexai-preview.modelparams.md} (54%) rename docs-devsite/{vertexai.promptfeedback.md => vertexai-preview.promptfeedback.md} (66%) rename docs-devsite/{vertexai.requestoptions.md => vertexai-preview.requestoptions.md} (55%) rename docs-devsite/{vertexai.retrievedcontextattribution.md => vertexai-preview.retrievedcontextattribution.md} (76%) rename docs-devsite/{vertexai.safetyrating.md => vertexai-preview.safetyrating.md} (55%) rename docs-devsite/{vertexai.safetysetting.md => vertexai-preview.safetysetting.md} (64%) rename docs-devsite/{vertexai.segment.md => vertexai-preview.segment.md} (75%) rename docs-devsite/{vertexai.startchatparams.md => vertexai-preview.startchatparams.md} (51%) rename docs-devsite/{vertexai.textpart.md => vertexai-preview.textpart.md} (72%) rename docs-devsite/{vertexai.toolconfig.md => vertexai-preview.toolconfig.md} (71%) rename docs-devsite/{vertexai.usagemetadata.md => vertexai-preview.usagemetadata.md} (63%) rename docs-devsite/{vertexai.vertexai.md => vertexai-preview.vertexai.md} (58%) rename docs-devsite/{vertexai.vertexaierror.md => vertexai-preview.vertexaierror.md} (55%) rename docs-devsite/{vertexai.vertexaioptions.md => vertexai-preview.vertexaioptions.md} (79%) rename docs-devsite/{vertexai.videometadata.md => vertexai-preview.videometadata.md} (66%) rename docs-devsite/{vertexai.webattribution.md => vertexai-preview.webattribution.md} (79%) delete mode 100644 docs-devsite/vertexai.arrayschema.md delete mode 100644 docs-devsite/vertexai.booleanschema.md delete mode 100644 docs-devsite/vertexai.chatsession.md delete mode 100644 docs-devsite/vertexai.functiondeclarationstool.md delete mode 100644 docs-devsite/vertexai.generatecontentcandidate.md delete mode 100644 docs-devsite/vertexai.generationconfig.md delete mode 100644 docs-devsite/vertexai.generativemodel.md delete mode 100644 docs-devsite/vertexai.integerschema.md delete mode 100644 docs-devsite/vertexai.md delete mode 100644 docs-devsite/vertexai.numberschema.md delete mode 100644 docs-devsite/vertexai.objectschema.md delete mode 100644 docs-devsite/vertexai.objectschemainterface.md delete mode 100644 docs-devsite/vertexai.schema.md delete mode 100644 docs-devsite/vertexai.schemainterface.md delete mode 100644 docs-devsite/vertexai.schemaparams.md delete mode 100644 docs-devsite/vertexai.schemarequest.md delete mode 100644 docs-devsite/vertexai.schemashared.md delete mode 100644 docs-devsite/vertexai.stringschema.md diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index a27f2832eb7..569c436a053 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -201,16 +201,62 @@ toc: - title: firestore path: /docs/reference/js/firestore_.md section: + - title: Accumulator + path: /docs/reference/js/firestore_.accumulator.md + - title: Add + path: /docs/reference/js/firestore_.add.md + - title: AddFields + path: /docs/reference/js/firestore_.addfields.md + - title: Aggregate + path: /docs/reference/js/firestore_.aggregate.md - title: AggregateField path: /docs/reference/js/firestore_.aggregatefield.md - title: AggregateQuerySnapshot path: /docs/reference/js/firestore_.aggregatequerysnapshot.md - title: AggregateSpec path: /docs/reference/js/firestore_.aggregatespec.md + - title: And + path: /docs/reference/js/firestore_.and.md + - title: ArrayConcat + path: /docs/reference/js/firestore_.arrayconcat.md + - title: ArrayContains + path: /docs/reference/js/firestore_.arraycontains.md + - title: ArrayContainsAll + path: /docs/reference/js/firestore_.arraycontainsall.md + - title: ArrayContainsAny + path: /docs/reference/js/firestore_.arraycontainsany.md + - title: ArrayElement + path: /docs/reference/js/firestore_.arrayelement.md + - title: ArrayLength + path: /docs/reference/js/firestore_.arraylength.md + - title: ArrayReverse + path: /docs/reference/js/firestore_.arrayreverse.md + - title: Avg + path: /docs/reference/js/firestore_.avg.md + - title: ByteLength + path: /docs/reference/js/firestore_.bytelength.md - title: Bytes path: /docs/reference/js/firestore_.bytes.md + - title: CharLength + path: /docs/reference/js/firestore_.charlength.md + - title: CollectionGroupSource + path: /docs/reference/js/firestore_.collectiongroupsource.md - title: CollectionReference path: /docs/reference/js/firestore_.collectionreference.md + - title: CollectionSource + path: /docs/reference/js/firestore_.collectionsource.md + - title: Constant + path: /docs/reference/js/firestore_.constant.md + - title: CosineDistance + path: /docs/reference/js/firestore_.cosinedistance.md + - title: Count + path: /docs/reference/js/firestore_.count.md + - title: DatabaseSource + path: /docs/reference/js/firestore_.databasesource.md + - title: Distinct + path: /docs/reference/js/firestore_.distinct.md + - title: Divide + path: /docs/reference/js/firestore_.divide.md - title: DocumentChange path: /docs/reference/js/firestore_.documentchange.md - title: DocumentData @@ -219,32 +265,86 @@ toc: path: /docs/reference/js/firestore_.documentreference.md - title: DocumentSnapshot path: /docs/reference/js/firestore_.documentsnapshot.md + - title: DocumentsSource + path: /docs/reference/js/firestore_.documentssource.md + - title: DotProduct + path: /docs/reference/js/firestore_.dotproduct.md + - title: EndsWith + path: /docs/reference/js/firestore_.endswith.md + - title: Eq + path: /docs/reference/js/firestore_.eq.md + - title: EuclideanDistance + path: /docs/reference/js/firestore_.euclideandistance.md + - title: Exists + path: /docs/reference/js/firestore_.exists.md - title: ExperimentalLongPollingOptions path: /docs/reference/js/firestore_.experimentallongpollingoptions.md + - title: ExprWithAlias + path: /docs/reference/js/firestore_.exprwithalias.md + - title: Field + path: /docs/reference/js/firestore_.field.md - title: FieldPath path: /docs/reference/js/firestore_.fieldpath.md + - title: Fields + path: /docs/reference/js/firestore_.fields.md - title: FieldValue path: /docs/reference/js/firestore_.fieldvalue.md + - title: FilterCondition + path: /docs/reference/js/firestore_.filtercondition.md + - title: FindNearest + path: /docs/reference/js/firestore_.findnearest.md + - title: FindNearestOptions + path: /docs/reference/js/firestore_.findnearestoptions.md - title: Firestore path: /docs/reference/js/firestore_.firestore.md - title: FirestoreDataConverter path: /docs/reference/js/firestore_.firestoredataconverter.md - title: FirestoreError path: /docs/reference/js/firestore_.firestoreerror.md + - title: FirestoreFunction + path: /docs/reference/js/firestore_.firestorefunction.md - title: FirestoreSettings path: /docs/reference/js/firestore_.firestoresettings.md + - title: GenericStage + path: /docs/reference/js/firestore_.genericstage.md - title: GeoPoint path: /docs/reference/js/firestore_.geopoint.md + - title: Gt + path: /docs/reference/js/firestore_.gt.md + - title: Gte + path: /docs/reference/js/firestore_.gte.md + - title: If + path: /docs/reference/js/firestore_.if.md + - title: In + path: /docs/reference/js/firestore_.in.md - title: Index path: /docs/reference/js/firestore_.index.md - title: IndexConfiguration path: /docs/reference/js/firestore_.indexconfiguration.md - title: IndexField path: /docs/reference/js/firestore_.indexfield.md + - title: IsNan + path: /docs/reference/js/firestore_.isnan.md + - title: Like + path: /docs/reference/js/firestore_.like.md + - title: Limit + path: /docs/reference/js/firestore_.limit.md - title: LoadBundleTask path: /docs/reference/js/firestore_.loadbundletask.md - title: LoadBundleTaskProgress path: /docs/reference/js/firestore_.loadbundletaskprogress.md + - title: LogicalMax + path: /docs/reference/js/firestore_.logicalmax.md + - title: LogicalMin + path: /docs/reference/js/firestore_.logicalmin.md + - title: Lt + path: /docs/reference/js/firestore_.lt.md + - title: Lte + path: /docs/reference/js/firestore_.lte.md + - title: MapGet + path: /docs/reference/js/firestore_.mapget.md + - title: Max + path: /docs/reference/js/firestore_.max.md - title: MemoryCacheSettings path: /docs/reference/js/firestore_.memorycachesettings.md - title: MemoryEagerGarbageCollector @@ -253,6 +353,22 @@ toc: path: /docs/reference/js/firestore_.memorylocalcache.md - title: MemoryLruGarbageCollector path: /docs/reference/js/firestore_.memorylrugarbagecollector.md + - title: Min + path: /docs/reference/js/firestore_.min.md + - title: Mod + path: /docs/reference/js/firestore_.mod.md + - title: Multiply + path: /docs/reference/js/firestore_.multiply.md + - title: Neq + path: /docs/reference/js/firestore_.neq.md + - title: Not + path: /docs/reference/js/firestore_.not.md + - title: Offset + path: /docs/reference/js/firestore_.offset.md + - title: Or + path: /docs/reference/js/firestore_.or.md + - title: Ordering + path: /docs/reference/js/firestore_.ordering.md - title: PersistenceSettings path: /docs/reference/js/firestore_.persistencesettings.md - title: PersistentCacheIndexManager @@ -267,6 +383,12 @@ toc: path: /docs/reference/js/firestore_.persistentsingletabmanager.md - title: PersistentSingleTabManagerSettings path: /docs/reference/js/firestore_.persistentsingletabmanagersettings.md + - title: Pipeline + path: /docs/reference/js/firestore_.pipeline.md + - title: PipelineResult + path: /docs/reference/js/firestore_.pipelineresult.md + - title: PipelineSource + path: /docs/reference/js/firestore_.pipelinesource.md - title: Query path: /docs/reference/js/firestore_.query.md - title: QueryCompositeFilterConstraint @@ -287,55 +409,233 @@ toc: path: /docs/reference/js/firestore_.querysnapshot.md - title: QueryStartAtConstraint path: /docs/reference/js/firestore_.querystartatconstraint.md + - title: RegexContains + path: /docs/reference/js/firestore_.regexcontains.md + - title: RegexMatch + path: /docs/reference/js/firestore_.regexmatch.md + - title: ReplaceAll + path: /docs/reference/js/firestore_.replaceall.md + - title: ReplaceFirst + path: /docs/reference/js/firestore_.replacefirst.md + - title: Reverse + path: /docs/reference/js/firestore_.reverse.md + - title: Select + path: /docs/reference/js/firestore_.select.md + - title: Selectable + path: /docs/reference/js/firestore_.selectable.md - title: SnapshotListenOptions path: /docs/reference/js/firestore_.snapshotlistenoptions.md - title: SnapshotMetadata path: /docs/reference/js/firestore_.snapshotmetadata.md - title: SnapshotOptions path: /docs/reference/js/firestore_.snapshotoptions.md + - title: Sort + path: /docs/reference/js/firestore_.sort.md + - title: Stage + path: /docs/reference/js/firestore_.stage.md + - title: StartsWith + path: /docs/reference/js/firestore_.startswith.md + - title: StrConcat + path: /docs/reference/js/firestore_.strconcat.md + - title: StrContains + path: /docs/reference/js/firestore_.strcontains.md + - title: Subtract + path: /docs/reference/js/firestore_.subtract.md + - title: Sum + path: /docs/reference/js/firestore_.sum.md - title: Timestamp path: /docs/reference/js/firestore_.timestamp.md + - title: TimestampAdd + path: /docs/reference/js/firestore_.timestampadd.md + - title: TimestampSub + path: /docs/reference/js/firestore_.timestampsub.md + - title: TimestampToUnixMicros + path: /docs/reference/js/firestore_.timestamptounixmicros.md + - title: TimestampToUnixMillis + path: /docs/reference/js/firestore_.timestamptounixmillis.md + - title: TimestampToUnixSeconds + path: /docs/reference/js/firestore_.timestamptounixseconds.md + - title: ToLower + path: /docs/reference/js/firestore_.tolower.md + - title: ToUpper + path: /docs/reference/js/firestore_.toupper.md - title: Transaction path: /docs/reference/js/firestore_.transaction.md - title: TransactionOptions path: /docs/reference/js/firestore_.transactionoptions.md + - title: Trim + path: /docs/reference/js/firestore_.trim.md + - title: UnixMicrosToTimestamp + path: /docs/reference/js/firestore_.unixmicrostotimestamp.md + - title: UnixMillisToTimestamp + path: /docs/reference/js/firestore_.unixmillistotimestamp.md + - title: UnixSecondsToTimestamp + path: /docs/reference/js/firestore_.unixsecondstotimestamp.md - title: Unsubscribe path: /docs/reference/js/firestore_.unsubscribe.md + - title: VectorLength + path: /docs/reference/js/firestore_.vectorlength.md - title: VectorValue path: /docs/reference/js/firestore_.vectorvalue.md + - title: Where + path: /docs/reference/js/firestore_.where.md - title: WriteBatch path: /docs/reference/js/firestore_.writebatch.md + - title: Xor + path: /docs/reference/js/firestore_.xor.md - title: firestore/lite path: /docs/reference/js/firestore_lite.md section: + - title: Accumulator + path: /docs/reference/js/firestore_lite.accumulator.md + - title: Add + path: /docs/reference/js/firestore_lite.add.md + - title: AddFields + path: /docs/reference/js/firestore_lite.addfields.md + - title: Aggregate + path: /docs/reference/js/firestore_lite.aggregate.md - title: AggregateField path: /docs/reference/js/firestore_lite.aggregatefield.md - title: AggregateQuerySnapshot path: /docs/reference/js/firestore_lite.aggregatequerysnapshot.md - title: AggregateSpec path: /docs/reference/js/firestore_lite.aggregatespec.md + - title: And + path: /docs/reference/js/firestore_lite.and.md + - title: ArrayConcat + path: /docs/reference/js/firestore_lite.arrayconcat.md + - title: ArrayContains + path: /docs/reference/js/firestore_lite.arraycontains.md + - title: ArrayContainsAll + path: /docs/reference/js/firestore_lite.arraycontainsall.md + - title: ArrayContainsAny + path: /docs/reference/js/firestore_lite.arraycontainsany.md + - title: ArrayElement + path: /docs/reference/js/firestore_lite.arrayelement.md + - title: ArrayLength + path: /docs/reference/js/firestore_lite.arraylength.md + - title: ArrayReverse + path: /docs/reference/js/firestore_lite.arrayreverse.md + - title: Avg + path: /docs/reference/js/firestore_lite.avg.md + - title: ByteLength + path: /docs/reference/js/firestore_lite.bytelength.md - title: Bytes path: /docs/reference/js/firestore_lite.bytes.md + - title: CharLength + path: /docs/reference/js/firestore_lite.charlength.md + - title: CollectionGroupSource + path: /docs/reference/js/firestore_lite.collectiongroupsource.md - title: CollectionReference path: /docs/reference/js/firestore_lite.collectionreference.md + - title: CollectionSource + path: /docs/reference/js/firestore_lite.collectionsource.md + - title: Constant + path: /docs/reference/js/firestore_lite.constant.md + - title: CosineDistance + path: /docs/reference/js/firestore_lite.cosinedistance.md + - title: Count + path: /docs/reference/js/firestore_lite.count.md + - title: DatabaseSource + path: /docs/reference/js/firestore_lite.databasesource.md + - title: Distinct + path: /docs/reference/js/firestore_lite.distinct.md + - title: Divide + path: /docs/reference/js/firestore_lite.divide.md - title: DocumentData path: /docs/reference/js/firestore_lite.documentdata.md - title: DocumentReference path: /docs/reference/js/firestore_lite.documentreference.md - title: DocumentSnapshot path: /docs/reference/js/firestore_lite.documentsnapshot.md + - title: DocumentsSource + path: /docs/reference/js/firestore_lite.documentssource.md + - title: DotProduct + path: /docs/reference/js/firestore_lite.dotproduct.md + - title: EndsWith + path: /docs/reference/js/firestore_lite.endswith.md + - title: Eq + path: /docs/reference/js/firestore_lite.eq.md + - title: EuclideanDistance + path: /docs/reference/js/firestore_lite.euclideandistance.md + - title: Exists + path: /docs/reference/js/firestore_lite.exists.md + - title: ExprWithAlias + path: /docs/reference/js/firestore_lite.exprwithalias.md + - title: Field + path: /docs/reference/js/firestore_lite.field.md - title: FieldPath path: /docs/reference/js/firestore_lite.fieldpath.md + - title: Fields + path: /docs/reference/js/firestore_lite.fields.md - title: FieldValue path: /docs/reference/js/firestore_lite.fieldvalue.md + - title: FilterCondition + path: /docs/reference/js/firestore_lite.filtercondition.md + - title: FindNearest + path: /docs/reference/js/firestore_lite.findnearest.md + - title: FindNearestOptions + path: /docs/reference/js/firestore_lite.findnearestoptions.md - title: Firestore path: /docs/reference/js/firestore_lite.firestore.md - title: FirestoreDataConverter path: /docs/reference/js/firestore_lite.firestoredataconverter.md - title: FirestoreError path: /docs/reference/js/firestore_lite.firestoreerror.md + - title: FirestoreFunction + path: /docs/reference/js/firestore_lite.firestorefunction.md + - title: GenericStage + path: /docs/reference/js/firestore_lite.genericstage.md - title: GeoPoint path: /docs/reference/js/firestore_lite.geopoint.md + - title: Gt + path: /docs/reference/js/firestore_lite.gt.md + - title: Gte + path: /docs/reference/js/firestore_lite.gte.md + - title: If + path: /docs/reference/js/firestore_lite.if.md + - title: In + path: /docs/reference/js/firestore_lite.in.md + - title: IsNan + path: /docs/reference/js/firestore_lite.isnan.md + - title: Like + path: /docs/reference/js/firestore_lite.like.md + - title: Limit + path: /docs/reference/js/firestore_lite.limit.md + - title: LogicalMax + path: /docs/reference/js/firestore_lite.logicalmax.md + - title: LogicalMin + path: /docs/reference/js/firestore_lite.logicalmin.md + - title: Lt + path: /docs/reference/js/firestore_lite.lt.md + - title: Lte + path: /docs/reference/js/firestore_lite.lte.md + - title: MapGet + path: /docs/reference/js/firestore_lite.mapget.md + - title: Max + path: /docs/reference/js/firestore_lite.max.md + - title: Min + path: /docs/reference/js/firestore_lite.min.md + - title: Mod + path: /docs/reference/js/firestore_lite.mod.md + - title: Multiply + path: /docs/reference/js/firestore_lite.multiply.md + - title: Neq + path: /docs/reference/js/firestore_lite.neq.md + - title: Not + path: /docs/reference/js/firestore_lite.not.md + - title: Offset + path: /docs/reference/js/firestore_lite.offset.md + - title: Or + path: /docs/reference/js/firestore_lite.or.md + - title: Ordering + path: /docs/reference/js/firestore_lite.ordering.md + - title: Pipeline + path: /docs/reference/js/firestore_lite.pipeline.md + - title: PipelineResult + path: /docs/reference/js/firestore_lite.pipelineresult.md + - title: PipelineSource + path: /docs/reference/js/firestore_lite.pipelinesource.md - title: Query path: /docs/reference/js/firestore_lite.query.md - title: QueryCompositeFilterConstraint @@ -356,18 +656,74 @@ toc: path: /docs/reference/js/firestore_lite.querysnapshot.md - title: QueryStartAtConstraint path: /docs/reference/js/firestore_lite.querystartatconstraint.md + - title: RegexContains + path: /docs/reference/js/firestore_lite.regexcontains.md + - title: RegexMatch + path: /docs/reference/js/firestore_lite.regexmatch.md + - title: ReplaceAll + path: /docs/reference/js/firestore_lite.replaceall.md + - title: ReplaceFirst + path: /docs/reference/js/firestore_lite.replacefirst.md + - title: Reverse + path: /docs/reference/js/firestore_lite.reverse.md + - title: Select + path: /docs/reference/js/firestore_lite.select.md + - title: Selectable + path: /docs/reference/js/firestore_lite.selectable.md - title: Settings path: /docs/reference/js/firestore_lite.settings.md + - title: Sort + path: /docs/reference/js/firestore_lite.sort.md + - title: Stage + path: /docs/reference/js/firestore_lite.stage.md + - title: StartsWith + path: /docs/reference/js/firestore_lite.startswith.md + - title: StrConcat + path: /docs/reference/js/firestore_lite.strconcat.md + - title: StrContains + path: /docs/reference/js/firestore_lite.strcontains.md + - title: Subtract + path: /docs/reference/js/firestore_lite.subtract.md + - title: Sum + path: /docs/reference/js/firestore_lite.sum.md - title: Timestamp path: /docs/reference/js/firestore_lite.timestamp.md + - title: TimestampAdd + path: /docs/reference/js/firestore_lite.timestampadd.md + - title: TimestampSub + path: /docs/reference/js/firestore_lite.timestampsub.md + - title: TimestampToUnixMicros + path: /docs/reference/js/firestore_lite.timestamptounixmicros.md + - title: TimestampToUnixMillis + path: /docs/reference/js/firestore_lite.timestamptounixmillis.md + - title: TimestampToUnixSeconds + path: /docs/reference/js/firestore_lite.timestamptounixseconds.md + - title: ToLower + path: /docs/reference/js/firestore_lite.tolower.md + - title: ToUpper + path: /docs/reference/js/firestore_lite.toupper.md - title: Transaction path: /docs/reference/js/firestore_lite.transaction.md - title: TransactionOptions path: /docs/reference/js/firestore_lite.transactionoptions.md + - title: Trim + path: /docs/reference/js/firestore_lite.trim.md + - title: UnixMicrosToTimestamp + path: /docs/reference/js/firestore_lite.unixmicrostotimestamp.md + - title: UnixMillisToTimestamp + path: /docs/reference/js/firestore_lite.unixmillistotimestamp.md + - title: UnixSecondsToTimestamp + path: /docs/reference/js/firestore_lite.unixsecondstotimestamp.md + - title: VectorLength + path: /docs/reference/js/firestore_lite.vectorlength.md - title: VectorValue path: /docs/reference/js/firestore_lite.vectorvalue.md + - title: Where + path: /docs/reference/js/firestore_lite.where.md - title: WriteBatch path: /docs/reference/js/firestore_lite.writebatch.md + - title: Xor + path: /docs/reference/js/firestore_lite.xor.md - title: functions path: /docs/reference/js/functions.md section: @@ -455,124 +811,105 @@ toc: path: /docs/reference/js/storage.uploadtask.md - title: UploadTaskSnapshot path: /docs/reference/js/storage.uploadtasksnapshot.md - - title: vertexai - path: /docs/reference/js/vertexai.md + - title: vertexai-preview + path: /docs/reference/js/vertexai-preview.md section: - - title: ArraySchema - path: /docs/reference/js/vertexai.arrayschema.md - title: BaseParams - path: /docs/reference/js/vertexai.baseparams.md - - title: BooleanSchema - path: /docs/reference/js/vertexai.booleanschema.md + path: /docs/reference/js/vertexai-preview.baseparams.md - title: ChatSession - path: /docs/reference/js/vertexai.chatsession.md + path: /docs/reference/js/vertexai-preview.chatsession.md - title: Citation - path: /docs/reference/js/vertexai.citation.md + path: /docs/reference/js/vertexai-preview.citation.md - title: CitationMetadata - path: /docs/reference/js/vertexai.citationmetadata.md + path: /docs/reference/js/vertexai-preview.citationmetadata.md - title: Content - path: /docs/reference/js/vertexai.content.md + path: /docs/reference/js/vertexai-preview.content.md - title: CountTokensRequest - path: /docs/reference/js/vertexai.counttokensrequest.md + path: /docs/reference/js/vertexai-preview.counttokensrequest.md - title: CountTokensResponse - path: /docs/reference/js/vertexai.counttokensresponse.md + path: /docs/reference/js/vertexai-preview.counttokensresponse.md - title: CustomErrorData - path: /docs/reference/js/vertexai.customerrordata.md + path: /docs/reference/js/vertexai-preview.customerrordata.md - title: Date_2 - path: /docs/reference/js/vertexai.date_2.md + path: /docs/reference/js/vertexai-preview.date_2.md - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md + path: /docs/reference/js/vertexai-preview.enhancedgeneratecontentresponse.md - title: ErrorDetails - path: /docs/reference/js/vertexai.errordetails.md + path: /docs/reference/js/vertexai-preview.errordetails.md - title: FileData - path: /docs/reference/js/vertexai.filedata.md + path: /docs/reference/js/vertexai-preview.filedata.md - title: FileDataPart - path: /docs/reference/js/vertexai.filedatapart.md + path: /docs/reference/js/vertexai-preview.filedatapart.md - title: FunctionCall - path: /docs/reference/js/vertexai.functioncall.md + path: /docs/reference/js/vertexai-preview.functioncall.md - title: FunctionCallingConfig - path: /docs/reference/js/vertexai.functioncallingconfig.md + path: /docs/reference/js/vertexai-preview.functioncallingconfig.md - title: FunctionCallPart - path: /docs/reference/js/vertexai.functioncallpart.md + path: /docs/reference/js/vertexai-preview.functioncallpart.md - title: FunctionDeclaration - path: /docs/reference/js/vertexai.functiondeclaration.md + path: /docs/reference/js/vertexai-preview.functiondeclaration.md + - title: FunctionDeclarationSchema + path: /docs/reference/js/vertexai-preview.functiondeclarationschema.md + - title: FunctionDeclarationSchemaProperty + path: >- + /docs/reference/js/vertexai-preview.functiondeclarationschemaproperty.md - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai.functiondeclarationstool.md + path: /docs/reference/js/vertexai-preview.functiondeclarationstool.md - title: FunctionResponse - path: /docs/reference/js/vertexai.functionresponse.md + path: /docs/reference/js/vertexai-preview.functionresponse.md - title: FunctionResponsePart - path: /docs/reference/js/vertexai.functionresponsepart.md + path: /docs/reference/js/vertexai-preview.functionresponsepart.md - title: GenerateContentCandidate - path: /docs/reference/js/vertexai.generatecontentcandidate.md + path: /docs/reference/js/vertexai-preview.generatecontentcandidate.md - title: GenerateContentRequest - path: /docs/reference/js/vertexai.generatecontentrequest.md + path: /docs/reference/js/vertexai-preview.generatecontentrequest.md - title: GenerateContentResponse - path: /docs/reference/js/vertexai.generatecontentresponse.md + path: /docs/reference/js/vertexai-preview.generatecontentresponse.md - title: GenerateContentResult - path: /docs/reference/js/vertexai.generatecontentresult.md + path: /docs/reference/js/vertexai-preview.generatecontentresult.md - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai.generatecontentstreamresult.md + path: /docs/reference/js/vertexai-preview.generatecontentstreamresult.md - title: GenerationConfig - path: /docs/reference/js/vertexai.generationconfig.md + path: /docs/reference/js/vertexai-preview.generationconfig.md - title: GenerativeContentBlob - path: /docs/reference/js/vertexai.generativecontentblob.md + path: /docs/reference/js/vertexai-preview.generativecontentblob.md - title: GenerativeModel - path: /docs/reference/js/vertexai.generativemodel.md + path: /docs/reference/js/vertexai-preview.generativemodel.md - title: GroundingAttribution - path: /docs/reference/js/vertexai.groundingattribution.md + path: /docs/reference/js/vertexai-preview.groundingattribution.md - title: GroundingMetadata - path: /docs/reference/js/vertexai.groundingmetadata.md + path: /docs/reference/js/vertexai-preview.groundingmetadata.md - title: InlineDataPart - path: /docs/reference/js/vertexai.inlinedatapart.md - - title: IntegerSchema - path: /docs/reference/js/vertexai.integerschema.md + path: /docs/reference/js/vertexai-preview.inlinedatapart.md - title: ModelParams - path: /docs/reference/js/vertexai.modelparams.md - - title: NumberSchema - path: /docs/reference/js/vertexai.numberschema.md - - title: ObjectSchema - path: /docs/reference/js/vertexai.objectschema.md - - title: ObjectSchemaInterface - path: /docs/reference/js/vertexai.objectschemainterface.md + path: /docs/reference/js/vertexai-preview.modelparams.md - title: PromptFeedback - path: /docs/reference/js/vertexai.promptfeedback.md + path: /docs/reference/js/vertexai-preview.promptfeedback.md - title: RequestOptions - path: /docs/reference/js/vertexai.requestoptions.md + path: /docs/reference/js/vertexai-preview.requestoptions.md - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai.retrievedcontextattribution.md + path: /docs/reference/js/vertexai-preview.retrievedcontextattribution.md - title: SafetyRating - path: /docs/reference/js/vertexai.safetyrating.md + path: /docs/reference/js/vertexai-preview.safetyrating.md - title: SafetySetting - path: /docs/reference/js/vertexai.safetysetting.md - - title: Schema - path: /docs/reference/js/vertexai.schema.md - - title: SchemaInterface - path: /docs/reference/js/vertexai.schemainterface.md - - title: SchemaParams - path: /docs/reference/js/vertexai.schemaparams.md - - title: SchemaRequest - path: /docs/reference/js/vertexai.schemarequest.md - - title: SchemaShared - path: /docs/reference/js/vertexai.schemashared.md + path: /docs/reference/js/vertexai-preview.safetysetting.md - title: Segment - path: /docs/reference/js/vertexai.segment.md + path: /docs/reference/js/vertexai-preview.segment.md - title: StartChatParams - path: /docs/reference/js/vertexai.startchatparams.md - - title: StringSchema - path: /docs/reference/js/vertexai.stringschema.md + path: /docs/reference/js/vertexai-preview.startchatparams.md - title: TextPart - path: /docs/reference/js/vertexai.textpart.md + path: /docs/reference/js/vertexai-preview.textpart.md - title: ToolConfig - path: /docs/reference/js/vertexai.toolconfig.md + path: /docs/reference/js/vertexai-preview.toolconfig.md - title: UsageMetadata - path: /docs/reference/js/vertexai.usagemetadata.md + path: /docs/reference/js/vertexai-preview.usagemetadata.md - title: VertexAI - path: /docs/reference/js/vertexai.vertexai.md + path: /docs/reference/js/vertexai-preview.vertexai.md - title: VertexAIError - path: /docs/reference/js/vertexai.vertexaierror.md + path: /docs/reference/js/vertexai-preview.vertexaierror.md - title: VertexAIOptions - path: /docs/reference/js/vertexai.vertexaioptions.md + path: /docs/reference/js/vertexai-preview.vertexaioptions.md - title: VideoMetadata - path: /docs/reference/js/vertexai.videometadata.md + path: /docs/reference/js/vertexai-preview.videometadata.md - title: WebAttribution - path: /docs/reference/js/vertexai.webattribution.md + path: /docs/reference/js/vertexai-preview.webattribution.md diff --git a/docs-devsite/firestore_.accumulator.md b/docs-devsite/firestore_.accumulator.md new file mode 100644 index 00000000000..540bb3da217 --- /dev/null +++ b/docs-devsite/firestore_.accumulator.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Accumulator interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents an accumulator. + +Signature: + +```typescript +export declare interface Accumulator +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [accumulator](./firestore_.accumulator.md#accumulatoraccumulator) | true | (BETA) | + +## Accumulator.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.add.md b/docs-devsite/firestore_.add.md new file mode 100644 index 00000000000..5fa68c68d84 --- /dev/null +++ b/docs-devsite/firestore_.add.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Add class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Add extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.add.md#addconstructor) | | (BETA) Constructs a new instance of the Add class | + +## Add.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Add` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.addfields.md b/docs-devsite/firestore_.addfields.md new file mode 100644 index 00000000000..23cf88da2d0 --- /dev/null +++ b/docs-devsite/firestore_.addfields.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AddFields class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class AddFields implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(fields)](./firestore_.addfields.md#addfieldsconstructor) | | (BETA) Constructs a new instance of the AddFields class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.addfields.md#addfieldsname) | | string | (BETA) | + +## AddFields.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `AddFields` class + +Signature: + +```typescript +constructor(fields: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fields | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | + +## AddFields.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.aggregate.md b/docs-devsite/firestore_.aggregate.md new file mode 100644 index 00000000000..0868c5edc95 --- /dev/null +++ b/docs-devsite/firestore_.aggregate.md @@ -0,0 +1,65 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Aggregate class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Aggregate implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(accumulators, groups)](./firestore_.aggregate.md#aggregateconstructor) | | (BETA) Constructs a new instance of the Aggregate class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.aggregate.md#aggregatename) | | string | (BETA) | + +## Aggregate.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Aggregate` class + +Signature: + +```typescript +constructor(accumulators: Map, groups: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| accumulators | Map<string, [Accumulator](./firestore_.accumulator.md#accumulator_interface)> | | +| groups | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | + +## Aggregate.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.and.md b/docs-devsite/firestore_.and.md new file mode 100644 index 00000000000..59b0a32b25d --- /dev/null +++ b/docs-devsite/firestore_.and.md @@ -0,0 +1,17 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# and namespace +Signature: + +```typescript +export declare namespace and +``` diff --git a/docs-devsite/firestore_.arrayconcat.md b/docs-devsite/firestore_.arrayconcat.md new file mode 100644 index 00000000000..d7f104b6954 --- /dev/null +++ b/docs-devsite/firestore_.arrayconcat.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayConcat class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayConcat extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, elements)](./firestore_.arrayconcat.md#arrayconcatconstructor) | | (BETA) Constructs a new instance of the ArrayConcat class | + +## ArrayConcat.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayConcat` class + +Signature: + +```typescript +constructor(array: Constant, elements: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | +| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | | + diff --git a/docs-devsite/firestore_.arraycontains.md b/docs-devsite/firestore_.arraycontains.md new file mode 100644 index 00000000000..c56ae8b281d --- /dev/null +++ b/docs-devsite/firestore_.arraycontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, element)](./firestore_.arraycontains.md#arraycontainsconstructor) | | (BETA) Constructs a new instance of the ArrayContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.arraycontains.md#arraycontainsfilterable) | | true | (BETA) | + +## ArrayContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContains` class + +Signature: + +```typescript +constructor(array: Constant, element: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | +| element | [Constant](./firestore_.constant.md#constant_class) | | + +## ArrayContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.arraycontainsall.md b/docs-devsite/firestore_.arraycontainsall.md new file mode 100644 index 00000000000..0509d2ee79d --- /dev/null +++ b/docs-devsite/firestore_.arraycontainsall.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContainsAll class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContainsAll extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, values)](./firestore_.arraycontainsall.md#arraycontainsallconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAll class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.arraycontainsall.md#arraycontainsallfilterable) | | true | (BETA) | + +## ArrayContainsAll.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContainsAll` class + +Signature: + +```typescript +constructor(array: Constant, values: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | | + +## ArrayContainsAll.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.arraycontainsany.md b/docs-devsite/firestore_.arraycontainsany.md new file mode 100644 index 00000000000..0736b7b198b --- /dev/null +++ b/docs-devsite/firestore_.arraycontainsany.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContainsAny class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContainsAny extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, values)](./firestore_.arraycontainsany.md#arraycontainsanyconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAny class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.arraycontainsany.md#arraycontainsanyfilterable) | | true | (BETA) | + +## ArrayContainsAny.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContainsAny` class + +Signature: + +```typescript +constructor(array: Constant, values: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | | + +## ArrayContainsAny.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.arrayelement.md b/docs-devsite/firestore_.arrayelement.md new file mode 100644 index 00000000000..e8dcd7e04b7 --- /dev/null +++ b/docs-devsite/firestore_.arrayelement.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayElement class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayElement extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)()](./firestore_.arrayelement.md#arrayelementconstructor) | | (BETA) Constructs a new instance of the ArrayElement class | + +## ArrayElement.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayElement` class + +Signature: + +```typescript +constructor(); +``` diff --git a/docs-devsite/firestore_.arraylength.md b/docs-devsite/firestore_.arraylength.md new file mode 100644 index 00000000000..88b3b3fa624 --- /dev/null +++ b/docs-devsite/firestore_.arraylength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array)](./firestore_.arraylength.md#arraylengthconstructor) | | (BETA) Constructs a new instance of the ArrayLength class | + +## ArrayLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayLength` class + +Signature: + +```typescript +constructor(array: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.arrayreverse.md b/docs-devsite/firestore_.arrayreverse.md new file mode 100644 index 00000000000..bc7e06c72a7 --- /dev/null +++ b/docs-devsite/firestore_.arrayreverse.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayReverse class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayReverse extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array)](./firestore_.arrayreverse.md#arrayreverseconstructor) | | (BETA) Constructs a new instance of the ArrayReverse class | + +## ArrayReverse.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayReverse` class + +Signature: + +```typescript +constructor(array: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.avg.md b/docs-devsite/firestore_.avg.md new file mode 100644 index 00000000000..e93ade31d62 --- /dev/null +++ b/docs-devsite/firestore_.avg.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Avg class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Avg extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_.avg.md#avgconstructor) | | (BETA) Constructs a new instance of the Avg class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_.avg.md#avgaccumulator) | | true | (BETA) | + +## Avg.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Avg` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| distinct | boolean | | + +## Avg.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.bytelength.md b/docs-devsite/firestore_.bytelength.md new file mode 100644 index 00000000000..7b7055b2951 --- /dev/null +++ b/docs-devsite/firestore_.bytelength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ByteLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ByteLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_.bytelength.md#bytelengthconstructor) | | (BETA) Constructs a new instance of the ByteLength class | + +## ByteLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ByteLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.charlength.md b/docs-devsite/firestore_.charlength.md new file mode 100644 index 00000000000..cb978a4675f --- /dev/null +++ b/docs-devsite/firestore_.charlength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CharLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CharLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_.charlength.md#charlengthconstructor) | | (BETA) Constructs a new instance of the CharLength class | + +## CharLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CharLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.collectiongroupsource.md b/docs-devsite/firestore_.collectiongroupsource.md new file mode 100644 index 00000000000..58d0d7e9b25 --- /dev/null +++ b/docs-devsite/firestore_.collectiongroupsource.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CollectionGroupSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CollectionGroupSource implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(collectionId)](./firestore_.collectiongroupsource.md#collectiongroupsourceconstructor) | | (BETA) Constructs a new instance of the CollectionGroupSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.collectiongroupsource.md#collectiongroupsourcename) | | string | (BETA) | + +## CollectionGroupSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CollectionGroupSource` class + +Signature: + +```typescript +constructor(collectionId: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionId | string | | + +## CollectionGroupSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.collectionsource.md b/docs-devsite/firestore_.collectionsource.md new file mode 100644 index 00000000000..d5b485ea610 --- /dev/null +++ b/docs-devsite/firestore_.collectionsource.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CollectionSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CollectionSource implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(collectionPath)](./firestore_.collectionsource.md#collectionsourceconstructor) | | (BETA) Constructs a new instance of the CollectionSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.collectionsource.md#collectionsourcename) | | string | (BETA) | + +## CollectionSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CollectionSource` class + +Signature: + +```typescript +constructor(collectionPath: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionPath | string | | + +## CollectionSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.constant.md b/docs-devsite/firestore_.constant.md new file mode 100644 index 00000000000..42463dbc01d --- /dev/null +++ b/docs-devsite/firestore_.constant.md @@ -0,0 +1,3504 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Constant class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents a constant value that can be used in a Firestore pipeline expression. + +You can create a `Constant` instance using the static method: + +```typescript +// Create a Constant instance for the number 10 +const ten = Constant.of(10); + +// Create a Constant instance for the string "hello" +const hello = Constant.of("hello"); + +``` + +Signature: + +```typescript +export declare class Constant +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_.constant.md#constantexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_.constant.md#constantarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_.constant.md#constantas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_.constant.md#constantascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_.constant.md#constantavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_.constant.md#constantbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_.constant.md#constantcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_.constant.md#constantcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_.constant.md#constantdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) | +| [exists()](./firestore_.constant.md#constantexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_.constant.md#constantin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_.constant.md#constantin) | | (BETA) | +| [isNaN()](./firestore_.constant.md#constantisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_.constant.md#constantlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_.constant.md#constantlike) | | (BETA) | +| [logicalMax(other)](./firestore_.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_.constant.md#constantmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_.constant.md#constantmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_.constant.md#constantmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a number value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a DocumentReference value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for an array value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a map value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a VectorValue value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a string value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a boolean value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a null value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for an undefined value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a GeoPoint value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Timestamp value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Date value. | +| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Uint8Array value. | +| [regexContains(pattern)](./firestore_.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_.constant.md#constantreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_.constant.md#constantstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_.constant.md#constantsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_.constant.md#constanttimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_.constant.md#constanttimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_.constant.md#constanttimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_.constant.md#constanttolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_.constant.md#constanttoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_.constant.md#constanttrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_.constant.md#constantunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_.constant.md#constantunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_.constant.md#constantunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vector(value)](./firestore_.constant.md#constantvector) | static | (BETA) Creates a Constant instance for a VectorValue value. +```typescript +// Create a Constant instance for a vector value +const vectorConstant = Constant.ofVector([1, 2, 3]); + +``` + | +| [vectorLength()](./firestore_.constant.md#constantvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Constant.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Constant.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Constant.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Constant.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Constant.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Constant.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Constant.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Constant.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Constant.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Constant.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Constant.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Constant.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## Constant.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> + +## Constant.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Constant.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_.avg.md#avg_class) + +## Constant.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +## Constant.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Constant.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +## Constant.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Constant.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Constant.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Constant.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Constant.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Constant.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Constant.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Constant.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +## Constant.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Constant.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Constant.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Constant.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Constant.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Constant.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Constant.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_.isnan.md#isnan_class) + +## Constant.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Constant.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Constant.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Constant.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Constant.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Constant.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Constant.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Constant.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Constant.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Constant.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Constant.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_.mapget.md#mapget_class) + +## Constant.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_.max.md#max_class) + +## Constant.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_.min.md#min_class) + +## Constant.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Constant.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Constant.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Constant.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Constant.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Constant.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a number value. + +Signature: + +```typescript +static of(value: number): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | number | The number value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a DocumentReference value. + +Signature: + +```typescript +static of(value: DocumentReference): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [DocumentReference](./firestore_.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for an array value. + +Signature: + +```typescript +static of(value: any[]): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | any\[\] | The array value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a map value. + +Signature: + +```typescript +static of(value: Map): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Map<string, any> | The map value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a VectorValue value. + +Signature: + +```typescript +static of(value: VectorValue): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a string value. + +Signature: + +```typescript +static of(value: string): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | string | The string value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a boolean value. + +Signature: + +```typescript +static of(value: boolean): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | boolean | The boolean value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a null value. + +Signature: + +```typescript +static of(value: null): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | null | The null value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for an undefined value. + +Signature: + +```typescript +static of(value: undefined): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | undefined | The undefined value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a GeoPoint value. + +Signature: + +```typescript +static of(value: GeoPoint): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [GeoPoint](./firestore_.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Timestamp value. + +Signature: + +```typescript +static of(value: Timestamp): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Timestamp](./firestore_.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Date value. + +Signature: + +```typescript +static of(value: Date): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Date | The Date value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Uint8Array value. + +Signature: + +```typescript +static of(value: Uint8Array): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Uint8Array | The Uint8Array value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Constant.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Constant.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Constant.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Constant.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Constant.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Constant.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Constant.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Constant.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +## Constant.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Constant.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Constant.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## Constant.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Constant.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Constant.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Constant.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Constant.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_.sum.md#sum_class) + +## Constant.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Constant.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Constant.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Constant.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Constant.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +## Constant.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +## Constant.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +## Constant.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +## Constant.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +## Constant.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +## Constant.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Constant.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Constant.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Constant.vector() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a VectorValue value. + +```typescript +// Create a Constant instance for a vector value +const vectorConstant = Constant.ofVector([1, 2, 3]); + +``` + +Signature: + +```typescript +static vector(value: number[] | VectorValue): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | + +Returns: + +[Constant](./firestore_.constant.md#constant_class) + +## Constant.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_.cosinedistance.md b/docs-devsite/firestore_.cosinedistance.md new file mode 100644 index 00000000000..794d99c6d34 --- /dev/null +++ b/docs-devsite/firestore_.cosinedistance.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CosineDistance class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CosineDistance extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_.cosinedistance.md#cosinedistanceconstructor) | | (BETA) Constructs a new instance of the CosineDistance class | + +## CosineDistance.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CosineDistance` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.count.md b/docs-devsite/firestore_.count.md new file mode 100644 index 00000000000..be4c3a37c57 --- /dev/null +++ b/docs-devsite/firestore_.count.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Count class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Count extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_.count.md#countconstructor) | | (BETA) Constructs a new instance of the Count class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_.count.md#countaccumulator) | | true | (BETA) | + +## Count.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Count` class + +Signature: + +```typescript +constructor(value: Constant | undefined, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) \| undefined | | +| distinct | boolean | | + +## Count.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.databasesource.md b/docs-devsite/firestore_.databasesource.md new file mode 100644 index 00000000000..0989b69042c --- /dev/null +++ b/docs-devsite/firestore_.databasesource.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DatabaseSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DatabaseSource implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.databasesource.md#databasesourcename) | | string | (BETA) | + +## DatabaseSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.distinct.md b/docs-devsite/firestore_.distinct.md new file mode 100644 index 00000000000..a893d3f7e47 --- /dev/null +++ b/docs-devsite/firestore_.distinct.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Distinct class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Distinct implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(groups)](./firestore_.distinct.md#distinctconstructor) | | (BETA) Constructs a new instance of the Distinct class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.distinct.md#distinctname) | | string | (BETA) | + +## Distinct.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Distinct` class + +Signature: + +```typescript +constructor(groups: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| groups | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | + +## Distinct.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.divide.md b/docs-devsite/firestore_.divide.md new file mode 100644 index 00000000000..ac77d7916d8 --- /dev/null +++ b/docs-devsite/firestore_.divide.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Divide class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Divide extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.divide.md#divideconstructor) | | (BETA) Constructs a new instance of the Divide class | + +## Divide.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Divide` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.documentssource.md b/docs-devsite/firestore_.documentssource.md new file mode 100644 index 00000000000..18ea01c0517 --- /dev/null +++ b/docs-devsite/firestore_.documentssource.md @@ -0,0 +1,92 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DocumentsSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DocumentsSource implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(docPaths)](./firestore_.documentssource.md#documentssourceconstructor) | | (BETA) Constructs a new instance of the DocumentsSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.documentssource.md#documentssourcename) | | string | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [of(refs)](./firestore_.documentssource.md#documentssourceof) | static | (BETA) | + +## DocumentsSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `DocumentsSource` class + +Signature: + +```typescript +constructor(docPaths: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| docPaths | string\[\] | | + +## DocumentsSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` + +## DocumentsSource.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(refs: DocumentReference[]): DocumentsSource; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| refs | [DocumentReference](./firestore_.documentreference.md#documentreference_class)\[\] | | + +Returns: + +[DocumentsSource](./firestore_.documentssource.md#documentssource_class) + diff --git a/docs-devsite/firestore_.dotproduct.md b/docs-devsite/firestore_.dotproduct.md new file mode 100644 index 00000000000..2e1a21700ad --- /dev/null +++ b/docs-devsite/firestore_.dotproduct.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DotProduct class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DotProduct extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_.dotproduct.md#dotproductconstructor) | | (BETA) Constructs a new instance of the DotProduct class | + +## DotProduct.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `DotProduct` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.endswith.md b/docs-devsite/firestore_.endswith.md new file mode 100644 index 00000000000..85f67657c50 --- /dev/null +++ b/docs-devsite/firestore_.endswith.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# EndsWith class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class EndsWith extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, suffix)](./firestore_.endswith.md#endswithconstructor) | | (BETA) Constructs a new instance of the EndsWith class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.endswith.md#endswithfilterable) | | true | (BETA) | + +## EndsWith.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `EndsWith` class + +Signature: + +```typescript +constructor(expr: Constant, suffix: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| suffix | [Constant](./firestore_.constant.md#constant_class) | | + +## EndsWith.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.eq.md b/docs-devsite/firestore_.eq.md new file mode 100644 index 00000000000..15cc19e3c2b --- /dev/null +++ b/docs-devsite/firestore_.eq.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Eq class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Eq extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.eq.md#eqconstructor) | | (BETA) Constructs a new instance of the Eq class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.eq.md#eqfilterable) | | true | (BETA) | + +## Eq.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Eq` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Eq.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.euclideandistance.md b/docs-devsite/firestore_.euclideandistance.md new file mode 100644 index 00000000000..240f048f42e --- /dev/null +++ b/docs-devsite/firestore_.euclideandistance.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# EuclideanDistance class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class EuclideanDistance extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_.euclideandistance.md#euclideandistanceconstructor) | | (BETA) Constructs a new instance of the EuclideanDistance class | + +## EuclideanDistance.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `EuclideanDistance` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.exists.md b/docs-devsite/firestore_.exists.md new file mode 100644 index 00000000000..459196066d4 --- /dev/null +++ b/docs-devsite/firestore_.exists.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Exists class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Exists extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.exists.md#existsconstructor) | | (BETA) Constructs a new instance of the Exists class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.exists.md#existsfilterable) | | true | (BETA) | + +## Exists.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Exists` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + +## Exists.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.exprwithalias.md b/docs-devsite/firestore_.exprwithalias.md new file mode 100644 index 00000000000..7d92f0e46fa --- /dev/null +++ b/docs-devsite/firestore_.exprwithalias.md @@ -0,0 +1,3207 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ExprWithAlias class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ExprWithAlias implements Selectable +``` +Implements: [Selectable](./firestore_.selectable.md#selectable_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, alias)](./firestore_.exprwithalias.md#exprwithaliasconstructor) | | (BETA) Constructs a new instance of the ExprWithAlias class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [alias](./firestore_.exprwithalias.md#exprwithaliasalias) | | string | (BETA) | +| [expr](./firestore_.exprwithalias.md#exprwithaliasexpr) | | T | (BETA) | +| [exprType](./firestore_.exprwithalias.md#exprwithaliasexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | +| [selectable](./firestore_.exprwithalias.md#exprwithaliasselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_.exprwithalias.md#exprwithaliasarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_.exprwithalias.md#exprwithaliasas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_.exprwithalias.md#exprwithaliasascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_.exprwithalias.md#exprwithaliasavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_.exprwithalias.md#exprwithaliasbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_.exprwithalias.md#exprwithaliascharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_.exprwithalias.md#exprwithaliascount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_.exprwithalias.md#exprwithaliasdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) | +| [exists()](./firestore_.exprwithalias.md#exprwithaliasexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_.exprwithalias.md#exprwithaliasin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_.exprwithalias.md#exprwithaliasin) | | (BETA) | +| [isNaN()](./firestore_.exprwithalias.md#exprwithaliasisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_.exprwithalias.md#exprwithaliaslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_.exprwithalias.md#exprwithaliaslike) | | (BETA) | +| [logicalMax(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_.exprwithalias.md#exprwithaliasmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_.exprwithalias.md#exprwithaliasmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_.exprwithalias.md#exprwithaliasmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [regexContains(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_.exprwithalias.md#exprwithaliasreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_.exprwithalias.md#exprwithaliasstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_.exprwithalias.md#exprwithaliassum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_.exprwithalias.md#exprwithaliastolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_.exprwithalias.md#exprwithaliastoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_.exprwithalias.md#exprwithaliastrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_.exprwithalias.md#exprwithaliasvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## ExprWithAlias.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ExprWithAlias` class + +Signature: + +```typescript +constructor(expr: T, alias: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | T | | +| alias | string | | + +## ExprWithAlias.alias + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +alias: string; +``` + +## ExprWithAlias.expr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +expr: T; +``` + +## ExprWithAlias.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## ExprWithAlias.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## ExprWithAlias.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## ExprWithAlias.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## ExprWithAlias.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## ExprWithAlias.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## ExprWithAlias.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## ExprWithAlias.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## ExprWithAlias.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## ExprWithAlias.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## ExprWithAlias.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## ExprWithAlias.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## ExprWithAlias.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## ExprWithAlias.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> + +## ExprWithAlias.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## ExprWithAlias.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_.avg.md#avg_class) + +## ExprWithAlias.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +## ExprWithAlias.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +## ExprWithAlias.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## ExprWithAlias.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## ExprWithAlias.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## ExprWithAlias.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## ExprWithAlias.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## ExprWithAlias.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## ExprWithAlias.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +## ExprWithAlias.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## ExprWithAlias.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## ExprWithAlias.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## ExprWithAlias.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## ExprWithAlias.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +## ExprWithAlias.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_.in.md#in_class) + +## ExprWithAlias.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_.isnan.md#isnan_class) + +## ExprWithAlias.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## ExprWithAlias.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## ExprWithAlias.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## ExprWithAlias.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## ExprWithAlias.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## ExprWithAlias.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## ExprWithAlias.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## ExprWithAlias.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## ExprWithAlias.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## ExprWithAlias.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## ExprWithAlias.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_.mapget.md#mapget_class) + +## ExprWithAlias.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_.max.md#max_class) + +## ExprWithAlias.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_.min.md#min_class) + +## ExprWithAlias.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## ExprWithAlias.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## ExprWithAlias.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## ExprWithAlias.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## ExprWithAlias.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## ExprWithAlias.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## ExprWithAlias.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## ExprWithAlias.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## ExprWithAlias.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## ExprWithAlias.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## ExprWithAlias.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## ExprWithAlias.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## ExprWithAlias.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## ExprWithAlias.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## ExprWithAlias.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +## ExprWithAlias.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## ExprWithAlias.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## ExprWithAlias.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## ExprWithAlias.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## ExprWithAlias.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## ExprWithAlias.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## ExprWithAlias.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## ExprWithAlias.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_.sum.md#sum_class) + +## ExprWithAlias.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## ExprWithAlias.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## ExprWithAlias.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## ExprWithAlias.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## ExprWithAlias.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +## ExprWithAlias.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +## ExprWithAlias.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +## ExprWithAlias.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +## ExprWithAlias.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +## ExprWithAlias.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +## ExprWithAlias.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## ExprWithAlias.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## ExprWithAlias.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## ExprWithAlias.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_.field.md b/docs-devsite/firestore_.field.md new file mode 100644 index 00000000000..d2406157dab --- /dev/null +++ b/docs-devsite/firestore_.field.md @@ -0,0 +1,3275 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Field class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage. + +

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. + +

You can create a `Field` instance using the static method: + +```typescript +// Create a Field instance for the 'name' field +const nameField = Field.of("name"); + +// Create a Field instance for a nested field 'address.city' +const cityField = Field.of("address.city"); + +``` + +Signature: + +```typescript +export declare class Field implements Selectable +``` +Implements: [Selectable](./firestore_.selectable.md#selectable_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_.field.md#fieldexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | +| [selectable](./firestore_.field.md#fieldselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_.field.md#fieldarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_.field.md#fieldas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_.field.md#fieldascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_.field.md#fieldavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_.field.md#fieldbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_.field.md#fieldcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_.field.md#fieldcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_.field.md#fielddescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) | +| [exists()](./firestore_.field.md#fieldexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [fieldName()](./firestore_.field.md#fieldfieldname) | | (BETA) | +| [gt(other)](./firestore_.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_.field.md#fieldin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_.field.md#fieldin) | | (BETA) | +| [isNaN()](./firestore_.field.md#fieldisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_.field.md#fieldlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_.field.md#fieldlike) | | (BETA) | +| [logicalMax(other)](./firestore_.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_.field.md#fieldmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_.field.md#fieldmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_.field.md#fieldmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(name)](./firestore_.field.md#fieldof) | static | (BETA) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). +```typescript +// Create a Field instance for the 'title' field +const titleField = Field.of("title"); + +// Create a Field instance for a nested field 'author.firstName' +const authorFirstNameField = Field.of("author.firstName"); + +``` + | +| [of(path)](./firestore_.field.md#fieldof) | static | (BETA) | +| [of(pipeline, name)](./firestore_.field.md#fieldof) | static | (BETA) | +| [regexContains(pattern)](./firestore_.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_.field.md#fieldreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_.field.md#fieldstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_.field.md#fieldsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_.field.md#fieldtimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_.field.md#fieldtimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_.field.md#fieldtimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_.field.md#fieldtolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_.field.md#fieldtoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_.field.md#fieldtrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_.field.md#fieldunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_.field.md#fieldunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_.field.md#fieldunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_.field.md#fieldvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Field.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Field.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## Field.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Field.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Field.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Field.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Field.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Field.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Field.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Field.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Field.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Field.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Field.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## Field.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> + +## Field.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Field.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_.avg.md#avg_class) + +## Field.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +## Field.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Field.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +## Field.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Field.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Field.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Field.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Field.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Field.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Field.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Field.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +## Field.fieldName() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +fieldName(): string; +``` +Returns: + +string + +## Field.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Field.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Field.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Field.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Field.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Field.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Field.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_.isnan.md#isnan_class) + +## Field.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Field.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Field.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Field.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Field.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Field.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Field.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Field.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Field.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Field.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Field.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_.mapget.md#mapget_class) + +## Field.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_.max.md#max_class) + +## Field.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_.min.md#min_class) + +## Field.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Field.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Field.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Field.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Field.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Field.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a instance representing the field at the given path. + +The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). + +```typescript +// Create a Field instance for the 'title' field +const titleField = Field.of("title"); + +// Create a Field instance for a nested field 'author.firstName' +const authorFirstNameField = Field.of("author.firstName"); + +``` + +Signature: + +```typescript +static of(name: string): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The path to the field. A new instance representing the specified field. | + +Returns: + +[Field](./firestore_.field.md#field_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(path: FieldPath): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| path | [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | | + +Returns: + +[Field](./firestore_.field.md#field_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(pipeline: Pipeline, name: string): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pipeline | [Pipeline](./firestore_.pipeline.md#pipeline_class) | | +| name | string | | + +Returns: + +[Field](./firestore_.field.md#field_class) + +## Field.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Field.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Field.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Field.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Field.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Field.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Field.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Field.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Field.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +## Field.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Field.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Field.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## Field.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Field.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Field.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Field.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Field.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_.sum.md#sum_class) + +## Field.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Field.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Field.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Field.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Field.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +## Field.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +## Field.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +## Field.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +## Field.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +## Field.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +## Field.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Field.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Field.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Field.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_.fields.md b/docs-devsite/firestore_.fields.md new file mode 100644 index 00000000000..8baec029555 --- /dev/null +++ b/docs-devsite/firestore_.fields.md @@ -0,0 +1,3210 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Fields class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Fields implements Selectable +``` +Implements: [Selectable](./firestore_.selectable.md#selectable_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_.fields.md#fieldsexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | +| [selectable](./firestore_.fields.md#fieldsselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_.fields.md#fieldsarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_.fields.md#fieldsas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_.fields.md#fieldsascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_.fields.md#fieldsavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_.fields.md#fieldsbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_.fields.md#fieldscharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_.fields.md#fieldscount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_.fields.md#fieldsdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) | +| [exists()](./firestore_.fields.md#fieldsexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [fieldList()](./firestore_.fields.md#fieldsfieldlist) | | (BETA) | +| [gt(other)](./firestore_.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_.fields.md#fieldsin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_.fields.md#fieldsin) | | (BETA) | +| [isNaN()](./firestore_.fields.md#fieldsisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_.fields.md#fieldslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_.fields.md#fieldslike) | | (BETA) | +| [logicalMax(other)](./firestore_.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_.fields.md#fieldsmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_.fields.md#fieldsmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_.fields.md#fieldsmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(name, others)](./firestore_.fields.md#fieldsof) | static | (BETA) | +| [ofAll()](./firestore_.fields.md#fieldsofall) | static | (BETA) | +| [regexContains(pattern)](./firestore_.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_.fields.md#fieldsreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_.fields.md#fieldsstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_.fields.md#fieldssum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_.fields.md#fieldstimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_.fields.md#fieldstimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_.fields.md#fieldstimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_.fields.md#fieldstolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_.fields.md#fieldstoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_.fields.md#fieldstrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_.fields.md#fieldsunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_.fields.md#fieldsunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_.fields.md#fieldsunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_.fields.md#fieldsvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Fields.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Fields.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## Fields.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Fields.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## Fields.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Fields.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## Fields.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Fields.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## Fields.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Fields.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## Fields.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Fields.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## Fields.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## Fields.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> + +## Fields.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Fields.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_.avg.md#avg_class) + +## Fields.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +## Fields.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## Fields.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +## Fields.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## Fields.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Fields.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## Fields.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Fields.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## Fields.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Fields.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## Fields.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +## Fields.fieldList() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +fieldList(): Field[]; +``` +Returns: + +[Field](./firestore_.field.md#field_class)\[\] + +## Fields.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Fields.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## Fields.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Fields.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## Fields.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Fields.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_.in.md#in_class) + +## Fields.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_.isnan.md#isnan_class) + +## Fields.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Fields.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## Fields.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Fields.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## Fields.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Fields.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## Fields.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Fields.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## Fields.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Fields.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## Fields.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_.mapget.md#mapget_class) + +## Fields.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_.max.md#max_class) + +## Fields.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_.min.md#min_class) + +## Fields.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Fields.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## Fields.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Fields.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## Fields.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Fields.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## Fields.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(name: string, ...others: string[]): Fields; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| others | string\[\] | | + +Returns: + +[Fields](./firestore_.fields.md#fields_class) + +## Fields.ofAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static ofAll(): Fields; +``` +Returns: + +[Fields](./firestore_.fields.md#fields_class) + +## Fields.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Fields.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## Fields.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Fields.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## Fields.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Fields.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## Fields.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Fields.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## Fields.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +## Fields.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Fields.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## Fields.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## Fields.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Fields.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## Fields.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Fields.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## Fields.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_.sum.md#sum_class) + +## Fields.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Fields.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## Fields.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Fields.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## Fields.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +## Fields.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +## Fields.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +## Fields.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +## Fields.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +## Fields.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +## Fields.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Fields.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Fields.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Fields.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_.filtercondition.md b/docs-devsite/firestore_.filtercondition.md new file mode 100644 index 00000000000..2665d872f9d --- /dev/null +++ b/docs-devsite/firestore_.filtercondition.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FilterCondition interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents a filter condition. + +Signature: + +```typescript +export declare interface FilterCondition +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [filterable](./firestore_.filtercondition.md#filterconditionfilterable) | true | (BETA) | + +## FilterCondition.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.findnearest.md b/docs-devsite/firestore_.findnearest.md new file mode 100644 index 00000000000..3b3f5c29744 --- /dev/null +++ b/docs-devsite/firestore_.findnearest.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FindNearest class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class FindNearest implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.findnearest.md#findnearestname) | | string | (BETA) | + +## FindNearest.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.findnearestoptions.md b/docs-devsite/firestore_.findnearestoptions.md new file mode 100644 index 00000000000..5a4835b418d --- /dev/null +++ b/docs-devsite/firestore_.findnearestoptions.md @@ -0,0 +1,86 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FindNearestOptions interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare interface FindNearestOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [distanceField](./firestore_.findnearestoptions.md#findnearestoptionsdistancefield) | string | (BETA) | +| [distanceMeasure](./firestore_.findnearestoptions.md#findnearestoptionsdistancemeasure) | 'euclidean' \| 'cosine' \| 'dot\_product' | (BETA) | +| [field](./firestore_.findnearestoptions.md#findnearestoptionsfield) | [Field](./firestore_.field.md#field_class) | (BETA) | +| [limit](./firestore_.findnearestoptions.md#findnearestoptionslimit) | number | (BETA) | +| [vectorValue](./firestore_.findnearestoptions.md#findnearestoptionsvectorvalue) | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | (BETA) | + +## FindNearestOptions.distanceField + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +distanceField?: string; +``` + +## FindNearestOptions.distanceMeasure + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; +``` + +## FindNearestOptions.field + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +field: Field; +``` + +## FindNearestOptions.limit + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +limit?: number; +``` + +## FindNearestOptions.vectorValue + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +vectorValue: VectorValue | number[]; +``` diff --git a/docs-devsite/firestore_.firestore.md b/docs-devsite/firestore_.firestore.md index 01267d5b2d3..a8b7561a3ba 100644 --- a/docs-devsite/firestore_.firestore.md +++ b/docs-devsite/firestore_.firestore.md @@ -31,6 +31,7 @@ export declare class Firestore | Method | Modifiers | Description | | --- | --- | --- | +| [pipeline()](./firestore_.firestore.md#firestorepipeline) | | Pipeline query. | | [toJSON()](./firestore_.firestore.md#firestoretojson) | | Returns a JSON-serializable representation of this Firestore instance. | ## Firestore.app @@ -53,6 +54,19 @@ Whether it's a [Firestore](./firestore_.firestore.md#firestore_class) or Firesto type: 'firestore-lite' | 'firestore'; ``` +## Firestore.pipeline() + +Pipeline query. + +Signature: + +```typescript +pipeline(): PipelineSource; +``` +Returns: + +[PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) + ## Firestore.toJSON() Returns a JSON-serializable representation of this `Firestore` instance. diff --git a/docs-devsite/firestore_.firestorefunction.md b/docs-devsite/firestore_.firestorefunction.md new file mode 100644 index 00000000000..43022c17c72 --- /dev/null +++ b/docs-devsite/firestore_.firestorefunction.md @@ -0,0 +1,3173 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FirestoreFunction class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution. + +Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. + +Signature: + +```typescript +export declare class FirestoreFunction +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(name, params)](./firestore_.firestorefunction.md#firestorefunctionconstructor) | | (BETA) Constructs a new instance of the FirestoreFunction class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_.firestorefunction.md#firestorefunctionexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_.firestorefunction.md#firestorefunctionarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_.firestorefunction.md#firestorefunctionas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_.firestorefunction.md#firestorefunctionascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_.firestorefunction.md#firestorefunctionavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_.firestorefunction.md#firestorefunctionbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_.firestorefunction.md#firestorefunctioncharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_.firestorefunction.md#firestorefunctioncount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_.firestorefunction.md#firestorefunctiondescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) | +| [exists()](./firestore_.firestorefunction.md#firestorefunctionexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_.firestorefunction.md#firestorefunctionin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_.firestorefunction.md#firestorefunctionin) | | (BETA) | +| [isNaN()](./firestore_.firestorefunction.md#firestorefunctionisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_.firestorefunction.md#firestorefunctionlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_.firestorefunction.md#firestorefunctionlike) | | (BETA) | +| [logicalMax(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_.firestorefunction.md#firestorefunctionmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_.firestorefunction.md#firestorefunctionmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_.firestorefunction.md#firestorefunctionmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [regexContains(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_.firestorefunction.md#firestorefunctionreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_.firestorefunction.md#firestorefunctionstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_.firestorefunction.md#firestorefunctionsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_.firestorefunction.md#firestorefunctiontolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_.firestorefunction.md#firestorefunctiontoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_.firestorefunction.md#firestorefunctiontrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_.firestorefunction.md#firestorefunctionvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## FirestoreFunction.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `FirestoreFunction` class + +Signature: + +```typescript +constructor(name: string, params: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| params | [Constant](./firestore_.constant.md#constant_class)\[\] | | + +## FirestoreFunction.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## FirestoreFunction.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## FirestoreFunction.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +## FirestoreFunction.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## FirestoreFunction.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +## FirestoreFunction.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## FirestoreFunction.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +## FirestoreFunction.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## FirestoreFunction.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +## FirestoreFunction.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## FirestoreFunction.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +## FirestoreFunction.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## FirestoreFunction.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> + +## FirestoreFunction.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## FirestoreFunction.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_.avg.md#avg_class) + +## FirestoreFunction.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +## FirestoreFunction.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +## FirestoreFunction.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +## FirestoreFunction.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## FirestoreFunction.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +## FirestoreFunction.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## FirestoreFunction.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +## FirestoreFunction.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## FirestoreFunction.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +## FirestoreFunction.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## FirestoreFunction.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +## FirestoreFunction.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## FirestoreFunction.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +## FirestoreFunction.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +## FirestoreFunction.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_.in.md#in_class) + +## FirestoreFunction.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_.isnan.md#isnan_class) + +## FirestoreFunction.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## FirestoreFunction.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_.like.md#like_class) + +## FirestoreFunction.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## FirestoreFunction.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +## FirestoreFunction.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## FirestoreFunction.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +## FirestoreFunction.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## FirestoreFunction.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +## FirestoreFunction.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## FirestoreFunction.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +## FirestoreFunction.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_.mapget.md#mapget_class) + +## FirestoreFunction.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_.max.md#max_class) + +## FirestoreFunction.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_.min.md#min_class) + +## FirestoreFunction.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## FirestoreFunction.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +## FirestoreFunction.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## FirestoreFunction.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +## FirestoreFunction.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## FirestoreFunction.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_.neq.md#neq_class) + +## FirestoreFunction.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## FirestoreFunction.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) + +## FirestoreFunction.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## FirestoreFunction.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +## FirestoreFunction.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## FirestoreFunction.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +## FirestoreFunction.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## FirestoreFunction.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +## FirestoreFunction.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +## FirestoreFunction.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## FirestoreFunction.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +## FirestoreFunction.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## FirestoreFunction.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## FirestoreFunction.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_.strcontains.md#strcontains_class) + +## FirestoreFunction.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## FirestoreFunction.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_.subtract.md#subtract_class) + +## FirestoreFunction.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_.sum.md#sum_class) + +## FirestoreFunction.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## FirestoreFunction.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +## FirestoreFunction.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## FirestoreFunction.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +## FirestoreFunction.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +## FirestoreFunction.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +## FirestoreFunction.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +## FirestoreFunction.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +## FirestoreFunction.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +## FirestoreFunction.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +## FirestoreFunction.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## FirestoreFunction.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## FirestoreFunction.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## FirestoreFunction.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_.genericstage.md b/docs-devsite/firestore_.genericstage.md new file mode 100644 index 00000000000..765ef090d87 --- /dev/null +++ b/docs-devsite/firestore_.genericstage.md @@ -0,0 +1,65 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenericStage class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class GenericStage implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(name, params)](./firestore_.genericstage.md#genericstageconstructor) | | (BETA) Constructs a new instance of the GenericStage class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.genericstage.md#genericstagename) | | string | (BETA) | + +## GenericStage.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `GenericStage` class + +Signature: + +```typescript +constructor(name: string, params: unknown[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| params | unknown\[\] | | + +## GenericStage.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.gt.md b/docs-devsite/firestore_.gt.md new file mode 100644 index 00000000000..75843e172d7 --- /dev/null +++ b/docs-devsite/firestore_.gt.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Gt class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Gt extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.gt.md#gtconstructor) | | (BETA) Constructs a new instance of the Gt class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.gt.md#gtfilterable) | | true | (BETA) | + +## Gt.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Gt` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Gt.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.gte.md b/docs-devsite/firestore_.gte.md new file mode 100644 index 00000000000..923ece3ab8d --- /dev/null +++ b/docs-devsite/firestore_.gte.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Gte class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Gte extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.gte.md#gteconstructor) | | (BETA) Constructs a new instance of the Gte class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.gte.md#gtefilterable) | | true | (BETA) | + +## Gte.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Gte` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Gte.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.if.md b/docs-devsite/firestore_.if.md new file mode 100644 index 00000000000..4f756b032b4 --- /dev/null +++ b/docs-devsite/firestore_.if.md @@ -0,0 +1,68 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# If class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class If extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(condition, thenExpr, elseExpr)](./firestore_.if.md#ifconstructor) | | (BETA) Constructs a new instance of the If class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.if.md#iffilterable) | | true | (BETA) | + +## If.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `If` class + +Signature: + +```typescript +constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterExpr](./firestore_.md#filterexpr) | | +| thenExpr | [Constant](./firestore_.constant.md#constant_class) | | +| elseExpr | [Constant](./firestore_.constant.md#constant_class) | | + +## If.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.in.md b/docs-devsite/firestore_.in.md new file mode 100644 index 00000000000..76f38733041 --- /dev/null +++ b/docs-devsite/firestore_.in.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# In class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class In extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, others)](./firestore_.in.md#inconstructor) | | (BETA) Constructs a new instance of the In class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.in.md#infilterable) | | true | (BETA) | + +## In.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `In` class + +Signature: + +```typescript +constructor(left: Constant, others: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | | + +## In.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.isnan.md b/docs-devsite/firestore_.isnan.md new file mode 100644 index 00000000000..bbeb8e4fa51 --- /dev/null +++ b/docs-devsite/firestore_.isnan.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# IsNan class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class IsNan extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.isnan.md#isnanconstructor) | | (BETA) Constructs a new instance of the IsNan class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.isnan.md#isnanfilterable) | | true | (BETA) | + +## IsNan.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `IsNan` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + +## IsNan.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.like.md b/docs-devsite/firestore_.like.md new file mode 100644 index 00000000000..94e680dd723 --- /dev/null +++ b/docs-devsite/firestore_.like.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Like class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Like extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_.like.md#likeconstructor) | | (BETA) Constructs a new instance of the Like class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.like.md#likefilterable) | | true | (BETA) | + +## Like.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Like` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +## Like.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.limit.md b/docs-devsite/firestore_.limit.md new file mode 100644 index 00000000000..81ad7339037 --- /dev/null +++ b/docs-devsite/firestore_.limit.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Limit class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Limit implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(limit)](./firestore_.limit.md#limitconstructor) | | (BETA) Constructs a new instance of the Limit class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.limit.md#limitname) | | string | (BETA) | + +## Limit.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Limit` class + +Signature: + +```typescript +constructor(limit: number); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| limit | number | | + +## Limit.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.logicalmax.md b/docs-devsite/firestore_.logicalmax.md new file mode 100644 index 00000000000..633947cdaba --- /dev/null +++ b/docs-devsite/firestore_.logicalmax.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LogicalMax class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class LogicalMax extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.logicalmax.md#logicalmaxconstructor) | | (BETA) Constructs a new instance of the LogicalMax class | + +## LogicalMax.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `LogicalMax` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.logicalmin.md b/docs-devsite/firestore_.logicalmin.md new file mode 100644 index 00000000000..65bf7ad5dc1 --- /dev/null +++ b/docs-devsite/firestore_.logicalmin.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LogicalMin class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class LogicalMin extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.logicalmin.md#logicalminconstructor) | | (BETA) Constructs a new instance of the LogicalMin class | + +## LogicalMin.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `LogicalMin` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.lt.md b/docs-devsite/firestore_.lt.md new file mode 100644 index 00000000000..54911158139 --- /dev/null +++ b/docs-devsite/firestore_.lt.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Lt class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Lt extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.lt.md#ltconstructor) | | (BETA) Constructs a new instance of the Lt class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.lt.md#ltfilterable) | | true | (BETA) | + +## Lt.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Lt` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Lt.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.lte.md b/docs-devsite/firestore_.lte.md new file mode 100644 index 00000000000..7bd5cbe4420 --- /dev/null +++ b/docs-devsite/firestore_.lte.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Lte class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Lte extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.lte.md#lteconstructor) | | (BETA) Constructs a new instance of the Lte class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.lte.md#ltefilterable) | | true | (BETA) | + +## Lte.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Lte` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Lte.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.mapget.md b/docs-devsite/firestore_.mapget.md new file mode 100644 index 00000000000..c2fe330f2f3 --- /dev/null +++ b/docs-devsite/firestore_.mapget.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MapGet class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class MapGet extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(map, name)](./firestore_.mapget.md#mapgetconstructor) | | (BETA) Constructs a new instance of the MapGet class | + +## MapGet.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `MapGet` class + +Signature: + +```typescript +constructor(map: Constant, name: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| map | [Constant](./firestore_.constant.md#constant_class) | | +| name | string | | + diff --git a/docs-devsite/firestore_.max.md b/docs-devsite/firestore_.max.md new file mode 100644 index 00000000000..5fe1c376f93 --- /dev/null +++ b/docs-devsite/firestore_.max.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Max class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Max extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_.max.md#maxconstructor) | | (BETA) Constructs a new instance of the Max class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_.max.md#maxaccumulator) | | true | (BETA) | + +## Max.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Max` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| distinct | boolean | | + +## Max.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index 74e960c833b..78db4044e17 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -34,6 +34,7 @@ https://github.com/firebase/firebase-js-sdk | [namedQuery(firestore, name)](./firestore_.md#namedquery_6438876) | Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name.The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using loadBundle. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. | | [onSnapshotsInSync(firestore, observer)](./firestore_.md#onsnapshotsinsync_2f0dfa4) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [onSnapshotsInSync(firestore, onSync)](./firestore_.md#onsnapshotsinsync_1901c06) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | +| [pipeline(firestore)](./firestore_.md#pipeline_231a8e0) | Experimental Modular API for console testing. | | [runTransaction(firestore, updateFunction, options)](./firestore_.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | | [setIndexConfiguration(firestore, configuration)](./firestore_.md#setindexconfiguration_c362f04) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. | | [setIndexConfiguration(firestore, json)](./firestore_.md#setindexconfiguration_90d0285) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. Invoke either enableIndexedDbPersistence() or enableMultiTabIndexedDbPersistence() before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored.The method accepts the JSON format exported by the Firebase CLI (firebase firestore:indexes). If the JSON format is invalid, this method throws an error. | @@ -42,2418 +43,9439 @@ https://github.com/firebase/firebase-js-sdk | [writeBatch(firestore)](./firestore_.md#writebatch_231a8e0) | Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500.Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. | | function() | | [count()](./firestore_.md#count) | Create an AggregateField object that can be used to compute the count of documents in the result set of a query. | +| [countAll()](./firestore_.md#countall) | (BETA) Creates an aggregation that counts the total number of stage inputs. +```typescript +// Count the total number of users +countAll().as("totalUsers"); + +``` + A new representing the 'countAll' aggregation. | | [deleteField()](./firestore_.md#deletefield) | Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with {merge: true} to mark a field for deletion. | | [documentId()](./firestore_.md#documentid) | Returns a special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. | | [getFirestore()](./firestore_.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [memoryEagerGarbageCollector()](./firestore_.md#memoryeagergarbagecollector) | Creates an instance of MemoryEagerGarbageCollector. This is also the default garbage collector unless it is explicitly specified otherwise. | | [persistentMultipleTabManager()](./firestore_.md#persistentmultipletabmanager) | Creates an instance of PersistentMultipleTabManager. | | [serverTimestamp()](./firestore_.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | +| [useFirestorePipelines()](./firestore_.md#usefirestorepipelines) | | +| function(array, ...) | +| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); + +``` + | +| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_21991c1) | (BETA) Creates an expression that concatenates an array expression with other arrays and/or values. +```typescript +// Combine the 'tags' array with a new array +arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); + +``` + | +| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_f8d5d5e) | (BETA) Creates an expression that concatenates a field's array value with other arrays. +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + +``` + | +| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_5a66d99) | (BETA) Creates an expression that concatenates a field's array value with other arrays and/or values. +```typescript +// Combine the 'tags' array with a new array +arrayConcat("tags", ["newTag1", "newTag2"]); + +``` + | +| [arrayContains(array, element)](./firestore_.md#arraycontains_01ea7c0) | (BETA) Creates an expression that checks if an array expression contains a specific element. +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains(Field.of("colors"), Field.of("selectedColor")); + +``` + | +| [arrayContains(array, element)](./firestore_.md#arraycontains_60f8f2f) | (BETA) Creates an expression that checks if an array expression contains a specific element. +```typescript +// Check if the 'colors' array contains "red" +arrayContains(Field.of("colors"), "red"); + +``` + | +| [arrayContains(array, element)](./firestore_.md#arraycontains_0ebdbfe) | (BETA) Creates an expression that checks if a field's array value contains a specific element. +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains("colors", Field.of("selectedColor")); + +``` + | +| [arrayContains(array, element)](./firestore_.md#arraycontains_8f718df) | (BETA) Creates an expression that checks if a field's array value contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +arrayContains("colors", "red"); + +``` + | +| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_7b7433a) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_d919466) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_7b7433a) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_d919466) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + | +| [arrayLength(array)](./firestore_.md#arraylength_0bb5dbb) | (BETA) Creates an expression that calculates the length of an array expression. +```typescript +// Get the number of items in the 'cart' array +arrayLength(Field.of("cart")); + +``` + | +| function(condition, ...) | +| [ifFunction(condition, thenExpr, elseExpr)](./firestore_.md#iffunction_f7b2404) | (BETA) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. +```typescript +// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". +ifFunction( + gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + +``` + | | function(databaseId, ...) | | [getFirestore(databaseId)](./firestore_.md#getfirestore_53dc891) | (BETA) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| function(element, ...) | +| [inAny(element, others)](./firestore_.md#inany_a73b259) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_.md#inany_f5721c6) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_.md#inany_c6646ea) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_.md#inany_e6877aa) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", ["Electronics", Field.of("primaryType")]); + +``` + | +| [notInAny(element, others)](./firestore_.md#notinany_a73b259) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_.md#notinany_f5721c6) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_.md#notinany_c6646ea) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_.md#notinany_e6877aa) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", ["pending", Field.of("rejectedStatus")]); + +``` + | | function(elements, ...) | | [arrayRemove(elements)](./firestore_.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | -| function(field, ...) | -| [average(field)](./firestore_.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | -| [sum(field)](./firestore_.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | -| function(fieldPath, ...) | -| [orderBy(fieldPath, directionStr)](./firestore_.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | -| [where(fieldPath, opStr, value)](./firestore_.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | -| function(fieldValues, ...) | -| [endAt(fieldValues)](./firestore_.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [endBefore(fieldValues)](./firestore_.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAfter(fieldValues)](./firestore_.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAt(fieldValues)](./firestore_.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| function(indexManager, ...) | -| [deleteAllPersistentCacheIndexes(indexManager)](./firestore_.md#deleteallpersistentcacheindexes_98b2645) | Removes all persistent cache indexes.Please note this function will also deletes indexes generated by setIndexConfiguration(), which is deprecated. | -| [disablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#disablepersistentcacheindexautocreation_98b2645) | Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling enablePersistentCacheIndexAutoCreation() still take effect. | -| [enablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#enablepersistentcacheindexautocreation_98b2645) | Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance.This feature is disabled by default. | -| function(left, ...) | -| [aggregateFieldEqual(left, right)](./firestore_.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | -| [aggregateQuerySnapshotEqual(left, right)](./firestore_.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | -| [queryEqual(left, right)](./firestore_.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | -| [refEqual(left, right)](./firestore_.md#refequal_598b780) | Returns true if the provided references are equal. | -| [snapshotEqual(left, right)](./firestore_.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | -| function(limit, ...) | -| [limit(limit)](./firestore_.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | -| [limitToLast(limit)](./firestore_.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | -| function(logLevel, ...) | -| [setLogLevel(logLevel)](./firestore_.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | -| function(n, ...) | -| [increment(n)](./firestore_.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | -| function(query, ...) | -| [getAggregateFromServer(query, aggregateSpec)](./firestore_.md#getaggregatefromserver_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | -| [getCountFromServer(query)](./firestore_.md#getcountfromserver_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | -| [getDocs(query)](./firestore_.md#getdocs_4e56953) | Executes the query and returns the results as a QuerySnapshot.Note: getDocs() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). | -| [getDocsFromCache(query)](./firestore_.md#getdocsfromcache_4e56953) | Executes the query and returns the results as a QuerySnapshot from cache. Returns an empty result set if no documents matching the query are currently cached. | -| [getDocsFromServer(query)](./firestore_.md#getdocsfromserver_4e56953) | Executes the query and returns the results as a QuerySnapshot from the server. Returns an error if the network is not available. | -| [onSnapshot(query, observer)](./firestore_.md#onsnapshot_8d14049) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, options, observer)](./firestore_.md#onsnapshot_03dfff5) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_3ebfbe2) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_b8f9c47) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [query(query, compositeFilter, queryConstraints)](./firestore_.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | -| [query(query, queryConstraints)](./firestore_.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | -| function(queryConstraints, ...) | -| [and(queryConstraints)](./firestore_.md#and_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. | -| [or(queryConstraints)](./firestore_.md#or_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. | -| function(reference, ...) | -| [addDoc(reference, data)](./firestore_.md#adddoc_6e783ff) | Add a new document to specified CollectionReference with the given data, assigning it a document ID automatically. | -| [collection(reference, path, pathSegments)](./firestore_.md#collection_568f98d) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | -| [collection(reference, path, pathSegments)](./firestore_.md#collection_70b4396) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | -| [deleteDoc(reference)](./firestore_.md#deletedoc_4569087) | Deletes the document referred to by the specified DocumentReference. | -| [doc(reference, path, pathSegments)](./firestore_.md#doc_568f98d) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned DocumentReference. | -| [doc(reference, path, pathSegments)](./firestore_.md#doc_70b4396) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. | -| [getDoc(reference)](./firestore_.md#getdoc_4569087) | Reads the document referred to by this DocumentReference.Note: getDoc() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). | -| [getDocFromCache(reference)](./firestore_.md#getdocfromcache_4569087) | Reads the document referred to by this DocumentReference from cache. Returns an error if the document is not currently cached. | -| [getDocFromServer(reference)](./firestore_.md#getdocfromserver_4569087) | Reads the document referred to by this DocumentReference from the server. Returns an error if the network is not available. | -| [onSnapshot(reference, observer)](./firestore_.md#onsnapshot_0312fd7) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, options, observer)](./firestore_.md#onsnapshot_86b6b9e) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_905f42c) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_0c39991) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [setDoc(reference, data)](./firestore_.md#setdoc_ee215ad) | Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created. | -| [setDoc(reference, data, options)](./firestore_.md#setdoc_ff80739) | Writes to the document referred to by the specified DocumentReference. If the document does not yet exist, it will be created. If you provide merge or mergeFields, the provided data can be merged into an existing document. | -| [updateDoc(reference, data)](./firestore_.md#updatedoc_51a65e3) | Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist. | -| [updateDoc(reference, field, value, moreFieldsAndValues)](./firestore_.md#updatedoc_7c28659) | Updates fields in the document referred to by the specified DocumentReference The update will fail if applied to a document that does not exist.Nested fields can be updated by providing dot-separated field path strings or by providing FieldPath objects. | -| function(settings, ...) | -| [memoryLocalCache(settings)](./firestore_.md#memorylocalcache_05f4bf2) | Creates an instance of MemoryLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use. | -| [memoryLruGarbageCollector(settings)](./firestore_.md#memorylrugarbagecollector_5ee014c) | Creates an instance of MemoryLruGarbageCollector.A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). | -| [persistentLocalCache(settings)](./firestore_.md#persistentlocalcache_d312f71) | Creates an instance of PersistentLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use.Persistent cache cannot be used in a Node.js environment. | -| [persistentSingleTabManager(settings)](./firestore_.md#persistentsingletabmanager_c99c68d) | Creates an instance of PersistentSingleTabManager. | -| function(snapshot, ...) | -| [endAt(snapshot)](./firestore_.md#endat_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [endBefore(snapshot)](./firestore_.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [startAfter(snapshot)](./firestore_.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [startAt(snapshot)](./firestore_.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | -| function(values, ...) | -| [vector(values)](./firestore_.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | +| function(expr, ...) | +| [ascending(expr)](./firestore_.md#ascending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +firestore.pipeline().collection("users") + .sort(ascending(Field.of("name"))); -## Classes +``` + | +| [byteLength(expr)](./firestore_.md#bytelength_f3fb767) | (BETA) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength(Field.of("myString")); -| Class | Description | -| --- | --- | -| [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | -| [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | -| [Bytes](./firestore_.bytes.md#bytes_class) | An immutable object representing an array of bytes. | -| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | -| [DocumentReference](./firestore_.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | -| [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | -| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | -| [FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | -| [Firestore](./firestore_.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | -| [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | -| [GeoPoint](./firestore_.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | -| [LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) | Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.The API is compatible with Promise<LoadBundleTaskProgress>. | -| [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | A PersistentCacheIndexManager for configuring persistent cache indexes used for local query execution.To use, call getPersistentCacheIndexManager() to get an instance. | -| [Query](./firestore_.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | -| [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | -| [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | -| [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | -| [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | -| [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | -| [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | -| [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | -| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | -| [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | -| [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. | -| [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | -| [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | -| [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | +``` + | +| [charLength(expr)](./firestore_.md#charlength_f3fb767) | (BETA) Creates an expression that calculates the character length of a string expression in UTF-8. +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength(Field.of("name")); -## Interfaces +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_b4c7dc2) | (BETA) Calculates the Cosine distance between a field's vector value and a double array. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", [37.7749, -122.4194]); -| Interface | Description | -| --- | --- | -| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | -| [DocumentChange](./firestore_.documentchange.md#documentchange_interface) | A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred. | -| [DocumentData](./firestore_.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | -| [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.Note: This interface is "experimental" and is subject to change.See FirestoreSettings.experimentalAutoDetectLongPolling, FirestoreSettings.experimentalForceLongPolling, and FirestoreSettings.experimentalLongPollingOptions. | -| [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | -| [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | -| [Index](./firestore_.index.md#index_interface) | (BETA) The SDK definition of a Firestore index. | -| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (BETA) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | -| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (BETA) A single field element in an index configuration. | -| [LoadBundleTaskProgress](./firestore_.loadbundletaskprogress.md#loadbundletaskprogress_interface) | Represents a progress update or a final state from loading bundles. | -| [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | An settings object to configure an MemoryLocalCache instance. | -| [MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) | A garbage collector deletes documents whenever they are not part of any active queries, and have no local mutations attached to them.This collector tries to ensure lowest memory footprints from the SDK, at the risk of documents not being cached for offline queries or for direct queries to the cache.Use factory function to create an instance of this collector. | -| [MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) | Provides an in-memory cache to the SDK. This is the default cache unless explicitly configured otherwise.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | -| [MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) | A garbage collector deletes Least-Recently-Used documents in multiple batches.This collector is configured with a target size, and will only perform collection when the cached documents exceed the target size. It avoids querying backend repeated for the same query or document, at the risk of having a larger memory footprint.Use factory function to create a instance of this collector. | -| [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Settings that can be passed to enableIndexedDbPersistence() to configure Firestore persistence.Persistence cannot be used in a Node.js environment. | -| [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | An settings object to configure an PersistentLocalCache instance.Persistent cache cannot be used in a Node.js environment. | -| [PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) | Provides a persistent cache backed by IndexedDb to the SDK.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | -| [PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) | A tab manager supporting multiple tabs. SDK will synchronize queries and mutations done across all tabs using the SDK. | -| [PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) | A tab manager supporting only one tab, no synchronization will be performed across tabs. | -| [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) | Type to configure an PersistentSingleTabManager instance. | -| [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | An options object that can be passed to [onSnapshot()](./firestore_.md#onsnapshot_0312fd7) and [QuerySnapshot.docChanges()](./firestore_.querysnapshot.md#querysnapshotdocchanges) to control which types of changes to include in the result set. | -| [SnapshotOptions](./firestore_.snapshotoptions.md#snapshotoptions_interface) | Options that configure how data is retrieved from a DocumentSnapshot (for example the desired behavior for server timestamps that have not yet been set to their final value). | -| [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | -| [Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) | A function returned by onSnapshot() that removes the listener when invoked. | +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_8d2bd9d) | (BETA) Calculates the Cosine distance between a field's vector value and a VectorValue. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", new VectorValue([37.7749, -122.4194])); -## Variables +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_c9ae0bc) | (BETA) Calculates the Cosine distance between a field's vector value and a vector expression. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance("userVector", Field.of("itemVector")); -| Variable | Description | -| --- | --- | -| [CACHE\_SIZE\_UNLIMITED](./firestore_.md#cache_size_unlimited) | Constant used to indicate the LRU garbage collection should be disabled. Set this value as the cacheSizeBytes on the settings passed to the [Firestore](./firestore_.firestore.md#firestore_class) instance. | +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_e701952) | (BETA) Calculates the Cosine distance between a vector expression and a double array. +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), [37.7749, -122.4194]); -## Type Aliases +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_cc2e83e) | (BETA) Calculates the Cosine distance between a vector expression and a VectorValue. +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); -| Type Alias | Description | -| --- | --- | -| [AddPrefixToKeys](./firestore_.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | -| [AggregateFieldType](./firestore_.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | -| [AggregateSpecData](./firestore_.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | -| [AggregateType](./firestore_.md#aggregatetype) | Union type representing the aggregate type to be performed. | -| [ChildUpdateFields](./firestore_.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | -| [DocumentChangeType](./firestore_.md#documentchangetype) | The type of a DocumentChange may be 'added', 'removed', or 'modified'. | -| [FirestoreErrorCode](./firestore_.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | -| [FirestoreLocalCache](./firestore_.md#firestorelocalcache) | Union type from all supported SDK cache layer. | -| [ListenSource](./firestore_.md#listensource) | Describe the source a query listens to.Set to default to listen to both cache and server changes. Set to cache to listen to changes in cache only. | -| [MemoryGarbageCollector](./firestore_.md#memorygarbagecollector) | Union type from all support garbage collectors for memory local cache. | -| [NestedUpdateFields](./firestore_.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | -| [OrderByDirection](./firestore_.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | -| [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | -| [PersistentTabManager](./firestore_.md#persistenttabmanager) | A union of all available tab managers. | -| [Primitive](./firestore_.md#primitive) | Primitive types. | -| [QueryConstraintType](./firestore_.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | -| [QueryFilterConstraint](./firestore_.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | -| [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | -| [SetOptions](./firestore_.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | -| [TaskState](./firestore_.md#taskstate) | Represents the state of bundle loading tasks.Both 'Error' and 'Success' are sinking state: task will abort or complete and there will be no more updates after they are reported. | -| [UnionToIntersection](./firestore_.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | -| [UpdateData](./firestore_.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | -| [WhereFilterOp](./firestore_.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | +``` + | +| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_0896fbd) | (BETA) Calculates the Cosine distance between two vector expressions. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance(Field.of("userVector"), Field.of("itemVector")); + +``` + | +| [descending(expr)](./firestore_.md#descending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") + .sort(descending(Field.of("createdAt"))); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_b4c7dc2) | (BETA) Calculates the dot product between a field's vector value and a double array. +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", [0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_8d2bd9d) | (BETA) Calculates the dot product between a field's vector value and a VectorValue. +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_c9ae0bc) | (BETA) Calculates the dot product between a field's vector value and a vector expression. +```typescript +// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' +dotProduct("docVector1", Field.of("docVector2")); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_e701952) | (BETA) Calculates the dot product between a vector expression and a double array. +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_cc2e83e) | (BETA) Calculates the dot product between a vector expression and a VectorValue. +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(expr, other)](./firestore_.md#dotproduct_0896fbd) | (BETA) Calculates the dot product between two vector expressions. +```typescript +// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' +dotProduct(Field.of("docVector1"), Field.of("docVector2")); + +``` + | +| [endsWith(expr, suffix)](./firestore_.md#endswith_88569cd) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +endsWith("filename", ".txt"); + +``` + | +| [endsWith(expr, suffix)](./firestore_.md#endswith_e2e794e) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +endsWith("url", Field.of("extension")); + +``` + | +| [endsWith(expr, suffix)](./firestore_.md#endswith_6308b81) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), "Jr."); + +``` + | +| [endsWith(expr, suffix)](./firestore_.md#endswith_ab1cc39) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), Constant.of("Jr.")); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_b4c7dc2) | (BETA) Calculates the Euclidean distance between a field's vector value and a double array. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", [37.7749, -122.4194]); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_8d2bd9d) | (BETA) Calculates the Euclidean distance between a field's vector value and a VectorValue. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_c9ae0bc) | (BETA) Calculates the Euclidean distance between a field's vector value and a vector expression. +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance("pointA", Field.of("pointB")); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_e701952) | (BETA) Calculates the Euclidean distance between a vector expression and a double array. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location + +euclideanDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_cc2e83e) | (BETA) Calculates the Euclidean distance between a vector expression and a VectorValue. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_0896fbd) | (BETA) Calculates the Euclidean distance between two vector expressions. +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance(Field.of("pointA"), Field.of("pointB")); + +``` + | +| [reverse(expr)](./firestore_.md#reverse_f3fb767) | (BETA) Creates an expression that reverses a string. +```typescript +// Reverse the value of the 'myString' field. +reverse(Field.of("myString")); + +``` + | +| [startsWith(expr, prefix)](./firestore_.md#startswith_484d9f3) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +startsWith("name", "Mr."); + +``` + | +| [startsWith(expr, prefix)](./firestore_.md#startswith_7deb5c7) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +startsWith("fullName", Field.of("firstName")); + +``` + | +| [startsWith(expr, prefix)](./firestore_.md#startswith_68300d1) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), "Mr."); + +``` + | +| [startsWith(expr, prefix)](./firestore_.md#startswith_5774b68) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), Field.of("prefix")); + +``` + | +| [timestampToUnixMicros(expr)](./firestore_.md#timestamptounixmicros_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros(Field.of("timestamp")); + +``` + | +| [timestampToUnixMillis(expr)](./firestore_.md#timestamptounixmillis_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis(Field.of("timestamp")); + +``` + | +| [timestampToUnixSeconds(expr)](./firestore_.md#timestamptounixseconds_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds(Field.of("timestamp")); + +``` + | +| [toLower(expr)](./firestore_.md#tolower_1e536ed) | (BETA) Creates an expression that converts a string field to lowercase. +```typescript +// Convert the 'name' field to lowercase +toLower("name"); + +``` + | +| [toLower(expr)](./firestore_.md#tolower_f3fb767) | (BETA) Creates an expression that converts a string expression to lowercase. +```typescript +// Convert the 'name' field to lowercase +toLower(Field.of("name")); + +``` + | +| [toUpper(expr)](./firestore_.md#toupper_1e536ed) | (BETA) Creates an expression that converts a string field to uppercase. +```typescript +// Convert the 'title' field to uppercase +toUpper("title"); + +``` + | +| [toUpper(expr)](./firestore_.md#toupper_f3fb767) | (BETA) Creates an expression that converts a string expression to uppercase. +```typescript +// Convert the 'title' field to uppercase +toUppercase(Field.of("title")); + +``` + | +| [trim(expr)](./firestore_.md#trim_1e536ed) | (BETA) Creates an expression that removes leading and trailing whitespace from a string field. +```typescript +// Trim whitespace from the 'userInput' field +trim("userInput"); + +``` + | +| [trim(expr)](./firestore_.md#trim_f3fb767) | (BETA) Creates an expression that removes leading and trailing whitespace from a string expression. +```typescript +// Trim whitespace from the 'userInput' field +trim(Field.of("userInput")); + +``` + | +| [unixMicrosToTimestamp(expr)](./firestore_.md#unixmicrostotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp(Field.of("microseconds")); + +``` + | +| [unixMillisToTimestamp(expr)](./firestore_.md#unixmillistotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp(Field.of("milliseconds")); + +``` + | +| [unixSecondsToTimestamp(expr)](./firestore_.md#unixsecondstotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp(Field.of("seconds")); + +``` + | +| [vectorLength(expr)](./firestore_.md#vectorlength_f3fb767) | (BETA) Creates an expression that calculates the length of a Firestore Vector. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength(Field.of("embedding")); + +``` + | +| function(field, ...) | +| [average(field)](./firestore_.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | +| [byteLength(field)](./firestore_.md#bytelength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength("myString"); + +``` + | +| [charLength(field)](./firestore_.md#charlength_0fb8cd4) | (BETA) Creates an expression that calculates the character length of a string field in UTF8. +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength("name"); + +``` + | +| [exists(field)](./firestore_.md#exists_0fb8cd4) | (BETA) Creates an expression that checks if a field exists. +```typescript +// Check if the document has a field named "phoneNumber" +exists("phoneNumber"); + +``` + | +| [replaceAll(field, find, replace)](./firestore_.md#replaceall_b257ab0) | (BETA) Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll("message", "hello", "hi"); + +``` + | +| [replaceFirst(field, find, replace)](./firestore_.md#replacefirst_b257ab0) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst("message", "hello", "hi"); + +``` + | +| [reverse(field)](./firestore_.md#reverse_0fb8cd4) | (BETA) Creates an expression that reverses a string represented by a field. +```typescript +// Reverse the value of the 'myString' field. +reverse("myString"); + +``` + | +| [sum(field)](./firestore_.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | +| [timestampAdd(field, unit, amount)](./firestore_.md#timestampadd_565792c) | (BETA) Creates an expression that adds a specified amount of time to a timestamp represented by a field. +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd("timestamp", "day", 1); + +``` + | +| [timestampSub(field, unit, amount)](./firestore_.md#timestampsub_565792c) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub("timestamp", "day", 1); + +``` + | +| [timestampToUnixMicros(field)](./firestore_.md#timestamptounixmicros_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros("timestamp"); + +``` + | +| [timestampToUnixMillis(field)](./firestore_.md#timestamptounixmillis_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis("timestamp"); + +``` + | +| [timestampToUnixSeconds(field)](./firestore_.md#timestamptounixseconds_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds("timestamp"); + +``` + | +| [unixMicrosToTimestamp(field)](./firestore_.md#unixmicrostotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp("microseconds"); + +``` + | +| [unixMillisToTimestamp(field)](./firestore_.md#unixmillistotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp("milliseconds"); + +``` + | +| [unixSecondsToTimestamp(field)](./firestore_.md#unixsecondstotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp("seconds"); + +``` + | +| [vectorLength(field)](./firestore_.md#vectorlength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a Firestore Vector represented by a field. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength("embedding"); + +``` + | +| function(fieldPath, ...) | +| [orderBy(fieldPath, directionStr)](./firestore_.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | +| [where(fieldPath, opStr, value)](./firestore_.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | +| function(fieldValues, ...) | +| [endAt(fieldValues)](./firestore_.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [endBefore(fieldValues)](./firestore_.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAfter(fieldValues)](./firestore_.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAt(fieldValues)](./firestore_.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| function(filter, ...) | +| [not(filter)](./firestore_.md#not_5520849) | (BETA) Creates an expression that negates a filter condition. +```typescript +// Find documents where the 'completed' field is NOT true +not(eq("completed", true)); + +``` + | +| function(first, ...) | +| [strConcat(first, elements)](./firestore_.md#strconcat_0f1bdbf) | (BETA) Creates an expression that concatenates string functions, fields or constants together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat("firstName", " ", Field.of("lastName")); + +``` + | +| [strConcat(first, elements)](./firestore_.md#strconcat_1eb0ac1) | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat(Field.of("firstName"), " ", Field.of("lastName")); + +``` + | +| function(indexManager, ...) | +| [deleteAllPersistentCacheIndexes(indexManager)](./firestore_.md#deleteallpersistentcacheindexes_98b2645) | Removes all persistent cache indexes.Please note this function will also deletes indexes generated by setIndexConfiguration(), which is deprecated. | +| [disablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#disablepersistentcacheindexautocreation_98b2645) | Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling enablePersistentCacheIndexAutoCreation() still take effect. | +| [enablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#enablepersistentcacheindexautocreation_98b2645) | Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance.This feature is disabled by default. | +| function(left, ...) | +| [add(left, right)](./firestore_.md#add_be96f75) | (BETA) Creates an expression that adds two expressions together. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add(Field.of("quantity"), Field.of("reserve")); + +``` + | +| [add(left, right)](./firestore_.md#add_010ba9e) | (BETA) Creates an expression that adds an expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +add(Field.of("age"), 5); + +``` + | +| [add(left, right)](./firestore_.md#add_674c63f) | (BETA) Creates an expression that adds a field's value to an expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add("quantity", Field.of("reserve")); + +``` + | +| [add(left, right)](./firestore_.md#add_1f46a76) | (BETA) Creates an expression that adds a field's value to a constant value. +```typescript +// Add 5 to the value of the 'age' field +add("age", 5); + +``` + | +| [aggregateFieldEqual(left, right)](./firestore_.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | +| [aggregateQuerySnapshotEqual(left, right)](./firestore_.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | +| [and(left, right)](./firestore_.md#and_eba7e36) | (BETA) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. +```typescript +// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND +// the 'status' field is "active" +const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + | +| [divide(left, right)](./firestore_.md#divide_be96f75) | (BETA) Creates an expression that divides two expressions. +```typescript +// Divide the 'total' field by the 'count' field +divide(Field.of("total"), Field.of("count")); + +``` + | +| [divide(left, right)](./firestore_.md#divide_010ba9e) | (BETA) Creates an expression that divides an expression by a constant value. +```typescript +// Divide the 'value' field by 10 +divide(Field.of("value"), 10); + +``` + | +| [divide(left, right)](./firestore_.md#divide_674c63f) | (BETA) Creates an expression that divides a field's value by an expression. +```typescript +// Divide the 'total' field by the 'count' field +divide("total", Field.of("count")); + +``` + | +| [divide(left, right)](./firestore_.md#divide_1f46a76) | (BETA) Creates an expression that divides a field's value by a constant value. +```typescript +// Divide the 'value' field by 10 +divide("value", 10); + +``` + | +| [eq(left, right)](./firestore_.md#eq_be96f75) | (BETA) Creates an expression that checks if two expressions are equal. +```typescript +// Check if the 'age' field is equal to an expression +eq(Field.of("age"), Field.of("minAge").add(10)); + +``` + | +| [eq(left, right)](./firestore_.md#eq_010ba9e) | (BETA) Creates an expression that checks if an expression is equal to a constant value. +```typescript +// Check if the 'age' field is equal to 21 +eq(Field.of("age"), 21); + +``` + | +| [eq(left, right)](./firestore_.md#eq_674c63f) | (BETA) Creates an expression that checks if a field's value is equal to an expression. +```typescript +// Check if the 'age' field is equal to the 'limit' field +eq("age", Field.of("limit")); + +``` + | +| [eq(left, right)](./firestore_.md#eq_1f46a76) | (BETA) Creates an expression that checks if a field's value is equal to a constant value. +```typescript +// Check if the 'city' field is equal to string constant "London" +eq("city", "London"); + +``` + | +| [gt(left, right)](./firestore_.md#gt_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than the second expression. +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), Constant(9).add(9)); + +``` + | +| [gt(left, right)](./firestore_.md#gt_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than a constant value. +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), 18); + +``` + | +| [gt(left, right)](./firestore_.md#gt_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than an expression. +```typescript +// Check if the value of field 'age' is greater than the value of field 'limit' +gt("age", Field.of("limit")); + +``` + | +| [gt(left, right)](./firestore_.md#gt_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +gt("price", 100); + +``` + | +| [gte(left, right)](./firestore_.md#gte_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than or equal to the second expression. +```typescript +// Check if the 'quantity' field is greater than or equal to the field "threshold" +gte(Field.of("quantity"), Field.of("threshold")); + +``` + | +| [gte(left, right)](./firestore_.md#gte_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than or equal to a constant value. +```typescript +// Check if the 'quantity' field is greater than or equal to 10 +gte(Field.of("quantity"), 10); + +``` + | +| [gte(left, right)](./firestore_.md#gte_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than or equal to an expression. +```typescript +// Check if the value of field 'age' is greater than or equal to the value of field 'limit' +gte("age", Field.of("limit")); + +``` + | +| [gte(left, right)](./firestore_.md#gte_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +gte("score", 80); + +``` + | +| [like(left, pattern)](./firestore_.md#like_33ec01b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. +```typescript +// Check if the 'title' field contains the string "guide" +like("title", "%guide%"); + +``` + | +| [like(left, pattern)](./firestore_.md#like_dd84184) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. +```typescript +// Check if the 'title' field contains the string "guide" +like("title", Field.of("pattern")); + +``` + | +| [like(left, pattern)](./firestore_.md#like_3aaffe0) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), "%guide%"); + +``` + | +| [like(left, pattern)](./firestore_.md#like_a2c3e8b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), Field.of("pattern")); + +``` + | +| [logicalMax(left, right)](./firestore_.md#logicalmax_be96f75) | (BETA) Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax(Field.of("field1"), Field.of("field2")); + +``` + | +| [logicalMax(left, right)](./firestore_.md#logicalmax_010ba9e) | (BETA) Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax(Field.of("value"), 10); + +``` + | +| [logicalMax(left, right)](./firestore_.md#logicalmax_674c63f) | (BETA) Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax("field1", Field.of('field2')); + +``` + | +| [logicalMax(left, right)](./firestore_.md#logicalmax_1f46a76) | (BETA) Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax("value", 10); + +``` + | +| [logicalMin(left, right)](./firestore_.md#logicalmin_be96f75) | (BETA) Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin(Field.of("field1"), Field.of("field2")); + +``` + | +| [logicalMin(left, right)](./firestore_.md#logicalmin_010ba9e) | (BETA) Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin(Field.of("value"), 10); + +``` + | +| [logicalMin(left, right)](./firestore_.md#logicalmin_674c63f) | (BETA) Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin("field1", Field.of("field2")); + +``` + | +| [logicalMin(left, right)](./firestore_.md#logicalmin_1f46a76) | (BETA) Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin("value", 10); + +``` + | +| [lt(left, right)](./firestore_.md#lt_be96f75) | (BETA) Creates an expression that checks if the first expression is less than the second expression. +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), Field.of("limit")); + +``` + | +| [lt(left, right)](./firestore_.md#lt_010ba9e) | (BETA) Creates an expression that checks if an expression is less than a constant value. +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), 30); + +``` + | +| [lt(left, right)](./firestore_.md#lt_674c63f) | (BETA) Creates an expression that checks if a field's value is less than an expression. +```typescript +// Check if the 'age' field is less than the 'limit' field +lt("age", Field.of("limit")); + +``` + | +| [lt(left, right)](./firestore_.md#lt_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +lt("price", 50); + +``` + | +| [lte(left, right)](./firestore_.md#lte_be96f75) | (BETA) Creates an expression that checks if the first expression is less than or equal to the second expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), Field.of("limit")); + +``` + | +| [lte(left, right)](./firestore_.md#lte_010ba9e) | (BETA) Creates an expression that checks if an expression is less than or equal to a constant value. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), 20); + +``` + | +| [lte(left, right)](./firestore_.md#lte_674c63f) | Creates an expression that checks if a field's value is less than or equal to an expression. +```typescript +// Check if the 'quantity' field is less than or equal to the 'limit' field +lte("quantity", Field.of("limit")); + +``` + | +| [lte(left, right)](./firestore_.md#lte_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +lte("score", 70); + +``` + | +| [mod(left, right)](./firestore_.md#mod_be96f75) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing two expressions. +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod(Field.of("field1"), Field.of("field2")); + +``` + | +| [mod(left, right)](./firestore_.md#mod_010ba9e) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod(Field.of("field1"), 5); + +``` + | +| [mod(left, right)](./firestore_.md#mod_674c63f) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod("field1", Field.of("field2")); + +``` + | +| [mod(left, right)](./firestore_.md#mod_1f46a76) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod("field1", 5); + +``` + | +| [multiply(left, right)](./firestore_.md#multiply_be96f75) | (BETA) Creates an expression that multiplies two expressions together. +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply(Field.of("quantity"), Field.of("price")); + +``` + | +| [multiply(left, right)](./firestore_.md#multiply_010ba9e) | (BETA) Creates an expression that multiplies an expression by a constant value. +```typescript +// Multiply the value of the 'price' field by 2 +multiply(Field.of("price"), 2); + +``` + | +| [multiply(left, right)](./firestore_.md#multiply_674c63f) | (BETA) Creates an expression that multiplies a field's value by an expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply("quantity", Field.of("price")); + +``` + | +| [multiply(left, right)](./firestore_.md#multiply_1f46a76) | (BETA) Creates an expression that multiplies a field's value by a constant value. +```typescript +// Multiply the 'value' field by 2 +multiply("value", 2); + +``` + | +| [neq(left, right)](./firestore_.md#neq_be96f75) | (BETA) Creates an expression that checks if two expressions are not equal. +```typescript +// Check if the 'status' field is not equal to field 'finalState' +neq(Field.of("status"), Field.of("finalState")); + +``` + | +| [neq(left, right)](./firestore_.md#neq_010ba9e) | (BETA) Creates an expression that checks if an expression is not equal to a constant value. +```typescript +// Check if the 'status' field is not equal to "completed" +neq(Field.of("status"), "completed"); + +``` + | +| [neq(left, right)](./firestore_.md#neq_674c63f) | (BETA) Creates an expression that checks if a field's value is not equal to an expression. +```typescript +// Check if the 'status' field is not equal to the value of 'expectedStatus' +neq("status", Field.of("expectedStatus")); + +``` + | +| [neq(left, right)](./firestore_.md#neq_1f46a76) | (BETA) Creates an expression that checks if a field's value is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +neq("country", "USA"); + +``` + | +| [or(left, right)](./firestore_.md#or_eba7e36) | (BETA) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. +```typescript +// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR +// the 'status' field is "active" +const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + | +| [queryEqual(left, right)](./firestore_.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | +| [refEqual(left, right)](./firestore_.md#refequal_598b780) | Returns true if the provided references are equal. | +| [regexContains(left, pattern)](./firestore_.md#regexcontains_33ec01b) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", "(?i)example"); + +``` + | +| [regexContains(left, pattern)](./firestore_.md#regexcontains_dd84184) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", Field.of("pattern")); + +``` + | +| [regexContains(left, pattern)](./firestore_.md#regexcontains_3aaffe0) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), "(?i)example"); + +``` + | +| [regexContains(left, pattern)](./firestore_.md#regexcontains_a2c3e8b) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), Field.of("pattern")); + +``` + | +| [regexMatch(left, pattern)](./firestore_.md#regexmatch_33ec01b) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(left, pattern)](./firestore_.md#regexmatch_dd84184) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", Field.of("pattern")); + +``` + | +| [regexMatch(left, pattern)](./firestore_.md#regexmatch_3aaffe0) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(left, pattern)](./firestore_.md#regexmatch_a2c3e8b) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), Field.of("pattern")); + +``` + | +| [snapshotEqual(left, right)](./firestore_.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | +| [strContains(left, substring)](./firestore_.md#strcontains_18eaf5d) | (BETA) Creates an expression that checks if a string field contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +strContains("description", "example"); + +``` + | +| [strContains(left, substring)](./firestore_.md#strcontains_f0f1f2f) | (BETA) Creates an expression that checks if a string field contains a substring specified by an expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains("description", Field.of("keyword")); + +``` + | +| [strContains(left, substring)](./firestore_.md#strcontains_5fdbd29) | (BETA) Creates an expression that checks if a string expression contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +strContains(Field.of("description"), "example"); + +``` + | +| [strContains(left, substring)](./firestore_.md#strcontains_d9d749f) | (BETA) Creates an expression that checks if a string expression contains a substring specified by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains(Field.of("description"), Field.of("keyword")); + +``` + | +| [subtract(left, right)](./firestore_.md#subtract_be96f75) | (BETA) Creates an expression that subtracts two expressions. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract(Field.of("price"), Field.of("discount")); + +``` + | +| [subtract(left, right)](./firestore_.md#subtract_010ba9e) | (BETA) Creates an expression that subtracts a constant value from an expression. +```typescript +// Subtract the constant value 2 from the 'value' field +subtract(Field.of("value"), 2); + +``` + | +| [subtract(left, right)](./firestore_.md#subtract_674c63f) | (BETA) Creates an expression that subtracts an expression from a field's value. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract("price", Field.of("discount")); + +``` + | +| [subtract(left, right)](./firestore_.md#subtract_1f46a76) | (BETA) Creates an expression that subtracts a constant value from a field's value. +```typescript +// Subtract 20 from the value of the 'total' field +subtract("total", 20); + +``` + | +| [xor(left, right)](./firestore_.md#xor_eba7e36) | (BETA) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. +```typescript +// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", +// or 'status' is "active". +const condition = xor( + gt("age", 18), + eq("city", "London"), + eq("status", "active")); + +``` + | +| function(limit, ...) | +| [limit(limit)](./firestore_.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | +| [limitToLast(limit)](./firestore_.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | +| function(logLevel, ...) | +| [setLogLevel(logLevel)](./firestore_.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | +| function(mapExpr, ...) | +| [mapGet(mapExpr, subField)](./firestore_.md#mapget_9715f90) | (BETA) Accesses a value from a map (object) expression using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +mapGet(Field.of("address"), "city"); + +``` + | +| function(mapField, ...) | +| [mapGet(mapField, subField)](./firestore_.md#mapget_b37bbb6) | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +mapGet("address", "city"); + +``` + | +| function(n, ...) | +| [increment(n)](./firestore_.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | +| function(name, ...) | +| [genericFunction(name, params)](./firestore_.md#genericfunction_b886545) | (BETA) Creates functions that work on the backend but do not exist in the SDK yet. +```typescript +// Call a user defined function named "myFunc" with the arguments 10 and 20 +// This is the same of the 'sum(Field.of("price"))', if it did not exist +genericFunction("sum", [Field.of("price")]); + +``` + | +| function(pipeline, ...) | +| [execute(pipeline)](./firestore_.md#execute_86486e6) | (BETA) Modular API for console experimentation. | +| function(query, ...) | +| [getAggregateFromServer(query, aggregateSpec)](./firestore_.md#getaggregatefromserver_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | +| [getCountFromServer(query)](./firestore_.md#getcountfromserver_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | +| [getDocs(query)](./firestore_.md#getdocs_4e56953) | Executes the query and returns the results as a QuerySnapshot.Note: getDocs() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). | +| [getDocsFromCache(query)](./firestore_.md#getdocsfromcache_4e56953) | Executes the query and returns the results as a QuerySnapshot from cache. Returns an empty result set if no documents matching the query are currently cached. | +| [getDocsFromServer(query)](./firestore_.md#getdocsfromserver_4e56953) | Executes the query and returns the results as a QuerySnapshot from the server. Returns an error if the network is not available. | +| [onSnapshot(query, observer)](./firestore_.md#onsnapshot_8d14049) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, options, observer)](./firestore_.md#onsnapshot_03dfff5) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_3ebfbe2) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_b8f9c47) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [pipeline(query)](./firestore_.md#pipeline_20b2416) | Experimental Modular API for console testing. | +| [query(query, compositeFilter, queryConstraints)](./firestore_.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | +| [query(query, queryConstraints)](./firestore_.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | +| function(queryConstraints, ...) | +| [and(queryConstraints)](./firestore_.md#and_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. | +| [or(queryConstraints)](./firestore_.md#or_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. | +| function(reference, ...) | +| [addDoc(reference, data)](./firestore_.md#adddoc_6e783ff) | Add a new document to specified CollectionReference with the given data, assigning it a document ID automatically. | +| [collection(reference, path, pathSegments)](./firestore_.md#collection_568f98d) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | +| [collection(reference, path, pathSegments)](./firestore_.md#collection_70b4396) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | +| [deleteDoc(reference)](./firestore_.md#deletedoc_4569087) | Deletes the document referred to by the specified DocumentReference. | +| [doc(reference, path, pathSegments)](./firestore_.md#doc_568f98d) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned DocumentReference. | +| [doc(reference, path, pathSegments)](./firestore_.md#doc_70b4396) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. | +| [getDoc(reference)](./firestore_.md#getdoc_4569087) | Reads the document referred to by this DocumentReference.Note: getDoc() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). | +| [getDocFromCache(reference)](./firestore_.md#getdocfromcache_4569087) | Reads the document referred to by this DocumentReference from cache. Returns an error if the document is not currently cached. | +| [getDocFromServer(reference)](./firestore_.md#getdocfromserver_4569087) | Reads the document referred to by this DocumentReference from the server. Returns an error if the network is not available. | +| [onSnapshot(reference, observer)](./firestore_.md#onsnapshot_0312fd7) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, options, observer)](./firestore_.md#onsnapshot_86b6b9e) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_905f42c) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_0c39991) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [setDoc(reference, data)](./firestore_.md#setdoc_ee215ad) | Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created. | +| [setDoc(reference, data, options)](./firestore_.md#setdoc_ff80739) | Writes to the document referred to by the specified DocumentReference. If the document does not yet exist, it will be created. If you provide merge or mergeFields, the provided data can be merged into an existing document. | +| [updateDoc(reference, data)](./firestore_.md#updatedoc_51a65e3) | Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist. | +| [updateDoc(reference, field, value, moreFieldsAndValues)](./firestore_.md#updatedoc_7c28659) | Updates fields in the document referred to by the specified DocumentReference The update will fail if applied to a document that does not exist.Nested fields can be updated by providing dot-separated field path strings or by providing FieldPath objects. | +| function(settings, ...) | +| [memoryLocalCache(settings)](./firestore_.md#memorylocalcache_05f4bf2) | Creates an instance of MemoryLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use. | +| [memoryLruGarbageCollector(settings)](./firestore_.md#memorylrugarbagecollector_5ee014c) | Creates an instance of MemoryLruGarbageCollector.A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). | +| [persistentLocalCache(settings)](./firestore_.md#persistentlocalcache_d312f71) | Creates an instance of PersistentLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use.Persistent cache cannot be used in a Node.js environment. | +| [persistentSingleTabManager(settings)](./firestore_.md#persistentsingletabmanager_c99c68d) | Creates an instance of PersistentSingleTabManager. | +| function(snapshot, ...) | +| [endAt(snapshot)](./firestore_.md#endat_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [endBefore(snapshot)](./firestore_.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [startAfter(snapshot)](./firestore_.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [startAt(snapshot)](./firestore_.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | +| function(timestamp, ...) | +| [timestampAdd(timestamp, unit, amount)](./firestore_.md#timestampadd_87db576) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(timestamp, unit, amount)](./firestore_.md#timestampadd_46a2d7e) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), "day", 1); + +``` + | +| [timestampSub(timestamp, unit, amount)](./firestore_.md#timestampsub_87db576) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(timestamp, unit, amount)](./firestore_.md#timestampsub_46a2d7e) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub(Field.of("timestamp"), "day", 1); + +``` + | +| function(value, ...) | +| [avg(value)](./firestore_.md#avg_f83680a) | (BETA) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. +```typescript +// Calculate the average age of users +avg(Field.of("age")).as("averageAge"); + +``` + | +| [avg(value)](./firestore_.md#avg_7c807cd) | (BETA) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. +```typescript +// Calculate the average age of users +avg("age").as("averageAge"); + +``` + | +| [countExpression(value)](./firestore_.md#countexpression_f83680a) | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. +```typescript +// Count the number of items where the price is greater than 10 +count(Field.of("price").gt(10)).as("expensiveItemCount"); + +``` + | +| [countExpression(value)](./firestore_.md#countexpression_7c807cd) | Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided field. +```typescript +// Count the total number of products +count("productId").as("totalProducts"); + +``` + | +| [exists(value)](./firestore_.md#exists_f83680a) | (BETA) Creates an expression that checks if a field exists. +```typescript +// Check if the document has a field named "phoneNumber" +exists(Field.of("phoneNumber")); + +``` + | +| [isNan(value)](./firestore_.md#isnan_f83680a) | (BETA) Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +isNaN(Field.of("value").divide(0)); + +``` + | +| [isNan(value)](./firestore_.md#isnan_7c807cd) | (BETA) Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +isNaN("value"); + +``` + | +| [max(value)](./firestore_.md#max_f83680a) | (BETA) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +max(Field.of("score")).as("highestScore"); + +``` + | +| [max(value)](./firestore_.md#max_7c807cd) | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +max("score").as("highestScore"); + +``` + | +| [min(value)](./firestore_.md#min_f83680a) | (BETA) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. +```typescript +// Find the lowest price of all products +min(Field.of("price")).as("lowestPrice"); + +``` + | +| [min(value)](./firestore_.md#min_7c807cd) | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +min("price").as("lowestPrice"); + +``` + | +| [replaceAll(value, find, replace)](./firestore_.md#replaceall_f06d323) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll(Field.of("message"), "hello", "hi"); + +``` + | +| [replaceAll(value, find, replace)](./firestore_.md#replaceall_26a7926) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(value, find, replace)](./firestore_.md#replacefirst_f06d323) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst(Field.of("message"), "hello", "hi"); + +``` + | +| [replaceFirst(value, find, replace)](./firestore_.md#replacefirst_26a7926) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` + | +| [sumExpression(value)](./firestore_.md#sumexpression_f83680a) | (BETA) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +sum(Field.of("orderAmount")).as("totalRevenue"); + +``` + | +| [sumExpression(value)](./firestore_.md#sumexpression_7c807cd) | (BETA) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +sum("orderAmount").as("totalRevenue"); + +``` + | +| function(values, ...) | +| [vector(values)](./firestore_.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | + +## Classes + +| Class | Description | +| --- | --- | +| [Add](./firestore_.add.md#add_class) | (BETA) | +| [AddFields](./firestore_.addfields.md#addfields_class) | (BETA) | +| [Aggregate](./firestore_.aggregate.md#aggregate_class) | (BETA) | +| [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | +| [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | +| [And](./firestore_.and.md#and_class) | (BETA) | +| [ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) | (BETA) | +| [ArrayContains](./firestore_.arraycontains.md#arraycontains_class) | (BETA) | +| [ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) | (BETA) | +| [ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) | (BETA) | +| [ArrayElement](./firestore_.arrayelement.md#arrayelement_class) | (BETA) | +| [ArrayLength](./firestore_.arraylength.md#arraylength_class) | (BETA) | +| [ArrayReverse](./firestore_.arrayreverse.md#arrayreverse_class) | (BETA) | +| [Avg](./firestore_.avg.md#avg_class) | (BETA) | +| [ByteLength](./firestore_.bytelength.md#bytelength_class) | (BETA) | +| [Bytes](./firestore_.bytes.md#bytes_class) | An immutable object representing an array of bytes. | +| [CharLength](./firestore_.charlength.md#charlength_class) | (BETA) | +| [CollectionGroupSource](./firestore_.collectiongroupsource.md#collectiongroupsource_class) | (BETA) | +| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | +| [CollectionSource](./firestore_.collectionsource.md#collectionsource_class) | (BETA) | +| [Constant](./firestore_.constant.md#constant_class) | (BETA) Represents a constant value that can be used in a Firestore pipeline expression.You can create a Constant instance using the static method: +```typescript +// Create a Constant instance for the number 10 +const ten = Constant.of(10); + +// Create a Constant instance for the string "hello" +const hello = Constant.of("hello"); + +``` + | +| [CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) | (BETA) | +| [Count](./firestore_.count.md#count_class) | (BETA) | +| [DatabaseSource](./firestore_.databasesource.md#databasesource_class) | (BETA) | +| [Distinct](./firestore_.distinct.md#distinct_class) | (BETA) | +| [Divide](./firestore_.divide.md#divide_class) | (BETA) | +| [DocumentReference](./firestore_.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | +| [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | +| [DocumentsSource](./firestore_.documentssource.md#documentssource_class) | (BETA) | +| [DotProduct](./firestore_.dotproduct.md#dotproduct_class) | (BETA) | +| [EndsWith](./firestore_.endswith.md#endswith_class) | (BETA) | +| [Eq](./firestore_.eq.md#eq_class) | (BETA) | +| [EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) | (BETA) | +| [Exists](./firestore_.exists.md#exists_class) | (BETA) | +| [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) | (BETA) | +| [Field](./firestore_.field.md#field_class) | (BETA) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage.

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.

You can create a Field instance using the static method: +```typescript +// Create a Field instance for the 'name' field +const nameField = Field.of("name"); + +// Create a Field instance for a nested field 'address.city' +const cityField = Field.of("address.city"); + +``` + | +| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | +| [Fields](./firestore_.fields.md#fields_class) | (BETA) | +| [FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | +| [FindNearest](./firestore_.findnearest.md#findnearest_class) | (BETA) | +| [Firestore](./firestore_.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | +| [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | +| [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) | (BETA) This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. | +| [GenericStage](./firestore_.genericstage.md#genericstage_class) | (BETA) | +| [GeoPoint](./firestore_.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | +| [Gt](./firestore_.gt.md#gt_class) | (BETA) | +| [Gte](./firestore_.gte.md#gte_class) | (BETA) | +| [If](./firestore_.if.md#if_class) | (BETA) | +| [In](./firestore_.in.md#in_class) | (BETA) | +| [IsNan](./firestore_.isnan.md#isnan_class) | (BETA) | +| [Like](./firestore_.like.md#like_class) | (BETA) | +| [Limit](./firestore_.limit.md#limit_class) | (BETA) | +| [LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) | Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.The API is compatible with Promise<LoadBundleTaskProgress>. | +| [LogicalMax](./firestore_.logicalmax.md#logicalmax_class) | (BETA) | +| [LogicalMin](./firestore_.logicalmin.md#logicalmin_class) | (BETA) | +| [Lt](./firestore_.lt.md#lt_class) | (BETA) | +| [Lte](./firestore_.lte.md#lte_class) | (BETA) | +| [MapGet](./firestore_.mapget.md#mapget_class) | (BETA) | +| [Max](./firestore_.max.md#max_class) | (BETA) | +| [Min](./firestore_.min.md#min_class) | (BETA) | +| [Mod](./firestore_.mod.md#mod_class) | (BETA) | +| [Multiply](./firestore_.multiply.md#multiply_class) | (BETA) | +| [Neq](./firestore_.neq.md#neq_class) | (BETA) | +| [Not](./firestore_.not.md#not_class) | (BETA) | +| [Offset](./firestore_.offset.md#offset_class) | (BETA) | +| [Or](./firestore_.or.md#or_class) | (BETA) | +| [Ordering](./firestore_.ordering.md#ordering_class) | (BETA) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. | +| [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | A PersistentCacheIndexManager for configuring persistent cache indexes used for local query execution.To use, call getPersistentCacheIndexManager() to get an instance. | +| [Pipeline](./firestore_.pipeline.md#pipeline_class) | | +| [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) | (BETA) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.

If the PipelineResult represents a non-document result, ref will return a undefined value. | +| [PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) | (BETA) Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). | +| [Query](./firestore_.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | +| [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | +| [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | +| [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | +| [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | +| [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | +| [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | +| [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | +| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | +| [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | +| [RegexContains](./firestore_.regexcontains.md#regexcontains_class) | (BETA) | +| [RegexMatch](./firestore_.regexmatch.md#regexmatch_class) | (BETA) | +| [ReplaceAll](./firestore_.replaceall.md#replaceall_class) | (BETA) | +| [ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) | (BETA) | +| [Reverse](./firestore_.reverse.md#reverse_class) | (BETA) | +| [Select](./firestore_.select.md#select_class) | (BETA) | +| [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. | +| [Sort](./firestore_.sort.md#sort_class) | (BETA) | +| [StartsWith](./firestore_.startswith.md#startswith_class) | (BETA) | +| [StrConcat](./firestore_.strconcat.md#strconcat_class) | (BETA) | +| [StrContains](./firestore_.strcontains.md#strcontains_class) | (BETA) | +| [Subtract](./firestore_.subtract.md#subtract_class) | (BETA) | +| [Sum](./firestore_.sum.md#sum_class) | (BETA) | +| [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | +| [TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) | (BETA) | +| [TimestampSub](./firestore_.timestampsub.md#timestampsub_class) | (BETA) | +| [TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) | (BETA) | +| [TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) | (BETA) | +| [TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) | (BETA) | +| [ToLower](./firestore_.tolower.md#tolower_class) | (BETA) | +| [ToUpper](./firestore_.toupper.md#toupper_class) | (BETA) | +| [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | +| [Trim](./firestore_.trim.md#trim_class) | (BETA) | +| [UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) | (BETA) | +| [UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) | (BETA) | +| [UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) | (BETA) | +| [VectorLength](./firestore_.vectorlength.md#vectorlength_class) | (BETA) | +| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [Where](./firestore_.where.md#where_class) | (BETA) | +| [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | +| [Xor](./firestore_.xor.md#xor_class) | (BETA) | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [Accumulator](./firestore_.accumulator.md#accumulator_interface) | (BETA) An interface that represents an accumulator. | +| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | +| [DocumentChange](./firestore_.documentchange.md#documentchange_interface) | A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred. | +| [DocumentData](./firestore_.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | +| [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.Note: This interface is "experimental" and is subject to change.See FirestoreSettings.experimentalAutoDetectLongPolling, FirestoreSettings.experimentalForceLongPolling, and FirestoreSettings.experimentalLongPollingOptions. | +| [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) | (BETA) An interface that represents a filter condition. | +| [FindNearestOptions](./firestore_.findnearestoptions.md#findnearestoptions_interface) | (BETA) | +| [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | +| [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | +| [Index](./firestore_.index.md#index_interface) | (BETA) The SDK definition of a Firestore index. | +| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (BETA) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | +| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (BETA) A single field element in an index configuration. | +| [LoadBundleTaskProgress](./firestore_.loadbundletaskprogress.md#loadbundletaskprogress_interface) | Represents a progress update or a final state from loading bundles. | +| [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | An settings object to configure an MemoryLocalCache instance. | +| [MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) | A garbage collector deletes documents whenever they are not part of any active queries, and have no local mutations attached to them.This collector tries to ensure lowest memory footprints from the SDK, at the risk of documents not being cached for offline queries or for direct queries to the cache.Use factory function to create an instance of this collector. | +| [MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) | Provides an in-memory cache to the SDK. This is the default cache unless explicitly configured otherwise.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | +| [MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) | A garbage collector deletes Least-Recently-Used documents in multiple batches.This collector is configured with a target size, and will only perform collection when the cached documents exceed the target size. It avoids querying backend repeated for the same query or document, at the risk of having a larger memory footprint.Use factory function to create a instance of this collector. | +| [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Settings that can be passed to enableIndexedDbPersistence() to configure Firestore persistence.Persistence cannot be used in a Node.js environment. | +| [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | An settings object to configure an PersistentLocalCache instance.Persistent cache cannot be used in a Node.js environment. | +| [PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) | Provides a persistent cache backed by IndexedDb to the SDK.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | +| [PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) | A tab manager supporting multiple tabs. SDK will synchronize queries and mutations done across all tabs using the SDK. | +| [PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) | A tab manager supporting only one tab, no synchronization will be performed across tabs. | +| [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) | Type to configure an PersistentSingleTabManager instance. | +| [Selectable](./firestore_.selectable.md#selectable_interface) | (BETA) An interface that represents a selectable expression. | +| [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | An options object that can be passed to [onSnapshot()](./firestore_.md#onsnapshot_0312fd7) and [QuerySnapshot.docChanges()](./firestore_.querysnapshot.md#querysnapshotdocchanges) to control which types of changes to include in the result set. | +| [SnapshotOptions](./firestore_.snapshotoptions.md#snapshotoptions_interface) | Options that configure how data is retrieved from a DocumentSnapshot (for example the desired behavior for server timestamps that have not yet been set to their final value). | +| [Stage](./firestore_.stage.md#stage_interface) | (BETA) | +| [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | +| [Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) | A function returned by onSnapshot() that removes the listener when invoked. | + +## Namespaces + +| Namespace | Description | +| --- | --- | +| [and](./firestore_.and.md#and_namespace) | | +| [or](./firestore_.or.md#or_namespace) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [CACHE\_SIZE\_UNLIMITED](./firestore_.md#cache_size_unlimited) | Constant used to indicate the LRU garbage collection should be disabled. Set this value as the cacheSizeBytes on the settings passed to the [Firestore](./firestore_.firestore.md#firestore_class) instance. | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [AccumulatorTarget](./firestore_.md#accumulatortarget) | (BETA) An accumulator target, which is an expression with an alias that also implements the Accumulator interface. | +| [AddPrefixToKeys](./firestore_.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | +| [AggregateFieldType](./firestore_.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | +| [AggregateSpecData](./firestore_.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | +| [AggregateType](./firestore_.md#aggregatetype) | Union type representing the aggregate type to be performed. | +| [ChildUpdateFields](./firestore_.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | +| [DocumentChangeType](./firestore_.md#documentchangetype) | The type of a DocumentChange may be 'added', 'removed', or 'modified'. | +| [ExprType](./firestore_.md#exprtype) | (BETA) An enumeration of the different types of expressions. | +| [FilterExpr](./firestore_.md#filterexpr) | (BETA) A filter expression, which is an expression that also implements the FilterCondition interface. | +| [FirestoreErrorCode](./firestore_.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | +| [FirestoreLocalCache](./firestore_.md#firestorelocalcache) | Union type from all supported SDK cache layer. | +| [ListenSource](./firestore_.md#listensource) | Describe the source a query listens to.Set to default to listen to both cache and server changes. Set to cache to listen to changes in cache only. | +| [MemoryGarbageCollector](./firestore_.md#memorygarbagecollector) | Union type from all support garbage collectors for memory local cache. | +| [NestedUpdateFields](./firestore_.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | +| [OrderByDirection](./firestore_.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | +| [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | +| [PersistentTabManager](./firestore_.md#persistenttabmanager) | A union of all available tab managers. | +| [Primitive](./firestore_.md#primitive) | Primitive types. | +| [QueryConstraintType](./firestore_.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | +| [QueryFilterConstraint](./firestore_.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | +| [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | +| [SelectableExpr](./firestore_.md#selectableexpr) | (BETA) A selectable expression, which is an expression that also implements the Selectable interface. | +| [SetOptions](./firestore_.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | +| [TaskState](./firestore_.md#taskstate) | Represents the state of bundle loading tasks.Both 'Error' and 'Success' are sinking state: task will abort or complete and there will be no more updates after they are reported. | +| [UnionToIntersection](./firestore_.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | +| [UpdateData](./firestore_.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | +| [WhereFilterOp](./firestore_.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | | [WithFieldValue](./firestore_.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | -## function(app, ...) +## function(app, ...) + +### getFirestore(app) {:#getfirestore_cf608e1} + +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(app: FirebaseApp): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | + +Returns: + +[Firestore](./firestore_.firestore.md#firestore_class) + +The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### getFirestore(app, databaseId) {:#getfirestore_48de6cb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_.firestore.md#firestore_class) + +The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### initializeFirestore(app, settings, databaseId) {:#initializefirestore_fc7d200} + +Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). + +Signature: + +```typescript +export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the [Firestore](./firestore_.firestore.md#firestore_class) instance will be associated. | +| settings | [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | A settings object to configure the [Firestore](./firestore_.firestore.md#firestore_class) instance. | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_.firestore.md#firestore_class) + +A newly initialized [Firestore](./firestore_.firestore.md#firestore_class) instance. + +## function(firestore, ...) + +### clearIndexedDbPersistence(firestore) {:#clearindexeddbpersistence_231a8e0} + +Clears the persistent storage. This includes pending writes and cached documents. + +Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of `failed-precondition`. + +Note: `clearIndexedDbPersistence()` is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. + +Signature: + +```typescript +export declare function clearIndexedDbPersistence(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to clear persistence for. | + +Returns: + +Promise<void> + +A `Promise` that is resolved when the persistent storage is cleared. Otherwise, the promise is rejected with an error. + +### collection(firestore, path, pathSegments) {:#collection_1eb4c23} + +Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. + +Signature: + +```typescript +export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | + +Returns: + +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> + +The `CollectionReference` instance. + +#### Exceptions + +If the final path has an even number of segments and does not point to a collection. + +### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} + +Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. + +Signature: + +```typescript +export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | + +Returns: + +[Query](./firestore_.query.md#query_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> + +The created `Query`. + +### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} + +Modify this instance to communicate with the Cloud Firestore emulator. + +Note: This must be called before this instance has been used to do any operations. + +Signature: + +```typescript +export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { + mockUserToken?: EmulatorMockTokenOptions | string; +}): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | +| host | string | the emulator host (ex: localhost). | +| port | number | the emulator port (ex: 9000). | +| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | + +Returns: + +void + +### disableNetwork(firestore) {:#disablenetwork_231a8e0} + +Disables network usage for this instance. It can be re-enabled via [enableNetwork()](./firestore_.md#enablenetwork_231a8e0). While the network is disabled, any snapshot listeners, `getDoc()` or `getDocs()` calls will return results from cache, and any write operations will be queued until the network is restored. + +Signature: + +```typescript +export declare function disableNetwork(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +Promise<void> + +A `Promise` that is resolved once the network has been disabled. + +### doc(firestore, path, pathSegments) {:#doc_1eb4c23} + +Gets a `DocumentReference` instance that refers to the document at the specified absolute path. + +Signature: + +```typescript +export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | + +Returns: + +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> + +The `DocumentReference` instance. + +#### Exceptions + +If the final path has an odd number of segments and does not point to a document. + +### enableIndexedDbPersistence(firestore, persistenceSettings) {:#enableindexeddbpersistence_224174f} + +> Warning: This API is now obsolete. +> +> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. +> + +Attempts to enable persistent storage, if possible. + +On failure, `enableIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. + +\* failed-precondition: The app is already open in another browser tab. \* unimplemented: The browser is incompatible with the offline persistence implementation. + +Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. + +Note: `enableIndexedDbPersistence()` must be called before any other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200), [getFirestore()](./firestore_.md#getfirestore) or [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0). + +Persistence cannot be used in a Node.js environment. + +Signature: + +```typescript +export declare function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | +| persistenceSettings | [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Optional settings object to configure persistence. | + +Returns: + +Promise<void> + +A `Promise` that represents successfully enabling persistent storage. + +### enableMultiTabIndexedDbPersistence(firestore) {:#enablemultitabindexeddbpersistence_231a8e0} + +> Warning: This API is now obsolete. +> +> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. +> + +Attempts to enable multi-tab persistent storage, if possible. If enabled across all tabs, all operations share access to local persistence, including shared execution of queries and latency-compensated local document updates across all connected instances. + +On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. + +\* failed-precondition: The app is already open in another browser tab and multi-tab is not enabled. \* unimplemented: The browser is incompatible with the offline persistence implementation. + +Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. + +Signature: + +```typescript +export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | + +Returns: + +Promise<void> + +A `Promise` that represents successfully enabling persistent storage. + +### enableNetwork(firestore) {:#enablenetwork_231a8e0} + +Re-enables use of the network for this [Firestore](./firestore_.firestore.md#firestore_class) instance after a prior call to [disableNetwork()](./firestore_.md#disablenetwork_231a8e0). + +Signature: + +```typescript +export declare function enableNetwork(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +Promise<void> + +A `Promise` that is resolved once the network has been enabled. + +### getPersistentCacheIndexManager(firestore) {:#getpersistentcacheindexmanager_231a8e0} + +Returns the PersistentCache Index Manager used by the given `Firestore` object. + + The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use. + +Signature: + +```typescript +export declare function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +[PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) \| null + +### loadBundle(firestore, bundleData) {:#loadbundle_bec5b75} + +Loads a Firestore bundle into the local cache. + +Signature: + +```typescript +export declare function loadBundle(firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string): LoadBundleTask; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to load bundles for. | +| bundleData | ReadableStream<Uint8Array> \| ArrayBuffer \| string | An object representing the bundle to be loaded. Valid objects are ArrayBuffer, ReadableStream<Uint8Array> or string. | + +Returns: + +[LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) + +A `LoadBundleTask` object, which notifies callers with progress updates, and completion or error events. It can be used as a `Promise`. + +### namedQuery(firestore, name) {:#namedquery_6438876} + +Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name. + +The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using `loadBundle`. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. + +Signature: + +```typescript +export declare function namedQuery(firestore: Firestore, name: string): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to read the query from. | +| name | string | The name of the query. | + +Returns: + +Promise<[Query](./firestore_.query.md#query_class) \| null> + +A `Promise` that is resolved with the Query or `null`. + +### onSnapshotsInSync(firestore, observer) {:#onsnapshotsinsync_2f0dfa4} + +Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. + +NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. + +Signature: + +```typescript +export declare function onSnapshotsInSync(firestore: Firestore, observer: { + next?: (value: void) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The instance of Firestore for synchronizing snapshots. | +| observer | { next?: (value: void) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotsInSync(firestore, onSync) {:#onsnapshotsinsync_1901c06} + +Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. + +NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use `SnapshotMetadata` in the individual listeners to determine if a snapshot is from the cache or the server. + +Signature: + +```typescript +export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance for synchronizing snapshots. | +| onSync | () => void | A callback to be called every time all snapshot listeners are in sync with each other. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### pipeline(firestore) {:#pipeline_231a8e0} + +Experimental Modular API for console testing. + +Signature: + +```typescript +export declare function pipeline(firestore: Firestore): PipelineSource; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +[PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) + +### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} + +Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. + +The maximum number of writes allowed in a single transaction is 500. + +Signature: + +```typescript +export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | +| updateFunction | (transaction: [Transaction](./firestore_.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | +| options | [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | + +Returns: + +Promise<T> + +If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. + +### setIndexConfiguration(firestore, configuration) {:#setindexconfiguration_c362f04} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +> Warning: This API is now obsolete. +> +> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. +> + +Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. + +The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. + +Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. + +Signature: + +```typescript +export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | +| configuration | [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | The index definition. | + +Returns: + +Promise<void> + +A `Promise` that resolves once all indices are successfully configured. + +#### Exceptions + +FirestoreError if the JSON format is invalid. + +### setIndexConfiguration(firestore, json) {:#setindexconfiguration_90d0285} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +> Warning: This API is now obsolete. +> +> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. +> + +Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. + +The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. + +Indexes are only supported with IndexedDb persistence. Invoke either `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored. + +The method accepts the JSON format exported by the Firebase CLI (`firebase firestore:indexes`). If the JSON format is invalid, this method throws an error. + +Signature: + +```typescript +export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | +| json | string | The JSON format exported by the Firebase CLI. | + +Returns: + +Promise<void> + +A `Promise` that resolves once all indices are successfully configured. + +#### Exceptions + +FirestoreError if the JSON format is invalid. + +### terminate(firestore) {:#terminate_231a8e0} + +Terminates the provided [Firestore](./firestore_.firestore.md#firestore_class) instance. + +After calling `terminate()` only the `clearIndexedDbPersistence()` function may be used. Any other function will throw a `FirestoreError`. + +To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.md#getfirestore). + +Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. If you have persistence enabled, the next time you start this instance, it will resume sending these writes to the server. + +Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with `clearIndexedDbPersistence()` to ensure that all local state is destroyed between test runs. + +Signature: + +```typescript +export declare function terminate(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +Promise<void> + +A `Promise` that is resolved when the instance has been successfully terminated. + +### waitForPendingWrites(firestore) {:#waitforpendingwrites_231a8e0} + +Waits until all currently pending writes for the active user have been acknowledged by the backend. + +The returned promise resolves immediately if there are no outstanding writes. Otherwise, the promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call `waitForPendingWrites()` again. + +Any outstanding `waitForPendingWrites()` promises are rejected during user changes. + +Signature: + +```typescript +export declare function waitForPendingWrites(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +Promise<void> + +A `Promise` which resolves when all currently pending writes have been acknowledged by the backend. + +### writeBatch(firestore) {:#writebatch_231a8e0} + +Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500. + +Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. + +Signature: + +```typescript +export declare function writeBatch(firestore: Firestore): WriteBatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | + +Returns: + +[WriteBatch](./firestore_.writebatch.md#writebatch_class) + +A [WriteBatch](./firestore_.writebatch.md#writebatch_class) that can be used to atomically execute multiple writes. + +## function() + +### count() {:#count} + +Create an AggregateField object that can be used to compute the count of documents in the result set of a query. + +Signature: + +```typescript +export declare function count(): AggregateField; +``` +Returns: + +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> + +### countAll() {:#countall} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the total number of stage inputs. + +```typescript +// Count the total number of users +countAll().as("totalUsers"); + +``` + A new representing the 'countAll' aggregation. + +Signature: + +```typescript +export declare function countAll(): Count; +``` +Returns: + +[Count](./firestore_.count.md#count_class) + +### deleteField() {:#deletefield} + +Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. + +Signature: + +```typescript +export declare function deleteField(): FieldValue; +``` +Returns: + +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) + +### documentId() {:#documentid} + +Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. + +Signature: + +```typescript +export declare function documentId(): FieldPath; +``` +Returns: + +[FieldPath](./firestore_.fieldpath.md#fieldpath_class) + +### getFirestore() {:#getfirestore} + +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(): Firestore; +``` +Returns: + +[Firestore](./firestore_.firestore.md#firestore_class) + +The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. + +### memoryEagerGarbageCollector() {:#memoryeagergarbagecollector} + +Creates an instance of `MemoryEagerGarbageCollector`. This is also the default garbage collector unless it is explicitly specified otherwise. + +Signature: + +```typescript +export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; +``` +Returns: + +[MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) + +### persistentMultipleTabManager() {:#persistentmultipletabmanager} + +Creates an instance of `PersistentMultipleTabManager`. + +Signature: + +```typescript +export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; +``` +Returns: + +[PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) + +### serverTimestamp() {:#servertimestamp} + +Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. + +Signature: + +```typescript +export declare function serverTimestamp(): FieldValue; +``` +Returns: + +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) + +### useFirestorePipelines() {:#usefirestorepipelines} + +Signature: + +```typescript +export declare function useFirestorePipelines(): void; +``` +Returns: + +void + +## function(array, ...) + +### arrayConcat(array, elements) {:#arrayconcat_0b3ddb9} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with other arrays. + +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to concatenate to. | +| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_21991c1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with other arrays and/or values. + +```typescript +// Combine the 'tags' array with a new array +arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: Constant, elements: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to concatenate to. | +| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_f8d5d5e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates a field's array value with other arrays. + +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: string, elements: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name containing array values. | +| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_5a66d99} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates a field's array value with other arrays and/or values. + +```typescript +// Combine the 'tags' array with a new array +arrayConcat("tags", ["newTag1", "newTag2"]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: string, elements: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name containing array values. | +| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) + +### arrayContains(array, element) {:#arraycontains_01ea7c0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains a specific element. + +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains(Field.of("colors"), Field.of("selectedColor")); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: Constant, element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_60f8f2f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains a specific element. + +```typescript +// Check if the 'colors' array contains "red" +arrayContains(Field.of("colors"), "red"); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: Constant, element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_0ebdbfe} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains a specific element. + +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains("colors", Field.of("selectedColor")); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: string, element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_8f718df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +arrayContains("colors", "red"); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: string, element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_7b7433a} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_d919466} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_b40e2df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains all the specified values or expressions. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_b08efbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains all the specified values or expressions. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_7b7433a} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_d919466} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_b40e2df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_b08efbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) + +### arrayLength(array) {:#arraylength_0bb5dbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array expression. + +```typescript +// Get the number of items in the 'cart' array +arrayLength(Field.of("cart")); + +``` + +Signature: + +```typescript +export declare function arrayLength(array: Constant): ArrayLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to calculate the length of. A new representing the length of the array. | + +Returns: + +[ArrayLength](./firestore_.arraylength.md#arraylength_class) + +## function(condition, ...) + +### ifFunction(condition, thenExpr, elseExpr) {:#iffunction_f7b2404} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. + +```typescript +// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". +ifFunction( + gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + +``` + +Signature: + +```typescript +export declare function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterExpr](./firestore_.md#filterexpr) | The condition to evaluate. | +| thenExpr | [Constant](./firestore_.constant.md#constant_class) | The expression to evaluate if the condition is true. | +| elseExpr | [Constant](./firestore_.constant.md#constant_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. | + +Returns: + +[If](./firestore_.if.md#if_class) + +## function(databaseId, ...) + +### getFirestore(databaseId) {:#getfirestore_53dc891} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(databaseId: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_.firestore.md#firestore_class) + +The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. + +## function(element, ...) + +### inAny(element, others) {:#inany_a73b259} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: Constant, others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +### inAny(element, others) {:#inany_f5721c6} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: Constant, others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +### inAny(element, others) {:#inany_c6646ea} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: string, others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field to compare. | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +### inAny(element, others) {:#inany_e6877aa} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", ["Electronics", Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: string, others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field to compare. | +| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_.in.md#in_class) + +### notInAny(element, others) {:#notinany_a73b259} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: Constant, others: Constant[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_.not.md#not_class) + +### notInAny(element, others) {:#notinany_f5721c6} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: Constant, others: any[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_.not.md#not_class) + +### notInAny(element, others) {:#notinany_c6646ea} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: string, others: Constant[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field name to compare. | +| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_.not.md#not_class) + +### notInAny(element, others) {:#notinany_e6877aa} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", ["pending", Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: string, others: any[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field name to compare. | +| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_.not.md#not_class) + +## function(elements, ...) + +### arrayRemove(elements) {:#arrayremove_7d853aa} + +Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. + +Signature: + +```typescript +export declare function arrayRemove(...elements: unknown[]): FieldValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | unknown\[\] | The elements to remove from the array. | + +Returns: + +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) + +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` + +### arrayUnion(elements) {:#arrayunion_7d853aa} + +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. + +Signature: + +```typescript +export declare function arrayUnion(...elements: unknown[]): FieldValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | unknown\[\] | The elements to union into the array. | + +Returns: + +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) + +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. + +## function(expr, ...) + +### ascending(expr) {:#ascending_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +firestore.pipeline().collection("users") + .sort(ascending(Field.of("name"))); + +``` + +Signature: + +```typescript +export declare function ascending(expr: Constant): Ordering; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to create an ascending ordering for. A new Ordering for ascending sorting. | + +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +### byteLength(expr) {:#bytelength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. + +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength(Field.of("myString")); + +``` + +Signature: + +```typescript +export declare function byteLength(expr: Constant): ByteLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string. A new representing the length of the string in bytes. | + +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +### charLength(expr) {:#charlength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string expression in UTF-8. + +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength(Field.of("name")); + +``` + +Signature: + +```typescript +export declare function charLength(expr: Constant): CharLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to calculate the length of. A new representing the length of the string. | + +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +### cosineDistance(expr, other) {:#cosinedistance_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a double array. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a VectorValue. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a vector expression. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance("userVector", Field.of("itemVector")); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a vector expression and a double array. + +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a vector expression and a VectorValue. + +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vector expressions. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance(Field.of("userVector"), Field.of("itemVector")); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) + +### descending(expr) {:#descending_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") + .sort(descending(Field.of("createdAt"))); + +``` + +Signature: + +```typescript +export declare function descending(expr: Constant): Ordering; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. | + +Returns: + +[Ordering](./firestore_.ordering.md#ordering_class) + +### dotProduct(expr, other) {:#dotproduct_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a double array. + +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", [0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a VectorValue. + +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a vector expression. + +```typescript +// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' +dotProduct("docVector1", Field.of("docVector2")); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a vector expression and a double array. + +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a vector expression and a VectorValue. + +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vector expressions. + +```typescript +// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' +dotProduct(Field.of("docVector1"), Field.of("docVector2")); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_.dotproduct.md#dotproduct_class) + +### endsWith(expr, suffix) {:#endswith_88569cd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +endsWith("filename", ".txt"); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: string, suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_e2e794e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value ends with a given postfix. + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +endsWith("url", Field.of("extension")); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: string, suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The expression representing the postfix. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_6308b81} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression ends with a given postfix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), "Jr."); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: Constant, suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | +| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_ab1cc39} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression ends with a given postfix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), Constant.of("Jr.")); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: Constant, suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | +| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_.endswith.md#endswith_class) + +### euclideanDistance(expr, other) {:#euclideandistance_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a double array. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a VectorValue. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a vector expression. + +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance("pointA", Field.of("pointB")); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a vector expression and a double array. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location + +euclideanDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a vector expression and a VectorValue. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vector expressions. + +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance(Field.of("pointA"), Field.of("pointB")); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) + +### reverse(expr) {:#reverse_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses a string. + +```typescript +// Reverse the value of the 'myString' field. +reverse(Field.of("myString")); + +``` + +Signature: + +```typescript +export declare function reverse(expr: Constant): Reverse; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to reverse. A new representing the reversed string. | + +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +### startsWith(expr, prefix) {:#startswith_484d9f3} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +startsWith("name", "Mr."); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: string, prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_7deb5c7} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value starts with a given prefix. + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +startsWith("fullName", Field.of("firstName")); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: string, prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The expression representing the prefix. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_68300d1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression starts with a given prefix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), "Mr."); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: Constant, prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | +| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_5774b68} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression starts with a given prefix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), Field.of("prefix")); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: Constant, prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | +| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_.startswith.md#startswith_class) + +### timestampToUnixMicros(expr) {:#timestamptounixmicros_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. | + +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +### timestampToUnixMillis(expr) {:#timestamptounixmillis_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. | + +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +### timestampToUnixSeconds(expr) {:#timestamptounixseconds_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. | + +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +### toLower(expr) {:#tolower_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string field to lowercase. + +```typescript +// Convert the 'name' field to lowercase +toLower("name"); + +``` + +Signature: + +```typescript +export declare function toLower(expr: string): ToLower; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the lowercase string. | + +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +### toLower(expr) {:#tolower_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string expression to lowercase. + +```typescript +// Convert the 'name' field to lowercase +toLower(Field.of("name")); + +``` + +Signature: + +```typescript +export declare function toLower(expr: Constant): ToLower; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to convert to lowercase. A new representing the lowercase string. | + +Returns: + +[ToLower](./firestore_.tolower.md#tolower_class) + +### toUpper(expr) {:#toupper_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string field to uppercase. + +```typescript +// Convert the 'title' field to uppercase +toUpper("title"); + +``` + +Signature: + +```typescript +export declare function toUpper(expr: string): ToUpper; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the uppercase string. | + +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +### toUpper(expr) {:#toupper_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string expression to uppercase. + +```typescript +// Convert the 'title' field to uppercase +toUppercase(Field.of("title")); + +``` + +Signature: + +```typescript +export declare function toUpper(expr: Constant): ToUpper; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to convert to uppercase. A new representing the uppercase string. | + +Returns: + +[ToUpper](./firestore_.toupper.md#toupper_class) + +### trim(expr) {:#trim_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string field. + +```typescript +// Trim whitespace from the 'userInput' field +trim("userInput"); + +``` + +Signature: + +```typescript +export declare function trim(expr: string): Trim; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the trimmed string. | + +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +### trim(expr) {:#trim_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string expression. + +```typescript +// Trim whitespace from the 'userInput' field +trim(Field.of("userInput")); + +``` + +Signature: + +```typescript +export declare function trim(expr: Constant): Trim; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to trim. A new representing the trimmed string. | + +Returns: + +[Trim](./firestore_.trim.md#trim_class) + +### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp(Field.of("microseconds")); + +``` + +Signature: + +```typescript +export declare function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp(Field.of("milliseconds")); + +``` + +Signature: + +```typescript +export declare function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp(Field.of("seconds")); + +``` + +Signature: + +```typescript +export declare function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +### vectorLength(expr) {:#vectorlength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a Firestore Vector. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength(Field.of("embedding")); + +``` + +Signature: + +```typescript +export declare function vectorLength(expr: Constant): VectorLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the Firestore Vector. A new representing the length of the array. | + +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + +## function(field, ...) + +### average(field) {:#average_aacc3a9} + +Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. + +Signature: + +```typescript +export declare function average(field: string | FieldPath): AggregateField; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | + +Returns: + +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number \| null> + +### byteLength(field) {:#bytelength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. + +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength("myString"); + +``` + +Signature: + +```typescript +export declare function byteLength(field: string): ByteLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string. A new representing the length of the string in bytes. | + +Returns: + +[ByteLength](./firestore_.bytelength.md#bytelength_class) + +### charLength(field) {:#charlength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string field in UTF8. + +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength("name"); + +``` + +Signature: + +```typescript +export declare function charLength(field: string): CharLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field containing the string. A new representing the length of the string. | + +Returns: + +[CharLength](./firestore_.charlength.md#charlength_class) + +### exists(field) {:#exists_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists. + +```typescript +// Check if the document has a field named "phoneNumber" +exists("phoneNumber"); + +``` + +Signature: + +```typescript +export declare function exists(field: string): Exists; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The field name to check. A new representing the 'exists' check. | + +Returns: + +[Exists](./firestore_.exists.md#exists_class) + +### replaceAll(field, find, replace) {:#replaceall_b257ab0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll("message", "hello", "hi"); + +``` + +Signature: + +```typescript +export declare function replaceAll(field: string, find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) + +### replaceFirst(field, find, replace) {:#replacefirst_b257ab0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst("message", "hello", "hi"); + +``` + +Signature: + +```typescript +export declare function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) + +### reverse(field) {:#reverse_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses a string represented by a field. + +```typescript +// Reverse the value of the 'myString' field. +reverse("myString"); + +``` + +Signature: + +```typescript +export declare function reverse(field: string): Reverse; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to reverse. A new representing the reversed string. | + +Returns: + +[Reverse](./firestore_.reverse.md#reverse_class) + +### sum(field) {:#sum_aacc3a9} + +Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. + +Signature: + +```typescript +export declare function sum(field: string | FieldPath): AggregateField; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | + +Returns: + +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> + +### timestampAdd(field, unit, amount) {:#timestampadd_565792c} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to a timestamp represented by a field. + +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd("timestamp", "day", 1); + +``` + +Signature: + +```typescript +export declare function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) + +### timestampSub(field, unit, amount) {:#timestampsub_565792c} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. + +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub("timestamp", "day", 1); + +``` + +Signature: + +```typescript +export declare function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) + +### timestampToUnixMicros(field) {:#timestamptounixmicros_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMicros(field: string): TimestampToUnixMicros; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. | + +Returns: + +[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) + +### timestampToUnixMillis(field) {:#timestamptounixmillis_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMillis(field: string): TimestampToUnixMillis; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. | + +Returns: + +[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) + +### timestampToUnixSeconds(field) {:#timestamptounixseconds_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. | + +Returns: + +[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) + +### unixMicrosToTimestamp(field) {:#unixmicrostotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp("microseconds"); + +``` + +Signature: + +```typescript +export declare function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +### unixMillisToTimestamp(field) {:#unixmillistotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp("milliseconds"); + +``` + +Signature: + +```typescript +export declare function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) + +### unixSecondsToTimestamp(field) {:#unixsecondstotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp("seconds"); + +``` + +Signature: + +```typescript +export declare function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +### vectorLength(field) {:#vectorlength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a Firestore Vector represented by a field. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength("embedding"); + +``` + +Signature: + +```typescript +export declare function vectorLength(field: string): VectorLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the Firestore Vector. A new representing the length of the array. | + +Returns: + +[VectorLength](./firestore_.vectorlength.md#vectorlength_class) + +## function(fieldPath, ...) + +### orderBy(fieldPath, directionStr) {:#orderby_006d61f} + +Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. + +Note: Documents that do not contain the specified field will not be present in the query result. + +Signature: + +```typescript +export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The field to sort by. | +| directionStr | [OrderByDirection](./firestore_.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | + +Returns: + +[QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) + +The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). + +### where(fieldPath, opStr, value) {:#where_0fae4bf} + +Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. + +Signature: + +```typescript +export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The path to compare | +| opStr | [WhereFilterOp](./firestore_.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | +| value | unknown | The value for comparison | + +Returns: + +[QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) + +The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). + +## function(fieldValues, ...) + +### endAt(fieldValues) {:#endat_8b2f2c8} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | + +Returns: + +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) + +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` + +### endBefore(fieldValues) {:#endbefore_8b2f2c8} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | + +Returns: + +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) + +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` + +### startAfter(fieldValues) {:#startafter_8b2f2c8} + +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | + +Returns: + +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` + +### startAt(fieldValues) {:#startat_8b2f2c8} + +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | + +Returns: + +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. + +## function(filter, ...) + +### not(filter) {:#not_5520849} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that negates a filter condition. + +```typescript +// Find documents where the 'completed' field is NOT true +not(eq("completed", true)); + +``` + +Signature: + +```typescript +export declare function not(filter: FilterExpr): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filter | [FilterExpr](./firestore_.md#filterexpr) | The filter condition to negate. A new representing the negated filter condition. | + +Returns: + +[Not](./firestore_.not.md#not_class) + +## function(first, ...) + +### strConcat(first, elements) {:#strconcat_0f1bdbf} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string functions, fields or constants together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat("firstName", " ", Field.of("lastName")); + +``` + +Signature: + +```typescript +export declare function strConcat(first: string, ...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | string | The field name containing the initial string value. | +| elements | Array<[Constant](./firestore_.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +### strConcat(first, elements) {:#strconcat_1eb0ac1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat(Field.of("firstName"), " ", Field.of("lastName")); + +``` + +Signature: + +```typescript +export declare function strConcat(first: Constant, ...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | [Constant](./firestore_.constant.md#constant_class) | The initial string expression to concatenate to. | +| elements | Array<[Constant](./firestore_.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_.strconcat.md#strconcat_class) + +## function(indexManager, ...) + +### deleteAllPersistentCacheIndexes(indexManager) {:#deleteallpersistentcacheindexes_98b2645} + +Removes all persistent cache indexes. + +Please note this function will also deletes indexes generated by `setIndexConfiguration()`, which is deprecated. + +Signature: + +```typescript +export declare function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | + +Returns: + +void + +### disablePersistentCacheIndexAutoCreation(indexManager) {:#disablepersistentcacheindexautocreation_98b2645} + +Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling `enablePersistentCacheIndexAutoCreation()` still take effect. + +Signature: + +```typescript +export declare function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | + +Returns: + +void + +### enablePersistentCacheIndexAutoCreation(indexManager) {:#enablepersistentcacheindexautocreation_98b2645} + +Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance. + +This feature is disabled by default. + +Signature: + +```typescript +export declare function enablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | + +Returns: + +void + +## function(left, ...) + +### add(left, right) {:#add_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds two expressions together. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add(Field.of("quantity"), Field.of("reserve")); + +``` + +Signature: + +```typescript +export declare function add(left: Constant, right: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to add. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +### add(left, right) {:#add_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds an expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +add(Field.of("age"), 5); + +``` + +Signature: + +```typescript +export declare function add(left: Constant, right: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to add to. | +| right | any | The constant value to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +### add(left, right) {:#add_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a field's value to an expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add("quantity", Field.of("reserve")); + +``` + +Signature: + +```typescript +export declare function add(left: string, right: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to add to. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +### add(left, right) {:#add_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a field's value to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +add("age", 5); + +``` + +Signature: + +```typescript +export declare function add(left: string, right: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to add to. | +| right | any | The constant value to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_.add.md#add_class) + +### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} + +Compares two 'AggregateField\` instances for equality. + +Signature: + +```typescript +export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | +| right | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | + +Returns: + +boolean + +### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} + +Compares two `AggregateQuerySnapshot` instances for equality. + +Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. + +Signature: + +```typescript +export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | +| right | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | + +Returns: + +boolean + +`true` if the objects are "equal", as defined above, or `false` otherwise. + +### and(left, right) {:#and_eba7e36} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a logical 'AND' operation on multiple filter conditions. + +```typescript +// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND +// the 'status' field is "active" +const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + +Signature: + +```typescript +export declare function and(left: FilterExpr, ...right: FilterExpr[]): And; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. | + +Returns: + +[And](./firestore_.and.md#and_class) + +### divide(left, right) {:#divide_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides two expressions. + +```typescript +// Divide the 'total' field by the 'count' field +divide(Field.of("total"), Field.of("count")); + +``` + +Signature: + +```typescript +export declare function divide(left: Constant, right: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to be divided. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +### divide(left, right) {:#divide_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides an expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +divide(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function divide(left: Constant, right: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to be divided. | +| right | any | The constant value to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +### divide(left, right) {:#divide_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides a field's value by an expression. + +```typescript +// Divide the 'total' field by the 'count' field +divide("total", Field.of("count")); + +``` + +Signature: + +```typescript +export declare function divide(left: string, right: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to be divided. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +### divide(left, right) {:#divide_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides a field's value by a constant value. + +```typescript +// Divide the 'value' field by 10 +divide("value", 10); + +``` + +Signature: + +```typescript +export declare function divide(left: string, right: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to be divided. | +| right | any | The constant value to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_.divide.md#divide_class) + +### eq(left, right) {:#eq_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if two expressions are equal. + +```typescript +// Check if the 'age' field is equal to an expression +eq(Field.of("age"), Field.of("minAge").add(10)); + +``` + +Signature: + +```typescript +export declare function eq(left: Constant, right: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +### eq(left, right) {:#eq_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to a constant value. + +```typescript +// Check if the 'age' field is equal to 21 +eq(Field.of("age"), 21); + +``` + +Signature: + +```typescript +export declare function eq(left: Constant, right: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +### eq(left, right) {:#eq_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to an expression. + +```typescript +// Check if the 'age' field is equal to the 'limit' field +eq("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function eq(left: string, right: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +### eq(left, right) {:#eq_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to string constant "London" +eq("city", "London"); + +``` + +Signature: + +```typescript +export declare function eq(left: string, right: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_.eq.md#eq_class) + +### gt(left, right) {:#gt_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is greater than the second expression. + +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), Constant(9).add(9)); + +``` + +Signature: + +```typescript +export declare function gt(left: Constant, right: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +### gt(left, right) {:#gt_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is greater than a constant value. + +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), 18); + +``` + +Signature: + +```typescript +export declare function gt(left: Constant, right: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +### gt(left, right) {:#gt_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than an expression. + +```typescript +// Check if the value of field 'age' is greater than the value of field 'limit' +gt("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function gt(left: string, right: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +### gt(left, right) {:#gt_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +gt("price", 100); + +``` + +Signature: + +```typescript +export declare function gt(left: string, right: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_.gt.md#gt_class) + +### gte(left, right) {:#gte_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is greater than or equal to the second expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to the field "threshold" +gte(Field.of("quantity"), Field.of("threshold")); + +``` + +Signature: + +```typescript +export declare function gte(left: Constant, right: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +### gte(left, right) {:#gte_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is greater than or equal to a constant value. + +```typescript +// Check if the 'quantity' field is greater than or equal to 10 +gte(Field.of("quantity"), 10); + +``` + +Signature: + +```typescript +export declare function gte(left: Constant, right: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +### gte(left, right) {:#gte_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than or equal to an expression. + +```typescript +// Check if the value of field 'age' is greater than or equal to the value of field 'limit' +gte("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function gte(left: string, right: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +### gte(left, right) {:#gte_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +gte("score", 80); + +``` + +Signature: + +```typescript +export declare function gte(left: string, right: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_.gte.md#gte_class) + +### like(left, pattern) {:#like_33ec01b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison against a field. + +```typescript +// Check if the 'title' field contains the string "guide" +like("title", "%guide%"); + +``` + +Signature: + +```typescript +export declare function like(left: string, pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +### like(left, pattern) {:#like_dd84184} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison against a field. + +```typescript +// Check if the 'title' field contains the string "guide" +like("title", Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function like(left: string, pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +### like(left, pattern) {:#like_3aaffe0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison. + +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), "%guide%"); + +``` + +Signature: + +```typescript +export declare function like(left: Constant, pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +### like(left, pattern) {:#like_a2c3e8b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison. + +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function like(left: Constant, pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_.like.md#like_class) + +### logicalMax(left, right) {:#logicalmax_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: Constant, right: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | +| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: Constant, right: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | +| right | any | The right operand constant. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax("field1", Field.of('field2')); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: string, right: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax("value", 10); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: string, right: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | any | The right operand constant. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) + +### logicalMin(left, right) {:#logicalmin_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: Constant, right: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | +| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: Constant, right: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | +| right | any | The right operand constant. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin("field1", Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: string, right: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin("value", 10); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: string, right: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | any | The right operand constant. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) + +### lt(left, right) {:#lt_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is less than the second expression. + +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lt(left: Constant, right: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +### lt(left, right) {:#lt_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is less than a constant value. + +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), 30); + +``` + +Signature: + +```typescript +export declare function lt(left: Constant, right: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +### lt(left, right) {:#lt_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than an expression. + +```typescript +// Check if the 'age' field is less than the 'limit' field +lt("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lt(left: string, right: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +### lt(left, right) {:#lt_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +lt("price", 50); + +``` + +Signature: + +```typescript +export declare function lt(left: string, right: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_.lt.md#lt_class) + +### lte(left, right) {:#lte_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is less than or equal to the second expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lte(left: Constant, right: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +### lte(left, right) {:#lte_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is less than or equal to a constant value. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), 20); + +``` + +Signature: + +```typescript +export declare function lte(left: Constant, right: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +### lte(left, right) {:#lte_674c63f} + +Creates an expression that checks if a field's value is less than or equal to an expression. + +```typescript +// Check if the 'quantity' field is less than or equal to the 'limit' field +lte("quantity", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lte(left: string, right: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +### lte(left, right) {:#lte_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +lte("score", 70); + +``` + +Signature: + +```typescript +export declare function lte(left: string, right: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_.lte.md#lte_class) + +### mod(left, right) {:#mod_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing two expressions. + +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function mod(left: Constant, right: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The dividend expression. | +| right | [Constant](./firestore_.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +### mod(left, right) {:#mod_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. + +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod(Field.of("field1"), 5); + +``` + +Signature: + +```typescript +export declare function mod(left: Constant, right: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The dividend expression. | +| right | any | The divisor constant. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +### mod(left, right) {:#mod_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. + +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod("field1", Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function mod(left: string, right: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The dividend field name. | +| right | [Constant](./firestore_.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +### mod(left, right) {:#mod_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. + +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod("field1", 5); + +``` + +Signature: + +```typescript +export declare function mod(left: string, right: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The dividend field name. | +| right | any | The divisor constant. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_.mod.md#mod_class) + +### multiply(left, right) {:#multiply_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies two expressions together. + +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply(Field.of("quantity"), Field.of("price")); + +``` + +Signature: + +```typescript +export declare function multiply(left: Constant, right: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to multiply. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to multiply. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies an expression by a constant value. + +```typescript +// Multiply the value of the 'price' field by 2 +multiply(Field.of("price"), 2); + +``` + +Signature: + +```typescript +export declare function multiply(left: Constant, right: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply. | +| right | any | The constant value to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies a field's value by an expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply("quantity", Field.of("price")); + +``` + +Signature: + +```typescript +export declare function multiply(left: string, right: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to multiply. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies a field's value by a constant value. + +```typescript +// Multiply the 'value' field by 2 +multiply("value", 2); + +``` + +Signature: + +```typescript +export declare function multiply(left: string, right: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to multiply. | +| right | any | The constant value to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_.multiply.md#multiply_class) + +### neq(left, right) {:#neq_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if two expressions are not equal. + +```typescript +// Check if the 'status' field is not equal to field 'finalState' +neq(Field.of("status"), Field.of("finalState")); + +``` + +Signature: + +```typescript +export declare function neq(left: Constant, right: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the inequality comparison. | + +Returns: -### getFirestore(app) {:#getfirestore_cf608e1} +[Neq](./firestore_.neq.md#neq_class) -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +### neq(left, right) {:#neq_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to a constant value. + +```typescript +// Check if the 'status' field is not equal to "completed" +neq(Field.of("status"), "completed"); + +``` Signature: ```typescript -export declare function getFirestore(app: FirebaseApp): Firestore; +export declare function neq(left: Constant, right: any): Neq; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | Returns: -[Firestore](./firestore_.firestore.md#firestore_class) - -The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. +[Neq](./firestore_.neq.md#neq_class) -### getFirestore(app, databaseId) {:#getfirestore_48de6cb} +### neq(left, right) {:#neq_674c63f} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +Creates an expression that checks if a field's value is not equal to an expression. + +```typescript +// Check if the 'status' field is not equal to the value of 'expectedStatus' +neq("status", Field.of("expectedStatus")); + +``` Signature: ```typescript -export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; +export declare function neq(left: string, right: Constant): Neq; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | -| databaseId | string | The name of the database. | +| left | string | The field name to compare. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the inequality comparison. | Returns: -[Firestore](./firestore_.firestore.md#firestore_class) +[Neq](./firestore_.neq.md#neq_class) -The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. +### neq(left, right) {:#neq_1f46a76} -### initializeFirestore(app, settings, databaseId) {:#initializefirestore_fc7d200} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). +Creates an expression that checks if a field's value is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +neq("country", "USA"); + +``` Signature: ```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; +export declare function neq(left: string, right: any): Neq; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the [Firestore](./firestore_.firestore.md#firestore_class) instance will be associated. | -| settings | [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | A settings object to configure the [Firestore](./firestore_.firestore.md#firestore_class) instance. | -| databaseId | string | The name of the database. | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | Returns: -[Firestore](./firestore_.firestore.md#firestore_class) +[Neq](./firestore_.neq.md#neq_class) -A newly initialized [Firestore](./firestore_.firestore.md#firestore_class) instance. +### or(left, right) {:#or_eba7e36} -## function(firestore, ...) +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### clearIndexedDbPersistence(firestore) {:#clearindexeddbpersistence_231a8e0} +Creates an expression that performs a logical 'OR' operation on multiple filter conditions. -Clears the persistent storage. This includes pending writes and cached documents. +```typescript +// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR +// the 'status' field is "active" +const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); -Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of `failed-precondition`. +``` -Note: `clearIndexedDbPersistence()` is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. +Signature: + +```typescript +export declare function or(left: FilterExpr, ...right: FilterExpr[]): Or; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. | + +Returns: + +[Or](./firestore_.or.md#or_class) + +### queryEqual(left, right) {:#queryequal_7a1f045} + +Returns true if the provided queries point to the same collection and apply the same constraints. Signature: ```typescript -export declare function clearIndexedDbPersistence(firestore: Firestore): Promise; +export declare function queryEqual(left: Query, right: Query): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to clear persistence for. | +| left | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| right | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | Returns: -Promise<void> +boolean -A `Promise` that is resolved when the persistent storage is cleared. Otherwise, the promise is rejected with an error. +true if the references point to the same location in the same Firestore database. -### collection(firestore, path, pathSegments) {:#collection_1eb4c23} +### refEqual(left, right) {:#refequal_598b780} -Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. +Returns true if the provided references are equal. Signature: ```typescript -export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; +export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| left | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| right | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | Returns: -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> +boolean -The `CollectionReference` instance. +true if the references point to the same location in the same Firestore database. -#### Exceptions +### regexContains(left, pattern) {:#regexcontains_33ec01b} -If the final path has an even number of segments and does not point to a collection. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} +Creates an expression that checks if a string field contains a specified regular expression as a substring. -Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", "(?i)example"); + +``` Signature: ```typescript -export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; +export declare function regexContains(left: string, pattern: string): RegexContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | +| left | string | The name of the field containing the string. | +| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | Returns: -[Query](./firestore_.query.md#query_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) -The created `Query`. +### regexContains(left, pattern) {:#regexcontains_dd84184} -### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Modify this instance to communicate with the Cloud Firestore emulator. +Creates an expression that checks if a string field contains a specified regular expression as a substring. -Note: This must be called before this instance has been used to do any operations. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", Field.of("pattern")); + +``` Signature: ```typescript -export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; +export declare function regexContains(left: string, pattern: Constant): RegexContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | -| host | string | the emulator host (ex: localhost). | -| port | number | the emulator port (ex: 9000). | -| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | Returns: -void +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) -### disableNetwork(firestore) {:#disablenetwork_231a8e0} +### regexContains(left, pattern) {:#regexcontains_3aaffe0} -Disables network usage for this instance. It can be re-enabled via [enableNetwork()](./firestore_.md#enablenetwork_231a8e0). While the network is disabled, any snapshot listeners, `getDoc()` or `getDocs()` calls will return results from cache, and any write operations will be queued until the network is restored. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), "(?i)example"); + +``` Signature: ```typescript -export declare function disableNetwork(firestore: Firestore): Promise; +export declare function regexContains(left: Constant, pattern: string): RegexContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | Returns: -Promise<void> +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) -A `Promise` that is resolved once the network has been disabled. +### regexContains(left, pattern) {:#regexcontains_a2c3e8b} -### doc(firestore, path, pathSegments) {:#doc_1eb4c23} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Gets a `DocumentReference` instance that refers to the document at the specified absolute path. +Creates an expression that checks if a string expression contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), Field.of("pattern")); + +``` Signature: ```typescript -export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; +export declare function regexContains(left: Constant, pattern: Constant): RegexContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | Returns: -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> +[RegexContains](./firestore_.regexcontains.md#regexcontains_class) -The `DocumentReference` instance. +### regexMatch(left, pattern) {:#regexmatch_33ec01b} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an odd number of segments and does not point to a document. +Creates an expression that checks if a string field matches a specified regular expression. -### enableIndexedDbPersistence(firestore, persistenceSettings) {:#enableindexeddbpersistence_224174f} +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); -> Warning: This API is now obsolete. -> -> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. -> +``` -Attempts to enable persistent storage, if possible. +Signature: -On failure, `enableIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. +```typescript +export declare function regexMatch(left: string, pattern: string): RegexMatch; +``` -\* failed-precondition: The app is already open in another browser tab. \* unimplemented: The browser is incompatible with the offline persistence implementation. +#### Parameters -Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | -Note: `enableIndexedDbPersistence()` must be called before any other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200), [getFirestore()](./firestore_.md#getfirestore) or [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0). +Returns: -Persistence cannot be used in a Node.js environment. +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +### regexMatch(left, pattern) {:#regexmatch_dd84184} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", Field.of("pattern")); + +``` Signature: ```typescript -export declare function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise; +export declare function regexMatch(left: string, pattern: Constant): RegexMatch; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | -| persistenceSettings | [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Optional settings object to configure persistence. | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | Returns: -Promise<void> - -A `Promise` that represents successfully enabling persistent storage. +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) -### enableMultiTabIndexedDbPersistence(firestore) {:#enablemultitabindexeddbpersistence_231a8e0} +### regexMatch(left, pattern) {:#regexmatch_3aaffe0} -> Warning: This API is now obsolete. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. + +Creates an expression that checks if a string expression matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +export declare function regexMatch(left: Constant, pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to match against. | +| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +### regexMatch(left, pattern) {:#regexmatch_a2c3e8b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Attempts to enable multi-tab persistent storage, if possible. If enabled across all tabs, all operations share access to local persistence, including shared execution of queries and latency-compensated local document updates across all connected instances. +Creates an expression that checks if a string expression matches a specified regular expression. -On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), Field.of("pattern")); -\* failed-precondition: The app is already open in another browser tab and multi-tab is not enabled. \* unimplemented: The browser is incompatible with the offline persistence implementation. +``` -Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. +Signature: + +```typescript +export declare function regexMatch(left: Constant, pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to match against. | +| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) + +### snapshotEqual(left, right) {:#snapshotequal_5109204} + +Returns true if the provided snapshots are equal. Signature: ```typescript -export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise; +export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | +| left | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| right | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | Returns: -Promise<void> +boolean -A `Promise` that represents successfully enabling persistent storage. +true if the snapshots are equal. -### enableNetwork(firestore) {:#enablenetwork_231a8e0} +### strContains(left, substring) {:#strcontains_18eaf5d} -Re-enables use of the network for this [Firestore](./firestore_.firestore.md#firestore_class) instance after a prior call to [disableNetwork()](./firestore_.md#disablenetwork_231a8e0). +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +strContains("description", "example"); + +``` Signature: ```typescript -export declare function enableNetwork(firestore: Firestore): Promise; +export declare function strContains(left: string, substring: string): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| left | string | The name of the field containing the string. | +| substring | string | The substring to search for. A new representing the 'contains' comparison. | Returns: -Promise<void> +[StrContains](./firestore_.strcontains.md#strcontains_class) + +### strContains(left, substring) {:#strcontains_f0f1f2f} -A `Promise` that is resolved once the network has been enabled. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### getPersistentCacheIndexManager(firestore) {:#getpersistentcacheindexmanager_231a8e0} +Creates an expression that checks if a string field contains a substring specified by an expression. -Returns the PersistentCache Index Manager used by the given `Firestore` object. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains("description", Field.of("keyword")); - The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use. +``` Signature: ```typescript -export declare function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; +export declare function strContains(left: string, substring: Constant): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| left | string | The name of the field containing the string. | +| substring | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | Returns: -[PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) \| null +[StrContains](./firestore_.strcontains.md#strcontains_class) -### loadBundle(firestore, bundleData) {:#loadbundle_bec5b75} +### strContains(left, substring) {:#strcontains_5fdbd29} -Loads a Firestore bundle into the local cache. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +strContains(Field.of("description"), "example"); + +``` Signature: ```typescript -export declare function loadBundle(firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string): LoadBundleTask; +export declare function strContains(left: Constant, substring: string): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to load bundles for. | -| bundleData | ReadableStream<Uint8Array> \| ArrayBuffer \| string | An object representing the bundle to be loaded. Valid objects are ArrayBuffer, ReadableStream<Uint8Array> or string. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| substring | string | The substring to search for. A new representing the 'contains' comparison. | Returns: -[LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) +[StrContains](./firestore_.strcontains.md#strcontains_class) -A `LoadBundleTask` object, which notifies callers with progress updates, and completion or error events. It can be used as a `Promise`. +### strContains(left, substring) {:#strcontains_d9d749f} -### namedQuery(firestore, name) {:#namedquery_6438876} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name. +Creates an expression that checks if a string expression contains a substring specified by another expression. -The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using `loadBundle`. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains(Field.of("description"), Field.of("keyword")); + +``` Signature: ```typescript -export declare function namedQuery(firestore: Firestore, name: string): Promise; +export declare function strContains(left: Constant, substring: Constant): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to read the query from. | -| name | string | The name of the query. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| substring | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | Returns: -Promise<[Query](./firestore_.query.md#query_class) \| null> +[StrContains](./firestore_.strcontains.md#strcontains_class) -A `Promise` that is resolved with the Query or `null`. +### subtract(left, right) {:#subtract_be96f75} -### onSnapshotsInSync(firestore, observer) {:#onsnapshotsinsync_2f0dfa4} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. +Creates an expression that subtracts two expressions. -NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract(Field.of("price"), Field.of("discount")); + +``` Signature: ```typescript -export declare function onSnapshotsInSync(firestore: Firestore, observer: { - next?: (value: void) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function subtract(left: Constant, right: Constant): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The instance of Firestore for synchronizing snapshots. | -| observer | { next?: (value: void) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Subtract](./firestore_.subtract.md#subtract_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### subtract(left, right) {:#subtract_010ba9e} -### onSnapshotsInSync(firestore, onSync) {:#onsnapshotsinsync_1901c06} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. +Creates an expression that subtracts a constant value from an expression. -NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use `SnapshotMetadata` in the individual listeners to determine if a snapshot is from the cache or the server. +```typescript +// Subtract the constant value 2 from the 'value' field +subtract(Field.of("value"), 2); + +``` Signature: ```typescript -export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; +export declare function subtract(left: Constant, right: any): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance for synchronizing snapshots. | -| onSync | () => void | A callback to be called every time all snapshot listeners are in sync with each other. | +| left | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from. | +| right | any | The constant value to subtract. A new representing the subtraction operation. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Subtract](./firestore_.subtract.md#subtract_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### subtract(left, right) {:#subtract_674c63f} -### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. +Creates an expression that subtracts an expression from a field's value. -The maximum number of writes allowed in a single transaction is 500. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract("price", Field.of("discount")); + +``` Signature: ```typescript -export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +export declare function subtract(left: string, right: Constant): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | -| updateFunction | (transaction: [Transaction](./firestore_.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | -| options | [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | +| left | string | The field name to subtract from. | +| right | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | Returns: -Promise<T> - -If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. +[Subtract](./firestore_.subtract.md#subtract_class) -### setIndexConfiguration(firestore, configuration) {:#setindexconfiguration_c362f04} +### subtract(left, right) {:#subtract_1f46a76} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -> Warning: This API is now obsolete. -> -> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. -> - -Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. +Creates an expression that subtracts a constant value from a field's value. -The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. +```typescript +// Subtract 20 from the value of the 'total' field +subtract("total", 20); -Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. +``` Signature: ```typescript -export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise; +export declare function subtract(left: string, right: any): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | -| configuration | [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | The index definition. | +| left | string | The field name to subtract from. | +| right | any | The constant value to subtract. A new representing the subtraction operation. | Returns: -Promise<void> - -A `Promise` that resolves once all indices are successfully configured. - -#### Exceptions - -FirestoreError if the JSON format is invalid. +[Subtract](./firestore_.subtract.md#subtract_class) -### setIndexConfiguration(firestore, json) {:#setindexconfiguration_90d0285} +### xor(left, right) {:#xor_eba7e36} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -> Warning: This API is now obsolete. -> -> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. -> - -Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. - -The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. +Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. -Indexes are only supported with IndexedDb persistence. Invoke either `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored. +```typescript +// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", +// or 'status' is "active". +const condition = xor( + gt("age", 18), + eq("city", "London"), + eq("status", "active")); -The method accepts the JSON format exported by the Firebase CLI (`firebase firestore:indexes`). If the JSON format is invalid, this method throws an error. +``` Signature: ```typescript -export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise; +export declare function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | -| json | string | The JSON format exported by the Firebase CLI. | +| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'XOR' together. A new representing the logical 'XOR' operation. | Returns: -Promise<void> - -A `Promise` that resolves once all indices are successfully configured. - -#### Exceptions - -FirestoreError if the JSON format is invalid. - -### terminate(firestore) {:#terminate_231a8e0} - -Terminates the provided [Firestore](./firestore_.firestore.md#firestore_class) instance. - -After calling `terminate()` only the `clearIndexedDbPersistence()` function may be used. Any other function will throw a `FirestoreError`. +[Xor](./firestore_.xor.md#xor_class) -To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.md#getfirestore). +## function(limit, ...) -Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. If you have persistence enabled, the next time you start this instance, it will resume sending these writes to the server. +### limit(limit) {:#limit_ec46c78} -Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with `clearIndexedDbPersistence()` to ensure that all local state is destroyed between test runs. +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. Signature: ```typescript -export declare function terminate(firestore: Firestore): Promise; +export declare function limit(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| limit | number | The maximum number of items to return. | Returns: -Promise<void> - -A `Promise` that is resolved when the instance has been successfully terminated. +[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) -### waitForPendingWrites(firestore) {:#waitforpendingwrites_231a8e0} +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -Waits until all currently pending writes for the active user have been acknowledged by the backend. +### limitToLast(limit) {:#limittolast_ec46c78} -The returned promise resolves immediately if there are no outstanding writes. Otherwise, the promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call `waitForPendingWrites()` again. +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. -Any outstanding `waitForPendingWrites()` promises are rejected during user changes. +You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. Signature: ```typescript -export declare function waitForPendingWrites(firestore: Firestore): Promise; +export declare function limitToLast(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| limit | number | The maximum number of items to return. | Returns: -Promise<void> +[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) -A `Promise` which resolves when all currently pending writes have been acknowledged by the backend. +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -### writeBatch(firestore) {:#writebatch_231a8e0} +## function(logLevel, ...) -Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500. +### setLogLevel(logLevel) {:#setloglevel_d02fda2} -Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. +Sets the verbosity of Cloud Firestore logs (debug, error, or silent). Signature: ```typescript -export declare function writeBatch(firestore: Firestore): WriteBatch; +export declare function setLogLevel(logLevel: LogLevel): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | +| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:

  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| Returns: -[WriteBatch](./firestore_.writebatch.md#writebatch_class) +void -A [WriteBatch](./firestore_.writebatch.md#writebatch_class) that can be used to atomically execute multiple writes. +## function(mapExpr, ...) -## function() +### mapGet(mapExpr, subField) {:#mapget_9715f90} -### count() {:#count} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Create an AggregateField object that can be used to compute the count of documents in the result set of a query. +Accesses a value from a map (object) expression using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +mapGet(Field.of("address"), "city"); + +``` Signature: ```typescript -export declare function count(): AggregateField; +export declare function mapGet(mapExpr: Constant, subField: string): MapGet; ``` -Returns: -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> +#### Parameters -### deleteField() {:#deletefield} +| Parameter | Type | Description | +| --- | --- | --- | +| mapExpr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the map. | +| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | -Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. +Returns: -Signature: +[MapGet](./firestore_.mapget.md#mapget_class) -```typescript -export declare function deleteField(): FieldValue; -``` -Returns: +## function(mapField, ...) -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) +### mapGet(mapField, subField) {:#mapget_b37bbb6} -### documentId() {:#documentid} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +mapGet("address", "city"); + +``` Signature: ```typescript -export declare function documentId(): FieldPath; +export declare function mapGet(mapField: string, subField: string): MapGet; ``` -Returns: -[FieldPath](./firestore_.fieldpath.md#fieldpath_class) +#### Parameters -### getFirestore() {:#getfirestore} +| Parameter | Type | Description | +| --- | --- | --- | +| mapField | string | The field name of the map field. | +| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +Returns: -Signature: +[MapGet](./firestore_.mapget.md#mapget_class) -```typescript -export declare function getFirestore(): Firestore; -``` -Returns: +## function(n, ...) -[Firestore](./firestore_.firestore.md#firestore_class) +### increment(n) {:#increment_5685735} -The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. -### memoryEagerGarbageCollector() {:#memoryeagergarbagecollector} +If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. -Creates an instance of `MemoryEagerGarbageCollector`. This is also the default garbage collector unless it is explicitly specified otherwise. +If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. Signature: ```typescript -export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; +export declare function increment(n: number): FieldValue; ``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| n | number | The value to increment by. | + Returns: -[MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) -### persistentMultipleTabManager() {:#persistentmultipletabmanager} +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -Creates an instance of `PersistentMultipleTabManager`. +## function(name, ...) -Signature: +### genericFunction(name, params) {:#genericfunction_b886545} -```typescript -export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; -``` -Returns: +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -[PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) +Creates functions that work on the backend but do not exist in the SDK yet. -### serverTimestamp() {:#servertimestamp} +```typescript +// Call a user defined function named "myFunc" with the arguments 10 and 20 +// This is the same of the 'sum(Field.of("price"))', if it did not exist +genericFunction("sum", [Field.of("price")]); -Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. +``` Signature: ```typescript -export declare function serverTimestamp(): FieldValue; +export declare function genericFunction(name: string, params: Constant[]): FirestoreFunction; ``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The name of the user defined function. | +| params | [Constant](./firestore_.constant.md#constant_class)\[\] | The arguments to pass to the function. A new representing the function call. | + Returns: -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) +[FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) -## function(databaseId, ...) +## function(pipeline, ...) -### getFirestore(databaseId) {:#getfirestore_53dc891} +### execute(pipeline) {:#execute_86486e6} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +Modular API for console experimentation. Signature: ```typescript -export declare function getFirestore(databaseId: string): Firestore; +export declare function execute(pipeline: Pipeline): Promise>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| databaseId | string | The name of the database. | +| pipeline | [Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> | Execute this pipeline. | Returns: -[Firestore](./firestore_.firestore.md#firestore_class) +Promise<Array<[PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class)<AppModelType>>> -The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. +## function(query, ...) -## function(elements, ...) +### getAggregateFromServer(query, aggregateSpec) {:#getaggregatefromserver_2073a74} -### arrayRemove(elements) {:#arrayremove_7d853aa} +Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. -Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. +Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). + +The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. Signature: ```typescript -export declare function arrayRemove(...elements: unknown[]): FieldValue; +export declare function getAggregateFromServer(query: Query, aggregateSpec: AggregateSpecType): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| elements | unknown\[\] | The elements to remove from the array. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | +| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | Returns: -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) +Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` +### Example -### arrayUnion(elements) {:#arrayunion_7d853aa} -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. +```typescript +const aggregateSnapshot = await getAggregateFromServer(query, { + countOfDocs: count(), + totalHours: sum('hours'), + averageScore: average('score') +}); + +const countOfDocs: number = aggregateSnapshot.data().countOfDocs; +const totalHours: number = aggregateSnapshot.data().totalHours; +const averageScore: number | null = aggregateSnapshot.data().averageScore; + +``` + +### getCountFromServer(query) {:#getcountfromserver_4e56953} + +Calculates the number of documents in the result set of the given query without actually downloading the documents. + +Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). + +The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. Signature: ```typescript -export declare function arrayUnion(...elements: unknown[]): FieldValue; +export declare function getCountFromServer(query: Query): Promise; +}, AppModelType, DbModelType>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| elements | unknown\[\] | The elements to union into the array. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | Returns: -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) +Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. +A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. -## function(field, ...) +### getDocs(query) {:#getdocs_4e56953} -### average(field) {:#average_aacc3a9} +Executes the query and returns the results as a `QuerySnapshot`. -Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. +Note: `getDocs()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). Signature: ```typescript -export declare function average(field: string | FieldPath): AggregateField; +export declare function getDocs(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number \| null> +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -### sum(field) {:#sum_aacc3a9} +A `Promise` that will be resolved with the results of the query. -Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. +### getDocsFromCache(query) {:#getdocsfromcache_4e56953} + +Executes the query and returns the results as a `QuerySnapshot` from cache. Returns an empty result set if no documents matching the query are currently cached. Signature: ```typescript -export declare function sum(field: string | FieldPath): AggregateField; +export declare function getDocsFromCache(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> - -## function(fieldPath, ...) +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -### orderBy(fieldPath, directionStr) {:#orderby_006d61f} +A `Promise` that will be resolved with the results of the query. -Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. +### getDocsFromServer(query) {:#getdocsfromserver_4e56953} -Note: Documents that do not contain the specified field will not be present in the query result. +Executes the query and returns the results as a `QuerySnapshot` from the server. Returns an error if the network is not available. Signature: ```typescript -export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; +export declare function getDocsFromServer(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The field to sort by. | -| directionStr | [OrderByDirection](./firestore_.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). +A `Promise` that will be resolved with the results of the query. -### where(fieldPath, opStr, value) {:#where_0fae4bf} +### onSnapshot(query, observer) {:#onsnapshot_8d14049} -Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; +export declare function onSnapshot(query: Query, observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The path to compare | -| opStr | [WhereFilterOp](./firestore_.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | -| value | unknown | The value for comparison | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -[QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). +An unsubscribe function that can be called to cancel the snapshot listener. -## function(fieldValues, ...) +### onSnapshot(query, options, observer) {:#onsnapshot_03dfff5} -### endAt(fieldValues) {:#endat_8b2f2c8} +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; +export declare function onSnapshot(query: Query, options: SnapshotListenOptions, observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +An unsubscribe function that can be called to cancel the snapshot listener. -### endBefore(fieldValues) {:#endbefore_8b2f2c8} +### onSnapshot(query, onNext, onError, onCompletion) {:#onsnapshot_3ebfbe2} -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +export declare function onSnapshot(query: Query, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +An unsubscribe function that can be called to cancel the snapshot listener. -### startAfter(fieldValues) {:#startafter_8b2f2c8} +### onSnapshot(query, options, onNext, onError, onCompletion) {:#onsnapshot_b8f9c47} -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; +export declare function onSnapshot(query: Query, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +An unsubscribe function that can be called to cancel the snapshot listener. -### startAt(fieldValues) {:#startat_8b2f2c8} +### pipeline(query) {:#pipeline_20b2416} -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +Experimental Modular API for console testing. Signature: ```typescript -export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +export declare function pipeline(query: Query): Pipeline; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | +| query | [Query](./firestore_.query.md#query_class) | | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. - -## function(indexManager, ...) - -### deleteAllPersistentCacheIndexes(indexManager) {:#deleteallpersistentcacheindexes_98b2645} +[Pipeline](./firestore_.pipeline.md#pipeline_class) -Removes all persistent cache indexes. +### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} -Please note this function will also deletes indexes generated by `setIndexConfiguration()`, which is deprecated. +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; +export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| compositeFilter | [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using or . | +| queryConstraints | [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | Returns: -void +[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> -### disablePersistentCacheIndexAutoCreation(indexManager) {:#disablepersistentcacheindexautocreation_98b2645} +#### Exceptions -Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling `enablePersistentCacheIndexAutoCreation()` still take effect. +if any of the provided query constraints cannot be combined with the existing or new constraints. + +### query(query, queryConstraints) {:#query_0f46da1} + +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; +export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| queryConstraints | [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | Returns: -void +[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> -### enablePersistentCacheIndexAutoCreation(indexManager) {:#enablepersistentcacheindexautocreation_98b2645} +#### Exceptions -Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance. +if any of the provided query constraints cannot be combined with the existing or new constraints. -This feature is disabled by default. +## function(queryConstraints, ...) + +### and(queryConstraints) {:#and_e72c712} + +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. Signature: ```typescript -export declare function enablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; +export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | +| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | Returns: -void +[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -## function(left, ...) +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} +### or(queryConstraints) {:#or_e72c712} -Compares two 'AggregateField\` instances for equality. +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. Signature: ```typescript -export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; +export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | -| right | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | +| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | Returns: -boolean +[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -Compares two `AggregateQuerySnapshot` instances for equality. +## function(reference, ...) -Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. +### addDoc(reference, data) {:#adddoc_6e783ff} + +Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. Signature: ```typescript -export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; +export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | -| right | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | +| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | Returns: -boolean +Promise<[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType>> -`true` if the objects are "equal", as defined above, or `false` otherwise. +A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend (Note that it won't resolve while you're offline). -### queryEqual(left, right) {:#queryequal_7a1f045} +### collection(reference, path, pathSegments) {:#collection_568f98d} -Returns true if the provided queries point to the same collection and apply the same constraints. +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function queryEqual(left: Query, right: Query): boolean; +export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | -| right | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -boolean +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -true if the references point to the same location in the same Firestore database. +The `CollectionReference` instance. -### refEqual(left, right) {:#refequal_598b780} +#### Exceptions -Returns true if the provided references are equal. +If the final path has an even number of segments and does not point to a collection. + +### collection(reference, path, pathSegments) {:#collection_70b4396} + +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | -| right | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -boolean +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -true if the references point to the same location in the same Firestore database. +The `CollectionReference` instance. -### snapshotEqual(left, right) {:#snapshotequal_5109204} +#### Exceptions -Returns true if the provided snapshots are equal. +If the final path has an even number of segments and does not point to a collection. + +### deleteDoc(reference) {:#deletedoc_4569087} + +Deletes the document referred to by the specified `DocumentReference`. Signature: ```typescript -export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; +export declare function deleteDoc(reference: DocumentReference): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | -| right | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | Returns: -boolean - -true if the snapshots are equal. +Promise<void> -## function(limit, ...) +A Promise resolved once the document has been successfully deleted from the backend (note that it won't resolve while you're offline). -### limit(limit) {:#limit_ec46c78} +### doc(reference, path, pathSegments) {:#doc_568f98d} -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. Signature: ```typescript -export declare function limit(limit: number): QueryLimitConstraint; +export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +The `DocumentReference` instance. -### limitToLast(limit) {:#limittolast_ec46c78} +#### Exceptions -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. +If the final path has an odd number of segments and does not point to a document. -You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. +### doc(reference, path, pathSegments) {:#doc_70b4396} + +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. Signature: ```typescript -export declare function limitToLast(limit: number): QueryLimitConstraint; +export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +The `DocumentReference` instance. -## function(logLevel, ...) +#### Exceptions -### setLogLevel(logLevel) {:#setloglevel_d02fda2} +If the final path has an odd number of segments and does not point to a document. -Sets the verbosity of Cloud Firestore logs (debug, error, or silent). +### getDoc(reference) {:#getdoc_4569087} + +Reads the document referred to by this `DocumentReference`. + +Note: `getDoc()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). Signature: ```typescript -export declare function setLogLevel(logLevel: LogLevel): void; +export declare function getDoc(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:
  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | Returns: -void - -## function(n, ...) - -### increment(n) {:#increment_5685735} +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. +A Promise resolved with a `DocumentSnapshot` containing the current document contents. -If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. +### getDocFromCache(reference) {:#getdocfromcache_4569087} -If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. +Reads the document referred to by this `DocumentReference` from cache. Returns an error if the document is not currently cached. Signature: ```typescript -export declare function increment(n: number): FieldValue; +export declare function getDocFromCache(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| n | number | The value to increment by. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | Returns: -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) - -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` - -## function(query, ...) - -### getAggregateFromServer(query, aggregateSpec) {:#getaggregatefromserver_2073a74} +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. +A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. -Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +### getDocFromServer(reference) {:#getdocfromserver_4569087} -The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. +Reads the document referred to by this `DocumentReference` from the server. Returns an error if the network is not available. Signature: ```typescript -export declare function getAggregateFromServer(query: Query, aggregateSpec: AggregateSpecType): Promise>; +export declare function getDocFromServer(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | -| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | Returns: -Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> - -### Example - - -```typescript -const aggregateSnapshot = await getAggregateFromServer(query, { - countOfDocs: count(), - totalHours: sum('hours'), - averageScore: average('score') -}); - -const countOfDocs: number = aggregateSnapshot.data().countOfDocs; -const totalHours: number = aggregateSnapshot.data().totalHours; -const averageScore: number | null = aggregateSnapshot.data().averageScore; - -``` +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -### getCountFromServer(query) {:#getcountfromserver_4e56953} +A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. -Calculates the number of documents in the result set of the given query without actually downloading the documents. +### onSnapshot(reference, observer) {:#onsnapshot_0312fd7} -Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. -The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function getCountFromServer(query: Query): Promise; -}, AppModelType, DbModelType>>; +export declare function onSnapshot(reference: DocumentReference, observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. +An unsubscribe function that can be called to cancel the snapshot listener. -### getDocs(query) {:#getdocs_4e56953} +### onSnapshot(reference, options, observer) {:#onsnapshot_86b6b9e} -Executes the query and returns the results as a `QuerySnapshot`. +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. -Note: `getDocs()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function getDocs(query: Query): Promise>; +export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A `Promise` that will be resolved with the results of the query. +An unsubscribe function that can be called to cancel the snapshot listener. -### getDocsFromCache(query) {:#getdocsfromcache_4e56953} +### onSnapshot(reference, onNext, onError, onCompletion) {:#onsnapshot_905f42c} -Executes the query and returns the results as a `QuerySnapshot` from cache. Returns an empty result set if no documents matching the query are currently cached. +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function getDocsFromCache(query: Query): Promise>; +export declare function onSnapshot(reference: DocumentReference, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A `Promise` that will be resolved with the results of the query. +An unsubscribe function that can be called to cancel the snapshot listener. -### getDocsFromServer(query) {:#getdocsfromserver_4e56953} +### onSnapshot(reference, options, onNext, onError, onCompletion) {:#onsnapshot_0c39991} -Executes the query and returns the results as a `QuerySnapshot` from the server. Returns an error if the network is not available. +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function getDocsFromServer(query: Query): Promise>; +export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> - -A `Promise` that will be resolved with the results of the query. +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -### onSnapshot(query, observer) {:#onsnapshot_8d14049} +An unsubscribe function that can be called to cancel the snapshot listener. -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### setDoc(reference, data) {:#setdoc_ee215ad} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Writes to the document referred to by this `DocumentReference`. If the document does not yet exist, it will be created. Signature: ```typescript -export declare function onSnapshot(query: Query, observer: { - next?: (snapshot: QuerySnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +Promise<void> -### onSnapshot(query, options, observer) {:#onsnapshot_03dfff5} +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### setDoc(reference, data, options) {:#setdoc_ff80739} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. Signature: ```typescript -export declare function onSnapshot(query: Query, options: SnapshotListenOptions, observer: { - next?: (snapshot: QuerySnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| options | [SetOptions](./firestore_.md#setoptions) | An object to configure the set behavior. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +Promise<void> -### onSnapshot(query, onNext, onError, onCompletion) {:#onsnapshot_3ebfbe2} +A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### updateDoc(reference, data) {:#updatedoc_51a65e3} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. Signature: ```typescript -export declare function onSnapshot(query: Query, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| data | [UpdateData](./firestore_.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +Promise<void> -An unsubscribe function that can be called to cancel the snapshot listener. +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -### onSnapshot(query, options, onNext, onError, onCompletion) {:#onsnapshot_b8f9c47} +### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. Signature: ```typescript -export declare function onSnapshot(query: Query, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The first field to update. | +| value | unknown | The first value. | +| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +Promise<void> -An unsubscribe function that can be called to cancel the snapshot listener. +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} +## function(settings, ...) -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +### memoryLocalCache(settings) {:#memorylocalcache_05f4bf2} + +Creates an instance of `MemoryLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. Signature: ```typescript -export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; +export declare function memoryLocalCache(settings?: MemoryCacheSettings): MemoryLocalCache; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| compositeFilter | [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using [and()](./firestore_.md#and_e72c712) or [or()](./firestore_.md#or_e72c712). | -| queryConstraints | [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | +| settings | [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | | Returns: -[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions +[MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) -if any of the provided query constraints cannot be combined with the existing or new constraints. +### memoryLruGarbageCollector(settings) {:#memorylrugarbagecollector_5ee014c} -### query(query, queryConstraints) {:#query_0f46da1} +Creates an instance of `MemoryLruGarbageCollector`. -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). Signature: ```typescript -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; +export declare function memoryLruGarbageCollector(settings?: { + cacheSizeBytes?: number; +}): MemoryLruGarbageCollector; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| queryConstraints | [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | +| settings | { cacheSizeBytes?: number; } | | Returns: -[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions - -if any of the provided query constraints cannot be combined with the existing or new constraints. +[MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) -## function(queryConstraints, ...) +### persistentLocalCache(settings) {:#persistentlocalcache_d312f71} -### and(queryConstraints) {:#and_e72c712} +Creates an instance of `PersistentLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. +Persistent cache cannot be used in a Node.js environment. Signature: ```typescript -export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function persistentLocalCache(settings?: PersistentCacheSettings): PersistentLocalCache; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | +| settings | [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | | Returns: -[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) - -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +[PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) -### or(queryConstraints) {:#or_e72c712} +### persistentSingleTabManager(settings) {:#persistentsingletabmanager_c99c68d} -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. +Creates an instance of `PersistentSingleTabManager`. Signature: ```typescript -export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function persistentSingleTabManager(settings: PersistentSingleTabManagerSettings | undefined): PersistentSingleTabManager; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | +| settings | [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) \| undefined | Configures the created tab manager. | Returns: -[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) - -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +[PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) -## function(reference, ...) +## function(snapshot, ...) -### addDoc(reference, data) {:#adddoc_6e783ff} +### endAt(snapshot) {:#endat_9a4477f} -Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | -| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | Returns: -Promise<[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType>> +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend (Note that it won't resolve while you're offline). +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -### collection(reference, path, pathSegments) {:#collection_568f98d} +### endBefore(snapshot) {:#endbefore_9a4477f} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | Returns: -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -If the final path has an even number of segments and does not point to a collection. +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -### collection(reference, path, pathSegments) {:#collection_70b4396} +### startAfter(snapshot) {:#startafter_9a4477f} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | Returns: -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) -If the final path has an even number of segments and does not point to a collection. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -### deleteDoc(reference) {:#deletedoc_4569087} +### startAt(snapshot) {:#startat_9a4477f} -Deletes the document referred to by the specified `DocumentReference`. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. Signature: ```typescript -export declare function deleteDoc(reference: DocumentReference): Promise; +export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | Returns: -Promise<void> +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) -A Promise resolved once the document has been successfully deleted from the backend (note that it won't resolve while you're offline). +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. -### doc(reference, path, pathSegments) {:#doc_568f98d} +## function(timestamp, ...) -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. +### timestampAdd(timestamp, unit, amount) {:#timestampadd_87db576} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to a timestamp. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` Signature: ```typescript -export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; +export declare function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | Returns: -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) -The `DocumentReference` instance. +### timestampAdd(timestamp, unit, amount) {:#timestampadd_46a2d7e} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an odd number of segments and does not point to a document. +Creates an expression that adds a specified amount of time to a timestamp. -### doc(reference, path, pathSegments) {:#doc_70b4396} +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), "day", 1); -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. +``` Signature: ```typescript -export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; +export declare function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | Returns: -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. +[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) -#### Exceptions +### timestampSub(timestamp, unit, amount) {:#timestampsub_87db576} -If the final path has an odd number of segments and does not point to a document. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### getDoc(reference) {:#getdoc_4569087} +Creates an expression that subtracts a specified amount of time from a timestamp. -Reads the document referred to by this `DocumentReference`. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); -Note: `getDoc()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). +``` Signature: ```typescript -export declare function getDoc(reference: DocumentReference): Promise>; +export declare function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | +| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) -A Promise resolved with a `DocumentSnapshot` containing the current document contents. +### timestampSub(timestamp, unit, amount) {:#timestampsub_46a2d7e} -### getDocFromCache(reference) {:#getdocfromcache_4569087} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Reads the document referred to by this `DocumentReference` from cache. Returns an error if the document is not currently cached. +Creates an expression that subtracts a specified amount of time from a timestamp. + +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub(Field.of("timestamp"), "day", 1); + +``` Signature: ```typescript -export declare function getDocFromCache(reference: DocumentReference): Promise>; +export declare function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) -A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. +## function(value, ...) -### getDocFromServer(reference) {:#getdocfromserver_4569087} +### avg(value) {:#avg_f83680a} -Reads the document referred to by this `DocumentReference` from the server. Returns an error if the network is not available. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. + +```typescript +// Calculate the average age of users +avg(Field.of("age")).as("averageAge"); + +``` Signature: ```typescript -export declare function getDocFromServer(reference: DocumentReference): Promise>; +export declare function avg(value: Constant): Avg; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the values to average. A new representing the 'avg' aggregation. | Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +[Avg](./firestore_.avg.md#avg_class) -A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. +### avg(value) {:#avg_7c807cd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### onSnapshot(reference, observer) {:#onsnapshot_0312fd7} +Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +```typescript +// Calculate the average age of users +avg("age").as("averageAge"); -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +``` Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, observer: { - next?: (snapshot: DocumentSnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function avg(value: string): Avg; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| value | string | The name of the field containing numeric values to average. A new representing the 'avg' aggregation. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Avg](./firestore_.avg.md#avg_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### countExpression(value) {:#countexpression_f83680a} -### onSnapshot(reference, options, observer) {:#onsnapshot_86b6b9e} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +```typescript +// Count the number of items where the price is greater than 10 +count(Field.of("price").gt(10)).as("expensiveItemCount"); + +``` Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, observer: { - next?: (snapshot: DocumentSnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function countExpression(value: Constant): Count; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression to count. A new representing the 'count' aggregation. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Count](./firestore_.count.md#count_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### countExpression(value) {:#countexpression_7c807cd} -### onSnapshot(reference, onNext, onError, onCompletion) {:#onsnapshot_905f42c} +Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided field. -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +```typescript +// Count the total number of products +count("productId").as("totalProducts"); -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +``` Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function countExpression(value: string): Count; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| value | string | The name of the field to count. A new representing the 'count' aggregation. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Count](./firestore_.count.md#count_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### exists(value) {:#exists_f83680a} -### onSnapshot(reference, options, onNext, onError, onCompletion) {:#onsnapshot_0c39991} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +Creates an expression that checks if a field exists. -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +```typescript +// Check if the document has a field named "phoneNumber" +exists(Field.of("phoneNumber")); + +``` Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function exists(value: Constant): Exists; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| value | [Constant](./firestore_.constant.md#constant_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[Exists](./firestore_.exists.md#exists_class) -An unsubscribe function that can be called to cancel the snapshot listener. +### isNan(value) {:#isnan_f83680a} -### setDoc(reference, data) {:#setdoc_ee215ad} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Writes to the document referred to by this `DocumentReference`. If the document does not yet exist, it will be created. +Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +isNaN(Field.of("value").divide(0)); + +``` Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; +export declare function isNan(value: Constant): IsNan; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression to check. A new representing the 'isNaN' check. | Returns: -Promise<void> +[IsNan](./firestore_.isnan.md#isnan_class) -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +### isNan(value) {:#isnan_7c807cd} -### setDoc(reference, data, options) {:#setdoc_ff80739} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. +Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +isNaN("value"); + +``` Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; +export declare function isNan(value: string): IsNan; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | -| options | [SetOptions](./firestore_.md#setoptions) | An object to configure the set behavior. | +| value | string | The name of the field to check. A new representing the 'isNaN' check. | Returns: -Promise<void> +[IsNan](./firestore_.isnan.md#isnan_class) -A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +### max(value) {:#max_f83680a} -### updateDoc(reference, data) {:#updatedoc_51a65e3} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. +Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +max(Field.of("score")).as("highestScore"); + +``` Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; +export declare function max(value: Constant): Max; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| data | [UpdateData](./firestore_.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression to find the maximum value of. A new representing the 'max' aggregation. | Returns: -Promise<void> +[Max](./firestore_.max.md#max_class) -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +### max(value) {:#max_7c807cd} -### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. +```typescript +// Find the highest score in a leaderboard +max("score").as("highestScore"); + +``` Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +export declare function max(value: string): Max; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The first field to update. | -| value | unknown | The first value. | -| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | +| value | string | The name of the field to find the maximum value of. A new representing the 'max' aggregation. | Returns: -Promise<void> +[Max](./firestore_.max.md#max_class) -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +### min(value) {:#min_f83680a} -## function(settings, ...) +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### memoryLocalCache(settings) {:#memorylocalcache_05f4bf2} +Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. -Creates an instance of `MemoryLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. +```typescript +// Find the lowest price of all products +min(Field.of("price")).as("lowestPrice"); + +``` Signature: ```typescript -export declare function memoryLocalCache(settings?: MemoryCacheSettings): MemoryLocalCache; +export declare function min(value: Constant): Min; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression to find the minimum value of. A new representing the 'min' aggregation. | Returns: -[MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) +[Min](./firestore_.min.md#min_class) -### memoryLruGarbageCollector(settings) {:#memorylrugarbagecollector_5ee014c} +### min(value) {:#min_7c807cd} -Creates an instance of `MemoryLruGarbageCollector`. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +min("price").as("lowestPrice"); + +``` Signature: ```typescript -export declare function memoryLruGarbageCollector(settings?: { - cacheSizeBytes?: number; -}): MemoryLruGarbageCollector; +export declare function min(value: string): Min; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | { cacheSizeBytes?: number; } | | +| value | string | The name of the field to find the minimum value of. A new representing the 'min' aggregation. | Returns: -[MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) +[Min](./firestore_.min.md#min_class) -### persistentLocalCache(settings) {:#persistentlocalcache_d312f71} +### replaceAll(value, find, replace) {:#replaceall_f06d323} -Creates an instance of `PersistentLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Persistent cache cannot be used in a Node.js environment. +Creates an expression that replaces all occurrences of a substring within a string with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll(Field.of("message"), "hello", "hi"); + +``` Signature: ```typescript -export declare function persistentLocalCache(settings?: PersistentCacheSettings): PersistentLocalCache; +export declare function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | Returns: -[PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) -### persistentSingleTabManager(settings) {:#persistentsingletabmanager_c99c68d} +### replaceAll(value, find, replace) {:#replaceall_26a7926} -Creates an instance of `PersistentSingleTabManager`. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` Signature: ```typescript -export declare function persistentSingleTabManager(settings: PersistentSingleTabManagerSettings | undefined): PersistentSingleTabManager; +export declare function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) \| undefined | Configures the created tab manager. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | Returns: -[PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) +[ReplaceAll](./firestore_.replaceall.md#replaceall_class) -## function(snapshot, ...) +### replaceFirst(value, find, replace) {:#replacefirst_f06d323} -### endAt(snapshot) {:#endat_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Creates an expression that replaces the first occurrence of a substring within a string with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst(Field.of("message"), "hello", "hi"); + +``` Signature: ```typescript -export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### replaceFirst(value, find, replace) {:#replacefirst_26a7926} -### endBefore(snapshot) {:#endbefore_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` Signature: ```typescript -export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### sumExpression(value) {:#sumexpression_f83680a} -### startAfter(snapshot) {:#startafter_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +sum(Field.of("orderAmount")).as("totalRevenue"); + +``` Signature: ```typescript -export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function sumExpression(value: Constant): Sum; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | +| value | [Constant](./firestore_.constant.md#constant_class) | The expression to sum up. A new representing the 'sum' aggregation. | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) +[Sum](./firestore_.sum.md#sum_class) -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +### sumExpression(value) {:#sumexpression_7c807cd} -### startAt(snapshot) {:#startat_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. +Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +sum("orderAmount").as("totalRevenue"); + +``` Signature: ```typescript -export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function sumExpression(value: string): Sum; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | +| value | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. +[Sum](./firestore_.sum.md#sum_class) ## function(values, ...) @@ -2489,6 +9511,19 @@ Constant used to indicate the LRU garbage collection should be disabled. Set thi CACHE_SIZE_UNLIMITED = -1 ``` +## AccumulatorTarget + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An accumulator target, which is an expression with an alias that also implements the Accumulator interface. + +Signature: + +```typescript +export declare type AccumulatorTarget = ExprWithAlias; +``` + ## AddPrefixToKeys Returns a new map where every key is prefixed with the outer key appended to a dot. @@ -2557,6 +9592,32 @@ The type of a `DocumentChange` may be 'added', 'removed', or 'modified'. export declare type DocumentChangeType = 'added' | 'removed' | 'modified'; ``` +## ExprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An enumeration of the different types of expressions. + +Signature: + +```typescript +export declare type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; +``` + +## FilterExpr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter expression, which is an expression that also implements the FilterCondition interface. + +Signature: + +```typescript +export declare type FilterExpr = Constant & FilterCondition; +``` + ## FirestoreErrorCode The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md @@ -2685,6 +9746,19 @@ export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCo export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint; ``` +## SelectableExpr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A selectable expression, which is an expression that also implements the Selectable interface. + +Signature: + +```typescript +export declare type SelectableExpr = Constant & Selectable; +``` + ## SetOptions An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a `SetOptions` with `merge: true`. diff --git a/docs-devsite/firestore_.min.md b/docs-devsite/firestore_.min.md new file mode 100644 index 00000000000..56f71586256 --- /dev/null +++ b/docs-devsite/firestore_.min.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Min class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Min extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_.min.md#minconstructor) | | (BETA) Constructs a new instance of the Min class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_.min.md#minaccumulator) | | true | (BETA) | + +## Min.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Min` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| distinct | boolean | | + +## Min.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.mod.md b/docs-devsite/firestore_.mod.md new file mode 100644 index 00000000000..205eba4f984 --- /dev/null +++ b/docs-devsite/firestore_.mod.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Mod class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Mod extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.mod.md#modconstructor) | | (BETA) Constructs a new instance of the Mod class | + +## Mod.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Mod` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.multiply.md b/docs-devsite/firestore_.multiply.md new file mode 100644 index 00000000000..add30cd9359 --- /dev/null +++ b/docs-devsite/firestore_.multiply.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Multiply class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Multiply extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.multiply.md#multiplyconstructor) | | (BETA) Constructs a new instance of the Multiply class | + +## Multiply.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Multiply` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.neq.md b/docs-devsite/firestore_.neq.md new file mode 100644 index 00000000000..fc44be2b9d7 --- /dev/null +++ b/docs-devsite/firestore_.neq.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Neq class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Neq extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.neq.md#neqconstructor) | | (BETA) Constructs a new instance of the Neq class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.neq.md#neqfilterable) | | true | (BETA) | + +## Neq.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Neq` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + +## Neq.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.not.md b/docs-devsite/firestore_.not.md new file mode 100644 index 00000000000..1b1823f75e6 --- /dev/null +++ b/docs-devsite/firestore_.not.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Not class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Not extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.not.md#notconstructor) | | (BETA) Constructs a new instance of the Not class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.not.md#notfilterable) | | true | (BETA) | + +## Not.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Not` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + +## Not.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.offset.md b/docs-devsite/firestore_.offset.md new file mode 100644 index 00000000000..5d3431f382d --- /dev/null +++ b/docs-devsite/firestore_.offset.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Offset class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Offset implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(offset)](./firestore_.offset.md#offsetconstructor) | | (BETA) Constructs a new instance of the Offset class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.offset.md#offsetname) | | string | (BETA) | + +## Offset.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Offset` class + +Signature: + +```typescript +constructor(offset: number); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| offset | number | | + +## Offset.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.or.md b/docs-devsite/firestore_.or.md new file mode 100644 index 00000000000..d2c506893a0 --- /dev/null +++ b/docs-devsite/firestore_.or.md @@ -0,0 +1,17 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# or namespace +Signature: + +```typescript +export declare namespace or +``` diff --git a/docs-devsite/firestore_.ordering.md b/docs-devsite/firestore_.ordering.md new file mode 100644 index 00000000000..ce673370b28 --- /dev/null +++ b/docs-devsite/firestore_.ordering.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Ordering class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents an ordering criterion for sorting documents in a Firestore pipeline. + +You create `Ordering` instances using the `ascending` and `descending` helper functions. + +Signature: + +```typescript +export declare class Ordering +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, direction)](./firestore_.ordering.md#orderingconstructor) | | (BETA) Constructs a new instance of the Ordering class | + +## Ordering.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Ordering` class + +Signature: + +```typescript +constructor(expr: Constant, direction: 'ascending' | 'descending'); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| direction | 'ascending' \| 'descending' | | + diff --git a/docs-devsite/firestore_.pipeline.md b/docs-devsite/firestore_.pipeline.md new file mode 100644 index 00000000000..18c109d2c83 --- /dev/null +++ b/docs-devsite/firestore_.pipeline.md @@ -0,0 +1,609 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Pipeline class +Signature: + +```typescript +export declare class Pipeline +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [converter](./firestore_.pipeline.md#pipelineconverter) | | any | | +| [readUserData](./firestore_.pipeline.md#pipelinereaduserdata) | | any | Reads user data for each expression in the expressionMap. | +| [selectablesToMap](./firestore_.pipeline.md#pipelineselectablestomap) | | any | | +| [stages](./firestore_.pipeline.md#pipelinestages) | | any | | +| [userDataReader](./firestore_.pipeline.md#pipelineuserdatareader) | | any | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addFields(fields)](./firestore_.pipeline.md#pipelineaddfields) | | Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like add, multiply with assigned aliases using .Example: +```typescript +firestore.pipeline().collection("books") +.addFields( +Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' +add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' +); + +``` + | +| [aggregate(accumulators)](./firestore_.pipeline.md#pipelineaggregate) | | Performs aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances.

Example: +```typescript +// Calculate the average rating and the total number of books +firestore.pipeline().collection("books") +.aggregate( +Field.of("rating").avg().as("averageRating"), +countAll().as("totalBooks") +); + +``` + | +| [aggregate(options)](./firestore_.pipeline.md#pipelineaggregate) | | Performs optionally grouped aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify:

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.

Example: +```typescript +// Calculate the average rating for each genre. +firestore.pipeline().collection("books") +.aggregate({ +accumulators: [avg(Field.of("rating")).as("avg_rating")] +groups: ["genre"] +}); + +``` + | +| [distinct(groups)](./firestore_.pipeline.md#pipelinedistinct) | | Returns a set of distinct values from the inputs to this stage.

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc).

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using

Example: +```typescript +// Get a list of unique author names in uppercase and genre combinations. +firestore.pipeline().collection("books") +.distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") +.select("authorName"); + +``` + | +| [execute()](./firestore_.pipeline.md#pipelineexecute) | | Executes this pipeline and returns a Promise to represent the asynchronous operation.

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.

Example: +```typescript +const futureResults = await firestore.pipeline().collection("books") + .where(gt(Field.of("rating"), 4.5)) + .select("title", "author", "rating") + .execute(); + +``` + A Promise representing the asynchronous pipeline execution. | +| [findNearest(options)](./firestore_.pipeline.md#pipelinefindnearest) | | | +| [genericStage(name, params)](./firestore_.pipeline.md#pipelinegenericstage) | | Adds a generic stage to the pipeline.

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique name and a set of params that control its behavior.

Example (Assuming there is no "where" stage available in SDK): +```typescript +// Assume we don't have a built-in "where" stage +firestore.pipeline().collection("books") +.genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage +.select("title", "author"); + +``` + | +| [limit(limit)](./firestore_.pipeline.md#pipelinelimit) | | Limits the maximum number of documents returned by previous stages to limit.

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for:

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.

Example: +```typescript +// Limit the results to the top 10 highest-rated books +firestore.pipeline().collection("books") +.sort(Field.of("rating").descending()) +.limit(10); + +``` + | +| [offset(offset)](./firestore_.pipeline.md#pipelineoffset) | | Skips the first offset number of documents from the results of previous stages.

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.

Example: +```typescript +// Retrieve the second page of 20 results +firestore.pipeline().collection("books") +.sort(Field.of("published").descending()) +.offset(20) // Skip the first 20 results +.limit(20); // Take the next 20 results + +``` + | +| [select(selections)](./firestore_.pipeline.md#pipelineselect) | | Selects or creates a set of fields from the outputs of previous stages.

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.

Example: +```typescript +firestore.pipeline().collection("books") +.select( +"firstName", +Field.of("lastName"), +Field.of("address").toUppercase().as("upperAddress"), +); + +``` + | +| [sort(orderings)](./firestore_.pipeline.md#pipelinesort) | | Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria.

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.

Example: +```typescript +// Sort books by rating in descending order, and then by title in ascending order for books +// with the same rating +firestore.pipeline().collection("books") +.sort( +Ordering.of(Field.of("rating")).descending(), +Ordering.of(Field.of("title")) // Ascending order is the default +); + +``` + | +| [sort(options)](./firestore_.pipeline.md#pipelinesort) | | | +| [where(condition)](./firestore_.pipeline.md#pipelinewhere) | | Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface).

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to:

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.

Example: +```typescript +firestore.pipeline().collection("books") +.where( +and( +gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 +Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") +) +); + +``` + | + +## Pipeline.converter + +Signature: + +```typescript +converter: any; +``` + +## Pipeline.readUserData + +Reads user data for each expression in the expressionMap. + +Signature: + +```typescript +readUserData: any; +``` + +## Pipeline.selectablesToMap + +Signature: + +```typescript +selectablesToMap: any; +``` + +## Pipeline.stages + +Signature: + +```typescript +stages: any; +``` + +## Pipeline.userDataReader + +Signature: + +```typescript +userDataReader: any; +``` + +## Pipeline.addFields() + +Adds new fields to outputs from previous stages. + +This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps). + +The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be: + +- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like `add`, `multiply` with assigned aliases using . + +Example: + +```typescript +firestore.pipeline().collection("books") +.addFields( +Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' +add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' +); + +``` + +Signature: + +```typescript +addFields(...fields: Selectable[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fields | [Selectable](./firestore_.selectable.md#selectable_interface)\[\] | The fields to add to the documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface)s. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.aggregate() + +Performs aggregation operations on the documents from previous stages. + +

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. + +

Example: + +```typescript +// Calculate the average rating and the total number of books +firestore.pipeline().collection("books") +.aggregate( +Field.of("rating").avg().as("averageRating"), +countAll().as("totalBooks") +); + +``` + +Signature: + +```typescript +aggregate(...accumulators: AccumulatorTarget[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| accumulators | [AccumulatorTarget](./firestore_.md#accumulatortarget)\[\] | The [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, each wrapping an [Accumulator](./firestore_.accumulator.md#accumulator_interface) and provide a name for the accumulated results. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.aggregate() + +Performs optionally grouped aggregation operations on the documents from previous stages. + +

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: + +

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.
+ +

Example: + +```typescript +// Calculate the average rating for each genre. +firestore.pipeline().collection("books") +.aggregate({ +accumulators: [avg(Field.of("rating")).as("avg_rating")] +groups: ["genre"] +}); + +``` + +Signature: + +```typescript +aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | { accumulators: [AccumulatorTarget](./firestore_.md#accumulatortarget)\[\]; groups?: Array<string \| [Selectable](./firestore_.selectable.md#selectable_interface)>; } | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.distinct() + +Returns a set of distinct values from the inputs to this stage. + +

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc). + +

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s: + +

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using
+ +

Example: + +```typescript +// Get a list of unique author names in uppercase and genre combinations. +firestore.pipeline().collection("books") +.distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") +.select("authorName"); + +``` + +Signature: + +```typescript +distinct(...groups: Array): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| groups | Array<string \| [Selectable](./firestore_.selectable.md#selectable_interface)> | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.execute() + +Executes this pipeline and returns a Promise to represent the asynchronous operation. + +

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously. + +

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: + +

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.
+ +

Example: + +```typescript +const futureResults = await firestore.pipeline().collection("books") + .where(gt(Field.of("rating"), 4.5)) + .select("title", "author", "rating") + .execute(); + +``` + A Promise representing the asynchronous pipeline execution. + +Signature: + +```typescript +execute(): Promise>>; +``` +Returns: + +Promise<Array<[PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class)<AppModelType>>> + +## Pipeline.findNearest() + +Signature: + +```typescript +findNearest(options: FindNearestOptions): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [FindNearestOptions](./firestore_.findnearestoptions.md#findnearestoptions_interface) | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.genericStage() + +Adds a generic stage to the pipeline. + +

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique `name` and a set of `params` that control its behavior. + +

Example (Assuming there is no "where" stage available in SDK): + +```typescript +// Assume we don't have a built-in "where" stage +firestore.pipeline().collection("books") +.genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage +.select("title", "author"); + +``` + +Signature: + +```typescript +genericStage(name: string, params: any[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The unique name of the generic stage to add. | +| params | any\[\] | A list of parameters to configure the generic stage's behavior. A new object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.limit() + +Limits the maximum number of documents returned by previous stages to `limit`. + +

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: + +

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.
+ +

Example: + +```typescript +// Limit the results to the top 10 highest-rated books +firestore.pipeline().collection("books") +.sort(Field.of("rating").descending()) +.limit(10); + +``` + +Signature: + +```typescript +limit(limit: number): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| limit | number | The maximum number of documents to return. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.offset() + +Skips the first `offset` number of documents from the results of previous stages. + +

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. + +

Example: + +```typescript +// Retrieve the second page of 20 results +firestore.pipeline().collection("books") +.sort(Field.of("published").descending()) +.offset(20) // Skip the first 20 results +.limit(20); // Take the next 20 results + +``` + +Signature: + +```typescript +offset(offset: number): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| offset | number | The number of documents to skip. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.select() + +Selects or creates a set of fields from the outputs of previous stages. + +

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be: + +

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using
+ +

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. + +

Example: + +```typescript +firestore.pipeline().collection("books") +.select( +"firstName", +Field.of("lastName"), +Field.of("address").toUppercase().as("upperAddress"), +); + +``` + +Signature: + +```typescript +select(...selections: Array): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selections | Array<[Selectable](./firestore_.selectable.md#selectable_interface) \| string> | The fields to include in the output documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface) expressions or values representing field names. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.sort() + +Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria. + +

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. + +

Example: + +```typescript +// Sort books by rating in descending order, and then by title in ascending order for books +// with the same rating +firestore.pipeline().collection("books") +.sort( +Ordering.of(Field.of("rating")).descending(), +Ordering.of(Field.of("title")) // Ascending order is the default +); + +``` + +Signature: + +```typescript +sort(...orderings: Ordering[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| orderings | [Ordering](./firestore_.ordering.md#ordering_class)\[\] | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.sort() + +Signature: + +```typescript +sort(options: { orderings: Ordering[]; }): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | { orderings: [Ordering](./firestore_.ordering.md#ordering_class)\[\]; } | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.where() + +Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface). + +

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to: + +

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.
+ +

Example: + +```typescript +firestore.pipeline().collection("books") +.where( +and( +gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 +Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") +) +); + +``` + +Signature: + +```typescript +where(condition: FilterCondition & Constant): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) & [Constant](./firestore_.constant.md#constant_class) | The [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) to apply. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> + diff --git a/docs-devsite/firestore_.pipelineresult.md b/docs-devsite/firestore_.pipelineresult.md new file mode 100644 index 00000000000..a035e4375ff --- /dev/null +++ b/docs-devsite/firestore_.pipelineresult.md @@ -0,0 +1,184 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# PipelineResult class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods. + +

If the PipelineResult represents a non-document result, `ref` will return a undefined value. + +Signature: + +```typescript +export declare class PipelineResult +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [createTime](./firestore_.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was created. Undefined if this result is not a document. {Timestamp\|undefined} | +| [executionTime](./firestore_.pipelineresult.md#pipelineresultexecutiontime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) | (BETA) The time at which the pipeline producing this result is executed. {Timestamp} | +| [id](./firestore_.pipelineresult.md#pipelineresultid) | | string \| undefined | (BETA) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. {string} | +| [ref](./firestore_.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class) \| undefined | (BETA) The reference of the document, if it is a document; otherwise undefined. | +| [updateTime](./firestore_.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [data()](./firestore_.pipelineresult.md#pipelineresultdata) | | (BETA) Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. | +| [get(fieldPath)](./firestore_.pipelineresult.md#pipelineresultget) | | (BETA) Retrieves the field specified by field. | + +## PipelineResult.createTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time the document was created. Undefined if this result is not a document. + + {Timestamp\|undefined} + +Signature: + +```typescript +get createTime(): Timestamp | undefined; +``` + +## PipelineResult.executionTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time at which the pipeline producing this result is executed. + + {Timestamp} + +Signature: + +```typescript +get executionTime(): Timestamp; +``` + +## PipelineResult.id + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The ID of the document for which this PipelineResult contains data, if it is a document; otherwise `undefined`. + + {string} + +Signature: + +```typescript +get id(): string | undefined; +``` + +## PipelineResult.ref + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The reference of the document, if it is a document; otherwise `undefined`. + +Signature: + +```typescript +get ref(): DocumentReference | undefined; +``` + +## PipelineResult.updateTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. + + {Timestamp\|undefined} + +Signature: + +```typescript +get updateTime(): Timestamp | undefined; +``` + +## PipelineResult.data() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. + +Signature: + +```typescript +data(): AppModelType | undefined; +``` +Returns: + +AppModelType \| undefined + +{T\|undefined} An object containing all fields in the document or 'undefined' if the document doesn't exist. + +### Example + + +``` +let p = firestore.pipeline().collection('col'); + +p.execute().then(results => { + let data = results[0].data(); + console.log(`Retrieved data: ${JSON.stringify(data)}`); +}); + +``` + +## PipelineResult.get() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Retrieves the field specified by `field`. + +Signature: + +```typescript +get(fieldPath: string | FieldPath): any; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | | + +Returns: + +any + +{\*} The data at the specified field location or undefined if no such field exists. + +### Example + + +``` +let p = firestore.pipeline().collection('col'); + +p.execute().then(results => { + let field = results[0].get('a.b'); + console.log(`Retrieved field value: ${field}`); +}); + +``` + diff --git a/docs-devsite/firestore_.pipelinesource.md b/docs-devsite/firestore_.pipelinesource.md new file mode 100644 index 00000000000..cbe4150b1fe --- /dev/null +++ b/docs-devsite/firestore_.pipelinesource.md @@ -0,0 +1,109 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# PipelineSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). + +Signature: + +```typescript +export declare class PipelineSource +``` + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [collection(collectionPath)](./firestore_.pipelinesource.md#pipelinesourcecollection) | | (BETA) | +| [collectionGroup(collectionId)](./firestore_.pipelinesource.md#pipelinesourcecollectiongroup) | | (BETA) | +| [database()](./firestore_.pipelinesource.md#pipelinesourcedatabase) | | (BETA) | +| [documents(docs)](./firestore_.pipelinesource.md#pipelinesourcedocuments) | | (BETA) | + +## PipelineSource.collection() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +collection(collectionPath: string): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionPath | string | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class) + +## PipelineSource.collectionGroup() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +collectionGroup(collectionId: string): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionId | string | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class) + +## PipelineSource.database() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +database(): Pipeline; +``` +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class) + +## PipelineSource.documents() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +documents(docs: DocumentReference[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| docs | [DocumentReference](./firestore_.documentreference.md#documentreference_class)\[\] | | + +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class) + diff --git a/docs-devsite/firestore_.query.md b/docs-devsite/firestore_.query.md index 086d117aa1e..f4d0c8d20e1 100644 --- a/docs-devsite/firestore_.query.md +++ b/docs-devsite/firestore_.query.md @@ -36,6 +36,7 @@ export declare class QueryNewDbModelType and your custom type NewAppModelType. | @@ -79,6 +80,19 @@ The type of this Firestore reference. readonly type: 'query' | 'collection'; ``` +## Query.pipeline() + +Pipeline query. + +Signature: + +```typescript +pipeline(): Pipeline; +``` +Returns: + +[Pipeline](./firestore_.pipeline.md#pipeline_class) + ## Query.withConverter() Removes the current converter. diff --git a/docs-devsite/firestore_.querycompositefilterconstraint.md b/docs-devsite/firestore_.querycompositefilterconstraint.md index bb00c3bf2b3..61afef2b6b7 100644 --- a/docs-devsite/firestore_.querycompositefilterconstraint.md +++ b/docs-devsite/firestore_.querycompositefilterconstraint.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # QueryCompositeFilterConstraint class -A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. +A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. Signature: diff --git a/docs-devsite/firestore_.regexcontains.md b/docs-devsite/firestore_.regexcontains.md new file mode 100644 index 00000000000..b9be8441054 --- /dev/null +++ b/docs-devsite/firestore_.regexcontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RegexContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class RegexContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_.regexcontains.md#regexcontainsconstructor) | | (BETA) Constructs a new instance of the RegexContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.regexcontains.md#regexcontainsfilterable) | | true | (BETA) | + +## RegexContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `RegexContains` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +## RegexContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.regexmatch.md b/docs-devsite/firestore_.regexmatch.md new file mode 100644 index 00000000000..5a8ccf289aa --- /dev/null +++ b/docs-devsite/firestore_.regexmatch.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RegexMatch class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class RegexMatch extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_.regexmatch.md#regexmatchconstructor) | | (BETA) Constructs a new instance of the RegexMatch class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.regexmatch.md#regexmatchfilterable) | | true | (BETA) | + +## RegexMatch.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `RegexMatch` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| pattern | [Constant](./firestore_.constant.md#constant_class) | | + +## RegexMatch.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.replaceall.md b/docs-devsite/firestore_.replaceall.md new file mode 100644 index 00000000000..592c709eac7 --- /dev/null +++ b/docs-devsite/firestore_.replaceall.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ReplaceAll class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ReplaceAll extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, find, replace)](./firestore_.replaceall.md#replaceallconstructor) | | (BETA) Constructs a new instance of the ReplaceAll class | + +## ReplaceAll.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ReplaceAll` class + +Signature: + +```typescript +constructor(value: Constant, find: Constant, replace: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| find | [Constant](./firestore_.constant.md#constant_class) | | +| replace | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.replacefirst.md b/docs-devsite/firestore_.replacefirst.md new file mode 100644 index 00000000000..d79957a1f6b --- /dev/null +++ b/docs-devsite/firestore_.replacefirst.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ReplaceFirst class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ReplaceFirst extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, find, replace)](./firestore_.replacefirst.md#replacefirstconstructor) | | (BETA) Constructs a new instance of the ReplaceFirst class | + +## ReplaceFirst.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ReplaceFirst` class + +Signature: + +```typescript +constructor(value: Constant, find: Constant, replace: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| find | [Constant](./firestore_.constant.md#constant_class) | | +| replace | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.reverse.md b/docs-devsite/firestore_.reverse.md new file mode 100644 index 00000000000..f6d8f61a312 --- /dev/null +++ b/docs-devsite/firestore_.reverse.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Reverse class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Reverse extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_.reverse.md#reverseconstructor) | | (BETA) Constructs a new instance of the Reverse class | + +## Reverse.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Reverse` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.select.md b/docs-devsite/firestore_.select.md new file mode 100644 index 00000000000..42fe74ce7db --- /dev/null +++ b/docs-devsite/firestore_.select.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Select class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Select implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(projections)](./firestore_.select.md#selectconstructor) | | (BETA) Constructs a new instance of the Select class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.select.md#selectname) | | string | (BETA) | + +## Select.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Select` class + +Signature: + +```typescript +constructor(projections: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| projections | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | + +## Select.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.selectable.md b/docs-devsite/firestore_.selectable.md new file mode 100644 index 00000000000..0fb32592d4a --- /dev/null +++ b/docs-devsite/firestore_.selectable.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Selectable interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents a selectable expression. + +Signature: + +```typescript +export declare interface Selectable +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [selectable](./firestore_.selectable.md#selectableselectable) | true | (BETA) | + +## Selectable.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` diff --git a/docs-devsite/firestore_.sort.md b/docs-devsite/firestore_.sort.md new file mode 100644 index 00000000000..fa7e1d119fc --- /dev/null +++ b/docs-devsite/firestore_.sort.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Sort class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Sort implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(orders)](./firestore_.sort.md#sortconstructor) | | (BETA) Constructs a new instance of the Sort class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.sort.md#sortname) | | string | (BETA) | + +## Sort.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Sort` class + +Signature: + +```typescript +constructor(orders: Ordering[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| orders | [Ordering](./firestore_.ordering.md#ordering_class)\[\] | | + +## Sort.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.stage.md b/docs-devsite/firestore_.stage.md new file mode 100644 index 00000000000..34a94a3d4ba --- /dev/null +++ b/docs-devsite/firestore_.stage.md @@ -0,0 +1,38 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Stage interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare interface Stage +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [name](./firestore_.stage.md#stagename) | string | (BETA) | + +## Stage.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.startswith.md b/docs-devsite/firestore_.startswith.md new file mode 100644 index 00000000000..e12aca31300 --- /dev/null +++ b/docs-devsite/firestore_.startswith.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StartsWith class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StartsWith extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, prefix)](./firestore_.startswith.md#startswithconstructor) | | (BETA) Constructs a new instance of the StartsWith class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.startswith.md#startswithfilterable) | | true | (BETA) | + +## StartsWith.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StartsWith` class + +Signature: + +```typescript +constructor(expr: Constant, prefix: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| prefix | [Constant](./firestore_.constant.md#constant_class) | | + +## StartsWith.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.strconcat.md b/docs-devsite/firestore_.strconcat.md new file mode 100644 index 00000000000..5d044f31561 --- /dev/null +++ b/docs-devsite/firestore_.strconcat.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StrConcat class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StrConcat extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(first, rest)](./firestore_.strconcat.md#strconcatconstructor) | | (BETA) Constructs a new instance of the StrConcat class | + +## StrConcat.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StrConcat` class + +Signature: + +```typescript +constructor(first: Constant, rest: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | [Constant](./firestore_.constant.md#constant_class) | | +| rest | [Constant](./firestore_.constant.md#constant_class)\[\] | | + diff --git a/docs-devsite/firestore_.strcontains.md b/docs-devsite/firestore_.strcontains.md new file mode 100644 index 00000000000..a704676ad7a --- /dev/null +++ b/docs-devsite/firestore_.strcontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StrContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StrContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, substring)](./firestore_.strcontains.md#strcontainsconstructor) | | (BETA) Constructs a new instance of the StrContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.strcontains.md#strcontainsfilterable) | | true | (BETA) | + +## StrContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StrContains` class + +Signature: + +```typescript +constructor(expr: Constant, substring: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | +| substring | [Constant](./firestore_.constant.md#constant_class) | | + +## StrContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_.subtract.md b/docs-devsite/firestore_.subtract.md new file mode 100644 index 00000000000..d72563e8471 --- /dev/null +++ b/docs-devsite/firestore_.subtract.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Subtract class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Subtract extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_.subtract.md#subtractconstructor) | | (BETA) Constructs a new instance of the Subtract class | + +## Subtract.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Subtract` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_.constant.md#constant_class) | | +| right | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.sum.md b/docs-devsite/firestore_.sum.md new file mode 100644 index 00000000000..41d11c83b0c --- /dev/null +++ b/docs-devsite/firestore_.sum.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Sum class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Sum extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_.sum.md#sumconstructor) | | (BETA) Constructs a new instance of the Sum class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_.sum.md#sumaccumulator) | | true | (BETA) | + +## Sum.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Sum` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | +| distinct | boolean | | + +## Sum.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_.timestampadd.md b/docs-devsite/firestore_.timestampadd.md new file mode 100644 index 00000000000..9e563f5f364 --- /dev/null +++ b/docs-devsite/firestore_.timestampadd.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampAdd class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampAdd extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(timestamp, unit, amount)](./firestore_.timestampadd.md#timestampaddconstructor) | | (BETA) Constructs a new instance of the TimestampAdd class | + +## TimestampAdd.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampAdd` class + +Signature: + +```typescript +constructor(timestamp: Constant, unit: Constant, amount: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | | +| unit | [Constant](./firestore_.constant.md#constant_class) | | +| amount | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.timestampsub.md b/docs-devsite/firestore_.timestampsub.md new file mode 100644 index 00000000000..a3a28e60c1b --- /dev/null +++ b/docs-devsite/firestore_.timestampsub.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampSub class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampSub extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(timestamp, unit, amount)](./firestore_.timestampsub.md#timestampsubconstructor) | | (BETA) Constructs a new instance of the TimestampSub class | + +## TimestampSub.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampSub` class + +Signature: + +```typescript +constructor(timestamp: Constant, unit: Constant, amount: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| timestamp | [Constant](./firestore_.constant.md#constant_class) | | +| unit | [Constant](./firestore_.constant.md#constant_class) | | +| amount | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.timestamptounixmicros.md b/docs-devsite/firestore_.timestamptounixmicros.md new file mode 100644 index 00000000000..3075048c254 --- /dev/null +++ b/docs-devsite/firestore_.timestamptounixmicros.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixMicros class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixMicros extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.timestamptounixmicros.md#timestamptounixmicrosconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMicros class | + +## TimestampToUnixMicros.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixMicros` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.timestamptounixmillis.md b/docs-devsite/firestore_.timestamptounixmillis.md new file mode 100644 index 00000000000..0098c5932dd --- /dev/null +++ b/docs-devsite/firestore_.timestamptounixmillis.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixMillis class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixMillis extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.timestamptounixmillis.md#timestamptounixmillisconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMillis class | + +## TimestampToUnixMillis.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixMillis` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.timestamptounixseconds.md b/docs-devsite/firestore_.timestamptounixseconds.md new file mode 100644 index 00000000000..49b2dd97664 --- /dev/null +++ b/docs-devsite/firestore_.timestamptounixseconds.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixSeconds class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixSeconds extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.timestamptounixseconds.md#timestamptounixsecondsconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixSeconds class | + +## TimestampToUnixSeconds.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixSeconds` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.tolower.md b/docs-devsite/firestore_.tolower.md new file mode 100644 index 00000000000..b5b29215bcd --- /dev/null +++ b/docs-devsite/firestore_.tolower.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ToLower class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ToLower extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.tolower.md#tolowerconstructor) | | (BETA) Constructs a new instance of the ToLower class | + +## ToLower.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ToLower` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.toupper.md b/docs-devsite/firestore_.toupper.md new file mode 100644 index 00000000000..bfd5fb607b4 --- /dev/null +++ b/docs-devsite/firestore_.toupper.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ToUpper class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ToUpper extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.toupper.md#toupperconstructor) | | (BETA) Constructs a new instance of the ToUpper class | + +## ToUpper.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ToUpper` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.trim.md b/docs-devsite/firestore_.trim.md new file mode 100644 index 00000000000..bfbce9afbed --- /dev/null +++ b/docs-devsite/firestore_.trim.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Trim class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Trim extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_.trim.md#trimconstructor) | | (BETA) Constructs a new instance of the Trim class | + +## Trim.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Trim` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.unixmicrostotimestamp.md b/docs-devsite/firestore_.unixmicrostotimestamp.md new file mode 100644 index 00000000000..cd40de9afb3 --- /dev/null +++ b/docs-devsite/firestore_.unixmicrostotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixMicrosToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixMicrosToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMicrosToTimestamp class | + +## UnixMicrosToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixMicrosToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.unixmillistotimestamp.md b/docs-devsite/firestore_.unixmillistotimestamp.md new file mode 100644 index 00000000000..554deb16305 --- /dev/null +++ b/docs-devsite/firestore_.unixmillistotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixMillisToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixMillisToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.unixmillistotimestamp.md#unixmillistotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMillisToTimestamp class | + +## UnixMillisToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixMillisToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.unixsecondstotimestamp.md b/docs-devsite/firestore_.unixsecondstotimestamp.md new file mode 100644 index 00000000000..935b579ca0b --- /dev/null +++ b/docs-devsite/firestore_.unixsecondstotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixSecondsToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixSecondsToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestampconstructor) | | (BETA) Constructs a new instance of the UnixSecondsToTimestamp class | + +## UnixSecondsToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixSecondsToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.vectorlength.md b/docs-devsite/firestore_.vectorlength.md new file mode 100644 index 00000000000..0a7097bdbdd --- /dev/null +++ b/docs-devsite/firestore_.vectorlength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# VectorLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class VectorLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_.vectorlength.md#vectorlengthconstructor) | | (BETA) Constructs a new instance of the VectorLength class | + +## VectorLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `VectorLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_.where.md b/docs-devsite/firestore_.where.md new file mode 100644 index 00000000000..a6cca720fb8 --- /dev/null +++ b/docs-devsite/firestore_.where.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Where class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Where implements Stage +``` +Implements: [Stage](./firestore_.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(condition)](./firestore_.where.md#whereconstructor) | | (BETA) Constructs a new instance of the Where class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_.where.md#wherename) | | string | (BETA) | + +## Where.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Where` class + +Signature: + +```typescript +constructor(condition: FilterCondition & Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) & [Constant](./firestore_.constant.md#constant_class) | | + +## Where.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_.xor.md b/docs-devsite/firestore_.xor.md new file mode 100644 index 00000000000..b7a9269ed1b --- /dev/null +++ b/docs-devsite/firestore_.xor.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Xor class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Xor extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(conditions)](./firestore_.xor.md#xorconstructor) | | (BETA) Constructs a new instance of the Xor class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_.xor.md#xorfilterable) | | true | (BETA) | + +## Xor.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Xor` class + +Signature: + +```typescript +constructor(conditions: FilterExpr[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| conditions | [FilterExpr](./firestore_.md#filterexpr)\[\] | | + +## Xor.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.accumulator.md b/docs-devsite/firestore_lite.accumulator.md new file mode 100644 index 00000000000..0b26c43d241 --- /dev/null +++ b/docs-devsite/firestore_lite.accumulator.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Accumulator interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents an accumulator. + +Signature: + +```typescript +export declare interface Accumulator +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [accumulator](./firestore_lite.accumulator.md#accumulatoraccumulator) | true | (BETA) | + +## Accumulator.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.add.md b/docs-devsite/firestore_lite.add.md new file mode 100644 index 00000000000..a01caad72ca --- /dev/null +++ b/docs-devsite/firestore_lite.add.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Add class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Add extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.add.md#addconstructor) | | (BETA) Constructs a new instance of the Add class | + +## Add.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Add` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.addfields.md b/docs-devsite/firestore_lite.addfields.md new file mode 100644 index 00000000000..7cef7ce90a3 --- /dev/null +++ b/docs-devsite/firestore_lite.addfields.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AddFields class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class AddFields implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(fields)](./firestore_lite.addfields.md#addfieldsconstructor) | | (BETA) Constructs a new instance of the AddFields class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.addfields.md#addfieldsname) | | string | (BETA) | + +## AddFields.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `AddFields` class + +Signature: + +```typescript +constructor(fields: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fields | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | + +## AddFields.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.aggregate.md b/docs-devsite/firestore_lite.aggregate.md new file mode 100644 index 00000000000..b5df22e08ab --- /dev/null +++ b/docs-devsite/firestore_lite.aggregate.md @@ -0,0 +1,65 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Aggregate class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Aggregate implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(accumulators, groups)](./firestore_lite.aggregate.md#aggregateconstructor) | | (BETA) Constructs a new instance of the Aggregate class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.aggregate.md#aggregatename) | | string | (BETA) | + +## Aggregate.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Aggregate` class + +Signature: + +```typescript +constructor(accumulators: Map, groups: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| accumulators | Map<string, [Accumulator](./firestore_lite.accumulator.md#accumulator_interface)> | | +| groups | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | + +## Aggregate.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.and.md b/docs-devsite/firestore_lite.and.md new file mode 100644 index 00000000000..59b0a32b25d --- /dev/null +++ b/docs-devsite/firestore_lite.and.md @@ -0,0 +1,17 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# and namespace +Signature: + +```typescript +export declare namespace and +``` diff --git a/docs-devsite/firestore_lite.arrayconcat.md b/docs-devsite/firestore_lite.arrayconcat.md new file mode 100644 index 00000000000..2c9bf6bd104 --- /dev/null +++ b/docs-devsite/firestore_lite.arrayconcat.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayConcat class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayConcat extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, elements)](./firestore_lite.arrayconcat.md#arrayconcatconstructor) | | (BETA) Constructs a new instance of the ArrayConcat class | + +## ArrayConcat.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayConcat` class + +Signature: + +```typescript +constructor(array: Constant, elements: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | +| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + diff --git a/docs-devsite/firestore_lite.arraycontains.md b/docs-devsite/firestore_lite.arraycontains.md new file mode 100644 index 00000000000..9875702d3b9 --- /dev/null +++ b/docs-devsite/firestore_lite.arraycontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, element)](./firestore_lite.arraycontains.md#arraycontainsconstructor) | | (BETA) Constructs a new instance of the ArrayContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.arraycontains.md#arraycontainsfilterable) | | true | (BETA) | + +## ArrayContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContains` class + +Signature: + +```typescript +constructor(array: Constant, element: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | +| element | [Constant](./firestore_lite.constant.md#constant_class) | | + +## ArrayContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.arraycontainsall.md b/docs-devsite/firestore_lite.arraycontainsall.md new file mode 100644 index 00000000000..2d830641779 --- /dev/null +++ b/docs-devsite/firestore_lite.arraycontainsall.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContainsAll class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContainsAll extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, values)](./firestore_lite.arraycontainsall.md#arraycontainsallconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAll class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.arraycontainsall.md#arraycontainsallfilterable) | | true | (BETA) | + +## ArrayContainsAll.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContainsAll` class + +Signature: + +```typescript +constructor(array: Constant, values: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + +## ArrayContainsAll.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.arraycontainsany.md b/docs-devsite/firestore_lite.arraycontainsany.md new file mode 100644 index 00000000000..6c87810c719 --- /dev/null +++ b/docs-devsite/firestore_lite.arraycontainsany.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayContainsAny class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayContainsAny extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array, values)](./firestore_lite.arraycontainsany.md#arraycontainsanyconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAny class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.arraycontainsany.md#arraycontainsanyfilterable) | | true | (BETA) | + +## ArrayContainsAny.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayContainsAny` class + +Signature: + +```typescript +constructor(array: Constant, values: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + +## ArrayContainsAny.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.arrayelement.md b/docs-devsite/firestore_lite.arrayelement.md new file mode 100644 index 00000000000..768a623e6d9 --- /dev/null +++ b/docs-devsite/firestore_lite.arrayelement.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayElement class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayElement extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)()](./firestore_lite.arrayelement.md#arrayelementconstructor) | | (BETA) Constructs a new instance of the ArrayElement class | + +## ArrayElement.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayElement` class + +Signature: + +```typescript +constructor(); +``` diff --git a/docs-devsite/firestore_lite.arraylength.md b/docs-devsite/firestore_lite.arraylength.md new file mode 100644 index 00000000000..d755e7b0e23 --- /dev/null +++ b/docs-devsite/firestore_lite.arraylength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array)](./firestore_lite.arraylength.md#arraylengthconstructor) | | (BETA) Constructs a new instance of the ArrayLength class | + +## ArrayLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayLength` class + +Signature: + +```typescript +constructor(array: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.arrayreverse.md b/docs-devsite/firestore_lite.arrayreverse.md new file mode 100644 index 00000000000..0117a8e0971 --- /dev/null +++ b/docs-devsite/firestore_lite.arrayreverse.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArrayReverse class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ArrayReverse extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(array)](./firestore_lite.arrayreverse.md#arrayreverseconstructor) | | (BETA) Constructs a new instance of the ArrayReverse class | + +## ArrayReverse.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ArrayReverse` class + +Signature: + +```typescript +constructor(array: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.avg.md b/docs-devsite/firestore_lite.avg.md new file mode 100644 index 00000000000..de139de6c28 --- /dev/null +++ b/docs-devsite/firestore_lite.avg.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Avg class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Avg extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_lite.avg.md#avgconstructor) | | (BETA) Constructs a new instance of the Avg class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_lite.avg.md#avgaccumulator) | | true | (BETA) | + +## Avg.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Avg` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| distinct | boolean | | + +## Avg.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.bytelength.md b/docs-devsite/firestore_lite.bytelength.md new file mode 100644 index 00000000000..2d8d42dea62 --- /dev/null +++ b/docs-devsite/firestore_lite.bytelength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ByteLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ByteLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_lite.bytelength.md#bytelengthconstructor) | | (BETA) Constructs a new instance of the ByteLength class | + +## ByteLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ByteLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.charlength.md b/docs-devsite/firestore_lite.charlength.md new file mode 100644 index 00000000000..c2889640765 --- /dev/null +++ b/docs-devsite/firestore_lite.charlength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CharLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CharLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_lite.charlength.md#charlengthconstructor) | | (BETA) Constructs a new instance of the CharLength class | + +## CharLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CharLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.collectiongroupsource.md b/docs-devsite/firestore_lite.collectiongroupsource.md new file mode 100644 index 00000000000..0d650e6a9b7 --- /dev/null +++ b/docs-devsite/firestore_lite.collectiongroupsource.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CollectionGroupSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CollectionGroupSource implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(collectionId)](./firestore_lite.collectiongroupsource.md#collectiongroupsourceconstructor) | | (BETA) Constructs a new instance of the CollectionGroupSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.collectiongroupsource.md#collectiongroupsourcename) | | string | (BETA) | + +## CollectionGroupSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CollectionGroupSource` class + +Signature: + +```typescript +constructor(collectionId: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionId | string | | + +## CollectionGroupSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.collectionsource.md b/docs-devsite/firestore_lite.collectionsource.md new file mode 100644 index 00000000000..a0c0a44d768 --- /dev/null +++ b/docs-devsite/firestore_lite.collectionsource.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CollectionSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CollectionSource implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(collectionPath)](./firestore_lite.collectionsource.md#collectionsourceconstructor) | | (BETA) Constructs a new instance of the CollectionSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.collectionsource.md#collectionsourcename) | | string | (BETA) | + +## CollectionSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CollectionSource` class + +Signature: + +```typescript +constructor(collectionPath: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionPath | string | | + +## CollectionSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.constant.md b/docs-devsite/firestore_lite.constant.md new file mode 100644 index 00000000000..8a26c14416c --- /dev/null +++ b/docs-devsite/firestore_lite.constant.md @@ -0,0 +1,3504 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Constant class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents a constant value that can be used in a Firestore pipeline expression. + +You can create a `Constant` instance using the static method: + +```typescript +// Create a Constant instance for the number 10 +const ten = Constant.of(10); + +// Create a Constant instance for the string "hello" +const hello = Constant.of("hello"); + +``` + +Signature: + +```typescript +export declare class Constant +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_lite.constant.md#constantexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_lite.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_lite.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_lite.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_lite.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_lite.constant.md#constantarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_lite.constant.md#constantas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_lite.constant.md#constantascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_lite.constant.md#constantavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_lite.constant.md#constantbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_lite.constant.md#constantcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_lite.constant.md#constantcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_lite.constant.md#constantdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_lite.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_lite.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_lite.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_lite.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_lite.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_lite.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) | +| [exists()](./firestore_lite.constant.md#constantexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_lite.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_lite.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_lite.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_lite.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_lite.constant.md#constantin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_lite.constant.md#constantin) | | (BETA) | +| [isNaN()](./firestore_lite.constant.md#constantisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_lite.constant.md#constantlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_lite.constant.md#constantlike) | | (BETA) | +| [logicalMax(other)](./firestore_lite.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_lite.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_lite.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_lite.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_lite.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_lite.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_lite.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_lite.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_lite.constant.md#constantmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_lite.constant.md#constantmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_lite.constant.md#constantmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_lite.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_lite.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_lite.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_lite.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_lite.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_lite.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a number value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a DocumentReference value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for an array value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a map value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a VectorValue value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a string value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a boolean value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a null value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for an undefined value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a GeoPoint value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Timestamp value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Date value. | +| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Uint8Array value. | +| [regexContains(pattern)](./firestore_lite.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_lite.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_lite.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_lite.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_lite.constant.md#constantreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_lite.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_lite.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_lite.constant.md#constantstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_lite.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_lite.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_lite.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_lite.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_lite.constant.md#constantsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_lite.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_lite.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_lite.constant.md#constanttimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_lite.constant.md#constanttimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_lite.constant.md#constanttimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_lite.constant.md#constanttolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_lite.constant.md#constanttoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_lite.constant.md#constanttrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_lite.constant.md#constantunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_lite.constant.md#constantunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_lite.constant.md#constantunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vector(value)](./firestore_lite.constant.md#constantvector) | static | (BETA) Creates a Constant instance for a VectorValue value. +```typescript +// Create a Constant instance for a vector value +const vectorConstant = Constant.ofVector([1, 2, 3]); + +``` + | +| [vectorLength()](./firestore_lite.constant.md#constantvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Constant.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Constant.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Constant.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Constant.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Constant.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Constant.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Constant.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Constant.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Constant.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Constant.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Constant.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Constant.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## Constant.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> + +## Constant.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Constant.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_lite.avg.md#avg_class) + +## Constant.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +## Constant.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Constant.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Constant.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +## Constant.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Constant.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Constant.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Constant.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Constant.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Constant.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Constant.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Constant.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Constant.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Constant.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +## Constant.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Constant.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Constant.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Constant.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Constant.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Constant.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Constant.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_lite.isnan.md#isnan_class) + +## Constant.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Constant.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Constant.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Constant.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Constant.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Constant.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Constant.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Constant.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Constant.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Constant.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Constant.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_lite.mapget.md#mapget_class) + +## Constant.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_lite.max.md#max_class) + +## Constant.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_lite.min.md#min_class) + +## Constant.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Constant.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Constant.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Constant.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Constant.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Constant.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a number value. + +Signature: + +```typescript +static of(value: number): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | number | The number value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a DocumentReference value. + +Signature: + +```typescript +static of(value: DocumentReference): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for an array value. + +Signature: + +```typescript +static of(value: any[]): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | any\[\] | The array value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a map value. + +Signature: + +```typescript +static of(value: Map): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Map<string, any> | The map value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a VectorValue value. + +Signature: + +```typescript +static of(value: VectorValue): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a string value. + +Signature: + +```typescript +static of(value: string): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | string | The string value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a boolean value. + +Signature: + +```typescript +static of(value: boolean): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | boolean | The boolean value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a null value. + +Signature: + +```typescript +static of(value: null): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | null | The null value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for an undefined value. + +Signature: + +```typescript +static of(value: undefined): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | undefined | The undefined value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a GeoPoint value. + +Signature: + +```typescript +static of(value: GeoPoint): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Timestamp value. + +Signature: + +```typescript +static of(value: Timestamp): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Date value. + +Signature: + +```typescript +static of(value: Date): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Date | The Date value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a Uint8Array value. + +Signature: + +```typescript +static of(value: Uint8Array): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | Uint8Array | The Uint8Array value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Constant.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Constant.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Constant.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Constant.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Constant.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Constant.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Constant.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Constant.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +## Constant.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Constant.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Constant.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## Constant.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Constant.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Constant.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Constant.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Constant.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_lite.sum.md#sum_class) + +## Constant.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Constant.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Constant.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Constant.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Constant.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +## Constant.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +## Constant.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +## Constant.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +## Constant.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +## Constant.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +## Constant.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Constant.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Constant.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Constant.vector() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a `Constant` instance for a VectorValue value. + +```typescript +// Create a Constant instance for a vector value +const vectorConstant = Constant.ofVector([1, 2, 3]); + +``` + +Signature: + +```typescript +static vector(value: number[] | VectorValue): Constant; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | + +Returns: + +[Constant](./firestore_lite.constant.md#constant_class) + +## Constant.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_lite.cosinedistance.md b/docs-devsite/firestore_lite.cosinedistance.md new file mode 100644 index 00000000000..d8642f784ee --- /dev/null +++ b/docs-devsite/firestore_lite.cosinedistance.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CosineDistance class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class CosineDistance extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_lite.cosinedistance.md#cosinedistanceconstructor) | | (BETA) Constructs a new instance of the CosineDistance class | + +## CosineDistance.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `CosineDistance` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.count.md b/docs-devsite/firestore_lite.count.md new file mode 100644 index 00000000000..3de2d0585a7 --- /dev/null +++ b/docs-devsite/firestore_lite.count.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Count class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Count extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_lite.count.md#countconstructor) | | (BETA) Constructs a new instance of the Count class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_lite.count.md#countaccumulator) | | true | (BETA) | + +## Count.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Count` class + +Signature: + +```typescript +constructor(value: Constant | undefined, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) \| undefined | | +| distinct | boolean | | + +## Count.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.databasesource.md b/docs-devsite/firestore_lite.databasesource.md new file mode 100644 index 00000000000..c837f93ba36 --- /dev/null +++ b/docs-devsite/firestore_lite.databasesource.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DatabaseSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DatabaseSource implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.databasesource.md#databasesourcename) | | string | (BETA) | + +## DatabaseSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.distinct.md b/docs-devsite/firestore_lite.distinct.md new file mode 100644 index 00000000000..37d2385de22 --- /dev/null +++ b/docs-devsite/firestore_lite.distinct.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Distinct class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Distinct implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(groups)](./firestore_lite.distinct.md#distinctconstructor) | | (BETA) Constructs a new instance of the Distinct class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.distinct.md#distinctname) | | string | (BETA) | + +## Distinct.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Distinct` class + +Signature: + +```typescript +constructor(groups: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| groups | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | + +## Distinct.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.divide.md b/docs-devsite/firestore_lite.divide.md new file mode 100644 index 00000000000..ae2ed8410a4 --- /dev/null +++ b/docs-devsite/firestore_lite.divide.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Divide class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Divide extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.divide.md#divideconstructor) | | (BETA) Constructs a new instance of the Divide class | + +## Divide.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Divide` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.documentssource.md b/docs-devsite/firestore_lite.documentssource.md new file mode 100644 index 00000000000..5444a06ee6a --- /dev/null +++ b/docs-devsite/firestore_lite.documentssource.md @@ -0,0 +1,92 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DocumentsSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DocumentsSource implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(docPaths)](./firestore_lite.documentssource.md#documentssourceconstructor) | | (BETA) Constructs a new instance of the DocumentsSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.documentssource.md#documentssourcename) | | string | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [of(refs)](./firestore_lite.documentssource.md#documentssourceof) | static | (BETA) | + +## DocumentsSource.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `DocumentsSource` class + +Signature: + +```typescript +constructor(docPaths: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| docPaths | string\[\] | | + +## DocumentsSource.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` + +## DocumentsSource.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(refs: DocumentReference[]): DocumentsSource; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| refs | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)\[\] | | + +Returns: + +[DocumentsSource](./firestore_lite.documentssource.md#documentssource_class) + diff --git a/docs-devsite/firestore_lite.dotproduct.md b/docs-devsite/firestore_lite.dotproduct.md new file mode 100644 index 00000000000..ad91f78f92d --- /dev/null +++ b/docs-devsite/firestore_lite.dotproduct.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DotProduct class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class DotProduct extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_lite.dotproduct.md#dotproductconstructor) | | (BETA) Constructs a new instance of the DotProduct class | + +## DotProduct.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `DotProduct` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.endswith.md b/docs-devsite/firestore_lite.endswith.md new file mode 100644 index 00000000000..d34c4f3dc83 --- /dev/null +++ b/docs-devsite/firestore_lite.endswith.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# EndsWith class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class EndsWith extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, suffix)](./firestore_lite.endswith.md#endswithconstructor) | | (BETA) Constructs a new instance of the EndsWith class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.endswith.md#endswithfilterable) | | true | (BETA) | + +## EndsWith.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `EndsWith` class + +Signature: + +```typescript +constructor(expr: Constant, suffix: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | | + +## EndsWith.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.eq.md b/docs-devsite/firestore_lite.eq.md new file mode 100644 index 00000000000..02fa728f481 --- /dev/null +++ b/docs-devsite/firestore_lite.eq.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Eq class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Eq extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.eq.md#eqconstructor) | | (BETA) Constructs a new instance of the Eq class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.eq.md#eqfilterable) | | true | (BETA) | + +## Eq.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Eq` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Eq.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.euclideandistance.md b/docs-devsite/firestore_lite.euclideandistance.md new file mode 100644 index 00000000000..860057fc9d7 --- /dev/null +++ b/docs-devsite/firestore_lite.euclideandistance.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# EuclideanDistance class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class EuclideanDistance extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vector1, vector2)](./firestore_lite.euclideandistance.md#euclideandistanceconstructor) | | (BETA) Constructs a new instance of the EuclideanDistance class | + +## EuclideanDistance.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `EuclideanDistance` class + +Signature: + +```typescript +constructor(vector1: Constant, vector2: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | +| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.exists.md b/docs-devsite/firestore_lite.exists.md new file mode 100644 index 00000000000..50ef86f9fec --- /dev/null +++ b/docs-devsite/firestore_lite.exists.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Exists class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Exists extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.exists.md#existsconstructor) | | (BETA) Constructs a new instance of the Exists class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.exists.md#existsfilterable) | | true | (BETA) | + +## Exists.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Exists` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Exists.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.exprwithalias.md b/docs-devsite/firestore_lite.exprwithalias.md new file mode 100644 index 00000000000..a7c47c19b4f --- /dev/null +++ b/docs-devsite/firestore_lite.exprwithalias.md @@ -0,0 +1,3207 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ExprWithAlias class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ExprWithAlias implements Selectable +``` +Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, alias)](./firestore_lite.exprwithalias.md#exprwithaliasconstructor) | | (BETA) Constructs a new instance of the ExprWithAlias class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [alias](./firestore_lite.exprwithalias.md#exprwithaliasalias) | | string | (BETA) | +| [expr](./firestore_lite.exprwithalias.md#exprwithaliasexpr) | | T | (BETA) | +| [exprType](./firestore_lite.exprwithalias.md#exprwithaliasexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | +| [selectable](./firestore_lite.exprwithalias.md#exprwithaliasselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_lite.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_lite.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_lite.exprwithalias.md#exprwithaliasarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_lite.exprwithalias.md#exprwithaliasas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_lite.exprwithalias.md#exprwithaliasascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_lite.exprwithalias.md#exprwithaliasavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_lite.exprwithalias.md#exprwithaliasbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_lite.exprwithalias.md#exprwithaliascharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_lite.exprwithalias.md#exprwithaliascount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_lite.exprwithalias.md#exprwithaliasdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_lite.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_lite.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_lite.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_lite.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_lite.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_lite.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) | +| [exists()](./firestore_lite.exprwithalias.md#exprwithaliasexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_lite.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_lite.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_lite.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_lite.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_lite.exprwithalias.md#exprwithaliasin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_lite.exprwithalias.md#exprwithaliasin) | | (BETA) | +| [isNaN()](./firestore_lite.exprwithalias.md#exprwithaliasisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_lite.exprwithalias.md#exprwithaliaslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_lite.exprwithalias.md#exprwithaliaslike) | | (BETA) | +| [logicalMax(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_lite.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_lite.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_lite.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_lite.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_lite.exprwithalias.md#exprwithaliasmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_lite.exprwithalias.md#exprwithaliasmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_lite.exprwithalias.md#exprwithaliasmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_lite.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_lite.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_lite.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_lite.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_lite.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_lite.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [regexContains(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_lite.exprwithalias.md#exprwithaliasreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_lite.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_lite.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_lite.exprwithalias.md#exprwithaliasstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_lite.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_lite.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_lite.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_lite.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_lite.exprwithalias.md#exprwithaliassum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_lite.exprwithalias.md#exprwithaliastolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_lite.exprwithalias.md#exprwithaliastoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_lite.exprwithalias.md#exprwithaliastrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_lite.exprwithalias.md#exprwithaliasvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## ExprWithAlias.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ExprWithAlias` class + +Signature: + +```typescript +constructor(expr: T, alias: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | T | | +| alias | string | | + +## ExprWithAlias.alias + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +alias: string; +``` + +## ExprWithAlias.expr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +expr: T; +``` + +## ExprWithAlias.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## ExprWithAlias.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## ExprWithAlias.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## ExprWithAlias.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## ExprWithAlias.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## ExprWithAlias.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## ExprWithAlias.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## ExprWithAlias.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## ExprWithAlias.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## ExprWithAlias.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## ExprWithAlias.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## ExprWithAlias.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## ExprWithAlias.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## ExprWithAlias.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> + +## ExprWithAlias.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## ExprWithAlias.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_lite.avg.md#avg_class) + +## ExprWithAlias.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +## ExprWithAlias.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## ExprWithAlias.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +## ExprWithAlias.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## ExprWithAlias.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## ExprWithAlias.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## ExprWithAlias.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## ExprWithAlias.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## ExprWithAlias.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## ExprWithAlias.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## ExprWithAlias.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## ExprWithAlias.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +## ExprWithAlias.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## ExprWithAlias.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## ExprWithAlias.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## ExprWithAlias.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## ExprWithAlias.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## ExprWithAlias.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## ExprWithAlias.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_lite.isnan.md#isnan_class) + +## ExprWithAlias.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## ExprWithAlias.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## ExprWithAlias.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## ExprWithAlias.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## ExprWithAlias.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## ExprWithAlias.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## ExprWithAlias.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## ExprWithAlias.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## ExprWithAlias.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## ExprWithAlias.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## ExprWithAlias.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_lite.mapget.md#mapget_class) + +## ExprWithAlias.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_lite.max.md#max_class) + +## ExprWithAlias.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_lite.min.md#min_class) + +## ExprWithAlias.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## ExprWithAlias.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## ExprWithAlias.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## ExprWithAlias.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## ExprWithAlias.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## ExprWithAlias.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## ExprWithAlias.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## ExprWithAlias.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## ExprWithAlias.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## ExprWithAlias.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## ExprWithAlias.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## ExprWithAlias.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## ExprWithAlias.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## ExprWithAlias.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## ExprWithAlias.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +## ExprWithAlias.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## ExprWithAlias.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## ExprWithAlias.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## ExprWithAlias.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## ExprWithAlias.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## ExprWithAlias.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## ExprWithAlias.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## ExprWithAlias.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_lite.sum.md#sum_class) + +## ExprWithAlias.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## ExprWithAlias.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## ExprWithAlias.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## ExprWithAlias.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## ExprWithAlias.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +## ExprWithAlias.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +## ExprWithAlias.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +## ExprWithAlias.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +## ExprWithAlias.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +## ExprWithAlias.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +## ExprWithAlias.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## ExprWithAlias.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## ExprWithAlias.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## ExprWithAlias.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_lite.field.md b/docs-devsite/firestore_lite.field.md new file mode 100644 index 00000000000..0619a19d6bb --- /dev/null +++ b/docs-devsite/firestore_lite.field.md @@ -0,0 +1,3275 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Field class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage. + +

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. + +

You can create a `Field` instance using the static method: + +```typescript +// Create a Field instance for the 'name' field +const nameField = Field.of("name"); + +// Create a Field instance for a nested field 'address.city' +const cityField = Field.of("address.city"); + +``` + +Signature: + +```typescript +export declare class Field implements Selectable +``` +Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_lite.field.md#fieldexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | +| [selectable](./firestore_lite.field.md#fieldselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_lite.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_lite.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_lite.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_lite.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_lite.field.md#fieldarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_lite.field.md#fieldas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_lite.field.md#fieldascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_lite.field.md#fieldavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_lite.field.md#fieldbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_lite.field.md#fieldcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_lite.field.md#fieldcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_lite.field.md#fielddescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_lite.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_lite.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_lite.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_lite.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_lite.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_lite.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) | +| [exists()](./firestore_lite.field.md#fieldexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [fieldName()](./firestore_lite.field.md#fieldfieldname) | | (BETA) | +| [gt(other)](./firestore_lite.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_lite.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_lite.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_lite.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_lite.field.md#fieldin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_lite.field.md#fieldin) | | (BETA) | +| [isNaN()](./firestore_lite.field.md#fieldisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_lite.field.md#fieldlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_lite.field.md#fieldlike) | | (BETA) | +| [logicalMax(other)](./firestore_lite.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_lite.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_lite.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_lite.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_lite.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_lite.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_lite.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_lite.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_lite.field.md#fieldmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_lite.field.md#fieldmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_lite.field.md#fieldmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_lite.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_lite.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_lite.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_lite.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_lite.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_lite.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(name)](./firestore_lite.field.md#fieldof) | static | (BETA) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). +```typescript +// Create a Field instance for the 'title' field +const titleField = Field.of("title"); + +// Create a Field instance for a nested field 'author.firstName' +const authorFirstNameField = Field.of("author.firstName"); + +``` + | +| [of(path)](./firestore_lite.field.md#fieldof) | static | (BETA) | +| [of(pipeline, name)](./firestore_lite.field.md#fieldof) | static | (BETA) | +| [regexContains(pattern)](./firestore_lite.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_lite.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_lite.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_lite.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_lite.field.md#fieldreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_lite.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_lite.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_lite.field.md#fieldstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_lite.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_lite.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_lite.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_lite.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_lite.field.md#fieldsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_lite.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_lite.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_lite.field.md#fieldtimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_lite.field.md#fieldtimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_lite.field.md#fieldtimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_lite.field.md#fieldtolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_lite.field.md#fieldtoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_lite.field.md#fieldtrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_lite.field.md#fieldunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_lite.field.md#fieldunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_lite.field.md#fieldunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_lite.field.md#fieldvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Field.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Field.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## Field.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Field.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Field.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Field.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Field.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Field.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Field.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Field.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Field.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Field.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Field.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## Field.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> + +## Field.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Field.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_lite.avg.md#avg_class) + +## Field.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +## Field.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Field.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Field.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +## Field.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Field.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Field.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Field.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Field.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Field.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Field.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Field.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Field.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Field.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +## Field.fieldName() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +fieldName(): string; +``` +Returns: + +string + +## Field.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Field.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Field.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Field.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Field.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Field.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Field.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_lite.isnan.md#isnan_class) + +## Field.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Field.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Field.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Field.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Field.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Field.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Field.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Field.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Field.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Field.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Field.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_lite.mapget.md#mapget_class) + +## Field.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_lite.max.md#max_class) + +## Field.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_lite.min.md#min_class) + +## Field.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Field.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Field.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Field.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Field.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Field.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a instance representing the field at the given path. + +The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). + +```typescript +// Create a Field instance for the 'title' field +const titleField = Field.of("title"); + +// Create a Field instance for a nested field 'author.firstName' +const authorFirstNameField = Field.of("author.firstName"); + +``` + +Signature: + +```typescript +static of(name: string): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The path to the field. A new instance representing the specified field. | + +Returns: + +[Field](./firestore_lite.field.md#field_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(path: FieldPath): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| path | [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | | + +Returns: + +[Field](./firestore_lite.field.md#field_class) + +## Field.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(pipeline: Pipeline, name: string): Field; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pipeline | [Pipeline](./firestore_lite.pipeline.md#pipeline_class) | | +| name | string | | + +Returns: + +[Field](./firestore_lite.field.md#field_class) + +## Field.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Field.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Field.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Field.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Field.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Field.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Field.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Field.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Field.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +## Field.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Field.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Field.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## Field.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Field.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Field.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Field.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Field.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_lite.sum.md#sum_class) + +## Field.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Field.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Field.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Field.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Field.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +## Field.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +## Field.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +## Field.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +## Field.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +## Field.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +## Field.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Field.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Field.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Field.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_lite.fields.md b/docs-devsite/firestore_lite.fields.md new file mode 100644 index 00000000000..469b9b6b651 --- /dev/null +++ b/docs-devsite/firestore_lite.fields.md @@ -0,0 +1,3210 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Fields class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Fields implements Selectable +``` +Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_lite.fields.md#fieldsexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | +| [selectable](./firestore_lite.fields.md#fieldsselectable) | | true | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_lite.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_lite.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_lite.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_lite.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_lite.fields.md#fieldsarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_lite.fields.md#fieldsas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_lite.fields.md#fieldsascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_lite.fields.md#fieldsavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_lite.fields.md#fieldsbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_lite.fields.md#fieldscharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_lite.fields.md#fieldscount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_lite.fields.md#fieldsdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_lite.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_lite.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_lite.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_lite.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_lite.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_lite.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) | +| [exists()](./firestore_lite.fields.md#fieldsexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [fieldList()](./firestore_lite.fields.md#fieldsfieldlist) | | (BETA) | +| [gt(other)](./firestore_lite.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_lite.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_lite.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_lite.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_lite.fields.md#fieldsin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_lite.fields.md#fieldsin) | | (BETA) | +| [isNaN()](./firestore_lite.fields.md#fieldsisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_lite.fields.md#fieldslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_lite.fields.md#fieldslike) | | (BETA) | +| [logicalMax(other)](./firestore_lite.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_lite.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_lite.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_lite.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_lite.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_lite.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_lite.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_lite.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_lite.fields.md#fieldsmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_lite.fields.md#fieldsmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_lite.fields.md#fieldsmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_lite.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_lite.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_lite.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_lite.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_lite.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_lite.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [of(name, others)](./firestore_lite.fields.md#fieldsof) | static | (BETA) | +| [ofAll()](./firestore_lite.fields.md#fieldsofall) | static | (BETA) | +| [regexContains(pattern)](./firestore_lite.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_lite.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_lite.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_lite.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_lite.fields.md#fieldsreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_lite.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_lite.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_lite.fields.md#fieldsstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_lite.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_lite.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_lite.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_lite.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_lite.fields.md#fieldssum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_lite.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_lite.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_lite.fields.md#fieldstimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_lite.fields.md#fieldstimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_lite.fields.md#fieldstimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_lite.fields.md#fieldstolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_lite.fields.md#fieldstoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_lite.fields.md#fieldstrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_lite.fields.md#fieldsunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_lite.fields.md#fieldsunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_lite.fields.md#fieldsunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_lite.fields.md#fieldsvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## Fields.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## Fields.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` + +## Fields.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Fields.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## Fields.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Fields.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## Fields.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Fields.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## Fields.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Fields.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## Fields.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Fields.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## Fields.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## Fields.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> + +## Fields.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Fields.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_lite.avg.md#avg_class) + +## Fields.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +## Fields.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Fields.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## Fields.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +## Fields.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## Fields.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Fields.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Fields.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## Fields.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Fields.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## Fields.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Fields.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Fields.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## Fields.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +## Fields.fieldList() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +fieldList(): Field[]; +``` +Returns: + +[Field](./firestore_lite.field.md#field_class)\[\] + +## Fields.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Fields.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## Fields.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Fields.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## Fields.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Fields.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## Fields.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_lite.isnan.md#isnan_class) + +## Fields.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Fields.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## Fields.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Fields.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## Fields.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Fields.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## Fields.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Fields.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## Fields.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Fields.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## Fields.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_lite.mapget.md#mapget_class) + +## Fields.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_lite.max.md#max_class) + +## Fields.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_lite.min.md#min_class) + +## Fields.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Fields.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## Fields.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Fields.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## Fields.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Fields.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## Fields.of() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static of(name: string, ...others: string[]): Fields; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| others | string\[\] | | + +Returns: + +[Fields](./firestore_lite.fields.md#fields_class) + +## Fields.ofAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +static ofAll(): Fields; +``` +Returns: + +[Fields](./firestore_lite.fields.md#fields_class) + +## Fields.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Fields.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## Fields.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Fields.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## Fields.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Fields.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## Fields.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Fields.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## Fields.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +## Fields.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Fields.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## Fields.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## Fields.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Fields.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## Fields.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Fields.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## Fields.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_lite.sum.md#sum_class) + +## Fields.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Fields.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## Fields.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Fields.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## Fields.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +## Fields.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +## Fields.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +## Fields.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +## Fields.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +## Fields.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +## Fields.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## Fields.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## Fields.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## Fields.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_lite.filtercondition.md b/docs-devsite/firestore_lite.filtercondition.md new file mode 100644 index 00000000000..3f638859319 --- /dev/null +++ b/docs-devsite/firestore_lite.filtercondition.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FilterCondition interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents a filter condition. + +Signature: + +```typescript +export declare interface FilterCondition +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [filterable](./firestore_lite.filtercondition.md#filterconditionfilterable) | true | (BETA) | + +## FilterCondition.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.findnearest.md b/docs-devsite/firestore_lite.findnearest.md new file mode 100644 index 00000000000..a0fe60cb31e --- /dev/null +++ b/docs-devsite/firestore_lite.findnearest.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FindNearest class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class FindNearest implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.findnearest.md#findnearestname) | | string | (BETA) | + +## FindNearest.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.findnearestoptions.md b/docs-devsite/firestore_lite.findnearestoptions.md new file mode 100644 index 00000000000..fe142b4a8d4 --- /dev/null +++ b/docs-devsite/firestore_lite.findnearestoptions.md @@ -0,0 +1,86 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FindNearestOptions interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare interface FindNearestOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [distanceField](./firestore_lite.findnearestoptions.md#findnearestoptionsdistancefield) | string | (BETA) | +| [distanceMeasure](./firestore_lite.findnearestoptions.md#findnearestoptionsdistancemeasure) | 'euclidean' \| 'cosine' \| 'dot\_product' | (BETA) | +| [field](./firestore_lite.findnearestoptions.md#findnearestoptionsfield) | [Field](./firestore_lite.field.md#field_class) | (BETA) | +| [limit](./firestore_lite.findnearestoptions.md#findnearestoptionslimit) | number | (BETA) | +| [vectorValue](./firestore_lite.findnearestoptions.md#findnearestoptionsvectorvalue) | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | (BETA) | + +## FindNearestOptions.distanceField + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +distanceField?: string; +``` + +## FindNearestOptions.distanceMeasure + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; +``` + +## FindNearestOptions.field + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +field: Field; +``` + +## FindNearestOptions.limit + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +limit?: number; +``` + +## FindNearestOptions.vectorValue + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +vectorValue: VectorValue | number[]; +``` diff --git a/docs-devsite/firestore_lite.firestore.md b/docs-devsite/firestore_lite.firestore.md index 2edac7aa130..cfbb412ed25 100644 --- a/docs-devsite/firestore_lite.firestore.md +++ b/docs-devsite/firestore_lite.firestore.md @@ -31,6 +31,7 @@ export declare class Firestore | Method | Modifiers | Description | | --- | --- | --- | +| [pipeline()](./firestore_lite.firestore.md#firestorepipeline) | | Pipeline query. | | [toJSON()](./firestore_lite.firestore.md#firestoretojson) | | Returns a JSON-serializable representation of this Firestore instance. | ## Firestore.app @@ -53,6 +54,19 @@ Whether it's a Firestore or Firestore Lite instance. type: 'firestore-lite' | 'firestore'; ``` +## Firestore.pipeline() + +Pipeline query. + +Signature: + +```typescript +pipeline(): PipelineSource; +``` +Returns: + +[PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) + ## Firestore.toJSON() Returns a JSON-serializable representation of this `Firestore` instance. diff --git a/docs-devsite/firestore_lite.firestorefunction.md b/docs-devsite/firestore_lite.firestorefunction.md new file mode 100644 index 00000000000..04bf9e874f8 --- /dev/null +++ b/docs-devsite/firestore_lite.firestorefunction.md @@ -0,0 +1,3173 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FirestoreFunction class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution. + +Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. + +Signature: + +```typescript +export declare class FirestoreFunction +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(name, params)](./firestore_lite.firestorefunction.md#firestorefunctionconstructor) | | (BETA) Constructs a new instance of the FirestoreFunction class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [exprType](./firestore_lite.firestorefunction.md#firestorefunctionexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(other)](./firestore_lite.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to another expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + | +| [add(other)](./firestore_lite.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + | +| [arrayConcat(arrays)](./firestore_lite.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + | +| [arrayContains(element)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + | +| [arrayContains(element)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAll(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + | +| [arrayContainsAny(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + | +| [arrayLength()](./firestore_lite.firestorefunction.md#firestorefunctionarraylength) | | (BETA) Creates an expression that calculates the length of an array. +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new Expr representing the length of the array. | +| [as(name)](./firestore_lite.firestorefunction.md#firestorefunctionas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + | +| [ascending()](./firestore_lite.firestorefunction.md#firestorefunctionascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new Ordering for ascending sorting. | +| [avg()](./firestore_lite.firestorefunction.md#firestorefunctionavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new Accumulator representing the 'avg' aggregation. | +| [byteLength()](./firestore_lite.firestorefunction.md#firestorefunctionbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. | +| [charLength()](./firestore_lite.firestorefunction.md#firestorefunctioncharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new Expr representing the length of the string. | +| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the cosine distance between two vectors. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + | +| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + | +| [count()](./firestore_lite.firestorefunction.md#firestorefunctioncount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new Accumulator representing the 'count' aggregation. | +| [descending()](./firestore_lite.firestorefunction.md#firestorefunctiondescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new Ordering for descending sorting. | +| [divide(other)](./firestore_lite.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by another expression. +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + | +| [divide(other)](./firestore_lite.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by a constant value. +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + | +| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) | +| [endsWith(suffix)](./firestore_lite.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + | +| [endsWith(suffix)](./firestore_lite.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + | +| [eq(other)](./firestore_lite.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + | +| [eq(other)](./firestore_lite.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + | +| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + | +| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) | +| [exists()](./firestore_lite.firestorefunction.md#firestorefunctionexists) | | (BETA) Creates an expression that checks if a field exists in the document. +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new Expr representing the 'exists' check. | +| [gt(other)](./firestore_lite.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + | +| [gt(other)](./firestore_lite.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + | +| [gte(other)](./firestore_lite.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + | +| [gte(other)](./firestore_lite.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + | +| [in(others)](./firestore_lite.firestorefunction.md#firestorefunctionin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + | +| [in(others)](./firestore_lite.firestorefunction.md#firestorefunctionin) | | (BETA) | +| [isNaN()](./firestore_lite.firestorefunction.md#firestorefunctionisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new Expr representing the 'isNaN' check. | +| [like(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + | +| [like(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionlike) | | (BETA) | +| [logicalMax(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + | +| [logicalMax(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + | +| [logicalMin(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + | +| [logicalMin(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + | +| [lt(other)](./firestore_lite.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + | +| [lt(other)](./firestore_lite.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + | +| [lte(other)](./firestore_lite.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + | +| [lte(other)](./firestore_lite.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + | +| [mapGet(subfield)](./firestore_lite.firestorefunction.md#firestorefunctionmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + | +| [max()](./firestore_lite.firestorefunction.md#firestorefunctionmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new Accumulator representing the 'max' aggregation. | +| [min()](./firestore_lite.firestorefunction.md#firestorefunctionmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new Accumulator representing the 'min' aggregation. | +| [mod(other)](./firestore_lite.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + | +| [mod(other)](./firestore_lite.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + | +| [multiply(other)](./firestore_lite.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + | +| [multiply(other)](./firestore_lite.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + | +| [neq(other)](./firestore_lite.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + | +| [neq(other)](./firestore_lite.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + | +| [regexContains(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + | +| [regexContains(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + | +| [regexMatch(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + | +| [replaceAll(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + | +| [replaceFirst(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + | +| [reverse()](./firestore_lite.firestorefunction.md#firestorefunctionreverse) | | (BETA) Creates an expression that reverses this string expression. +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. | +| [startsWith(prefix)](./firestore_lite.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + | +| [startsWith(prefix)](./firestore_lite.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + | +| [strConcat(elements)](./firestore_lite.firestorefunction.md#firestorefunctionstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + | +| [strContains(substring)](./firestore_lite.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + | +| [strContains(expr)](./firestore_lite.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + | +| [subtract(other)](./firestore_lite.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + | +| [subtract(other)](./firestore_lite.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + | +| [sum()](./firestore_lite.firestorefunction.md#firestorefunctionsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new Accumulator representing the 'sum' aggregation. | +| [timestampAdd(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + | +| [timestampToUnixMicros()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. | +| [timestampToUnixMillis()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. | +| [timestampToUnixSeconds()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. | +| [toLower()](./firestore_lite.firestorefunction.md#firestorefunctiontolower) | | (BETA) Creates an expression that converts a string to lowercase. +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new Expr representing the lowercase string. | +| [toUpper()](./firestore_lite.firestorefunction.md#firestorefunctiontoupper) | | (BETA) Creates an expression that converts a string to uppercase. +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new Expr representing the uppercase string. | +| [trim()](./firestore_lite.firestorefunction.md#firestorefunctiontrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new Expr representing the trimmed string. | +| [unixMicrosToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. | +| [unixMillisToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. | +| [unixSecondsToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. | +| [vectorLength()](./firestore_lite.firestorefunction.md#firestorefunctionvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. | + +## FirestoreFunction.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `FirestoreFunction` class + +Signature: + +```typescript +constructor(name: string, params: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| params | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + +## FirestoreFunction.exprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +exprType: ExprType; +``` + +## FirestoreFunction.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to another expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +Field.of("quantity").add(Field.of("reserve")); + +``` + +Signature: + +```typescript +add(other: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## FirestoreFunction.add() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds this expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +Field.of("age").add(5); + +``` + +Signature: + +```typescript +add(other: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to add. A new Expr representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +## FirestoreFunction.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'items' array with another array field. +Field.of("items").arrayConcat(Field.of("otherItems")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## FirestoreFunction.arrayConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with one or more other arrays. + +```typescript +// Combine the 'tags' array with a new array and an array field +Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); + +``` + +Signature: + +```typescript +arrayConcat(arrays: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +## FirestoreFunction.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific element. + +```typescript +// Check if the 'sizes' array contains the value from the 'selectedSize' field +Field.of("sizes").arrayContains(Field.of("selectedSize")); + +``` + +Signature: + +```typescript +arrayContains(element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## FirestoreFunction.arrayContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +Field.of("colors").arrayContains("red"); + +``` + +Signature: + +```typescript +arrayContains(element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +## FirestoreFunction.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both "news" and "sports" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## FirestoreFunction.arrayContainsAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + +``` + +Signature: + +```typescript +arrayContainsAll(...values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +## FirestoreFunction.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "cate2" +Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## FirestoreFunction.arrayContainsAny() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + +``` + +Signature: + +```typescript +arrayContainsAny(...values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +## FirestoreFunction.arrayLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array. + +```typescript +// Get the number of items in the 'cart' array +Field.of("cart").arrayLength(); + +``` + A new `Expr` representing the length of the array. + +Signature: + +```typescript +arrayLength(): ArrayLength; +``` +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## FirestoreFunction.as() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Assigns an alias to this expression. + +Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. + +```typescript +// Calculate the total price and assign it the alias "totalPrice" and add it to the output. +firestore.pipeline().collection("items") +.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + +``` + +Signature: + +```typescript +as(name: string): ExprWithAlias; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | + +Returns: + +[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> + +## FirestoreFunction.ascending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +pipeline().collection("users") +.sort(Field.of("name").ascending()); + +``` + A new `Ordering` for ascending sorting. + +Signature: + +```typescript +ascending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## FirestoreFunction.avg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. + +```typescript +// Calculate the average age of users +Field.of("age").avg().as("averageAge"); + +``` + A new `Accumulator` representing the 'avg' aggregation. + +Signature: + +```typescript +avg(): Avg; +``` +Returns: + +[Avg](./firestore_lite.avg.md#avg_class) + +## FirestoreFunction.byteLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of this string expression in bytes. + +```typescript +// Calculate the length of the 'myString' field in bytes. +Field.of("myString").byteLength(); + +``` + A new representing the length of the string in bytes. + +Signature: + +```typescript +byteLength(): ByteLength; +``` +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +## FirestoreFunction.charLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string in UTF-8. + +```typescript +// Get the character length of the 'name' field in its UTF-8 form. +Field.of("name").charLength(); + +``` + A new `Expr` representing the length of the string. + +Signature: + +```typescript +charLength(): CharLength; +``` +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the cosine distance between two vectors. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +Field.of("userVector").cosineDistance(Field.of("itemVector")); + +``` + +Signature: + +```typescript +cosineDistance(other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +cosineDistance(other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.cosineDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vectors. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +Field.of("location").cosineDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +cosineDistance(other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +## FirestoreFunction.count() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. + +```typescript +// Count the total number of products +Field.of("productId").count().as("totalProducts"); + +``` + A new `Accumulator` representing the 'count' aggregation. + +Signature: + +```typescript +count(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +## FirestoreFunction.descending() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") +.sort(Field.of("createdAt").descending()); + +``` + A new `Ordering` for descending sorting. + +Signature: + +```typescript +descending(): Ordering; +``` +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +## FirestoreFunction.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by another expression. + +```typescript +// Divide the 'total' field by the 'count' field +Field.of("total").divide(Field.of("count")); + +``` + +Signature: + +```typescript +divide(other: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## FirestoreFunction.divide() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides this expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +Field.of("value").divide(10); + +``` + +Signature: + +```typescript +divide(other: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct([0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +dotProduct(other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vectors. + +```typescript +// Calculate the dot product between a feature vector and a target vector +Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +dotProduct(other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## FirestoreFunction.dotProduct() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +dotProduct(other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +## FirestoreFunction.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +Field.of("filename").endsWith(".txt"); + +``` + +Signature: + +```typescript +endsWith(suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## FirestoreFunction.endsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string ends with a given postfix (represented as an expression). + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +Field.of("url").endsWith(Field.of("extension")); + +``` + +Signature: + +```typescript +endsWith(suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +## FirestoreFunction.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to another expression. + +```typescript +// Check if the 'age' field is equal to 21 +Field.of("age").eq(21); + +``` + +Signature: + +```typescript +eq(other: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## FirestoreFunction.eq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to "London" +Field.of("city").eq("London"); + +``` + +Signature: + +```typescript +eq(other: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance([37.7749, -122.4194]); + +``` + +Signature: + +```typescript +euclideanDistance(other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vectors. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +euclideanDistance(other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.euclideanDistance() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +euclideanDistance(other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | number\[\] | | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +## FirestoreFunction.exists() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists in the document. + +```typescript +// Check if the document has a field named "phoneNumber" +Field.of("phoneNumber").exists(); + +``` + A new `Expr` representing the 'exists' check. + +Signature: + +```typescript +exists(): Exists; +``` +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +## FirestoreFunction.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than another expression. + +```typescript +// Check if the 'age' field is greater than the 'limit' field +Field.of("age").gt(Field.of("limit")); + +``` + +Signature: + +```typescript +gt(other: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## FirestoreFunction.gt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +Field.of("price").gt(100); + +``` + +Signature: + +```typescript +gt(other: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +## FirestoreFunction.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to another expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 +Field.of("quantity").gte(Field.of('requirement').add(1)); + +``` + +Signature: + +```typescript +gte(other: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## FirestoreFunction.gte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +Field.of("score").gte(80); + +``` + +Signature: + +```typescript +gte(other: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +## FirestoreFunction.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +Field.of("category").in("Electronics", Field.of("primaryType")); + +``` + +Signature: + +```typescript +in(...others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## FirestoreFunction.in() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +in(...others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| others | any\[\] | | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +## FirestoreFunction.isNaN() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +Field.of("value").divide(0).isNaN(); + +``` + A new `Expr` representing the 'isNaN' check. + +Signature: + +```typescript +isNaN(): IsNan; +``` +Returns: + +[IsNan](./firestore_lite.isnan.md#isnan_class) + +## FirestoreFunction.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive string comparison. + +```typescript +// Check if the 'title' field contains the word "guide" (case-sensitive) +Field.of("title").like("%guide%"); + +``` + +Signature: + +```typescript +like(pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## FirestoreFunction.like() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +like(pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +## FirestoreFunction.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMax(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMax(other: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## FirestoreFunction.logicalMax() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +Field.of("value").logicalMax(10); + +``` + +Signature: + +```typescript +logicalMax(other: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +## FirestoreFunction.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'timestamp' field and the current timestamp. +Field.of("timestamp").logicalMin(Function.currentTimestamp()); + +``` + +Signature: + +```typescript +logicalMin(other: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## FirestoreFunction.logicalMin() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +Field.of("value").logicalMin(10); + +``` + +Signature: + +```typescript +logicalMin(other: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare with. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +## FirestoreFunction.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than another expression. + +```typescript +// Check if the 'age' field is less than 'limit' +Field.of("age").lt(Field.of('limit')); + +``` + +Signature: + +```typescript +lt(other: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## FirestoreFunction.lt() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +Field.of("price").lt(50); + +``` + +Signature: + +```typescript +lt(other: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +## FirestoreFunction.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to another expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +Field.of("quantity").lte(Constant.of(20)); + +``` + +Signature: + +```typescript +lte(other: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## FirestoreFunction.lte() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +Field.of("score").lte(70); + +``` + +Signature: + +```typescript +lte(other: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +## FirestoreFunction.mapGet() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +Field.of("address").mapGet("city"); + +``` + +Signature: + +```typescript +mapGet(subfield: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | + +Returns: + +[MapGet](./firestore_lite.mapget.md#mapget_class) + +## FirestoreFunction.max() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. + +```typescript +// Find the highest score in a leaderboard +Field.of("score").max().as("highestScore"); + +``` + A new `Accumulator` representing the 'max' aggregation. + +Signature: + +```typescript +max(): Max; +``` +Returns: + +[Max](./firestore_lite.max.md#max_class) + +## FirestoreFunction.min() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. + +```typescript +// Find the lowest price of all products +Field.of("price").min().as("lowestPrice"); + +``` + A new `Accumulator` representing the 'min' aggregation. + +Signature: + +```typescript +min(): Min; +``` +Returns: + +[Min](./firestore_lite.min.md#min_class) + +## FirestoreFunction.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. + +```typescript +// Calculate the remainder of dividing the 'value' field by the 'divisor' field +Field.of("value").mod(Field.of("divisor")); + +``` + +Signature: + +```typescript +mod(other: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## FirestoreFunction.mod() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. + +```typescript +// Calculate the remainder of dividing the 'value' field by 10 +Field.of("value").mod(10); + +``` + +Signature: + +```typescript +mod(other: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to divide by. A new Expr representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +## FirestoreFunction.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by another expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +Field.of("quantity").multiply(Field.of("price")); + +``` + +Signature: + +```typescript +multiply(other: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## FirestoreFunction.multiply() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies this expression by a constant value. + +```typescript +// Multiply the 'value' field by 2 +Field.of("value").multiply(2); + +``` + +Signature: + +```typescript +multiply(other: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +## FirestoreFunction.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to another expression. + +```typescript +// Check if the 'status' field is not equal to "completed" +Field.of("status").neq("completed"); + +``` + +Signature: + +```typescript +neq(other: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## FirestoreFunction.neq() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if this expression is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +Field.of("country").neq("USA"); + +``` + +Signature: + +```typescript +neq(other: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +## FirestoreFunction.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +Field.of("description").regexContains("(?i)example"); + +``` + +Signature: + +```typescript +regexContains(pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## FirestoreFunction.regexContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains the regular expression stored in field 'regex' +Field.of("description").regexContains(Field.of("regex")); + +``` + +Signature: + +```typescript +regexContains(pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +## FirestoreFunction.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +regexMatch(pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## FirestoreFunction.regexMatch() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a regular expression stored in field 'regex' +Field.of("email").regexMatch(Field.of("regex")); + +``` + +Signature: + +```typescript +regexMatch(pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +## FirestoreFunction.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field +Field.of("message").replaceAll("hello", "hi"); + +``` + +Signature: + +```typescript +replaceAll(find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## FirestoreFunction.replaceAll() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceAll(find: Constant, replace: Constant): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +## FirestoreFunction.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field +Field.of("message").replaceFirst("hello", "hi"); + +``` + +Signature: + +```typescript +replaceFirst(find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## FirestoreFunction.replaceFirst() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field +Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + +``` + +Signature: + +```typescript +replaceFirst(find: Constant, replace: Constant): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +## FirestoreFunction.reverse() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses this string expression. + +```typescript +// Reverse the value of the 'myString' field. +Field.of("myString").reverse(); + +``` + A new representing the reversed string. + +Signature: + +```typescript +reverse(): Reverse; +``` +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +## FirestoreFunction.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +Field.of("name").startsWith("Mr."); + +``` + +Signature: + +```typescript +startsWith(prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## FirestoreFunction.startsWith() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string starts with a given prefix (represented as an expression). + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +Field.of("fullName").startsWith(Field.of("firstName")); + +``` + +Signature: + +```typescript +startsWith(prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +## FirestoreFunction.strConcat() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + +``` + +Signature: + +```typescript +strConcat(...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## FirestoreFunction.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +Field.of("description").strContains("example"); + +``` + +Signature: + +```typescript +strContains(substring: string): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## FirestoreFunction.strContains() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string contains the string represented by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +Field.of("description").strContains(Field.of("keyword")); + +``` + +Signature: + +```typescript +strContains(expr: Constant): StrContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | + +Returns: + +[StrContains](./firestore_lite.strcontains.md#strcontains_class) + +## FirestoreFunction.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts another expression from this expression. + +```typescript +// Subtract the 'discount' field from the 'price' field +Field.of("price").subtract(Field.of("discount")); + +``` + +Signature: + +```typescript +subtract(other: Constant): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## FirestoreFunction.subtract() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from this expression. + +```typescript +// Subtract 20 from the value of the 'total' field +Field.of("total").subtract(20); + +``` + +Signature: + +```typescript +subtract(other: any): Subtract; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | + +Returns: + +[Subtract](./firestore_lite.subtract.md#subtract_class) + +## FirestoreFunction.sum() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +Field.of("orderAmount").sum().as("totalRevenue"); + +``` + A new `Accumulator` representing the 'sum' aggregation. + +Signature: + +```typescript +sum(): Sum; +``` +Returns: + +[Sum](./firestore_lite.sum.md#sum_class) + +## FirestoreFunction.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampAdd(unit: Constant, amount: Constant): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## FirestoreFunction.timestampAdd() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to this timestamp expression. + +```typescript +// Add 1 day to the 'timestamp' field. +Field.of("timestamp").timestampAdd("day", 1); + +``` + +Signature: + +```typescript +timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +## FirestoreFunction.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + +``` + +Signature: + +```typescript +timestampSub(unit: Constant, amount: Constant): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## FirestoreFunction.timestampSub() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from this timestamp expression. + +```typescript +// Subtract 1 day from the 'timestamp' field. +Field.of("timestamp").timestampSub("day", 1); + +``` + +Signature: + +```typescript +timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +## FirestoreFunction.timestampToUnixMicros() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +Field.of("timestamp").timestampToUnixMicros(); + +``` + A new representing the number of microseconds since epoch. + +Signature: + +```typescript +timestampToUnixMicros(): TimestampToUnixMicros; +``` +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +## FirestoreFunction.timestampToUnixMillis() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +Field.of("timestamp").timestampToUnixMillis(); + +``` + A new representing the number of milliseconds since epoch. + +Signature: + +```typescript +timestampToUnixMillis(): TimestampToUnixMillis; +``` +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +## FirestoreFunction.timestampToUnixSeconds() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +Field.of("timestamp").timestampToUnixSeconds(); + +``` + A new representing the number of seconds since epoch. + +Signature: + +```typescript +timestampToUnixSeconds(): TimestampToUnixSeconds; +``` +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +## FirestoreFunction.toLower() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to lowercase. + +```typescript +// Convert the 'name' field to lowercase +Field.of("name").toLower(); + +``` + A new `Expr` representing the lowercase string. + +Signature: + +```typescript +toLower(): ToLower; +``` +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +## FirestoreFunction.toUpper() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string to uppercase. + +```typescript +// Convert the 'title' field to uppercase +Field.of("title").toUpper(); + +``` + A new `Expr` representing the uppercase string. + +Signature: + +```typescript +toUpper(): ToUpper; +``` +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +## FirestoreFunction.trim() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string. + +```typescript +// Trim whitespace from the 'userInput' field +Field.of("userInput").trim(); + +``` + A new `Expr` representing the trimmed string. + +Signature: + +```typescript +trim(): Trim; +``` +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +## FirestoreFunction.unixMicrosToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +Field.of("microseconds").unixMicrosToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMicrosToTimestamp(): UnixMicrosToTimestamp; +``` +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +## FirestoreFunction.unixMillisToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +Field.of("milliseconds").unixMillisToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixMillisToTimestamp(): UnixMillisToTimestamp; +``` +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +## FirestoreFunction.unixSecondsToTimestamp() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +Field.of("seconds").unixSecondsToTimestamp(); + +``` + A new representing the timestamp. + +Signature: + +```typescript +unixSecondsToTimestamp(): UnixSecondsToTimestamp; +``` +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +## FirestoreFunction.vectorLength() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +Field.of("embedding").vectorLength(); + +``` + A new representing the length of the vector. + +Signature: + +```typescript +vectorLength(): VectorLength; +``` +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + diff --git a/docs-devsite/firestore_lite.genericstage.md b/docs-devsite/firestore_lite.genericstage.md new file mode 100644 index 00000000000..c2f723c8f50 --- /dev/null +++ b/docs-devsite/firestore_lite.genericstage.md @@ -0,0 +1,65 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenericStage class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class GenericStage implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(name, params)](./firestore_lite.genericstage.md#genericstageconstructor) | | (BETA) Constructs a new instance of the GenericStage class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.genericstage.md#genericstagename) | | string | (BETA) | + +## GenericStage.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `GenericStage` class + +Signature: + +```typescript +constructor(name: string, params: unknown[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| params | unknown\[\] | | + +## GenericStage.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.gt.md b/docs-devsite/firestore_lite.gt.md new file mode 100644 index 00000000000..61c217f58ce --- /dev/null +++ b/docs-devsite/firestore_lite.gt.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Gt class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Gt extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.gt.md#gtconstructor) | | (BETA) Constructs a new instance of the Gt class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.gt.md#gtfilterable) | | true | (BETA) | + +## Gt.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Gt` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Gt.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.gte.md b/docs-devsite/firestore_lite.gte.md new file mode 100644 index 00000000000..1550dd8daec --- /dev/null +++ b/docs-devsite/firestore_lite.gte.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Gte class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Gte extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.gte.md#gteconstructor) | | (BETA) Constructs a new instance of the Gte class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.gte.md#gtefilterable) | | true | (BETA) | + +## Gte.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Gte` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Gte.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.if.md b/docs-devsite/firestore_lite.if.md new file mode 100644 index 00000000000..c587b2f1f01 --- /dev/null +++ b/docs-devsite/firestore_lite.if.md @@ -0,0 +1,68 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# If class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class If extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(condition, thenExpr, elseExpr)](./firestore_lite.if.md#ifconstructor) | | (BETA) Constructs a new instance of the If class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.if.md#iffilterable) | | true | (BETA) | + +## If.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `If` class + +Signature: + +```typescript +constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterExpr](./firestore_lite.md#filterexpr) | | +| thenExpr | [Constant](./firestore_lite.constant.md#constant_class) | | +| elseExpr | [Constant](./firestore_lite.constant.md#constant_class) | | + +## If.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.in.md b/docs-devsite/firestore_lite.in.md new file mode 100644 index 00000000000..83bd0e57107 --- /dev/null +++ b/docs-devsite/firestore_lite.in.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# In class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class In extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, others)](./firestore_lite.in.md#inconstructor) | | (BETA) Constructs a new instance of the In class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.in.md#infilterable) | | true | (BETA) | + +## In.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `In` class + +Signature: + +```typescript +constructor(left: Constant, others: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + +## In.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.isnan.md b/docs-devsite/firestore_lite.isnan.md new file mode 100644 index 00000000000..f3be87e7eb8 --- /dev/null +++ b/docs-devsite/firestore_lite.isnan.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# IsNan class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class IsNan extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.isnan.md#isnanconstructor) | | (BETA) Constructs a new instance of the IsNan class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.isnan.md#isnanfilterable) | | true | (BETA) | + +## IsNan.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `IsNan` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + +## IsNan.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.like.md b/docs-devsite/firestore_lite.like.md new file mode 100644 index 00000000000..67b00346b88 --- /dev/null +++ b/docs-devsite/firestore_lite.like.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Like class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Like extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_lite.like.md#likeconstructor) | | (BETA) Constructs a new instance of the Like class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.like.md#likefilterable) | | true | (BETA) | + +## Like.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Like` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Like.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.limit.md b/docs-devsite/firestore_lite.limit.md new file mode 100644 index 00000000000..4e559293f2a --- /dev/null +++ b/docs-devsite/firestore_lite.limit.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Limit class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Limit implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(limit)](./firestore_lite.limit.md#limitconstructor) | | (BETA) Constructs a new instance of the Limit class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.limit.md#limitname) | | string | (BETA) | + +## Limit.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Limit` class + +Signature: + +```typescript +constructor(limit: number); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| limit | number | | + +## Limit.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.logicalmax.md b/docs-devsite/firestore_lite.logicalmax.md new file mode 100644 index 00000000000..f992776b068 --- /dev/null +++ b/docs-devsite/firestore_lite.logicalmax.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LogicalMax class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class LogicalMax extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.logicalmax.md#logicalmaxconstructor) | | (BETA) Constructs a new instance of the LogicalMax class | + +## LogicalMax.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `LogicalMax` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.logicalmin.md b/docs-devsite/firestore_lite.logicalmin.md new file mode 100644 index 00000000000..686378b7f56 --- /dev/null +++ b/docs-devsite/firestore_lite.logicalmin.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LogicalMin class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class LogicalMin extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.logicalmin.md#logicalminconstructor) | | (BETA) Constructs a new instance of the LogicalMin class | + +## LogicalMin.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `LogicalMin` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.lt.md b/docs-devsite/firestore_lite.lt.md new file mode 100644 index 00000000000..b44d2f656d0 --- /dev/null +++ b/docs-devsite/firestore_lite.lt.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Lt class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Lt extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.lt.md#ltconstructor) | | (BETA) Constructs a new instance of the Lt class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.lt.md#ltfilterable) | | true | (BETA) | + +## Lt.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Lt` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Lt.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.lte.md b/docs-devsite/firestore_lite.lte.md new file mode 100644 index 00000000000..ddde6a08d93 --- /dev/null +++ b/docs-devsite/firestore_lite.lte.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Lte class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Lte extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.lte.md#lteconstructor) | | (BETA) Constructs a new instance of the Lte class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.lte.md#ltefilterable) | | true | (BETA) | + +## Lte.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Lte` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Lte.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.mapget.md b/docs-devsite/firestore_lite.mapget.md new file mode 100644 index 00000000000..617b92d4d5a --- /dev/null +++ b/docs-devsite/firestore_lite.mapget.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MapGet class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class MapGet extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(map, name)](./firestore_lite.mapget.md#mapgetconstructor) | | (BETA) Constructs a new instance of the MapGet class | + +## MapGet.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `MapGet` class + +Signature: + +```typescript +constructor(map: Constant, name: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| map | [Constant](./firestore_lite.constant.md#constant_class) | | +| name | string | | + diff --git a/docs-devsite/firestore_lite.max.md b/docs-devsite/firestore_lite.max.md new file mode 100644 index 00000000000..185fa011d0a --- /dev/null +++ b/docs-devsite/firestore_lite.max.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Max class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Max extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_lite.max.md#maxconstructor) | | (BETA) Constructs a new instance of the Max class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_lite.max.md#maxaccumulator) | | true | (BETA) | + +## Max.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Max` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| distinct | boolean | | + +## Max.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md index da7d304e3d5..59abff098db 100644 --- a/docs-devsite/firestore_lite.md +++ b/docs-devsite/firestore_lite.md @@ -25,48 +25,1216 @@ https://github.com/firebase/firebase-js-sdk | [collectionGroup(firestore, collectionId)](./firestore_lite.md#collectiongroup_1838fc3) | Creates and returns a new Query instance that includes all documents in the database that are contained in a collection or subcollection with the given collectionId. | | [connectFirestoreEmulator(firestore, host, port, options)](./firestore_lite.md#connectfirestoreemulator_7c247cd) | Modify this instance to communicate with the Cloud Firestore emulator.Note: This must be called before this instance has been used to do any operations. | | [doc(firestore, path, pathSegments)](./firestore_lite.md#doc_1eb4c23) | Gets a DocumentReference instance that refers to the document at the specified absolute path. | +| [pipeline(firestore)](./firestore_lite.md#pipeline_231a8e0) | Experimental Modular API for console testing. | | [runTransaction(firestore, updateFunction, options)](./firestore_lite.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | | [terminate(firestore)](./firestore_lite.md#terminate_231a8e0) | Terminates the provided Firestore instance.After calling terminate() only the clearIndexedDbPersistence() functions may be used. Any other function will throw a FirestoreError. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved.To restart after termination, create a new instance of Firestore with [getFirestore()](./firestore_.md#getfirestore).Note: Under normal circumstances, calling terminate() is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. | | [writeBatch(firestore)](./firestore_lite.md#writebatch_231a8e0) | Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500.The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. | | function() | | [count()](./firestore_lite.md#count) | Create an AggregateField object that can be used to compute the count of documents in the result set of a query. | +| [countAll()](./firestore_lite.md#countall) | (BETA) Creates an aggregation that counts the total number of stage inputs. +```typescript +// Count the total number of users +countAll().as("totalUsers"); + +``` + A new representing the 'countAll' aggregation. | | [deleteField()](./firestore_lite.md#deletefield) | Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with {merge: true} to mark a field for deletion. | | [documentId()](./firestore_lite.md#documentid) | Returns a special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. | | [getFirestore()](./firestore_lite.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [serverTimestamp()](./firestore_lite.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | +| [useFirestorePipelines()](./firestore_lite.md#usefirestorepipelines) | | +| function(array, ...) | +| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); + +``` + | +| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_21991c1) | (BETA) Creates an expression that concatenates an array expression with other arrays and/or values. +```typescript +// Combine the 'tags' array with a new array +arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); + +``` + | +| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_f8d5d5e) | (BETA) Creates an expression that concatenates a field's array value with other arrays. +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + +``` + | +| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_5a66d99) | (BETA) Creates an expression that concatenates a field's array value with other arrays and/or values. +```typescript +// Combine the 'tags' array with a new array +arrayConcat("tags", ["newTag1", "newTag2"]); + +``` + | +| [arrayContains(array, element)](./firestore_lite.md#arraycontains_01ea7c0) | (BETA) Creates an expression that checks if an array expression contains a specific element. +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains(Field.of("colors"), Field.of("selectedColor")); + +``` + | +| [arrayContains(array, element)](./firestore_lite.md#arraycontains_60f8f2f) | (BETA) Creates an expression that checks if an array expression contains a specific element. +```typescript +// Check if the 'colors' array contains "red" +arrayContains(Field.of("colors"), "red"); + +``` + | +| [arrayContains(array, element)](./firestore_lite.md#arraycontains_0ebdbfe) | (BETA) Creates an expression that checks if a field's array value contains a specific element. +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains("colors", Field.of("selectedColor")); + +``` + | +| [arrayContains(array, element)](./firestore_lite.md#arraycontains_8f718df) | (BETA) Creates an expression that checks if a field's array value contains a specific value. +```typescript +// Check if the 'colors' array contains "red" +arrayContains("colors", "red"); + +``` + | +| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_7b7433a) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_d919466) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_7b7433a) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_d919466) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + | +| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + | +| [arrayLength(array)](./firestore_lite.md#arraylength_0bb5dbb) | (BETA) Creates an expression that calculates the length of an array expression. +```typescript +// Get the number of items in the 'cart' array +arrayLength(Field.of("cart")); + +``` + | +| function(condition, ...) | +| [ifFunction(condition, thenExpr, elseExpr)](./firestore_lite.md#iffunction_f7b2404) | (BETA) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. +```typescript +// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". +ifFunction( + gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + +``` + | | function(databaseId, ...) | | [getFirestore(databaseId)](./firestore_lite.md#getfirestore_53dc891) | (BETA) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| function(element, ...) | +| [inAny(element, others)](./firestore_lite.md#inany_a73b259) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_lite.md#inany_f5721c6) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_lite.md#inany_c6646ea) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + | +| [inAny(element, others)](./firestore_lite.md#inany_e6877aa) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", ["Electronics", Field.of("primaryType")]); + +``` + | +| [notInAny(element, others)](./firestore_lite.md#notinany_a73b259) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_lite.md#notinany_f5721c6) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_lite.md#notinany_c6646ea) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + | +| [notInAny(element, others)](./firestore_lite.md#notinany_e6877aa) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", ["pending", Field.of("rejectedStatus")]); + +``` + | | function(elements, ...) | | [arrayRemove(elements)](./firestore_lite.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_lite.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | +| function(expr, ...) | +| [ascending(expr)](./firestore_lite.md#ascending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. +```typescript +// Sort documents by the 'name' field in ascending order +firestore.pipeline().collection("users") + .sort(ascending(Field.of("name"))); + +``` + | +| [byteLength(expr)](./firestore_lite.md#bytelength_f3fb767) | (BETA) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength(Field.of("myString")); + +``` + | +| [charLength(expr)](./firestore_lite.md#charlength_f3fb767) | (BETA) Creates an expression that calculates the character length of a string expression in UTF-8. +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength(Field.of("name")); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_b4c7dc2) | (BETA) Calculates the Cosine distance between a field's vector value and a double array. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", [37.7749, -122.4194]); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_8d2bd9d) | (BETA) Calculates the Cosine distance between a field's vector value and a VectorValue. +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_c9ae0bc) | (BETA) Calculates the Cosine distance between a field's vector value and a vector expression. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance("userVector", Field.of("itemVector")); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_e701952) | (BETA) Calculates the Cosine distance between a vector expression and a double array. +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_cc2e83e) | (BETA) Calculates the Cosine distance between a vector expression and a VectorValue. +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + | +| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_0896fbd) | (BETA) Calculates the Cosine distance between two vector expressions. +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance(Field.of("userVector"), Field.of("itemVector")); + +``` + | +| [descending(expr)](./firestore_lite.md#descending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") + .sort(descending(Field.of("createdAt"))); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_b4c7dc2) | (BETA) Calculates the dot product between a field's vector value and a double array. +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", [0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_8d2bd9d) | (BETA) Calculates the dot product between a field's vector value and a VectorValue. +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_c9ae0bc) | (BETA) Calculates the dot product between a field's vector value and a vector expression. +```typescript +// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' +dotProduct("docVector1", Field.of("docVector2")); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_e701952) | (BETA) Calculates the dot product between a vector expression and a double array. +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_cc2e83e) | (BETA) Calculates the dot product between a vector expression and a VectorValue. +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + +``` + | +| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_0896fbd) | (BETA) Calculates the dot product between two vector expressions. +```typescript +// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' +dotProduct(Field.of("docVector1"), Field.of("docVector2")); + +``` + | +| [endsWith(expr, suffix)](./firestore_lite.md#endswith_88569cd) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. +```typescript +// Check if the 'filename' field ends with ".txt" +endsWith("filename", ".txt"); + +``` + | +| [endsWith(expr, suffix)](./firestore_lite.md#endswith_e2e794e) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +endsWith("url", Field.of("extension")); + +``` + | +| [endsWith(expr, suffix)](./firestore_lite.md#endswith_6308b81) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), "Jr."); + +``` + | +| [endsWith(expr, suffix)](./firestore_lite.md#endswith_ab1cc39) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), Constant.of("Jr.")); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_b4c7dc2) | (BETA) Calculates the Euclidean distance between a field's vector value and a double array. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", [37.7749, -122.4194]); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_8d2bd9d) | (BETA) Calculates the Euclidean distance between a field's vector value and a VectorValue. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_c9ae0bc) | (BETA) Calculates the Euclidean distance between a field's vector value and a vector expression. +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance("pointA", Field.of("pointB")); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_e701952) | (BETA) Calculates the Euclidean distance between a vector expression and a double array. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location + +euclideanDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_cc2e83e) | (BETA) Calculates the Euclidean distance between a vector expression and a VectorValue. +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + | +| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_0896fbd) | (BETA) Calculates the Euclidean distance between two vector expressions. +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance(Field.of("pointA"), Field.of("pointB")); + +``` + | +| [reverse(expr)](./firestore_lite.md#reverse_f3fb767) | (BETA) Creates an expression that reverses a string. +```typescript +// Reverse the value of the 'myString' field. +reverse(Field.of("myString")); + +``` + | +| [startsWith(expr, prefix)](./firestore_lite.md#startswith_484d9f3) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. +```typescript +// Check if the 'name' field starts with "Mr." +startsWith("name", "Mr."); + +``` + | +| [startsWith(expr, prefix)](./firestore_lite.md#startswith_7deb5c7) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +startsWith("fullName", Field.of("firstName")); + +``` + | +| [startsWith(expr, prefix)](./firestore_lite.md#startswith_68300d1) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), "Mr."); + +``` + | +| [startsWith(expr, prefix)](./firestore_lite.md#startswith_5774b68) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), Field.of("prefix")); + +``` + | +| [timestampToUnixMicros(expr)](./firestore_lite.md#timestamptounixmicros_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros(Field.of("timestamp")); + +``` + | +| [timestampToUnixMillis(expr)](./firestore_lite.md#timestamptounixmillis_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis(Field.of("timestamp")); + +``` + | +| [timestampToUnixSeconds(expr)](./firestore_lite.md#timestamptounixseconds_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds(Field.of("timestamp")); + +``` + | +| [toLower(expr)](./firestore_lite.md#tolower_1e536ed) | (BETA) Creates an expression that converts a string field to lowercase. +```typescript +// Convert the 'name' field to lowercase +toLower("name"); + +``` + | +| [toLower(expr)](./firestore_lite.md#tolower_f3fb767) | (BETA) Creates an expression that converts a string expression to lowercase. +```typescript +// Convert the 'name' field to lowercase +toLower(Field.of("name")); + +``` + | +| [toUpper(expr)](./firestore_lite.md#toupper_1e536ed) | (BETA) Creates an expression that converts a string field to uppercase. +```typescript +// Convert the 'title' field to uppercase +toUpper("title"); + +``` + | +| [toUpper(expr)](./firestore_lite.md#toupper_f3fb767) | (BETA) Creates an expression that converts a string expression to uppercase. +```typescript +// Convert the 'title' field to uppercase +toUppercase(Field.of("title")); + +``` + | +| [trim(expr)](./firestore_lite.md#trim_1e536ed) | (BETA) Creates an expression that removes leading and trailing whitespace from a string field. +```typescript +// Trim whitespace from the 'userInput' field +trim("userInput"); + +``` + | +| [trim(expr)](./firestore_lite.md#trim_f3fb767) | (BETA) Creates an expression that removes leading and trailing whitespace from a string expression. +```typescript +// Trim whitespace from the 'userInput' field +trim(Field.of("userInput")); + +``` + | +| [unixMicrosToTimestamp(expr)](./firestore_lite.md#unixmicrostotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp(Field.of("microseconds")); + +``` + | +| [unixMillisToTimestamp(expr)](./firestore_lite.md#unixmillistotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp(Field.of("milliseconds")); + +``` + | +| [unixSecondsToTimestamp(expr)](./firestore_lite.md#unixsecondstotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp(Field.of("seconds")); + +``` + | +| [vectorLength(expr)](./firestore_lite.md#vectorlength_f3fb767) | (BETA) Creates an expression that calculates the length of a Firestore Vector. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength(Field.of("embedding")); + +``` + | | function(field, ...) | | [average(field)](./firestore_lite.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | +| [byteLength(field)](./firestore_lite.md#bytelength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength("myString"); + +``` + | +| [charLength(field)](./firestore_lite.md#charlength_0fb8cd4) | (BETA) Creates an expression that calculates the character length of a string field in UTF8. +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength("name"); + +``` + | +| [exists(field)](./firestore_lite.md#exists_0fb8cd4) | (BETA) Creates an expression that checks if a field exists. +```typescript +// Check if the document has a field named "phoneNumber" +exists("phoneNumber"); + +``` + | +| [replaceAll(field, find, replace)](./firestore_lite.md#replaceall_b257ab0) | (BETA) Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll("message", "hello", "hi"); + +``` + | +| [replaceFirst(field, find, replace)](./firestore_lite.md#replacefirst_b257ab0) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst("message", "hello", "hi"); + +``` + | +| [reverse(field)](./firestore_lite.md#reverse_0fb8cd4) | (BETA) Creates an expression that reverses a string represented by a field. +```typescript +// Reverse the value of the 'myString' field. +reverse("myString"); + +``` + | | [sum(field)](./firestore_lite.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | -| function(fieldPath, ...) | -| [orderBy(fieldPath, directionStr)](./firestore_lite.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | -| [where(fieldPath, opStr, value)](./firestore_lite.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | -| function(fieldValues, ...) | -| [endAt(fieldValues)](./firestore_lite.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [endBefore(fieldValues)](./firestore_lite.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAfter(fieldValues)](./firestore_lite.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAt(fieldValues)](./firestore_lite.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| function(left, ...) | -| [aggregateFieldEqual(left, right)](./firestore_lite.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | -| [aggregateQuerySnapshotEqual(left, right)](./firestore_lite.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | -| [queryEqual(left, right)](./firestore_lite.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | -| [refEqual(left, right)](./firestore_lite.md#refequal_598b780) | Returns true if the provided references are equal. | -| [snapshotEqual(left, right)](./firestore_lite.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | -| function(limit, ...) | -| [limit(limit)](./firestore_lite.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | -| [limitToLast(limit)](./firestore_lite.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | -| function(logLevel, ...) | -| [setLogLevel(logLevel)](./firestore_lite.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | -| function(n, ...) | -| [increment(n)](./firestore_lite.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | -| function(query, ...) | -| [getAggregate(query, aggregateSpec)](./firestore_lite.md#getaggregate_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | -| [getCount(query)](./firestore_lite.md#getcount_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | +| [timestampAdd(field, unit, amount)](./firestore_lite.md#timestampadd_565792c) | (BETA) Creates an expression that adds a specified amount of time to a timestamp represented by a field. +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd("timestamp", "day", 1); + +``` + | +| [timestampSub(field, unit, amount)](./firestore_lite.md#timestampsub_565792c) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub("timestamp", "day", 1); + +``` + | +| [timestampToUnixMicros(field)](./firestore_lite.md#timestamptounixmicros_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros("timestamp"); + +``` + | +| [timestampToUnixMillis(field)](./firestore_lite.md#timestamptounixmillis_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis("timestamp"); + +``` + | +| [timestampToUnixSeconds(field)](./firestore_lite.md#timestamptounixseconds_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds("timestamp"); + +``` + | +| [unixMicrosToTimestamp(field)](./firestore_lite.md#unixmicrostotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp("microseconds"); + +``` + | +| [unixMillisToTimestamp(field)](./firestore_lite.md#unixmillistotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp("milliseconds"); + +``` + | +| [unixSecondsToTimestamp(field)](./firestore_lite.md#unixsecondstotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp("seconds"); + +``` + | +| [vectorLength(field)](./firestore_lite.md#vectorlength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a Firestore Vector represented by a field. +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength("embedding"); + +``` + | +| function(fieldPath, ...) | +| [orderBy(fieldPath, directionStr)](./firestore_lite.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | +| [where(fieldPath, opStr, value)](./firestore_lite.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | +| function(fieldValues, ...) | +| [endAt(fieldValues)](./firestore_lite.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [endBefore(fieldValues)](./firestore_lite.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAfter(fieldValues)](./firestore_lite.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAt(fieldValues)](./firestore_lite.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| function(filter, ...) | +| [not(filter)](./firestore_lite.md#not_5520849) | (BETA) Creates an expression that negates a filter condition. +```typescript +// Find documents where the 'completed' field is NOT true +not(eq("completed", true)); + +``` + | +| function(first, ...) | +| [strConcat(first, elements)](./firestore_lite.md#strconcat_0f1bdbf) | (BETA) Creates an expression that concatenates string functions, fields or constants together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat("firstName", " ", Field.of("lastName")); + +``` + | +| [strConcat(first, elements)](./firestore_lite.md#strconcat_1eb0ac1) | (BETA) Creates an expression that concatenates string expressions together. +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat(Field.of("firstName"), " ", Field.of("lastName")); + +``` + | +| function(left, ...) | +| [add(left, right)](./firestore_lite.md#add_be96f75) | (BETA) Creates an expression that adds two expressions together. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add(Field.of("quantity"), Field.of("reserve")); + +``` + | +| [add(left, right)](./firestore_lite.md#add_010ba9e) | (BETA) Creates an expression that adds an expression to a constant value. +```typescript +// Add 5 to the value of the 'age' field +add(Field.of("age"), 5); + +``` + | +| [add(left, right)](./firestore_lite.md#add_674c63f) | (BETA) Creates an expression that adds a field's value to an expression. +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add("quantity", Field.of("reserve")); + +``` + | +| [add(left, right)](./firestore_lite.md#add_1f46a76) | (BETA) Creates an expression that adds a field's value to a constant value. +```typescript +// Add 5 to the value of the 'age' field +add("age", 5); + +``` + | +| [aggregateFieldEqual(left, right)](./firestore_lite.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | +| [aggregateQuerySnapshotEqual(left, right)](./firestore_lite.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | +| [and(left, right)](./firestore_lite.md#and_eba7e36) | (BETA) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. +```typescript +// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND +// the 'status' field is "active" +const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + | +| [divide(left, right)](./firestore_lite.md#divide_be96f75) | (BETA) Creates an expression that divides two expressions. +```typescript +// Divide the 'total' field by the 'count' field +divide(Field.of("total"), Field.of("count")); + +``` + | +| [divide(left, right)](./firestore_lite.md#divide_010ba9e) | (BETA) Creates an expression that divides an expression by a constant value. +```typescript +// Divide the 'value' field by 10 +divide(Field.of("value"), 10); + +``` + | +| [divide(left, right)](./firestore_lite.md#divide_674c63f) | (BETA) Creates an expression that divides a field's value by an expression. +```typescript +// Divide the 'total' field by the 'count' field +divide("total", Field.of("count")); + +``` + | +| [divide(left, right)](./firestore_lite.md#divide_1f46a76) | (BETA) Creates an expression that divides a field's value by a constant value. +```typescript +// Divide the 'value' field by 10 +divide("value", 10); + +``` + | +| [eq(left, right)](./firestore_lite.md#eq_be96f75) | (BETA) Creates an expression that checks if two expressions are equal. +```typescript +// Check if the 'age' field is equal to an expression +eq(Field.of("age"), Field.of("minAge").add(10)); + +``` + | +| [eq(left, right)](./firestore_lite.md#eq_010ba9e) | (BETA) Creates an expression that checks if an expression is equal to a constant value. +```typescript +// Check if the 'age' field is equal to 21 +eq(Field.of("age"), 21); + +``` + | +| [eq(left, right)](./firestore_lite.md#eq_674c63f) | (BETA) Creates an expression that checks if a field's value is equal to an expression. +```typescript +// Check if the 'age' field is equal to the 'limit' field +eq("age", Field.of("limit")); + +``` + | +| [eq(left, right)](./firestore_lite.md#eq_1f46a76) | (BETA) Creates an expression that checks if a field's value is equal to a constant value. +```typescript +// Check if the 'city' field is equal to string constant "London" +eq("city", "London"); + +``` + | +| [gt(left, right)](./firestore_lite.md#gt_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than the second expression. +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), Constant(9).add(9)); + +``` + | +| [gt(left, right)](./firestore_lite.md#gt_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than a constant value. +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), 18); + +``` + | +| [gt(left, right)](./firestore_lite.md#gt_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than an expression. +```typescript +// Check if the value of field 'age' is greater than the value of field 'limit' +gt("age", Field.of("limit")); + +``` + | +| [gt(left, right)](./firestore_lite.md#gt_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than a constant value. +```typescript +// Check if the 'price' field is greater than 100 +gt("price", 100); + +``` + | +| [gte(left, right)](./firestore_lite.md#gte_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than or equal to the second expression. +```typescript +// Check if the 'quantity' field is greater than or equal to the field "threshold" +gte(Field.of("quantity"), Field.of("threshold")); + +``` + | +| [gte(left, right)](./firestore_lite.md#gte_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than or equal to a constant value. +```typescript +// Check if the 'quantity' field is greater than or equal to 10 +gte(Field.of("quantity"), 10); + +``` + | +| [gte(left, right)](./firestore_lite.md#gte_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than or equal to an expression. +```typescript +// Check if the value of field 'age' is greater than or equal to the value of field 'limit' +gte("age", Field.of("limit")); + +``` + | +| [gte(left, right)](./firestore_lite.md#gte_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than or equal to a constant value. +```typescript +// Check if the 'score' field is greater than or equal to 80 +gte("score", 80); + +``` + | +| [like(left, pattern)](./firestore_lite.md#like_33ec01b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. +```typescript +// Check if the 'title' field contains the string "guide" +like("title", "%guide%"); + +``` + | +| [like(left, pattern)](./firestore_lite.md#like_dd84184) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. +```typescript +// Check if the 'title' field contains the string "guide" +like("title", Field.of("pattern")); + +``` + | +| [like(left, pattern)](./firestore_lite.md#like_3aaffe0) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), "%guide%"); + +``` + | +| [like(left, pattern)](./firestore_lite.md#like_a2c3e8b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), Field.of("pattern")); + +``` + | +| [logicalMax(left, right)](./firestore_lite.md#logicalmax_be96f75) | (BETA) Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax(Field.of("field1"), Field.of("field2")); + +``` + | +| [logicalMax(left, right)](./firestore_lite.md#logicalmax_010ba9e) | (BETA) Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax(Field.of("value"), 10); + +``` + | +| [logicalMax(left, right)](./firestore_lite.md#logicalmax_674c63f) | (BETA) Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax("field1", Field.of('field2')); + +``` + | +| [logicalMax(left, right)](./firestore_lite.md#logicalmax_1f46a76) | (BETA) Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax("value", 10); + +``` + | +| [logicalMin(left, right)](./firestore_lite.md#logicalmin_be96f75) | (BETA) Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin(Field.of("field1"), Field.of("field2")); + +``` + | +| [logicalMin(left, right)](./firestore_lite.md#logicalmin_010ba9e) | (BETA) Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin(Field.of("value"), 10); + +``` + | +| [logicalMin(left, right)](./firestore_lite.md#logicalmin_674c63f) | (BETA) Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin("field1", Field.of("field2")); + +``` + | +| [logicalMin(left, right)](./firestore_lite.md#logicalmin_1f46a76) | (BETA) Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin("value", 10); + +``` + | +| [lt(left, right)](./firestore_lite.md#lt_be96f75) | (BETA) Creates an expression that checks if the first expression is less than the second expression. +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), Field.of("limit")); + +``` + | +| [lt(left, right)](./firestore_lite.md#lt_010ba9e) | (BETA) Creates an expression that checks if an expression is less than a constant value. +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), 30); + +``` + | +| [lt(left, right)](./firestore_lite.md#lt_674c63f) | (BETA) Creates an expression that checks if a field's value is less than an expression. +```typescript +// Check if the 'age' field is less than the 'limit' field +lt("age", Field.of("limit")); + +``` + | +| [lt(left, right)](./firestore_lite.md#lt_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than a constant value. +```typescript +// Check if the 'price' field is less than 50 +lt("price", 50); + +``` + | +| [lte(left, right)](./firestore_lite.md#lte_be96f75) | (BETA) Creates an expression that checks if the first expression is less than or equal to the second expression. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), Field.of("limit")); + +``` + | +| [lte(left, right)](./firestore_lite.md#lte_010ba9e) | (BETA) Creates an expression that checks if an expression is less than or equal to a constant value. +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), 20); + +``` + | +| [lte(left, right)](./firestore_lite.md#lte_674c63f) | Creates an expression that checks if a field's value is less than or equal to an expression. +```typescript +// Check if the 'quantity' field is less than or equal to the 'limit' field +lte("quantity", Field.of("limit")); + +``` + | +| [lte(left, right)](./firestore_lite.md#lte_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than or equal to a constant value. +```typescript +// Check if the 'score' field is less than or equal to 70 +lte("score", 70); + +``` + | +| [mod(left, right)](./firestore_lite.md#mod_be96f75) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing two expressions. +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod(Field.of("field1"), Field.of("field2")); + +``` + | +| [mod(left, right)](./firestore_lite.md#mod_010ba9e) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod(Field.of("field1"), 5); + +``` + | +| [mod(left, right)](./firestore_lite.md#mod_674c63f) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod("field1", Field.of("field2")); + +``` + | +| [mod(left, right)](./firestore_lite.md#mod_1f46a76) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod("field1", 5); + +``` + | +| [multiply(left, right)](./firestore_lite.md#multiply_be96f75) | (BETA) Creates an expression that multiplies two expressions together. +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply(Field.of("quantity"), Field.of("price")); + +``` + | +| [multiply(left, right)](./firestore_lite.md#multiply_010ba9e) | (BETA) Creates an expression that multiplies an expression by a constant value. +```typescript +// Multiply the value of the 'price' field by 2 +multiply(Field.of("price"), 2); + +``` + | +| [multiply(left, right)](./firestore_lite.md#multiply_674c63f) | (BETA) Creates an expression that multiplies a field's value by an expression. +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply("quantity", Field.of("price")); + +``` + | +| [multiply(left, right)](./firestore_lite.md#multiply_1f46a76) | (BETA) Creates an expression that multiplies a field's value by a constant value. +```typescript +// Multiply the 'value' field by 2 +multiply("value", 2); + +``` + | +| [neq(left, right)](./firestore_lite.md#neq_be96f75) | (BETA) Creates an expression that checks if two expressions are not equal. +```typescript +// Check if the 'status' field is not equal to field 'finalState' +neq(Field.of("status"), Field.of("finalState")); + +``` + | +| [neq(left, right)](./firestore_lite.md#neq_010ba9e) | (BETA) Creates an expression that checks if an expression is not equal to a constant value. +```typescript +// Check if the 'status' field is not equal to "completed" +neq(Field.of("status"), "completed"); + +``` + | +| [neq(left, right)](./firestore_lite.md#neq_674c63f) | (BETA) Creates an expression that checks if a field's value is not equal to an expression. +```typescript +// Check if the 'status' field is not equal to the value of 'expectedStatus' +neq("status", Field.of("expectedStatus")); + +``` + | +| [neq(left, right)](./firestore_lite.md#neq_1f46a76) | (BETA) Creates an expression that checks if a field's value is not equal to a constant value. +```typescript +// Check if the 'country' field is not equal to "USA" +neq("country", "USA"); + +``` + | +| [or(left, right)](./firestore_lite.md#or_eba7e36) | (BETA) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. +```typescript +// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR +// the 'status' field is "active" +const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + | +| [queryEqual(left, right)](./firestore_lite.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | +| [refEqual(left, right)](./firestore_lite.md#refequal_598b780) | Returns true if the provided references are equal. | +| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_33ec01b) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", "(?i)example"); + +``` + | +| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_dd84184) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", Field.of("pattern")); + +``` + | +| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_3aaffe0) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), "(?i)example"); + +``` + | +| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_a2c3e8b) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), Field.of("pattern")); + +``` + | +| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_33ec01b) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_dd84184) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", Field.of("pattern")); + +``` + | +| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_3aaffe0) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + | +| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_a2c3e8b) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), Field.of("pattern")); + +``` + | +| [snapshotEqual(left, right)](./firestore_lite.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | +| [strContains(left, substring)](./firestore_lite.md#strcontains_18eaf5d) | (BETA) Creates an expression that checks if a string field contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +strContains("description", "example"); + +``` + | +| [strContains(left, substring)](./firestore_lite.md#strcontains_f0f1f2f) | (BETA) Creates an expression that checks if a string field contains a substring specified by an expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains("description", Field.of("keyword")); + +``` + | +| [strContains(left, substring)](./firestore_lite.md#strcontains_5fdbd29) | (BETA) Creates an expression that checks if a string expression contains a specified substring. +```typescript +// Check if the 'description' field contains "example". +strContains(Field.of("description"), "example"); + +``` + | +| [strContains(left, substring)](./firestore_lite.md#strcontains_d9d749f) | (BETA) Creates an expression that checks if a string expression contains a substring specified by another expression. +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains(Field.of("description"), Field.of("keyword")); + +``` + | +| [subtract(left, right)](./firestore_lite.md#subtract_be96f75) | (BETA) Creates an expression that subtracts two expressions. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract(Field.of("price"), Field.of("discount")); + +``` + | +| [subtract(left, right)](./firestore_lite.md#subtract_010ba9e) | (BETA) Creates an expression that subtracts a constant value from an expression. +```typescript +// Subtract the constant value 2 from the 'value' field +subtract(Field.of("value"), 2); + +``` + | +| [subtract(left, right)](./firestore_lite.md#subtract_674c63f) | (BETA) Creates an expression that subtracts an expression from a field's value. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract("price", Field.of("discount")); + +``` + | +| [subtract(left, right)](./firestore_lite.md#subtract_1f46a76) | (BETA) Creates an expression that subtracts a constant value from a field's value. +```typescript +// Subtract 20 from the value of the 'total' field +subtract("total", 20); + +``` + | +| [xor(left, right)](./firestore_lite.md#xor_eba7e36) | (BETA) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. +```typescript +// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", +// or 'status' is "active". +const condition = xor( + gt("age", 18), + eq("city", "London"), + eq("status", "active")); + +``` + | +| function(limit, ...) | +| [limit(limit)](./firestore_lite.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | +| [limitToLast(limit)](./firestore_lite.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | +| function(logLevel, ...) | +| [setLogLevel(logLevel)](./firestore_lite.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | +| function(mapExpr, ...) | +| [mapGet(mapExpr, subField)](./firestore_lite.md#mapget_9715f90) | (BETA) Accesses a value from a map (object) expression using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +mapGet(Field.of("address"), "city"); + +``` + | +| function(mapField, ...) | +| [mapGet(mapField, subField)](./firestore_lite.md#mapget_b37bbb6) | (BETA) Accesses a value from a map (object) field using the provided key. +```typescript +// Get the 'city' value from the 'address' map field +mapGet("address", "city"); + +``` + | +| function(n, ...) | +| [increment(n)](./firestore_lite.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | +| function(name, ...) | +| [genericFunction(name, params)](./firestore_lite.md#genericfunction_b886545) | (BETA) Creates functions that work on the backend but do not exist in the SDK yet. +```typescript +// Call a user defined function named "myFunc" with the arguments 10 and 20 +// This is the same of the 'sum(Field.of("price"))', if it did not exist +genericFunction("sum", [Field.of("price")]); + +``` + | +| function(pipeline, ...) | +| [execute(pipeline)](./firestore_lite.md#execute_86486e6) | (BETA) Modular API for console experimentation. | +| function(query, ...) | +| [getAggregate(query, aggregateSpec)](./firestore_lite.md#getaggregate_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | +| [getCount(query)](./firestore_lite.md#getcount_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | | [getDocs(query)](./firestore_lite.md#getdocs_4e56953) | Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class).All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. | +| [pipeline(query)](./firestore_lite.md#pipeline_20b2416) | Experimental Modular API for console testing. | | [query(query, compositeFilter, queryConstraints)](./firestore_lite.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | | [query(query, queryConstraints)](./firestore_lite.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | | function(queryConstraints, ...) | @@ -89,1487 +1257,7272 @@ https://github.com/firebase/firebase-js-sdk | [endBefore(snapshot)](./firestore_lite.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | | [startAfter(snapshot)](./firestore_lite.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | | [startAt(snapshot)](./firestore_lite.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | +| function(timestamp, ...) | +| [timestampAdd(timestamp, unit, amount)](./firestore_lite.md#timestampadd_87db576) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampAdd(timestamp, unit, amount)](./firestore_lite.md#timestampadd_46a2d7e) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), "day", 1); + +``` + | +| [timestampSub(timestamp, unit, amount)](./firestore_lite.md#timestampsub_87db576) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` + | +| [timestampSub(timestamp, unit, amount)](./firestore_lite.md#timestampsub_46a2d7e) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub(Field.of("timestamp"), "day", 1); + +``` + | +| function(value, ...) | +| [avgFunction(value)](./firestore_lite.md#avgfunction_f83680a) | (BETA) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. +```typescript +// Calculate the average age of users +avg(Field.of("age")).as("averageAge"); + +``` + | +| [avgFunction(value)](./firestore_lite.md#avgfunction_7c807cd) | (BETA) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. +```typescript +// Calculate the average age of users +avg("age").as("averageAge"); + +``` + | +| [exists(value)](./firestore_lite.md#exists_f83680a) | (BETA) Creates an expression that checks if a field exists. +```typescript +// Check if the document has a field named "phoneNumber" +exists(Field.of("phoneNumber")); + +``` + | +| [isNan(value)](./firestore_lite.md#isnan_f83680a) | (BETA) Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +isNaN(Field.of("value").divide(0)); + +``` + | +| [isNan(value)](./firestore_lite.md#isnan_7c807cd) | (BETA) Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). +```typescript +// Check if the result of a calculation is NaN +isNaN("value"); + +``` + | +| [max(value)](./firestore_lite.md#max_f83680a) | (BETA) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +max(Field.of("score")).as("highestScore"); + +``` + | +| [max(value)](./firestore_lite.md#max_7c807cd) | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +```typescript +// Find the highest score in a leaderboard +max("score").as("highestScore"); + +``` + | +| [min(value)](./firestore_lite.md#min_f83680a) | (BETA) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. +```typescript +// Find the lowest price of all products +min(Field.of("price")).as("lowestPrice"); + +``` + | +| [min(value)](./firestore_lite.md#min_7c807cd) | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +```typescript +// Find the lowest price of all products +min("price").as("lowestPrice"); + +``` + | +| [replaceAll(value, find, replace)](./firestore_lite.md#replaceall_f06d323) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll(Field.of("message"), "hello", "hi"); + +``` + | +| [replaceAll(value, find, replace)](./firestore_lite.md#replaceall_26a7926) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` + | +| [replaceFirst(value, find, replace)](./firestore_lite.md#replacefirst_f06d323) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring. +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst(Field.of("message"), "hello", "hi"); + +``` + | +| [replaceFirst(value, find, replace)](./firestore_lite.md#replacefirst_26a7926) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` + | +| [sumFunction(value)](./firestore_lite.md#sumfunction_f83680a) | (BETA) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +sum(Field.of("orderAmount")).as("totalRevenue"); + +``` + | +| [sumFunction(value)](./firestore_lite.md#sumfunction_7c807cd) | (BETA) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. +```typescript +// Calculate the total revenue from a set of orders +sum("orderAmount").as("totalRevenue"); + +``` + | | function(values, ...) | | [vector(values)](./firestore_lite.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | -## Classes +## Classes + +| Class | Description | +| --- | --- | +| [Add](./firestore_lite.add.md#add_class) | (BETA) | +| [AddFields](./firestore_lite.addfields.md#addfields_class) | (BETA) | +| [Aggregate](./firestore_lite.aggregate.md#aggregate_class) | (BETA) | +| [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | +| [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | +| [And](./firestore_lite.and.md#and_class) | (BETA) | +| [ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) | (BETA) | +| [ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) | (BETA) | +| [ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) | (BETA) | +| [ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) | (BETA) | +| [ArrayElement](./firestore_lite.arrayelement.md#arrayelement_class) | (BETA) | +| [ArrayLength](./firestore_lite.arraylength.md#arraylength_class) | (BETA) | +| [ArrayReverse](./firestore_lite.arrayreverse.md#arrayreverse_class) | (BETA) | +| [Avg](./firestore_lite.avg.md#avg_class) | (BETA) | +| [ByteLength](./firestore_lite.bytelength.md#bytelength_class) | (BETA) | +| [Bytes](./firestore_lite.bytes.md#bytes_class) | An immutable object representing an array of bytes. | +| [CharLength](./firestore_lite.charlength.md#charlength_class) | (BETA) | +| [CollectionGroupSource](./firestore_lite.collectiongroupsource.md#collectiongroupsource_class) | (BETA) | +| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | +| [CollectionSource](./firestore_lite.collectionsource.md#collectionsource_class) | (BETA) | +| [Constant](./firestore_lite.constant.md#constant_class) | (BETA) Represents a constant value that can be used in a Firestore pipeline expression.You can create a Constant instance using the static method: +```typescript +// Create a Constant instance for the number 10 +const ten = Constant.of(10); + +// Create a Constant instance for the string "hello" +const hello = Constant.of("hello"); + +``` + | +| [CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) | (BETA) | +| [Count](./firestore_lite.count.md#count_class) | (BETA) | +| [DatabaseSource](./firestore_lite.databasesource.md#databasesource_class) | (BETA) | +| [Distinct](./firestore_lite.distinct.md#distinct_class) | (BETA) | +| [Divide](./firestore_lite.divide.md#divide_class) | (BETA) | +| [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | +| [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | +| [DocumentsSource](./firestore_lite.documentssource.md#documentssource_class) | (BETA) | +| [DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) | (BETA) | +| [EndsWith](./firestore_lite.endswith.md#endswith_class) | (BETA) | +| [Eq](./firestore_lite.eq.md#eq_class) | (BETA) | +| [EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) | (BETA) | +| [Exists](./firestore_lite.exists.md#exists_class) | (BETA) | +| [ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class) | (BETA) | +| [Field](./firestore_lite.field.md#field_class) | (BETA) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage.

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.

You can create a Field instance using the static method: +```typescript +// Create a Field instance for the 'name' field +const nameField = Field.of("name"); + +// Create a Field instance for a nested field 'address.city' +const cityField = Field.of("address.city"); + +``` + | +| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | +| [Fields](./firestore_lite.fields.md#fields_class) | (BETA) | +| [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | +| [FindNearest](./firestore_lite.findnearest.md#findnearest_class) | (BETA) | +| [Firestore](./firestore_lite.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | +| [FirestoreError](./firestore_lite.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | +| [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) | (BETA) This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. | +| [GenericStage](./firestore_lite.genericstage.md#genericstage_class) | (BETA) | +| [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | +| [Gt](./firestore_lite.gt.md#gt_class) | (BETA) | +| [Gte](./firestore_lite.gte.md#gte_class) | (BETA) | +| [If](./firestore_lite.if.md#if_class) | (BETA) | +| [In](./firestore_lite.in.md#in_class) | (BETA) | +| [IsNan](./firestore_lite.isnan.md#isnan_class) | (BETA) | +| [Like](./firestore_lite.like.md#like_class) | (BETA) | +| [Limit](./firestore_lite.limit.md#limit_class) | (BETA) | +| [LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) | (BETA) | +| [LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) | (BETA) | +| [Lt](./firestore_lite.lt.md#lt_class) | (BETA) | +| [Lte](./firestore_lite.lte.md#lte_class) | (BETA) | +| [MapGet](./firestore_lite.mapget.md#mapget_class) | (BETA) | +| [Max](./firestore_lite.max.md#max_class) | (BETA) | +| [Min](./firestore_lite.min.md#min_class) | (BETA) | +| [Mod](./firestore_lite.mod.md#mod_class) | (BETA) | +| [Multiply](./firestore_lite.multiply.md#multiply_class) | (BETA) | +| [Neq](./firestore_lite.neq.md#neq_class) | (BETA) | +| [Not](./firestore_lite.not.md#not_class) | (BETA) | +| [Offset](./firestore_lite.offset.md#offset_class) | (BETA) | +| [Or](./firestore_lite.or.md#or_class) | (BETA) | +| [Ordering](./firestore_lite.ordering.md#ordering_class) | (BETA) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. | +| [Pipeline](./firestore_lite.pipeline.md#pipeline_class) | Base-class implementation | +| [PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class) | (BETA) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.

If the PipelineResult represents a non-document result, ref will return a undefined value. | +| [PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) | (BETA) Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). | +| [Query](./firestore_lite.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | +| [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | +| [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | +| [QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | +| [QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | +| [QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | +| [QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | +| [QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | +| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | +| [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | +| [RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) | (BETA) | +| [RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) | (BETA) | +| [ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) | (BETA) | +| [ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) | (BETA) | +| [Reverse](./firestore_lite.reverse.md#reverse_class) | (BETA) | +| [Select](./firestore_lite.select.md#select_class) | (BETA) | +| [Sort](./firestore_lite.sort.md#sort_class) | (BETA) | +| [StartsWith](./firestore_lite.startswith.md#startswith_class) | (BETA) | +| [StrConcat](./firestore_lite.strconcat.md#strconcat_class) | (BETA) | +| [StrContains](./firestore_lite.strcontains.md#strcontains_class) | (BETA) | +| [Subtract](./firestore_lite.subtract.md#subtract_class) | (BETA) | +| [Sum](./firestore_lite.sum.md#sum_class) | (BETA) | +| [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | +| [TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) | (BETA) | +| [TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) | (BETA) | +| [TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) | (BETA) | +| [TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) | (BETA) | +| [TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) | (BETA) | +| [ToLower](./firestore_lite.tolower.md#tolower_class) | (BETA) | +| [ToUpper](./firestore_lite.toupper.md#toupper_class) | (BETA) | +| [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | +| [Trim](./firestore_lite.trim.md#trim_class) | (BETA) | +| [UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) | (BETA) | +| [UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) | (BETA) | +| [UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) | (BETA) | +| [VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) | (BETA) | +| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [Where](./firestore_lite.where.md#where_class) | (BETA) | +| [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | +| [Xor](./firestore_lite.xor.md#xor_class) | (BETA) | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) | (BETA) An interface that represents an accumulator. | +| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | +| [DocumentData](./firestore_lite.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | +| [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) | (BETA) An interface that represents a filter condition. | +| [FindNearestOptions](./firestore_lite.findnearestoptions.md#findnearestoptions_interface) | (BETA) | +| [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | +| [Selectable](./firestore_lite.selectable.md#selectable_interface) | (BETA) An interface that represents a selectable expression. | +| [Settings](./firestore_lite.settings.md#settings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | +| [Stage](./firestore_lite.stage.md#stage_interface) | (BETA) | +| [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | + +## Namespaces + +| Namespace | Description | +| --- | --- | +| [and](./firestore_lite.and.md#and_namespace) | | +| [or](./firestore_lite.or.md#or_namespace) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [AccumulatorTarget](./firestore_lite.md#accumulatortarget) | (BETA) An accumulator target, which is an expression with an alias that also implements the Accumulator interface. | +| [AddPrefixToKeys](./firestore_lite.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | +| [AggregateFieldType](./firestore_lite.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | +| [AggregateSpecData](./firestore_lite.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | +| [AggregateType](./firestore_lite.md#aggregatetype) | Union type representing the aggregate type to be performed. | +| [ChildUpdateFields](./firestore_lite.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | +| [ExprType](./firestore_lite.md#exprtype) | (BETA) An enumeration of the different types of expressions. | +| [FilterExpr](./firestore_lite.md#filterexpr) | (BETA) A filter expression, which is an expression that also implements the FilterCondition interface. | +| [FirestoreErrorCode](./firestore_lite.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | +| [NestedUpdateFields](./firestore_lite.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | +| [OrderByDirection](./firestore_lite.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | +| [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | +| [Primitive](./firestore_lite.md#primitive) | Primitive types. | +| [QueryConstraintType](./firestore_lite.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | +| [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | +| [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | +| [SelectableExpr](./firestore_lite.md#selectableexpr) | (BETA) A selectable expression, which is an expression that also implements the Selectable interface. | +| [SetOptions](./firestore_lite.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | +| [UnionToIntersection](./firestore_lite.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | +| [UpdateData](./firestore_lite.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | +| [WhereFilterOp](./firestore_lite.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | +| [WithFieldValue](./firestore_lite.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | + +## function(app, ...) + +### getFirestore(app) {:#getfirestore_cf608e1} + +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(app: FirebaseApp): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | + +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### getFirestore(app, databaseId) {:#getfirestore_48de6cb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### initializeFirestore(app, settings) {:#initializefirestore_87c6318} + +Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). + +Signature: + +```typescript +export declare function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | +| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | + +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +A newly initialized `Firestore` instance. + +### initializeFirestore(app, settings, databaseId) {:#initializefirestore_37baaaf} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). + +Signature: + +```typescript +export declare function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | +| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +A newly initialized `Firestore` instance. + +## function(firestore, ...) + +### collection(firestore, path, pathSegments) {:#collection_1eb4c23} + +Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. + +Signature: + +```typescript +export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | + +Returns: + +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> + +The `CollectionReference` instance. + +#### Exceptions + +If the final path has an even number of segments and does not point to a collection. + +### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} + +Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. + +Signature: + +```typescript +export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | + +Returns: + +[Query](./firestore_lite.query.md#query_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> + +The created `Query`. + +### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} + +Modify this instance to communicate with the Cloud Firestore emulator. + +Note: This must be called before this instance has been used to do any operations. + +Signature: + +```typescript +export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { + mockUserToken?: EmulatorMockTokenOptions | string; +}): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | +| host | string | the emulator host (ex: localhost). | +| port | number | the emulator port (ex: 9000). | +| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | + +Returns: + +void + +### doc(firestore, path, pathSegments) {:#doc_1eb4c23} + +Gets a `DocumentReference` instance that refers to the document at the specified absolute path. + +Signature: + +```typescript +export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | + +Returns: + +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> + +The `DocumentReference` instance. + +#### Exceptions + +If the final path has an odd number of segments and does not point to a document. + +### pipeline(firestore) {:#pipeline_231a8e0} + +Experimental Modular API for console testing. + +Signature: + +```typescript +export declare function pipeline(firestore: Firestore): PipelineSource; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | + +Returns: + +[PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) + +### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} + +Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. + +The maximum number of writes allowed in a single transaction is 500. + +Signature: + +```typescript +export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | +| updateFunction | (transaction: [Transaction](./firestore_lite.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | +| options | [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | + +Returns: + +Promise<T> + +If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. + +### terminate(firestore) {:#terminate_231a8e0} + +Terminates the provided `Firestore` instance. + +After calling `terminate()` only the `clearIndexedDbPersistence()` functions may be used. Any other function will throw a `FirestoreError`. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. + +To restart after termination, create a new instance of `Firestore` with [getFirestore()](./firestore_.md#getfirestore). + +Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. + +Signature: + +```typescript +export declare function terminate(firestore: Firestore): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to terminate. | + +Returns: + +Promise<void> + +A `Promise` that is resolved when the instance has been successfully terminated. + +### writeBatch(firestore) {:#writebatch_231a8e0} + +Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500. + +The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. + +Signature: + +```typescript +export declare function writeBatch(firestore: Firestore): WriteBatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | + +Returns: + +[WriteBatch](./firestore_lite.writebatch.md#writebatch_class) + +A `WriteBatch` that can be used to atomically execute multiple writes. + +## function() + +### count() {:#count} + +Create an AggregateField object that can be used to compute the count of documents in the result set of a query. + +Signature: + +```typescript +export declare function count(): AggregateField; +``` +Returns: + +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> + +### countAll() {:#countall} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an aggregation that counts the total number of stage inputs. + +```typescript +// Count the total number of users +countAll().as("totalUsers"); + +``` + A new representing the 'countAll' aggregation. + +Signature: + +```typescript +export declare function countAll(): Count; +``` +Returns: + +[Count](./firestore_lite.count.md#count_class) + +### deleteField() {:#deletefield} + +Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. + +Signature: + +```typescript +export declare function deleteField(): FieldValue; +``` +Returns: + +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) + +### documentId() {:#documentid} + +Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. + +Signature: + +```typescript +export declare function documentId(): FieldPath; +``` +Returns: + +[FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) + +### getFirestore() {:#getfirestore} + +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(): Firestore; +``` +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### serverTimestamp() {:#servertimestamp} + +Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. + +Signature: + +```typescript +export declare function serverTimestamp(): FieldValue; +``` +Returns: + +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) + +### useFirestorePipelines() {:#usefirestorepipelines} + +Signature: + +```typescript +export declare function useFirestorePipelines(): void; +``` +Returns: + +void + +## function(array, ...) + +### arrayConcat(array, elements) {:#arrayconcat_0b3ddb9} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with other arrays. + +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to concatenate to. | +| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_21991c1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates an array expression with other arrays and/or values. + +```typescript +// Combine the 'tags' array with a new array +arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: Constant, elements: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to concatenate to. | +| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_f8d5d5e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates a field's array value with other arrays. + +```typescript +// Combine the 'items' array with two new item arrays +arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: string, elements: Constant[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name containing array values. | +| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +### arrayConcat(array, elements) {:#arrayconcat_5a66d99} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates a field's array value with other arrays and/or values. + +```typescript +// Combine the 'tags' array with a new array +arrayConcat("tags", ["newTag1", "newTag2"]); + +``` + +Signature: + +```typescript +export declare function arrayConcat(array: string, elements: any[]): ArrayConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name containing array values. | +| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | + +Returns: + +[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) + +### arrayContains(array, element) {:#arraycontains_01ea7c0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains a specific element. + +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains(Field.of("colors"), Field.of("selectedColor")); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: Constant, element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_60f8f2f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains a specific element. + +```typescript +// Check if the 'colors' array contains "red" +arrayContains(Field.of("colors"), "red"); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: Constant, element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_0ebdbfe} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains a specific element. + +```typescript +// Check if the 'colors' array contains the value of field 'selectedColor' +arrayContains("colors", Field.of("selectedColor")); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: string, element: Constant): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +### arrayContains(array, element) {:#arraycontains_8f718df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains a specific value. + +```typescript +// Check if the 'colors' array contains "red" +arrayContains("colors", "red"); + +``` + +Signature: + +```typescript +export declare function arrayContains(array: string, element: any): ArrayContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | + +Returns: + +[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_7b7433a} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_d919466} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains all the specified elements. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" +arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_b40e2df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains all the specified values or expressions. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAll(array, values) {:#arraycontainsall_b08efbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains all the specified values or expressions. + +```typescript +// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" +arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | + +Returns: + +[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_7b7433a} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_d919466} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an array expression contains any of the specified elements. + +```typescript +// Check if the 'categories' array contains either values from field "cate1" or "Science" +arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_b40e2df} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +### arrayContainsAny(array, values) {:#arraycontainsany_b08efbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's array value contains any of the specified elements. + +```typescript +// Check if the 'groups' array contains either the value from the 'userGroup' field +// or the value "guest" +arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + +``` + +Signature: + +```typescript +export declare function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | string | The field name to check. | +| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | + +Returns: + +[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) + +### arrayLength(array) {:#arraylength_0bb5dbb} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of an array expression. + +```typescript +// Get the number of items in the 'cart' array +arrayLength(Field.of("cart")); + +``` + +Signature: + +```typescript +export declare function arrayLength(array: Constant): ArrayLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to calculate the length of. A new representing the length of the array. | + +Returns: + +[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) + +## function(condition, ...) + +### ifFunction(condition, thenExpr, elseExpr) {:#iffunction_f7b2404} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. + +```typescript +// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". +ifFunction( + gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + +``` + +Signature: + +```typescript +export declare function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterExpr](./firestore_lite.md#filterexpr) | The condition to evaluate. | +| thenExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to evaluate if the condition is true. | +| elseExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. | + +Returns: + +[If](./firestore_lite.if.md#if_class) + +## function(databaseId, ...) + +### getFirestore(databaseId) {:#getfirestore_53dc891} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. + +Signature: + +```typescript +export declare function getFirestore(databaseId: string): Firestore; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| databaseId | string | The name of the database. | + +Returns: + +[Firestore](./firestore_lite.firestore.md#firestore_class) + +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +## function(element, ...) + +### inAny(element, others) {:#inany_a73b259} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: Constant, others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +### inAny(element, others) {:#inany_f5721c6} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: Constant, others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +### inAny(element, others) {:#inany_c6646ea} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: string, others: Constant[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field to compare. | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +### inAny(element, others) {:#inany_e6877aa} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to any of the provided values or expressions. + +```typescript +// Check if the 'category' field is either "Electronics" or value of field 'primaryType' +inAny("category", ["Electronics", Field.of("primaryType")]); + +``` + +Signature: + +```typescript +export declare function inAny(element: string, others: any[]): In; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field to compare. | +| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | + +Returns: + +[In](./firestore_lite.in.md#in_class) + +### notInAny(element, others) {:#notinany_a73b259} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: Constant, others: Constant[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_lite.not.md#not_class) + +### notInAny(element, others) {:#notinany_f5721c6} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: Constant, others: any[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_lite.not.md#not_class) + +### notInAny(element, others) {:#notinany_c6646ea} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: string, others: Constant[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field name to compare. | +| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_lite.not.md#not_class) + +### notInAny(element, others) {:#notinany_e6877aa} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. + +```typescript +// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' +notInAny("status", ["pending", Field.of("rejectedStatus")]); + +``` + +Signature: + +```typescript +export declare function notInAny(element: string, others: any[]): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| element | string | The field name to compare. | +| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | + +Returns: + +[Not](./firestore_lite.not.md#not_class) + +## function(elements, ...) + +### arrayRemove(elements) {:#arrayremove_7d853aa} + +Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. + +Signature: + +```typescript +export declare function arrayRemove(...elements: unknown[]): FieldValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | unknown\[\] | The elements to remove from the array. | + +Returns: + +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) + +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` + +### arrayUnion(elements) {:#arrayunion_7d853aa} + +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. + +Signature: + +```typescript +export declare function arrayUnion(...elements: unknown[]): FieldValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| elements | unknown\[\] | The elements to union into the array. | + +Returns: + +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) + +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. + +## function(expr, ...) + +### ascending(expr) {:#ascending_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. + +```typescript +// Sort documents by the 'name' field in ascending order +firestore.pipeline().collection("users") + .sort(ascending(Field.of("name"))); + +``` + +Signature: + +```typescript +export declare function ascending(expr: Constant): Ordering; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to create an ascending ordering for. A new Ordering for ascending sorting. | + +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +### byteLength(expr) {:#bytelength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. + +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength(Field.of("myString")); + +``` + +Signature: + +```typescript +export declare function byteLength(expr: Constant): ByteLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string. A new representing the length of the string in bytes. | + +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +### charLength(expr) {:#charlength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string expression in UTF-8. + +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength(Field.of("name")); + +``` + +Signature: + +```typescript +export declare function charLength(expr: Constant): CharLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to calculate the length of. A new representing the length of the string. | + +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +### cosineDistance(expr, other) {:#cosinedistance_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a double array. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a VectorValue. + +```typescript +// Calculate the Cosine distance between the 'location' field and a target location +cosineDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a field's vector value and a vector expression. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance("userVector", Field.of("itemVector")); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: string, other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a vector expression and a double array. + +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: number[]): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between a vector expression and a VectorValue. + +```typescript +// Calculate the cosine distance between the 'location' field and a target location +cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### cosineDistance(expr, other) {:#cosinedistance_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Cosine distance between two vector expressions. + +```typescript +// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field +cosineDistance(Field.of("userVector"), Field.of("itemVector")); + +``` + +Signature: + +```typescript +export declare function cosineDistance(expr: Constant, other: Constant): CosineDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | + +Returns: + +[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) + +### descending(expr) {:#descending_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. + +```typescript +// Sort documents by the 'createdAt' field in descending order +firestore.pipeline().collection("users") + .sort(descending(Field.of("createdAt"))); + +``` + +Signature: + +```typescript +export declare function descending(expr: Constant): Ordering; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. | + +Returns: + +[Ordering](./firestore_lite.ordering.md#ordering_class) + +### dotProduct(expr, other) {:#dotproduct_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a double array. + +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", [0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a VectorValue. + +```typescript +// Calculate the dot product distance between a feature vector and a target vector +dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a field's vector value and a vector expression. + +```typescript +// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' +dotProduct("docVector1", Field.of("docVector2")); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: string, other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a vector expression and a double array. + +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: number[]): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between a vector expression and a VectorValue. + +```typescript +// Calculate the dot product between a feature vector and a target vector +dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: VectorValue): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### dotProduct(expr, other) {:#dotproduct_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the dot product between two vector expressions. + +```typescript +// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' +dotProduct(Field.of("docVector1"), Field.of("docVector2")); + +``` + +Signature: + +```typescript +export declare function dotProduct(expr: Constant, other: Constant): DotProduct; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | + +Returns: + +[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) + +### endsWith(expr, suffix) {:#endswith_88569cd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value ends with a given postfix. + +```typescript +// Check if the 'filename' field ends with ".txt" +endsWith("filename", ".txt"); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: string, suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_e2e794e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value ends with a given postfix. + +```typescript +// Check if the 'url' field ends with the value of the 'extension' field +endsWith("url", Field.of("extension")); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: string, suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the postfix. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_6308b81} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression ends with a given postfix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), "Jr."); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: Constant, suffix: string): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | +| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +### endsWith(expr, suffix) {:#endswith_ab1cc39} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression ends with a given postfix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." +endsWith(Field.of("fullName"), Constant.of("Jr.")); + +``` + +Signature: + +```typescript +export declare function endsWith(expr: Constant, suffix: Constant): EndsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | +| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix to check for. A new representing the 'ends with' comparison. | + +Returns: + +[EndsWith](./firestore_lite.endswith.md#endswith_class) + +### euclideanDistance(expr, other) {:#euclideandistance_b4c7dc2} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a double array. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_8d2bd9d} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a VectorValue. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance("location", new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_c9ae0bc} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a field's vector value and a vector expression. + +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance("pointA", Field.of("pointB")); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: string, other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the first vector. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_e701952} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a vector expression and a double array. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location + +euclideanDistance(Field.of("location"), [37.7749, -122.4194]); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_cc2e83e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between a vector expression and a VectorValue. + +```typescript +// Calculate the Euclidean distance between the 'location' field and a target location +euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### euclideanDistance(expr, other) {:#euclideandistance_0896fbd} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Calculates the Euclidean distance between two vector expressions. + +```typescript +// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' +euclideanDistance(Field.of("pointA"), Field.of("pointB")); + +``` + +Signature: + +```typescript +export declare function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | +| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | + +Returns: + +[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) + +### reverse(expr) {:#reverse_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses a string. + +```typescript +// Reverse the value of the 'myString' field. +reverse(Field.of("myString")); + +``` + +Signature: + +```typescript +export declare function reverse(expr: Constant): Reverse; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to reverse. A new representing the reversed string. | + +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +### startsWith(expr, prefix) {:#startswith_484d9f3} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value starts with a given prefix. + +```typescript +// Check if the 'name' field starts with "Mr." +startsWith("name", "Mr."); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: string, prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_7deb5c7} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value starts with a given prefix. + +```typescript +// Check if the 'fullName' field starts with the value of the 'firstName' field +startsWith("fullName", Field.of("firstName")); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: string, prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The field name to check. | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the prefix. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_68300d1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression starts with a given prefix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), "Mr."); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: Constant, prefix: string): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | +| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +### startsWith(expr, prefix) {:#startswith_5774b68} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression starts with a given prefix. + +```typescript +// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." +startsWith(Field.of("fullName"), Field.of("prefix")); + +``` + +Signature: + +```typescript +export declare function startsWith(expr: Constant, prefix: Constant): StartsWith; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix to check for. A new representing the 'starts with' comparison. | + +Returns: + +[StartsWith](./firestore_lite.startswith.md#startswith_class) + +### timestampToUnixMicros(expr) {:#timestamptounixmicros_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. | + +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +### timestampToUnixMillis(expr) {:#timestamptounixmillis_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. | + +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +### timestampToUnixSeconds(expr) {:#timestamptounixseconds_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds(Field.of("timestamp")); + +``` + +Signature: + +```typescript +export declare function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. | + +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +### toLower(expr) {:#tolower_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string field to lowercase. + +```typescript +// Convert the 'name' field to lowercase +toLower("name"); + +``` + +Signature: + +```typescript +export declare function toLower(expr: string): ToLower; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the lowercase string. | + +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +### toLower(expr) {:#tolower_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string expression to lowercase. + +```typescript +// Convert the 'name' field to lowercase +toLower(Field.of("name")); + +``` + +Signature: + +```typescript +export declare function toLower(expr: Constant): ToLower; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to convert to lowercase. A new representing the lowercase string. | + +Returns: + +[ToLower](./firestore_lite.tolower.md#tolower_class) + +### toUpper(expr) {:#toupper_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string field to uppercase. + +```typescript +// Convert the 'title' field to uppercase +toUpper("title"); + +``` + +Signature: + +```typescript +export declare function toUpper(expr: string): ToUpper; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the uppercase string. | + +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +### toUpper(expr) {:#toupper_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a string expression to uppercase. + +```typescript +// Convert the 'title' field to uppercase +toUppercase(Field.of("title")); + +``` + +Signature: + +```typescript +export declare function toUpper(expr: Constant): ToUpper; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to convert to uppercase. A new representing the uppercase string. | + +Returns: + +[ToUpper](./firestore_lite.toupper.md#toupper_class) + +### trim(expr) {:#trim_1e536ed} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string field. + +```typescript +// Trim whitespace from the 'userInput' field +trim("userInput"); + +``` + +Signature: + +```typescript +export declare function trim(expr: string): Trim; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | string | The name of the field containing the string. A new representing the trimmed string. | + +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +### trim(expr) {:#trim_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that removes leading and trailing whitespace from a string expression. + +```typescript +// Trim whitespace from the 'userInput' field +trim(Field.of("userInput")); + +``` + +Signature: + +```typescript +export declare function trim(expr: Constant): Trim; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to trim. A new representing the trimmed string. | + +Returns: + +[Trim](./firestore_lite.trim.md#trim_class) + +### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp(Field.of("microseconds")); + +``` + +Signature: + +```typescript +export declare function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp(Field.of("milliseconds")); + +``` + +Signature: + +```typescript +export declare function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp(Field.of("seconds")); + +``` + +Signature: + +```typescript +export declare function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +### vectorLength(expr) {:#vectorlength_f3fb767} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a Firestore Vector. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength(Field.of("embedding")); + +``` + +Signature: + +```typescript +export declare function vectorLength(expr: Constant): VectorLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the Firestore Vector. A new representing the length of the array. | + +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + +## function(field, ...) + +### average(field) {:#average_aacc3a9} + +Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. + +Signature: + +```typescript +export declare function average(field: string | FieldPath): AggregateField; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | + +Returns: + +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number \| null> + +### byteLength(field) {:#bytelength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. + +```typescript +// Calculate the length of the 'myString' field in bytes. +byteLength("myString"); + +``` + +Signature: + +```typescript +export declare function byteLength(field: string): ByteLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string. A new representing the length of the string in bytes. | + +Returns: + +[ByteLength](./firestore_lite.bytelength.md#bytelength_class) + +### charLength(field) {:#charlength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the character length of a string field in UTF8. + +```typescript +// Get the character length of the 'name' field in UTF-8. +strLength("name"); + +``` + +Signature: + +```typescript +export declare function charLength(field: string): CharLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field containing the string. A new representing the length of the string. | + +Returns: + +[CharLength](./firestore_lite.charlength.md#charlength_class) + +### exists(field) {:#exists_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field exists. + +```typescript +// Check if the document has a field named "phoneNumber" +exists("phoneNumber"); + +``` + +Signature: + +```typescript +export declare function exists(field: string): Exists; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The field name to check. A new representing the 'exists' check. | + +Returns: + +[Exists](./firestore_lite.exists.md#exists_class) + +### replaceAll(field, find, replace) {:#replaceall_b257ab0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. + +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll("message", "hello", "hi"); + +``` + +Signature: + +```typescript +export declare function replaceAll(field: string, find: string, replace: string): ReplaceAll; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | + +Returns: + +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) + +### replaceFirst(field, find, replace) {:#replacefirst_b257ab0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. + +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst("message", "hello", "hi"); + +``` + +Signature: + +```typescript +export declare function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | + +Returns: + +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) + +### reverse(field) {:#reverse_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that reverses a string represented by a field. + +```typescript +// Reverse the value of the 'myString' field. +reverse("myString"); + +``` + +Signature: + +```typescript +export declare function reverse(field: string): Reverse; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the string to reverse. A new representing the reversed string. | + +Returns: + +[Reverse](./firestore_lite.reverse.md#reverse_class) + +### sum(field) {:#sum_aacc3a9} + +Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. + +Signature: + +```typescript +export declare function sum(field: string | FieldPath): AggregateField; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | + +Returns: + +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> + +### timestampAdd(field, unit, amount) {:#timestampadd_565792c} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to a timestamp represented by a field. + +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd("timestamp", "day", 1); + +``` + +Signature: + +```typescript +export declare function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | + +Returns: + +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) + +### timestampSub(field, unit, amount) {:#timestampsub_565792c} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. + +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub("timestamp", "day", 1); + +``` + +Signature: + +```typescript +export declare function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | + +Returns: + +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) + +### timestampToUnixMicros(field) {:#timestamptounixmicros_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to microseconds since epoch. +timestampToUnixMicros("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMicros(field: string): TimestampToUnixMicros; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. | + +Returns: + +[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) + +### timestampToUnixMillis(field) {:#timestamptounixmillis_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to milliseconds since epoch. +timestampToUnixMillis("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixMillis(field: string): TimestampToUnixMillis; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. | + +Returns: + +[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) + +### timestampToUnixSeconds(field) {:#timestamptounixseconds_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). + +```typescript +// Convert the 'timestamp' field to seconds since epoch. +timestampToUnixSeconds("timestamp"); + +``` + +Signature: + +```typescript +export declare function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. | + +Returns: + +[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) + +### unixMicrosToTimestamp(field) {:#unixmicrostotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'microseconds' field as microseconds since epoch. +unixMicrosToTimestamp("microseconds"); + +``` + +Signature: + +```typescript +export declare function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) + +### unixMillisToTimestamp(field) {:#unixmillistotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'milliseconds' field as milliseconds since epoch. +unixMillisToTimestamp("milliseconds"); + +``` + +Signature: + +```typescript +export declare function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) + +### unixSecondsToTimestamp(field) {:#unixsecondstotimestamp_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. + +```typescript +// Interpret the 'seconds' field as seconds since epoch. +unixSecondsToTimestamp("seconds"); + +``` + +Signature: + +```typescript +export declare function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. | + +Returns: + +[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) + +### vectorLength(field) {:#vectorlength_0fb8cd4} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the length of a Firestore Vector represented by a field. + +```typescript +// Get the vector length (dimension) of the field 'embedding'. +vectorLength("embedding"); + +``` + +Signature: + +```typescript +export declare function vectorLength(field: string): VectorLength; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | string | The name of the field representing the Firestore Vector. A new representing the length of the array. | + +Returns: + +[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) + +## function(fieldPath, ...) + +### orderBy(fieldPath, directionStr) {:#orderby_006d61f} + +Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. + +Note: Documents that do not contain the specified field will not be present in the query result. + +Signature: + +```typescript +export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The field to sort by. | +| directionStr | [OrderByDirection](./firestore_lite.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | + +Returns: + +[QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) + +The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). + +### where(fieldPath, opStr, value) {:#where_0fae4bf} + +Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. + +Signature: + +```typescript +export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The path to compare | +| opStr | [WhereFilterOp](./firestore_lite.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | +| value | unknown | The value for comparison | + +Returns: + +[QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) + +The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). + +## function(fieldValues, ...) + +### endAt(fieldValues) {:#endat_8b2f2c8} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | + +Returns: + +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) + +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` + +### endBefore(fieldValues) {:#endbefore_8b2f2c8} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | + +Returns: + +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) + +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` + +### startAfter(fieldValues) {:#startafter_8b2f2c8} + +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | + +Returns: + +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` + +### startAt(fieldValues) {:#startat_8b2f2c8} + +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. + +Signature: + +```typescript +export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | + +Returns: + +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. + +## function(filter, ...) + +### not(filter) {:#not_5520849} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that negates a filter condition. + +```typescript +// Find documents where the 'completed' field is NOT true +not(eq("completed", true)); + +``` + +Signature: + +```typescript +export declare function not(filter: FilterExpr): Not; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filter | [FilterExpr](./firestore_lite.md#filterexpr) | The filter condition to negate. A new representing the negated filter condition. | + +Returns: + +[Not](./firestore_lite.not.md#not_class) + +## function(first, ...) + +### strConcat(first, elements) {:#strconcat_0f1bdbf} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string functions, fields or constants together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat("firstName", " ", Field.of("lastName")); + +``` + +Signature: + +```typescript +export declare function strConcat(first: string, ...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | string | The field name containing the initial string value. | +| elements | Array<[Constant](./firestore_lite.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +### strConcat(first, elements) {:#strconcat_1eb0ac1} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that concatenates string expressions together. + +```typescript +// Combine the 'firstName', " ", and 'lastName' fields into a single string +strConcat(Field.of("firstName"), " ", Field.of("lastName")); + +``` + +Signature: + +```typescript +export declare function strConcat(first: Constant, ...elements: Array): StrConcat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | [Constant](./firestore_lite.constant.md#constant_class) | The initial string expression to concatenate to. | +| elements | Array<[Constant](./firestore_lite.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | + +Returns: + +[StrConcat](./firestore_lite.strconcat.md#strconcat_class) + +## function(left, ...) + +### add(left, right) {:#add_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds two expressions together. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add(Field.of("quantity"), Field.of("reserve")); + +``` + +Signature: + +```typescript +export declare function add(left: Constant, right: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to add. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +### add(left, right) {:#add_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds an expression to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +add(Field.of("age"), 5); + +``` + +Signature: + +```typescript +export declare function add(left: Constant, right: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to. | +| right | any | The constant value to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +### add(left, right) {:#add_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a field's value to an expression. + +```typescript +// Add the value of the 'quantity' field and the 'reserve' field. +add("quantity", Field.of("reserve")); + +``` + +Signature: + +```typescript +export declare function add(left: string, right: Constant): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to add to. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +### add(left, right) {:#add_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a field's value to a constant value. + +```typescript +// Add 5 to the value of the 'age' field +add("age", 5); + +``` + +Signature: + +```typescript +export declare function add(left: string, right: any): Add; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to add to. | +| right | any | The constant value to add. A new representing the addition operation. | + +Returns: + +[Add](./firestore_lite.add.md#add_class) + +### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} + +Compares two 'AggregateField\` instances for equality. + +Signature: + +```typescript +export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | +| right | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | + +Returns: + +boolean + +### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} + +Compares two `AggregateQuerySnapshot` instances for equality. + +Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. + +Signature: + +```typescript +export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | +| right | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | + +Returns: + +boolean + +`true` if the objects are "equal", as defined above, or `false` otherwise. + +### and(left, right) {:#and_eba7e36} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a logical 'AND' operation on multiple filter conditions. + +```typescript +// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND +// the 'status' field is "active" +const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + +Signature: + +```typescript +export declare function and(left: FilterExpr, ...right: FilterExpr[]): And; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. | + +Returns: + +[And](./firestore_lite.and.md#and_class) + +### divide(left, right) {:#divide_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides two expressions. + +```typescript +// Divide the 'total' field by the 'count' field +divide(Field.of("total"), Field.of("count")); + +``` + +Signature: + +```typescript +export declare function divide(left: Constant, right: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to be divided. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +### divide(left, right) {:#divide_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides an expression by a constant value. + +```typescript +// Divide the 'value' field by 10 +divide(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function divide(left: Constant, right: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to be divided. | +| right | any | The constant value to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +### divide(left, right) {:#divide_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides a field's value by an expression. + +```typescript +// Divide the 'total' field by the 'count' field +divide("total", Field.of("count")); + +``` + +Signature: + +```typescript +export declare function divide(left: string, right: Constant): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to be divided. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +### divide(left, right) {:#divide_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that divides a field's value by a constant value. + +```typescript +// Divide the 'value' field by 10 +divide("value", 10); + +``` + +Signature: + +```typescript +export declare function divide(left: string, right: any): Divide; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to be divided. | +| right | any | The constant value to divide by. A new representing the division operation. | + +Returns: + +[Divide](./firestore_lite.divide.md#divide_class) + +### eq(left, right) {:#eq_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if two expressions are equal. + +```typescript +// Check if the 'age' field is equal to an expression +eq(Field.of("age"), Field.of("minAge").add(10)); + +``` + +Signature: + +```typescript +export declare function eq(left: Constant, right: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +### eq(left, right) {:#eq_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is equal to a constant value. + +```typescript +// Check if the 'age' field is equal to 21 +eq(Field.of("age"), 21); + +``` + +Signature: + +```typescript +export declare function eq(left: Constant, right: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +### eq(left, right) {:#eq_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to an expression. + +```typescript +// Check if the 'age' field is equal to the 'limit' field +eq("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function eq(left: string, right: Constant): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +### eq(left, right) {:#eq_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is equal to a constant value. + +```typescript +// Check if the 'city' field is equal to string constant "London" +eq("city", "London"); + +``` + +Signature: + +```typescript +export declare function eq(left: string, right: any): Eq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the equality comparison. | + +Returns: + +[Eq](./firestore_lite.eq.md#eq_class) + +### gt(left, right) {:#gt_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is greater than the second expression. + +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), Constant(9).add(9)); + +``` + +Signature: + +```typescript +export declare function gt(left: Constant, right: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +### gt(left, right) {:#gt_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is greater than a constant value. + +```typescript +// Check if the 'age' field is greater than 18 +gt(Field.of("age"), 18); + +``` + +Signature: + +```typescript +export declare function gt(left: Constant, right: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +### gt(left, right) {:#gt_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than an expression. + +```typescript +// Check if the value of field 'age' is greater than the value of field 'limit' +gt("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function gt(left: string, right: Constant): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +### gt(left, right) {:#gt_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than a constant value. + +```typescript +// Check if the 'price' field is greater than 100 +gt("price", 100); + +``` + +Signature: + +```typescript +export declare function gt(left: string, right: any): Gt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | + +Returns: + +[Gt](./firestore_lite.gt.md#gt_class) + +### gte(left, right) {:#gte_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is greater than or equal to the second expression. + +```typescript +// Check if the 'quantity' field is greater than or equal to the field "threshold" +gte(Field.of("quantity"), Field.of("threshold")); + +``` + +Signature: + +```typescript +export declare function gte(left: Constant, right: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +### gte(left, right) {:#gte_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is greater than or equal to a constant value. + +```typescript +// Check if the 'quantity' field is greater than or equal to 10 +gte(Field.of("quantity"), 10); + +``` + +Signature: + +```typescript +export declare function gte(left: Constant, right: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +### gte(left, right) {:#gte_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than or equal to an expression. + +```typescript +// Check if the value of field 'age' is greater than or equal to the value of field 'limit' +gte("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function gte(left: string, right: Constant): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +### gte(left, right) {:#gte_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is greater than or equal to a constant value. + +```typescript +// Check if the 'score' field is greater than or equal to 80 +gte("score", 80); + +``` + +Signature: + +```typescript +export declare function gte(left: string, right: any): Gte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | + +Returns: + +[Gte](./firestore_lite.gte.md#gte_class) + +### like(left, pattern) {:#like_33ec01b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison against a field. + +```typescript +// Check if the 'title' field contains the string "guide" +like("title", "%guide%"); + +``` + +Signature: + +```typescript +export declare function like(left: string, pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +### like(left, pattern) {:#like_dd84184} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison against a field. + +```typescript +// Check if the 'title' field contains the string "guide" +like("title", Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function like(left: string, pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +### like(left, pattern) {:#like_3aaffe0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison. + +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), "%guide%"); + +``` + +Signature: + +```typescript +export declare function like(left: Constant, pattern: string): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +### like(left, pattern) {:#like_a2c3e8b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a case-sensitive wildcard string comparison. + +```typescript +// Check if the 'title' field contains the string "guide" +like(Field.of("title"), Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function like(left: Constant, pattern: Constant): Like; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | + +Returns: + +[Like](./firestore_lite.like.md#like_class) + +### logicalMax(left, right) {:#logicalmax_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: Constant, right: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: Constant, right: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | +| right | any | The right operand constant. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'field1' field and the 'field2' field. +logicalMax("field1", Field.of('field2')); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: string, right: Constant): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +### logicalMax(left, right) {:#logicalmax_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the larger value between the 'value' field and 10. +logicalMax("value", 10); + +``` + +Signature: + +```typescript +export declare function logicalMax(left: string, right: any): LogicalMax; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | any | The right operand constant. A new representing the logical max operation. | + +Returns: + +[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) + +### logicalMin(left, right) {:#logicalmin_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: Constant, right: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin(Field.of("value"), 10); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: Constant, right: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | +| right | any | The right operand constant. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'field1' field and the 'field2' field. +logicalMin("field1", Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: string, right: Constant): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +### logicalMin(left, right) {:#logicalmin_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. + +```typescript +// Returns the smaller value between the 'value' field and 10. +logicalMin("value", 10); + +``` + +Signature: + +```typescript +export declare function logicalMin(left: string, right: any): LogicalMin; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The left operand field name. | +| right | any | The right operand constant. A new representing the logical min operation. | + +Returns: + +[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) + +### lt(left, right) {:#lt_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is less than the second expression. + +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lt(left: Constant, right: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +### lt(left, right) {:#lt_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is less than a constant value. + +```typescript +// Check if the 'age' field is less than 30 +lt(Field.of("age"), 30); + +``` + +Signature: + +```typescript +export declare function lt(left: Constant, right: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +### lt(left, right) {:#lt_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than an expression. + +```typescript +// Check if the 'age' field is less than the 'limit' field +lt("age", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lt(left: string, right: Constant): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +### lt(left, right) {:#lt_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than a constant value. + +```typescript +// Check if the 'price' field is less than 50 +lt("price", 50); + +``` + +Signature: + +```typescript +export declare function lt(left: string, right: any): Lt; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than comparison. | + +Returns: + +[Lt](./firestore_lite.lt.md#lt_class) + +### lte(left, right) {:#lte_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if the first expression is less than or equal to the second expression. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lte(left: Constant, right: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +### lte(left, right) {:#lte_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is less than or equal to a constant value. + +```typescript +// Check if the 'quantity' field is less than or equal to 20 +lte(Field.of("quantity"), 20); + +``` + +Signature: + +```typescript +export declare function lte(left: Constant, right: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +### lte(left, right) {:#lte_674c63f} + +Creates an expression that checks if a field's value is less than or equal to an expression. + +```typescript +// Check if the 'quantity' field is less than or equal to the 'limit' field +lte("quantity", Field.of("limit")); + +``` + +Signature: + +```typescript +export declare function lte(left: string, right: Constant): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +### lte(left, right) {:#lte_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is less than or equal to a constant value. + +```typescript +// Check if the 'score' field is less than or equal to 70 +lte("score", 70); + +``` + +Signature: + +```typescript +export declare function lte(left: string, right: any): Lte; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | + +Returns: + +[Lte](./firestore_lite.lte.md#lte_class) + +### mod(left, right) {:#mod_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing two expressions. + +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod(Field.of("field1"), Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function mod(left: Constant, right: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The dividend expression. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +### mod(left, right) {:#mod_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. + +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod(Field.of("field1"), 5); + +``` + +Signature: + +```typescript +export declare function mod(left: Constant, right: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The dividend expression. | +| right | any | The divisor constant. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +### mod(left, right) {:#mod_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. + +```typescript +// Calculate the remainder of dividing 'field1' by 'field2'. +mod("field1", Field.of("field2")); + +``` + +Signature: + +```typescript +export declare function mod(left: string, right: Constant): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The dividend field name. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +### mod(left, right) {:#mod_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. + +```typescript +// Calculate the remainder of dividing 'field1' by 5. +mod("field1", 5); + +``` + +Signature: + +```typescript +export declare function mod(left: string, right: any): Mod; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The dividend field name. | +| right | any | The divisor constant. A new representing the modulo operation. | + +Returns: + +[Mod](./firestore_lite.mod.md#mod_class) + +### multiply(left, right) {:#multiply_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies two expressions together. + +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply(Field.of("quantity"), Field.of("price")); + +``` + +Signature: + +```typescript +export declare function multiply(left: Constant, right: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to multiply. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to multiply. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies an expression by a constant value. + +```typescript +// Multiply the value of the 'price' field by 2 +multiply(Field.of("price"), 2); + +``` + +Signature: + +```typescript +export declare function multiply(left: Constant, right: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply. | +| right | any | The constant value to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies a field's value by an expression. + +```typescript +// Multiply the 'quantity' field by the 'price' field +multiply("quantity", Field.of("price")); + +``` + +Signature: + +```typescript +export declare function multiply(left: string, right: Constant): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to multiply. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +### multiply(left, right) {:#multiply_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that multiplies a field's value by a constant value. + +```typescript +// Multiply the 'value' field by 2 +multiply("value", 2); + +``` + +Signature: + +```typescript +export declare function multiply(left: string, right: any): Multiply; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to multiply. | +| right | any | The constant value to multiply by. A new representing the multiplication operation. | + +Returns: + +[Multiply](./firestore_lite.multiply.md#multiply_class) + +### neq(left, right) {:#neq_be96f75} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if two expressions are not equal. + +```typescript +// Check if the 'status' field is not equal to field 'finalState' +neq(Field.of("status"), Field.of("finalState")); + +``` + +Signature: + +```typescript +export declare function neq(left: Constant, right: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +### neq(left, right) {:#neq_010ba9e} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if an expression is not equal to a constant value. + +```typescript +// Check if the 'status' field is not equal to "completed" +neq(Field.of("status"), "completed"); + +``` + +Signature: + +```typescript +export declare function neq(left: Constant, right: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | +| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +### neq(left, right) {:#neq_674c63f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to an expression. + +```typescript +// Check if the 'status' field is not equal to the value of 'expectedStatus' +neq("status", Field.of("expectedStatus")); + +``` + +Signature: + +```typescript +export declare function neq(left: string, right: Constant): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +### neq(left, right) {:#neq_1f46a76} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a field's value is not equal to a constant value. + +```typescript +// Check if the 'country' field is not equal to "USA" +neq("country", "USA"); + +``` + +Signature: + +```typescript +export declare function neq(left: string, right: any): Neq; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The field name to compare. | +| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | + +Returns: + +[Neq](./firestore_lite.neq.md#neq_class) + +### or(left, right) {:#or_eba7e36} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that performs a logical 'OR' operation on multiple filter conditions. + +```typescript +// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR +// the 'status' field is "active" +const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + +``` + +Signature: + +```typescript +export declare function or(left: FilterExpr, ...right: FilterExpr[]): Or; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. | + +Returns: + +[Or](./firestore_lite.or.md#or_class) -| Class | Description | -| --- | --- | -| [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | -| [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | -| [Bytes](./firestore_lite.bytes.md#bytes_class) | An immutable object representing an array of bytes. | -| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | -| [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | -| [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | -| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | -| [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | -| [Firestore](./firestore_lite.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | -| [FirestoreError](./firestore_lite.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | -| [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | -| [Query](./firestore_lite.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | -| [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | -| [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | -| [QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | -| [QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | -| [QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | -| [QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | -| [QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | -| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | -| [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | -| [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | -| [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | -| [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | +### queryEqual(left, right) {:#queryequal_7a1f045} + +Returns true if the provided queries point to the same collection and apply the same constraints. + +Signature: + +```typescript +export declare function queryEqual(left: Query, right: Query): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| right | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | + +Returns: + +boolean + +true if the references point to the same location in the same Firestore database. + +### refEqual(left, right) {:#refequal_598b780} + +Returns true if the provided references are equal. + +Signature: + +```typescript +export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| right | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | + +Returns: + +boolean + +true if the references point to the same location in the same Firestore database. + +### regexContains(left, pattern) {:#regexcontains_33ec01b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", "(?i)example"); + +``` + +Signature: + +```typescript +export declare function regexContains(left: string, pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +### regexContains(left, pattern) {:#regexcontains_dd84184} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains("description", Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function regexContains(left: string, pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +### regexContains(left, pattern) {:#regexcontains_3aaffe0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), "(?i)example"); + +``` + +Signature: + +```typescript +export declare function regexContains(left: Constant, pattern: string): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +### regexContains(left, pattern) {:#regexcontains_a2c3e8b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression contains a specified regular expression as a substring. + +```typescript +// Check if the 'description' field contains "example" (case-insensitive) +regexContains(Field.of("description"), Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function regexContains(left: Constant, pattern: Constant): RegexContains; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | + +Returns: + +[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) + +### regexMatch(left, pattern) {:#regexmatch_33ec01b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +export declare function regexMatch(left: string, pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +### regexMatch(left, pattern) {:#regexmatch_dd84184} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch("email", Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function regexMatch(left: string, pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | string | The name of the field containing the string. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +### regexMatch(left, pattern) {:#regexmatch_3aaffe0} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + +``` + +Signature: + +```typescript +export declare function regexMatch(left: Constant, pattern: string): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to match against. | +| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +### regexMatch(left, pattern) {:#regexmatch_a2c3e8b} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string expression matches a specified regular expression. + +```typescript +// Check if the 'email' field matches a valid email pattern +regexMatch(Field.of("email"), Field.of("pattern")); + +``` + +Signature: + +```typescript +export declare function regexMatch(left: Constant, pattern: Constant): RegexMatch; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to match against. | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | + +Returns: + +[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) + +### snapshotEqual(left, right) {:#snapshotequal_5109204} + +Returns true if the provided snapshots are equal. + +Signature: + +```typescript +export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; +``` -## Interfaces +#### Parameters -| Interface | Description | -| --- | --- | -| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | -| [DocumentData](./firestore_lite.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | -| [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | -| [Settings](./firestore_lite.settings.md#settings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | -| [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | +| Parameter | Type | Description | +| --- | --- | --- | +| left | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| right | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | -## Type Aliases +Returns: -| Type Alias | Description | -| --- | --- | -| [AddPrefixToKeys](./firestore_lite.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | -| [AggregateFieldType](./firestore_lite.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | -| [AggregateSpecData](./firestore_lite.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | -| [AggregateType](./firestore_lite.md#aggregatetype) | Union type representing the aggregate type to be performed. | -| [ChildUpdateFields](./firestore_lite.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | -| [FirestoreErrorCode](./firestore_lite.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | -| [NestedUpdateFields](./firestore_lite.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | -| [OrderByDirection](./firestore_lite.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | -| [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | -| [Primitive](./firestore_lite.md#primitive) | Primitive types. | -| [QueryConstraintType](./firestore_lite.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | -| [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | -| [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | -| [SetOptions](./firestore_lite.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | -| [UnionToIntersection](./firestore_lite.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | -| [UpdateData](./firestore_lite.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | -| [WhereFilterOp](./firestore_lite.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | -| [WithFieldValue](./firestore_lite.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | +boolean -## function(app, ...) +true if the snapshots are equal. -### getFirestore(app) {:#getfirestore_cf608e1} +### strContains(left, substring) {:#strcontains_18eaf5d} -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that checks if a string field contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +strContains("description", "example"); + +``` Signature: ```typescript -export declare function getFirestore(app: FirebaseApp): Firestore; +export declare function strContains(left: string, substring: string): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| left | string | The name of the field containing the string. | +| substring | string | The substring to search for. A new representing the 'contains' comparison. | Returns: -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. +[StrContains](./firestore_lite.strcontains.md#strcontains_class) -### getFirestore(app, databaseId) {:#getfirestore_48de6cb} +### strContains(left, substring) {:#strcontains_f0f1f2f} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +Creates an expression that checks if a string field contains a substring specified by an expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains("description", Field.of("keyword")); + +``` Signature: ```typescript -export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; +export declare function strContains(left: string, substring: Constant): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | -| databaseId | string | The name of the database. | +| left | string | The name of the field containing the string. | +| substring | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | Returns: -[Firestore](./firestore_lite.firestore.md#firestore_class) +[StrContains](./firestore_lite.strcontains.md#strcontains_class) -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. +### strContains(left, substring) {:#strcontains_5fdbd29} -### initializeFirestore(app, settings) {:#initializefirestore_87c6318} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). +Creates an expression that checks if a string expression contains a specified substring. + +```typescript +// Check if the 'description' field contains "example". +strContains(Field.of("description"), "example"); + +``` Signature: ```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; +export declare function strContains(left: Constant, substring: string): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | -| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| substring | string | The substring to search for. A new representing the 'contains' comparison. | Returns: -[Firestore](./firestore_lite.firestore.md#firestore_class) - -A newly initialized `Firestore` instance. +[StrContains](./firestore_lite.strcontains.md#strcontains_class) -### initializeFirestore(app, settings, databaseId) {:#initializefirestore_37baaaf} +### strContains(left, substring) {:#strcontains_d9d749f} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). +Creates an expression that checks if a string expression contains a substring specified by another expression. + +```typescript +// Check if the 'description' field contains the value of the 'keyword' field. +strContains(Field.of("description"), Field.of("keyword")); + +``` Signature: ```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; +export declare function strContains(left: Constant, substring: Constant): StrContains; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | -| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | -| databaseId | string | The name of the database. | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | +| substring | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | Returns: -[Firestore](./firestore_lite.firestore.md#firestore_class) +[StrContains](./firestore_lite.strcontains.md#strcontains_class) -A newly initialized `Firestore` instance. +### subtract(left, right) {:#subtract_be96f75} -## function(firestore, ...) +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### collection(firestore, path, pathSegments) {:#collection_1eb4c23} +Creates an expression that subtracts two expressions. -Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract(Field.of("price"), Field.of("discount")); + +``` Signature: ```typescript -export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; +export declare function subtract(left: Constant, right: Constant): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | Returns: -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> +[Subtract](./firestore_lite.subtract.md#subtract_class) -The `CollectionReference` instance. +### subtract(left, right) {:#subtract_010ba9e} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an even number of segments and does not point to a collection. +Creates an expression that subtracts a constant value from an expression. -### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} +```typescript +// Subtract the constant value 2 from the 'value' field +subtract(Field.of("value"), 2); -Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. +``` Signature: ```typescript -export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; +export declare function subtract(left: Constant, right: any): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | +| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from. | +| right | any | The constant value to subtract. A new representing the subtraction operation. | Returns: -[Query](./firestore_lite.query.md#query_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> +[Subtract](./firestore_lite.subtract.md#subtract_class) -The created `Query`. +### subtract(left, right) {:#subtract_674c63f} -### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Modify this instance to communicate with the Cloud Firestore emulator. +Creates an expression that subtracts an expression from a field's value. -Note: This must be called before this instance has been used to do any operations. +```typescript +// Subtract the 'discount' field from the 'price' field +subtract("price", Field.of("discount")); + +``` Signature: ```typescript -export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; +export declare function subtract(left: string, right: Constant): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | -| host | string | the emulator host (ex: localhost). | -| port | number | the emulator port (ex: 9000). | -| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | +| left | string | The field name to subtract from. | +| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | Returns: -void +[Subtract](./firestore_lite.subtract.md#subtract_class) -### doc(firestore, path, pathSegments) {:#doc_1eb4c23} +### subtract(left, right) {:#subtract_1f46a76} -Gets a `DocumentReference` instance that refers to the document at the specified absolute path. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that subtracts a constant value from a field's value. + +```typescript +// Subtract 20 from the value of the 'total' field +subtract("total", 20); + +``` Signature: ```typescript -export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; +export declare function subtract(left: string, right: any): Subtract; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | string | The field name to subtract from. | +| right | any | The constant value to subtract. A new representing the subtraction operation. | Returns: -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> +[Subtract](./firestore_lite.subtract.md#subtract_class) -The `DocumentReference` instance. +### xor(left, right) {:#xor_eba7e36} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an odd number of segments and does not point to a document. +Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. -### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} +```typescript +// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", +// or 'status' is "active". +const condition = xor( + gt("age", 18), + eq("city", "London"), + eq("status", "active")); -Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. +``` -The maximum number of writes allowed in a single transaction is 500. +Signature: + +```typescript +export declare function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | +| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'XOR' together. A new representing the logical 'XOR' operation. | + +Returns: + +[Xor](./firestore_lite.xor.md#xor_class) + +## function(limit, ...) + +### limit(limit) {:#limit_ec46c78} + +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. Signature: ```typescript -export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; +export declare function limit(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | -| updateFunction | (transaction: [Transaction](./firestore_lite.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | -| options | [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | +| limit | number | The maximum number of items to return. | Returns: -Promise<T> +[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) -If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -### terminate(firestore) {:#terminate_231a8e0} +### limitToLast(limit) {:#limittolast_ec46c78} -Terminates the provided `Firestore` instance. +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. -After calling `terminate()` only the `clearIndexedDbPersistence()` functions may be used. Any other function will throw a `FirestoreError`. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. +You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. -To restart after termination, create a new instance of `Firestore` with [getFirestore()](./firestore_.md#getfirestore). +Signature: -Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. +```typescript +export declare function limitToLast(limit: number): QueryLimitConstraint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| limit | number | The maximum number of items to return. | + +Returns: + +[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) + +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). + +## function(logLevel, ...) + +### setLogLevel(logLevel) {:#setloglevel_d02fda2} + +Sets the verbosity of Cloud Firestore logs (debug, error, or silent). Signature: ```typescript -export declare function terminate(firestore: Firestore): Promise; +export declare function setLogLevel(logLevel: LogLevel): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to terminate. | +| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:

  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| Returns: -Promise<void> +void -A `Promise` that is resolved when the instance has been successfully terminated. +## function(mapExpr, ...) -### writeBatch(firestore) {:#writebatch_231a8e0} +### mapGet(mapExpr, subField) {:#mapget_9715f90} -Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +Accesses a value from a map (object) expression using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +mapGet(Field.of("address"), "city"); + +``` Signature: ```typescript -export declare function writeBatch(firestore: Firestore): WriteBatch; +export declare function mapGet(mapExpr: Constant, subField: string): MapGet; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | +| mapExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the map. | +| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | Returns: -[WriteBatch](./firestore_lite.writebatch.md#writebatch_class) +[MapGet](./firestore_lite.mapget.md#mapget_class) -A `WriteBatch` that can be used to atomically execute multiple writes. +## function(mapField, ...) -## function() +### mapGet(mapField, subField) {:#mapget_b37bbb6} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Accesses a value from a map (object) field using the provided key. + +```typescript +// Get the 'city' value from the 'address' map field +mapGet("address", "city"); + +``` + +Signature: + +```typescript +export declare function mapGet(mapField: string, subField: string): MapGet; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| mapField | string | The field name of the map field. | +| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | -### count() {:#count} +Returns: -Create an AggregateField object that can be used to compute the count of documents in the result set of a query. +[MapGet](./firestore_lite.mapget.md#mapget_class) -Signature: +## function(n, ...) -```typescript -export declare function count(): AggregateField; -``` -Returns: +### increment(n) {:#increment_5685735} -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. -### deleteField() {:#deletefield} +If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. -Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. +If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. Signature: ```typescript -export declare function deleteField(): FieldValue; +export declare function increment(n: number): FieldValue; ``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| n | number | The value to increment by. | + Returns: [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -### documentId() {:#documentid} +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. +## function(name, ...) -Signature: +### genericFunction(name, params) {:#genericfunction_b886545} -```typescript -export declare function documentId(): FieldPath; -``` -Returns: +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -[FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) +Creates functions that work on the backend but do not exist in the SDK yet. -### getFirestore() {:#getfirestore} +```typescript +// Call a user defined function named "myFunc" with the arguments 10 and 20 +// This is the same of the 'sum(Field.of("price"))', if it did not exist +genericFunction("sum", [Field.of("price")]); -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +``` Signature: ```typescript -export declare function getFirestore(): Firestore; +export declare function genericFunction(name: string, params: Constant[]): FirestoreFunction; ``` -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### serverTimestamp() {:#servertimestamp} -Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. +#### Parameters -Signature: +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The name of the user defined function. | +| params | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The arguments to pass to the function. A new representing the function call. | -```typescript -export declare function serverTimestamp(): FieldValue; -``` Returns: -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) +[FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) -## function(databaseId, ...) +## function(pipeline, ...) -### getFirestore(databaseId) {:#getfirestore_53dc891} +### execute(pipeline) {:#execute_86486e6} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. +Modular API for console experimentation. Signature: ```typescript -export declare function getFirestore(databaseId: string): Firestore; +export declare function execute(pipeline: Pipeline): Promise>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| databaseId | string | The name of the database. | +| pipeline | [Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> | Execute this pipeline. | Returns: -[Firestore](./firestore_lite.firestore.md#firestore_class) +Promise<Array<[PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class)<AppModelType>>> -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. +## function(query, ...) -## function(elements, ...) +### getAggregate(query, aggregateSpec) {:#getaggregate_2073a74} -### arrayRemove(elements) {:#arrayremove_7d853aa} +Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. -Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. +Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). Signature: ```typescript -export declare function arrayRemove(...elements: unknown[]): FieldValue; +export declare function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| elements | unknown\[\] | The elements to remove from the array. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | +| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | Returns: -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) +Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` +### Example -### arrayUnion(elements) {:#arrayunion_7d853aa} -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. +```typescript +const aggregateSnapshot = await getAggregate(query, { + countOfDocs: count(), + totalHours: sum('hours'), + averageScore: average('score') +}); + +const countOfDocs: number = aggregateSnapshot.data().countOfDocs; +const totalHours: number = aggregateSnapshot.data().totalHours; +const averageScore: number | null = aggregateSnapshot.data().averageScore; + +``` + +### getCount(query) {:#getcount_4e56953} + +Calculates the number of documents in the result set of the given query without actually downloading the documents. + +Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). Signature: ```typescript -export declare function arrayUnion(...elements: unknown[]): FieldValue; +export declare function getCount(query: Query): Promise; +}, AppModelType, DbModelType>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| elements | unknown\[\] | The elements to union into the array. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | Returns: -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) +Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. +A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. -## function(field, ...) +### getDocs(query) {:#getdocs_4e56953} -### average(field) {:#average_aacc3a9} +Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class). -Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. +All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. Signature: ```typescript -export declare function average(field: string | FieldPath): AggregateField; +export declare function getDocs(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The Query to execute. | Returns: -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number \| null> +Promise<[QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -### sum(field) {:#sum_aacc3a9} +A Promise that will be resolved with the results of the query. -Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. +### pipeline(query) {:#pipeline_20b2416} + +Experimental Modular API for console testing. Signature: ```typescript -export declare function sum(field: string | FieldPath): AggregateField; +export declare function pipeline(query: Query): Pipeline; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | +| query | [Query](./firestore_lite.query.md#query_class) | | Returns: -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> - -## function(fieldPath, ...) - -### orderBy(fieldPath, directionStr) {:#orderby_006d61f} +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) -Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. +### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} -Note: Documents that do not contain the specified field will not be present in the query result. +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; +export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The field to sort by. | -| directionStr | [OrderByDirection](./firestore_lite.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| compositeFilter | [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using or . | +| queryConstraints | [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | Returns: -[QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) +[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> -The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). +#### Exceptions -### where(fieldPath, opStr, value) {:#where_0fae4bf} +if any of the provided query constraints cannot be combined with the existing or new constraints. -Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. +### query(query, queryConstraints) {:#query_0f46da1} + +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; +export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The path to compare | -| opStr | [WhereFilterOp](./firestore_lite.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | -| value | unknown | The value for comparison | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| queryConstraints | [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | Returns: -[QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) +[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> -The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). +#### Exceptions -## function(fieldValues, ...) +if any of the provided query constraints cannot be combined with the existing or new constraints. -### endAt(fieldValues) {:#endat_8b2f2c8} +## function(queryConstraints, ...) -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +### and(queryConstraints) {:#and_e72c712} + +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. Signature: ```typescript -export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; +export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | +| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | Returns: -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) +[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -### endBefore(fieldValues) {:#endbefore_8b2f2c8} +### or(queryConstraints) {:#or_e72c712} -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. Signature: ```typescript -export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; +export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | +| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | Returns: -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) +[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -### startAfter(fieldValues) {:#startafter_8b2f2c8} +## function(reference, ...) -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +### addDoc(reference, data) {:#adddoc_6e783ff} + +Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. + +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; +export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | +| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) +Promise<[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType>> -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend. -### startAt(fieldValues) {:#startat_8b2f2c8} +#### Exceptions -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. +Error - If the provided input is not a valid Firestore document. + +### collection(reference, path, pathSegments) {:#collection_568f98d} + +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; +export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. +The `CollectionReference` instance. -## function(left, ...) +#### Exceptions -### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} +If the final path has an even number of segments and does not point to a collection. -Compares two 'AggregateField\` instances for equality. +### collection(reference, path, pathSegments) {:#collection_70b4396} + +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; +export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | -| right | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -boolean +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} +The `CollectionReference` instance. -Compares two `AggregateQuerySnapshot` instances for equality. +#### Exceptions -Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. +If the final path has an even number of segments and does not point to a collection. + +### deleteDoc(reference) {:#deletedoc_4569087} + +Deletes the document referred to by the specified `DocumentReference`. + +The deletion will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the delete fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; +export declare function deleteDoc(reference: DocumentReference): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | -| right | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | Returns: -boolean +Promise<void> -`true` if the objects are "equal", as defined above, or `false` otherwise. +A `Promise` resolved once the document has been successfully deleted from the backend. -### queryEqual(left, right) {:#queryequal_7a1f045} +### doc(reference, path, pathSegments) {:#doc_568f98d} -Returns true if the provided queries point to the same collection and apply the same constraints. +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. Signature: ```typescript -export declare function queryEqual(left: Query, right: Query): boolean; +export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | -| right | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -boolean +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> -true if the references point to the same location in the same Firestore database. +The `DocumentReference` instance. -### refEqual(left, right) {:#refequal_598b780} +#### Exceptions -Returns true if the provided references are equal. +If the final path has an odd number of segments and does not point to a document. + +### doc(reference, path, pathSegments) {:#doc_70b4396} + +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. Signature: ```typescript -export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | -| right | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -boolean +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -true if the references point to the same location in the same Firestore database. +The `DocumentReference` instance. -### snapshotEqual(left, right) {:#snapshotequal_5109204} +#### Exceptions -Returns true if the provided snapshots are equal. +If the final path has an odd number of segments and does not point to a document. + +### getDoc(reference) {:#getdoc_4569087} + +Reads the document referred to by the specified document reference. + +All documents are directly fetched from the server, even if the document was previously read or modified. Recent modifications are only reflected in the retrieved `DocumentSnapshot` if they have already been applied by the backend. If the client is offline, the read fails. If you like to use caching or see local modifications, please use the full Firestore SDK. Signature: ```typescript -export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; +export declare function getDoc(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | -| right | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | Returns: -boolean +Promise<[DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -true if the snapshots are equal. +A Promise resolved with a `DocumentSnapshot` containing the current document contents. -## function(limit, ...) +### setDoc(reference, data) {:#setdoc_ee215ad} -### limit(limit) {:#limit_ec46c78} +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function limit(limit: number): QueryLimitConstraint; +export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | Returns: -[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) +Promise<void> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +A `Promise` resolved once the data has been successfully written to the backend. -### limitToLast(limit) {:#limittolast_ec46c78} +#### Exceptions -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. +Error - If the provided input is not a valid Firestore document. -You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. +### setDoc(reference, data, options) {:#setdoc_ff80739} + +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. + +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function limitToLast(limit: number): QueryLimitConstraint; +export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| options | [SetOptions](./firestore_lite.md#setoptions) | An object to configure the set behavior. | Returns: -[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) +Promise<void> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +A `Promise` resolved once the data has been successfully written to the backend. -## function(logLevel, ...) +#### Exceptions -### setLogLevel(logLevel) {:#setloglevel_d02fda2} +Error - If the provided input is not a valid Firestore document. -Sets the verbosity of Cloud Firestore logs (debug, error, or silent). +### updateDoc(reference, data) {:#updatedoc_51a65e3} + +Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. + +The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function setLogLevel(logLevel: LogLevel): void; +export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:
  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| data | [UpdateData](./firestore_lite.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | Returns: -void +Promise<void> -## function(n, ...) +A `Promise` resolved once the data has been successfully written to the backend. -### increment(n) {:#increment_5685735} +#### Exceptions -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. +Error - If the provided input is not valid Firestore data. -If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. +### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} -If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. +Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. + +Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. + +The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function increment(n: number): FieldValue; +export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| n | number | The value to increment by. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The first field to update. | +| value | unknown | The first value. | +| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | Returns: -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) +Promise<void> -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` +A `Promise` resolved once the data has been successfully written to the backend. -## function(query, ...) +#### Exceptions -### getAggregate(query, aggregateSpec) {:#getaggregate_2073a74} +Error - If the provided input is not valid Firestore data. -Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. +## function(snapshot, ...) -Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +### endAt(snapshot) {:#endat_9a4477f} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; +export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | -| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) -### Example +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### endBefore(snapshot) {:#endbefore_9a4477f} -```typescript -const aggregateSnapshot = await getAggregate(query, { - countOfDocs: count(), - totalHours: sum('hours'), - averageScore: average('score') -}); +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. -const countOfDocs: number = aggregateSnapshot.data().countOfDocs; -const totalHours: number = aggregateSnapshot.data().totalHours; -const averageScore: number | null = aggregateSnapshot.data().averageScore; +Signature: +```typescript +export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` -### getCount(query) {:#getcount_4e56953} +#### Parameters -Calculates the number of documents in the result set of the given query without actually downloading the documents. +| Parameter | Type | Description | +| --- | --- | --- | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | -Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +Returns: + +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) + +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` + +### startAfter(snapshot) {:#startafter_9a4477f} + +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function getCount(query: Query): Promise; -}, AppModelType, DbModelType>>; +export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> - -A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) -### getDocs(query) {:#getdocs_4e56953} +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class). +### startAt(snapshot) {:#startat_9a4477f} -All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. Signature: ```typescript -export declare function getDocs(query: Query): Promise>; +export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The Query to execute. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | Returns: -Promise<[QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) -A Promise that will be resolved with the results of the query. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. -### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} +## function(timestamp, ...) -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +### timestampAdd(timestamp, unit, amount) {:#timestampadd_87db576} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an expression that adds a specified amount of time to a timestamp. + +```typescript +// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + +``` Signature: ```typescript -export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; +export declare function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| compositeFilter | [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using [and()](./firestore_.md#and_e72c712) or [or()](./firestore_.md#or_e72c712). | -| queryConstraints | [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | Returns: -[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) -#### Exceptions +### timestampAdd(timestamp, unit, amount) {:#timestampadd_46a2d7e} -if any of the provided query constraints cannot be combined with the existing or new constraints. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### query(query, queryConstraints) {:#query_0f46da1} +Creates an expression that adds a specified amount of time to a timestamp. -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +```typescript +// Add 1 day to the 'timestamp' field. +timestampAdd(Field.of("timestamp"), "day", 1); + +``` Signature: ```typescript -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; +export declare function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| queryConstraints | [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | +| amount | number | The amount of time to add. A new representing the resulting timestamp. | Returns: -[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> +[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) -#### Exceptions +### timestampSub(timestamp, unit, amount) {:#timestampsub_87db576} -if any of the provided query constraints cannot be combined with the existing or new constraints. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -## function(queryConstraints, ...) +Creates an expression that subtracts a specified amount of time from a timestamp. -### and(queryConstraints) {:#and_e72c712} +```typescript +// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. +timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. +``` Signature: ```typescript -export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | Returns: -[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +### timestampSub(timestamp, unit, amount) {:#timestampsub_46a2d7e} -### or(queryConstraints) {:#or_e72c712} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. +Creates an expression that subtracts a specified amount of time from a timestamp. + +```typescript +// Subtract 1 day from the 'timestamp' field. +timestampSub(Field.of("timestamp"), "day", 1); + +``` Signature: ```typescript -export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | +| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | +| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | Returns: -[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) +[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +## function(value, ...) -## function(reference, ...) +### avgFunction(value) {:#avgfunction_f83680a} -### addDoc(reference, data) {:#adddoc_6e783ff} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. +Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +```typescript +// Calculate the average age of users +avg(Field.of("age")).as("averageAge"); + +``` Signature: ```typescript -export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +export declare function avgFunction(value: Constant): Avg; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | -| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the values to average. A new representing the 'avg' aggregation. | Returns: -Promise<[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType>> +[Avg](./firestore_lite.avg.md#avg_class) -A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend. +### avgFunction(value) {:#avgfunction_7c807cd} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Error - If the provided input is not a valid Firestore document. +Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. -### collection(reference, path, pathSegments) {:#collection_568f98d} +```typescript +// Calculate the average age of users +avg("age").as("averageAge"); -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +``` Signature: ```typescript -export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function avgFunction(value: string): Avg; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| value | string | The name of the field containing numeric values to average. A new representing the 'avg' aggregation. | Returns: -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> +[Avg](./firestore_lite.avg.md#avg_class) -The `CollectionReference` instance. +### exists(value) {:#exists_f83680a} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an even number of segments and does not point to a collection. +Creates an expression that checks if a field exists. -### collection(reference, path, pathSegments) {:#collection_70b4396} +```typescript +// Check if the document has a field named "phoneNumber" +exists(Field.of("phoneNumber")); -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +``` Signature: ```typescript -export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function exists(value: Constant): Exists; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. | Returns: -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. +[Exists](./firestore_lite.exists.md#exists_class) -#### Exceptions +### isNan(value) {:#isnan_f83680a} -If the final path has an even number of segments and does not point to a collection. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### deleteDoc(reference) {:#deletedoc_4569087} +Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). -Deletes the document referred to by the specified `DocumentReference`. +```typescript +// Check if the result of a calculation is NaN +isNaN(Field.of("value").divide(0)); -The deletion will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the delete fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +``` Signature: ```typescript -export declare function deleteDoc(reference: DocumentReference): Promise; +export declare function isNan(value: Constant): IsNan; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. A new representing the 'isNaN' check. | Returns: -Promise<void> +[IsNan](./firestore_lite.isnan.md#isnan_class) -A `Promise` resolved once the document has been successfully deleted from the backend. +### isNan(value) {:#isnan_7c807cd} -### doc(reference, path, pathSegments) {:#doc_568f98d} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. +Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). + +```typescript +// Check if the result of a calculation is NaN +isNaN("value"); + +``` Signature: ```typescript -export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; +export declare function isNan(value: string): IsNan; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| value | string | The name of the field to check. A new representing the 'isNaN' check. | Returns: -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> +[IsNan](./firestore_lite.isnan.md#isnan_class) -The `DocumentReference` instance. +### max(value) {:#max_f83680a} -#### Exceptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -If the final path has an odd number of segments and does not point to a document. +Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. -### doc(reference, path, pathSegments) {:#doc_70b4396} +```typescript +// Find the highest score in a leaderboard +max(Field.of("score")).as("highestScore"); -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. +``` Signature: ```typescript -export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; +export declare function max(value: Constant): Max; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to find the maximum value of. A new representing the 'max' aggregation. | Returns: -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. +[Max](./firestore_lite.max.md#max_class) -#### Exceptions +### max(value) {:#max_7c807cd} -If the final path has an odd number of segments and does not point to a document. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### getDoc(reference) {:#getdoc_4569087} +Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -Reads the document referred to by the specified document reference. +```typescript +// Find the highest score in a leaderboard +max("score").as("highestScore"); -All documents are directly fetched from the server, even if the document was previously read or modified. Recent modifications are only reflected in the retrieved `DocumentSnapshot` if they have already been applied by the backend. If the client is offline, the read fails. If you like to use caching or see local modifications, please use the full Firestore SDK. +``` Signature: ```typescript -export declare function getDoc(reference: DocumentReference): Promise>; +export declare function max(value: string): Max; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | +| value | string | The name of the field to find the maximum value of. A new representing the 'max' aggregation. | Returns: -Promise<[DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +[Max](./firestore_lite.max.md#max_class) -A Promise resolved with a `DocumentSnapshot` containing the current document contents. +### min(value) {:#min_f83680a} -### setDoc(reference, data) {:#setdoc_ee215ad} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. +Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +```typescript +// Find the lowest price of all products +min(Field.of("price")).as("lowestPrice"); + +``` Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; +export declare function min(value: Constant): Min; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to find the minimum value of. A new representing the 'min' aggregation. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. +[Min](./firestore_lite.min.md#min_class) -#### Exceptions +### min(value) {:#min_7c807cd} -Error - If the provided input is not a valid Firestore document. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### setDoc(reference, data, options) {:#setdoc_ff80739} +Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. +```typescript +// Find the lowest price of all products +min("price").as("lowestPrice"); -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +``` Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; +export declare function min(value: string): Min; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | -| options | [SetOptions](./firestore_lite.md#setoptions) | An object to configure the set behavior. | +| value | string | The name of the field to find the minimum value of. A new representing the 'min' aggregation. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. +[Min](./firestore_lite.min.md#min_class) -#### Exceptions +### replaceAll(value, find, replace) {:#replaceall_f06d323} -Error - If the provided input is not a valid Firestore document. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -### updateDoc(reference, data) {:#updatedoc_51a65e3} +Creates an expression that replaces all occurrences of a substring within a string with another substring. -Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. +```typescript +// Replace all occurrences of "hello" with "hi" in the 'message' field. +replaceAll(Field.of("message"), "hello", "hi"); -The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +``` Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; +export declare function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| data | [UpdateData](./firestore_lite.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. - -#### Exceptions +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) -Error - If the provided input is not valid Firestore data. +### replaceAll(value, find, replace) {:#replaceall_26a7926} -### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. +Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. -Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. +```typescript +// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); -The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +``` Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +export declare function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The first field to update. | -| value | unknown | The first value. | -| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. +[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) -#### Exceptions +### replaceFirst(value, find, replace) {:#replacefirst_f06d323} -Error - If the provided input is not valid Firestore data. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -## function(snapshot, ...) +Creates an expression that replaces the first occurrence of a substring within a string with another substring. -### endAt(snapshot) {:#endat_9a4477f} +```typescript +// Replace the first occurrence of "hello" with "hi" in the 'message' field. +replaceFirst(Field.of("message"), "hello", "hi"); -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +``` Signature: ```typescript -export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | string | The substring to search for. | +| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | Returns: -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### replaceFirst(value, find, replace) {:#replacefirst_26a7926} -### endBefore(snapshot) {:#endbefore_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. + +```typescript +// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. +replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + +``` Signature: ```typescript -export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | +| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | Returns: -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) +[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### sumFunction(value) {:#sumfunction_f83680a} -### startAfter(snapshot) {:#startafter_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +sum(Field.of("orderAmount")).as("totalRevenue"); + +``` Signature: ```typescript -export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function sumFunction(value: Constant): Sum; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | +| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to sum up. A new representing the 'sum' aggregation. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) +[Sum](./firestore_lite.sum.md#sum_class) -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +### sumFunction(value) {:#sumfunction_7c807cd} -### startAt(snapshot) {:#startat_9a4477f} +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. +Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. + +```typescript +// Calculate the total revenue from a set of orders +sum("orderAmount").as("totalRevenue"); + +``` Signature: ```typescript -export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function sumFunction(value: string): Sum; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | +| value | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. +[Sum](./firestore_lite.sum.md#sum_class) ## function(values, ...) @@ -1595,6 +8548,19 @@ export declare function vector(values?: number[]): VectorValue; A new `VectorValue` constructed with a copy of the given array of numbers. +## AccumulatorTarget + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An accumulator target, which is an expression with an alias that also implements the Accumulator interface. + +Signature: + +```typescript +export declare type AccumulatorTarget = ExprWithAlias; +``` + ## AddPrefixToKeys Returns a new map where every key is prefixed with the outer key appended to a dot. @@ -1653,6 +8619,32 @@ See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributi export declare type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; ``` +## ExprType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An enumeration of the different types of expressions. + +Signature: + +```typescript +export declare type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; +``` + +## FilterExpr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter expression, which is an expression that also implements the FilterCondition interface. + +Signature: + +```typescript +export declare type FilterExpr = Constant & FilterCondition; +``` + ## FirestoreErrorCode The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md @@ -1739,6 +8731,19 @@ export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCo export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint; ``` +## SelectableExpr + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A selectable expression, which is an expression that also implements the Selectable interface. + +Signature: + +```typescript +export declare type SelectableExpr = Constant & Selectable; +``` + ## SetOptions An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a `SetOptions` with `merge: true`. diff --git a/docs-devsite/firestore_lite.min.md b/docs-devsite/firestore_lite.min.md new file mode 100644 index 00000000000..684db43d806 --- /dev/null +++ b/docs-devsite/firestore_lite.min.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Min class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Min extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_lite.min.md#minconstructor) | | (BETA) Constructs a new instance of the Min class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_lite.min.md#minaccumulator) | | true | (BETA) | + +## Min.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Min` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| distinct | boolean | | + +## Min.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.mod.md b/docs-devsite/firestore_lite.mod.md new file mode 100644 index 00000000000..f007f09a87e --- /dev/null +++ b/docs-devsite/firestore_lite.mod.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Mod class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Mod extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.mod.md#modconstructor) | | (BETA) Constructs a new instance of the Mod class | + +## Mod.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Mod` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.multiply.md b/docs-devsite/firestore_lite.multiply.md new file mode 100644 index 00000000000..38ca6014b2c --- /dev/null +++ b/docs-devsite/firestore_lite.multiply.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Multiply class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Multiply extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.multiply.md#multiplyconstructor) | | (BETA) Constructs a new instance of the Multiply class | + +## Multiply.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Multiply` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.neq.md b/docs-devsite/firestore_lite.neq.md new file mode 100644 index 00000000000..132e5721b8f --- /dev/null +++ b/docs-devsite/firestore_lite.neq.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Neq class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Neq extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.neq.md#neqconstructor) | | (BETA) Constructs a new instance of the Neq class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.neq.md#neqfilterable) | | true | (BETA) | + +## Neq.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Neq` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Neq.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.not.md b/docs-devsite/firestore_lite.not.md new file mode 100644 index 00000000000..362ccd8a789 --- /dev/null +++ b/docs-devsite/firestore_lite.not.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Not class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Not extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.not.md#notconstructor) | | (BETA) Constructs a new instance of the Not class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.not.md#notfilterable) | | true | (BETA) | + +## Not.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Not` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + +## Not.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.offset.md b/docs-devsite/firestore_lite.offset.md new file mode 100644 index 00000000000..dc09ac97be6 --- /dev/null +++ b/docs-devsite/firestore_lite.offset.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Offset class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Offset implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(offset)](./firestore_lite.offset.md#offsetconstructor) | | (BETA) Constructs a new instance of the Offset class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.offset.md#offsetname) | | string | (BETA) | + +## Offset.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Offset` class + +Signature: + +```typescript +constructor(offset: number); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| offset | number | | + +## Offset.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.or.md b/docs-devsite/firestore_lite.or.md new file mode 100644 index 00000000000..d2c506893a0 --- /dev/null +++ b/docs-devsite/firestore_lite.or.md @@ -0,0 +1,17 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# or namespace +Signature: + +```typescript +export declare namespace or +``` diff --git a/docs-devsite/firestore_lite.ordering.md b/docs-devsite/firestore_lite.ordering.md new file mode 100644 index 00000000000..c8dc1249d73 --- /dev/null +++ b/docs-devsite/firestore_lite.ordering.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Ordering class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents an ordering criterion for sorting documents in a Firestore pipeline. + +You create `Ordering` instances using the `ascending` and `descending` helper functions. + +Signature: + +```typescript +export declare class Ordering +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, direction)](./firestore_lite.ordering.md#orderingconstructor) | | (BETA) Constructs a new instance of the Ordering class | + +## Ordering.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Ordering` class + +Signature: + +```typescript +constructor(expr: Constant, direction: 'ascending' | 'descending'); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| direction | 'ascending' \| 'descending' | | + diff --git a/docs-devsite/firestore_lite.pipeline.md b/docs-devsite/firestore_lite.pipeline.md new file mode 100644 index 00000000000..c34aa32109e --- /dev/null +++ b/docs-devsite/firestore_lite.pipeline.md @@ -0,0 +1,564 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Pipeline class +Base-class implementation + +Signature: + +```typescript +export declare class Pipeline +``` + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addFields(fields)](./firestore_lite.pipeline.md#pipelineaddfields) | | Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like add, multiply with assigned aliases using .Example: +```typescript +firestore.pipeline().collection("books") + .addFields( + Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' + add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' + ); + +``` + | +| [aggregate(accumulators)](./firestore_lite.pipeline.md#pipelineaggregate) | | Performs aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances.

Example: +```typescript +// Calculate the average rating and the total number of books +firestore.pipeline().collection("books") + .aggregate( + Field.of("rating").avg().as("averageRating"), + countAll().as("totalBooks") + ); + +``` + | +| [aggregate(options)](./firestore_lite.pipeline.md#pipelineaggregate) | | Performs optionally grouped aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify:

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.

Example: +```typescript +// Calculate the average rating for each genre. +firestore.pipeline().collection("books") + .aggregate({ + accumulators: [avg(Field.of("rating")).as("avg_rating")] + groups: ["genre"] + }); + +``` + | +| [distinct(groups)](./firestore_lite.pipeline.md#pipelinedistinct) | | Returns a set of distinct values from the inputs to this stage.

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc).

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using

Example: +```typescript +// Get a list of unique author names in uppercase and genre combinations. +firestore.pipeline().collection("books") + .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") + .select("authorName"); + +``` + | +| [execute()](./firestore_lite.pipeline.md#pipelineexecute) | | Executes this pipeline and returns a Promise to represent the asynchronous operation.

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.

Example: +```typescript +const futureResults = await firestore.pipeline().collection("books") + .where(gt(Field.of("rating"), 4.5)) + .select("title", "author", "rating") + .execute(); + +``` + A Promise representing the asynchronous pipeline execution. | +| [findNearest(options)](./firestore_lite.pipeline.md#pipelinefindnearest) | | | +| [genericStage(name, params)](./firestore_lite.pipeline.md#pipelinegenericstage) | | Adds a generic stage to the pipeline.

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique name and a set of params that control its behavior.

Example (Assuming there is no "where" stage available in SDK): +```typescript +// Assume we don't have a built-in "where" stage +firestore.pipeline().collection("books") + .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage + .select("title", "author"); + +``` + | +| [limit(limit)](./firestore_lite.pipeline.md#pipelinelimit) | | Limits the maximum number of documents returned by previous stages to limit.

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for:

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.

Example: +```typescript +// Limit the results to the top 10 highest-rated books +firestore.pipeline().collection("books") + .sort(Field.of("rating").descending()) + .limit(10); + +``` + | +| [offset(offset)](./firestore_lite.pipeline.md#pipelineoffset) | | Skips the first offset number of documents from the results of previous stages.

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.

Example: +```typescript +// Retrieve the second page of 20 results +firestore.pipeline().collection("books") + .sort(Field.of("published").descending()) + .offset(20) // Skip the first 20 results + .limit(20); // Take the next 20 results + +``` + | +| [select(selections)](./firestore_lite.pipeline.md#pipelineselect) | | Selects or creates a set of fields from the outputs of previous stages.

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.

Example: +```typescript +firestore.pipeline().collection("books") + .select( + "firstName", + Field.of("lastName"), + Field.of("address").toUppercase().as("upperAddress"), + ); + +``` + | +| [sort(orderings)](./firestore_lite.pipeline.md#pipelinesort) | | Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria.

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.

Example: +```typescript +// Sort books by rating in descending order, and then by title in ascending order for books +// with the same rating +firestore.pipeline().collection("books") + .sort( + Ordering.of(Field.of("rating")).descending(), + Ordering.of(Field.of("title")) // Ascending order is the default + ); + +``` + | +| [sort(options)](./firestore_lite.pipeline.md#pipelinesort) | | | +| [where(condition)](./firestore_lite.pipeline.md#pipelinewhere) | | Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface).

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to:

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.

Example: +```typescript +firestore.pipeline().collection("books") + .where( + and( + gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 + Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") + ) + ); + +``` + | + +## Pipeline.addFields() + +Adds new fields to outputs from previous stages. + +This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps). + +The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be: + +- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like `add`, `multiply` with assigned aliases using . + +Example: + +```typescript +firestore.pipeline().collection("books") + .addFields( + Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' + add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' + ); + +``` + +Signature: + +```typescript +addFields(...fields: Selectable[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fields | [Selectable](./firestore_lite.selectable.md#selectable_interface)\[\] | The fields to add to the documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface)s. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.aggregate() + +Performs aggregation operations on the documents from previous stages. + +

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. + +

Example: + +```typescript +// Calculate the average rating and the total number of books +firestore.pipeline().collection("books") + .aggregate( + Field.of("rating").avg().as("averageRating"), + countAll().as("totalBooks") + ); + +``` + +Signature: + +```typescript +aggregate(...accumulators: AccumulatorTarget[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| accumulators | [AccumulatorTarget](./firestore_lite.md#accumulatortarget)\[\] | The [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, each wrapping an [Accumulator](./firestore_.accumulator.md#accumulator_interface) and provide a name for the accumulated results. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.aggregate() + +Performs optionally grouped aggregation operations on the documents from previous stages. + +

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: + +

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.
+ +

Example: + +```typescript +// Calculate the average rating for each genre. +firestore.pipeline().collection("books") + .aggregate({ + accumulators: [avg(Field.of("rating")).as("avg_rating")] + groups: ["genre"] + }); + +``` + +Signature: + +```typescript +aggregate(options: { + accumulators: AccumulatorTarget[]; + groups?: Array; + }): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | { accumulators: [AccumulatorTarget](./firestore_lite.md#accumulatortarget)\[\]; groups?: Array<string \| [Selectable](./firestore_lite.selectable.md#selectable_interface)>; } | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.distinct() + +Returns a set of distinct values from the inputs to this stage. + +

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc). + +

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s: + +

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using
+ +

Example: + +```typescript +// Get a list of unique author names in uppercase and genre combinations. +firestore.pipeline().collection("books") + .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") + .select("authorName"); + +``` + +Signature: + +```typescript +distinct(...groups: Array): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| groups | Array<string \| [Selectable](./firestore_lite.selectable.md#selectable_interface)> | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.execute() + +Executes this pipeline and returns a Promise to represent the asynchronous operation. + +

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously. + +

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: + +

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.
+ +

Example: + +```typescript +const futureResults = await firestore.pipeline().collection("books") + .where(gt(Field.of("rating"), 4.5)) + .select("title", "author", "rating") + .execute(); + +``` + A Promise representing the asynchronous pipeline execution. + +Signature: + +```typescript +execute(): Promise>>; +``` +Returns: + +Promise<Array<[PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class)<AppModelType>>> + +## Pipeline.findNearest() + +Signature: + +```typescript +findNearest(options: FindNearestOptions): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [FindNearestOptions](./firestore_lite.findnearestoptions.md#findnearestoptions_interface) | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.genericStage() + +Adds a generic stage to the pipeline. + +

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique `name` and a set of `params` that control its behavior. + +

Example (Assuming there is no "where" stage available in SDK): + +```typescript +// Assume we don't have a built-in "where" stage +firestore.pipeline().collection("books") + .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage + .select("title", "author"); + +``` + +Signature: + +```typescript +genericStage(name: string, params: any[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | The unique name of the generic stage to add. | +| params | any\[\] | A list of parameters to configure the generic stage's behavior. A new object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.limit() + +Limits the maximum number of documents returned by previous stages to `limit`. + +

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: + +

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.
+ +

Example: + +```typescript +// Limit the results to the top 10 highest-rated books +firestore.pipeline().collection("books") + .sort(Field.of("rating").descending()) + .limit(10); + +``` + +Signature: + +```typescript +limit(limit: number): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| limit | number | The maximum number of documents to return. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.offset() + +Skips the first `offset` number of documents from the results of previous stages. + +

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. + +

Example: + +```typescript +// Retrieve the second page of 20 results +firestore.pipeline().collection("books") + .sort(Field.of("published").descending()) + .offset(20) // Skip the first 20 results + .limit(20); // Take the next 20 results + +``` + +Signature: + +```typescript +offset(offset: number): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| offset | number | The number of documents to skip. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.select() + +Selects or creates a set of fields from the outputs of previous stages. + +

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be: + +

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using
+ +

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. + +

Example: + +```typescript +firestore.pipeline().collection("books") + .select( + "firstName", + Field.of("lastName"), + Field.of("address").toUppercase().as("upperAddress"), + ); + +``` + +Signature: + +```typescript +select(...selections: Array): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selections | Array<[Selectable](./firestore_lite.selectable.md#selectable_interface) \| string> | The fields to include in the output documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface) expressions or values representing field names. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.sort() + +Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria. + +

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. + +

Example: + +```typescript +// Sort books by rating in descending order, and then by title in ascending order for books +// with the same rating +firestore.pipeline().collection("books") + .sort( + Ordering.of(Field.of("rating")).descending(), + Ordering.of(Field.of("title")) // Ascending order is the default + ); + +``` + +Signature: + +```typescript +sort(...orderings: Ordering[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| orderings | [Ordering](./firestore_lite.ordering.md#ordering_class)\[\] | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.sort() + +Signature: + +```typescript +sort(options: { + orderings: Ordering[]; + }): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | { orderings: [Ordering](./firestore_lite.ordering.md#ordering_class)\[\]; } | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + +## Pipeline.where() + +Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface). + +

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to: + +

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.
+ +

Example: + +```typescript +firestore.pipeline().collection("books") + .where( + and( + gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 + Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") + ) + ); + +``` + +Signature: + +```typescript +where(condition: FilterCondition & Constant): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) & [Constant](./firestore_lite.constant.md#constant_class) | The [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) to apply. A new Pipeline object with this stage appended to the stage list. | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> + diff --git a/docs-devsite/firestore_lite.pipelineresult.md b/docs-devsite/firestore_lite.pipelineresult.md new file mode 100644 index 00000000000..16a64fd9b7c --- /dev/null +++ b/docs-devsite/firestore_lite.pipelineresult.md @@ -0,0 +1,184 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# PipelineResult class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods. + +

If the PipelineResult represents a non-document result, `ref` will return a undefined value. + +Signature: + +```typescript +export declare class PipelineResult +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [createTime](./firestore_lite.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was created. Undefined if this result is not a document. {Timestamp\|undefined} | +| [executionTime](./firestore_lite.pipelineresult.md#pipelineresultexecutiontime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | (BETA) The time at which the pipeline producing this result is executed. {Timestamp} | +| [id](./firestore_lite.pipelineresult.md#pipelineresultid) | | string \| undefined | (BETA) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. {string} | +| [ref](./firestore_lite.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) \| undefined | (BETA) The reference of the document, if it is a document; otherwise undefined. | +| [updateTime](./firestore_lite.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [data()](./firestore_lite.pipelineresult.md#pipelineresultdata) | | (BETA) Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. | +| [get(fieldPath)](./firestore_lite.pipelineresult.md#pipelineresultget) | | (BETA) Retrieves the field specified by field. | + +## PipelineResult.createTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time the document was created. Undefined if this result is not a document. + + {Timestamp\|undefined} + +Signature: + +```typescript +get createTime(): Timestamp | undefined; +``` + +## PipelineResult.executionTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time at which the pipeline producing this result is executed. + + {Timestamp} + +Signature: + +```typescript +get executionTime(): Timestamp; +``` + +## PipelineResult.id + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The ID of the document for which this PipelineResult contains data, if it is a document; otherwise `undefined`. + + {string} + +Signature: + +```typescript +get id(): string | undefined; +``` + +## PipelineResult.ref + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The reference of the document, if it is a document; otherwise `undefined`. + +Signature: + +```typescript +get ref(): DocumentReference | undefined; +``` + +## PipelineResult.updateTime + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. + + {Timestamp\|undefined} + +Signature: + +```typescript +get updateTime(): Timestamp | undefined; +``` + +## PipelineResult.data() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. + +Signature: + +```typescript +data(): AppModelType | undefined; +``` +Returns: + +AppModelType \| undefined + +{T\|undefined} An object containing all fields in the document or 'undefined' if the document doesn't exist. + +### Example + + +``` +let p = firestore.pipeline().collection('col'); + +p.execute().then(results => { + let data = results[0].data(); + console.log(`Retrieved data: ${JSON.stringify(data)}`); +}); + +``` + +## PipelineResult.get() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Retrieves the field specified by `field`. + +Signature: + +```typescript +get(fieldPath: string | FieldPath): any; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | | + +Returns: + +any + +{\*} The data at the specified field location or undefined if no such field exists. + +### Example + + +``` +let p = firestore.pipeline().collection('col'); + +p.execute().then(results => { + let field = results[0].get('a.b'); + console.log(`Retrieved field value: ${field}`); +}); + +``` + diff --git a/docs-devsite/firestore_lite.pipelinesource.md b/docs-devsite/firestore_lite.pipelinesource.md new file mode 100644 index 00000000000..9a5f0362c93 --- /dev/null +++ b/docs-devsite/firestore_lite.pipelinesource.md @@ -0,0 +1,109 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# PipelineSource class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). + +Signature: + +```typescript +export declare class PipelineSource +``` + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [collection(collectionPath)](./firestore_lite.pipelinesource.md#pipelinesourcecollection) | | (BETA) | +| [collectionGroup(collectionId)](./firestore_lite.pipelinesource.md#pipelinesourcecollectiongroup) | | (BETA) | +| [database()](./firestore_lite.pipelinesource.md#pipelinesourcedatabase) | | (BETA) | +| [documents(docs)](./firestore_lite.pipelinesource.md#pipelinesourcedocuments) | | (BETA) | + +## PipelineSource.collection() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +collection(collectionPath: string): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionPath | string | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) + +## PipelineSource.collectionGroup() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +collectionGroup(collectionId: string): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| collectionId | string | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) + +## PipelineSource.database() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +database(): Pipeline; +``` +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) + +## PipelineSource.documents() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +documents(docs: DocumentReference[]): Pipeline; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| docs | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)\[\] | | + +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) + diff --git a/docs-devsite/firestore_lite.query.md b/docs-devsite/firestore_lite.query.md index 48beee0e10c..210d2b0895e 100644 --- a/docs-devsite/firestore_lite.query.md +++ b/docs-devsite/firestore_lite.query.md @@ -36,6 +36,7 @@ export declare class QueryNewDbModelType and your custom type NewAppModelType. | @@ -79,6 +80,19 @@ The type of this Firestore reference. readonly type: 'query' | 'collection'; ``` +## Query.pipeline() + +Pipeline query. + +Signature: + +```typescript +pipeline(): Pipeline; +``` +Returns: + +[Pipeline](./firestore_lite.pipeline.md#pipeline_class) + ## Query.withConverter() Removes the current converter. diff --git a/docs-devsite/firestore_lite.querycompositefilterconstraint.md b/docs-devsite/firestore_lite.querycompositefilterconstraint.md index 1db79b79522..c32cfa1b5a0 100644 --- a/docs-devsite/firestore_lite.querycompositefilterconstraint.md +++ b/docs-devsite/firestore_lite.querycompositefilterconstraint.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # QueryCompositeFilterConstraint class -A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. +A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. Signature: diff --git a/docs-devsite/firestore_lite.regexcontains.md b/docs-devsite/firestore_lite.regexcontains.md new file mode 100644 index 00000000000..aaf069cde7f --- /dev/null +++ b/docs-devsite/firestore_lite.regexcontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RegexContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class RegexContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_lite.regexcontains.md#regexcontainsconstructor) | | (BETA) Constructs a new instance of the RegexContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.regexcontains.md#regexcontainsfilterable) | | true | (BETA) | + +## RegexContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `RegexContains` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +## RegexContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.regexmatch.md b/docs-devsite/firestore_lite.regexmatch.md new file mode 100644 index 00000000000..78d9029e3a9 --- /dev/null +++ b/docs-devsite/firestore_lite.regexmatch.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RegexMatch class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class RegexMatch extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, pattern)](./firestore_lite.regexmatch.md#regexmatchconstructor) | | (BETA) Constructs a new instance of the RegexMatch class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.regexmatch.md#regexmatchfilterable) | | true | (BETA) | + +## RegexMatch.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `RegexMatch` class + +Signature: + +```typescript +constructor(expr: Constant, pattern: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | + +## RegexMatch.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.replaceall.md b/docs-devsite/firestore_lite.replaceall.md new file mode 100644 index 00000000000..d318d936b96 --- /dev/null +++ b/docs-devsite/firestore_lite.replaceall.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ReplaceAll class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ReplaceAll extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, find, replace)](./firestore_lite.replaceall.md#replaceallconstructor) | | (BETA) Constructs a new instance of the ReplaceAll class | + +## ReplaceAll.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ReplaceAll` class + +Signature: + +```typescript +constructor(value: Constant, find: Constant, replace: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| find | [Constant](./firestore_lite.constant.md#constant_class) | | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.replacefirst.md b/docs-devsite/firestore_lite.replacefirst.md new file mode 100644 index 00000000000..d8e83dd2140 --- /dev/null +++ b/docs-devsite/firestore_lite.replacefirst.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ReplaceFirst class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ReplaceFirst extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, find, replace)](./firestore_lite.replacefirst.md#replacefirstconstructor) | | (BETA) Constructs a new instance of the ReplaceFirst class | + +## ReplaceFirst.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ReplaceFirst` class + +Signature: + +```typescript +constructor(value: Constant, find: Constant, replace: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| find | [Constant](./firestore_lite.constant.md#constant_class) | | +| replace | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.reverse.md b/docs-devsite/firestore_lite.reverse.md new file mode 100644 index 00000000000..65b4d256a5c --- /dev/null +++ b/docs-devsite/firestore_lite.reverse.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Reverse class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Reverse extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_lite.reverse.md#reverseconstructor) | | (BETA) Constructs a new instance of the Reverse class | + +## Reverse.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Reverse` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.select.md b/docs-devsite/firestore_lite.select.md new file mode 100644 index 00000000000..6221a7c41a7 --- /dev/null +++ b/docs-devsite/firestore_lite.select.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Select class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Select implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(projections)](./firestore_lite.select.md#selectconstructor) | | (BETA) Constructs a new instance of the Select class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.select.md#selectname) | | string | (BETA) | + +## Select.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Select` class + +Signature: + +```typescript +constructor(projections: Map); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| projections | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | + +## Select.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.selectable.md b/docs-devsite/firestore_lite.selectable.md new file mode 100644 index 00000000000..aeb75036db3 --- /dev/null +++ b/docs-devsite/firestore_lite.selectable.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Selectable interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An interface that represents a selectable expression. + +Signature: + +```typescript +export declare interface Selectable +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [selectable](./firestore_lite.selectable.md#selectableselectable) | true | (BETA) | + +## Selectable.selectable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +selectable: true; +``` diff --git a/docs-devsite/firestore_lite.sort.md b/docs-devsite/firestore_lite.sort.md new file mode 100644 index 00000000000..f387044b540 --- /dev/null +++ b/docs-devsite/firestore_lite.sort.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Sort class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Sort implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(orders)](./firestore_lite.sort.md#sortconstructor) | | (BETA) Constructs a new instance of the Sort class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.sort.md#sortname) | | string | (BETA) | + +## Sort.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Sort` class + +Signature: + +```typescript +constructor(orders: Ordering[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| orders | [Ordering](./firestore_lite.ordering.md#ordering_class)\[\] | | + +## Sort.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.stage.md b/docs-devsite/firestore_lite.stage.md new file mode 100644 index 00000000000..9aa24210656 --- /dev/null +++ b/docs-devsite/firestore_lite.stage.md @@ -0,0 +1,38 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Stage interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare interface Stage +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [name](./firestore_lite.stage.md#stagename) | string | (BETA) | + +## Stage.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.startswith.md b/docs-devsite/firestore_lite.startswith.md new file mode 100644 index 00000000000..a30cdae497a --- /dev/null +++ b/docs-devsite/firestore_lite.startswith.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StartsWith class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StartsWith extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, prefix)](./firestore_lite.startswith.md#startswithconstructor) | | (BETA) Constructs a new instance of the StartsWith class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.startswith.md#startswithfilterable) | | true | (BETA) | + +## StartsWith.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StartsWith` class + +Signature: + +```typescript +constructor(expr: Constant, prefix: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| prefix | [Constant](./firestore_lite.constant.md#constant_class) | | + +## StartsWith.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.strconcat.md b/docs-devsite/firestore_lite.strconcat.md new file mode 100644 index 00000000000..f3e1ad2bcde --- /dev/null +++ b/docs-devsite/firestore_lite.strconcat.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StrConcat class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StrConcat extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(first, rest)](./firestore_lite.strconcat.md#strconcatconstructor) | | (BETA) Constructs a new instance of the StrConcat class | + +## StrConcat.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StrConcat` class + +Signature: + +```typescript +constructor(first: Constant, rest: Constant[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| first | [Constant](./firestore_lite.constant.md#constant_class) | | +| rest | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | + diff --git a/docs-devsite/firestore_lite.strcontains.md b/docs-devsite/firestore_lite.strcontains.md new file mode 100644 index 00000000000..36fed4dd005 --- /dev/null +++ b/docs-devsite/firestore_lite.strcontains.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StrContains class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class StrContains extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr, substring)](./firestore_lite.strcontains.md#strcontainsconstructor) | | (BETA) Constructs a new instance of the StrContains class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.strcontains.md#strcontainsfilterable) | | true | (BETA) | + +## StrContains.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `StrContains` class + +Signature: + +```typescript +constructor(expr: Constant, substring: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | +| substring | [Constant](./firestore_lite.constant.md#constant_class) | | + +## StrContains.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/firestore_lite.subtract.md b/docs-devsite/firestore_lite.subtract.md new file mode 100644 index 00000000000..7d692f3c779 --- /dev/null +++ b/docs-devsite/firestore_lite.subtract.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Subtract class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Subtract extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(left, right)](./firestore_lite.subtract.md#subtractconstructor) | | (BETA) Constructs a new instance of the Subtract class | + +## Subtract.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Subtract` class + +Signature: + +```typescript +constructor(left: Constant, right: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| left | [Constant](./firestore_lite.constant.md#constant_class) | | +| right | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.sum.md b/docs-devsite/firestore_lite.sum.md new file mode 100644 index 00000000000..0f65e6aa601 --- /dev/null +++ b/docs-devsite/firestore_lite.sum.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Sum class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Sum extends FirestoreFunction implements Accumulator +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value, distinct)](./firestore_lite.sum.md#sumconstructor) | | (BETA) Constructs a new instance of the Sum class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [accumulator](./firestore_lite.sum.md#sumaccumulator) | | true | (BETA) | + +## Sum.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Sum` class + +Signature: + +```typescript +constructor(value: Constant, distinct: boolean); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | +| distinct | boolean | | + +## Sum.accumulator + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +accumulator: true; +``` diff --git a/docs-devsite/firestore_lite.timestampadd.md b/docs-devsite/firestore_lite.timestampadd.md new file mode 100644 index 00000000000..10f90f438e0 --- /dev/null +++ b/docs-devsite/firestore_lite.timestampadd.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampAdd class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampAdd extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(timestamp, unit, amount)](./firestore_lite.timestampadd.md#timestampaddconstructor) | | (BETA) Constructs a new instance of the TimestampAdd class | + +## TimestampAdd.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampAdd` class + +Signature: + +```typescript +constructor(timestamp: Constant, unit: Constant, amount: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.timestampsub.md b/docs-devsite/firestore_lite.timestampsub.md new file mode 100644 index 00000000000..076e525cf10 --- /dev/null +++ b/docs-devsite/firestore_lite.timestampsub.md @@ -0,0 +1,50 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampSub class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampSub extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(timestamp, unit, amount)](./firestore_lite.timestampsub.md#timestampsubconstructor) | | (BETA) Constructs a new instance of the TimestampSub class | + +## TimestampSub.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampSub` class + +Signature: + +```typescript +constructor(timestamp: Constant, unit: Constant, amount: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | | +| unit | [Constant](./firestore_lite.constant.md#constant_class) | | +| amount | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.timestamptounixmicros.md b/docs-devsite/firestore_lite.timestamptounixmicros.md new file mode 100644 index 00000000000..e9f398659a7 --- /dev/null +++ b/docs-devsite/firestore_lite.timestamptounixmicros.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixMicros class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixMicros extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.timestamptounixmicros.md#timestamptounixmicrosconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMicros class | + +## TimestampToUnixMicros.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixMicros` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.timestamptounixmillis.md b/docs-devsite/firestore_lite.timestamptounixmillis.md new file mode 100644 index 00000000000..b354dcc5585 --- /dev/null +++ b/docs-devsite/firestore_lite.timestamptounixmillis.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixMillis class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixMillis extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.timestamptounixmillis.md#timestamptounixmillisconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMillis class | + +## TimestampToUnixMillis.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixMillis` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.timestamptounixseconds.md b/docs-devsite/firestore_lite.timestamptounixseconds.md new file mode 100644 index 00000000000..2275fe6ebac --- /dev/null +++ b/docs-devsite/firestore_lite.timestamptounixseconds.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TimestampToUnixSeconds class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class TimestampToUnixSeconds extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.timestamptounixseconds.md#timestamptounixsecondsconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixSeconds class | + +## TimestampToUnixSeconds.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `TimestampToUnixSeconds` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.tolower.md b/docs-devsite/firestore_lite.tolower.md new file mode 100644 index 00000000000..49128adf612 --- /dev/null +++ b/docs-devsite/firestore_lite.tolower.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ToLower class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ToLower extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.tolower.md#tolowerconstructor) | | (BETA) Constructs a new instance of the ToLower class | + +## ToLower.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ToLower` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.toupper.md b/docs-devsite/firestore_lite.toupper.md new file mode 100644 index 00000000000..120c81d05bd --- /dev/null +++ b/docs-devsite/firestore_lite.toupper.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ToUpper class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class ToUpper extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.toupper.md#toupperconstructor) | | (BETA) Constructs a new instance of the ToUpper class | + +## ToUpper.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `ToUpper` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.trim.md b/docs-devsite/firestore_lite.trim.md new file mode 100644 index 00000000000..8de73fd1667 --- /dev/null +++ b/docs-devsite/firestore_lite.trim.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Trim class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Trim extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(expr)](./firestore_lite.trim.md#trimconstructor) | | (BETA) Constructs a new instance of the Trim class | + +## Trim.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Trim` class + +Signature: + +```typescript +constructor(expr: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expr | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.unixmicrostotimestamp.md b/docs-devsite/firestore_lite.unixmicrostotimestamp.md new file mode 100644 index 00000000000..a2e03a5dedf --- /dev/null +++ b/docs-devsite/firestore_lite.unixmicrostotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixMicrosToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixMicrosToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMicrosToTimestamp class | + +## UnixMicrosToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixMicrosToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.unixmillistotimestamp.md b/docs-devsite/firestore_lite.unixmillistotimestamp.md new file mode 100644 index 00000000000..a48df96c0e9 --- /dev/null +++ b/docs-devsite/firestore_lite.unixmillistotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixMillisToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixMillisToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMillisToTimestamp class | + +## UnixMillisToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixMillisToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.unixsecondstotimestamp.md b/docs-devsite/firestore_lite.unixsecondstotimestamp.md new file mode 100644 index 00000000000..99ad2f71285 --- /dev/null +++ b/docs-devsite/firestore_lite.unixsecondstotimestamp.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# UnixSecondsToTimestamp class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class UnixSecondsToTimestamp extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(input)](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestampconstructor) | | (BETA) Constructs a new instance of the UnixSecondsToTimestamp class | + +## UnixSecondsToTimestamp.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `UnixSecondsToTimestamp` class + +Signature: + +```typescript +constructor(input: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| input | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.vectorlength.md b/docs-devsite/firestore_lite.vectorlength.md new file mode 100644 index 00000000000..58636d6f95a --- /dev/null +++ b/docs-devsite/firestore_lite.vectorlength.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# VectorLength class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class VectorLength extends FirestoreFunction +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(value)](./firestore_lite.vectorlength.md#vectorlengthconstructor) | | (BETA) Constructs a new instance of the VectorLength class | + +## VectorLength.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `VectorLength` class + +Signature: + +```typescript +constructor(value: Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| value | [Constant](./firestore_lite.constant.md#constant_class) | | + diff --git a/docs-devsite/firestore_lite.where.md b/docs-devsite/firestore_lite.where.md new file mode 100644 index 00000000000..1d3674f2659 --- /dev/null +++ b/docs-devsite/firestore_lite.where.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Where class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Where implements Stage +``` +Implements: [Stage](./firestore_lite.stage.md#stage_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(condition)](./firestore_lite.where.md#whereconstructor) | | (BETA) Constructs a new instance of the Where class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [name](./firestore_lite.where.md#wherename) | | string | (BETA) | + +## Where.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Where` class + +Signature: + +```typescript +constructor(condition: FilterCondition & Constant); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| condition | [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) & [Constant](./firestore_lite.constant.md#constant_class) | | + +## Where.name + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +name: string; +``` diff --git a/docs-devsite/firestore_lite.xor.md b/docs-devsite/firestore_lite.xor.md new file mode 100644 index 00000000000..2a94acbe570 --- /dev/null +++ b/docs-devsite/firestore_lite.xor.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Xor class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + + +Signature: + +```typescript +export declare class Xor extends FirestoreFunction implements FilterCondition +``` +Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) + +Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(conditions)](./firestore_lite.xor.md#xorconstructor) | | (BETA) Constructs a new instance of the Xor class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [filterable](./firestore_lite.xor.md#xorfilterable) | | true | (BETA) | + +## Xor.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `Xor` class + +Signature: + +```typescript +constructor(conditions: FilterExpr[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| conditions | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | | + +## Xor.filterable + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +filterable: true; +``` diff --git a/docs-devsite/index.md b/docs-devsite/index.md index 82fdb36f076..2c22b58d80c 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -27,5 +27,5 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Vertex AI in Firebase Web SDK. | +| [@firebase/vertexai-preview](./vertexai-preview.md#vertexai-preview_package) | The Vertex AI For Firebase Web SDK. | diff --git a/docs-devsite/vertexai.baseparams.md b/docs-devsite/vertexai-preview.baseparams.md similarity index 67% rename from docs-devsite/vertexai.baseparams.md rename to docs-devsite/vertexai-preview.baseparams.md index 382ec825210..6756c919ccc 100644 --- a/docs-devsite/vertexai.baseparams.md +++ b/docs-devsite/vertexai-preview.baseparams.md @@ -22,8 +22,8 @@ export interface BaseParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | -| [safetySettings](./vertexai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | +| [generationConfig](./vertexai-preview.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | +| [safetySettings](./vertexai-preview.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | ## BaseParams.generationConfig diff --git a/docs-devsite/vertexai-preview.chatsession.md b/docs-devsite/vertexai-preview.chatsession.md new file mode 100644 index 00000000000..d8dc691d186 --- /dev/null +++ b/docs-devsite/vertexai-preview.chatsession.md @@ -0,0 +1,138 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ChatSession class +ChatSession class that enables sending chat messages and stores history of sent and received messages so far. + +Signature: + +```typescript +export declare class ChatSession +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai-preview.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai-preview.chatsession.md#chatsessionmodel) | | string | | +| [params](./vertexai-preview.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | +| [requestOptions](./vertexai-preview.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getHistory()](./vertexai-preview.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | +| [sendMessage(request)](./vertexai-preview.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./vertexai-preview.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | + +## ChatSession.(constructor) + +Constructs a new instance of the `ChatSession` class + +Signature: + +```typescript +constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| apiSettings | ApiSettings | | +| model | string | | +| params | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | +| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | + +## ChatSession.model + +Signature: + +```typescript +model: string; +``` + +## ChatSession.params + +Signature: + +```typescript +params?: StartChatParams | undefined; +``` + +## ChatSession.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions | undefined; +``` + +## ChatSession.getHistory() + +Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. + +Signature: + +```typescript +getHistory(): Promise; +``` +Returns: + +Promise<[Content](./vertexai-preview.content.md#content_interface)\[\]> + +## ChatSession.sendMessage() + +Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) + +Signature: + +```typescript +sendMessage(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> + +## ChatSession.sendMessageStream() + +Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. + +Signature: + +```typescript +sendMessageStream(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + diff --git a/docs-devsite/vertexai.citation.md b/docs-devsite/vertexai-preview.citation.md similarity index 68% rename from docs-devsite/vertexai.citation.md rename to docs-devsite/vertexai-preview.citation.md index b5f5a19f231..10a615ee247 100644 --- a/docs-devsite/vertexai.citation.md +++ b/docs-devsite/vertexai-preview.citation.md @@ -22,12 +22,12 @@ export interface Citation | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai.citation.md#citationendindex) | number | | -| [license](./vertexai.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | | -| [startIndex](./vertexai.citation.md#citationstartindex) | number | | -| [title](./vertexai.citation.md#citationtitle) | string | | -| [uri](./vertexai.citation.md#citationuri) | string | | +| [endIndex](./vertexai-preview.citation.md#citationendindex) | number | | +| [license](./vertexai-preview.citation.md#citationlicense) | string | | +| [publicationDate](./vertexai-preview.citation.md#citationpublicationdate) | Date | | +| [startIndex](./vertexai-preview.citation.md#citationstartindex) | number | | +| [title](./vertexai-preview.citation.md#citationtitle) | string | | +| [uri](./vertexai-preview.citation.md#citationuri) | string | | ## Citation.endIndex diff --git a/docs-devsite/vertexai.citationmetadata.md b/docs-devsite/vertexai-preview.citationmetadata.md similarity index 64% rename from docs-devsite/vertexai.citationmetadata.md rename to docs-devsite/vertexai-preview.citationmetadata.md index e3d41a37d98..fa740ca1af7 100644 --- a/docs-devsite/vertexai.citationmetadata.md +++ b/docs-devsite/vertexai-preview.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: @@ -22,7 +22,7 @@ export interface CitationMetadata | Property | Type | Description | | --- | --- | --- | -| [citations](./vertexai.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai.citation.md#citation_interface)\[\] | | +| [citations](./vertexai-preview.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai-preview.citation.md#citation_interface)\[\] | | ## CitationMetadata.citations diff --git a/docs-devsite/vertexai.content.md b/docs-devsite/vertexai-preview.content.md similarity index 76% rename from docs-devsite/vertexai.content.md rename to docs-devsite/vertexai-preview.content.md index 7a4634a62bc..26198a3951f 100644 --- a/docs-devsite/vertexai.content.md +++ b/docs-devsite/vertexai-preview.content.md @@ -22,8 +22,8 @@ export interface Content | Property | Type | Description | | --- | --- | --- | -| [parts](./vertexai.content.md#contentparts) | [Part](./vertexai.md#part)\[\] | | -| [role](./vertexai.content.md#contentrole) | [Role](./vertexai.md#role) | | +| [parts](./vertexai-preview.content.md#contentparts) | [Part](./vertexai-preview.md#part)\[\] | | +| [role](./vertexai-preview.content.md#contentrole) | [Role](./vertexai-preview.md#role) | | ## Content.parts diff --git a/docs-devsite/vertexai.counttokensrequest.md b/docs-devsite/vertexai-preview.counttokensrequest.md similarity index 68% rename from docs-devsite/vertexai.counttokensrequest.md rename to docs-devsite/vertexai-preview.counttokensrequest.md index db519b7eb11..07e5f0d85f3 100644 --- a/docs-devsite/vertexai.counttokensrequest.md +++ b/docs-devsite/vertexai-preview.counttokensrequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensRequest interface -Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) +Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) Signature: @@ -22,7 +22,7 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [contents](./vertexai-preview.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | ## CountTokensRequest.contents diff --git a/docs-devsite/vertexai.counttokensresponse.md b/docs-devsite/vertexai-preview.counttokensresponse.md similarity index 67% rename from docs-devsite/vertexai.counttokensresponse.md rename to docs-devsite/vertexai-preview.counttokensresponse.md index 2978f9a45bb..d097d5aacff 100644 --- a/docs-devsite/vertexai.counttokensresponse.md +++ b/docs-devsite/vertexai-preview.counttokensresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensResponse interface -Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). +Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). Signature: @@ -22,8 +22,8 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | -| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | -| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | +| [totalBillableCharacters](./vertexai-preview.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | +| [totalTokens](./vertexai-preview.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.totalBillableCharacters diff --git a/docs-devsite/vertexai.customerrordata.md b/docs-devsite/vertexai-preview.customerrordata.md similarity index 54% rename from docs-devsite/vertexai.customerrordata.md rename to docs-devsite/vertexai-preview.customerrordata.md index 701b1b84c49..f0af0574161 100644 --- a/docs-devsite/vertexai.customerrordata.md +++ b/docs-devsite/vertexai-preview.customerrordata.md @@ -22,10 +22,10 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | -| [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | -| [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | -| [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | +| [errorDetails](./vertexai-preview.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | +| [response](./vertexai-preview.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | +| [status](./vertexai-preview.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | +| [statusText](./vertexai-preview.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | ## CustomErrorData.errorDetails @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai.date_2.md b/docs-devsite/vertexai-preview.date_2.md similarity index 78% rename from docs-devsite/vertexai.date_2.md rename to docs-devsite/vertexai-preview.date_2.md index cf073bb86fe..5af031447c4 100644 --- a/docs-devsite/vertexai.date_2.md +++ b/docs-devsite/vertexai-preview.date_2.md @@ -22,9 +22,9 @@ export interface Date | Property | Type | Description | | --- | --- | --- | -| [day](./vertexai.date_2.md#date_2day) | number | | -| [month](./vertexai.date_2.md#date_2month) | number | | -| [year](./vertexai.date_2.md#date_2year) | number | | +| [day](./vertexai-preview.date_2.md#date_2day) | number | | +| [month](./vertexai-preview.date_2.md#date_2month) | number | | +| [year](./vertexai-preview.date_2.md#date_2year) | number | | ## Date\_2.day diff --git a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md similarity index 61% rename from docs-devsite/vertexai.enhancedgeneratecontentresponse.md rename to docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md index 535fb9def8f..132c5ed0be2 100644 --- a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md +++ b/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md @@ -17,14 +17,14 @@ Response object wrapped with helper methods. ```typescript export interface EnhancedGenerateContentResponse extends GenerateContentResponse ``` -Extends: [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) +Extends: [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | +| [functionCalls](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [text](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | ## EnhancedGenerateContentResponse.functionCalls diff --git a/docs-devsite/vertexai.errordetails.md b/docs-devsite/vertexai-preview.errordetails.md similarity index 68% rename from docs-devsite/vertexai.errordetails.md rename to docs-devsite/vertexai-preview.errordetails.md index 68959343439..45e84a618ab 100644 --- a/docs-devsite/vertexai.errordetails.md +++ b/docs-devsite/vertexai-preview.errordetails.md @@ -22,10 +22,10 @@ export interface ErrorDetails | Property | Type | Description | | --- | --- | --- | -| ["@type"](./vertexai.errordetails.md#errordetails"@type") | string | | -| [domain](./vertexai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | -| [metadata](./vertexai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | -| [reason](./vertexai.errordetails.md#errordetailsreason) | string | The reason for the error. | +| ["@type"](./vertexai-preview.errordetails.md#errordetails"@type") | string | | +| [domain](./vertexai-preview.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | +| [metadata](./vertexai-preview.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | +| [reason](./vertexai-preview.errordetails.md#errordetailsreason) | string | The reason for the error. | ## ErrorDetails."@type" diff --git a/docs-devsite/vertexai.filedata.md b/docs-devsite/vertexai-preview.filedata.md similarity index 81% rename from docs-devsite/vertexai.filedata.md rename to docs-devsite/vertexai-preview.filedata.md index 7e000174692..577b4b1910d 100644 --- a/docs-devsite/vertexai.filedata.md +++ b/docs-devsite/vertexai-preview.filedata.md @@ -22,8 +22,8 @@ export interface FileData | Property | Type | Description | | --- | --- | --- | -| [fileUri](./vertexai.filedata.md#filedatafileuri) | string | | -| [mimeType](./vertexai.filedata.md#filedatamimetype) | string | | +| [fileUri](./vertexai-preview.filedata.md#filedatafileuri) | string | | +| [mimeType](./vertexai-preview.filedata.md#filedatamimetype) | string | | ## FileData.fileUri diff --git a/docs-devsite/vertexai.filedatapart.md b/docs-devsite/vertexai-preview.filedatapart.md similarity index 60% rename from docs-devsite/vertexai.filedatapart.md rename to docs-devsite/vertexai-preview.filedatapart.md index 74512fa6d29..e03c056f588 100644 --- a/docs-devsite/vertexai.filedatapart.md +++ b/docs-devsite/vertexai-preview.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) Signature: @@ -22,11 +22,11 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | -| [fileData](./vertexai.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai.filedata.md#filedata_interface) | | -| [functionCall](./vertexai.filedatapart.md#filedatapartfunctioncall) | never | | -| [functionResponse](./vertexai.filedatapart.md#filedatapartfunctionresponse) | never | | -| [inlineData](./vertexai.filedatapart.md#filedatapartinlinedata) | never | | -| [text](./vertexai.filedatapart.md#filedataparttext) | never | | +| [fileData](./vertexai-preview.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai-preview.filedata.md#filedata_interface) | | +| [functionCall](./vertexai-preview.filedatapart.md#filedatapartfunctioncall) | never | | +| [functionResponse](./vertexai-preview.filedatapart.md#filedatapartfunctionresponse) | never | | +| [inlineData](./vertexai-preview.filedatapart.md#filedatapartinlinedata) | never | | +| [text](./vertexai-preview.filedatapart.md#filedataparttext) | never | | ## FileDataPart.fileData diff --git a/docs-devsite/vertexai.functioncall.md b/docs-devsite/vertexai-preview.functioncall.md similarity index 57% rename from docs-devsite/vertexai.functioncall.md rename to docs-devsite/vertexai-preview.functioncall.md index ca7bc015438..60e0ea50dc4 100644 --- a/docs-devsite/vertexai.functioncall.md +++ b/docs-devsite/vertexai-preview.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: @@ -22,8 +22,8 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | -| [args](./vertexai.functioncall.md#functioncallargs) | object | | -| [name](./vertexai.functioncall.md#functioncallname) | string | | +| [args](./vertexai-preview.functioncall.md#functioncallargs) | object | | +| [name](./vertexai-preview.functioncall.md#functioncallname) | string | | ## FunctionCall.args diff --git a/docs-devsite/vertexai.functioncallingconfig.md b/docs-devsite/vertexai-preview.functioncallingconfig.md similarity index 71% rename from docs-devsite/vertexai.functioncallingconfig.md rename to docs-devsite/vertexai-preview.functioncallingconfig.md index 3724fec5bf7..1965fb76e95 100644 --- a/docs-devsite/vertexai.functioncallingconfig.md +++ b/docs-devsite/vertexai-preview.functioncallingconfig.md @@ -21,8 +21,8 @@ export interface FunctionCallingConfig | Property | Type | Description | | --- | --- | --- | -| [allowedFunctionNames](./vertexai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | -| [mode](./vertexai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | +| [allowedFunctionNames](./vertexai-preview.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | +| [mode](./vertexai-preview.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | ## FunctionCallingConfig.allowedFunctionNames diff --git a/docs-devsite/vertexai.functioncallpart.md b/docs-devsite/vertexai-preview.functioncallpart.md similarity index 59% rename from docs-devsite/vertexai.functioncallpart.md rename to docs-devsite/vertexai-preview.functioncallpart.md index af8ccf1109a..5da204692f9 100644 --- a/docs-devsite/vertexai.functioncallpart.md +++ b/docs-devsite/vertexai-preview.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | | -| [functionResponse](./vertexai.functioncallpart.md#functioncallpartfunctionresponse) | never | | -| [inlineData](./vertexai.functioncallpart.md#functioncallpartinlinedata) | never | | -| [text](./vertexai.functioncallpart.md#functioncallparttext) | never | | +| [functionCall](./vertexai-preview.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | | +| [functionResponse](./vertexai-preview.functioncallpart.md#functioncallpartfunctionresponse) | never | | +| [inlineData](./vertexai-preview.functioncallpart.md#functioncallpartinlinedata) | never | | +| [text](./vertexai-preview.functioncallpart.md#functioncallparttext) | never | | ## FunctionCallPart.functionCall diff --git a/docs-devsite/vertexai.functiondeclaration.md b/docs-devsite/vertexai-preview.functiondeclaration.md similarity index 57% rename from docs-devsite/vertexai.functiondeclaration.md rename to docs-devsite/vertexai-preview.functiondeclaration.md index 211c1dd868d..e178c7e8bc3 100644 --- a/docs-devsite/vertexai.functiondeclaration.md +++ b/docs-devsite/vertexai-preview.functiondeclaration.md @@ -22,18 +22,18 @@ export declare interface FunctionDeclaration | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | -| [name](./vertexai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./vertexai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [description](./vertexai-preview.functiondeclaration.md#functiondeclarationdescription) | string | Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. | +| [name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | +| [parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description -Description and purpose of the function. Model uses it to decide how and whether to call the function. +Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. Signature: ```typescript -description: string; +description?: string; ``` ## FunctionDeclaration.name @@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format Signature: ```typescript -parameters?: ObjectSchemaInterface; +parameters?: FunctionDeclarationSchema; ``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationschema.md b/docs-devsite/vertexai-preview.functiondeclarationschema.md new file mode 100644 index 00000000000..7d0e5809d41 --- /dev/null +++ b/docs-devsite/vertexai-preview.functiondeclarationschema.md @@ -0,0 +1,70 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationSchema interface +Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). + +Signature: + +```typescript +export interface FunctionDeclarationSchema +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemadescription) | string | Optional. Description of the parameter. | +| [properties](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemaproperties) | { \[k: string\]: [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface); } | The format of the parameter. | +| [required](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemarequired) | string\[\] | Optional. Array of required parameters. | +| [type](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschematype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | The type of the parameter. | + +## FunctionDeclarationSchema.description + +Optional. Description of the parameter. + +Signature: + +```typescript +description?: string; +``` + +## FunctionDeclarationSchema.properties + +The format of the parameter. + +Signature: + +```typescript +properties: { + [k: string]: FunctionDeclarationSchemaProperty; + }; +``` + +## FunctionDeclarationSchema.required + +Optional. Array of required parameters. + +Signature: + +```typescript +required?: string[]; +``` + +## FunctionDeclarationSchema.type + +The type of the parameter. + +Signature: + +```typescript +type: FunctionDeclarationSchemaType; +``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md b/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md new file mode 100644 index 00000000000..ac2e1262dd0 --- /dev/null +++ b/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md @@ -0,0 +1,125 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationSchemaProperty interface +Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. + +Signature: + +```typescript +export interface FunctionDeclarationSchemaProperty +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertydescription) | string | Optional. The description of the property. | +| [enum](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyenum) | string\[\] | Optional. The enum of the property. | +| [example](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyexample) | unknown | Optional. The example of the property. | +| [format](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyformat) | string | Optional. The format of the property. | +| [items](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyitems) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | +| [nullable](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertynullable) | boolean | Optional. Whether the property is nullable. | +| [properties](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyproperties) | { \[k: string\]: [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface); } | Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). | +| [required](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyrequired) | string\[\] | Optional. Array of required property. | +| [type](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertytype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). | + +## FunctionDeclarationSchemaProperty.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## FunctionDeclarationSchemaProperty.enum + +Optional. The enum of the property. + +Signature: + +```typescript +enum?: string[]; +``` + +## FunctionDeclarationSchemaProperty.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## FunctionDeclarationSchemaProperty.format + +Optional. The format of the property. + +Signature: + +```typescript +format?: string; +``` + +## FunctionDeclarationSchemaProperty.items + +Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) + +Signature: + +```typescript +items?: FunctionDeclarationSchema; +``` + +## FunctionDeclarationSchemaProperty.nullable + +Optional. Whether the property is nullable. + +Signature: + +```typescript +nullable?: boolean; +``` + +## FunctionDeclarationSchemaProperty.properties + +Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). + +Signature: + +```typescript +properties?: { + [k: string]: FunctionDeclarationSchema; + }; +``` + +## FunctionDeclarationSchemaProperty.required + +Optional. Array of required property. + +Signature: + +```typescript +required?: string[]; +``` + +## FunctionDeclarationSchemaProperty.type + +Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). + +Signature: + +```typescript +type?: FunctionDeclarationSchemaType; +``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationstool.md b/docs-devsite/vertexai-preview.functiondeclarationstool.md new file mode 100644 index 00000000000..d1af4351a23 --- /dev/null +++ b/docs-devsite/vertexai-preview.functiondeclarationstool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationsTool interface +A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + +Signature: + +```typescript +export declare interface FunctionDeclarationsTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionDeclarations](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | + +## FunctionDeclarationsTool.functionDeclarations + +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. + +Signature: + +```typescript +functionDeclarations?: FunctionDeclaration[]; +``` diff --git a/docs-devsite/vertexai.functionresponse.md b/docs-devsite/vertexai-preview.functionresponse.md similarity index 50% rename from docs-devsite/vertexai.functionresponse.md rename to docs-devsite/vertexai-preview.functionresponse.md index 0ca553e0e6b..d89ace08df1 100644 --- a/docs-devsite/vertexai.functionresponse.md +++ b/docs-devsite/vertexai-preview.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. Signature: @@ -22,8 +22,8 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | -| [name](./vertexai.functionresponse.md#functionresponsename) | string | | -| [response](./vertexai.functionresponse.md#functionresponseresponse) | object | | +| [name](./vertexai-preview.functionresponse.md#functionresponsename) | string | | +| [response](./vertexai-preview.functionresponse.md#functionresponseresponse) | object | | ## FunctionResponse.name diff --git a/docs-devsite/vertexai.functionresponsepart.md b/docs-devsite/vertexai-preview.functionresponsepart.md similarity index 58% rename from docs-devsite/vertexai.functionresponsepart.md rename to docs-devsite/vertexai-preview.functionresponsepart.md index 1905c98cdc7..4e246d625f6 100644 --- a/docs-devsite/vertexai.functionresponsepart.md +++ b/docs-devsite/vertexai-preview.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | -| [functionResponse](./vertexai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | | -| [inlineData](./vertexai.functionresponsepart.md#functionresponsepartinlinedata) | never | | -| [text](./vertexai.functionresponsepart.md#functionresponseparttext) | never | | +| [functionCall](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctioncall) | never | | +| [functionResponse](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | | +| [inlineData](./vertexai-preview.functionresponsepart.md#functionresponsepartinlinedata) | never | | +| [text](./vertexai-preview.functionresponsepart.md#functionresponseparttext) | never | | ## FunctionResponsePart.functionCall diff --git a/docs-devsite/vertexai-preview.generatecontentcandidate.md b/docs-devsite/vertexai-preview.generatecontentcandidate.md new file mode 100644 index 00000000000..9f36fab1e87 --- /dev/null +++ b/docs-devsite/vertexai-preview.generatecontentcandidate.md @@ -0,0 +1,87 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerateContentCandidate interface +A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +export interface GenerateContentCandidate +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [citationMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | | +| [content](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai-preview.content.md#content_interface) | | +| [finishMessage](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | +| [finishReason](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai-preview.md#finishreason) | | +| [groundingMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | | +| [index](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidateindex) | number | | +| [safetyRatings](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | + +## GenerateContentCandidate.citationMetadata + +Signature: + +```typescript +citationMetadata?: CitationMetadata; +``` + +## GenerateContentCandidate.content + +Signature: + +```typescript +content: Content; +``` + +## GenerateContentCandidate.finishMessage + +Signature: + +```typescript +finishMessage?: string; +``` + +## GenerateContentCandidate.finishReason + +Signature: + +```typescript +finishReason?: FinishReason; +``` + +## GenerateContentCandidate.groundingMetadata + +Signature: + +```typescript +groundingMetadata?: GroundingMetadata; +``` + +## GenerateContentCandidate.index + +Signature: + +```typescript +index: number; +``` + +## GenerateContentCandidate.safetyRatings + +Signature: + +```typescript +safetyRatings?: SafetyRating[]; +``` diff --git a/docs-devsite/vertexai.generatecontentrequest.md b/docs-devsite/vertexai-preview.generatecontentrequest.md similarity index 54% rename from docs-devsite/vertexai.generatecontentrequest.md rename to docs-devsite/vertexai-preview.generatecontentrequest.md index 31f1103a2e2..68ce52340e8 100644 --- a/docs-devsite/vertexai.generatecontentrequest.md +++ b/docs-devsite/vertexai-preview.generatecontentrequest.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentRequest interface -Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) +Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) Signature: ```typescript export interface GenerateContentRequest extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai.md#tool)\[\] | | +| [contents](./vertexai-preview.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai-preview.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | +| [toolConfig](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai-preview.md#tool)\[\] | | ## GenerateContentRequest.contents diff --git a/docs-devsite/vertexai.generatecontentresponse.md b/docs-devsite/vertexai-preview.generatecontentresponse.md similarity index 50% rename from docs-devsite/vertexai.generatecontentresponse.md rename to docs-devsite/vertexai-preview.generatecontentresponse.md index 304674c9b6f..cb0fb0e3209 100644 --- a/docs-devsite/vertexai.generatecontentresponse.md +++ b/docs-devsite/vertexai-preview.generatecontentresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResponse interface -Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. +Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. Signature: @@ -22,9 +22,9 @@ export interface GenerateContentResponse | Property | Type | Description | | --- | --- | --- | -| [candidates](./vertexai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | -| [promptFeedback](./vertexai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | | -| [usageMetadata](./vertexai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | | +| [candidates](./vertexai-preview.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | +| [promptFeedback](./vertexai-preview.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | | +| [usageMetadata](./vertexai-preview.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | | ## GenerateContentResponse.candidates diff --git a/docs-devsite/vertexai.generatecontentresult.md b/docs-devsite/vertexai-preview.generatecontentresult.md similarity index 69% rename from docs-devsite/vertexai.generatecontentresult.md rename to docs-devsite/vertexai-preview.generatecontentresult.md index 3e162f9ebb2..87249a5bc55 100644 --- a/docs-devsite/vertexai.generatecontentresult.md +++ b/docs-devsite/vertexai-preview.generatecontentresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResult interface -Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. +Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. Signature: @@ -22,7 +22,7 @@ export interface GenerateContentResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | +| [response](./vertexai-preview.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | ## GenerateContentResult.response diff --git a/docs-devsite/vertexai.generatecontentstreamresult.md b/docs-devsite/vertexai-preview.generatecontentstreamresult.md similarity index 52% rename from docs-devsite/vertexai.generatecontentstreamresult.md rename to docs-devsite/vertexai-preview.generatecontentstreamresult.md index 340abb1d0bd..6fd46600079 100644 --- a/docs-devsite/vertexai.generatecontentstreamresult.md +++ b/docs-devsite/vertexai-preview.generatecontentstreamresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentStreamResult interface -Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. +Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. Signature: @@ -22,8 +22,8 @@ export interface GenerateContentStreamResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | -| [stream](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [response](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [stream](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | ## GenerateContentStreamResult.response diff --git a/docs-devsite/vertexai-preview.generationconfig.md b/docs-devsite/vertexai-preview.generationconfig.md new file mode 100644 index 00000000000..b14dfea053b --- /dev/null +++ b/docs-devsite/vertexai-preview.generationconfig.md @@ -0,0 +1,107 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerationConfig interface +Config options for content-related requests + +Signature: + +```typescript +export interface GenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidateCount](./vertexai-preview.generationconfig.md#generationconfigcandidatecount) | number | | +| [frequencyPenalty](./vertexai-preview.generationconfig.md#generationconfigfrequencypenalty) | number | | +| [maxOutputTokens](./vertexai-preview.generationconfig.md#generationconfigmaxoutputtokens) | number | | +| [presencePenalty](./vertexai-preview.generationconfig.md#generationconfigpresencepenalty) | number | | +| [responseMimeType](./vertexai-preview.generationconfig.md#generationconfigresponsemimetype) | string | Output response mimetype of the generated candidate text. Supported mimetypes are text/plain (default, text output) and application/json (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. | +| [stopSequences](./vertexai-preview.generationconfig.md#generationconfigstopsequences) | string\[\] | | +| [temperature](./vertexai-preview.generationconfig.md#generationconfigtemperature) | number | | +| [topK](./vertexai-preview.generationconfig.md#generationconfigtopk) | number | | +| [topP](./vertexai-preview.generationconfig.md#generationconfigtopp) | number | | + +## GenerationConfig.candidateCount + +Signature: + +```typescript +candidateCount?: number; +``` + +## GenerationConfig.frequencyPenalty + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## GenerationConfig.maxOutputTokens + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## GenerationConfig.presencePenalty + +Signature: + +```typescript +presencePenalty?: number; +``` + +## GenerationConfig.responseMimeType + +Output response mimetype of the generated candidate text. Supported mimetypes are `text/plain` (default, text output) and `application/json` (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. + +Signature: + +```typescript +responseMimeType?: string; +``` + +## GenerationConfig.stopSequences + +Signature: + +```typescript +stopSequences?: string[]; +``` + +## GenerationConfig.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## GenerationConfig.topK + +Signature: + +```typescript +topK?: number; +``` + +## GenerationConfig.topP + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/vertexai.generativecontentblob.md b/docs-devsite/vertexai-preview.generativecontentblob.md similarity index 76% rename from docs-devsite/vertexai.generativecontentblob.md rename to docs-devsite/vertexai-preview.generativecontentblob.md index dfcd098291f..b5dcb272027 100644 --- a/docs-devsite/vertexai.generativecontentblob.md +++ b/docs-devsite/vertexai-preview.generativecontentblob.md @@ -22,8 +22,8 @@ export interface GenerativeContentBlob | Property | Type | Description | | --- | --- | --- | -| [data](./vertexai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | -| [mimeType](./vertexai.generativecontentblob.md#generativecontentblobmimetype) | string | | +| [data](./vertexai-preview.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | +| [mimeType](./vertexai-preview.generativecontentblob.md#generativecontentblobmimetype) | string | | ## GenerativeContentBlob.data diff --git a/docs-devsite/vertexai-preview.generativemodel.md b/docs-devsite/vertexai-preview.generativemodel.md new file mode 100644 index 00000000000..a50fac631cc --- /dev/null +++ b/docs-devsite/vertexai-preview.generativemodel.md @@ -0,0 +1,201 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerativeModel class +Class for generative model APIs. + +Signature: + +```typescript +export declare class GenerativeModel +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai-preview.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./vertexai-preview.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | +| [model](./vertexai-preview.generativemodel.md#generativemodelmodel) | | string | | +| [requestOptions](./vertexai-preview.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | +| [safetySettings](./vertexai-preview.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | +| [systemInstruction](./vertexai-preview.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai-preview.content.md#content_interface) | | +| [toolConfig](./vertexai-preview.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai-preview.generativemodel.md#generativemodeltools) | | [Tool](./vertexai-preview.md#tool)\[\] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [countTokens(request)](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | +| [generateContent(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContentStream(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | +| [startChat(startChatParams)](./vertexai-preview.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | + +## GenerativeModel.(constructor) + +Constructs a new instance of the `GenerativeModel` class + +Signature: + +```typescript +constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | + +## GenerativeModel.generationConfig + +Signature: + +```typescript +generationConfig: GenerationConfig; +``` + +## GenerativeModel.model + +Signature: + +```typescript +model: string; +``` + +## GenerativeModel.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions; +``` + +## GenerativeModel.safetySettings + +Signature: + +```typescript +safetySettings: SafetySetting[]; +``` + +## GenerativeModel.systemInstruction + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## GenerativeModel.toolConfig + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## GenerativeModel.tools + +Signature: + +```typescript +tools?: Tool[]; +``` + +## GenerativeModel.countTokens() + +Counts the tokens in the provided request. + +Signature: + +```typescript +countTokens(request: CountTokensRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | + +Returns: + +Promise<[CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface)> + +## GenerativeModel.generateContent() + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +generateContent(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> + +## GenerativeModel.generateContentStream() + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + +## GenerativeModel.startChat() + +Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. + +Signature: + +```typescript +startChat(startChatParams?: StartChatParams): ChatSession; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| startChatParams | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | | + +Returns: + +[ChatSession](./vertexai-preview.chatsession.md#chatsession_class) + diff --git a/docs-devsite/vertexai.groundingattribution.md b/docs-devsite/vertexai-preview.groundingattribution.md similarity index 58% rename from docs-devsite/vertexai.groundingattribution.md rename to docs-devsite/vertexai-preview.groundingattribution.md index b72d8150635..2c7d2f09e0b 100644 --- a/docs-devsite/vertexai.groundingattribution.md +++ b/docs-devsite/vertexai-preview.groundingattribution.md @@ -21,10 +21,10 @@ export interface GroundingAttribution | Property | Type | Description | | --- | --- | --- | -| [confidenceScore](./vertexai.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./vertexai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./vertexai.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai.segment.md#segment_interface) | | -| [web](./vertexai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | +| [confidenceScore](./vertexai-preview.groundingattribution.md#groundingattributionconfidencescore) | number | | +| [retrievedContext](./vertexai-preview.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [segment](./vertexai-preview.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai-preview.segment.md#segment_interface) | | +| [web](./vertexai-preview.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | ## GroundingAttribution.confidenceScore diff --git a/docs-devsite/vertexai.groundingmetadata.md b/docs-devsite/vertexai-preview.groundingmetadata.md similarity index 66% rename from docs-devsite/vertexai.groundingmetadata.md rename to docs-devsite/vertexai-preview.groundingmetadata.md index 186f00d29a7..5f40a00457d 100644 --- a/docs-devsite/vertexai.groundingmetadata.md +++ b/docs-devsite/vertexai-preview.groundingmetadata.md @@ -22,9 +22,9 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./vertexai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface)\[\] | | -| [retrievalQueries](./vertexai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./vertexai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [groundingAttributions](./vertexai-preview.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface)\[\] | | +| [retrievalQueries](./vertexai-preview.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | +| [webSearchQueries](./vertexai-preview.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | ## GroundingMetadata.groundingAttributions diff --git a/docs-devsite/vertexai.inlinedatapart.md b/docs-devsite/vertexai-preview.inlinedatapart.md similarity index 60% rename from docs-devsite/vertexai.inlinedatapart.md rename to docs-devsite/vertexai-preview.inlinedatapart.md index 0cb064fc357..ae05f80ddb7 100644 --- a/docs-devsite/vertexai.inlinedatapart.md +++ b/docs-devsite/vertexai-preview.inlinedatapart.md @@ -22,11 +22,11 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | -| [functionResponse](./vertexai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | -| [inlineData](./vertexai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | | -| [text](./vertexai.inlinedatapart.md#inlinedataparttext) | never | | -| [videoMetadata](./vertexai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +| [functionCall](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctioncall) | never | | +| [functionResponse](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | +| [inlineData](./vertexai-preview.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | | +| [text](./vertexai-preview.inlinedatapart.md#inlinedataparttext) | never | | +| [videoMetadata](./vertexai-preview.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall diff --git a/docs-devsite/vertexai-preview.md b/docs-devsite/vertexai-preview.md new file mode 100644 index 00000000000..57fbab35909 --- /dev/null +++ b/docs-devsite/vertexai-preview.md @@ -0,0 +1,397 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# vertexai-preview package +The Vertex AI For Firebase Web SDK. + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getVertexAI(app, options)](./vertexai-preview.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. | +| function(vertexAI, ...) | +| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai-preview.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | + +## Classes + +| Class | Description | +| --- | --- | +| [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | +| [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI for Firebase SDK. | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [BlockReason](./vertexai-preview.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./vertexai-preview.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | +| [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ | +| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | +| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. | +| [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [Citation](./vertexai-preview.citation.md#citation_interface) | A single citation. | +| [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [Content](./vertexai-preview.content.md#content_interface) | Content type for both prompts and response candidates. | +| [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | +| [CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). | +| [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | +| [Date\_2](./vertexai-preview.date_2.md#date_2_interface) | Protobuf google.type.Date | +| [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | +| [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [FileData](./vertexai-preview.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | +| [FileDataPart](./vertexai-preview.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) | +| [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | +| [FunctionCallPart](./vertexai-preview.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). | +| [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | +| [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). | +| [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface) | Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. | +| [FunctionDeclarationsTool](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | +| [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./vertexai-preview.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | +| [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | +| [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | +| [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. | +| [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | +| [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | Config options for content-related requests | +| [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface) | | +| [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [InlineDataPart](./vertexai-preview.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | +| [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | +| [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | +| [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | +| [Segment](./vertexai-preview.segment.md#segment_interface) | | +| [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). | +| [TextPart](./vertexai-preview.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | +| [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | An instance of the Vertex AI for Firebase SDK. | +| [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI for Firebase SDK. | +| [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Describes the input video content. | +| [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [POSSIBLE\_ROLES](./vertexai-preview.md#possible_roles) | Possible roles. | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Part](./vertexai-preview.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [Role](./vertexai-preview.md#role) | Role is the producer of the content. | +| [Tool](./vertexai-preview.md#tool) | Defines a tool that model can call to access external knowledge. | + +## function(app, ...) + +### getVertexAI(app, options) {:#getvertexai_04094cf} + +Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. + +Signature: + +```typescript +export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | | + +Returns: + +[VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) + +## function(vertexAI, ...) + +### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} + +Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. + +Signature: + +```typescript +export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | + +Returns: + +[GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) + +## POSSIBLE\_ROLES + +Possible roles. + +Signature: + +```typescript +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +``` + +## Part + +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export declare type Role = (typeof POSSIBLE_ROLES)[number]; +``` + +## Tool + +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export declare type Tool = FunctionDeclarationsTool; +``` + +## BlockReason + +Reason that a prompt was blocked. + +Signature: + +```typescript +export declare enum BlockReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCKED\_REASON\_UNSPECIFIED | "BLOCKED_REASON_UNSPECIFIED" | | +| OTHER | "OTHER" | | +| SAFETY | "SAFETY" | | + +## FinishReason + +Reason that a candidate finished. + +Signature: + +```typescript +export declare enum FinishReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| FINISH\_REASON\_UNSPECIFIED | "FINISH_REASON_UNSPECIFIED" | | +| MAX\_TOKENS | "MAX_TOKENS" | | +| OTHER | "OTHER" | | +| RECITATION | "RECITATION" | | +| SAFETY | "SAFETY" | | +| STOP | "STOP" | | + +## FunctionCallingMode + + +Signature: + +```typescript +export declare enum FunctionCallingMode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ANY | "ANY" | | +| AUTO | "AUTO" | | +| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED" | | +| NONE | "NONE" | | + +## FunctionDeclarationSchemaType + +Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ + +Signature: + +```typescript +export declare enum FunctionDeclarationSchemaType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ARRAY | "ARRAY" | Array type. | +| BOOLEAN | "BOOLEAN" | Boolean type. | +| INTEGER | "INTEGER" | Integer type. | +| NUMBER | "NUMBER" | Number type. | +| OBJECT | "OBJECT" | Object type. | +| STRING | "STRING" | String type. | + +## HarmBlockMethod + + +Signature: + +```typescript +export declare enum HarmBlockMethod +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_BLOCK\_METHOD\_UNSPECIFIED | "HARM_BLOCK_METHOD_UNSPECIFIED" | | +| PROBABILITY | "PROBABILITY" | | +| SEVERITY | "SEVERITY" | | + +## HarmBlockThreshold + +Threshold above which a prompt or candidate will be blocked. + +Signature: + +```typescript +export declare enum HarmBlockThreshold +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | +| BLOCK\_NONE | "BLOCK_NONE" | | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | +| HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | | + +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +export declare enum HarmCategory +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | +| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | +| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | +| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | +| HARM\_CATEGORY\_UNSPECIFIED | "HARM_CATEGORY_UNSPECIFIED" | | + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +export declare enum HarmProbability +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_PROBABILITY\_UNSPECIFIED | "HARM_PROBABILITY_UNSPECIFIED" | | +| HIGH | "HIGH" | | +| LOW | "LOW" | | +| MEDIUM | "MEDIUM" | | +| NEGLIGIBLE | "NEGLIGIBLE" | | + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +export declare enum HarmSeverity +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | +| HARM\_SEVERITY\_UNSPECIFIED | "HARM_SEVERITY_UNSPECIFIED" | | + +## VertexAIErrorCode + +Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. + +Signature: + +```typescript +export declare const enum VertexAIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | + diff --git a/docs-devsite/vertexai.modelparams.md b/docs-devsite/vertexai-preview.modelparams.md similarity index 54% rename from docs-devsite/vertexai.modelparams.md rename to docs-devsite/vertexai-preview.modelparams.md index 590bc14e435..34d68f86714 100644 --- a/docs-devsite/vertexai.modelparams.md +++ b/docs-devsite/vertexai-preview.modelparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). Signature: ```typescript export interface ModelParams extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [model](./vertexai.modelparams.md#modelparamsmodel) | string | | -| [systemInstruction](./vertexai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.modelparams.md#modelparamstools) | [Tool](./vertexai.md#tool)\[\] | | +| [model](./vertexai-preview.modelparams.md#modelparamsmodel) | string | | +| [systemInstruction](./vertexai-preview.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | +| [toolConfig](./vertexai-preview.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai-preview.modelparams.md#modelparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | ## ModelParams.model diff --git a/docs-devsite/vertexai.promptfeedback.md b/docs-devsite/vertexai-preview.promptfeedback.md similarity index 66% rename from docs-devsite/vertexai.promptfeedback.md rename to docs-devsite/vertexai-preview.promptfeedback.md index 369ef02051d..cb27f10c8c3 100644 --- a/docs-devsite/vertexai.promptfeedback.md +++ b/docs-devsite/vertexai-preview.promptfeedback.md @@ -22,16 +22,16 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | -| [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | -| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | -| [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | +| [blockReason](./vertexai-preview.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai-preview.md#blockreason) | | +| [blockReasonMessage](./vertexai-preview.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | +| [safetyRatings](./vertexai-preview.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason Signature: ```typescript -blockReason?: BlockReason; +blockReason: BlockReason; ``` ## PromptFeedback.blockReasonMessage diff --git a/docs-devsite/vertexai.requestoptions.md b/docs-devsite/vertexai-preview.requestoptions.md similarity index 55% rename from docs-devsite/vertexai.requestoptions.md rename to docs-devsite/vertexai-preview.requestoptions.md index 6d074775520..550ec44ce96 100644 --- a/docs-devsite/vertexai.requestoptions.md +++ b/docs-devsite/vertexai-preview.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). Signature: @@ -22,12 +22,12 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | -| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | +| [baseUrl](./vertexai-preview.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebaseml.googleapis.com | +| [timeout](./vertexai-preview.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. | ## RequestOptions.baseUrl -Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com +Base url for endpoint. Defaults to https://firebaseml.googleapis.com Signature: @@ -37,7 +37,7 @@ baseUrl?: string; ## RequestOptions.timeout -Request timeout in milliseconds. Defaults to 180 seconds (180000ms). +Request timeout in milliseconds. Signature: diff --git a/docs-devsite/vertexai.retrievedcontextattribution.md b/docs-devsite/vertexai-preview.retrievedcontextattribution.md similarity index 76% rename from docs-devsite/vertexai.retrievedcontextattribution.md rename to docs-devsite/vertexai-preview.retrievedcontextattribution.md index e36bfacb3ec..0a121cdc004 100644 --- a/docs-devsite/vertexai.retrievedcontextattribution.md +++ b/docs-devsite/vertexai-preview.retrievedcontextattribution.md @@ -21,8 +21,8 @@ export interface RetrievedContextAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | -| [uri](./vertexai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | +| [title](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | +| [uri](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | ## RetrievedContextAttribution.title diff --git a/docs-devsite/vertexai.safetyrating.md b/docs-devsite/vertexai-preview.safetyrating.md similarity index 55% rename from docs-devsite/vertexai.safetyrating.md rename to docs-devsite/vertexai-preview.safetyrating.md index b5f204bef2c..65b1bc8fb42 100644 --- a/docs-devsite/vertexai.safetyrating.md +++ b/docs-devsite/vertexai-preview.safetyrating.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) +A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) Signature: @@ -22,12 +22,12 @@ export interface SafetyRating | Property | Type | Description | | --- | --- | --- | -| [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | -| [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | -| [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | -| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | | -| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | | -| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | | +| [blocked](./vertexai-preview.safetyrating.md#safetyratingblocked) | boolean | | +| [category](./vertexai-preview.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | +| [probability](./vertexai-preview.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai-preview.md#harmprobability) | | +| [probabilityScore](./vertexai-preview.safetyrating.md#safetyratingprobabilityscore) | number | | +| [severity](./vertexai-preview.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai-preview.md#harmseverity) | | +| [severityScore](./vertexai-preview.safetyrating.md#safetyratingseverityscore) | number | | ## SafetyRating.blocked diff --git a/docs-devsite/vertexai.safetysetting.md b/docs-devsite/vertexai-preview.safetysetting.md similarity index 64% rename from docs-devsite/vertexai.safetysetting.md rename to docs-devsite/vertexai-preview.safetysetting.md index 17fa1cff839..78678315805 100644 --- a/docs-devsite/vertexai.safetysetting.md +++ b/docs-devsite/vertexai-preview.safetysetting.md @@ -22,9 +22,9 @@ export interface SafetySetting | Property | Type | Description | | --- | --- | --- | -| [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | -| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | | -| [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | +| [category](./vertexai-preview.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | +| [method](./vertexai-preview.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | +| [threshold](./vertexai-preview.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | | ## SafetySetting.category @@ -39,7 +39,7 @@ category: HarmCategory; Signature: ```typescript -method?: HarmBlockMethod; +method: HarmBlockMethod; ``` ## SafetySetting.threshold diff --git a/docs-devsite/vertexai.segment.md b/docs-devsite/vertexai-preview.segment.md similarity index 75% rename from docs-devsite/vertexai.segment.md rename to docs-devsite/vertexai-preview.segment.md index db61f00a149..c64bc3ffcda 100644 --- a/docs-devsite/vertexai.segment.md +++ b/docs-devsite/vertexai-preview.segment.md @@ -21,9 +21,9 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai.segment.md#segmentendindex) | number | | -| [partIndex](./vertexai.segment.md#segmentpartindex) | number | | -| [startIndex](./vertexai.segment.md#segmentstartindex) | number | | +| [endIndex](./vertexai-preview.segment.md#segmentendindex) | number | | +| [partIndex](./vertexai-preview.segment.md#segmentpartindex) | number | | +| [startIndex](./vertexai-preview.segment.md#segmentstartindex) | number | | ## Segment.endIndex diff --git a/docs-devsite/vertexai.startchatparams.md b/docs-devsite/vertexai-preview.startchatparams.md similarity index 51% rename from docs-devsite/vertexai.startchatparams.md rename to docs-devsite/vertexai-preview.startchatparams.md index e07bbd91d82..f422f7a1ff0 100644 --- a/docs-devsite/vertexai.startchatparams.md +++ b/docs-devsite/vertexai-preview.startchatparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # StartChatParams interface -Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). +Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). Signature: ```typescript export interface StartChatParams extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [history](./vertexai.startchatparams.md#startchatparamshistory) | [Content](./vertexai.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.startchatparams.md#startchatparamstools) | [Tool](./vertexai.md#tool)\[\] | | +| [history](./vertexai-preview.startchatparams.md#startchatparamshistory) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai-preview.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | +| [toolConfig](./vertexai-preview.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai-preview.startchatparams.md#startchatparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | ## StartChatParams.history diff --git a/docs-devsite/vertexai.textpart.md b/docs-devsite/vertexai-preview.textpart.md similarity index 72% rename from docs-devsite/vertexai.textpart.md rename to docs-devsite/vertexai-preview.textpart.md index afee40a369d..206168180b2 100644 --- a/docs-devsite/vertexai.textpart.md +++ b/docs-devsite/vertexai-preview.textpart.md @@ -22,10 +22,10 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.textpart.md#textpartfunctioncall) | never | | -| [functionResponse](./vertexai.textpart.md#textpartfunctionresponse) | never | | -| [inlineData](./vertexai.textpart.md#textpartinlinedata) | never | | -| [text](./vertexai.textpart.md#textparttext) | string | | +| [functionCall](./vertexai-preview.textpart.md#textpartfunctioncall) | never | | +| [functionResponse](./vertexai-preview.textpart.md#textpartfunctionresponse) | never | | +| [inlineData](./vertexai-preview.textpart.md#textpartinlinedata) | never | | +| [text](./vertexai-preview.textpart.md#textparttext) | string | | ## TextPart.functionCall diff --git a/docs-devsite/vertexai.toolconfig.md b/docs-devsite/vertexai-preview.toolconfig.md similarity index 71% rename from docs-devsite/vertexai.toolconfig.md rename to docs-devsite/vertexai-preview.toolconfig.md index 30c62c17c01..4278eef509b 100644 --- a/docs-devsite/vertexai.toolconfig.md +++ b/docs-devsite/vertexai-preview.toolconfig.md @@ -22,12 +22,12 @@ export interface ToolConfig | Property | Type | Description | | --- | --- | --- | -| [functionCallingConfig](./vertexai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [functionCallingConfig](./vertexai-preview.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | ## ToolConfig.functionCallingConfig Signature: ```typescript -functionCallingConfig?: FunctionCallingConfig; +functionCallingConfig: FunctionCallingConfig; ``` diff --git a/docs-devsite/vertexai.usagemetadata.md b/docs-devsite/vertexai-preview.usagemetadata.md similarity index 63% rename from docs-devsite/vertexai.usagemetadata.md rename to docs-devsite/vertexai-preview.usagemetadata.md index d254f34335f..2829c9dbd5d 100644 --- a/docs-devsite/vertexai.usagemetadata.md +++ b/docs-devsite/vertexai-preview.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,9 +22,9 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | -| [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | -| [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | -| [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | +| [candidatesTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [promptTokenCount](./vertexai-preview.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [totalTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount diff --git a/docs-devsite/vertexai.vertexai.md b/docs-devsite/vertexai-preview.vertexai.md similarity index 58% rename from docs-devsite/vertexai.vertexai.md rename to docs-devsite/vertexai-preview.vertexai.md index 4797bf8bada..35991f2be12 100644 --- a/docs-devsite/vertexai.vertexai.md +++ b/docs-devsite/vertexai-preview.vertexai.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAI interface -An instance of the Vertex AI in Firebase SDK. +An instance of the Vertex AI for Firebase SDK. Signature: @@ -22,12 +22,12 @@ export interface VertexAI | Property | Type | Description | | --- | --- | --- | -| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | -| [location](./vertexai.vertexai.md#vertexailocation) | string | | +| [app](./vertexai-preview.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. | +| [location](./vertexai-preview.vertexai.md#vertexailocation) | string | | ## VertexAI.app -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. Signature: diff --git a/docs-devsite/vertexai.vertexaierror.md b/docs-devsite/vertexai-preview.vertexaierror.md similarity index 55% rename from docs-devsite/vertexai.vertexaierror.md rename to docs-devsite/vertexai-preview.vertexaierror.md index 86532ac6018..05a12c62b8e 100644 --- a/docs-devsite/vertexai.vertexaierror.md +++ b/docs-devsite/vertexai-preview.vertexaierror.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAIError class -Error class for the Vertex AI in Firebase SDK. +Error class for the Vertex AI for Firebase SDK. Signature: @@ -23,14 +23,15 @@ export declare class VertexAIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | +| [(constructor)(code, message, customErrorData)](./vertexai-preview.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | | -| [customErrorData](./vertexai.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | +| [code](./vertexai-preview.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | | +| [customErrorData](./vertexai-preview.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | | +| [message](./vertexai-preview.vertexaierror.md#vertexaierrormessage) | | string | | ## VertexAIError.(constructor) @@ -46,9 +47,9 @@ constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomEr | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | +| code | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode). | | message | string | A human-readable message describing the error. | -| customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | +| customErrorData | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | ## VertexAIError.code @@ -65,3 +66,11 @@ readonly code: VertexAIErrorCode; ```typescript readonly customErrorData?: CustomErrorData | undefined; ``` + +## VertexAIError.message + +Signature: + +```typescript +readonly message: string; +``` diff --git a/docs-devsite/vertexai.vertexaioptions.md b/docs-devsite/vertexai-preview.vertexaioptions.md similarity index 79% rename from docs-devsite/vertexai.vertexaioptions.md rename to docs-devsite/vertexai-preview.vertexaioptions.md index e15b525bfed..320132c22f9 100644 --- a/docs-devsite/vertexai.vertexaioptions.md +++ b/docs-devsite/vertexai-preview.vertexaioptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAIOptions interface -Options when initializing the Vertex AI in Firebase SDK. +Options when initializing the Vertex AI for Firebase SDK. Signature: @@ -22,7 +22,7 @@ export interface VertexAIOptions | Property | Type | Description | | --- | --- | --- | -| [location](./vertexai.vertexaioptions.md#vertexaioptionslocation) | string | | +| [location](./vertexai-preview.vertexaioptions.md#vertexaioptionslocation) | string | | ## VertexAIOptions.location diff --git a/docs-devsite/vertexai.videometadata.md b/docs-devsite/vertexai-preview.videometadata.md similarity index 66% rename from docs-devsite/vertexai.videometadata.md rename to docs-devsite/vertexai-preview.videometadata.md index b4f872c4e3d..04d8883bae9 100644 --- a/docs-devsite/vertexai.videometadata.md +++ b/docs-devsite/vertexai-preview.videometadata.md @@ -22,8 +22,8 @@ export interface VideoMetadata | Property | Type | Description | | --- | --- | --- | -| [endOffset](./vertexai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | -| [startOffset](./vertexai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [endOffset](./vertexai-preview.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [startOffset](./vertexai-preview.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | ## VideoMetadata.endOffset diff --git a/docs-devsite/vertexai.webattribution.md b/docs-devsite/vertexai-preview.webattribution.md similarity index 79% rename from docs-devsite/vertexai.webattribution.md rename to docs-devsite/vertexai-preview.webattribution.md index bb4fecf874d..5db6f94b82e 100644 --- a/docs-devsite/vertexai.webattribution.md +++ b/docs-devsite/vertexai-preview.webattribution.md @@ -21,8 +21,8 @@ export interface WebAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai.webattribution.md#webattributiontitle) | string | | -| [uri](./vertexai.webattribution.md#webattributionuri) | string | | +| [title](./vertexai-preview.webattribution.md#webattributiontitle) | string | | +| [uri](./vertexai-preview.webattribution.md#webattributionuri) | string | | ## WebAttribution.title diff --git a/docs-devsite/vertexai.arrayschema.md b/docs-devsite/vertexai.arrayschema.md deleted file mode 100644 index 8f228baf9e8..00000000000 --- a/docs-devsite/vertexai.arrayschema.md +++ /dev/null @@ -1,57 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArraySchema class -Schema class for "array" types. The `items` param should refer to the type of item that can be a member of the array. - -Signature: - -```typescript -export declare class ArraySchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams, items)](./vertexai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [items](./vertexai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./vertexai.md#typedschema) | | - -## ArraySchema.(constructor) - -Constructs a new instance of the `ArraySchema` class - -Signature: - -```typescript -constructor(schemaParams: SchemaParams, items: TypedSchema); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | -| items | [TypedSchema](./vertexai.md#typedschema) | | - -## ArraySchema.items - -Signature: - -```typescript -items: TypedSchema; -``` diff --git a/docs-devsite/vertexai.booleanschema.md b/docs-devsite/vertexai.booleanschema.md deleted file mode 100644 index 89449f26142..00000000000 --- a/docs-devsite/vertexai.booleanschema.md +++ /dev/null @@ -1,43 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# BooleanSchema class -Schema class for "boolean" types. - -Signature: - -```typescript -export declare class BooleanSchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | - -## BooleanSchema.(constructor) - -Constructs a new instance of the `BooleanSchema` class - -Signature: - -```typescript -constructor(schemaParams?: SchemaParams); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/vertexai.chatsession.md deleted file mode 100644 index cc5a75ace16..00000000000 --- a/docs-devsite/vertexai.chatsession.md +++ /dev/null @@ -1,138 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ChatSession class -ChatSession class that enables sending chat messages and stores history of sent and received messages so far. - -Signature: - -```typescript -export declare class ChatSession -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [model](./vertexai.chatsession.md#chatsessionmodel) | | string | | -| [params](./vertexai.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | -| [requestOptions](./vertexai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | - -## ChatSession.(constructor) - -Constructs a new instance of the `ChatSession` class - -Signature: - -```typescript -constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| apiSettings | ApiSettings | | -| model | string | | -| params | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | - -## ChatSession.model - -Signature: - -```typescript -model: string; -``` - -## ChatSession.params - -Signature: - -```typescript -params?: StartChatParams | undefined; -``` - -## ChatSession.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions | undefined; -``` - -## ChatSession.getHistory() - -Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. - -Signature: - -```typescript -getHistory(): Promise; -``` -Returns: - -Promise<[Content](./vertexai.content.md#content_interface)\[\]> - -## ChatSession.sendMessage() - -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) - -Signature: - -```typescript -sendMessage(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> - -## ChatSession.sendMessageStream() - -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. - -Signature: - -```typescript -sendMessageStream(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md deleted file mode 100644 index 5e728046639..00000000000 --- a/docs-devsite/vertexai.functiondeclarationstool.md +++ /dev/null @@ -1,35 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationsTool interface -A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - -Signature: - -```typescript -export declare interface FunctionDeclarationsTool -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | - -## FunctionDeclarationsTool.functionDeclarations - -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. - -Signature: - -```typescript -functionDeclarations?: FunctionDeclaration[]; -``` diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/vertexai.generatecontentcandidate.md deleted file mode 100644 index a30eef55485..00000000000 --- a/docs-devsite/vertexai.generatecontentcandidate.md +++ /dev/null @@ -1,87 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -export interface GenerateContentCandidate -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [citationMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | | -| [content](./vertexai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai.content.md#content_interface) | | -| [finishMessage](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | -| [finishReason](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai.md#finishreason) | | -| [groundingMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | | -| [index](./vertexai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | -| [safetyRatings](./vertexai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | - -## GenerateContentCandidate.citationMetadata - -Signature: - -```typescript -citationMetadata?: CitationMetadata; -``` - -## GenerateContentCandidate.content - -Signature: - -```typescript -content: Content; -``` - -## GenerateContentCandidate.finishMessage - -Signature: - -```typescript -finishMessage?: string; -``` - -## GenerateContentCandidate.finishReason - -Signature: - -```typescript -finishReason?: FinishReason; -``` - -## GenerateContentCandidate.groundingMetadata - -Signature: - -```typescript -groundingMetadata?: GroundingMetadata; -``` - -## GenerateContentCandidate.index - -Signature: - -```typescript -index: number; -``` - -## GenerateContentCandidate.safetyRatings - -Signature: - -```typescript -safetyRatings?: SafetyRating[]; -``` diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md deleted file mode 100644 index 3c3d0a14ffa..00000000000 --- a/docs-devsite/vertexai.generationconfig.md +++ /dev/null @@ -1,118 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerationConfig interface -Config options for content-related requests - -Signature: - -```typescript -export interface GenerationConfig -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidateCount](./vertexai.generationconfig.md#generationconfigcandidatecount) | number | | -| [frequencyPenalty](./vertexai.generationconfig.md#generationconfigfrequencypenalty) | number | | -| [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | -| [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | -| [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | -| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | -| [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | -| [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | -| [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | -| [topP](./vertexai.generationconfig.md#generationconfigtopp) | number | | - -## GenerationConfig.candidateCount - -Signature: - -```typescript -candidateCount?: number; -``` - -## GenerationConfig.frequencyPenalty - -Signature: - -```typescript -frequencyPenalty?: number; -``` - -## GenerationConfig.maxOutputTokens - -Signature: - -```typescript -maxOutputTokens?: number; -``` - -## GenerationConfig.presencePenalty - -Signature: - -```typescript -presencePenalty?: number; -``` - -## GenerationConfig.responseMimeType - -Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. - -Signature: - -```typescript -responseMimeType?: string; -``` - -## GenerationConfig.responseSchema - -Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. - -Signature: - -```typescript -responseSchema?: TypedSchema | SchemaRequest; -``` - -## GenerationConfig.stopSequences - -Signature: - -```typescript -stopSequences?: string[]; -``` - -## GenerationConfig.temperature - -Signature: - -```typescript -temperature?: number; -``` - -## GenerationConfig.topK - -Signature: - -```typescript -topK?: number; -``` - -## GenerationConfig.topP - -Signature: - -```typescript -topP?: number; -``` diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md deleted file mode 100644 index 7105f9c100b..00000000000 --- a/docs-devsite/vertexai.generativemodel.md +++ /dev/null @@ -1,201 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerativeModel class -Class for generative model APIs. - -Signature: - -```typescript -export declare class GenerativeModel -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | -| [model](./vertexai.generativemodel.md#generativemodelmodel) | | string | | -| [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | -| [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | -| [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.generativemodel.md#generativemodeltools) | | [Tool](./vertexai.md#tool)\[\] | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | - -## GenerativeModel.(constructor) - -Constructs a new instance of the `GenerativeModel` class - -Signature: - -```typescript -constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | - -## GenerativeModel.generationConfig - -Signature: - -```typescript -generationConfig: GenerationConfig; -``` - -## GenerativeModel.model - -Signature: - -```typescript -model: string; -``` - -## GenerativeModel.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions; -``` - -## GenerativeModel.safetySettings - -Signature: - -```typescript -safetySettings: SafetySetting[]; -``` - -## GenerativeModel.systemInstruction - -Signature: - -```typescript -systemInstruction?: Content; -``` - -## GenerativeModel.toolConfig - -Signature: - -```typescript -toolConfig?: ToolConfig; -``` - -## GenerativeModel.tools - -Signature: - -```typescript -tools?: Tool[]; -``` - -## GenerativeModel.countTokens() - -Counts the tokens in the provided request. - -Signature: - -```typescript -countTokens(request: CountTokensRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface)> - -## GenerativeModel.generateContent() - -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -generateContent(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> - -## GenerativeModel.generateContentStream() - -Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. - -Signature: - -```typescript -generateContentStream(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - -## GenerativeModel.startChat() - -Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. - -Signature: - -```typescript -startChat(startChatParams?: StartChatParams): ChatSession; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| startChatParams | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | | - -Returns: - -[ChatSession](./vertexai.chatsession.md#chatsession_class) - diff --git a/docs-devsite/vertexai.integerschema.md b/docs-devsite/vertexai.integerschema.md deleted file mode 100644 index 4822bdd618b..00000000000 --- a/docs-devsite/vertexai.integerschema.md +++ /dev/null @@ -1,43 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# IntegerSchema class -Schema class for "integer" types. - -Signature: - -```typescript -export declare class IntegerSchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | - -## IntegerSchema.(constructor) - -Constructs a new instance of the `IntegerSchema` class - -Signature: - -```typescript -constructor(schemaParams?: SchemaParams); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md deleted file mode 100644 index d9e26eabc5d..00000000000 --- a/docs-devsite/vertexai.md +++ /dev/null @@ -1,412 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# vertexai package -The Vertex AI in Firebase Web SDK. - -## Functions - -| Function | Description | -| --- | --- | -| function(app, ...) | -| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | -| function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | - -## Classes - -| Class | Description | -| --- | --- | -| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | -| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | -| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | -| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | -| [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | -| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | -| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | -| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | -| [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | - -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./vertexai.md#functioncallingmode) | | -| [HarmBlockMethod](./vertexai.md#harmblockmethod) | | -| [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | -| [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | -| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [Citation](./vertexai.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | -| [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | -| [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | -| [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | -| [Date\_2](./vertexai.date_2.md#date_2_interface) | Protobuf google.type.Date | -| [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | -| [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | -| [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | -| [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | -| [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | -| [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | -| [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | -| [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | -| [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | -| [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | -| [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | -| [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | -| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | -| [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | -| [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | -| [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | -| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | -| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | -| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | -| [Segment](./vertexai.segment.md#segment_interface) | | -| [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | -| [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | -| [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | -| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | -| [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | -| [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | -| [Role](./vertexai.md#role) | Role is the producer of the content. | -| [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | -| [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | - -## function(app, ...) - -### getVertexAI(app, options) {:#getvertexai_04094cf} - -Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | | - -Returns: - -[VertexAI](./vertexai.vertexai.md#vertexai_interface) - -## function(vertexAI, ...) - -### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} - -Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. - -Signature: - -```typescript -export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | - -Returns: - -[GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) - -## POSSIBLE\_ROLES - -Possible roles. - -Signature: - -```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] -``` - -## Part - -Content part - includes text, image/video, or function call/response part types. - -Signature: - -```typescript -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; -``` - -## Role - -Role is the producer of the content. - -Signature: - -```typescript -export type Role = (typeof POSSIBLE_ROLES)[number]; -``` - -## Tool - -Defines a tool that model can call to access external knowledge. - -Signature: - -```typescript -export declare type Tool = FunctionDeclarationsTool; -``` - -## TypedSchema - -A type that includes all specific Schema types. - -Signature: - -```typescript -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; -``` - -## BlockReason - -Reason that a prompt was blocked. - -Signature: - -```typescript -export declare enum BlockReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| OTHER | "OTHER" | | -| SAFETY | "SAFETY" | | - -## FinishReason - -Reason that a candidate finished. - -Signature: - -```typescript -export declare enum FinishReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| MAX\_TOKENS | "MAX_TOKENS" | | -| OTHER | "OTHER" | | -| RECITATION | "RECITATION" | | -| SAFETY | "SAFETY" | | -| STOP | "STOP" | | - -## FunctionCallingMode - - -Signature: - -```typescript -export declare enum FunctionCallingMode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | | -| AUTO | "AUTO" | | -| NONE | "NONE" | | - -## HarmBlockMethod - - -Signature: - -```typescript -export declare enum HarmBlockMethod -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| PROBABILITY | "PROBABILITY" | | -| SEVERITY | "SEVERITY" | | - -## HarmBlockThreshold - -Threshold above which a prompt or candidate will be blocked. - -Signature: - -```typescript -export declare enum HarmBlockThreshold -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | -| BLOCK\_NONE | "BLOCK_NONE" | | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | - -## HarmCategory - -Harm categories that would cause prompts or candidates to be blocked. - -Signature: - -```typescript -export declare enum HarmCategory -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | - -## HarmProbability - -Probability that a prompt or candidate matches a harm category. - -Signature: - -```typescript -export declare enum HarmProbability -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HIGH | "HIGH" | | -| LOW | "LOW" | | -| MEDIUM | "MEDIUM" | | -| NEGLIGIBLE | "NEGLIGIBLE" | | - -## HarmSeverity - -Harm severity levels. - -Signature: - -```typescript -export declare enum HarmSeverity -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | - -## SchemaType - -Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) - -Signature: - -```typescript -export declare enum SchemaType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "array" | Array type. | -| BOOLEAN | "boolean" | Boolean type. | -| INTEGER | "integer" | Integer type. | -| NUMBER | "number" | Number type. | -| OBJECT | "object" | Object type. | -| STRING | "string" | String type. | - -## VertexAIErrorCode - -Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. - -Signature: - -```typescript -export declare const enum VertexAIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | - diff --git a/docs-devsite/vertexai.numberschema.md b/docs-devsite/vertexai.numberschema.md deleted file mode 100644 index 8fdd9374652..00000000000 --- a/docs-devsite/vertexai.numberschema.md +++ /dev/null @@ -1,43 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# NumberSchema class -Schema class for "number" types. - -Signature: - -```typescript -export declare class NumberSchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | - -## NumberSchema.(constructor) - -Constructs a new instance of the `NumberSchema` class - -Signature: - -```typescript -constructor(schemaParams?: SchemaParams); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - diff --git a/docs-devsite/vertexai.objectschema.md b/docs-devsite/vertexai.objectschema.md deleted file mode 100644 index 8731960b220..00000000000 --- a/docs-devsite/vertexai.objectschema.md +++ /dev/null @@ -1,71 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ObjectSchema class -Schema class for "object" types. The `properties` param must be a map of `Schema` objects. - -Signature: - -```typescript -export declare class ObjectSchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams, properties, optionalProperties)](./vertexai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [optionalProperties](./vertexai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | -| [properties](./vertexai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | - -## ObjectSchema.(constructor) - -Constructs a new instance of the `ObjectSchema` class - -Signature: - -```typescript -constructor(schemaParams: SchemaParams, properties: { - [k: string]: TypedSchema; - }, optionalProperties?: string[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | -| properties | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | -| optionalProperties | string\[\] | | - -## ObjectSchema.optionalProperties - -Signature: - -```typescript -optionalProperties: string[]; -``` - -## ObjectSchema.properties - -Signature: - -```typescript -properties: { - [k: string]: TypedSchema; - }; -``` diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/vertexai.objectschemainterface.md deleted file mode 100644 index 6a4e052d183..00000000000 --- a/docs-devsite/vertexai.objectschemainterface.md +++ /dev/null @@ -1,43 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ObjectSchemaInterface interface -Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. - -Signature: - -```typescript -export interface ObjectSchemaInterface extends SchemaInterface -``` -Extends: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [optionalProperties](./vertexai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | -| [type](./vertexai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./vertexai.md#schematypeobject_enummember) | | - -## ObjectSchemaInterface.optionalProperties - -Signature: - -```typescript -optionalProperties?: string[]; -``` - -## ObjectSchemaInterface.type - -Signature: - -```typescript -type: SchemaType.OBJECT; -``` diff --git a/docs-devsite/vertexai.schema.md b/docs-devsite/vertexai.schema.md deleted file mode 100644 index f4a36c3c506..00000000000 --- a/docs-devsite/vertexai.schema.md +++ /dev/null @@ -1,250 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Schema class -Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with `JSON.stringify()` into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) - -Signature: - -```typescript -export declare abstract class Schema implements SchemaInterface -``` -Implements: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [description](./vertexai.schema.md#schemadescription) | | string | Optional. The description of the property. | -| [example](./vertexai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | -| [format](./vertexai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:

  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| -| [nullable](./vertexai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | -| [type](./vertexai.schema.md#schematype) | | [SchemaType](./vertexai.md#schematype) | Optional. The type of the property. [SchemaType](./vertexai.md#schematype). | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [array(arrayParams)](./vertexai.schema.md#schemaarray) | static | | -| [boolean(booleanParams)](./vertexai.schema.md#schemaboolean) | static | | -| [enumString(stringParams)](./vertexai.schema.md#schemaenumstring) | static | | -| [integer(integerParams)](./vertexai.schema.md#schemainteger) | static | | -| [number(numberParams)](./vertexai.schema.md#schemanumber) | static | | -| [object(objectParams)](./vertexai.schema.md#schemaobject) | static | | -| [string(stringParams)](./vertexai.schema.md#schemastring) | static | | - -## Schema.(constructor) - -Constructs a new instance of the `Schema` class - -Signature: - -```typescript -constructor(schemaParams: SchemaInterface); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | | - -## Schema.description - -Optional. The description of the property. - -Signature: - -```typescript -description?: string; -``` - -## Schema.example - -Optional. The example of the property. - -Signature: - -```typescript -example?: unknown; -``` - -## Schema.format - -Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
- -Signature: - -```typescript -format?: string; -``` - -## Schema.nullable - -Optional. Whether the property is nullable. Defaults to false. - -Signature: - -```typescript -nullable: boolean; -``` - -## Schema.type - -Optional. The type of the property. [SchemaType](./vertexai.md#schematype). - -Signature: - -```typescript -type: SchemaType; -``` - -## Schema.array() - -Signature: - -```typescript -static array(arrayParams: SchemaParams & { - items: Schema; - }): ArraySchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrayParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { items: [Schema](./vertexai.schema.md#schema_class); } | | - -Returns: - -[ArraySchema](./vertexai.arrayschema.md#arrayschema_class) - -## Schema.boolean() - -Signature: - -```typescript -static boolean(booleanParams?: SchemaParams): BooleanSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| booleanParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - -Returns: - -[BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) - -## Schema.enumString() - -Signature: - -```typescript -static enumString(stringParams: SchemaParams & { - enum: string[]; - }): StringSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | - -Returns: - -[StringSchema](./vertexai.stringschema.md#stringschema_class) - -## Schema.integer() - -Signature: - -```typescript -static integer(integerParams?: SchemaParams): IntegerSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| integerParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - -Returns: - -[IntegerSchema](./vertexai.integerschema.md#integerschema_class) - -## Schema.number() - -Signature: - -```typescript -static number(numberParams?: SchemaParams): NumberSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| numberParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - -Returns: - -[NumberSchema](./vertexai.numberschema.md#numberschema_class) - -## Schema.object() - -Signature: - -```typescript -static object(objectParams: SchemaParams & { - properties: { - [k: string]: Schema; - }; - optionalProperties?: string[]; - }): ObjectSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| objectParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./vertexai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | - -Returns: - -[ObjectSchema](./vertexai.objectschema.md#objectschema_class) - -## Schema.string() - -Signature: - -```typescript -static string(stringParams?: SchemaParams): StringSchema; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | - -Returns: - -[StringSchema](./vertexai.stringschema.md#stringschema_class) - diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/vertexai.schemainterface.md deleted file mode 100644 index 3992c9e5116..00000000000 --- a/docs-devsite/vertexai.schemainterface.md +++ /dev/null @@ -1,36 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SchemaInterface interface -Interface for [Schema](./vertexai.schema.md#schema_class) class. - -Signature: - -```typescript -export interface SchemaInterface extends SchemaShared -``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [type](./vertexai.schemainterface.md#schemainterfacetype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | - -## SchemaInterface.type - -The type of the property. [SchemaType](./vertexai.md#schematype). - -Signature: - -```typescript -type: SchemaType; -``` diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/vertexai.schemaparams.md deleted file mode 100644 index 3c6d9f385fd..00000000000 --- a/docs-devsite/vertexai.schemaparams.md +++ /dev/null @@ -1,21 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SchemaParams interface -Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. - -Signature: - -```typescript -export interface SchemaParams extends SchemaShared -``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> - diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/vertexai.schemarequest.md deleted file mode 100644 index f12259b1608..00000000000 --- a/docs-devsite/vertexai.schemarequest.md +++ /dev/null @@ -1,47 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SchemaRequest interface -Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. - -Signature: - -```typescript -export interface SchemaRequest extends SchemaShared -``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface)> - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [required](./vertexai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | -| [type](./vertexai.schemarequest.md#schemarequesttype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | - -## SchemaRequest.required - -Optional. Array of required property. - -Signature: - -```typescript -required?: string[]; -``` - -## SchemaRequest.type - -The type of the property. [SchemaType](./vertexai.md#schematype). - -Signature: - -```typescript -type: SchemaType; -``` diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md deleted file mode 100644 index 50cc6464ecf..00000000000 --- a/docs-devsite/vertexai.schemashared.md +++ /dev/null @@ -1,103 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SchemaShared interface -Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. - -Signature: - -```typescript -export interface SchemaShared -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | -| [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | -| [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | -| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. | -| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | -| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | -| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | - -## SchemaShared.description - -Optional. The description of the property. - -Signature: - -```typescript -description?: string; -``` - -## SchemaShared.enum - -Optional. The enum of the property. - -Signature: - -```typescript -enum?: string[]; -``` - -## SchemaShared.example - -Optional. The example of the property. - -Signature: - -```typescript -example?: unknown; -``` - -## SchemaShared.format - -Optional. The format of the property. - -Signature: - -```typescript -format?: string; -``` - -## SchemaShared.items - -Optional. The items of the property. - -Signature: - -```typescript -items?: T; -``` - -## SchemaShared.nullable - -Optional. Whether the property is nullable. - -Signature: - -```typescript -nullable?: boolean; -``` - -## SchemaShared.properties - -Optional. Map of `Schema` objects. - -Signature: - -```typescript -properties?: { - [k: string]: T; - }; -``` diff --git a/docs-devsite/vertexai.stringschema.md b/docs-devsite/vertexai.stringschema.md deleted file mode 100644 index bfafe0fe9df..00000000000 --- a/docs-devsite/vertexai.stringschema.md +++ /dev/null @@ -1,57 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StringSchema class -Schema class for "string" types. Can be used with or without enum values. - -Signature: - -```typescript -export declare class StringSchema extends Schema -``` -Extends: [Schema](./vertexai.schema.md#schema_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(schemaParams, enumValues)](./vertexai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [enum](./vertexai.stringschema.md#stringschemaenum) | | string\[\] | | - -## StringSchema.(constructor) - -Constructs a new instance of the `StringSchema` class - -Signature: - -```typescript -constructor(schemaParams?: SchemaParams, enumValues?: string[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | -| enumValues | string\[\] | | - -## StringSchema.enum - -Signature: - -```typescript -enum?: string[]; -``` From 9c4d5561924fc6e62a1650ca69dbf54169f81deb Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:30:10 -0700 Subject: [PATCH 032/295] license headers --- .../src/api/database_augmentation.ts | 17 +++++++++++ packages/firestore/src/api/pipeline.ts | 17 +++++++++++ .../firestore/src/api/user_data_writer.ts | 17 +++++++++++ packages/firestore/src/core/pipeline-util.ts | 29 ++++++++++--------- .../src/lite-api/database_augmentation.ts | 17 +++++++++++ .../firestore/src/lite-api/expressions.ts | 29 ++++++++++--------- packages/firestore/src/lite-api/overloads.ts | 17 +++++++++++ .../firestore/src/lite-api/pipeline-result.ts | 29 ++++++++++--------- .../firestore/src/lite-api/pipeline-source.ts | 29 ++++++++++--------- packages/firestore/src/lite-api/pipeline.ts | 29 ++++++++++--------- .../firestore/src/lite-api/pipeline_impl.ts | 17 +++++++++++ packages/firestore/src/lite-api/stage.ts | 29 ++++++++++--------- .../src/model/pipeline_stream_element.ts | 17 +++++++++++ .../test/integration/api/pipeline.test.ts | 29 ++++++++++--------- 14 files changed, 231 insertions(+), 91 deletions(-) diff --git a/packages/firestore/src/api/database_augmentation.ts b/packages/firestore/src/api/database_augmentation.ts index dcaff555a04..b59f160c1ba 100644 --- a/packages/firestore/src/api/database_augmentation.ts +++ b/packages/firestore/src/api/database_augmentation.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { And, FilterExpr, Or } from '../lite-api/expressions'; import { and, or } from '../lite-api/overloads'; import { Pipeline } from '../lite-api/pipeline'; diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index 3122fc36412..14532ba85c0 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult } from '../lite-api/pipeline-result'; diff --git a/packages/firestore/src/api/user_data_writer.ts b/packages/firestore/src/api/user_data_writer.ts index e21dcb70506..3567f72cd93 100644 --- a/packages/firestore/src/api/user_data_writer.ts +++ b/packages/firestore/src/api/user_data_writer.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { Bytes } from '../lite-api/bytes'; import { DocumentReference } from '../lite-api/reference'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 49704e06381..5f0f418d2e4 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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 { Constant, diff --git a/packages/firestore/src/lite-api/database_augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts index cce1214138a..a2c3652bd71 100644 --- a/packages/firestore/src/lite-api/database_augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { DocumentKey } from '../model/document_key'; import { Firestore } from './database'; diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 82729147e75..336a7b7d2b1 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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. + */ /* eslint @typescript-eslint/no-explicit-any: 0 */ diff --git a/packages/firestore/src/lite-api/overloads.ts b/packages/firestore/src/lite-api/overloads.ts index 2b3675db521..6a4b87e96c5 100644 --- a/packages/firestore/src/lite-api/overloads.ts +++ b/packages/firestore/src/lite-api/overloads.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { CompositeOperator } from '../core/filter'; import { And, FilterExpr, Or } from './expressions'; diff --git a/packages/firestore/src/lite-api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts index 9ebaeb1b306..f3951099ba2 100644 --- a/packages/firestore/src/lite-api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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 { ObjectValue } from '../model/object_value'; import { isOptionalEqual } from '../util/misc'; diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index 4b913e26ce7..a79c5cafc31 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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 { DocumentKey } from '../model/document_key'; diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 5b9c061c1b9..4d13d5dfddd 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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. + */ /* eslint @typescript-eslint/no-explicit-any: 0 */ diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index 30ccc04cbd4..cd490d31871 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { Pipeline } from './pipeline'; import { PipelineResult } from './pipeline-result'; diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 9f4c7735f03..b4fe237f79c 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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 { ObjectValue } from '../model/object_value'; import { diff --git a/packages/firestore/src/model/pipeline_stream_element.ts b/packages/firestore/src/model/pipeline_stream_element.ts index 9ec4c765993..efa27e2cc44 100644 --- a/packages/firestore/src/model/pipeline_stream_element.ts +++ b/packages/firestore/src/model/pipeline_stream_element.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright 2024 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 { SnapshotVersion } from '../core/snapshot_version'; import { DocumentKey } from './document_key'; diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index aa68528d124..8b107a7ea65 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -1,16 +1,19 @@ -// Copyright 2024 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. +/** + * @license + * Copyright 2024 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 { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; From 1aef450d38337d2cf2c0c330d594da1ab0320d3c Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:35:54 -0700 Subject: [PATCH 033/295] docgen --- common/api-review/firestore-lite.api.md | 8 ++++---- common/api-review/firestore.api.md | 8 ++++---- docs-devsite/firestore_.md | 10 +++++++++- docs-devsite/firestore_lite.md | 10 +++++++++- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 1d32a0b466a..8b7e4612dd9 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2146,7 +2146,7 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; -// @public (undocumented) +// @public export function useFirestorePipelines(): void; // @public @@ -2214,8 +2214,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index bafcf704778..c1106de776c 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2419,7 +2419,7 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; -// @public (undocumented) +// @public export function useFirestorePipelines(): void; // @public @@ -2490,8 +2490,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index 78db4044e17..4393d8999dc 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -56,7 +56,7 @@ countAll().as("totalUsers"); | [memoryEagerGarbageCollector()](./firestore_.md#memoryeagergarbagecollector) | Creates an instance of MemoryEagerGarbageCollector. This is also the default garbage collector unless it is explicitly specified otherwise. | | [persistentMultipleTabManager()](./firestore_.md#persistentmultipletabmanager) | Creates an instance of PersistentMultipleTabManager. | | [serverTimestamp()](./firestore_.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | -| [useFirestorePipelines()](./firestore_.md#usefirestorepipelines) | | +| [useFirestorePipelines()](./firestore_.md#usefirestorepipelines) | Copyright 2024 Google LLCLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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. | | function(array, ...) | | [arrayConcat(array, elements)](./firestore_.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. ```typescript @@ -2432,6 +2432,14 @@ export declare function serverTimestamp(): FieldValue; ### useFirestorePipelines() {:#usefirestorepipelines} + Copyright 2024 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. + Signature: ```typescript diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md index 59abff098db..2a9a2c55801 100644 --- a/docs-devsite/firestore_lite.md +++ b/docs-devsite/firestore_lite.md @@ -42,7 +42,7 @@ countAll().as("totalUsers"); | [documentId()](./firestore_lite.md#documentid) | Returns a special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. | | [getFirestore()](./firestore_lite.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [serverTimestamp()](./firestore_lite.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | -| [useFirestorePipelines()](./firestore_lite.md#usefirestorepipelines) | | +| [useFirestorePipelines()](./firestore_lite.md#usefirestorepipelines) | Copyright 2024 Google LLCLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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. | | function(array, ...) | | [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. ```typescript @@ -1976,6 +1976,14 @@ export declare function serverTimestamp(): FieldValue; ### useFirestorePipelines() {:#usefirestorepipelines} + Copyright 2024 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. + Signature: ```typescript From b20afe6e65c762a4be19f6c4d1830796045a6a09 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:48:08 -0700 Subject: [PATCH 034/295] docs-devsite fix --- docs-devsite/_toc.yaml | 127 +++--- docs-devsite/index.md | 2 +- docs-devsite/vertexai-preview.chatsession.md | 138 ------ ...texai-preview.functiondeclarationschema.md | 70 --- ...eview.functiondeclarationschemaproperty.md | 125 ------ ...rtexai-preview.functiondeclarationstool.md | 35 -- ...rtexai-preview.generatecontentcandidate.md | 87 ---- .../vertexai-preview.generationconfig.md | 107 ----- .../vertexai-preview.generativemodel.md | 201 --------- docs-devsite/vertexai-preview.md | 397 ----------------- docs-devsite/vertexai.arrayschema.md | 57 +++ ...w.baseparams.md => vertexai.baseparams.md} | 4 +- docs-devsite/vertexai.booleanschema.md | 43 ++ docs-devsite/vertexai.chatsession.md | 138 ++++++ ...eview.citation.md => vertexai.citation.md} | 12 +- ...tadata.md => vertexai.citationmetadata.md} | 4 +- ...preview.content.md => vertexai.content.md} | 4 +- ...uest.md => vertexai.counttokensrequest.md} | 4 +- ...nse.md => vertexai.counttokensresponse.md} | 6 +- ...rordata.md => vertexai.customerrordata.md} | 10 +- ...i-preview.date_2.md => vertexai.date_2.md} | 6 +- ...rtexai.enhancedgeneratecontentresponse.md} | 6 +- ...rordetails.md => vertexai.errordetails.md} | 8 +- ...eview.filedata.md => vertexai.filedata.md} | 4 +- ...ledatapart.md => vertexai.filedatapart.md} | 12 +- ...nctioncall.md => vertexai.functioncall.md} | 6 +- ...g.md => vertexai.functioncallingconfig.md} | 4 +- ...llpart.md => vertexai.functioncallpart.md} | 10 +- ...ion.md => vertexai.functiondeclaration.md} | 12 +- .../vertexai.functiondeclarationstool.md | 35 ++ ...sponse.md => vertexai.functionresponse.md} | 6 +- ...rt.md => vertexai.functionresponsepart.md} | 10 +- .../vertexai.generatecontentcandidate.md | 87 ++++ ....md => vertexai.generatecontentrequest.md} | 12 +- ...md => vertexai.generatecontentresponse.md} | 8 +- ...t.md => vertexai.generatecontentresult.md} | 4 +- ...> vertexai.generatecontentstreamresult.md} | 6 +- docs-devsite/vertexai.generationconfig.md | 118 +++++ ...b.md => vertexai.generativecontentblob.md} | 4 +- docs-devsite/vertexai.generativemodel.md | 201 +++++++++ ...on.md => vertexai.groundingattribution.md} | 8 +- ...adata.md => vertexai.groundingmetadata.md} | 6 +- ...datapart.md => vertexai.inlinedatapart.md} | 10 +- docs-devsite/vertexai.integerschema.md | 43 ++ docs-devsite/vertexai.md | 412 ++++++++++++++++++ ...modelparams.md => vertexai.modelparams.md} | 12 +- docs-devsite/vertexai.numberschema.md | 43 ++ docs-devsite/vertexai.objectschema.md | 71 +++ .../vertexai.objectschemainterface.md | 43 ++ ...feedback.md => vertexai.promptfeedback.md} | 8 +- ...toptions.md => vertexai.requestoptions.md} | 10 +- ...> vertexai.retrievedcontextattribution.md} | 4 +- ...fetyrating.md => vertexai.safetyrating.md} | 14 +- ...tysetting.md => vertexai.safetysetting.md} | 8 +- docs-devsite/vertexai.schema.md | 250 +++++++++++ docs-devsite/vertexai.schemainterface.md | 36 ++ docs-devsite/vertexai.schemaparams.md | 21 + docs-devsite/vertexai.schemarequest.md | 47 ++ docs-devsite/vertexai.schemashared.md | 103 +++++ ...preview.segment.md => vertexai.segment.md} | 6 +- ...tparams.md => vertexai.startchatparams.md} | 12 +- docs-devsite/vertexai.stringschema.md | 57 +++ ...eview.textpart.md => vertexai.textpart.md} | 8 +- ...w.toolconfig.md => vertexai.toolconfig.md} | 4 +- ...emetadata.md => vertexai.usagemetadata.md} | 8 +- ...eview.vertexai.md => vertexai.vertexai.md} | 8 +- ...exaierror.md => vertexai.vertexaierror.md} | 21 +- ...options.md => vertexai.vertexaioptions.md} | 4 +- ...ometadata.md => vertexai.videometadata.md} | 4 +- ...ribution.md => vertexai.webattribution.md} | 4 +- 70 files changed, 2035 insertions(+), 1380 deletions(-) delete mode 100644 docs-devsite/vertexai-preview.chatsession.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationschema.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationstool.md delete mode 100644 docs-devsite/vertexai-preview.generatecontentcandidate.md delete mode 100644 docs-devsite/vertexai-preview.generationconfig.md delete mode 100644 docs-devsite/vertexai-preview.generativemodel.md delete mode 100644 docs-devsite/vertexai-preview.md create mode 100644 docs-devsite/vertexai.arrayschema.md rename docs-devsite/{vertexai-preview.baseparams.md => vertexai.baseparams.md} (67%) create mode 100644 docs-devsite/vertexai.booleanschema.md create mode 100644 docs-devsite/vertexai.chatsession.md rename docs-devsite/{vertexai-preview.citation.md => vertexai.citation.md} (68%) rename docs-devsite/{vertexai-preview.citationmetadata.md => vertexai.citationmetadata.md} (64%) rename docs-devsite/{vertexai-preview.content.md => vertexai.content.md} (76%) rename docs-devsite/{vertexai-preview.counttokensrequest.md => vertexai.counttokensrequest.md} (68%) rename docs-devsite/{vertexai-preview.counttokensresponse.md => vertexai.counttokensresponse.md} (67%) rename docs-devsite/{vertexai-preview.customerrordata.md => vertexai.customerrordata.md} (54%) rename docs-devsite/{vertexai-preview.date_2.md => vertexai.date_2.md} (78%) rename docs-devsite/{vertexai-preview.enhancedgeneratecontentresponse.md => vertexai.enhancedgeneratecontentresponse.md} (61%) rename docs-devsite/{vertexai-preview.errordetails.md => vertexai.errordetails.md} (68%) rename docs-devsite/{vertexai-preview.filedata.md => vertexai.filedata.md} (81%) rename docs-devsite/{vertexai-preview.filedatapart.md => vertexai.filedatapart.md} (60%) rename docs-devsite/{vertexai-preview.functioncall.md => vertexai.functioncall.md} (57%) rename docs-devsite/{vertexai-preview.functioncallingconfig.md => vertexai.functioncallingconfig.md} (71%) rename docs-devsite/{vertexai-preview.functioncallpart.md => vertexai.functioncallpart.md} (59%) rename docs-devsite/{vertexai-preview.functiondeclaration.md => vertexai.functiondeclaration.md} (57%) create mode 100644 docs-devsite/vertexai.functiondeclarationstool.md rename docs-devsite/{vertexai-preview.functionresponse.md => vertexai.functionresponse.md} (50%) rename docs-devsite/{vertexai-preview.functionresponsepart.md => vertexai.functionresponsepart.md} (58%) create mode 100644 docs-devsite/vertexai.generatecontentcandidate.md rename docs-devsite/{vertexai-preview.generatecontentrequest.md => vertexai.generatecontentrequest.md} (54%) rename docs-devsite/{vertexai-preview.generatecontentresponse.md => vertexai.generatecontentresponse.md} (50%) rename docs-devsite/{vertexai-preview.generatecontentresult.md => vertexai.generatecontentresult.md} (69%) rename docs-devsite/{vertexai-preview.generatecontentstreamresult.md => vertexai.generatecontentstreamresult.md} (52%) create mode 100644 docs-devsite/vertexai.generationconfig.md rename docs-devsite/{vertexai-preview.generativecontentblob.md => vertexai.generativecontentblob.md} (76%) create mode 100644 docs-devsite/vertexai.generativemodel.md rename docs-devsite/{vertexai-preview.groundingattribution.md => vertexai.groundingattribution.md} (58%) rename docs-devsite/{vertexai-preview.groundingmetadata.md => vertexai.groundingmetadata.md} (66%) rename docs-devsite/{vertexai-preview.inlinedatapart.md => vertexai.inlinedatapart.md} (60%) create mode 100644 docs-devsite/vertexai.integerschema.md create mode 100644 docs-devsite/vertexai.md rename docs-devsite/{vertexai-preview.modelparams.md => vertexai.modelparams.md} (54%) create mode 100644 docs-devsite/vertexai.numberschema.md create mode 100644 docs-devsite/vertexai.objectschema.md create mode 100644 docs-devsite/vertexai.objectschemainterface.md rename docs-devsite/{vertexai-preview.promptfeedback.md => vertexai.promptfeedback.md} (66%) rename docs-devsite/{vertexai-preview.requestoptions.md => vertexai.requestoptions.md} (55%) rename docs-devsite/{vertexai-preview.retrievedcontextattribution.md => vertexai.retrievedcontextattribution.md} (76%) rename docs-devsite/{vertexai-preview.safetyrating.md => vertexai.safetyrating.md} (55%) rename docs-devsite/{vertexai-preview.safetysetting.md => vertexai.safetysetting.md} (64%) create mode 100644 docs-devsite/vertexai.schema.md create mode 100644 docs-devsite/vertexai.schemainterface.md create mode 100644 docs-devsite/vertexai.schemaparams.md create mode 100644 docs-devsite/vertexai.schemarequest.md create mode 100644 docs-devsite/vertexai.schemashared.md rename docs-devsite/{vertexai-preview.segment.md => vertexai.segment.md} (75%) rename docs-devsite/{vertexai-preview.startchatparams.md => vertexai.startchatparams.md} (51%) create mode 100644 docs-devsite/vertexai.stringschema.md rename docs-devsite/{vertexai-preview.textpart.md => vertexai.textpart.md} (72%) rename docs-devsite/{vertexai-preview.toolconfig.md => vertexai.toolconfig.md} (71%) rename docs-devsite/{vertexai-preview.usagemetadata.md => vertexai.usagemetadata.md} (63%) rename docs-devsite/{vertexai-preview.vertexai.md => vertexai.vertexai.md} (58%) rename docs-devsite/{vertexai-preview.vertexaierror.md => vertexai.vertexaierror.md} (55%) rename docs-devsite/{vertexai-preview.vertexaioptions.md => vertexai.vertexaioptions.md} (79%) rename docs-devsite/{vertexai-preview.videometadata.md => vertexai.videometadata.md} (66%) rename docs-devsite/{vertexai-preview.webattribution.md => vertexai.webattribution.md} (79%) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 569c436a053..26c520a12ba 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -811,105 +811,124 @@ toc: path: /docs/reference/js/storage.uploadtask.md - title: UploadTaskSnapshot path: /docs/reference/js/storage.uploadtasksnapshot.md - - title: vertexai-preview - path: /docs/reference/js/vertexai-preview.md + - title: vertexai + path: /docs/reference/js/vertexai.md section: + - title: ArraySchema + path: /docs/reference/js/vertexai.arrayschema.md - title: BaseParams - path: /docs/reference/js/vertexai-preview.baseparams.md + path: /docs/reference/js/vertexai.baseparams.md + - title: BooleanSchema + path: /docs/reference/js/vertexai.booleanschema.md - title: ChatSession - path: /docs/reference/js/vertexai-preview.chatsession.md + path: /docs/reference/js/vertexai.chatsession.md - title: Citation - path: /docs/reference/js/vertexai-preview.citation.md + path: /docs/reference/js/vertexai.citation.md - title: CitationMetadata - path: /docs/reference/js/vertexai-preview.citationmetadata.md + path: /docs/reference/js/vertexai.citationmetadata.md - title: Content - path: /docs/reference/js/vertexai-preview.content.md + path: /docs/reference/js/vertexai.content.md - title: CountTokensRequest - path: /docs/reference/js/vertexai-preview.counttokensrequest.md + path: /docs/reference/js/vertexai.counttokensrequest.md - title: CountTokensResponse - path: /docs/reference/js/vertexai-preview.counttokensresponse.md + path: /docs/reference/js/vertexai.counttokensresponse.md - title: CustomErrorData - path: /docs/reference/js/vertexai-preview.customerrordata.md + path: /docs/reference/js/vertexai.customerrordata.md - title: Date_2 - path: /docs/reference/js/vertexai-preview.date_2.md + path: /docs/reference/js/vertexai.date_2.md - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai-preview.enhancedgeneratecontentresponse.md + path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md - title: ErrorDetails - path: /docs/reference/js/vertexai-preview.errordetails.md + path: /docs/reference/js/vertexai.errordetails.md - title: FileData - path: /docs/reference/js/vertexai-preview.filedata.md + path: /docs/reference/js/vertexai.filedata.md - title: FileDataPart - path: /docs/reference/js/vertexai-preview.filedatapart.md + path: /docs/reference/js/vertexai.filedatapart.md - title: FunctionCall - path: /docs/reference/js/vertexai-preview.functioncall.md + path: /docs/reference/js/vertexai.functioncall.md - title: FunctionCallingConfig - path: /docs/reference/js/vertexai-preview.functioncallingconfig.md + path: /docs/reference/js/vertexai.functioncallingconfig.md - title: FunctionCallPart - path: /docs/reference/js/vertexai-preview.functioncallpart.md + path: /docs/reference/js/vertexai.functioncallpart.md - title: FunctionDeclaration - path: /docs/reference/js/vertexai-preview.functiondeclaration.md - - title: FunctionDeclarationSchema - path: /docs/reference/js/vertexai-preview.functiondeclarationschema.md - - title: FunctionDeclarationSchemaProperty - path: >- - /docs/reference/js/vertexai-preview.functiondeclarationschemaproperty.md + path: /docs/reference/js/vertexai.functiondeclaration.md - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai-preview.functiondeclarationstool.md + path: /docs/reference/js/vertexai.functiondeclarationstool.md - title: FunctionResponse - path: /docs/reference/js/vertexai-preview.functionresponse.md + path: /docs/reference/js/vertexai.functionresponse.md - title: FunctionResponsePart - path: /docs/reference/js/vertexai-preview.functionresponsepart.md + path: /docs/reference/js/vertexai.functionresponsepart.md - title: GenerateContentCandidate - path: /docs/reference/js/vertexai-preview.generatecontentcandidate.md + path: /docs/reference/js/vertexai.generatecontentcandidate.md - title: GenerateContentRequest - path: /docs/reference/js/vertexai-preview.generatecontentrequest.md + path: /docs/reference/js/vertexai.generatecontentrequest.md - title: GenerateContentResponse - path: /docs/reference/js/vertexai-preview.generatecontentresponse.md + path: /docs/reference/js/vertexai.generatecontentresponse.md - title: GenerateContentResult - path: /docs/reference/js/vertexai-preview.generatecontentresult.md + path: /docs/reference/js/vertexai.generatecontentresult.md - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai-preview.generatecontentstreamresult.md + path: /docs/reference/js/vertexai.generatecontentstreamresult.md - title: GenerationConfig - path: /docs/reference/js/vertexai-preview.generationconfig.md + path: /docs/reference/js/vertexai.generationconfig.md - title: GenerativeContentBlob - path: /docs/reference/js/vertexai-preview.generativecontentblob.md + path: /docs/reference/js/vertexai.generativecontentblob.md - title: GenerativeModel - path: /docs/reference/js/vertexai-preview.generativemodel.md + path: /docs/reference/js/vertexai.generativemodel.md - title: GroundingAttribution - path: /docs/reference/js/vertexai-preview.groundingattribution.md + path: /docs/reference/js/vertexai.groundingattribution.md - title: GroundingMetadata - path: /docs/reference/js/vertexai-preview.groundingmetadata.md + path: /docs/reference/js/vertexai.groundingmetadata.md - title: InlineDataPart - path: /docs/reference/js/vertexai-preview.inlinedatapart.md + path: /docs/reference/js/vertexai.inlinedatapart.md + - title: IntegerSchema + path: /docs/reference/js/vertexai.integerschema.md - title: ModelParams - path: /docs/reference/js/vertexai-preview.modelparams.md + path: /docs/reference/js/vertexai.modelparams.md + - title: NumberSchema + path: /docs/reference/js/vertexai.numberschema.md + - title: ObjectSchema + path: /docs/reference/js/vertexai.objectschema.md + - title: ObjectSchemaInterface + path: /docs/reference/js/vertexai.objectschemainterface.md - title: PromptFeedback - path: /docs/reference/js/vertexai-preview.promptfeedback.md + path: /docs/reference/js/vertexai.promptfeedback.md - title: RequestOptions - path: /docs/reference/js/vertexai-preview.requestoptions.md + path: /docs/reference/js/vertexai.requestoptions.md - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai-preview.retrievedcontextattribution.md + path: /docs/reference/js/vertexai.retrievedcontextattribution.md - title: SafetyRating - path: /docs/reference/js/vertexai-preview.safetyrating.md + path: /docs/reference/js/vertexai.safetyrating.md - title: SafetySetting - path: /docs/reference/js/vertexai-preview.safetysetting.md + path: /docs/reference/js/vertexai.safetysetting.md + - title: Schema + path: /docs/reference/js/vertexai.schema.md + - title: SchemaInterface + path: /docs/reference/js/vertexai.schemainterface.md + - title: SchemaParams + path: /docs/reference/js/vertexai.schemaparams.md + - title: SchemaRequest + path: /docs/reference/js/vertexai.schemarequest.md + - title: SchemaShared + path: /docs/reference/js/vertexai.schemashared.md - title: Segment - path: /docs/reference/js/vertexai-preview.segment.md + path: /docs/reference/js/vertexai.segment.md - title: StartChatParams - path: /docs/reference/js/vertexai-preview.startchatparams.md + path: /docs/reference/js/vertexai.startchatparams.md + - title: StringSchema + path: /docs/reference/js/vertexai.stringschema.md - title: TextPart - path: /docs/reference/js/vertexai-preview.textpart.md + path: /docs/reference/js/vertexai.textpart.md - title: ToolConfig - path: /docs/reference/js/vertexai-preview.toolconfig.md + path: /docs/reference/js/vertexai.toolconfig.md - title: UsageMetadata - path: /docs/reference/js/vertexai-preview.usagemetadata.md + path: /docs/reference/js/vertexai.usagemetadata.md - title: VertexAI - path: /docs/reference/js/vertexai-preview.vertexai.md + path: /docs/reference/js/vertexai.vertexai.md - title: VertexAIError - path: /docs/reference/js/vertexai-preview.vertexaierror.md + path: /docs/reference/js/vertexai.vertexaierror.md - title: VertexAIOptions - path: /docs/reference/js/vertexai-preview.vertexaioptions.md + path: /docs/reference/js/vertexai.vertexaioptions.md - title: VideoMetadata - path: /docs/reference/js/vertexai-preview.videometadata.md + path: /docs/reference/js/vertexai.videometadata.md - title: WebAttribution - path: /docs/reference/js/vertexai-preview.webattribution.md + path: /docs/reference/js/vertexai.webattribution.md diff --git a/docs-devsite/index.md b/docs-devsite/index.md index 2c22b58d80c..82fdb36f076 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -27,5 +27,5 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai-preview](./vertexai-preview.md#vertexai-preview_package) | The Vertex AI For Firebase Web SDK. | +| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Vertex AI in Firebase Web SDK. | diff --git a/docs-devsite/vertexai-preview.chatsession.md b/docs-devsite/vertexai-preview.chatsession.md deleted file mode 100644 index d8dc691d186..00000000000 --- a/docs-devsite/vertexai-preview.chatsession.md +++ /dev/null @@ -1,138 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ChatSession class -ChatSession class that enables sending chat messages and stores history of sent and received messages so far. - -Signature: - -```typescript -export declare class ChatSession -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai-preview.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [model](./vertexai-preview.chatsession.md#chatsessionmodel) | | string | | -| [params](./vertexai-preview.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| [requestOptions](./vertexai-preview.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [getHistory()](./vertexai-preview.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai-preview.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai-preview.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | - -## ChatSession.(constructor) - -Constructs a new instance of the `ChatSession` class - -Signature: - -```typescript -constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| apiSettings | ApiSettings | | -| model | string | | -| params | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## ChatSession.model - -Signature: - -```typescript -model: string; -``` - -## ChatSession.params - -Signature: - -```typescript -params?: StartChatParams | undefined; -``` - -## ChatSession.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions | undefined; -``` - -## ChatSession.getHistory() - -Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. - -Signature: - -```typescript -getHistory(): Promise; -``` -Returns: - -Promise<[Content](./vertexai-preview.content.md#content_interface)\[\]> - -## ChatSession.sendMessage() - -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) - -Signature: - -```typescript -sendMessage(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## ChatSession.sendMessageStream() - -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. - -Signature: - -```typescript -sendMessageStream(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - diff --git a/docs-devsite/vertexai-preview.functiondeclarationschema.md b/docs-devsite/vertexai-preview.functiondeclarationschema.md deleted file mode 100644 index 7d0e5809d41..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschema.md +++ /dev/null @@ -1,70 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchema interface -Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). - -Signature: - -```typescript -export interface FunctionDeclarationSchema -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemadescription) | string | Optional. Description of the parameter. | -| [properties](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemaproperties) | { \[k: string\]: [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface); } | The format of the parameter. | -| [required](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemarequired) | string\[\] | Optional. Array of required parameters. | -| [type](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschematype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | The type of the parameter. | - -## FunctionDeclarationSchema.description - -Optional. Description of the parameter. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchema.properties - -The format of the parameter. - -Signature: - -```typescript -properties: { - [k: string]: FunctionDeclarationSchemaProperty; - }; -``` - -## FunctionDeclarationSchema.required - -Optional. Array of required parameters. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchema.type - -The type of the parameter. - -Signature: - -```typescript -type: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md b/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md deleted file mode 100644 index ac2e1262dd0..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md +++ /dev/null @@ -1,125 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchemaProperty interface -Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. - -Signature: - -```typescript -export interface FunctionDeclarationSchemaProperty -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertydescription) | string | Optional. The description of the property. | -| [enum](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyenum) | string\[\] | Optional. The enum of the property. | -| [example](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyexample) | unknown | Optional. The example of the property. | -| [format](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyformat) | string | Optional. The format of the property. | -| [items](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyitems) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | -| [nullable](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertynullable) | boolean | Optional. Whether the property is nullable. | -| [properties](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyproperties) | { \[k: string\]: [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface); } | Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). | -| [required](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyrequired) | string\[\] | Optional. Array of required property. | -| [type](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertytype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). | - -## FunctionDeclarationSchemaProperty.description - -Optional. The description of the property. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchemaProperty.enum - -Optional. The enum of the property. - -Signature: - -```typescript -enum?: string[]; -``` - -## FunctionDeclarationSchemaProperty.example - -Optional. The example of the property. - -Signature: - -```typescript -example?: unknown; -``` - -## FunctionDeclarationSchemaProperty.format - -Optional. The format of the property. - -Signature: - -```typescript -format?: string; -``` - -## FunctionDeclarationSchemaProperty.items - -Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) - -Signature: - -```typescript -items?: FunctionDeclarationSchema; -``` - -## FunctionDeclarationSchemaProperty.nullable - -Optional. Whether the property is nullable. - -Signature: - -```typescript -nullable?: boolean; -``` - -## FunctionDeclarationSchemaProperty.properties - -Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). - -Signature: - -```typescript -properties?: { - [k: string]: FunctionDeclarationSchema; - }; -``` - -## FunctionDeclarationSchemaProperty.required - -Optional. Array of required property. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchemaProperty.type - -Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). - -Signature: - -```typescript -type?: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationstool.md b/docs-devsite/vertexai-preview.functiondeclarationstool.md deleted file mode 100644 index d1af4351a23..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationstool.md +++ /dev/null @@ -1,35 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationsTool interface -A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - -Signature: - -```typescript -export declare interface FunctionDeclarationsTool -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionDeclarations](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | - -## FunctionDeclarationsTool.functionDeclarations - -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. - -Signature: - -```typescript -functionDeclarations?: FunctionDeclaration[]; -``` diff --git a/docs-devsite/vertexai-preview.generatecontentcandidate.md b/docs-devsite/vertexai-preview.generatecontentcandidate.md deleted file mode 100644 index 9f36fab1e87..00000000000 --- a/docs-devsite/vertexai-preview.generatecontentcandidate.md +++ /dev/null @@ -1,87 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -export interface GenerateContentCandidate -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [citationMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | | -| [content](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai-preview.content.md#content_interface) | | -| [finishMessage](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | -| [finishReason](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai-preview.md#finishreason) | | -| [groundingMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | | -| [index](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidateindex) | number | | -| [safetyRatings](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | - -## GenerateContentCandidate.citationMetadata - -Signature: - -```typescript -citationMetadata?: CitationMetadata; -``` - -## GenerateContentCandidate.content - -Signature: - -```typescript -content: Content; -``` - -## GenerateContentCandidate.finishMessage - -Signature: - -```typescript -finishMessage?: string; -``` - -## GenerateContentCandidate.finishReason - -Signature: - -```typescript -finishReason?: FinishReason; -``` - -## GenerateContentCandidate.groundingMetadata - -Signature: - -```typescript -groundingMetadata?: GroundingMetadata; -``` - -## GenerateContentCandidate.index - -Signature: - -```typescript -index: number; -``` - -## GenerateContentCandidate.safetyRatings - -Signature: - -```typescript -safetyRatings?: SafetyRating[]; -``` diff --git a/docs-devsite/vertexai-preview.generationconfig.md b/docs-devsite/vertexai-preview.generationconfig.md deleted file mode 100644 index b14dfea053b..00000000000 --- a/docs-devsite/vertexai-preview.generationconfig.md +++ /dev/null @@ -1,107 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerationConfig interface -Config options for content-related requests - -Signature: - -```typescript -export interface GenerationConfig -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidateCount](./vertexai-preview.generationconfig.md#generationconfigcandidatecount) | number | | -| [frequencyPenalty](./vertexai-preview.generationconfig.md#generationconfigfrequencypenalty) | number | | -| [maxOutputTokens](./vertexai-preview.generationconfig.md#generationconfigmaxoutputtokens) | number | | -| [presencePenalty](./vertexai-preview.generationconfig.md#generationconfigpresencepenalty) | number | | -| [responseMimeType](./vertexai-preview.generationconfig.md#generationconfigresponsemimetype) | string | Output response mimetype of the generated candidate text. Supported mimetypes are text/plain (default, text output) and application/json (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. | -| [stopSequences](./vertexai-preview.generationconfig.md#generationconfigstopsequences) | string\[\] | | -| [temperature](./vertexai-preview.generationconfig.md#generationconfigtemperature) | number | | -| [topK](./vertexai-preview.generationconfig.md#generationconfigtopk) | number | | -| [topP](./vertexai-preview.generationconfig.md#generationconfigtopp) | number | | - -## GenerationConfig.candidateCount - -Signature: - -```typescript -candidateCount?: number; -``` - -## GenerationConfig.frequencyPenalty - -Signature: - -```typescript -frequencyPenalty?: number; -``` - -## GenerationConfig.maxOutputTokens - -Signature: - -```typescript -maxOutputTokens?: number; -``` - -## GenerationConfig.presencePenalty - -Signature: - -```typescript -presencePenalty?: number; -``` - -## GenerationConfig.responseMimeType - -Output response mimetype of the generated candidate text. Supported mimetypes are `text/plain` (default, text output) and `application/json` (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. - -Signature: - -```typescript -responseMimeType?: string; -``` - -## GenerationConfig.stopSequences - -Signature: - -```typescript -stopSequences?: string[]; -``` - -## GenerationConfig.temperature - -Signature: - -```typescript -temperature?: number; -``` - -## GenerationConfig.topK - -Signature: - -```typescript -topK?: number; -``` - -## GenerationConfig.topP - -Signature: - -```typescript -topP?: number; -``` diff --git a/docs-devsite/vertexai-preview.generativemodel.md b/docs-devsite/vertexai-preview.generativemodel.md deleted file mode 100644 index a50fac631cc..00000000000 --- a/docs-devsite/vertexai-preview.generativemodel.md +++ /dev/null @@ -1,201 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerativeModel class -Class for generative model APIs. - -Signature: - -```typescript -export declare class GenerativeModel -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai-preview.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [generationConfig](./vertexai-preview.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [model](./vertexai-preview.generativemodel.md#generativemodelmodel) | | string | | -| [requestOptions](./vertexai-preview.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | -| [safetySettings](./vertexai-preview.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generativemodel.md#generativemodeltools) | | [Tool](./vertexai-preview.md#tool)\[\] | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [countTokens(request)](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [generateContentStream(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai-preview.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | - -## GenerativeModel.(constructor) - -Constructs a new instance of the `GenerativeModel` class - -Signature: - -```typescript -constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -## GenerativeModel.generationConfig - -Signature: - -```typescript -generationConfig: GenerationConfig; -``` - -## GenerativeModel.model - -Signature: - -```typescript -model: string; -``` - -## GenerativeModel.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions; -``` - -## GenerativeModel.safetySettings - -Signature: - -```typescript -safetySettings: SafetySetting[]; -``` - -## GenerativeModel.systemInstruction - -Signature: - -```typescript -systemInstruction?: Content; -``` - -## GenerativeModel.toolConfig - -Signature: - -```typescript -toolConfig?: ToolConfig; -``` - -## GenerativeModel.tools - -Signature: - -```typescript -tools?: Tool[]; -``` - -## GenerativeModel.countTokens() - -Counts the tokens in the provided request. - -Signature: - -```typescript -countTokens(request: CountTokensRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface)> - -## GenerativeModel.generateContent() - -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -generateContent(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## GenerativeModel.generateContentStream() - -Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. - -Signature: - -```typescript -generateContentStream(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - -## GenerativeModel.startChat() - -Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. - -Signature: - -```typescript -startChat(startChatParams?: StartChatParams): ChatSession; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| startChatParams | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | | - -Returns: - -[ChatSession](./vertexai-preview.chatsession.md#chatsession_class) - diff --git a/docs-devsite/vertexai-preview.md b/docs-devsite/vertexai-preview.md deleted file mode 100644 index 57fbab35909..00000000000 --- a/docs-devsite/vertexai-preview.md +++ /dev/null @@ -1,397 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# vertexai-preview package -The Vertex AI For Firebase Web SDK. - -## Functions - -| Function | Description | -| --- | --- | -| function(app, ...) | -| [getVertexAI(app, options)](./vertexai-preview.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. | -| function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai-preview.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | - -## Classes - -| Class | Description | -| --- | --- | -| [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | -| [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI for Firebase SDK. | - -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [BlockReason](./vertexai-preview.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./vertexai-preview.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | -| [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ | -| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. | -| [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [Citation](./vertexai-preview.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [Content](./vertexai-preview.content.md#content_interface) | Content type for both prompts and response candidates. | -| [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | -| [CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). | -| [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | -| [Date\_2](./vertexai-preview.date_2.md#date_2_interface) | Protobuf google.type.Date | -| [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | -| [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [FileData](./vertexai-preview.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai-preview.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | -| [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai-preview.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). | -| [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | -| [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). | -| [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface) | Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. | -| [FunctionDeclarationsTool](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai-preview.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | -| [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | -| [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. | -| [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | -| [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | Config options for content-related requests | -| [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | -| [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | -| [InlineDataPart](./vertexai-preview.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | -| [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). | -| [TextPart](./vertexai-preview.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | -| [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | An instance of the Vertex AI for Firebase SDK. | -| [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI for Firebase SDK. | -| [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Describes the input video content. | -| [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [POSSIBLE\_ROLES](./vertexai-preview.md#possible_roles) | Possible roles. | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Part](./vertexai-preview.md#part) | Content part - includes text, image/video, or function call/response part types. | -| [Role](./vertexai-preview.md#role) | Role is the producer of the content. | -| [Tool](./vertexai-preview.md#tool) | Defines a tool that model can call to access external knowledge. | - -## function(app, ...) - -### getVertexAI(app, options) {:#getvertexai_04094cf} - -Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | | - -Returns: - -[VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) - -## function(vertexAI, ...) - -### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} - -Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. - -Signature: - -```typescript -export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -Returns: - -[GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) - -## POSSIBLE\_ROLES - -Possible roles. - -Signature: - -```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] -``` - -## Part - -Content part - includes text, image/video, or function call/response part types. - -Signature: - -```typescript -export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; -``` - -## Role - -Role is the producer of the content. - -Signature: - -```typescript -export declare type Role = (typeof POSSIBLE_ROLES)[number]; -``` - -## Tool - -Defines a tool that model can call to access external knowledge. - -Signature: - -```typescript -export declare type Tool = FunctionDeclarationsTool; -``` - -## BlockReason - -Reason that a prompt was blocked. - -Signature: - -```typescript -export declare enum BlockReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCKED\_REASON\_UNSPECIFIED | "BLOCKED_REASON_UNSPECIFIED" | | -| OTHER | "OTHER" | | -| SAFETY | "SAFETY" | | - -## FinishReason - -Reason that a candidate finished. - -Signature: - -```typescript -export declare enum FinishReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| FINISH\_REASON\_UNSPECIFIED | "FINISH_REASON_UNSPECIFIED" | | -| MAX\_TOKENS | "MAX_TOKENS" | | -| OTHER | "OTHER" | | -| RECITATION | "RECITATION" | | -| SAFETY | "SAFETY" | | -| STOP | "STOP" | | - -## FunctionCallingMode - - -Signature: - -```typescript -export declare enum FunctionCallingMode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | | -| AUTO | "AUTO" | | -| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED" | | -| NONE | "NONE" | | - -## FunctionDeclarationSchemaType - -Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ - -Signature: - -```typescript -export declare enum FunctionDeclarationSchemaType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "ARRAY" | Array type. | -| BOOLEAN | "BOOLEAN" | Boolean type. | -| INTEGER | "INTEGER" | Integer type. | -| NUMBER | "NUMBER" | Number type. | -| OBJECT | "OBJECT" | Object type. | -| STRING | "STRING" | String type. | - -## HarmBlockMethod - - -Signature: - -```typescript -export declare enum HarmBlockMethod -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_BLOCK\_METHOD\_UNSPECIFIED | "HARM_BLOCK_METHOD_UNSPECIFIED" | | -| PROBABILITY | "PROBABILITY" | | -| SEVERITY | "SEVERITY" | | - -## HarmBlockThreshold - -Threshold above which a prompt or candidate will be blocked. - -Signature: - -```typescript -export declare enum HarmBlockThreshold -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | -| BLOCK\_NONE | "BLOCK_NONE" | | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | -| HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | | - -## HarmCategory - -Harm categories that would cause prompts or candidates to be blocked. - -Signature: - -```typescript -export declare enum HarmCategory -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | -| HARM\_CATEGORY\_UNSPECIFIED | "HARM_CATEGORY_UNSPECIFIED" | | - -## HarmProbability - -Probability that a prompt or candidate matches a harm category. - -Signature: - -```typescript -export declare enum HarmProbability -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_PROBABILITY\_UNSPECIFIED | "HARM_PROBABILITY_UNSPECIFIED" | | -| HIGH | "HIGH" | | -| LOW | "LOW" | | -| MEDIUM | "MEDIUM" | | -| NEGLIGIBLE | "NEGLIGIBLE" | | - -## HarmSeverity - -Harm severity levels. - -Signature: - -```typescript -export declare enum HarmSeverity -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | -| HARM\_SEVERITY\_UNSPECIFIED | "HARM_SEVERITY_UNSPECIFIED" | | - -## VertexAIErrorCode - -Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. - -Signature: - -```typescript -export declare const enum VertexAIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | - diff --git a/docs-devsite/vertexai.arrayschema.md b/docs-devsite/vertexai.arrayschema.md new file mode 100644 index 00000000000..8f228baf9e8 --- /dev/null +++ b/docs-devsite/vertexai.arrayschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArraySchema class +Schema class for "array" types. The `items` param should refer to the type of item that can be a member of the array. + +Signature: + +```typescript +export declare class ArraySchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, items)](./vertexai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [items](./vertexai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.(constructor) + +Constructs a new instance of the `ArraySchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, items: TypedSchema); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| items | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.items + +Signature: + +```typescript +items: TypedSchema; +``` diff --git a/docs-devsite/vertexai-preview.baseparams.md b/docs-devsite/vertexai.baseparams.md similarity index 67% rename from docs-devsite/vertexai-preview.baseparams.md rename to docs-devsite/vertexai.baseparams.md index 6756c919ccc..382ec825210 100644 --- a/docs-devsite/vertexai-preview.baseparams.md +++ b/docs-devsite/vertexai.baseparams.md @@ -22,8 +22,8 @@ export interface BaseParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai-preview.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [safetySettings](./vertexai-preview.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | +| [generationConfig](./vertexai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [safetySettings](./vertexai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | ## BaseParams.generationConfig diff --git a/docs-devsite/vertexai.booleanschema.md b/docs-devsite/vertexai.booleanschema.md new file mode 100644 index 00000000000..89449f26142 --- /dev/null +++ b/docs-devsite/vertexai.booleanschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# BooleanSchema class +Schema class for "boolean" types. + +Signature: + +```typescript +export declare class BooleanSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | + +## BooleanSchema.(constructor) + +Constructs a new instance of the `BooleanSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/vertexai.chatsession.md new file mode 100644 index 00000000000..cc5a75ace16 --- /dev/null +++ b/docs-devsite/vertexai.chatsession.md @@ -0,0 +1,138 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ChatSession class +ChatSession class that enables sending chat messages and stores history of sent and received messages so far. + +Signature: + +```typescript +export declare class ChatSession +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai.chatsession.md#chatsessionmodel) | | string | | +| [params](./vertexai.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| [requestOptions](./vertexai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | +| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | + +## ChatSession.(constructor) + +Constructs a new instance of the `ChatSession` class + +Signature: + +```typescript +constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| apiSettings | ApiSettings | | +| model | string | | +| params | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## ChatSession.model + +Signature: + +```typescript +model: string; +``` + +## ChatSession.params + +Signature: + +```typescript +params?: StartChatParams | undefined; +``` + +## ChatSession.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions | undefined; +``` + +## ChatSession.getHistory() + +Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. + +Signature: + +```typescript +getHistory(): Promise; +``` +Returns: + +Promise<[Content](./vertexai.content.md#content_interface)\[\]> + +## ChatSession.sendMessage() + +Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) + +Signature: + +```typescript +sendMessage(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## ChatSession.sendMessageStream() + +Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. + +Signature: + +```typescript +sendMessageStream(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + diff --git a/docs-devsite/vertexai-preview.citation.md b/docs-devsite/vertexai.citation.md similarity index 68% rename from docs-devsite/vertexai-preview.citation.md rename to docs-devsite/vertexai.citation.md index 10a615ee247..b5f5a19f231 100644 --- a/docs-devsite/vertexai-preview.citation.md +++ b/docs-devsite/vertexai.citation.md @@ -22,12 +22,12 @@ export interface Citation | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.citation.md#citationendindex) | number | | -| [license](./vertexai-preview.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai-preview.citation.md#citationpublicationdate) | Date | | -| [startIndex](./vertexai-preview.citation.md#citationstartindex) | number | | -| [title](./vertexai-preview.citation.md#citationtitle) | string | | -| [uri](./vertexai-preview.citation.md#citationuri) | string | | +| [endIndex](./vertexai.citation.md#citationendindex) | number | | +| [license](./vertexai.citation.md#citationlicense) | string | | +| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | | +| [startIndex](./vertexai.citation.md#citationstartindex) | number | | +| [title](./vertexai.citation.md#citationtitle) | string | | +| [uri](./vertexai.citation.md#citationuri) | string | | ## Citation.endIndex diff --git a/docs-devsite/vertexai-preview.citationmetadata.md b/docs-devsite/vertexai.citationmetadata.md similarity index 64% rename from docs-devsite/vertexai-preview.citationmetadata.md rename to docs-devsite/vertexai.citationmetadata.md index fa740ca1af7..e3d41a37d98 100644 --- a/docs-devsite/vertexai-preview.citationmetadata.md +++ b/docs-devsite/vertexai.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: @@ -22,7 +22,7 @@ export interface CitationMetadata | Property | Type | Description | | --- | --- | --- | -| [citations](./vertexai-preview.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai-preview.citation.md#citation_interface)\[\] | | +| [citations](./vertexai.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai.citation.md#citation_interface)\[\] | | ## CitationMetadata.citations diff --git a/docs-devsite/vertexai-preview.content.md b/docs-devsite/vertexai.content.md similarity index 76% rename from docs-devsite/vertexai-preview.content.md rename to docs-devsite/vertexai.content.md index 26198a3951f..7a4634a62bc 100644 --- a/docs-devsite/vertexai-preview.content.md +++ b/docs-devsite/vertexai.content.md @@ -22,8 +22,8 @@ export interface Content | Property | Type | Description | | --- | --- | --- | -| [parts](./vertexai-preview.content.md#contentparts) | [Part](./vertexai-preview.md#part)\[\] | | -| [role](./vertexai-preview.content.md#contentrole) | [Role](./vertexai-preview.md#role) | | +| [parts](./vertexai.content.md#contentparts) | [Part](./vertexai.md#part)\[\] | | +| [role](./vertexai.content.md#contentrole) | [Role](./vertexai.md#role) | | ## Content.parts diff --git a/docs-devsite/vertexai-preview.counttokensrequest.md b/docs-devsite/vertexai.counttokensrequest.md similarity index 68% rename from docs-devsite/vertexai-preview.counttokensrequest.md rename to docs-devsite/vertexai.counttokensrequest.md index 07e5f0d85f3..db519b7eb11 100644 --- a/docs-devsite/vertexai-preview.counttokensrequest.md +++ b/docs-devsite/vertexai.counttokensrequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensRequest interface -Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) +Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) Signature: @@ -22,7 +22,7 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | +| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | ## CountTokensRequest.contents diff --git a/docs-devsite/vertexai-preview.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md similarity index 67% rename from docs-devsite/vertexai-preview.counttokensresponse.md rename to docs-devsite/vertexai.counttokensresponse.md index d097d5aacff..2978f9a45bb 100644 --- a/docs-devsite/vertexai-preview.counttokensresponse.md +++ b/docs-devsite/vertexai.counttokensresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensResponse interface -Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). +Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). Signature: @@ -22,8 +22,8 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | -| [totalBillableCharacters](./vertexai-preview.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | -| [totalTokens](./vertexai-preview.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | +| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | +| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.totalBillableCharacters diff --git a/docs-devsite/vertexai-preview.customerrordata.md b/docs-devsite/vertexai.customerrordata.md similarity index 54% rename from docs-devsite/vertexai-preview.customerrordata.md rename to docs-devsite/vertexai.customerrordata.md index f0af0574161..701b1b84c49 100644 --- a/docs-devsite/vertexai-preview.customerrordata.md +++ b/docs-devsite/vertexai.customerrordata.md @@ -22,10 +22,10 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | -| [errorDetails](./vertexai-preview.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai-preview.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | -| [status](./vertexai-preview.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | -| [statusText](./vertexai-preview.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | +| [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | +| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | +| [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | +| [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | ## CustomErrorData.errorDetails @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai-preview.date_2.md b/docs-devsite/vertexai.date_2.md similarity index 78% rename from docs-devsite/vertexai-preview.date_2.md rename to docs-devsite/vertexai.date_2.md index 5af031447c4..cf073bb86fe 100644 --- a/docs-devsite/vertexai-preview.date_2.md +++ b/docs-devsite/vertexai.date_2.md @@ -22,9 +22,9 @@ export interface Date | Property | Type | Description | | --- | --- | --- | -| [day](./vertexai-preview.date_2.md#date_2day) | number | | -| [month](./vertexai-preview.date_2.md#date_2month) | number | | -| [year](./vertexai-preview.date_2.md#date_2year) | number | | +| [day](./vertexai.date_2.md#date_2day) | number | | +| [month](./vertexai.date_2.md#date_2month) | number | | +| [year](./vertexai.date_2.md#date_2year) | number | | ## Date\_2.day diff --git a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md similarity index 61% rename from docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md rename to docs-devsite/vertexai.enhancedgeneratecontentresponse.md index 132c5ed0be2..535fb9def8f 100644 --- a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md +++ b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md @@ -17,14 +17,14 @@ Response object wrapped with helper methods. ```typescript export interface EnhancedGenerateContentResponse extends GenerateContentResponse ``` -Extends: [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) +Extends: [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [functionCalls](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [text](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | +| [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | ## EnhancedGenerateContentResponse.functionCalls diff --git a/docs-devsite/vertexai-preview.errordetails.md b/docs-devsite/vertexai.errordetails.md similarity index 68% rename from docs-devsite/vertexai-preview.errordetails.md rename to docs-devsite/vertexai.errordetails.md index 45e84a618ab..68959343439 100644 --- a/docs-devsite/vertexai-preview.errordetails.md +++ b/docs-devsite/vertexai.errordetails.md @@ -22,10 +22,10 @@ export interface ErrorDetails | Property | Type | Description | | --- | --- | --- | -| ["@type"](./vertexai-preview.errordetails.md#errordetails"@type") | string | | -| [domain](./vertexai-preview.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | -| [metadata](./vertexai-preview.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | -| [reason](./vertexai-preview.errordetails.md#errordetailsreason) | string | The reason for the error. | +| ["@type"](./vertexai.errordetails.md#errordetails"@type") | string | | +| [domain](./vertexai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | +| [metadata](./vertexai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | +| [reason](./vertexai.errordetails.md#errordetailsreason) | string | The reason for the error. | ## ErrorDetails."@type" diff --git a/docs-devsite/vertexai-preview.filedata.md b/docs-devsite/vertexai.filedata.md similarity index 81% rename from docs-devsite/vertexai-preview.filedata.md rename to docs-devsite/vertexai.filedata.md index 577b4b1910d..7e000174692 100644 --- a/docs-devsite/vertexai-preview.filedata.md +++ b/docs-devsite/vertexai.filedata.md @@ -22,8 +22,8 @@ export interface FileData | Property | Type | Description | | --- | --- | --- | -| [fileUri](./vertexai-preview.filedata.md#filedatafileuri) | string | | -| [mimeType](./vertexai-preview.filedata.md#filedatamimetype) | string | | +| [fileUri](./vertexai.filedata.md#filedatafileuri) | string | | +| [mimeType](./vertexai.filedata.md#filedatamimetype) | string | | ## FileData.fileUri diff --git a/docs-devsite/vertexai-preview.filedatapart.md b/docs-devsite/vertexai.filedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.filedatapart.md rename to docs-devsite/vertexai.filedatapart.md index e03c056f588..74512fa6d29 100644 --- a/docs-devsite/vertexai-preview.filedatapart.md +++ b/docs-devsite/vertexai.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) Signature: @@ -22,11 +22,11 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | -| [fileData](./vertexai-preview.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai-preview.filedata.md#filedata_interface) | | -| [functionCall](./vertexai-preview.filedatapart.md#filedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.filedatapart.md#filedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.filedatapart.md#filedatapartinlinedata) | never | | -| [text](./vertexai-preview.filedatapart.md#filedataparttext) | never | | +| [fileData](./vertexai.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai.filedata.md#filedata_interface) | | +| [functionCall](./vertexai.filedatapart.md#filedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.filedatapart.md#filedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.filedatapart.md#filedatapartinlinedata) | never | | +| [text](./vertexai.filedatapart.md#filedataparttext) | never | | ## FileDataPart.fileData diff --git a/docs-devsite/vertexai-preview.functioncall.md b/docs-devsite/vertexai.functioncall.md similarity index 57% rename from docs-devsite/vertexai-preview.functioncall.md rename to docs-devsite/vertexai.functioncall.md index 60e0ea50dc4..ca7bc015438 100644 --- a/docs-devsite/vertexai-preview.functioncall.md +++ b/docs-devsite/vertexai.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: @@ -22,8 +22,8 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | -| [args](./vertexai-preview.functioncall.md#functioncallargs) | object | | -| [name](./vertexai-preview.functioncall.md#functioncallname) | string | | +| [args](./vertexai.functioncall.md#functioncallargs) | object | | +| [name](./vertexai.functioncall.md#functioncallname) | string | | ## FunctionCall.args diff --git a/docs-devsite/vertexai-preview.functioncallingconfig.md b/docs-devsite/vertexai.functioncallingconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.functioncallingconfig.md rename to docs-devsite/vertexai.functioncallingconfig.md index 1965fb76e95..3724fec5bf7 100644 --- a/docs-devsite/vertexai-preview.functioncallingconfig.md +++ b/docs-devsite/vertexai.functioncallingconfig.md @@ -21,8 +21,8 @@ export interface FunctionCallingConfig | Property | Type | Description | | --- | --- | --- | -| [allowedFunctionNames](./vertexai-preview.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | -| [mode](./vertexai-preview.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | +| [allowedFunctionNames](./vertexai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | +| [mode](./vertexai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | ## FunctionCallingConfig.allowedFunctionNames diff --git a/docs-devsite/vertexai-preview.functioncallpart.md b/docs-devsite/vertexai.functioncallpart.md similarity index 59% rename from docs-devsite/vertexai-preview.functioncallpart.md rename to docs-devsite/vertexai.functioncallpart.md index 5da204692f9..af8ccf1109a 100644 --- a/docs-devsite/vertexai-preview.functioncallpart.md +++ b/docs-devsite/vertexai.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | | -| [functionResponse](./vertexai-preview.functioncallpart.md#functioncallpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.functioncallpart.md#functioncallpartinlinedata) | never | | -| [text](./vertexai-preview.functioncallpart.md#functioncallparttext) | never | | +| [functionCall](./vertexai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | | +| [functionResponse](./vertexai.functioncallpart.md#functioncallpartfunctionresponse) | never | | +| [inlineData](./vertexai.functioncallpart.md#functioncallpartinlinedata) | never | | +| [text](./vertexai.functioncallpart.md#functioncallparttext) | never | | ## FunctionCallPart.functionCall diff --git a/docs-devsite/vertexai-preview.functiondeclaration.md b/docs-devsite/vertexai.functiondeclaration.md similarity index 57% rename from docs-devsite/vertexai-preview.functiondeclaration.md rename to docs-devsite/vertexai.functiondeclaration.md index e178c7e8bc3..211c1dd868d 100644 --- a/docs-devsite/vertexai-preview.functiondeclaration.md +++ b/docs-devsite/vertexai.functiondeclaration.md @@ -22,18 +22,18 @@ export declare interface FunctionDeclaration | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai-preview.functiondeclaration.md#functiondeclarationdescription) | string | Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. | -| [name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [description](./vertexai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | +| [name](./vertexai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | +| [parameters](./vertexai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description -Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. +Description and purpose of the function. Model uses it to decide how and whether to call the function. Signature: ```typescript -description?: string; +description: string; ``` ## FunctionDeclaration.name @@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format Signature: ```typescript -parameters?: FunctionDeclarationSchema; +parameters?: ObjectSchemaInterface; ``` diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md new file mode 100644 index 00000000000..5e728046639 --- /dev/null +++ b/docs-devsite/vertexai.functiondeclarationstool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationsTool interface +A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + +Signature: + +```typescript +export declare interface FunctionDeclarationsTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | + +## FunctionDeclarationsTool.functionDeclarations + +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. + +Signature: + +```typescript +functionDeclarations?: FunctionDeclaration[]; +``` diff --git a/docs-devsite/vertexai-preview.functionresponse.md b/docs-devsite/vertexai.functionresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.functionresponse.md rename to docs-devsite/vertexai.functionresponse.md index d89ace08df1..0ca553e0e6b 100644 --- a/docs-devsite/vertexai-preview.functionresponse.md +++ b/docs-devsite/vertexai.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. Signature: @@ -22,8 +22,8 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | -| [name](./vertexai-preview.functionresponse.md#functionresponsename) | string | | -| [response](./vertexai-preview.functionresponse.md#functionresponseresponse) | object | | +| [name](./vertexai.functionresponse.md#functionresponsename) | string | | +| [response](./vertexai.functionresponse.md#functionresponseresponse) | object | | ## FunctionResponse.name diff --git a/docs-devsite/vertexai-preview.functionresponsepart.md b/docs-devsite/vertexai.functionresponsepart.md similarity index 58% rename from docs-devsite/vertexai-preview.functionresponsepart.md rename to docs-devsite/vertexai.functionresponsepart.md index 4e246d625f6..1905c98cdc7 100644 --- a/docs-devsite/vertexai-preview.functionresponsepart.md +++ b/docs-devsite/vertexai.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | | -| [inlineData](./vertexai-preview.functionresponsepart.md#functionresponsepartinlinedata) | never | | -| [text](./vertexai-preview.functionresponsepart.md#functionresponseparttext) | never | | +| [functionCall](./vertexai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | +| [functionResponse](./vertexai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | | +| [inlineData](./vertexai.functionresponsepart.md#functionresponsepartinlinedata) | never | | +| [text](./vertexai.functionresponsepart.md#functionresponseparttext) | never | | ## FunctionResponsePart.functionCall diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/vertexai.generatecontentcandidate.md new file mode 100644 index 00000000000..a30eef55485 --- /dev/null +++ b/docs-devsite/vertexai.generatecontentcandidate.md @@ -0,0 +1,87 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerateContentCandidate interface +A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +export interface GenerateContentCandidate +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [citationMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | | +| [content](./vertexai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai.content.md#content_interface) | | +| [finishMessage](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | +| [finishReason](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai.md#finishreason) | | +| [groundingMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | | +| [index](./vertexai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | +| [safetyRatings](./vertexai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | + +## GenerateContentCandidate.citationMetadata + +Signature: + +```typescript +citationMetadata?: CitationMetadata; +``` + +## GenerateContentCandidate.content + +Signature: + +```typescript +content: Content; +``` + +## GenerateContentCandidate.finishMessage + +Signature: + +```typescript +finishMessage?: string; +``` + +## GenerateContentCandidate.finishReason + +Signature: + +```typescript +finishReason?: FinishReason; +``` + +## GenerateContentCandidate.groundingMetadata + +Signature: + +```typescript +groundingMetadata?: GroundingMetadata; +``` + +## GenerateContentCandidate.index + +Signature: + +```typescript +index: number; +``` + +## GenerateContentCandidate.safetyRatings + +Signature: + +```typescript +safetyRatings?: SafetyRating[]; +``` diff --git a/docs-devsite/vertexai-preview.generatecontentrequest.md b/docs-devsite/vertexai.generatecontentrequest.md similarity index 54% rename from docs-devsite/vertexai-preview.generatecontentrequest.md rename to docs-devsite/vertexai.generatecontentrequest.md index 68ce52340e8..31f1103a2e2 100644 --- a/docs-devsite/vertexai-preview.generatecontentrequest.md +++ b/docs-devsite/vertexai.generatecontentrequest.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentRequest interface -Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) +Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) Signature: ```typescript export interface GenerateContentRequest extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [contents](./vertexai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai.md#tool)\[\] | | ## GenerateContentRequest.contents diff --git a/docs-devsite/vertexai-preview.generatecontentresponse.md b/docs-devsite/vertexai.generatecontentresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.generatecontentresponse.md rename to docs-devsite/vertexai.generatecontentresponse.md index cb0fb0e3209..304674c9b6f 100644 --- a/docs-devsite/vertexai-preview.generatecontentresponse.md +++ b/docs-devsite/vertexai.generatecontentresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResponse interface -Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. +Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. Signature: @@ -22,9 +22,9 @@ export interface GenerateContentResponse | Property | Type | Description | | --- | --- | --- | -| [candidates](./vertexai-preview.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | -| [promptFeedback](./vertexai-preview.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | | -| [usageMetadata](./vertexai-preview.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | | +| [candidates](./vertexai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | +| [promptFeedback](./vertexai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | | +| [usageMetadata](./vertexai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | | ## GenerateContentResponse.candidates diff --git a/docs-devsite/vertexai-preview.generatecontentresult.md b/docs-devsite/vertexai.generatecontentresult.md similarity index 69% rename from docs-devsite/vertexai-preview.generatecontentresult.md rename to docs-devsite/vertexai.generatecontentresult.md index 87249a5bc55..3e162f9ebb2 100644 --- a/docs-devsite/vertexai-preview.generatecontentresult.md +++ b/docs-devsite/vertexai.generatecontentresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResult interface -Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. +Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. Signature: @@ -22,7 +22,7 @@ export interface GenerateContentResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | +| [response](./vertexai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | ## GenerateContentResult.response diff --git a/docs-devsite/vertexai-preview.generatecontentstreamresult.md b/docs-devsite/vertexai.generatecontentstreamresult.md similarity index 52% rename from docs-devsite/vertexai-preview.generatecontentstreamresult.md rename to docs-devsite/vertexai.generatecontentstreamresult.md index 6fd46600079..340abb1d0bd 100644 --- a/docs-devsite/vertexai-preview.generatecontentstreamresult.md +++ b/docs-devsite/vertexai.generatecontentstreamresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentStreamResult interface -Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. +Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. Signature: @@ -22,8 +22,8 @@ export interface GenerateContentStreamResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | -| [stream](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [response](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [stream](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | ## GenerateContentStreamResult.response diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md new file mode 100644 index 00000000000..3c3d0a14ffa --- /dev/null +++ b/docs-devsite/vertexai.generationconfig.md @@ -0,0 +1,118 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerationConfig interface +Config options for content-related requests + +Signature: + +```typescript +export interface GenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidateCount](./vertexai.generationconfig.md#generationconfigcandidatecount) | number | | +| [frequencyPenalty](./vertexai.generationconfig.md#generationconfigfrequencypenalty) | number | | +| [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | +| [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | +| [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | +| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | +| [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | +| [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | +| [topP](./vertexai.generationconfig.md#generationconfigtopp) | number | | + +## GenerationConfig.candidateCount + +Signature: + +```typescript +candidateCount?: number; +``` + +## GenerationConfig.frequencyPenalty + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## GenerationConfig.maxOutputTokens + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## GenerationConfig.presencePenalty + +Signature: + +```typescript +presencePenalty?: number; +``` + +## GenerationConfig.responseMimeType + +Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. + +Signature: + +```typescript +responseMimeType?: string; +``` + +## GenerationConfig.responseSchema + +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. + +Signature: + +```typescript +responseSchema?: TypedSchema | SchemaRequest; +``` + +## GenerationConfig.stopSequences + +Signature: + +```typescript +stopSequences?: string[]; +``` + +## GenerationConfig.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## GenerationConfig.topK + +Signature: + +```typescript +topK?: number; +``` + +## GenerationConfig.topP + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/vertexai-preview.generativecontentblob.md b/docs-devsite/vertexai.generativecontentblob.md similarity index 76% rename from docs-devsite/vertexai-preview.generativecontentblob.md rename to docs-devsite/vertexai.generativecontentblob.md index b5dcb272027..dfcd098291f 100644 --- a/docs-devsite/vertexai-preview.generativecontentblob.md +++ b/docs-devsite/vertexai.generativecontentblob.md @@ -22,8 +22,8 @@ export interface GenerativeContentBlob | Property | Type | Description | | --- | --- | --- | -| [data](./vertexai-preview.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | -| [mimeType](./vertexai-preview.generativecontentblob.md#generativecontentblobmimetype) | string | | +| [data](./vertexai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | +| [mimeType](./vertexai.generativecontentblob.md#generativecontentblobmimetype) | string | | ## GenerativeContentBlob.data diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md new file mode 100644 index 00000000000..7105f9c100b --- /dev/null +++ b/docs-devsite/vertexai.generativemodel.md @@ -0,0 +1,201 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerativeModel class +Class for generative model APIs. + +Signature: + +```typescript +export declare class GenerativeModel +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [model](./vertexai.generativemodel.md#generativemodelmodel) | | string | | +| [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | +| [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | +| [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generativemodel.md#generativemodeltools) | | [Tool](./vertexai.md#tool)\[\] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | +| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | +| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | + +## GenerativeModel.(constructor) + +Constructs a new instance of the `GenerativeModel` class + +Signature: + +```typescript +constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +## GenerativeModel.generationConfig + +Signature: + +```typescript +generationConfig: GenerationConfig; +``` + +## GenerativeModel.model + +Signature: + +```typescript +model: string; +``` + +## GenerativeModel.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions; +``` + +## GenerativeModel.safetySettings + +Signature: + +```typescript +safetySettings: SafetySetting[]; +``` + +## GenerativeModel.systemInstruction + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## GenerativeModel.toolConfig + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## GenerativeModel.tools + +Signature: + +```typescript +tools?: Tool[]; +``` + +## GenerativeModel.countTokens() + +Counts the tokens in the provided request. + +Signature: + +```typescript +countTokens(request: CountTokensRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface)> + +## GenerativeModel.generateContent() + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +generateContent(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## GenerativeModel.generateContentStream() + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + +## GenerativeModel.startChat() + +Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. + +Signature: + +```typescript +startChat(startChatParams?: StartChatParams): ChatSession; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| startChatParams | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | | + +Returns: + +[ChatSession](./vertexai.chatsession.md#chatsession_class) + diff --git a/docs-devsite/vertexai-preview.groundingattribution.md b/docs-devsite/vertexai.groundingattribution.md similarity index 58% rename from docs-devsite/vertexai-preview.groundingattribution.md rename to docs-devsite/vertexai.groundingattribution.md index 2c7d2f09e0b..b72d8150635 100644 --- a/docs-devsite/vertexai-preview.groundingattribution.md +++ b/docs-devsite/vertexai.groundingattribution.md @@ -21,10 +21,10 @@ export interface GroundingAttribution | Property | Type | Description | | --- | --- | --- | -| [confidenceScore](./vertexai-preview.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./vertexai-preview.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./vertexai-preview.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [web](./vertexai-preview.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | +| [confidenceScore](./vertexai.groundingattribution.md#groundingattributionconfidencescore) | number | | +| [retrievedContext](./vertexai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [segment](./vertexai.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai.segment.md#segment_interface) | | +| [web](./vertexai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | ## GroundingAttribution.confidenceScore diff --git a/docs-devsite/vertexai-preview.groundingmetadata.md b/docs-devsite/vertexai.groundingmetadata.md similarity index 66% rename from docs-devsite/vertexai-preview.groundingmetadata.md rename to docs-devsite/vertexai.groundingmetadata.md index 5f40a00457d..186f00d29a7 100644 --- a/docs-devsite/vertexai-preview.groundingmetadata.md +++ b/docs-devsite/vertexai.groundingmetadata.md @@ -22,9 +22,9 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./vertexai-preview.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface)\[\] | | -| [retrievalQueries](./vertexai-preview.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./vertexai-preview.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [groundingAttributions](./vertexai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface)\[\] | | +| [retrievalQueries](./vertexai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | +| [webSearchQueries](./vertexai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | ## GroundingMetadata.groundingAttributions diff --git a/docs-devsite/vertexai-preview.inlinedatapart.md b/docs-devsite/vertexai.inlinedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.inlinedatapart.md rename to docs-devsite/vertexai.inlinedatapart.md index ae05f80ddb7..0cb064fc357 100644 --- a/docs-devsite/vertexai-preview.inlinedatapart.md +++ b/docs-devsite/vertexai.inlinedatapart.md @@ -22,11 +22,11 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | | -| [text](./vertexai-preview.inlinedatapart.md#inlinedataparttext) | never | | -| [videoMetadata](./vertexai-preview.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +| [functionCall](./vertexai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | | +| [text](./vertexai.inlinedatapart.md#inlinedataparttext) | never | | +| [videoMetadata](./vertexai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall diff --git a/docs-devsite/vertexai.integerschema.md b/docs-devsite/vertexai.integerschema.md new file mode 100644 index 00000000000..4822bdd618b --- /dev/null +++ b/docs-devsite/vertexai.integerschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# IntegerSchema class +Schema class for "integer" types. + +Signature: + +```typescript +export declare class IntegerSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | + +## IntegerSchema.(constructor) + +Constructs a new instance of the `IntegerSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md new file mode 100644 index 00000000000..d9e26eabc5d --- /dev/null +++ b/docs-devsite/vertexai.md @@ -0,0 +1,412 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# vertexai package +The Vertex AI in Firebase Web SDK. + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | +| function(vertexAI, ...) | +| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | + +## Classes + +| Class | Description | +| --- | --- | +| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | +| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | +| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | +| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | +| [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | +| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | +| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | +| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | +| [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./vertexai.md#functioncallingmode) | | +| [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | +| [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | +| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [Citation](./vertexai.citation.md#citation_interface) | A single citation. | +| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | +| [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | +| [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | +| [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | +| [Date\_2](./vertexai.date_2.md#date_2_interface) | Protobuf google.type.Date | +| [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | +| [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | +| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | +| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | +| [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | +| [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | +| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | +| [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | +| [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | +| [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | +| [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | +| [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | +| [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | +| [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | +| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | +| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | +| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | +| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | +| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | +| [Segment](./vertexai.segment.md#segment_interface) | | +| [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | +| [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | +| [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | +| [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [Role](./vertexai.md#role) | Role is the producer of the content. | +| [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | +| [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | + +## function(app, ...) + +### getVertexAI(app, options) {:#getvertexai_04094cf} + +Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. + +Signature: + +```typescript +export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | | + +Returns: + +[VertexAI](./vertexai.vertexai.md#vertexai_interface) + +## function(vertexAI, ...) + +### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} + +Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. + +Signature: + +```typescript +export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +Returns: + +[GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) + +## POSSIBLE\_ROLES + +Possible roles. + +Signature: + +```typescript +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +``` + +## Part + +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export type Role = (typeof POSSIBLE_ROLES)[number]; +``` + +## Tool + +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export declare type Tool = FunctionDeclarationsTool; +``` + +## TypedSchema + +A type that includes all specific Schema types. + +Signature: + +```typescript +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +``` + +## BlockReason + +Reason that a prompt was blocked. + +Signature: + +```typescript +export declare enum BlockReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| OTHER | "OTHER" | | +| SAFETY | "SAFETY" | | + +## FinishReason + +Reason that a candidate finished. + +Signature: + +```typescript +export declare enum FinishReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| MAX\_TOKENS | "MAX_TOKENS" | | +| OTHER | "OTHER" | | +| RECITATION | "RECITATION" | | +| SAFETY | "SAFETY" | | +| STOP | "STOP" | | + +## FunctionCallingMode + + +Signature: + +```typescript +export declare enum FunctionCallingMode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ANY | "ANY" | | +| AUTO | "AUTO" | | +| NONE | "NONE" | | + +## HarmBlockMethod + + +Signature: + +```typescript +export declare enum HarmBlockMethod +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| PROBABILITY | "PROBABILITY" | | +| SEVERITY | "SEVERITY" | | + +## HarmBlockThreshold + +Threshold above which a prompt or candidate will be blocked. + +Signature: + +```typescript +export declare enum HarmBlockThreshold +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | +| BLOCK\_NONE | "BLOCK_NONE" | | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | + +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +export declare enum HarmCategory +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | +| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | +| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | +| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +export declare enum HarmProbability +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HIGH | "HIGH" | | +| LOW | "LOW" | | +| MEDIUM | "MEDIUM" | | +| NEGLIGIBLE | "NEGLIGIBLE" | | + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +export declare enum HarmSeverity +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | + +## SchemaType + +Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) + +Signature: + +```typescript +export declare enum SchemaType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ARRAY | "array" | Array type. | +| BOOLEAN | "boolean" | Boolean type. | +| INTEGER | "integer" | Integer type. | +| NUMBER | "number" | Number type. | +| OBJECT | "object" | Object type. | +| STRING | "string" | String type. | + +## VertexAIErrorCode + +Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. + +Signature: + +```typescript +export declare const enum VertexAIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | + diff --git a/docs-devsite/vertexai-preview.modelparams.md b/docs-devsite/vertexai.modelparams.md similarity index 54% rename from docs-devsite/vertexai-preview.modelparams.md rename to docs-devsite/vertexai.modelparams.md index 34d68f86714..590bc14e435 100644 --- a/docs-devsite/vertexai-preview.modelparams.md +++ b/docs-devsite/vertexai.modelparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: ```typescript export interface ModelParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [model](./vertexai-preview.modelparams.md#modelparamsmodel) | string | | -| [systemInstruction](./vertexai-preview.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.modelparams.md#modelparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [model](./vertexai.modelparams.md#modelparamsmodel) | string | | +| [systemInstruction](./vertexai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.modelparams.md#modelparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## ModelParams.model diff --git a/docs-devsite/vertexai.numberschema.md b/docs-devsite/vertexai.numberschema.md new file mode 100644 index 00000000000..8fdd9374652 --- /dev/null +++ b/docs-devsite/vertexai.numberschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# NumberSchema class +Schema class for "number" types. + +Signature: + +```typescript +export declare class NumberSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | + +## NumberSchema.(constructor) + +Constructs a new instance of the `NumberSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.objectschema.md b/docs-devsite/vertexai.objectschema.md new file mode 100644 index 00000000000..8731960b220 --- /dev/null +++ b/docs-devsite/vertexai.objectschema.md @@ -0,0 +1,71 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchema class +Schema class for "object" types. The `properties` param must be a map of `Schema` objects. + +Signature: + +```typescript +export declare class ObjectSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, properties, optionalProperties)](./vertexai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [optionalProperties](./vertexai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | +| [properties](./vertexai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | + +## ObjectSchema.(constructor) + +Constructs a new instance of the `ObjectSchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, properties: { + [k: string]: TypedSchema; + }, optionalProperties?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| properties | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | +| optionalProperties | string\[\] | | + +## ObjectSchema.optionalProperties + +Signature: + +```typescript +optionalProperties: string[]; +``` + +## ObjectSchema.properties + +Signature: + +```typescript +properties: { + [k: string]: TypedSchema; + }; +``` diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/vertexai.objectschemainterface.md new file mode 100644 index 00000000000..6a4e052d183 --- /dev/null +++ b/docs-devsite/vertexai.objectschemainterface.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchemaInterface interface +Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. + +Signature: + +```typescript +export interface ObjectSchemaInterface extends SchemaInterface +``` +Extends: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [optionalProperties](./vertexai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | +| [type](./vertexai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./vertexai.md#schematypeobject_enummember) | | + +## ObjectSchemaInterface.optionalProperties + +Signature: + +```typescript +optionalProperties?: string[]; +``` + +## ObjectSchemaInterface.type + +Signature: + +```typescript +type: SchemaType.OBJECT; +``` diff --git a/docs-devsite/vertexai-preview.promptfeedback.md b/docs-devsite/vertexai.promptfeedback.md similarity index 66% rename from docs-devsite/vertexai-preview.promptfeedback.md rename to docs-devsite/vertexai.promptfeedback.md index cb27f10c8c3..369ef02051d 100644 --- a/docs-devsite/vertexai-preview.promptfeedback.md +++ b/docs-devsite/vertexai.promptfeedback.md @@ -22,16 +22,16 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | -| [blockReason](./vertexai-preview.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai-preview.md#blockreason) | | -| [blockReasonMessage](./vertexai-preview.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | -| [safetyRatings](./vertexai-preview.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | +| [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | +| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | +| [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason Signature: ```typescript -blockReason: BlockReason; +blockReason?: BlockReason; ``` ## PromptFeedback.blockReasonMessage diff --git a/docs-devsite/vertexai-preview.requestoptions.md b/docs-devsite/vertexai.requestoptions.md similarity index 55% rename from docs-devsite/vertexai-preview.requestoptions.md rename to docs-devsite/vertexai.requestoptions.md index 550ec44ce96..6d074775520 100644 --- a/docs-devsite/vertexai-preview.requestoptions.md +++ b/docs-devsite/vertexai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: @@ -22,12 +22,12 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./vertexai-preview.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebaseml.googleapis.com | -| [timeout](./vertexai-preview.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. | +| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | +| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | ## RequestOptions.baseUrl -Base url for endpoint. Defaults to https://firebaseml.googleapis.com +Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com Signature: @@ -37,7 +37,7 @@ baseUrl?: string; ## RequestOptions.timeout -Request timeout in milliseconds. +Request timeout in milliseconds. Defaults to 180 seconds (180000ms). Signature: diff --git a/docs-devsite/vertexai-preview.retrievedcontextattribution.md b/docs-devsite/vertexai.retrievedcontextattribution.md similarity index 76% rename from docs-devsite/vertexai-preview.retrievedcontextattribution.md rename to docs-devsite/vertexai.retrievedcontextattribution.md index 0a121cdc004..e36bfacb3ec 100644 --- a/docs-devsite/vertexai-preview.retrievedcontextattribution.md +++ b/docs-devsite/vertexai.retrievedcontextattribution.md @@ -21,8 +21,8 @@ export interface RetrievedContextAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | -| [uri](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | +| [title](./vertexai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | +| [uri](./vertexai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | ## RetrievedContextAttribution.title diff --git a/docs-devsite/vertexai-preview.safetyrating.md b/docs-devsite/vertexai.safetyrating.md similarity index 55% rename from docs-devsite/vertexai-preview.safetyrating.md rename to docs-devsite/vertexai.safetyrating.md index 65b1bc8fb42..b5f204bef2c 100644 --- a/docs-devsite/vertexai-preview.safetyrating.md +++ b/docs-devsite/vertexai.safetyrating.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) +A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) Signature: @@ -22,12 +22,12 @@ export interface SafetyRating | Property | Type | Description | | --- | --- | --- | -| [blocked](./vertexai-preview.safetyrating.md#safetyratingblocked) | boolean | | -| [category](./vertexai-preview.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [probability](./vertexai-preview.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai-preview.md#harmprobability) | | -| [probabilityScore](./vertexai-preview.safetyrating.md#safetyratingprobabilityscore) | number | | -| [severity](./vertexai-preview.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai-preview.md#harmseverity) | | -| [severityScore](./vertexai-preview.safetyrating.md#safetyratingseverityscore) | number | | +| [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | +| [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | +| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | | +| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | | +| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | | ## SafetyRating.blocked diff --git a/docs-devsite/vertexai-preview.safetysetting.md b/docs-devsite/vertexai.safetysetting.md similarity index 64% rename from docs-devsite/vertexai-preview.safetysetting.md rename to docs-devsite/vertexai.safetysetting.md index 78678315805..17fa1cff839 100644 --- a/docs-devsite/vertexai-preview.safetysetting.md +++ b/docs-devsite/vertexai.safetysetting.md @@ -22,9 +22,9 @@ export interface SafetySetting | Property | Type | Description | | --- | --- | --- | -| [category](./vertexai-preview.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [method](./vertexai-preview.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [threshold](./vertexai-preview.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | | +| [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | ## SafetySetting.category @@ -39,7 +39,7 @@ category: HarmCategory; Signature: ```typescript -method: HarmBlockMethod; +method?: HarmBlockMethod; ``` ## SafetySetting.threshold diff --git a/docs-devsite/vertexai.schema.md b/docs-devsite/vertexai.schema.md new file mode 100644 index 00000000000..f4a36c3c506 --- /dev/null +++ b/docs-devsite/vertexai.schema.md @@ -0,0 +1,250 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Schema class +Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with `JSON.stringify()` into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) + +Signature: + +```typescript +export declare abstract class Schema implements SchemaInterface +``` +Implements: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [description](./vertexai.schema.md#schemadescription) | | string | Optional. The description of the property. | +| [example](./vertexai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | +| [format](./vertexai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| +| [nullable](./vertexai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | +| [type](./vertexai.schema.md#schematype) | | [SchemaType](./vertexai.md#schematype) | Optional. The type of the property. [SchemaType](./vertexai.md#schematype). | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [array(arrayParams)](./vertexai.schema.md#schemaarray) | static | | +| [boolean(booleanParams)](./vertexai.schema.md#schemaboolean) | static | | +| [enumString(stringParams)](./vertexai.schema.md#schemaenumstring) | static | | +| [integer(integerParams)](./vertexai.schema.md#schemainteger) | static | | +| [number(numberParams)](./vertexai.schema.md#schemanumber) | static | | +| [object(objectParams)](./vertexai.schema.md#schemaobject) | static | | +| [string(stringParams)](./vertexai.schema.md#schemastring) | static | | + +## Schema.(constructor) + +Constructs a new instance of the `Schema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaInterface); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | | + +## Schema.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## Schema.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## Schema.format + +Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
+ +Signature: + +```typescript +format?: string; +``` + +## Schema.nullable + +Optional. Whether the property is nullable. Defaults to false. + +Signature: + +```typescript +nullable: boolean; +``` + +## Schema.type + +Optional. The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` + +## Schema.array() + +Signature: + +```typescript +static array(arrayParams: SchemaParams & { + items: Schema; + }): ArraySchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrayParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { items: [Schema](./vertexai.schema.md#schema_class); } | | + +Returns: + +[ArraySchema](./vertexai.arrayschema.md#arrayschema_class) + +## Schema.boolean() + +Signature: + +```typescript +static boolean(booleanParams?: SchemaParams): BooleanSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| booleanParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) + +## Schema.enumString() + +Signature: + +```typescript +static enumString(stringParams: SchemaParams & { + enum: string[]; + }): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + +## Schema.integer() + +Signature: + +```typescript +static integer(integerParams?: SchemaParams): IntegerSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| integerParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[IntegerSchema](./vertexai.integerschema.md#integerschema_class) + +## Schema.number() + +Signature: + +```typescript +static number(numberParams?: SchemaParams): NumberSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| numberParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[NumberSchema](./vertexai.numberschema.md#numberschema_class) + +## Schema.object() + +Signature: + +```typescript +static object(objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + }): ObjectSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| objectParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./vertexai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | + +Returns: + +[ObjectSchema](./vertexai.objectschema.md#objectschema_class) + +## Schema.string() + +Signature: + +```typescript +static string(stringParams?: SchemaParams): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/vertexai.schemainterface.md new file mode 100644 index 00000000000..3992c9e5116 --- /dev/null +++ b/docs-devsite/vertexai.schemainterface.md @@ -0,0 +1,36 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaInterface interface +Interface for [Schema](./vertexai.schema.md#schema_class) class. + +Signature: + +```typescript +export interface SchemaInterface extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./vertexai.schemainterface.md#schemainterfacetype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaInterface.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/vertexai.schemaparams.md new file mode 100644 index 00000000000..3c6d9f385fd --- /dev/null +++ b/docs-devsite/vertexai.schemaparams.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaParams interface +Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. + +Signature: + +```typescript +export interface SchemaParams extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/vertexai.schemarequest.md new file mode 100644 index 00000000000..f12259b1608 --- /dev/null +++ b/docs-devsite/vertexai.schemarequest.md @@ -0,0 +1,47 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaRequest interface +Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. + +Signature: + +```typescript +export interface SchemaRequest extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [required](./vertexai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | +| [type](./vertexai.schemarequest.md#schemarequesttype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaRequest.required + +Optional. Array of required property. + +Signature: + +```typescript +required?: string[]; +``` + +## SchemaRequest.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md new file mode 100644 index 00000000000..50cc6464ecf --- /dev/null +++ b/docs-devsite/vertexai.schemashared.md @@ -0,0 +1,103 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaShared interface +Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. + +Signature: + +```typescript +export interface SchemaShared +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | +| [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | +| [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | +| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. | +| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | +| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | +| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | + +## SchemaShared.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## SchemaShared.enum + +Optional. The enum of the property. + +Signature: + +```typescript +enum?: string[]; +``` + +## SchemaShared.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## SchemaShared.format + +Optional. The format of the property. + +Signature: + +```typescript +format?: string; +``` + +## SchemaShared.items + +Optional. The items of the property. + +Signature: + +```typescript +items?: T; +``` + +## SchemaShared.nullable + +Optional. Whether the property is nullable. + +Signature: + +```typescript +nullable?: boolean; +``` + +## SchemaShared.properties + +Optional. Map of `Schema` objects. + +Signature: + +```typescript +properties?: { + [k: string]: T; + }; +``` diff --git a/docs-devsite/vertexai-preview.segment.md b/docs-devsite/vertexai.segment.md similarity index 75% rename from docs-devsite/vertexai-preview.segment.md rename to docs-devsite/vertexai.segment.md index c64bc3ffcda..db61f00a149 100644 --- a/docs-devsite/vertexai-preview.segment.md +++ b/docs-devsite/vertexai.segment.md @@ -21,9 +21,9 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.segment.md#segmentendindex) | number | | -| [partIndex](./vertexai-preview.segment.md#segmentpartindex) | number | | -| [startIndex](./vertexai-preview.segment.md#segmentstartindex) | number | | +| [endIndex](./vertexai.segment.md#segmentendindex) | number | | +| [partIndex](./vertexai.segment.md#segmentpartindex) | number | | +| [startIndex](./vertexai.segment.md#segmentstartindex) | number | | ## Segment.endIndex diff --git a/docs-devsite/vertexai-preview.startchatparams.md b/docs-devsite/vertexai.startchatparams.md similarity index 51% rename from docs-devsite/vertexai-preview.startchatparams.md rename to docs-devsite/vertexai.startchatparams.md index f422f7a1ff0..e07bbd91d82 100644 --- a/docs-devsite/vertexai-preview.startchatparams.md +++ b/docs-devsite/vertexai.startchatparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # StartChatParams interface -Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). +Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). Signature: ```typescript export interface StartChatParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [history](./vertexai-preview.startchatparams.md#startchatparamshistory) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.startchatparams.md#startchatparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [history](./vertexai.startchatparams.md#startchatparamshistory) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.startchatparams.md#startchatparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## StartChatParams.history diff --git a/docs-devsite/vertexai.stringschema.md b/docs-devsite/vertexai.stringschema.md new file mode 100644 index 00000000000..bfafe0fe9df --- /dev/null +++ b/docs-devsite/vertexai.stringschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StringSchema class +Schema class for "string" types. Can be used with or without enum values. + +Signature: + +```typescript +export declare class StringSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, enumValues)](./vertexai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [enum](./vertexai.stringschema.md#stringschemaenum) | | string\[\] | | + +## StringSchema.(constructor) + +Constructs a new instance of the `StringSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams, enumValues?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| enumValues | string\[\] | | + +## StringSchema.enum + +Signature: + +```typescript +enum?: string[]; +``` diff --git a/docs-devsite/vertexai-preview.textpart.md b/docs-devsite/vertexai.textpart.md similarity index 72% rename from docs-devsite/vertexai-preview.textpart.md rename to docs-devsite/vertexai.textpart.md index 206168180b2..afee40a369d 100644 --- a/docs-devsite/vertexai-preview.textpart.md +++ b/docs-devsite/vertexai.textpart.md @@ -22,10 +22,10 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.textpart.md#textpartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.textpart.md#textpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.textpart.md#textpartinlinedata) | never | | -| [text](./vertexai-preview.textpart.md#textparttext) | string | | +| [functionCall](./vertexai.textpart.md#textpartfunctioncall) | never | | +| [functionResponse](./vertexai.textpart.md#textpartfunctionresponse) | never | | +| [inlineData](./vertexai.textpart.md#textpartinlinedata) | never | | +| [text](./vertexai.textpart.md#textparttext) | string | | ## TextPart.functionCall diff --git a/docs-devsite/vertexai-preview.toolconfig.md b/docs-devsite/vertexai.toolconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.toolconfig.md rename to docs-devsite/vertexai.toolconfig.md index 4278eef509b..30c62c17c01 100644 --- a/docs-devsite/vertexai-preview.toolconfig.md +++ b/docs-devsite/vertexai.toolconfig.md @@ -22,12 +22,12 @@ export interface ToolConfig | Property | Type | Description | | --- | --- | --- | -| [functionCallingConfig](./vertexai-preview.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | +| [functionCallingConfig](./vertexai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | ## ToolConfig.functionCallingConfig Signature: ```typescript -functionCallingConfig: FunctionCallingConfig; +functionCallingConfig?: FunctionCallingConfig; ``` diff --git a/docs-devsite/vertexai-preview.usagemetadata.md b/docs-devsite/vertexai.usagemetadata.md similarity index 63% rename from docs-devsite/vertexai-preview.usagemetadata.md rename to docs-devsite/vertexai.usagemetadata.md index 2829c9dbd5d..d254f34335f 100644 --- a/docs-devsite/vertexai-preview.usagemetadata.md +++ b/docs-devsite/vertexai.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,9 +22,9 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | -| [candidatesTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatacandidatestokencount) | number | | -| [promptTokenCount](./vertexai-preview.usagemetadata.md#usagemetadataprompttokencount) | number | | -| [totalTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatatotaltokencount) | number | | +| [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount diff --git a/docs-devsite/vertexai-preview.vertexai.md b/docs-devsite/vertexai.vertexai.md similarity index 58% rename from docs-devsite/vertexai-preview.vertexai.md rename to docs-devsite/vertexai.vertexai.md index 35991f2be12..4797bf8bada 100644 --- a/docs-devsite/vertexai-preview.vertexai.md +++ b/docs-devsite/vertexai.vertexai.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAI interface -An instance of the Vertex AI for Firebase SDK. +An instance of the Vertex AI in Firebase SDK. Signature: @@ -22,12 +22,12 @@ export interface VertexAI | Property | Type | Description | | --- | --- | --- | -| [app](./vertexai-preview.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. | -| [location](./vertexai-preview.vertexai.md#vertexailocation) | string | | +| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | +| [location](./vertexai.vertexai.md#vertexailocation) | string | | ## VertexAI.app -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. Signature: diff --git a/docs-devsite/vertexai-preview.vertexaierror.md b/docs-devsite/vertexai.vertexaierror.md similarity index 55% rename from docs-devsite/vertexai-preview.vertexaierror.md rename to docs-devsite/vertexai.vertexaierror.md index 05a12c62b8e..86532ac6018 100644 --- a/docs-devsite/vertexai-preview.vertexaierror.md +++ b/docs-devsite/vertexai.vertexaierror.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAIError class -Error class for the Vertex AI for Firebase SDK. +Error class for the Vertex AI in Firebase SDK. Signature: @@ -23,15 +23,14 @@ export declare class VertexAIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai-preview.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | +| [(constructor)(code, message, customErrorData)](./vertexai.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai-preview.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | | -| [customErrorData](./vertexai-preview.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | | -| [message](./vertexai-preview.vertexaierror.md#vertexaierrormessage) | | string | | +| [code](./vertexai.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | | +| [customErrorData](./vertexai.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | ## VertexAIError.(constructor) @@ -47,9 +46,9 @@ constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomEr | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode). | +| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | | message | string | A human-readable message describing the error. | -| customErrorData | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | +| customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | ## VertexAIError.code @@ -66,11 +65,3 @@ readonly code: VertexAIErrorCode; ```typescript readonly customErrorData?: CustomErrorData | undefined; ``` - -## VertexAIError.message - -Signature: - -```typescript -readonly message: string; -``` diff --git a/docs-devsite/vertexai-preview.vertexaioptions.md b/docs-devsite/vertexai.vertexaioptions.md similarity index 79% rename from docs-devsite/vertexai-preview.vertexaioptions.md rename to docs-devsite/vertexai.vertexaioptions.md index 320132c22f9..e15b525bfed 100644 --- a/docs-devsite/vertexai-preview.vertexaioptions.md +++ b/docs-devsite/vertexai.vertexaioptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAIOptions interface -Options when initializing the Vertex AI for Firebase SDK. +Options when initializing the Vertex AI in Firebase SDK. Signature: @@ -22,7 +22,7 @@ export interface VertexAIOptions | Property | Type | Description | | --- | --- | --- | -| [location](./vertexai-preview.vertexaioptions.md#vertexaioptionslocation) | string | | +| [location](./vertexai.vertexaioptions.md#vertexaioptionslocation) | string | | ## VertexAIOptions.location diff --git a/docs-devsite/vertexai-preview.videometadata.md b/docs-devsite/vertexai.videometadata.md similarity index 66% rename from docs-devsite/vertexai-preview.videometadata.md rename to docs-devsite/vertexai.videometadata.md index 04d8883bae9..b4f872c4e3d 100644 --- a/docs-devsite/vertexai-preview.videometadata.md +++ b/docs-devsite/vertexai.videometadata.md @@ -22,8 +22,8 @@ export interface VideoMetadata | Property | Type | Description | | --- | --- | --- | -| [endOffset](./vertexai-preview.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | -| [startOffset](./vertexai-preview.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [endOffset](./vertexai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [startOffset](./vertexai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | ## VideoMetadata.endOffset diff --git a/docs-devsite/vertexai-preview.webattribution.md b/docs-devsite/vertexai.webattribution.md similarity index 79% rename from docs-devsite/vertexai-preview.webattribution.md rename to docs-devsite/vertexai.webattribution.md index 5db6f94b82e..bb4fecf874d 100644 --- a/docs-devsite/vertexai-preview.webattribution.md +++ b/docs-devsite/vertexai.webattribution.md @@ -21,8 +21,8 @@ export interface WebAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.webattribution.md#webattributiontitle) | string | | -| [uri](./vertexai-preview.webattribution.md#webattributionuri) | string | | +| [title](./vertexai.webattribution.md#webattributiontitle) | string | | +| [uri](./vertexai.webattribution.md#webattributionuri) | string | | ## WebAttribution.title From 877bf3c43f3cf12c8e9a6caeaa9124e51af6ea01 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:53:44 -0700 Subject: [PATCH 035/295] Skipping pipeline tests for CI --- packages/firestore/test/integration/api/pipeline.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 8b107a7ea65..9bdb35251d0 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -62,7 +62,7 @@ import { apiDescribe, withTestCollection } from '../util/helpers'; use(chaiAsPromised); useFirestorePipelines(); -apiDescribe('Pipelines', persistence => { +apiDescribe.skip('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; let randomCol: CollectionReference; From 1f7b0718a7e6d822d1cb376843b8061501ab83f3 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Wed, 13 Nov 2024 22:08:32 +0000 Subject: [PATCH 036/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 8b7e4612dd9..165385bf890 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2214,8 +2214,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index c1106de776c..d8beb999ddd 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2490,8 +2490,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From d9b6e9a8bec774d64e1174565415b8b19f939d18 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:45:41 -0700 Subject: [PATCH 037/295] reverting changes to docs-devsite --- docs-devsite/_toc.yaml | 356 - docs-devsite/firestore_.accumulator.md | 39 - docs-devsite/firestore_.add.md | 49 - docs-devsite/firestore_.addfields.md | 64 - docs-devsite/firestore_.aggregate.md | 65 - docs-devsite/firestore_.and.md | 17 - docs-devsite/firestore_.arrayconcat.md | 49 - docs-devsite/firestore_.arraycontains.md | 67 - docs-devsite/firestore_.arraycontainsall.md | 67 - docs-devsite/firestore_.arraycontainsany.md | 67 - docs-devsite/firestore_.arrayelement.md | 41 - docs-devsite/firestore_.arraylength.md | 48 - docs-devsite/firestore_.arrayreverse.md | 48 - docs-devsite/firestore_.avg.md | 67 - docs-devsite/firestore_.bytelength.md | 48 - docs-devsite/firestore_.charlength.md | 48 - .../firestore_.collectiongroupsource.md | 64 - docs-devsite/firestore_.collectionsource.md | 64 - docs-devsite/firestore_.constant.md | 3504 ------- docs-devsite/firestore_.cosinedistance.md | 49 - docs-devsite/firestore_.count.md | 67 - docs-devsite/firestore_.databasesource.md | 39 - docs-devsite/firestore_.distinct.md | 64 - docs-devsite/firestore_.divide.md | 49 - docs-devsite/firestore_.documentssource.md | 92 - docs-devsite/firestore_.dotproduct.md | 49 - docs-devsite/firestore_.endswith.md | 67 - docs-devsite/firestore_.eq.md | 67 - docs-devsite/firestore_.euclideandistance.md | 49 - docs-devsite/firestore_.exists.md | 66 - docs-devsite/firestore_.exprwithalias.md | 3207 ------ docs-devsite/firestore_.field.md | 3275 ------ docs-devsite/firestore_.fields.md | 3210 ------ docs-devsite/firestore_.filtercondition.md | 39 - docs-devsite/firestore_.findnearest.md | 39 - docs-devsite/firestore_.findnearestoptions.md | 86 - docs-devsite/firestore_.firestore.md | 14 - docs-devsite/firestore_.firestorefunction.md | 3173 ------ docs-devsite/firestore_.genericstage.md | 65 - docs-devsite/firestore_.gt.md | 67 - docs-devsite/firestore_.gte.md | 67 - docs-devsite/firestore_.if.md | 68 - docs-devsite/firestore_.in.md | 67 - docs-devsite/firestore_.isnan.md | 66 - docs-devsite/firestore_.like.md | 67 - docs-devsite/firestore_.limit.md | 64 - docs-devsite/firestore_.logicalmax.md | 49 - docs-devsite/firestore_.logicalmin.md | 49 - docs-devsite/firestore_.lt.md | 67 - docs-devsite/firestore_.lte.md | 67 - docs-devsite/firestore_.mapget.md | 49 - docs-devsite/firestore_.max.md | 67 - docs-devsite/firestore_.md | 8980 ++--------------- docs-devsite/firestore_.min.md | 67 - docs-devsite/firestore_.mod.md | 49 - docs-devsite/firestore_.multiply.md | 49 - docs-devsite/firestore_.neq.md | 67 - docs-devsite/firestore_.not.md | 66 - docs-devsite/firestore_.offset.md | 64 - docs-devsite/firestore_.or.md | 17 - docs-devsite/firestore_.ordering.md | 51 - docs-devsite/firestore_.pipeline.md | 609 -- docs-devsite/firestore_.pipelineresult.md | 184 - docs-devsite/firestore_.pipelinesource.md | 109 - docs-devsite/firestore_.query.md | 14 - ...restore_.querycompositefilterconstraint.md | 2 +- docs-devsite/firestore_.regexcontains.md | 67 - docs-devsite/firestore_.regexmatch.md | 67 - docs-devsite/firestore_.replaceall.md | 50 - docs-devsite/firestore_.replacefirst.md | 50 - docs-devsite/firestore_.reverse.md | 48 - docs-devsite/firestore_.select.md | 64 - docs-devsite/firestore_.selectable.md | 39 - docs-devsite/firestore_.sort.md | 64 - docs-devsite/firestore_.stage.md | 38 - docs-devsite/firestore_.startswith.md | 67 - docs-devsite/firestore_.strconcat.md | 49 - docs-devsite/firestore_.strcontains.md | 67 - docs-devsite/firestore_.subtract.md | 49 - docs-devsite/firestore_.sum.md | 67 - docs-devsite/firestore_.timestampadd.md | 50 - docs-devsite/firestore_.timestampsub.md | 50 - .../firestore_.timestamptounixmicros.md | 48 - .../firestore_.timestamptounixmillis.md | 48 - .../firestore_.timestamptounixseconds.md | 48 - docs-devsite/firestore_.tolower.md | 48 - docs-devsite/firestore_.toupper.md | 48 - docs-devsite/firestore_.trim.md | 48 - .../firestore_.unixmicrostotimestamp.md | 48 - .../firestore_.unixmillistotimestamp.md | 48 - .../firestore_.unixsecondstotimestamp.md | 48 - docs-devsite/firestore_.vectorlength.md | 48 - docs-devsite/firestore_.where.md | 64 - docs-devsite/firestore_.xor.md | 66 - docs-devsite/firestore_lite.accumulator.md | 39 - docs-devsite/firestore_lite.add.md | 49 - docs-devsite/firestore_lite.addfields.md | 64 - docs-devsite/firestore_lite.aggregate.md | 65 - docs-devsite/firestore_lite.and.md | 17 - docs-devsite/firestore_lite.arrayconcat.md | 49 - docs-devsite/firestore_lite.arraycontains.md | 67 - .../firestore_lite.arraycontainsall.md | 67 - .../firestore_lite.arraycontainsany.md | 67 - docs-devsite/firestore_lite.arrayelement.md | 41 - docs-devsite/firestore_lite.arraylength.md | 48 - docs-devsite/firestore_lite.arrayreverse.md | 48 - docs-devsite/firestore_lite.avg.md | 67 - docs-devsite/firestore_lite.bytelength.md | 48 - docs-devsite/firestore_lite.charlength.md | 48 - .../firestore_lite.collectiongroupsource.md | 64 - .../firestore_lite.collectionsource.md | 64 - docs-devsite/firestore_lite.constant.md | 3504 ------- docs-devsite/firestore_lite.cosinedistance.md | 49 - docs-devsite/firestore_lite.count.md | 67 - docs-devsite/firestore_lite.databasesource.md | 39 - docs-devsite/firestore_lite.distinct.md | 64 - docs-devsite/firestore_lite.divide.md | 49 - .../firestore_lite.documentssource.md | 92 - docs-devsite/firestore_lite.dotproduct.md | 49 - docs-devsite/firestore_lite.endswith.md | 67 - docs-devsite/firestore_lite.eq.md | 67 - .../firestore_lite.euclideandistance.md | 49 - docs-devsite/firestore_lite.exists.md | 66 - docs-devsite/firestore_lite.exprwithalias.md | 3207 ------ docs-devsite/firestore_lite.field.md | 3275 ------ docs-devsite/firestore_lite.fields.md | 3210 ------ .../firestore_lite.filtercondition.md | 39 - docs-devsite/firestore_lite.findnearest.md | 39 - .../firestore_lite.findnearestoptions.md | 86 - docs-devsite/firestore_lite.firestore.md | 14 - .../firestore_lite.firestorefunction.md | 3173 ------ docs-devsite/firestore_lite.genericstage.md | 65 - docs-devsite/firestore_lite.gt.md | 67 - docs-devsite/firestore_lite.gte.md | 67 - docs-devsite/firestore_lite.if.md | 68 - docs-devsite/firestore_lite.in.md | 67 - docs-devsite/firestore_lite.isnan.md | 66 - docs-devsite/firestore_lite.like.md | 67 - docs-devsite/firestore_lite.limit.md | 64 - docs-devsite/firestore_lite.logicalmax.md | 49 - docs-devsite/firestore_lite.logicalmin.md | 49 - docs-devsite/firestore_lite.lt.md | 67 - docs-devsite/firestore_lite.lte.md | 67 - docs-devsite/firestore_lite.mapget.md | 49 - docs-devsite/firestore_lite.max.md | 67 - docs-devsite/firestore_lite.md | 8091 +-------------- docs-devsite/firestore_lite.min.md | 67 - docs-devsite/firestore_lite.mod.md | 49 - docs-devsite/firestore_lite.multiply.md | 49 - docs-devsite/firestore_lite.neq.md | 67 - docs-devsite/firestore_lite.not.md | 66 - docs-devsite/firestore_lite.offset.md | 64 - docs-devsite/firestore_lite.or.md | 17 - docs-devsite/firestore_lite.ordering.md | 51 - docs-devsite/firestore_lite.pipeline.md | 564 -- docs-devsite/firestore_lite.pipelineresult.md | 184 - docs-devsite/firestore_lite.pipelinesource.md | 109 - docs-devsite/firestore_lite.query.md | 14 - ...ore_lite.querycompositefilterconstraint.md | 2 +- docs-devsite/firestore_lite.regexcontains.md | 67 - docs-devsite/firestore_lite.regexmatch.md | 67 - docs-devsite/firestore_lite.replaceall.md | 50 - docs-devsite/firestore_lite.replacefirst.md | 50 - docs-devsite/firestore_lite.reverse.md | 48 - docs-devsite/firestore_lite.select.md | 64 - docs-devsite/firestore_lite.selectable.md | 39 - docs-devsite/firestore_lite.sort.md | 64 - docs-devsite/firestore_lite.stage.md | 38 - docs-devsite/firestore_lite.startswith.md | 67 - docs-devsite/firestore_lite.strconcat.md | 49 - docs-devsite/firestore_lite.strcontains.md | 67 - docs-devsite/firestore_lite.subtract.md | 49 - docs-devsite/firestore_lite.sum.md | 67 - docs-devsite/firestore_lite.timestampadd.md | 50 - docs-devsite/firestore_lite.timestampsub.md | 50 - .../firestore_lite.timestamptounixmicros.md | 48 - .../firestore_lite.timestamptounixmillis.md | 48 - .../firestore_lite.timestamptounixseconds.md | 48 - docs-devsite/firestore_lite.tolower.md | 48 - docs-devsite/firestore_lite.toupper.md | 48 - docs-devsite/firestore_lite.trim.md | 48 - .../firestore_lite.unixmicrostotimestamp.md | 48 - .../firestore_lite.unixmillistotimestamp.md | 48 - .../firestore_lite.unixsecondstotimestamp.md | 48 - docs-devsite/firestore_lite.vectorlength.md | 48 - docs-devsite/firestore_lite.where.md | 64 - docs-devsite/firestore_lite.xor.md | 66 - 187 files changed, 1490 insertions(+), 59572 deletions(-) delete mode 100644 docs-devsite/firestore_.accumulator.md delete mode 100644 docs-devsite/firestore_.add.md delete mode 100644 docs-devsite/firestore_.addfields.md delete mode 100644 docs-devsite/firestore_.aggregate.md delete mode 100644 docs-devsite/firestore_.and.md delete mode 100644 docs-devsite/firestore_.arrayconcat.md delete mode 100644 docs-devsite/firestore_.arraycontains.md delete mode 100644 docs-devsite/firestore_.arraycontainsall.md delete mode 100644 docs-devsite/firestore_.arraycontainsany.md delete mode 100644 docs-devsite/firestore_.arrayelement.md delete mode 100644 docs-devsite/firestore_.arraylength.md delete mode 100644 docs-devsite/firestore_.arrayreverse.md delete mode 100644 docs-devsite/firestore_.avg.md delete mode 100644 docs-devsite/firestore_.bytelength.md delete mode 100644 docs-devsite/firestore_.charlength.md delete mode 100644 docs-devsite/firestore_.collectiongroupsource.md delete mode 100644 docs-devsite/firestore_.collectionsource.md delete mode 100644 docs-devsite/firestore_.constant.md delete mode 100644 docs-devsite/firestore_.cosinedistance.md delete mode 100644 docs-devsite/firestore_.count.md delete mode 100644 docs-devsite/firestore_.databasesource.md delete mode 100644 docs-devsite/firestore_.distinct.md delete mode 100644 docs-devsite/firestore_.divide.md delete mode 100644 docs-devsite/firestore_.documentssource.md delete mode 100644 docs-devsite/firestore_.dotproduct.md delete mode 100644 docs-devsite/firestore_.endswith.md delete mode 100644 docs-devsite/firestore_.eq.md delete mode 100644 docs-devsite/firestore_.euclideandistance.md delete mode 100644 docs-devsite/firestore_.exists.md delete mode 100644 docs-devsite/firestore_.exprwithalias.md delete mode 100644 docs-devsite/firestore_.field.md delete mode 100644 docs-devsite/firestore_.fields.md delete mode 100644 docs-devsite/firestore_.filtercondition.md delete mode 100644 docs-devsite/firestore_.findnearest.md delete mode 100644 docs-devsite/firestore_.findnearestoptions.md delete mode 100644 docs-devsite/firestore_.firestorefunction.md delete mode 100644 docs-devsite/firestore_.genericstage.md delete mode 100644 docs-devsite/firestore_.gt.md delete mode 100644 docs-devsite/firestore_.gte.md delete mode 100644 docs-devsite/firestore_.if.md delete mode 100644 docs-devsite/firestore_.in.md delete mode 100644 docs-devsite/firestore_.isnan.md delete mode 100644 docs-devsite/firestore_.like.md delete mode 100644 docs-devsite/firestore_.limit.md delete mode 100644 docs-devsite/firestore_.logicalmax.md delete mode 100644 docs-devsite/firestore_.logicalmin.md delete mode 100644 docs-devsite/firestore_.lt.md delete mode 100644 docs-devsite/firestore_.lte.md delete mode 100644 docs-devsite/firestore_.mapget.md delete mode 100644 docs-devsite/firestore_.max.md delete mode 100644 docs-devsite/firestore_.min.md delete mode 100644 docs-devsite/firestore_.mod.md delete mode 100644 docs-devsite/firestore_.multiply.md delete mode 100644 docs-devsite/firestore_.neq.md delete mode 100644 docs-devsite/firestore_.not.md delete mode 100644 docs-devsite/firestore_.offset.md delete mode 100644 docs-devsite/firestore_.or.md delete mode 100644 docs-devsite/firestore_.ordering.md delete mode 100644 docs-devsite/firestore_.pipeline.md delete mode 100644 docs-devsite/firestore_.pipelineresult.md delete mode 100644 docs-devsite/firestore_.pipelinesource.md delete mode 100644 docs-devsite/firestore_.regexcontains.md delete mode 100644 docs-devsite/firestore_.regexmatch.md delete mode 100644 docs-devsite/firestore_.replaceall.md delete mode 100644 docs-devsite/firestore_.replacefirst.md delete mode 100644 docs-devsite/firestore_.reverse.md delete mode 100644 docs-devsite/firestore_.select.md delete mode 100644 docs-devsite/firestore_.selectable.md delete mode 100644 docs-devsite/firestore_.sort.md delete mode 100644 docs-devsite/firestore_.stage.md delete mode 100644 docs-devsite/firestore_.startswith.md delete mode 100644 docs-devsite/firestore_.strconcat.md delete mode 100644 docs-devsite/firestore_.strcontains.md delete mode 100644 docs-devsite/firestore_.subtract.md delete mode 100644 docs-devsite/firestore_.sum.md delete mode 100644 docs-devsite/firestore_.timestampadd.md delete mode 100644 docs-devsite/firestore_.timestampsub.md delete mode 100644 docs-devsite/firestore_.timestamptounixmicros.md delete mode 100644 docs-devsite/firestore_.timestamptounixmillis.md delete mode 100644 docs-devsite/firestore_.timestamptounixseconds.md delete mode 100644 docs-devsite/firestore_.tolower.md delete mode 100644 docs-devsite/firestore_.toupper.md delete mode 100644 docs-devsite/firestore_.trim.md delete mode 100644 docs-devsite/firestore_.unixmicrostotimestamp.md delete mode 100644 docs-devsite/firestore_.unixmillistotimestamp.md delete mode 100644 docs-devsite/firestore_.unixsecondstotimestamp.md delete mode 100644 docs-devsite/firestore_.vectorlength.md delete mode 100644 docs-devsite/firestore_.where.md delete mode 100644 docs-devsite/firestore_.xor.md delete mode 100644 docs-devsite/firestore_lite.accumulator.md delete mode 100644 docs-devsite/firestore_lite.add.md delete mode 100644 docs-devsite/firestore_lite.addfields.md delete mode 100644 docs-devsite/firestore_lite.aggregate.md delete mode 100644 docs-devsite/firestore_lite.and.md delete mode 100644 docs-devsite/firestore_lite.arrayconcat.md delete mode 100644 docs-devsite/firestore_lite.arraycontains.md delete mode 100644 docs-devsite/firestore_lite.arraycontainsall.md delete mode 100644 docs-devsite/firestore_lite.arraycontainsany.md delete mode 100644 docs-devsite/firestore_lite.arrayelement.md delete mode 100644 docs-devsite/firestore_lite.arraylength.md delete mode 100644 docs-devsite/firestore_lite.arrayreverse.md delete mode 100644 docs-devsite/firestore_lite.avg.md delete mode 100644 docs-devsite/firestore_lite.bytelength.md delete mode 100644 docs-devsite/firestore_lite.charlength.md delete mode 100644 docs-devsite/firestore_lite.collectiongroupsource.md delete mode 100644 docs-devsite/firestore_lite.collectionsource.md delete mode 100644 docs-devsite/firestore_lite.constant.md delete mode 100644 docs-devsite/firestore_lite.cosinedistance.md delete mode 100644 docs-devsite/firestore_lite.count.md delete mode 100644 docs-devsite/firestore_lite.databasesource.md delete mode 100644 docs-devsite/firestore_lite.distinct.md delete mode 100644 docs-devsite/firestore_lite.divide.md delete mode 100644 docs-devsite/firestore_lite.documentssource.md delete mode 100644 docs-devsite/firestore_lite.dotproduct.md delete mode 100644 docs-devsite/firestore_lite.endswith.md delete mode 100644 docs-devsite/firestore_lite.eq.md delete mode 100644 docs-devsite/firestore_lite.euclideandistance.md delete mode 100644 docs-devsite/firestore_lite.exists.md delete mode 100644 docs-devsite/firestore_lite.exprwithalias.md delete mode 100644 docs-devsite/firestore_lite.field.md delete mode 100644 docs-devsite/firestore_lite.fields.md delete mode 100644 docs-devsite/firestore_lite.filtercondition.md delete mode 100644 docs-devsite/firestore_lite.findnearest.md delete mode 100644 docs-devsite/firestore_lite.findnearestoptions.md delete mode 100644 docs-devsite/firestore_lite.firestorefunction.md delete mode 100644 docs-devsite/firestore_lite.genericstage.md delete mode 100644 docs-devsite/firestore_lite.gt.md delete mode 100644 docs-devsite/firestore_lite.gte.md delete mode 100644 docs-devsite/firestore_lite.if.md delete mode 100644 docs-devsite/firestore_lite.in.md delete mode 100644 docs-devsite/firestore_lite.isnan.md delete mode 100644 docs-devsite/firestore_lite.like.md delete mode 100644 docs-devsite/firestore_lite.limit.md delete mode 100644 docs-devsite/firestore_lite.logicalmax.md delete mode 100644 docs-devsite/firestore_lite.logicalmin.md delete mode 100644 docs-devsite/firestore_lite.lt.md delete mode 100644 docs-devsite/firestore_lite.lte.md delete mode 100644 docs-devsite/firestore_lite.mapget.md delete mode 100644 docs-devsite/firestore_lite.max.md delete mode 100644 docs-devsite/firestore_lite.min.md delete mode 100644 docs-devsite/firestore_lite.mod.md delete mode 100644 docs-devsite/firestore_lite.multiply.md delete mode 100644 docs-devsite/firestore_lite.neq.md delete mode 100644 docs-devsite/firestore_lite.not.md delete mode 100644 docs-devsite/firestore_lite.offset.md delete mode 100644 docs-devsite/firestore_lite.or.md delete mode 100644 docs-devsite/firestore_lite.ordering.md delete mode 100644 docs-devsite/firestore_lite.pipeline.md delete mode 100644 docs-devsite/firestore_lite.pipelineresult.md delete mode 100644 docs-devsite/firestore_lite.pipelinesource.md delete mode 100644 docs-devsite/firestore_lite.regexcontains.md delete mode 100644 docs-devsite/firestore_lite.regexmatch.md delete mode 100644 docs-devsite/firestore_lite.replaceall.md delete mode 100644 docs-devsite/firestore_lite.replacefirst.md delete mode 100644 docs-devsite/firestore_lite.reverse.md delete mode 100644 docs-devsite/firestore_lite.select.md delete mode 100644 docs-devsite/firestore_lite.selectable.md delete mode 100644 docs-devsite/firestore_lite.sort.md delete mode 100644 docs-devsite/firestore_lite.stage.md delete mode 100644 docs-devsite/firestore_lite.startswith.md delete mode 100644 docs-devsite/firestore_lite.strconcat.md delete mode 100644 docs-devsite/firestore_lite.strcontains.md delete mode 100644 docs-devsite/firestore_lite.subtract.md delete mode 100644 docs-devsite/firestore_lite.sum.md delete mode 100644 docs-devsite/firestore_lite.timestampadd.md delete mode 100644 docs-devsite/firestore_lite.timestampsub.md delete mode 100644 docs-devsite/firestore_lite.timestamptounixmicros.md delete mode 100644 docs-devsite/firestore_lite.timestamptounixmillis.md delete mode 100644 docs-devsite/firestore_lite.timestamptounixseconds.md delete mode 100644 docs-devsite/firestore_lite.tolower.md delete mode 100644 docs-devsite/firestore_lite.toupper.md delete mode 100644 docs-devsite/firestore_lite.trim.md delete mode 100644 docs-devsite/firestore_lite.unixmicrostotimestamp.md delete mode 100644 docs-devsite/firestore_lite.unixmillistotimestamp.md delete mode 100644 docs-devsite/firestore_lite.unixsecondstotimestamp.md delete mode 100644 docs-devsite/firestore_lite.vectorlength.md delete mode 100644 docs-devsite/firestore_lite.where.md delete mode 100644 docs-devsite/firestore_lite.xor.md diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 26c520a12ba..a27f2832eb7 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -201,62 +201,16 @@ toc: - title: firestore path: /docs/reference/js/firestore_.md section: - - title: Accumulator - path: /docs/reference/js/firestore_.accumulator.md - - title: Add - path: /docs/reference/js/firestore_.add.md - - title: AddFields - path: /docs/reference/js/firestore_.addfields.md - - title: Aggregate - path: /docs/reference/js/firestore_.aggregate.md - title: AggregateField path: /docs/reference/js/firestore_.aggregatefield.md - title: AggregateQuerySnapshot path: /docs/reference/js/firestore_.aggregatequerysnapshot.md - title: AggregateSpec path: /docs/reference/js/firestore_.aggregatespec.md - - title: And - path: /docs/reference/js/firestore_.and.md - - title: ArrayConcat - path: /docs/reference/js/firestore_.arrayconcat.md - - title: ArrayContains - path: /docs/reference/js/firestore_.arraycontains.md - - title: ArrayContainsAll - path: /docs/reference/js/firestore_.arraycontainsall.md - - title: ArrayContainsAny - path: /docs/reference/js/firestore_.arraycontainsany.md - - title: ArrayElement - path: /docs/reference/js/firestore_.arrayelement.md - - title: ArrayLength - path: /docs/reference/js/firestore_.arraylength.md - - title: ArrayReverse - path: /docs/reference/js/firestore_.arrayreverse.md - - title: Avg - path: /docs/reference/js/firestore_.avg.md - - title: ByteLength - path: /docs/reference/js/firestore_.bytelength.md - title: Bytes path: /docs/reference/js/firestore_.bytes.md - - title: CharLength - path: /docs/reference/js/firestore_.charlength.md - - title: CollectionGroupSource - path: /docs/reference/js/firestore_.collectiongroupsource.md - title: CollectionReference path: /docs/reference/js/firestore_.collectionreference.md - - title: CollectionSource - path: /docs/reference/js/firestore_.collectionsource.md - - title: Constant - path: /docs/reference/js/firestore_.constant.md - - title: CosineDistance - path: /docs/reference/js/firestore_.cosinedistance.md - - title: Count - path: /docs/reference/js/firestore_.count.md - - title: DatabaseSource - path: /docs/reference/js/firestore_.databasesource.md - - title: Distinct - path: /docs/reference/js/firestore_.distinct.md - - title: Divide - path: /docs/reference/js/firestore_.divide.md - title: DocumentChange path: /docs/reference/js/firestore_.documentchange.md - title: DocumentData @@ -265,86 +219,32 @@ toc: path: /docs/reference/js/firestore_.documentreference.md - title: DocumentSnapshot path: /docs/reference/js/firestore_.documentsnapshot.md - - title: DocumentsSource - path: /docs/reference/js/firestore_.documentssource.md - - title: DotProduct - path: /docs/reference/js/firestore_.dotproduct.md - - title: EndsWith - path: /docs/reference/js/firestore_.endswith.md - - title: Eq - path: /docs/reference/js/firestore_.eq.md - - title: EuclideanDistance - path: /docs/reference/js/firestore_.euclideandistance.md - - title: Exists - path: /docs/reference/js/firestore_.exists.md - title: ExperimentalLongPollingOptions path: /docs/reference/js/firestore_.experimentallongpollingoptions.md - - title: ExprWithAlias - path: /docs/reference/js/firestore_.exprwithalias.md - - title: Field - path: /docs/reference/js/firestore_.field.md - title: FieldPath path: /docs/reference/js/firestore_.fieldpath.md - - title: Fields - path: /docs/reference/js/firestore_.fields.md - title: FieldValue path: /docs/reference/js/firestore_.fieldvalue.md - - title: FilterCondition - path: /docs/reference/js/firestore_.filtercondition.md - - title: FindNearest - path: /docs/reference/js/firestore_.findnearest.md - - title: FindNearestOptions - path: /docs/reference/js/firestore_.findnearestoptions.md - title: Firestore path: /docs/reference/js/firestore_.firestore.md - title: FirestoreDataConverter path: /docs/reference/js/firestore_.firestoredataconverter.md - title: FirestoreError path: /docs/reference/js/firestore_.firestoreerror.md - - title: FirestoreFunction - path: /docs/reference/js/firestore_.firestorefunction.md - title: FirestoreSettings path: /docs/reference/js/firestore_.firestoresettings.md - - title: GenericStage - path: /docs/reference/js/firestore_.genericstage.md - title: GeoPoint path: /docs/reference/js/firestore_.geopoint.md - - title: Gt - path: /docs/reference/js/firestore_.gt.md - - title: Gte - path: /docs/reference/js/firestore_.gte.md - - title: If - path: /docs/reference/js/firestore_.if.md - - title: In - path: /docs/reference/js/firestore_.in.md - title: Index path: /docs/reference/js/firestore_.index.md - title: IndexConfiguration path: /docs/reference/js/firestore_.indexconfiguration.md - title: IndexField path: /docs/reference/js/firestore_.indexfield.md - - title: IsNan - path: /docs/reference/js/firestore_.isnan.md - - title: Like - path: /docs/reference/js/firestore_.like.md - - title: Limit - path: /docs/reference/js/firestore_.limit.md - title: LoadBundleTask path: /docs/reference/js/firestore_.loadbundletask.md - title: LoadBundleTaskProgress path: /docs/reference/js/firestore_.loadbundletaskprogress.md - - title: LogicalMax - path: /docs/reference/js/firestore_.logicalmax.md - - title: LogicalMin - path: /docs/reference/js/firestore_.logicalmin.md - - title: Lt - path: /docs/reference/js/firestore_.lt.md - - title: Lte - path: /docs/reference/js/firestore_.lte.md - - title: MapGet - path: /docs/reference/js/firestore_.mapget.md - - title: Max - path: /docs/reference/js/firestore_.max.md - title: MemoryCacheSettings path: /docs/reference/js/firestore_.memorycachesettings.md - title: MemoryEagerGarbageCollector @@ -353,22 +253,6 @@ toc: path: /docs/reference/js/firestore_.memorylocalcache.md - title: MemoryLruGarbageCollector path: /docs/reference/js/firestore_.memorylrugarbagecollector.md - - title: Min - path: /docs/reference/js/firestore_.min.md - - title: Mod - path: /docs/reference/js/firestore_.mod.md - - title: Multiply - path: /docs/reference/js/firestore_.multiply.md - - title: Neq - path: /docs/reference/js/firestore_.neq.md - - title: Not - path: /docs/reference/js/firestore_.not.md - - title: Offset - path: /docs/reference/js/firestore_.offset.md - - title: Or - path: /docs/reference/js/firestore_.or.md - - title: Ordering - path: /docs/reference/js/firestore_.ordering.md - title: PersistenceSettings path: /docs/reference/js/firestore_.persistencesettings.md - title: PersistentCacheIndexManager @@ -383,12 +267,6 @@ toc: path: /docs/reference/js/firestore_.persistentsingletabmanager.md - title: PersistentSingleTabManagerSettings path: /docs/reference/js/firestore_.persistentsingletabmanagersettings.md - - title: Pipeline - path: /docs/reference/js/firestore_.pipeline.md - - title: PipelineResult - path: /docs/reference/js/firestore_.pipelineresult.md - - title: PipelineSource - path: /docs/reference/js/firestore_.pipelinesource.md - title: Query path: /docs/reference/js/firestore_.query.md - title: QueryCompositeFilterConstraint @@ -409,233 +287,55 @@ toc: path: /docs/reference/js/firestore_.querysnapshot.md - title: QueryStartAtConstraint path: /docs/reference/js/firestore_.querystartatconstraint.md - - title: RegexContains - path: /docs/reference/js/firestore_.regexcontains.md - - title: RegexMatch - path: /docs/reference/js/firestore_.regexmatch.md - - title: ReplaceAll - path: /docs/reference/js/firestore_.replaceall.md - - title: ReplaceFirst - path: /docs/reference/js/firestore_.replacefirst.md - - title: Reverse - path: /docs/reference/js/firestore_.reverse.md - - title: Select - path: /docs/reference/js/firestore_.select.md - - title: Selectable - path: /docs/reference/js/firestore_.selectable.md - title: SnapshotListenOptions path: /docs/reference/js/firestore_.snapshotlistenoptions.md - title: SnapshotMetadata path: /docs/reference/js/firestore_.snapshotmetadata.md - title: SnapshotOptions path: /docs/reference/js/firestore_.snapshotoptions.md - - title: Sort - path: /docs/reference/js/firestore_.sort.md - - title: Stage - path: /docs/reference/js/firestore_.stage.md - - title: StartsWith - path: /docs/reference/js/firestore_.startswith.md - - title: StrConcat - path: /docs/reference/js/firestore_.strconcat.md - - title: StrContains - path: /docs/reference/js/firestore_.strcontains.md - - title: Subtract - path: /docs/reference/js/firestore_.subtract.md - - title: Sum - path: /docs/reference/js/firestore_.sum.md - title: Timestamp path: /docs/reference/js/firestore_.timestamp.md - - title: TimestampAdd - path: /docs/reference/js/firestore_.timestampadd.md - - title: TimestampSub - path: /docs/reference/js/firestore_.timestampsub.md - - title: TimestampToUnixMicros - path: /docs/reference/js/firestore_.timestamptounixmicros.md - - title: TimestampToUnixMillis - path: /docs/reference/js/firestore_.timestamptounixmillis.md - - title: TimestampToUnixSeconds - path: /docs/reference/js/firestore_.timestamptounixseconds.md - - title: ToLower - path: /docs/reference/js/firestore_.tolower.md - - title: ToUpper - path: /docs/reference/js/firestore_.toupper.md - title: Transaction path: /docs/reference/js/firestore_.transaction.md - title: TransactionOptions path: /docs/reference/js/firestore_.transactionoptions.md - - title: Trim - path: /docs/reference/js/firestore_.trim.md - - title: UnixMicrosToTimestamp - path: /docs/reference/js/firestore_.unixmicrostotimestamp.md - - title: UnixMillisToTimestamp - path: /docs/reference/js/firestore_.unixmillistotimestamp.md - - title: UnixSecondsToTimestamp - path: /docs/reference/js/firestore_.unixsecondstotimestamp.md - title: Unsubscribe path: /docs/reference/js/firestore_.unsubscribe.md - - title: VectorLength - path: /docs/reference/js/firestore_.vectorlength.md - title: VectorValue path: /docs/reference/js/firestore_.vectorvalue.md - - title: Where - path: /docs/reference/js/firestore_.where.md - title: WriteBatch path: /docs/reference/js/firestore_.writebatch.md - - title: Xor - path: /docs/reference/js/firestore_.xor.md - title: firestore/lite path: /docs/reference/js/firestore_lite.md section: - - title: Accumulator - path: /docs/reference/js/firestore_lite.accumulator.md - - title: Add - path: /docs/reference/js/firestore_lite.add.md - - title: AddFields - path: /docs/reference/js/firestore_lite.addfields.md - - title: Aggregate - path: /docs/reference/js/firestore_lite.aggregate.md - title: AggregateField path: /docs/reference/js/firestore_lite.aggregatefield.md - title: AggregateQuerySnapshot path: /docs/reference/js/firestore_lite.aggregatequerysnapshot.md - title: AggregateSpec path: /docs/reference/js/firestore_lite.aggregatespec.md - - title: And - path: /docs/reference/js/firestore_lite.and.md - - title: ArrayConcat - path: /docs/reference/js/firestore_lite.arrayconcat.md - - title: ArrayContains - path: /docs/reference/js/firestore_lite.arraycontains.md - - title: ArrayContainsAll - path: /docs/reference/js/firestore_lite.arraycontainsall.md - - title: ArrayContainsAny - path: /docs/reference/js/firestore_lite.arraycontainsany.md - - title: ArrayElement - path: /docs/reference/js/firestore_lite.arrayelement.md - - title: ArrayLength - path: /docs/reference/js/firestore_lite.arraylength.md - - title: ArrayReverse - path: /docs/reference/js/firestore_lite.arrayreverse.md - - title: Avg - path: /docs/reference/js/firestore_lite.avg.md - - title: ByteLength - path: /docs/reference/js/firestore_lite.bytelength.md - title: Bytes path: /docs/reference/js/firestore_lite.bytes.md - - title: CharLength - path: /docs/reference/js/firestore_lite.charlength.md - - title: CollectionGroupSource - path: /docs/reference/js/firestore_lite.collectiongroupsource.md - title: CollectionReference path: /docs/reference/js/firestore_lite.collectionreference.md - - title: CollectionSource - path: /docs/reference/js/firestore_lite.collectionsource.md - - title: Constant - path: /docs/reference/js/firestore_lite.constant.md - - title: CosineDistance - path: /docs/reference/js/firestore_lite.cosinedistance.md - - title: Count - path: /docs/reference/js/firestore_lite.count.md - - title: DatabaseSource - path: /docs/reference/js/firestore_lite.databasesource.md - - title: Distinct - path: /docs/reference/js/firestore_lite.distinct.md - - title: Divide - path: /docs/reference/js/firestore_lite.divide.md - title: DocumentData path: /docs/reference/js/firestore_lite.documentdata.md - title: DocumentReference path: /docs/reference/js/firestore_lite.documentreference.md - title: DocumentSnapshot path: /docs/reference/js/firestore_lite.documentsnapshot.md - - title: DocumentsSource - path: /docs/reference/js/firestore_lite.documentssource.md - - title: DotProduct - path: /docs/reference/js/firestore_lite.dotproduct.md - - title: EndsWith - path: /docs/reference/js/firestore_lite.endswith.md - - title: Eq - path: /docs/reference/js/firestore_lite.eq.md - - title: EuclideanDistance - path: /docs/reference/js/firestore_lite.euclideandistance.md - - title: Exists - path: /docs/reference/js/firestore_lite.exists.md - - title: ExprWithAlias - path: /docs/reference/js/firestore_lite.exprwithalias.md - - title: Field - path: /docs/reference/js/firestore_lite.field.md - title: FieldPath path: /docs/reference/js/firestore_lite.fieldpath.md - - title: Fields - path: /docs/reference/js/firestore_lite.fields.md - title: FieldValue path: /docs/reference/js/firestore_lite.fieldvalue.md - - title: FilterCondition - path: /docs/reference/js/firestore_lite.filtercondition.md - - title: FindNearest - path: /docs/reference/js/firestore_lite.findnearest.md - - title: FindNearestOptions - path: /docs/reference/js/firestore_lite.findnearestoptions.md - title: Firestore path: /docs/reference/js/firestore_lite.firestore.md - title: FirestoreDataConverter path: /docs/reference/js/firestore_lite.firestoredataconverter.md - title: FirestoreError path: /docs/reference/js/firestore_lite.firestoreerror.md - - title: FirestoreFunction - path: /docs/reference/js/firestore_lite.firestorefunction.md - - title: GenericStage - path: /docs/reference/js/firestore_lite.genericstage.md - title: GeoPoint path: /docs/reference/js/firestore_lite.geopoint.md - - title: Gt - path: /docs/reference/js/firestore_lite.gt.md - - title: Gte - path: /docs/reference/js/firestore_lite.gte.md - - title: If - path: /docs/reference/js/firestore_lite.if.md - - title: In - path: /docs/reference/js/firestore_lite.in.md - - title: IsNan - path: /docs/reference/js/firestore_lite.isnan.md - - title: Like - path: /docs/reference/js/firestore_lite.like.md - - title: Limit - path: /docs/reference/js/firestore_lite.limit.md - - title: LogicalMax - path: /docs/reference/js/firestore_lite.logicalmax.md - - title: LogicalMin - path: /docs/reference/js/firestore_lite.logicalmin.md - - title: Lt - path: /docs/reference/js/firestore_lite.lt.md - - title: Lte - path: /docs/reference/js/firestore_lite.lte.md - - title: MapGet - path: /docs/reference/js/firestore_lite.mapget.md - - title: Max - path: /docs/reference/js/firestore_lite.max.md - - title: Min - path: /docs/reference/js/firestore_lite.min.md - - title: Mod - path: /docs/reference/js/firestore_lite.mod.md - - title: Multiply - path: /docs/reference/js/firestore_lite.multiply.md - - title: Neq - path: /docs/reference/js/firestore_lite.neq.md - - title: Not - path: /docs/reference/js/firestore_lite.not.md - - title: Offset - path: /docs/reference/js/firestore_lite.offset.md - - title: Or - path: /docs/reference/js/firestore_lite.or.md - - title: Ordering - path: /docs/reference/js/firestore_lite.ordering.md - - title: Pipeline - path: /docs/reference/js/firestore_lite.pipeline.md - - title: PipelineResult - path: /docs/reference/js/firestore_lite.pipelineresult.md - - title: PipelineSource - path: /docs/reference/js/firestore_lite.pipelinesource.md - title: Query path: /docs/reference/js/firestore_lite.query.md - title: QueryCompositeFilterConstraint @@ -656,74 +356,18 @@ toc: path: /docs/reference/js/firestore_lite.querysnapshot.md - title: QueryStartAtConstraint path: /docs/reference/js/firestore_lite.querystartatconstraint.md - - title: RegexContains - path: /docs/reference/js/firestore_lite.regexcontains.md - - title: RegexMatch - path: /docs/reference/js/firestore_lite.regexmatch.md - - title: ReplaceAll - path: /docs/reference/js/firestore_lite.replaceall.md - - title: ReplaceFirst - path: /docs/reference/js/firestore_lite.replacefirst.md - - title: Reverse - path: /docs/reference/js/firestore_lite.reverse.md - - title: Select - path: /docs/reference/js/firestore_lite.select.md - - title: Selectable - path: /docs/reference/js/firestore_lite.selectable.md - title: Settings path: /docs/reference/js/firestore_lite.settings.md - - title: Sort - path: /docs/reference/js/firestore_lite.sort.md - - title: Stage - path: /docs/reference/js/firestore_lite.stage.md - - title: StartsWith - path: /docs/reference/js/firestore_lite.startswith.md - - title: StrConcat - path: /docs/reference/js/firestore_lite.strconcat.md - - title: StrContains - path: /docs/reference/js/firestore_lite.strcontains.md - - title: Subtract - path: /docs/reference/js/firestore_lite.subtract.md - - title: Sum - path: /docs/reference/js/firestore_lite.sum.md - title: Timestamp path: /docs/reference/js/firestore_lite.timestamp.md - - title: TimestampAdd - path: /docs/reference/js/firestore_lite.timestampadd.md - - title: TimestampSub - path: /docs/reference/js/firestore_lite.timestampsub.md - - title: TimestampToUnixMicros - path: /docs/reference/js/firestore_lite.timestamptounixmicros.md - - title: TimestampToUnixMillis - path: /docs/reference/js/firestore_lite.timestamptounixmillis.md - - title: TimestampToUnixSeconds - path: /docs/reference/js/firestore_lite.timestamptounixseconds.md - - title: ToLower - path: /docs/reference/js/firestore_lite.tolower.md - - title: ToUpper - path: /docs/reference/js/firestore_lite.toupper.md - title: Transaction path: /docs/reference/js/firestore_lite.transaction.md - title: TransactionOptions path: /docs/reference/js/firestore_lite.transactionoptions.md - - title: Trim - path: /docs/reference/js/firestore_lite.trim.md - - title: UnixMicrosToTimestamp - path: /docs/reference/js/firestore_lite.unixmicrostotimestamp.md - - title: UnixMillisToTimestamp - path: /docs/reference/js/firestore_lite.unixmillistotimestamp.md - - title: UnixSecondsToTimestamp - path: /docs/reference/js/firestore_lite.unixsecondstotimestamp.md - - title: VectorLength - path: /docs/reference/js/firestore_lite.vectorlength.md - title: VectorValue path: /docs/reference/js/firestore_lite.vectorvalue.md - - title: Where - path: /docs/reference/js/firestore_lite.where.md - title: WriteBatch path: /docs/reference/js/firestore_lite.writebatch.md - - title: Xor - path: /docs/reference/js/firestore_lite.xor.md - title: functions path: /docs/reference/js/functions.md section: diff --git a/docs-devsite/firestore_.accumulator.md b/docs-devsite/firestore_.accumulator.md deleted file mode 100644 index 540bb3da217..00000000000 --- a/docs-devsite/firestore_.accumulator.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Accumulator interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents an accumulator. - -Signature: - -```typescript -export declare interface Accumulator -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [accumulator](./firestore_.accumulator.md#accumulatoraccumulator) | true | (BETA) | - -## Accumulator.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.add.md b/docs-devsite/firestore_.add.md deleted file mode 100644 index 5fa68c68d84..00000000000 --- a/docs-devsite/firestore_.add.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Add class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Add extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.add.md#addconstructor) | | (BETA) Constructs a new instance of the Add class | - -## Add.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Add` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.addfields.md b/docs-devsite/firestore_.addfields.md deleted file mode 100644 index 23cf88da2d0..00000000000 --- a/docs-devsite/firestore_.addfields.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# AddFields class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class AddFields implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(fields)](./firestore_.addfields.md#addfieldsconstructor) | | (BETA) Constructs a new instance of the AddFields class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.addfields.md#addfieldsname) | | string | (BETA) | - -## AddFields.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `AddFields` class - -Signature: - -```typescript -constructor(fields: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fields | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | - -## AddFields.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.aggregate.md b/docs-devsite/firestore_.aggregate.md deleted file mode 100644 index 0868c5edc95..00000000000 --- a/docs-devsite/firestore_.aggregate.md +++ /dev/null @@ -1,65 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Aggregate class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Aggregate implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(accumulators, groups)](./firestore_.aggregate.md#aggregateconstructor) | | (BETA) Constructs a new instance of the Aggregate class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.aggregate.md#aggregatename) | | string | (BETA) | - -## Aggregate.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Aggregate` class - -Signature: - -```typescript -constructor(accumulators: Map, groups: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| accumulators | Map<string, [Accumulator](./firestore_.accumulator.md#accumulator_interface)> | | -| groups | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | - -## Aggregate.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.and.md b/docs-devsite/firestore_.and.md deleted file mode 100644 index 59b0a32b25d..00000000000 --- a/docs-devsite/firestore_.and.md +++ /dev/null @@ -1,17 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# and namespace -Signature: - -```typescript -export declare namespace and -``` diff --git a/docs-devsite/firestore_.arrayconcat.md b/docs-devsite/firestore_.arrayconcat.md deleted file mode 100644 index d7f104b6954..00000000000 --- a/docs-devsite/firestore_.arrayconcat.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayConcat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayConcat extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, elements)](./firestore_.arrayconcat.md#arrayconcatconstructor) | | (BETA) Constructs a new instance of the ArrayConcat class | - -## ArrayConcat.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayConcat` class - -Signature: - -```typescript -constructor(array: Constant, elements: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | -| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | | - diff --git a/docs-devsite/firestore_.arraycontains.md b/docs-devsite/firestore_.arraycontains.md deleted file mode 100644 index c56ae8b281d..00000000000 --- a/docs-devsite/firestore_.arraycontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, element)](./firestore_.arraycontains.md#arraycontainsconstructor) | | (BETA) Constructs a new instance of the ArrayContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.arraycontains.md#arraycontainsfilterable) | | true | (BETA) | - -## ArrayContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContains` class - -Signature: - -```typescript -constructor(array: Constant, element: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | -| element | [Constant](./firestore_.constant.md#constant_class) | | - -## ArrayContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.arraycontainsall.md b/docs-devsite/firestore_.arraycontainsall.md deleted file mode 100644 index 0509d2ee79d..00000000000 --- a/docs-devsite/firestore_.arraycontainsall.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContainsAll class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContainsAll extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, values)](./firestore_.arraycontainsall.md#arraycontainsallconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAll class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.arraycontainsall.md#arraycontainsallfilterable) | | true | (BETA) | - -## ArrayContainsAll.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContainsAll` class - -Signature: - -```typescript -constructor(array: Constant, values: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | | - -## ArrayContainsAll.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.arraycontainsany.md b/docs-devsite/firestore_.arraycontainsany.md deleted file mode 100644 index 0736b7b198b..00000000000 --- a/docs-devsite/firestore_.arraycontainsany.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContainsAny class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContainsAny extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, values)](./firestore_.arraycontainsany.md#arraycontainsanyconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAny class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.arraycontainsany.md#arraycontainsanyfilterable) | | true | (BETA) | - -## ArrayContainsAny.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContainsAny` class - -Signature: - -```typescript -constructor(array: Constant, values: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | | - -## ArrayContainsAny.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.arrayelement.md b/docs-devsite/firestore_.arrayelement.md deleted file mode 100644 index e8dcd7e04b7..00000000000 --- a/docs-devsite/firestore_.arrayelement.md +++ /dev/null @@ -1,41 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayElement class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayElement extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)()](./firestore_.arrayelement.md#arrayelementconstructor) | | (BETA) Constructs a new instance of the ArrayElement class | - -## ArrayElement.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayElement` class - -Signature: - -```typescript -constructor(); -``` diff --git a/docs-devsite/firestore_.arraylength.md b/docs-devsite/firestore_.arraylength.md deleted file mode 100644 index 88b3b3fa624..00000000000 --- a/docs-devsite/firestore_.arraylength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array)](./firestore_.arraylength.md#arraylengthconstructor) | | (BETA) Constructs a new instance of the ArrayLength class | - -## ArrayLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayLength` class - -Signature: - -```typescript -constructor(array: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.arrayreverse.md b/docs-devsite/firestore_.arrayreverse.md deleted file mode 100644 index bc7e06c72a7..00000000000 --- a/docs-devsite/firestore_.arrayreverse.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayReverse class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayReverse extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array)](./firestore_.arrayreverse.md#arrayreverseconstructor) | | (BETA) Constructs a new instance of the ArrayReverse class | - -## ArrayReverse.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayReverse` class - -Signature: - -```typescript -constructor(array: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.avg.md b/docs-devsite/firestore_.avg.md deleted file mode 100644 index e93ade31d62..00000000000 --- a/docs-devsite/firestore_.avg.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Avg class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Avg extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_.avg.md#avgconstructor) | | (BETA) Constructs a new instance of the Avg class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_.avg.md#avgaccumulator) | | true | (BETA) | - -## Avg.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Avg` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| distinct | boolean | | - -## Avg.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.bytelength.md b/docs-devsite/firestore_.bytelength.md deleted file mode 100644 index 7b7055b2951..00000000000 --- a/docs-devsite/firestore_.bytelength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ByteLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ByteLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_.bytelength.md#bytelengthconstructor) | | (BETA) Constructs a new instance of the ByteLength class | - -## ByteLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ByteLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.charlength.md b/docs-devsite/firestore_.charlength.md deleted file mode 100644 index cb978a4675f..00000000000 --- a/docs-devsite/firestore_.charlength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CharLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CharLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_.charlength.md#charlengthconstructor) | | (BETA) Constructs a new instance of the CharLength class | - -## CharLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CharLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.collectiongroupsource.md b/docs-devsite/firestore_.collectiongroupsource.md deleted file mode 100644 index 58d0d7e9b25..00000000000 --- a/docs-devsite/firestore_.collectiongroupsource.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CollectionGroupSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CollectionGroupSource implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(collectionId)](./firestore_.collectiongroupsource.md#collectiongroupsourceconstructor) | | (BETA) Constructs a new instance of the CollectionGroupSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.collectiongroupsource.md#collectiongroupsourcename) | | string | (BETA) | - -## CollectionGroupSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CollectionGroupSource` class - -Signature: - -```typescript -constructor(collectionId: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionId | string | | - -## CollectionGroupSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.collectionsource.md b/docs-devsite/firestore_.collectionsource.md deleted file mode 100644 index d5b485ea610..00000000000 --- a/docs-devsite/firestore_.collectionsource.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CollectionSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CollectionSource implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(collectionPath)](./firestore_.collectionsource.md#collectionsourceconstructor) | | (BETA) Constructs a new instance of the CollectionSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.collectionsource.md#collectionsourcename) | | string | (BETA) | - -## CollectionSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CollectionSource` class - -Signature: - -```typescript -constructor(collectionPath: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -## CollectionSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.constant.md b/docs-devsite/firestore_.constant.md deleted file mode 100644 index 42463dbc01d..00000000000 --- a/docs-devsite/firestore_.constant.md +++ /dev/null @@ -1,3504 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Constant class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents a constant value that can be used in a Firestore pipeline expression. - -You can create a `Constant` instance using the static method: - -```typescript -// Create a Constant instance for the number 10 -const ten = Constant.of(10); - -// Create a Constant instance for the string "hello" -const hello = Constant.of("hello"); - -``` - -Signature: - -```typescript -export declare class Constant -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_.constant.md#constantexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_.constant.md#constantarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_.constant.md#constantas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_.constant.md#constantascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_.constant.md#constantavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_.constant.md#constantbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_.constant.md#constantcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_.constant.md#constantcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_.constant.md#constantdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_.constant.md#constantdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_.constant.md#constanteuclideandistance) | | (BETA) | -| [exists()](./firestore_.constant.md#constantexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_.constant.md#constantin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_.constant.md#constantin) | | (BETA) | -| [isNaN()](./firestore_.constant.md#constantisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_.constant.md#constantlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_.constant.md#constantlike) | | (BETA) | -| [logicalMax(other)](./firestore_.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_.constant.md#constantmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_.constant.md#constantmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_.constant.md#constantmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a number value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a DocumentReference value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for an array value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a map value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a VectorValue value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a string value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a boolean value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a null value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for an undefined value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a GeoPoint value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Timestamp value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Date value. | -| [of(value)](./firestore_.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Uint8Array value. | -| [regexContains(pattern)](./firestore_.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_.constant.md#constantreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_.constant.md#constantstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_.constant.md#constantsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_.constant.md#constanttimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_.constant.md#constanttimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_.constant.md#constanttimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_.constant.md#constanttolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_.constant.md#constanttoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_.constant.md#constanttrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_.constant.md#constantunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_.constant.md#constantunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_.constant.md#constantunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vector(value)](./firestore_.constant.md#constantvector) | static | (BETA) Creates a Constant instance for a VectorValue value. -```typescript -// Create a Constant instance for a vector value -const vectorConstant = Constant.ofVector([1, 2, 3]); - -``` - | -| [vectorLength()](./firestore_.constant.md#constantvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Constant.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Constant.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Constant.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Constant.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Constant.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Constant.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Constant.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Constant.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Constant.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Constant.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Constant.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Constant.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## Constant.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> - -## Constant.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Constant.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_.avg.md#avg_class) - -## Constant.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -## Constant.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Constant.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -## Constant.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Constant.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Constant.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Constant.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Constant.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Constant.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Constant.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Constant.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -## Constant.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Constant.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Constant.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Constant.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Constant.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Constant.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Constant.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_.isnan.md#isnan_class) - -## Constant.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Constant.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Constant.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Constant.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Constant.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Constant.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Constant.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Constant.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Constant.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Constant.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Constant.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_.mapget.md#mapget_class) - -## Constant.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_.max.md#max_class) - -## Constant.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_.min.md#min_class) - -## Constant.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Constant.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Constant.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Constant.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Constant.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Constant.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a number value. - -Signature: - -```typescript -static of(value: number): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | number | The number value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a DocumentReference value. - -Signature: - -```typescript -static of(value: DocumentReference): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [DocumentReference](./firestore_.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for an array value. - -Signature: - -```typescript -static of(value: any[]): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | any\[\] | The array value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a map value. - -Signature: - -```typescript -static of(value: Map): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Map<string, any> | The map value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a VectorValue value. - -Signature: - -```typescript -static of(value: VectorValue): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a string value. - -Signature: - -```typescript -static of(value: string): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | string | The string value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a boolean value. - -Signature: - -```typescript -static of(value: boolean): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | boolean | The boolean value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a null value. - -Signature: - -```typescript -static of(value: null): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | null | The null value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for an undefined value. - -Signature: - -```typescript -static of(value: undefined): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | undefined | The undefined value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a GeoPoint value. - -Signature: - -```typescript -static of(value: GeoPoint): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [GeoPoint](./firestore_.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Timestamp value. - -Signature: - -```typescript -static of(value: Timestamp): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Timestamp](./firestore_.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Date value. - -Signature: - -```typescript -static of(value: Date): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Date | The Date value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Uint8Array value. - -Signature: - -```typescript -static of(value: Uint8Array): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Uint8Array | The Uint8Array value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Constant.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Constant.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Constant.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Constant.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Constant.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Constant.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Constant.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Constant.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -## Constant.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Constant.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Constant.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## Constant.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Constant.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Constant.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Constant.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Constant.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_.sum.md#sum_class) - -## Constant.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Constant.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Constant.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Constant.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Constant.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -## Constant.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -## Constant.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -## Constant.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -## Constant.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -## Constant.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -## Constant.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Constant.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Constant.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Constant.vector() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a VectorValue value. - -```typescript -// Create a Constant instance for a vector value -const vectorConstant = Constant.ofVector([1, 2, 3]); - -``` - -Signature: - -```typescript -static vector(value: number[] | VectorValue): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | - -Returns: - -[Constant](./firestore_.constant.md#constant_class) - -## Constant.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_.cosinedistance.md b/docs-devsite/firestore_.cosinedistance.md deleted file mode 100644 index 794d99c6d34..00000000000 --- a/docs-devsite/firestore_.cosinedistance.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CosineDistance class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CosineDistance extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_.cosinedistance.md#cosinedistanceconstructor) | | (BETA) Constructs a new instance of the CosineDistance class | - -## CosineDistance.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CosineDistance` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.count.md b/docs-devsite/firestore_.count.md deleted file mode 100644 index be4c3a37c57..00000000000 --- a/docs-devsite/firestore_.count.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Count class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Count extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_.count.md#countconstructor) | | (BETA) Constructs a new instance of the Count class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_.count.md#countaccumulator) | | true | (BETA) | - -## Count.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Count` class - -Signature: - -```typescript -constructor(value: Constant | undefined, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) \| undefined | | -| distinct | boolean | | - -## Count.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.databasesource.md b/docs-devsite/firestore_.databasesource.md deleted file mode 100644 index 0989b69042c..00000000000 --- a/docs-devsite/firestore_.databasesource.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DatabaseSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DatabaseSource implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.databasesource.md#databasesourcename) | | string | (BETA) | - -## DatabaseSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.distinct.md b/docs-devsite/firestore_.distinct.md deleted file mode 100644 index a893d3f7e47..00000000000 --- a/docs-devsite/firestore_.distinct.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Distinct class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Distinct implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(groups)](./firestore_.distinct.md#distinctconstructor) | | (BETA) Constructs a new instance of the Distinct class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.distinct.md#distinctname) | | string | (BETA) | - -## Distinct.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Distinct` class - -Signature: - -```typescript -constructor(groups: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| groups | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | - -## Distinct.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.divide.md b/docs-devsite/firestore_.divide.md deleted file mode 100644 index ac77d7916d8..00000000000 --- a/docs-devsite/firestore_.divide.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Divide class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Divide extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.divide.md#divideconstructor) | | (BETA) Constructs a new instance of the Divide class | - -## Divide.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Divide` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.documentssource.md b/docs-devsite/firestore_.documentssource.md deleted file mode 100644 index 18ea01c0517..00000000000 --- a/docs-devsite/firestore_.documentssource.md +++ /dev/null @@ -1,92 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DocumentsSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DocumentsSource implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(docPaths)](./firestore_.documentssource.md#documentssourceconstructor) | | (BETA) Constructs a new instance of the DocumentsSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.documentssource.md#documentssourcename) | | string | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [of(refs)](./firestore_.documentssource.md#documentssourceof) | static | (BETA) | - -## DocumentsSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `DocumentsSource` class - -Signature: - -```typescript -constructor(docPaths: string[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| docPaths | string\[\] | | - -## DocumentsSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` - -## DocumentsSource.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(refs: DocumentReference[]): DocumentsSource; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| refs | [DocumentReference](./firestore_.documentreference.md#documentreference_class)\[\] | | - -Returns: - -[DocumentsSource](./firestore_.documentssource.md#documentssource_class) - diff --git a/docs-devsite/firestore_.dotproduct.md b/docs-devsite/firestore_.dotproduct.md deleted file mode 100644 index 2e1a21700ad..00000000000 --- a/docs-devsite/firestore_.dotproduct.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DotProduct class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DotProduct extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_.dotproduct.md#dotproductconstructor) | | (BETA) Constructs a new instance of the DotProduct class | - -## DotProduct.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `DotProduct` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.endswith.md b/docs-devsite/firestore_.endswith.md deleted file mode 100644 index 85f67657c50..00000000000 --- a/docs-devsite/firestore_.endswith.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# EndsWith class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class EndsWith extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, suffix)](./firestore_.endswith.md#endswithconstructor) | | (BETA) Constructs a new instance of the EndsWith class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.endswith.md#endswithfilterable) | | true | (BETA) | - -## EndsWith.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `EndsWith` class - -Signature: - -```typescript -constructor(expr: Constant, suffix: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| suffix | [Constant](./firestore_.constant.md#constant_class) | | - -## EndsWith.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.eq.md b/docs-devsite/firestore_.eq.md deleted file mode 100644 index 15cc19e3c2b..00000000000 --- a/docs-devsite/firestore_.eq.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Eq class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Eq extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.eq.md#eqconstructor) | | (BETA) Constructs a new instance of the Eq class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.eq.md#eqfilterable) | | true | (BETA) | - -## Eq.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Eq` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Eq.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.euclideandistance.md b/docs-devsite/firestore_.euclideandistance.md deleted file mode 100644 index 240f048f42e..00000000000 --- a/docs-devsite/firestore_.euclideandistance.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# EuclideanDistance class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class EuclideanDistance extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_.euclideandistance.md#euclideandistanceconstructor) | | (BETA) Constructs a new instance of the EuclideanDistance class | - -## EuclideanDistance.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `EuclideanDistance` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.exists.md b/docs-devsite/firestore_.exists.md deleted file mode 100644 index 459196066d4..00000000000 --- a/docs-devsite/firestore_.exists.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Exists class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Exists extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.exists.md#existsconstructor) | | (BETA) Constructs a new instance of the Exists class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.exists.md#existsfilterable) | | true | (BETA) | - -## Exists.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Exists` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - -## Exists.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.exprwithalias.md b/docs-devsite/firestore_.exprwithalias.md deleted file mode 100644 index 7d92f0e46fa..00000000000 --- a/docs-devsite/firestore_.exprwithalias.md +++ /dev/null @@ -1,3207 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ExprWithAlias class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ExprWithAlias implements Selectable -``` -Implements: [Selectable](./firestore_.selectable.md#selectable_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, alias)](./firestore_.exprwithalias.md#exprwithaliasconstructor) | | (BETA) Constructs a new instance of the ExprWithAlias class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias](./firestore_.exprwithalias.md#exprwithaliasalias) | | string | (BETA) | -| [expr](./firestore_.exprwithalias.md#exprwithaliasexpr) | | T | (BETA) | -| [exprType](./firestore_.exprwithalias.md#exprwithaliasexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | -| [selectable](./firestore_.exprwithalias.md#exprwithaliasselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_.exprwithalias.md#exprwithaliasarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_.exprwithalias.md#exprwithaliasas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_.exprwithalias.md#exprwithaliasascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_.exprwithalias.md#exprwithaliasavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_.exprwithalias.md#exprwithaliasbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_.exprwithalias.md#exprwithaliascharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_.exprwithalias.md#exprwithaliascount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_.exprwithalias.md#exprwithaliasdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) | -| [exists()](./firestore_.exprwithalias.md#exprwithaliasexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_.exprwithalias.md#exprwithaliasin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_.exprwithalias.md#exprwithaliasin) | | (BETA) | -| [isNaN()](./firestore_.exprwithalias.md#exprwithaliasisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_.exprwithalias.md#exprwithaliaslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_.exprwithalias.md#exprwithaliaslike) | | (BETA) | -| [logicalMax(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_.exprwithalias.md#exprwithaliasmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_.exprwithalias.md#exprwithaliasmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_.exprwithalias.md#exprwithaliasmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [regexContains(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_.exprwithalias.md#exprwithaliasreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_.exprwithalias.md#exprwithaliasstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_.exprwithalias.md#exprwithaliassum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_.exprwithalias.md#exprwithaliastimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_.exprwithalias.md#exprwithaliastolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_.exprwithalias.md#exprwithaliastoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_.exprwithalias.md#exprwithaliastrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_.exprwithalias.md#exprwithaliasunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_.exprwithalias.md#exprwithaliasvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## ExprWithAlias.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ExprWithAlias` class - -Signature: - -```typescript -constructor(expr: T, alias: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | T | | -| alias | string | | - -## ExprWithAlias.alias - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -alias: string; -``` - -## ExprWithAlias.expr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -expr: T; -``` - -## ExprWithAlias.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## ExprWithAlias.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## ExprWithAlias.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## ExprWithAlias.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## ExprWithAlias.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## ExprWithAlias.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## ExprWithAlias.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## ExprWithAlias.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## ExprWithAlias.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## ExprWithAlias.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## ExprWithAlias.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## ExprWithAlias.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## ExprWithAlias.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## ExprWithAlias.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> - -## ExprWithAlias.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## ExprWithAlias.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_.avg.md#avg_class) - -## ExprWithAlias.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -## ExprWithAlias.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -## ExprWithAlias.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## ExprWithAlias.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## ExprWithAlias.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## ExprWithAlias.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## ExprWithAlias.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## ExprWithAlias.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## ExprWithAlias.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -## ExprWithAlias.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## ExprWithAlias.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## ExprWithAlias.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## ExprWithAlias.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## ExprWithAlias.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -## ExprWithAlias.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_.in.md#in_class) - -## ExprWithAlias.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_.isnan.md#isnan_class) - -## ExprWithAlias.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## ExprWithAlias.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## ExprWithAlias.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## ExprWithAlias.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## ExprWithAlias.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## ExprWithAlias.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## ExprWithAlias.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## ExprWithAlias.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## ExprWithAlias.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## ExprWithAlias.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## ExprWithAlias.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_.mapget.md#mapget_class) - -## ExprWithAlias.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_.max.md#max_class) - -## ExprWithAlias.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_.min.md#min_class) - -## ExprWithAlias.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## ExprWithAlias.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## ExprWithAlias.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## ExprWithAlias.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## ExprWithAlias.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## ExprWithAlias.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## ExprWithAlias.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## ExprWithAlias.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## ExprWithAlias.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## ExprWithAlias.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## ExprWithAlias.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## ExprWithAlias.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## ExprWithAlias.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## ExprWithAlias.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## ExprWithAlias.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -## ExprWithAlias.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## ExprWithAlias.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## ExprWithAlias.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## ExprWithAlias.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## ExprWithAlias.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## ExprWithAlias.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## ExprWithAlias.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## ExprWithAlias.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_.sum.md#sum_class) - -## ExprWithAlias.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## ExprWithAlias.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## ExprWithAlias.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## ExprWithAlias.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## ExprWithAlias.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -## ExprWithAlias.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -## ExprWithAlias.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -## ExprWithAlias.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -## ExprWithAlias.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -## ExprWithAlias.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -## ExprWithAlias.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## ExprWithAlias.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## ExprWithAlias.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## ExprWithAlias.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_.field.md b/docs-devsite/firestore_.field.md deleted file mode 100644 index d2406157dab..00000000000 --- a/docs-devsite/firestore_.field.md +++ /dev/null @@ -1,3275 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Field class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage. - -

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. - -

You can create a `Field` instance using the static method: - -```typescript -// Create a Field instance for the 'name' field -const nameField = Field.of("name"); - -// Create a Field instance for a nested field 'address.city' -const cityField = Field.of("address.city"); - -``` - -Signature: - -```typescript -export declare class Field implements Selectable -``` -Implements: [Selectable](./firestore_.selectable.md#selectable_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_.field.md#fieldexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | -| [selectable](./firestore_.field.md#fieldselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_.field.md#fieldarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_.field.md#fieldas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_.field.md#fieldascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_.field.md#fieldavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_.field.md#fieldbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_.field.md#fieldcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_.field.md#fieldcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_.field.md#fielddescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_.field.md#fielddotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_.field.md#fieldeuclideandistance) | | (BETA) | -| [exists()](./firestore_.field.md#fieldexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [fieldName()](./firestore_.field.md#fieldfieldname) | | (BETA) | -| [gt(other)](./firestore_.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_.field.md#fieldin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_.field.md#fieldin) | | (BETA) | -| [isNaN()](./firestore_.field.md#fieldisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_.field.md#fieldlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_.field.md#fieldlike) | | (BETA) | -| [logicalMax(other)](./firestore_.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_.field.md#fieldmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_.field.md#fieldmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_.field.md#fieldmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(name)](./firestore_.field.md#fieldof) | static | (BETA) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). -```typescript -// Create a Field instance for the 'title' field -const titleField = Field.of("title"); - -// Create a Field instance for a nested field 'author.firstName' -const authorFirstNameField = Field.of("author.firstName"); - -``` - | -| [of(path)](./firestore_.field.md#fieldof) | static | (BETA) | -| [of(pipeline, name)](./firestore_.field.md#fieldof) | static | (BETA) | -| [regexContains(pattern)](./firestore_.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_.field.md#fieldreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_.field.md#fieldstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_.field.md#fieldsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_.field.md#fieldtimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_.field.md#fieldtimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_.field.md#fieldtimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_.field.md#fieldtolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_.field.md#fieldtoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_.field.md#fieldtrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_.field.md#fieldunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_.field.md#fieldunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_.field.md#fieldunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_.field.md#fieldvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Field.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Field.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## Field.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Field.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Field.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Field.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Field.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Field.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Field.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Field.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Field.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Field.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Field.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## Field.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> - -## Field.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Field.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_.avg.md#avg_class) - -## Field.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -## Field.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Field.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -## Field.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Field.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Field.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Field.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Field.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Field.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Field.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Field.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -## Field.fieldName() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -fieldName(): string; -``` -Returns: - -string - -## Field.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Field.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Field.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Field.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Field.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Field.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Field.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_.isnan.md#isnan_class) - -## Field.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Field.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Field.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Field.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Field.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Field.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Field.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Field.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Field.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Field.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Field.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_.mapget.md#mapget_class) - -## Field.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_.max.md#max_class) - -## Field.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_.min.md#min_class) - -## Field.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Field.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Field.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Field.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Field.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Field.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a instance representing the field at the given path. - -The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). - -```typescript -// Create a Field instance for the 'title' field -const titleField = Field.of("title"); - -// Create a Field instance for a nested field 'author.firstName' -const authorFirstNameField = Field.of("author.firstName"); - -``` - -Signature: - -```typescript -static of(name: string): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The path to the field. A new instance representing the specified field. | - -Returns: - -[Field](./firestore_.field.md#field_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(path: FieldPath): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| path | [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | | - -Returns: - -[Field](./firestore_.field.md#field_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(pipeline: Pipeline, name: string): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pipeline | [Pipeline](./firestore_.pipeline.md#pipeline_class) | | -| name | string | | - -Returns: - -[Field](./firestore_.field.md#field_class) - -## Field.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Field.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Field.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Field.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Field.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Field.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Field.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Field.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Field.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -## Field.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Field.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Field.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## Field.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Field.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Field.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Field.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Field.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_.sum.md#sum_class) - -## Field.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Field.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Field.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Field.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Field.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -## Field.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -## Field.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -## Field.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -## Field.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -## Field.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -## Field.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Field.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Field.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Field.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_.fields.md b/docs-devsite/firestore_.fields.md deleted file mode 100644 index 8baec029555..00000000000 --- a/docs-devsite/firestore_.fields.md +++ /dev/null @@ -1,3210 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Fields class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Fields implements Selectable -``` -Implements: [Selectable](./firestore_.selectable.md#selectable_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_.fields.md#fieldsexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | -| [selectable](./firestore_.fields.md#fieldsselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_.fields.md#fieldsarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_.fields.md#fieldsas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_.fields.md#fieldsascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_.fields.md#fieldsavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_.fields.md#fieldsbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_.fields.md#fieldscharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_.fields.md#fieldscount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_.fields.md#fieldsdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_.fields.md#fieldsdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_.fields.md#fieldseuclideandistance) | | (BETA) | -| [exists()](./firestore_.fields.md#fieldsexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [fieldList()](./firestore_.fields.md#fieldsfieldlist) | | (BETA) | -| [gt(other)](./firestore_.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_.fields.md#fieldsin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_.fields.md#fieldsin) | | (BETA) | -| [isNaN()](./firestore_.fields.md#fieldsisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_.fields.md#fieldslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_.fields.md#fieldslike) | | (BETA) | -| [logicalMax(other)](./firestore_.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_.fields.md#fieldsmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_.fields.md#fieldsmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_.fields.md#fieldsmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(name, others)](./firestore_.fields.md#fieldsof) | static | (BETA) | -| [ofAll()](./firestore_.fields.md#fieldsofall) | static | (BETA) | -| [regexContains(pattern)](./firestore_.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_.fields.md#fieldsreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_.fields.md#fieldsstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_.fields.md#fieldssum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_.fields.md#fieldstimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_.fields.md#fieldstimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_.fields.md#fieldstimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_.fields.md#fieldstolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_.fields.md#fieldstoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_.fields.md#fieldstrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_.fields.md#fieldsunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_.fields.md#fieldsunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_.fields.md#fieldsunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_.fields.md#fieldsvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Fields.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Fields.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## Fields.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Fields.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## Fields.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Fields.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## Fields.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Fields.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## Fields.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Fields.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## Fields.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Fields.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## Fields.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## Fields.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> - -## Fields.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Fields.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_.avg.md#avg_class) - -## Fields.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -## Fields.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## Fields.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -## Fields.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## Fields.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Fields.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## Fields.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Fields.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## Fields.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Fields.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## Fields.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -## Fields.fieldList() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -fieldList(): Field[]; -``` -Returns: - -[Field](./firestore_.field.md#field_class)\[\] - -## Fields.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Fields.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## Fields.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Fields.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## Fields.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Fields.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_.in.md#in_class) - -## Fields.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_.isnan.md#isnan_class) - -## Fields.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Fields.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## Fields.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Fields.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## Fields.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Fields.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## Fields.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Fields.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## Fields.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Fields.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## Fields.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_.mapget.md#mapget_class) - -## Fields.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_.max.md#max_class) - -## Fields.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_.min.md#min_class) - -## Fields.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Fields.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## Fields.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Fields.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## Fields.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Fields.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## Fields.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(name: string, ...others: string[]): Fields; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| others | string\[\] | | - -Returns: - -[Fields](./firestore_.fields.md#fields_class) - -## Fields.ofAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static ofAll(): Fields; -``` -Returns: - -[Fields](./firestore_.fields.md#fields_class) - -## Fields.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Fields.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## Fields.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Fields.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## Fields.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Fields.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## Fields.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Fields.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## Fields.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -## Fields.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Fields.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## Fields.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## Fields.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Fields.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## Fields.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Fields.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## Fields.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_.sum.md#sum_class) - -## Fields.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Fields.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## Fields.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Fields.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## Fields.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -## Fields.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -## Fields.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -## Fields.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -## Fields.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -## Fields.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -## Fields.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Fields.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Fields.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Fields.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_.filtercondition.md b/docs-devsite/firestore_.filtercondition.md deleted file mode 100644 index 2665d872f9d..00000000000 --- a/docs-devsite/firestore_.filtercondition.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FilterCondition interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents a filter condition. - -Signature: - -```typescript -export declare interface FilterCondition -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [filterable](./firestore_.filtercondition.md#filterconditionfilterable) | true | (BETA) | - -## FilterCondition.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.findnearest.md b/docs-devsite/firestore_.findnearest.md deleted file mode 100644 index 3b3f5c29744..00000000000 --- a/docs-devsite/firestore_.findnearest.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FindNearest class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class FindNearest implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.findnearest.md#findnearestname) | | string | (BETA) | - -## FindNearest.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.findnearestoptions.md b/docs-devsite/firestore_.findnearestoptions.md deleted file mode 100644 index 5a4835b418d..00000000000 --- a/docs-devsite/firestore_.findnearestoptions.md +++ /dev/null @@ -1,86 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FindNearestOptions interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare interface FindNearestOptions -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [distanceField](./firestore_.findnearestoptions.md#findnearestoptionsdistancefield) | string | (BETA) | -| [distanceMeasure](./firestore_.findnearestoptions.md#findnearestoptionsdistancemeasure) | 'euclidean' \| 'cosine' \| 'dot\_product' | (BETA) | -| [field](./firestore_.findnearestoptions.md#findnearestoptionsfield) | [Field](./firestore_.field.md#field_class) | (BETA) | -| [limit](./firestore_.findnearestoptions.md#findnearestoptionslimit) | number | (BETA) | -| [vectorValue](./firestore_.findnearestoptions.md#findnearestoptionsvectorvalue) | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | (BETA) | - -## FindNearestOptions.distanceField - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -distanceField?: string; -``` - -## FindNearestOptions.distanceMeasure - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; -``` - -## FindNearestOptions.field - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -field: Field; -``` - -## FindNearestOptions.limit - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -limit?: number; -``` - -## FindNearestOptions.vectorValue - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -vectorValue: VectorValue | number[]; -``` diff --git a/docs-devsite/firestore_.firestore.md b/docs-devsite/firestore_.firestore.md index a8b7561a3ba..01267d5b2d3 100644 --- a/docs-devsite/firestore_.firestore.md +++ b/docs-devsite/firestore_.firestore.md @@ -31,7 +31,6 @@ export declare class Firestore | Method | Modifiers | Description | | --- | --- | --- | -| [pipeline()](./firestore_.firestore.md#firestorepipeline) | | Pipeline query. | | [toJSON()](./firestore_.firestore.md#firestoretojson) | | Returns a JSON-serializable representation of this Firestore instance. | ## Firestore.app @@ -54,19 +53,6 @@ Whether it's a [Firestore](./firestore_.firestore.md#firestore_class) or Firesto type: 'firestore-lite' | 'firestore'; ``` -## Firestore.pipeline() - -Pipeline query. - -Signature: - -```typescript -pipeline(): PipelineSource; -``` -Returns: - -[PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) - ## Firestore.toJSON() Returns a JSON-serializable representation of this `Firestore` instance. diff --git a/docs-devsite/firestore_.firestorefunction.md b/docs-devsite/firestore_.firestorefunction.md deleted file mode 100644 index 43022c17c72..00000000000 --- a/docs-devsite/firestore_.firestorefunction.md +++ /dev/null @@ -1,3173 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FirestoreFunction class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution. - -Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. - -Signature: - -```typescript -export declare class FirestoreFunction -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(name, params)](./firestore_.firestorefunction.md#firestorefunctionconstructor) | | (BETA) Constructs a new instance of the FirestoreFunction class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_.firestorefunction.md#firestorefunctionexprtype) | | [ExprType](./firestore_.md#exprtype) | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_.firestorefunction.md#firestorefunctionarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_.firestorefunction.md#firestorefunctionas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_.firestorefunction.md#firestorefunctionascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_.firestorefunction.md#firestorefunctionavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_.firestorefunction.md#firestorefunctionbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_.firestorefunction.md#firestorefunctioncharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_.firestorefunction.md#firestorefunctioncount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_.firestorefunction.md#firestorefunctiondescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) | -| [exists()](./firestore_.firestorefunction.md#firestorefunctionexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_.firestorefunction.md#firestorefunctionin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_.firestorefunction.md#firestorefunctionin) | | (BETA) | -| [isNaN()](./firestore_.firestorefunction.md#firestorefunctionisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_.firestorefunction.md#firestorefunctionlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_.firestorefunction.md#firestorefunctionlike) | | (BETA) | -| [logicalMax(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_.firestorefunction.md#firestorefunctionmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_.firestorefunction.md#firestorefunctionmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_.firestorefunction.md#firestorefunctionmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [regexContains(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_.firestorefunction.md#firestorefunctionreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_.firestorefunction.md#firestorefunctionstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_.firestorefunction.md#firestorefunctionsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_.firestorefunction.md#firestorefunctiontimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_.firestorefunction.md#firestorefunctiontolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_.firestorefunction.md#firestorefunctiontoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_.firestorefunction.md#firestorefunctiontrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_.firestorefunction.md#firestorefunctionunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_.firestorefunction.md#firestorefunctionvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## FirestoreFunction.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `FirestoreFunction` class - -Signature: - -```typescript -constructor(name: string, params: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| params | [Constant](./firestore_.constant.md#constant_class)\[\] | | - -## FirestoreFunction.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## FirestoreFunction.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## FirestoreFunction.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -## FirestoreFunction.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## FirestoreFunction.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -## FirestoreFunction.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## FirestoreFunction.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -## FirestoreFunction.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## FirestoreFunction.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -## FirestoreFunction.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## FirestoreFunction.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -## FirestoreFunction.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## FirestoreFunction.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class)<this> - -## FirestoreFunction.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## FirestoreFunction.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_.avg.md#avg_class) - -## FirestoreFunction.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -## FirestoreFunction.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -## FirestoreFunction.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -## FirestoreFunction.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## FirestoreFunction.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -## FirestoreFunction.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## FirestoreFunction.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -## FirestoreFunction.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## FirestoreFunction.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -## FirestoreFunction.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## FirestoreFunction.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -## FirestoreFunction.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## FirestoreFunction.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -## FirestoreFunction.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -## FirestoreFunction.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_.in.md#in_class) - -## FirestoreFunction.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_.isnan.md#isnan_class) - -## FirestoreFunction.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## FirestoreFunction.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_.like.md#like_class) - -## FirestoreFunction.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## FirestoreFunction.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -## FirestoreFunction.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## FirestoreFunction.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -## FirestoreFunction.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## FirestoreFunction.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -## FirestoreFunction.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## FirestoreFunction.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -## FirestoreFunction.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_.mapget.md#mapget_class) - -## FirestoreFunction.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_.max.md#max_class) - -## FirestoreFunction.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_.min.md#min_class) - -## FirestoreFunction.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## FirestoreFunction.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -## FirestoreFunction.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## FirestoreFunction.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -## FirestoreFunction.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## FirestoreFunction.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -## FirestoreFunction.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## FirestoreFunction.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -## FirestoreFunction.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## FirestoreFunction.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -## FirestoreFunction.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## FirestoreFunction.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -## FirestoreFunction.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## FirestoreFunction.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -## FirestoreFunction.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -## FirestoreFunction.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## FirestoreFunction.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -## FirestoreFunction.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## FirestoreFunction.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## FirestoreFunction.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_.strcontains.md#strcontains_class) - -## FirestoreFunction.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## FirestoreFunction.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_.subtract.md#subtract_class) - -## FirestoreFunction.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_.sum.md#sum_class) - -## FirestoreFunction.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## FirestoreFunction.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -## FirestoreFunction.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## FirestoreFunction.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## FirestoreFunction.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -## FirestoreFunction.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -## FirestoreFunction.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -## FirestoreFunction.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -## FirestoreFunction.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -## FirestoreFunction.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -## FirestoreFunction.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## FirestoreFunction.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## FirestoreFunction.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## FirestoreFunction.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_.genericstage.md b/docs-devsite/firestore_.genericstage.md deleted file mode 100644 index 765ef090d87..00000000000 --- a/docs-devsite/firestore_.genericstage.md +++ /dev/null @@ -1,65 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenericStage class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class GenericStage implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(name, params)](./firestore_.genericstage.md#genericstageconstructor) | | (BETA) Constructs a new instance of the GenericStage class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.genericstage.md#genericstagename) | | string | (BETA) | - -## GenericStage.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `GenericStage` class - -Signature: - -```typescript -constructor(name: string, params: unknown[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| params | unknown\[\] | | - -## GenericStage.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.gt.md b/docs-devsite/firestore_.gt.md deleted file mode 100644 index 75843e172d7..00000000000 --- a/docs-devsite/firestore_.gt.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Gt class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Gt extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.gt.md#gtconstructor) | | (BETA) Constructs a new instance of the Gt class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.gt.md#gtfilterable) | | true | (BETA) | - -## Gt.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Gt` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Gt.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.gte.md b/docs-devsite/firestore_.gte.md deleted file mode 100644 index 923ece3ab8d..00000000000 --- a/docs-devsite/firestore_.gte.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Gte class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Gte extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.gte.md#gteconstructor) | | (BETA) Constructs a new instance of the Gte class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.gte.md#gtefilterable) | | true | (BETA) | - -## Gte.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Gte` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Gte.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.if.md b/docs-devsite/firestore_.if.md deleted file mode 100644 index 4f756b032b4..00000000000 --- a/docs-devsite/firestore_.if.md +++ /dev/null @@ -1,68 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# If class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class If extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(condition, thenExpr, elseExpr)](./firestore_.if.md#ifconstructor) | | (BETA) Constructs a new instance of the If class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.if.md#iffilterable) | | true | (BETA) | - -## If.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `If` class - -Signature: - -```typescript -constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterExpr](./firestore_.md#filterexpr) | | -| thenExpr | [Constant](./firestore_.constant.md#constant_class) | | -| elseExpr | [Constant](./firestore_.constant.md#constant_class) | | - -## If.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.in.md b/docs-devsite/firestore_.in.md deleted file mode 100644 index 76f38733041..00000000000 --- a/docs-devsite/firestore_.in.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# In class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class In extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, others)](./firestore_.in.md#inconstructor) | | (BETA) Constructs a new instance of the In class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.in.md#infilterable) | | true | (BETA) | - -## In.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `In` class - -Signature: - -```typescript -constructor(left: Constant, others: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | | - -## In.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.isnan.md b/docs-devsite/firestore_.isnan.md deleted file mode 100644 index bbeb8e4fa51..00000000000 --- a/docs-devsite/firestore_.isnan.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# IsNan class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class IsNan extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.isnan.md#isnanconstructor) | | (BETA) Constructs a new instance of the IsNan class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.isnan.md#isnanfilterable) | | true | (BETA) | - -## IsNan.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `IsNan` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - -## IsNan.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.like.md b/docs-devsite/firestore_.like.md deleted file mode 100644 index 94e680dd723..00000000000 --- a/docs-devsite/firestore_.like.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Like class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Like extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_.like.md#likeconstructor) | | (BETA) Constructs a new instance of the Like class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.like.md#likefilterable) | | true | (BETA) | - -## Like.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Like` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -## Like.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.limit.md b/docs-devsite/firestore_.limit.md deleted file mode 100644 index 81ad7339037..00000000000 --- a/docs-devsite/firestore_.limit.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Limit class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Limit implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(limit)](./firestore_.limit.md#limitconstructor) | | (BETA) Constructs a new instance of the Limit class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.limit.md#limitname) | | string | (BETA) | - -## Limit.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Limit` class - -Signature: - -```typescript -constructor(limit: number); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| limit | number | | - -## Limit.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.logicalmax.md b/docs-devsite/firestore_.logicalmax.md deleted file mode 100644 index 633947cdaba..00000000000 --- a/docs-devsite/firestore_.logicalmax.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# LogicalMax class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class LogicalMax extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.logicalmax.md#logicalmaxconstructor) | | (BETA) Constructs a new instance of the LogicalMax class | - -## LogicalMax.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `LogicalMax` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.logicalmin.md b/docs-devsite/firestore_.logicalmin.md deleted file mode 100644 index 65bf7ad5dc1..00000000000 --- a/docs-devsite/firestore_.logicalmin.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# LogicalMin class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class LogicalMin extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.logicalmin.md#logicalminconstructor) | | (BETA) Constructs a new instance of the LogicalMin class | - -## LogicalMin.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `LogicalMin` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.lt.md b/docs-devsite/firestore_.lt.md deleted file mode 100644 index 54911158139..00000000000 --- a/docs-devsite/firestore_.lt.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Lt class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Lt extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.lt.md#ltconstructor) | | (BETA) Constructs a new instance of the Lt class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.lt.md#ltfilterable) | | true | (BETA) | - -## Lt.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Lt` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Lt.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.lte.md b/docs-devsite/firestore_.lte.md deleted file mode 100644 index 7bd5cbe4420..00000000000 --- a/docs-devsite/firestore_.lte.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Lte class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Lte extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.lte.md#lteconstructor) | | (BETA) Constructs a new instance of the Lte class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.lte.md#ltefilterable) | | true | (BETA) | - -## Lte.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Lte` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Lte.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.mapget.md b/docs-devsite/firestore_.mapget.md deleted file mode 100644 index c2fe330f2f3..00000000000 --- a/docs-devsite/firestore_.mapget.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# MapGet class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class MapGet extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(map, name)](./firestore_.mapget.md#mapgetconstructor) | | (BETA) Constructs a new instance of the MapGet class | - -## MapGet.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `MapGet` class - -Signature: - -```typescript -constructor(map: Constant, name: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| map | [Constant](./firestore_.constant.md#constant_class) | | -| name | string | | - diff --git a/docs-devsite/firestore_.max.md b/docs-devsite/firestore_.max.md deleted file mode 100644 index 5fe1c376f93..00000000000 --- a/docs-devsite/firestore_.max.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Max class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Max extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_.max.md#maxconstructor) | | (BETA) Constructs a new instance of the Max class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_.max.md#maxaccumulator) | | true | (BETA) | - -## Max.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Max` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| distinct | boolean | | - -## Max.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index 4393d8999dc..74e960c833b 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -34,7 +34,6 @@ https://github.com/firebase/firebase-js-sdk | [namedQuery(firestore, name)](./firestore_.md#namedquery_6438876) | Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name.The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using loadBundle. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. | | [onSnapshotsInSync(firestore, observer)](./firestore_.md#onsnapshotsinsync_2f0dfa4) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [onSnapshotsInSync(firestore, onSync)](./firestore_.md#onsnapshotsinsync_1901c06) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | -| [pipeline(firestore)](./firestore_.md#pipeline_231a8e0) | Experimental Modular API for console testing. | | [runTransaction(firestore, updateFunction, options)](./firestore_.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | | [setIndexConfiguration(firestore, configuration)](./firestore_.md#setindexconfiguration_c362f04) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. | | [setIndexConfiguration(firestore, json)](./firestore_.md#setindexconfiguration_90d0285) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. Invoke either enableIndexedDbPersistence() or enableMultiTabIndexedDbPersistence() before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored.The method accepts the JSON format exported by the Firebase CLI (firebase firestore:indexes). If the JSON format is invalid, this method throws an error. | @@ -43,9447 +42,2418 @@ https://github.com/firebase/firebase-js-sdk | [writeBatch(firestore)](./firestore_.md#writebatch_231a8e0) | Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500.Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. | | function() | | [count()](./firestore_.md#count) | Create an AggregateField object that can be used to compute the count of documents in the result set of a query. | -| [countAll()](./firestore_.md#countall) | (BETA) Creates an aggregation that counts the total number of stage inputs. -```typescript -// Count the total number of users -countAll().as("totalUsers"); - -``` - A new representing the 'countAll' aggregation. | | [deleteField()](./firestore_.md#deletefield) | Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with {merge: true} to mark a field for deletion. | | [documentId()](./firestore_.md#documentid) | Returns a special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. | | [getFirestore()](./firestore_.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [memoryEagerGarbageCollector()](./firestore_.md#memoryeagergarbagecollector) | Creates an instance of MemoryEagerGarbageCollector. This is also the default garbage collector unless it is explicitly specified otherwise. | | [persistentMultipleTabManager()](./firestore_.md#persistentmultipletabmanager) | Creates an instance of PersistentMultipleTabManager. | | [serverTimestamp()](./firestore_.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | -| [useFirestorePipelines()](./firestore_.md#usefirestorepipelines) | Copyright 2024 Google LLCLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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. | -| function(array, ...) | -| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); - -``` - | -| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_21991c1) | (BETA) Creates an expression that concatenates an array expression with other arrays and/or values. -```typescript -// Combine the 'tags' array with a new array -arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); - -``` - | -| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_f8d5d5e) | (BETA) Creates an expression that concatenates a field's array value with other arrays. -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); - -``` - | -| [arrayConcat(array, elements)](./firestore_.md#arrayconcat_5a66d99) | (BETA) Creates an expression that concatenates a field's array value with other arrays and/or values. -```typescript -// Combine the 'tags' array with a new array -arrayConcat("tags", ["newTag1", "newTag2"]); - -``` - | -| [arrayContains(array, element)](./firestore_.md#arraycontains_01ea7c0) | (BETA) Creates an expression that checks if an array expression contains a specific element. -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains(Field.of("colors"), Field.of("selectedColor")); - -``` - | -| [arrayContains(array, element)](./firestore_.md#arraycontains_60f8f2f) | (BETA) Creates an expression that checks if an array expression contains a specific element. -```typescript -// Check if the 'colors' array contains "red" -arrayContains(Field.of("colors"), "red"); - -``` - | -| [arrayContains(array, element)](./firestore_.md#arraycontains_0ebdbfe) | (BETA) Creates an expression that checks if a field's array value contains a specific element. -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains("colors", Field.of("selectedColor")); - -``` - | -| [arrayContains(array, element)](./firestore_.md#arraycontains_8f718df) | (BETA) Creates an expression that checks if a field's array value contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -arrayContains("colors", "red"); - -``` - | -| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_7b7433a) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_d919466) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_.md#arraycontainsall_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_7b7433a) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_d919466) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_.md#arraycontainsany_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - | -| [arrayLength(array)](./firestore_.md#arraylength_0bb5dbb) | (BETA) Creates an expression that calculates the length of an array expression. -```typescript -// Get the number of items in the 'cart' array -arrayLength(Field.of("cart")); - -``` - | -| function(condition, ...) | -| [ifFunction(condition, thenExpr, elseExpr)](./firestore_.md#iffunction_f7b2404) | (BETA) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. -```typescript -// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". -ifFunction( - gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); - -``` - | | function(databaseId, ...) | | [getFirestore(databaseId)](./firestore_.md#getfirestore_53dc891) | (BETA) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | -| function(element, ...) | -| [inAny(element, others)](./firestore_.md#inany_a73b259) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_.md#inany_f5721c6) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_.md#inany_c6646ea) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_.md#inany_e6877aa) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", ["Electronics", Field.of("primaryType")]); - -``` - | -| [notInAny(element, others)](./firestore_.md#notinany_a73b259) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_.md#notinany_f5721c6) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_.md#notinany_c6646ea) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_.md#notinany_e6877aa) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", ["pending", Field.of("rejectedStatus")]); - -``` - | | function(elements, ...) | | [arrayRemove(elements)](./firestore_.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | -| function(expr, ...) | -| [ascending(expr)](./firestore_.md#ascending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -firestore.pipeline().collection("users") - .sort(ascending(Field.of("name"))); - -``` - | -| [byteLength(expr)](./firestore_.md#bytelength_f3fb767) | (BETA) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength(Field.of("myString")); - -``` - | -| [charLength(expr)](./firestore_.md#charlength_f3fb767) | (BETA) Creates an expression that calculates the character length of a string expression in UTF-8. -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength(Field.of("name")); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_b4c7dc2) | (BETA) Calculates the Cosine distance between a field's vector value and a double array. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", [37.7749, -122.4194]); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_8d2bd9d) | (BETA) Calculates the Cosine distance between a field's vector value and a VectorValue. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_c9ae0bc) | (BETA) Calculates the Cosine distance between a field's vector value and a vector expression. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance("userVector", Field.of("itemVector")); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_e701952) | (BETA) Calculates the Cosine distance between a vector expression and a double array. -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_cc2e83e) | (BETA) Calculates the Cosine distance between a vector expression and a VectorValue. -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(expr, other)](./firestore_.md#cosinedistance_0896fbd) | (BETA) Calculates the Cosine distance between two vector expressions. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance(Field.of("userVector"), Field.of("itemVector")); +| function(field, ...) | +| [average(field)](./firestore_.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | +| [sum(field)](./firestore_.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | +| function(fieldPath, ...) | +| [orderBy(fieldPath, directionStr)](./firestore_.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | +| [where(fieldPath, opStr, value)](./firestore_.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | +| function(fieldValues, ...) | +| [endAt(fieldValues)](./firestore_.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [endBefore(fieldValues)](./firestore_.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAfter(fieldValues)](./firestore_.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| [startAt(fieldValues)](./firestore_.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | +| function(indexManager, ...) | +| [deleteAllPersistentCacheIndexes(indexManager)](./firestore_.md#deleteallpersistentcacheindexes_98b2645) | Removes all persistent cache indexes.Please note this function will also deletes indexes generated by setIndexConfiguration(), which is deprecated. | +| [disablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#disablepersistentcacheindexautocreation_98b2645) | Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling enablePersistentCacheIndexAutoCreation() still take effect. | +| [enablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#enablepersistentcacheindexautocreation_98b2645) | Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance.This feature is disabled by default. | +| function(left, ...) | +| [aggregateFieldEqual(left, right)](./firestore_.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | +| [aggregateQuerySnapshotEqual(left, right)](./firestore_.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | +| [queryEqual(left, right)](./firestore_.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | +| [refEqual(left, right)](./firestore_.md#refequal_598b780) | Returns true if the provided references are equal. | +| [snapshotEqual(left, right)](./firestore_.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | +| function(limit, ...) | +| [limit(limit)](./firestore_.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | +| [limitToLast(limit)](./firestore_.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | +| function(logLevel, ...) | +| [setLogLevel(logLevel)](./firestore_.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | +| function(n, ...) | +| [increment(n)](./firestore_.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | +| function(query, ...) | +| [getAggregateFromServer(query, aggregateSpec)](./firestore_.md#getaggregatefromserver_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | +| [getCountFromServer(query)](./firestore_.md#getcountfromserver_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | +| [getDocs(query)](./firestore_.md#getdocs_4e56953) | Executes the query and returns the results as a QuerySnapshot.Note: getDocs() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). | +| [getDocsFromCache(query)](./firestore_.md#getdocsfromcache_4e56953) | Executes the query and returns the results as a QuerySnapshot from cache. Returns an empty result set if no documents matching the query are currently cached. | +| [getDocsFromServer(query)](./firestore_.md#getdocsfromserver_4e56953) | Executes the query and returns the results as a QuerySnapshot from the server. Returns an error if the network is not available. | +| [onSnapshot(query, observer)](./firestore_.md#onsnapshot_8d14049) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, options, observer)](./firestore_.md#onsnapshot_03dfff5) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_3ebfbe2) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(query, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_b8f9c47) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [query(query, compositeFilter, queryConstraints)](./firestore_.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | +| [query(query, queryConstraints)](./firestore_.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | +| function(queryConstraints, ...) | +| [and(queryConstraints)](./firestore_.md#and_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. | +| [or(queryConstraints)](./firestore_.md#or_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. | +| function(reference, ...) | +| [addDoc(reference, data)](./firestore_.md#adddoc_6e783ff) | Add a new document to specified CollectionReference with the given data, assigning it a document ID automatically. | +| [collection(reference, path, pathSegments)](./firestore_.md#collection_568f98d) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | +| [collection(reference, path, pathSegments)](./firestore_.md#collection_70b4396) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | +| [deleteDoc(reference)](./firestore_.md#deletedoc_4569087) | Deletes the document referred to by the specified DocumentReference. | +| [doc(reference, path, pathSegments)](./firestore_.md#doc_568f98d) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned DocumentReference. | +| [doc(reference, path, pathSegments)](./firestore_.md#doc_70b4396) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. | +| [getDoc(reference)](./firestore_.md#getdoc_4569087) | Reads the document referred to by this DocumentReference.Note: getDoc() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). | +| [getDocFromCache(reference)](./firestore_.md#getdocfromcache_4569087) | Reads the document referred to by this DocumentReference from cache. Returns an error if the document is not currently cached. | +| [getDocFromServer(reference)](./firestore_.md#getdocfromserver_4569087) | Reads the document referred to by this DocumentReference from the server. Returns an error if the network is not available. | +| [onSnapshot(reference, observer)](./firestore_.md#onsnapshot_0312fd7) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, options, observer)](./firestore_.md#onsnapshot_86b6b9e) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_905f42c) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshot(reference, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_0c39991) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [setDoc(reference, data)](./firestore_.md#setdoc_ee215ad) | Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created. | +| [setDoc(reference, data, options)](./firestore_.md#setdoc_ff80739) | Writes to the document referred to by the specified DocumentReference. If the document does not yet exist, it will be created. If you provide merge or mergeFields, the provided data can be merged into an existing document. | +| [updateDoc(reference, data)](./firestore_.md#updatedoc_51a65e3) | Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist. | +| [updateDoc(reference, field, value, moreFieldsAndValues)](./firestore_.md#updatedoc_7c28659) | Updates fields in the document referred to by the specified DocumentReference The update will fail if applied to a document that does not exist.Nested fields can be updated by providing dot-separated field path strings or by providing FieldPath objects. | +| function(settings, ...) | +| [memoryLocalCache(settings)](./firestore_.md#memorylocalcache_05f4bf2) | Creates an instance of MemoryLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use. | +| [memoryLruGarbageCollector(settings)](./firestore_.md#memorylrugarbagecollector_5ee014c) | Creates an instance of MemoryLruGarbageCollector.A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). | +| [persistentLocalCache(settings)](./firestore_.md#persistentlocalcache_d312f71) | Creates an instance of PersistentLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use.Persistent cache cannot be used in a Node.js environment. | +| [persistentSingleTabManager(settings)](./firestore_.md#persistentsingletabmanager_c99c68d) | Creates an instance of PersistentSingleTabManager. | +| function(snapshot, ...) | +| [endAt(snapshot)](./firestore_.md#endat_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [endBefore(snapshot)](./firestore_.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [startAfter(snapshot)](./firestore_.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | +| [startAt(snapshot)](./firestore_.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | +| function(values, ...) | +| [vector(values)](./firestore_.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | -``` - | -| [descending(expr)](./firestore_.md#descending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") - .sort(descending(Field.of("createdAt"))); +## Classes -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_b4c7dc2) | (BETA) Calculates the dot product between a field's vector value and a double array. -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", [0.5, 0.8, 0.2]); +| Class | Description | +| --- | --- | +| [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | +| [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | +| [Bytes](./firestore_.bytes.md#bytes_class) | An immutable object representing an array of bytes. | +| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | +| [DocumentReference](./firestore_.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | +| [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | +| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | +| [FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | +| [Firestore](./firestore_.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | +| [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | +| [GeoPoint](./firestore_.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | +| [LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) | Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.The API is compatible with Promise<LoadBundleTaskProgress>. | +| [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | A PersistentCacheIndexManager for configuring persistent cache indexes used for local query execution.To use, call getPersistentCacheIndexManager() to get an instance. | +| [Query](./firestore_.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | +| [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | +| [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | +| [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | +| [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | +| [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | +| [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | +| [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | +| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | +| [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | +| [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. | +| [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | +| [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | +| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_8d2bd9d) | (BETA) Calculates the dot product between a field's vector value and a VectorValue. -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); +## Interfaces -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_c9ae0bc) | (BETA) Calculates the dot product between a field's vector value and a vector expression. -```typescript -// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' -dotProduct("docVector1", Field.of("docVector2")); +| Interface | Description | +| --- | --- | +| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | +| [DocumentChange](./firestore_.documentchange.md#documentchange_interface) | A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred. | +| [DocumentData](./firestore_.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | +| [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.Note: This interface is "experimental" and is subject to change.See FirestoreSettings.experimentalAutoDetectLongPolling, FirestoreSettings.experimentalForceLongPolling, and FirestoreSettings.experimentalLongPollingOptions. | +| [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | +| [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | +| [Index](./firestore_.index.md#index_interface) | (BETA) The SDK definition of a Firestore index. | +| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (BETA) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | +| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (BETA) A single field element in an index configuration. | +| [LoadBundleTaskProgress](./firestore_.loadbundletaskprogress.md#loadbundletaskprogress_interface) | Represents a progress update or a final state from loading bundles. | +| [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | An settings object to configure an MemoryLocalCache instance. | +| [MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) | A garbage collector deletes documents whenever they are not part of any active queries, and have no local mutations attached to them.This collector tries to ensure lowest memory footprints from the SDK, at the risk of documents not being cached for offline queries or for direct queries to the cache.Use factory function to create an instance of this collector. | +| [MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) | Provides an in-memory cache to the SDK. This is the default cache unless explicitly configured otherwise.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | +| [MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) | A garbage collector deletes Least-Recently-Used documents in multiple batches.This collector is configured with a target size, and will only perform collection when the cached documents exceed the target size. It avoids querying backend repeated for the same query or document, at the risk of having a larger memory footprint.Use factory function to create a instance of this collector. | +| [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Settings that can be passed to enableIndexedDbPersistence() to configure Firestore persistence.Persistence cannot be used in a Node.js environment. | +| [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | An settings object to configure an PersistentLocalCache instance.Persistent cache cannot be used in a Node.js environment. | +| [PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) | Provides a persistent cache backed by IndexedDb to the SDK.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | +| [PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) | A tab manager supporting multiple tabs. SDK will synchronize queries and mutations done across all tabs using the SDK. | +| [PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) | A tab manager supporting only one tab, no synchronization will be performed across tabs. | +| [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) | Type to configure an PersistentSingleTabManager instance. | +| [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | An options object that can be passed to [onSnapshot()](./firestore_.md#onsnapshot_0312fd7) and [QuerySnapshot.docChanges()](./firestore_.querysnapshot.md#querysnapshotdocchanges) to control which types of changes to include in the result set. | +| [SnapshotOptions](./firestore_.snapshotoptions.md#snapshotoptions_interface) | Options that configure how data is retrieved from a DocumentSnapshot (for example the desired behavior for server timestamps that have not yet been set to their final value). | +| [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | +| [Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) | A function returned by onSnapshot() that removes the listener when invoked. | -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_e701952) | (BETA) Calculates the dot product between a vector expression and a double array. -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); +## Variables -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_cc2e83e) | (BETA) Calculates the dot product between a vector expression and a VectorValue. -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); +| Variable | Description | +| --- | --- | +| [CACHE\_SIZE\_UNLIMITED](./firestore_.md#cache_size_unlimited) | Constant used to indicate the LRU garbage collection should be disabled. Set this value as the cacheSizeBytes on the settings passed to the [Firestore](./firestore_.firestore.md#firestore_class) instance. | -``` - | -| [dotProduct(expr, other)](./firestore_.md#dotproduct_0896fbd) | (BETA) Calculates the dot product between two vector expressions. -```typescript -// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' -dotProduct(Field.of("docVector1"), Field.of("docVector2")); +## Type Aliases -``` - | -| [endsWith(expr, suffix)](./firestore_.md#endswith_88569cd) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -endsWith("filename", ".txt"); - -``` - | -| [endsWith(expr, suffix)](./firestore_.md#endswith_e2e794e) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -endsWith("url", Field.of("extension")); - -``` - | -| [endsWith(expr, suffix)](./firestore_.md#endswith_6308b81) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), "Jr."); - -``` - | -| [endsWith(expr, suffix)](./firestore_.md#endswith_ab1cc39) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), Constant.of("Jr.")); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_b4c7dc2) | (BETA) Calculates the Euclidean distance between a field's vector value and a double array. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", [37.7749, -122.4194]); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_8d2bd9d) | (BETA) Calculates the Euclidean distance between a field's vector value and a VectorValue. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_c9ae0bc) | (BETA) Calculates the Euclidean distance between a field's vector value and a vector expression. -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance("pointA", Field.of("pointB")); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_e701952) | (BETA) Calculates the Euclidean distance between a vector expression and a double array. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location - -euclideanDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_cc2e83e) | (BETA) Calculates the Euclidean distance between a vector expression and a VectorValue. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(expr, other)](./firestore_.md#euclideandistance_0896fbd) | (BETA) Calculates the Euclidean distance between two vector expressions. -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance(Field.of("pointA"), Field.of("pointB")); - -``` - | -| [reverse(expr)](./firestore_.md#reverse_f3fb767) | (BETA) Creates an expression that reverses a string. -```typescript -// Reverse the value of the 'myString' field. -reverse(Field.of("myString")); - -``` - | -| [startsWith(expr, prefix)](./firestore_.md#startswith_484d9f3) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -startsWith("name", "Mr."); - -``` - | -| [startsWith(expr, prefix)](./firestore_.md#startswith_7deb5c7) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -startsWith("fullName", Field.of("firstName")); - -``` - | -| [startsWith(expr, prefix)](./firestore_.md#startswith_68300d1) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), "Mr."); - -``` - | -| [startsWith(expr, prefix)](./firestore_.md#startswith_5774b68) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), Field.of("prefix")); - -``` - | -| [timestampToUnixMicros(expr)](./firestore_.md#timestamptounixmicros_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros(Field.of("timestamp")); - -``` - | -| [timestampToUnixMillis(expr)](./firestore_.md#timestamptounixmillis_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis(Field.of("timestamp")); - -``` - | -| [timestampToUnixSeconds(expr)](./firestore_.md#timestamptounixseconds_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds(Field.of("timestamp")); - -``` - | -| [toLower(expr)](./firestore_.md#tolower_1e536ed) | (BETA) Creates an expression that converts a string field to lowercase. -```typescript -// Convert the 'name' field to lowercase -toLower("name"); - -``` - | -| [toLower(expr)](./firestore_.md#tolower_f3fb767) | (BETA) Creates an expression that converts a string expression to lowercase. -```typescript -// Convert the 'name' field to lowercase -toLower(Field.of("name")); - -``` - | -| [toUpper(expr)](./firestore_.md#toupper_1e536ed) | (BETA) Creates an expression that converts a string field to uppercase. -```typescript -// Convert the 'title' field to uppercase -toUpper("title"); - -``` - | -| [toUpper(expr)](./firestore_.md#toupper_f3fb767) | (BETA) Creates an expression that converts a string expression to uppercase. -```typescript -// Convert the 'title' field to uppercase -toUppercase(Field.of("title")); - -``` - | -| [trim(expr)](./firestore_.md#trim_1e536ed) | (BETA) Creates an expression that removes leading and trailing whitespace from a string field. -```typescript -// Trim whitespace from the 'userInput' field -trim("userInput"); - -``` - | -| [trim(expr)](./firestore_.md#trim_f3fb767) | (BETA) Creates an expression that removes leading and trailing whitespace from a string expression. -```typescript -// Trim whitespace from the 'userInput' field -trim(Field.of("userInput")); - -``` - | -| [unixMicrosToTimestamp(expr)](./firestore_.md#unixmicrostotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp(Field.of("microseconds")); - -``` - | -| [unixMillisToTimestamp(expr)](./firestore_.md#unixmillistotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp(Field.of("milliseconds")); - -``` - | -| [unixSecondsToTimestamp(expr)](./firestore_.md#unixsecondstotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp(Field.of("seconds")); - -``` - | -| [vectorLength(expr)](./firestore_.md#vectorlength_f3fb767) | (BETA) Creates an expression that calculates the length of a Firestore Vector. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength(Field.of("embedding")); - -``` - | -| function(field, ...) | -| [average(field)](./firestore_.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | -| [byteLength(field)](./firestore_.md#bytelength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength("myString"); - -``` - | -| [charLength(field)](./firestore_.md#charlength_0fb8cd4) | (BETA) Creates an expression that calculates the character length of a string field in UTF8. -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength("name"); - -``` - | -| [exists(field)](./firestore_.md#exists_0fb8cd4) | (BETA) Creates an expression that checks if a field exists. -```typescript -// Check if the document has a field named "phoneNumber" -exists("phoneNumber"); - -``` - | -| [replaceAll(field, find, replace)](./firestore_.md#replaceall_b257ab0) | (BETA) Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll("message", "hello", "hi"); - -``` - | -| [replaceFirst(field, find, replace)](./firestore_.md#replacefirst_b257ab0) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst("message", "hello", "hi"); - -``` - | -| [reverse(field)](./firestore_.md#reverse_0fb8cd4) | (BETA) Creates an expression that reverses a string represented by a field. -```typescript -// Reverse the value of the 'myString' field. -reverse("myString"); - -``` - | -| [sum(field)](./firestore_.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | -| [timestampAdd(field, unit, amount)](./firestore_.md#timestampadd_565792c) | (BETA) Creates an expression that adds a specified amount of time to a timestamp represented by a field. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd("timestamp", "day", 1); - -``` - | -| [timestampSub(field, unit, amount)](./firestore_.md#timestampsub_565792c) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub("timestamp", "day", 1); - -``` - | -| [timestampToUnixMicros(field)](./firestore_.md#timestamptounixmicros_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros("timestamp"); - -``` - | -| [timestampToUnixMillis(field)](./firestore_.md#timestamptounixmillis_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis("timestamp"); - -``` - | -| [timestampToUnixSeconds(field)](./firestore_.md#timestamptounixseconds_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds("timestamp"); - -``` - | -| [unixMicrosToTimestamp(field)](./firestore_.md#unixmicrostotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp("microseconds"); - -``` - | -| [unixMillisToTimestamp(field)](./firestore_.md#unixmillistotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp("milliseconds"); - -``` - | -| [unixSecondsToTimestamp(field)](./firestore_.md#unixsecondstotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp("seconds"); - -``` - | -| [vectorLength(field)](./firestore_.md#vectorlength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a Firestore Vector represented by a field. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength("embedding"); - -``` - | -| function(fieldPath, ...) | -| [orderBy(fieldPath, directionStr)](./firestore_.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | -| [where(fieldPath, opStr, value)](./firestore_.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | -| function(fieldValues, ...) | -| [endAt(fieldValues)](./firestore_.md#endat_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [endBefore(fieldValues)](./firestore_.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAfter(fieldValues)](./firestore_.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| [startAt(fieldValues)](./firestore_.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| function(filter, ...) | -| [not(filter)](./firestore_.md#not_5520849) | (BETA) Creates an expression that negates a filter condition. -```typescript -// Find documents where the 'completed' field is NOT true -not(eq("completed", true)); - -``` - | -| function(first, ...) | -| [strConcat(first, elements)](./firestore_.md#strconcat_0f1bdbf) | (BETA) Creates an expression that concatenates string functions, fields or constants together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat("firstName", " ", Field.of("lastName")); - -``` - | -| [strConcat(first, elements)](./firestore_.md#strconcat_1eb0ac1) | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat(Field.of("firstName"), " ", Field.of("lastName")); - -``` - | -| function(indexManager, ...) | -| [deleteAllPersistentCacheIndexes(indexManager)](./firestore_.md#deleteallpersistentcacheindexes_98b2645) | Removes all persistent cache indexes.Please note this function will also deletes indexes generated by setIndexConfiguration(), which is deprecated. | -| [disablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#disablepersistentcacheindexautocreation_98b2645) | Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling enablePersistentCacheIndexAutoCreation() still take effect. | -| [enablePersistentCacheIndexAutoCreation(indexManager)](./firestore_.md#enablepersistentcacheindexautocreation_98b2645) | Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance.This feature is disabled by default. | -| function(left, ...) | -| [add(left, right)](./firestore_.md#add_be96f75) | (BETA) Creates an expression that adds two expressions together. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add(Field.of("quantity"), Field.of("reserve")); - -``` - | -| [add(left, right)](./firestore_.md#add_010ba9e) | (BETA) Creates an expression that adds an expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -add(Field.of("age"), 5); - -``` - | -| [add(left, right)](./firestore_.md#add_674c63f) | (BETA) Creates an expression that adds a field's value to an expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add("quantity", Field.of("reserve")); - -``` - | -| [add(left, right)](./firestore_.md#add_1f46a76) | (BETA) Creates an expression that adds a field's value to a constant value. -```typescript -// Add 5 to the value of the 'age' field -add("age", 5); - -``` - | -| [aggregateFieldEqual(left, right)](./firestore_.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | -| [aggregateQuerySnapshotEqual(left, right)](./firestore_.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | -| [and(left, right)](./firestore_.md#and_eba7e36) | (BETA) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. -```typescript -// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND -// the 'status' field is "active" -const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - | -| [divide(left, right)](./firestore_.md#divide_be96f75) | (BETA) Creates an expression that divides two expressions. -```typescript -// Divide the 'total' field by the 'count' field -divide(Field.of("total"), Field.of("count")); - -``` - | -| [divide(left, right)](./firestore_.md#divide_010ba9e) | (BETA) Creates an expression that divides an expression by a constant value. -```typescript -// Divide the 'value' field by 10 -divide(Field.of("value"), 10); - -``` - | -| [divide(left, right)](./firestore_.md#divide_674c63f) | (BETA) Creates an expression that divides a field's value by an expression. -```typescript -// Divide the 'total' field by the 'count' field -divide("total", Field.of("count")); - -``` - | -| [divide(left, right)](./firestore_.md#divide_1f46a76) | (BETA) Creates an expression that divides a field's value by a constant value. -```typescript -// Divide the 'value' field by 10 -divide("value", 10); - -``` - | -| [eq(left, right)](./firestore_.md#eq_be96f75) | (BETA) Creates an expression that checks if two expressions are equal. -```typescript -// Check if the 'age' field is equal to an expression -eq(Field.of("age"), Field.of("minAge").add(10)); - -``` - | -| [eq(left, right)](./firestore_.md#eq_010ba9e) | (BETA) Creates an expression that checks if an expression is equal to a constant value. -```typescript -// Check if the 'age' field is equal to 21 -eq(Field.of("age"), 21); - -``` - | -| [eq(left, right)](./firestore_.md#eq_674c63f) | (BETA) Creates an expression that checks if a field's value is equal to an expression. -```typescript -// Check if the 'age' field is equal to the 'limit' field -eq("age", Field.of("limit")); - -``` - | -| [eq(left, right)](./firestore_.md#eq_1f46a76) | (BETA) Creates an expression that checks if a field's value is equal to a constant value. -```typescript -// Check if the 'city' field is equal to string constant "London" -eq("city", "London"); - -``` - | -| [gt(left, right)](./firestore_.md#gt_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than the second expression. -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), Constant(9).add(9)); - -``` - | -| [gt(left, right)](./firestore_.md#gt_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than a constant value. -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), 18); - -``` - | -| [gt(left, right)](./firestore_.md#gt_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than an expression. -```typescript -// Check if the value of field 'age' is greater than the value of field 'limit' -gt("age", Field.of("limit")); - -``` - | -| [gt(left, right)](./firestore_.md#gt_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -gt("price", 100); - -``` - | -| [gte(left, right)](./firestore_.md#gte_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than or equal to the second expression. -```typescript -// Check if the 'quantity' field is greater than or equal to the field "threshold" -gte(Field.of("quantity"), Field.of("threshold")); - -``` - | -| [gte(left, right)](./firestore_.md#gte_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than or equal to a constant value. -```typescript -// Check if the 'quantity' field is greater than or equal to 10 -gte(Field.of("quantity"), 10); - -``` - | -| [gte(left, right)](./firestore_.md#gte_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than or equal to an expression. -```typescript -// Check if the value of field 'age' is greater than or equal to the value of field 'limit' -gte("age", Field.of("limit")); - -``` - | -| [gte(left, right)](./firestore_.md#gte_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -gte("score", 80); - -``` - | -| [like(left, pattern)](./firestore_.md#like_33ec01b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. -```typescript -// Check if the 'title' field contains the string "guide" -like("title", "%guide%"); - -``` - | -| [like(left, pattern)](./firestore_.md#like_dd84184) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. -```typescript -// Check if the 'title' field contains the string "guide" -like("title", Field.of("pattern")); - -``` - | -| [like(left, pattern)](./firestore_.md#like_3aaffe0) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), "%guide%"); - -``` - | -| [like(left, pattern)](./firestore_.md#like_a2c3e8b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), Field.of("pattern")); - -``` - | -| [logicalMax(left, right)](./firestore_.md#logicalmax_be96f75) | (BETA) Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax(Field.of("field1"), Field.of("field2")); - -``` - | -| [logicalMax(left, right)](./firestore_.md#logicalmax_010ba9e) | (BETA) Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax(Field.of("value"), 10); - -``` - | -| [logicalMax(left, right)](./firestore_.md#logicalmax_674c63f) | (BETA) Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax("field1", Field.of('field2')); - -``` - | -| [logicalMax(left, right)](./firestore_.md#logicalmax_1f46a76) | (BETA) Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax("value", 10); - -``` - | -| [logicalMin(left, right)](./firestore_.md#logicalmin_be96f75) | (BETA) Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin(Field.of("field1"), Field.of("field2")); - -``` - | -| [logicalMin(left, right)](./firestore_.md#logicalmin_010ba9e) | (BETA) Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin(Field.of("value"), 10); - -``` - | -| [logicalMin(left, right)](./firestore_.md#logicalmin_674c63f) | (BETA) Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin("field1", Field.of("field2")); - -``` - | -| [logicalMin(left, right)](./firestore_.md#logicalmin_1f46a76) | (BETA) Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin("value", 10); - -``` - | -| [lt(left, right)](./firestore_.md#lt_be96f75) | (BETA) Creates an expression that checks if the first expression is less than the second expression. -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), Field.of("limit")); - -``` - | -| [lt(left, right)](./firestore_.md#lt_010ba9e) | (BETA) Creates an expression that checks if an expression is less than a constant value. -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), 30); - -``` - | -| [lt(left, right)](./firestore_.md#lt_674c63f) | (BETA) Creates an expression that checks if a field's value is less than an expression. -```typescript -// Check if the 'age' field is less than the 'limit' field -lt("age", Field.of("limit")); - -``` - | -| [lt(left, right)](./firestore_.md#lt_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -lt("price", 50); - -``` - | -| [lte(left, right)](./firestore_.md#lte_be96f75) | (BETA) Creates an expression that checks if the first expression is less than or equal to the second expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), Field.of("limit")); - -``` - | -| [lte(left, right)](./firestore_.md#lte_010ba9e) | (BETA) Creates an expression that checks if an expression is less than or equal to a constant value. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), 20); - -``` - | -| [lte(left, right)](./firestore_.md#lte_674c63f) | Creates an expression that checks if a field's value is less than or equal to an expression. -```typescript -// Check if the 'quantity' field is less than or equal to the 'limit' field -lte("quantity", Field.of("limit")); - -``` - | -| [lte(left, right)](./firestore_.md#lte_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -lte("score", 70); - -``` - | -| [mod(left, right)](./firestore_.md#mod_be96f75) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing two expressions. -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod(Field.of("field1"), Field.of("field2")); - -``` - | -| [mod(left, right)](./firestore_.md#mod_010ba9e) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod(Field.of("field1"), 5); - -``` - | -| [mod(left, right)](./firestore_.md#mod_674c63f) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod("field1", Field.of("field2")); - -``` - | -| [mod(left, right)](./firestore_.md#mod_1f46a76) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod("field1", 5); - -``` - | -| [multiply(left, right)](./firestore_.md#multiply_be96f75) | (BETA) Creates an expression that multiplies two expressions together. -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply(Field.of("quantity"), Field.of("price")); - -``` - | -| [multiply(left, right)](./firestore_.md#multiply_010ba9e) | (BETA) Creates an expression that multiplies an expression by a constant value. -```typescript -// Multiply the value of the 'price' field by 2 -multiply(Field.of("price"), 2); - -``` - | -| [multiply(left, right)](./firestore_.md#multiply_674c63f) | (BETA) Creates an expression that multiplies a field's value by an expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply("quantity", Field.of("price")); - -``` - | -| [multiply(left, right)](./firestore_.md#multiply_1f46a76) | (BETA) Creates an expression that multiplies a field's value by a constant value. -```typescript -// Multiply the 'value' field by 2 -multiply("value", 2); - -``` - | -| [neq(left, right)](./firestore_.md#neq_be96f75) | (BETA) Creates an expression that checks if two expressions are not equal. -```typescript -// Check if the 'status' field is not equal to field 'finalState' -neq(Field.of("status"), Field.of("finalState")); - -``` - | -| [neq(left, right)](./firestore_.md#neq_010ba9e) | (BETA) Creates an expression that checks if an expression is not equal to a constant value. -```typescript -// Check if the 'status' field is not equal to "completed" -neq(Field.of("status"), "completed"); - -``` - | -| [neq(left, right)](./firestore_.md#neq_674c63f) | (BETA) Creates an expression that checks if a field's value is not equal to an expression. -```typescript -// Check if the 'status' field is not equal to the value of 'expectedStatus' -neq("status", Field.of("expectedStatus")); - -``` - | -| [neq(left, right)](./firestore_.md#neq_1f46a76) | (BETA) Creates an expression that checks if a field's value is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -neq("country", "USA"); - -``` - | -| [or(left, right)](./firestore_.md#or_eba7e36) | (BETA) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. -```typescript -// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR -// the 'status' field is "active" -const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - | -| [queryEqual(left, right)](./firestore_.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | -| [refEqual(left, right)](./firestore_.md#refequal_598b780) | Returns true if the provided references are equal. | -| [regexContains(left, pattern)](./firestore_.md#regexcontains_33ec01b) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", "(?i)example"); - -``` - | -| [regexContains(left, pattern)](./firestore_.md#regexcontains_dd84184) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", Field.of("pattern")); - -``` - | -| [regexContains(left, pattern)](./firestore_.md#regexcontains_3aaffe0) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), "(?i)example"); - -``` - | -| [regexContains(left, pattern)](./firestore_.md#regexcontains_a2c3e8b) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), Field.of("pattern")); - -``` - | -| [regexMatch(left, pattern)](./firestore_.md#regexmatch_33ec01b) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(left, pattern)](./firestore_.md#regexmatch_dd84184) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", Field.of("pattern")); - -``` - | -| [regexMatch(left, pattern)](./firestore_.md#regexmatch_3aaffe0) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(left, pattern)](./firestore_.md#regexmatch_a2c3e8b) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), Field.of("pattern")); - -``` - | -| [snapshotEqual(left, right)](./firestore_.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | -| [strContains(left, substring)](./firestore_.md#strcontains_18eaf5d) | (BETA) Creates an expression that checks if a string field contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -strContains("description", "example"); - -``` - | -| [strContains(left, substring)](./firestore_.md#strcontains_f0f1f2f) | (BETA) Creates an expression that checks if a string field contains a substring specified by an expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains("description", Field.of("keyword")); - -``` - | -| [strContains(left, substring)](./firestore_.md#strcontains_5fdbd29) | (BETA) Creates an expression that checks if a string expression contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -strContains(Field.of("description"), "example"); - -``` - | -| [strContains(left, substring)](./firestore_.md#strcontains_d9d749f) | (BETA) Creates an expression that checks if a string expression contains a substring specified by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains(Field.of("description"), Field.of("keyword")); - -``` - | -| [subtract(left, right)](./firestore_.md#subtract_be96f75) | (BETA) Creates an expression that subtracts two expressions. -```typescript -// Subtract the 'discount' field from the 'price' field -subtract(Field.of("price"), Field.of("discount")); - -``` - | -| [subtract(left, right)](./firestore_.md#subtract_010ba9e) | (BETA) Creates an expression that subtracts a constant value from an expression. -```typescript -// Subtract the constant value 2 from the 'value' field -subtract(Field.of("value"), 2); - -``` - | -| [subtract(left, right)](./firestore_.md#subtract_674c63f) | (BETA) Creates an expression that subtracts an expression from a field's value. -```typescript -// Subtract the 'discount' field from the 'price' field -subtract("price", Field.of("discount")); - -``` - | -| [subtract(left, right)](./firestore_.md#subtract_1f46a76) | (BETA) Creates an expression that subtracts a constant value from a field's value. -```typescript -// Subtract 20 from the value of the 'total' field -subtract("total", 20); - -``` - | -| [xor(left, right)](./firestore_.md#xor_eba7e36) | (BETA) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. -```typescript -// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", -// or 'status' is "active". -const condition = xor( - gt("age", 18), - eq("city", "London"), - eq("status", "active")); - -``` - | -| function(limit, ...) | -| [limit(limit)](./firestore_.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | -| [limitToLast(limit)](./firestore_.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | -| function(logLevel, ...) | -| [setLogLevel(logLevel)](./firestore_.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | -| function(mapExpr, ...) | -| [mapGet(mapExpr, subField)](./firestore_.md#mapget_9715f90) | (BETA) Accesses a value from a map (object) expression using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -mapGet(Field.of("address"), "city"); - -``` - | -| function(mapField, ...) | -| [mapGet(mapField, subField)](./firestore_.md#mapget_b37bbb6) | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -mapGet("address", "city"); - -``` - | -| function(n, ...) | -| [increment(n)](./firestore_.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | -| function(name, ...) | -| [genericFunction(name, params)](./firestore_.md#genericfunction_b886545) | (BETA) Creates functions that work on the backend but do not exist in the SDK yet. -```typescript -// Call a user defined function named "myFunc" with the arguments 10 and 20 -// This is the same of the 'sum(Field.of("price"))', if it did not exist -genericFunction("sum", [Field.of("price")]); - -``` - | -| function(pipeline, ...) | -| [execute(pipeline)](./firestore_.md#execute_86486e6) | (BETA) Modular API for console experimentation. | -| function(query, ...) | -| [getAggregateFromServer(query, aggregateSpec)](./firestore_.md#getaggregatefromserver_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | -| [getCountFromServer(query)](./firestore_.md#getcountfromserver_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents).The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. | -| [getDocs(query)](./firestore_.md#getdocs_4e56953) | Executes the query and returns the results as a QuerySnapshot.Note: getDocs() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). | -| [getDocsFromCache(query)](./firestore_.md#getdocsfromcache_4e56953) | Executes the query and returns the results as a QuerySnapshot from cache. Returns an empty result set if no documents matching the query are currently cached. | -| [getDocsFromServer(query)](./firestore_.md#getdocsfromserver_4e56953) | Executes the query and returns the results as a QuerySnapshot from the server. Returns an error if the network is not available. | -| [onSnapshot(query, observer)](./firestore_.md#onsnapshot_8d14049) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, options, observer)](./firestore_.md#onsnapshot_03dfff5) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_3ebfbe2) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(query, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_b8f9c47) | Attaches a listener for QuerySnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [pipeline(query)](./firestore_.md#pipeline_20b2416) | Experimental Modular API for console testing. | -| [query(query, compositeFilter, queryConstraints)](./firestore_.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | -| [query(query, queryConstraints)](./firestore_.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | -| function(queryConstraints, ...) | -| [and(queryConstraints)](./firestore_.md#and_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. | -| [or(queryConstraints)](./firestore_.md#or_e72c712) | Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. | -| function(reference, ...) | -| [addDoc(reference, data)](./firestore_.md#adddoc_6e783ff) | Add a new document to specified CollectionReference with the given data, assigning it a document ID automatically. | -| [collection(reference, path, pathSegments)](./firestore_.md#collection_568f98d) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | -| [collection(reference, path, pathSegments)](./firestore_.md#collection_70b4396) | Gets a CollectionReference instance that refers to a subcollection of reference at the specified relative path. | -| [deleteDoc(reference)](./firestore_.md#deletedoc_4569087) | Deletes the document referred to by the specified DocumentReference. | -| [doc(reference, path, pathSegments)](./firestore_.md#doc_568f98d) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned DocumentReference. | -| [doc(reference, path, pathSegments)](./firestore_.md#doc_70b4396) | Gets a DocumentReference instance that refers to a document within reference at the specified relative path. | -| [getDoc(reference)](./firestore_.md#getdoc_4569087) | Reads the document referred to by this DocumentReference.Note: getDoc() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). | -| [getDocFromCache(reference)](./firestore_.md#getdocfromcache_4569087) | Reads the document referred to by this DocumentReference from cache. Returns an error if the document is not currently cached. | -| [getDocFromServer(reference)](./firestore_.md#getdocfromserver_4569087) | Reads the document referred to by this DocumentReference from the server. Returns an error if the network is not available. | -| [onSnapshot(reference, observer)](./firestore_.md#onsnapshot_0312fd7) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, options, observer)](./firestore_.md#onsnapshot_86b6b9e) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_905f42c) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [onSnapshot(reference, options, onNext, onError, onCompletion)](./firestore_.md#onsnapshot_0c39991) | Attaches a listener for DocumentSnapshot events. You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | -| [setDoc(reference, data)](./firestore_.md#setdoc_ee215ad) | Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created. | -| [setDoc(reference, data, options)](./firestore_.md#setdoc_ff80739) | Writes to the document referred to by the specified DocumentReference. If the document does not yet exist, it will be created. If you provide merge or mergeFields, the provided data can be merged into an existing document. | -| [updateDoc(reference, data)](./firestore_.md#updatedoc_51a65e3) | Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist. | -| [updateDoc(reference, field, value, moreFieldsAndValues)](./firestore_.md#updatedoc_7c28659) | Updates fields in the document referred to by the specified DocumentReference The update will fail if applied to a document that does not exist.Nested fields can be updated by providing dot-separated field path strings or by providing FieldPath objects. | -| function(settings, ...) | -| [memoryLocalCache(settings)](./firestore_.md#memorylocalcache_05f4bf2) | Creates an instance of MemoryLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use. | -| [memoryLruGarbageCollector(settings)](./firestore_.md#memorylrugarbagecollector_5ee014c) | Creates an instance of MemoryLruGarbageCollector.A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). | -| [persistentLocalCache(settings)](./firestore_.md#persistentlocalcache_d312f71) | Creates an instance of PersistentLocalCache. The instance can be set to FirestoreSettings.cache to tell the SDK which cache layer to use.Persistent cache cannot be used in a Node.js environment. | -| [persistentSingleTabManager(settings)](./firestore_.md#persistentsingletabmanager_c99c68d) | Creates an instance of PersistentSingleTabManager. | -| function(snapshot, ...) | -| [endAt(snapshot)](./firestore_.md#endat_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [endBefore(snapshot)](./firestore_.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [startAfter(snapshot)](./firestore_.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [startAt(snapshot)](./firestore_.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | -| function(timestamp, ...) | -| [timestampAdd(timestamp, unit, amount)](./firestore_.md#timestampadd_87db576) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(timestamp, unit, amount)](./firestore_.md#timestampadd_46a2d7e) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), "day", 1); - -``` - | -| [timestampSub(timestamp, unit, amount)](./firestore_.md#timestampsub_87db576) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(timestamp, unit, amount)](./firestore_.md#timestampsub_46a2d7e) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub(Field.of("timestamp"), "day", 1); - -``` - | -| function(value, ...) | -| [avg(value)](./firestore_.md#avg_f83680a) | (BETA) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. -```typescript -// Calculate the average age of users -avg(Field.of("age")).as("averageAge"); - -``` - | -| [avg(value)](./firestore_.md#avg_7c807cd) | (BETA) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. -```typescript -// Calculate the average age of users -avg("age").as("averageAge"); - -``` - | -| [countExpression(value)](./firestore_.md#countexpression_f83680a) | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. -```typescript -// Count the number of items where the price is greater than 10 -count(Field.of("price").gt(10)).as("expensiveItemCount"); - -``` - | -| [countExpression(value)](./firestore_.md#countexpression_7c807cd) | Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided field. -```typescript -// Count the total number of products -count("productId").as("totalProducts"); - -``` - | -| [exists(value)](./firestore_.md#exists_f83680a) | (BETA) Creates an expression that checks if a field exists. -```typescript -// Check if the document has a field named "phoneNumber" -exists(Field.of("phoneNumber")); - -``` - | -| [isNan(value)](./firestore_.md#isnan_f83680a) | (BETA) Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -isNaN(Field.of("value").divide(0)); - -``` - | -| [isNan(value)](./firestore_.md#isnan_7c807cd) | (BETA) Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -isNaN("value"); - -``` - | -| [max(value)](./firestore_.md#max_f83680a) | (BETA) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -max(Field.of("score")).as("highestScore"); - -``` - | -| [max(value)](./firestore_.md#max_7c807cd) | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -max("score").as("highestScore"); - -``` - | -| [min(value)](./firestore_.md#min_f83680a) | (BETA) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. -```typescript -// Find the lowest price of all products -min(Field.of("price")).as("lowestPrice"); - -``` - | -| [min(value)](./firestore_.md#min_7c807cd) | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -min("price").as("lowestPrice"); - -``` - | -| [replaceAll(value, find, replace)](./firestore_.md#replaceall_f06d323) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll(Field.of("message"), "hello", "hi"); - -``` - | -| [replaceAll(value, find, replace)](./firestore_.md#replaceall_26a7926) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(value, find, replace)](./firestore_.md#replacefirst_f06d323) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst(Field.of("message"), "hello", "hi"); - -``` - | -| [replaceFirst(value, find, replace)](./firestore_.md#replacefirst_26a7926) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); - -``` - | -| [sumExpression(value)](./firestore_.md#sumexpression_f83680a) | (BETA) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -sum(Field.of("orderAmount")).as("totalRevenue"); - -``` - | -| [sumExpression(value)](./firestore_.md#sumexpression_7c807cd) | (BETA) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -sum("orderAmount").as("totalRevenue"); - -``` - | -| function(values, ...) | -| [vector(values)](./firestore_.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | - -## Classes - -| Class | Description | -| --- | --- | -| [Add](./firestore_.add.md#add_class) | (BETA) | -| [AddFields](./firestore_.addfields.md#addfields_class) | (BETA) | -| [Aggregate](./firestore_.aggregate.md#aggregate_class) | (BETA) | -| [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | -| [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | -| [And](./firestore_.and.md#and_class) | (BETA) | -| [ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) | (BETA) | -| [ArrayContains](./firestore_.arraycontains.md#arraycontains_class) | (BETA) | -| [ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) | (BETA) | -| [ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) | (BETA) | -| [ArrayElement](./firestore_.arrayelement.md#arrayelement_class) | (BETA) | -| [ArrayLength](./firestore_.arraylength.md#arraylength_class) | (BETA) | -| [ArrayReverse](./firestore_.arrayreverse.md#arrayreverse_class) | (BETA) | -| [Avg](./firestore_.avg.md#avg_class) | (BETA) | -| [ByteLength](./firestore_.bytelength.md#bytelength_class) | (BETA) | -| [Bytes](./firestore_.bytes.md#bytes_class) | An immutable object representing an array of bytes. | -| [CharLength](./firestore_.charlength.md#charlength_class) | (BETA) | -| [CollectionGroupSource](./firestore_.collectiongroupsource.md#collectiongroupsource_class) | (BETA) | -| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | -| [CollectionSource](./firestore_.collectionsource.md#collectionsource_class) | (BETA) | -| [Constant](./firestore_.constant.md#constant_class) | (BETA) Represents a constant value that can be used in a Firestore pipeline expression.You can create a Constant instance using the static method: -```typescript -// Create a Constant instance for the number 10 -const ten = Constant.of(10); - -// Create a Constant instance for the string "hello" -const hello = Constant.of("hello"); - -``` - | -| [CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) | (BETA) | -| [Count](./firestore_.count.md#count_class) | (BETA) | -| [DatabaseSource](./firestore_.databasesource.md#databasesource_class) | (BETA) | -| [Distinct](./firestore_.distinct.md#distinct_class) | (BETA) | -| [Divide](./firestore_.divide.md#divide_class) | (BETA) | -| [DocumentReference](./firestore_.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | -| [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | -| [DocumentsSource](./firestore_.documentssource.md#documentssource_class) | (BETA) | -| [DotProduct](./firestore_.dotproduct.md#dotproduct_class) | (BETA) | -| [EndsWith](./firestore_.endswith.md#endswith_class) | (BETA) | -| [Eq](./firestore_.eq.md#eq_class) | (BETA) | -| [EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) | (BETA) | -| [Exists](./firestore_.exists.md#exists_class) | (BETA) | -| [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) | (BETA) | -| [Field](./firestore_.field.md#field_class) | (BETA) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage.

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.

You can create a Field instance using the static method: -```typescript -// Create a Field instance for the 'name' field -const nameField = Field.of("name"); - -// Create a Field instance for a nested field 'address.city' -const cityField = Field.of("address.city"); - -``` - | -| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | -| [Fields](./firestore_.fields.md#fields_class) | (BETA) | -| [FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | -| [FindNearest](./firestore_.findnearest.md#findnearest_class) | (BETA) | -| [Firestore](./firestore_.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | -| [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | -| [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) | (BETA) This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. | -| [GenericStage](./firestore_.genericstage.md#genericstage_class) | (BETA) | -| [GeoPoint](./firestore_.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | -| [Gt](./firestore_.gt.md#gt_class) | (BETA) | -| [Gte](./firestore_.gte.md#gte_class) | (BETA) | -| [If](./firestore_.if.md#if_class) | (BETA) | -| [In](./firestore_.in.md#in_class) | (BETA) | -| [IsNan](./firestore_.isnan.md#isnan_class) | (BETA) | -| [Like](./firestore_.like.md#like_class) | (BETA) | -| [Limit](./firestore_.limit.md#limit_class) | (BETA) | -| [LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) | Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.The API is compatible with Promise<LoadBundleTaskProgress>. | -| [LogicalMax](./firestore_.logicalmax.md#logicalmax_class) | (BETA) | -| [LogicalMin](./firestore_.logicalmin.md#logicalmin_class) | (BETA) | -| [Lt](./firestore_.lt.md#lt_class) | (BETA) | -| [Lte](./firestore_.lte.md#lte_class) | (BETA) | -| [MapGet](./firestore_.mapget.md#mapget_class) | (BETA) | -| [Max](./firestore_.max.md#max_class) | (BETA) | -| [Min](./firestore_.min.md#min_class) | (BETA) | -| [Mod](./firestore_.mod.md#mod_class) | (BETA) | -| [Multiply](./firestore_.multiply.md#multiply_class) | (BETA) | -| [Neq](./firestore_.neq.md#neq_class) | (BETA) | -| [Not](./firestore_.not.md#not_class) | (BETA) | -| [Offset](./firestore_.offset.md#offset_class) | (BETA) | -| [Or](./firestore_.or.md#or_class) | (BETA) | -| [Ordering](./firestore_.ordering.md#ordering_class) | (BETA) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. | -| [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | A PersistentCacheIndexManager for configuring persistent cache indexes used for local query execution.To use, call getPersistentCacheIndexManager() to get an instance. | -| [Pipeline](./firestore_.pipeline.md#pipeline_class) | | -| [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) | (BETA) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.

If the PipelineResult represents a non-document result, ref will return a undefined value. | -| [PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) | (BETA) Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). | -| [Query](./firestore_.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | -| [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | -| [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | -| [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | -| [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | -| [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | -| [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | -| [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | -| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | -| [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | -| [RegexContains](./firestore_.regexcontains.md#regexcontains_class) | (BETA) | -| [RegexMatch](./firestore_.regexmatch.md#regexmatch_class) | (BETA) | -| [ReplaceAll](./firestore_.replaceall.md#replaceall_class) | (BETA) | -| [ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) | (BETA) | -| [Reverse](./firestore_.reverse.md#reverse_class) | (BETA) | -| [Select](./firestore_.select.md#select_class) | (BETA) | -| [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. | -| [Sort](./firestore_.sort.md#sort_class) | (BETA) | -| [StartsWith](./firestore_.startswith.md#startswith_class) | (BETA) | -| [StrConcat](./firestore_.strconcat.md#strconcat_class) | (BETA) | -| [StrContains](./firestore_.strcontains.md#strcontains_class) | (BETA) | -| [Subtract](./firestore_.subtract.md#subtract_class) | (BETA) | -| [Sum](./firestore_.sum.md#sum_class) | (BETA) | -| [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | -| [TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) | (BETA) | -| [TimestampSub](./firestore_.timestampsub.md#timestampsub_class) | (BETA) | -| [TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) | (BETA) | -| [TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) | (BETA) | -| [TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) | (BETA) | -| [ToLower](./firestore_.tolower.md#tolower_class) | (BETA) | -| [ToUpper](./firestore_.toupper.md#toupper_class) | (BETA) | -| [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [Trim](./firestore_.trim.md#trim_class) | (BETA) | -| [UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) | (BETA) | -| [UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) | (BETA) | -| [UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) | (BETA) | -| [VectorLength](./firestore_.vectorlength.md#vectorlength_class) | (BETA) | -| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | -| [Where](./firestore_.where.md#where_class) | (BETA) | -| [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | -| [Xor](./firestore_.xor.md#xor_class) | (BETA) | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [Accumulator](./firestore_.accumulator.md#accumulator_interface) | (BETA) An interface that represents an accumulator. | -| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | -| [DocumentChange](./firestore_.documentchange.md#documentchange_interface) | A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred. | -| [DocumentData](./firestore_.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | -| [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.Note: This interface is "experimental" and is subject to change.See FirestoreSettings.experimentalAutoDetectLongPolling, FirestoreSettings.experimentalForceLongPolling, and FirestoreSettings.experimentalLongPollingOptions. | -| [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) | (BETA) An interface that represents a filter condition. | -| [FindNearestOptions](./firestore_.findnearestoptions.md#findnearestoptions_interface) | (BETA) | -| [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | -| [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | -| [Index](./firestore_.index.md#index_interface) | (BETA) The SDK definition of a Firestore index. | -| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (BETA) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | -| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (BETA) A single field element in an index configuration. | -| [LoadBundleTaskProgress](./firestore_.loadbundletaskprogress.md#loadbundletaskprogress_interface) | Represents a progress update or a final state from loading bundles. | -| [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | An settings object to configure an MemoryLocalCache instance. | -| [MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) | A garbage collector deletes documents whenever they are not part of any active queries, and have no local mutations attached to them.This collector tries to ensure lowest memory footprints from the SDK, at the risk of documents not being cached for offline queries or for direct queries to the cache.Use factory function to create an instance of this collector. | -| [MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) | Provides an in-memory cache to the SDK. This is the default cache unless explicitly configured otherwise.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | -| [MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) | A garbage collector deletes Least-Recently-Used documents in multiple batches.This collector is configured with a target size, and will only perform collection when the cached documents exceed the target size. It avoids querying backend repeated for the same query or document, at the risk of having a larger memory footprint.Use factory function to create a instance of this collector. | -| [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Settings that can be passed to enableIndexedDbPersistence() to configure Firestore persistence.Persistence cannot be used in a Node.js environment. | -| [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | An settings object to configure an PersistentLocalCache instance.Persistent cache cannot be used in a Node.js environment. | -| [PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) | Provides a persistent cache backed by IndexedDb to the SDK.To use, create an instance using the factory function , then set the instance to FirestoreSettings.cache and call initializeFirestore using the settings object. | -| [PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) | A tab manager supporting multiple tabs. SDK will synchronize queries and mutations done across all tabs using the SDK. | -| [PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) | A tab manager supporting only one tab, no synchronization will be performed across tabs. | -| [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) | Type to configure an PersistentSingleTabManager instance. | -| [Selectable](./firestore_.selectable.md#selectable_interface) | (BETA) An interface that represents a selectable expression. | -| [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | An options object that can be passed to [onSnapshot()](./firestore_.md#onsnapshot_0312fd7) and [QuerySnapshot.docChanges()](./firestore_.querysnapshot.md#querysnapshotdocchanges) to control which types of changes to include in the result set. | -| [SnapshotOptions](./firestore_.snapshotoptions.md#snapshotoptions_interface) | Options that configure how data is retrieved from a DocumentSnapshot (for example the desired behavior for server timestamps that have not yet been set to their final value). | -| [Stage](./firestore_.stage.md#stage_interface) | (BETA) | -| [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | -| [Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) | A function returned by onSnapshot() that removes the listener when invoked. | - -## Namespaces - -| Namespace | Description | -| --- | --- | -| [and](./firestore_.and.md#and_namespace) | | -| [or](./firestore_.or.md#or_namespace) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [CACHE\_SIZE\_UNLIMITED](./firestore_.md#cache_size_unlimited) | Constant used to indicate the LRU garbage collection should be disabled. Set this value as the cacheSizeBytes on the settings passed to the [Firestore](./firestore_.firestore.md#firestore_class) instance. | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [AccumulatorTarget](./firestore_.md#accumulatortarget) | (BETA) An accumulator target, which is an expression with an alias that also implements the Accumulator interface. | -| [AddPrefixToKeys](./firestore_.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | -| [AggregateFieldType](./firestore_.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | -| [AggregateSpecData](./firestore_.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | -| [AggregateType](./firestore_.md#aggregatetype) | Union type representing the aggregate type to be performed. | -| [ChildUpdateFields](./firestore_.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | -| [DocumentChangeType](./firestore_.md#documentchangetype) | The type of a DocumentChange may be 'added', 'removed', or 'modified'. | -| [ExprType](./firestore_.md#exprtype) | (BETA) An enumeration of the different types of expressions. | -| [FilterExpr](./firestore_.md#filterexpr) | (BETA) A filter expression, which is an expression that also implements the FilterCondition interface. | -| [FirestoreErrorCode](./firestore_.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | -| [FirestoreLocalCache](./firestore_.md#firestorelocalcache) | Union type from all supported SDK cache layer. | -| [ListenSource](./firestore_.md#listensource) | Describe the source a query listens to.Set to default to listen to both cache and server changes. Set to cache to listen to changes in cache only. | -| [MemoryGarbageCollector](./firestore_.md#memorygarbagecollector) | Union type from all support garbage collectors for memory local cache. | -| [NestedUpdateFields](./firestore_.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | -| [OrderByDirection](./firestore_.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | -| [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | -| [PersistentTabManager](./firestore_.md#persistenttabmanager) | A union of all available tab managers. | -| [Primitive](./firestore_.md#primitive) | Primitive types. | -| [QueryConstraintType](./firestore_.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | -| [QueryFilterConstraint](./firestore_.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | -| [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | -| [SelectableExpr](./firestore_.md#selectableexpr) | (BETA) A selectable expression, which is an expression that also implements the Selectable interface. | -| [SetOptions](./firestore_.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | -| [TaskState](./firestore_.md#taskstate) | Represents the state of bundle loading tasks.Both 'Error' and 'Success' are sinking state: task will abort or complete and there will be no more updates after they are reported. | -| [UnionToIntersection](./firestore_.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | -| [UpdateData](./firestore_.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | -| [WhereFilterOp](./firestore_.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | -| [WithFieldValue](./firestore_.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | - -## function(app, ...) - -### getFirestore(app) {:#getfirestore_cf608e1} - -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(app: FirebaseApp): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | - -Returns: - -[Firestore](./firestore_.firestore.md#firestore_class) - -The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### getFirestore(app, databaseId) {:#getfirestore_48de6cb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_.firestore.md#firestore_class) - -The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### initializeFirestore(app, settings, databaseId) {:#initializefirestore_fc7d200} - -Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). - -Signature: - -```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the [Firestore](./firestore_.firestore.md#firestore_class) instance will be associated. | -| settings | [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | A settings object to configure the [Firestore](./firestore_.firestore.md#firestore_class) instance. | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_.firestore.md#firestore_class) - -A newly initialized [Firestore](./firestore_.firestore.md#firestore_class) instance. - -## function(firestore, ...) - -### clearIndexedDbPersistence(firestore) {:#clearindexeddbpersistence_231a8e0} - -Clears the persistent storage. This includes pending writes and cached documents. - -Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of `failed-precondition`. - -Note: `clearIndexedDbPersistence()` is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. - -Signature: - -```typescript -export declare function clearIndexedDbPersistence(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to clear persistence for. | - -Returns: - -Promise<void> - -A `Promise` that is resolved when the persistent storage is cleared. Otherwise, the promise is rejected with an error. - -### collection(firestore, path, pathSegments) {:#collection_1eb4c23} - -Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. - -Signature: - -```typescript -export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | - -Returns: - -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions - -If the final path has an even number of segments and does not point to a collection. - -### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} - -Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. - -Signature: - -```typescript -export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | - -Returns: - -[Query](./firestore_.query.md#query_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The created `Query`. - -### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} - -Modify this instance to communicate with the Cloud Firestore emulator. - -Note: This must be called before this instance has been used to do any operations. - -Signature: - -```typescript -export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | -| host | string | the emulator host (ex: localhost). | -| port | number | the emulator port (ex: 9000). | -| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | - -Returns: - -void - -### disableNetwork(firestore) {:#disablenetwork_231a8e0} - -Disables network usage for this instance. It can be re-enabled via [enableNetwork()](./firestore_.md#enablenetwork_231a8e0). While the network is disabled, any snapshot listeners, `getDoc()` or `getDocs()` calls will return results from cache, and any write operations will be queued until the network is restored. - -Signature: - -```typescript -export declare function disableNetwork(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -Promise<void> - -A `Promise` that is resolved once the network has been disabled. - -### doc(firestore, path, pathSegments) {:#doc_1eb4c23} - -Gets a `DocumentReference` instance that refers to the document at the specified absolute path. - -Signature: - -```typescript -export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | - -Returns: - -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. - -#### Exceptions - -If the final path has an odd number of segments and does not point to a document. - -### enableIndexedDbPersistence(firestore, persistenceSettings) {:#enableindexeddbpersistence_224174f} - -> Warning: This API is now obsolete. -> -> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. -> - -Attempts to enable persistent storage, if possible. - -On failure, `enableIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. - -\* failed-precondition: The app is already open in another browser tab. \* unimplemented: The browser is incompatible with the offline persistence implementation. - -Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. - -Note: `enableIndexedDbPersistence()` must be called before any other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200), [getFirestore()](./firestore_.md#getfirestore) or [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0). - -Persistence cannot be used in a Node.js environment. - -Signature: - -```typescript -export declare function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | -| persistenceSettings | [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Optional settings object to configure persistence. | - -Returns: - -Promise<void> - -A `Promise` that represents successfully enabling persistent storage. - -### enableMultiTabIndexedDbPersistence(firestore) {:#enablemultitabindexeddbpersistence_231a8e0} - -> Warning: This API is now obsolete. -> -> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. -> - -Attempts to enable multi-tab persistent storage, if possible. If enabled across all tabs, all operations share access to local persistence, including shared execution of queries and latency-compensated local document updates across all connected instances. - -On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. - -\* failed-precondition: The app is already open in another browser tab and multi-tab is not enabled. \* unimplemented: The browser is incompatible with the offline persistence implementation. - -Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. - -Signature: - -```typescript -export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | - -Returns: - -Promise<void> - -A `Promise` that represents successfully enabling persistent storage. - -### enableNetwork(firestore) {:#enablenetwork_231a8e0} - -Re-enables use of the network for this [Firestore](./firestore_.firestore.md#firestore_class) instance after a prior call to [disableNetwork()](./firestore_.md#disablenetwork_231a8e0). - -Signature: - -```typescript -export declare function enableNetwork(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -Promise<void> - -A `Promise` that is resolved once the network has been enabled. - -### getPersistentCacheIndexManager(firestore) {:#getpersistentcacheindexmanager_231a8e0} - -Returns the PersistentCache Index Manager used by the given `Firestore` object. - - The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use. - -Signature: - -```typescript -export declare function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -[PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) \| null - -### loadBundle(firestore, bundleData) {:#loadbundle_bec5b75} - -Loads a Firestore bundle into the local cache. - -Signature: - -```typescript -export declare function loadBundle(firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string): LoadBundleTask; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to load bundles for. | -| bundleData | ReadableStream<Uint8Array> \| ArrayBuffer \| string | An object representing the bundle to be loaded. Valid objects are ArrayBuffer, ReadableStream<Uint8Array> or string. | - -Returns: - -[LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) - -A `LoadBundleTask` object, which notifies callers with progress updates, and completion or error events. It can be used as a `Promise`. - -### namedQuery(firestore, name) {:#namedquery_6438876} - -Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name. - -The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using `loadBundle`. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. - -Signature: - -```typescript -export declare function namedQuery(firestore: Firestore, name: string): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to read the query from. | -| name | string | The name of the query. | - -Returns: - -Promise<[Query](./firestore_.query.md#query_class) \| null> - -A `Promise` that is resolved with the Query or `null`. - -### onSnapshotsInSync(firestore, observer) {:#onsnapshotsinsync_2f0dfa4} - -Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. - -NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. - -Signature: - -```typescript -export declare function onSnapshotsInSync(firestore: Firestore, observer: { - next?: (value: void) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The instance of Firestore for synchronizing snapshots. | -| observer | { next?: (value: void) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | - -Returns: - -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. - -### onSnapshotsInSync(firestore, onSync) {:#onsnapshotsinsync_1901c06} - -Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. - -NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use `SnapshotMetadata` in the individual listeners to determine if a snapshot is from the cache or the server. - -Signature: - -```typescript -export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance for synchronizing snapshots. | -| onSync | () => void | A callback to be called every time all snapshot listeners are in sync with each other. | - -Returns: - -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. - -### pipeline(firestore) {:#pipeline_231a8e0} - -Experimental Modular API for console testing. - -Signature: - -```typescript -export declare function pipeline(firestore: Firestore): PipelineSource; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -[PipelineSource](./firestore_.pipelinesource.md#pipelinesource_class) - -### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} - -Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. - -The maximum number of writes allowed in a single transaction is 500. - -Signature: - -```typescript -export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | -| updateFunction | (transaction: [Transaction](./firestore_.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | -| options | [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | - -Returns: - -Promise<T> - -If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. - -### setIndexConfiguration(firestore, configuration) {:#setindexconfiguration_c362f04} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -> Warning: This API is now obsolete. -> -> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. -> - -Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. - -The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. - -Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. - -Signature: - -```typescript -export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | -| configuration | [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | The index definition. | - -Returns: - -Promise<void> - -A `Promise` that resolves once all indices are successfully configured. - -#### Exceptions - -FirestoreError if the JSON format is invalid. - -### setIndexConfiguration(firestore, json) {:#setindexconfiguration_90d0285} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -> Warning: This API is now obsolete. -> -> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. -> - -Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. - -The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. - -Indexes are only supported with IndexedDb persistence. Invoke either `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored. - -The method accepts the JSON format exported by the Firebase CLI (`firebase firestore:indexes`). If the JSON format is invalid, this method throws an error. - -Signature: - -```typescript -export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | -| json | string | The JSON format exported by the Firebase CLI. | - -Returns: - -Promise<void> - -A `Promise` that resolves once all indices are successfully configured. - -#### Exceptions - -FirestoreError if the JSON format is invalid. - -### terminate(firestore) {:#terminate_231a8e0} - -Terminates the provided [Firestore](./firestore_.firestore.md#firestore_class) instance. - -After calling `terminate()` only the `clearIndexedDbPersistence()` function may be used. Any other function will throw a `FirestoreError`. - -To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.md#getfirestore). - -Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. If you have persistence enabled, the next time you start this instance, it will resume sending these writes to the server. - -Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with `clearIndexedDbPersistence()` to ensure that all local state is destroyed between test runs. - -Signature: - -```typescript -export declare function terminate(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -Promise<void> - -A `Promise` that is resolved when the instance has been successfully terminated. - -### waitForPendingWrites(firestore) {:#waitforpendingwrites_231a8e0} - -Waits until all currently pending writes for the active user have been acknowledged by the backend. - -The returned promise resolves immediately if there are no outstanding writes. Otherwise, the promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call `waitForPendingWrites()` again. - -Any outstanding `waitForPendingWrites()` promises are rejected during user changes. - -Signature: - -```typescript -export declare function waitForPendingWrites(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -Promise<void> - -A `Promise` which resolves when all currently pending writes have been acknowledged by the backend. - -### writeBatch(firestore) {:#writebatch_231a8e0} - -Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500. - -Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. - -Signature: - -```typescript -export declare function writeBatch(firestore: Firestore): WriteBatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | - -Returns: - -[WriteBatch](./firestore_.writebatch.md#writebatch_class) - -A [WriteBatch](./firestore_.writebatch.md#writebatch_class) that can be used to atomically execute multiple writes. - -## function() - -### count() {:#count} - -Create an AggregateField object that can be used to compute the count of documents in the result set of a query. - -Signature: - -```typescript -export declare function count(): AggregateField; -``` -Returns: - -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> - -### countAll() {:#countall} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the total number of stage inputs. - -```typescript -// Count the total number of users -countAll().as("totalUsers"); - -``` - A new representing the 'countAll' aggregation. - -Signature: - -```typescript -export declare function countAll(): Count; -``` -Returns: - -[Count](./firestore_.count.md#count_class) - -### deleteField() {:#deletefield} - -Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. - -Signature: - -```typescript -export declare function deleteField(): FieldValue; -``` -Returns: - -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) - -### documentId() {:#documentid} - -Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. - -Signature: - -```typescript -export declare function documentId(): FieldPath; -``` -Returns: - -[FieldPath](./firestore_.fieldpath.md#fieldpath_class) - -### getFirestore() {:#getfirestore} - -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(): Firestore; -``` -Returns: - -[Firestore](./firestore_.firestore.md#firestore_class) - -The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. - -### memoryEagerGarbageCollector() {:#memoryeagergarbagecollector} - -Creates an instance of `MemoryEagerGarbageCollector`. This is also the default garbage collector unless it is explicitly specified otherwise. - -Signature: - -```typescript -export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; -``` -Returns: - -[MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) - -### persistentMultipleTabManager() {:#persistentmultipletabmanager} - -Creates an instance of `PersistentMultipleTabManager`. - -Signature: - -```typescript -export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; -``` -Returns: - -[PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) - -### serverTimestamp() {:#servertimestamp} - -Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. - -Signature: - -```typescript -export declare function serverTimestamp(): FieldValue; -``` -Returns: - -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) - -### useFirestorePipelines() {:#usefirestorepipelines} - - Copyright 2024 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. - -Signature: - -```typescript -export declare function useFirestorePipelines(): void; -``` -Returns: - -void - -## function(array, ...) - -### arrayConcat(array, elements) {:#arrayconcat_0b3ddb9} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with other arrays. - -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to concatenate to. | -| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_21991c1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with other arrays and/or values. - -```typescript -// Combine the 'tags' array with a new array -arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: Constant, elements: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to concatenate to. | -| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_f8d5d5e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates a field's array value with other arrays. - -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: string, elements: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name containing array values. | -| elements | [Constant](./firestore_.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_5a66d99} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates a field's array value with other arrays and/or values. - -```typescript -// Combine the 'tags' array with a new array -arrayConcat("tags", ["newTag1", "newTag2"]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: string, elements: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name containing array values. | -| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_.arrayconcat.md#arrayconcat_class) - -### arrayContains(array, element) {:#arraycontains_01ea7c0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains a specific element. - -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains(Field.of("colors"), Field.of("selectedColor")); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: Constant, element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_60f8f2f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains a specific element. - -```typescript -// Check if the 'colors' array contains "red" -arrayContains(Field.of("colors"), "red"); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: Constant, element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_0ebdbfe} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains a specific element. - -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains("colors", Field.of("selectedColor")); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: string, element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| element | [Constant](./firestore_.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_8f718df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -arrayContains("colors", "red"); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: string, element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_.arraycontains.md#arraycontains_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_7b7433a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_d919466} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_b40e2df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains all the specified values or expressions. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_b08efbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains all the specified values or expressions. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_7b7433a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_d919466} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_b40e2df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | [Constant](./firestore_.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_b08efbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_.arraycontainsany.md#arraycontainsany_class) - -### arrayLength(array) {:#arraylength_0bb5dbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array expression. - -```typescript -// Get the number of items in the 'cart' array -arrayLength(Field.of("cart")); - -``` - -Signature: - -```typescript -export declare function arrayLength(array: Constant): ArrayLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_.constant.md#constant_class) | The array expression to calculate the length of. A new representing the length of the array. | - -Returns: - -[ArrayLength](./firestore_.arraylength.md#arraylength_class) - -## function(condition, ...) - -### ifFunction(condition, thenExpr, elseExpr) {:#iffunction_f7b2404} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. - -```typescript -// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". -ifFunction( - gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); - -``` - -Signature: - -```typescript -export declare function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterExpr](./firestore_.md#filterexpr) | The condition to evaluate. | -| thenExpr | [Constant](./firestore_.constant.md#constant_class) | The expression to evaluate if the condition is true. | -| elseExpr | [Constant](./firestore_.constant.md#constant_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. | - -Returns: - -[If](./firestore_.if.md#if_class) - -## function(databaseId, ...) - -### getFirestore(databaseId) {:#getfirestore_53dc891} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(databaseId: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_.firestore.md#firestore_class) - -The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. - -## function(element, ...) - -### inAny(element, others) {:#inany_a73b259} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: Constant, others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -### inAny(element, others) {:#inany_f5721c6} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: Constant, others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -### inAny(element, others) {:#inany_c6646ea} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: string, others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field to compare. | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -### inAny(element, others) {:#inany_e6877aa} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", ["Electronics", Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: string, others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field to compare. | -| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_.in.md#in_class) - -### notInAny(element, others) {:#notinany_a73b259} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: Constant, others: Constant[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_.not.md#not_class) - -### notInAny(element, others) {:#notinany_f5721c6} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: Constant, others: any[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_.not.md#not_class) - -### notInAny(element, others) {:#notinany_c6646ea} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: string, others: Constant[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field name to compare. | -| others | [Constant](./firestore_.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_.not.md#not_class) - -### notInAny(element, others) {:#notinany_e6877aa} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", ["pending", Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: string, others: any[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field name to compare. | -| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_.not.md#not_class) - -## function(elements, ...) - -### arrayRemove(elements) {:#arrayremove_7d853aa} - -Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. - -Signature: - -```typescript -export declare function arrayRemove(...elements: unknown[]): FieldValue; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | unknown\[\] | The elements to remove from the array. | - -Returns: - -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) - -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` - -### arrayUnion(elements) {:#arrayunion_7d853aa} - -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. - -Signature: - -```typescript -export declare function arrayUnion(...elements: unknown[]): FieldValue; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | unknown\[\] | The elements to union into the array. | - -Returns: - -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) - -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. - -## function(expr, ...) - -### ascending(expr) {:#ascending_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -firestore.pipeline().collection("users") - .sort(ascending(Field.of("name"))); - -``` - -Signature: - -```typescript -export declare function ascending(expr: Constant): Ordering; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to create an ascending ordering for. A new Ordering for ascending sorting. | - -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -### byteLength(expr) {:#bytelength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. - -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength(Field.of("myString")); - -``` - -Signature: - -```typescript -export declare function byteLength(expr: Constant): ByteLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string. A new representing the length of the string in bytes. | - -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -### charLength(expr) {:#charlength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string expression in UTF-8. - -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength(Field.of("name")); - -``` - -Signature: - -```typescript -export declare function charLength(expr: Constant): CharLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to calculate the length of. A new representing the length of the string. | - -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -### cosineDistance(expr, other) {:#cosinedistance_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a double array. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a VectorValue. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a vector expression. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance("userVector", Field.of("itemVector")); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a vector expression and a double array. - -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a vector expression and a VectorValue. - -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vector expressions. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance(Field.of("userVector"), Field.of("itemVector")); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_.cosinedistance.md#cosinedistance_class) - -### descending(expr) {:#descending_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") - .sort(descending(Field.of("createdAt"))); - -``` - -Signature: - -```typescript -export declare function descending(expr: Constant): Ordering; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. | - -Returns: - -[Ordering](./firestore_.ordering.md#ordering_class) - -### dotProduct(expr, other) {:#dotproduct_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a double array. - -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", [0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a VectorValue. - -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a vector expression. - -```typescript -// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' -dotProduct("docVector1", Field.of("docVector2")); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a vector expression and a double array. - -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a vector expression and a VectorValue. - -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vector expressions. - -```typescript -// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' -dotProduct(Field.of("docVector1"), Field.of("docVector2")); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_.dotproduct.md#dotproduct_class) - -### endsWith(expr, suffix) {:#endswith_88569cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -endsWith("filename", ".txt"); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: string, suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_e2e794e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value ends with a given postfix. - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -endsWith("url", Field.of("extension")); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: string, suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The expression representing the postfix. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_6308b81} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression ends with a given postfix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), "Jr."); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: Constant, suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | -| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_ab1cc39} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression ends with a given postfix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), Constant.of("Jr.")); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: Constant, suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | -| suffix | [Constant](./firestore_.constant.md#constant_class) | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_.endswith.md#endswith_class) - -### euclideanDistance(expr, other) {:#euclideandistance_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a double array. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a VectorValue. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a vector expression. - -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance("pointA", Field.of("pointB")); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a vector expression and a double array. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location - -euclideanDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a vector expression and a VectorValue. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vector expressions. - -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance(Field.of("pointA"), Field.of("pointB")); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [Constant](./firestore_.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_.euclideandistance.md#euclideandistance_class) - -### reverse(expr) {:#reverse_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses a string. - -```typescript -// Reverse the value of the 'myString' field. -reverse(Field.of("myString")); - -``` - -Signature: - -```typescript -export declare function reverse(expr: Constant): Reverse; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to reverse. A new representing the reversed string. | - -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -### startsWith(expr, prefix) {:#startswith_484d9f3} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -startsWith("name", "Mr."); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: string, prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_7deb5c7} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value starts with a given prefix. - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -startsWith("fullName", Field.of("firstName")); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: string, prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The expression representing the prefix. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_68300d1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression starts with a given prefix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), "Mr."); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: Constant, prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | -| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_5774b68} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression starts with a given prefix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), Field.of("prefix")); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: Constant, prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression to check. | -| prefix | [Constant](./firestore_.constant.md#constant_class) | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_.startswith.md#startswith_class) - -### timestampToUnixMicros(expr) {:#timestamptounixmicros_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. | - -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -### timestampToUnixMillis(expr) {:#timestamptounixmillis_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. | - -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -### timestampToUnixSeconds(expr) {:#timestamptounixseconds_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. | - -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -### toLower(expr) {:#tolower_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string field to lowercase. - -```typescript -// Convert the 'name' field to lowercase -toLower("name"); - -``` - -Signature: - -```typescript -export declare function toLower(expr: string): ToLower; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the lowercase string. | - -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -### toLower(expr) {:#tolower_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string expression to lowercase. - -```typescript -// Convert the 'name' field to lowercase -toLower(Field.of("name")); - -``` - -Signature: - -```typescript -export declare function toLower(expr: Constant): ToLower; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to convert to lowercase. A new representing the lowercase string. | - -Returns: - -[ToLower](./firestore_.tolower.md#tolower_class) - -### toUpper(expr) {:#toupper_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string field to uppercase. - -```typescript -// Convert the 'title' field to uppercase -toUpper("title"); - -``` - -Signature: - -```typescript -export declare function toUpper(expr: string): ToUpper; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the uppercase string. | - -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -### toUpper(expr) {:#toupper_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string expression to uppercase. - -```typescript -// Convert the 'title' field to uppercase -toUppercase(Field.of("title")); - -``` - -Signature: - -```typescript -export declare function toUpper(expr: Constant): ToUpper; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to convert to uppercase. A new representing the uppercase string. | - -Returns: - -[ToUpper](./firestore_.toupper.md#toupper_class) - -### trim(expr) {:#trim_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string field. - -```typescript -// Trim whitespace from the 'userInput' field -trim("userInput"); - -``` - -Signature: - -```typescript -export declare function trim(expr: string): Trim; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the trimmed string. | - -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -### trim(expr) {:#trim_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string expression. - -```typescript -// Trim whitespace from the 'userInput' field -trim(Field.of("userInput")); - -``` - -Signature: - -```typescript -export declare function trim(expr: Constant): Trim; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to trim. A new representing the trimmed string. | - -Returns: - -[Trim](./firestore_.trim.md#trim_class) - -### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp(Field.of("microseconds")); - -``` - -Signature: - -```typescript -export declare function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp(Field.of("milliseconds")); - -``` - -Signature: - -```typescript -export declare function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp(Field.of("seconds")); - -``` - -Signature: - -```typescript -export declare function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -### vectorLength(expr) {:#vectorlength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a Firestore Vector. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength(Field.of("embedding")); - -``` - -Signature: - -```typescript -export declare function vectorLength(expr: Constant): VectorLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the Firestore Vector. A new representing the length of the array. | - -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - -## function(field, ...) - -### average(field) {:#average_aacc3a9} - -Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. - -Signature: - -```typescript -export declare function average(field: string | FieldPath): AggregateField; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | - -Returns: - -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number \| null> - -### byteLength(field) {:#bytelength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. - -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength("myString"); - -``` - -Signature: - -```typescript -export declare function byteLength(field: string): ByteLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string. A new representing the length of the string in bytes. | - -Returns: - -[ByteLength](./firestore_.bytelength.md#bytelength_class) - -### charLength(field) {:#charlength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string field in UTF8. - -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength("name"); - -``` - -Signature: - -```typescript -export declare function charLength(field: string): CharLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field containing the string. A new representing the length of the string. | - -Returns: - -[CharLength](./firestore_.charlength.md#charlength_class) - -### exists(field) {:#exists_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists. - -```typescript -// Check if the document has a field named "phoneNumber" -exists("phoneNumber"); - -``` - -Signature: - -```typescript -export declare function exists(field: string): Exists; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The field name to check. A new representing the 'exists' check. | - -Returns: - -[Exists](./firestore_.exists.md#exists_class) - -### replaceAll(field, find, replace) {:#replaceall_b257ab0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll("message", "hello", "hi"); - -``` - -Signature: - -```typescript -export declare function replaceAll(field: string, find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -### replaceFirst(field, find, replace) {:#replacefirst_b257ab0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst("message", "hello", "hi"); - -``` - -Signature: - -```typescript -export declare function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -### reverse(field) {:#reverse_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses a string represented by a field. - -```typescript -// Reverse the value of the 'myString' field. -reverse("myString"); - -``` - -Signature: - -```typescript -export declare function reverse(field: string): Reverse; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to reverse. A new representing the reversed string. | - -Returns: - -[Reverse](./firestore_.reverse.md#reverse_class) - -### sum(field) {:#sum_aacc3a9} - -Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. - -Signature: - -```typescript -export declare function sum(field: string | FieldPath): AggregateField; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | - -Returns: - -[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> - -### timestampAdd(field, unit, amount) {:#timestampadd_565792c} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to a timestamp represented by a field. - -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd("timestamp", "day", 1); - -``` - -Signature: - -```typescript -export declare function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) - -### timestampSub(field, unit, amount) {:#timestampsub_565792c} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. - -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub("timestamp", "day", 1); - -``` - -Signature: - -```typescript -export declare function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -### timestampToUnixMicros(field) {:#timestamptounixmicros_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMicros(field: string): TimestampToUnixMicros; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. | - -Returns: - -[TimestampToUnixMicros](./firestore_.timestamptounixmicros.md#timestamptounixmicros_class) - -### timestampToUnixMillis(field) {:#timestamptounixmillis_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMillis(field: string): TimestampToUnixMillis; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. | - -Returns: - -[TimestampToUnixMillis](./firestore_.timestamptounixmillis.md#timestamptounixmillis_class) - -### timestampToUnixSeconds(field) {:#timestamptounixseconds_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. | - -Returns: - -[TimestampToUnixSeconds](./firestore_.timestamptounixseconds.md#timestamptounixseconds_class) - -### unixMicrosToTimestamp(field) {:#unixmicrostotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp("microseconds"); - -``` - -Signature: - -```typescript -export declare function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMicrosToTimestamp](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -### unixMillisToTimestamp(field) {:#unixmillistotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp("milliseconds"); - -``` - -Signature: - -```typescript -export declare function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMillisToTimestamp](./firestore_.unixmillistotimestamp.md#unixmillistotimestamp_class) - -### unixSecondsToTimestamp(field) {:#unixsecondstotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp("seconds"); - -``` - -Signature: - -```typescript -export declare function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixSecondsToTimestamp](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -### vectorLength(field) {:#vectorlength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a Firestore Vector represented by a field. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength("embedding"); - -``` - -Signature: - -```typescript -export declare function vectorLength(field: string): VectorLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the Firestore Vector. A new representing the length of the array. | - -Returns: - -[VectorLength](./firestore_.vectorlength.md#vectorlength_class) - -## function(fieldPath, ...) - -### orderBy(fieldPath, directionStr) {:#orderby_006d61f} - -Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. - -Note: Documents that do not contain the specified field will not be present in the query result. - -Signature: - -```typescript -export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The field to sort by. | -| directionStr | [OrderByDirection](./firestore_.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | - -Returns: - -[QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) - -The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). - -### where(fieldPath, opStr, value) {:#where_0fae4bf} - -Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. - -Signature: - -```typescript -export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The path to compare | -| opStr | [WhereFilterOp](./firestore_.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | -| value | unknown | The value for comparison | - -Returns: - -[QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) - -The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). - -## function(fieldValues, ...) - -### endAt(fieldValues) {:#endat_8b2f2c8} - -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | - -Returns: - -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) - -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` - -### endBefore(fieldValues) {:#endbefore_8b2f2c8} - -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | - -Returns: - -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) - -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` - -### startAfter(fieldValues) {:#startafter_8b2f2c8} - -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | - -Returns: - -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` - -### startAt(fieldValues) {:#startat_8b2f2c8} - -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | - -Returns: - -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. - -## function(filter, ...) - -### not(filter) {:#not_5520849} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that negates a filter condition. - -```typescript -// Find documents where the 'completed' field is NOT true -not(eq("completed", true)); - -``` - -Signature: - -```typescript -export declare function not(filter: FilterExpr): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| filter | [FilterExpr](./firestore_.md#filterexpr) | The filter condition to negate. A new representing the negated filter condition. | - -Returns: - -[Not](./firestore_.not.md#not_class) - -## function(first, ...) - -### strConcat(first, elements) {:#strconcat_0f1bdbf} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string functions, fields or constants together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat("firstName", " ", Field.of("lastName")); - -``` - -Signature: - -```typescript -export declare function strConcat(first: string, ...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | string | The field name containing the initial string value. | -| elements | Array<[Constant](./firestore_.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -### strConcat(first, elements) {:#strconcat_1eb0ac1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat(Field.of("firstName"), " ", Field.of("lastName")); - -``` - -Signature: - -```typescript -export declare function strConcat(first: Constant, ...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | [Constant](./firestore_.constant.md#constant_class) | The initial string expression to concatenate to. | -| elements | Array<[Constant](./firestore_.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_.strconcat.md#strconcat_class) - -## function(indexManager, ...) - -### deleteAllPersistentCacheIndexes(indexManager) {:#deleteallpersistentcacheindexes_98b2645} - -Removes all persistent cache indexes. - -Please note this function will also deletes indexes generated by `setIndexConfiguration()`, which is deprecated. - -Signature: - -```typescript -export declare function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | - -Returns: - -void - -### disablePersistentCacheIndexAutoCreation(indexManager) {:#disablepersistentcacheindexautocreation_98b2645} - -Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling `enablePersistentCacheIndexAutoCreation()` still take effect. - -Signature: - -```typescript -export declare function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | - -Returns: - -void - -### enablePersistentCacheIndexAutoCreation(indexManager) {:#enablepersistentcacheindexautocreation_98b2645} - -Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance. - -This feature is disabled by default. - -Signature: - -```typescript -export declare function enablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | - -Returns: - -void - -## function(left, ...) - -### add(left, right) {:#add_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds two expressions together. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add(Field.of("quantity"), Field.of("reserve")); - -``` - -Signature: - -```typescript -export declare function add(left: Constant, right: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to add. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -### add(left, right) {:#add_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds an expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -add(Field.of("age"), 5); - -``` - -Signature: - -```typescript -export declare function add(left: Constant, right: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to add to. | -| right | any | The constant value to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -### add(left, right) {:#add_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a field's value to an expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add("quantity", Field.of("reserve")); - -``` - -Signature: - -```typescript -export declare function add(left: string, right: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to add to. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -### add(left, right) {:#add_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a field's value to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -add("age", 5); - -``` - -Signature: - -```typescript -export declare function add(left: string, right: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to add to. | -| right | any | The constant value to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_.add.md#add_class) - -### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} - -Compares two 'AggregateField\` instances for equality. - -Signature: - -```typescript -export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | -| right | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | - -Returns: - -boolean - -### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} - -Compares two `AggregateQuerySnapshot` instances for equality. - -Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. - -Signature: - -```typescript -export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | -| right | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | - -Returns: - -boolean - -`true` if the objects are "equal", as defined above, or `false` otherwise. - -### and(left, right) {:#and_eba7e36} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a logical 'AND' operation on multiple filter conditions. - -```typescript -// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND -// the 'status' field is "active" -const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - -Signature: - -```typescript -export declare function and(left: FilterExpr, ...right: FilterExpr[]): And; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. | - -Returns: - -[And](./firestore_.and.md#and_class) - -### divide(left, right) {:#divide_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides two expressions. - -```typescript -// Divide the 'total' field by the 'count' field -divide(Field.of("total"), Field.of("count")); - -``` - -Signature: - -```typescript -export declare function divide(left: Constant, right: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to be divided. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -### divide(left, right) {:#divide_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides an expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -divide(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function divide(left: Constant, right: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to be divided. | -| right | any | The constant value to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -### divide(left, right) {:#divide_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides a field's value by an expression. - -```typescript -// Divide the 'total' field by the 'count' field -divide("total", Field.of("count")); - -``` - -Signature: - -```typescript -export declare function divide(left: string, right: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to be divided. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -### divide(left, right) {:#divide_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides a field's value by a constant value. - -```typescript -// Divide the 'value' field by 10 -divide("value", 10); - -``` - -Signature: - -```typescript -export declare function divide(left: string, right: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to be divided. | -| right | any | The constant value to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_.divide.md#divide_class) - -### eq(left, right) {:#eq_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if two expressions are equal. - -```typescript -// Check if the 'age' field is equal to an expression -eq(Field.of("age"), Field.of("minAge").add(10)); - -``` - -Signature: - -```typescript -export declare function eq(left: Constant, right: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -### eq(left, right) {:#eq_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to a constant value. - -```typescript -// Check if the 'age' field is equal to 21 -eq(Field.of("age"), 21); - -``` - -Signature: - -```typescript -export declare function eq(left: Constant, right: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -### eq(left, right) {:#eq_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to an expression. - -```typescript -// Check if the 'age' field is equal to the 'limit' field -eq("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function eq(left: string, right: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -### eq(left, right) {:#eq_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to string constant "London" -eq("city", "London"); - -``` - -Signature: - -```typescript -export declare function eq(left: string, right: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_.eq.md#eq_class) - -### gt(left, right) {:#gt_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is greater than the second expression. - -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), Constant(9).add(9)); - -``` - -Signature: - -```typescript -export declare function gt(left: Constant, right: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -### gt(left, right) {:#gt_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is greater than a constant value. - -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), 18); - -``` - -Signature: - -```typescript -export declare function gt(left: Constant, right: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -### gt(left, right) {:#gt_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than an expression. - -```typescript -// Check if the value of field 'age' is greater than the value of field 'limit' -gt("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function gt(left: string, right: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -### gt(left, right) {:#gt_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -gt("price", 100); - -``` - -Signature: - -```typescript -export declare function gt(left: string, right: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_.gt.md#gt_class) - -### gte(left, right) {:#gte_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is greater than or equal to the second expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to the field "threshold" -gte(Field.of("quantity"), Field.of("threshold")); - -``` - -Signature: - -```typescript -export declare function gte(left: Constant, right: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -### gte(left, right) {:#gte_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is greater than or equal to a constant value. - -```typescript -// Check if the 'quantity' field is greater than or equal to 10 -gte(Field.of("quantity"), 10); - -``` - -Signature: - -```typescript -export declare function gte(left: Constant, right: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -### gte(left, right) {:#gte_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than or equal to an expression. - -```typescript -// Check if the value of field 'age' is greater than or equal to the value of field 'limit' -gte("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function gte(left: string, right: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -### gte(left, right) {:#gte_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -gte("score", 80); - -``` - -Signature: - -```typescript -export declare function gte(left: string, right: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_.gte.md#gte_class) - -### like(left, pattern) {:#like_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison against a field. - -```typescript -// Check if the 'title' field contains the string "guide" -like("title", "%guide%"); - -``` - -Signature: - -```typescript -export declare function like(left: string, pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -### like(left, pattern) {:#like_dd84184} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison against a field. - -```typescript -// Check if the 'title' field contains the string "guide" -like("title", Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function like(left: string, pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -### like(left, pattern) {:#like_3aaffe0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison. - -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), "%guide%"); - -``` - -Signature: - -```typescript -export declare function like(left: Constant, pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -### like(left, pattern) {:#like_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison. - -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function like(left: Constant, pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_.like.md#like_class) - -### logicalMax(left, right) {:#logicalmax_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: Constant, right: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | -| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: Constant, right: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | -| right | any | The right operand constant. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax("field1", Field.of('field2')); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: string, right: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax("value", 10); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: string, right: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | any | The right operand constant. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_.logicalmax.md#logicalmax_class) - -### logicalMin(left, right) {:#logicalmin_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: Constant, right: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | -| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: Constant, right: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The left operand expression. | -| right | any | The right operand constant. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin("field1", Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: string, right: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | [Constant](./firestore_.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin("value", 10); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: string, right: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | any | The right operand constant. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_.logicalmin.md#logicalmin_class) - -### lt(left, right) {:#lt_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is less than the second expression. - -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lt(left: Constant, right: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -### lt(left, right) {:#lt_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is less than a constant value. - -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), 30); - -``` - -Signature: - -```typescript -export declare function lt(left: Constant, right: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -### lt(left, right) {:#lt_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than an expression. - -```typescript -// Check if the 'age' field is less than the 'limit' field -lt("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lt(left: string, right: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -### lt(left, right) {:#lt_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -lt("price", 50); - -``` - -Signature: - -```typescript -export declare function lt(left: string, right: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_.lt.md#lt_class) - -### lte(left, right) {:#lte_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is less than or equal to the second expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lte(left: Constant, right: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -### lte(left, right) {:#lte_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is less than or equal to a constant value. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), 20); - -``` - -Signature: - -```typescript -export declare function lte(left: Constant, right: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -### lte(left, right) {:#lte_674c63f} - -Creates an expression that checks if a field's value is less than or equal to an expression. - -```typescript -// Check if the 'quantity' field is less than or equal to the 'limit' field -lte("quantity", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lte(left: string, right: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -### lte(left, right) {:#lte_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -lte("score", 70); - -``` - -Signature: - -```typescript -export declare function lte(left: string, right: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_.lte.md#lte_class) - -### mod(left, right) {:#mod_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing two expressions. - -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function mod(left: Constant, right: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The dividend expression. | -| right | [Constant](./firestore_.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -### mod(left, right) {:#mod_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. - -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod(Field.of("field1"), 5); - -``` - -Signature: - -```typescript -export declare function mod(left: Constant, right: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The dividend expression. | -| right | any | The divisor constant. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -### mod(left, right) {:#mod_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. - -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod("field1", Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function mod(left: string, right: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The dividend field name. | -| right | [Constant](./firestore_.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -### mod(left, right) {:#mod_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. - -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod("field1", 5); - -``` - -Signature: - -```typescript -export declare function mod(left: string, right: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The dividend field name. | -| right | any | The divisor constant. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_.mod.md#mod_class) - -### multiply(left, right) {:#multiply_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies two expressions together. - -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply(Field.of("quantity"), Field.of("price")); - -``` - -Signature: - -```typescript -export declare function multiply(left: Constant, right: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to multiply. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to multiply. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies an expression by a constant value. - -```typescript -// Multiply the value of the 'price' field by 2 -multiply(Field.of("price"), 2); - -``` - -Signature: - -```typescript -export declare function multiply(left: Constant, right: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply. | -| right | any | The constant value to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies a field's value by an expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply("quantity", Field.of("price")); - -``` - -Signature: - -```typescript -export declare function multiply(left: string, right: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to multiply. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies a field's value by a constant value. - -```typescript -// Multiply the 'value' field by 2 -multiply("value", 2); - -``` - -Signature: - -```typescript -export declare function multiply(left: string, right: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to multiply. | -| right | any | The constant value to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_.multiply.md#multiply_class) - -### neq(left, right) {:#neq_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if two expressions are not equal. - -```typescript -// Check if the 'status' field is not equal to field 'finalState' -neq(Field.of("status"), Field.of("finalState")); - -``` - -Signature: - -```typescript -export declare function neq(left: Constant, right: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The second expression to compare. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_.neq.md#neq_class) - -### neq(left, right) {:#neq_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +| Type Alias | Description | +| --- | --- | +| [AddPrefixToKeys](./firestore_.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | +| [AggregateFieldType](./firestore_.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | +| [AggregateSpecData](./firestore_.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | +| [AggregateType](./firestore_.md#aggregatetype) | Union type representing the aggregate type to be performed. | +| [ChildUpdateFields](./firestore_.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | +| [DocumentChangeType](./firestore_.md#documentchangetype) | The type of a DocumentChange may be 'added', 'removed', or 'modified'. | +| [FirestoreErrorCode](./firestore_.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | +| [FirestoreLocalCache](./firestore_.md#firestorelocalcache) | Union type from all supported SDK cache layer. | +| [ListenSource](./firestore_.md#listensource) | Describe the source a query listens to.Set to default to listen to both cache and server changes. Set to cache to listen to changes in cache only. | +| [MemoryGarbageCollector](./firestore_.md#memorygarbagecollector) | Union type from all support garbage collectors for memory local cache. | +| [NestedUpdateFields](./firestore_.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | +| [OrderByDirection](./firestore_.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | +| [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | +| [PersistentTabManager](./firestore_.md#persistenttabmanager) | A union of all available tab managers. | +| [Primitive](./firestore_.md#primitive) | Primitive types. | +| [QueryConstraintType](./firestore_.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | +| [QueryFilterConstraint](./firestore_.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | +| [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | +| [SetOptions](./firestore_.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | +| [TaskState](./firestore_.md#taskstate) | Represents the state of bundle loading tasks.Both 'Error' and 'Success' are sinking state: task will abort or complete and there will be no more updates after they are reported. | +| [UnionToIntersection](./firestore_.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | +| [UpdateData](./firestore_.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | +| [WhereFilterOp](./firestore_.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | +| [WithFieldValue](./firestore_.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | -Creates an expression that checks if an expression is not equal to a constant value. +## function(app, ...) -```typescript -// Check if the 'status' field is not equal to "completed" -neq(Field.of("status"), "completed"); +### getFirestore(app) {:#getfirestore_cf608e1} -``` +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function neq(left: Constant, right: any): Neq; +export declare function getFirestore(app: FirebaseApp): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | Returns: -[Neq](./firestore_.neq.md#neq_class) - -### neq(left, right) {:#neq_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to an expression. - -```typescript -// Check if the 'status' field is not equal to the value of 'expectedStatus' -neq("status", Field.of("expectedStatus")); - -``` - -Signature: - -```typescript -export declare function neq(left: string, right: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to compare to. A new Expr representing the inequality comparison. | - -Returns: +[Firestore](./firestore_.firestore.md#firestore_class) -[Neq](./firestore_.neq.md#neq_class) +The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. -### neq(left, right) {:#neq_1f46a76} +### getFirestore(app, databaseId) {:#getfirestore_48de6cb} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an expression that checks if a field's value is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -neq("country", "USA"); - -``` +Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function neq(left: string, right: any): Neq; +export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| databaseId | string | The name of the database. | Returns: -[Neq](./firestore_.neq.md#neq_class) - -### or(left, right) {:#or_eba7e36} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[Firestore](./firestore_.firestore.md#firestore_class) -Creates an expression that performs a logical 'OR' operation on multiple filter conditions. +The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. -```typescript -// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR -// the 'status' field is "active" -const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); +### initializeFirestore(app, settings, databaseId) {:#initializefirestore_fc7d200} -``` +Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). Signature: ```typescript -export declare function or(left: FilterExpr, ...right: FilterExpr[]): Or; +export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the [Firestore](./firestore_.firestore.md#firestore_class) instance will be associated. | +| settings | [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | A settings object to configure the [Firestore](./firestore_.firestore.md#firestore_class) instance. | +| databaseId | string | The name of the database. | Returns: -[Or](./firestore_.or.md#or_class) - -### queryEqual(left, right) {:#queryequal_7a1f045} - -Returns true if the provided queries point to the same collection and apply the same constraints. - -Signature: - -```typescript -export declare function queryEqual(left: Query, right: Query): boolean; -``` - -#### Parameters +[Firestore](./firestore_.firestore.md#firestore_class) -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | -| right | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +A newly initialized [Firestore](./firestore_.firestore.md#firestore_class) instance. -Returns: +## function(firestore, ...) -boolean +### clearIndexedDbPersistence(firestore) {:#clearindexeddbpersistence_231a8e0} -true if the references point to the same location in the same Firestore database. +Clears the persistent storage. This includes pending writes and cached documents. -### refEqual(left, right) {:#refequal_598b780} +Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of `failed-precondition`. -Returns true if the provided references are equal. +Note: `clearIndexedDbPersistence()` is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. Signature: ```typescript -export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; +export declare function clearIndexedDbPersistence(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | -| right | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to clear persistence for. | Returns: -boolean - -true if the references point to the same location in the same Firestore database. - -### regexContains(left, pattern) {:#regexcontains_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a string field contains a specified regular expression as a substring. +A `Promise` that is resolved when the persistent storage is cleared. Otherwise, the promise is rejected with an error. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", "(?i)example"); +### collection(firestore, path, pathSegments) {:#collection_1eb4c23} -``` +Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. Signature: ```typescript -export declare function regexContains(left: string, pattern: string): RegexContains; +export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -### regexContains(left, pattern) {:#regexcontains_dd84184} +The `CollectionReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that checks if a string field contains a specified regular expression as a substring. +If the final path has an even number of segments and does not point to a collection. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", Field.of("pattern")); +### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} -``` +Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. Signature: ```typescript -export declare function regexContains(left: string, pattern: Constant): RegexContains; +export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | Returns: -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -### regexContains(left, pattern) {:#regexcontains_3aaffe0} +[Query](./firestore_.query.md#query_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +The created `Query`. -Creates an expression that checks if a string expression contains a specified regular expression as a substring. +### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), "(?i)example"); +Modify this instance to communicate with the Cloud Firestore emulator. -``` +Note: This must be called before this instance has been used to do any operations. Signature: ```typescript -export declare function regexContains(left: Constant, pattern: string): RegexContains; +export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { + mockUserToken?: EmulatorMockTokenOptions | string; +}): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | +| host | string | the emulator host (ex: localhost). | +| port | number | the emulator port (ex: 9000). | +| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | Returns: -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -### regexContains(left, pattern) {:#regexcontains_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression contains a specified regular expression as a substring. +void -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), Field.of("pattern")); +### disableNetwork(firestore) {:#disablenetwork_231a8e0} -``` +Disables network usage for this instance. It can be re-enabled via [enableNetwork()](./firestore_.md#enablenetwork_231a8e0). While the network is disabled, any snapshot listeners, `getDoc()` or `getDocs()` calls will return results from cache, and any write operations will be queued until the network is restored. Signature: ```typescript -export declare function regexContains(left: Constant, pattern: Constant): RegexContains; +export declare function disableNetwork(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -[RegexContains](./firestore_.regexcontains.md#regexcontains_class) - -### regexMatch(left, pattern) {:#regexmatch_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a string field matches a specified regular expression. +A `Promise` that is resolved once the network has been disabled. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); +### doc(firestore, path, pathSegments) {:#doc_1eb4c23} -``` +Gets a `DocumentReference` instance that refers to the document at the specified absolute path. Signature: ```typescript -export declare function regexMatch(left: string, pattern: string): RegexMatch; +export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -### regexMatch(left, pattern) {:#regexmatch_dd84184} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", Field.of("pattern")); - -``` +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -Signature: +The `DocumentReference` instance. -```typescript -export declare function regexMatch(left: string, pattern: Constant): RegexMatch; -``` +#### Exceptions -#### Parameters +If the final path has an odd number of segments and does not point to a document. -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | +### enableIndexedDbPersistence(firestore, persistenceSettings) {:#enableindexeddbpersistence_224174f} -Returns: +> Warning: This API is now obsolete. +> +> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. +> -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) +Attempts to enable persistent storage, if possible. -### regexMatch(left, pattern) {:#regexmatch_3aaffe0} +On failure, `enableIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +\* failed-precondition: The app is already open in another browser tab. \* unimplemented: The browser is incompatible with the offline persistence implementation. -Creates an expression that checks if a string expression matches a specified regular expression. +Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); +Note: `enableIndexedDbPersistence()` must be called before any other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200), [getFirestore()](./firestore_.md#getfirestore) or [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0). -``` +Persistence cannot be used in a Node.js environment. Signature: ```typescript -export declare function regexMatch(left: Constant, pattern: string): RegexMatch; +export declare function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to match against. | -| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | +| persistenceSettings | [PersistenceSettings](./firestore_.persistencesettings.md#persistencesettings_interface) | Optional settings object to configure persistence. | Returns: -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) - -### regexMatch(left, pattern) {:#regexmatch_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), Field.of("pattern")); - -``` - -Signature: +Promise<void> -```typescript -export declare function regexMatch(left: Constant, pattern: Constant): RegexMatch; -``` +A `Promise` that represents successfully enabling persistent storage. -#### Parameters +### enableMultiTabIndexedDbPersistence(firestore) {:#enablemultitabindexeddbpersistence_231a8e0} -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to match against. | -| pattern | [Constant](./firestore_.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | +> Warning: This API is now obsolete. +> +> This function will be removed in a future major release. Instead, set `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` is already specified will throw an exception. +> -Returns: +Attempts to enable multi-tab persistent storage, if possible. If enabled across all tabs, all operations share access to local persistence, including shared execution of queries and latency-compensated local document updates across all connected instances. -[RegexMatch](./firestore_.regexmatch.md#regexmatch_class) +On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the `code` on the error. -### snapshotEqual(left, right) {:#snapshotequal_5109204} +\* failed-precondition: The app is already open in another browser tab and multi-tab is not enabled. \* unimplemented: The browser is incompatible with the offline persistence implementation. -Returns true if the provided snapshots are equal. +Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. Signature: ```typescript -export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; +export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | -| right | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable persistence for. | Returns: -boolean - -true if the snapshots are equal. - -### strContains(left, substring) {:#strcontains_18eaf5d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a string field contains a specified substring. +A `Promise` that represents successfully enabling persistent storage. -```typescript -// Check if the 'description' field contains "example". -strContains("description", "example"); +### enableNetwork(firestore) {:#enablenetwork_231a8e0} -``` +Re-enables use of the network for this [Firestore](./firestore_.firestore.md#firestore_class) instance after a prior call to [disableNetwork()](./firestore_.md#disablenetwork_231a8e0). Signature: ```typescript -export declare function strContains(left: string, substring: string): StrContains; +export declare function enableNetwork(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| substring | string | The substring to search for. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -[StrContains](./firestore_.strcontains.md#strcontains_class) - -### strContains(left, substring) {:#strcontains_f0f1f2f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a string field contains a substring specified by an expression. +A `Promise` that is resolved once the network has been enabled. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains("description", Field.of("keyword")); +### getPersistentCacheIndexManager(firestore) {:#getpersistentcacheindexmanager_231a8e0} -``` +Returns the PersistentCache Index Manager used by the given `Firestore` object. + + The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use. Signature: ```typescript -export declare function strContains(left: string, substring: Constant): StrContains; +export declare function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| substring | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -[StrContains](./firestore_.strcontains.md#strcontains_class) - -### strContains(left, substring) {:#strcontains_5fdbd29} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression contains a specified substring. +[PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) \| null -```typescript -// Check if the 'description' field contains "example". -strContains(Field.of("description"), "example"); +### loadBundle(firestore, bundleData) {:#loadbundle_bec5b75} -``` +Loads a Firestore bundle into the local cache. Signature: ```typescript -export declare function strContains(left: Constant, substring: string): StrContains; +export declare function loadBundle(firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string): LoadBundleTask; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| substring | string | The substring to search for. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to load bundles for. | +| bundleData | ReadableStream<Uint8Array> \| ArrayBuffer \| string | An object representing the bundle to be loaded. Valid objects are ArrayBuffer, ReadableStream<Uint8Array> or string. | Returns: -[StrContains](./firestore_.strcontains.md#strcontains_class) - -### strContains(left, substring) {:#strcontains_d9d749f} +[LoadBundleTask](./firestore_.loadbundletask.md#loadbundletask_class) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A `LoadBundleTask` object, which notifies callers with progress updates, and completion or error events. It can be used as a `Promise`. -Creates an expression that checks if a string expression contains a substring specified by another expression. +### namedQuery(firestore, name) {:#namedquery_6438876} -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains(Field.of("description"), Field.of("keyword")); +Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name. -``` +The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using `loadBundle`. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. Signature: ```typescript -export declare function strContains(left: Constant, substring: Constant): StrContains; +export declare function namedQuery(firestore: Firestore, name: string): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| substring | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to read the query from. | +| name | string | The name of the query. | Returns: -[StrContains](./firestore_.strcontains.md#strcontains_class) - -### subtract(left, right) {:#subtract_be96f75} +Promise<[Query](./firestore_.query.md#query_class) \| null> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A `Promise` that is resolved with the Query or `null`. -Creates an expression that subtracts two expressions. +### onSnapshotsInSync(firestore, observer) {:#onsnapshotsinsync_2f0dfa4} -```typescript -// Subtract the 'discount' field from the 'price' field -subtract(Field.of("price"), Field.of("discount")); +Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. -``` +NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. Signature: ```typescript -export declare function subtract(left: Constant, right: Constant): Subtract; +export declare function onSnapshotsInSync(firestore: Firestore, observer: { + next?: (value: void) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The instance of Firestore for synchronizing snapshots. | +| observer | { next?: (value: void) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -[Subtract](./firestore_.subtract.md#subtract_class) - -### subtract(left, right) {:#subtract_010ba9e} +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +An unsubscribe function that can be called to cancel the snapshot listener. -Creates an expression that subtracts a constant value from an expression. +### onSnapshotsInSync(firestore, onSync) {:#onsnapshotsinsync_1901c06} -```typescript -// Subtract the constant value 2 from the 'value' field -subtract(Field.of("value"), 2); +Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. -``` +NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use `SnapshotMetadata` in the individual listeners to determine if a snapshot is from the cache or the server. Signature: ```typescript -export declare function subtract(left: Constant, right: any): Subtract; +export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract from. | -| right | any | The constant value to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The Firestore instance for synchronizing snapshots. | +| onSync | () => void | A callback to be called every time all snapshot listeners are in sync with each other. | Returns: -[Subtract](./firestore_.subtract.md#subtract_class) - -### subtract(left, right) {:#subtract_674c63f} +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +An unsubscribe function that can be called to cancel the snapshot listener. -Creates an expression that subtracts an expression from a field's value. +### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} -```typescript -// Subtract the 'discount' field from the 'price' field -subtract("price", Field.of("discount")); +Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. -``` +The maximum number of writes allowed in a single transaction is 500. Signature: ```typescript -export declare function subtract(left: string, right: Constant): Subtract; +export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The field name to subtract from. | -| right | [Constant](./firestore_.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | +| updateFunction | (transaction: [Transaction](./firestore_.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | +| options | [TransactionOptions](./firestore_.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | Returns: -[Subtract](./firestore_.subtract.md#subtract_class) +Promise<T> + +If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. -### subtract(left, right) {:#subtract_1f46a76} +### setIndexConfiguration(firestore, configuration) {:#setindexconfiguration_c362f04} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an expression that subtracts a constant value from a field's value. +> Warning: This API is now obsolete. +> +> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. +> -```typescript -// Subtract 20 from the value of the 'total' field -subtract("total", 20); +Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. -``` +The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. + +Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. Signature: ```typescript -export declare function subtract(left: string, right: any): Subtract; +export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The field name to subtract from. | -| right | any | The constant value to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | +| configuration | [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | The index definition. | Returns: -[Subtract](./firestore_.subtract.md#subtract_class) +Promise<void> + +A `Promise` that resolves once all indices are successfully configured. + +#### Exceptions + +FirestoreError if the JSON format is invalid. -### xor(left, right) {:#xor_eba7e36} +### setIndexConfiguration(firestore, json) {:#setindexconfiguration_90d0285} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. +> Warning: This API is now obsolete. +> +> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally. +> -```typescript -// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", -// or 'status' is "active". -const condition = xor( - gt("age", 18), - eq("city", "London"), - eq("status", "active")); +Configures indexing for local query execution. Any previous index configuration is overridden. The `Promise` resolves once the index configuration has been persisted. -``` +The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written. + +Indexes are only supported with IndexedDb persistence. Invoke either `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored. + +The method accepts the JSON format exported by the Firebase CLI (`firebase firestore:indexes`). If the JSON format is invalid, this method throws an error. Signature: ```typescript -export declare function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; +export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [FilterExpr](./firestore_.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_.md#filterexpr)\[\] | Additional filter conditions to 'XOR' together. A new representing the logical 'XOR' operation. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to configure indexes for. | +| json | string | The JSON format exported by the Firebase CLI. | Returns: -[Xor](./firestore_.xor.md#xor_class) +Promise<void> + +A `Promise` that resolves once all indices are successfully configured. -## function(limit, ...) +#### Exceptions -### limit(limit) {:#limit_ec46c78} +FirestoreError if the JSON format is invalid. -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. +### terminate(firestore) {:#terminate_231a8e0} + +Terminates the provided [Firestore](./firestore_.firestore.md#firestore_class) instance. + +After calling `terminate()` only the `clearIndexedDbPersistence()` function may be used. Any other function will throw a `FirestoreError`. + +To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.md#getfirestore). + +Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. If you have persistence enabled, the next time you start this instance, it will resume sending these writes to the server. + +Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with `clearIndexedDbPersistence()` to ensure that all local state is destroyed between test runs. Signature: ```typescript -export declare function limit(limit: number): QueryLimitConstraint; +export declare function terminate(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) +Promise<void> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +A `Promise` that is resolved when the instance has been successfully terminated. -### limitToLast(limit) {:#limittolast_ec46c78} +### waitForPendingWrites(firestore) {:#waitforpendingwrites_231a8e0} -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. +Waits until all currently pending writes for the active user have been acknowledged by the backend. -You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. +The returned promise resolves immediately if there are no outstanding writes. Otherwise, the promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call `waitForPendingWrites()` again. + +Any outstanding `waitForPendingWrites()` promises are rejected during user changes. Signature: ```typescript -export declare function limitToLast(limit: number): QueryLimitConstraint; +export declare function waitForPendingWrites(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) +Promise<void> -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +A `Promise` which resolves when all currently pending writes have been acknowledged by the backend. -## function(logLevel, ...) +### writeBatch(firestore) {:#writebatch_231a8e0} -### setLogLevel(logLevel) {:#setloglevel_d02fda2} +Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500. -Sets the verbosity of Cloud Firestore logs (debug, error, or silent). +Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. Signature: ```typescript -export declare function setLogLevel(logLevel: LogLevel): void; +export declare function writeBatch(firestore: Firestore): WriteBatch; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:

  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | | Returns: -void - -## function(mapExpr, ...) - -### mapGet(mapExpr, subField) {:#mapget_9715f90} +[WriteBatch](./firestore_.writebatch.md#writebatch_class) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A [WriteBatch](./firestore_.writebatch.md#writebatch_class) that can be used to atomically execute multiple writes. -Accesses a value from a map (object) expression using the provided key. +## function() -```typescript -// Get the 'city' value from the 'address' map field -mapGet(Field.of("address"), "city"); +### count() {:#count} -``` +Create an AggregateField object that can be used to compute the count of documents in the result set of a query. Signature: ```typescript -export declare function mapGet(mapExpr: Constant, subField: string): MapGet; +export declare function count(): AggregateField; ``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| mapExpr | [Constant](./firestore_.constant.md#constant_class) | The expression representing the map. | -| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | - Returns: -[MapGet](./firestore_.mapget.md#mapget_class) - -## function(mapField, ...) +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> -### mapGet(mapField, subField) {:#mapget_b37bbb6} +### deleteField() {:#deletefield} -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. -Accesses a value from a map (object) field using the provided key. +Signature: ```typescript -// Get the 'city' value from the 'address' map field -mapGet("address", "city"); - +export declare function deleteField(): FieldValue; ``` +Returns: + +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) + +### documentId() {:#documentid} + +Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. Signature: ```typescript -export declare function mapGet(mapField: string, subField: string): MapGet; +export declare function documentId(): FieldPath; ``` +Returns: -#### Parameters +[FieldPath](./firestore_.fieldpath.md#fieldpath_class) -| Parameter | Type | Description | -| --- | --- | --- | -| mapField | string | The field name of the map field. | -| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | +### getFirestore() {:#getfirestore} -Returns: +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. -[MapGet](./firestore_.mapget.md#mapget_class) +Signature: -## function(n, ...) +```typescript +export declare function getFirestore(): Firestore; +``` +Returns: -### increment(n) {:#increment_5685735} +[Firestore](./firestore_.firestore.md#firestore_class) -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. +The default [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. -If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. +### memoryEagerGarbageCollector() {:#memoryeagergarbagecollector} -If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. +Creates an instance of `MemoryEagerGarbageCollector`. This is also the default garbage collector unless it is explicitly specified otherwise. Signature: ```typescript -export declare function increment(n: number): FieldValue; +export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; ``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| n | number | The value to increment by. | - Returns: -[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) +[MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` +### persistentMultipleTabManager() {:#persistentmultipletabmanager} -## function(name, ...) +Creates an instance of `PersistentMultipleTabManager`. -### genericFunction(name, params) {:#genericfunction_b886545} +Signature: -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +```typescript +export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; +``` +Returns: -Creates functions that work on the backend but do not exist in the SDK yet. +[PersistentMultipleTabManager](./firestore_.persistentmultipletabmanager.md#persistentmultipletabmanager_interface) -```typescript -// Call a user defined function named "myFunc" with the arguments 10 and 20 -// This is the same of the 'sum(Field.of("price"))', if it did not exist -genericFunction("sum", [Field.of("price")]); +### serverTimestamp() {:#servertimestamp} -``` +Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. Signature: ```typescript -export declare function genericFunction(name: string, params: Constant[]): FirestoreFunction; +export declare function serverTimestamp(): FieldValue; ``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The name of the user defined function. | -| params | [Constant](./firestore_.constant.md#constant_class)\[\] | The arguments to pass to the function. A new representing the function call. | - Returns: -[FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) -## function(pipeline, ...) +## function(databaseId, ...) -### execute(pipeline) {:#execute_86486e6} +### getFirestore(databaseId) {:#getfirestore_53dc891} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Modular API for console experimentation. +Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function execute(pipeline: Pipeline): Promise>>; +export declare function getFirestore(databaseId: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| pipeline | [Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> | Execute this pipeline. | +| databaseId | string | The name of the database. | Returns: -Promise<Array<[PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class)<AppModelType>>> - -## function(query, ...) +[Firestore](./firestore_.firestore.md#firestore_class) -### getAggregateFromServer(query, aggregateSpec) {:#getaggregatefromserver_2073a74} +The named [Firestore](./firestore_.firestore.md#firestore_class) instance of the default app. -Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. +## function(elements, ...) -Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +### arrayRemove(elements) {:#arrayremove_7d853aa} -The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. +Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. Signature: ```typescript -export declare function getAggregateFromServer(query: Query, aggregateSpec: AggregateSpecType): Promise>; +export declare function arrayRemove(...elements: unknown[]): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | -| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | +| elements | unknown\[\] | The elements to remove from the array. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> - -### Example - - -```typescript -const aggregateSnapshot = await getAggregateFromServer(query, { - countOfDocs: count(), - totalHours: sum('hours'), - averageScore: average('score') -}); - -const countOfDocs: number = aggregateSnapshot.data().countOfDocs; -const totalHours: number = aggregateSnapshot.data().totalHours; -const averageScore: number | null = aggregateSnapshot.data().averageScore; - -``` - -### getCountFromServer(query) {:#getcountfromserver_4e56953} +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) -Calculates the number of documents in the result set of the given query without actually downloading the documents. +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +### arrayUnion(elements) {:#arrayunion_7d853aa} -The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. Signature: ```typescript -export declare function getCountFromServer(query: Query): Promise; -}, AppModelType, DbModelType>>; +export declare function arrayUnion(...elements: unknown[]): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | +| elements | unknown\[\] | The elements to union into the array. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) -A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. -### getDocs(query) {:#getdocs_4e56953} +## function(field, ...) -Executes the query and returns the results as a `QuerySnapshot`. +### average(field) {:#average_aacc3a9} -Note: `getDocs()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). +Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. Signature: ```typescript -export declare function getDocs(query: Query): Promise>; +export declare function average(field: string | FieldPath): AggregateField; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> - -A `Promise` that will be resolved with the results of the query. +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number \| null> -### getDocsFromCache(query) {:#getdocsfromcache_4e56953} +### sum(field) {:#sum_aacc3a9} -Executes the query and returns the results as a `QuerySnapshot` from cache. Returns an empty result set if no documents matching the query are currently cached. +Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. Signature: ```typescript -export declare function getDocsFromCache(query: Query): Promise>; +export declare function sum(field: string | FieldPath): AggregateField; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> +[AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number> -A `Promise` that will be resolved with the results of the query. +## function(fieldPath, ...) -### getDocsFromServer(query) {:#getdocsfromserver_4e56953} +### orderBy(fieldPath, directionStr) {:#orderby_006d61f} -Executes the query and returns the results as a `QuerySnapshot` from the server. Returns an error if the network is not available. +Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. + +Note: Documents that do not contain the specified field will not be present in the query result. Signature: ```typescript -export declare function getDocsFromServer(query: Query): Promise>; +export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | +| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The field to sort by. | +| directionStr | [OrderByDirection](./firestore_.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | Returns: -Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> - -A `Promise` that will be resolved with the results of the query. +[QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) -### onSnapshot(query, observer) {:#onsnapshot_8d14049} +The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### where(fieldPath, opStr, value) {:#where_0fae4bf} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. Signature: ```typescript -export declare function onSnapshot(query: Query, observer: { - next?: (snapshot: QuerySnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The path to compare | +| opStr | [WhereFilterOp](./firestore_.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | +| value | unknown | The value for comparison | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) -An unsubscribe function that can be called to cancel the snapshot listener. +The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). -### onSnapshot(query, options, observer) {:#onsnapshot_03dfff5} +## function(fieldValues, ...) -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### endAt(fieldValues) {:#endat_8b2f2c8} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function onSnapshot(query: Query, options: SnapshotListenOptions, observer: { - next?: (snapshot: QuerySnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -### onSnapshot(query, onNext, onError, onCompletion) {:#onsnapshot_3ebfbe2} +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### endBefore(fieldValues) {:#endbefore_8b2f2c8} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function onSnapshot(query: Query, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -### onSnapshot(query, options, onNext, onError, onCompletion) {:#onsnapshot_b8f9c47} +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. +### startAfter(fieldValues) {:#startafter_8b2f2c8} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function onSnapshot(query: Query, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) -An unsubscribe function that can be called to cancel the snapshot listener. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -### pipeline(query) {:#pipeline_20b2416} +### startAt(fieldValues) {:#startat_8b2f2c8} -Experimental Modular API for console testing. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function pipeline(query: Query): Pipeline; +export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class) | | +| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | Returns: -[Pipeline](./firestore_.pipeline.md#pipeline_class) +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) -### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +## function(indexManager, ...) + +### deleteAllPersistentCacheIndexes(indexManager) {:#deleteallpersistentcacheindexes_98b2645} + +Removes all persistent cache indexes. + +Please note this function will also deletes indexes generated by `setIndexConfiguration()`, which is deprecated. Signature: ```typescript -export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; +export declare function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| compositeFilter | [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using or . | -| queryConstraints | [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | Returns: -[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions - -if any of the provided query constraints cannot be combined with the existing or new constraints. +void -### query(query, queryConstraints) {:#query_0f46da1} +### disablePersistentCacheIndexAutoCreation(indexManager) {:#disablepersistentcacheindexautocreation_98b2645} -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling `enablePersistentCacheIndexAutoCreation()` still take effect. Signature: ```typescript -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; +export declare function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| queryConstraints | [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | Returns: -[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions - -if any of the provided query constraints cannot be combined with the existing or new constraints. +void -## function(queryConstraints, ...) +### enablePersistentCacheIndexAutoCreation(indexManager) {:#enablepersistentcacheindexautocreation_98b2645} -### and(queryConstraints) {:#and_e72c712} +Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improve performance. -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. +This feature is disabled by default. Signature: ```typescript -export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function enablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | +| indexManager | [PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) | | Returns: -[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) +void -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +## function(left, ...) -### or(queryConstraints) {:#or_e72c712} +### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. +Compares two 'AggregateField\` instances for equality. Signature: ```typescript -export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | +| left | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | +| right | [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | Returns: -[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) - -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +boolean -## function(reference, ...) +### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} -### addDoc(reference, data) {:#adddoc_6e783ff} +Compares two `AggregateQuerySnapshot` instances for equality. -Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. +Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. Signature: ```typescript -export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | -| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | +| left | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | +| right | [AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | Returns: -Promise<[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType>> +boolean -A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend (Note that it won't resolve while you're offline). +`true` if the objects are "equal", as defined above, or `false` otherwise. -### collection(reference, path, pathSegments) {:#collection_568f98d} +### queryEqual(left, right) {:#queryequal_7a1f045} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Returns true if the provided queries point to the same collection and apply the same constraints. Signature: ```typescript -export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function queryEqual(left: Query, right: Query): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| left | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| right | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | Returns: -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions +boolean -If the final path has an even number of segments and does not point to a collection. +true if the references point to the same location in the same Firestore database. -### collection(reference, path, pathSegments) {:#collection_70b4396} +### refEqual(left, right) {:#refequal_598b780} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Returns true if the provided references are equal. Signature: ```typescript -export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| right | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | Returns: -[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions +boolean -If the final path has an even number of segments and does not point to a collection. +true if the references point to the same location in the same Firestore database. -### deleteDoc(reference) {:#deletedoc_4569087} +### snapshotEqual(left, right) {:#snapshotequal_5109204} -Deletes the document referred to by the specified `DocumentReference`. +Returns true if the provided snapshots are equal. Signature: ```typescript -export declare function deleteDoc(reference: DocumentReference): Promise; +export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | +| left | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| right | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | Returns: -Promise<void> +boolean -A Promise resolved once the document has been successfully deleted from the backend (note that it won't resolve while you're offline). +true if the snapshots are equal. -### doc(reference, path, pathSegments) {:#doc_568f98d} +## function(limit, ...) -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. +### limit(limit) {:#limit_ec46c78} + +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. Signature: ```typescript -export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; +export declare function limit(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| limit | number | The maximum number of items to return. | Returns: -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> - -The `DocumentReference` instance. +[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) -#### Exceptions +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -If the final path has an odd number of segments and does not point to a document. +### limitToLast(limit) {:#limittolast_ec46c78} -### doc(reference, path, pathSegments) {:#doc_70b4396} +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. +You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. Signature: ```typescript -export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; +export declare function limitToLast(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| limit | number | The maximum number of items to return. | Returns: -[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. - -#### Exceptions +[QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) -If the final path has an odd number of segments and does not point to a document. +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -### getDoc(reference) {:#getdoc_4569087} +## function(logLevel, ...) -Reads the document referred to by this `DocumentReference`. +### setLogLevel(logLevel) {:#setloglevel_d02fda2} -Note: `getDoc()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). +Sets the verbosity of Cloud Firestore logs (debug, error, or silent). Signature: ```typescript -export declare function getDoc(reference: DocumentReference): Promise>; +export declare function setLogLevel(logLevel: LogLevel): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | +| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:
  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +void -A Promise resolved with a `DocumentSnapshot` containing the current document contents. +## function(n, ...) -### getDocFromCache(reference) {:#getdocfromcache_4569087} +### increment(n) {:#increment_5685735} -Reads the document referred to by this `DocumentReference` from cache. Returns an error if the document is not currently cached. +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. + +If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. + +If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. Signature: ```typescript -export declare function getDocFromCache(reference: DocumentReference): Promise>; +export declare function increment(n: number): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | +| n | number | The value to increment by. | Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +[FieldValue](./firestore_.fieldvalue.md#fieldvalue_class) -A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -### getDocFromServer(reference) {:#getdocfromserver_4569087} +## function(query, ...) -Reads the document referred to by this `DocumentReference` from the server. Returns an error if the network is not available. +### getAggregateFromServer(query, aggregateSpec) {:#getaggregatefromserver_2073a74} + +Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. + +Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). + +The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. Signature: ```typescript -export declare function getDocFromServer(reference: DocumentReference): Promise>; +export declare function getAggregateFromServer(query: Query, aggregateSpec: AggregateSpecType): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | +| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | Returns: -Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> -A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. +### Example -### onSnapshot(reference, observer) {:#onsnapshot_0312fd7} -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +```typescript +const aggregateSnapshot = await getAggregateFromServer(query, { + countOfDocs: count(), + totalHours: sum('hours'), + averageScore: average('score') +}); -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +const countOfDocs: number = aggregateSnapshot.data().countOfDocs; +const totalHours: number = aggregateSnapshot.data().totalHours; +const averageScore: number | null = aggregateSnapshot.data().averageScore; + +``` + +### getCountFromServer(query) {:#getcountfromserver_4e56953} + +Calculates the number of documents in the result set of the given query without actually downloading the documents. + +Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). + +The result received from the server is presented, unaltered, without considering any local state. That is, documents in the local cache are not taken into consideration, neither are local modifications not yet synchronized with the server. Previously-downloaded results, if any, are not used. Every invocation of this function necessarily involves a round trip to the server. Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, observer: { - next?: (snapshot: DocumentSnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function getCountFromServer(query: Query): Promise; +}, AppModelType, DbModelType>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +Promise<[AggregateQuerySnapshot](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> -An unsubscribe function that can be called to cancel the snapshot listener. +A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. -### onSnapshot(reference, options, observer) {:#onsnapshot_86b6b9e} +### getDocs(query) {:#getdocs_4e56953} -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +Executes the query and returns the results as a `QuerySnapshot`. -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Note: `getDocs()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocsFromCache()](./firestore_.md#getdocsfromcache_4e56953) or [getDocsFromServer()](./firestore_.md#getdocsfromserver_4e56953). Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, observer: { - next?: (snapshot: DocumentSnapshot) => void; - error?: (error: FirestoreError) => void; - complete?: () => void; -}): Unsubscribe; +export declare function getDocs(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -### onSnapshot(reference, onNext, onError, onCompletion) {:#onsnapshot_905f42c} +A `Promise` that will be resolved with the results of the query. -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +### getDocsFromCache(query) {:#getdocsfromcache_4e56953} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Executes the query and returns the results as a `QuerySnapshot` from cache. Returns an empty result set if no documents matching the query are currently cached. Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function getDocsFromCache(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) - -An unsubscribe function that can be called to cancel the snapshot listener. +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -### onSnapshot(reference, options, onNext, onError, onCompletion) {:#onsnapshot_0c39991} +A `Promise` that will be resolved with the results of the query. -Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. +### getDocsFromServer(query) {:#getdocsfromserver_4e56953} -NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. +Executes the query and returns the results as a `QuerySnapshot` from the server. Returns an error if the network is not available. Signature: ```typescript -export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +export declare function getDocsFromServer(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | -| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | -| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | -| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | -| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | | Returns: -[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) +Promise<[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -An unsubscribe function that can be called to cancel the snapshot listener. +A `Promise` that will be resolved with the results of the query. -### setDoc(reference, data) {:#setdoc_ee215ad} +### onSnapshot(query, observer) {:#onsnapshot_8d14049} -Writes to the document referred to by this `DocumentReference`. If the document does not yet exist, it will be created. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; +export declare function onSnapshot(query: Query, observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -Promise<void> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +### onSnapshot(query, options, observer) {:#onsnapshot_03dfff5} -### setDoc(reference, data, options) {:#setdoc_ff80739} +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; +export declare function onSnapshot(query: Query, options: SnapshotListenOptions, observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | -| options | [SetOptions](./firestore_.md#setoptions) | An object to configure the set behavior. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next?: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -Promise<void> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +An unsubscribe function that can be called to cancel the snapshot listener. -### updateDoc(reference, data) {:#updatedoc_51a65e3} +### onSnapshot(query, onNext, onError, onCompletion) {:#onsnapshot_3ebfbe2} -Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; +export declare function onSnapshot(query: Query, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| data | [UpdateData](./firestore_.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -Promise<void> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +An unsubscribe function that can be called to cancel the snapshot listener. -### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} +### onSnapshot(query, options, onNext, onError, onCompletion) {:#onsnapshot_b8f9c47} -Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. +Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. -Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +export declare function onSnapshot(query: Query, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The first field to update. | -| value | unknown | The first value. | -| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The query to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -## function(settings, ...) +An unsubscribe function that can be called to cancel the snapshot listener. -### memoryLocalCache(settings) {:#memorylocalcache_05f4bf2} +### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} -Creates an instance of `MemoryLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function memoryLocalCache(settings?: MemoryCacheSettings): MemoryLocalCache; +export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| compositeFilter | [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using [and()](./firestore_.md#and_e72c712) or [or()](./firestore_.md#or_e72c712). | +| queryConstraints | [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | Returns: -[MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) +[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> -### memoryLruGarbageCollector(settings) {:#memorylrugarbagecollector_5ee014c} +#### Exceptions -Creates an instance of `MemoryLruGarbageCollector`. +if any of the provided query constraints cannot be combined with the existing or new constraints. -A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). +### query(query, queryConstraints) {:#query_0f46da1} + +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function memoryLruGarbageCollector(settings?: { - cacheSizeBytes?: number; -}): MemoryLruGarbageCollector; +export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | { cacheSizeBytes?: number; } | | +| query | [Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| queryConstraints | [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | Returns: -[MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) +[Query](./firestore_.query.md#query_class)<AppModelType, DbModelType> -### persistentLocalCache(settings) {:#persistentlocalcache_d312f71} +#### Exceptions -Creates an instance of `PersistentLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. +if any of the provided query constraints cannot be combined with the existing or new constraints. -Persistent cache cannot be used in a Node.js environment. +## function(queryConstraints, ...) + +### and(queryConstraints) {:#and_e72c712} + +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. Signature: ```typescript -export declare function persistentLocalCache(settings?: PersistentCacheSettings): PersistentLocalCache; +export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | | +| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | Returns: -[PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) +[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -### persistentSingleTabManager(settings) {:#persistentsingletabmanager_c99c68d} +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -Creates an instance of `PersistentSingleTabManager`. +### or(queryConstraints) {:#or_e72c712} + +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. Signature: ```typescript -export declare function persistentSingleTabManager(settings: PersistentSingleTabManagerSettings | undefined): PersistentSingleTabManager; +export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| settings | [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) \| undefined | Configures the created tab manager. | +| queryConstraints | [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | Returns: -[PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) +[QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -## function(snapshot, ...) +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -### endAt(snapshot) {:#endat_9a4477f} +## function(reference, ...) -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +### addDoc(reference, data) {:#adddoc_6e783ff} + +Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. Signature: ```typescript -export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | +| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +Promise<[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType>> -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend (Note that it won't resolve while you're offline). -### endBefore(snapshot) {:#endbefore_9a4477f} +### collection(reference, path, pathSegments) {:#collection_568f98d} -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +The `CollectionReference` instance. -### startAfter(snapshot) {:#startafter_9a4477f} +#### Exceptions -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +If the final path has an even number of segments and does not point to a collection. + +### collection(reference, path, pathSegments) {:#collection_70b4396} + +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) +[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +The `CollectionReference` instance. -### startAt(snapshot) {:#startat_9a4477f} +#### Exceptions -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. +If the final path has an even number of segments and does not point to a collection. + +### deleteDoc(reference) {:#deletedoc_4569087} + +Deletes the document referred to by the specified `DocumentReference`. Signature: ```typescript -export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function deleteDoc(reference: DocumentReference): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | Returns: -[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. - -## function(timestamp, ...) - -### timestampAdd(timestamp, unit, amount) {:#timestampadd_87db576} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that adds a specified amount of time to a timestamp. +A Promise resolved once the document has been successfully deleted from the backend (note that it won't resolve while you're offline). -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); +### doc(reference, path, pathSegments) {:#doc_568f98d} -``` +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. Signature: ```typescript -export declare function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; +export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | +| reference | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> -### timestampAdd(timestamp, unit, amount) {:#timestampadd_46a2d7e} +The `DocumentReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that adds a specified amount of time to a timestamp. +If the final path has an odd number of segments and does not point to a document. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), "day", 1); +### doc(reference, path, pathSegments) {:#doc_70b4396} -``` +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. Signature: ```typescript -export declare function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[TimestampAdd](./firestore_.timestampadd.md#timestampadd_class) +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<[DocumentData](./firestore_.documentdata.md#documentdata_interface), [DocumentData](./firestore_.documentdata.md#documentdata_interface)> -### timestampSub(timestamp, unit, amount) {:#timestampsub_87db576} +The `DocumentReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that subtracts a specified amount of time from a timestamp. +If the final path has an odd number of segments and does not point to a document. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); +### getDoc(reference) {:#getdoc_4569087} -``` +Reads the document referred to by this `DocumentReference`. + +Note: `getDoc()` attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. To specify this behavior, invoke [getDocFromCache()](./firestore_.md#getdocfromcache_4569087) or [getDocFromServer()](./firestore_.md#getdocfromserver_4569087). Signature: ```typescript -export declare function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; +export declare function getDoc(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | -| unit | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | Returns: -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -### timestampSub(timestamp, unit, amount) {:#timestampsub_46a2d7e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -Creates an expression that subtracts a specified amount of time from a timestamp. +A Promise resolved with a `DocumentSnapshot` containing the current document contents. -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub(Field.of("timestamp"), "day", 1); +### getDocFromCache(reference) {:#getdocfromcache_4569087} -``` +Reads the document referred to by this `DocumentReference` from cache. Returns an error if the document is not currently cached. Signature: ```typescript -export declare function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +export declare function getDocFromCache(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | The expression representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | Returns: -[TimestampSub](./firestore_.timestampsub.md#timestampsub_class) - -## function(value, ...) - -### avg(value) {:#avg_f83680a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. +A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. -```typescript -// Calculate the average age of users -avg(Field.of("age")).as("averageAge"); +### getDocFromServer(reference) {:#getdocfromserver_4569087} -``` +Reads the document referred to by this `DocumentReference` from the server. Returns an error if the network is not available. Signature: ```typescript -export declare function avg(value: Constant): Avg; +export declare function getDocFromServer(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the values to average. A new representing the 'avg' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | | Returns: -[Avg](./firestore_.avg.md#avg_class) - -### avg(value) {:#avg_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. +A `Promise` resolved with a `DocumentSnapshot` containing the current document contents. -```typescript -// Calculate the average age of users -avg("age").as("averageAge"); +### onSnapshot(reference, observer) {:#onsnapshot_0312fd7} -``` +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function avg(value: string): Avg; +export declare function onSnapshot(reference: DocumentReference, observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field containing numeric values to average. A new representing the 'avg' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -[Avg](./firestore_.avg.md#avg_class) - -### countExpression(value) {:#countexpression_f83680a} +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +An unsubscribe function that can be called to cancel the snapshot listener. -Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. +### onSnapshot(reference, options, observer) {:#onsnapshot_86b6b9e} -```typescript -// Count the number of items where the price is greater than 10 -count(Field.of("price").gt(10)).as("expensiveItemCount"); +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. -``` +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function countExpression(value: Constant): Count; +export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression to count. A new representing the 'count' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next?: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | Returns: -[Count](./firestore_.count.md#count_class) +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -### countExpression(value) {:#countexpression_7c807cd} +An unsubscribe function that can be called to cancel the snapshot listener. -Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided field. +### onSnapshot(reference, onNext, onError, onCompletion) {:#onsnapshot_905f42c} -```typescript -// Count the total number of products -count("productId").as("totalProducts"); +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. -``` +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function countExpression(value: string): Count; +export declare function onSnapshot(reference: DocumentReference, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to count. A new representing the 'count' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -[Count](./firestore_.count.md#count_class) - -### exists(value) {:#exists_f83680a} +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +An unsubscribe function that can be called to cancel the snapshot listener. -Creates an expression that checks if a field exists. +### onSnapshot(reference, options, onNext, onError, onCompletion) {:#onsnapshot_0c39991} -```typescript -// Check if the document has a field named "phoneNumber" -exists(Field.of("phoneNumber")); +Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. -``` +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. Signature: ```typescript -export declare function exists(value: Constant): Exists; +export declare function onSnapshot(reference: DocumentReference, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to listen to. | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | Returns: -[Exists](./firestore_.exists.md#exists_class) - -### isNan(value) {:#isnan_f83680a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) -Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). +An unsubscribe function that can be called to cancel the snapshot listener. -```typescript -// Check if the result of a calculation is NaN -isNaN(Field.of("value").divide(0)); +### setDoc(reference, data) {:#setdoc_ee215ad} -``` +Writes to the document referred to by this `DocumentReference`. If the document does not yet exist, it will be created. Signature: ```typescript -export declare function isNan(value: Constant): IsNan; +export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression to check. A new representing the 'isNaN' check. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [WithFieldValue](./firestore_.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | Returns: -[IsNan](./firestore_.isnan.md#isnan_class) - -### isNan(value) {:#isnan_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -```typescript -// Check if the result of a calculation is NaN -isNaN("value"); +### setDoc(reference, data, options) {:#setdoc_ff80739} -``` +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. Signature: ```typescript -export declare function isNan(value: string): IsNan; +export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to check. A new representing the 'isNaN' check. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [PartialWithFieldValue](./firestore_.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| options | [SetOptions](./firestore_.md#setoptions) | An object to configure the set behavior. | Returns: -[IsNan](./firestore_.isnan.md#isnan_class) - -### max(value) {:#max_f83680a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. +A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -```typescript -// Find the highest score in a leaderboard -max(Field.of("score")).as("highestScore"); +### updateDoc(reference, data) {:#updatedoc_51a65e3} -``` +Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. Signature: ```typescript -export declare function max(value: Constant): Max; +export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression to find the maximum value of. A new representing the 'max' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| data | [UpdateData](./firestore_.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | Returns: -[Max](./firestore_.max.md#max_class) - -### max(value) {:#max_7c807cd} +Promise<void> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} -```typescript -// Find the highest score in a leaderboard -max("score").as("highestScore"); +Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. -``` +Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. Signature: ```typescript -export declare function max(value: string): Max; +export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to find the maximum value of. A new representing the 'max' aggregation. | +| reference | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| field | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | The first field to update. | +| value | unknown | The first value. | +| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | Returns: -[Max](./firestore_.max.md#max_class) - -### min(value) {:#min_f83680a} +Promise<void> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A `Promise` resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline). -Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. +## function(settings, ...) -```typescript -// Find the lowest price of all products -min(Field.of("price")).as("lowestPrice"); +### memoryLocalCache(settings) {:#memorylocalcache_05f4bf2} -``` +Creates an instance of `MemoryLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. Signature: ```typescript -export declare function min(value: Constant): Min; +export declare function memoryLocalCache(settings?: MemoryCacheSettings): MemoryLocalCache; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression to find the minimum value of. A new representing the 'min' aggregation. | +| settings | [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | | Returns: -[Min](./firestore_.min.md#min_class) - -### min(value) {:#min_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[MemoryLocalCache](./firestore_.memorylocalcache.md#memorylocalcache_interface) -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +### memoryLruGarbageCollector(settings) {:#memorylrugarbagecollector_5ee014c} -```typescript -// Find the lowest price of all products -min("price").as("lowestPrice"); +Creates an instance of `MemoryLruGarbageCollector`. -``` +A target size can be specified as part of the setting parameter. The collector will start deleting documents once the cache size exceeds the given size. The default cache size is 40MB (40 \* 1024 \* 1024 bytes). Signature: ```typescript -export declare function min(value: string): Min; +export declare function memoryLruGarbageCollector(settings?: { + cacheSizeBytes?: number; +}): MemoryLruGarbageCollector; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to find the minimum value of. A new representing the 'min' aggregation. | +| settings | { cacheSizeBytes?: number; } | | Returns: -[Min](./firestore_.min.md#min_class) - -### replaceAll(value, find, replace) {:#replaceall_f06d323} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[MemoryLruGarbageCollector](./firestore_.memorylrugarbagecollector.md#memorylrugarbagecollector_interface) -Creates an expression that replaces all occurrences of a substring within a string with another substring. +### persistentLocalCache(settings) {:#persistentlocalcache_d312f71} -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll(Field.of("message"), "hello", "hi"); +Creates an instance of `PersistentLocalCache`. The instance can be set to `FirestoreSettings.cache` to tell the SDK which cache layer to use. -``` +Persistent cache cannot be used in a Node.js environment. Signature: ```typescript -export declare function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; +export declare function persistentLocalCache(settings?: PersistentCacheSettings): PersistentLocalCache; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | +| settings | [PersistentCacheSettings](./firestore_.persistentcachesettings.md#persistentcachesettings_interface) | | Returns: -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -### replaceAll(value, find, replace) {:#replaceall_26a7926} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +[PersistentLocalCache](./firestore_.persistentlocalcache.md#persistentlocalcache_interface) -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); +### persistentSingleTabManager(settings) {:#persistentsingletabmanager_c99c68d} -``` +Creates an instance of `PersistentSingleTabManager`. Signature: ```typescript -export declare function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; +export declare function persistentSingleTabManager(settings: PersistentSingleTabManagerSettings | undefined): PersistentSingleTabManager; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | +| settings | [PersistentSingleTabManagerSettings](./firestore_.persistentsingletabmanagersettings.md#persistentsingletabmanagersettings_interface) \| undefined | Configures the created tab manager. | Returns: -[ReplaceAll](./firestore_.replaceall.md#replaceall_class) - -### replaceFirst(value, find, replace) {:#replacefirst_f06d323} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[PersistentSingleTabManager](./firestore_.persistentsingletabmanager.md#persistentsingletabmanager_interface) -Creates an expression that replaces the first occurrence of a substring within a string with another substring. +## function(snapshot, ...) -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst(Field.of("message"), "hello", "hi"); +### endAt(snapshot) {:#endat_9a4477f} -``` +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; +export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | Returns: -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -### replaceFirst(value, find, replace) {:#replacefirst_26a7926} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); +### endBefore(snapshot) {:#endbefore_9a4477f} -``` +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; +export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | Returns: -[ReplaceFirst](./firestore_.replacefirst.md#replacefirst_class) - -### sumExpression(value) {:#sumexpression_f83680a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) -Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -```typescript -// Calculate the total revenue from a set of orders -sum(Field.of("orderAmount")).as("totalRevenue"); +### startAfter(snapshot) {:#startafter_9a4477f} -``` +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function sumExpression(value: Constant): Sum; +export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | The expression to sum up. A new representing the 'sum' aggregation. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | Returns: -[Sum](./firestore_.sum.md#sum_class) - -### sumExpression(value) {:#sumexpression_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) -Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -```typescript -// Calculate the total revenue from a set of orders -sum("orderAmount").as("totalRevenue"); +### startAt(snapshot) {:#startat_9a4477f} -``` +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. Signature: ```typescript -export declare function sumExpression(value: string): Sum; +export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. | +| snapshot | [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | Returns: -[Sum](./firestore_.sum.md#sum_class) +[QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. ## function(values, ...) @@ -9519,19 +2489,6 @@ Constant used to indicate the LRU garbage collection should be disabled. Set thi CACHE_SIZE_UNLIMITED = -1 ``` -## AccumulatorTarget - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An accumulator target, which is an expression with an alias that also implements the Accumulator interface. - -Signature: - -```typescript -export declare type AccumulatorTarget = ExprWithAlias; -``` - ## AddPrefixToKeys Returns a new map where every key is prefixed with the outer key appended to a dot. @@ -9600,32 +2557,6 @@ The type of a `DocumentChange` may be 'added', 'removed', or 'modified'. export declare type DocumentChangeType = 'added' | 'removed' | 'modified'; ``` -## ExprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An enumeration of the different types of expressions. - -Signature: - -```typescript -export declare type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; -``` - -## FilterExpr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A filter expression, which is an expression that also implements the FilterCondition interface. - -Signature: - -```typescript -export declare type FilterExpr = Constant & FilterCondition; -``` - ## FirestoreErrorCode The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md @@ -9754,19 +2685,6 @@ export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCo export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint; ``` -## SelectableExpr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A selectable expression, which is an expression that also implements the Selectable interface. - -Signature: - -```typescript -export declare type SelectableExpr = Constant & Selectable; -``` - ## SetOptions An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a `SetOptions` with `merge: true`. diff --git a/docs-devsite/firestore_.min.md b/docs-devsite/firestore_.min.md deleted file mode 100644 index 56f71586256..00000000000 --- a/docs-devsite/firestore_.min.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Min class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Min extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_.min.md#minconstructor) | | (BETA) Constructs a new instance of the Min class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_.min.md#minaccumulator) | | true | (BETA) | - -## Min.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Min` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| distinct | boolean | | - -## Min.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.mod.md b/docs-devsite/firestore_.mod.md deleted file mode 100644 index 205eba4f984..00000000000 --- a/docs-devsite/firestore_.mod.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Mod class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Mod extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.mod.md#modconstructor) | | (BETA) Constructs a new instance of the Mod class | - -## Mod.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Mod` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.multiply.md b/docs-devsite/firestore_.multiply.md deleted file mode 100644 index add30cd9359..00000000000 --- a/docs-devsite/firestore_.multiply.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Multiply class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Multiply extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.multiply.md#multiplyconstructor) | | (BETA) Constructs a new instance of the Multiply class | - -## Multiply.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Multiply` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.neq.md b/docs-devsite/firestore_.neq.md deleted file mode 100644 index fc44be2b9d7..00000000000 --- a/docs-devsite/firestore_.neq.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Neq class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Neq extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.neq.md#neqconstructor) | | (BETA) Constructs a new instance of the Neq class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.neq.md#neqfilterable) | | true | (BETA) | - -## Neq.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Neq` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - -## Neq.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.not.md b/docs-devsite/firestore_.not.md deleted file mode 100644 index 1b1823f75e6..00000000000 --- a/docs-devsite/firestore_.not.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Not class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Not extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.not.md#notconstructor) | | (BETA) Constructs a new instance of the Not class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.not.md#notfilterable) | | true | (BETA) | - -## Not.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Not` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - -## Not.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.offset.md b/docs-devsite/firestore_.offset.md deleted file mode 100644 index 5d3431f382d..00000000000 --- a/docs-devsite/firestore_.offset.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Offset class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Offset implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(offset)](./firestore_.offset.md#offsetconstructor) | | (BETA) Constructs a new instance of the Offset class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.offset.md#offsetname) | | string | (BETA) | - -## Offset.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Offset` class - -Signature: - -```typescript -constructor(offset: number); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| offset | number | | - -## Offset.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.or.md b/docs-devsite/firestore_.or.md deleted file mode 100644 index d2c506893a0..00000000000 --- a/docs-devsite/firestore_.or.md +++ /dev/null @@ -1,17 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# or namespace -Signature: - -```typescript -export declare namespace or -``` diff --git a/docs-devsite/firestore_.ordering.md b/docs-devsite/firestore_.ordering.md deleted file mode 100644 index ce673370b28..00000000000 --- a/docs-devsite/firestore_.ordering.md +++ /dev/null @@ -1,51 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Ordering class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents an ordering criterion for sorting documents in a Firestore pipeline. - -You create `Ordering` instances using the `ascending` and `descending` helper functions. - -Signature: - -```typescript -export declare class Ordering -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, direction)](./firestore_.ordering.md#orderingconstructor) | | (BETA) Constructs a new instance of the Ordering class | - -## Ordering.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Ordering` class - -Signature: - -```typescript -constructor(expr: Constant, direction: 'ascending' | 'descending'); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| direction | 'ascending' \| 'descending' | | - diff --git a/docs-devsite/firestore_.pipeline.md b/docs-devsite/firestore_.pipeline.md deleted file mode 100644 index 18c109d2c83..00000000000 --- a/docs-devsite/firestore_.pipeline.md +++ /dev/null @@ -1,609 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Pipeline class -Signature: - -```typescript -export declare class Pipeline -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [converter](./firestore_.pipeline.md#pipelineconverter) | | any | | -| [readUserData](./firestore_.pipeline.md#pipelinereaduserdata) | | any | Reads user data for each expression in the expressionMap. | -| [selectablesToMap](./firestore_.pipeline.md#pipelineselectablestomap) | | any | | -| [stages](./firestore_.pipeline.md#pipelinestages) | | any | | -| [userDataReader](./firestore_.pipeline.md#pipelineuserdatareader) | | any | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [addFields(fields)](./firestore_.pipeline.md#pipelineaddfields) | | Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like add, multiply with assigned aliases using .Example: -```typescript -firestore.pipeline().collection("books") -.addFields( -Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' -add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' -); - -``` - | -| [aggregate(accumulators)](./firestore_.pipeline.md#pipelineaggregate) | | Performs aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances.

Example: -```typescript -// Calculate the average rating and the total number of books -firestore.pipeline().collection("books") -.aggregate( -Field.of("rating").avg().as("averageRating"), -countAll().as("totalBooks") -); - -``` - | -| [aggregate(options)](./firestore_.pipeline.md#pipelineaggregate) | | Performs optionally grouped aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify:

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.

Example: -```typescript -// Calculate the average rating for each genre. -firestore.pipeline().collection("books") -.aggregate({ -accumulators: [avg(Field.of("rating")).as("avg_rating")] -groups: ["genre"] -}); - -``` - | -| [distinct(groups)](./firestore_.pipeline.md#pipelinedistinct) | | Returns a set of distinct values from the inputs to this stage.

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc).

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using

Example: -```typescript -// Get a list of unique author names in uppercase and genre combinations. -firestore.pipeline().collection("books") -.distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") -.select("authorName"); - -``` - | -| [execute()](./firestore_.pipeline.md#pipelineexecute) | | Executes this pipeline and returns a Promise to represent the asynchronous operation.

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.

Example: -```typescript -const futureResults = await firestore.pipeline().collection("books") - .where(gt(Field.of("rating"), 4.5)) - .select("title", "author", "rating") - .execute(); - -``` - A Promise representing the asynchronous pipeline execution. | -| [findNearest(options)](./firestore_.pipeline.md#pipelinefindnearest) | | | -| [genericStage(name, params)](./firestore_.pipeline.md#pipelinegenericstage) | | Adds a generic stage to the pipeline.

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique name and a set of params that control its behavior.

Example (Assuming there is no "where" stage available in SDK): -```typescript -// Assume we don't have a built-in "where" stage -firestore.pipeline().collection("books") -.genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage -.select("title", "author"); - -``` - | -| [limit(limit)](./firestore_.pipeline.md#pipelinelimit) | | Limits the maximum number of documents returned by previous stages to limit.

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for:

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.

Example: -```typescript -// Limit the results to the top 10 highest-rated books -firestore.pipeline().collection("books") -.sort(Field.of("rating").descending()) -.limit(10); - -``` - | -| [offset(offset)](./firestore_.pipeline.md#pipelineoffset) | | Skips the first offset number of documents from the results of previous stages.

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.

Example: -```typescript -// Retrieve the second page of 20 results -firestore.pipeline().collection("books") -.sort(Field.of("published").descending()) -.offset(20) // Skip the first 20 results -.limit(20); // Take the next 20 results - -``` - | -| [select(selections)](./firestore_.pipeline.md#pipelineselect) | | Selects or creates a set of fields from the outputs of previous stages.

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.

Example: -```typescript -firestore.pipeline().collection("books") -.select( -"firstName", -Field.of("lastName"), -Field.of("address").toUppercase().as("upperAddress"), -); - -``` - | -| [sort(orderings)](./firestore_.pipeline.md#pipelinesort) | | Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria.

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.

Example: -```typescript -// Sort books by rating in descending order, and then by title in ascending order for books -// with the same rating -firestore.pipeline().collection("books") -.sort( -Ordering.of(Field.of("rating")).descending(), -Ordering.of(Field.of("title")) // Ascending order is the default -); - -``` - | -| [sort(options)](./firestore_.pipeline.md#pipelinesort) | | | -| [where(condition)](./firestore_.pipeline.md#pipelinewhere) | | Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface).

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to:

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.

Example: -```typescript -firestore.pipeline().collection("books") -.where( -and( -gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 -Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") -) -); - -``` - | - -## Pipeline.converter - -Signature: - -```typescript -converter: any; -``` - -## Pipeline.readUserData - -Reads user data for each expression in the expressionMap. - -Signature: - -```typescript -readUserData: any; -``` - -## Pipeline.selectablesToMap - -Signature: - -```typescript -selectablesToMap: any; -``` - -## Pipeline.stages - -Signature: - -```typescript -stages: any; -``` - -## Pipeline.userDataReader - -Signature: - -```typescript -userDataReader: any; -``` - -## Pipeline.addFields() - -Adds new fields to outputs from previous stages. - -This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps). - -The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be: - -- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like `add`, `multiply` with assigned aliases using . - -Example: - -```typescript -firestore.pipeline().collection("books") -.addFields( -Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' -add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' -); - -``` - -Signature: - -```typescript -addFields(...fields: Selectable[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fields | [Selectable](./firestore_.selectable.md#selectable_interface)\[\] | The fields to add to the documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface)s. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.aggregate() - -Performs aggregation operations on the documents from previous stages. - -

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. - -

Example: - -```typescript -// Calculate the average rating and the total number of books -firestore.pipeline().collection("books") -.aggregate( -Field.of("rating").avg().as("averageRating"), -countAll().as("totalBooks") -); - -``` - -Signature: - -```typescript -aggregate(...accumulators: AccumulatorTarget[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| accumulators | [AccumulatorTarget](./firestore_.md#accumulatortarget)\[\] | The [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, each wrapping an [Accumulator](./firestore_.accumulator.md#accumulator_interface) and provide a name for the accumulated results. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.aggregate() - -Performs optionally grouped aggregation operations on the documents from previous stages. - -

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: - -

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.
- -

Example: - -```typescript -// Calculate the average rating for each genre. -firestore.pipeline().collection("books") -.aggregate({ -accumulators: [avg(Field.of("rating")).as("avg_rating")] -groups: ["genre"] -}); - -``` - -Signature: - -```typescript -aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | { accumulators: [AccumulatorTarget](./firestore_.md#accumulatortarget)\[\]; groups?: Array<string \| [Selectable](./firestore_.selectable.md#selectable_interface)>; } | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.distinct() - -Returns a set of distinct values from the inputs to this stage. - -

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc). - -

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s: - -

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using
- -

Example: - -```typescript -// Get a list of unique author names in uppercase and genre combinations. -firestore.pipeline().collection("books") -.distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") -.select("authorName"); - -``` - -Signature: - -```typescript -distinct(...groups: Array): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| groups | Array<string \| [Selectable](./firestore_.selectable.md#selectable_interface)> | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.execute() - -Executes this pipeline and returns a Promise to represent the asynchronous operation. - -

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously. - -

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: - -

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.
- -

Example: - -```typescript -const futureResults = await firestore.pipeline().collection("books") - .where(gt(Field.of("rating"), 4.5)) - .select("title", "author", "rating") - .execute(); - -``` - A Promise representing the asynchronous pipeline execution. - -Signature: - -```typescript -execute(): Promise>>; -``` -Returns: - -Promise<Array<[PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class)<AppModelType>>> - -## Pipeline.findNearest() - -Signature: - -```typescript -findNearest(options: FindNearestOptions): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | [FindNearestOptions](./firestore_.findnearestoptions.md#findnearestoptions_interface) | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.genericStage() - -Adds a generic stage to the pipeline. - -

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique `name` and a set of `params` that control its behavior. - -

Example (Assuming there is no "where" stage available in SDK): - -```typescript -// Assume we don't have a built-in "where" stage -firestore.pipeline().collection("books") -.genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage -.select("title", "author"); - -``` - -Signature: - -```typescript -genericStage(name: string, params: any[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The unique name of the generic stage to add. | -| params | any\[\] | A list of parameters to configure the generic stage's behavior. A new object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.limit() - -Limits the maximum number of documents returned by previous stages to `limit`. - -

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: - -

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.
- -

Example: - -```typescript -// Limit the results to the top 10 highest-rated books -firestore.pipeline().collection("books") -.sort(Field.of("rating").descending()) -.limit(10); - -``` - -Signature: - -```typescript -limit(limit: number): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| limit | number | The maximum number of documents to return. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.offset() - -Skips the first `offset` number of documents from the results of previous stages. - -

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. - -

Example: - -```typescript -// Retrieve the second page of 20 results -firestore.pipeline().collection("books") -.sort(Field.of("published").descending()) -.offset(20) // Skip the first 20 results -.limit(20); // Take the next 20 results - -``` - -Signature: - -```typescript -offset(offset: number): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| offset | number | The number of documents to skip. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.select() - -Selects or creates a set of fields from the outputs of previous stages. - -

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be: - -

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using
- -

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. - -

Example: - -```typescript -firestore.pipeline().collection("books") -.select( -"firstName", -Field.of("lastName"), -Field.of("address").toUppercase().as("upperAddress"), -); - -``` - -Signature: - -```typescript -select(...selections: Array): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| selections | Array<[Selectable](./firestore_.selectable.md#selectable_interface) \| string> | The fields to include in the output documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface) expressions or values representing field names. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.sort() - -Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria. - -

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. - -

Example: - -```typescript -// Sort books by rating in descending order, and then by title in ascending order for books -// with the same rating -firestore.pipeline().collection("books") -.sort( -Ordering.of(Field.of("rating")).descending(), -Ordering.of(Field.of("title")) // Ascending order is the default -); - -``` - -Signature: - -```typescript -sort(...orderings: Ordering[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| orderings | [Ordering](./firestore_.ordering.md#ordering_class)\[\] | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.sort() - -Signature: - -```typescript -sort(options: { orderings: Ordering[]; }): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | { orderings: [Ordering](./firestore_.ordering.md#ordering_class)\[\]; } | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.where() - -Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface). - -

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to: - -

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.
- -

Example: - -```typescript -firestore.pipeline().collection("books") -.where( -and( -gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 -Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") -) -); - -``` - -Signature: - -```typescript -where(condition: FilterCondition & Constant): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) & [Constant](./firestore_.constant.md#constant_class) | The [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) to apply. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class)<AppModelType> - diff --git a/docs-devsite/firestore_.pipelineresult.md b/docs-devsite/firestore_.pipelineresult.md deleted file mode 100644 index a035e4375ff..00000000000 --- a/docs-devsite/firestore_.pipelineresult.md +++ /dev/null @@ -1,184 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# PipelineResult class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods. - -

If the PipelineResult represents a non-document result, `ref` will return a undefined value. - -Signature: - -```typescript -export declare class PipelineResult -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [createTime](./firestore_.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was created. Undefined if this result is not a document. {Timestamp\|undefined} | -| [executionTime](./firestore_.pipelineresult.md#pipelineresultexecutiontime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) | (BETA) The time at which the pipeline producing this result is executed. {Timestamp} | -| [id](./firestore_.pipelineresult.md#pipelineresultid) | | string \| undefined | (BETA) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. {string} | -| [ref](./firestore_.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class) \| undefined | (BETA) The reference of the document, if it is a document; otherwise undefined. | -| [updateTime](./firestore_.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [data()](./firestore_.pipelineresult.md#pipelineresultdata) | | (BETA) Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. | -| [get(fieldPath)](./firestore_.pipelineresult.md#pipelineresultget) | | (BETA) Retrieves the field specified by field. | - -## PipelineResult.createTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time the document was created. Undefined if this result is not a document. - - {Timestamp\|undefined} - -Signature: - -```typescript -get createTime(): Timestamp | undefined; -``` - -## PipelineResult.executionTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time at which the pipeline producing this result is executed. - - {Timestamp} - -Signature: - -```typescript -get executionTime(): Timestamp; -``` - -## PipelineResult.id - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The ID of the document for which this PipelineResult contains data, if it is a document; otherwise `undefined`. - - {string} - -Signature: - -```typescript -get id(): string | undefined; -``` - -## PipelineResult.ref - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The reference of the document, if it is a document; otherwise `undefined`. - -Signature: - -```typescript -get ref(): DocumentReference | undefined; -``` - -## PipelineResult.updateTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. - - {Timestamp\|undefined} - -Signature: - -```typescript -get updateTime(): Timestamp | undefined; -``` - -## PipelineResult.data() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. - -Signature: - -```typescript -data(): AppModelType | undefined; -``` -Returns: - -AppModelType \| undefined - -{T\|undefined} An object containing all fields in the document or 'undefined' if the document doesn't exist. - -### Example - - -``` -let p = firestore.pipeline().collection('col'); - -p.execute().then(results => { - let data = results[0].data(); - console.log(`Retrieved data: ${JSON.stringify(data)}`); -}); - -``` - -## PipelineResult.get() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Retrieves the field specified by `field`. - -Signature: - -```typescript -get(fieldPath: string | FieldPath): any; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_.fieldpath.md#fieldpath_class) | | - -Returns: - -any - -{\*} The data at the specified field location or undefined if no such field exists. - -### Example - - -``` -let p = firestore.pipeline().collection('col'); - -p.execute().then(results => { - let field = results[0].get('a.b'); - console.log(`Retrieved field value: ${field}`); -}); - -``` - diff --git a/docs-devsite/firestore_.pipelinesource.md b/docs-devsite/firestore_.pipelinesource.md deleted file mode 100644 index cbe4150b1fe..00000000000 --- a/docs-devsite/firestore_.pipelinesource.md +++ /dev/null @@ -1,109 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# PipelineSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). - -Signature: - -```typescript -export declare class PipelineSource -``` - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [collection(collectionPath)](./firestore_.pipelinesource.md#pipelinesourcecollection) | | (BETA) | -| [collectionGroup(collectionId)](./firestore_.pipelinesource.md#pipelinesourcecollectiongroup) | | (BETA) | -| [database()](./firestore_.pipelinesource.md#pipelinesourcedatabase) | | (BETA) | -| [documents(docs)](./firestore_.pipelinesource.md#pipelinesourcedocuments) | | (BETA) | - -## PipelineSource.collection() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -collection(collectionPath: string): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class) - -## PipelineSource.collectionGroup() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -collectionGroup(collectionId: string): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionId | string | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class) - -## PipelineSource.database() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -database(): Pipeline; -``` -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class) - -## PipelineSource.documents() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -documents(docs: DocumentReference[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| docs | [DocumentReference](./firestore_.documentreference.md#documentreference_class)\[\] | | - -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class) - diff --git a/docs-devsite/firestore_.query.md b/docs-devsite/firestore_.query.md index f4d0c8d20e1..086d117aa1e 100644 --- a/docs-devsite/firestore_.query.md +++ b/docs-devsite/firestore_.query.md @@ -36,7 +36,6 @@ export declare class QueryNewDbModelType and your custom type NewAppModelType. | @@ -80,19 +79,6 @@ The type of this Firestore reference. readonly type: 'query' | 'collection'; ``` -## Query.pipeline() - -Pipeline query. - -Signature: - -```typescript -pipeline(): Pipeline; -``` -Returns: - -[Pipeline](./firestore_.pipeline.md#pipeline_class) - ## Query.withConverter() Removes the current converter. diff --git a/docs-devsite/firestore_.querycompositefilterconstraint.md b/docs-devsite/firestore_.querycompositefilterconstraint.md index 61afef2b6b7..bb00c3bf2b3 100644 --- a/docs-devsite/firestore_.querycompositefilterconstraint.md +++ b/docs-devsite/firestore_.querycompositefilterconstraint.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # QueryCompositeFilterConstraint class -A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. +A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. Signature: diff --git a/docs-devsite/firestore_.regexcontains.md b/docs-devsite/firestore_.regexcontains.md deleted file mode 100644 index b9be8441054..00000000000 --- a/docs-devsite/firestore_.regexcontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# RegexContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class RegexContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_.regexcontains.md#regexcontainsconstructor) | | (BETA) Constructs a new instance of the RegexContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.regexcontains.md#regexcontainsfilterable) | | true | (BETA) | - -## RegexContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `RegexContains` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -## RegexContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.regexmatch.md b/docs-devsite/firestore_.regexmatch.md deleted file mode 100644 index 5a8ccf289aa..00000000000 --- a/docs-devsite/firestore_.regexmatch.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# RegexMatch class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class RegexMatch extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_.regexmatch.md#regexmatchconstructor) | | (BETA) Constructs a new instance of the RegexMatch class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.regexmatch.md#regexmatchfilterable) | | true | (BETA) | - -## RegexMatch.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `RegexMatch` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| pattern | [Constant](./firestore_.constant.md#constant_class) | | - -## RegexMatch.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.replaceall.md b/docs-devsite/firestore_.replaceall.md deleted file mode 100644 index 592c709eac7..00000000000 --- a/docs-devsite/firestore_.replaceall.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ReplaceAll class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ReplaceAll extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, find, replace)](./firestore_.replaceall.md#replaceallconstructor) | | (BETA) Constructs a new instance of the ReplaceAll class | - -## ReplaceAll.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ReplaceAll` class - -Signature: - -```typescript -constructor(value: Constant, find: Constant, replace: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| find | [Constant](./firestore_.constant.md#constant_class) | | -| replace | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.replacefirst.md b/docs-devsite/firestore_.replacefirst.md deleted file mode 100644 index d79957a1f6b..00000000000 --- a/docs-devsite/firestore_.replacefirst.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ReplaceFirst class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ReplaceFirst extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, find, replace)](./firestore_.replacefirst.md#replacefirstconstructor) | | (BETA) Constructs a new instance of the ReplaceFirst class | - -## ReplaceFirst.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ReplaceFirst` class - -Signature: - -```typescript -constructor(value: Constant, find: Constant, replace: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| find | [Constant](./firestore_.constant.md#constant_class) | | -| replace | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.reverse.md b/docs-devsite/firestore_.reverse.md deleted file mode 100644 index f6d8f61a312..00000000000 --- a/docs-devsite/firestore_.reverse.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Reverse class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Reverse extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_.reverse.md#reverseconstructor) | | (BETA) Constructs a new instance of the Reverse class | - -## Reverse.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Reverse` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.select.md b/docs-devsite/firestore_.select.md deleted file mode 100644 index 42fe74ce7db..00000000000 --- a/docs-devsite/firestore_.select.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Select class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Select implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(projections)](./firestore_.select.md#selectconstructor) | | (BETA) Constructs a new instance of the Select class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.select.md#selectname) | | string | (BETA) | - -## Select.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Select` class - -Signature: - -```typescript -constructor(projections: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| projections | Map<string, [Constant](./firestore_.constant.md#constant_class)> | | - -## Select.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.selectable.md b/docs-devsite/firestore_.selectable.md deleted file mode 100644 index 0fb32592d4a..00000000000 --- a/docs-devsite/firestore_.selectable.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Selectable interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents a selectable expression. - -Signature: - -```typescript -export declare interface Selectable -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [selectable](./firestore_.selectable.md#selectableselectable) | true | (BETA) | - -## Selectable.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` diff --git a/docs-devsite/firestore_.sort.md b/docs-devsite/firestore_.sort.md deleted file mode 100644 index fa7e1d119fc..00000000000 --- a/docs-devsite/firestore_.sort.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Sort class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Sort implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(orders)](./firestore_.sort.md#sortconstructor) | | (BETA) Constructs a new instance of the Sort class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.sort.md#sortname) | | string | (BETA) | - -## Sort.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Sort` class - -Signature: - -```typescript -constructor(orders: Ordering[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| orders | [Ordering](./firestore_.ordering.md#ordering_class)\[\] | | - -## Sort.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.stage.md b/docs-devsite/firestore_.stage.md deleted file mode 100644 index 34a94a3d4ba..00000000000 --- a/docs-devsite/firestore_.stage.md +++ /dev/null @@ -1,38 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Stage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare interface Stage -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [name](./firestore_.stage.md#stagename) | string | (BETA) | - -## Stage.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.startswith.md b/docs-devsite/firestore_.startswith.md deleted file mode 100644 index e12aca31300..00000000000 --- a/docs-devsite/firestore_.startswith.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StartsWith class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StartsWith extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, prefix)](./firestore_.startswith.md#startswithconstructor) | | (BETA) Constructs a new instance of the StartsWith class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.startswith.md#startswithfilterable) | | true | (BETA) | - -## StartsWith.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StartsWith` class - -Signature: - -```typescript -constructor(expr: Constant, prefix: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| prefix | [Constant](./firestore_.constant.md#constant_class) | | - -## StartsWith.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.strconcat.md b/docs-devsite/firestore_.strconcat.md deleted file mode 100644 index 5d044f31561..00000000000 --- a/docs-devsite/firestore_.strconcat.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StrConcat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StrConcat extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(first, rest)](./firestore_.strconcat.md#strconcatconstructor) | | (BETA) Constructs a new instance of the StrConcat class | - -## StrConcat.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StrConcat` class - -Signature: - -```typescript -constructor(first: Constant, rest: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | [Constant](./firestore_.constant.md#constant_class) | | -| rest | [Constant](./firestore_.constant.md#constant_class)\[\] | | - diff --git a/docs-devsite/firestore_.strcontains.md b/docs-devsite/firestore_.strcontains.md deleted file mode 100644 index a704676ad7a..00000000000 --- a/docs-devsite/firestore_.strcontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StrContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StrContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, substring)](./firestore_.strcontains.md#strcontainsconstructor) | | (BETA) Constructs a new instance of the StrContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.strcontains.md#strcontainsfilterable) | | true | (BETA) | - -## StrContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StrContains` class - -Signature: - -```typescript -constructor(expr: Constant, substring: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | -| substring | [Constant](./firestore_.constant.md#constant_class) | | - -## StrContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_.subtract.md b/docs-devsite/firestore_.subtract.md deleted file mode 100644 index d72563e8471..00000000000 --- a/docs-devsite/firestore_.subtract.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Subtract class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Subtract extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_.subtract.md#subtractconstructor) | | (BETA) Constructs a new instance of the Subtract class | - -## Subtract.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Subtract` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_.constant.md#constant_class) | | -| right | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.sum.md b/docs-devsite/firestore_.sum.md deleted file mode 100644 index 41d11c83b0c..00000000000 --- a/docs-devsite/firestore_.sum.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Sum class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Sum extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_.sum.md#sumconstructor) | | (BETA) Constructs a new instance of the Sum class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_.sum.md#sumaccumulator) | | true | (BETA) | - -## Sum.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Sum` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | -| distinct | boolean | | - -## Sum.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_.timestampadd.md b/docs-devsite/firestore_.timestampadd.md deleted file mode 100644 index 9e563f5f364..00000000000 --- a/docs-devsite/firestore_.timestampadd.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampAdd class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampAdd extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(timestamp, unit, amount)](./firestore_.timestampadd.md#timestampaddconstructor) | | (BETA) Constructs a new instance of the TimestampAdd class | - -## TimestampAdd.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampAdd` class - -Signature: - -```typescript -constructor(timestamp: Constant, unit: Constant, amount: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | | -| unit | [Constant](./firestore_.constant.md#constant_class) | | -| amount | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.timestampsub.md b/docs-devsite/firestore_.timestampsub.md deleted file mode 100644 index a3a28e60c1b..00000000000 --- a/docs-devsite/firestore_.timestampsub.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampSub class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampSub extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(timestamp, unit, amount)](./firestore_.timestampsub.md#timestampsubconstructor) | | (BETA) Constructs a new instance of the TimestampSub class | - -## TimestampSub.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampSub` class - -Signature: - -```typescript -constructor(timestamp: Constant, unit: Constant, amount: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| timestamp | [Constant](./firestore_.constant.md#constant_class) | | -| unit | [Constant](./firestore_.constant.md#constant_class) | | -| amount | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.timestamptounixmicros.md b/docs-devsite/firestore_.timestamptounixmicros.md deleted file mode 100644 index 3075048c254..00000000000 --- a/docs-devsite/firestore_.timestamptounixmicros.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixMicros class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixMicros extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.timestamptounixmicros.md#timestamptounixmicrosconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMicros class | - -## TimestampToUnixMicros.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixMicros` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.timestamptounixmillis.md b/docs-devsite/firestore_.timestamptounixmillis.md deleted file mode 100644 index 0098c5932dd..00000000000 --- a/docs-devsite/firestore_.timestamptounixmillis.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixMillis class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixMillis extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.timestamptounixmillis.md#timestamptounixmillisconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMillis class | - -## TimestampToUnixMillis.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixMillis` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.timestamptounixseconds.md b/docs-devsite/firestore_.timestamptounixseconds.md deleted file mode 100644 index 49b2dd97664..00000000000 --- a/docs-devsite/firestore_.timestamptounixseconds.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixSeconds class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixSeconds extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.timestamptounixseconds.md#timestamptounixsecondsconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixSeconds class | - -## TimestampToUnixSeconds.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixSeconds` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.tolower.md b/docs-devsite/firestore_.tolower.md deleted file mode 100644 index b5b29215bcd..00000000000 --- a/docs-devsite/firestore_.tolower.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ToLower class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ToLower extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.tolower.md#tolowerconstructor) | | (BETA) Constructs a new instance of the ToLower class | - -## ToLower.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ToLower` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.toupper.md b/docs-devsite/firestore_.toupper.md deleted file mode 100644 index bfd5fb607b4..00000000000 --- a/docs-devsite/firestore_.toupper.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ToUpper class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ToUpper extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.toupper.md#toupperconstructor) | | (BETA) Constructs a new instance of the ToUpper class | - -## ToUpper.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ToUpper` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.trim.md b/docs-devsite/firestore_.trim.md deleted file mode 100644 index bfbce9afbed..00000000000 --- a/docs-devsite/firestore_.trim.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Trim class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Trim extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_.trim.md#trimconstructor) | | (BETA) Constructs a new instance of the Trim class | - -## Trim.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Trim` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.unixmicrostotimestamp.md b/docs-devsite/firestore_.unixmicrostotimestamp.md deleted file mode 100644 index cd40de9afb3..00000000000 --- a/docs-devsite/firestore_.unixmicrostotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixMicrosToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixMicrosToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.unixmicrostotimestamp.md#unixmicrostotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMicrosToTimestamp class | - -## UnixMicrosToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixMicrosToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.unixmillistotimestamp.md b/docs-devsite/firestore_.unixmillistotimestamp.md deleted file mode 100644 index 554deb16305..00000000000 --- a/docs-devsite/firestore_.unixmillistotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixMillisToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixMillisToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.unixmillistotimestamp.md#unixmillistotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMillisToTimestamp class | - -## UnixMillisToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixMillisToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.unixsecondstotimestamp.md b/docs-devsite/firestore_.unixsecondstotimestamp.md deleted file mode 100644 index 935b579ca0b..00000000000 --- a/docs-devsite/firestore_.unixsecondstotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixSecondsToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixSecondsToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_.unixsecondstotimestamp.md#unixsecondstotimestampconstructor) | | (BETA) Constructs a new instance of the UnixSecondsToTimestamp class | - -## UnixSecondsToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixSecondsToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.vectorlength.md b/docs-devsite/firestore_.vectorlength.md deleted file mode 100644 index 0a7097bdbdd..00000000000 --- a/docs-devsite/firestore_.vectorlength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# VectorLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class VectorLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_.vectorlength.md#vectorlengthconstructor) | | (BETA) Constructs a new instance of the VectorLength class | - -## VectorLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `VectorLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_.where.md b/docs-devsite/firestore_.where.md deleted file mode 100644 index a6cca720fb8..00000000000 --- a/docs-devsite/firestore_.where.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Where class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Where implements Stage -``` -Implements: [Stage](./firestore_.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(condition)](./firestore_.where.md#whereconstructor) | | (BETA) Constructs a new instance of the Where class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_.where.md#wherename) | | string | (BETA) | - -## Where.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Where` class - -Signature: - -```typescript -constructor(condition: FilterCondition & Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) & [Constant](./firestore_.constant.md#constant_class) | | - -## Where.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_.xor.md b/docs-devsite/firestore_.xor.md deleted file mode 100644 index b7a9269ed1b..00000000000 --- a/docs-devsite/firestore_.xor.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Xor class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Xor extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(conditions)](./firestore_.xor.md#xorconstructor) | | (BETA) Constructs a new instance of the Xor class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_.xor.md#xorfilterable) | | true | (BETA) | - -## Xor.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Xor` class - -Signature: - -```typescript -constructor(conditions: FilterExpr[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| conditions | [FilterExpr](./firestore_.md#filterexpr)\[\] | | - -## Xor.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.accumulator.md b/docs-devsite/firestore_lite.accumulator.md deleted file mode 100644 index 0b26c43d241..00000000000 --- a/docs-devsite/firestore_lite.accumulator.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Accumulator interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents an accumulator. - -Signature: - -```typescript -export declare interface Accumulator -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [accumulator](./firestore_lite.accumulator.md#accumulatoraccumulator) | true | (BETA) | - -## Accumulator.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.add.md b/docs-devsite/firestore_lite.add.md deleted file mode 100644 index a01caad72ca..00000000000 --- a/docs-devsite/firestore_lite.add.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Add class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Add extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.add.md#addconstructor) | | (BETA) Constructs a new instance of the Add class | - -## Add.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Add` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.addfields.md b/docs-devsite/firestore_lite.addfields.md deleted file mode 100644 index 7cef7ce90a3..00000000000 --- a/docs-devsite/firestore_lite.addfields.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# AddFields class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class AddFields implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(fields)](./firestore_lite.addfields.md#addfieldsconstructor) | | (BETA) Constructs a new instance of the AddFields class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.addfields.md#addfieldsname) | | string | (BETA) | - -## AddFields.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `AddFields` class - -Signature: - -```typescript -constructor(fields: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fields | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | - -## AddFields.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.aggregate.md b/docs-devsite/firestore_lite.aggregate.md deleted file mode 100644 index b5df22e08ab..00000000000 --- a/docs-devsite/firestore_lite.aggregate.md +++ /dev/null @@ -1,65 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Aggregate class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Aggregate implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(accumulators, groups)](./firestore_lite.aggregate.md#aggregateconstructor) | | (BETA) Constructs a new instance of the Aggregate class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.aggregate.md#aggregatename) | | string | (BETA) | - -## Aggregate.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Aggregate` class - -Signature: - -```typescript -constructor(accumulators: Map, groups: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| accumulators | Map<string, [Accumulator](./firestore_lite.accumulator.md#accumulator_interface)> | | -| groups | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | - -## Aggregate.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.and.md b/docs-devsite/firestore_lite.and.md deleted file mode 100644 index 59b0a32b25d..00000000000 --- a/docs-devsite/firestore_lite.and.md +++ /dev/null @@ -1,17 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# and namespace -Signature: - -```typescript -export declare namespace and -``` diff --git a/docs-devsite/firestore_lite.arrayconcat.md b/docs-devsite/firestore_lite.arrayconcat.md deleted file mode 100644 index 2c9bf6bd104..00000000000 --- a/docs-devsite/firestore_lite.arrayconcat.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayConcat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayConcat extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, elements)](./firestore_lite.arrayconcat.md#arrayconcatconstructor) | | (BETA) Constructs a new instance of the ArrayConcat class | - -## ArrayConcat.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayConcat` class - -Signature: - -```typescript -constructor(array: Constant, elements: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | -| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - diff --git a/docs-devsite/firestore_lite.arraycontains.md b/docs-devsite/firestore_lite.arraycontains.md deleted file mode 100644 index 9875702d3b9..00000000000 --- a/docs-devsite/firestore_lite.arraycontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, element)](./firestore_lite.arraycontains.md#arraycontainsconstructor) | | (BETA) Constructs a new instance of the ArrayContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.arraycontains.md#arraycontainsfilterable) | | true | (BETA) | - -## ArrayContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContains` class - -Signature: - -```typescript -constructor(array: Constant, element: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | -| element | [Constant](./firestore_lite.constant.md#constant_class) | | - -## ArrayContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.arraycontainsall.md b/docs-devsite/firestore_lite.arraycontainsall.md deleted file mode 100644 index 2d830641779..00000000000 --- a/docs-devsite/firestore_lite.arraycontainsall.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContainsAll class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContainsAll extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, values)](./firestore_lite.arraycontainsall.md#arraycontainsallconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAll class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.arraycontainsall.md#arraycontainsallfilterable) | | true | (BETA) | - -## ArrayContainsAll.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContainsAll` class - -Signature: - -```typescript -constructor(array: Constant, values: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - -## ArrayContainsAll.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.arraycontainsany.md b/docs-devsite/firestore_lite.arraycontainsany.md deleted file mode 100644 index 6c87810c719..00000000000 --- a/docs-devsite/firestore_lite.arraycontainsany.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayContainsAny class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayContainsAny extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array, values)](./firestore_lite.arraycontainsany.md#arraycontainsanyconstructor) | | (BETA) Constructs a new instance of the ArrayContainsAny class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.arraycontainsany.md#arraycontainsanyfilterable) | | true | (BETA) | - -## ArrayContainsAny.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayContainsAny` class - -Signature: - -```typescript -constructor(array: Constant, values: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - -## ArrayContainsAny.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.arrayelement.md b/docs-devsite/firestore_lite.arrayelement.md deleted file mode 100644 index 768a623e6d9..00000000000 --- a/docs-devsite/firestore_lite.arrayelement.md +++ /dev/null @@ -1,41 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayElement class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayElement extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)()](./firestore_lite.arrayelement.md#arrayelementconstructor) | | (BETA) Constructs a new instance of the ArrayElement class | - -## ArrayElement.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayElement` class - -Signature: - -```typescript -constructor(); -``` diff --git a/docs-devsite/firestore_lite.arraylength.md b/docs-devsite/firestore_lite.arraylength.md deleted file mode 100644 index d755e7b0e23..00000000000 --- a/docs-devsite/firestore_lite.arraylength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array)](./firestore_lite.arraylength.md#arraylengthconstructor) | | (BETA) Constructs a new instance of the ArrayLength class | - -## ArrayLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayLength` class - -Signature: - -```typescript -constructor(array: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.arrayreverse.md b/docs-devsite/firestore_lite.arrayreverse.md deleted file mode 100644 index 0117a8e0971..00000000000 --- a/docs-devsite/firestore_lite.arrayreverse.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ArrayReverse class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ArrayReverse extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(array)](./firestore_lite.arrayreverse.md#arrayreverseconstructor) | | (BETA) Constructs a new instance of the ArrayReverse class | - -## ArrayReverse.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ArrayReverse` class - -Signature: - -```typescript -constructor(array: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.avg.md b/docs-devsite/firestore_lite.avg.md deleted file mode 100644 index de139de6c28..00000000000 --- a/docs-devsite/firestore_lite.avg.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Avg class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Avg extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_lite.avg.md#avgconstructor) | | (BETA) Constructs a new instance of the Avg class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_lite.avg.md#avgaccumulator) | | true | (BETA) | - -## Avg.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Avg` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| distinct | boolean | | - -## Avg.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.bytelength.md b/docs-devsite/firestore_lite.bytelength.md deleted file mode 100644 index 2d8d42dea62..00000000000 --- a/docs-devsite/firestore_lite.bytelength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ByteLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ByteLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_lite.bytelength.md#bytelengthconstructor) | | (BETA) Constructs a new instance of the ByteLength class | - -## ByteLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ByteLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.charlength.md b/docs-devsite/firestore_lite.charlength.md deleted file mode 100644 index c2889640765..00000000000 --- a/docs-devsite/firestore_lite.charlength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CharLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CharLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_lite.charlength.md#charlengthconstructor) | | (BETA) Constructs a new instance of the CharLength class | - -## CharLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CharLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.collectiongroupsource.md b/docs-devsite/firestore_lite.collectiongroupsource.md deleted file mode 100644 index 0d650e6a9b7..00000000000 --- a/docs-devsite/firestore_lite.collectiongroupsource.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CollectionGroupSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CollectionGroupSource implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(collectionId)](./firestore_lite.collectiongroupsource.md#collectiongroupsourceconstructor) | | (BETA) Constructs a new instance of the CollectionGroupSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.collectiongroupsource.md#collectiongroupsourcename) | | string | (BETA) | - -## CollectionGroupSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CollectionGroupSource` class - -Signature: - -```typescript -constructor(collectionId: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionId | string | | - -## CollectionGroupSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.collectionsource.md b/docs-devsite/firestore_lite.collectionsource.md deleted file mode 100644 index a0c0a44d768..00000000000 --- a/docs-devsite/firestore_lite.collectionsource.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CollectionSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CollectionSource implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(collectionPath)](./firestore_lite.collectionsource.md#collectionsourceconstructor) | | (BETA) Constructs a new instance of the CollectionSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.collectionsource.md#collectionsourcename) | | string | (BETA) | - -## CollectionSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CollectionSource` class - -Signature: - -```typescript -constructor(collectionPath: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -## CollectionSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.constant.md b/docs-devsite/firestore_lite.constant.md deleted file mode 100644 index 8a26c14416c..00000000000 --- a/docs-devsite/firestore_lite.constant.md +++ /dev/null @@ -1,3504 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Constant class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents a constant value that can be used in a Firestore pipeline expression. - -You can create a `Constant` instance using the static method: - -```typescript -// Create a Constant instance for the number 10 -const ten = Constant.of(10); - -// Create a Constant instance for the string "hello" -const hello = Constant.of("hello"); - -``` - -Signature: - -```typescript -export declare class Constant -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_lite.constant.md#constantexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_lite.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_lite.constant.md#constantadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.constant.md#constantarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_lite.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_lite.constant.md#constantarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.constant.md#constantarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.constant.md#constantarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_lite.constant.md#constantarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_lite.constant.md#constantas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_lite.constant.md#constantascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_lite.constant.md#constantavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_lite.constant.md#constantbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_lite.constant.md#constantcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_lite.constant.md#constantcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_lite.constant.md#constantcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_lite.constant.md#constantdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_lite.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_lite.constant.md#constantdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_lite.constant.md#constantdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_lite.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_lite.constant.md#constantendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_lite.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_lite.constant.md#constanteq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_lite.constant.md#constanteuclideandistance) | | (BETA) | -| [exists()](./firestore_lite.constant.md#constantexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_lite.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_lite.constant.md#constantgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_lite.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_lite.constant.md#constantgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_lite.constant.md#constantin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_lite.constant.md#constantin) | | (BETA) | -| [isNaN()](./firestore_lite.constant.md#constantisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_lite.constant.md#constantlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_lite.constant.md#constantlike) | | (BETA) | -| [logicalMax(other)](./firestore_lite.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_lite.constant.md#constantlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_lite.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_lite.constant.md#constantlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_lite.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_lite.constant.md#constantlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_lite.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_lite.constant.md#constantlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_lite.constant.md#constantmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_lite.constant.md#constantmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_lite.constant.md#constantmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_lite.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_lite.constant.md#constantmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_lite.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_lite.constant.md#constantmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_lite.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_lite.constant.md#constantneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a number value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a DocumentReference value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for an array value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a map value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a VectorValue value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a string value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a boolean value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a null value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for an undefined value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a GeoPoint value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Timestamp value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Date value. | -| [of(value)](./firestore_lite.constant.md#constantof) | static | (BETA) Creates a Constant instance for a Uint8Array value. | -| [regexContains(pattern)](./firestore_lite.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_lite.constant.md#constantregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_lite.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_lite.constant.md#constantregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.constant.md#constantreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.constant.md#constantreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_lite.constant.md#constantreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_lite.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_lite.constant.md#constantstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_lite.constant.md#constantstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_lite.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_lite.constant.md#constantstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_lite.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_lite.constant.md#constantsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_lite.constant.md#constantsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_lite.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_lite.constant.md#constanttimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.constant.md#constanttimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_lite.constant.md#constanttimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_lite.constant.md#constanttimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_lite.constant.md#constanttimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_lite.constant.md#constanttolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_lite.constant.md#constanttoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_lite.constant.md#constanttrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_lite.constant.md#constantunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_lite.constant.md#constantunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_lite.constant.md#constantunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vector(value)](./firestore_lite.constant.md#constantvector) | static | (BETA) Creates a Constant instance for a VectorValue value. -```typescript -// Create a Constant instance for a vector value -const vectorConstant = Constant.ofVector([1, 2, 3]); - -``` - | -| [vectorLength()](./firestore_lite.constant.md#constantvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Constant.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Constant.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Constant.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Constant.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Constant.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Constant.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Constant.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Constant.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Constant.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Constant.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Constant.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Constant.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## Constant.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> - -## Constant.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Constant.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_lite.avg.md#avg_class) - -## Constant.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -## Constant.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Constant.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Constant.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -## Constant.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Constant.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Constant.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Constant.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Constant.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Constant.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Constant.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Constant.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Constant.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Constant.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -## Constant.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Constant.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Constant.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Constant.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Constant.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Constant.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Constant.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_lite.isnan.md#isnan_class) - -## Constant.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Constant.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Constant.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Constant.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Constant.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Constant.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Constant.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Constant.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Constant.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Constant.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Constant.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## Constant.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_lite.max.md#max_class) - -## Constant.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_lite.min.md#min_class) - -## Constant.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Constant.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Constant.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Constant.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Constant.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Constant.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a number value. - -Signature: - -```typescript -static of(value: number): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | number | The number value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a DocumentReference value. - -Signature: - -```typescript -static of(value: DocumentReference): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for an array value. - -Signature: - -```typescript -static of(value: any[]): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | any\[\] | The array value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a map value. - -Signature: - -```typescript -static of(value: Map): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Map<string, any> | The map value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a VectorValue value. - -Signature: - -```typescript -static of(value: VectorValue): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a string value. - -Signature: - -```typescript -static of(value: string): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | string | The string value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a boolean value. - -Signature: - -```typescript -static of(value: boolean): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | boolean | The boolean value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a null value. - -Signature: - -```typescript -static of(value: null): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | null | The null value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for an undefined value. - -Signature: - -```typescript -static of(value: undefined): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | undefined | The undefined value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a GeoPoint value. - -Signature: - -```typescript -static of(value: GeoPoint): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Timestamp value. - -Signature: - -```typescript -static of(value: Timestamp): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Date value. - -Signature: - -```typescript -static of(value: Date): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Date | The Date value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a Uint8Array value. - -Signature: - -```typescript -static of(value: Uint8Array): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | Uint8Array | The Uint8Array value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Constant.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Constant.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Constant.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Constant.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Constant.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Constant.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Constant.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Constant.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -## Constant.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Constant.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Constant.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## Constant.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Constant.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Constant.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Constant.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Constant.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_lite.sum.md#sum_class) - -## Constant.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Constant.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Constant.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Constant.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Constant.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -## Constant.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -## Constant.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -## Constant.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -## Constant.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -## Constant.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -## Constant.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Constant.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Constant.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Constant.vector() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a `Constant` instance for a VectorValue value. - -```typescript -// Create a Constant instance for a vector value -const vectorConstant = Constant.ofVector([1, 2, 3]); - -``` - -Signature: - -```typescript -static vector(value: number[] | VectorValue): Constant; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. | - -Returns: - -[Constant](./firestore_lite.constant.md#constant_class) - -## Constant.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_lite.cosinedistance.md b/docs-devsite/firestore_lite.cosinedistance.md deleted file mode 100644 index d8642f784ee..00000000000 --- a/docs-devsite/firestore_lite.cosinedistance.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CosineDistance class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class CosineDistance extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_lite.cosinedistance.md#cosinedistanceconstructor) | | (BETA) Constructs a new instance of the CosineDistance class | - -## CosineDistance.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `CosineDistance` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.count.md b/docs-devsite/firestore_lite.count.md deleted file mode 100644 index 3de2d0585a7..00000000000 --- a/docs-devsite/firestore_lite.count.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Count class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Count extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_lite.count.md#countconstructor) | | (BETA) Constructs a new instance of the Count class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_lite.count.md#countaccumulator) | | true | (BETA) | - -## Count.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Count` class - -Signature: - -```typescript -constructor(value: Constant | undefined, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) \| undefined | | -| distinct | boolean | | - -## Count.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.databasesource.md b/docs-devsite/firestore_lite.databasesource.md deleted file mode 100644 index c837f93ba36..00000000000 --- a/docs-devsite/firestore_lite.databasesource.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DatabaseSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DatabaseSource implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.databasesource.md#databasesourcename) | | string | (BETA) | - -## DatabaseSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.distinct.md b/docs-devsite/firestore_lite.distinct.md deleted file mode 100644 index 37d2385de22..00000000000 --- a/docs-devsite/firestore_lite.distinct.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Distinct class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Distinct implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(groups)](./firestore_lite.distinct.md#distinctconstructor) | | (BETA) Constructs a new instance of the Distinct class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.distinct.md#distinctname) | | string | (BETA) | - -## Distinct.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Distinct` class - -Signature: - -```typescript -constructor(groups: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| groups | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | - -## Distinct.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.divide.md b/docs-devsite/firestore_lite.divide.md deleted file mode 100644 index ae2ed8410a4..00000000000 --- a/docs-devsite/firestore_lite.divide.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Divide class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Divide extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.divide.md#divideconstructor) | | (BETA) Constructs a new instance of the Divide class | - -## Divide.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Divide` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.documentssource.md b/docs-devsite/firestore_lite.documentssource.md deleted file mode 100644 index 5444a06ee6a..00000000000 --- a/docs-devsite/firestore_lite.documentssource.md +++ /dev/null @@ -1,92 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DocumentsSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DocumentsSource implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(docPaths)](./firestore_lite.documentssource.md#documentssourceconstructor) | | (BETA) Constructs a new instance of the DocumentsSource class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.documentssource.md#documentssourcename) | | string | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [of(refs)](./firestore_lite.documentssource.md#documentssourceof) | static | (BETA) | - -## DocumentsSource.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `DocumentsSource` class - -Signature: - -```typescript -constructor(docPaths: string[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| docPaths | string\[\] | | - -## DocumentsSource.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` - -## DocumentsSource.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(refs: DocumentReference[]): DocumentsSource; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| refs | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)\[\] | | - -Returns: - -[DocumentsSource](./firestore_lite.documentssource.md#documentssource_class) - diff --git a/docs-devsite/firestore_lite.dotproduct.md b/docs-devsite/firestore_lite.dotproduct.md deleted file mode 100644 index ad91f78f92d..00000000000 --- a/docs-devsite/firestore_lite.dotproduct.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# DotProduct class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class DotProduct extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_lite.dotproduct.md#dotproductconstructor) | | (BETA) Constructs a new instance of the DotProduct class | - -## DotProduct.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `DotProduct` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.endswith.md b/docs-devsite/firestore_lite.endswith.md deleted file mode 100644 index d34c4f3dc83..00000000000 --- a/docs-devsite/firestore_lite.endswith.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# EndsWith class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class EndsWith extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, suffix)](./firestore_lite.endswith.md#endswithconstructor) | | (BETA) Constructs a new instance of the EndsWith class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.endswith.md#endswithfilterable) | | true | (BETA) | - -## EndsWith.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `EndsWith` class - -Signature: - -```typescript -constructor(expr: Constant, suffix: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | | - -## EndsWith.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.eq.md b/docs-devsite/firestore_lite.eq.md deleted file mode 100644 index 02fa728f481..00000000000 --- a/docs-devsite/firestore_lite.eq.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Eq class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Eq extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.eq.md#eqconstructor) | | (BETA) Constructs a new instance of the Eq class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.eq.md#eqfilterable) | | true | (BETA) | - -## Eq.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Eq` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Eq.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.euclideandistance.md b/docs-devsite/firestore_lite.euclideandistance.md deleted file mode 100644 index 860057fc9d7..00000000000 --- a/docs-devsite/firestore_lite.euclideandistance.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# EuclideanDistance class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class EuclideanDistance extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vector1, vector2)](./firestore_lite.euclideandistance.md#euclideandistanceconstructor) | | (BETA) Constructs a new instance of the EuclideanDistance class | - -## EuclideanDistance.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `EuclideanDistance` class - -Signature: - -```typescript -constructor(vector1: Constant, vector2: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vector1 | [Constant](./firestore_lite.constant.md#constant_class) | | -| vector2 | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.exists.md b/docs-devsite/firestore_lite.exists.md deleted file mode 100644 index 50ef86f9fec..00000000000 --- a/docs-devsite/firestore_lite.exists.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Exists class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Exists extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.exists.md#existsconstructor) | | (BETA) Constructs a new instance of the Exists class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.exists.md#existsfilterable) | | true | (BETA) | - -## Exists.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Exists` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Exists.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.exprwithalias.md b/docs-devsite/firestore_lite.exprwithalias.md deleted file mode 100644 index a7c47c19b4f..00000000000 --- a/docs-devsite/firestore_lite.exprwithalias.md +++ /dev/null @@ -1,3207 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ExprWithAlias class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ExprWithAlias implements Selectable -``` -Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, alias)](./firestore_lite.exprwithalias.md#exprwithaliasconstructor) | | (BETA) Constructs a new instance of the ExprWithAlias class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias](./firestore_lite.exprwithalias.md#exprwithaliasalias) | | string | (BETA) | -| [expr](./firestore_lite.exprwithalias.md#exprwithaliasexpr) | | T | (BETA) | -| [exprType](./firestore_lite.exprwithalias.md#exprwithaliasexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | -| [selectable](./firestore_lite.exprwithalias.md#exprwithaliasselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_lite.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_lite.exprwithalias.md#exprwithaliasadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.exprwithalias.md#exprwithaliasarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.exprwithalias.md#exprwithaliasarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_lite.exprwithalias.md#exprwithaliasarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_lite.exprwithalias.md#exprwithaliasas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_lite.exprwithalias.md#exprwithaliasascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_lite.exprwithalias.md#exprwithaliasavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_lite.exprwithalias.md#exprwithaliasbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_lite.exprwithalias.md#exprwithaliascharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliascosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_lite.exprwithalias.md#exprwithaliascount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_lite.exprwithalias.md#exprwithaliasdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_lite.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_lite.exprwithalias.md#exprwithaliasdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_lite.exprwithalias.md#exprwithaliasdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_lite.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_lite.exprwithalias.md#exprwithaliasendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_lite.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_lite.exprwithalias.md#exprwithaliaseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_lite.exprwithalias.md#exprwithaliaseuclideandistance) | | (BETA) | -| [exists()](./firestore_lite.exprwithalias.md#exprwithaliasexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_lite.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_lite.exprwithalias.md#exprwithaliasgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_lite.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_lite.exprwithalias.md#exprwithaliasgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_lite.exprwithalias.md#exprwithaliasin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_lite.exprwithalias.md#exprwithaliasin) | | (BETA) | -| [isNaN()](./firestore_lite.exprwithalias.md#exprwithaliasisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_lite.exprwithalias.md#exprwithaliaslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_lite.exprwithalias.md#exprwithaliaslike) | | (BETA) | -| [logicalMax(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_lite.exprwithalias.md#exprwithaliaslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_lite.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_lite.exprwithalias.md#exprwithaliaslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_lite.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_lite.exprwithalias.md#exprwithaliaslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_lite.exprwithalias.md#exprwithaliasmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_lite.exprwithalias.md#exprwithaliasmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_lite.exprwithalias.md#exprwithaliasmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_lite.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_lite.exprwithalias.md#exprwithaliasmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_lite.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_lite.exprwithalias.md#exprwithaliasmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_lite.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_lite.exprwithalias.md#exprwithaliasneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [regexContains(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_lite.exprwithalias.md#exprwithaliasregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.exprwithalias.md#exprwithaliasreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_lite.exprwithalias.md#exprwithaliasreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_lite.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_lite.exprwithalias.md#exprwithaliasstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_lite.exprwithalias.md#exprwithaliasstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_lite.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_lite.exprwithalias.md#exprwithaliasstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_lite.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_lite.exprwithalias.md#exprwithaliassubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_lite.exprwithalias.md#exprwithaliassum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.exprwithalias.md#exprwithaliastimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_lite.exprwithalias.md#exprwithaliastimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_lite.exprwithalias.md#exprwithaliastolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_lite.exprwithalias.md#exprwithaliastoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_lite.exprwithalias.md#exprwithaliastrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_lite.exprwithalias.md#exprwithaliasunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_lite.exprwithalias.md#exprwithaliasvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## ExprWithAlias.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ExprWithAlias` class - -Signature: - -```typescript -constructor(expr: T, alias: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | T | | -| alias | string | | - -## ExprWithAlias.alias - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -alias: string; -``` - -## ExprWithAlias.expr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -expr: T; -``` - -## ExprWithAlias.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## ExprWithAlias.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## ExprWithAlias.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## ExprWithAlias.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## ExprWithAlias.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## ExprWithAlias.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## ExprWithAlias.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## ExprWithAlias.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## ExprWithAlias.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## ExprWithAlias.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## ExprWithAlias.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## ExprWithAlias.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## ExprWithAlias.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## ExprWithAlias.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> - -## ExprWithAlias.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## ExprWithAlias.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_lite.avg.md#avg_class) - -## ExprWithAlias.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -## ExprWithAlias.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## ExprWithAlias.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -## ExprWithAlias.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## ExprWithAlias.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## ExprWithAlias.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## ExprWithAlias.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## ExprWithAlias.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## ExprWithAlias.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## ExprWithAlias.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## ExprWithAlias.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## ExprWithAlias.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -## ExprWithAlias.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## ExprWithAlias.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## ExprWithAlias.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## ExprWithAlias.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## ExprWithAlias.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## ExprWithAlias.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## ExprWithAlias.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_lite.isnan.md#isnan_class) - -## ExprWithAlias.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## ExprWithAlias.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## ExprWithAlias.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## ExprWithAlias.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## ExprWithAlias.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## ExprWithAlias.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## ExprWithAlias.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## ExprWithAlias.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## ExprWithAlias.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## ExprWithAlias.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## ExprWithAlias.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## ExprWithAlias.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_lite.max.md#max_class) - -## ExprWithAlias.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_lite.min.md#min_class) - -## ExprWithAlias.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## ExprWithAlias.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## ExprWithAlias.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## ExprWithAlias.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## ExprWithAlias.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## ExprWithAlias.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## ExprWithAlias.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## ExprWithAlias.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## ExprWithAlias.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## ExprWithAlias.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## ExprWithAlias.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## ExprWithAlias.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## ExprWithAlias.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## ExprWithAlias.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## ExprWithAlias.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -## ExprWithAlias.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## ExprWithAlias.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## ExprWithAlias.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## ExprWithAlias.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## ExprWithAlias.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## ExprWithAlias.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## ExprWithAlias.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## ExprWithAlias.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_lite.sum.md#sum_class) - -## ExprWithAlias.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## ExprWithAlias.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## ExprWithAlias.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## ExprWithAlias.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## ExprWithAlias.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -## ExprWithAlias.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -## ExprWithAlias.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -## ExprWithAlias.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -## ExprWithAlias.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -## ExprWithAlias.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -## ExprWithAlias.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## ExprWithAlias.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## ExprWithAlias.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## ExprWithAlias.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_lite.field.md b/docs-devsite/firestore_lite.field.md deleted file mode 100644 index 0619a19d6bb..00000000000 --- a/docs-devsite/firestore_lite.field.md +++ /dev/null @@ -1,3275 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Field class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage. - -

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. - -

You can create a `Field` instance using the static method: - -```typescript -// Create a Field instance for the 'name' field -const nameField = Field.of("name"); - -// Create a Field instance for a nested field 'address.city' -const cityField = Field.of("address.city"); - -``` - -Signature: - -```typescript -export declare class Field implements Selectable -``` -Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_lite.field.md#fieldexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | -| [selectable](./firestore_lite.field.md#fieldselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_lite.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_lite.field.md#fieldadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.field.md#fieldarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_lite.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_lite.field.md#fieldarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.field.md#fieldarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.field.md#fieldarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_lite.field.md#fieldarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_lite.field.md#fieldas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_lite.field.md#fieldascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_lite.field.md#fieldavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_lite.field.md#fieldbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_lite.field.md#fieldcharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_lite.field.md#fieldcosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_lite.field.md#fieldcount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_lite.field.md#fielddescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_lite.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_lite.field.md#fielddivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_lite.field.md#fielddotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_lite.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_lite.field.md#fieldendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_lite.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_lite.field.md#fieldeq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_lite.field.md#fieldeuclideandistance) | | (BETA) | -| [exists()](./firestore_lite.field.md#fieldexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [fieldName()](./firestore_lite.field.md#fieldfieldname) | | (BETA) | -| [gt(other)](./firestore_lite.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_lite.field.md#fieldgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_lite.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_lite.field.md#fieldgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_lite.field.md#fieldin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_lite.field.md#fieldin) | | (BETA) | -| [isNaN()](./firestore_lite.field.md#fieldisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_lite.field.md#fieldlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_lite.field.md#fieldlike) | | (BETA) | -| [logicalMax(other)](./firestore_lite.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_lite.field.md#fieldlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_lite.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_lite.field.md#fieldlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_lite.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_lite.field.md#fieldlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_lite.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_lite.field.md#fieldlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_lite.field.md#fieldmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_lite.field.md#fieldmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_lite.field.md#fieldmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_lite.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_lite.field.md#fieldmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_lite.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_lite.field.md#fieldmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_lite.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_lite.field.md#fieldneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(name)](./firestore_lite.field.md#fieldof) | static | (BETA) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). -```typescript -// Create a Field instance for the 'title' field -const titleField = Field.of("title"); - -// Create a Field instance for a nested field 'author.firstName' -const authorFirstNameField = Field.of("author.firstName"); - -``` - | -| [of(path)](./firestore_lite.field.md#fieldof) | static | (BETA) | -| [of(pipeline, name)](./firestore_lite.field.md#fieldof) | static | (BETA) | -| [regexContains(pattern)](./firestore_lite.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_lite.field.md#fieldregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_lite.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_lite.field.md#fieldregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.field.md#fieldreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.field.md#fieldreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_lite.field.md#fieldreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_lite.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_lite.field.md#fieldstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_lite.field.md#fieldstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_lite.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_lite.field.md#fieldstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_lite.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_lite.field.md#fieldsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_lite.field.md#fieldsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_lite.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_lite.field.md#fieldtimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.field.md#fieldtimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_lite.field.md#fieldtimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_lite.field.md#fieldtimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_lite.field.md#fieldtimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_lite.field.md#fieldtolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_lite.field.md#fieldtoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_lite.field.md#fieldtrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_lite.field.md#fieldunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_lite.field.md#fieldunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_lite.field.md#fieldunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_lite.field.md#fieldvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Field.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Field.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## Field.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Field.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Field.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Field.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Field.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Field.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Field.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Field.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Field.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Field.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Field.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## Field.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> - -## Field.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Field.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_lite.avg.md#avg_class) - -## Field.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -## Field.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Field.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Field.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -## Field.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Field.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Field.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Field.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Field.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Field.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Field.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Field.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Field.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Field.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -## Field.fieldName() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -fieldName(): string; -``` -Returns: - -string - -## Field.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Field.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Field.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Field.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Field.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Field.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Field.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_lite.isnan.md#isnan_class) - -## Field.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Field.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Field.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Field.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Field.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Field.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Field.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Field.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Field.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Field.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Field.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## Field.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_lite.max.md#max_class) - -## Field.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_lite.min.md#min_class) - -## Field.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Field.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Field.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Field.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Field.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Field.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a instance representing the field at the given path. - -The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). - -```typescript -// Create a Field instance for the 'title' field -const titleField = Field.of("title"); - -// Create a Field instance for a nested field 'author.firstName' -const authorFirstNameField = Field.of("author.firstName"); - -``` - -Signature: - -```typescript -static of(name: string): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The path to the field. A new instance representing the specified field. | - -Returns: - -[Field](./firestore_lite.field.md#field_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(path: FieldPath): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| path | [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | | - -Returns: - -[Field](./firestore_lite.field.md#field_class) - -## Field.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(pipeline: Pipeline, name: string): Field; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pipeline | [Pipeline](./firestore_lite.pipeline.md#pipeline_class) | | -| name | string | | - -Returns: - -[Field](./firestore_lite.field.md#field_class) - -## Field.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Field.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Field.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Field.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Field.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Field.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Field.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Field.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Field.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -## Field.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Field.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Field.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## Field.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Field.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Field.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Field.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Field.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_lite.sum.md#sum_class) - -## Field.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Field.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Field.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Field.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Field.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -## Field.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -## Field.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -## Field.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -## Field.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -## Field.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -## Field.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Field.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Field.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Field.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_lite.fields.md b/docs-devsite/firestore_lite.fields.md deleted file mode 100644 index 469b9b6b651..00000000000 --- a/docs-devsite/firestore_lite.fields.md +++ /dev/null @@ -1,3210 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Fields class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Fields implements Selectable -``` -Implements: [Selectable](./firestore_lite.selectable.md#selectable_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_lite.fields.md#fieldsexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | -| [selectable](./firestore_lite.fields.md#fieldsselectable) | | true | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_lite.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_lite.fields.md#fieldsadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.fields.md#fieldsarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_lite.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_lite.fields.md#fieldsarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.fields.md#fieldsarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.fields.md#fieldsarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_lite.fields.md#fieldsarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_lite.fields.md#fieldsas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_lite.fields.md#fieldsascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_lite.fields.md#fieldsavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_lite.fields.md#fieldsbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_lite.fields.md#fieldscharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_lite.fields.md#fieldscosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_lite.fields.md#fieldscount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_lite.fields.md#fieldsdescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_lite.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_lite.fields.md#fieldsdivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_lite.fields.md#fieldsdotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_lite.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_lite.fields.md#fieldsendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_lite.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_lite.fields.md#fieldseq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_lite.fields.md#fieldseuclideandistance) | | (BETA) | -| [exists()](./firestore_lite.fields.md#fieldsexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [fieldList()](./firestore_lite.fields.md#fieldsfieldlist) | | (BETA) | -| [gt(other)](./firestore_lite.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_lite.fields.md#fieldsgt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_lite.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_lite.fields.md#fieldsgte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_lite.fields.md#fieldsin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_lite.fields.md#fieldsin) | | (BETA) | -| [isNaN()](./firestore_lite.fields.md#fieldsisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_lite.fields.md#fieldslike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_lite.fields.md#fieldslike) | | (BETA) | -| [logicalMax(other)](./firestore_lite.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_lite.fields.md#fieldslogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_lite.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_lite.fields.md#fieldslogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_lite.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_lite.fields.md#fieldslt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_lite.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_lite.fields.md#fieldslte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_lite.fields.md#fieldsmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_lite.fields.md#fieldsmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_lite.fields.md#fieldsmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_lite.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_lite.fields.md#fieldsmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_lite.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_lite.fields.md#fieldsmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_lite.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_lite.fields.md#fieldsneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [of(name, others)](./firestore_lite.fields.md#fieldsof) | static | (BETA) | -| [ofAll()](./firestore_lite.fields.md#fieldsofall) | static | (BETA) | -| [regexContains(pattern)](./firestore_lite.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_lite.fields.md#fieldsregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_lite.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_lite.fields.md#fieldsregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.fields.md#fieldsreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.fields.md#fieldsreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_lite.fields.md#fieldsreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_lite.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_lite.fields.md#fieldsstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_lite.fields.md#fieldsstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_lite.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_lite.fields.md#fieldsstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_lite.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_lite.fields.md#fieldssubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_lite.fields.md#fieldssum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_lite.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_lite.fields.md#fieldstimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.fields.md#fieldstimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_lite.fields.md#fieldstimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_lite.fields.md#fieldstimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_lite.fields.md#fieldstimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_lite.fields.md#fieldstolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_lite.fields.md#fieldstoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_lite.fields.md#fieldstrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_lite.fields.md#fieldsunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_lite.fields.md#fieldsunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_lite.fields.md#fieldsunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_lite.fields.md#fieldsvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## Fields.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## Fields.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` - -## Fields.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Fields.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## Fields.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Fields.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## Fields.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Fields.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## Fields.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Fields.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## Fields.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Fields.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## Fields.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## Fields.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> - -## Fields.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Fields.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_lite.avg.md#avg_class) - -## Fields.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -## Fields.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Fields.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## Fields.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -## Fields.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## Fields.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Fields.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Fields.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## Fields.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Fields.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## Fields.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Fields.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Fields.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## Fields.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -## Fields.fieldList() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -fieldList(): Field[]; -``` -Returns: - -[Field](./firestore_lite.field.md#field_class)\[\] - -## Fields.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Fields.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## Fields.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Fields.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## Fields.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Fields.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## Fields.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_lite.isnan.md#isnan_class) - -## Fields.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Fields.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## Fields.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Fields.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## Fields.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Fields.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## Fields.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Fields.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## Fields.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Fields.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## Fields.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## Fields.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_lite.max.md#max_class) - -## Fields.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_lite.min.md#min_class) - -## Fields.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Fields.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## Fields.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Fields.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## Fields.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Fields.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## Fields.of() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static of(name: string, ...others: string[]): Fields; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| others | string\[\] | | - -Returns: - -[Fields](./firestore_lite.fields.md#fields_class) - -## Fields.ofAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -static ofAll(): Fields; -``` -Returns: - -[Fields](./firestore_lite.fields.md#fields_class) - -## Fields.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Fields.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## Fields.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Fields.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## Fields.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Fields.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## Fields.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Fields.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## Fields.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -## Fields.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Fields.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## Fields.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## Fields.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Fields.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## Fields.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Fields.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## Fields.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_lite.sum.md#sum_class) - -## Fields.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Fields.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## Fields.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Fields.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## Fields.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -## Fields.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -## Fields.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -## Fields.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -## Fields.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -## Fields.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -## Fields.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## Fields.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## Fields.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## Fields.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_lite.filtercondition.md b/docs-devsite/firestore_lite.filtercondition.md deleted file mode 100644 index 3f638859319..00000000000 --- a/docs-devsite/firestore_lite.filtercondition.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FilterCondition interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents a filter condition. - -Signature: - -```typescript -export declare interface FilterCondition -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [filterable](./firestore_lite.filtercondition.md#filterconditionfilterable) | true | (BETA) | - -## FilterCondition.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.findnearest.md b/docs-devsite/firestore_lite.findnearest.md deleted file mode 100644 index a0fe60cb31e..00000000000 --- a/docs-devsite/firestore_lite.findnearest.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FindNearest class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class FindNearest implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.findnearest.md#findnearestname) | | string | (BETA) | - -## FindNearest.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.findnearestoptions.md b/docs-devsite/firestore_lite.findnearestoptions.md deleted file mode 100644 index fe142b4a8d4..00000000000 --- a/docs-devsite/firestore_lite.findnearestoptions.md +++ /dev/null @@ -1,86 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FindNearestOptions interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare interface FindNearestOptions -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [distanceField](./firestore_lite.findnearestoptions.md#findnearestoptionsdistancefield) | string | (BETA) | -| [distanceMeasure](./firestore_lite.findnearestoptions.md#findnearestoptionsdistancemeasure) | 'euclidean' \| 'cosine' \| 'dot\_product' | (BETA) | -| [field](./firestore_lite.findnearestoptions.md#findnearestoptionsfield) | [Field](./firestore_lite.field.md#field_class) | (BETA) | -| [limit](./firestore_lite.findnearestoptions.md#findnearestoptionslimit) | number | (BETA) | -| [vectorValue](./firestore_lite.findnearestoptions.md#findnearestoptionsvectorvalue) | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | (BETA) | - -## FindNearestOptions.distanceField - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -distanceField?: string; -``` - -## FindNearestOptions.distanceMeasure - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; -``` - -## FindNearestOptions.field - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -field: Field; -``` - -## FindNearestOptions.limit - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -limit?: number; -``` - -## FindNearestOptions.vectorValue - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -vectorValue: VectorValue | number[]; -``` diff --git a/docs-devsite/firestore_lite.firestore.md b/docs-devsite/firestore_lite.firestore.md index cfbb412ed25..2edac7aa130 100644 --- a/docs-devsite/firestore_lite.firestore.md +++ b/docs-devsite/firestore_lite.firestore.md @@ -31,7 +31,6 @@ export declare class Firestore | Method | Modifiers | Description | | --- | --- | --- | -| [pipeline()](./firestore_lite.firestore.md#firestorepipeline) | | Pipeline query. | | [toJSON()](./firestore_lite.firestore.md#firestoretojson) | | Returns a JSON-serializable representation of this Firestore instance. | ## Firestore.app @@ -54,19 +53,6 @@ Whether it's a Firestore or Firestore Lite instance. type: 'firestore-lite' | 'firestore'; ``` -## Firestore.pipeline() - -Pipeline query. - -Signature: - -```typescript -pipeline(): PipelineSource; -``` -Returns: - -[PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) - ## Firestore.toJSON() Returns a JSON-serializable representation of this `Firestore` instance. diff --git a/docs-devsite/firestore_lite.firestorefunction.md b/docs-devsite/firestore_lite.firestorefunction.md deleted file mode 100644 index 04bf9e874f8..00000000000 --- a/docs-devsite/firestore_lite.firestorefunction.md +++ /dev/null @@ -1,3173 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FirestoreFunction class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution. - -Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. - -Signature: - -```typescript -export declare class FirestoreFunction -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(name, params)](./firestore_lite.firestorefunction.md#firestorefunctionconstructor) | | (BETA) Constructs a new instance of the FirestoreFunction class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [exprType](./firestore_lite.firestorefunction.md#firestorefunctionexprtype) | | [ExprType](./firestore_lite.md#exprtype) | (BETA) | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [add(other)](./firestore_lite.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to another expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - | -| [add(other)](./firestore_lite.firestorefunction.md#firestorefunctionadd) | | (BETA) Creates an expression that adds this expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - | -| [arrayConcat(arrays)](./firestore_lite.firestorefunction.md#firestorefunctionarrayconcat) | | (BETA) Creates an expression that concatenates an array expression with one or more other arrays. -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - | -| [arrayContains(element)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific element. -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - | -| [arrayContains(element)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontains) | | (BETA) Creates an expression that checks if an array contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAll(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsall) | | (BETA) Creates an expression that checks if an array contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - | -| [arrayContainsAny(values)](./firestore_lite.firestorefunction.md#firestorefunctionarraycontainsany) | | (BETA) Creates an expression that checks if an array contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - | -| [arrayLength()](./firestore_lite.firestorefunction.md#firestorefunctionarraylength) | | (BETA) Creates an expression that calculates the length of an array. -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new Expr representing the length of the array. | -| [as(name)](./firestore_lite.firestorefunction.md#firestorefunctionas) | | (BETA) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - | -| [ascending()](./firestore_lite.firestorefunction.md#firestorefunctionascending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new Ordering for ascending sorting. | -| [avg()](./firestore_lite.firestorefunction.md#firestorefunctionavg) | | (BETA) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new Accumulator representing the 'avg' aggregation. | -| [byteLength()](./firestore_lite.firestorefunction.md#firestorefunctionbytelength) | | (BETA) Creates an expression that calculates the length of this string expression in bytes. -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. | -| [charLength()](./firestore_lite.firestorefunction.md#firestorefunctioncharlength) | | (BETA) Creates an expression that calculates the character length of a string in UTF-8. -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new Expr representing the length of the string. | -| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the cosine distance between two vectors. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - | -| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioncosinedistance) | | (BETA) Calculates the Cosine distance between two vectors. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - | -| [count()](./firestore_lite.firestorefunction.md#firestorefunctioncount) | | (BETA) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new Accumulator representing the 'count' aggregation. | -| [descending()](./firestore_lite.firestorefunction.md#firestorefunctiondescending) | | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new Ordering for descending sorting. | -| [divide(other)](./firestore_lite.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by another expression. -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - | -| [divide(other)](./firestore_lite.firestorefunction.md#firestorefunctiondivide) | | (BETA) Creates an expression that divides this expression by a constant value. -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - | -| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) Calculates the dot product between two vectors. -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(other)](./firestore_lite.firestorefunction.md#firestorefunctiondotproduct) | | (BETA) | -| [endsWith(suffix)](./firestore_lite.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - | -| [endsWith(suffix)](./firestore_lite.firestorefunction.md#firestorefunctionendswith) | | (BETA) Creates an expression that checks if a string ends with a given postfix (represented as an expression). -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - | -| [eq(other)](./firestore_lite.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to another expression. -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - | -| [eq(other)](./firestore_lite.firestorefunction.md#firestorefunctioneq) | | (BETA) Creates an expression that checks if this expression is equal to a constant value. -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - | -| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - | -| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) Calculates the Euclidean distance between two vectors. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(other)](./firestore_lite.firestorefunction.md#firestorefunctioneuclideandistance) | | (BETA) | -| [exists()](./firestore_lite.firestorefunction.md#firestorefunctionexists) | | (BETA) Creates an expression that checks if a field exists in the document. -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new Expr representing the 'exists' check. | -| [gt(other)](./firestore_lite.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than another expression. -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - | -| [gt(other)](./firestore_lite.firestorefunction.md#firestorefunctiongt) | | (BETA) Creates an expression that checks if this expression is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - | -| [gte(other)](./firestore_lite.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to another expression. -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - | -| [gte(other)](./firestore_lite.firestorefunction.md#firestorefunctiongte) | | (BETA) Creates an expression that checks if this expression is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - | -| [in(others)](./firestore_lite.firestorefunction.md#firestorefunctionin) | | (BETA) Creates an expression that checks if this expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - | -| [in(others)](./firestore_lite.firestorefunction.md#firestorefunctionin) | | (BETA) | -| [isNaN()](./firestore_lite.firestorefunction.md#firestorefunctionisnan) | | (BETA) Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new Expr representing the 'isNaN' check. | -| [like(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionlike) | | (BETA) Creates an expression that performs a case-sensitive string comparison. -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - | -| [like(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionlike) | | (BETA) | -| [logicalMax(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - | -| [logicalMax(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmax) | | (BETA) Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - | -| [logicalMin(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - | -| [logicalMin(other)](./firestore_lite.firestorefunction.md#firestorefunctionlogicalmin) | | (BETA) Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - | -| [lt(other)](./firestore_lite.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than another expression. -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - | -| [lt(other)](./firestore_lite.firestorefunction.md#firestorefunctionlt) | | (BETA) Creates an expression that checks if this expression is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - | -| [lte(other)](./firestore_lite.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to another expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - | -| [lte(other)](./firestore_lite.firestorefunction.md#firestorefunctionlte) | | (BETA) Creates an expression that checks if this expression is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - | -| [mapGet(subfield)](./firestore_lite.firestorefunction.md#firestorefunctionmapget) | | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - | -| [max()](./firestore_lite.firestorefunction.md#firestorefunctionmax) | | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new Accumulator representing the 'max' aggregation. | -| [min()](./firestore_lite.firestorefunction.md#firestorefunctionmin) | | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new Accumulator representing the 'min' aggregation. | -| [mod(other)](./firestore_lite.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - | -| [mod(other)](./firestore_lite.firestorefunction.md#firestorefunctionmod) | | (BETA) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - | -| [multiply(other)](./firestore_lite.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by another expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - | -| [multiply(other)](./firestore_lite.firestorefunction.md#firestorefunctionmultiply) | | (BETA) Creates an expression that multiplies this expression by a constant value. -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - | -| [neq(other)](./firestore_lite.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to another expression. -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - | -| [neq(other)](./firestore_lite.firestorefunction.md#firestorefunctionneq) | | (BETA) Creates an expression that checks if this expression is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - | -| [regexContains(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - | -| [regexContains(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexcontains) | | (BETA) Creates an expression that checks if a string contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - | -| [regexMatch(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(pattern)](./firestore_lite.firestorefunction.md#firestorefunctionregexmatch) | | (BETA) Creates an expression that checks if a string matches a specified regular expression. -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - | -| [replaceAll(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplaceall) | | (BETA) Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - | -| [replaceFirst(find, replace)](./firestore_lite.firestorefunction.md#firestorefunctionreplacefirst) | | (BETA) Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - | -| [reverse()](./firestore_lite.firestorefunction.md#firestorefunctionreverse) | | (BETA) Creates an expression that reverses this string expression. -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. | -| [startsWith(prefix)](./firestore_lite.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - | -| [startsWith(prefix)](./firestore_lite.firestorefunction.md#firestorefunctionstartswith) | | (BETA) Creates an expression that checks if a string starts with a given prefix (represented as an expression). -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - | -| [strConcat(elements)](./firestore_lite.firestorefunction.md#firestorefunctionstrconcat) | | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - | -| [strContains(substring)](./firestore_lite.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - | -| [strContains(expr)](./firestore_lite.firestorefunction.md#firestorefunctionstrcontains) | | (BETA) Creates an expression that checks if a string contains the string represented by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - | -| [subtract(other)](./firestore_lite.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts another expression from this expression. -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - | -| [subtract(other)](./firestore_lite.firestorefunction.md#firestorefunctionsubtract) | | (BETA) Creates an expression that subtracts a constant value from this expression. -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - | -| [sum()](./firestore_lite.firestorefunction.md#firestorefunctionsum) | | (BETA) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new Accumulator representing the 'sum' aggregation. | -| [timestampAdd(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampadd) | | (BETA) Creates an expression that adds a specified amount of time to this timestamp expression. -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(unit, amount)](./firestore_lite.firestorefunction.md#firestorefunctiontimestampsub) | | (BETA) Creates an expression that subtracts a specified amount of time from this timestamp expression. -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - | -| [timestampToUnixMicros()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixmicros) | | (BETA) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. | -| [timestampToUnixMillis()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixmillis) | | (BETA) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. | -| [timestampToUnixSeconds()](./firestore_lite.firestorefunction.md#firestorefunctiontimestamptounixseconds) | | (BETA) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. | -| [toLower()](./firestore_lite.firestorefunction.md#firestorefunctiontolower) | | (BETA) Creates an expression that converts a string to lowercase. -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new Expr representing the lowercase string. | -| [toUpper()](./firestore_lite.firestorefunction.md#firestorefunctiontoupper) | | (BETA) Creates an expression that converts a string to uppercase. -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new Expr representing the uppercase string. | -| [trim()](./firestore_lite.firestorefunction.md#firestorefunctiontrim) | | (BETA) Creates an expression that removes leading and trailing whitespace from a string. -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new Expr representing the trimmed string. | -| [unixMicrosToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixmicrostotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. | -| [unixMillisToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixmillistotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. | -| [unixSecondsToTimestamp()](./firestore_lite.firestorefunction.md#firestorefunctionunixsecondstotimestamp) | | (BETA) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. | -| [vectorLength()](./firestore_lite.firestorefunction.md#firestorefunctionvectorlength) | | (BETA) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. | - -## FirestoreFunction.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `FirestoreFunction` class - -Signature: - -```typescript -constructor(name: string, params: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| params | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - -## FirestoreFunction.exprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -exprType: ExprType; -``` - -## FirestoreFunction.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to another expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -Field.of("quantity").add(Field.of("reserve")); - -``` - -Signature: - -```typescript -add(other: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to this expression. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## FirestoreFunction.add() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds this expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -Field.of("age").add(5); - -``` - -Signature: - -```typescript -add(other: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to add. A new Expr representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -## FirestoreFunction.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'items' array with another array field. -Field.of("items").arrayConcat(Field.of("otherItems")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## FirestoreFunction.arrayConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with one or more other arrays. - -```typescript -// Combine the 'tags' array with a new array and an array field -Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - -``` - -Signature: - -```typescript -arrayConcat(arrays: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| arrays | any\[\] | The array expressions or values to concatenate. A new Expr representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -## FirestoreFunction.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific element. - -```typescript -// Check if the 'sizes' array contains the value from the 'selectedSize' field -Field.of("sizes").arrayContains(Field.of("selectedSize")); - -``` - -Signature: - -```typescript -arrayContains(element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## FirestoreFunction.arrayContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -Field.of("colors").arrayContains("red"); - -``` - -Signature: - -```typescript -arrayContains(element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | any | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -## FirestoreFunction.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both "news" and "sports" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## FirestoreFunction.arrayContainsAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); - -``` - -Signature: - -```typescript -arrayContainsAll(...values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -## FirestoreFunction.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "cate2" -Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## FirestoreFunction.arrayContainsAny() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); - -``` - -Signature: - -```typescript -arrayContainsAny(...values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| values | any\[\] | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -## FirestoreFunction.arrayLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array. - -```typescript -// Get the number of items in the 'cart' array -Field.of("cart").arrayLength(); - -``` - A new `Expr` representing the length of the array. - -Signature: - -```typescript -arrayLength(): ArrayLength; -``` -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## FirestoreFunction.as() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Assigns an alias to this expression. - -Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. - -```typescript -// Calculate the total price and assign it the alias "totalPrice" and add it to the output. -firestore.pipeline().collection("items") -.addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); - -``` - -Signature: - -```typescript -as(name: string): ExprWithAlias; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The alias to assign to this expression. A new [ExprWithAlias](./firestore_.exprwithalias.md#exprwithalias_class) that wraps this expression and associates it with the provided alias. | - -Returns: - -[ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class)<this> - -## FirestoreFunction.ascending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -pipeline().collection("users") -.sort(Field.of("name").ascending()); - -``` - A new `Ordering` for ascending sorting. - -Signature: - -```typescript -ascending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## FirestoreFunction.avg() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. - -```typescript -// Calculate the average age of users -Field.of("age").avg().as("averageAge"); - -``` - A new `Accumulator` representing the 'avg' aggregation. - -Signature: - -```typescript -avg(): Avg; -``` -Returns: - -[Avg](./firestore_lite.avg.md#avg_class) - -## FirestoreFunction.byteLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of this string expression in bytes. - -```typescript -// Calculate the length of the 'myString' field in bytes. -Field.of("myString").byteLength(); - -``` - A new representing the length of the string in bytes. - -Signature: - -```typescript -byteLength(): ByteLength; -``` -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -## FirestoreFunction.charLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string in UTF-8. - -```typescript -// Get the character length of the 'name' field in its UTF-8 form. -Field.of("name").charLength(); - -``` - A new `Expr` representing the length of the string. - -Signature: - -```typescript -charLength(): CharLength; -``` -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the cosine distance between two vectors. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -Field.of("userVector").cosineDistance(Field.of("itemVector")); - -``` - -Signature: - -```typescript -cosineDistance(other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -cosineDistance(other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.cosineDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vectors. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -Field.of("location").cosineDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -cosineDistance(other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | The other vector (as an array of numbers) to compare against. A new Expr representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -## FirestoreFunction.count() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. - -```typescript -// Count the total number of products -Field.of("productId").count().as("totalProducts"); - -``` - A new `Accumulator` representing the 'count' aggregation. - -Signature: - -```typescript -count(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -## FirestoreFunction.descending() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") -.sort(Field.of("createdAt").descending()); - -``` - A new `Ordering` for descending sorting. - -Signature: - -```typescript -descending(): Ordering; -``` -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -## FirestoreFunction.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by another expression. - -```typescript -// Divide the 'total' field by the 'count' field -Field.of("total").divide(Field.of("count")); - -``` - -Signature: - -```typescript -divide(other: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## FirestoreFunction.divide() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides this expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -Field.of("value").divide(10); - -``` - -Signature: - -```typescript -divide(other: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct([0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -dotProduct(other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vectors. - -```typescript -// Calculate the dot product between a feature vector and a target vector -Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -dotProduct(other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## FirestoreFunction.dotProduct() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -dotProduct(other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -## FirestoreFunction.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -Field.of("filename").endsWith(".txt"); - -``` - -Signature: - -```typescript -endsWith(suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## FirestoreFunction.endsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string ends with a given postfix (represented as an expression). - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -Field.of("url").endsWith(Field.of("extension")); - -``` - -Signature: - -```typescript -endsWith(suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -## FirestoreFunction.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to another expression. - -```typescript -// Check if the 'age' field is equal to 21 -Field.of("age").eq(21); - -``` - -Signature: - -```typescript -eq(other: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## FirestoreFunction.eq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to "London" -Field.of("city").eq("London"); - -``` - -Signature: - -```typescript -eq(other: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for equality. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance([37.7749, -122.4194]); - -``` - -Signature: - -```typescript -euclideanDistance(other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vectors. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -euclideanDistance(other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.euclideanDistance() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -euclideanDistance(other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | number\[\] | | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -## FirestoreFunction.exists() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists in the document. - -```typescript -// Check if the document has a field named "phoneNumber" -Field.of("phoneNumber").exists(); - -``` - A new `Expr` representing the 'exists' check. - -Signature: - -```typescript -exists(): Exists; -``` -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -## FirestoreFunction.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than another expression. - -```typescript -// Check if the 'age' field is greater than the 'limit' field -Field.of("age").gt(Field.of("limit")); - -``` - -Signature: - -```typescript -gt(other: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## FirestoreFunction.gt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -Field.of("price").gt(100); - -``` - -Signature: - -```typescript -gt(other: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -## FirestoreFunction.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to another expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 -Field.of("quantity").gte(Field.of('requirement').add(1)); - -``` - -Signature: - -```typescript -gte(other: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## FirestoreFunction.gte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -Field.of("score").gte(80); - -``` - -Signature: - -```typescript -gte(other: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -## FirestoreFunction.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -Field.of("category").in("Electronics", Field.of("primaryType")); - -``` - -Signature: - -```typescript -in(...others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values or expressions to check against. A new Expr representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## FirestoreFunction.in() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -in(...others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| others | any\[\] | | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -## FirestoreFunction.isNaN() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression evaluates to 'NaN' (Not a Number). - -```typescript -// Check if the result of a calculation is NaN -Field.of("value").divide(0).isNaN(); - -``` - A new `Expr` representing the 'isNaN' check. - -Signature: - -```typescript -isNaN(): IsNan; -``` -Returns: - -[IsNan](./firestore_lite.isnan.md#isnan_class) - -## FirestoreFunction.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive string comparison. - -```typescript -// Check if the 'title' field contains the word "guide" (case-sensitive) -Field.of("title").like("%guide%"); - -``` - -Signature: - -```typescript -like(pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## FirestoreFunction.like() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -like(pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -## FirestoreFunction.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMax(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMax(other: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## FirestoreFunction.logicalMax() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -Field.of("value").logicalMax(10); - -``` - -Signature: - -```typescript -logicalMax(other: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -## FirestoreFunction.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'timestamp' field and the current timestamp. -Field.of("timestamp").logicalMin(Function.currentTimestamp()); - -``` - -Signature: - -```typescript -logicalMin(other: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## FirestoreFunction.logicalMin() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -Field.of("value").logicalMin(10); - -``` - -Signature: - -```typescript -logicalMin(other: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare with. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -## FirestoreFunction.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than another expression. - -```typescript -// Check if the 'age' field is less than 'limit' -Field.of("age").lt(Field.of('limit')); - -``` - -Signature: - -```typescript -lt(other: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## FirestoreFunction.lt() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -Field.of("price").lt(50); - -``` - -Signature: - -```typescript -lt(other: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -## FirestoreFunction.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to another expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -Field.of("quantity").lte(Constant.of(20)); - -``` - -Signature: - -```typescript -lte(other: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## FirestoreFunction.lte() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -Field.of("score").lte(70); - -``` - -Signature: - -```typescript -lte(other: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -## FirestoreFunction.mapGet() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Accesses a value from a map (object) field using the provided key. - -```typescript -// Get the 'city' value from the 'address' map field -Field.of("address").mapGet("city"); - -``` - -Signature: - -```typescript -mapGet(subfield: string): MapGet; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| subfield | string | The key to access in the map. A new Expr representing the value associated with the given key in the map. | - -Returns: - -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## FirestoreFunction.max() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. - -```typescript -// Find the highest score in a leaderboard -Field.of("score").max().as("highestScore"); - -``` - A new `Accumulator` representing the 'max' aggregation. - -Signature: - -```typescript -max(): Max; -``` -Returns: - -[Max](./firestore_lite.max.md#max_class) - -## FirestoreFunction.min() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. - -```typescript -// Find the lowest price of all products -Field.of("price").min().as("lowestPrice"); - -``` - A new `Accumulator` representing the 'min' aggregation. - -Signature: - -```typescript -min(): Min; -``` -Returns: - -[Min](./firestore_lite.min.md#min_class) - -## FirestoreFunction.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. - -```typescript -// Calculate the remainder of dividing the 'value' field by the 'divisor' field -Field.of("value").mod(Field.of("divisor")); - -``` - -Signature: - -```typescript -mod(other: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## FirestoreFunction.mod() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. - -```typescript -// Calculate the remainder of dividing the 'value' field by 10 -Field.of("value").mod(10); - -``` - -Signature: - -```typescript -mod(other: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to divide by. A new Expr representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -## FirestoreFunction.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by another expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -Field.of("quantity").multiply(Field.of("price")); - -``` - -Signature: - -```typescript -multiply(other: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## FirestoreFunction.multiply() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies this expression by a constant value. - -```typescript -// Multiply the 'value' field by 2 -Field.of("value").multiply(2); - -``` - -Signature: - -```typescript -multiply(other: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to multiply by. A new Expr representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -## FirestoreFunction.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to another expression. - -```typescript -// Check if the 'status' field is not equal to "completed" -Field.of("status").neq("completed"); - -``` - -Signature: - -```typescript -neq(other: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## FirestoreFunction.neq() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if this expression is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -Field.of("country").neq("USA"); - -``` - -Signature: - -```typescript -neq(other: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to compare for inequality. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -## FirestoreFunction.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -Field.of("description").regexContains("(?i)example"); - -``` - -Signature: - -```typescript -regexContains(pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## FirestoreFunction.regexContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains the regular expression stored in field 'regex' -Field.of("description").regexContains(Field.of("regex")); - -``` - -Signature: - -```typescript -regexContains(pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -## FirestoreFunction.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -regexMatch(pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## FirestoreFunction.regexMatch() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a regular expression stored in field 'regex' -Field.of("email").regexMatch(Field.of("regex")); - -``` - -Signature: - -```typescript -regexMatch(pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new Expr representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -## FirestoreFunction.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field -Field.of("message").replaceAll("hello", "hi"); - -``` - -Signature: - -```typescript -replaceAll(find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## FirestoreFunction.replaceAll() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceAll(find: Constant, replace: Constant): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -## FirestoreFunction.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field -Field.of("message").replaceFirst("hello", "hi"); - -``` - -Signature: - -```typescript -replaceFirst(find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## FirestoreFunction.replaceFirst() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, where the substring to find and the replacement substring are specified by expressions. - -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field -Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); - -``` - -Signature: - -```typescript -replaceFirst(find: Constant, replace: Constant): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -## FirestoreFunction.reverse() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses this string expression. - -```typescript -// Reverse the value of the 'myString' field. -Field.of("myString").reverse(); - -``` - A new representing the reversed string. - -Signature: - -```typescript -reverse(): Reverse; -``` -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -## FirestoreFunction.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -Field.of("name").startsWith("Mr."); - -``` - -Signature: - -```typescript -startsWith(prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## FirestoreFunction.startsWith() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string starts with a given prefix (represented as an expression). - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -Field.of("fullName").startsWith(Field.of("firstName")); - -``` - -Signature: - -```typescript -startsWith(prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -## FirestoreFunction.strConcat() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); - -``` - -Signature: - -```typescript -strConcat(...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | Array<string \| [Constant](./firestore_lite.constant.md#constant_class)> | The expressions (typically strings) to concatenate. A new Expr representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## FirestoreFunction.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -Field.of("description").strContains("example"); - -``` - -Signature: - -```typescript -strContains(substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| substring | string | The substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## FirestoreFunction.strContains() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string contains the string represented by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -Field.of("description").strContains(Field.of("keyword")); - -``` - -Signature: - -```typescript -strContains(expr: Constant): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. | - -Returns: - -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -## FirestoreFunction.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts another expression from this expression. - -```typescript -// Subtract the 'discount' field from the 'price' field -Field.of("price").subtract(Field.of("discount")); - -``` - -Signature: - -```typescript -subtract(other: Constant): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## FirestoreFunction.subtract() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a constant value from this expression. - -```typescript -// Subtract 20 from the value of the 'total' field -Field.of("total").subtract(20); - -``` - -Signature: - -```typescript -subtract(other: any): Subtract; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| other | any | The constant value to subtract. A new Expr representing the subtraction operation. | - -Returns: - -[Subtract](./firestore_lite.subtract.md#subtract_class) - -## FirestoreFunction.sum() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. - -```typescript -// Calculate the total revenue from a set of orders -Field.of("orderAmount").sum().as("totalRevenue"); - -``` - A new `Accumulator` representing the 'sum' aggregation. - -Signature: - -```typescript -sum(): Sum; -``` -Returns: - -[Sum](./firestore_lite.sum.md#sum_class) - -## FirestoreFunction.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampAdd(unit: Constant, amount: Constant): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## FirestoreFunction.timestampAdd() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to this timestamp expression. - -```typescript -// Add 1 day to the 'timestamp' field. -Field.of("timestamp").timestampAdd("day", 1); - -``` - -Signature: - -```typescript -timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -## FirestoreFunction.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); - -``` - -Signature: - -```typescript -timestampSub(unit: Constant, amount: Constant): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## FirestoreFunction.timestampSub() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from this timestamp expression. - -```typescript -// Subtract 1 day from the 'timestamp' field. -Field.of("timestamp").timestampSub("day", 1); - -``` - -Signature: - -```typescript -timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## FirestoreFunction.timestampToUnixMicros() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -Field.of("timestamp").timestampToUnixMicros(); - -``` - A new representing the number of microseconds since epoch. - -Signature: - -```typescript -timestampToUnixMicros(): TimestampToUnixMicros; -``` -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -## FirestoreFunction.timestampToUnixMillis() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -Field.of("timestamp").timestampToUnixMillis(); - -``` - A new representing the number of milliseconds since epoch. - -Signature: - -```typescript -timestampToUnixMillis(): TimestampToUnixMillis; -``` -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -## FirestoreFunction.timestampToUnixSeconds() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -Field.of("timestamp").timestampToUnixSeconds(); - -``` - A new representing the number of seconds since epoch. - -Signature: - -```typescript -timestampToUnixSeconds(): TimestampToUnixSeconds; -``` -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -## FirestoreFunction.toLower() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to lowercase. - -```typescript -// Convert the 'name' field to lowercase -Field.of("name").toLower(); - -``` - A new `Expr` representing the lowercase string. - -Signature: - -```typescript -toLower(): ToLower; -``` -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -## FirestoreFunction.toUpper() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string to uppercase. - -```typescript -// Convert the 'title' field to uppercase -Field.of("title").toUpper(); - -``` - A new `Expr` representing the uppercase string. - -Signature: - -```typescript -toUpper(): ToUpper; -``` -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -## FirestoreFunction.trim() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string. - -```typescript -// Trim whitespace from the 'userInput' field -Field.of("userInput").trim(); - -``` - A new `Expr` representing the trimmed string. - -Signature: - -```typescript -trim(): Trim; -``` -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -## FirestoreFunction.unixMicrosToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -Field.of("microseconds").unixMicrosToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMicrosToTimestamp(): UnixMicrosToTimestamp; -``` -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -## FirestoreFunction.unixMillisToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -Field.of("milliseconds").unixMillisToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixMillisToTimestamp(): UnixMillisToTimestamp; -``` -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -## FirestoreFunction.unixSecondsToTimestamp() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -Field.of("seconds").unixSecondsToTimestamp(); - -``` - A new representing the timestamp. - -Signature: - -```typescript -unixSecondsToTimestamp(): UnixSecondsToTimestamp; -``` -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -## FirestoreFunction.vectorLength() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -Field.of("embedding").vectorLength(); - -``` - A new representing the length of the vector. - -Signature: - -```typescript -vectorLength(): VectorLength; -``` -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - diff --git a/docs-devsite/firestore_lite.genericstage.md b/docs-devsite/firestore_lite.genericstage.md deleted file mode 100644 index c2f723c8f50..00000000000 --- a/docs-devsite/firestore_lite.genericstage.md +++ /dev/null @@ -1,65 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenericStage class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class GenericStage implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(name, params)](./firestore_lite.genericstage.md#genericstageconstructor) | | (BETA) Constructs a new instance of the GenericStage class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.genericstage.md#genericstagename) | | string | (BETA) | - -## GenericStage.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `GenericStage` class - -Signature: - -```typescript -constructor(name: string, params: unknown[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | | -| params | unknown\[\] | | - -## GenericStage.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.gt.md b/docs-devsite/firestore_lite.gt.md deleted file mode 100644 index 61c217f58ce..00000000000 --- a/docs-devsite/firestore_lite.gt.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Gt class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Gt extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.gt.md#gtconstructor) | | (BETA) Constructs a new instance of the Gt class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.gt.md#gtfilterable) | | true | (BETA) | - -## Gt.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Gt` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Gt.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.gte.md b/docs-devsite/firestore_lite.gte.md deleted file mode 100644 index 1550dd8daec..00000000000 --- a/docs-devsite/firestore_lite.gte.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Gte class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Gte extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.gte.md#gteconstructor) | | (BETA) Constructs a new instance of the Gte class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.gte.md#gtefilterable) | | true | (BETA) | - -## Gte.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Gte` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Gte.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.if.md b/docs-devsite/firestore_lite.if.md deleted file mode 100644 index c587b2f1f01..00000000000 --- a/docs-devsite/firestore_lite.if.md +++ /dev/null @@ -1,68 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# If class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class If extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(condition, thenExpr, elseExpr)](./firestore_lite.if.md#ifconstructor) | | (BETA) Constructs a new instance of the If class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.if.md#iffilterable) | | true | (BETA) | - -## If.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `If` class - -Signature: - -```typescript -constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterExpr](./firestore_lite.md#filterexpr) | | -| thenExpr | [Constant](./firestore_lite.constant.md#constant_class) | | -| elseExpr | [Constant](./firestore_lite.constant.md#constant_class) | | - -## If.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.in.md b/docs-devsite/firestore_lite.in.md deleted file mode 100644 index 83bd0e57107..00000000000 --- a/docs-devsite/firestore_lite.in.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# In class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class In extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, others)](./firestore_lite.in.md#inconstructor) | | (BETA) Constructs a new instance of the In class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.in.md#infilterable) | | true | (BETA) | - -## In.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `In` class - -Signature: - -```typescript -constructor(left: Constant, others: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - -## In.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.isnan.md b/docs-devsite/firestore_lite.isnan.md deleted file mode 100644 index f3be87e7eb8..00000000000 --- a/docs-devsite/firestore_lite.isnan.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# IsNan class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class IsNan extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.isnan.md#isnanconstructor) | | (BETA) Constructs a new instance of the IsNan class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.isnan.md#isnanfilterable) | | true | (BETA) | - -## IsNan.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `IsNan` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - -## IsNan.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.like.md b/docs-devsite/firestore_lite.like.md deleted file mode 100644 index 67b00346b88..00000000000 --- a/docs-devsite/firestore_lite.like.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Like class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Like extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_lite.like.md#likeconstructor) | | (BETA) Constructs a new instance of the Like class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.like.md#likefilterable) | | true | (BETA) | - -## Like.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Like` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Like.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.limit.md b/docs-devsite/firestore_lite.limit.md deleted file mode 100644 index 4e559293f2a..00000000000 --- a/docs-devsite/firestore_lite.limit.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Limit class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Limit implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(limit)](./firestore_lite.limit.md#limitconstructor) | | (BETA) Constructs a new instance of the Limit class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.limit.md#limitname) | | string | (BETA) | - -## Limit.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Limit` class - -Signature: - -```typescript -constructor(limit: number); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| limit | number | | - -## Limit.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.logicalmax.md b/docs-devsite/firestore_lite.logicalmax.md deleted file mode 100644 index f992776b068..00000000000 --- a/docs-devsite/firestore_lite.logicalmax.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# LogicalMax class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class LogicalMax extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.logicalmax.md#logicalmaxconstructor) | | (BETA) Constructs a new instance of the LogicalMax class | - -## LogicalMax.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `LogicalMax` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.logicalmin.md b/docs-devsite/firestore_lite.logicalmin.md deleted file mode 100644 index 686378b7f56..00000000000 --- a/docs-devsite/firestore_lite.logicalmin.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# LogicalMin class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class LogicalMin extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.logicalmin.md#logicalminconstructor) | | (BETA) Constructs a new instance of the LogicalMin class | - -## LogicalMin.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `LogicalMin` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.lt.md b/docs-devsite/firestore_lite.lt.md deleted file mode 100644 index b44d2f656d0..00000000000 --- a/docs-devsite/firestore_lite.lt.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Lt class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Lt extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.lt.md#ltconstructor) | | (BETA) Constructs a new instance of the Lt class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.lt.md#ltfilterable) | | true | (BETA) | - -## Lt.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Lt` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Lt.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.lte.md b/docs-devsite/firestore_lite.lte.md deleted file mode 100644 index ddde6a08d93..00000000000 --- a/docs-devsite/firestore_lite.lte.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Lte class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Lte extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.lte.md#lteconstructor) | | (BETA) Constructs a new instance of the Lte class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.lte.md#ltefilterable) | | true | (BETA) | - -## Lte.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Lte` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Lte.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.mapget.md b/docs-devsite/firestore_lite.mapget.md deleted file mode 100644 index 617b92d4d5a..00000000000 --- a/docs-devsite/firestore_lite.mapget.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# MapGet class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class MapGet extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(map, name)](./firestore_lite.mapget.md#mapgetconstructor) | | (BETA) Constructs a new instance of the MapGet class | - -## MapGet.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `MapGet` class - -Signature: - -```typescript -constructor(map: Constant, name: string); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| map | [Constant](./firestore_lite.constant.md#constant_class) | | -| name | string | | - diff --git a/docs-devsite/firestore_lite.max.md b/docs-devsite/firestore_lite.max.md deleted file mode 100644 index 185fa011d0a..00000000000 --- a/docs-devsite/firestore_lite.max.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Max class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Max extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_lite.max.md#maxconstructor) | | (BETA) Constructs a new instance of the Max class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_lite.max.md#maxaccumulator) | | true | (BETA) | - -## Max.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Max` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| distinct | boolean | | - -## Max.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md index 2a9a2c55801..da7d304e3d5 100644 --- a/docs-devsite/firestore_lite.md +++ b/docs-devsite/firestore_lite.md @@ -25,637 +25,23 @@ https://github.com/firebase/firebase-js-sdk | [collectionGroup(firestore, collectionId)](./firestore_lite.md#collectiongroup_1838fc3) | Creates and returns a new Query instance that includes all documents in the database that are contained in a collection or subcollection with the given collectionId. | | [connectFirestoreEmulator(firestore, host, port, options)](./firestore_lite.md#connectfirestoreemulator_7c247cd) | Modify this instance to communicate with the Cloud Firestore emulator.Note: This must be called before this instance has been used to do any operations. | | [doc(firestore, path, pathSegments)](./firestore_lite.md#doc_1eb4c23) | Gets a DocumentReference instance that refers to the document at the specified absolute path. | -| [pipeline(firestore)](./firestore_lite.md#pipeline_231a8e0) | Experimental Modular API for console testing. | | [runTransaction(firestore, updateFunction, options)](./firestore_lite.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | | [terminate(firestore)](./firestore_lite.md#terminate_231a8e0) | Terminates the provided Firestore instance.After calling terminate() only the clearIndexedDbPersistence() functions may be used. Any other function will throw a FirestoreError. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved.To restart after termination, create a new instance of Firestore with [getFirestore()](./firestore_.md#getfirestore).Note: Under normal circumstances, calling terminate() is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. | | [writeBatch(firestore)](./firestore_lite.md#writebatch_231a8e0) | Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500.The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. | | function() | | [count()](./firestore_lite.md#count) | Create an AggregateField object that can be used to compute the count of documents in the result set of a query. | -| [countAll()](./firestore_lite.md#countall) | (BETA) Creates an aggregation that counts the total number of stage inputs. -```typescript -// Count the total number of users -countAll().as("totalUsers"); - -``` - A new representing the 'countAll' aggregation. | | [deleteField()](./firestore_lite.md#deletefield) | Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with {merge: true} to mark a field for deletion. | | [documentId()](./firestore_lite.md#documentid) | Returns a special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. | | [getFirestore()](./firestore_lite.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [serverTimestamp()](./firestore_lite.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | -| [useFirestorePipelines()](./firestore_lite.md#usefirestorepipelines) | Copyright 2024 Google LLCLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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. | -| function(array, ...) | -| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_0b3ddb9) | (BETA) Creates an expression that concatenates an array expression with other arrays. -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); - -``` - | -| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_21991c1) | (BETA) Creates an expression that concatenates an array expression with other arrays and/or values. -```typescript -// Combine the 'tags' array with a new array -arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); - -``` - | -| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_f8d5d5e) | (BETA) Creates an expression that concatenates a field's array value with other arrays. -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); - -``` - | -| [arrayConcat(array, elements)](./firestore_lite.md#arrayconcat_5a66d99) | (BETA) Creates an expression that concatenates a field's array value with other arrays and/or values. -```typescript -// Combine the 'tags' array with a new array -arrayConcat("tags", ["newTag1", "newTag2"]); - -``` - | -| [arrayContains(array, element)](./firestore_lite.md#arraycontains_01ea7c0) | (BETA) Creates an expression that checks if an array expression contains a specific element. -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains(Field.of("colors"), Field.of("selectedColor")); - -``` - | -| [arrayContains(array, element)](./firestore_lite.md#arraycontains_60f8f2f) | (BETA) Creates an expression that checks if an array expression contains a specific element. -```typescript -// Check if the 'colors' array contains "red" -arrayContains(Field.of("colors"), "red"); - -``` - | -| [arrayContains(array, element)](./firestore_lite.md#arraycontains_0ebdbfe) | (BETA) Creates an expression that checks if a field's array value contains a specific element. -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains("colors", Field.of("selectedColor")); - -``` - | -| [arrayContains(array, element)](./firestore_lite.md#arraycontains_8f718df) | (BETA) Creates an expression that checks if a field's array value contains a specific value. -```typescript -// Check if the 'colors' array contains "red" -arrayContains("colors", "red"); - -``` - | -| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_7b7433a) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_d919466) | (BETA) Creates an expression that checks if an array expression contains all the specified elements. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAll(array, values)](./firestore_lite.md#arraycontainsall_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains all the specified values or expressions. -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_7b7433a) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_d919466) | (BETA) Creates an expression that checks if an array expression contains any of the specified elements. -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_b40e2df) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - | -| [arrayContainsAny(array, values)](./firestore_lite.md#arraycontainsany_b08efbb) | (BETA) Creates an expression that checks if a field's array value contains any of the specified elements. -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - | -| [arrayLength(array)](./firestore_lite.md#arraylength_0bb5dbb) | (BETA) Creates an expression that calculates the length of an array expression. -```typescript -// Get the number of items in the 'cart' array -arrayLength(Field.of("cart")); - -``` - | -| function(condition, ...) | -| [ifFunction(condition, thenExpr, elseExpr)](./firestore_lite.md#iffunction_f7b2404) | (BETA) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. -```typescript -// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". -ifFunction( - gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); - -``` - | | function(databaseId, ...) | | [getFirestore(databaseId)](./firestore_lite.md#getfirestore_53dc891) | (BETA) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | -| function(element, ...) | -| [inAny(element, others)](./firestore_lite.md#inany_a73b259) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_lite.md#inany_f5721c6) | (BETA) Creates an expression that checks if an expression is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_lite.md#inany_c6646ea) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - | -| [inAny(element, others)](./firestore_lite.md#inany_e6877aa) | (BETA) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", ["Electronics", Field.of("primaryType")]); - -``` - | -| [notInAny(element, others)](./firestore_lite.md#notinany_a73b259) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_lite.md#notinany_f5721c6) | (BETA) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_lite.md#notinany_c6646ea) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - | -| [notInAny(element, others)](./firestore_lite.md#notinany_e6877aa) | (BETA) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", ["pending", Field.of("rejectedStatus")]); - -``` - | | function(elements, ...) | | [arrayRemove(elements)](./firestore_lite.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_lite.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | -| function(expr, ...) | -| [ascending(expr)](./firestore_lite.md#ascending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. -```typescript -// Sort documents by the 'name' field in ascending order -firestore.pipeline().collection("users") - .sort(ascending(Field.of("name"))); - -``` - | -| [byteLength(expr)](./firestore_lite.md#bytelength_f3fb767) | (BETA) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength(Field.of("myString")); - -``` - | -| [charLength(expr)](./firestore_lite.md#charlength_f3fb767) | (BETA) Creates an expression that calculates the character length of a string expression in UTF-8. -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength(Field.of("name")); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_b4c7dc2) | (BETA) Calculates the Cosine distance between a field's vector value and a double array. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", [37.7749, -122.4194]); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_8d2bd9d) | (BETA) Calculates the Cosine distance between a field's vector value and a VectorValue. -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_c9ae0bc) | (BETA) Calculates the Cosine distance between a field's vector value and a vector expression. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance("userVector", Field.of("itemVector")); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_e701952) | (BETA) Calculates the Cosine distance between a vector expression and a double array. -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_cc2e83e) | (BETA) Calculates the Cosine distance between a vector expression and a VectorValue. -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - | -| [cosineDistance(expr, other)](./firestore_lite.md#cosinedistance_0896fbd) | (BETA) Calculates the Cosine distance between two vector expressions. -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance(Field.of("userVector"), Field.of("itemVector")); - -``` - | -| [descending(expr)](./firestore_lite.md#descending_f3fb767) | (BETA) Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") - .sort(descending(Field.of("createdAt"))); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_b4c7dc2) | (BETA) Calculates the dot product between a field's vector value and a double array. -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", [0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_8d2bd9d) | (BETA) Calculates the dot product between a field's vector value and a VectorValue. -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_c9ae0bc) | (BETA) Calculates the dot product between a field's vector value and a vector expression. -```typescript -// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' -dotProduct("docVector1", Field.of("docVector2")); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_e701952) | (BETA) Calculates the dot product between a vector expression and a double array. -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_cc2e83e) | (BETA) Calculates the dot product between a vector expression and a VectorValue. -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); - -``` - | -| [dotProduct(expr, other)](./firestore_lite.md#dotproduct_0896fbd) | (BETA) Calculates the dot product between two vector expressions. -```typescript -// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' -dotProduct(Field.of("docVector1"), Field.of("docVector2")); - -``` - | -| [endsWith(expr, suffix)](./firestore_lite.md#endswith_88569cd) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. -```typescript -// Check if the 'filename' field ends with ".txt" -endsWith("filename", ".txt"); - -``` - | -| [endsWith(expr, suffix)](./firestore_lite.md#endswith_e2e794e) | (BETA) Creates an expression that checks if a field's value ends with a given postfix. -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -endsWith("url", Field.of("extension")); - -``` - | -| [endsWith(expr, suffix)](./firestore_lite.md#endswith_6308b81) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), "Jr."); - -``` - | -| [endsWith(expr, suffix)](./firestore_lite.md#endswith_ab1cc39) | (BETA) Creates an expression that checks if a string expression ends with a given postfix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), Constant.of("Jr.")); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_b4c7dc2) | (BETA) Calculates the Euclidean distance between a field's vector value and a double array. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", [37.7749, -122.4194]); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_8d2bd9d) | (BETA) Calculates the Euclidean distance between a field's vector value and a VectorValue. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_c9ae0bc) | (BETA) Calculates the Euclidean distance between a field's vector value and a vector expression. -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance("pointA", Field.of("pointB")); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_e701952) | (BETA) Calculates the Euclidean distance between a vector expression and a double array. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location - -euclideanDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_cc2e83e) | (BETA) Calculates the Euclidean distance between a vector expression and a VectorValue. -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - | -| [euclideanDistance(expr, other)](./firestore_lite.md#euclideandistance_0896fbd) | (BETA) Calculates the Euclidean distance between two vector expressions. -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance(Field.of("pointA"), Field.of("pointB")); - -``` - | -| [reverse(expr)](./firestore_lite.md#reverse_f3fb767) | (BETA) Creates an expression that reverses a string. -```typescript -// Reverse the value of the 'myString' field. -reverse(Field.of("myString")); - -``` - | -| [startsWith(expr, prefix)](./firestore_lite.md#startswith_484d9f3) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. -```typescript -// Check if the 'name' field starts with "Mr." -startsWith("name", "Mr."); - -``` - | -| [startsWith(expr, prefix)](./firestore_lite.md#startswith_7deb5c7) | (BETA) Creates an expression that checks if a field's value starts with a given prefix. -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -startsWith("fullName", Field.of("firstName")); - -``` - | -| [startsWith(expr, prefix)](./firestore_lite.md#startswith_68300d1) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), "Mr."); - -``` - | -| [startsWith(expr, prefix)](./firestore_lite.md#startswith_5774b68) | (BETA) Creates an expression that checks if a string expression starts with a given prefix. -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), Field.of("prefix")); - -``` - | -| [timestampToUnixMicros(expr)](./firestore_lite.md#timestamptounixmicros_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros(Field.of("timestamp")); - -``` - | -| [timestampToUnixMillis(expr)](./firestore_lite.md#timestamptounixmillis_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis(Field.of("timestamp")); - -``` - | -| [timestampToUnixSeconds(expr)](./firestore_lite.md#timestamptounixseconds_f3fb767) | (BETA) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds(Field.of("timestamp")); - -``` - | -| [toLower(expr)](./firestore_lite.md#tolower_1e536ed) | (BETA) Creates an expression that converts a string field to lowercase. -```typescript -// Convert the 'name' field to lowercase -toLower("name"); - -``` - | -| [toLower(expr)](./firestore_lite.md#tolower_f3fb767) | (BETA) Creates an expression that converts a string expression to lowercase. -```typescript -// Convert the 'name' field to lowercase -toLower(Field.of("name")); - -``` - | -| [toUpper(expr)](./firestore_lite.md#toupper_1e536ed) | (BETA) Creates an expression that converts a string field to uppercase. -```typescript -// Convert the 'title' field to uppercase -toUpper("title"); - -``` - | -| [toUpper(expr)](./firestore_lite.md#toupper_f3fb767) | (BETA) Creates an expression that converts a string expression to uppercase. -```typescript -// Convert the 'title' field to uppercase -toUppercase(Field.of("title")); - -``` - | -| [trim(expr)](./firestore_lite.md#trim_1e536ed) | (BETA) Creates an expression that removes leading and trailing whitespace from a string field. -```typescript -// Trim whitespace from the 'userInput' field -trim("userInput"); - -``` - | -| [trim(expr)](./firestore_lite.md#trim_f3fb767) | (BETA) Creates an expression that removes leading and trailing whitespace from a string expression. -```typescript -// Trim whitespace from the 'userInput' field -trim(Field.of("userInput")); - -``` - | -| [unixMicrosToTimestamp(expr)](./firestore_lite.md#unixmicrostotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp(Field.of("microseconds")); - -``` - | -| [unixMillisToTimestamp(expr)](./firestore_lite.md#unixmillistotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp(Field.of("milliseconds")); - -``` - | -| [unixSecondsToTimestamp(expr)](./firestore_lite.md#unixsecondstotimestamp_f3fb767) | (BETA) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp(Field.of("seconds")); - -``` - | -| [vectorLength(expr)](./firestore_lite.md#vectorlength_f3fb767) | (BETA) Creates an expression that calculates the length of a Firestore Vector. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength(Field.of("embedding")); - -``` - | | function(field, ...) | | [average(field)](./firestore_lite.md#average_aacc3a9) | Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. | -| [byteLength(field)](./firestore_lite.md#bytelength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength("myString"); - -``` - | -| [charLength(field)](./firestore_lite.md#charlength_0fb8cd4) | (BETA) Creates an expression that calculates the character length of a string field in UTF8. -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength("name"); - -``` - | -| [exists(field)](./firestore_lite.md#exists_0fb8cd4) | (BETA) Creates an expression that checks if a field exists. -```typescript -// Check if the document has a field named "phoneNumber" -exists("phoneNumber"); - -``` - | -| [replaceAll(field, find, replace)](./firestore_lite.md#replaceall_b257ab0) | (BETA) Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll("message", "hello", "hi"); - -``` - | -| [replaceFirst(field, find, replace)](./firestore_lite.md#replacefirst_b257ab0) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst("message", "hello", "hi"); - -``` - | -| [reverse(field)](./firestore_lite.md#reverse_0fb8cd4) | (BETA) Creates an expression that reverses a string represented by a field. -```typescript -// Reverse the value of the 'myString' field. -reverse("myString"); - -``` - | | [sum(field)](./firestore_lite.md#sum_aacc3a9) | Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. | -| [timestampAdd(field, unit, amount)](./firestore_lite.md#timestampadd_565792c) | (BETA) Creates an expression that adds a specified amount of time to a timestamp represented by a field. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd("timestamp", "day", 1); - -``` - | -| [timestampSub(field, unit, amount)](./firestore_lite.md#timestampsub_565792c) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub("timestamp", "day", 1); - -``` - | -| [timestampToUnixMicros(field)](./firestore_lite.md#timestamptounixmicros_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros("timestamp"); - -``` - | -| [timestampToUnixMillis(field)](./firestore_lite.md#timestamptounixmillis_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis("timestamp"); - -``` - | -| [timestampToUnixSeconds(field)](./firestore_lite.md#timestamptounixseconds_0fb8cd4) | (BETA) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds("timestamp"); - -``` - | -| [unixMicrosToTimestamp(field)](./firestore_lite.md#unixmicrostotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp("microseconds"); - -``` - | -| [unixMillisToTimestamp(field)](./firestore_lite.md#unixmillistotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp("milliseconds"); - -``` - | -| [unixSecondsToTimestamp(field)](./firestore_lite.md#unixsecondstotimestamp_0fb8cd4) | (BETA) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp("seconds"); - -``` - | -| [vectorLength(field)](./firestore_lite.md#vectorlength_0fb8cd4) | (BETA) Creates an expression that calculates the length of a Firestore Vector represented by a field. -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength("embedding"); - -``` - | | function(fieldPath, ...) | | [orderBy(fieldPath, directionStr)](./firestore_lite.md#orderby_006d61f) | Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending.Note: Documents that do not contain the specified field will not be present in the query result. | | [where(fieldPath, opStr, value)](./firestore_lite.md#where_0fae4bf) | Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. | @@ -664,577 +50,23 @@ vectorLength("embedding"); | [endBefore(fieldValues)](./firestore_lite.md#endbefore_8b2f2c8) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | | [startAfter(fieldValues)](./firestore_lite.md#startafter_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | | [startAt(fieldValues)](./firestore_lite.md#startat_8b2f2c8) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. | -| function(filter, ...) | -| [not(filter)](./firestore_lite.md#not_5520849) | (BETA) Creates an expression that negates a filter condition. -```typescript -// Find documents where the 'completed' field is NOT true -not(eq("completed", true)); - -``` - | -| function(first, ...) | -| [strConcat(first, elements)](./firestore_lite.md#strconcat_0f1bdbf) | (BETA) Creates an expression that concatenates string functions, fields or constants together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat("firstName", " ", Field.of("lastName")); - -``` - | -| [strConcat(first, elements)](./firestore_lite.md#strconcat_1eb0ac1) | (BETA) Creates an expression that concatenates string expressions together. -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat(Field.of("firstName"), " ", Field.of("lastName")); - -``` - | | function(left, ...) | -| [add(left, right)](./firestore_lite.md#add_be96f75) | (BETA) Creates an expression that adds two expressions together. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add(Field.of("quantity"), Field.of("reserve")); - -``` - | -| [add(left, right)](./firestore_lite.md#add_010ba9e) | (BETA) Creates an expression that adds an expression to a constant value. -```typescript -// Add 5 to the value of the 'age' field -add(Field.of("age"), 5); - -``` - | -| [add(left, right)](./firestore_lite.md#add_674c63f) | (BETA) Creates an expression that adds a field's value to an expression. -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add("quantity", Field.of("reserve")); - -``` - | -| [add(left, right)](./firestore_lite.md#add_1f46a76) | (BETA) Creates an expression that adds a field's value to a constant value. -```typescript -// Add 5 to the value of the 'age' field -add("age", 5); - -``` - | | [aggregateFieldEqual(left, right)](./firestore_lite.md#aggregatefieldequal_e80a2b2) | Compares two 'AggregateField\` instances for equality. | | [aggregateQuerySnapshotEqual(left, right)](./firestore_lite.md#aggregatequerysnapshotequal_1529a20) | Compares two AggregateQuerySnapshot instances for equality.Two AggregateQuerySnapshot instances are considered "equal" if they have underlying queries that compare equal, and the same data. | -| [and(left, right)](./firestore_lite.md#and_eba7e36) | (BETA) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. -```typescript -// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND -// the 'status' field is "active" -const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - | -| [divide(left, right)](./firestore_lite.md#divide_be96f75) | (BETA) Creates an expression that divides two expressions. -```typescript -// Divide the 'total' field by the 'count' field -divide(Field.of("total"), Field.of("count")); - -``` - | -| [divide(left, right)](./firestore_lite.md#divide_010ba9e) | (BETA) Creates an expression that divides an expression by a constant value. -```typescript -// Divide the 'value' field by 10 -divide(Field.of("value"), 10); - -``` - | -| [divide(left, right)](./firestore_lite.md#divide_674c63f) | (BETA) Creates an expression that divides a field's value by an expression. -```typescript -// Divide the 'total' field by the 'count' field -divide("total", Field.of("count")); - -``` - | -| [divide(left, right)](./firestore_lite.md#divide_1f46a76) | (BETA) Creates an expression that divides a field's value by a constant value. -```typescript -// Divide the 'value' field by 10 -divide("value", 10); - -``` - | -| [eq(left, right)](./firestore_lite.md#eq_be96f75) | (BETA) Creates an expression that checks if two expressions are equal. -```typescript -// Check if the 'age' field is equal to an expression -eq(Field.of("age"), Field.of("minAge").add(10)); - -``` - | -| [eq(left, right)](./firestore_lite.md#eq_010ba9e) | (BETA) Creates an expression that checks if an expression is equal to a constant value. -```typescript -// Check if the 'age' field is equal to 21 -eq(Field.of("age"), 21); - -``` - | -| [eq(left, right)](./firestore_lite.md#eq_674c63f) | (BETA) Creates an expression that checks if a field's value is equal to an expression. -```typescript -// Check if the 'age' field is equal to the 'limit' field -eq("age", Field.of("limit")); - -``` - | -| [eq(left, right)](./firestore_lite.md#eq_1f46a76) | (BETA) Creates an expression that checks if a field's value is equal to a constant value. -```typescript -// Check if the 'city' field is equal to string constant "London" -eq("city", "London"); - -``` - | -| [gt(left, right)](./firestore_lite.md#gt_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than the second expression. -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), Constant(9).add(9)); - -``` - | -| [gt(left, right)](./firestore_lite.md#gt_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than a constant value. -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), 18); - -``` - | -| [gt(left, right)](./firestore_lite.md#gt_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than an expression. -```typescript -// Check if the value of field 'age' is greater than the value of field 'limit' -gt("age", Field.of("limit")); - -``` - | -| [gt(left, right)](./firestore_lite.md#gt_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than a constant value. -```typescript -// Check if the 'price' field is greater than 100 -gt("price", 100); - -``` - | -| [gte(left, right)](./firestore_lite.md#gte_be96f75) | (BETA) Creates an expression that checks if the first expression is greater than or equal to the second expression. -```typescript -// Check if the 'quantity' field is greater than or equal to the field "threshold" -gte(Field.of("quantity"), Field.of("threshold")); - -``` - | -| [gte(left, right)](./firestore_lite.md#gte_010ba9e) | (BETA) Creates an expression that checks if an expression is greater than or equal to a constant value. -```typescript -// Check if the 'quantity' field is greater than or equal to 10 -gte(Field.of("quantity"), 10); - -``` - | -| [gte(left, right)](./firestore_lite.md#gte_674c63f) | (BETA) Creates an expression that checks if a field's value is greater than or equal to an expression. -```typescript -// Check if the value of field 'age' is greater than or equal to the value of field 'limit' -gte("age", Field.of("limit")); - -``` - | -| [gte(left, right)](./firestore_lite.md#gte_1f46a76) | (BETA) Creates an expression that checks if a field's value is greater than or equal to a constant value. -```typescript -// Check if the 'score' field is greater than or equal to 80 -gte("score", 80); - -``` - | -| [like(left, pattern)](./firestore_lite.md#like_33ec01b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. -```typescript -// Check if the 'title' field contains the string "guide" -like("title", "%guide%"); - -``` - | -| [like(left, pattern)](./firestore_lite.md#like_dd84184) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison against a field. -```typescript -// Check if the 'title' field contains the string "guide" -like("title", Field.of("pattern")); - -``` - | -| [like(left, pattern)](./firestore_lite.md#like_3aaffe0) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), "%guide%"); - -``` - | -| [like(left, pattern)](./firestore_lite.md#like_a2c3e8b) | (BETA) Creates an expression that performs a case-sensitive wildcard string comparison. -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), Field.of("pattern")); - -``` - | -| [logicalMax(left, right)](./firestore_lite.md#logicalmax_be96f75) | (BETA) Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax(Field.of("field1"), Field.of("field2")); - -``` - | -| [logicalMax(left, right)](./firestore_lite.md#logicalmax_010ba9e) | (BETA) Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax(Field.of("value"), 10); - -``` - | -| [logicalMax(left, right)](./firestore_lite.md#logicalmax_674c63f) | (BETA) Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax("field1", Field.of('field2')); - -``` - | -| [logicalMax(left, right)](./firestore_lite.md#logicalmax_1f46a76) | (BETA) Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax("value", 10); - -``` - | -| [logicalMin(left, right)](./firestore_lite.md#logicalmin_be96f75) | (BETA) Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin(Field.of("field1"), Field.of("field2")); - -``` - | -| [logicalMin(left, right)](./firestore_lite.md#logicalmin_010ba9e) | (BETA) Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin(Field.of("value"), 10); - -``` - | -| [logicalMin(left, right)](./firestore_lite.md#logicalmin_674c63f) | (BETA) Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin("field1", Field.of("field2")); - -``` - | -| [logicalMin(left, right)](./firestore_lite.md#logicalmin_1f46a76) | (BETA) Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin("value", 10); - -``` - | -| [lt(left, right)](./firestore_lite.md#lt_be96f75) | (BETA) Creates an expression that checks if the first expression is less than the second expression. -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), Field.of("limit")); - -``` - | -| [lt(left, right)](./firestore_lite.md#lt_010ba9e) | (BETA) Creates an expression that checks if an expression is less than a constant value. -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), 30); - -``` - | -| [lt(left, right)](./firestore_lite.md#lt_674c63f) | (BETA) Creates an expression that checks if a field's value is less than an expression. -```typescript -// Check if the 'age' field is less than the 'limit' field -lt("age", Field.of("limit")); - -``` - | -| [lt(left, right)](./firestore_lite.md#lt_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than a constant value. -```typescript -// Check if the 'price' field is less than 50 -lt("price", 50); - -``` - | -| [lte(left, right)](./firestore_lite.md#lte_be96f75) | (BETA) Creates an expression that checks if the first expression is less than or equal to the second expression. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), Field.of("limit")); - -``` - | -| [lte(left, right)](./firestore_lite.md#lte_010ba9e) | (BETA) Creates an expression that checks if an expression is less than or equal to a constant value. -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), 20); - -``` - | -| [lte(left, right)](./firestore_lite.md#lte_674c63f) | Creates an expression that checks if a field's value is less than or equal to an expression. -```typescript -// Check if the 'quantity' field is less than or equal to the 'limit' field -lte("quantity", Field.of("limit")); - -``` - | -| [lte(left, right)](./firestore_lite.md#lte_1f46a76) | (BETA) Creates an expression that checks if a field's value is less than or equal to a constant value. -```typescript -// Check if the 'score' field is less than or equal to 70 -lte("score", 70); - -``` - | -| [mod(left, right)](./firestore_lite.md#mod_be96f75) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing two expressions. -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod(Field.of("field1"), Field.of("field2")); - -``` - | -| [mod(left, right)](./firestore_lite.md#mod_010ba9e) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod(Field.of("field1"), 5); - -``` - | -| [mod(left, right)](./firestore_lite.md#mod_674c63f) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod("field1", Field.of("field2")); - -``` - | -| [mod(left, right)](./firestore_lite.md#mod_1f46a76) | (BETA) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod("field1", 5); - -``` - | -| [multiply(left, right)](./firestore_lite.md#multiply_be96f75) | (BETA) Creates an expression that multiplies two expressions together. -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply(Field.of("quantity"), Field.of("price")); - -``` - | -| [multiply(left, right)](./firestore_lite.md#multiply_010ba9e) | (BETA) Creates an expression that multiplies an expression by a constant value. -```typescript -// Multiply the value of the 'price' field by 2 -multiply(Field.of("price"), 2); - -``` - | -| [multiply(left, right)](./firestore_lite.md#multiply_674c63f) | (BETA) Creates an expression that multiplies a field's value by an expression. -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply("quantity", Field.of("price")); - -``` - | -| [multiply(left, right)](./firestore_lite.md#multiply_1f46a76) | (BETA) Creates an expression that multiplies a field's value by a constant value. -```typescript -// Multiply the 'value' field by 2 -multiply("value", 2); - -``` - | -| [neq(left, right)](./firestore_lite.md#neq_be96f75) | (BETA) Creates an expression that checks if two expressions are not equal. -```typescript -// Check if the 'status' field is not equal to field 'finalState' -neq(Field.of("status"), Field.of("finalState")); - -``` - | -| [neq(left, right)](./firestore_lite.md#neq_010ba9e) | (BETA) Creates an expression that checks if an expression is not equal to a constant value. -```typescript -// Check if the 'status' field is not equal to "completed" -neq(Field.of("status"), "completed"); - -``` - | -| [neq(left, right)](./firestore_lite.md#neq_674c63f) | (BETA) Creates an expression that checks if a field's value is not equal to an expression. -```typescript -// Check if the 'status' field is not equal to the value of 'expectedStatus' -neq("status", Field.of("expectedStatus")); - -``` - | -| [neq(left, right)](./firestore_lite.md#neq_1f46a76) | (BETA) Creates an expression that checks if a field's value is not equal to a constant value. -```typescript -// Check if the 'country' field is not equal to "USA" -neq("country", "USA"); - -``` - | -| [or(left, right)](./firestore_lite.md#or_eba7e36) | (BETA) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. -```typescript -// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR -// the 'status' field is "active" -const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - | | [queryEqual(left, right)](./firestore_lite.md#queryequal_7a1f045) | Returns true if the provided queries point to the same collection and apply the same constraints. | | [refEqual(left, right)](./firestore_lite.md#refequal_598b780) | Returns true if the provided references are equal. | -| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_33ec01b) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", "(?i)example"); - -``` - | -| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_dd84184) | (BETA) Creates an expression that checks if a string field contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", Field.of("pattern")); - -``` - | -| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_3aaffe0) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), "(?i)example"); - -``` - | -| [regexContains(left, pattern)](./firestore_lite.md#regexcontains_a2c3e8b) | (BETA) Creates an expression that checks if a string expression contains a specified regular expression as a substring. -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), Field.of("pattern")); - -``` - | -| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_33ec01b) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_dd84184) | (BETA) Creates an expression that checks if a string field matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", Field.of("pattern")); - -``` - | -| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_3aaffe0) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - | -| [regexMatch(left, pattern)](./firestore_lite.md#regexmatch_a2c3e8b) | (BETA) Creates an expression that checks if a string expression matches a specified regular expression. -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), Field.of("pattern")); - -``` - | | [snapshotEqual(left, right)](./firestore_lite.md#snapshotequal_5109204) | Returns true if the provided snapshots are equal. | -| [strContains(left, substring)](./firestore_lite.md#strcontains_18eaf5d) | (BETA) Creates an expression that checks if a string field contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -strContains("description", "example"); - -``` - | -| [strContains(left, substring)](./firestore_lite.md#strcontains_f0f1f2f) | (BETA) Creates an expression that checks if a string field contains a substring specified by an expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains("description", Field.of("keyword")); - -``` - | -| [strContains(left, substring)](./firestore_lite.md#strcontains_5fdbd29) | (BETA) Creates an expression that checks if a string expression contains a specified substring. -```typescript -// Check if the 'description' field contains "example". -strContains(Field.of("description"), "example"); - -``` - | -| [strContains(left, substring)](./firestore_lite.md#strcontains_d9d749f) | (BETA) Creates an expression that checks if a string expression contains a substring specified by another expression. -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains(Field.of("description"), Field.of("keyword")); - -``` - | -| [subtract(left, right)](./firestore_lite.md#subtract_be96f75) | (BETA) Creates an expression that subtracts two expressions. -```typescript -// Subtract the 'discount' field from the 'price' field -subtract(Field.of("price"), Field.of("discount")); - -``` - | -| [subtract(left, right)](./firestore_lite.md#subtract_010ba9e) | (BETA) Creates an expression that subtracts a constant value from an expression. -```typescript -// Subtract the constant value 2 from the 'value' field -subtract(Field.of("value"), 2); - -``` - | -| [subtract(left, right)](./firestore_lite.md#subtract_674c63f) | (BETA) Creates an expression that subtracts an expression from a field's value. -```typescript -// Subtract the 'discount' field from the 'price' field -subtract("price", Field.of("discount")); - -``` - | -| [subtract(left, right)](./firestore_lite.md#subtract_1f46a76) | (BETA) Creates an expression that subtracts a constant value from a field's value. -```typescript -// Subtract 20 from the value of the 'total' field -subtract("total", 20); - -``` - | -| [xor(left, right)](./firestore_lite.md#xor_eba7e36) | (BETA) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. -```typescript -// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", -// or 'status' is "active". -const condition = xor( - gt("age", 18), - eq("city", "London"), - eq("status", "active")); - -``` - | | function(limit, ...) | | [limit(limit)](./firestore_lite.md#limit_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. | | [limitToLast(limit)](./firestore_lite.md#limittolast_ec46c78) | Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents.You must specify at least one orderBy clause for limitToLast queries, otherwise an exception will be thrown during execution. | | function(logLevel, ...) | | [setLogLevel(logLevel)](./firestore_lite.md#setloglevel_d02fda2) | Sets the verbosity of Cloud Firestore logs (debug, error, or silent). | -| function(mapExpr, ...) | -| [mapGet(mapExpr, subField)](./firestore_lite.md#mapget_9715f90) | (BETA) Accesses a value from a map (object) expression using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -mapGet(Field.of("address"), "city"); - -``` - | -| function(mapField, ...) | -| [mapGet(mapField, subField)](./firestore_lite.md#mapget_b37bbb6) | (BETA) Accesses a value from a map (object) field using the provided key. -```typescript -// Get the 'city' value from the 'address' map field -mapGet("address", "city"); - -``` - | | function(n, ...) | | [increment(n)](./firestore_lite.md#increment_5685735) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value.If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1.If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. | -| function(name, ...) | -| [genericFunction(name, params)](./firestore_lite.md#genericfunction_b886545) | (BETA) Creates functions that work on the backend but do not exist in the SDK yet. -```typescript -// Call a user defined function named "myFunc" with the arguments 10 and 20 -// This is the same of the 'sum(Field.of("price"))', if it did not exist -genericFunction("sum", [Field.of("price")]); - -``` - | -| function(pipeline, ...) | -| [execute(pipeline)](./firestore_lite.md#execute_86486e6) | (BETA) Modular API for console experimentation. | | function(query, ...) | | [getAggregate(query, aggregateSpec)](./firestore_lite.md#getaggregate_2073a74) | Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents.Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | | [getCount(query)](./firestore_lite.md#getcount_4e56953) | Calculates the number of documents in the result set of the given query without actually downloading the documents.Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). | | [getDocs(query)](./firestore_lite.md#getdocs_4e56953) | Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class).All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. | -| [pipeline(query)](./firestore_lite.md#pipeline_20b2416) | Experimental Modular API for console testing. | | [query(query, compositeFilter, queryConstraints)](./firestore_lite.md#query_9f7b0f4) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | | [query(query, queryConstraints)](./firestore_lite.md#query_0f46da1) | Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. | | function(queryConstraints, ...) | @@ -1256,7281 +88,1488 @@ genericFunction("sum", [Field.of("price")]); | [endAt(snapshot)](./firestore_lite.md#endat_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | | [endBefore(snapshot)](./firestore_lite.md#endbefore_9a4477f) | Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | | [startAfter(snapshot)](./firestore_lite.md#startafter_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. | -| [startAt(snapshot)](./firestore_lite.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | -| function(timestamp, ...) | -| [timestampAdd(timestamp, unit, amount)](./firestore_lite.md#timestampadd_87db576) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampAdd(timestamp, unit, amount)](./firestore_lite.md#timestampadd_46a2d7e) | (BETA) Creates an expression that adds a specified amount of time to a timestamp. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), "day", 1); - -``` - | -| [timestampSub(timestamp, unit, amount)](./firestore_lite.md#timestampsub_87db576) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); - -``` - | -| [timestampSub(timestamp, unit, amount)](./firestore_lite.md#timestampsub_46a2d7e) | (BETA) Creates an expression that subtracts a specified amount of time from a timestamp. -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub(Field.of("timestamp"), "day", 1); - -``` - | -| function(value, ...) | -| [avgFunction(value)](./firestore_lite.md#avgfunction_f83680a) | (BETA) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. -```typescript -// Calculate the average age of users -avg(Field.of("age")).as("averageAge"); - -``` - | -| [avgFunction(value)](./firestore_lite.md#avgfunction_7c807cd) | (BETA) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. -```typescript -// Calculate the average age of users -avg("age").as("averageAge"); - -``` - | -| [exists(value)](./firestore_lite.md#exists_f83680a) | (BETA) Creates an expression that checks if a field exists. -```typescript -// Check if the document has a field named "phoneNumber" -exists(Field.of("phoneNumber")); - -``` - | -| [isNan(value)](./firestore_lite.md#isnan_f83680a) | (BETA) Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -isNaN(Field.of("value").divide(0)); - -``` - | -| [isNan(value)](./firestore_lite.md#isnan_7c807cd) | (BETA) Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). -```typescript -// Check if the result of a calculation is NaN -isNaN("value"); - -``` - | -| [max(value)](./firestore_lite.md#max_f83680a) | (BETA) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -max(Field.of("score")).as("highestScore"); - -``` - | -| [max(value)](./firestore_lite.md#max_7c807cd) | (BETA) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. -```typescript -// Find the highest score in a leaderboard -max("score").as("highestScore"); - -``` - | -| [min(value)](./firestore_lite.md#min_f83680a) | (BETA) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. -```typescript -// Find the lowest price of all products -min(Field.of("price")).as("lowestPrice"); - -``` - | -| [min(value)](./firestore_lite.md#min_7c807cd) | (BETA) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. -```typescript -// Find the lowest price of all products -min("price").as("lowestPrice"); - -``` - | -| [replaceAll(value, find, replace)](./firestore_lite.md#replaceall_f06d323) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll(Field.of("message"), "hello", "hi"); - -``` - | -| [replaceAll(value, find, replace)](./firestore_lite.md#replaceall_26a7926) | (BETA) Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); - -``` - | -| [replaceFirst(value, find, replace)](./firestore_lite.md#replacefirst_f06d323) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst(Field.of("message"), "hello", "hi"); - -``` - | -| [replaceFirst(value, find, replace)](./firestore_lite.md#replacefirst_26a7926) | (BETA) Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); - -``` - | -| [sumFunction(value)](./firestore_lite.md#sumfunction_f83680a) | (BETA) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -sum(Field.of("orderAmount")).as("totalRevenue"); - -``` - | -| [sumFunction(value)](./firestore_lite.md#sumfunction_7c807cd) | (BETA) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. -```typescript -// Calculate the total revenue from a set of orders -sum("orderAmount").as("totalRevenue"); - -``` - | -| function(values, ...) | -| [vector(values)](./firestore_lite.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | - -## Classes - -| Class | Description | -| --- | --- | -| [Add](./firestore_lite.add.md#add_class) | (BETA) | -| [AddFields](./firestore_lite.addfields.md#addfields_class) | (BETA) | -| [Aggregate](./firestore_lite.aggregate.md#aggregate_class) | (BETA) | -| [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | -| [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | -| [And](./firestore_lite.and.md#and_class) | (BETA) | -| [ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) | (BETA) | -| [ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) | (BETA) | -| [ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) | (BETA) | -| [ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) | (BETA) | -| [ArrayElement](./firestore_lite.arrayelement.md#arrayelement_class) | (BETA) | -| [ArrayLength](./firestore_lite.arraylength.md#arraylength_class) | (BETA) | -| [ArrayReverse](./firestore_lite.arrayreverse.md#arrayreverse_class) | (BETA) | -| [Avg](./firestore_lite.avg.md#avg_class) | (BETA) | -| [ByteLength](./firestore_lite.bytelength.md#bytelength_class) | (BETA) | -| [Bytes](./firestore_lite.bytes.md#bytes_class) | An immutable object representing an array of bytes. | -| [CharLength](./firestore_lite.charlength.md#charlength_class) | (BETA) | -| [CollectionGroupSource](./firestore_lite.collectiongroupsource.md#collectiongroupsource_class) | (BETA) | -| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | -| [CollectionSource](./firestore_lite.collectionsource.md#collectionsource_class) | (BETA) | -| [Constant](./firestore_lite.constant.md#constant_class) | (BETA) Represents a constant value that can be used in a Firestore pipeline expression.You can create a Constant instance using the static method: -```typescript -// Create a Constant instance for the number 10 -const ten = Constant.of(10); - -// Create a Constant instance for the string "hello" -const hello = Constant.of("hello"); - -``` - | -| [CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) | (BETA) | -| [Count](./firestore_lite.count.md#count_class) | (BETA) | -| [DatabaseSource](./firestore_lite.databasesource.md#databasesource_class) | (BETA) | -| [Distinct](./firestore_lite.distinct.md#distinct_class) | (BETA) | -| [Divide](./firestore_lite.divide.md#divide_class) | (BETA) | -| [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | -| [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | -| [DocumentsSource](./firestore_lite.documentssource.md#documentssource_class) | (BETA) | -| [DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) | (BETA) | -| [EndsWith](./firestore_lite.endswith.md#endswith_class) | (BETA) | -| [Eq](./firestore_lite.eq.md#eq_class) | (BETA) | -| [EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) | (BETA) | -| [Exists](./firestore_lite.exists.md#exists_class) | (BETA) | -| [ExprWithAlias](./firestore_lite.exprwithalias.md#exprwithalias_class) | (BETA) | -| [Field](./firestore_lite.field.md#field_class) | (BETA) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_.pipeline.md#pipeline_class) stage.

Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.

You can create a Field instance using the static method: -```typescript -// Create a Field instance for the 'name' field -const nameField = Field.of("name"); - -// Create a Field instance for a nested field 'address.city' -const cityField = Field.of("address.city"); - -``` - | -| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | -| [Fields](./firestore_lite.fields.md#fields_class) | (BETA) | -| [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | -| [FindNearest](./firestore_lite.findnearest.md#findnearest_class) | (BETA) | -| [Firestore](./firestore_lite.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | -| [FirestoreError](./firestore_lite.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | -| [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) | (BETA) This class defines the base class for Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like , , or the methods on (, , etc) to construct new Function instances. | -| [GenericStage](./firestore_lite.genericstage.md#genericstage_class) | (BETA) | -| [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | -| [Gt](./firestore_lite.gt.md#gt_class) | (BETA) | -| [Gte](./firestore_lite.gte.md#gte_class) | (BETA) | -| [If](./firestore_lite.if.md#if_class) | (BETA) | -| [In](./firestore_lite.in.md#in_class) | (BETA) | -| [IsNan](./firestore_lite.isnan.md#isnan_class) | (BETA) | -| [Like](./firestore_lite.like.md#like_class) | (BETA) | -| [Limit](./firestore_lite.limit.md#limit_class) | (BETA) | -| [LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) | (BETA) | -| [LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) | (BETA) | -| [Lt](./firestore_lite.lt.md#lt_class) | (BETA) | -| [Lte](./firestore_lite.lte.md#lte_class) | (BETA) | -| [MapGet](./firestore_lite.mapget.md#mapget_class) | (BETA) | -| [Max](./firestore_lite.max.md#max_class) | (BETA) | -| [Min](./firestore_lite.min.md#min_class) | (BETA) | -| [Mod](./firestore_lite.mod.md#mod_class) | (BETA) | -| [Multiply](./firestore_lite.multiply.md#multiply_class) | (BETA) | -| [Neq](./firestore_lite.neq.md#neq_class) | (BETA) | -| [Not](./firestore_lite.not.md#not_class) | (BETA) | -| [Offset](./firestore_lite.offset.md#offset_class) | (BETA) | -| [Or](./firestore_lite.or.md#or_class) | (BETA) | -| [Ordering](./firestore_lite.ordering.md#ordering_class) | (BETA) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. | -| [Pipeline](./firestore_lite.pipeline.md#pipeline_class) | Base-class implementation | -| [PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class) | (BETA) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.

If the PipelineResult represents a non-document result, ref will return a undefined value. | -| [PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) | (BETA) Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). | -| [Query](./firestore_lite.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | -| [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | -| [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | -| [QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | -| [QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | -| [QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | -| [QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | -| [QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | -| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | -| [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | -| [RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) | (BETA) | -| [RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) | (BETA) | -| [ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) | (BETA) | -| [ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) | (BETA) | -| [Reverse](./firestore_lite.reverse.md#reverse_class) | (BETA) | -| [Select](./firestore_lite.select.md#select_class) | (BETA) | -| [Sort](./firestore_lite.sort.md#sort_class) | (BETA) | -| [StartsWith](./firestore_lite.startswith.md#startswith_class) | (BETA) | -| [StrConcat](./firestore_lite.strconcat.md#strconcat_class) | (BETA) | -| [StrContains](./firestore_lite.strcontains.md#strcontains_class) | (BETA) | -| [Subtract](./firestore_lite.subtract.md#subtract_class) | (BETA) | -| [Sum](./firestore_lite.sum.md#sum_class) | (BETA) | -| [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | -| [TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) | (BETA) | -| [TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) | (BETA) | -| [TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) | (BETA) | -| [TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) | (BETA) | -| [TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) | (BETA) | -| [ToLower](./firestore_lite.tolower.md#tolower_class) | (BETA) | -| [ToUpper](./firestore_lite.toupper.md#toupper_class) | (BETA) | -| [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [Trim](./firestore_lite.trim.md#trim_class) | (BETA) | -| [UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) | (BETA) | -| [UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) | (BETA) | -| [UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) | (BETA) | -| [VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) | (BETA) | -| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | -| [Where](./firestore_lite.where.md#where_class) | (BETA) | -| [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | -| [Xor](./firestore_lite.xor.md#xor_class) | (BETA) | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) | (BETA) An interface that represents an accumulator. | -| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | -| [DocumentData](./firestore_lite.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | -| [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) | (BETA) An interface that represents a filter condition. | -| [FindNearestOptions](./firestore_lite.findnearestoptions.md#findnearestoptions_interface) | (BETA) | -| [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | -| [Selectable](./firestore_lite.selectable.md#selectable_interface) | (BETA) An interface that represents a selectable expression. | -| [Settings](./firestore_lite.settings.md#settings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | -| [Stage](./firestore_lite.stage.md#stage_interface) | (BETA) | -| [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | - -## Namespaces - -| Namespace | Description | -| --- | --- | -| [and](./firestore_lite.and.md#and_namespace) | | -| [or](./firestore_lite.or.md#or_namespace) | | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [AccumulatorTarget](./firestore_lite.md#accumulatortarget) | (BETA) An accumulator target, which is an expression with an alias that also implements the Accumulator interface. | -| [AddPrefixToKeys](./firestore_lite.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | -| [AggregateFieldType](./firestore_lite.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | -| [AggregateSpecData](./firestore_lite.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | -| [AggregateType](./firestore_lite.md#aggregatetype) | Union type representing the aggregate type to be performed. | -| [ChildUpdateFields](./firestore_lite.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | -| [ExprType](./firestore_lite.md#exprtype) | (BETA) An enumeration of the different types of expressions. | -| [FilterExpr](./firestore_lite.md#filterexpr) | (BETA) A filter expression, which is an expression that also implements the FilterCondition interface. | -| [FirestoreErrorCode](./firestore_lite.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | -| [NestedUpdateFields](./firestore_lite.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | -| [OrderByDirection](./firestore_lite.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | -| [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | -| [Primitive](./firestore_lite.md#primitive) | Primitive types. | -| [QueryConstraintType](./firestore_lite.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | -| [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | -| [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | -| [SelectableExpr](./firestore_lite.md#selectableexpr) | (BETA) A selectable expression, which is an expression that also implements the Selectable interface. | -| [SetOptions](./firestore_lite.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | -| [UnionToIntersection](./firestore_lite.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | -| [UpdateData](./firestore_lite.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | -| [WhereFilterOp](./firestore_lite.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | -| [WithFieldValue](./firestore_lite.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | - -## function(app, ...) - -### getFirestore(app) {:#getfirestore_cf608e1} - -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(app: FirebaseApp): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | - -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### getFirestore(app, databaseId) {:#getfirestore_48de6cb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### initializeFirestore(app, settings) {:#initializefirestore_87c6318} - -Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). - -Signature: - -```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | -| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | - -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -A newly initialized `Firestore` instance. - -### initializeFirestore(app, settings, databaseId) {:#initializefirestore_37baaaf} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). - -Signature: - -```typescript -export declare function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | -| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -A newly initialized `Firestore` instance. - -## function(firestore, ...) - -### collection(firestore, path, pathSegments) {:#collection_1eb4c23} - -Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. - -Signature: - -```typescript -export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | - -Returns: - -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions - -If the final path has an even number of segments and does not point to a collection. - -### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} - -Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. - -Signature: - -```typescript -export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | - -Returns: - -[Query](./firestore_lite.query.md#query_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The created `Query`. - -### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} - -Modify this instance to communicate with the Cloud Firestore emulator. - -Note: This must be called before this instance has been used to do any operations. - -Signature: - -```typescript -export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { - mockUserToken?: EmulatorMockTokenOptions | string; -}): void; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | -| host | string | the emulator host (ex: localhost). | -| port | number | the emulator port (ex: 9000). | -| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | - -Returns: - -void - -### doc(firestore, path, pathSegments) {:#doc_1eb4c23} - -Gets a `DocumentReference` instance that refers to the document at the specified absolute path. - -Signature: - -```typescript -export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | - -Returns: - -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. - -#### Exceptions - -If the final path has an odd number of segments and does not point to a document. - -### pipeline(firestore) {:#pipeline_231a8e0} - -Experimental Modular API for console testing. - -Signature: - -```typescript -export declare function pipeline(firestore: Firestore): PipelineSource; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | - -Returns: - -[PipelineSource](./firestore_lite.pipelinesource.md#pipelinesource_class) - -### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} - -Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. - -The maximum number of writes allowed in a single transaction is 500. - -Signature: - -```typescript -export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | -| updateFunction | (transaction: [Transaction](./firestore_lite.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | -| options | [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | - -Returns: - -Promise<T> - -If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. - -### terminate(firestore) {:#terminate_231a8e0} - -Terminates the provided `Firestore` instance. - -After calling `terminate()` only the `clearIndexedDbPersistence()` functions may be used. Any other function will throw a `FirestoreError`. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. - -To restart after termination, create a new instance of `Firestore` with [getFirestore()](./firestore_.md#getfirestore). - -Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. - -Signature: - -```typescript -export declare function terminate(firestore: Firestore): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to terminate. | - -Returns: - -Promise<void> - -A `Promise` that is resolved when the instance has been successfully terminated. - -### writeBatch(firestore) {:#writebatch_231a8e0} - -Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500. - -The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. - -Signature: - -```typescript -export declare function writeBatch(firestore: Firestore): WriteBatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | - -Returns: - -[WriteBatch](./firestore_lite.writebatch.md#writebatch_class) - -A `WriteBatch` that can be used to atomically execute multiple writes. - -## function() - -### count() {:#count} - -Create an AggregateField object that can be used to compute the count of documents in the result set of a query. - -Signature: - -```typescript -export declare function count(): AggregateField; -``` -Returns: - -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> - -### countAll() {:#countall} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an aggregation that counts the total number of stage inputs. - -```typescript -// Count the total number of users -countAll().as("totalUsers"); - -``` - A new representing the 'countAll' aggregation. - -Signature: - -```typescript -export declare function countAll(): Count; -``` -Returns: - -[Count](./firestore_lite.count.md#count_class) - -### deleteField() {:#deletefield} - -Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. - -Signature: - -```typescript -export declare function deleteField(): FieldValue; -``` -Returns: - -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) - -### documentId() {:#documentid} - -Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. - -Signature: - -```typescript -export declare function documentId(): FieldPath; -``` -Returns: - -[FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) - -### getFirestore() {:#getfirestore} - -Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(): Firestore; -``` -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -### serverTimestamp() {:#servertimestamp} - -Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. - -Signature: - -```typescript -export declare function serverTimestamp(): FieldValue; -``` -Returns: - -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) - -### useFirestorePipelines() {:#usefirestorepipelines} - - Copyright 2024 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. - -Signature: - -```typescript -export declare function useFirestorePipelines(): void; -``` -Returns: - -void - -## function(array, ...) - -### arrayConcat(array, elements) {:#arrayconcat_0b3ddb9} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with other arrays. - -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to concatenate to. | -| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_21991c1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates an array expression with other arrays and/or values. - -```typescript -// Combine the 'tags' array with a new array -arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: Constant, elements: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to concatenate to. | -| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_f8d5d5e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates a field's array value with other arrays. - -```typescript -// Combine the 'items' array with two new item arrays -arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: string, elements: Constant[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name containing array values. | -| elements | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The array expressions to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -### arrayConcat(array, elements) {:#arrayconcat_5a66d99} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates a field's array value with other arrays and/or values. - -```typescript -// Combine the 'tags' array with a new array -arrayConcat("tags", ["newTag1", "newTag2"]); - -``` - -Signature: - -```typescript -export declare function arrayConcat(array: string, elements: any[]): ArrayConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name containing array values. | -| elements | any\[\] | The array expressions or single values to concatenate. A new representing the concatenated array. | - -Returns: - -[ArrayConcat](./firestore_lite.arrayconcat.md#arrayconcat_class) - -### arrayContains(array, element) {:#arraycontains_01ea7c0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains a specific element. - -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains(Field.of("colors"), Field.of("selectedColor")); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: Constant, element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_60f8f2f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains a specific element. - -```typescript -// Check if the 'colors' array contains "red" -arrayContains(Field.of("colors"), "red"); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: Constant, element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_0ebdbfe} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains a specific element. - -```typescript -// Check if the 'colors' array contains the value of field 'selectedColor' -arrayContains("colors", Field.of("selectedColor")); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: string, element: Constant): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -### arrayContains(array, element) {:#arraycontains_8f718df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains a specific value. - -```typescript -// Check if the 'colors' array contains "red" -arrayContains("colors", "red"); - -``` - -Signature: - -```typescript -export declare function arrayContains(array: string, element: any): ArrayContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| element | any | The element to search for in the array. A new representing the 'array\_contains' comparison. | - -Returns: - -[ArrayContains](./firestore_lite.arraycontains.md#arraycontains_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_7b7433a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_d919466} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains all the specified elements. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" -arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_b40e2df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains all the specified values or expressions. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAll(array, values) {:#arraycontainsall_b08efbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains all the specified values or expressions. - -```typescript -// Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" -arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_all' comparison. | - -Returns: - -[ArrayContainsAll](./firestore_lite.arraycontainsall.md#arraycontainsall_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_7b7433a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_d919466} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an array expression contains any of the specified elements. - -```typescript -// Check if the 'categories' array contains either values from field "cate1" or "Science" -arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_b40e2df} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -### arrayContainsAny(array, values) {:#arraycontainsany_b08efbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's array value contains any of the specified elements. - -```typescript -// Check if the 'groups' array contains either the value from the 'userGroup' field -// or the value "guest" -arrayContainsAny("categories", [Field.of("cate1"), "Science"]); - -``` - -Signature: - -```typescript -export declare function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | string | The field name to check. | -| values | any\[\] | The elements to check for in the array. A new representing the 'array\_contains\_any' comparison. | - -Returns: - -[ArrayContainsAny](./firestore_lite.arraycontainsany.md#arraycontainsany_class) - -### arrayLength(array) {:#arraylength_0bb5dbb} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of an array expression. - -```typescript -// Get the number of items in the 'cart' array -arrayLength(Field.of("cart")); - -``` - -Signature: - -```typescript -export declare function arrayLength(array: Constant): ArrayLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| array | [Constant](./firestore_lite.constant.md#constant_class) | The array expression to calculate the length of. A new representing the length of the array. | - -Returns: - -[ArrayLength](./firestore_lite.arraylength.md#arraylength_class) - -## function(condition, ...) - -### ifFunction(condition, thenExpr, elseExpr) {:#iffunction_f7b2404} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. - -```typescript -// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". -ifFunction( - gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); - -``` - -Signature: - -```typescript -export declare function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterExpr](./firestore_lite.md#filterexpr) | The condition to evaluate. | -| thenExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to evaluate if the condition is true. | -| elseExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. | - -Returns: - -[If](./firestore_lite.if.md#if_class) - -## function(databaseId, ...) - -### getFirestore(databaseId) {:#getfirestore_53dc891} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. - -Signature: - -```typescript -export declare function getFirestore(databaseId: string): Firestore; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| databaseId | string | The name of the database. | - -Returns: - -[Firestore](./firestore_lite.firestore.md#firestore_class) - -The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. - -## function(element, ...) - -### inAny(element, others) {:#inany_a73b259} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: Constant, others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -### inAny(element, others) {:#inany_f5721c6} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: Constant, others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -### inAny(element, others) {:#inany_c6646ea} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: string, others: Constant[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field to compare. | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -### inAny(element, others) {:#inany_e6877aa} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to any of the provided values or expressions. - -```typescript -// Check if the 'category' field is either "Electronics" or value of field 'primaryType' -inAny("category", ["Electronics", Field.of("primaryType")]); - -``` - -Signature: - -```typescript -export declare function inAny(element: string, others: any[]): In; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field to compare. | -| others | any\[\] | The values to check against. A new representing the 'IN' comparison. | - -Returns: - -[In](./firestore_lite.in.md#in_class) - -### notInAny(element, others) {:#notinany_a73b259} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: Constant, others: Constant[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_lite.not.md#not_class) - -### notInAny(element, others) {:#notinany_f5721c6} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: Constant, others: any[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_lite.not.md#not_class) - -### notInAny(element, others) {:#notinany_c6646ea} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: string, others: Constant[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field name to compare. | -| others | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_lite.not.md#not_class) - -### notInAny(element, others) {:#notinany_e6877aa} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. - -```typescript -// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' -notInAny("status", ["pending", Field.of("rejectedStatus")]); - -``` - -Signature: - -```typescript -export declare function notInAny(element: string, others: any[]): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| element | string | The field name to compare. | -| others | any\[\] | The values to check against. A new representing the 'NOT IN' comparison. | - -Returns: - -[Not](./firestore_lite.not.md#not_class) - -## function(elements, ...) - -### arrayRemove(elements) {:#arrayremove_7d853aa} - -Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. - -Signature: - -```typescript -export declare function arrayRemove(...elements: unknown[]): FieldValue; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | unknown\[\] | The elements to remove from the array. | - -Returns: - -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) - -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` - -### arrayUnion(elements) {:#arrayunion_7d853aa} - -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. - -Signature: - -```typescript -export declare function arrayUnion(...elements: unknown[]): FieldValue; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| elements | unknown\[\] | The elements to union into the array. | - -Returns: - -[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) - -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. - -## function(expr, ...) - -### ascending(expr) {:#ascending_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. - -```typescript -// Sort documents by the 'name' field in ascending order -firestore.pipeline().collection("users") - .sort(ascending(Field.of("name"))); - -``` - -Signature: - -```typescript -export declare function ascending(expr: Constant): Ordering; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to create an ascending ordering for. A new Ordering for ascending sorting. | - -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -### byteLength(expr) {:#bytelength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. - -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength(Field.of("myString")); - -``` - -Signature: - -```typescript -export declare function byteLength(expr: Constant): ByteLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string. A new representing the length of the string in bytes. | - -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -### charLength(expr) {:#charlength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string expression in UTF-8. - -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength(Field.of("name")); - -``` - -Signature: - -```typescript -export declare function charLength(expr: Constant): CharLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to calculate the length of. A new representing the length of the string. | - -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -### cosineDistance(expr, other) {:#cosinedistance_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a double array. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a VectorValue. - -```typescript -// Calculate the Cosine distance between the 'location' field and a target location -cosineDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a field's vector value and a vector expression. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance("userVector", Field.of("itemVector")); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: string, other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a vector expression and a double array. - -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: number[]): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between a vector expression and a VectorValue. - -```typescript -// Calculate the cosine distance between the 'location' field and a target location -cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### cosineDistance(expr, other) {:#cosinedistance_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Cosine distance between two vector expressions. - -```typescript -// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field -cosineDistance(Field.of("userVector"), Field.of("itemVector")); - -``` - -Signature: - -```typescript -export declare function cosineDistance(expr: Constant, other: Constant): CosineDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. | - -Returns: - -[CosineDistance](./firestore_lite.cosinedistance.md#cosinedistance_class) - -### descending(expr) {:#descending_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an [Ordering](./firestore_.ordering.md#ordering_class) that sorts documents in descending order based on this expression. - -```typescript -// Sort documents by the 'createdAt' field in descending order -firestore.pipeline().collection("users") - .sort(descending(Field.of("createdAt"))); - -``` - -Signature: - -```typescript -export declare function descending(expr: Constant): Ordering; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. | - -Returns: - -[Ordering](./firestore_lite.ordering.md#ordering_class) - -### dotProduct(expr, other) {:#dotproduct_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a double array. - -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", [0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a VectorValue. - -```typescript -// Calculate the dot product distance between a feature vector and a target vector -dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a field's vector value and a vector expression. - -```typescript -// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' -dotProduct("docVector1", Field.of("docVector2")); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: string, other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a vector expression and a double array. - -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: number[]): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | number\[\] | The other vector (as an array of doubles) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between a vector expression and a VectorValue. - -```typescript -// Calculate the dot product between a feature vector and a target vector -dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: VectorValue): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### dotProduct(expr, other) {:#dotproduct_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the dot product between two vector expressions. - -```typescript -// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' -dotProduct(Field.of("docVector1"), Field.of("docVector2")); - -``` - -Signature: - -```typescript -export declare function dotProduct(expr: Constant, other: Constant): DotProduct; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to calculate with. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. | - -Returns: - -[DotProduct](./firestore_lite.dotproduct.md#dotproduct_class) - -### endsWith(expr, suffix) {:#endswith_88569cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value ends with a given postfix. - -```typescript -// Check if the 'filename' field ends with ".txt" -endsWith("filename", ".txt"); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: string, suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_e2e794e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value ends with a given postfix. - -```typescript -// Check if the 'url' field ends with the value of the 'extension' field -endsWith("url", Field.of("extension")); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: string, suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the postfix. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_6308b81} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression ends with a given postfix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), "Jr."); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: Constant, suffix: string): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | -| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -### endsWith(expr, suffix) {:#endswith_ab1cc39} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression ends with a given postfix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." -endsWith(Field.of("fullName"), Constant.of("Jr.")); - -``` - -Signature: - -```typescript -export declare function endsWith(expr: Constant, suffix: Constant): EndsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | -| suffix | [Constant](./firestore_lite.constant.md#constant_class) | The postfix to check for. A new representing the 'ends with' comparison. | - -Returns: - -[EndsWith](./firestore_lite.endswith.md#endswith_class) - -### euclideanDistance(expr, other) {:#euclideandistance_b4c7dc2} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a double array. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_8d2bd9d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a VectorValue. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance("location", new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_c9ae0bc} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a field's vector value and a vector expression. - -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance("pointA", Field.of("pointB")); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: string, other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the first vector. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_e701952} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a vector expression and a double array. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location - -euclideanDistance(Field.of("location"), [37.7749, -122.4194]); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | number\[\] | The other vector (as an array of doubles) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_cc2e83e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between a vector expression and a VectorValue. - -```typescript -// Calculate the Euclidean distance between the 'location' field and a target location -euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as a VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### euclideanDistance(expr, other) {:#euclideandistance_0896fbd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Calculates the Euclidean distance between two vector expressions. - -```typescript -// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' -euclideanDistance(Field.of("pointA"), Field.of("pointB")); - -``` - -Signature: - -```typescript -export declare function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The first vector (represented as an Expr) to compare against. | -| other | [Constant](./firestore_lite.constant.md#constant_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. | - -Returns: - -[EuclideanDistance](./firestore_lite.euclideandistance.md#euclideandistance_class) - -### reverse(expr) {:#reverse_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses a string. - -```typescript -// Reverse the value of the 'myString' field. -reverse(Field.of("myString")); - -``` - -Signature: - -```typescript -export declare function reverse(expr: Constant): Reverse; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to reverse. A new representing the reversed string. | - -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -### startsWith(expr, prefix) {:#startswith_484d9f3} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value starts with a given prefix. - -```typescript -// Check if the 'name' field starts with "Mr." -startsWith("name", "Mr."); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: string, prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_7deb5c7} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value starts with a given prefix. - -```typescript -// Check if the 'fullName' field starts with the value of the 'firstName' field -startsWith("fullName", Field.of("firstName")); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: string, prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The field name to check. | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the prefix. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_68300d1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression starts with a given prefix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), "Mr."); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: Constant, prefix: string): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | -| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -### startsWith(expr, prefix) {:#startswith_5774b68} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression starts with a given prefix. - -```typescript -// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." -startsWith(Field.of("fullName"), Field.of("prefix")); - -``` - -Signature: - -```typescript -export declare function startsWith(expr: Constant, prefix: Constant): StartsWith; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | The prefix to check for. A new representing the 'starts with' comparison. | - -Returns: - -[StartsWith](./firestore_lite.startswith.md#startswith_class) - -### timestampToUnixMicros(expr) {:#timestamptounixmicros_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. | - -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -### timestampToUnixMillis(expr) {:#timestamptounixmillis_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. | - -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -### timestampToUnixSeconds(expr) {:#timestamptounixseconds_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds(Field.of("timestamp")); - -``` - -Signature: - -```typescript -export declare function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. | - -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -### toLower(expr) {:#tolower_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string field to lowercase. - -```typescript -// Convert the 'name' field to lowercase -toLower("name"); - -``` - -Signature: - -```typescript -export declare function toLower(expr: string): ToLower; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the lowercase string. | - -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -### toLower(expr) {:#tolower_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string expression to lowercase. - -```typescript -// Convert the 'name' field to lowercase -toLower(Field.of("name")); - -``` - -Signature: - -```typescript -export declare function toLower(expr: Constant): ToLower; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to convert to lowercase. A new representing the lowercase string. | - -Returns: - -[ToLower](./firestore_lite.tolower.md#tolower_class) - -### toUpper(expr) {:#toupper_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string field to uppercase. - -```typescript -// Convert the 'title' field to uppercase -toUpper("title"); - -``` - -Signature: - -```typescript -export declare function toUpper(expr: string): ToUpper; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the uppercase string. | - -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -### toUpper(expr) {:#toupper_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a string expression to uppercase. - -```typescript -// Convert the 'title' field to uppercase -toUppercase(Field.of("title")); - -``` - -Signature: - -```typescript -export declare function toUpper(expr: Constant): ToUpper; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to convert to uppercase. A new representing the uppercase string. | - -Returns: - -[ToUpper](./firestore_lite.toupper.md#toupper_class) - -### trim(expr) {:#trim_1e536ed} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string field. - -```typescript -// Trim whitespace from the 'userInput' field -trim("userInput"); - -``` - -Signature: - -```typescript -export declare function trim(expr: string): Trim; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | string | The name of the field containing the string. A new representing the trimmed string. | - -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -### trim(expr) {:#trim_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that removes leading and trailing whitespace from a string expression. - -```typescript -// Trim whitespace from the 'userInput' field -trim(Field.of("userInput")); - -``` - -Signature: - -```typescript -export declare function trim(expr: Constant): Trim; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to trim. A new representing the trimmed string. | - -Returns: - -[Trim](./firestore_lite.trim.md#trim_class) - -### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp(Field.of("microseconds")); - -``` - -Signature: - -```typescript -export declare function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp(Field.of("milliseconds")); - -``` - -Signature: - -```typescript -export declare function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp(Field.of("seconds")); - -``` - -Signature: - -```typescript -export declare function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -### vectorLength(expr) {:#vectorlength_f3fb767} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a Firestore Vector. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength(Field.of("embedding")); - -``` - -Signature: - -```typescript -export declare function vectorLength(expr: Constant): VectorLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the Firestore Vector. A new representing the length of the array. | - -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - -## function(field, ...) - -### average(field) {:#average_aacc3a9} - -Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. - -Signature: - -```typescript -export declare function average(field: string | FieldPath): AggregateField; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | - -Returns: - -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number \| null> - -### byteLength(field) {:#bytelength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. - -```typescript -// Calculate the length of the 'myString' field in bytes. -byteLength("myString"); - -``` - -Signature: - -```typescript -export declare function byteLength(field: string): ByteLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string. A new representing the length of the string in bytes. | - -Returns: - -[ByteLength](./firestore_lite.bytelength.md#bytelength_class) - -### charLength(field) {:#charlength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the character length of a string field in UTF8. - -```typescript -// Get the character length of the 'name' field in UTF-8. -strLength("name"); - -``` - -Signature: - -```typescript -export declare function charLength(field: string): CharLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field containing the string. A new representing the length of the string. | - -Returns: - -[CharLength](./firestore_lite.charlength.md#charlength_class) - -### exists(field) {:#exists_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field exists. - -```typescript -// Check if the document has a field named "phoneNumber" -exists("phoneNumber"); - -``` - -Signature: - -```typescript -export declare function exists(field: string): Exists; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The field name to check. A new representing the 'exists' check. | - -Returns: - -[Exists](./firestore_lite.exists.md#exists_class) - -### replaceAll(field, find, replace) {:#replaceall_b257ab0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. - -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll("message", "hello", "hi"); - -``` - -Signature: - -```typescript -export declare function replaceAll(field: string, find: string, replace: string): ReplaceAll; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | - -Returns: - -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) - -### replaceFirst(field, find, replace) {:#replacefirst_b257ab0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. - -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst("message", "hello", "hi"); - -``` - -Signature: - -```typescript -export declare function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | - -Returns: - -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -### reverse(field) {:#reverse_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that reverses a string represented by a field. - -```typescript -// Reverse the value of the 'myString' field. -reverse("myString"); - -``` - -Signature: - -```typescript -export declare function reverse(field: string): Reverse; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the string to reverse. A new representing the reversed string. | - -Returns: - -[Reverse](./firestore_lite.reverse.md#reverse_class) - -### sum(field) {:#sum_aacc3a9} - -Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. - -Signature: - -```typescript -export declare function sum(field: string | FieldPath): AggregateField; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | - -Returns: - -[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> - -### timestampAdd(field, unit, amount) {:#timestampadd_565792c} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a specified amount of time to a timestamp represented by a field. - -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd("timestamp", "day", 1); - -``` - -Signature: - -```typescript -export declare function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | - -Returns: - -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -### timestampSub(field, unit, amount) {:#timestampsub_565792c} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. - -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub("timestamp", "day", 1); - -``` - -Signature: - -```typescript -export declare function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | - -Returns: - -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -### timestampToUnixMicros(field) {:#timestamptounixmicros_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to microseconds since epoch. -timestampToUnixMicros("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMicros(field: string): TimestampToUnixMicros; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. | - -Returns: - -[TimestampToUnixMicros](./firestore_lite.timestamptounixmicros.md#timestamptounixmicros_class) - -### timestampToUnixMillis(field) {:#timestamptounixmillis_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to milliseconds since epoch. -timestampToUnixMillis("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixMillis(field: string): TimestampToUnixMillis; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. | - -Returns: - -[TimestampToUnixMillis](./firestore_lite.timestamptounixmillis.md#timestamptounixmillis_class) - -### timestampToUnixSeconds(field) {:#timestamptounixseconds_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). - -```typescript -// Convert the 'timestamp' field to seconds since epoch. -timestampToUnixSeconds("timestamp"); - -``` - -Signature: - -```typescript -export declare function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. | - -Returns: - -[TimestampToUnixSeconds](./firestore_lite.timestamptounixseconds.md#timestamptounixseconds_class) - -### unixMicrosToTimestamp(field) {:#unixmicrostotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'microseconds' field as microseconds since epoch. -unixMicrosToTimestamp("microseconds"); - -``` - -Signature: - -```typescript -export declare function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMicrosToTimestamp](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestamp_class) - -### unixMillisToTimestamp(field) {:#unixmillistotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'milliseconds' field as milliseconds since epoch. -unixMillisToTimestamp("milliseconds"); - -``` - -Signature: - -```typescript -export declare function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixMillisToTimestamp](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestamp_class) - -### unixSecondsToTimestamp(field) {:#unixsecondstotimestamp_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. - -```typescript -// Interpret the 'seconds' field as seconds since epoch. -unixSecondsToTimestamp("seconds"); - -``` - -Signature: - -```typescript -export declare function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. | - -Returns: - -[UnixSecondsToTimestamp](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestamp_class) - -### vectorLength(field) {:#vectorlength_0fb8cd4} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the length of a Firestore Vector represented by a field. - -```typescript -// Get the vector length (dimension) of the field 'embedding'. -vectorLength("embedding"); - -``` - -Signature: - -```typescript -export declare function vectorLength(field: string): VectorLength; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| field | string | The name of the field representing the Firestore Vector. A new representing the length of the array. | - -Returns: - -[VectorLength](./firestore_lite.vectorlength.md#vectorlength_class) - -## function(fieldPath, ...) - -### orderBy(fieldPath, directionStr) {:#orderby_006d61f} - -Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. - -Note: Documents that do not contain the specified field will not be present in the query result. - -Signature: - -```typescript -export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The field to sort by. | -| directionStr | [OrderByDirection](./firestore_lite.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | - -Returns: - -[QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) - -The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). - -### where(fieldPath, opStr, value) {:#where_0fae4bf} - -Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. - -Signature: - -```typescript -export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The path to compare | -| opStr | [WhereFilterOp](./firestore_lite.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | -| value | unknown | The value for comparison | - -Returns: - -[QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) - -The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). - -## function(fieldValues, ...) - -### endAt(fieldValues) {:#endat_8b2f2c8} - -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | - -Returns: - -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) - -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` - -### endBefore(fieldValues) {:#endbefore_8b2f2c8} - -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | - -Returns: - -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) - -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` - -### startAfter(fieldValues) {:#startafter_8b2f2c8} - -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | - -Returns: - -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` - -### startAt(fieldValues) {:#startat_8b2f2c8} - -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. - -Signature: - -```typescript -export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | - -Returns: - -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. - -## function(filter, ...) - -### not(filter) {:#not_5520849} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that negates a filter condition. - -```typescript -// Find documents where the 'completed' field is NOT true -not(eq("completed", true)); - -``` - -Signature: - -```typescript -export declare function not(filter: FilterExpr): Not; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| filter | [FilterExpr](./firestore_lite.md#filterexpr) | The filter condition to negate. A new representing the negated filter condition. | - -Returns: - -[Not](./firestore_lite.not.md#not_class) - -## function(first, ...) - -### strConcat(first, elements) {:#strconcat_0f1bdbf} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string functions, fields or constants together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat("firstName", " ", Field.of("lastName")); - -``` - -Signature: - -```typescript -export declare function strConcat(first: string, ...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | string | The field name containing the initial string value. | -| elements | Array<[Constant](./firestore_lite.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -### strConcat(first, elements) {:#strconcat_1eb0ac1} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that concatenates string expressions together. - -```typescript -// Combine the 'firstName', " ", and 'lastName' fields into a single string -strConcat(Field.of("firstName"), " ", Field.of("lastName")); - -``` - -Signature: - -```typescript -export declare function strConcat(first: Constant, ...elements: Array): StrConcat; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | [Constant](./firestore_lite.constant.md#constant_class) | The initial string expression to concatenate to. | -| elements | Array<[Constant](./firestore_lite.constant.md#constant_class) \| string> | The expressions (typically strings) to concatenate. A new representing the concatenated string. | - -Returns: - -[StrConcat](./firestore_lite.strconcat.md#strconcat_class) - -## function(left, ...) - -### add(left, right) {:#add_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds two expressions together. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add(Field.of("quantity"), Field.of("reserve")); - -``` - -Signature: - -```typescript -export declare function add(left: Constant, right: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to add. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -### add(left, right) {:#add_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds an expression to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -add(Field.of("age"), 5); - -``` - -Signature: - -```typescript -export declare function add(left: Constant, right: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add to. | -| right | any | The constant value to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -### add(left, right) {:#add_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a field's value to an expression. - -```typescript -// Add the value of the 'quantity' field and the 'reserve' field. -add("quantity", Field.of("reserve")); - -``` - -Signature: - -```typescript -export declare function add(left: string, right: Constant): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to add to. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -### add(left, right) {:#add_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that adds a field's value to a constant value. - -```typescript -// Add 5 to the value of the 'age' field -add("age", 5); - -``` - -Signature: - -```typescript -export declare function add(left: string, right: any): Add; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to add to. | -| right | any | The constant value to add. A new representing the addition operation. | - -Returns: - -[Add](./firestore_lite.add.md#add_class) - -### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} - -Compares two 'AggregateField\` instances for equality. - -Signature: - -```typescript -export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | -| right | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | - -Returns: - -boolean - -### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} - -Compares two `AggregateQuerySnapshot` instances for equality. - -Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. - -Signature: - -```typescript -export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | -| right | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | - -Returns: - -boolean - -`true` if the objects are "equal", as defined above, or `false` otherwise. - -### and(left, right) {:#and_eba7e36} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a logical 'AND' operation on multiple filter conditions. - -```typescript -// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND -// the 'status' field is "active" -const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - -Signature: - -```typescript -export declare function and(left: FilterExpr, ...right: FilterExpr[]): And; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. | - -Returns: - -[And](./firestore_lite.and.md#and_class) - -### divide(left, right) {:#divide_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides two expressions. - -```typescript -// Divide the 'total' field by the 'count' field -divide(Field.of("total"), Field.of("count")); - -``` - -Signature: - -```typescript -export declare function divide(left: Constant, right: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to be divided. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -### divide(left, right) {:#divide_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides an expression by a constant value. - -```typescript -// Divide the 'value' field by 10 -divide(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function divide(left: Constant, right: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to be divided. | -| right | any | The constant value to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -### divide(left, right) {:#divide_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides a field's value by an expression. - -```typescript -// Divide the 'total' field by the 'count' field -divide("total", Field.of("count")); - -``` - -Signature: - -```typescript -export declare function divide(left: string, right: Constant): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to be divided. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -### divide(left, right) {:#divide_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that divides a field's value by a constant value. - -```typescript -// Divide the 'value' field by 10 -divide("value", 10); - -``` - -Signature: - -```typescript -export declare function divide(left: string, right: any): Divide; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to be divided. | -| right | any | The constant value to divide by. A new representing the division operation. | - -Returns: - -[Divide](./firestore_lite.divide.md#divide_class) - -### eq(left, right) {:#eq_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if two expressions are equal. - -```typescript -// Check if the 'age' field is equal to an expression -eq(Field.of("age"), Field.of("minAge").add(10)); - -``` - -Signature: - -```typescript -export declare function eq(left: Constant, right: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -### eq(left, right) {:#eq_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is equal to a constant value. - -```typescript -// Check if the 'age' field is equal to 21 -eq(Field.of("age"), 21); - -``` - -Signature: - -```typescript -export declare function eq(left: Constant, right: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -### eq(left, right) {:#eq_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to an expression. - -```typescript -// Check if the 'age' field is equal to the 'limit' field -eq("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function eq(left: string, right: Constant): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -### eq(left, right) {:#eq_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is equal to a constant value. - -```typescript -// Check if the 'city' field is equal to string constant "London" -eq("city", "London"); - -``` - -Signature: - -```typescript -export declare function eq(left: string, right: any): Eq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the equality comparison. | - -Returns: - -[Eq](./firestore_lite.eq.md#eq_class) - -### gt(left, right) {:#gt_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is greater than the second expression. - -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), Constant(9).add(9)); - -``` - -Signature: - -```typescript -export declare function gt(left: Constant, right: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -### gt(left, right) {:#gt_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is greater than a constant value. - -```typescript -// Check if the 'age' field is greater than 18 -gt(Field.of("age"), 18); - -``` - -Signature: - -```typescript -export declare function gt(left: Constant, right: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -### gt(left, right) {:#gt_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than an expression. - -```typescript -// Check if the value of field 'age' is greater than the value of field 'limit' -gt("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function gt(left: string, right: Constant): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -### gt(left, right) {:#gt_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than a constant value. - -```typescript -// Check if the 'price' field is greater than 100 -gt("price", 100); - -``` - -Signature: - -```typescript -export declare function gt(left: string, right: any): Gt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than comparison. | - -Returns: - -[Gt](./firestore_lite.gt.md#gt_class) - -### gte(left, right) {:#gte_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is greater than or equal to the second expression. - -```typescript -// Check if the 'quantity' field is greater than or equal to the field "threshold" -gte(Field.of("quantity"), Field.of("threshold")); - -``` - -Signature: - -```typescript -export declare function gte(left: Constant, right: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -### gte(left, right) {:#gte_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is greater than or equal to a constant value. - -```typescript -// Check if the 'quantity' field is greater than or equal to 10 -gte(Field.of("quantity"), 10); - -``` - -Signature: - -```typescript -export declare function gte(left: Constant, right: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -### gte(left, right) {:#gte_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than or equal to an expression. - -```typescript -// Check if the value of field 'age' is greater than or equal to the value of field 'limit' -gte("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function gte(left: string, right: Constant): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -### gte(left, right) {:#gte_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is greater than or equal to a constant value. - -```typescript -// Check if the 'score' field is greater than or equal to 80 -gte("score", 80); - -``` - -Signature: - -```typescript -export declare function gte(left: string, right: any): Gte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the greater than or equal to comparison. | - -Returns: - -[Gte](./firestore_lite.gte.md#gte_class) - -### like(left, pattern) {:#like_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison against a field. - -```typescript -// Check if the 'title' field contains the string "guide" -like("title", "%guide%"); - -``` - -Signature: - -```typescript -export declare function like(left: string, pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -### like(left, pattern) {:#like_dd84184} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison against a field. - -```typescript -// Check if the 'title' field contains the string "guide" -like("title", Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function like(left: string, pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -### like(left, pattern) {:#like_3aaffe0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison. - -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), "%guide%"); - -``` - -Signature: - -```typescript -export declare function like(left: Constant, pattern: string): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -### like(left, pattern) {:#like_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a case-sensitive wildcard string comparison. - -```typescript -// Check if the 'title' field contains the string "guide" -like(Field.of("title"), Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function like(left: Constant, pattern: Constant): Like; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. | - -Returns: - -[Like](./firestore_lite.like.md#like_class) - -### logicalMax(left, right) {:#logicalmax_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: Constant, right: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: Constant, right: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | -| right | any | The right operand constant. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'field1' field and the 'field2' field. -logicalMax("field1", Field.of('field2')); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: string, right: Constant): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -### logicalMax(left, right) {:#logicalmax_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the larger value between the 'value' field and 10. -logicalMax("value", 10); - -``` - -Signature: - -```typescript -export declare function logicalMax(left: string, right: any): LogicalMax; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | any | The right operand constant. A new representing the logical max operation. | - -Returns: - -[LogicalMax](./firestore_lite.logicalmax.md#logicalmax_class) - -### logicalMin(left, right) {:#logicalmin_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: Constant, right: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin(Field.of("value"), 10); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: Constant, right: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The left operand expression. | -| right | any | The right operand constant. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'field1' field and the 'field2' field. -logicalMin("field1", Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: string, right: Constant): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The right operand expression. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -### logicalMin(left, right) {:#logicalmin_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. - -```typescript -// Returns the smaller value between the 'value' field and 10. -logicalMin("value", 10); - -``` - -Signature: - -```typescript -export declare function logicalMin(left: string, right: any): LogicalMin; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The left operand field name. | -| right | any | The right operand constant. A new representing the logical min operation. | - -Returns: - -[LogicalMin](./firestore_lite.logicalmin.md#logicalmin_class) - -### lt(left, right) {:#lt_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is less than the second expression. - -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lt(left: Constant, right: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -### lt(left, right) {:#lt_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is less than a constant value. - -```typescript -// Check if the 'age' field is less than 30 -lt(Field.of("age"), 30); - -``` - -Signature: - -```typescript -export declare function lt(left: Constant, right: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -### lt(left, right) {:#lt_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than an expression. - -```typescript -// Check if the 'age' field is less than the 'limit' field -lt("age", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lt(left: string, right: Constant): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -### lt(left, right) {:#lt_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than a constant value. - -```typescript -// Check if the 'price' field is less than 50 -lt("price", 50); - -``` - -Signature: - -```typescript -export declare function lt(left: string, right: any): Lt; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than comparison. | - -Returns: - -[Lt](./firestore_lite.lt.md#lt_class) - -### lte(left, right) {:#lte_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if the first expression is less than or equal to the second expression. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lte(left: Constant, right: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -### lte(left, right) {:#lte_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is less than or equal to a constant value. - -```typescript -// Check if the 'quantity' field is less than or equal to 20 -lte(Field.of("quantity"), 20); - -``` - -Signature: - -```typescript -export declare function lte(left: Constant, right: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -### lte(left, right) {:#lte_674c63f} - -Creates an expression that checks if a field's value is less than or equal to an expression. - -```typescript -// Check if the 'quantity' field is less than or equal to the 'limit' field -lte("quantity", Field.of("limit")); - -``` - -Signature: - -```typescript -export declare function lte(left: string, right: Constant): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -### lte(left, right) {:#lte_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is less than or equal to a constant value. - -```typescript -// Check if the 'score' field is less than or equal to 70 -lte("score", 70); - -``` - -Signature: - -```typescript -export declare function lte(left: string, right: any): Lte; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the less than or equal to comparison. | - -Returns: - -[Lte](./firestore_lite.lte.md#lte_class) - -### mod(left, right) {:#mod_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing two expressions. - -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod(Field.of("field1"), Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function mod(left: Constant, right: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The dividend expression. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -### mod(left, right) {:#mod_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. - -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod(Field.of("field1"), 5); - -``` - -Signature: - -```typescript -export declare function mod(left: Constant, right: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The dividend expression. | -| right | any | The divisor constant. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -### mod(left, right) {:#mod_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. - -```typescript -// Calculate the remainder of dividing 'field1' by 'field2'. -mod("field1", Field.of("field2")); - -``` - -Signature: - -```typescript -export declare function mod(left: string, right: Constant): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The dividend field name. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The divisor expression. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -### mod(left, right) {:#mod_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. - -```typescript -// Calculate the remainder of dividing 'field1' by 5. -mod("field1", 5); - -``` - -Signature: - -```typescript -export declare function mod(left: string, right: any): Mod; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The dividend field name. | -| right | any | The divisor constant. A new representing the modulo operation. | - -Returns: - -[Mod](./firestore_lite.mod.md#mod_class) - -### multiply(left, right) {:#multiply_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies two expressions together. - -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply(Field.of("quantity"), Field.of("price")); - -``` - -Signature: - -```typescript -export declare function multiply(left: Constant, right: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to multiply. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to multiply. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies an expression by a constant value. - -```typescript -// Multiply the value of the 'price' field by 2 -multiply(Field.of("price"), 2); - -``` - -Signature: - -```typescript -export declare function multiply(left: Constant, right: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply. | -| right | any | The constant value to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies a field's value by an expression. - -```typescript -// Multiply the 'quantity' field by the 'price' field -multiply("quantity", Field.of("price")); - -``` - -Signature: - -```typescript -export declare function multiply(left: string, right: Constant): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to multiply. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -### multiply(left, right) {:#multiply_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that multiplies a field's value by a constant value. - -```typescript -// Multiply the 'value' field by 2 -multiply("value", 2); - -``` - -Signature: - -```typescript -export declare function multiply(left: string, right: any): Multiply; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to multiply. | -| right | any | The constant value to multiply by. A new representing the multiplication operation. | - -Returns: - -[Multiply](./firestore_lite.multiply.md#multiply_class) - -### neq(left, right) {:#neq_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if two expressions are not equal. - -```typescript -// Check if the 'status' field is not equal to field 'finalState' -neq(Field.of("status"), Field.of("finalState")); - -``` - -Signature: - -```typescript -export declare function neq(left: Constant, right: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The first expression to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The second expression to compare. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -### neq(left, right) {:#neq_010ba9e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if an expression is not equal to a constant value. - -```typescript -// Check if the 'status' field is not equal to "completed" -neq(Field.of("status"), "completed"); - -``` - -Signature: - -```typescript -export declare function neq(left: Constant, right: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare. | -| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -### neq(left, right) {:#neq_674c63f} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to an expression. - -```typescript -// Check if the 'status' field is not equal to the value of 'expectedStatus' -neq("status", Field.of("expectedStatus")); - -``` - -Signature: - -```typescript -export declare function neq(left: string, right: Constant): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to compare to. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -### neq(left, right) {:#neq_1f46a76} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a field's value is not equal to a constant value. - -```typescript -// Check if the 'country' field is not equal to "USA" -neq("country", "USA"); - -``` - -Signature: - -```typescript -export declare function neq(left: string, right: any): Neq; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The field name to compare. | -| right | any | The constant value to compare to. A new Expr representing the inequality comparison. | - -Returns: - -[Neq](./firestore_lite.neq.md#neq_class) - -### or(left, right) {:#or_eba7e36} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that performs a logical 'OR' operation on multiple filter conditions. - -```typescript -// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR -// the 'status' field is "active" -const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); - -``` - -Signature: - -```typescript -export declare function or(left: FilterExpr, ...right: FilterExpr[]): Or; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. | - -Returns: - -[Or](./firestore_lite.or.md#or_class) - -### queryEqual(left, right) {:#queryequal_7a1f045} - -Returns true if the provided queries point to the same collection and apply the same constraints. - -Signature: - -```typescript -export declare function queryEqual(left: Query, right: Query): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | -| right | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | - -Returns: - -boolean - -true if the references point to the same location in the same Firestore database. - -### refEqual(left, right) {:#refequal_598b780} - -Returns true if the provided references are equal. - -Signature: - -```typescript -export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | -| right | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | - -Returns: - -boolean - -true if the references point to the same location in the same Firestore database. - -### regexContains(left, pattern) {:#regexcontains_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", "(?i)example"); - -``` - -Signature: - -```typescript -export declare function regexContains(left: string, pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -### regexContains(left, pattern) {:#regexcontains_dd84184} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains("description", Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function regexContains(left: string, pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -### regexContains(left, pattern) {:#regexcontains_3aaffe0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), "(?i)example"); - -``` - -Signature: - -```typescript -export declare function regexContains(left: Constant, pattern: string): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | string | The regular expression to use for the search. A new representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -### regexContains(left, pattern) {:#regexcontains_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression contains a specified regular expression as a substring. - -```typescript -// Check if the 'description' field contains "example" (case-insensitive) -regexContains(Field.of("description"), Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function regexContains(left: Constant, pattern: Constant): RegexContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the search. A new representing the 'contains' comparison. | - -Returns: - -[RegexContains](./firestore_lite.regexcontains.md#regexcontains_class) - -### regexMatch(left, pattern) {:#regexmatch_33ec01b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -export declare function regexMatch(left: string, pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -### regexMatch(left, pattern) {:#regexmatch_dd84184} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch("email", Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function regexMatch(left: string, pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -### regexMatch(left, pattern) {:#regexmatch_3aaffe0} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); - -``` - -Signature: - -```typescript -export declare function regexMatch(left: Constant, pattern: string): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to match against. | -| pattern | string | The regular expression to use for the match. A new representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -### regexMatch(left, pattern) {:#regexmatch_a2c3e8b} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression matches a specified regular expression. - -```typescript -// Check if the 'email' field matches a valid email pattern -regexMatch(Field.of("email"), Field.of("pattern")); - -``` - -Signature: - -```typescript -export declare function regexMatch(left: Constant, pattern: Constant): RegexMatch; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to match against. | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | The regular expression to use for the match. A new representing the regular expression match. | - -Returns: - -[RegexMatch](./firestore_lite.regexmatch.md#regexmatch_class) - -### snapshotEqual(left, right) {:#snapshotequal_5109204} - -Returns true if the provided snapshots are equal. - -Signature: - -```typescript -export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | -| right | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | - -Returns: - -boolean - -true if the snapshots are equal. - -### strContains(left, substring) {:#strcontains_18eaf5d} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string field contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -strContains("description", "example"); - -``` - -Signature: - -```typescript -export declare function strContains(left: string, substring: string): StrContains; -``` +| [startAt(snapshot)](./firestore_lite.md#startat_9a4477f) | Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. | +| function(values, ...) | +| [vector(values)](./firestore_lite.md#vector_0dbdaf2) | Creates a new VectorValue constructed with a copy of the given array of numbers. | -#### Parameters +## Classes -| Parameter | Type | Description | -| --- | --- | --- | -| left | string | The name of the field containing the string. | -| substring | string | The substring to search for. A new representing the 'contains' comparison. | +| Class | Description | +| --- | --- | +| [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class) | Represents an aggregation that can be performed by Firestore. | +| [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class) | The results of executing an aggregation query. | +| [Bytes](./firestore_lite.bytes.md#bytes_class) | An immutable object representing an array of bytes. | +| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). | +| [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. | +| [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. | +| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. | +| [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). | +| [Firestore](./firestore_lite.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). | +| [FirestoreError](./firestore_lite.firestoreerror.md#firestoreerror_class) | An error returned by a Firestore operation. | +| [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. | +| [Query](./firestore_lite.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. | +| [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | A QueryCompositeFilterConstraint is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. QueryCompositeFilterConstraints are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryCompositeFilterConstraint. | +| [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class) | A QueryConstraint is used to narrow the set of documents returned by a Firestore query. QueryConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf), [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78), [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryConstraint. | +| [QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. | +| [QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) | A QueryEndAtConstraint is used to exclude documents from the end of a result set returned by a Firestore query. QueryEndAtConstraints are created by invoking [endAt()](./firestore_.md#endat_9a4477f) or [endBefore()](./firestore_.md#endbefore_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryEndAtConstraint. | +| [QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) | A QueryFieldFilterConstraint is used to narrow the set of documents returned by a Firestore query by filtering on one or more document fields. QueryFieldFilterConstraints are created by invoking [where()](./firestore_.md#where_0fae4bf) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryFieldFilterConstraint. | +| [QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) | A QueryLimitConstraint is used to limit the number of documents returned by a Firestore query. QueryLimitConstraints are created by invoking [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryLimitConstraint. | +| [QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) | A QueryOrderByConstraint is used to sort the set of documents returned by a Firestore query. QueryOrderByConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryOrderByConstraint.Note: Documents that do not contain the orderBy field will not be present in the query result. | +| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class) | A QuerySnapshot contains zero or more DocumentSnapshot objects representing the results of a query. The documents can be accessed as an array via the docs property or enumerated using the forEach method. The number of documents can be determined via the empty and size properties. | +| [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | +| [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | +| [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | +| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | -Returns: +## Interfaces -[StrContains](./firestore_lite.strcontains.md#strcontains_class) +| Interface | Description | +| --- | --- | +| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. | +| [DocumentData](./firestore_lite.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc_ee215ad)) consists of fields mapped to values. | +| [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | +| [Settings](./firestore_lite.settings.md#settings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | +| [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | Options to customize transaction behavior. | -### strContains(left, substring) {:#strcontains_f0f1f2f} +## Type Aliases -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +| Type Alias | Description | +| --- | --- | +| [AddPrefixToKeys](./firestore_lite.md#addprefixtokeys) | Returns a new map where every key is prefixed with the outer key appended to a dot. | +| [AggregateFieldType](./firestore_lite.md#aggregatefieldtype) | The union of all AggregateField types that are supported by Firestore. | +| [AggregateSpecData](./firestore_lite.md#aggregatespecdata) | A type whose keys are taken from an AggregateSpec, and whose values are the result of the aggregation performed by the corresponding AggregateField from the input AggregateSpec. | +| [AggregateType](./firestore_lite.md#aggregatetype) | Union type representing the aggregate type to be performed. | +| [ChildUpdateFields](./firestore_lite.md#childupdatefields) | Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributive-conditional-types | +| [FirestoreErrorCode](./firestore_lite.md#firestoreerrorcode) | The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | +| [NestedUpdateFields](./firestore_lite.md#nestedupdatefields) | For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional | +| [OrderByDirection](./firestore_lite.md#orderbydirection) | The direction of a [orderBy()](./firestore_.md#orderby_006d61f) clause is specified as 'desc' or 'asc' (descending or ascending). | +| [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. | +| [Primitive](./firestore_lite.md#primitive) | Primitive types. | +| [QueryConstraintType](./firestore_lite.md#queryconstrainttype) | Describes the different query constraints available in this SDK. | +| [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint) | QueryFilterConstraint is a helper union type that represents [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) and [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). | +| [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint) | QueryNonFilterConstraint is a helper union type that represents QueryConstraints which are used to narrow or order the set of documents, but that do not explicitly filter on a document field. QueryNonFilterConstraints are created by invoking [orderBy()](./firestore_.md#orderby_006d61f), [startAt()](./firestore_.md#startat_9a4477f), [startAfter()](./firestore_.md#startafter_9a4477f), [endBefore()](./firestore_.md#endbefore_9a4477f), [endAt()](./firestore_.md#endat_9a4477f), [limit()](./firestore_.md#limit_ec46c78) or [limitToLast()](./firestore_.md#limittolast_ec46c78) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the QueryConstraint. | +| [SetOptions](./firestore_lite.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. | +| [UnionToIntersection](./firestore_lite.md#uniontointersection) | Given a union type U = T1 | T2 | ..., returns an intersected type (T1 & T2 & ...).Uses distributive conditional types and inference from conditional types. This works because multiple candidates for the same type variable in contra-variant positions causes an intersection type to be inferred. https://www.typescriptlang.org/docs/handbook/advanced-types.html\#type-inference-in-conditional-types https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type | +| [UpdateData](./firestore_lite.md#updatedata) | Update data (for use with [updateDoc()](./firestore_.md#updatedoc_51a65e3)) that consists of field paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference nested fields within the document. FieldValues can be passed in as property values. | +| [WhereFilterOp](./firestore_lite.md#wherefilterop) | Filter conditions in a [where()](./firestore_.md#where_0fae4bf) clause are specified using the strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in', 'array-contains-any', and 'not-in'. | +| [WithFieldValue](./firestore_lite.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. | -Creates an expression that checks if a string field contains a substring specified by an expression. +## function(app, ...) -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains("description", Field.of("keyword")); +### getFirestore(app) {:#getfirestore_cf608e1} -``` +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function strContains(left: string, substring: Constant): StrContains; +export declare function getFirestore(app: FirebaseApp): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The name of the field containing the string. | -| substring | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | Returns: -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -### strContains(left, substring) {:#strcontains_5fdbd29} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Creates an expression that checks if a string expression contains a specified substring. - -```typescript -// Check if the 'description' field contains "example". -strContains(Field.of("description"), "example"); - -``` - -Signature: - -```typescript -export declare function strContains(left: Constant, substring: string): StrContains; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| substring | string | The substring to search for. A new representing the 'contains' comparison. | - -Returns: +[Firestore](./firestore_lite.firestore.md#firestore_class) -[StrContains](./firestore_lite.strcontains.md#strcontains_class) +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. -### strContains(left, substring) {:#strcontains_d9d749f} +### getFirestore(app, databaseId) {:#getfirestore_48de6cb} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an expression that checks if a string expression contains a substring specified by another expression. - -```typescript -// Check if the 'description' field contains the value of the 'keyword' field. -strContains(Field.of("description"), Field.of("keyword")); - -``` +Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function strContains(left: Constant, substring: Constant): StrContains; +export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the comparison on. | -| substring | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance that the returned [Firestore](./firestore_.firestore.md#firestore_class) instance is associated with. | +| databaseId | string | The name of the database. | Returns: -[StrContains](./firestore_lite.strcontains.md#strcontains_class) - -### subtract(left, right) {:#subtract_be96f75} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[Firestore](./firestore_lite.firestore.md#firestore_class) -Creates an expression that subtracts two expressions. +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. -```typescript -// Subtract the 'discount' field from the 'price' field -subtract(Field.of("price"), Field.of("discount")); +### initializeFirestore(app, settings) {:#initializefirestore_87c6318} -``` +Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). Signature: ```typescript -export declare function subtract(left: Constant, right: Constant): Subtract; +export declare function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | +| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | Returns: -[Subtract](./firestore_lite.subtract.md#subtract_class) +[Firestore](./firestore_lite.firestore.md#firestore_class) + +A newly initialized `Firestore` instance. -### subtract(left, right) {:#subtract_010ba9e} +### initializeFirestore(app, settings, databaseId) {:#initializefirestore_37baaaf} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an expression that subtracts a constant value from an expression. - -```typescript -// Subtract the constant value 2 from the 'value' field -subtract(Field.of("value"), 2); - -``` +Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). Signature: ```typescript -export declare function subtract(left: Constant, right: any): Subtract; +export declare function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract from. | -| right | any | The constant value to subtract. A new representing the subtraction operation. | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) with which the Firestore instance will be associated. | +| settings | [Settings](./firestore_lite.settings.md#settings_interface) | A settings object to configure the Firestore instance. | +| databaseId | string | The name of the database. | Returns: -[Subtract](./firestore_lite.subtract.md#subtract_class) - -### subtract(left, right) {:#subtract_674c63f} +[Firestore](./firestore_lite.firestore.md#firestore_class) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A newly initialized `Firestore` instance. -Creates an expression that subtracts an expression from a field's value. +## function(firestore, ...) -```typescript -// Subtract the 'discount' field from the 'price' field -subtract("price", Field.of("discount")); +### collection(firestore, path, pathSegments) {:#collection_1eb4c23} -``` +Gets a `CollectionReference` instance that refers to the collection at the specified absolute path. Signature: ```typescript -export declare function subtract(left: string, right: Constant): Subtract; +export declare function collection(firestore: Firestore, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The field name to subtract from. | -| right | [Constant](./firestore_lite.constant.md#constant_class) | The expression to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -[Subtract](./firestore_lite.subtract.md#subtract_class) +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -### subtract(left, right) {:#subtract_1f46a76} +The `CollectionReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that subtracts a constant value from a field's value. +If the final path has an even number of segments and does not point to a collection. -```typescript -// Subtract 20 from the value of the 'total' field -subtract("total", 20); +### collectionGroup(firestore, collectionId) {:#collectiongroup_1838fc3} -``` +Creates and returns a new `Query` instance that includes all documents in the database that are contained in a collection or subcollection with the given `collectionId`. Signature: ```typescript -export declare function subtract(left: string, right: any): Subtract; +export declare function collectionGroup(firestore: Firestore, collectionId: string): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | string | The field name to subtract from. | -| right | any | The constant value to subtract. A new representing the subtraction operation. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. | Returns: -[Subtract](./firestore_lite.subtract.md#subtract_class) - -### xor(left, right) {:#xor_eba7e36} +[Query](./firestore_lite.query.md#query_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +The created `Query`. -Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter conditions. +### connectFirestoreEmulator(firestore, host, port, options) {:#connectfirestoreemulator_7c247cd} -```typescript -// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", -// or 'status' is "active". -const condition = xor( - gt("age", 18), - eq("city", "London"), - eq("status", "active")); +Modify this instance to communicate with the Cloud Firestore emulator. -``` +Note: This must be called before this instance has been used to do any operations. Signature: ```typescript -export declare function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; +export declare function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { + mockUserToken?: EmulatorMockTokenOptions | string; +}): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| left | [FilterExpr](./firestore_lite.md#filterexpr) | The first filter condition. | -| right | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | Additional filter conditions to 'XOR' together. A new representing the logical 'XOR' operation. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to configure to connect to the emulator. | +| host | string | the emulator host (ex: localhost). | +| port | number | the emulator port (ex: 9000). | +| options | { mockUserToken?: [EmulatorMockTokenOptions](./util.md#emulatormocktokenoptions) \| string; } | | Returns: -[Xor](./firestore_lite.xor.md#xor_class) - -## function(limit, ...) +void -### limit(limit) {:#limit_ec46c78} +### doc(firestore, path, pathSegments) {:#doc_1eb4c23} -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. +Gets a `DocumentReference` instance that refers to the document at the specified absolute path. Signature: ```typescript -export declare function limit(limit: number): QueryLimitConstraint; +export declare function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| limit | number | The maximum number of items to return. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the root Firestore instance. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) - -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). - -### limitToLast(limit) {:#limittolast_ec46c78} - -Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. - -You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. - -Signature: - -```typescript -export declare function limitToLast(limit: number): QueryLimitConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| limit | number | The maximum number of items to return. | +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -Returns: +The `DocumentReference` instance. -[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) +#### Exceptions -The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). +If the final path has an odd number of segments and does not point to a document. -## function(logLevel, ...) +### runTransaction(firestore, updateFunction, options) {:#runtransaction_6f03ec4} -### setLogLevel(logLevel) {:#setloglevel_d02fda2} +Executes the given `updateFunction` and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the `updateFunction`. If it fails to commit after 5 attempts, the transaction fails. -Sets the verbosity of Cloud Firestore logs (debug, error, or silent). +The maximum number of writes allowed in a single transaction is 500. Signature: ```typescript -export declare function setLogLevel(logLevel: LogLevel): void; +export declare function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:

  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | A reference to the Firestore database to run this transaction against. | +| updateFunction | (transaction: [Transaction](./firestore_lite.transaction.md#transaction_class)) => Promise<T> | The function to execute within the transaction context. | +| options | [TransactionOptions](./firestore_lite.transactionoptions.md#transactionoptions_interface) | An options object to configure maximum number of attempts to commit. | Returns: -void +Promise<T> -## function(mapExpr, ...) +If the transaction completed successfully or was explicitly aborted (the `updateFunction` returned a failed promise), the promise returned by the `updateFunction `is returned here. Otherwise, if the transaction failed, a rejected promise with the corresponding failure error is returned. -### mapGet(mapExpr, subField) {:#mapget_9715f90} +### terminate(firestore) {:#terminate_231a8e0} -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Terminates the provided `Firestore` instance. -Accesses a value from a map (object) expression using the provided key. +After calling `terminate()` only the `clearIndexedDbPersistence()` functions may be used. Any other function will throw a `FirestoreError`. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. -```typescript -// Get the 'city' value from the 'address' map field -mapGet(Field.of("address"), "city"); +To restart after termination, create a new instance of `Firestore` with [getFirestore()](./firestore_.md#getfirestore). -``` +Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0) to ensure that all local state is destroyed between test runs. Signature: ```typescript -export declare function mapGet(mapExpr: Constant, subField: string): MapGet; +export declare function terminate(firestore: Firestore): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| mapExpr | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the map. | -| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The Firestore instance to terminate. | Returns: -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## function(mapField, ...) - -### mapGet(mapField, subField) {:#mapget_b37bbb6} +Promise<void> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A `Promise` that is resolved when the instance has been successfully terminated. -Accesses a value from a map (object) field using the provided key. +### writeBatch(firestore) {:#writebatch_231a8e0} -```typescript -// Get the 'city' value from the 'address' map field -mapGet("address", "city"); +Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500. -``` +The result of these writes will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function mapGet(mapField: string, subField: string): MapGet; +export declare function writeBatch(firestore: Firestore): WriteBatch; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| mapField | string | The field name of the map field. | -| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | | Returns: -[MapGet](./firestore_lite.mapget.md#mapget_class) - -## function(n, ...) +[WriteBatch](./firestore_lite.writebatch.md#writebatch_class) -### increment(n) {:#increment_5685735} +A `WriteBatch` that can be used to atomically execute multiple writes. -Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. +## function() -If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. +### count() {:#count} -If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. +Create an AggregateField object that can be used to compute the count of documents in the result set of a query. Signature: ```typescript -export declare function increment(n: number): FieldValue; +export declare function count(): AggregateField; ``` +Returns: -#### Parameters +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> -| Parameter | Type | Description | -| --- | --- | --- | -| n | number | The value to increment by. | +### deleteField() {:#deletefield} + +Returns a sentinel for use with [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) or [setDoc()](./firestore_lite.md#setdoc_ee215ad) with `{merge: true}` to mark a field for deletion. +Signature: + +```typescript +export declare function deleteField(): FieldValue; +``` Returns: [FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` +### documentId() {:#documentid} -## function(name, ...) +Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID. -### genericFunction(name, params) {:#genericfunction_b886545} +Signature: -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +```typescript +export declare function documentId(): FieldPath; +``` +Returns: -Creates functions that work on the backend but do not exist in the SDK yet. +[FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) -```typescript -// Call a user defined function named "myFunc" with the arguments 10 and 20 -// This is the same of the 'sum(Field.of("price"))', if it did not exist -genericFunction("sum", [Field.of("price")]); +### getFirestore() {:#getfirestore} -``` +Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function genericFunction(name: string, params: Constant[]): FirestoreFunction; +export declare function getFirestore(): Firestore; ``` +Returns: -#### Parameters +[Firestore](./firestore_lite.firestore.md#firestore_class) -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The name of the user defined function. | -| params | [Constant](./firestore_lite.constant.md#constant_class)\[\] | The arguments to pass to the function. A new representing the function call. | +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. + +### serverTimestamp() {:#servertimestamp} + +Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. + +Signature: +```typescript +export declare function serverTimestamp(): FieldValue; +``` Returns: -[FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -## function(pipeline, ...) +## function(databaseId, ...) -### execute(pipeline) {:#execute_86486e6} +### getFirestore(databaseId) {:#getfirestore_53dc891} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Modular API for console experimentation. +Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. Signature: ```typescript -export declare function execute(pipeline: Pipeline): Promise>>; +export declare function getFirestore(databaseId: string): Firestore; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| pipeline | [Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> | Execute this pipeline. | +| databaseId | string | The name of the database. | Returns: -Promise<Array<[PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class)<AppModelType>>> +[Firestore](./firestore_lite.firestore.md#firestore_class) -## function(query, ...) +The [Firestore](./firestore_.firestore.md#firestore_class) instance of the provided app. -### getAggregate(query, aggregateSpec) {:#getaggregate_2073a74} +## function(elements, ...) -Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. +### arrayRemove(elements) {:#arrayremove_7d853aa} -Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. Signature: ```typescript -export declare function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; +export declare function arrayRemove(...elements: unknown[]): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | -| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | +| elements | unknown\[\] | The elements to remove from the array. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> - -### Example - - -```typescript -const aggregateSnapshot = await getAggregate(query, { - countOfDocs: count(), - totalHours: sum('hours'), - averageScore: average('score') -}); - -const countOfDocs: number = aggregateSnapshot.data().countOfDocs; -const totalHours: number = aggregateSnapshot.data().totalHours; -const averageScore: number | null = aggregateSnapshot.data().averageScore; - -``` +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -### getCount(query) {:#getcount_4e56953} +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -Calculates the number of documents in the result set of the given query without actually downloading the documents. +### arrayUnion(elements) {:#arrayunion_7d853aa} -Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. Signature: ```typescript -export declare function getCount(query: Query): Promise; -}, AppModelType, DbModelType>>; +export declare function arrayUnion(...elements: unknown[]): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | +| elements | unknown\[\] | The elements to union into the array. | Returns: -Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()`. -### getDocs(query) {:#getdocs_4e56953} +## function(field, ...) -Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class). +### average(field) {:#average_aacc3a9} -All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. +Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query. Signature: ```typescript -export declare function getDocs(query: Query): Promise>; +export declare function average(field: string | FieldPath): AggregateField; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The Query to execute. | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to average across the result set. | Returns: -Promise<[QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> - -A Promise that will be resolved with the results of the query. +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number \| null> -### pipeline(query) {:#pipeline_20b2416} +### sum(field) {:#sum_aacc3a9} -Experimental Modular API for console testing. +Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query. Signature: ```typescript -export declare function pipeline(query: Query): Pipeline; +export declare function sum(field: string | FieldPath): AggregateField; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class) | | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | Specifies the field to sum across the result set. | Returns: -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) +[AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number> -### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} +## function(fieldPath, ...) -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +### orderBy(fieldPath, directionStr) {:#orderby_006d61f} + +Creates a [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class) that sorts the query result by the specified field, optionally in descending order instead of ascending. + +Note: Documents that do not contain the specified field will not be present in the query result. Signature: ```typescript -export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; +export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| compositeFilter | [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using or . | -| queryConstraints | [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | +| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The field to sort by. | +| directionStr | [OrderByDirection](./firestore_lite.md#orderbydirection) | Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. | Returns: -[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions +[QueryOrderByConstraint](./firestore_lite.queryorderbyconstraint.md#queryorderbyconstraint_class) -if any of the provided query constraints cannot be combined with the existing or new constraints. +The created [QueryOrderByConstraint](./firestore_.queryorderbyconstraint.md#queryorderbyconstraint_class). -### query(query, queryConstraints) {:#query_0f46da1} +### where(fieldPath, opStr, value) {:#where_0fae4bf} -Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. +Creates a [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided. Signature: ```typescript -export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; +export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | -| queryConstraints | [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | +| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The path to compare | +| opStr | [WhereFilterOp](./firestore_lite.md#wherefilterop) | The operation string (e.g "&lt;", "&lt;=", "==", "&lt;", "&lt;=", "!="). | +| value | unknown | The value for comparison | Returns: -[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> - -#### Exceptions +[QueryFieldFilterConstraint](./firestore_lite.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class) -if any of the provided query constraints cannot be combined with the existing or new constraints. +The created [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class). -## function(queryConstraints, ...) +## function(fieldValues, ...) -### and(queryConstraints) {:#and_e72c712} +### endAt(fieldValues) {:#endat_8b2f2c8} -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | +| fieldValues | unknown\[\] | The field values to end this query at, in order of the query's order by. | Returns: -[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -### or(queryConstraints) {:#or_e72c712} +### endBefore(fieldValues) {:#endbefore_8b2f2c8} -Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; +export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), , or . | +| fieldValues | unknown\[\] | The field values to end this query before, in order of the query's order by. | Returns: -[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) - -The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). - -## function(reference, ...) +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) -### addDoc(reference, data) {:#adddoc_6e783ff} +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. +### startAfter(fieldValues) {:#startafter_8b2f2c8} -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; +export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | -| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | +| fieldValues | unknown\[\] | The field values to start this query after, in order of the query's order by. | Returns: -Promise<[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType>> - -A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend. - -#### Exceptions +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) -Error - If the provided input is not a valid Firestore document. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -### collection(reference, path, pathSegments) {:#collection_568f98d} +### startAt(fieldValues) {:#startat_8b2f2c8} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. Signature: ```typescript -export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | +| fieldValues | unknown\[\] | The field values to start this query at, in order of the query's order by. | Returns: -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) -#### Exceptions +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. -If the final path has an even number of segments and does not point to a collection. +## function(left, ...) -### collection(reference, path, pathSegments) {:#collection_70b4396} +### aggregateFieldEqual(left, right) {:#aggregatefieldequal_e80a2b2} -Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. +Compares two 'AggregateField\` instances for equality. Signature: ```typescript -export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; +export declare function aggregateFieldEqual(left: AggregateField, right: AggregateField): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a collection. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the right. | +| right | [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<unknown> | Compare this AggregateField to the left. | Returns: -[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `CollectionReference` instance. - -#### Exceptions - -If the final path has an even number of segments and does not point to a collection. +boolean -### deleteDoc(reference) {:#deletedoc_4569087} +### aggregateQuerySnapshotEqual(left, right) {:#aggregatequerysnapshotequal_1529a20} -Deletes the document referred to by the specified `DocumentReference`. +Compares two `AggregateQuerySnapshot` instances for equality. -The deletion will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the delete fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +Two `AggregateQuerySnapshot` instances are considered "equal" if they have underlying queries that compare equal, and the same data. Signature: ```typescript -export declare function deleteDoc(reference: DocumentReference): Promise; +export declare function aggregateQuerySnapshotEqual(left: AggregateQuerySnapshot, right: AggregateQuerySnapshot): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | +| left | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The first AggregateQuerySnapshot to compare. | +| right | [AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType> | The second AggregateQuerySnapshot to compare. | Returns: -Promise<void> +boolean -A `Promise` resolved once the document has been successfully deleted from the backend. +`true` if the objects are "equal", as defined above, or `false` otherwise. -### doc(reference, path, pathSegments) {:#doc_568f98d} +### queryEqual(left, right) {:#queryequal_7a1f045} -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. +Returns true if the provided queries point to the same collection and apply the same constraints. Signature: ```typescript -export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; +export declare function queryEqual(left: Query, right: Query): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | -| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | +| right | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | A Query to compare. | Returns: -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> - -The `DocumentReference` instance. - -#### Exceptions +boolean -If the final path has an odd number of segments and does not point to a document. +true if the references point to the same location in the same Firestore database. -### doc(reference, path, pathSegments) {:#doc_70b4396} +### refEqual(left, right) {:#refequal_598b780} -Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. +Returns true if the provided references are equal. Signature: ```typescript -export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; +export declare function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | -| path | string | A slash-separated path to a document. | -| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | +| left | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | +| right | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> \| [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to compare. | Returns: -[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> - -The `DocumentReference` instance. - -#### Exceptions - -If the final path has an odd number of segments and does not point to a document. +boolean -### getDoc(reference) {:#getdoc_4569087} +true if the references point to the same location in the same Firestore database. -Reads the document referred to by the specified document reference. +### snapshotEqual(left, right) {:#snapshotequal_5109204} -All documents are directly fetched from the server, even if the document was previously read or modified. Recent modifications are only reflected in the retrieved `DocumentSnapshot` if they have already been applied by the backend. If the client is offline, the read fails. If you like to use caching or see local modifications, please use the full Firestore SDK. +Returns true if the provided snapshots are equal. Signature: ```typescript -export declare function getDoc(reference: DocumentReference): Promise>; +export declare function snapshotEqual(left: DocumentSnapshot | QuerySnapshot, right: DocumentSnapshot | QuerySnapshot): boolean; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | +| left | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | +| right | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> \| [QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> | A snapshot to compare. | Returns: -Promise<[DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> +boolean -A Promise resolved with a `DocumentSnapshot` containing the current document contents. +true if the snapshots are equal. -### setDoc(reference, data) {:#setdoc_ee215ad} +## function(limit, ...) -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. +### limit(limit) {:#limit_ec46c78} -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the first matching documents. Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; +export declare function limit(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| limit | number | The maximum number of items to return. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. - -#### Exceptions +[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) -Error - If the provided input is not a valid Firestore document. +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -### setDoc(reference, data, options) {:#setdoc_ff80739} +### limitToLast(limit) {:#limittolast_ec46c78} -Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. +Creates a [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class) that only returns the last matching documents. -The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution. Signature: ```typescript -export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; +export declare function limitToLast(limit: number): QueryLimitConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | -| data | [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | -| options | [SetOptions](./firestore_lite.md#setoptions) | An object to configure the set behavior. | +| limit | number | The maximum number of items to return. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. - -#### Exceptions +[QueryLimitConstraint](./firestore_lite.querylimitconstraint.md#querylimitconstraint_class) -Error - If the provided input is not a valid Firestore document. +The created [QueryLimitConstraint](./firestore_.querylimitconstraint.md#querylimitconstraint_class). -### updateDoc(reference, data) {:#updatedoc_51a65e3} +## function(logLevel, ...) -Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. +### setLogLevel(logLevel) {:#setloglevel_d02fda2} -The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +Sets the verbosity of Cloud Firestore logs (debug, error, or silent). Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; +export declare function setLogLevel(logLevel: LogLevel): void; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| data | [UpdateData](./firestore_lite.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | +| logLevel | LogLevel | The verbosity you set for activity and error logging. Can be any of the following values:
  • debug for the most verbose logging level, primarily for debugging.
  • error to log errors only.
  • silent to turn off logging.
| Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. - -#### Exceptions +void -Error - If the provided input is not valid Firestore data. +## function(n, ...) -### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} +### increment(n) {:#increment_5685735} -Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. +Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to increment the field's current value by the given value. -Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. +If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. -The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. +If the current field value is not of type `number`, or if the field does not yet exist, the transformation sets the field to the given value. Signature: ```typescript -export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; +export declare function increment(n: number): FieldValue; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | -| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The first field to update. | -| value | unknown | The first value. | -| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | +| n | number | The value to increment by. | Returns: -Promise<void> - -A `Promise` resolved once the data has been successfully written to the backend. +[FieldValue](./firestore_lite.fieldvalue.md#fieldvalue_class) -#### Exceptions +The `FieldValue` sentinel for use in a call to `setDoc()` or `updateDoc()` -Error - If the provided input is not valid Firestore data. +## function(query, ...) -## function(snapshot, ...) +### getAggregate(query, aggregateSpec) {:#getaggregate_2073a74} -### endAt(snapshot) {:#endat_9a4477f} +Calculates the specified aggregations over the documents in the result set of the given query without actually downloading the documents. -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Using this function to perform aggregations is efficient because only the final aggregation values, not the documents' data, are downloaded. This function can perform aggregations of the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). Signature: ```typescript -export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; +export declare function getAggregate(query: Query, aggregateSpec: AggregateSpecType): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set is aggregated over. | +| aggregateSpec | AggregateSpecType | An AggregateSpec object that specifies the aggregates to perform over the result set. The AggregateSpec specifies aliases for each aggregate, which can be used to retrieve the aggregate result. | Returns: -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) - -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` - -### endBefore(snapshot) {:#endbefore_9a4477f} +Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<AggregateSpecType, AppModelType, DbModelType>> -Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +### Example -Signature: ```typescript -export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | +const aggregateSnapshot = await getAggregate(query, { + countOfDocs: count(), + totalHours: sum('hours'), + averageScore: average('score') +}); -Returns: +const countOfDocs: number = aggregateSnapshot.data().countOfDocs; +const totalHours: number = aggregateSnapshot.data().totalHours; +const averageScore: number | null = aggregateSnapshot.data().averageScore; -[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) +``` -A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` +### getCount(query) {:#getcount_4e56953} -### startAfter(snapshot) {:#startafter_9a4477f} +Calculates the number of documents in the result set of the given query without actually downloading the documents. -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. +Using this function to count the documents is efficient because only the final count, not the documents' data, is downloaded. This function can count the documents in cases where the result set is prohibitively large to download entirely (thousands of documents). Signature: ```typescript -export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function getCount(query: Query): Promise; +}, AppModelType, DbModelType>>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The query whose result set size is calculated. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) +Promise<[AggregateQuerySnapshot](./firestore_lite.aggregatequerysnapshot.md#aggregatequerysnapshot_class)<{ count: [AggregateField](./firestore_lite.aggregatefield.md#aggregatefield_class)<number>; }, AppModelType, DbModelType>> -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` +A Promise that will be resolved with the count; the count can be retrieved from `snapshot.data().count`, where `snapshot` is the `AggregateQuerySnapshot` to which the returned Promise resolves. -### startAt(snapshot) {:#startat_9a4477f} +### getDocs(query) {:#getdocs_4e56953} -Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. +Executes the query and returns the results as a [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class). + +All queries are executed directly by the server, even if the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK. Signature: ```typescript -export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; +export declare function getDocs(query: Query): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The Query to execute. | Returns: -[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) - -A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. - -## function(timestamp, ...) - -### timestampAdd(timestamp, unit, amount) {:#timestampadd_87db576} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<[QuerySnapshot](./firestore_lite.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>> -Creates an expression that adds a specified amount of time to a timestamp. +A Promise that will be resolved with the results of the query. -```typescript -// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); +### query(query, compositeFilter, queryConstraints) {:#query_9f7b0f4} -``` +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; +export declare function query(query: Query, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| compositeFilter | [QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) | The [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) to apply. Create [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) using [and()](./firestore_.md#and_e72c712) or [or()](./firestore_.md#or_e72c712). | +| queryConstraints | [QueryNonFilterConstraint](./firestore_lite.md#querynonfilterconstraint)\[\] | Additional [QueryNonFilterConstraint](./firestore_.md#querynonfilterconstraint)s to apply (e.g. [orderBy()](./firestore_.md#orderby_006d61f), [limit()](./firestore_.md#limit_ec46c78)). | Returns: -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) - -### timestampAdd(timestamp, unit, amount) {:#timestampadd_46a2d7e} +[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that adds a specified amount of time to a timestamp. +if any of the provided query constraints cannot be combined with the existing or new constraints. -```typescript -// Add 1 day to the 'timestamp' field. -timestampAdd(Field.of("timestamp"), "day", 1); +### query(query, queryConstraints) {:#query_0f46da1} -``` +Creates a new immutable instance of [Query](./firestore_.query.md#query_class) that is extended to also include additional query constraints. Signature: ```typescript -export declare function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +export declare function query(query: Query, ...queryConstraints: QueryConstraint[]): Query; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). | -| amount | number | The amount of time to add. A new representing the resulting timestamp. | +| query | [Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> | The [Query](./firestore_.query.md#query_class) instance to use as a base for the new constraints. | +| queryConstraints | [QueryConstraint](./firestore_lite.queryconstraint.md#queryconstraint_class)\[\] | The list of [QueryConstraint](./firestore_.queryconstraint.md#queryconstraint_class)s to apply. | Returns: -[TimestampAdd](./firestore_lite.timestampadd.md#timestampadd_class) +[Query](./firestore_lite.query.md#query_class)<AppModelType, DbModelType> -### timestampSub(timestamp, unit, amount) {:#timestampsub_87db576} +#### Exceptions -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +if any of the provided query constraints cannot be combined with the existing or new constraints. -Creates an expression that subtracts a specified amount of time from a timestamp. +## function(queryConstraints, ...) -```typescript -// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. -timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); +### and(queryConstraints) {:#and_e72c712} -``` +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a conjunction of the given filter constraints. A conjunction filter includes a document if it satisfies all of the given filters. Signature: ```typescript -export declare function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; +export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. | +| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a conjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | Returns: -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -### timestampSub(timestamp, unit, amount) {:#timestampsub_46a2d7e} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -Creates an expression that subtracts a specified amount of time from a timestamp. +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -```typescript -// Subtract 1 day from the 'timestamp' field. -timestampSub(Field.of("timestamp"), "day", 1); +### or(queryConstraints) {:#or_e72c712} -``` +Creates a new [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class) that is a disjunction of the given filter constraints. A disjunction filter includes a document if it satisfies any of the given filters. Signature: ```typescript -export declare function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the timestamp. | -| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). | -| amount | number | The amount of time to subtract. A new representing the resulting timestamp. | +| queryConstraints | [QueryFilterConstraint](./firestore_lite.md#queryfilterconstraint)\[\] | Optional. The list of [QueryFilterConstraint](./firestore_.md#queryfilterconstraint)s to perform a disjunction for. These must be created with calls to [where()](./firestore_.md#where_0fae4bf), [or()](./firestore_.md#or_e72c712), or [and()](./firestore_.md#and_e72c712). | Returns: -[TimestampSub](./firestore_lite.timestampsub.md#timestampsub_class) - -## function(value, ...) +[QueryCompositeFilterConstraint](./firestore_lite.querycompositefilterconstraint.md#querycompositefilterconstraint_class) -### avgFunction(value) {:#avgfunction_f83680a} +The newly created [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class). -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +## function(reference, ...) -Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. +### addDoc(reference, data) {:#adddoc_6e783ff} -```typescript -// Calculate the average age of users -avg(Field.of("age")).as("averageAge"); +Add a new document to specified `CollectionReference` with the given data, assigning it a document ID automatically. -``` +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function avgFunction(value: Constant): Avg; +export declare function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the values to average. A new representing the 'avg' aggregation. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to the collection to add this document to. | +| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | An Object containing the data for the new document. | Returns: -[Avg](./firestore_lite.avg.md#avg_class) +Promise<[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType>> -### avgFunction(value) {:#avgfunction_7c807cd} +A `Promise` resolved with a `DocumentReference` pointing to the newly created document after it has been written to the backend. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. +Error - If the provided input is not a valid Firestore document. -```typescript -// Calculate the average age of users -avg("age").as("averageAge"); +### collection(reference, path, pathSegments) {:#collection_568f98d} -``` +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function avgFunction(value: string): Avg; +export declare function collection(reference: CollectionReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field containing numeric values to average. A new representing the 'avg' aggregation. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments to apply relative to the first argument. | Returns: -[Avg](./firestore_lite.avg.md#avg_class) +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -### exists(value) {:#exists_f83680a} +The `CollectionReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that checks if a field exists. +If the final path has an even number of segments and does not point to a collection. -```typescript -// Check if the document has a field named "phoneNumber" -exists(Field.of("phoneNumber")); +### collection(reference, path, pathSegments) {:#collection_70b4396} -``` +Gets a `CollectionReference` instance that refers to a subcollection of `reference` at the specified relative path. Signature: ```typescript -export declare function exists(value: Constant): Exists; +export declare function collection(reference: DocumentReference, path: string, ...pathSegments: string[]): CollectionReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a collection. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[Exists](./firestore_lite.exists.md#exists_class) +[CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -### isNan(value) {:#isnan_f83680a} +The `CollectionReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). +If the final path has an even number of segments and does not point to a collection. -```typescript -// Check if the result of a calculation is NaN -isNaN(Field.of("value").divide(0)); +### deleteDoc(reference) {:#deletedoc_4569087} -``` +Deletes the document referred to by the specified `DocumentReference`. + +The deletion will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the delete fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function isNan(value: Constant): IsNan; +export declare function deleteDoc(reference: DocumentReference): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to check. A new representing the 'isNaN' check. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to delete. | Returns: -[IsNan](./firestore_lite.isnan.md#isnan_class) - -### isNan(value) {:#isnan_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Promise<void> -Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). +A `Promise` resolved once the document has been successfully deleted from the backend. -```typescript -// Check if the result of a calculation is NaN -isNaN("value"); +### doc(reference, path, pathSegments) {:#doc_568f98d} -``` +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. If no path is specified, an automatically-generated unique ID will be used for the returned `DocumentReference`. Signature: ```typescript -export declare function isNan(value: string): IsNan; +export declare function doc(reference: CollectionReference, path?: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to check. A new representing the 'isNaN' check. | +| reference | [CollectionReference](./firestore_lite.collectionreference.md#collectionreference_class)<AppModelType, DbModelType> | A reference to a collection. | +| path | string | A slash-separated path to a document. Has to be omitted to use auto-generated IDs. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[IsNan](./firestore_lite.isnan.md#isnan_class) +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> -### max(value) {:#max_f83680a} +The `DocumentReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. +If the final path has an odd number of segments and does not point to a document. -```typescript -// Find the highest score in a leaderboard -max(Field.of("score")).as("highestScore"); +### doc(reference, path, pathSegments) {:#doc_70b4396} -``` +Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path. Signature: ```typescript -export declare function max(value: Constant): Max; +export declare function doc(reference: DocumentReference, path: string, ...pathSegments: string[]): DocumentReference; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to find the maximum value of. A new representing the 'max' aggregation. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to a Firestore document. | +| path | string | A slash-separated path to a document. | +| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. | Returns: -[Max](./firestore_lite.max.md#max_class) +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<[DocumentData](./firestore_lite.documentdata.md#documentdata_interface), [DocumentData](./firestore_lite.documentdata.md#documentdata_interface)> -### max(value) {:#max_7c807cd} +The `DocumentReference` instance. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an aggregation that finds the maximum value of a field across multiple stage inputs. +If the final path has an odd number of segments and does not point to a document. -```typescript -// Find the highest score in a leaderboard -max("score").as("highestScore"); +### getDoc(reference) {:#getdoc_4569087} -``` +Reads the document referred to by the specified document reference. + +All documents are directly fetched from the server, even if the document was previously read or modified. Recent modifications are only reflected in the retrieved `DocumentSnapshot` if they have already been applied by the backend. If the client is offline, the read fails. If you like to use caching or see local modifications, please use the full Firestore SDK. Signature: ```typescript -export declare function max(value: string): Max; +export declare function getDoc(reference: DocumentReference): Promise>; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to find the maximum value of. A new representing the 'max' aggregation. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | The reference of the document to fetch. | Returns: -[Max](./firestore_lite.max.md#max_class) - -### min(value) {:#min_f83680a} +Promise<[DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>> -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +A Promise resolved with a `DocumentSnapshot` containing the current document contents. -Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. +### setDoc(reference, data) {:#setdoc_ee215ad} -```typescript -// Find the lowest price of all products -min(Field.of("price")).as("lowestPrice"); +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. -``` +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function min(value: Constant): Min; +export declare function setDoc(reference: DocumentReference, data: WithFieldValue): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to find the minimum value of. A new representing the 'min' aggregation. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [WithFieldValue](./firestore_lite.md#withfieldvalue)<AppModelType> | A map of the fields and values for the document. | Returns: -[Min](./firestore_lite.min.md#min_class) +Promise<void> -### min(value) {:#min_7c807cd} +A `Promise` resolved once the data has been successfully written to the backend. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an aggregation that finds the minimum value of a field across multiple stage inputs. +Error - If the provided input is not a valid Firestore document. -```typescript -// Find the lowest price of all products -min("price").as("lowestPrice"); +### setDoc(reference, data, options) {:#setdoc_ff80739} -``` +Writes to the document referred to by the specified `DocumentReference`. If the document does not yet exist, it will be created. If you provide `merge` or `mergeFields`, the provided data can be merged into an existing document. + +The result of this write will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function min(value: string): Min; +export declare function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field to find the minimum value of. A new representing the 'min' aggregation. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to write. | +| data | [PartialWithFieldValue](./firestore_lite.md#partialwithfieldvalue)<AppModelType> | A map of the fields and values for the document. | +| options | [SetOptions](./firestore_lite.md#setoptions) | An object to configure the set behavior. | Returns: -[Min](./firestore_lite.min.md#min_class) +Promise<void> -### replaceAll(value, find, replace) {:#replaceall_f06d323} +A `Promise` resolved once the data has been successfully written to the backend. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that replaces all occurrences of a substring within a string with another substring. +Error - If the provided input is not a valid Firestore document. -```typescript -// Replace all occurrences of "hello" with "hi" in the 'message' field. -replaceAll(Field.of("message"), "hello", "hi"); +### updateDoc(reference, data) {:#updatedoc_51a65e3} -``` +Updates fields in the document referred to by the specified `DocumentReference`. The update will fail if applied to a document that does not exist. + +The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; +export declare function updateDoc(reference: DocumentReference, data: UpdateData): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| data | [UpdateData](./firestore_lite.md#updatedata)<DbModelType> | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. | Returns: -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) +Promise<void> -### replaceAll(value, find, replace) {:#replaceall_26a7926} +A `Promise` resolved once the data has been successfully written to the backend. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that replaces all occurrences of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +Error - If the provided input is not valid Firestore data. -```typescript -// Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); +### updateDoc(reference, field, value, moreFieldsAndValues) {:#updatedoc_7c28659} -``` +Updates fields in the document referred to by the specified `DocumentReference` The update will fail if applied to a document that does not exist. + +Nested fields can be updated by providing dot-separated field path strings or by providing `FieldPath` objects. + +The result of this update will only be reflected in document reads that occur after the returned promise resolves. If the client is offline, the update fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK. Signature: ```typescript -export declare function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; +export declare function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace all occurrences of 'find' with. A new representing the string with all occurrences replaced. | +| reference | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<AppModelType, DbModelType> | A reference to the document to update. | +| field | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | The first field to update. | +| value | unknown | The first value. | +| moreFieldsAndValues | unknown\[\] | Additional key value pairs. | Returns: -[ReplaceAll](./firestore_lite.replaceall.md#replaceall_class) +Promise<void> -### replaceFirst(value, find, replace) {:#replacefirst_f06d323} +A `Promise` resolved once the data has been successfully written to the backend. -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +#### Exceptions -Creates an expression that replaces the first occurrence of a substring within a string with another substring. +Error - If the provided input is not valid Firestore data. -```typescript -// Replace the first occurrence of "hello" with "hi" in the 'message' field. -replaceFirst(Field.of("message"), "hello", "hi"); +## function(snapshot, ...) -``` +### endAt(snapshot) {:#endat_9a4477f} + +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; +export declare function endAt(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | string | The substring to search for. | -| replace | string | The substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end at. | Returns: -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -### replaceFirst(value, find, replace) {:#replacefirst_26a7926} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) -Creates an expression that replaces the first occurrence of a substring within a string with another substring, where the substring to find and the replacement substring are specified by expressions. +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -```typescript -// Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. -replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); +### endBefore(snapshot) {:#endbefore_9a4477f} -``` +Creates a [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) that modifies the result set to end before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; +export declare function endBefore(snapshot: DocumentSnapshot): QueryEndAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the string to perform the replacement on. | -| find | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to search for. | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | The expression representing the substring to replace the first occurrence of 'find' with. A new representing the string with the first occurrence replaced. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to end before. | Returns: -[ReplaceFirst](./firestore_lite.replacefirst.md#replacefirst_class) - -### sumFunction(value) {:#sumfunction_f83680a} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryEndAtConstraint](./firestore_lite.queryendatconstraint.md#queryendatconstraint_class) -Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. +A [QueryEndAtConstraint](./firestore_.queryendatconstraint.md#queryendatconstraint_class) to pass to `query()` -```typescript -// Calculate the total revenue from a set of orders -sum(Field.of("orderAmount")).as("totalRevenue"); +### startAfter(snapshot) {:#startafter_9a4477f} -``` +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query. Signature: ```typescript -export declare function sumFunction(value: Constant): Sum; +export declare function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | The expression to sum up. A new representing the 'sum' aggregation. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start after. | Returns: -[Sum](./firestore_lite.sum.md#sum_class) - -### sumFunction(value) {:#sumfunction_7c807cd} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) -Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()` -```typescript -// Calculate the total revenue from a set of orders -sum("orderAmount").as("totalRevenue"); +### startAt(snapshot) {:#startat_9a4477f} -``` +Creates a [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) that modifies the result set to start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the `orderBy` of this query. Signature: ```typescript -export declare function sumFunction(value: string): Sum; +export declare function startAt(snapshot: DocumentSnapshot): QueryStartAtConstraint; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| value | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. | +| snapshot | [DocumentSnapshot](./firestore_lite.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> | The snapshot of the document to start at. | Returns: -[Sum](./firestore_lite.sum.md#sum_class) +[QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) + +A [QueryStartAtConstraint](./firestore_.querystartatconstraint.md#querystartatconstraint_class) to pass to `query()`. ## function(values, ...) @@ -8556,19 +1595,6 @@ export declare function vector(values?: number[]): VectorValue; A new `VectorValue` constructed with a copy of the given array of numbers. -## AccumulatorTarget - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An accumulator target, which is an expression with an alias that also implements the Accumulator interface. - -Signature: - -```typescript -export declare type AccumulatorTarget = ExprWithAlias; -``` - ## AddPrefixToKeys Returns a new map where every key is prefixed with the outer key appended to a dot. @@ -8627,32 +1653,6 @@ See https://www.typescriptlang.org/docs/handbook/advanced-types.html\#distributi export declare type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; ``` -## ExprType - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An enumeration of the different types of expressions. - -Signature: - -```typescript -export declare type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; -``` - -## FilterExpr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A filter expression, which is an expression that also implements the FilterCondition interface. - -Signature: - -```typescript -export declare type FilterExpr = Constant & FilterCondition; -``` - ## FirestoreErrorCode The set of Firestore status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md @@ -8739,19 +1739,6 @@ export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCo export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint; ``` -## SelectableExpr - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A selectable expression, which is an expression that also implements the Selectable interface. - -Signature: - -```typescript -export declare type SelectableExpr = Constant & Selectable; -``` - ## SetOptions An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a `SetOptions` with `merge: true`. diff --git a/docs-devsite/firestore_lite.min.md b/docs-devsite/firestore_lite.min.md deleted file mode 100644 index 684db43d806..00000000000 --- a/docs-devsite/firestore_lite.min.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Min class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Min extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_lite.min.md#minconstructor) | | (BETA) Constructs a new instance of the Min class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_lite.min.md#minaccumulator) | | true | (BETA) | - -## Min.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Min` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| distinct | boolean | | - -## Min.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.mod.md b/docs-devsite/firestore_lite.mod.md deleted file mode 100644 index f007f09a87e..00000000000 --- a/docs-devsite/firestore_lite.mod.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Mod class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Mod extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.mod.md#modconstructor) | | (BETA) Constructs a new instance of the Mod class | - -## Mod.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Mod` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.multiply.md b/docs-devsite/firestore_lite.multiply.md deleted file mode 100644 index 38ca6014b2c..00000000000 --- a/docs-devsite/firestore_lite.multiply.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Multiply class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Multiply extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.multiply.md#multiplyconstructor) | | (BETA) Constructs a new instance of the Multiply class | - -## Multiply.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Multiply` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.neq.md b/docs-devsite/firestore_lite.neq.md deleted file mode 100644 index 132e5721b8f..00000000000 --- a/docs-devsite/firestore_lite.neq.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Neq class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Neq extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.neq.md#neqconstructor) | | (BETA) Constructs a new instance of the Neq class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.neq.md#neqfilterable) | | true | (BETA) | - -## Neq.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Neq` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Neq.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.not.md b/docs-devsite/firestore_lite.not.md deleted file mode 100644 index 362ccd8a789..00000000000 --- a/docs-devsite/firestore_lite.not.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Not class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Not extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.not.md#notconstructor) | | (BETA) Constructs a new instance of the Not class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.not.md#notfilterable) | | true | (BETA) | - -## Not.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Not` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - -## Not.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.offset.md b/docs-devsite/firestore_lite.offset.md deleted file mode 100644 index dc09ac97be6..00000000000 --- a/docs-devsite/firestore_lite.offset.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Offset class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Offset implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(offset)](./firestore_lite.offset.md#offsetconstructor) | | (BETA) Constructs a new instance of the Offset class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.offset.md#offsetname) | | string | (BETA) | - -## Offset.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Offset` class - -Signature: - -```typescript -constructor(offset: number); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| offset | number | | - -## Offset.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.or.md b/docs-devsite/firestore_lite.or.md deleted file mode 100644 index d2c506893a0..00000000000 --- a/docs-devsite/firestore_lite.or.md +++ /dev/null @@ -1,17 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# or namespace -Signature: - -```typescript -export declare namespace or -``` diff --git a/docs-devsite/firestore_lite.ordering.md b/docs-devsite/firestore_lite.ordering.md deleted file mode 100644 index c8dc1249d73..00000000000 --- a/docs-devsite/firestore_lite.ordering.md +++ /dev/null @@ -1,51 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Ordering class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents an ordering criterion for sorting documents in a Firestore pipeline. - -You create `Ordering` instances using the `ascending` and `descending` helper functions. - -Signature: - -```typescript -export declare class Ordering -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, direction)](./firestore_lite.ordering.md#orderingconstructor) | | (BETA) Constructs a new instance of the Ordering class | - -## Ordering.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Ordering` class - -Signature: - -```typescript -constructor(expr: Constant, direction: 'ascending' | 'descending'); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| direction | 'ascending' \| 'descending' | | - diff --git a/docs-devsite/firestore_lite.pipeline.md b/docs-devsite/firestore_lite.pipeline.md deleted file mode 100644 index c34aa32109e..00000000000 --- a/docs-devsite/firestore_lite.pipeline.md +++ /dev/null @@ -1,564 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Pipeline class -Base-class implementation - -Signature: - -```typescript -export declare class Pipeline -``` - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [addFields(fields)](./firestore_lite.pipeline.md#pipelineaddfields) | | Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like add, multiply with assigned aliases using .Example: -```typescript -firestore.pipeline().collection("books") - .addFields( - Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' - add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' - ); - -``` - | -| [aggregate(accumulators)](./firestore_lite.pipeline.md#pipelineaggregate) | | Performs aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances.

Example: -```typescript -// Calculate the average rating and the total number of books -firestore.pipeline().collection("books") - .aggregate( - Field.of("rating").avg().as("averageRating"), - countAll().as("totalBooks") - ); - -``` - | -| [aggregate(options)](./firestore_lite.pipeline.md#pipelineaggregate) | | Performs optionally grouped aggregation operations on the documents from previous stages.

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify:

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.

Example: -```typescript -// Calculate the average rating for each genre. -firestore.pipeline().collection("books") - .aggregate({ - accumulators: [avg(Field.of("rating")).as("avg_rating")] - groups: ["genre"] - }); - -``` - | -| [distinct(groups)](./firestore_lite.pipeline.md#pipelinedistinct) | | Returns a set of distinct values from the inputs to this stage.

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc).

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using

Example: -```typescript -// Get a list of unique author names in uppercase and genre combinations. -firestore.pipeline().collection("books") - .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") - .select("authorName"); - -``` - | -| [execute()](./firestore_lite.pipeline.md#pipelineexecute) | | Executes this pipeline and returns a Promise to represent the asynchronous operation.

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.

Example: -```typescript -const futureResults = await firestore.pipeline().collection("books") - .where(gt(Field.of("rating"), 4.5)) - .select("title", "author", "rating") - .execute(); - -``` - A Promise representing the asynchronous pipeline execution. | -| [findNearest(options)](./firestore_lite.pipeline.md#pipelinefindnearest) | | | -| [genericStage(name, params)](./firestore_lite.pipeline.md#pipelinegenericstage) | | Adds a generic stage to the pipeline.

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique name and a set of params that control its behavior.

Example (Assuming there is no "where" stage available in SDK): -```typescript -// Assume we don't have a built-in "where" stage -firestore.pipeline().collection("books") - .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage - .select("title", "author"); - -``` - | -| [limit(limit)](./firestore_lite.pipeline.md#pipelinelimit) | | Limits the maximum number of documents returned by previous stages to limit.

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for:

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.

Example: -```typescript -// Limit the results to the top 10 highest-rated books -firestore.pipeline().collection("books") - .sort(Field.of("rating").descending()) - .limit(10); - -``` - | -| [offset(offset)](./firestore_lite.pipeline.md#pipelineoffset) | | Skips the first offset number of documents from the results of previous stages.

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.

Example: -```typescript -// Retrieve the second page of 20 results -firestore.pipeline().collection("books") - .sort(Field.of("published").descending()) - .offset(20) // Skip the first 20 results - .limit(20); // Take the next 20 results - -``` - | -| [select(selections)](./firestore_lite.pipeline.md#pipelineselect) | | Selects or creates a set of fields from the outputs of previous stages.

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be:

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.

Example: -```typescript -firestore.pipeline().collection("books") - .select( - "firstName", - Field.of("lastName"), - Field.of("address").toUppercase().as("upperAddress"), - ); - -``` - | -| [sort(orderings)](./firestore_lite.pipeline.md#pipelinesort) | | Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria.

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.

Example: -```typescript -// Sort books by rating in descending order, and then by title in ascending order for books -// with the same rating -firestore.pipeline().collection("books") - .sort( - Ordering.of(Field.of("rating")).descending(), - Ordering.of(Field.of("title")) // Ascending order is the default - ); - -``` - | -| [sort(options)](./firestore_lite.pipeline.md#pipelinesort) | | | -| [where(condition)](./firestore_lite.pipeline.md#pipelinewhere) | | Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface).

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to:

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.

Example: -```typescript -firestore.pipeline().collection("books") - .where( - and( - gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 - Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") - ) - ); - -``` - | - -## Pipeline.addFields() - -Adds new fields to outputs from previous stages. - -This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps). - -The added fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface)s, which can be: - -- [Field](./firestore_.field.md#field_class): References an existing document field. - : Performs a calculation using functions like `add`, `multiply` with assigned aliases using . - -Example: - -```typescript -firestore.pipeline().collection("books") - .addFields( - Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' - add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' - ); - -``` - -Signature: - -```typescript -addFields(...fields: Selectable[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fields | [Selectable](./firestore_lite.selectable.md#selectable_interface)\[\] | The fields to add to the documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface)s. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.aggregate() - -Performs aggregation operations on the documents from previous stages. - -

This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions which are typically results of calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. - -

Example: - -```typescript -// Calculate the average rating and the total number of books -firestore.pipeline().collection("books") - .aggregate( - Field.of("rating").avg().as("averageRating"), - countAll().as("totalBooks") - ); - -``` - -Signature: - -```typescript -aggregate(...accumulators: AccumulatorTarget[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| accumulators | [AccumulatorTarget](./firestore_lite.md#accumulatortarget)\[\] | The [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, each wrapping an [Accumulator](./firestore_.accumulator.md#accumulator_interface) and provide a name for the accumulated results. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.aggregate() - -Performs optionally grouped aggregation operations on the documents from previous stages. - -

This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: - -

  • \*\*Grouping Fields or Functions:\*\* One or more fields or functions to group the documents by. For each distinct combination of values in these fields, a separate group is created. If no grouping fields are provided, a single group containing all documents is used. Not specifying groups is the same as putting the entire inputs into one group.
  • \*\*Accumulators:\*\* One or more accumulation operations to perform within each group. These are defined using [AccumulatorTarget](./firestore_.md#accumulatortarget) expressions, which are typically created by calling on [Accumulator](./firestore_.accumulator.md#accumulator_interface) instances. Each aggregation calculates a value (e.g., sum, average, count) based on the documents within its group.
- -

Example: - -```typescript -// Calculate the average rating for each genre. -firestore.pipeline().collection("books") - .aggregate({ - accumulators: [avg(Field.of("rating")).as("avg_rating")] - groups: ["genre"] - }); - -``` - -Signature: - -```typescript -aggregate(options: { - accumulators: AccumulatorTarget[]; - groups?: Array; - }): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | { accumulators: [AccumulatorTarget](./firestore_lite.md#accumulatortarget)\[\]; groups?: Array<string \| [Selectable](./firestore_lite.selectable.md#selectable_interface)>; } | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.distinct() - -Returns a set of distinct values from the inputs to this stage. - -

This stage run through the results from previous stages to include only results with unique combinations of values ([Field](./firestore_.field.md#field_class), , etc). - -

The parameters to this stage are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions or s: - -

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing document field.
  • : Represents the result of a function with an assigned alias name using
- -

Example: - -```typescript -// Get a list of unique author names in uppercase and genre combinations. -firestore.pipeline().collection("books") - .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") - .select("authorName"); - -``` - -Signature: - -```typescript -distinct(...groups: Array): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| groups | Array<string \| [Selectable](./firestore_lite.selectable.md#selectable_interface)> | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.execute() - -Executes this pipeline and returns a Promise to represent the asynchronous operation. - -

The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously. - -

The pipeline results are returned as a list of [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: - -

  • If there are no stages or only transformation stages, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a single document.
  • If there is an aggregation, only a single [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) is returned, representing the aggregated results over the entire dataset .
  • If there is an aggregation stage with grouping, each [PipelineResult](./firestore_.pipelineresult.md#pipelineresult_class) represents a distinct group and its associated aggregated values.
- -

Example: - -```typescript -const futureResults = await firestore.pipeline().collection("books") - .where(gt(Field.of("rating"), 4.5)) - .select("title", "author", "rating") - .execute(); - -``` - A Promise representing the asynchronous pipeline execution. - -Signature: - -```typescript -execute(): Promise>>; -``` -Returns: - -Promise<Array<[PipelineResult](./firestore_lite.pipelineresult.md#pipelineresult_class)<AppModelType>>> - -## Pipeline.findNearest() - -Signature: - -```typescript -findNearest(options: FindNearestOptions): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | [FindNearestOptions](./firestore_lite.findnearestoptions.md#findnearestoptions_interface) | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.genericStage() - -Adds a generic stage to the pipeline. - -

This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each generic stage is defined by a unique `name` and a set of `params` that control its behavior. - -

Example (Assuming there is no "where" stage available in SDK): - -```typescript -// Assume we don't have a built-in "where" stage -firestore.pipeline().collection("books") - .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage - .select("title", "author"); - -``` - -Signature: - -```typescript -genericStage(name: string, params: any[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| name | string | The unique name of the generic stage to add. | -| params | any\[\] | A list of parameters to configure the generic stage's behavior. A new object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.limit() - -Limits the maximum number of documents returned by previous stages to `limit`. - -

This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: - -

  • \*\*Pagination:\*\* In combination with to retrieve specific pages of results.
  • \*\*Limiting Data Retrieval:\*\* To prevent excessive data transfer and improve performance, especially when dealing with large collections.
- -

Example: - -```typescript -// Limit the results to the top 10 highest-rated books -firestore.pipeline().collection("books") - .sort(Field.of("rating").descending()) - .limit(10); - -``` - -Signature: - -```typescript -limit(limit: number): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| limit | number | The maximum number of documents to return. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.offset() - -Skips the first `offset` number of documents from the results of previous stages. - -

This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. - -

Example: - -```typescript -// Retrieve the second page of 20 results -firestore.pipeline().collection("books") - .sort(Field.of("published").descending()) - .offset(20) // Skip the first 20 results - .limit(20); // Take the next 20 results - -``` - -Signature: - -```typescript -offset(offset: number): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| offset | number | The number of documents to skip. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.select() - -Selects or creates a set of fields from the outputs of previous stages. - -

The selected fields are defined using [Selectable](./firestore_.selectable.md#selectable_interface) expressions, which can be: - -

  • : Name of an existing field
  • [Field](./firestore_.field.md#field_class): References an existing field.
  • : Represents the result of a function with an assigned alias name using
- -

If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. - -

Example: - -```typescript -firestore.pipeline().collection("books") - .select( - "firstName", - Field.of("lastName"), - Field.of("address").toUppercase().as("upperAddress"), - ); - -``` - -Signature: - -```typescript -select(...selections: Array): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| selections | Array<[Selectable](./firestore_lite.selectable.md#selectable_interface) \| string> | The fields to include in the output documents, specified as [Selectable](./firestore_.selectable.md#selectable_interface) expressions or values representing field names. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.sort() - -Sorts the documents from previous stages based on one or more [Ordering](./firestore_.ordering.md#ordering_class) criteria. - -

This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. - -

Example: - -```typescript -// Sort books by rating in descending order, and then by title in ascending order for books -// with the same rating -firestore.pipeline().collection("books") - .sort( - Ordering.of(Field.of("rating")).descending(), - Ordering.of(Field.of("title")) // Ascending order is the default - ); - -``` - -Signature: - -```typescript -sort(...orderings: Ordering[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| orderings | [Ordering](./firestore_lite.ordering.md#ordering_class)\[\] | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.sort() - -Signature: - -```typescript -sort(options: { - orderings: Ordering[]; - }): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| options | { orderings: [Ordering](./firestore_lite.ordering.md#ordering_class)\[\]; } | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - -## Pipeline.where() - -Filters the documents from previous stages to only include those matching the specified [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface). - -

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface), typically including but not limited to: - -

  • field comparators: , (less than), (greater than), etc.
  • logical operators: , , , etc.
  • advanced functions: , , etc.
- -

Example: - -```typescript -firestore.pipeline().collection("books") - .where( - and( - gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 - Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") - ) - ); - -``` - -Signature: - -```typescript -where(condition: FilterCondition & Constant): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) & [Constant](./firestore_lite.constant.md#constant_class) | The [FilterCondition](./firestore_.filtercondition.md#filtercondition_interface) to apply. A new Pipeline object with this stage appended to the stage list. | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class)<AppModelType> - diff --git a/docs-devsite/firestore_lite.pipelineresult.md b/docs-devsite/firestore_lite.pipelineresult.md deleted file mode 100644 index 16a64fd9b7c..00000000000 --- a/docs-devsite/firestore_lite.pipelineresult.md +++ /dev/null @@ -1,184 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# PipelineResult class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods. - -

If the PipelineResult represents a non-document result, `ref` will return a undefined value. - -Signature: - -```typescript -export declare class PipelineResult -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [createTime](./firestore_lite.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was created. Undefined if this result is not a document. {Timestamp\|undefined} | -| [executionTime](./firestore_lite.pipelineresult.md#pipelineresultexecutiontime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | (BETA) The time at which the pipeline producing this result is executed. {Timestamp} | -| [id](./firestore_lite.pipelineresult.md#pipelineresultid) | | string \| undefined | (BETA) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. {string} | -| [ref](./firestore_lite.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) \| undefined | (BETA) The reference of the document, if it is a document; otherwise undefined. | -| [updateTime](./firestore_lite.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (BETA) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [data()](./firestore_lite.pipelineresult.md#pipelineresultdata) | | (BETA) Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. | -| [get(fieldPath)](./firestore_lite.pipelineresult.md#pipelineresultget) | | (BETA) Retrieves the field specified by field. | - -## PipelineResult.createTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time the document was created. Undefined if this result is not a document. - - {Timestamp\|undefined} - -Signature: - -```typescript -get createTime(): Timestamp | undefined; -``` - -## PipelineResult.executionTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time at which the pipeline producing this result is executed. - - {Timestamp} - -Signature: - -```typescript -get executionTime(): Timestamp; -``` - -## PipelineResult.id - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The ID of the document for which this PipelineResult contains data, if it is a document; otherwise `undefined`. - - {string} - -Signature: - -```typescript -get id(): string | undefined; -``` - -## PipelineResult.ref - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The reference of the document, if it is a document; otherwise `undefined`. - -Signature: - -```typescript -get ref(): DocumentReference | undefined; -``` - -## PipelineResult.updateTime - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. - - {Timestamp\|undefined} - -Signature: - -```typescript -get updateTime(): Timestamp | undefined; -``` - -## PipelineResult.data() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Retrieves all fields in the result as an object. Returns 'undefined' if the document doesn't exist. - -Signature: - -```typescript -data(): AppModelType | undefined; -``` -Returns: - -AppModelType \| undefined - -{T\|undefined} An object containing all fields in the document or 'undefined' if the document doesn't exist. - -### Example - - -``` -let p = firestore.pipeline().collection('col'); - -p.execute().then(results => { - let data = results[0].data(); - console.log(`Retrieved data: ${JSON.stringify(data)}`); -}); - -``` - -## PipelineResult.get() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Retrieves the field specified by `field`. - -Signature: - -```typescript -get(fieldPath: string | FieldPath): any; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md#fieldpath_class) | | - -Returns: - -any - -{\*} The data at the specified field location or undefined if no such field exists. - -### Example - - -``` -let p = firestore.pipeline().collection('col'); - -p.execute().then(results => { - let field = results[0].get('a.b'); - console.log(`Retrieved field value: ${field}`); -}); - -``` - diff --git a/docs-devsite/firestore_lite.pipelinesource.md b/docs-devsite/firestore_lite.pipelinesource.md deleted file mode 100644 index 9a5f0362c93..00000000000 --- a/docs-devsite/firestore_lite.pipelinesource.md +++ /dev/null @@ -1,109 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# PipelineSource class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Represents the source of a Firestore [Pipeline](./firestore_.pipeline.md#pipeline_class). - -Signature: - -```typescript -export declare class PipelineSource -``` - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [collection(collectionPath)](./firestore_lite.pipelinesource.md#pipelinesourcecollection) | | (BETA) | -| [collectionGroup(collectionId)](./firestore_lite.pipelinesource.md#pipelinesourcecollectiongroup) | | (BETA) | -| [database()](./firestore_lite.pipelinesource.md#pipelinesourcedatabase) | | (BETA) | -| [documents(docs)](./firestore_lite.pipelinesource.md#pipelinesourcedocuments) | | (BETA) | - -## PipelineSource.collection() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -collection(collectionPath: string): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) - -## PipelineSource.collectionGroup() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -collectionGroup(collectionId: string): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionId | string | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) - -## PipelineSource.database() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -database(): Pipeline; -``` -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) - -## PipelineSource.documents() - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -documents(docs: DocumentReference[]): Pipeline; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| docs | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class)\[\] | | - -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) - diff --git a/docs-devsite/firestore_lite.query.md b/docs-devsite/firestore_lite.query.md index 210d2b0895e..48beee0e10c 100644 --- a/docs-devsite/firestore_lite.query.md +++ b/docs-devsite/firestore_lite.query.md @@ -36,7 +36,6 @@ export declare class QueryNewDbModelType and your custom type NewAppModelType. | @@ -80,19 +79,6 @@ The type of this Firestore reference. readonly type: 'query' | 'collection'; ``` -## Query.pipeline() - -Pipeline query. - -Signature: - -```typescript -pipeline(): Pipeline; -``` -Returns: - -[Pipeline](./firestore_lite.pipeline.md#pipeline_class) - ## Query.withConverter() Removes the current converter. diff --git a/docs-devsite/firestore_lite.querycompositefilterconstraint.md b/docs-devsite/firestore_lite.querycompositefilterconstraint.md index c32cfa1b5a0..1db79b79522 100644 --- a/docs-devsite/firestore_lite.querycompositefilterconstraint.md +++ b/docs-devsite/firestore_lite.querycompositefilterconstraint.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # QueryCompositeFilterConstraint class -A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking or and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. +A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a Firestore query by performing the logical OR or AND of multiple [QueryFieldFilterConstraint](./firestore_.queryfieldfilterconstraint.md#queryfieldfilterconstraint_class)s or [QueryCompositeFilterConstraint](./firestore_.querycompositefilterconstraint.md#querycompositefilterconstraint_class)s. `QueryCompositeFilterConstraint`s are created by invoking [or()](./firestore_.md#or_e72c712) or [and()](./firestore_.md#and_e72c712) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains the `QueryCompositeFilterConstraint`. Signature: diff --git a/docs-devsite/firestore_lite.regexcontains.md b/docs-devsite/firestore_lite.regexcontains.md deleted file mode 100644 index aaf069cde7f..00000000000 --- a/docs-devsite/firestore_lite.regexcontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# RegexContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class RegexContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_lite.regexcontains.md#regexcontainsconstructor) | | (BETA) Constructs a new instance of the RegexContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.regexcontains.md#regexcontainsfilterable) | | true | (BETA) | - -## RegexContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `RegexContains` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -## RegexContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.regexmatch.md b/docs-devsite/firestore_lite.regexmatch.md deleted file mode 100644 index 78d9029e3a9..00000000000 --- a/docs-devsite/firestore_lite.regexmatch.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# RegexMatch class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class RegexMatch extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, pattern)](./firestore_lite.regexmatch.md#regexmatchconstructor) | | (BETA) Constructs a new instance of the RegexMatch class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.regexmatch.md#regexmatchfilterable) | | true | (BETA) | - -## RegexMatch.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `RegexMatch` class - -Signature: - -```typescript -constructor(expr: Constant, pattern: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| pattern | [Constant](./firestore_lite.constant.md#constant_class) | | - -## RegexMatch.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.replaceall.md b/docs-devsite/firestore_lite.replaceall.md deleted file mode 100644 index d318d936b96..00000000000 --- a/docs-devsite/firestore_lite.replaceall.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ReplaceAll class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ReplaceAll extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, find, replace)](./firestore_lite.replaceall.md#replaceallconstructor) | | (BETA) Constructs a new instance of the ReplaceAll class | - -## ReplaceAll.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ReplaceAll` class - -Signature: - -```typescript -constructor(value: Constant, find: Constant, replace: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| find | [Constant](./firestore_lite.constant.md#constant_class) | | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.replacefirst.md b/docs-devsite/firestore_lite.replacefirst.md deleted file mode 100644 index d8e83dd2140..00000000000 --- a/docs-devsite/firestore_lite.replacefirst.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ReplaceFirst class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ReplaceFirst extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, find, replace)](./firestore_lite.replacefirst.md#replacefirstconstructor) | | (BETA) Constructs a new instance of the ReplaceFirst class | - -## ReplaceFirst.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ReplaceFirst` class - -Signature: - -```typescript -constructor(value: Constant, find: Constant, replace: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| find | [Constant](./firestore_lite.constant.md#constant_class) | | -| replace | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.reverse.md b/docs-devsite/firestore_lite.reverse.md deleted file mode 100644 index 65b4d256a5c..00000000000 --- a/docs-devsite/firestore_lite.reverse.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Reverse class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Reverse extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_lite.reverse.md#reverseconstructor) | | (BETA) Constructs a new instance of the Reverse class | - -## Reverse.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Reverse` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.select.md b/docs-devsite/firestore_lite.select.md deleted file mode 100644 index 6221a7c41a7..00000000000 --- a/docs-devsite/firestore_lite.select.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Select class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Select implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(projections)](./firestore_lite.select.md#selectconstructor) | | (BETA) Constructs a new instance of the Select class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.select.md#selectname) | | string | (BETA) | - -## Select.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Select` class - -Signature: - -```typescript -constructor(projections: Map); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| projections | Map<string, [Constant](./firestore_lite.constant.md#constant_class)> | | - -## Select.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.selectable.md b/docs-devsite/firestore_lite.selectable.md deleted file mode 100644 index aeb75036db3..00000000000 --- a/docs-devsite/firestore_lite.selectable.md +++ /dev/null @@ -1,39 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Selectable interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -An interface that represents a selectable expression. - -Signature: - -```typescript -export declare interface Selectable -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [selectable](./firestore_lite.selectable.md#selectableselectable) | true | (BETA) | - -## Selectable.selectable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -selectable: true; -``` diff --git a/docs-devsite/firestore_lite.sort.md b/docs-devsite/firestore_lite.sort.md deleted file mode 100644 index f387044b540..00000000000 --- a/docs-devsite/firestore_lite.sort.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Sort class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Sort implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(orders)](./firestore_lite.sort.md#sortconstructor) | | (BETA) Constructs a new instance of the Sort class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.sort.md#sortname) | | string | (BETA) | - -## Sort.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Sort` class - -Signature: - -```typescript -constructor(orders: Ordering[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| orders | [Ordering](./firestore_lite.ordering.md#ordering_class)\[\] | | - -## Sort.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.stage.md b/docs-devsite/firestore_lite.stage.md deleted file mode 100644 index 9aa24210656..00000000000 --- a/docs-devsite/firestore_lite.stage.md +++ /dev/null @@ -1,38 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Stage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare interface Stage -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [name](./firestore_lite.stage.md#stagename) | string | (BETA) | - -## Stage.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.startswith.md b/docs-devsite/firestore_lite.startswith.md deleted file mode 100644 index a30cdae497a..00000000000 --- a/docs-devsite/firestore_lite.startswith.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StartsWith class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StartsWith extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, prefix)](./firestore_lite.startswith.md#startswithconstructor) | | (BETA) Constructs a new instance of the StartsWith class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.startswith.md#startswithfilterable) | | true | (BETA) | - -## StartsWith.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StartsWith` class - -Signature: - -```typescript -constructor(expr: Constant, prefix: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| prefix | [Constant](./firestore_lite.constant.md#constant_class) | | - -## StartsWith.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.strconcat.md b/docs-devsite/firestore_lite.strconcat.md deleted file mode 100644 index f3e1ad2bcde..00000000000 --- a/docs-devsite/firestore_lite.strconcat.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StrConcat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StrConcat extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(first, rest)](./firestore_lite.strconcat.md#strconcatconstructor) | | (BETA) Constructs a new instance of the StrConcat class | - -## StrConcat.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StrConcat` class - -Signature: - -```typescript -constructor(first: Constant, rest: Constant[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| first | [Constant](./firestore_lite.constant.md#constant_class) | | -| rest | [Constant](./firestore_lite.constant.md#constant_class)\[\] | | - diff --git a/docs-devsite/firestore_lite.strcontains.md b/docs-devsite/firestore_lite.strcontains.md deleted file mode 100644 index 36fed4dd005..00000000000 --- a/docs-devsite/firestore_lite.strcontains.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# StrContains class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class StrContains extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr, substring)](./firestore_lite.strcontains.md#strcontainsconstructor) | | (BETA) Constructs a new instance of the StrContains class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.strcontains.md#strcontainsfilterable) | | true | (BETA) | - -## StrContains.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `StrContains` class - -Signature: - -```typescript -constructor(expr: Constant, substring: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | -| substring | [Constant](./firestore_lite.constant.md#constant_class) | | - -## StrContains.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` diff --git a/docs-devsite/firestore_lite.subtract.md b/docs-devsite/firestore_lite.subtract.md deleted file mode 100644 index 7d692f3c779..00000000000 --- a/docs-devsite/firestore_lite.subtract.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Subtract class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Subtract extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(left, right)](./firestore_lite.subtract.md#subtractconstructor) | | (BETA) Constructs a new instance of the Subtract class | - -## Subtract.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Subtract` class - -Signature: - -```typescript -constructor(left: Constant, right: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| left | [Constant](./firestore_lite.constant.md#constant_class) | | -| right | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.sum.md b/docs-devsite/firestore_lite.sum.md deleted file mode 100644 index 0f65e6aa601..00000000000 --- a/docs-devsite/firestore_lite.sum.md +++ /dev/null @@ -1,67 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Sum class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Sum extends FirestoreFunction implements Accumulator -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [Accumulator](./firestore_lite.accumulator.md#accumulator_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value, distinct)](./firestore_lite.sum.md#sumconstructor) | | (BETA) Constructs a new instance of the Sum class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [accumulator](./firestore_lite.sum.md#sumaccumulator) | | true | (BETA) | - -## Sum.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Sum` class - -Signature: - -```typescript -constructor(value: Constant, distinct: boolean); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | -| distinct | boolean | | - -## Sum.accumulator - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -accumulator: true; -``` diff --git a/docs-devsite/firestore_lite.timestampadd.md b/docs-devsite/firestore_lite.timestampadd.md deleted file mode 100644 index 10f90f438e0..00000000000 --- a/docs-devsite/firestore_lite.timestampadd.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampAdd class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampAdd extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(timestamp, unit, amount)](./firestore_lite.timestampadd.md#timestampaddconstructor) | | (BETA) Constructs a new instance of the TimestampAdd class | - -## TimestampAdd.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampAdd` class - -Signature: - -```typescript -constructor(timestamp: Constant, unit: Constant, amount: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.timestampsub.md b/docs-devsite/firestore_lite.timestampsub.md deleted file mode 100644 index 076e525cf10..00000000000 --- a/docs-devsite/firestore_lite.timestampsub.md +++ /dev/null @@ -1,50 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampSub class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampSub extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(timestamp, unit, amount)](./firestore_lite.timestampsub.md#timestampsubconstructor) | | (BETA) Constructs a new instance of the TimestampSub class | - -## TimestampSub.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampSub` class - -Signature: - -```typescript -constructor(timestamp: Constant, unit: Constant, amount: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| timestamp | [Constant](./firestore_lite.constant.md#constant_class) | | -| unit | [Constant](./firestore_lite.constant.md#constant_class) | | -| amount | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.timestamptounixmicros.md b/docs-devsite/firestore_lite.timestamptounixmicros.md deleted file mode 100644 index e9f398659a7..00000000000 --- a/docs-devsite/firestore_lite.timestamptounixmicros.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixMicros class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixMicros extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.timestamptounixmicros.md#timestamptounixmicrosconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMicros class | - -## TimestampToUnixMicros.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixMicros` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.timestamptounixmillis.md b/docs-devsite/firestore_lite.timestamptounixmillis.md deleted file mode 100644 index b354dcc5585..00000000000 --- a/docs-devsite/firestore_lite.timestamptounixmillis.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixMillis class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixMillis extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.timestamptounixmillis.md#timestamptounixmillisconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixMillis class | - -## TimestampToUnixMillis.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixMillis` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.timestamptounixseconds.md b/docs-devsite/firestore_lite.timestamptounixseconds.md deleted file mode 100644 index 2275fe6ebac..00000000000 --- a/docs-devsite/firestore_lite.timestamptounixseconds.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# TimestampToUnixSeconds class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class TimestampToUnixSeconds extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.timestamptounixseconds.md#timestamptounixsecondsconstructor) | | (BETA) Constructs a new instance of the TimestampToUnixSeconds class | - -## TimestampToUnixSeconds.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `TimestampToUnixSeconds` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.tolower.md b/docs-devsite/firestore_lite.tolower.md deleted file mode 100644 index 49128adf612..00000000000 --- a/docs-devsite/firestore_lite.tolower.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ToLower class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ToLower extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.tolower.md#tolowerconstructor) | | (BETA) Constructs a new instance of the ToLower class | - -## ToLower.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ToLower` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.toupper.md b/docs-devsite/firestore_lite.toupper.md deleted file mode 100644 index 120c81d05bd..00000000000 --- a/docs-devsite/firestore_lite.toupper.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ToUpper class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class ToUpper extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.toupper.md#toupperconstructor) | | (BETA) Constructs a new instance of the ToUpper class | - -## ToUpper.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `ToUpper` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.trim.md b/docs-devsite/firestore_lite.trim.md deleted file mode 100644 index 8de73fd1667..00000000000 --- a/docs-devsite/firestore_lite.trim.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Trim class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Trim extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(expr)](./firestore_lite.trim.md#trimconstructor) | | (BETA) Constructs a new instance of the Trim class | - -## Trim.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Trim` class - -Signature: - -```typescript -constructor(expr: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| expr | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.unixmicrostotimestamp.md b/docs-devsite/firestore_lite.unixmicrostotimestamp.md deleted file mode 100644 index a2e03a5dedf..00000000000 --- a/docs-devsite/firestore_lite.unixmicrostotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixMicrosToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixMicrosToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.unixmicrostotimestamp.md#unixmicrostotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMicrosToTimestamp class | - -## UnixMicrosToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixMicrosToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.unixmillistotimestamp.md b/docs-devsite/firestore_lite.unixmillistotimestamp.md deleted file mode 100644 index a48df96c0e9..00000000000 --- a/docs-devsite/firestore_lite.unixmillistotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixMillisToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixMillisToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.unixmillistotimestamp.md#unixmillistotimestampconstructor) | | (BETA) Constructs a new instance of the UnixMillisToTimestamp class | - -## UnixMillisToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixMillisToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.unixsecondstotimestamp.md b/docs-devsite/firestore_lite.unixsecondstotimestamp.md deleted file mode 100644 index 99ad2f71285..00000000000 --- a/docs-devsite/firestore_lite.unixsecondstotimestamp.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# UnixSecondsToTimestamp class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class UnixSecondsToTimestamp extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(input)](./firestore_lite.unixsecondstotimestamp.md#unixsecondstotimestampconstructor) | | (BETA) Constructs a new instance of the UnixSecondsToTimestamp class | - -## UnixSecondsToTimestamp.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `UnixSecondsToTimestamp` class - -Signature: - -```typescript -constructor(input: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| input | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.vectorlength.md b/docs-devsite/firestore_lite.vectorlength.md deleted file mode 100644 index 58636d6f95a..00000000000 --- a/docs-devsite/firestore_lite.vectorlength.md +++ /dev/null @@ -1,48 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# VectorLength class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class VectorLength extends FirestoreFunction -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(value)](./firestore_lite.vectorlength.md#vectorlengthconstructor) | | (BETA) Constructs a new instance of the VectorLength class | - -## VectorLength.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `VectorLength` class - -Signature: - -```typescript -constructor(value: Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| value | [Constant](./firestore_lite.constant.md#constant_class) | | - diff --git a/docs-devsite/firestore_lite.where.md b/docs-devsite/firestore_lite.where.md deleted file mode 100644 index 1d3674f2659..00000000000 --- a/docs-devsite/firestore_lite.where.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Where class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Where implements Stage -``` -Implements: [Stage](./firestore_lite.stage.md#stage_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(condition)](./firestore_lite.where.md#whereconstructor) | | (BETA) Constructs a new instance of the Where class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [name](./firestore_lite.where.md#wherename) | | string | (BETA) | - -## Where.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Where` class - -Signature: - -```typescript -constructor(condition: FilterCondition & Constant); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| condition | [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) & [Constant](./firestore_lite.constant.md#constant_class) | | - -## Where.name - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -name: string; -``` diff --git a/docs-devsite/firestore_lite.xor.md b/docs-devsite/firestore_lite.xor.md deleted file mode 100644 index 2a94acbe570..00000000000 --- a/docs-devsite/firestore_lite.xor.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# Xor class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - - -Signature: - -```typescript -export declare class Xor extends FirestoreFunction implements FilterCondition -``` -Extends: [FirestoreFunction](./firestore_lite.firestorefunction.md#firestorefunction_class) - -Implements: [FilterCondition](./firestore_lite.filtercondition.md#filtercondition_interface) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(conditions)](./firestore_lite.xor.md#xorconstructor) | | (BETA) Constructs a new instance of the Xor class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [filterable](./firestore_lite.xor.md#xorfilterable) | | true | (BETA) | - -## Xor.(constructor) - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Constructs a new instance of the `Xor` class - -Signature: - -```typescript -constructor(conditions: FilterExpr[]); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| conditions | [FilterExpr](./firestore_lite.md#filterexpr)\[\] | | - -## Xor.filterable - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Signature: - -```typescript -filterable: true; -``` From 703b18f9138d6ab34c0b2402bc4f3962f014d84f Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:19:43 -0700 Subject: [PATCH 038/295] revert and/or overloads --- common/api-review/firestore-lite.api.md | 32 +--- common/api-review/firestore.api.md | 38 ++-- packages/firestore/lite/index.ts | 8 +- packages/firestore/src/api.ts | 12 +- .../src/api/database_augmentation.ts | 10 - packages/firestore/src/api/filter.ts | 2 + packages/firestore/src/core/pipeline-util.ts | 37 ++-- .../src/lite-api/database_augmentation.ts | 10 - .../firestore/src/lite-api/expressions.ts | 56 +++++- packages/firestore/src/lite-api/overloads.ts | 172 ------------------ packages/firestore/src/lite-api/query.ts | 48 +++++ .../test/integration/api/pipeline.test.ts | 24 +-- 12 files changed, 156 insertions(+), 293 deletions(-) delete mode 100644 packages/firestore/src/lite-api/overloads.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 165385bf890..ee77620fc7e 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -100,16 +100,9 @@ export class And extends FirestoreFunction implements FilterCondition { filterable: true; } -// @beta -export function and(left: FilterExpr, ...right: FilterExpr[]): And; - // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @public (undocumented) -export namespace and { -} - // @beta (undocumented) export class ArrayConcat extends FirestoreFunction { constructor(array: Constant, elements: Constant[]); @@ -221,12 +214,6 @@ export class Avg extends FirestoreFunction implements Accumulator { accumulator: true; } -// @beta -export function avgFunction(value: Constant): Avg; - -// @beta -export function avgFunction(value: string): Avg; - // @beta (undocumented) export class ByteLength extends FirestoreFunction { constructor(value: Constant); @@ -1530,16 +1517,9 @@ export class Or extends FirestoreFunction implements FilterCondition { filterable: true; } -// @beta -export function or(left: FilterExpr, ...right: FilterExpr[]): Or; - // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @public (undocumented) -export namespace or { -} - // @public export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; @@ -1960,12 +1940,6 @@ export class Sum extends FirestoreFunction implements Accumulator { // @public export function sum(field: string | FieldPath): AggregateField; -// @beta -export function sumFunction(value: Constant): Sum; - -// @beta -export function sumFunction(value: string): Sum; - // @public export function terminate(firestore: Firestore): Promise; @@ -2214,8 +2188,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9243:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9273:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9177:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9178:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9207:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index d8beb999ddd..025073704e4 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -100,15 +100,11 @@ export class And extends FirestoreFunction implements FilterCondition { filterable: true; } -// @beta -export function and(left: FilterExpr, ...right: FilterExpr[]): And; - // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @public (undocumented) -export namespace and { -} +// @beta +export function andFunction(left: FilterExpr, ...right: FilterExpr[]): And; // @beta (undocumented) export class ArrayConcat extends FirestoreFunction { @@ -222,10 +218,10 @@ export class Avg extends FirestoreFunction implements Accumulator { } // @beta -export function avg(value: Constant): Avg; +export function avgFunction(value: Constant): Avg; // @beta -export function avg(value: string): Avg; +export function avgFunction(value: string): Avg; // @beta (undocumented) export class ByteLength extends FirestoreFunction { @@ -461,12 +457,12 @@ export function count(): AggregateField; export function countAll(): Count; // @beta -export function countExpression(value: Constant): Count; +export function countFunction(value: Constant): Count; -// Warning: (ae-incompatible-release-tags) The symbol "countExpression" is marked as @public, but its signature references "Count" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "countFunction" is marked as @public, but its signature references "Count" which is marked as @beta // // @public -export function countExpression(value: string): Count; +export function countFunction(value: string): Count; // @beta (undocumented) export class DatabaseSource implements Stage { @@ -1745,16 +1741,9 @@ export class Or extends FirestoreFunction implements FilterCondition { filterable: true; } -// @beta -export function or(left: FilterExpr, ...right: FilterExpr[]): Or; - // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @public (undocumented) -export namespace or { -} - // @public export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint; @@ -1766,6 +1755,9 @@ export class Ordering { constructor(expr: Constant, direction: 'ascending' | 'descending'); } +// @beta +export function orFunction(left: FilterExpr, ...right: FilterExpr[]): Or; + // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; @@ -2226,10 +2218,10 @@ export class Sum extends FirestoreFunction implements Accumulator { export function sum(field: string | FieldPath): AggregateField; // @beta -export function sumExpression(value: Constant): Sum; +export function sumFunction(value: Constant): Sum; // @beta -export function sumExpression(value: string): Sum; +export function sumFunction(value: string): Sum; // @public export type TaskState = 'Error' | 'Running' | 'Success'; @@ -2490,8 +2482,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10106:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10133:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10129:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index 7bd1b2ce3db..636eb4c6709 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -189,9 +189,7 @@ export { SelectableExpr, Selectable, FilterCondition, - Accumulator, - sum as sumFunction, - avg as avgFunction + Accumulator } from '../src/lite-api/expressions'; export { @@ -240,9 +238,8 @@ export { queryEqual } from '../src/lite-api/reference'; -export { and, or } from '../src/lite-api/overloads'; - export { + and, endAt, endBefore, startAt, @@ -250,6 +247,7 @@ export { limit, limitToLast, where, + or, orderBy, query, QueryConstraint, diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 9b77311666b..4d33b925706 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -87,9 +87,11 @@ export { strConcat, mapGet, countAll, - count as countExpression, - sum as sumExpression, - avg, + countFunction, + sumFunction, + avgFunction, + andFunction, + orFunction, min, max, cosineDistance, @@ -183,8 +185,6 @@ export { Accumulator } from './lite-api/expressions'; -export { and, or } from './lite-api/overloads'; - export { aggregateFieldEqual, aggregateQuerySnapshotEqual, @@ -284,10 +284,12 @@ export { } from './api/reference'; export { + and, endAt, endBefore, limit, limitToLast, + or, orderBy, OrderByDirection, query, diff --git a/packages/firestore/src/api/database_augmentation.ts b/packages/firestore/src/api/database_augmentation.ts index b59f160c1ba..0eb8c91a034 100644 --- a/packages/firestore/src/api/database_augmentation.ts +++ b/packages/firestore/src/api/database_augmentation.ts @@ -15,8 +15,6 @@ * limitations under the License. */ -import { And, FilterExpr, Or } from '../lite-api/expressions'; -import { and, or } from '../lite-api/overloads'; import { Pipeline } from '../lite-api/pipeline'; import { PipelineSource } from '../lite-api/pipeline-source'; import { newUserDataReader } from '../lite-api/user_data_reader'; @@ -56,12 +54,4 @@ export function useFirestorePipelines(): void { return pipeline; }; - - and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { - return new And([left, ...right]); - }; - - or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { - return new Or([left, ...right]); - }; } diff --git a/packages/firestore/src/api/filter.ts b/packages/firestore/src/api/filter.ts index 99906e31db8..035aca66aba 100644 --- a/packages/firestore/src/api/filter.ts +++ b/packages/firestore/src/api/filter.ts @@ -16,12 +16,14 @@ */ export { + and, endAt, endBefore, startAfter, startAt, limitToLast, limit, + or, orderBy, OrderByDirection, where, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 5f0f418d2e4..732d2963fcf 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -20,9 +20,10 @@ import { Expr, Field, FilterCondition, - not + not, + andFunction, + orFunction } from '../lite-api/expressions'; -import { and, or } from '../lite-api/overloads'; import { isNanValue, isNullValue } from '../model/values'; import { ArrayValue as ProtoArrayValue, @@ -178,51 +179,51 @@ export function toPipelineFilterCondition( const field = Field.of(f.field.toString()); if (isNanValue(f.value)) { if (f.op === Operator.EQUAL) { - return and(field.exists(), field.isNaN()); + return andFunction(field.exists(), field.isNaN()); } else { - return and(field.exists(), not(field.isNaN())); + return andFunction(field.exists(), not(field.isNaN())); } } else if (isNullValue(f.value)) { if (f.op === Operator.EQUAL) { - return and(field.exists(), field.eq(null)); + return andFunction(field.exists(), field.eq(null)); } else { - return and(field.exists(), not(field.eq(null))); + return andFunction(field.exists(), not(field.eq(null))); } } else { // Comparison filters const value = f.value; switch (f.op) { case Operator.LESS_THAN: - return and(field.exists(), field.lt(value)); + return andFunction(field.exists(), field.lt(value)); case Operator.LESS_THAN_OR_EQUAL: - return and(field.exists(), field.lte(value)); + return andFunction(field.exists(), field.lte(value)); case Operator.GREATER_THAN: - return and(field.exists(), field.gt(value)); + return andFunction(field.exists(), field.gt(value)); case Operator.GREATER_THAN_OR_EQUAL: - return and(field.exists(), field.gte(value)); + return andFunction(field.exists(), field.gte(value)); case Operator.EQUAL: - return and(field.exists(), field.eq(value)); + return andFunction(field.exists(), field.eq(value)); case Operator.NOT_EQUAL: - return and(field.exists(), field.neq(value)); + return andFunction(field.exists(), field.neq(value)); case Operator.ARRAY_CONTAINS: - return and(field.exists(), field.arrayContains(value)); + return andFunction(field.exists(), field.arrayContains(value)); case Operator.IN: { const values = value?.arrayValue?.values?.map((val: any) => Constant.of(val) ); - return and(field.exists(), field.in(...values!)); + return andFunction(field.exists(), field.in(...values!)); } case Operator.ARRAY_CONTAINS_ANY: { const values = value?.arrayValue?.values?.map((val: any) => Constant.of(val) ); - return and(field.exists(), field.arrayContainsAny(values!)); + return andFunction(field.exists(), field.arrayContainsAny(values!)); } case Operator.NOT_IN: { const values = value?.arrayValue?.values?.map((val: any) => Constant.of(val) ); - return and(field.exists(), not(field.in(...values!))); + return andFunction(field.exists(), not(field.in(...values!))); } default: fail('Unexpected operator'); @@ -234,13 +235,13 @@ export function toPipelineFilterCondition( const conditions = f .getFilters() .map(f => toPipelineFilterCondition(f)); - return and(conditions[0], ...conditions.slice(1)); + return andFunction(conditions[0], ...conditions.slice(1)); } case CompositeOperator.OR: { const conditions = f .getFilters() .map(f => toPipelineFilterCondition(f)); - return or(conditions[0], ...conditions.slice(1)); + return orFunction(conditions[0], ...conditions.slice(1)); } default: fail('Unexpected operator'); diff --git a/packages/firestore/src/lite-api/database_augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts index a2c3652bd71..14b9cf101c5 100644 --- a/packages/firestore/src/lite-api/database_augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -18,8 +18,6 @@ import { DocumentKey } from '../model/document_key'; import { Firestore } from './database'; -import { And, FilterExpr, Or } from './expressions'; -import { or, and } from './overloads'; import { Pipeline } from './pipeline'; import { PipelineSource } from './pipeline-source'; import { DocumentReference, Query } from './reference'; @@ -57,12 +55,4 @@ export function useFirestorePipelines(): void { return pipeline; }; - - and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { - return new And([left, ...right]); - }; - - or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { - return new Or([left, ...right]); - }; } diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 336a7b7d2b1..26a2f7c617c 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -5686,7 +5686,7 @@ export function countAll(): Count { * @param value The expression to count. * @return A new {@code Accumulator} representing the 'count' aggregation. */ -export function count(value: Expr): Count; +export function countFunction(value: Expr): Count; /** * Creates an aggregation that counts the number of stage inputs with valid evaluations of the @@ -5700,8 +5700,8 @@ export function count(value: Expr): Count; * @param value The name of the field to count. * @return A new {@code Accumulator} representing the 'count' aggregation. */ -export function count(value: string): Count; -export function count(value: Expr | string): Count { +export function countFunction(value: string): Count; +export function countFunction(value: Expr | string): Count { const exprValue = value instanceof Expr ? value : Field.of(value); return new Count(exprValue, false); } @@ -5720,7 +5720,7 @@ export function count(value: Expr | string): Count { * @param value The expression to sum up. * @return A new {@code Accumulator} representing the 'sum' aggregation. */ -export function sum(value: Expr): Sum; +export function sumFunction(value: Expr): Sum; /** * @beta @@ -5736,8 +5736,8 @@ export function sum(value: Expr): Sum; * @param value The name of the field containing numeric values to sum up. * @return A new {@code Accumulator} representing the 'sum' aggregation. */ -export function sum(value: string): Sum; -export function sum(value: Expr | string): Sum { +export function sumFunction(value: string): Sum; +export function sumFunction(value: Expr | string): Sum { const exprValue = value instanceof Expr ? value : Field.of(value); return new Sum(exprValue, false); } @@ -5756,7 +5756,7 @@ export function sum(value: Expr | string): Sum { * @param value The expression representing the values to average. * @return A new {@code Accumulator} representing the 'avg' aggregation. */ -export function avg(value: Expr): Avg; +export function avgFunction(value: Expr): Avg; /** * @beta @@ -5772,8 +5772,8 @@ export function avg(value: Expr): Avg; * @param value The name of the field containing numeric values to average. * @return A new {@code Accumulator} representing the 'avg' aggregation. */ -export function avg(value: string): Avg; -export function avg(value: Expr | string): Avg { +export function avgFunction(value: string): Avg; +export function avgFunction(value: Expr | string): Avg { const exprValue = value instanceof Expr ? value : Field.of(value); return new Avg(exprValue, false); } @@ -6626,6 +6626,44 @@ export function genericFunction( return new FirestoreFunction(name, params); } +/** + * @beta + * + * Creates an expression that performs a logical 'AND' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND + * // the 'status' field is "active" + * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'AND' together. + * @return A new {@code Expr} representing the logical 'AND' operation. + */ +export function andFunction(left: FilterExpr, ...right: FilterExpr[]): And { + return new And([left, ...right]); +} + +/** + * @beta + * + * Creates an expression that performs a logical 'OR' operation on multiple filter conditions. + * + * ```typescript + * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR + * // the 'status' field is "active" + * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + * ``` + * + * @param left The first filter condition. + * @param right Additional filter conditions to 'OR' together. + * @return A new {@code Expr} representing the logical 'OR' operation. + */ +export function orFunction(left: FilterExpr, ...right: FilterExpr[]): Or { + return new Or([left, ...right]); +} + /** * @beta * diff --git a/packages/firestore/src/lite-api/overloads.ts b/packages/firestore/src/lite-api/overloads.ts deleted file mode 100644 index 6a4b87e96c5..00000000000 --- a/packages/firestore/src/lite-api/overloads.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @license - * Copyright 2024 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 { CompositeOperator } from '../core/filter'; - -import { And, FilterExpr, Or } from './expressions'; -import { - QueryCompositeFilterConstraint, - QueryConstraint, - QueryFilterConstraint, - validateQueryFilterConstraint -} from './query'; - -/** - * @beta - * - * Creates an expression that performs a logical 'OR' operation on multiple filter conditions. - * - * ```typescript - * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR - * // the 'status' field is "active" - * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); - * ``` - * - * @param left The first filter condition. - * @param right Additional filter conditions to 'OR' together. - * @return A new {@code Expr} representing the logical 'OR' operation. - */ -export function or(left: FilterExpr, ...right: FilterExpr[]): Or; - -/** - * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of - * the given filter constraints. A disjunction filter includes a document if it - * satisfies any of the given filters. - * - * @param queryConstraints - Optional. The list of - * {@link QueryFilterConstraint}s to perform a disjunction for. These must be - * created with calls to {@link where}, {@link or}, or {@link and}. - * @returns The newly created {@link QueryCompositeFilterConstraint}. - */ -export function or( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint; - -export function or( - leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, - ...right: FilterExpr[] | QueryFilterConstraint[] -): Or | QueryCompositeFilterConstraint { - if (leftFilterExprOrQueryConstraint === undefined) { - return or._orFilters(); - } else if ( - leftFilterExprOrQueryConstraint instanceof QueryConstraint || - leftFilterExprOrQueryConstraint instanceof QueryCompositeFilterConstraint || - leftFilterExprOrQueryConstraint === undefined - ) { - return or._orFilters( - leftFilterExprOrQueryConstraint, - ...(right as QueryFilterConstraint[]) - ); - } else { - // @ts-ignore - return or._orFunction(leftFilterExprOrQueryConstraint, ...right); - } -} - -or._orFilters = function ( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint { - // Only support QueryFilterConstraints - queryConstraints.forEach(queryConstraint => - validateQueryFilterConstraint('or', queryConstraint) - ); - - return QueryCompositeFilterConstraint._create( - CompositeOperator.OR, - queryConstraints as QueryFilterConstraint[] - ); -}; - -or._orFunction = function (left: FilterExpr, ...right: FilterExpr[]): Or { - throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' - ); -}; - -/** - * @beta - * - * Creates an expression that performs a logical 'AND' operation on multiple filter conditions. - * - * ```typescript - * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND - * // the 'status' field is "active" - * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); - * ``` - * - * @param left The first filter condition. - * @param right Additional filter conditions to 'AND' together. - * @return A new {@code Expr} representing the logical 'AND' operation. - */ -export function and(left: FilterExpr, ...right: FilterExpr[]): And; - -/** - * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of - * the given filter constraints. A conjunction filter includes a document if it - * satisfies all of the given filters. - * - * @param queryConstraints - Optional. The list of - * {@link QueryFilterConstraint}s to perform a conjunction for. These must be - * created with calls to {@link where}, {@link or}, or {@link and}. - * @returns The newly created {@link QueryCompositeFilterConstraint}. - */ -export function and( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint; - -export function and( - leftFilterExprOrQueryConstraint?: FilterExpr | QueryFilterConstraint, - ...right: FilterExpr[] | QueryFilterConstraint[] -): And | QueryCompositeFilterConstraint { - if (leftFilterExprOrQueryConstraint === undefined) { - return and._andFilters(); - } - if ( - leftFilterExprOrQueryConstraint instanceof QueryConstraint || - leftFilterExprOrQueryConstraint === undefined - ) { - return and._andFilters( - leftFilterExprOrQueryConstraint, - ...(right as QueryFilterConstraint[]) - ); - } else { - return and._andFunction( - leftFilterExprOrQueryConstraint as FilterExpr, - ...(right as FilterExpr[]) - ); - } -} - -and._andFilters = function ( - ...queryConstraints: QueryFilterConstraint[] -): QueryCompositeFilterConstraint { - // Only support QueryFilterConstraints - queryConstraints.forEach(queryConstraint => - validateQueryFilterConstraint('and', queryConstraint) - ); - - return QueryCompositeFilterConstraint._create( - CompositeOperator.AND, - queryConstraints as QueryFilterConstraint[] - ); -}; - -and._andFunction = function (left: FilterExpr, ...right: FilterExpr[]): And { - throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' - ); -}; diff --git a/packages/firestore/src/lite-api/query.ts b/packages/firestore/src/lite-api/query.ts index 16ed4f69a31..f0a357b828c 100644 --- a/packages/firestore/src/lite-api/query.ts +++ b/packages/firestore/src/lite-api/query.ts @@ -367,6 +367,54 @@ export type QueryFilterConstraint = | QueryFieldFilterConstraint | QueryCompositeFilterConstraint; +/** + * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of + * the given filter constraints. A disjunction filter includes a document if it + * satisfies any of the given filters. + * + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a disjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. + */ +export function or( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint { + // Only support QueryFilterConstraints + queryConstraints.forEach(queryConstraint => + validateQueryFilterConstraint('or', queryConstraint) + ); + + return QueryCompositeFilterConstraint._create( + CompositeOperator.OR, + queryConstraints as QueryFilterConstraint[] + ); +} + +/** + * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of + * the given filter constraints. A conjunction filter includes a document if it + * satisfies all of the given filters. + * + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a conjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. + */ +export function and( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint { + // Only support QueryFilterConstraints + queryConstraints.forEach(queryConstraint => + validateQueryFilterConstraint('and', queryConstraint) + ); + + return QueryCompositeFilterConstraint._create( + CompositeOperator.AND, + queryConstraints as QueryFilterConstraint[] + ); +} + /** * A `QueryOrderByConstraint` is used to sort the set of documents returned by a * Firestore query. `QueryOrderByConstraint`s are created by invoking diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 9bdb35251d0..3c4e5a1fa48 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -25,10 +25,10 @@ import { Deferred } from '../../util/promise'; import { _internalPipelineToExecutePipelineRequestProto, add, - and, + andFunction, arrayContains, arrayContainsAny, - avg, + avgFunction, CollectionReference, Constant, cosineDistance, @@ -48,7 +48,7 @@ import { mapGet, neq, not, - or, + orFunction, PipelineResult, regexContains, regexMatch, @@ -290,7 +290,7 @@ apiDescribe.skip('Pipelines', persistence => { .where(eq('genre', 'Science Fiction')) .aggregate( countAll().as('count'), - avg('rating').as('avgRating'), + avgFunction('rating').as('avgRating'), Field.of('rating').max().as('maxRating') ) .execute(); @@ -329,7 +329,7 @@ apiDescribe.skip('Pipelines', persistence => { .pipeline() .where(lt(Field.of('published'), 1984)) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [avgFunction('rating').as('avgRating')], groups: ['genre'] }) .where(gt('avgRating', 4.3)) @@ -390,7 +390,7 @@ apiDescribe.skip('Pipelines', persistence => { it('where with and', async () => { const results = await randomCol .pipeline() - .where(and(gt('rating', 4.5), eq('genre', 'Science Fiction'))) + .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) .execute(); expectResults(results, 'book10'); }); @@ -398,7 +398,7 @@ apiDescribe.skip('Pipelines', persistence => { it('where with or', async () => { const results = await randomCol .pipeline() - .where(or(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) + .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) .select('title') .execute(); expectResults( @@ -643,7 +643,7 @@ apiDescribe.skip('Pipelines', persistence => { const results = await randomCol .pipeline() .where( - and( + andFunction( gt('rating', 4.2), lte(Field.of('rating'), 4.5), neq('genre', 'Science Fiction') @@ -667,8 +667,8 @@ apiDescribe.skip('Pipelines', persistence => { const results = await randomCol .pipeline() .where( - or( - and(gt('rating', 4.5), eq('genre', 'Science Fiction')), + orFunction( + andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), lt('published', 1900) ) ) @@ -853,7 +853,7 @@ apiDescribe.skip('Pipelines', persistence => { .collection(randomCol.path) .where(lt(Field.of('published'), 1984)) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [avgFunction('rating').as('avgRating')], groups: ['genre'] }) .where(gt('avgRating', 4.3)) @@ -873,7 +873,7 @@ apiDescribe.skip('Pipelines', persistence => { const myPipeline = pipeline(randomCol) .where(lt(Field.of('published'), 1984)) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [avgFunction('rating').as('avgRating')], groups: ['genre'] }) .where(gt('avgRating', 4.3)) From 75e35c8d6d11698b4aaab2999ad93723489af243 Mon Sep 17 00:00:00 2001 From: MarkDuckworth Date: Wed, 13 Nov 2024 23:31:39 +0000 Subject: [PATCH 039/295] Update API reports --- common/api-review/firestore-lite.api.md | 6 +++--- common/api-review/firestore.api.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index ee77620fc7e..d3edaf71247 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -2188,8 +2188,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9177:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9178:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9207:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9177:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9178:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9207:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 025073704e4..212d93972b2 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -2482,8 +2482,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10129:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10129:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` From ffbf5a60ac756c69dd50bddb69fccd9968844ac5 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 14 Nov 2024 07:04:30 -0800 Subject: [PATCH 040/295] Version Packages (#8635) Co-authored-by: github-actions[bot] --- .changeset/nervous-timers-call.md | 5 -- .changeset/six-toys-chew.md | 5 -- .changeset/tall-peas-tell.md | 5 -- .changeset/tame-paws-nail.md | 53 ----------------- .changeset/tasty-boxes-brake.md | 5 -- integration/compat-interop/package.json | 28 ++++----- integration/firebase/package.json | 2 +- integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 12 ++++ packages/analytics-compat/package.json | 12 ++-- packages/analytics-interop-types/CHANGELOG.md | 6 ++ packages/analytics-interop-types/package.json | 2 +- packages/analytics-types/CHANGELOG.md | 6 ++ packages/analytics-types/package.json | 2 +- packages/analytics/CHANGELOG.md | 12 ++++ packages/analytics/package.json | 12 ++-- packages/app-check-compat/CHANGELOG.md | 13 +++++ packages/app-check-compat/package.json | 14 ++--- packages/app-check-interop-types/CHANGELOG.md | 6 ++ packages/app-check-interop-types/package.json | 2 +- packages/app-check-types/CHANGELOG.md | 6 ++ packages/app-check-types/package.json | 2 +- packages/app-check/CHANGELOG.md | 11 ++++ packages/app-check/package.json | 10 ++-- packages/app-compat/CHANGELOG.md | 12 ++++ packages/app-compat/package.json | 10 ++-- packages/app-types/CHANGELOG.md | 6 ++ packages/app-types/package.json | 2 +- packages/app/CHANGELOG.md | 11 ++++ packages/app/package.json | 8 +-- packages/auth-compat/CHANGELOG.md | 12 ++++ packages/auth-compat/package.json | 12 ++-- packages/auth-interop-types/CHANGELOG.md | 6 ++ packages/auth-interop-types/package.json | 2 +- packages/auth-types/CHANGELOG.md | 6 ++ packages/auth-types/package.json | 2 +- packages/auth/CHANGELOG.md | 11 ++++ packages/auth/package.json | 10 ++-- packages/component/CHANGELOG.md | 9 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 12 ++++ packages/data-connect/package.json | 12 ++-- packages/database-compat/CHANGELOG.md | 13 +++++ packages/database-compat/package.json | 14 ++--- packages/database-types/CHANGELOG.md | 10 ++++ packages/database-types/package.json | 6 +- packages/database/CHANGELOG.md | 13 +++++ packages/database/package.json | 14 ++--- packages/firebase/CHANGELOG.md | 36 ++++++++++++ packages/firebase/package.json | 58 +++++++++---------- packages/firestore-compat/CHANGELOG.md | 12 ++++ packages/firestore-compat/package.json | 12 ++-- packages/firestore-types/CHANGELOG.md | 6 ++ packages/firestore-types/package.json | 2 +- packages/firestore/CHANGELOG.md | 14 +++++ packages/firestore/package.json | 16 ++--- packages/functions-compat/CHANGELOG.md | 12 ++++ packages/functions-compat/package.json | 12 ++-- packages/functions-types/CHANGELOG.md | 6 ++ packages/functions-types/package.json | 2 +- packages/functions/CHANGELOG.md | 13 +++++ packages/functions/package.json | 14 ++--- packages/installations-compat/CHANGELOG.md | 12 ++++ packages/installations-compat/package.json | 12 ++-- packages/installations-types/CHANGELOG.md | 6 ++ packages/installations-types/package.json | 2 +- packages/installations/CHANGELOG.md | 10 ++++ packages/installations/package.json | 8 +-- packages/logger/CHANGELOG.md | 6 ++ packages/logger/package.json | 2 +- packages/messaging-compat/CHANGELOG.md | 11 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging-interop-types/CHANGELOG.md | 6 ++ packages/messaging-interop-types/package.json | 2 +- packages/messaging/CHANGELOG.md | 12 ++++ packages/messaging/package.json | 12 ++-- packages/performance-compat/CHANGELOG.md | 13 +++++ packages/performance-compat/package.json | 14 ++--- packages/performance-types/CHANGELOG.md | 6 ++ packages/performance-types/package.json | 2 +- packages/performance/CHANGELOG.md | 12 ++++ packages/performance/package.json | 12 ++-- packages/remote-config-compat/CHANGELOG.md | 13 +++++ packages/remote-config-compat/package.json | 14 ++--- packages/remote-config-types/CHANGELOG.md | 6 ++ packages/remote-config-types/package.json | 2 +- packages/remote-config/CHANGELOG.md | 12 ++++ packages/remote-config/package.json | 12 ++-- packages/rules-unit-testing/CHANGELOG.md | 6 ++ packages/rules-unit-testing/package.json | 2 +- packages/storage-compat/CHANGELOG.md | 12 ++++ packages/storage-compat/package.json | 14 ++--- packages/storage-types/CHANGELOG.md | 6 ++ packages/storage-types/package.json | 2 +- packages/storage/CHANGELOG.md | 10 ++++ packages/storage/package.json | 10 ++-- packages/template-types/CHANGELOG.md | 6 ++ packages/template-types/package.json | 2 +- packages/template/CHANGELOG.md | 9 +++ packages/template/package.json | 6 +- packages/util/CHANGELOG.md | 6 ++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 18 ++++++ packages/vertexai/package.json | 12 ++-- packages/webchannel-wrapper/CHANGELOG.md | 6 ++ packages/webchannel-wrapper/package.json | 2 +- repo-scripts/size-analysis/package.json | 6 +- 108 files changed, 729 insertions(+), 306 deletions(-) delete mode 100644 .changeset/nervous-timers-call.md delete mode 100644 .changeset/six-toys-chew.md delete mode 100644 .changeset/tall-peas-tell.md delete mode 100644 .changeset/tame-paws-nail.md delete mode 100644 .changeset/tasty-boxes-brake.md diff --git a/.changeset/nervous-timers-call.md b/.changeset/nervous-timers-call.md deleted file mode 100644 index 49c504144d1..00000000000 --- a/.changeset/nervous-timers-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Update to new base URL in documentation diff --git a/.changeset/six-toys-chew.md b/.changeset/six-toys-chew.md deleted file mode 100644 index b15e6046724..00000000000 --- a/.changeset/six-toys-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Remove indentation in VertexAI API Not Enabled error diff --git a/.changeset/tall-peas-tell.md b/.changeset/tall-peas-tell.md deleted file mode 100644 index 59af1cb8ab8..00000000000 --- a/.changeset/tall-peas-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Send App Check dummy token in header if there is an App Check getToken error. diff --git a/.changeset/tame-paws-nail.md b/.changeset/tame-paws-nail.md deleted file mode 100644 index 0a2ad08c756..00000000000 --- a/.changeset/tame-paws-nail.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -'@firebase/analytics': patch -'@firebase/analytics-compat': patch -'@firebase/analytics-interop-types': patch -'@firebase/analytics-types': patch -'@firebase/app': patch -'@firebase/app-check': patch -'@firebase/app-check-compat': patch -'@firebase/app-check-interop-types': patch -'@firebase/app-check-types': patch -'@firebase/app-compat': patch -'@firebase/app-types': patch -'@firebase/auth': patch -'@firebase/auth-compat': patch -'@firebase/auth-interop-types': patch -'@firebase/auth-types': patch -'@firebase/component': patch -'@firebase/data-connect': patch -'@firebase/database': patch -'@firebase/database-compat': patch -'@firebase/database-types': patch -'firebase': patch -'@firebase/firestore': patch -'@firebase/firestore-compat': patch -'@firebase/firestore-types': patch -'@firebase/functions': patch -'@firebase/functions-compat': patch -'@firebase/functions-types': patch -'@firebase/installations': patch -'@firebase/installations-compat': patch -'@firebase/installations-types': patch -'@firebase/logger': patch -'@firebase/messaging': patch -'@firebase/messaging-compat': patch -'@firebase/messaging-interop-types': patch -'@firebase/performance': patch -'@firebase/performance-compat': patch -'@firebase/performance-types': patch -'@firebase/remote-config': patch -'@firebase/remote-config-compat': patch -'@firebase/remote-config-types': patch -'@firebase/rules-unit-testing': patch -'@firebase/storage': patch -'@firebase/storage-compat': patch -'@firebase/storage-types': patch -'@firebase/template': patch -'@firebase/template-types': patch -'@firebase/util': patch -'@firebase/vertexai': patch -'@firebase/webchannel-wrapper': patch ---- - -Upgrade to TypeScript 5.5.4 diff --git a/.changeset/tasty-boxes-brake.md b/.changeset/tasty-boxes-brake.md deleted file mode 100644 index beb8b626f36..00000000000 --- a/.changeset/tasty-boxes-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/firestore": patch ---- - -Prevent a possible condition of slow snapshots, caused by a rapid series of document update(s) followed by a delete. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 37e697d37eb..2b69327d1a0 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.10.15", - "@firebase/app-compat": "0.2.45", - "@firebase/analytics": "0.10.9", - "@firebase/analytics-compat": "0.2.15", - "@firebase/auth": "1.8.0", - "@firebase/auth-compat": "0.5.15", - "@firebase/functions": "0.11.9", - "@firebase/functions-compat": "0.3.15", - "@firebase/messaging": "0.12.13", - "@firebase/messaging-compat": "0.2.13", - "@firebase/performance": "0.6.10", - "@firebase/performance-compat": "0.2.10", - "@firebase/remote-config": "0.4.10", - "@firebase/remote-config-compat": "0.2.10" + "@firebase/app": "0.10.16", + "@firebase/app-compat": "0.2.46", + "@firebase/analytics": "0.10.10", + "@firebase/analytics-compat": "0.2.16", + "@firebase/auth": "1.8.1", + "@firebase/auth-compat": "0.5.16", + "@firebase/functions": "0.11.10", + "@firebase/functions-compat": "0.3.16", + "@firebase/messaging": "0.12.14", + "@firebase/messaging-compat": "0.2.14", + "@firebase/performance": "0.6.11", + "@firebase/performance-compat": "0.2.11", + "@firebase/remote-config": "0.4.11", + "@firebase/remote-config-compat": "0.2.11" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firebase/package.json b/integration/firebase/package.json index c831bba2b77..1b09cec2066 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -7,7 +7,7 @@ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { - "firebase": "11.0.1", + "firebase": "11.0.2", "@types/chai": "4.3.14", "@types/mocha": "9.1.1", "chai": "4.4.1", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index e0a4304d8e9..36f85e49a44 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.10.15", - "@firebase/firestore": "4.7.4" + "@firebase/app": "0.10.16", + "@firebase/firestore": "4.7.5" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index a6bdde34991..a15a3af76e3 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.0.1", + "firebase": "11.0.2", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 56551612379..5db0624cecb 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/analytics-compat +## 0.2.16 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/analytics@0.10.10 + - @firebase/analytics-types@0.8.3 + - @firebase/component@0.6.11 + - @firebase/util@1.10.2 + ## 0.2.15 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index c6a57c931bb..62e6a44748a 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.15", + "version": "0.2.16", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/analytics": "0.10.9", - "@firebase/analytics-types": "0.8.2", - "@firebase/util": "1.10.1", + "@firebase/component": "0.6.11", + "@firebase/analytics": "0.10.10", + "@firebase/analytics-types": "0.8.3", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics-interop-types/CHANGELOG.md b/packages/analytics-interop-types/CHANGELOG.md index 1dcfd9fd97c..67178bd2cac 100644 --- a/packages/analytics-interop-types/CHANGELOG.md +++ b/packages/analytics-interop-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/analytics-interop-types +## 0.3.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.3.2 ### Patch Changes diff --git a/packages/analytics-interop-types/package.json b/packages/analytics-interop-types/package.json index f0a988897d9..d96eeff69d5 100644 --- a/packages/analytics-interop-types/package.json +++ b/packages/analytics-interop-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-interop-types", - "version": "0.3.2", + "version": "0.3.3", "description": "@firebase/analytics Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/analytics-types/CHANGELOG.md b/packages/analytics-types/CHANGELOG.md index 88a1002fc82..02d1ad9828e 100644 --- a/packages/analytics-types/CHANGELOG.md +++ b/packages/analytics-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/analytics-types +## 0.8.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.8.2 ### Patch Changes diff --git a/packages/analytics-types/package.json b/packages/analytics-types/package.json index 26ac177f142..2798c23b3fe 100644 --- a/packages/analytics-types/package.json +++ b/packages/analytics-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-types", - "version": "0.8.2", + "version": "0.8.3", "description": "@firebase/analytics Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 13ae87ef46e..73355bab4c1 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/analytics +## 0.10.10 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/installations@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.10.9 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 6b6040a89d1..4274daf2601 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.9", + "version": "0.10.10", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/installations": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index d35d9852fa2..2d2fe443bde 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/app-check-compat +## 0.3.17 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app-check@0.8.10 + - @firebase/app-check-types@0.5.3 + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.3.16 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 169772febca..6900ed957a7 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.16", + "version": "0.3.17", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.9", - "@firebase/app-check-types": "0.5.2", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/app-check": "0.8.10", + "@firebase/app-check-types": "0.5.3", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check-interop-types/CHANGELOG.md b/packages/app-check-interop-types/CHANGELOG.md index 1c88b8c0e48..6b10b284a42 100644 --- a/packages/app-check-interop-types/CHANGELOG.md +++ b/packages/app-check-interop-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app-check-interop-types +## 0.3.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.3.2 ### Patch Changes diff --git a/packages/app-check-interop-types/package.json b/packages/app-check-interop-types/package.json index 333ca0649af..c7e45614eea 100644 --- a/packages/app-check-interop-types/package.json +++ b/packages/app-check-interop-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-interop-types", - "version": "0.3.2", + "version": "0.3.3", "description": "@firebase/app-check-interop-types Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/app-check-types/CHANGELOG.md b/packages/app-check-types/CHANGELOG.md index b2697cc265c..1f14898bba0 100644 --- a/packages/app-check-types/CHANGELOG.md +++ b/packages/app-check-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app-check-types +## 0.5.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.5.2 ### Patch Changes diff --git a/packages/app-check-types/package.json b/packages/app-check-types/package.json index 16a3692e2de..92439788566 100644 --- a/packages/app-check-types/package.json +++ b/packages/app-check-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-types", - "version": "0.5.2", + "version": "0.5.3", "description": "@firebase/app-check Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 7cc3cf78a89..74caa4107ce 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/app-check +## 0.8.10 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.8.9 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index f537ac4c4d4..4ef65cabc48 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.8.9", + "version": "0.8.10", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", - "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", + "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index eeff3cd9b94..711b44e7ca6 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app-compat +## 0.2.46 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app@0.10.16 + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.2.45 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 3d159345f5e..13c63a539ca 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.45", + "version": "0.2.46", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.15", - "@firebase/util": "1.10.1", - "@firebase/logger": "0.4.3", - "@firebase/component": "0.6.10", + "@firebase/app": "0.10.16", + "@firebase/util": "1.10.2", + "@firebase/logger": "0.4.4", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app-types/CHANGELOG.md b/packages/app-types/CHANGELOG.md index e20838394f9..35adae68b2d 100644 --- a/packages/app-types/CHANGELOG.md +++ b/packages/app-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app-types +## 0.9.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.9.2 ### Patch Changes diff --git a/packages/app-types/package.json b/packages/app-types/package.json index 9edbf4b1290..4c49efb3512 100644 --- a/packages/app-types/package.json +++ b/packages/app-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-types", - "version": "0.9.2", + "version": "0.9.3", "description": "@firebase/app Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index f33a0d0cf97..7afb9b6fe81 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/app +## 0.10.16 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.10.15 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index cdbb10f51fa..5a751a846b2 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.10.15", + "version": "0.10.16", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.10.1", - "@firebase/logger": "0.4.3", - "@firebase/component": "0.6.10", + "@firebase/util": "1.10.2", + "@firebase/logger": "0.4.4", + "@firebase/component": "0.6.11", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index bee7aa1d73d..15061bd7afc 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/auth-compat +## 0.5.16 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/auth@1.8.1 + - @firebase/auth-types@0.12.3 + - @firebase/component@0.6.11 + - @firebase/util@1.10.2 + ## 0.5.15 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 55cf19d1492..c879b32c82c 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.15", + "version": "0.5.16", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.8.0", - "@firebase/auth-types": "0.12.2", - "@firebase/component": "0.6.10", - "@firebase/util": "1.10.1", + "@firebase/auth": "1.8.1", + "@firebase/auth-types": "0.12.3", + "@firebase/component": "0.6.11", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth-interop-types/CHANGELOG.md b/packages/auth-interop-types/CHANGELOG.md index b257bee54bb..93b59e90353 100644 --- a/packages/auth-interop-types/CHANGELOG.md +++ b/packages/auth-interop-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/auth-interop-types +## 0.2.4 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.2.3 ### Patch Changes diff --git a/packages/auth-interop-types/package.json b/packages/auth-interop-types/package.json index 9cfc47fad7a..ecea25d0c00 100644 --- a/packages/auth-interop-types/package.json +++ b/packages/auth-interop-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-interop-types", - "version": "0.2.3", + "version": "0.2.4", "description": "@firebase/auth interop Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/auth-types/CHANGELOG.md b/packages/auth-types/CHANGELOG.md index f0f3ffb592d..b36e792b01c 100644 --- a/packages/auth-types/CHANGELOG.md +++ b/packages/auth-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/auth-types +## 0.12.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.12.2 ### Patch Changes diff --git a/packages/auth-types/package.json b/packages/auth-types/package.json index f1e8cf3fae6..9b5191b3b44 100644 --- a/packages/auth-types/package.json +++ b/packages/auth-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-types", - "version": "0.12.2", + "version": "0.12.3", "description": "@firebase/auth Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 4c6ebfe474d..2bfbfebe27b 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/auth +## 1.8.1 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 1.8.0 ### Minor Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index f6645c35eac..3accfee8f70 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.8.0", + "version": "1.8.1", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", + "@firebase/component": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 8ab0bb795f6..4402cb3ab96 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/component +## 0.6.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/util@1.10.2 + ## 0.6.10 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index a01723c79bf..9653a3e8180 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.10", + "version": "0.6.11", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.10.1", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 80e5ffda8d4..1e58217ac54 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,17 @@ ## Unreleased +## 0.1.2 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/auth-interop-types@0.2.4 + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.1.1 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 4db4d4df609..e2bab36a6f9 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.1.1", + "version": "0.1.2", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -48,14 +48,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", + "@firebase/auth-interop-types": "0.2.4", + "@firebase/component": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 2cc8a90cdc8..3509fa8068e 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/database-compat +## 2.0.1 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/database@1.0.10 + - @firebase/database-types@1.0.7 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 2.0.0 ### Major Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index e601f88ed12..53b64fe0c9e 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.0", + "version": "2.0.1", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.9", - "@firebase/database-types": "1.0.6", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/database": "1.0.10", + "@firebase/database-types": "1.0.7", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 252d2456b00..51b56696ef8 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-types +## 1.0.7 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app-types@0.9.3 + - @firebase/util@1.10.2 + ## 1.0.6 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index c42763ad0d8..4e190921d84 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.6", + "version": "1.0.7", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -12,8 +12,8 @@ "index.d.ts" ], "dependencies": { - "@firebase/app-types": "0.9.2", - "@firebase/util": "1.10.1" + "@firebase/app-types": "0.9.3", + "@firebase/util": "1.10.2" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 9814093f64e..638e395a45c 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,18 @@ # Unreleased +## 1.0.10 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app-check-interop-types@0.3.3 + - @firebase/auth-interop-types@0.2.4 + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 1.0.9 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 214433b7f94..3cdc6b5b574 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.9", + "version": "1.0.10", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -48,16 +48,16 @@ "license": "Apache-2.0", "peerDependencies": {}, "dependencies": { - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/auth-interop-types": "0.2.3", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 42913f9a843..91177890023 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,41 @@ # firebase +## 11.0.2 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`052e438bc`](https://github.com/firebase/firebase-js-sdk/commit/052e438bc9abc5bfaf553a41edd2cde44dc70bc2), [`1f1ba3fee`](https://github.com/firebase/firebase-js-sdk/commit/1f1ba3feedf543a8ce42326dda077b0cdae21f2f), [`4db3d3e7b`](https://github.com/firebase/firebase-js-sdk/commit/4db3d3e7be8b435b523d23b0910958a495c09ad8), [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1), [`0f5714ba5`](https://github.com/firebase/firebase-js-sdk/commit/0f5714ba5baab119a73355c0fd86db5a44cd3d20)]: + - @firebase/vertexai@1.0.1 + - @firebase/analytics@0.10.10 + - @firebase/analytics-compat@0.2.16 + - @firebase/app@0.10.16 + - @firebase/app-check@0.8.10 + - @firebase/app-check-compat@0.3.17 + - @firebase/app-compat@0.2.46 + - @firebase/app-types@0.9.3 + - @firebase/auth@1.8.1 + - @firebase/auth-compat@0.5.16 + - @firebase/data-connect@0.1.2 + - @firebase/database@1.0.10 + - @firebase/database-compat@2.0.1 + - @firebase/firestore@4.7.5 + - @firebase/firestore-compat@0.3.40 + - @firebase/functions@0.11.10 + - @firebase/functions-compat@0.3.16 + - @firebase/installations@0.6.11 + - @firebase/installations-compat@0.2.11 + - @firebase/messaging@0.12.14 + - @firebase/messaging-compat@0.2.14 + - @firebase/performance@0.6.11 + - @firebase/performance-compat@0.2.11 + - @firebase/remote-config@0.4.11 + - @firebase/remote-config-compat@0.2.11 + - @firebase/storage@0.13.4 + - @firebase/storage-compat@0.3.14 + - @firebase/util@1.10.2 + ## 11.0.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index f716238f483..38154234474 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.0.1", + "version": "11.0.2", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.10.15", - "@firebase/app-compat": "0.2.45", - "@firebase/app-types": "0.9.2", - "@firebase/auth": "1.8.0", - "@firebase/auth-compat": "0.5.15", - "@firebase/data-connect": "0.1.1", - "@firebase/database": "1.0.9", - "@firebase/database-compat": "2.0.0", - "@firebase/firestore": "4.7.4", - "@firebase/firestore-compat": "0.3.39", - "@firebase/functions": "0.11.9", - "@firebase/functions-compat": "0.3.15", - "@firebase/installations": "0.6.10", - "@firebase/installations-compat": "0.2.10", - "@firebase/messaging": "0.12.13", - "@firebase/messaging-compat": "0.2.13", - "@firebase/storage": "0.13.3", - "@firebase/storage-compat": "0.3.13", - "@firebase/performance": "0.6.10", - "@firebase/performance-compat": "0.2.10", - "@firebase/remote-config": "0.4.10", - "@firebase/remote-config-compat": "0.2.10", - "@firebase/analytics": "0.10.9", - "@firebase/analytics-compat": "0.2.15", - "@firebase/app-check": "0.8.9", - "@firebase/app-check-compat": "0.3.16", - "@firebase/util": "1.10.1", - "@firebase/vertexai": "1.0.0" + "@firebase/app": "0.10.16", + "@firebase/app-compat": "0.2.46", + "@firebase/app-types": "0.9.3", + "@firebase/auth": "1.8.1", + "@firebase/auth-compat": "0.5.16", + "@firebase/data-connect": "0.1.2", + "@firebase/database": "1.0.10", + "@firebase/database-compat": "2.0.1", + "@firebase/firestore": "4.7.5", + "@firebase/firestore-compat": "0.3.40", + "@firebase/functions": "0.11.10", + "@firebase/functions-compat": "0.3.16", + "@firebase/installations": "0.6.11", + "@firebase/installations-compat": "0.2.11", + "@firebase/messaging": "0.12.14", + "@firebase/messaging-compat": "0.2.14", + "@firebase/storage": "0.13.4", + "@firebase/storage-compat": "0.3.14", + "@firebase/performance": "0.6.11", + "@firebase/performance-compat": "0.2.11", + "@firebase/remote-config": "0.4.11", + "@firebase/remote-config-compat": "0.2.11", + "@firebase/analytics": "0.10.10", + "@firebase/analytics-compat": "0.2.16", + "@firebase/app-check": "0.8.10", + "@firebase/app-check-compat": "0.3.17", + "@firebase/util": "1.10.2", + "@firebase/vertexai": "1.0.1" }, "devDependencies": { "rollup": "2.79.1", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index a9b76657367..6031b99639c 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/firestore-compat +## 0.3.40 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1), [`0f5714ba5`](https://github.com/firebase/firebase-js-sdk/commit/0f5714ba5baab119a73355c0fd86db5a44cd3d20)]: + - @firebase/component@0.6.11 + - @firebase/firestore@4.7.5 + - @firebase/firestore-types@3.0.3 + - @firebase/util@1.10.2 + ## 0.3.39 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 5015eea131d..500ee4ef5ca 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.39", + "version": "0.3.40", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/firestore": "4.7.4", - "@firebase/util": "1.10.1", - "@firebase/firestore-types": "3.0.2", + "@firebase/component": "0.6.11", + "@firebase/firestore": "4.7.5", + "@firebase/util": "1.10.2", + "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "@types/eslint": "7.29.0", "rollup": "2.79.1", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore-types/CHANGELOG.md b/packages/firestore-types/CHANGELOG.md index 3eaef3b0941..7550d8b7777 100644 --- a/packages/firestore-types/CHANGELOG.md +++ b/packages/firestore-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/firestore-types +## 3.0.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 3.0.2 ### Patch Changes diff --git a/packages/firestore-types/package.json b/packages/firestore-types/package.json index 9a21e29e803..d1cf512ec53 100644 --- a/packages/firestore-types/package.json +++ b/packages/firestore-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-types", - "version": "3.0.2", + "version": "3.0.3", "description": "@firebase/firestore Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 187c08756be..311c6cb4fa0 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,19 @@ # @firebase/firestore +## 4.7.5 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- [`0f5714ba5`](https://github.com/firebase/firebase-js-sdk/commit/0f5714ba5baab119a73355c0fd86db5a44cd3d20) [#8595](https://github.com/firebase/firebase-js-sdk/pull/8595) (fixes [#8474](https://github.com/firebase/firebase-js-sdk/issues/8474)) - Prevent a possible condition of slow snapshots, caused by a rapid series of document update(s) followed by a delete. + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + - @firebase/webchannel-wrapper@1.0.3 + ## 4.7.4 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 896aaa55d6e..cde6244a769 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.4", + "version": "4.7.5", "engines": { "node": ">=18.0.0" }, @@ -94,10 +94,10 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/webchannel-wrapper": "1.0.2", + "@firebase/component": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0" @@ -106,9 +106,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.15", - "@firebase/app-compat": "0.2.45", - "@firebase/auth": "1.8.0", + "@firebase/app": "0.10.16", + "@firebase/app-compat": "0.2.46", + "@firebase/auth": "1.8.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index d195624b9d2..a3039cf5f8f 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/functions-compat +## 0.3.16 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/functions@0.11.10 + - @firebase/functions-types@0.6.3 + - @firebase/util@1.10.2 + ## 0.3.15 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 0f11b5d1227..43f1c0dbbb2 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.15", + "version": "0.3.16", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/functions": "0.11.9", - "@firebase/functions-types": "0.6.2", - "@firebase/util": "1.10.1", + "@firebase/component": "0.6.11", + "@firebase/functions": "0.11.10", + "@firebase/functions-types": "0.6.3", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions-types/CHANGELOG.md b/packages/functions-types/CHANGELOG.md index 34e516b8650..dee6b848c09 100644 --- a/packages/functions-types/CHANGELOG.md +++ b/packages/functions-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/functions-types +## 0.6.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.6.2 ### Patch Changes diff --git a/packages/functions-types/package.json b/packages/functions-types/package.json index b237ffcf752..f06c4489e6a 100644 --- a/packages/functions-types/package.json +++ b/packages/functions-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-types", - "version": "0.6.2", + "version": "0.6.3", "description": "@firebase/functions Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index d4ca103c1e7..c96b0c93394 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/functions +## 0.11.10 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app-check-interop-types@0.3.3 + - @firebase/auth-interop-types@0.2.4 + - @firebase/component@0.6.11 + - @firebase/messaging-interop-types@0.2.3 + - @firebase/util@1.10.2 + ## 0.11.9 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 29792f16c70..62ab7ff0000 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.11.9", + "version": "0.11.10", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.10", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/auth-interop-types": "0.2.3", - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/util": "1.10.1", + "@firebase/component": "0.6.11", + "@firebase/messaging-interop-types": "0.2.3", + "@firebase/auth-interop-types": "0.2.4", + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 25570ed15de..199010a4349 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/installations-compat +## 0.2.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/installations@0.6.11 + - @firebase/installations-types@0.5.3 + - @firebase/util@1.10.2 + ## 0.2.10 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 81f292d3c78..33a409e0606 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.10", + "version": "0.2.11", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.10", - "@firebase/installations-types": "0.5.2", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/installations": "0.6.11", + "@firebase/installations-types": "0.5.3", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" } } diff --git a/packages/installations-types/CHANGELOG.md b/packages/installations-types/CHANGELOG.md index d2f8589057f..75111d6cc85 100644 --- a/packages/installations-types/CHANGELOG.md +++ b/packages/installations-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/installations-types +## 0.5.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.5.2 ### Patch Changes diff --git a/packages/installations-types/package.json b/packages/installations-types/package.json index 7647ad385c8..fafe3b63102 100644 --- a/packages/installations-types/package.json +++ b/packages/installations-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-types", - "version": "0.5.2", + "version": "0.5.3", "description": "@firebase/installations Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 097fc7f3783..1d469d05f8d 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/installations +## 0.6.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/util@1.10.2 + ## 0.6.10 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index 78b6dacc6da..d6240ba4666 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.10", + "version": "0.6.11", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index acd6583bed8..502b8d93945 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/logger +## 0.4.4 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.4.3 ### Patch Changes diff --git a/packages/logger/package.json b/packages/logger/package.json index ef7d8000c8b..cc3eecd584f 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/logger", - "version": "0.4.3", + "version": "0.4.4", "description": "A logger package for use in the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index fe28f38476c..bc1d3388138 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/messaging-compat +## 0.2.14 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/messaging@0.12.14 + - @firebase/util@1.10.2 + ## 0.2.13 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 22cc40dd608..fc398773866 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.13", + "version": "0.2.14", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.13", - "@firebase/component": "0.6.10", - "@firebase/util": "1.10.1", + "@firebase/messaging": "0.12.14", + "@firebase/component": "0.6.11", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", + "@firebase/app-compat": "0.2.46", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", "ts-essentials": "9.3.0", diff --git a/packages/messaging-interop-types/CHANGELOG.md b/packages/messaging-interop-types/CHANGELOG.md index f41c8747eda..d23789f8e0b 100644 --- a/packages/messaging-interop-types/CHANGELOG.md +++ b/packages/messaging-interop-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/messaging-interop-types +## 0.2.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.2.2 ### Patch Changes diff --git a/packages/messaging-interop-types/package.json b/packages/messaging-interop-types/package.json index 2defbc5076f..9df85275ae1 100644 --- a/packages/messaging-interop-types/package.json +++ b/packages/messaging-interop-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-interop-types", - "version": "0.2.2", + "version": "0.2.3", "description": "@firebase/messaging-interop-types Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index eb4c08bb226..53878d9abeb 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/messaging +## 0.12.14 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/installations@0.6.11 + - @firebase/messaging-interop-types@0.2.3 + - @firebase/util@1.10.2 + ## 0.12.13 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index c8f26f448e3..5ae4a192fe0 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.13", + "version": "0.12.14", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.10", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/installations": "0.6.11", + "@firebase/messaging-interop-types": "0.2.3", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-json": "4.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index e3dd6b08791..51d89527e47 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/performance-compat +## 0.2.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/performance@0.6.11 + - @firebase/performance-types@0.2.3 + - @firebase/util@1.10.2 + ## 0.2.10 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 1e5496b6d8b..ce9cab87c7c 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.10", + "version": "0.2.11", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.6.10", - "@firebase/performance-types": "0.2.2", - "@firebase/util": "1.10.1", - "@firebase/logger": "0.4.3", - "@firebase/component": "0.6.10", + "@firebase/performance": "0.6.11", + "@firebase/performance-types": "0.2.3", + "@firebase/util": "1.10.2", + "@firebase/logger": "0.4.4", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.45" + "@firebase/app-compat": "0.2.46" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance-types/CHANGELOG.md b/packages/performance-types/CHANGELOG.md index 221e21f119b..277ae9fd29f 100644 --- a/packages/performance-types/CHANGELOG.md +++ b/packages/performance-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/performance-types +## 0.2.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.2.2 ### Patch Changes diff --git a/packages/performance-types/package.json b/packages/performance-types/package.json index 8bc3fd83093..0d90a465501 100644 --- a/packages/performance-types/package.json +++ b/packages/performance-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-types", - "version": "0.2.2", + "version": "0.2.3", "description": "@firebase/performance Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index bb3e4985da2..d045a8d2cb3 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/performance +## 0.6.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/installations@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.6.10 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 36754a73bc4..0c48828325a 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.6.10", + "version": "0.6.11", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,15 +38,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/logger": "0.4.3", - "@firebase/installations": "0.6.10", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.4", + "@firebase/installations": "0.6.11", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 4187a8f4e4d..7109ff834e4 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/remote-config-compat +## 0.2.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/remote-config@0.4.11 + - @firebase/remote-config-types@0.3.3 + - @firebase/util@1.10.2 + ## 0.2.10 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index ad3bc326d58..dd23e6bf8a3 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.10", + "version": "0.2.11", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.4.10", - "@firebase/remote-config-types": "0.3.2", - "@firebase/util": "1.10.1", - "@firebase/logger": "0.4.3", - "@firebase/component": "0.6.10", + "@firebase/remote-config": "0.4.11", + "@firebase/remote-config-types": "0.3.3", + "@firebase/util": "1.10.2", + "@firebase/logger": "0.4.4", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.45" + "@firebase/app-compat": "0.2.46" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config-types/CHANGELOG.md b/packages/remote-config-types/CHANGELOG.md index 5e75d661db0..8847841c372 100644 --- a/packages/remote-config-types/CHANGELOG.md +++ b/packages/remote-config-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/remote-config-types +## 0.3.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.3.2 ### Patch Changes diff --git a/packages/remote-config-types/package.json b/packages/remote-config-types/package.json index 7d83613b25c..2f5d32ec5bf 100644 --- a/packages/remote-config-types/package.json +++ b/packages/remote-config-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-types", - "version": "0.3.2", + "version": "0.3.3", "description": "@firebase/remote-config Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 96f1d485160..207ed85ae8d 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/remote-config +## 0.4.11 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/installations@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 0.4.10 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 761fa6a1e97..3eba22c156f 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.4.10", + "version": "0.4.11", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/installations": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/rules-unit-testing/CHANGELOG.md b/packages/rules-unit-testing/CHANGELOG.md index b39c288e87b..dbdb276a1d8 100644 --- a/packages/rules-unit-testing/CHANGELOG.md +++ b/packages/rules-unit-testing/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/rules-unit-testing +## 4.0.1 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 4.0.0 ### Patch Changes diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index d430b154545..851e01e285a 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/rules-unit-testing", - "version": "4.0.0", + "version": "4.0.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index e48871ac4ab..66b1b606ef6 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/storage-compat +## 0.3.14 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/storage@0.13.4 + - @firebase/storage-types@0.8.3 + - @firebase/util@1.10.2 + ## 0.3.13 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 6bcbda61e75..4bb26cf22cc 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.13", + "version": "0.3.14", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.3", - "@firebase/storage-types": "0.8.2", - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/storage": "0.13.4", + "@firebase/storage-types": "0.8.3", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.45", - "@firebase/auth-compat": "0.5.15", + "@firebase/app-compat": "0.2.46", + "@firebase/auth-compat": "0.5.16", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/storage-types/CHANGELOG.md b/packages/storage-types/CHANGELOG.md index 53121ba9ebb..9f80d0a2dc7 100644 --- a/packages/storage-types/CHANGELOG.md +++ b/packages/storage-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/storage-types +## 0.8.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.8.2 ### Patch Changes diff --git a/packages/storage-types/package.json b/packages/storage-types/package.json index b27148fa740..5addb80bc3b 100644 --- a/packages/storage-types/package.json +++ b/packages/storage-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-types", - "version": "0.8.2", + "version": "0.8.3", "description": "@firebase/storage Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 5e1407e30aa..3e3e7608457 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,15 @@ #Unreleased +## 0.13.4 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/component@0.6.11 + - @firebase/util@1.10.2 + ## 0.13.3 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 52f18def817..42d5d3720ea 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.3", + "version": "0.13.4", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.10.1", - "@firebase/component": "0.6.10", + "@firebase/util": "1.10.2", + "@firebase/component": "0.6.11", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.15", - "@firebase/auth": "1.8.0", + "@firebase/app": "0.10.16", + "@firebase/auth": "1.8.1", "rollup": "2.79.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/template-types/CHANGELOG.md b/packages/template-types/CHANGELOG.md index 0a8e13f7c87..a5cf28faf25 100644 --- a/packages/template-types/CHANGELOG.md +++ b/packages/template-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/template-types +## 0.2.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 0.2.2 ### Patch Changes diff --git a/packages/template-types/package.json b/packages/template-types/package.json index d1925c4d409..2704ffab6bd 100644 --- a/packages/template-types/package.json +++ b/packages/template-types/package.json @@ -1,7 +1,7 @@ { "name": "@firebase/template-types", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "@firebase/template Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/template/CHANGELOG.md b/packages/template/CHANGELOG.md index a2a8636c7d4..564baf12f32 100644 --- a/packages/template/CHANGELOG.md +++ b/packages/template/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/template +## 0.2.6 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/template-types@0.2.3 + ## 0.2.5 ### Patch Changes diff --git a/packages/template/package.json b/packages/template/package.json index 2a2e0ccaac0..7d9aaa4df97 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/template", - "version": "0.2.5", + "version": "0.2.6", "private": true, "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", @@ -43,12 +43,12 @@ "@firebase/app-types": "0.x" }, "dependencies": { - "@firebase/template-types": "0.2.2", + "@firebase/template-types": "0.2.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index c6d6d7d9403..5c22a8c29d2 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.10.2 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 1.10.1 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index 128606efc68..e569790968f 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.10.1", + "version": "1.10.2", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 5453745c076..15bfaaaf621 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,23 @@ # @firebase/vertexai +## 1.0.1 + +### Patch Changes + +- [`052e438bc`](https://github.com/firebase/firebase-js-sdk/commit/052e438bc9abc5bfaf553a41edd2cde44dc70bc2) [#8589](https://github.com/firebase/firebase-js-sdk/pull/8589) - Update to new base URL in documentation + +- [`1f1ba3fee`](https://github.com/firebase/firebase-js-sdk/commit/1f1ba3feedf543a8ce42326dda077b0cdae21f2f) [#8587](https://github.com/firebase/firebase-js-sdk/pull/8587) - Remove indentation in VertexAI API Not Enabled error + +- [`4db3d3e7b`](https://github.com/firebase/firebase-js-sdk/commit/4db3d3e7be8b435b523d23b0910958a495c09ad8) [#8591](https://github.com/firebase/firebase-js-sdk/pull/8591) - Send App Check dummy token in header if there is an App Check getToken error. + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + +- Updated dependencies [[`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1)]: + - @firebase/app-check-interop-types@0.3.3 + - @firebase/component@0.6.11 + - @firebase/logger@0.4.4 + - @firebase/util@1.10.2 + ## 1.0.0 ### Major Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index ff7243f0148..a3595df3aef 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.0.0", + "version": "1.0.1", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -48,15 +48,15 @@ "@firebase/app-types": "0.x" }, "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/component": "0.6.10", - "@firebase/logger": "0.4.3", - "@firebase/util": "1.10.1", + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/component": "0.6.11", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.15", + "@firebase/app": "0.10.16", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/packages/webchannel-wrapper/CHANGELOG.md b/packages/webchannel-wrapper/CHANGELOG.md index 190c26c97d6..789b6d26f7e 100644 --- a/packages/webchannel-wrapper/CHANGELOG.md +++ b/packages/webchannel-wrapper/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/webchannel-wrapper +## 1.0.3 + +### Patch Changes + +- [`b80711925`](https://github.com/firebase/firebase-js-sdk/commit/b807119252dacf46b0122344c2b6dfc503cecde1) [#8604](https://github.com/firebase/firebase-js-sdk/pull/8604) - Upgrade to TypeScript 5.5.4 + ## 1.0.2 ### Patch Changes diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index 7fb4fa5501c..5ab2fa18e53 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/webchannel-wrapper", - "version": "1.0.2", + "version": "1.0.3", "description": "A wrapper of the webchannel packages from closure-library for use outside of a closure compiled application", "author": "Firebase (https://firebase.google.com/)", "main": "empty.js", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index ed133f94fff..c0fc5b8e817 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -35,14 +35,14 @@ "typescript": "5.5.4", "terser": "5.16.1", "yargs": "17.7.2", - "@firebase/util": "1.10.1", + "@firebase/util": "1.10.2", "gzip-size": "6.0.0", "glob": "7.2.3" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/logger": "0.4.3", - "@firebase/app": "0.10.15" + "@firebase/logger": "0.4.4", + "@firebase/app": "0.10.16" }, "repository": { "directory": "repo-scripts/size-analysis", From 4bb953a7f2823ff65cb686ea50a571541147d91d Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:20:42 -0700 Subject: [PATCH 041/295] Fix bundle definition --- repo-scripts/size-analysis/bundle-definitions/firestore.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index f7e13a8f401..6c1adcad52c 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -186,7 +186,7 @@ "lt", "Field", "useFirestorePipelines", - "andExpression" + "andFunction" ] } ] From 92c651fda2b355ac91a92eaabc6c5e614bf0391b Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:44:13 -0700 Subject: [PATCH 042/295] Fix imports --- packages/firestore/test/integration/api/pipeline.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 3c4e5a1fa48..a954d9b53e1 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -18,11 +18,11 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { pipeline } from '../../../src/api/pipeline'; -import { execute } from '../../../src/lite-api/pipeline_impl'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { + pipeline, + execute, _internalPipelineToExecutePipelineRequestProto, add, andFunction, From cc3146c8435f2d22b6728c5ec69446f66a2b6292 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:04:44 -0700 Subject: [PATCH 043/295] Re-adding circular dependency check. --- packages/firestore/rollup.shared.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index 9cc31e3dc72..1b33ddf0b1b 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -96,11 +96,9 @@ exports.resolveNodeExterns = function (id) { /** Breaks the build if there is a circular dependency. */ exports.onwarn = function (warning, defaultWarn) { - // TODO(pipeline) re-enable and fix circular dependencies after the pipeline exploration phase - // if (warning.code === 'CIRCULAR_DEPENDENCY') { - // console.log(JSON.stringify(warning)); - // throw new Error(warning); - // } + if (warning.code === 'CIRCULAR_DEPENDENCY') { + throw new Error(warning); + } defaultWarn(warning); }; From d2e8d60afbeb5586d399a6c9abbefa8806ac0089 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:27:03 -0700 Subject: [PATCH 044/295] Addressing review comments. --- packages/firestore/src/lite-api/database.ts | 4 +- .../src/lite-api/user_data_reader.ts | 62 ------------------- .../src/remote/internal_serializer.ts | 1 - 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index f67c5c32767..6ef01bb5172 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -41,6 +41,8 @@ import { cast } from '../util/input_validation'; import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; +// `import type` to avoid bundling the source for +// pipelines if `useFirestorePipelines()` is not called import type { PipelineSource } from './pipeline-source'; import { DEFAULT_HOST, @@ -48,8 +50,6 @@ import { PrivateSettings, FirestoreSettings } from './settings'; -// `import type` to avoid bundling the source for -// pipelines if `useFirestorePipelines()` is not called export { EmulatorMockTokenOptions } from '@firebase/util'; diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index 8412c388faf..42f905d5cab 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -437,68 +437,6 @@ export function parseSetData( ); } -export function parse( - userDataReader: UserDataReader, - methodName: string, - targetDoc: DocumentKey, - input: unknown, - hasConverter: boolean, - options: SetOptions = {} -): ParsedSetData { - const context = userDataReader.createContext( - options.merge || options.mergeFields - ? UserDataSource.MergeSet - : UserDataSource.Set, - methodName, - targetDoc, - hasConverter - ); - validatePlainObject('Data must be an object, but it was:', context, input); - const updateData = parseObject(input, context)!; - - let fieldMask: FieldMask | null; - let fieldTransforms: FieldTransform[]; - - if (options.merge) { - fieldMask = new FieldMask(context.fieldMask); - fieldTransforms = context.fieldTransforms; - } else if (options.mergeFields) { - const validatedFieldPaths: InternalFieldPath[] = []; - - for (const stringOrFieldPath of options.mergeFields) { - const fieldPath = fieldPathFromArgument( - methodName, - stringOrFieldPath, - targetDoc - ); - if (!context.contains(fieldPath)) { - throw new FirestoreError( - Code.INVALID_ARGUMENT, - `Field '${fieldPath}' is specified in your field mask but missing from your input data.` - ); - } - - if (!fieldMaskContains(validatedFieldPaths, fieldPath)) { - validatedFieldPaths.push(fieldPath); - } - } - - fieldMask = new FieldMask(validatedFieldPaths); - fieldTransforms = context.fieldTransforms.filter(transform => - fieldMask!.covers(transform.field) - ); - } else { - fieldMask = null; - fieldTransforms = context.fieldTransforms; - } - - return new ParsedSetData( - new ObjectValue(updateData), - fieldMask, - fieldTransforms - ); -} - export class DeleteFieldValueImpl extends FieldValue { _toFieldTransform(context: ParseContextImpl): null { if (context.dataSource === UserDataSource.MergeSet) { diff --git a/packages/firestore/src/remote/internal_serializer.ts b/packages/firestore/src/remote/internal_serializer.ts index dafdea85efc..29a68620efc 100644 --- a/packages/firestore/src/remote/internal_serializer.ts +++ b/packages/firestore/src/remote/internal_serializer.ts @@ -102,7 +102,6 @@ export function _internalAggregationQueryToProtoRunAggregationQueryRequest< * * @param pipeline - The Pipeline to convert to proto representation. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export function _internalPipelineToExecutePipelineRequestProto( pipeline: Pipeline // eslint-disable-next-line @typescript-eslint/no-explicit-any From ecd931d70ca593574f2df8e802d6465d8dbb3e06 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:22:09 -0700 Subject: [PATCH 045/295] New bundle analysis to evaluate useFirestorePipelines vs execute --- packages/firestore/src/api.ts | 31 +- .../src/api/database_augmentation.ts | 57 - packages/firestore/src/api/pipeline-source.ts | 100 ++ packages/firestore/src/api/pipeline.ts | 66 +- packages/firestore/src/api/pipeline_impl.ts | 112 ++ packages/firestore/src/api_pipelines.ts | 184 +++ .../src/lite-api/database_augmentation.ts | 42 - .../firestore/src/lite-api/expressions.ts | 238 ++-- .../firestore/src/lite-api/pipeline-source.ts | 8 +- packages/firestore/src/lite-api/pipeline.ts | 137 +- .../firestore/src/lite-api/pipeline_impl.ts | 90 +- .../test/integration/api/pipeline.test.ts | 1195 +++++++++-------- .../bundle-definitions/firestore.json | 34 +- 13 files changed, 1410 insertions(+), 884 deletions(-) create mode 100644 packages/firestore/src/api/pipeline-source.ts create mode 100644 packages/firestore/src/api/pipeline_impl.ts create mode 100644 packages/firestore/src/api_pipelines.ts diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 4d33b925706..4a35ed07760 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -19,9 +19,9 @@ export { PipelineSource } from './lite-api/pipeline-source'; export { PipelineResult } from './lite-api/pipeline-result'; -export { Pipeline, pipeline } from './api/pipeline'; +export { Pipeline } from './api/pipeline'; -export { useFirestorePipelines } from './api/database_augmentation'; +export { useFirestorePipelines, pipeline } from './api/pipeline_impl'; export { execute } from './lite-api/pipeline_impl'; @@ -61,13 +61,13 @@ export { arrayContainsAny, arrayContainsAll, arrayLength, - inAny, - notInAny, + eqAny, + notEqAny, xor, - ifFunction, + cond, not, - logicalMax, - logicalMin, + logicalMaximum, + logicalMinimum, exists, isNan, reverse, @@ -92,8 +92,8 @@ export { avgFunction, andFunction, orFunction, - min, - max, + minimum, + maximum, cosineDistance, dotProduct, euclideanDistance, @@ -132,16 +132,17 @@ export { ArrayContainsAny, ArrayLength, ArrayElement, - In, + EqAny, + NotEqAny, IsNan, Exists, Not, And, Or, Xor, - If, - LogicalMax, - LogicalMin, + Cond, + LogicalMaximum, + LogicalMinimum, Reverse, ReplaceFirst, ReplaceAll, @@ -161,8 +162,8 @@ export { Count, Sum, Avg, - Min, - Max, + Minimum, + Maximum, CosineDistance, DotProduct, EuclideanDistance, diff --git a/packages/firestore/src/api/database_augmentation.ts b/packages/firestore/src/api/database_augmentation.ts index 0eb8c91a034..e69de29bb2d 100644 --- a/packages/firestore/src/api/database_augmentation.ts +++ b/packages/firestore/src/api/database_augmentation.ts @@ -1,57 +0,0 @@ -/** - * @license - * Copyright 2024 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 { Pipeline } from '../lite-api/pipeline'; -import { PipelineSource } from '../lite-api/pipeline-source'; -import { newUserDataReader } from '../lite-api/user_data_reader'; -import { DocumentKey } from '../model/document_key'; - -import { Firestore } from './database'; -import { DocumentReference, Query } from './reference'; -import { ExpUserDataWriter } from './user_data_writer'; - -export function useFirestorePipelines(): void { - Firestore.prototype.pipeline = function (): PipelineSource { - const firestore = this; - return new PipelineSource( - this, - newUserDataReader(firestore), - new ExpUserDataWriter(firestore), - (key: DocumentKey) => { - return new DocumentReference(firestore, null, key); - } - ); - }; - - Query.prototype.pipeline = function (): Pipeline { - let pipeline; - if (this._query.collectionGroup) { - pipeline = this.firestore - .pipeline() - .collectionGroup(this._query.collectionGroup); - } else { - pipeline = this.firestore - .pipeline() - .collection(this._query.path.canonicalString()); - } - - // TODO(pipeline) convert existing query filters, limits, etc into - // pipeline stages - - return pipeline; - }; -} diff --git a/packages/firestore/src/api/pipeline-source.ts b/packages/firestore/src/api/pipeline-source.ts new file mode 100644 index 00000000000..31a2d9d69a5 --- /dev/null +++ b/packages/firestore/src/api/pipeline-source.ts @@ -0,0 +1,100 @@ +/** + * @license + * Copyright 2024 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 { PipelineSource as LitePipelineSoure } from '../lite-api/pipeline-source'; +import { + CollectionGroupSource, + CollectionSource, + DatabaseSource, + DocumentsSource +} from '../lite-api/stage'; +import { UserDataReader } from '../lite-api/user_data_reader'; +import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { DocumentKey } from '../model/document_key'; +import { cast } from '../util/input_validation'; + +import { Firestore } from './database'; +import { Pipeline } from './pipeline'; +import { DocumentReference } from './reference'; + +/** + * Represents the source of a Firestore {@link Pipeline}. + * @beta + */ +export class PipelineSource extends LitePipelineSoure { + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + */ + // eslint-disable-next-line @typescript-eslint/no-useless-constructor + constructor( + db: Firestore, + userDataReader: UserDataReader, + userDataWriter: AbstractUserDataWriter, + documentReferenceFactory: (id: DocumentKey) => DocumentReference + ) { + super(db, userDataReader, userDataWriter, documentReferenceFactory); + } + + collection(collectionPath: string): Pipeline { + const db = cast(this.db, Firestore); + return new Pipeline( + db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new CollectionSource(collectionPath)] + ); + } + + collectionGroup(collectionId: string): Pipeline { + const db = cast(this.db, Firestore); + return new Pipeline( + db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new CollectionGroupSource(collectionId)] + ); + } + + database(): Pipeline { + const db = cast(this.db, Firestore); + return new Pipeline( + db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [new DatabaseSource()] + ); + } + + documents(docs: DocumentReference[]): Pipeline { + const db = cast(this.db, Firestore); + return new Pipeline( + db, + this.userDataReader, + this.userDataWriter, + this.documentReferenceFactory, + [DocumentsSource.of(docs)] + ); + } +} diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index 14532ba85c0..029e2d53eeb 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -15,18 +15,15 @@ * limitations under the License. */ -import { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult } from '../lite-api/pipeline-result'; -import { PipelineSource } from '../lite-api/pipeline-source'; -import { DocumentData, DocumentReference, Query } from '../lite-api/reference'; +import { DocumentData, DocumentReference } from '../lite-api/reference'; import { Stage } from '../lite-api/stage'; import { UserDataReader } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { DocumentKey } from '../model/document_key'; -import { cast } from '../util/input_validation'; -import { ensureFirestoreConfigured, Firestore } from './database'; +import { Firestore } from './database'; export class Pipeline< AppModelType = DocumentData @@ -61,6 +58,24 @@ export class Pipeline< ); } + protected newPipeline( + db: Firestore, + userDataReader: UserDataReader, + userDataWriter: AbstractUserDataWriter, + documentReferenceFactory: (id: DocumentKey) => DocumentReference, + stages: Stage[], + converter: unknown = {} + ): Pipeline { + return new Pipeline( + db, + userDataReader, + userDataWriter, + documentReferenceFactory, + stages, + converter + ); + } + /** * Executes this pipeline and returns a Promise to represent the asynchronous operation. * @@ -93,43 +108,8 @@ export class Pipeline< * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - const firestore = cast(this._db, Firestore); - const client = ensureFirestoreConfigured(firestore); - return firestoreClientExecutePipeline(client, this).then(result => { - const docs = result.map( - element => - new PipelineResult( - this.userDataWriter, - element.key?.path - ? this.documentReferenceFactory(element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - //this.converter - ) - ); - - return docs; - }); + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); } } - -/** - * Experimental Modular API for console testing. - * @param firestore - */ -export function pipeline(firestore: Firestore): PipelineSource; - -/** - * Experimental Modular API for console testing. - * @param query - */ -export function pipeline(query: Query): Pipeline; - -export function pipeline( - firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { - return firestoreOrQuery.pipeline(); -} diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts new file mode 100644 index 00000000000..91163eff3c2 --- /dev/null +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -0,0 +1,112 @@ +/** + * @license + * Copyright 2024 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 { Pipeline } from '../api/pipeline'; +import { PipelineSource } from '../api/pipeline-source'; +import { PipelineResult } from '../api_pipelines'; +import { firestoreClientExecutePipeline } from '../core/firestore_client'; +import { newUserDataReader } from '../lite-api/user_data_reader'; +import { DocumentKey } from '../model/document_key'; +import { cast } from '../util/input_validation'; + +import { Firestore, ensureFirestoreConfigured } from './database'; +import { DocumentReference, Query } from './reference'; +import { ExpUserDataWriter } from './user_data_writer'; + +/** + * Experimental Modular API for console testing. + * @param firestore + */ +export function pipeline(firestore: Firestore): PipelineSource; + +/** + * Experimental Modular API for console testing. + * @param query + */ +export function pipeline(query: Query): Pipeline; + +export function pipeline( + firestoreOrQuery: Firestore | Query +): PipelineSource | Pipeline { + if (firestoreOrQuery instanceof Firestore) { + const firestore = firestoreOrQuery; + return new PipelineSource( + firestore, + newUserDataReader(firestore), + new ExpUserDataWriter(firestore), + (key: DocumentKey) => { + return new DocumentReference(firestore, null, key); + } + ); + } else { + let result; + const query = firestoreOrQuery; + const db = cast(query.firestore, Firestore); + if (query._query.collectionGroup) { + result = pipeline(db).collectionGroup(query._query.collectionGroup); + } else { + result = pipeline(db).collection(query._query.path.canonicalString()); + } + + // TODO(pipeline) convert existing query filters, limits, etc into + // pipeline stages + + return result; + } +} +export function useFirestorePipelines(): void { + Firestore.prototype.pipeline = function (): PipelineSource { + return pipeline(this); + }; + + Query.prototype.pipeline = function (): Pipeline { + return pipeline(this); + }; + + Pipeline.prototype.execute = function (): Promise { + return execute(this); + }; +} + +export function execute( + pipeline: Pipeline +): Promise>> { + const firestore = cast(pipeline._db, Firestore); + const client = ensureFirestoreConfigured(firestore); + return firestoreClientExecutePipeline(client, pipeline).then(result => { + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + pipeline._userDataWriter, + element.key?.path + ? pipeline._documentReferenceFactory(element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + //this.converter + ) + ); + + return docs; + }); +} diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts new file mode 100644 index 00000000000..658794098ea --- /dev/null +++ b/packages/firestore/src/api_pipelines.ts @@ -0,0 +1,184 @@ +/** + * @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. + */ +export { PipelineSource } from './lite-api/pipeline-source'; + +export { PipelineResult } from './lite-api/pipeline-result'; + +export { Pipeline } from './lite-api/pipeline'; + +export { useFirestorePipelines } from './api/database_augmentation'; + +export { + Stage, + FindNearestOptions, + AddFields, + Aggregate, + Distinct, + CollectionSource, + CollectionGroupSource, + DatabaseSource, + DocumentsSource, + Where, + FindNearest, + Limit, + Offset, + Select, + Sort, + GenericStage +} from './lite-api/stage'; + +export { + add, + subtract, + multiply, + divide, + mod, + eq, + neq, + lt, + lte, + gt, + gte, + arrayConcat, + arrayContains, + arrayContainsAny, + arrayContainsAll, + arrayLength, + eqAny, + notEqAny, + xor, + cond, + not, + logicalMaximum, + logicalMinimum, + exists, + isNan, + reverse, + replaceFirst, + replaceAll, + byteLength, + charLength, + like, + regexContains, + regexMatch, + strContains, + startsWith, + endsWith, + toLower, + toUpper, + trim, + strConcat, + mapGet, + countAll, + countFunction, + sumFunction, + avgFunction, + andFunction, + orFunction, + minimum, + maximum, + cosineDistance, + dotProduct, + euclideanDistance, + vectorLength, + unixMicrosToTimestamp, + timestampToUnixMicros, + unixMillisToTimestamp, + timestampToUnixMillis, + unixSecondsToTimestamp, + timestampToUnixSeconds, + timestampAdd, + timestampSub, + genericFunction, + ascending, + descending, + ExprWithAlias, + Field, + Fields, + Constant, + FirestoreFunction, + Add, + Subtract, + Multiply, + Divide, + Mod, + Eq, + Neq, + Lt, + Lte, + Gt, + Gte, + ArrayConcat, + ArrayReverse, + ArrayContains, + ArrayContainsAll, + ArrayContainsAny, + ArrayLength, + ArrayElement, + EqAny, + NotEqAny, + IsNan, + Exists, + Not, + And, + Or, + Xor, + Cond, + LogicalMaximum, + LogicalMinimum, + Reverse, + ReplaceFirst, + ReplaceAll, + CharLength, + ByteLength, + Like, + RegexContains, + RegexMatch, + StrContains, + StartsWith, + EndsWith, + ToLower, + ToUpper, + Trim, + StrConcat, + MapGet, + Count, + Sum, + Avg, + Minimum, + Maximum, + CosineDistance, + DotProduct, + EuclideanDistance, + VectorLength, + UnixMicrosToTimestamp, + TimestampToUnixMicros, + UnixMillisToTimestamp, + TimestampToUnixMillis, + UnixSecondsToTimestamp, + TimestampToUnixSeconds, + TimestampAdd, + TimestampSub, + Ordering, + ExprType, + AccumulatorTarget, + FilterExpr, + SelectableExpr, + Selectable, + FilterCondition, + Accumulator +} from './lite-api/expressions'; diff --git a/packages/firestore/src/lite-api/database_augmentation.ts b/packages/firestore/src/lite-api/database_augmentation.ts index 14b9cf101c5..bf25e9c59c8 100644 --- a/packages/firestore/src/lite-api/database_augmentation.ts +++ b/packages/firestore/src/lite-api/database_augmentation.ts @@ -14,45 +14,3 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { DocumentKey } from '../model/document_key'; - -import { Firestore } from './database'; -import { Pipeline } from './pipeline'; -import { PipelineSource } from './pipeline-source'; -import { DocumentReference, Query } from './reference'; -import { LiteUserDataWriter } from './reference_impl'; -import { newUserDataReader } from './user_data_reader'; - -export function useFirestorePipelines(): void { - Firestore.prototype.pipeline = function (): PipelineSource { - const userDataWriter = new LiteUserDataWriter(this); - const userDataReader = newUserDataReader(this); - return new PipelineSource( - this, - userDataReader, - userDataWriter, - (key: DocumentKey) => { - return new DocumentReference(this, null, key); - } - ); - }; - - Query.prototype.pipeline = function (): Pipeline { - let pipeline; - if (this._query.collectionGroup) { - pipeline = this.firestore - .pipeline() - .collectionGroup(this._query.collectionGroup); - } else { - pipeline = this.firestore - .pipeline() - .collection(this._query.path.canonicalString()); - } - - // TODO(pipeline) convert existing query filters, limits, etc into - // pipeline stages - - return pipeline; - }; -} diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 26a2f7c617c..3ec68601e9e 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -804,13 +804,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * Field.of("category").in("Electronics", Field.of("primaryType")); + * Field.of("category").eqAny("Electronics", Field.of("primaryType")); * ``` * * @param others The values or expressions to check against. * @return A new `Expr` representing the 'IN' comparison. */ - in(...others: Expr[]): In; + eqAny(...others: Expr[]): EqAny; /** * Creates an expression that checks if this expression is equal to any of the provided values or @@ -818,18 +818,52 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * Field.of("category").in("Electronics", Field.of("primaryType")); + * Field.of("category").eqAny("Electronics", Field.of("primaryType")); * ``` * * @param others The values or expressions to check against. * @return A new `Expr` representing the 'IN' comparison. */ - in(...others: any[]): In; - in(...others: any[]): In { + eqAny(...others: any[]): EqAny; + eqAny(...others: any[]): EqAny { const exprOthers = others.map(other => other instanceof Expr ? other : Constant.of(other) ); - return new In(this, exprOthers); + return new EqAny(this, exprOthers); + } + + /** + * Creates an expression that checks if this expression is not equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * Field.of("status").notEqAny("pending", Field.of("rejectedStatus")); + * ``` + * + * @param others The values or expressions to check against. + * @return A new `Expr` representing the 'NotEqAny' comparison. + */ + notEqAny(...others: Expr[]): NotEqAny; + + /** + * Creates an expression that checks if this expression is not equal to any of the provided values or + * expressions. + * + * ```typescript + * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' + * Field.of("status").notEqAny("pending", Field.of("rejectedStatus")); + * ``` + * + * @param others The values or expressions to check against. + * @return A new `Expr` representing the 'NotEqAny' comparison. + */ + notEqAny(...others: any[]): NotEqAny; + notEqAny(...others: any[]): NotEqAny { + const exprOthers = others.map(other => + other instanceof Expr ? other : Constant.of(other) + ); + return new NotEqAny(this, exprOthers); } /** @@ -1300,13 +1334,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Find the lowest price of all products - * Field.of("price").min().as("lowestPrice"); + * Field.of("price").minimum().as("lowestPrice"); * ``` * * @return A new `Accumulator` representing the 'min' aggregation. */ - min(): Min { - return new Min(this, false); + minimum(): Minimum { + return new Minimum(this, false); } /** @@ -1314,13 +1348,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Find the highest score in a leaderboard - * Field.of("score").max().as("highestScore"); + * Field.of("score").maximum().as("highestScore"); * ``` * * @return A new `Accumulator` representing the 'max' aggregation. */ - max(): Max { - return new Max(this, false); + maximum(): Maximum { + return new Maximum(this, false); } /** @@ -1328,31 +1362,31 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Returns the larger value between the 'timestamp' field and the current timestamp. - * Field.of("timestamp").logicalMax(Function.currentTimestamp()); + * Field.of("timestamp").logicalMaximum(Function.currentTimestamp()); * ``` * * @param other The expression to compare with. * @return A new {@code Expr} representing the logical max operation. */ - logicalMax(other: Expr): LogicalMax; + logicalMaximum(other: Expr): LogicalMaximum; /** * Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. * * ```typescript * // Returns the larger value between the 'value' field and 10. - * Field.of("value").logicalMax(10); + * Field.of("value").logicalMaximum(10); * ``` * * @param other The constant value to compare with. * @return A new {@code Expr} representing the logical max operation. */ - logicalMax(other: any): LogicalMax; - logicalMax(other: any): LogicalMax { + logicalMaximum(other: any): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum { if (other instanceof Expr) { - return new LogicalMax(this, other as Expr); + return new LogicalMaximum(this, other as Expr); } - return new LogicalMax(this, Constant.of(other)); + return new LogicalMaximum(this, Constant.of(other)); } /** @@ -1360,31 +1394,31 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Returns the smaller value between the 'timestamp' field and the current timestamp. - * Field.of("timestamp").logicalMin(Function.currentTimestamp()); + * Field.of("timestamp").logicalMinimum(Function.currentTimestamp()); * ``` * * @param other The expression to compare with. * @return A new {@code Expr} representing the logical min operation. */ - logicalMin(other: Expr): LogicalMin; + logicalMinimum(other: Expr): LogicalMinimum; /** * Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. * * ```typescript * // Returns the smaller value between the 'value' field and 10. - * Field.of("value").logicalMin(10); + * Field.of("value").logicalMinimum(10); * ``` * * @param other The constant value to compare with. * @return A new {@code Expr} representing the logical min operation. */ - logicalMin(other: any): LogicalMin; - logicalMin(other: any): LogicalMin { + logicalMinimum(other: any): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum { if (other instanceof Expr) { - return new LogicalMin(this, other as Expr); + return new LogicalMinimum(this, other as Expr); } - return new LogicalMin(this, Constant.of(other)); + return new LogicalMinimum(this, Constant.of(other)); } /** @@ -2472,9 +2506,19 @@ export class ArrayElement extends FirestoreFunction { /** * @beta */ -export class In extends FirestoreFunction implements FilterCondition { +export class EqAny extends FirestoreFunction implements FilterCondition { + constructor(private left: Expr, private others: Expr[]) { + super('eq_any', [left, new ListOfExprs(others)]); + } + filterable = true as const; +} + +/** + * @beta + */ +export class NotEqAny extends FirestoreFunction implements FilterCondition { constructor(private left: Expr, private others: Expr[]) { - super('in', [left, new ListOfExprs(others)]); + super('not_eq_any', [left, new ListOfExprs(others)]); } filterable = true as const; } @@ -2543,13 +2587,13 @@ export class Xor extends FirestoreFunction implements FilterCondition { /** * @beta */ -export class If extends FirestoreFunction implements FilterCondition { +export class Cond extends FirestoreFunction implements FilterCondition { constructor( private condition: FilterExpr, private thenExpr: Expr, private elseExpr: Expr ) { - super('if', [condition, thenExpr, elseExpr]); + super('cond', [condition, thenExpr, elseExpr]); } filterable = true as const; } @@ -2557,18 +2601,18 @@ export class If extends FirestoreFunction implements FilterCondition { /** * @beta */ -export class LogicalMax extends FirestoreFunction { +export class LogicalMaximum extends FirestoreFunction { constructor(private left: Expr, private right: Expr) { - super('logical_max', [left, right]); + super('logical_maximum', [left, right]); } } /** * @beta */ -export class LogicalMin extends FirestoreFunction { +export class LogicalMinimum extends FirestoreFunction { constructor(private left: Expr, private right: Expr) { - super('logical_min', [left, right]); + super('logical_minimum', [left, right]); } } @@ -2758,20 +2802,20 @@ export class Avg extends FirestoreFunction implements Accumulator { /** * @beta */ -export class Min extends FirestoreFunction implements Accumulator { +export class Minimum extends FirestoreFunction implements Accumulator { accumulator = true as const; constructor(private value: Expr, private distinct: boolean) { - super('min', [value]); + super('minimum', [value]); } } /** * @beta */ -export class Max extends FirestoreFunction implements Accumulator { +export class Maximum extends FirestoreFunction implements Accumulator { accumulator = true as const; constructor(private value: Expr, private distinct: boolean) { - super('max', [value]); + super('maximum', [value]); } } @@ -4378,14 +4422,14 @@ export function arrayLength(array: Expr): ArrayLength { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * inAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + * eqAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); * ``` * * @param element The expression to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function inAny(element: Expr, others: Expr[]): In; +export function eqAny(element: Expr, others: Expr[]): EqAny; /** * @beta @@ -4395,14 +4439,14 @@ export function inAny(element: Expr, others: Expr[]): In; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * inAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + * eqAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); * ``` * * @param element The expression to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function inAny(element: Expr, others: any[]): In; +export function eqAny(element: Expr, others: any[]): EqAny; /** * @beta @@ -4412,14 +4456,14 @@ export function inAny(element: Expr, others: any[]): In; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * inAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + * eqAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); * ``` * * @param element The field to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function inAny(element: string, others: Expr[]): In; +export function eqAny(element: string, others: Expr[]): EqAny; /** * @beta @@ -4429,20 +4473,20 @@ export function inAny(element: string, others: Expr[]): In; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * inAny("category", ["Electronics", Field.of("primaryType")]); + * eqAny("category", ["Electronics", Field.of("primaryType")]); * ``` * * @param element The field to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function inAny(element: string, others: any[]): In; -export function inAny(element: Expr | string, others: any[]): In { +export function eqAny(element: string, others: any[]): EqAny; +export function eqAny(element: Expr | string, others: any[]): EqAny { const elementExpr = element instanceof Expr ? element : Field.of(element); const exprOthers = others.map(other => other instanceof Expr ? other : Constant.of(other) ); - return new In(elementExpr, exprOthers); + return new EqAny(elementExpr, exprOthers); } /** @@ -4453,14 +4497,14 @@ export function inAny(element: Expr | string, others: any[]): In { * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notInAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + * notEqAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); * ``` * * @param element The expression to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notInAny(element: Expr, others: Expr[]): Not; +export function notEqAny(element: Expr, others: Expr[]): NotEqAny; /** * @beta @@ -4470,14 +4514,14 @@ export function notInAny(element: Expr, others: Expr[]): Not; * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notInAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + * notEqAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); * ``` * * @param element The expression to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notInAny(element: Expr, others: any[]): Not; +export function notEqAny(element: Expr, others: any[]): NotEqAny; /** * @beta @@ -4487,14 +4531,14 @@ export function notInAny(element: Expr, others: any[]): Not; * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notInAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + * notEqAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); * ``` * * @param element The field name to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notInAny(element: string, others: Expr[]): Not; +export function notEqAny(element: string, others: Expr[]): NotEqAny; /** * @beta @@ -4504,20 +4548,20 @@ export function notInAny(element: string, others: Expr[]): Not; * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notInAny("status", ["pending", Field.of("rejectedStatus")]); + * notEqAny("status", ["pending", Field.of("rejectedStatus")]); * ``` * * @param element The field name to compare. * @param others The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notInAny(element: string, others: any[]): Not; -export function notInAny(element: Expr | string, others: any[]): Not { +export function notEqAny(element: string, others: any[]): NotEqAny; +export function notEqAny(element: Expr | string, others: any[]): NotEqAny { const elementExpr = element instanceof Expr ? element : Field.of(element); const exprOthers = others.map(other => other instanceof Expr ? other : Constant.of(other) ); - return new Not(new In(elementExpr, exprOthers)); + return new NotEqAny(elementExpr, exprOthers); } /** @@ -4551,7 +4595,7 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor { * * ```typescript * // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". - * ifFunction( + * cond( * gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); * ``` * @@ -4560,12 +4604,12 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor { * @param elseExpr The expression to evaluate if the condition is false. * @return A new {@code Expr} representing the conditional expression. */ -export function ifFunction( +export function cond( condition: FilterExpr, thenExpr: Expr, elseExpr: Expr -): If { - return new If(condition, thenExpr, elseExpr); +): Cond { + return new Cond(condition, thenExpr, elseExpr); } /** @@ -4592,14 +4636,14 @@ export function not(filter: FilterExpr): Not { * * ```typescript * // Returns the larger value between the 'field1' field and the 'field2' field. - * logicalMax(Field.of("field1"), Field.of("field2")); + * logicalMaximum(Field.of("field1"), Field.of("field2")); * ``` * * @param left The left operand expression. * @param right The right operand expression. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMax(left: Expr, right: Expr): LogicalMax; +export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; /** * @beta @@ -4608,14 +4652,14 @@ export function logicalMax(left: Expr, right: Expr): LogicalMax; * * ```typescript * // Returns the larger value between the 'value' field and 10. - * logicalMax(Field.of("value"), 10); + * logicalMaximum(Field.of("value"), 10); * ``` * * @param left The left operand expression. * @param right The right operand constant. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMax(left: Expr, right: any): LogicalMax; +export function logicalMaximum(left: Expr, right: any): LogicalMaximum; /** * @beta @@ -4624,14 +4668,14 @@ export function logicalMax(left: Expr, right: any): LogicalMax; * * ```typescript * // Returns the larger value between the 'field1' field and the 'field2' field. - * logicalMax("field1", Field.of('field2')); + * logicalMaximum("field1", Field.of('field2')); * ``` * * @param left The left operand field name. * @param right The right operand expression. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMax(left: string, right: Expr): LogicalMax; +export function logicalMaximum(left: string, right: Expr): LogicalMaximum; /** * @beta @@ -4640,18 +4684,21 @@ export function logicalMax(left: string, right: Expr): LogicalMax; * * ```typescript * // Returns the larger value between the 'value' field and 10. - * logicalMax("value", 10); + * logicalMaximum("value", 10); * ``` * * @param left The left operand field name. * @param right The right operand constant. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMax(left: string, right: any): LogicalMax; -export function logicalMax(left: Expr | string, right: Expr | any): LogicalMax { +export function logicalMaximum(left: string, right: any): LogicalMaximum; +export function logicalMaximum( + left: Expr | string, + right: Expr | any +): LogicalMaximum { const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new LogicalMax(normalizedLeft, normalizedRight); + return new LogicalMaximum(normalizedLeft, normalizedRight); } /** @@ -4661,14 +4708,14 @@ export function logicalMax(left: Expr | string, right: Expr | any): LogicalMax { * * ```typescript * // Returns the smaller value between the 'field1' field and the 'field2' field. - * logicalMin(Field.of("field1"), Field.of("field2")); + * logicalMinimum(Field.of("field1"), Field.of("field2")); * ``` * * @param left The left operand expression. * @param right The right operand expression. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMin(left: Expr, right: Expr): LogicalMin; +export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; /** * @beta @@ -4677,14 +4724,14 @@ export function logicalMin(left: Expr, right: Expr): LogicalMin; * * ```typescript * // Returns the smaller value between the 'value' field and 10. - * logicalMin(Field.of("value"), 10); + * logicalMinimum(Field.of("value"), 10); * ``` * * @param left The left operand expression. * @param right The right operand constant. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMin(left: Expr, right: any): LogicalMin; +export function logicalMinimum(left: Expr, right: any): LogicalMinimum; /** * @beta @@ -4693,14 +4740,14 @@ export function logicalMin(left: Expr, right: any): LogicalMin; * * ```typescript * // Returns the smaller value between the 'field1' field and the 'field2' field. - * logicalMin("field1", Field.of("field2")); + * logicalMinimum("field1", Field.of("field2")); * ``` * * @param left The left operand field name. * @param right The right operand expression. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMin(left: string, right: Expr): LogicalMin; +export function logicalMinimum(left: string, right: Expr): LogicalMinimum; /** * @beta @@ -4709,18 +4756,21 @@ export function logicalMin(left: string, right: Expr): LogicalMin; * * ```typescript * // Returns the smaller value between the 'value' field and 10. - * logicalMin("value", 10); + * logicalMinimum("value", 10); * ``` * * @param left The left operand field name. * @param right The right operand constant. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMin(left: string, right: any): LogicalMin; -export function logicalMin(left: Expr | string, right: Expr | any): LogicalMin { +export function logicalMinimum(left: string, right: any): LogicalMinimum; +export function logicalMinimum( + left: Expr | string, + right: Expr | any +): LogicalMinimum { const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new LogicalMin(normalizedLeft, normalizedRight); + return new LogicalMinimum(normalizedLeft, normalizedRight); } /** @@ -5786,13 +5836,13 @@ export function avgFunction(value: Expr | string): Avg { * * ```typescript * // Find the lowest price of all products - * min(Field.of("price")).as("lowestPrice"); + * minimum(Field.of("price")).as("lowestPrice"); * ``` * * @param value The expression to find the minimum value of. * @return A new {@code Accumulator} representing the 'min' aggregation. */ -export function min(value: Expr): Min; +export function minimum(value: Expr): Minimum; /** * @beta @@ -5801,16 +5851,16 @@ export function min(value: Expr): Min; * * ```typescript * // Find the lowest price of all products - * min("price").as("lowestPrice"); + * minimum("price").as("lowestPrice"); * ``` * * @param value The name of the field to find the minimum value of. * @return A new {@code Accumulator} representing the 'min' aggregation. */ -export function min(value: string): Min; -export function min(value: Expr | string): Min { +export function minimum(value: string): Minimum; +export function minimum(value: Expr | string): Minimum { const exprValue = value instanceof Expr ? value : Field.of(value); - return new Min(exprValue, false); + return new Minimum(exprValue, false); } /** @@ -5821,13 +5871,13 @@ export function min(value: Expr | string): Min { * * ```typescript * // Find the highest score in a leaderboard - * max(Field.of("score")).as("highestScore"); + * maximum(Field.of("score")).as("highestScore"); * ``` * * @param value The expression to find the maximum value of. * @return A new {@code Accumulator} representing the 'max' aggregation. */ -export function max(value: Expr): Max; +export function maximum(value: Expr): Maximum; /** * @beta @@ -5836,16 +5886,16 @@ export function max(value: Expr): Max; * * ```typescript * // Find the highest score in a leaderboard - * max("score").as("highestScore"); + * maximum("score").as("highestScore"); * ``` * * @param value The name of the field to find the maximum value of. * @return A new {@code Accumulator} representing the 'max' aggregation. */ -export function max(value: string): Max; -export function max(value: Expr | string): Max { +export function maximum(value: string): Maximum; +export function maximum(value: Expr | string): Maximum { const exprValue = value instanceof Expr ? value : Field.of(value); - return new Max(exprValue, false); + return new Maximum(exprValue, false); } /** diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index a79c5cafc31..da62a229adc 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -43,10 +43,10 @@ export class PipelineSource { * @param documentReferenceFactory */ constructor( - private db: Firestore, - private userDataReader: UserDataReader, - private userDataWriter: AbstractUserDataWriter, - private documentReferenceFactory: (id: DocumentKey) => DocumentReference + protected db: Firestore, + protected userDataReader: UserDataReader, + protected userDataWriter: AbstractUserDataWriter, + protected documentReferenceFactory: (id: DocumentKey) => DocumentReference ) {} collection(collectionPath: string): Pipeline { diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 4d13d5dfddd..f835f709551 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -24,14 +24,12 @@ import { StructuredPipeline, Stage as ProtoStage } from '../protos/firestore_proto_api'; -import { invokeExecutePipeline } from '../remote/datastore'; import { getEncodedDatabaseId, JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; -import { getDatastore } from './components'; import { Firestore } from './database'; import { Accumulator, @@ -45,8 +43,7 @@ import { Selectable } from './expressions'; import { PipelineResult } from './pipeline-result'; -import { PipelineSource } from './pipeline-source'; -import { DocumentData, DocumentReference, Query } from './reference'; +import { DocumentData, DocumentReference } from './reference'; import { AddFields, Aggregate, @@ -130,8 +127,8 @@ export class Pipeline * @private * @param _db * @param userDataReader - * @param userDataWriter - * @param documentReferenceFactory + * @param _userDataWriter + * @param _documentReferenceFactory * @param stages * @param converter */ @@ -146,12 +143,12 @@ export class Pipeline * @internal * @private */ - protected userDataWriter: AbstractUserDataWriter, + public _userDataWriter: AbstractUserDataWriter, /** * @internal * @private */ - protected documentReferenceFactory: (id: DocumentKey) => DocumentReference, + public _documentReferenceFactory: (id: DocumentKey) => DocumentReference, private stages: Stage[], // TODO(pipeline) support converter //private converter: FirestorePipelineConverter = defaultPipelineConverter() @@ -191,11 +188,11 @@ export class Pipeline this.readUserData('addFields', this.selectablesToMap(fields)) ) ); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -237,11 +234,11 @@ export class Pipeline let projections: Map = this.selectablesToMap(selections); projections = this.readUserData('select', projections); copy.push(new Select(projections)); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -294,6 +291,24 @@ export class Pipeline return expressionMap; } + protected newPipeline( + db: Firestore, + userDataReader: UserDataReader, + userDataWriter: AbstractUserDataWriter, + documentReferenceFactory: (id: DocumentKey) => DocumentReference, + stages: Stage[], + converter: unknown = {} + ): Pipeline { + return new Pipeline( + db, + userDataReader, + userDataWriter, + documentReferenceFactory, + stages, + converter + ); + } + /** * Filters the documents from previous stages to only include those matching the specified {@link * FilterCondition}. @@ -329,11 +344,11 @@ export class Pipeline const copy = this.stages.map(s => s); this.readUserData('where', condition); copy.push(new Where(condition)); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -362,11 +377,11 @@ export class Pipeline offset(offset: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Offset(offset)); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -400,11 +415,11 @@ export class Pipeline limit(limit: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Limit(limit)); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -445,11 +460,11 @@ export class Pipeline this.readUserData('distinct', this.selectablesToMap(groups || [])) ) ); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -558,11 +573,11 @@ export class Pipeline ) ); } - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -586,11 +601,11 @@ export class Pipeline options.distanceField ) ); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy ); } @@ -647,11 +662,11 @@ export class Pipeline ); } - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -685,11 +700,11 @@ export class Pipeline } }); copy.push(new GenericStage(name, params)); - return new Pipeline( + return this.newPipeline( this._db, this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._userDataWriter, + this._documentReferenceFactory, copy, this.converter ); @@ -754,7 +769,7 @@ export class Pipeline // converter: FirestorePipelineConverter | null // ): Pipeline { // const copy = this.stages.map(s => s); - // return new Pipeline( + // return this.newPipeline( // this.db, // copy, // converter ?? defaultPipelineConverter() @@ -793,29 +808,9 @@ export class Pipeline * @return A Promise representing the asynchronous pipeline execution. */ execute(): Promise>> { - const datastore = getDatastore(this._db); - return invokeExecutePipeline(datastore, this).then(result => { - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - this.userDataWriter, - element.key?.path - ? this.documentReferenceFactory(element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - //this.converter - ) - ); - - return docs; - }); + throw new Error( + 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + ); } /** @@ -833,21 +828,3 @@ export class Pipeline }; } } - -/** - * Experimental Modular API for console testing. - * @param firestore - */ -export function pipeline(firestore: Firestore): PipelineSource; - -/** - * Experimental Modular API for console testing. - * @param query - */ -export function pipeline(query: Query): Pipeline; - -export function pipeline( - firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { - return firestoreOrQuery.pipeline(); -} diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index cd490d31871..d049bbba05c 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -15,8 +15,17 @@ * limitations under the License. */ +import { DocumentKey } from '../model/document_key'; +import { invokeExecutePipeline } from '../remote/datastore'; + +import { getDatastore } from './components'; +import { Firestore } from './database'; import { Pipeline } from './pipeline'; import { PipelineResult } from './pipeline-result'; +import { PipelineSource } from './pipeline-source'; +import { DocumentReference, Query } from './reference'; +import { LiteUserDataWriter } from './reference_impl'; +import { newUserDataReader } from './user_data_reader'; /** * Modular API for console experimentation. @@ -26,5 +35,84 @@ import { PipelineResult } from './pipeline-result'; export function execute( pipeline: Pipeline ): Promise>> { - return pipeline.execute(); + const datastore = getDatastore(pipeline._db); + return invokeExecutePipeline(datastore, pipeline).then(result => { + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + pipeline._userDataWriter, + element.key?.path + ? pipeline._documentReferenceFactory(element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + //this.converter + ) + ); + + return docs; + }); +} + +/** + * Experimental Modular API for console testing. + * @param firestore + */ +export function pipeline(firestore: Firestore): PipelineSource; + +/** + * Experimental Modular API for console testing. + * @param query + */ +export function pipeline(query: Query): Pipeline; + +export function pipeline( + firestoreOrQuery: Firestore | Query +): PipelineSource | Pipeline { + if (firestoreOrQuery instanceof Firestore) { + const db = firestoreOrQuery; + const userDataWriter = new LiteUserDataWriter(db); + const userDataReader = newUserDataReader(db); + return new PipelineSource( + db, + userDataReader, + userDataWriter, + (key: DocumentKey) => { + return new DocumentReference(db, null, key); + } + ); + } else { + let pipeline; + const query = firestoreOrQuery; + if (query._query.collectionGroup) { + pipeline = query.firestore + .pipeline() + .collectionGroup(query._query.collectionGroup); + } else { + pipeline = query.firestore + .pipeline() + .collection(query._query.path.canonicalString()); + } + + // TODO(pipeline) convert existing query filters, limits, etc into + // pipeline stages + + return pipeline; + } +} + +export function useFirestorePipelines(): void { + Firestore.prototype.pipeline = function (): PipelineSource { + return pipeline(this); + }; + + Query.prototype.pipeline = function (): Pipeline { + return pipeline(this); + }; } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index a954d9b53e1..22fb5a1cdfb 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -55,14 +55,21 @@ import { setDoc, startsWith, subtract, - useFirestorePipelines + useFirestorePipelines, + setLogLevel, + cond, + eqAny, + logicalMaximum, + logicalMinimum, + notEqAny } from '../util/firebase_export'; import { apiDescribe, withTestCollection } from '../util/helpers'; use(chaiAsPromised); -useFirestorePipelines(); -apiDescribe.skip('Pipelines', persistence => { +setLogLevel('debug'); + +apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; let randomCol: CollectionReference; @@ -258,595 +265,689 @@ apiDescribe.skip('Pipelines', persistence => { await withTestCollectionPromise; }); - // setLogLevel('debug') + describe('fluent API', () => { + before(() => { + useFirestorePipelines(); + }); - it('empty results as expected', async () => { - const result = await firestore - .pipeline() - .collection(randomCol.path) - .limit(0) - .execute(); - expect(result.length).to.equal(0); - }); + it('empty results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .limit(0) + .execute(); + expect(result.length).to.equal(0); + }); - it('full results as expected', async () => { - const result = await firestore - .pipeline() - .collection(randomCol.path) - .execute(); - expect(result.length).to.equal(10); - }); + it('full results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .execute(); + expect(result.length).to.equal(10); + }); - it('returns aggregate results as expected', async () => { - let result = await firestore - .pipeline() - .collection(randomCol.path) - .aggregate(countAll().as('count')) - .execute(); - expectResults(result, { count: 10 }); - - result = await randomCol - .pipeline() - .where(eq('genre', 'Science Fiction')) - .aggregate( - countAll().as('count'), - avgFunction('rating').as('avgRating'), - Field.of('rating').max().as('maxRating') - ) - .execute(); - expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); - }); + it('returns aggregate results as expected', async () => { + let result = await firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countAll().as('count')) + .execute(); + expectResults(result, { count: 10 }); + + result = await randomCol + .pipeline() + .where(eq('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + avgFunction('rating').as('avgRating'), + Field.of('rating').maximum().as('maxRating') + ) + .execute(); + expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + }); - it('rejects groups without accumulators', async () => { - await expect( - randomCol + it('rejects groups without accumulators', async () => { + await expect( + randomCol + .pipeline() + .where(lt('published', 1900)) + .aggregate({ + accumulators: [], + groups: ['genre'] + }) + .execute() + ).to.be.rejected; + }); + + // skip: toLower not supported + // it.skip('returns distinct values as expected', async () => { + // const results = await randomCol + // .pipeline() + // .where(lt('published', 1900)) + // .distinct(Field.of('genre').toLower().as('lowerGenre')) + // .execute(); + // expectResults( + // results, + // { lowerGenre: 'romance' }, + // { lowerGenre: 'psychological thriller' } + // ); + // }); + + it('returns group and accumulate results', async () => { + const results = await randomCol .pipeline() - .where(lt('published', 1900)) + .where(lt(Field.of('published'), 1984)) .aggregate({ - accumulators: [], + accumulators: [avgFunction('rating').as('avgRating')], groups: ['genre'] }) - .execute() - ).to.be.rejected; - }); - - // skip: toLower not supported - // it.skip('returns distinct values as expected', async () => { - // const results = await randomCol - // .pipeline() - // .where(lt('published', 1900)) - // .distinct(Field.of('genre').toLower().as('lowerGenre')) - // .execute(); - // expectResults( - // results, - // { lowerGenre: 'romance' }, - // { lowerGenre: 'psychological thriller' } - // ); - // }); - - it('returns group and accumulate results', async () => { - const results = await randomCol - .pipeline() - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()) - .execute(); - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } - ); - }); + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()) + .execute(); + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); - it('returns min and max accumulations', async () => { - const results = await randomCol - .pipeline() - .aggregate( - countAll().as('count'), - Field.of('rating').max().as('maxRating'), - Field.of('published').min().as('minPublished') - ) - .execute(); - expectResults(results, { - count: 10, - maxRating: 4.7, - minPublished: 1813 + it('returns min and max accumulations', async () => { + const results = await randomCol + .pipeline() + .aggregate( + countAll().as('count'), + Field.of('rating').maximum().as('maxRating'), + Field.of('published').minimum().as('minPublished') + ) + .execute(); + expectResults(results, { + count: 10, + maxRating: 4.7, + minPublished: 1813 + }); }); - }); - it('can select fields', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'author') - .sort(Field.of('author').ascending()) - .execute(); - expectResults( - results, - { - title: "The Hitchhiker's Guide to the Galaxy", - author: 'Douglas Adams' - }, - { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, - { title: 'Dune', author: 'Frank Herbert' }, - { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, - { - title: 'One Hundred Years of Solitude', - author: 'Gabriel García Márquez' - }, - { title: '1984', author: 'George Orwell' }, - { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, - { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, - { title: 'Pride and Prejudice', author: 'Jane Austen' }, - { title: "The Handmaid's Tale", author: 'Margaret Atwood' } - ); - }); + it('can select fields', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(Field.of('author').ascending()) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' + }, + { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, + { title: 'Dune', author: 'Frank Herbert' }, + { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez' + }, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, + { title: 'Pride and Prejudice', author: 'Jane Austen' }, + { title: "The Handmaid's Tale", author: 'Margaret Atwood' } + ); + }); - it('where with and', async () => { - const results = await randomCol - .pipeline() - .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) - .execute(); - expectResults(results, 'book10'); - }); + it('where with and', async () => { + const results = await randomCol + .pipeline() + .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) + .execute(); + expectResults(results, 'book10'); + }); - it('where with or', async () => { - const results = await randomCol - .pipeline() - .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) - .select('title') - .execute(); - expectResults( - results, - { title: 'Pride and Prejudice' }, - { title: "The Handmaid's Tale" }, - { title: '1984' } - ); - }); + it('where with or', async () => { + const results = await randomCol + .pipeline() + .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) + .select('title') + .execute(); + expectResults( + results, + { title: 'Pride and Prejudice' }, + { title: "The Handmaid's Tale" }, + { title: '1984' } + ); + }); - it('offset and limits', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .sort(Field.of('author').ascending()) - .offset(5) - .limit(3) - .select('title', 'author') - .execute(); - expectResults( - results, - { title: '1984', author: 'George Orwell' }, - { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, - { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } - ); - }); + it('offset and limits', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .sort(Field.of('author').ascending()) + .offset(5) + .limit(3) + .select('title', 'author') + .execute(); + expectResults( + results, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); + }); - it('arrayContains works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContains('tags', 'comedy')) - .select('title') - .execute(); - expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); - }); + it('logical min works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + logicalMinimum(Constant.of(1960), Field.of('published')).as( + 'published-safe' + ) + ) + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1949 }, + { title: 'Crime and Punishment', 'published-safe': 1866 }, + { title: 'Dune', 'published-safe': 1960 } + ); + }); - it('arrayContainsAny works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContainsAny('tags', ['comedy', 'classic'])) - .select('title') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'Pride and Prejudice' } - ); - }); + it('logical max works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + logicalMaximum(Constant.of(1960), Field.of('published')).as( + 'published-safe' + ) + ) + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); - it('arrayContainsAll works', async () => { - const results = await randomCol - .pipeline() - .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) - .select('title') - .execute(); - expectResults(results, { title: 'The Lord of the Rings' }); - }); + it('cond works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + cond( + lt(Field.of('published'), 1960), + Constant.of(1960), + Field.of('published') + ).as('published-safe') + ) + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); - it('arrayLength works', async () => { - const results = await randomCol - .pipeline() - .select(Field.of('tags').arrayLength().as('tagsCount')) - .where(eq('tagsCount', 3)) - .execute(); - expect(results.length).to.equal(10); - }); + it('eqAny works', async () => { + const results = await randomCol + .pipeline() + .where(eqAny('published', [1979, 1999, 1967])) + .select('title') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'One Hundred Years of Solitude' } + ); + }); - // skip: arrayConcat not supported - // it.skip('arrayConcat works', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] - // }); - // }); - - it('testStrConcat', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('author').strConcat(' - ', Field.of('title')).as('bookInfo') - ) - .limit(1) - .execute(); - expectResults(results, { - bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + it('notEqAny works', async () => { + const results = await randomCol + .pipeline() + .where( + notEqAny( + 'published', + [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] + ) + ) + .select('title') + .execute(); + expectResults(results, { title: 'Pride and Prejudice' }); }); - }); - it('testStartsWith', async () => { - const results = await randomCol - .pipeline() - .where(startsWith('title', 'The')) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { title: 'The Great Gatsby' }, - { title: "The Handmaid's Tale" }, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Lord of the Rings' } - ); - }); + it('arrayContains works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContains('tags', 'comedy')) + .select('title') + .execute(); + expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); + }); - it('testEndsWith', async () => { - const results = await randomCol - .pipeline() - .where(endsWith('title', 'y')) - .select('title') - .sort(Field.of('title').descending()) - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Great Gatsby' } - ); - }); + it('arrayContainsAny works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .select('title') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'Pride and Prejudice' } + ); + }); - it('testLength', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('title').charLength().as('titleLength'), - Field.of('title') - ) - .where(gt('titleLength', 20)) - .sort(Field.of('title').ascending()) - .execute(); - - expectResults( - results, - - { - titleLength: 29, - title: 'One Hundred Years of Solitude' - }, - { - titleLength: 36, - title: "The Hitchhiker's Guide to the Galaxy" - }, - { - titleLength: 21, - title: 'The Lord of the Rings' - }, - { - titleLength: 21, - title: 'To Kill a Mockingbird' - } - ); - }); + it('arrayContainsAll works', async () => { + const results = await randomCol + .pipeline() + .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) + .select('title') + .execute(); + expectResults(results, { title: 'The Lord of the Rings' }); + }); - // skip: toLower not supported - // it.skip('testToLowercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('title').toLower().as('lowercaseTitle')) - // .limit(1) - // .execute(); - // expectResults(results, { - // lowercaseTitle: "the hitchhiker's guide to the galaxy" - // }); - // }); - - // skip: toUpper not supported - // it.skip('testToUppercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('author').toUpper().as('uppercaseAuthor')) - // .limit(1) - // .execute(); - // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); - // }); - - // skip: trim not supported - // it.skip('testTrim', async () => { - // const results = await randomCol - // .pipeline() - // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) - // .select( - // Field.of('spacedTitle').trim().as('trimmedTitle'), - // Field.of('spacedTitle') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", - // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" - // }); - // }); - - it('testLike', async () => { - const results = await randomCol - .pipeline() - .where(like('title', '%Guide%')) - .select('title') - .execute(); - expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); - }); + it('arrayLength works', async () => { + const results = await randomCol + .pipeline() + .select(Field.of('tags').arrayLength().as('tagsCount')) + .where(eq('tagsCount', 3)) + .execute(); + expect(results.length).to.equal(10); + }); - it('testRegexContains', async () => { - const results = await randomCol - .pipeline() - .where(regexContains('title', '(?i)(the|of)')) - .execute(); - expect(results.length).to.equal(5); - }); + // skip: arrayConcat not supported + // it.skip('arrayConcat works', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] + // }); + // }); + + it('testStrConcat', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('author').strConcat(' - ', Field.of('title')).as('bookInfo') + ) + .limit(1) + .execute(); + expectResults(results, { + bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + }); + }); - it('testRegexMatches', async () => { - const results = await randomCol - .pipeline() - .where(regexMatch('title', '.*(?i)(the|of).*')) - .execute(); - expect(results.length).to.equal(5); - }); + it('testStartsWith', async () => { + const results = await randomCol + .pipeline() + .where(startsWith('title', 'The')) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'The Great Gatsby' }, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Lord of the Rings' } + ); + }); - it('testArithmeticOperations', async () => { - const results = await randomCol - .pipeline() - .select( - add(Field.of('rating'), 1).as('ratingPlusOne'), - subtract(Field.of('published'), 1900).as('yearsSince1900'), - Field.of('rating').multiply(10).as('ratingTimesTen'), - Field.of('rating').divide(2).as('ratingDividedByTwo') - ) - .limit(1) - .execute(); - expectResults(results, { - ratingPlusOne: 5.2, - yearsSince1900: 79, - ratingTimesTen: 42, - ratingDividedByTwo: 2.1 + it('testEndsWith', async () => { + const results = await randomCol + .pipeline() + .where(endsWith('title', 'y')) + .select('title') + .sort(Field.of('title').descending()) + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Great Gatsby' } + ); }); - }); - it('testComparisonOperators', async () => { - const results = await randomCol - .pipeline() - .where( - andFunction( - gt('rating', 4.2), - lte(Field.of('rating'), 4.5), - neq('genre', 'Science Fiction') + it('testLength', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('title').charLength().as('titleLength'), + Field.of('title') ) - ) - .select('rating', 'title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { rating: 4.3, title: 'Crime and Punishment' }, - { - rating: 4.3, - title: 'One Hundred Years of Solitude' - }, - { rating: 4.5, title: 'Pride and Prejudice' } - ); - }); + .where(gt('titleLength', 20)) + .sort(Field.of('title').ascending()) + .execute(); + + expectResults( + results, + + { + titleLength: 29, + title: 'One Hundred Years of Solitude' + }, + { + titleLength: 36, + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + titleLength: 21, + title: 'The Lord of the Rings' + }, + { + titleLength: 21, + title: 'To Kill a Mockingbird' + } + ); + }); - it('testLogicalOperators', async () => { - const results = await randomCol - .pipeline() - .where( - orFunction( - andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), - lt('published', 1900) + // skip: toLower not supported + // it.skip('testToLowercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('title').toLower().as('lowercaseTitle')) + // .limit(1) + // .execute(); + // expectResults(results, { + // lowercaseTitle: "the hitchhiker's guide to the galaxy" + // }); + // }); + + // skip: toUpper not supported + // it.skip('testToUppercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('author').toUpper().as('uppercaseAuthor')) + // .limit(1) + // .execute(); + // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + // }); + + // skip: trim not supported + // it.skip('testTrim', async () => { + // const results = await randomCol + // .pipeline() + // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) + // .select( + // Field.of('spacedTitle').trim().as('trimmedTitle'), + // Field.of('spacedTitle') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + // }); + // }); + + it('testLike', async () => { + const results = await randomCol + .pipeline() + .where(like('title', '%Guide%')) + .select('title') + .execute(); + expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); + }); + + it('testRegexContains', async () => { + const results = await randomCol + .pipeline() + .where(regexContains('title', '(?i)(the|of)')) + .execute(); + expect(results.length).to.equal(5); + }); + + it('testRegexMatches', async () => { + const results = await randomCol + .pipeline() + .where(regexMatch('title', '.*(?i)(the|of).*')) + .execute(); + expect(results.length).to.equal(5); + }); + + it('testArithmeticOperations', async () => { + const results = await randomCol + .pipeline() + .select( + add(Field.of('rating'), 1).as('ratingPlusOne'), + subtract(Field.of('published'), 1900).as('yearsSince1900'), + Field.of('rating').multiply(10).as('ratingTimesTen'), + Field.of('rating').divide(2).as('ratingDividedByTwo') ) - ) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { title: 'Crime and Punishment' }, - { title: 'Dune' }, - { title: 'Pride and Prejudice' } - ); - }); + .limit(1) + .execute(); + expectResults(results, { + ratingPlusOne: 5.2, + yearsSince1900: 79, + ratingTimesTen: 42, + ratingDividedByTwo: 2.1 + }); + }); - it('testChecks', async () => { - const results = await randomCol - .pipeline() - .where(not(Field.of('rating').isNaN())) - .select( - Field.of('rating').eq(null).as('ratingIsNull'), - not(Field.of('rating').isNaN()).as('ratingIsNotNaN') - ) - .limit(1) - .execute(); - expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); - }); + it('testComparisonOperators', async () => { + const results = await randomCol + .pipeline() + .where( + andFunction( + gt('rating', 4.2), + lte(Field.of('rating'), 4.5), + neq('genre', 'Science Fiction') + ) + ) + .select('rating', 'title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { rating: 4.3, title: 'Crime and Punishment' }, + { + rating: 4.3, + title: 'One Hundred Years of Solitude' + }, + { rating: 4.5, title: 'Pride and Prejudice' } + ); + }); - it('testMapGet', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('awards').mapGet('hugo').as('hugoAward'), - Field.of('awards').mapGet('others').as('others'), - Field.of('title') - ) - .where(eq('hugoAward', true)) - .execute(); - expectResults( - results, - { - hugoAward: true, - title: "The Hitchhiker's Guide to the Galaxy", - others: { unknown: { year: 1980 } } - }, - { hugoAward: true, title: 'Dune', others: null } - ); - }); + it('testLogicalOperators', async () => { + const results = await randomCol + .pipeline() + .where( + orFunction( + andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), + lt('published', 1900) + ) + ) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'Crime and Punishment' }, + { title: 'Dune' }, + { title: 'Pride and Prejudice' } + ); + }); - // it('testParent', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // parent(randomCol.doc('chile').collection('subCollection').path).as( - // 'parent' - // ) - // ) - // .limit(1) - // .execute(); - // expect(results[0].data().parent.endsWith('/books')).to.be.true; - // }); - // - // it('testCollectionId', async () => { - // const results = await randomCol - // .pipeline() - // .select(collectionId(randomCol.doc('chile')).as('collectionId')) - // .limit(1) - // .execute(); - // expectResults(results, {collectionId: 'books'}); - // }); - - it('testDistanceFunctions', async () => { - const sourceVector = [0.1, 0.1]; - const targetVector = [0.5, 0.8]; - const results = await randomCol - .pipeline() - .select( - cosineDistance(Constant.vector(sourceVector), targetVector).as( - 'cosineDistance' - ), - dotProduct(Constant.vector(sourceVector), targetVector).as( - 'dotProductDistance' - ), - euclideanDistance(Constant.vector(sourceVector), targetVector).as( - 'euclideanDistance' + it('testChecks', async () => { + const results = await randomCol + .pipeline() + .where(not(Field.of('rating').isNaN())) + .select( + Field.of('rating').eq(null).as('ratingIsNull'), + not(Field.of('rating').isNaN()).as('ratingIsNotNaN') ) - ) - .limit(1) - .execute(); + .limit(1) + .execute(); + expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); + }); - expectResults(results, { - cosineDistance: 0.02560880430538015, - dotProductDistance: 0.13, - euclideanDistance: 0.806225774829855 + it('testMapGet', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('awards').mapGet('hugo').as('hugoAward'), + Field.of('awards').mapGet('others').as('others'), + Field.of('title') + ) + .where(eq('hugoAward', true)) + .execute(); + expectResults( + results, + { + hugoAward: true, + title: "The Hitchhiker's Guide to the Galaxy", + others: { unknown: { year: 1980 } } + }, + { hugoAward: true, title: 'Dune', others: null } + ); }); - }); - it('testNestedFields', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select('title', 'awards.hugo') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy", 'awards.hugo': true }, - { title: 'Dune', 'awards.hugo': true } - ); - }); + // it('testParent', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // parent(randomCol.doc('chile').collection('subCollection').path).as( + // 'parent' + // ) + // ) + // .limit(1) + // .execute(); + // expect(results[0].data().parent.endsWith('/books')).to.be.true; + // }); + // + // it('testCollectionId', async () => { + // const results = await randomCol + // .pipeline() + // .select(collectionId(randomCol.doc('chile')).as('collectionId')) + // .limit(1) + // .execute(); + // expectResults(results, {collectionId: 'books'}); + // }); + + it('testDistanceFunctions', async () => { + const sourceVector = [0.1, 0.1]; + const targetVector = [0.5, 0.8]; + const results = await randomCol + .pipeline() + .select( + cosineDistance(Constant.vector(sourceVector), targetVector).as( + 'cosineDistance' + ), + dotProduct(Constant.vector(sourceVector), targetVector).as( + 'dotProductDistance' + ), + euclideanDistance(Constant.vector(sourceVector), targetVector).as( + 'euclideanDistance' + ) + ) + .limit(1) + .execute(); + + expectResults(results, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + }); - it('test mapGet with field name including . notation', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') - ) - .execute(); - expectResults( - results, - { - title: "The Hitchhiker's Guide to the Galaxy", - 'nestedField.level.`1`': null, - nested: true - }, - { title: 'Dune', 'nestedField.level.`1`': null, nested: null } - ); - }); + it('testNestedFields', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select('title', 'awards.hugo') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy", 'awards.hugo': true }, + { title: 'Dune', 'awards.hugo': true } + ); + }); - it('supports internal serialization to proto', async () => { - const pipeline = firestore - .pipeline() - .collection('books') - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + it('test mapGet with field name including . notation', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'nestedField.level.`1`': null, + nested: true + }, + { title: 'Dune', 'nestedField.level.`1`': null, nested: null } ); + }); + + it('supports internal serialization to proto', async () => { + const pipeline = firestore + .pipeline() + .collection('books') + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ); + + const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); + expect(proto).not.to.be.null; + }); - const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); - expect(proto).not.to.be.null; + // TODO(pipeline) support converter + // it('pipeline converter works', async () => { + // interface AppModel {myTitle: string; myAuthor: string; myPublished: number} + // const converter: FirestorePipelineConverter = { + // fromFirestore(result: FirebaseFirestore.PipelineResult): AppModel { + // return { + // myTitle: result.data()!.title as string, + // myAuthor: result.data()!.author as string, + // myPublished: result.data()!.published as number, + // }; + // }, + // }; + // + // const results = await firestore + // .pipeline() + // .collection(randomCol.path) + // .sort(Field.of('published').ascending()) + // .limit(2) + // .withConverter(converter) + // .execute(); + // + // const objs = results.map(r => r.data()); + // expect(objs[0]).to.deep.equal({ + // myAuthor: 'Jane Austen', + // myPublished: 1813, + // myTitle: 'Pride and Prejudice', + // }); + // expect(objs[1]).to.deep.equal({ + // myAuthor: 'Fyodor Dostoevsky', + // myPublished: 1866, + // myTitle: 'Crime and Punishment', + // }); + // }); }); - // TODO(pipeline) support converter - // it('pipeline converter works', async () => { - // interface AppModel {myTitle: string; myAuthor: string; myPublished: number} - // const converter: FirestorePipelineConverter = { - // fromFirestore(result: FirebaseFirestore.PipelineResult): AppModel { - // return { - // myTitle: result.data()!.title as string, - // myAuthor: result.data()!.author as string, - // myPublished: result.data()!.published as number, - // }; - // }, - // }; - // - // const results = await firestore - // .pipeline() - // .collection(randomCol.path) - // .sort(Field.of('published').ascending()) - // .limit(2) - // .withConverter(converter) - // .execute(); - // - // const objs = results.map(r => r.data()); - // expect(objs[0]).to.deep.equal({ - // myAuthor: 'Jane Austen', - // myPublished: 1813, - // myTitle: 'Pride and Prejudice', - // }); - // expect(objs[1]).to.deep.equal({ - // myAuthor: 'Fyodor Dostoevsky', - // myPublished: 1866, - // myTitle: 'Crime and Punishment', - // }); - // }); describe('modular API', () => { it('works when creating a pipeline from a Firestore instance', async () => { const myPipeline = pipeline(firestore) diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index 6c1adcad52c..f265521b08b 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -129,7 +129,39 @@ ] }, { - "name": "Pipeline Query with lt filter", + "name": "Pipeline Query with lt filter (execute)", + "dependencies": [ + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "app", + "imports": [ + "initializeApp" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore", + "imports": [ + "getFirestore", + "lt", + "Field", + "execute" + ] + } + ] + } + ] + }, + { + "name": "Pipeline Query with lt filter (useFirestorePipelines)", "dependencies": [ { "packageName": "firebase", From 63b88541dc00330e653cf794265df581e65f1858 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:05:48 -0700 Subject: [PATCH 046/295] Fix build. Finish rename. Rename useFirestorePipelines to useFluentPipelines. --- common/api-review/firestore-lite.api.md | 268 ++++++++++-------- common/api-review/firestore.api.md | 234 ++++++++------- packages/firestore/lite/index.ts | 36 +-- packages/firestore/src/api.ts | 4 +- packages/firestore/src/api/database.ts | 2 +- .../src/api/database_augmentation.ts | 0 packages/firestore/src/api/pipeline-source.ts | 58 ++-- packages/firestore/src/api/pipeline.ts | 13 +- packages/firestore/src/api/pipeline_impl.ts | 7 +- packages/firestore/src/api_pipelines.ts | 2 +- packages/firestore/src/core/pipeline-util.ts | 4 +- packages/firestore/src/lite-api/database.ts | 4 +- .../firestore/src/lite-api/pipeline-source.ts | 64 +++-- packages/firestore/src/lite-api/pipeline.ts | 13 +- .../firestore/src/lite-api/pipeline_impl.ts | 2 +- packages/firestore/src/lite-api/reference.ts | 2 +- .../test/integration/api/pipeline.test.ts | 4 +- 17 files changed, 403 insertions(+), 314 deletions(-) delete mode 100644 packages/firestore/src/api/database_augmentation.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index d3edaf71247..36d02015529 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -285,6 +285,16 @@ export class CollectionSource implements Stage { name: string; } +// @beta (undocumented) +export class Cond extends FirestoreFunction implements FilterCondition { + constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function cond(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): Cond; + // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { mockUserToken?: EmulatorMockTokenOptions | string; @@ -323,6 +333,9 @@ export class Constant { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -334,30 +347,30 @@ export class Constant { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; static of(value: number): Constant; static of(value: string): Constant; static of(value: boolean): Constant; @@ -603,6 +616,25 @@ export function eq(left: string, right: Constant): Eq; // @beta export function eq(left: string, right: any): Eq; +// @beta (undocumented) +export class EqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, others: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function eqAny(element: Constant, others: Constant[]): EqAny; + +// @beta +export function eqAny(element: Constant, others: any[]): EqAny; + +// @beta +export function eqAny(element: string, others: Constant[]): EqAny; + +// @beta +export function eqAny(element: string, others: any[]): EqAny; + // @beta (undocumented) export class EuclideanDistance extends FirestoreFunction { constructor(vector1: Constant, vector2: Constant); @@ -681,6 +713,9 @@ export class ExprWithAlias implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -694,30 +729,30 @@ export class ExprWithAlias implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; regexMatch(pattern: string): RegexMatch; @@ -786,6 +821,9 @@ export class Field implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -799,30 +837,30 @@ export class Field implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; static of(name: string): Field; // (undocumented) static of(path: FieldPath): Field; @@ -902,6 +940,9 @@ export class Fields implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -915,30 +956,30 @@ export class Fields implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; // (undocumented) static of(name: string, ...others: string[]): Fields; // (undocumented) @@ -1072,6 +1113,9 @@ export class FirestoreFunction { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -1083,30 +1127,30 @@ export class FirestoreFunction { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; regexMatch(pattern: string): RegexMatch; @@ -1226,35 +1270,6 @@ export function gte(left: string, right: Constant): Gte; // @beta export function gte(left: string, right: any): Gte; -// @beta (undocumented) -export class If extends FirestoreFunction implements FilterCondition { - constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); - // (undocumented) - filterable: true; - } - -// @beta -export function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; - -// @beta (undocumented) -export class In extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, others: Constant[]); - // (undocumented) - filterable: true; - } - -// @beta -export function inAny(element: Constant, others: Constant[]): In; - -// @beta -export function inAny(element: Constant, others: any[]): In; - -// @beta -export function inAny(element: string, others: Constant[]): In; - -// @beta -export function inAny(element: string, others: any[]): In; - // @public export function increment(n: number): FieldValue; @@ -1310,38 +1325,38 @@ export function limit(limit: number): QueryLimitConstraint; export function limitToLast(limit: number): QueryLimitConstraint; // @beta (undocumented) -export class LogicalMax extends FirestoreFunction { +export class LogicalMaximum extends FirestoreFunction { constructor(left: Constant, right: Constant); } // @beta -export function logicalMax(left: Constant, right: Constant): LogicalMax; +export function logicalMaximum(left: Constant, right: Constant): LogicalMaximum; // @beta -export function logicalMax(left: Constant, right: any): LogicalMax; +export function logicalMaximum(left: Constant, right: any): LogicalMaximum; // @beta -export function logicalMax(left: string, right: Constant): LogicalMax; +export function logicalMaximum(left: string, right: Constant): LogicalMaximum; // @beta -export function logicalMax(left: string, right: any): LogicalMax; +export function logicalMaximum(left: string, right: any): LogicalMaximum; // @beta (undocumented) -export class LogicalMin extends FirestoreFunction { +export class LogicalMinimum extends FirestoreFunction { constructor(left: Constant, right: Constant); } // @beta -export function logicalMin(left: Constant, right: Constant): LogicalMin; +export function logicalMinimum(left: Constant, right: Constant): LogicalMinimum; // @beta -export function logicalMin(left: Constant, right: any): LogicalMin; +export function logicalMinimum(left: Constant, right: any): LogicalMinimum; // @beta -export function logicalMin(left: string, right: Constant): LogicalMin; +export function logicalMinimum(left: string, right: Constant): LogicalMinimum; // @beta -export function logicalMin(left: string, right: any): LogicalMin; +export function logicalMinimum(left: string, right: any): LogicalMinimum; export { LogLevel } @@ -1398,30 +1413,30 @@ export function mapGet(mapField: string, subField: string): MapGet; export function mapGet(mapExpr: Constant, subField: string): MapGet; // @beta (undocumented) -export class Max extends FirestoreFunction implements Accumulator { +export class Maximum extends FirestoreFunction implements Accumulator { constructor(value: Constant, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function max(value: Constant): Max; +export function maximum(value: Constant): Maximum; // @beta -export function max(value: string): Max; +export function maximum(value: string): Maximum; // @beta (undocumented) -export class Min extends FirestoreFunction implements Accumulator { +export class Minimum extends FirestoreFunction implements Accumulator { constructor(value: Constant, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function min(value: Constant): Min; +export function minimum(value: Constant): Minimum; // @beta -export function min(value: string): Min; +export function minimum(value: string): Minimum; // @beta (undocumented) export class Mod extends FirestoreFunction { @@ -1492,16 +1507,16 @@ export class Not extends FirestoreFunction implements FilterCondition { export function not(filter: FilterExpr): Not; // @beta -export function notInAny(element: Constant, others: Constant[]): Not; +export function notEqAny(element: Constant, others: Constant[]): FirestoreFunction; // @beta -export function notInAny(element: Constant, others: any[]): Not; +export function notEqAny(element: Constant, others: any[]): FirestoreFunction; // @beta -export function notInAny(element: string, others: Constant[]): Not; +export function notEqAny(element: string, others: Constant[]): FirestoreFunction; // @beta -export function notInAny(element: string, others: any[]): Not; +export function notEqAny(element: string, others: any[]): FirestoreFunction; // @beta (undocumented) export class Offset implements Stage { @@ -1541,55 +1556,55 @@ export class Pipeline { /* Excluded from this release type: _db */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta aggregate(...accumulators: AccumulatorTarget[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(...groups: Array): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta execute(): Promise>>; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ genericStage(name: string, params: any[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ limit(limit: number): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ offset(offset: number): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(...selections: Array): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(...orderings: Ordering[]): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // (undocumented) sort(options: { orderings: Ordering[]; }): Pipeline; - /* Excluded from this release type: userDataWriter */ - /* Excluded from this release type: documentReferenceFactory */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta where(condition: FilterCondition & Constant): Pipeline; @@ -1619,6 +1634,11 @@ export class PipelineResult { // @beta export class PipelineSource { + /* Excluded from this release type: _db */ + /* Excluded from this release type: _userDataReader */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ + /* Excluded from this release type: __constructor */ // (undocumented) collection(collectionPath: string): Pipeline; // (undocumented) @@ -1627,7 +1647,7 @@ export class PipelineSource { database(): Pipeline; // (undocumented) documents(docs: DocumentReference[]): Pipeline; - } +} // @public export type Primitive = string | number | boolean | undefined | null; @@ -2120,8 +2140,8 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; -// @public -export function useFirestorePipelines(): void; +// @public (undocumented) +export function useFluentPipelines(): void; // @public export function vector(values?: number[]): VectorValue; @@ -2188,8 +2208,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9177:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9178:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9207:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9248:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9249:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9278:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 212d93972b2..4b1e3bcc0b2 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -300,6 +300,16 @@ export class CollectionSource implements Stage { name: string; } +// @beta (undocumented) +export class Cond extends FirestoreFunction implements FilterCondition { + constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); + // (undocumented) + filterable: true; + } + +// @beta +export function cond(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): Cond; + // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { mockUserToken?: EmulatorMockTokenOptions | string; @@ -338,6 +348,9 @@ export class Constant { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -349,30 +362,30 @@ export class Constant { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): NotEqAny; + // (undocumented) + notEqAny(...others: any[]): NotEqAny; static of(value: number): Constant; static of(value: string): Constant; static of(value: boolean): Constant; @@ -659,6 +672,25 @@ export function eq(left: string, right: Constant): Eq; // @beta export function eq(left: string, right: any): Eq; +// @beta (undocumented) +export class EqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, others: Constant[]); + // (undocumented) + filterable: true; + } + +// @beta +export function eqAny(element: Constant, others: Constant[]): EqAny; + +// @beta +export function eqAny(element: Constant, others: any[]): EqAny; + +// @beta +export function eqAny(element: string, others: Constant[]): EqAny; + +// @beta +export function eqAny(element: string, others: any[]): EqAny; + // @beta (undocumented) export class EuclideanDistance extends FirestoreFunction { constructor(vector1: Constant, vector2: Constant); @@ -682,8 +714,10 @@ export function euclideanDistance(expr: Constant, other: VectorValue): Euclidean // @beta export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; -// @beta -export function execute(pipeline: Pipeline): Promise>>; +// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta +// +// @public (undocumented) +export function execute(pipeline: Pipeline): Promise>>; // @beta (undocumented) export class Exists extends FirestoreFunction implements FilterCondition { @@ -742,6 +776,9 @@ export class ExprWithAlias implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -755,30 +792,30 @@ export class ExprWithAlias implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): NotEqAny; + // (undocumented) + notEqAny(...others: any[]): NotEqAny; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; regexMatch(pattern: string): RegexMatch; @@ -847,6 +884,9 @@ export class Field implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -860,30 +900,30 @@ export class Field implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): NotEqAny; + // (undocumented) + notEqAny(...others: any[]): NotEqAny; static of(name: string): Field; // (undocumented) static of(path: FieldPath): Field; @@ -963,6 +1003,9 @@ export class Fields implements Selectable { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -976,30 +1019,30 @@ export class Fields implements Selectable { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): NotEqAny; + // (undocumented) + notEqAny(...others: any[]): NotEqAny; // (undocumented) static of(name: string, ...others: string[]): Fields; // (undocumented) @@ -1133,6 +1176,9 @@ export class FirestoreFunction { endsWith(suffix: Constant): EndsWith; eq(other: Constant): Eq; eq(other: any): Eq; + eqAny(...others: Constant[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; euclideanDistance(other: Constant): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; // (undocumented) @@ -1144,30 +1190,30 @@ export class FirestoreFunction { gt(other: any): Gt; gte(other: Constant): Gte; gte(other: any): Gte; - in(...others: Constant[]): In; - // (undocumented) - in(...others: any[]): In; isNaN(): IsNan; like(pattern: string): Like; // (undocumented) like(pattern: Constant): Like; - logicalMax(other: Constant): LogicalMax; - logicalMax(other: any): LogicalMax; - logicalMin(other: Constant): LogicalMin; - logicalMin(other: any): LogicalMin; + logicalMaximum(other: Constant): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; lt(other: Constant): Lt; lt(other: any): Lt; lte(other: Constant): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; - max(): Max; - min(): Min; + maximum(): Maximum; + minimum(): Minimum; mod(other: Constant): Mod; mod(other: any): Mod; multiply(other: Constant): Multiply; multiply(other: any): Multiply; neq(other: Constant): Neq; neq(other: any): Neq; + notEqAny(...others: Constant[]): NotEqAny; + // (undocumented) + notEqAny(...others: any[]): NotEqAny; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; regexMatch(pattern: string): RegexMatch; @@ -1317,35 +1363,6 @@ export function gte(left: string, right: Constant): Gte; // @beta export function gte(left: string, right: any): Gte; -// @beta (undocumented) -export class If extends FirestoreFunction implements FilterCondition { - constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); - // (undocumented) - filterable: true; - } - -// @beta -export function ifFunction(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): If; - -// @beta (undocumented) -export class In extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, others: Constant[]); - // (undocumented) - filterable: true; - } - -// @beta -export function inAny(element: Constant, others: Constant[]): In; - -// @beta -export function inAny(element: Constant, others: any[]): In; - -// @beta -export function inAny(element: string, others: Constant[]): In; - -// @beta -export function inAny(element: string, others: any[]): In; - // @public export function increment(n: number): FieldValue; @@ -1444,38 +1461,38 @@ export interface LoadBundleTaskProgress { } // @beta (undocumented) -export class LogicalMax extends FirestoreFunction { +export class LogicalMaximum extends FirestoreFunction { constructor(left: Constant, right: Constant); } // @beta -export function logicalMax(left: Constant, right: Constant): LogicalMax; +export function logicalMaximum(left: Constant, right: Constant): LogicalMaximum; // @beta -export function logicalMax(left: Constant, right: any): LogicalMax; +export function logicalMaximum(left: Constant, right: any): LogicalMaximum; // @beta -export function logicalMax(left: string, right: Constant): LogicalMax; +export function logicalMaximum(left: string, right: Constant): LogicalMaximum; // @beta -export function logicalMax(left: string, right: any): LogicalMax; +export function logicalMaximum(left: string, right: any): LogicalMaximum; // @beta (undocumented) -export class LogicalMin extends FirestoreFunction { +export class LogicalMinimum extends FirestoreFunction { constructor(left: Constant, right: Constant); } // @beta -export function logicalMin(left: Constant, right: Constant): LogicalMin; +export function logicalMinimum(left: Constant, right: Constant): LogicalMinimum; // @beta -export function logicalMin(left: Constant, right: any): LogicalMin; +export function logicalMinimum(left: Constant, right: any): LogicalMinimum; // @beta -export function logicalMin(left: string, right: Constant): LogicalMin; +export function logicalMinimum(left: string, right: Constant): LogicalMinimum; // @beta -export function logicalMin(left: string, right: any): LogicalMin; +export function logicalMinimum(left: string, right: any): LogicalMinimum; export { LogLevel } @@ -1532,17 +1549,17 @@ export function mapGet(mapField: string, subField: string): MapGet; export function mapGet(mapExpr: Constant, subField: string): MapGet; // @beta (undocumented) -export class Max extends FirestoreFunction implements Accumulator { +export class Maximum extends FirestoreFunction implements Accumulator { constructor(value: Constant, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function max(value: Constant): Max; +export function maximum(value: Constant): Maximum; // @beta -export function max(value: string): Max; +export function maximum(value: string): Maximum; // @public export interface MemoryCacheSettings { @@ -1582,17 +1599,17 @@ export function memoryLruGarbageCollector(settings?: { }): MemoryLruGarbageCollector; // @beta (undocumented) -export class Min extends FirestoreFunction implements Accumulator { +export class Minimum extends FirestoreFunction implements Accumulator { constructor(value: Constant, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function min(value: Constant): Min; +export function minimum(value: Constant): Minimum; // @beta -export function min(value: string): Min; +export function minimum(value: string): Minimum; // @beta (undocumented) export class Mod extends FirestoreFunction { @@ -1665,17 +1682,24 @@ export class Not extends FirestoreFunction implements FilterCondition { // @beta export function not(filter: FilterExpr): Not; +// @beta (undocumented) +export class NotEqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Constant, others: Constant[]); + // (undocumented) + filterable: true; + } + // @beta -export function notInAny(element: Constant, others: Constant[]): Not; +export function notEqAny(element: Constant, others: Constant[]): NotEqAny; // @beta -export function notInAny(element: Constant, others: any[]): Not; +export function notEqAny(element: Constant, others: any[]): NotEqAny; // @beta -export function notInAny(element: string, others: Constant[]): Not; +export function notEqAny(element: string, others: Constant[]): NotEqAny; // @beta -export function notInAny(element: string, others: any[]): Not; +export function notEqAny(element: string, others: any[]): NotEqAny; // @beta (undocumented) export class Offset implements Stage { @@ -1817,6 +1841,7 @@ export type PersistentTabManager = PersistentSingleTabManager | PersistentMultip // @public (undocumented) export class Pipeline { /* Excluded from this release type: __constructor */ + /* Excluded from this release type: newPipeline */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(...fields: Selectable[]): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta @@ -1877,6 +1902,11 @@ export class PipelineResult { // @beta export class PipelineSource { + /* Excluded from this release type: _db */ + /* Excluded from this release type: _userDataReader */ + /* Excluded from this release type: _userDataWriter */ + /* Excluded from this release type: _documentReferenceFactory */ + /* Excluded from this release type: __constructor */ // (undocumented) collection(collectionPath: string): Pipeline; // (undocumented) @@ -1885,7 +1915,7 @@ export class PipelineSource { database(): Pipeline; // (undocumented) documents(docs: DocumentReference[]): Pipeline; - } +} // @public export type Primitive = string | number | boolean | undefined | null; @@ -2411,8 +2441,8 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; -// @public -export function useFirestorePipelines(): void; +// @public (undocumented) +export function useFluentPipelines(): void; // @public export function vector(values?: number[]): VectorValue; @@ -2482,8 +2512,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10102:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10129:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10204:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index 636eb4c6709..d001457ac50 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -31,11 +31,13 @@ export { PipelineSource } from '../src/lite-api/pipeline-source'; export { PipelineResult } from '../src/lite-api/pipeline-result'; -export { Pipeline, pipeline } from '../src/lite-api/pipeline'; +export { Pipeline } from '../src/lite-api/pipeline'; -export { useFirestorePipelines } from '../src/lite-api/database_augmentation'; - -export { execute } from '../src/lite-api/pipeline_impl'; +export { + useFluentPipelines, + pipeline, + execute +} from '../src/lite-api/pipeline_impl'; export { Stage, @@ -73,13 +75,13 @@ export { arrayContainsAny, arrayContainsAll, arrayLength, - inAny, - notInAny, + eqAny, + notEqAny, xor, - ifFunction, + cond, not, - logicalMax, - logicalMin, + logicalMaximum, + logicalMinimum, exists, isNan, reverse, @@ -99,8 +101,8 @@ export { strConcat, mapGet, countAll, - min, - max, + minimum, + maximum, cosineDistance, dotProduct, euclideanDistance, @@ -139,16 +141,16 @@ export { ArrayContainsAny, ArrayLength, ArrayElement, - In, + EqAny, IsNan, Exists, Not, And, Or, Xor, - If, - LogicalMax, - LogicalMin, + Cond, + LogicalMaximum, + LogicalMinimum, Reverse, ReplaceFirst, ReplaceAll, @@ -168,8 +170,8 @@ export { Count, Sum, Avg, - Min, - Max, + Minimum, + Maximum, CosineDistance, DotProduct, EuclideanDistance, diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 4a35ed07760..7619312d2d5 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -21,9 +21,7 @@ export { PipelineResult } from './lite-api/pipeline-result'; export { Pipeline } from './api/pipeline'; -export { useFirestorePipelines, pipeline } from './api/pipeline_impl'; - -export { execute } from './lite-api/pipeline_impl'; +export { useFluentPipelines, pipeline, execute } from './api/pipeline_impl'; export { Stage, diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index cc1fab0c86a..bf36d469552 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -135,7 +135,7 @@ export class Firestore extends LiteFirestore { */ pipeline(): PipelineSource { throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' ); } } diff --git a/packages/firestore/src/api/database_augmentation.ts b/packages/firestore/src/api/database_augmentation.ts deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/firestore/src/api/pipeline-source.ts b/packages/firestore/src/api/pipeline-source.ts index 31a2d9d69a5..3ad66cab9e9 100644 --- a/packages/firestore/src/api/pipeline-source.ts +++ b/packages/firestore/src/api/pipeline-source.ts @@ -39,61 +39,61 @@ export class PipelineSource extends LitePipelineSoure { /** * @internal * @private - * @param db - * @param userDataReader - * @param userDataWriter - * @param documentReferenceFactory + * @param _db + * @param _userDataReader + * @param _userDataWriter + * @param _documentReferenceFactory */ // eslint-disable-next-line @typescript-eslint/no-useless-constructor constructor( - db: Firestore, - userDataReader: UserDataReader, - userDataWriter: AbstractUserDataWriter, - documentReferenceFactory: (id: DocumentKey) => DocumentReference + _db: Firestore, + _userDataReader: UserDataReader, + _userDataWriter: AbstractUserDataWriter, + _documentReferenceFactory: (id: DocumentKey) => DocumentReference ) { - super(db, userDataReader, userDataWriter, documentReferenceFactory); + super(_db, _userDataReader, _userDataWriter, _documentReferenceFactory); } collection(collectionPath: string): Pipeline { - const db = cast(this.db, Firestore); + const _db = cast(this._db, Firestore); return new Pipeline( - db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + _db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new CollectionSource(collectionPath)] ); } collectionGroup(collectionId: string): Pipeline { - const db = cast(this.db, Firestore); + const _db = cast(this._db, Firestore); return new Pipeline( - db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + _db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new CollectionGroupSource(collectionId)] ); } database(): Pipeline { - const db = cast(this.db, Firestore); + const _db = cast(this._db, Firestore); return new Pipeline( - db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + _db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new DatabaseSource()] ); } documents(docs: DocumentReference[]): Pipeline { - const db = cast(this.db, Firestore); + const _db = cast(this._db, Firestore); return new Pipeline( - db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + _db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [DocumentsSource.of(docs)] ); } diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index 029e2d53eeb..de2cb16d9aa 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -58,6 +58,17 @@ export class Pipeline< ); } + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + * @param stages + * @param converter + * @protected + */ protected newPipeline( db: Firestore, userDataReader: UserDataReader, @@ -109,7 +120,7 @@ export class Pipeline< */ execute(): Promise>> { throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' ); } } diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts index 91163eff3c2..b28821dbfe2 100644 --- a/packages/firestore/src/api/pipeline_impl.ts +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -17,8 +17,9 @@ import { Pipeline } from '../api/pipeline'; import { PipelineSource } from '../api/pipeline-source'; -import { PipelineResult } from '../api_pipelines'; import { firestoreClientExecutePipeline } from '../core/firestore_client'; +import { Pipeline as LitePipeline } from '../lite-api/pipeline'; +import { PipelineResult } from '../lite-api/pipeline-result'; import { newUserDataReader } from '../lite-api/user_data_reader'; import { DocumentKey } from '../model/document_key'; import { cast } from '../util/input_validation'; @@ -68,7 +69,7 @@ export function pipeline( return result; } } -export function useFirestorePipelines(): void { +export function useFluentPipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { return pipeline(this); }; @@ -83,7 +84,7 @@ export function useFirestorePipelines(): void { } export function execute( - pipeline: Pipeline + pipeline: LitePipeline ): Promise>> { const firestore = cast(pipeline._db, Firestore); const client = ensureFirestoreConfigured(firestore); diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts index 658794098ea..bcd54dca314 100644 --- a/packages/firestore/src/api_pipelines.ts +++ b/packages/firestore/src/api_pipelines.ts @@ -20,7 +20,7 @@ export { PipelineResult } from './lite-api/pipeline-result'; export { Pipeline } from './lite-api/pipeline'; -export { useFirestorePipelines } from './api/database_augmentation'; +export { useFluentPipelines, execute, pipeline } from './api/pipeline_impl'; export { Stage, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 732d2963fcf..38c291a4710 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -211,7 +211,7 @@ export function toPipelineFilterCondition( const values = value?.arrayValue?.values?.map((val: any) => Constant.of(val) ); - return andFunction(field.exists(), field.in(...values!)); + return andFunction(field.exists(), field.eqAny(...values!)); } case Operator.ARRAY_CONTAINS_ANY: { const values = value?.arrayValue?.values?.map((val: any) => @@ -223,7 +223,7 @@ export function toPipelineFilterCondition( const values = value?.arrayValue?.values?.map((val: any) => Constant.of(val) ); - return andFunction(field.exists(), not(field.in(...values!))); + return andFunction(field.exists(), not(field.eqAny(...values!))); } default: fail('Unexpected operator'); diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 6ef01bb5172..880ede2bed8 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -42,7 +42,7 @@ import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; // `import type` to avoid bundling the source for -// pipelines if `useFirestorePipelines()` is not called +// pipelines if `useFluentPipelines()` is not called import type { PipelineSource } from './pipeline-source'; import { DEFAULT_HOST, @@ -182,7 +182,7 @@ export class Firestore implements FirestoreService { */ pipeline(): PipelineSource { throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' ); } } diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index da62a229adc..99da8fee8c6 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -37,54 +37,70 @@ export class PipelineSource { /** * @internal * @private - * @param db - * @param userDataReader - * @param userDataWriter - * @param documentReferenceFactory + * @param _db + * @param _userDataReader + * @param _userDataWriter + * @param _documentReferenceFactory */ constructor( - protected db: Firestore, - protected userDataReader: UserDataReader, - protected userDataWriter: AbstractUserDataWriter, - protected documentReferenceFactory: (id: DocumentKey) => DocumentReference + /** + * @internal + * @private + */ + public _db: Firestore, + /** + * @internal + * @private + */ + public _userDataReader: UserDataReader, + /** + * @internal + * @private + */ + public _userDataWriter: AbstractUserDataWriter, + /** + * @internal + * @private + */ + public _documentReferenceFactory: (id: DocumentKey) => DocumentReference ) {} collection(collectionPath: string): Pipeline { return new Pipeline( - this.db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new CollectionSource(collectionPath)] ); } collectionGroup(collectionId: string): Pipeline { return new Pipeline( - this.db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new CollectionGroupSource(collectionId)] ); } database(): Pipeline { return new Pipeline( - this.db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [new DatabaseSource()] ); } documents(docs: DocumentReference[]): Pipeline { return new Pipeline( - this.db, - this.userDataReader, - this.userDataWriter, - this.documentReferenceFactory, + this._db, + this._userDataReader, + this._userDataWriter, + this._documentReferenceFactory, [DocumentsSource.of(docs)] ); } diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index f835f709551..a1b9ad481e9 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -291,6 +291,17 @@ export class Pipeline return expressionMap; } + /** + * @internal + * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param documentReferenceFactory + * @param stages + * @param converter + * @protected + */ protected newPipeline( db: Firestore, userDataReader: UserDataReader, @@ -809,7 +820,7 @@ export class Pipeline */ execute(): Promise>> { throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' ); } diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index d049bbba05c..c9ebe8ac7f5 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -107,7 +107,7 @@ export function pipeline( } } -export function useFirestorePipelines(): void { +export function useFluentPipelines(): void { Firestore.prototype.pipeline = function (): PipelineSource { return pipeline(this); }; diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 71b789227fc..db0949e9fbc 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -184,7 +184,7 @@ export class Query< */ pipeline(): Pipeline { throw new Error( - 'Pipelines not initialized. Your application must call `useFirestorePipelines()` before using Firestore Pipeline features.' + 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' ); } } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 22fb5a1cdfb..6d499a2a4df 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -55,7 +55,7 @@ import { setDoc, startsWith, subtract, - useFirestorePipelines, + useFluentPipelines, setLogLevel, cond, eqAny, @@ -267,7 +267,7 @@ apiDescribe.only('Pipelines', persistence => { describe('fluent API', () => { before(() => { - useFirestorePipelines(); + useFluentPipelines(); }); it('empty results as expected', async () => { From 1294e64c813b6dbfb64f8dc24d90ec69a66f71ae Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 4 Dec 2024 09:26:18 -0800 Subject: [PATCH 047/295] Wait for service worker registration to become active before any operations (#8661) --- .changeset/neat-beans-rescue.md | 5 ++ .../src/helpers/registerDefaultSw.ts | 48 ++++++++++++++++++- packages/messaging/src/util/constants.ts | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .changeset/neat-beans-rescue.md diff --git a/.changeset/neat-beans-rescue.md b/.changeset/neat-beans-rescue.md new file mode 100644 index 00000000000..278e5511da0 --- /dev/null +++ b/.changeset/neat-beans-rescue.md @@ -0,0 +1,5 @@ +--- +'@firebase/messaging': patch +--- + +Fix an issue where PushManager.subscribe() is called too soon after registering the default service worker. diff --git a/packages/messaging/src/helpers/registerDefaultSw.ts b/packages/messaging/src/helpers/registerDefaultSw.ts index 239e6ed8244..28890c93bd2 100644 --- a/packages/messaging/src/helpers/registerDefaultSw.ts +++ b/packages/messaging/src/helpers/registerDefaultSw.ts @@ -15,7 +15,11 @@ * limitations under the License. */ -import { DEFAULT_SW_PATH, DEFAULT_SW_SCOPE } from '../util/constants'; +import { + DEFAULT_REGISTRATION_TIMEOUT, + DEFAULT_SW_PATH, + DEFAULT_SW_SCOPE +} from '../util/constants'; import { ERROR_FACTORY, ErrorCode } from '../util/errors'; import { MessagingService } from '../messaging-service'; @@ -39,9 +43,51 @@ export async function registerDefaultSw( messaging.swRegistration.update().catch(() => { /* it is non blocking and we don't care if it failed */ }); + await waitForRegistrationActive(messaging.swRegistration); } catch (e) { throw ERROR_FACTORY.create(ErrorCode.FAILED_DEFAULT_REGISTRATION, { browserErrorMessage: (e as Error)?.message }); } } + +/** + * Waits for registration to become active. MDN documentation claims that + * a service worker registration should be ready to use after awaiting + * navigator.serviceWorker.register() but that doesn't seem to be the case in + * practice, causing the SDK to throw errors when calling + * swRegistration.pushManager.subscribe() too soon after register(). The only + * solution seems to be waiting for the service worker registration `state` + * to become "active". + */ +async function waitForRegistrationActive( + registration: ServiceWorkerRegistration +): Promise { + return new Promise((resolve, reject) => { + const rejectTimeout = setTimeout( + () => + reject( + new Error( + `Service worker not registered after ${DEFAULT_REGISTRATION_TIMEOUT} ms` + ) + ), + DEFAULT_REGISTRATION_TIMEOUT + ); + const incomingSw = registration.installing || registration.waiting; + if (registration.active) { + clearTimeout(rejectTimeout); + resolve(); + } else if (incomingSw) { + incomingSw.onstatechange = ev => { + if ((ev.target as ServiceWorker)?.state === 'activated') { + incomingSw.onstatechange = null; + clearTimeout(rejectTimeout); + resolve(); + } + }; + } else { + clearTimeout(rejectTimeout); + reject(new Error('No incoming service worker found.')); + } + }); +} diff --git a/packages/messaging/src/util/constants.ts b/packages/messaging/src/util/constants.ts index 8491380a5a0..e06c8cfaa34 100644 --- a/packages/messaging/src/util/constants.ts +++ b/packages/messaging/src/util/constants.ts @@ -36,6 +36,7 @@ export const MAX_NUMBER_OF_EVENTS_PER_LOG_REQUEST = 1000; export const MAX_RETRIES = 3; export const LOG_INTERVAL_IN_MS = 86400000; //24 hour export const DEFAULT_BACKOFF_TIME_MS = 5000; +export const DEFAULT_REGISTRATION_TIMEOUT = 10000; // FCM log source name registered at Firelog: 'FCM_CLIENT_EVENT_LOGGING'. It uniquely identifies // FCM's logging configuration. From c540ba9eedd189ec8ac0932124d2cc400d1bd1d6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 4 Dec 2024 12:38:08 -0500 Subject: [PATCH 048/295] Clear fetch abort timeout (#8663) * Clear fetch abort timeout * Add timeout constant and bring back minimum timeout value --- .changeset/four-baboons-behave.md | 5 ++++ packages/vertexai/src/constants.ts | 2 ++ packages/vertexai/src/requests/request.ts | 34 ++++++++++------------- 3 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 .changeset/four-baboons-behave.md diff --git a/.changeset/four-baboons-behave.md b/.changeset/four-baboons-behave.md new file mode 100644 index 00000000000..63c51a44c7e --- /dev/null +++ b/.changeset/four-baboons-behave.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Clear fetch timeout after request completion. Fixes an issue that caused Node scripts to hang due to a pending timeout. diff --git a/packages/vertexai/src/constants.ts b/packages/vertexai/src/constants.ts index 3ff894f354b..357e6c4e77c 100644 --- a/packages/vertexai/src/constants.ts +++ b/packages/vertexai/src/constants.ts @@ -28,3 +28,5 @@ export const DEFAULT_API_VERSION = 'v1beta'; export const PACKAGE_VERSION = version; export const LANGUAGE_TAG = 'gl-js'; + +export const DEFAULT_FETCH_TIMEOUT_MS = 180 * 1000; diff --git a/packages/vertexai/src/requests/request.ts b/packages/vertexai/src/requests/request.ts index 411bad859f0..f81b40635e3 100644 --- a/packages/vertexai/src/requests/request.ts +++ b/packages/vertexai/src/requests/request.ts @@ -21,6 +21,7 @@ import { ApiSettings } from '../types/internal'; import { DEFAULT_API_VERSION, DEFAULT_BASE_URL, + DEFAULT_FETCH_TIMEOUT_MS, LANGUAGE_TAG, PACKAGE_VERSION } from '../constants'; @@ -116,7 +117,6 @@ export async function constructRequest( return { url: url.toString(), fetchOptions: { - ...buildFetchOptions(requestOptions), method: 'POST', headers: await getHeaders(url), body @@ -134,6 +134,7 @@ export async function makeRequest( ): Promise { const url = new RequestUrl(model, task, apiSettings, stream, requestOptions); let response; + let fetchTimeoutId: string | number | NodeJS.Timeout | undefined; try { const request = await constructRequest( model, @@ -143,6 +144,15 @@ export async function makeRequest( body, requestOptions ); + // Timeout is 180s by default + const timeoutMillis = + requestOptions?.timeout != null && requestOptions.timeout >= 0 + ? requestOptions.timeout + : DEFAULT_FETCH_TIMEOUT_MS; + const abortController = new AbortController(); + fetchTimeoutId = setTimeout(() => abortController.abort(), timeoutMillis); + request.fetchOptions.signal = abortController.signal; + response = await fetch(request.url, request.fetchOptions); if (!response.ok) { let message = ''; @@ -211,24 +221,10 @@ export async function makeRequest( } throw err; + } finally { + if (fetchTimeoutId) { + clearTimeout(fetchTimeoutId); + } } return response; } - -/** - * Generates the request options to be passed to the fetch API. - * @param requestOptions - The user-defined request options. - * @returns The generated request options. - */ -function buildFetchOptions(requestOptions?: RequestOptions): RequestInit { - const fetchOptions = {} as RequestInit; - let timeoutMillis = 180 * 1000; // default: 180 s - if (requestOptions?.timeout && requestOptions?.timeout >= 0) { - timeoutMillis = requestOptions.timeout; - } - const abortController = new AbortController(); - const signal = abortController.signal; - setTimeout(() => abortController.abort(), timeoutMillis); - fetchOptions.signal = signal; - return fetchOptions; -} From f05509e8c526ce44656389ab9997a6e5ee957a3d Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 4 Dec 2024 09:48:50 -0800 Subject: [PATCH 049/295] Support streaming streaming responses for callable functions. (#8609) The new .stream() API allows the client to consume streaming responses from the WIP streaming callable functions in Firebase Functions Node.js SDK. When client makes a request to the callable function w/ header Accept: text/event-stream, the callable function responds with response chunks in Server-Sent Event format. The sdk changes here abstracts over the wire-protocol by parsing the response chunks and returning an instance of a AsyncIterable to consume to data: import { getFunctions, httpsCallable } from "firebase/functions"; const functions = getFunctions(); const generateText = httpsCallable(functions, 'generateText'); const resp = await generateText.stream( { text: 'What is your favorite Firebase service and why?' }, { signal: AbortSignal.timeout(60_000) }, ); try { for await (const message of resp.stream) { console.log(message); // prints "foo", "bar" } console.log(await resp.data) // prints "foo bar" } catch (e) { // FirebaseError(code='cancelled', message='Request was cancelled.'); console.error(e) } --- .changeset/bright-scissors-care.md | 6 + common/api-review/functions.api.md | 25 +- config/.gitignore | 1 + docs-devsite/_toc.yaml | 6 + docs-devsite/functions.httpscallable.md | 33 ++ .../functions.httpscallableoptions.md | 4 +- .../functions.httpscallablestreamoptions.md | 46 ++ .../functions.httpscallablestreamresult.md | 42 ++ docs-devsite/functions.md | 22 +- packages/functions/package.json | 2 +- packages/functions/src/api.ts | 17 +- packages/functions/src/callable.test.ts | 393 +++++++++++++++++- packages/functions/src/public-types.ts | 48 ++- packages/functions/src/service.ts | 334 +++++++++++++-- 14 files changed, 918 insertions(+), 61 deletions(-) create mode 100644 .changeset/bright-scissors-care.md create mode 100644 config/.gitignore create mode 100644 docs-devsite/functions.httpscallable.md create mode 100644 docs-devsite/functions.httpscallablestreamoptions.md create mode 100644 docs-devsite/functions.httpscallablestreamresult.md diff --git a/.changeset/bright-scissors-care.md b/.changeset/bright-scissors-care.md new file mode 100644 index 00000000000..b97b22b7248 --- /dev/null +++ b/.changeset/bright-scissors-care.md @@ -0,0 +1,6 @@ +--- +'@firebase/functions': minor +'firebase': minor +--- + +Add `.stream()` api for callable functions for consuming streaming responses. diff --git a/common/api-review/functions.api.md b/common/api-review/functions.api.md index 6133e017f67..883bde3bc0d 100644 --- a/common/api-review/functions.api.md +++ b/common/api-review/functions.api.md @@ -35,13 +35,18 @@ export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-a export function getFunctions(app?: FirebaseApp, regionOrCustomDomain?: string): Functions; // @public -export type HttpsCallable = (data?: RequestData | null) => Promise>; +export interface HttpsCallable { + // (undocumented) + (data?: RequestData | null): Promise>; + // (undocumented) + stream: (data?: RequestData | null, options?: HttpsCallableStreamOptions) => Promise>; +} // @public -export function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable; +export function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable; // @public -export function httpsCallableFromURL(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable; +export function httpsCallableFromURL(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable; // @public export interface HttpsCallableOptions { @@ -54,5 +59,19 @@ export interface HttpsCallableResult { readonly data: ResponseData; } +// @public +export interface HttpsCallableStreamOptions { + limitedUseAppCheckTokens?: boolean; + signal?: AbortSignal; +} + +// @public +export interface HttpsCallableStreamResult { + // (undocumented) + readonly data: Promise; + // (undocumented) + readonly stream: AsyncIterable; +} + ``` diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 00000000000..54b6cccf34d --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +# Uncomment this if you'd like others to create their own Firebase project. diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index a27f2832eb7..9d60c12906c 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -375,10 +375,16 @@ toc: path: /docs/reference/js/functions.functions.md - title: FunctionsError path: /docs/reference/js/functions.functionserror.md + - title: HttpsCallable + path: /docs/reference/js/functions.httpscallable.md - title: HttpsCallableOptions path: /docs/reference/js/functions.httpscallableoptions.md - title: HttpsCallableResult path: /docs/reference/js/functions.httpscallableresult.md + - title: HttpsCallableStreamOptions + path: /docs/reference/js/functions.httpscallablestreamoptions.md + - title: HttpsCallableStreamResult + path: /docs/reference/js/functions.httpscallablestreamresult.md - title: installations path: /docs/reference/js/installations.md section: diff --git a/docs-devsite/functions.httpscallable.md b/docs-devsite/functions.httpscallable.md new file mode 100644 index 00000000000..3b9d70f3a05 --- /dev/null +++ b/docs-devsite/functions.httpscallable.md @@ -0,0 +1,33 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# HttpsCallable interface +A reference to a "callable" HTTP trigger in Cloud Functions. + +Signature: + +```typescript +export interface HttpsCallable +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [stream](./functions.httpscallable.md#httpscallablestream) | (data?: RequestData \| null, options?: [HttpsCallableStreamOptions](./functions.httpscallablestreamoptions.md#httpscallablestreamoptions_interface)) => Promise<[HttpsCallableStreamResult](./functions.httpscallablestreamresult.md#httpscallablestreamresult_interface)<ResponseData, StreamData>> | | + +## HttpsCallable.stream + +Signature: + +```typescript +stream: (data?: RequestData | null, options?: HttpsCallableStreamOptions) => Promise>; +``` diff --git a/docs-devsite/functions.httpscallableoptions.md b/docs-devsite/functions.httpscallableoptions.md index b4a261918ce..22933a2f1f0 100644 --- a/docs-devsite/functions.httpscallableoptions.md +++ b/docs-devsite/functions.httpscallableoptions.md @@ -22,12 +22,12 @@ export interface HttpsCallableOptions | Property | Type | Description | | --- | --- | --- | -| [limitedUseAppCheckTokens](./functions.httpscallableoptions.md#httpscallableoptionslimiteduseappchecktokens) | boolean | If set to true, uses limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. | +| [limitedUseAppCheckTokens](./functions.httpscallableoptions.md#httpscallableoptionslimiteduseappchecktokens) | boolean | If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. | | [timeout](./functions.httpscallableoptions.md#httpscallableoptionstimeout) | number | Time in milliseconds after which to cancel if there is no response. Default is 70000. | ## HttpsCallableOptions.limitedUseAppCheckTokens -If set to true, uses limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. +If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. Signature: diff --git a/docs-devsite/functions.httpscallablestreamoptions.md b/docs-devsite/functions.httpscallablestreamoptions.md new file mode 100644 index 00000000000..6c790c7e0f9 --- /dev/null +++ b/docs-devsite/functions.httpscallablestreamoptions.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# HttpsCallableStreamOptions interface +An interface for metadata about how a stream call should be executed. + +Signature: + +```typescript +export interface HttpsCallableStreamOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [limitedUseAppCheckTokens](./functions.httpscallablestreamoptions.md#httpscallablestreamoptionslimiteduseappchecktokens) | boolean | If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. | +| [signal](./functions.httpscallablestreamoptions.md#httpscallablestreamoptionssignal) | AbortSignal | An AbortSignal that can be used to cancel the streaming response. When the signal is aborted, the underlying HTTP connection will be terminated. | + +## HttpsCallableStreamOptions.limitedUseAppCheckTokens + +If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface). You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. + +Signature: + +```typescript +limitedUseAppCheckTokens?: boolean; +``` + +## HttpsCallableStreamOptions.signal + +An `AbortSignal` that can be used to cancel the streaming response. When the signal is aborted, the underlying HTTP connection will be terminated. + +Signature: + +```typescript +signal?: AbortSignal; +``` diff --git a/docs-devsite/functions.httpscallablestreamresult.md b/docs-devsite/functions.httpscallablestreamresult.md new file mode 100644 index 00000000000..ba0d852041b --- /dev/null +++ b/docs-devsite/functions.httpscallablestreamresult.md @@ -0,0 +1,42 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# HttpsCallableStreamResult interface +An `HttpsCallableStreamResult` wraps a single streaming result from a function call. + +Signature: + +```typescript +export interface HttpsCallableStreamResult +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [data](./functions.httpscallablestreamresult.md#httpscallablestreamresultdata) | Promise<ResponseData> | | +| [stream](./functions.httpscallablestreamresult.md#httpscallablestreamresultstream) | AsyncIterable<StreamData> | | + +## HttpsCallableStreamResult.data + +Signature: + +```typescript +readonly data: Promise; +``` + +## HttpsCallableStreamResult.stream + +Signature: + +```typescript +readonly stream: AsyncIterable; +``` diff --git a/docs-devsite/functions.md b/docs-devsite/functions.md index 4887fcd4911..7e2eefa1569 100644 --- a/docs-devsite/functions.md +++ b/docs-devsite/functions.md @@ -34,8 +34,11 @@ Cloud Functions for Firebase | Interface | Description | | --- | --- | | [Functions](./functions.functions.md#functions_interface) | A Functions instance. | +| [HttpsCallable](./functions.httpscallable.md#httpscallable_interface) | A reference to a "callable" HTTP trigger in Cloud Functions. | | [HttpsCallableOptions](./functions.httpscallableoptions.md#httpscallableoptions_interface) | An interface for metadata about how calls should be executed. | | [HttpsCallableResult](./functions.httpscallableresult.md#httpscallableresult_interface) | An HttpsCallableResult wraps a single result from a function call. | +| [HttpsCallableStreamOptions](./functions.httpscallablestreamoptions.md#httpscallablestreamoptions_interface) | An interface for metadata about how a stream call should be executed. | +| [HttpsCallableStreamResult](./functions.httpscallablestreamresult.md#httpscallablestreamresult_interface) | An HttpsCallableStreamResult wraps a single streaming result from a function call. | ## Type Aliases @@ -43,7 +46,6 @@ Cloud Functions for Firebase | --- | --- | | [FunctionsErrorCode](./functions.md#functionserrorcode) | The set of Firebase Functions status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.mdPossible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. | | [FunctionsErrorCodeCore](./functions.md#functionserrorcodecore) | Functions error code string appended after "functions/" product prefix. See [FunctionsErrorCode](./functions.md#functionserrorcode) for full documentation of codes. | -| [HttpsCallable](./functions.md#httpscallable) | A reference to a "callable" HTTP trigger in Google Cloud Functions. | ## function(app, ...) @@ -101,7 +103,7 @@ Returns a reference to the callable HTTPS trigger with the given name. Signature: ```typescript -export declare function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable; +export declare function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable; ``` #### Parameters @@ -114,7 +116,7 @@ export declare function httpsCallableReturns: -[HttpsCallable](./functions.md#httpscallable)<RequestData, ResponseData> +[HttpsCallable](./functions.httpscallable.md#httpscallable_interface)<RequestData, ResponseData, StreamData> ### httpsCallableFromURL(functionsInstance, url, options) {:#httpscallablefromurl_7af6987} @@ -123,7 +125,7 @@ Returns a reference to the callable HTTPS trigger with the specified url. Signature: ```typescript -export declare function httpsCallableFromURL(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable; +export declare function httpsCallableFromURL(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable; ``` #### Parameters @@ -136,7 +138,7 @@ export declare function httpsCallableFromURLReturns: -[HttpsCallable](./functions.md#httpscallable)<RequestData, ResponseData> +[HttpsCallable](./functions.httpscallable.md#httpscallable_interface)<RequestData, ResponseData, StreamData> ## FunctionsErrorCode @@ -159,13 +161,3 @@ Functions error code string appended after "functions/" product prefix. See [Fun ```typescript export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; ``` - -## HttpsCallable - -A reference to a "callable" HTTP trigger in Google Cloud Functions. - -Signature: - -```typescript -export type HttpsCallable = (data?: RequestData | null) => Promise>; -``` diff --git a/packages/functions/package.json b/packages/functions/package.json index 62ab7ff0000..cc53d9120fb 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -37,7 +37,7 @@ "test:browser": "karma start", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.ts --config ../../config/mocharc.node.js", - "test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p --npm-path npm test:node", + "test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://127.0.0.1:5005 run-p --npm-path npm test:node", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report": "api-extractor run --local --verbose", "doc": "api-documenter markdown --input temp --output docs", diff --git a/packages/functions/src/api.ts b/packages/functions/src/api.ts index a7804c2f573..7f92cba8343 100644 --- a/packages/functions/src/api.ts +++ b/packages/functions/src/api.ts @@ -88,12 +88,16 @@ export function connectFunctionsEmulator( * @param name - The name of the trigger. * @public */ -export function httpsCallable( +export function httpsCallable< + RequestData = unknown, + ResponseData = unknown, + StreamData = unknown +>( functionsInstance: Functions, name: string, options?: HttpsCallableOptions -): HttpsCallable { - return _httpsCallable( +): HttpsCallable { + return _httpsCallable( getModularInstance(functionsInstance as FunctionsService), name, options @@ -107,13 +111,14 @@ export function httpsCallable( */ export function httpsCallableFromURL< RequestData = unknown, - ResponseData = unknown + ResponseData = unknown, + StreamData = unknown >( functionsInstance: Functions, url: string, options?: HttpsCallableOptions -): HttpsCallable { - return _httpsCallableFromURL( +): HttpsCallable { + return _httpsCallableFromURL( getModularInstance(functionsInstance as FunctionsService), url, options diff --git a/packages/functions/src/callable.test.ts b/packages/functions/src/callable.test.ts index 439e7d4f154..b969304c89e 100644 --- a/packages/functions/src/callable.test.ts +++ b/packages/functions/src/callable.test.ts @@ -37,7 +37,7 @@ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { makeFakeApp, createTestService } from '../test/utils'; -import { httpsCallable } from './service'; +import { FunctionsService, httpsCallable } from './service'; import { FUNCTIONS_TYPE } from './constants'; import { FunctionsError } from './error'; @@ -299,3 +299,394 @@ describe('Firebase Functions > Call', () => { await expectError(func(), 'deadline-exceeded', 'deadline-exceeded'); }); }); + +describe('Firebase Functions > Stream', () => { + let app: FirebaseApp; + let functions: FunctionsService; + let mockFetch: sinon.SinonStub; + const region = 'us-central1'; + + beforeEach(() => { + const useEmulator = !!process.env.FIREBASE_FUNCTIONS_EMULATOR_ORIGIN; + const projectId = useEmulator + ? 'functions-integration-test' + : TEST_PROJECT.projectId; + const messagingSenderId = 'messaging-sender-id'; + app = makeFakeApp({ projectId, messagingSenderId }); + functions = createTestService(app, region); + mockFetch = sinon.stub(functions, 'fetchImpl' as any); + }); + + afterEach(() => { + mockFetch.restore(); + }); + + it('successfully streams data and resolves final result', async () => { + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode('data: {"message":"Hello"}\n') + ); + controller.enqueue( + new TextEncoder().encode('data: {"message":"World"}\n') + ); + controller.enqueue( + new TextEncoder().encode('data: {"result":"Final Result"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamResult = await func.stream({}); + + const messages: string[] = []; + for await (const message of streamResult.stream) { + messages.push(message); + } + + expect(messages).to.deep.equal(['Hello', 'World']); + expect(await streamResult.data).to.equal('Final Result'); + }); + + it('successfully process request chunk with multiple events', async () => { + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode( + 'data: {"message":"Hello"}\n\ndata: {"message":"World"}\n' + ) + ); + controller.enqueue( + new TextEncoder().encode('data: {"result":"Final Result"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamResult = await func.stream({}); + + const messages: string[] = []; + for await (const message of streamResult.stream) { + messages.push(message); + } + + expect(messages).to.deep.equal(['Hello', 'World']); + expect(await streamResult.data).to.equal('Final Result'); + }); + + it('handles network errors', async () => { + mockFetch.rejects(new Error('Network error')); + + const func = httpsCallable, string, string>( + functions, + 'errTest' + ); + const streamResult = await func.stream({}); + + let errorThrown = false; + try { + for await (const _ of streamResult.stream) { + // This should not execute + } + } catch (error: unknown) { + errorThrown = true; + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/internal` + ); + } + expect(errorThrown).to.be.true; + await expectError(streamResult.data, 'internal', 'internal'); + }); + + it('handles server-side errors', async () => { + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode( + 'data: {"error":{"status":"INVALID_ARGUMENT","message":"Invalid input"}}\n' + ) + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'stream' + ); + const streamResult = await func.stream({}); + + let errorThrown = false; + try { + for await (const _ of streamResult.stream) { + // This should not execute + } + } catch (error) { + errorThrown = true; + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/invalid-argument` + ); + expect((error as FunctionsError).message).to.equal('Invalid input'); + } + + expect(errorThrown).to.be.true; + await expectError(streamResult.data, 'invalid-argument', 'Invalid input'); + }); + + it('includes authentication and app check tokens in request headers', async () => { + const authMock: FirebaseAuthInternal = { + getToken: async () => ({ accessToken: 'auth-token' }) + } as unknown as FirebaseAuthInternal; + const authProvider = new Provider( + 'auth-internal', + new ComponentContainer('test') + ); + authProvider.setComponent( + new Component('auth-internal', () => authMock, ComponentType.PRIVATE) + ); + const appCheckMock: FirebaseAppCheckInternal = { + getToken: async () => ({ token: 'app-check-token' }) + } as unknown as FirebaseAppCheckInternal; + const appCheckProvider = new Provider( + 'app-check-internal', + new ComponentContainer('test') + ); + appCheckProvider.setComponent( + new Component( + 'app-check-internal', + () => appCheckMock, + ComponentType.PRIVATE + ) + ); + + const functions = createTestService( + app, + region, + authProvider, + undefined, + appCheckProvider + ); + const mockFetch = sinon.stub(functions, 'fetchImpl' as any); + + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode('data: {"result":"Success"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'stream' + ); + await func.stream({}); + + expect(mockFetch.calledOnce).to.be.true; + const [_, options] = mockFetch.firstCall.args; + expect(options.headers['Authorization']).to.equal('Bearer auth-token'); + expect(options.headers['Content-Type']).to.equal('application/json'); + expect(options.headers['Accept']).to.equal('text/event-stream'); + }); + + it('aborts during initial fetch', async () => { + const controller = new AbortController(); + + // Create a fetch that rejects when aborted + const fetchPromise = new Promise((_, reject) => { + controller.signal.addEventListener('abort', () => { + const error = new Error('The operation was aborted'); + error.name = 'AbortError'; + reject(error); + }); + }); + mockFetch.returns(fetchPromise); + + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamPromise = func.stream({}, { signal: controller.signal }); + + controller.abort(); + + const streamResult = await streamPromise; + + // Verify fetch was called with abort signal + expect(mockFetch.calledOnce).to.be.true; + const [_, options] = mockFetch.firstCall.args; + expect(options.signal).to.equal(controller.signal); + + // Verify stream iteration throws AbortError + let errorThrown = false; + try { + for await (const _ of streamResult.stream) { + // Should not execute + } + } catch (error) { + errorThrown = true; + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/cancelled` + ); + } + expect(errorThrown).to.be.true; + await expectError(streamResult.data, 'cancelled', 'Request was cancelled.'); + }); + + it('aborts during streaming', async () => { + const controller = new AbortController(); + + const mockResponse = new ReadableStream({ + async start(controller) { + controller.enqueue( + new TextEncoder().encode('data: {"message":"First"}\n') + ); + // Add delay to simulate network latency + await new Promise(resolve => setTimeout(resolve, 50)); + controller.enqueue( + new TextEncoder().encode('data: {"message":"Second"}\n') + ); + await new Promise(resolve => setTimeout(resolve, 50)); + controller.enqueue( + new TextEncoder().encode('data: {"result":"Final"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamResult = await func.stream({}, { signal: controller.signal }); + + const messages: string[] = []; + try { + for await (const message of streamResult.stream) { + messages.push(message); + if (messages.length === 1) { + // Abort after receiving first message + controller.abort(); + } + } + throw new Error('Stream should have been aborted'); + } catch (error) { + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/cancelled` + ); + } + expect(messages).to.deep.equal(['First']); + await expectError(streamResult.data, 'cancelled', 'Request was cancelled.'); + }); + + it('fails immediately with pre-aborted signal', async () => { + mockFetch.callsFake((url: string, options: RequestInit) => { + if (options.signal?.aborted) { + const error = new Error('The operation was aborted'); + error.name = 'AbortError'; + return Promise.reject(error); + } + return Promise.resolve(new Response()); + }); + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamResult = await func.stream({}, { signal: AbortSignal.abort() }); + + let errorThrown = false; + try { + for await (const _ of streamResult.stream) { + // Should not execute + } + } catch (error) { + errorThrown = true; + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/cancelled` + ); + } + expect(errorThrown).to.be.true; + await expectError(streamResult.data, 'cancelled', 'Request was cancelled.'); + }); + + it('properly handles AbortSignal.timeout()', async () => { + const timeoutMs = 50; + const signal = AbortSignal.timeout(timeoutMs); + + mockFetch.callsFake(async (url: string, options: RequestInit) => { + await new Promise((resolve, reject) => { + options.signal?.addEventListener('abort', () => { + const error = new Error('The operation was aborted'); + error.name = 'AbortError'; + reject(error); + }); + setTimeout(resolve, timeoutMs * 3); + }); + + // If we get here, timeout didn't occur + return new Response(); + }); + + const func = httpsCallable, string, string>( + functions, + 'streamTest' + ); + const streamResult = await func.stream({}, { signal }); + + try { + for await (const _ of streamResult.stream) { + // Should not execute + } + throw new Error('Stream should have timed out'); + } catch (error) { + expect((error as FunctionsError).code).to.equal( + `${FUNCTIONS_TYPE}/cancelled` + ); + } + await expectError(streamResult.data, 'cancelled', 'Request was cancelled.'); + }); +}); diff --git a/packages/functions/src/public-types.ts b/packages/functions/src/public-types.ts index 311493d5fda..50b2d9a9e0c 100644 --- a/packages/functions/src/public-types.ts +++ b/packages/functions/src/public-types.ts @@ -28,13 +28,33 @@ export interface HttpsCallableResult { } /** - * A reference to a "callable" HTTP trigger in Google Cloud Functions. + * An `HttpsCallableStreamResult` wraps a single streaming result from a function call. + * @public + */ +export interface HttpsCallableStreamResult< + ResponseData = unknown, + StreamData = unknown +> { + readonly data: Promise; + readonly stream: AsyncIterable; +} + +/** + * A reference to a "callable" HTTP trigger in Cloud Functions. * @param data - Data to be passed to callable function. * @public */ -export type HttpsCallable = ( - data?: RequestData | null -) => Promise>; +export interface HttpsCallable< + RequestData = unknown, + ResponseData = unknown, + StreamData = unknown +> { + (data?: RequestData | null): Promise>; + stream: ( + data?: RequestData | null, + options?: HttpsCallableStreamOptions + ) => Promise>; +} /** * An interface for metadata about how calls should be executed. @@ -47,7 +67,25 @@ export interface HttpsCallableOptions { */ timeout?: number; /** - * If set to true, uses limited-use App Check token for callable function requests from this + * If set to true, uses a limited-use App Check token for callable function requests from this + * instance of {@link Functions}. You must use limited-use tokens to call functions with + * replay protection enabled. By default, this is false. + */ + limitedUseAppCheckTokens?: boolean; +} + +/** + * An interface for metadata about how a stream call should be executed. + * @public + */ +export interface HttpsCallableStreamOptions { + /** + * An `AbortSignal` that can be used to cancel the streaming response. When the signal is aborted, + * the underlying HTTP connection will be terminated. + */ + signal?: AbortSignal; + /** + * If set to true, uses a limited-use App Check token for callable function requests from this * instance of {@link Functions}. You must use limited-use tokens to call functions with * replay protection enabled. By default, this is false. */ diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index 986dcbc735d..ec459472b5a 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -19,7 +19,9 @@ import { FirebaseApp, _FirebaseService } from '@firebase/app'; import { HttpsCallable, HttpsCallableResult, - HttpsCallableOptions + HttpsCallableStreamResult, + HttpsCallableOptions, + HttpsCallableStreamOptions } from './public-types'; import { _errorForResponse, FunctionsError } from './error'; import { ContextProvider } from './context'; @@ -31,6 +33,8 @@ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types export const DEFAULT_REGION = 'us-central1'; +const responseLineRE = /^data: (.*?)(?:\n|$)/; + /** * The response to an http request. */ @@ -104,7 +108,8 @@ export class FunctionsService implements _FirebaseService { authProvider: Provider, messagingProvider: Provider, appCheckProvider: Provider, - regionOrCustomDomain: string = DEFAULT_REGION + regionOrCustomDomain: string = DEFAULT_REGION, + readonly fetchImpl: typeof fetch = (...args) => fetch(...args) ) { this.contextProvider = new ContextProvider( authProvider, @@ -176,14 +181,25 @@ export function connectFunctionsEmulator( * @param name - The name of the trigger. * @public */ -export function httpsCallable( +export function httpsCallable( functionsInstance: FunctionsService, name: string, options?: HttpsCallableOptions -): HttpsCallable { - return (data => { +): HttpsCallable { + const callable = ( + data?: RequestData | null + ): Promise => { return call(functionsInstance, name, data, options || {}); - }) as HttpsCallable; + }; + + callable.stream = ( + data?: RequestData | null, + options?: HttpsCallableStreamOptions + ) => { + return stream(functionsInstance, name, data, options); + }; + + return callable as HttpsCallable; } /** @@ -191,14 +207,28 @@ export function httpsCallable( * @param url - The url of the trigger. * @public */ -export function httpsCallableFromURL( +export function httpsCallableFromURL< + RequestData, + ResponseData, + StreamData = unknown +>( functionsInstance: FunctionsService, url: string, options?: HttpsCallableOptions -): HttpsCallable { - return (data => { +): HttpsCallable { + const callable = ( + data?: RequestData | null + ): Promise => { return callAtURL(functionsInstance, url, data, options || {}); - }) as HttpsCallable; + }; + + callable.stream = ( + data?: RequestData | null, + options?: HttpsCallableStreamOptions + ) => { + return streamAtURL(functionsInstance, url, data, options || {}); + }; + return callable as HttpsCallable; } /** @@ -211,13 +241,14 @@ export function httpsCallableFromURL( async function postJSON( url: string, body: unknown, - headers: { [key: string]: string } + headers: { [key: string]: string }, + fetchImpl: typeof fetch ): Promise { headers['Content-Type'] = 'application/json'; let response: Response; try { - response = await fetch(url, { + response = await fetchImpl(url, { method: 'POST', body: JSON.stringify(body), headers @@ -244,10 +275,36 @@ async function postJSON( }; } +/** + * Creates authorization headers for Firebase Functions requests. + * @param functionsInstance The Firebase Functions service instance. + * @param options Options for the callable function, including AppCheck token settings. + * @return A Promise that resolves a headers map to include in outgoing fetch request. + */ +async function makeAuthHeaders( + functionsInstance: FunctionsService, + options: HttpsCallableOptions +): Promise> { + const headers: Record = {}; + const context = await functionsInstance.contextProvider.getContext( + options.limitedUseAppCheckTokens + ); + if (context.authToken) { + headers['Authorization'] = 'Bearer ' + context.authToken; + } + if (context.messagingToken) { + headers['Firebase-Instance-ID-Token'] = context.messagingToken; + } + if (context.appCheckToken !== null) { + headers['X-Firebase-AppCheck'] = context.appCheckToken; + } + return headers; +} + /** * Calls a callable function asynchronously and returns the result. * @param name The name of the callable trigger. - * @param data The data to pass as params to the function.s + * @param data The data to pass as params to the function. */ function call( functionsInstance: FunctionsService, @@ -262,7 +319,7 @@ function call( /** * Calls a callable function asynchronously and returns the result. * @param url The url of the callable trigger. - * @param data The data to pass as params to the function.s + * @param data The data to pass as params to the function. */ async function callAtURL( functionsInstance: FunctionsService, @@ -275,26 +332,14 @@ async function callAtURL( const body = { data }; // Add a header for the authToken. - const headers: { [key: string]: string } = {}; - const context = await functionsInstance.contextProvider.getContext( - options.limitedUseAppCheckTokens - ); - if (context.authToken) { - headers['Authorization'] = 'Bearer ' + context.authToken; - } - if (context.messagingToken) { - headers['Firebase-Instance-ID-Token'] = context.messagingToken; - } - if (context.appCheckToken !== null) { - headers['X-Firebase-AppCheck'] = context.appCheckToken; - } + const headers = await makeAuthHeaders(functionsInstance, options); // Default timeout to 70s, but let the options override it. const timeout = options.timeout || 70000; const failAfterHandle = failAfter(timeout); const response = await Promise.race([ - postJSON(url, body, headers), + postJSON(url, body, headers, functionsInstance.fetchImpl), failAfterHandle.promise, functionsInstance.cancelAllRequests ]); @@ -336,3 +381,236 @@ async function callAtURL( return { data: decodedData }; } + +/** + * Calls a callable function asynchronously and returns a streaming result. + * @param name The name of the callable trigger. + * @param data The data to pass as params to the function. + * @param options Streaming request options. + */ +function stream( + functionsInstance: FunctionsService, + name: string, + data: unknown, + options?: HttpsCallableStreamOptions +): Promise { + const url = functionsInstance._url(name); + return streamAtURL(functionsInstance, url, data, options || {}); +} + +/** + * Calls a callable function asynchronously and return a streaming result. + * @param url The url of the callable trigger. + * @param data The data to pass as params to the function. + * @param options Streaming request options. + */ +async function streamAtURL( + functionsInstance: FunctionsService, + url: string, + data: unknown, + options: HttpsCallableStreamOptions +): Promise { + // Encode any special types, such as dates, in the input data. + data = encode(data); + const body = { data }; + // + // Add a header for the authToken. + const headers = await makeAuthHeaders(functionsInstance, options); + headers['Content-Type'] = 'application/json'; + headers['Accept'] = 'text/event-stream'; + + let response: Response; + try { + response = await functionsInstance.fetchImpl(url, { + method: 'POST', + body: JSON.stringify(body), + headers, + signal: options?.signal + }); + } catch (e) { + if (e instanceof Error && e.name === 'AbortError') { + const error = new FunctionsError('cancelled', 'Request was cancelled.'); + return { + data: Promise.reject(error), + stream: { + [Symbol.asyncIterator]() { + return { + next() { + return Promise.reject(error); + } + }; + } + } + }; + } + // This could be an unhandled error on the backend, or it could be a + // network error. There's no way to know, since an unhandled error on the + // backend will fail to set the proper CORS header, and thus will be + // treated as a network error by fetch. + const error = _errorForResponse(0, null); + return { + data: Promise.reject(error), + // Return an empty async iterator + stream: { + [Symbol.asyncIterator]() { + return { + next() { + return Promise.reject(error); + } + }; + } + } + }; + } + let resultResolver: (value: unknown) => void; + let resultRejecter: (reason: unknown) => void; + const resultPromise = new Promise((resolve, reject) => { + resultResolver = resolve; + resultRejecter = reject; + }); + options?.signal?.addEventListener('abort', () => { + const error = new FunctionsError('cancelled', 'Request was cancelled.'); + resultRejecter(error); + }); + const reader = response.body!.getReader(); + const rstream = createResponseStream( + reader, + resultResolver!, + resultRejecter!, + options?.signal + ); + return { + stream: { + [Symbol.asyncIterator]() { + const rreader = rstream.getReader(); + return { + async next() { + const { value, done } = await rreader.read(); + return { value: value as unknown, done }; + }, + async return() { + await rreader.cancel(); + return { done: true, value: undefined }; + } + }; + } + }, + data: resultPromise + }; +} + +/** + * Creates a ReadableStream that processes a streaming response from a streaming + * callable function that returns data in server-sent event format. + * + * @param reader The underlying reader providing raw response data + * @param resultResolver Callback to resolve the final result when received + * @param resultRejecter Callback to reject with an error if encountered + * @param signal Optional AbortSignal to cancel the stream processing + * @returns A ReadableStream that emits decoded messages from the response + * + * The returned ReadableStream: + * 1. Emits individual messages when "message" data is received + * 2. Resolves with the final result when a "result" message is received + * 3. Rejects with an error if an "error" message is received + */ +function createResponseStream( + reader: ReadableStreamDefaultReader, + resultResolver: (value: unknown) => void, + resultRejecter: (reason: unknown) => void, + signal?: AbortSignal +): ReadableStream { + const processLine = ( + line: string, + controller: ReadableStreamDefaultController + ): void => { + const match = line.match(responseLineRE); + // ignore all other lines (newline, comments, etc.) + if (!match) { + return; + } + const data = match[1]; + try { + const jsonData = JSON.parse(data); + if ('result' in jsonData) { + resultResolver(decode(jsonData.result)); + return; + } + if ('message' in jsonData) { + controller.enqueue(decode(jsonData.message)); + return; + } + if ('error' in jsonData) { + const error = _errorForResponse(0, jsonData); + controller.error(error); + resultRejecter(error); + return; + } + } catch (error) { + if (error instanceof FunctionsError) { + controller.error(error); + resultRejecter(error); + return; + } + // ignore other parsing errors + } + }; + + const decoder = new TextDecoder(); + return new ReadableStream({ + start(controller) { + let currentText = ''; + return pump(); + async function pump(): Promise { + if (signal?.aborted) { + const error = new FunctionsError( + 'cancelled', + 'Request was cancelled' + ); + controller.error(error); + resultRejecter(error); + return Promise.resolve(); + } + try { + const { value, done } = await reader.read(); + if (done) { + if (currentText.trim()) { + processLine(currentText.trim(), controller); + } + controller.close(); + return; + } + if (signal?.aborted) { + const error = new FunctionsError( + 'cancelled', + 'Request was cancelled' + ); + controller.error(error); + resultRejecter(error); + await reader.cancel(); + return; + } + currentText += decoder.decode(value, { stream: true }); + const lines = currentText.split('\n'); + currentText = lines.pop() || ''; + for (const line of lines) { + if (line.trim()) { + processLine(line.trim(), controller); + } + } + return pump(); + } catch (error) { + const functionsError = + error instanceof FunctionsError + ? error + : _errorForResponse(0, null); + controller.error(functionsError); + resultRejecter(functionsError); + } + } + }, + cancel() { + return reader.cancel(); + } + }); +} From cb4309f13a01a6c66eb502ae6f5d6fa93560ab06 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 4 Dec 2024 13:36:17 -0600 Subject: [PATCH 050/295] Fixed issue where multiple calls to connectDataConnectEmulator causes an exception (#8664) --- .changeset/funny-weeks-attack.md | 5 ++ packages/data-connect/src/api/DataConnect.ts | 22 ++++- .../test/unit/transportoptions.test.ts | 80 +++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .changeset/funny-weeks-attack.md create mode 100644 packages/data-connect/test/unit/transportoptions.test.ts diff --git a/.changeset/funny-weeks-attack.md b/.changeset/funny-weeks-attack.md new file mode 100644 index 00000000000..54e26f5c749 --- /dev/null +++ b/.changeset/funny-weeks-attack.md @@ -0,0 +1,5 @@ +--- +"@firebase/data-connect": patch +--- + +Fixed issue where multiple calls to connectDataConnectEmulator caused an exception diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index 27ab83660fd..30ec344f3ef 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -179,7 +179,10 @@ export class DataConnect { // @internal enableEmulator(transportOptions: TransportOptions): void { - if (this._initialized) { + if ( + this._initialized && + !areTransportOptionsEqual(this._transportOptions, transportOptions) + ) { logError('enableEmulator called after initialization'); throw new DataConnectError( Code.ALREADY_INITIALIZED, @@ -191,6 +194,23 @@ export class DataConnect { } } +/** + * @internal + * @param transportOptions1 + * @param transportOptions2 + * @returns + */ +export function areTransportOptionsEqual( + transportOptions1: TransportOptions, + transportOptions2: TransportOptions +): boolean { + return ( + transportOptions1.host === transportOptions2.host && + transportOptions1.port === transportOptions2.port && + transportOptions1.sslEnabled === transportOptions2.sslEnabled + ); +} + /** * Connect to the DataConnect Emulator * @param dc Data Connect instance diff --git a/packages/data-connect/test/unit/transportoptions.test.ts b/packages/data-connect/test/unit/transportoptions.test.ts new file mode 100644 index 00000000000..91e090e6a54 --- /dev/null +++ b/packages/data-connect/test/unit/transportoptions.test.ts @@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2024 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 { expect } from 'chai'; +import { + TransportOptions, + areTransportOptionsEqual, + connectDataConnectEmulator, + getDataConnect +} from '../../src/api/DataConnect'; +import { app } from '../util'; +import { queryRef } from '../../src'; +describe('Transport Options', () => { + it('should return false if transport options are not equal', () => { + const transportOptions1: TransportOptions = { + host: 'h', + port: 1, + sslEnabled: false + }; + const transportOptions2: TransportOptions = { + host: 'h2', + port: 2, + sslEnabled: false + }; + expect( + areTransportOptionsEqual(transportOptions1, transportOptions2) + ).to.eq(false); + }); + it('should return true if transport options are equal', () => { + const transportOptions1: TransportOptions = { + host: 'h', + port: 1, + sslEnabled: false + }; + const transportOptions2: TransportOptions = { + port: 1, + host: 'h', + sslEnabled: false + }; + expect( + areTransportOptionsEqual(transportOptions1, transportOptions2) + ).to.eq(true); + }); + it('should throw if emulator is connected to with new transport options', () => { + const dc = getDataConnect(app, { + connector: 'c', + location: 'l', + service: 's' + }); + expect(() => connectDataConnectEmulator(dc, 'h', 80, false)).to.not.throw(); + queryRef(dc, 'query'); + expect(() => connectDataConnectEmulator(dc, 'h2', 80, false)).to.throw( + 'DataConnect instance already initialized!' + ); + }); + it('should not throw if emulator is connected to with the same transport options', () => { + const dc = getDataConnect(app, { + connector: 'c', + location: 'l', + service: 's' + }); + expect(() => connectDataConnectEmulator(dc, 'h', 80, false)).to.not.throw(); + queryRef(dc, 'query'); + expect(() => connectDataConnectEmulator(dc, 'h', 80, false)).to.not.throw(); + }); +}); From 1e8edb70535724c571e5a5acce13841df108cad7 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 6 Dec 2024 10:20:52 -0800 Subject: [PATCH 051/295] Convert e2e unit tests to use Jest (#8666) --- e2e/babel.config.js | 23 + e2e/context-template.html | 59 - e2e/fix-jsdom-environment.ts | 35 + e2e/{test-setup.js => jest.config.ts} | 22 +- e2e/karma.conf.js | 97 - e2e/package.json | 27 +- e2e/tests/compat.test.ts | 55 +- e2e/tests/modular.test.ts | 75 +- e2e/yarn.lock | 3800 +++++++++++++------------ 9 files changed, 2090 insertions(+), 2103 deletions(-) create mode 100644 e2e/babel.config.js delete mode 100644 e2e/context-template.html create mode 100644 e2e/fix-jsdom-environment.ts rename e2e/{test-setup.js => jest.config.ts} (63%) delete mode 100644 e2e/karma.conf.js diff --git a/e2e/babel.config.js b/e2e/babel.config.js new file mode 100644 index 00000000000..f588a39a23d --- /dev/null +++ b/e2e/babel.config.js @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2024 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. + */ + +module.exports = { + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-typescript' + ] +}; diff --git a/e2e/context-template.html b/e2e/context-template.html deleted file mode 100644 index feb49749883..00000000000 --- a/e2e/context-template.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - %SCRIPTS% - - - - - \ No newline at end of file diff --git a/e2e/fix-jsdom-environment.ts b/e2e/fix-jsdom-environment.ts new file mode 100644 index 00000000000..6255969c6f9 --- /dev/null +++ b/e2e/fix-jsdom-environment.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2024 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 JSDOMEnvironment from 'jest-environment-jsdom'; + +/** + * JSDOMEnvironment patch to polyfill missing fetch with native + * Node fetch + */ +// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string +export default class FixJSDOMEnvironment extends JSDOMEnvironment { + constructor(...args: ConstructorParameters) { + super(...args); + + // FIXME https://github.com/jsdom/jsdom/issues/1724 + this.global.fetch = fetch; + this.global.Headers = Headers; + this.global.Request = Request; + this.global.Response = Response; + } +} diff --git a/e2e/test-setup.js b/e2e/jest.config.ts similarity index 63% rename from e2e/test-setup.js rename to e2e/jest.config.ts index 34969b5f7a6..7d86672c999 100644 --- a/e2e/test-setup.js +++ b/e2e/jest.config.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2021 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +15,14 @@ * limitations under the License. */ -const fs = require('fs'); +import type { Config } from 'jest'; -const contextHtml = fs.readFileSync('./context-template.html', 'utf8'); -fs.writeFileSync( - './context.html', - // Include single quotes so it doesn't replace the comment. - contextHtml.replace( - "'APP_CHECK_DEBUG_TOKEN'", - `'${process.env.APP_CHECK_DEBUG_TOKEN}'` - ) -); +const config: Config = { + verbose: true, + testEnvironment: './fix-jsdom-environment.ts', + globals: { + FIREBASE_APPCHECK_DEBUG_TOKEN: process.env.APP_CHECK_DEBUG_TOKEN + } +}; + +export default config; diff --git a/e2e/karma.conf.js b/e2e/karma.conf.js deleted file mode 100644 index fb2474f3beb..00000000000 --- a/e2e/karma.conf.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @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. - */ - -function getTestFiles(argv) { - const files = []; - if (argv.includes('--compat')) { - files.push('./tests/compat.test.ts'); - } - if (argv.includes('--modular')) { - files.push('./tests/modular.test.ts'); - } - return files; -} -const karma = require('karma'); - -module.exports = function (config) { - config.set({ - frameworks: ['karma-typescript', 'mocha'], - files: getTestFiles(process.argv), - preprocessors: { - './tests/*.test.ts': ['karma-typescript'] - }, - browsers: ['Chrome'], - singleRun: true, - client: { - mocha: { - timeout: 10000 - } - }, - customContextFile: './context.html', - reporters: ['spec'], - specReporter: { - maxLogLines: 5, // limit number of lines logged per test - suppressErrorSummary: true, // do not print error summary - suppressFailed: false, // do not print information about failed tests - suppressPassed: false, // do not print information about passed tests - suppressSkipped: true, // do not print information about skipped tests - showSpecTiming: false // print the time elapsed for each spec - }, - concurrency: 1, - karmaTypescriptConfig: { - bundlerOptions: { - resolve: { - directories: ['./node_modules'], - alias: { - 'idb': 'node_modules/idb/build/index.js' - } - }, - transforms: [ - require('karma-typescript-es6-transform')({ - presets: [ - [ - '@babel/preset-env', - { - targets: { - browsers: ['last 2 Chrome versions'] - } - } - ] - ] - }) - ] - }, - compilerOptions: { - allowJs: true, - 'module': 'commonjs', - 'moduleResolution': 'node', - 'resolveJsonModule': true, - 'esModuleInterop': true, - 'sourceMap': true, - 'target': 'es2017', - 'importHelpers': true, - 'noEmitOnError': true - } - }, - plugins: [ - 'karma-typescript', - 'karma-mocha', - 'karma-chrome-launcher', - 'karma-spec-reporter' - ] - }); -}; diff --git a/e2e/package.json b/e2e/package.json index 7c5c9e501c8..99cf42f2d69 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -5,9 +5,9 @@ "main": "index.js", "scripts": { "setup": "node test-setup.js", - "test": "yarn setup && karma start --compat --modular", - "test:compat": "yarn setup && yarn karma start --compat", - "test:modular": "yarn setup && karma start --modular", + "test": "yarn jest", + "test:compat": "yarn jest tests/compat.test.ts", + "test:modular": "yarn jest tests/modular.test.ts", "watch": "webpack --watch", "build": "webpack", "start:modular": "webpack serve --config-name modular", @@ -18,22 +18,17 @@ "author": "", "license": "ISC", "dependencies": { - "firebase": "9.23.0" + "firebase": "11.0.2" }, "devDependencies": { - "@babel/core": "7.24.4", - "@babel/preset-env": "7.24.4", - "@types/chai": "4.3.14", - "@types/mocha": "9.1.1", + "@babel/core": "7.26.0", + "@babel/preset-env": "7.26.0", + "@babel/preset-typescript": "7.26.0", + "@types/jest": "29.5.14", + "babel-jest": "29.7.0", "babel-loader": "8.3.0", - "chai": "4.4.1", - "karma": "6.4.2", - "karma-chrome-launcher": "3.2.0", - "karma-mocha": "2.0.1", - "karma-spec-reporter": "0.0.36", - "karma-typescript": "5.5.4", - "karma-typescript-es6-transform": "5.5.4", - "mocha": "9.2.2", + "jest": "29.7.0", + "jest-environment-jsdom": "29.7.0", "typescript": "5.5.4", "webpack": "5.76.0", "webpack-cli": "5.1.4", diff --git a/e2e/tests/compat.test.ts b/e2e/tests/compat.test.ts index cfd9d5a4e9d..661cd886a14 100644 --- a/e2e/tests/compat.test.ts +++ b/e2e/tests/compat.test.ts @@ -26,22 +26,22 @@ import 'firebase/compat/messaging'; import 'firebase/compat/performance'; import 'firebase/compat/database'; import { config, testAccount } from '../firebase-config'; -import { expect } from 'chai'; +import 'jest'; describe('COMPAT', () => { let app: firebase.app.App; - before(() => { + beforeAll(() => { console.log('FIREBASE VERSION', firebase.SDK_VERSION); app = firebase.initializeApp(config); firebase.setLogLevel('warn'); }); - after(async () => { + afterAll(async () => { await firebase.auth().signOut(); await app.delete(); }); - describe('AUTH', async () => { + describe('AUTH', () => { let auth: firebase.auth.Auth; it('init auth', () => { auth = firebase.auth(); @@ -51,12 +51,12 @@ describe('COMPAT', () => { testAccount.email, testAccount.password ); - console.log('Logged in with test account', cred.user.email); - expect(cred.user.email).to.equal(testAccount.email); + console.log('Logged in with test account', cred.user?.email); + expect(cred.user?.email).toBe(testAccount.email); }); }); - describe('APP CHECK', async () => { + describe('APP CHECK', () => { let appCheck: firebase.appCheck.AppCheck; it('init appCheck', () => { // @ts-ignore @@ -68,21 +68,19 @@ describe('COMPAT', () => { }); }); - describe('FUNCTIONS', async () => { + describe('FUNCTIONS', () => { let functions: firebase.functions.Functions; it('init functions', () => { functions = firebase.functions(); }); it('httpsCallable()', async () => { - console.log('hi'); const callTest = functions.httpsCallable('callTest'); const result = await callTest({ data: 'blah' }); - expect(result.data.word).to.equal('hellooo'); - // This takes a while. Extend timeout past default (2000); - }).timeout(5000); + expect(result.data.word).toBe('hellooo'); + }); }); - describe('STORAGE', async () => { + describe('STORAGE', () => { let storage: firebase.storage.Storage; let storageRef: firebase.storage.Reference; let url: string; @@ -95,20 +93,23 @@ describe('COMPAT', () => { }); it('getDownloadUrl()', async () => { url = await storageRef.getDownloadURL(); - expect(url).to.match(/test-compat\.txt/); + expect(url).toMatch(/test-compat\.txt/); }); it('fetch and check uploaded data', async () => { const response = await fetch(url); const data = await response.text(); - expect(data).to.equal('efg'); + expect(data).toBe('efg'); await storageRef.delete(); }); }); - describe('FIRESTORE', async () => { + describe('FIRESTORE', () => { let firestore: firebase.firestore.Firestore; it('init firestore', () => { firestore = firebase.firestore(); + // @ts-ignore Super hacky way to deactive useFetchStreams + // which don't work in jsdom + firestore._delegate._settings.useFetchStreams = false; }); it('set(), get(), where()', async () => { await firestore.collection('testCollection').doc('trueDoc').set({ @@ -121,7 +122,7 @@ describe('COMPAT', () => { .collection('testCollection') .where('testbool', '==', true) .get(); - expect(trueDocs.docs.length).to.equal(1); + expect(trueDocs.docs.length).toBe(1); await firestore.collection('testCollection').doc('trueDoc').delete(); await firestore.collection('testCollection').doc('falseDoc').delete(); }); @@ -129,9 +130,9 @@ describe('COMPAT', () => { const testDocRef = firestore.doc('testCollection/testDoc'); let expectedSnap: any = {}; testDocRef.onSnapshot(snap => { - expect(snap.exists).to.equal(expectedSnap.exists); + expect(snap.exists).toBe(expectedSnap.exists); if (snap.exists) { - expect(snap.data()).to.deep.equal(expectedSnap.data); + expect(snap.data()).toEqual(expectedSnap.data); } }); expectedSnap = { exists: true, data: { word: 'hi', number: 14 } }; @@ -146,7 +147,7 @@ describe('COMPAT', () => { }); }); - describe('DATABASE', async () => { + describe('DATABASE', () => { let db: firebase.database.Database; it('init database', () => { db = firebase.database(); @@ -156,9 +157,9 @@ describe('COMPAT', () => { let expectedValue: any = {}; ref.on('value', snap => { if (snap.exists()) { - expect(snap.val()).to.deep.equal(expectedValue); + expect(snap.val()).toEqual(expectedValue); } else { - expect(expectedValue).to.be.null; + expect(expectedValue).toBeNull; } }); expectedValue = { text: 'string 123 xyz' }; @@ -173,7 +174,15 @@ describe('COMPAT', () => { describe('MESSAGING', () => { it('init messaging', () => { + // @ts-ignore Stub missing browser APIs that FCM depends on + window.indexedDB = { open: () => Promise.resolve() }; + // @ts-ignore Stub missing browser APIs that FCM depends on + navigator.serviceWorker = { addEventListener: () => {} }; firebase.messaging(); + // @ts-ignore + delete window.indexedDB; + // @ts-ignore + delete navigator.serviceWorker; }); }); @@ -199,7 +208,7 @@ describe('COMPAT', () => { trace.start(); trace.stop(); trace.putAttribute('testattr', 'perftestvalue'); - expect(trace.getAttribute('testattr')).to.equal('perftestvalue'); + expect(trace.getAttribute('testattr')).toBe('perftestvalue'); }); }); }); diff --git a/e2e/tests/modular.test.ts b/e2e/tests/modular.test.ts index e5864452d70..24432604119 100644 --- a/e2e/tests/modular.test.ts +++ b/e2e/tests/modular.test.ts @@ -87,23 +87,22 @@ import { deleteObject } from 'firebase/storage'; import { config, testAccount } from '../firebase-config'; -import 'chai/register-expect'; -import { expect } from 'chai'; +import 'jest'; describe('MODULAR', () => { let app: FirebaseApp; - before(() => { + beforeAll(() => { console.log('FIREBASE VERSION', SDK_VERSION); app = initializeApp(config); setLogLevel('warn'); }); - after(() => { + afterAll(() => { signOut(getAuth(app)); deleteApp(app); }); - describe('AUTH', async () => { + describe('AUTH', () => { let auth: Auth; it('initializeAuth()', () => { auth = initializeAuth(app); @@ -118,11 +117,11 @@ describe('MODULAR', () => { testAccount.password ); console.log('Logged in with test account', cred.user.email); - expect(cred.user.email).to.equal(testAccount.email); + expect(cred.user.email).toBe(testAccount.email); }); }); - describe('APP CHECK', async () => { + describe('APP CHECK', () => { let appCheck: AppCheck; it('init appCheck', () => { // Test uses debug token, any string is fine here. @@ -135,7 +134,7 @@ describe('MODULAR', () => { }); }); - describe('FUNCTIONS', async () => { + describe('FUNCTIONS', () => { let functions: Functions; it('getFunctions()', () => { functions = getFunctions(app); @@ -146,21 +145,21 @@ describe('MODULAR', () => { 'callTest' ); const result = await callTest({ data: 'blah' }); - expect(result.data.word).to.equal('hellooo'); + expect(result.data.word).toBe('hellooo'); // This takes a while. Extend timeout past default (2000) - }).timeout(5000); + }); it('httpsCallableFromURL()', async () => { const callTest = httpsCallableFromURL<{ data: string }, { word: string }>( functions, `https://us-central1-${app.options.projectId}.cloudfunctions.net/callTest` ); const result = await callTest({ data: 'blah' }); - expect(result.data.word).to.equal('hellooo'); + expect(result.data.word).toBe('hellooo'); // This takes a while. Extend timeout past default (2000) - }).timeout(5000); + }); }); - describe('STORAGE', async () => { + describe('STORAGE', () => { let storage: FirebaseStorage; let sRef: StorageReference; let url: string; @@ -173,25 +172,28 @@ describe('MODULAR', () => { }); it('getDownloadURL()', async () => { url = await getDownloadURL(sRef); - expect(url).to.match(/test-exp\.txt/); + expect(url).toMatch(/test-exp\.txt/); }); it('fetch uploaded data', async () => { const response = await fetch(url); const data = await response.text(); - expect(data).to.equal('exp-efg'); + expect(data).toBe('exp-efg'); await deleteObject(sRef); }); }); - describe('FIRESTORE', async () => { + describe('FIRESTORE', () => { let firestore: Firestore; it('initializeFirestore()', () => { - firestore = initializeFirestore(app, {}); + // fetch streams doesn't work in Jest. + // @ts-ignore I think the option is private so TS doesn't like it. + firestore = initializeFirestore(app, { useFetchStreams: false }); }); it('getFirestore()', () => { firestore = getFirestore(app); }); it('setDoc(), getDocs(), query(), where()', async () => { + firestore = getFirestore(app); await setDoc(doc(firestore, 'testCollection/trueDoc'), { testbool: true }); @@ -205,18 +207,20 @@ describe('MODULAR', () => { where('testbool', '==', true) ) ); - expect(trueDocs.docs.length).to.equal(1); + expect(trueDocs.docs.length).toBe(1); await deleteDoc(doc(collection(firestore, 'testCollection'), 'trueDoc')); + await deleteDoc(doc(firestore, 'testCollection/falseDoc')); }); it('onSnapshot() reflects CRUD operations', async () => { + firestore = getFirestore(app); const testDocRef = doc(firestore, 'testCollection/testDoc'); let expectedData: any = {}; - onSnapshot(testDocRef, snap => { + const unsub = onSnapshot(testDocRef, snap => { if (snap.exists()) { - expect(snap.data()).to.deep.equal(expectedData); + expect(snap.data()).toEqual(expectedData); } else { - expect(expectedData).to.be.null; + expect(expectedData).toBeNull; } }); expectedData = { word: 'hi', number: 14 }; @@ -225,10 +229,11 @@ describe('MODULAR', () => { await updateDoc(testDocRef, { word: 'bye', newProp: ['a'] }); expectedData = null; await deleteDoc(testDocRef); + unsub(); }); }); - describe('DATABASE', async () => { + describe('DATABASE', () => { let db: Database; it('getDatabase', () => { db = getDatabase(app); @@ -238,9 +243,9 @@ describe('MODULAR', () => { let expectedValue: any = {}; onValue(ref, snap => { if (snap.exists()) { - expect(snap.val()).to.deep.equal(expectedValue); + expect(snap.val()).toEqual(expectedValue); } else { - expect(expectedValue).to.be.null; + expect(expectedValue).toBeNull; } }); expectedValue = { text: 'string 123 xyz' }; @@ -255,15 +260,31 @@ describe('MODULAR', () => { describe('MESSAGING', () => { it('getMessaging()', () => { + // @ts-ignore Stub missing browser APIs that FCM depends on + window.indexedDB = { open: () => Promise.resolve() }; + // @ts-ignore Stub missing browser APIs that FCM depends on + navigator.serviceWorker = { addEventListener: () => {} }; getMessaging(app); + // @ts-ignore + delete window.indexedDB; + // @ts-ignore + delete navigator.serviceWorker; }); }); - describe('ANALYTICS', async () => { + describe('ANALYTICS', () => { let analytics: Analytics; - it('analyticsIsSupported()', () => analyticsIsSupported()); + it('analyticsIsSupported()', () => { + analyticsIsSupported(); + }); it('getAnalytics()', () => { + const warn = jest.spyOn(console, 'warn').mockImplementationOnce(() => {}); analytics = getAnalytics(app); + expect(warn).toHaveBeenCalledWith( + expect.stringMatching('@firebase/analytics'), + expect.stringMatching(/IndexedDB unavailable/) + ); + warn.mockRestore(); }); it("logEvent() doesn't error", () => { logEvent(analytics, 'begin_checkout'); @@ -280,7 +301,7 @@ describe('MODULAR', () => { trace.start(); trace.stop(); trace.putAttribute('testattr', 'perftestvalue'); - expect(trace.getAttribute('testattr')).to.equal('perftestvalue'); + expect(trace.getAttribute('testattr')).toBe('perftestvalue'); }); }); }); diff --git a/e2e/yarn.lock b/e2e/yarn.lock index b3ec91b4856..f94b7e65ac2 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -10,7 +10,16 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.24.2", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": + version "7.26.2" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz#9374b5cd068d128dac0b94ff482594273b1c2815" integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== @@ -19,33 +28,12 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.24.4", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/core@7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.24.4.tgz#1f758428e88e0d8c563874741bc4ffc4f71a4717" - integrity sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.2" - "@babel/generator" "^7.24.4" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.24.4" - "@babel/parser" "^7.24.4" - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.1" - "@babel/types" "^7.24.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.11.1", "@babel/core@^7.7.5": +"@babel/core@7.26.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -66,7 +54,7 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.24.4", "@babel/generator@^7.25.9", "@babel/generator@^7.26.0": +"@babel/generator@^7.25.9", "@babel/generator@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz#505cc7c90d92513f458a477e5ef0703e7c91b8d7" integrity sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w== @@ -77,6 +65,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.7.2": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" + integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== + dependencies: + "@babel/parser" "^7.26.3" + "@babel/types" "^7.26.3" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/helper-annotate-as-pure@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" @@ -92,7 +91,7 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6", "@babel/helper-compilation-targets@^7.25.9": +"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== @@ -152,7 +151,7 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helper-module-transforms@^7.23.3", "@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": +"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== @@ -168,7 +167,7 @@ dependencies: "@babel/types" "^7.25.9" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.0", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== @@ -217,7 +216,7 @@ resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== -"@babel/helper-validator-option@^7.23.5", "@babel/helper-validator-option@^7.25.9": +"@babel/helper-validator-option@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== @@ -231,7 +230,7 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helpers@^7.24.4", "@babel/helpers@^7.26.0": +"@babel/helpers@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== @@ -239,14 +238,21 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" -"@babel/parser@^7.24.4", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== + dependencies: + "@babel/types" "^7.26.3" + +"@babel/parser@^7.25.9", "@babel/parser@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz#710a75a7d805a8f72753154e451474e9795b121c" integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== dependencies: "@babel/types" "^7.26.0" -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.24.4", "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== @@ -261,14 +267,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.24.1", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.24.1", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== @@ -277,7 +283,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" "@babel/plugin-transform-optional-chaining" "^7.25.9" -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.24.1", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== @@ -297,6 +303,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + "@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" @@ -311,28 +324,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-import-assertions@^7.24.1", "@babel/plugin-syntax-import-assertions@^7.26.0": +"@babel/plugin-syntax-import-assertions@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-attributes@^7.24.1", "@babel/plugin-syntax-import-attributes@^7.26.0": +"@babel/plugin-syntax-import-attributes@^7.24.7", "@babel/plugin-syntax-import-attributes@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== @@ -353,6 +352,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@^7.25.9", "@babel/plugin-syntax-jsx@^7.7.2": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -409,6 +415,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-syntax-typescript@^7.25.9", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" + integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" @@ -417,14 +430,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.24.1", "@babel/plugin-transform-arrow-functions@^7.25.9": +"@babel/plugin-transform-arrow-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.24.3", "@babel/plugin-transform-async-generator-functions@^7.25.9": +"@babel/plugin-transform-async-generator-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== @@ -433,7 +446,7 @@ "@babel/helper-remap-async-to-generator" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-async-to-generator@^7.24.1", "@babel/plugin-transform-async-to-generator@^7.25.9": +"@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== @@ -442,21 +455,21 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.24.1", "@babel/plugin-transform-block-scoped-functions@^7.25.9": +"@babel/plugin-transform-block-scoped-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-block-scoping@^7.24.4", "@babel/plugin-transform-block-scoping@^7.25.9": +"@babel/plugin-transform-block-scoping@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-class-properties@^7.24.1", "@babel/plugin-transform-class-properties@^7.25.9": +"@babel/plugin-transform-class-properties@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== @@ -464,7 +477,7 @@ "@babel/helper-create-class-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-class-static-block@^7.24.4", "@babel/plugin-transform-class-static-block@^7.26.0": +"@babel/plugin-transform-class-static-block@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== @@ -472,7 +485,7 @@ "@babel/helper-create-class-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-classes@^7.24.1", "@babel/plugin-transform-classes@^7.25.9": +"@babel/plugin-transform-classes@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== @@ -484,7 +497,7 @@ "@babel/traverse" "^7.25.9" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.24.1", "@babel/plugin-transform-computed-properties@^7.25.9": +"@babel/plugin-transform-computed-properties@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== @@ -492,14 +505,14 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/template" "^7.25.9" -"@babel/plugin-transform-destructuring@^7.24.1", "@babel/plugin-transform-destructuring@^7.25.9": +"@babel/plugin-transform-destructuring@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-dotall-regex@^7.24.1", "@babel/plugin-transform-dotall-regex@^7.25.9": +"@babel/plugin-transform-dotall-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== @@ -507,7 +520,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-duplicate-keys@^7.24.1", "@babel/plugin-transform-duplicate-keys@^7.25.9": +"@babel/plugin-transform-duplicate-keys@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== @@ -522,14 +535,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-dynamic-import@^7.24.1", "@babel/plugin-transform-dynamic-import@^7.25.9": +"@babel/plugin-transform-dynamic-import@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.24.1", "@babel/plugin-transform-exponentiation-operator@^7.25.9": +"@babel/plugin-transform-exponentiation-operator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz#ece47b70d236c1d99c263a1e22b62dc20a4c8b0f" integrity sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA== @@ -537,14 +550,14 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-export-namespace-from@^7.24.1", "@babel/plugin-transform-export-namespace-from@^7.25.9": +"@babel/plugin-transform-export-namespace-from@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-for-of@^7.24.1", "@babel/plugin-transform-for-of@^7.25.9": +"@babel/plugin-transform-for-of@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== @@ -552,7 +565,7 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-function-name@^7.24.1", "@babel/plugin-transform-function-name@^7.25.9": +"@babel/plugin-transform-function-name@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== @@ -561,35 +574,35 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-json-strings@^7.24.1", "@babel/plugin-transform-json-strings@^7.25.9": +"@babel/plugin-transform-json-strings@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-literals@^7.24.1", "@babel/plugin-transform-literals@^7.25.9": +"@babel/plugin-transform-literals@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-logical-assignment-operators@^7.24.1", "@babel/plugin-transform-logical-assignment-operators@^7.25.9": +"@babel/plugin-transform-logical-assignment-operators@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-member-expression-literals@^7.24.1", "@babel/plugin-transform-member-expression-literals@^7.25.9": +"@babel/plugin-transform-member-expression-literals@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-amd@^7.24.1", "@babel/plugin-transform-modules-amd@^7.25.9": +"@babel/plugin-transform-modules-amd@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== @@ -597,7 +610,7 @@ "@babel/helper-module-transforms" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@^7.24.1", "@babel/plugin-transform-modules-commonjs@^7.25.9": +"@babel/plugin-transform-modules-commonjs@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz#d165c8c569a080baf5467bda88df6425fc060686" integrity sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg== @@ -606,7 +619,7 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-simple-access" "^7.25.9" -"@babel/plugin-transform-modules-systemjs@^7.24.1", "@babel/plugin-transform-modules-systemjs@^7.25.9": +"@babel/plugin-transform-modules-systemjs@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== @@ -616,7 +629,7 @@ "@babel/helper-validator-identifier" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-modules-umd@^7.24.1", "@babel/plugin-transform-modules-umd@^7.25.9": +"@babel/plugin-transform-modules-umd@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== @@ -624,7 +637,7 @@ "@babel/helper-module-transforms" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5", "@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": +"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== @@ -632,28 +645,28 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-new-target@^7.24.1", "@babel/plugin-transform-new-target@^7.25.9": +"@babel/plugin-transform-new-target@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.24.1", "@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": +"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-numeric-separator@^7.24.1", "@babel/plugin-transform-numeric-separator@^7.25.9": +"@babel/plugin-transform-numeric-separator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-rest-spread@^7.24.1", "@babel/plugin-transform-object-rest-spread@^7.25.9": +"@babel/plugin-transform-object-rest-spread@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== @@ -662,7 +675,7 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-parameters" "^7.25.9" -"@babel/plugin-transform-object-super@^7.24.1", "@babel/plugin-transform-object-super@^7.25.9": +"@babel/plugin-transform-object-super@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== @@ -670,14 +683,14 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-replace-supers" "^7.25.9" -"@babel/plugin-transform-optional-catch-binding@^7.24.1", "@babel/plugin-transform-optional-catch-binding@^7.25.9": +"@babel/plugin-transform-optional-catch-binding@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-optional-chaining@^7.24.1", "@babel/plugin-transform-optional-chaining@^7.25.9": +"@babel/plugin-transform-optional-chaining@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== @@ -685,14 +698,14 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-parameters@^7.24.1", "@babel/plugin-transform-parameters@^7.25.9": +"@babel/plugin-transform-parameters@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-methods@^7.24.1", "@babel/plugin-transform-private-methods@^7.25.9": +"@babel/plugin-transform-private-methods@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== @@ -700,7 +713,7 @@ "@babel/helper-create-class-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-property-in-object@^7.24.1", "@babel/plugin-transform-private-property-in-object@^7.25.9": +"@babel/plugin-transform-private-property-in-object@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== @@ -709,14 +722,14 @@ "@babel/helper-create-class-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-property-literals@^7.24.1", "@babel/plugin-transform-property-literals@^7.25.9": +"@babel/plugin-transform-property-literals@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-regenerator@^7.24.1", "@babel/plugin-transform-regenerator@^7.25.9": +"@babel/plugin-transform-regenerator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== @@ -732,21 +745,21 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-reserved-words@^7.24.1", "@babel/plugin-transform-reserved-words@^7.25.9": +"@babel/plugin-transform-reserved-words@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-shorthand-properties@^7.24.1", "@babel/plugin-transform-shorthand-properties@^7.25.9": +"@babel/plugin-transform-shorthand-properties@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-spread@^7.24.1", "@babel/plugin-transform-spread@^7.25.9": +"@babel/plugin-transform-spread@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== @@ -754,35 +767,46 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-sticky-regex@^7.24.1", "@babel/plugin-transform-sticky-regex@^7.25.9": +"@babel/plugin-transform-sticky-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.24.1", "@babel/plugin-transform-template-literals@^7.25.9": +"@babel/plugin-transform-template-literals@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.24.1", "@babel/plugin-transform-typeof-symbol@^7.25.9": +"@babel/plugin-transform-typeof-symbol@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-escapes@^7.24.1", "@babel/plugin-transform-unicode-escapes@^7.25.9": +"@babel/plugin-transform-typescript@^7.25.9": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.3.tgz#3d6add9c78735623317387ee26d5ada540eee3fd" + integrity sha512-6+5hpdr6mETwSKjmJUdYw0EIkATiQhnELWlE3kJFBwSg/BGIVwVaVbX+gOXBCdc7Ln1RXZxyWGecIXhUfnl7oA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-syntax-typescript" "^7.25.9" + +"@babel/plugin-transform-unicode-escapes@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-property-regex@^7.24.1", "@babel/plugin-transform-unicode-property-regex@^7.25.9": +"@babel/plugin-transform-unicode-property-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== @@ -790,7 +814,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-regex@^7.24.1", "@babel/plugin-transform-unicode-regex@^7.25.9": +"@babel/plugin-transform-unicode-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== @@ -798,7 +822,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-sets-regex@^7.24.1", "@babel/plugin-transform-unicode-sets-regex@^7.25.9": +"@babel/plugin-transform-unicode-sets-regex@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== @@ -806,94 +830,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.4.tgz#46dbbcd608771373b88f956ffb67d471dce0d23b" - integrity sha512-7Kl6cSmYkak0FK/FXjSEnLJ1N9T/WA2RkMhu17gZ/dsxKJUuTYNIylahPTzqpLyJN4WhDif8X0XK1R8Wsguo/A== - dependencies: - "@babel/compat-data" "^7.24.4" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-validator-option" "^7.23.5" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.24.4" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.24.1" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.24.1" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.24.1" - "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.24.1" - "@babel/plugin-syntax-import-attributes" "^7.24.1" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.24.1" - "@babel/plugin-transform-async-generator-functions" "^7.24.3" - "@babel/plugin-transform-async-to-generator" "^7.24.1" - "@babel/plugin-transform-block-scoped-functions" "^7.24.1" - "@babel/plugin-transform-block-scoping" "^7.24.4" - "@babel/plugin-transform-class-properties" "^7.24.1" - "@babel/plugin-transform-class-static-block" "^7.24.4" - "@babel/plugin-transform-classes" "^7.24.1" - "@babel/plugin-transform-computed-properties" "^7.24.1" - "@babel/plugin-transform-destructuring" "^7.24.1" - "@babel/plugin-transform-dotall-regex" "^7.24.1" - "@babel/plugin-transform-duplicate-keys" "^7.24.1" - "@babel/plugin-transform-dynamic-import" "^7.24.1" - "@babel/plugin-transform-exponentiation-operator" "^7.24.1" - "@babel/plugin-transform-export-namespace-from" "^7.24.1" - "@babel/plugin-transform-for-of" "^7.24.1" - "@babel/plugin-transform-function-name" "^7.24.1" - "@babel/plugin-transform-json-strings" "^7.24.1" - "@babel/plugin-transform-literals" "^7.24.1" - "@babel/plugin-transform-logical-assignment-operators" "^7.24.1" - "@babel/plugin-transform-member-expression-literals" "^7.24.1" - "@babel/plugin-transform-modules-amd" "^7.24.1" - "@babel/plugin-transform-modules-commonjs" "^7.24.1" - "@babel/plugin-transform-modules-systemjs" "^7.24.1" - "@babel/plugin-transform-modules-umd" "^7.24.1" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" - "@babel/plugin-transform-new-target" "^7.24.1" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.24.1" - "@babel/plugin-transform-numeric-separator" "^7.24.1" - "@babel/plugin-transform-object-rest-spread" "^7.24.1" - "@babel/plugin-transform-object-super" "^7.24.1" - "@babel/plugin-transform-optional-catch-binding" "^7.24.1" - "@babel/plugin-transform-optional-chaining" "^7.24.1" - "@babel/plugin-transform-parameters" "^7.24.1" - "@babel/plugin-transform-private-methods" "^7.24.1" - "@babel/plugin-transform-private-property-in-object" "^7.24.1" - "@babel/plugin-transform-property-literals" "^7.24.1" - "@babel/plugin-transform-regenerator" "^7.24.1" - "@babel/plugin-transform-reserved-words" "^7.24.1" - "@babel/plugin-transform-shorthand-properties" "^7.24.1" - "@babel/plugin-transform-spread" "^7.24.1" - "@babel/plugin-transform-sticky-regex" "^7.24.1" - "@babel/plugin-transform-template-literals" "^7.24.1" - "@babel/plugin-transform-typeof-symbol" "^7.24.1" - "@babel/plugin-transform-unicode-escapes" "^7.24.1" - "@babel/plugin-transform-unicode-property-regex" "^7.24.1" - "@babel/plugin-transform-unicode-regex" "^7.24.1" - "@babel/plugin-transform-unicode-sets-regex" "^7.24.1" - "@babel/preset-modules" "0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.4" - babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.31.0" - semver "^6.3.1" - -"@babel/preset-env@^7.11.0": +"@babel/preset-env@7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== @@ -977,6 +914,17 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" +"@babel/preset-typescript@7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz#4a570f1b8d104a242d923957ffa1eaff142a106d" + integrity sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-syntax-jsx" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-typescript" "^7.25.9" + "@babel/runtime@^7.8.4": version "7.26.0" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" @@ -984,7 +932,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.24.0", "@babel/template@^7.25.9": +"@babel/template@^7.25.9", "@babel/template@^7.3.3": version "7.25.9" resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== @@ -993,7 +941,7 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/traverse@^7.24.1", "@babel/traverse@^7.25.9": +"@babel/traverse@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== @@ -1006,7 +954,15 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.24.0", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.4.4": version "7.26.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== @@ -1014,405 +970,405 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@colors/colors@1.5.0": - version "1.5.0" - resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" - integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@discoveryjs/json-ext@^0.5.0": version "0.5.7" resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@firebase/analytics-compat@0.2.15-canary.e577a408c": - version "0.2.15-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.15-canary.e577a408c.tgz#fddbb8af72b2263a1b37908e569bc5e078094697" - integrity sha512-ejzH+aLgVK5UVEzImnns878oKL7IkOAhnQ2CeL/vTxQR21Gn8sFYQ5fnO8wKLh9C9xdxorWnXmTDR5PDjbQ1CQ== +"@firebase/analytics-compat@0.2.16": + version "0.2.16" + resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.16.tgz#a84513988358494ef6f80ef626d4198da2b62381" + integrity sha512-Q/s+u/TEMSb2EDJFQMGsOzpSosybBl8HuoSEMyGZ99+0Pu7SIR9MPDGUjc8PKiCFQWDJ3QXxgqh1d/rujyAMbA== dependencies: - "@firebase/analytics" "0.10.9-canary.e577a408c" - "@firebase/analytics-types" "0.8.2-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/analytics" "0.10.10" + "@firebase/analytics-types" "0.8.3" + "@firebase/component" "0.6.11" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/analytics-types@0.8.2-canary.e577a408c": - version "0.8.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.2-canary.e577a408c.tgz#0eb6eb5ea62d0f2147e3b21163994c3b518d07d1" - integrity sha512-E0C/pI5GCKqWlZm7ZZEAwGOJLIunKlM/rfyElkxZdcdM2VVIhlNuRvi2R9r4TEtBwa+zS1E2Hp0rp1RJ5vtGhQ== +"@firebase/analytics-types@0.8.3": + version "0.8.3" + resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz#d08cd39a6209693ca2039ba7a81570dfa6c1518f" + integrity sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg== -"@firebase/analytics@0.10.9-canary.e577a408c": - version "0.10.9-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.9-canary.e577a408c.tgz#7b50262b9633e9dbfe2ea9ce4f4333da9391bbbc" - integrity sha512-KG2jF9HJTE3Axm1wcehmSHcGDfUy4gCDabbJjLr7TyNqmRz1+0w/PzYMZs8uPP6gWmwGMNKcmAGCEC9+mt/0aA== +"@firebase/analytics@0.10.10": + version "0.10.10" + resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.10.tgz#68492c7ec3a341fd6caf3f89cbd9e7e7ad374140" + integrity sha512-Psdo7c9g2SLAYh6u1XRA+RZ7ab2JfBVuAt/kLzXkhKZL/gS2cQUCMsOW5p0RIlDPRKqpdNSmvujd2TeRWLKOkQ== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/installations" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/app-check-compat@0.3.16-canary.e577a408c": - version "0.3.16-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.16-canary.e577a408c.tgz#c63299f699bf295512f538b3f40902a040f79b98" - integrity sha512-zvS/3ZA4iwgWFKPeTm6NybdiJCfvyBazAP2w731GAYdkcbnaqqki4rlDDPsJqY6WehhcwakBtpiBrK8DmGQ79A== +"@firebase/app-check-compat@0.3.17": + version "0.3.17" + resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.17.tgz#ec0e0b52c4c5ea7cb6d976f9d1f892e97d19febc" + integrity sha512-a/eadrGsY0MVCBPhrNbKUhoYpms4UKTYLKO7nswwSFVsm3Rw6NslQQCNLfvljcDqP4E7alQDRGJXjkxd/5gJ+Q== dependencies: - "@firebase/app-check" "0.8.9-canary.e577a408c" - "@firebase/app-check-types" "0.5.2-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/app-check" "0.8.10" + "@firebase/app-check-types" "0.5.3" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/app-check-interop-types@0.3.2-canary.e577a408c": - version "0.3.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2-canary.e577a408c.tgz#f9f22160782a294ee9eafe56c228b9a95710925e" - integrity sha512-fg6IFUVkc93xCiZ/qucO54zdq2mksks9HI4WJbBlLVCMoYJwXt3aBQt1m/0vHzMt2KPf3LlhQ9XLNnu1LGE0Dw== - -"@firebase/app-check-types@0.5.2-canary.e577a408c": - version "0.5.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.2-canary.e577a408c.tgz#55d0ac631fba11363c253ca29e149a2227718cbf" - integrity sha512-9+v/EvezXPhCJhvEJeASr/2bbw8lv6sJVq3pFxQUY8cexyoqbkXjWuFu8HnbvIJqlHHfYNnfSiumsgs2J4Q0Lw== - -"@firebase/app-check@0.8.9-canary.e577a408c": - version "0.8.9-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.9-canary.e577a408c.tgz#c567baa9cd987bb05b8bcb535f21b35ae40d4b4b" - integrity sha512-oVQG6HGf2YelvngoacKbascxlt6EH9VWY3HCTs/iYmdH3RfKf0wMSDkVY9+NokwwHnUwZjRY/Kjp5VcLc8C51A== - dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/app-check-interop-types@0.3.3": + version "0.3.3" + resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz#ed9c4a4f48d1395ef378f007476db3940aa5351a" + integrity sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A== + +"@firebase/app-check-types@0.5.3": + version "0.5.3" + resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz#38ba954acf4bffe451581a32fffa20337f11d8e5" + integrity sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng== + +"@firebase/app-check@0.8.10": + version "0.8.10" + resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.10.tgz#7fa10c9242ecc181a0f45a68bfc268e12729ff02" + integrity sha512-DWFfxxif/t+Ow4MmRUevDX+A3hVxm1rUf6y5ZP4sIomfnVCO1NNahqtsv9rb1/tKGkTeoVT40weiTS/WjQG1mA== + dependencies: + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/app-compat@0.2.45-canary.e577a408c": - version "0.2.45-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.45-canary.e577a408c.tgz#8052e478c0f617208e06473972b2012c030d7cfc" - integrity sha512-mTrdwl94ID3RnBcNQe3LLut3RJedZs9DzZwIbczPamKACjoui5YSm3UP5TITi3jaRv/bZwO34YNIK4hxyWS+jg== +"@firebase/app-compat@0.2.46": + version "0.2.46" + resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.46.tgz#67238416c9e45e9e8649dfe70304026af1cb0b08" + integrity sha512-9hSHWE5LMqtKIm13CnH5OZeMPbkVV3y5vgNZ5EMFHcG2ceRrncyNjG9No5XfWQw8JponZdGs4HlE4aMD/jxcFA== dependencies: - "@firebase/app" "0.10.15-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/app" "0.10.16" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/app-types@0.9.2-canary.e577a408c": - version "0.9.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2-canary.e577a408c.tgz#8a307fe169e4a86f9e98b6abd6f06eea100afcfc" - integrity sha512-b1NRPwjgAvEf3yOFC7qW58Ks2iFu/k1aY+8eNYvYz7dXdvXRFhRyuW3Qn63yEl4epy1DFo6gZiQ7+8wVSS4Ldw== +"@firebase/app-types@0.9.3": + version "0.9.3" + resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz#8408219eae9b1fb74f86c24e7150a148460414ad" + integrity sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw== -"@firebase/app@0.10.15-canary.e577a408c": - version "0.10.15-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/app/-/app-0.10.15-canary.e577a408c.tgz#a71c7aea85082448423881cf40e1252bfe48629a" - integrity sha512-/2kjjOmtfg7nfuXF6p9XipZi8WZUKCt6eoPWFgFj+1yvp7r9mUpFlvbR+XGbz0no4FAblW/cOvUVhsa3W1I+Ag== +"@firebase/app@0.10.16": + version "0.10.16" + resolved "https://registry.npmjs.org/@firebase/app/-/app-0.10.16.tgz#c557ee8fa0085909b48d6e0a00e7403943bd836f" + integrity sha512-SUati2qH48gvVGnSsqMkZr1Iq7No52a3tJQ4itboSTM89Erezmw3v1RsfVymrDze9+KiOLmBpvLNKSvheITFjg== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" idb "7.1.1" tslib "^2.1.0" -"@firebase/auth-compat@0.5.15-canary.e577a408c": - version "0.5.15-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.15-canary.e577a408c.tgz#cae7035dda7bf2042e87443f12e659c2a1834bdf" - integrity sha512-L0p5tmT5swkHgbjwm723YqxAdJe4wDRBe5kSeRaVqK7p2WChUgjKIhoFsFcwf6591StHCiK5eZKJtau2Uz6HjA== +"@firebase/auth-compat@0.5.16": + version "0.5.16" + resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.16.tgz#ef365d2594c0706688abefb8dd61f32a677625f6" + integrity sha512-YlYwJMBqAyv0ESy3jDUyshMhZlbUiwAm6B6+uUmigNDHU+uq7j4SFiDJEZlFFIz397yBzKn06SUdqutdQzGnCA== dependencies: - "@firebase/auth" "1.8.0-canary.e577a408c" - "@firebase/auth-types" "0.12.2-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/auth" "1.8.1" + "@firebase/auth-types" "0.12.3" + "@firebase/component" "0.6.11" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/auth-interop-types@0.2.3-canary.e577a408c": - version "0.2.3-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3-canary.e577a408c.tgz#2eccac1ba25b38386c26829d89cc18e272b6aa79" - integrity sha512-7kKiifjMceqygJlMJH6HQaLtScDHpNpHbYTBZ2r1hF/DTLJXgVhfzDk4S77AeEwl3HIvc1E9iFISVkmfl+rOsA== +"@firebase/auth-interop-types@0.2.4": + version "0.2.4" + resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz#176a08686b0685596ff03d7879b7e4115af53de0" + integrity sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA== -"@firebase/auth-types@0.12.2-canary.e577a408c": - version "0.12.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.2-canary.e577a408c.tgz#84efa14bcebfb2f1b901886f2e9b3d92ca6f1a91" - integrity sha512-rFhQTSsQBNtdUDbHZZ3+F81SZHVrNpkjUJ1aZ5pE6kkbpsn3Qvo1YecU0h28jLg4WbDcwS7iXaOT4GitckUQRw== +"@firebase/auth-types@0.12.3": + version "0.12.3" + resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.3.tgz#650e54a36060b5ea012075ddbd3cb26566334c41" + integrity sha512-Zq9zI0o5hqXDtKg6yDkSnvMCMuLU6qAVS51PANQx+ZZX5xnzyNLEBO3GZgBUPsV5qIMFhjhqmLDxUqCbnAYy2A== -"@firebase/auth@1.8.0-canary.e577a408c": - version "1.8.0-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.8.0-canary.e577a408c.tgz#2287c08335e9968768a40905cb9114dab8eb9b3c" - integrity sha512-gOip6KD67vtSiyJMxlDSGyDivR+FQPa+ZhdONZnmWLJSqx22m9MvqBKDZwWn5WV87DYE4i321px6FJudTw7igg== +"@firebase/auth@1.8.1": + version "1.8.1" + resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.8.1.tgz#8b508328f60bb069a11de8c7e1e4e39e01d5a796" + integrity sha512-LX9N/Cf5Z35r5yqm2+5M3+2bRRe/+RFaa/+u4HDni7TA27C/Xm4XHLKcWcLg1BzjrS4zngSaBEOSODvp6RFOqQ== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/component@0.6.10-canary.e577a408c": - version "0.6.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.10-canary.e577a408c.tgz#c79bf2009d4c130d273f0fc41fe6520da86896a8" - integrity sha512-oGPT9G2obvn0UDL4Sy3It3lHOEb4bx3/xSE5DYMhGt5p07WfKsEPcVerjhQKDRYRe3lVWrKo6wFuGeOwnosQuQ== +"@firebase/component@0.6.11": + version "0.6.11" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.11.tgz#228a2ff5a6b0e5970b84d4dd298bf6ed0483018e" + integrity sha512-eQbeCgPukLgsKD0Kw5wQgsMDX5LeoI1MIrziNDjmc6XDq5ZQnuUymANQgAb2wp1tSF9zDSXyxJmIUXaKgN58Ug== dependencies: - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/data-connect@0.1.1-canary.e577a408c": - version "0.1.1-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.1.1-canary.e577a408c.tgz#d4804b9e5de637bb2792a7356191aafd4d4316cd" - integrity sha512-Fk033kJ6EHLFaDcPuX+G40VLUJPHYK5hrB3DpvtkXJRKDB98oVg111ZlGuX5aHVBNtHZe/hU9ODdUqSKflhl3Q== +"@firebase/data-connect@0.1.2": + version "0.1.2" + resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.1.2.tgz#25c0d7c522089be4a44cbe7d2039dd3601448f81" + integrity sha512-Bcf29mntFCt5V7aceMe36wnkHrG7cwbMlUVbDHOlh2foQKx9VtSXEONw9r6FtL1sFobHVYOM5L6umX35f59m5g== dependencies: - "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/database-compat@2.0.0-canary.e577a408c": - version "2.0.0-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.0-canary.e577a408c.tgz#3474928eb0d95ddb841d743af549e0a731f6525e" - integrity sha512-cVATbY+ltzjKzARazHbT9chNKAW+NGEi3xFNtHpgSElNaiVVNQT/KKFosEQW3YsoYso0fG4Y4BJn0j0PsFTsgA== - dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/database" "1.0.9-canary.e577a408c" - "@firebase/database-types" "1.0.6-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/database-compat@2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.1.tgz#063c4bff74782337117280fbf5b73b463a9a0638" + integrity sha512-IsFivOjdE1GrjTeKoBU/ZMenESKDXidFDzZzHBPQ/4P20ptGdrl3oLlWrV/QJqJ9lND4IidE3z4Xr5JyfUW1vg== + dependencies: + "@firebase/component" "0.6.11" + "@firebase/database" "1.0.10" + "@firebase/database-types" "1.0.7" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/database-types@1.0.6-canary.e577a408c": - version "1.0.6-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.6-canary.e577a408c.tgz#9734ffe92db16b91a9c63529f8d3e3991d871039" - integrity sha512-C+7uS/uM/DHMYtCMERdHVbkBkWEO7DL4WIDqHGP3SuCQzZ8EOwQA587r/ko8GjePAU1RYTarY2G8TmiS3zvPQw== +"@firebase/database-types@1.0.7": + version "1.0.7" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.7.tgz#8a0819ca8c486fc967d3a9021a008c8f969576bf" + integrity sha512-I7zcLfJXrM0WM+ksFmFdAMdlq/DFmpeMNa+/GNsLyFo5u/lX5zzkPzGe3srVWqaBQBY5KprylDGxOsP6ETfL0A== dependencies: - "@firebase/app-types" "0.9.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/app-types" "0.9.3" + "@firebase/util" "1.10.2" -"@firebase/database@1.0.9-canary.e577a408c": - version "1.0.9-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.9-canary.e577a408c.tgz#99ee54b4b4e8f0112a91aa90aae412e93fbb92ec" - integrity sha512-HCUUYCFhBkZnf8rwK7Vd/StZk2phyul+qoSfD/dBokgiPm6wYBA1a6+bFqUwriy8iw9R85k8enfXy+Ywmc3Ovw== - dependencies: - "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" - "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/database@1.0.10": + version "1.0.10" + resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.10.tgz#e23044d5fd2cdfd07e7bef57fd80643db07af33d" + integrity sha512-sWp2g92u7xT4BojGbTXZ80iaSIaL6GAL0pwvM0CO/hb0nHSnABAqsH7AhnWGsGvXuEvbPr7blZylPaR9J+GSuQ== + dependencies: + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/firestore-compat@0.3.39-canary.e577a408c": - version "0.3.39-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.39-canary.e577a408c.tgz#08ad2d5d2ab175026dd506acac03f2fa78e9c823" - integrity sha512-W5ua0Vk9CIyPkWXA36uzTFR75vH2A1A2QQzbpx/h+qGIQUNvkNBhoCpfiW3pq3056jSYyUVPwlR4hXAVfWclpQ== +"@firebase/firestore-compat@0.3.40": + version "0.3.40" + resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.40.tgz#3f4cfc2d25d2f25d9925cdf5903c0b49bfdaeebc" + integrity sha512-18HopMN811KYBc9Ptpr1Rewwio0XF09FF3jc5wtV6rGyAs815SlFFw5vW7ZeLd43zv9tlEc2FzM0H+5Vr9ZRxw== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/firestore" "4.7.4-canary.e577a408c" - "@firebase/firestore-types" "3.0.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/firestore" "4.7.5" + "@firebase/firestore-types" "3.0.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/firestore-types@3.0.2-canary.e577a408c": - version "3.0.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.2-canary.e577a408c.tgz#79796f99480e0719823bb816c4845d2d20ac767a" - integrity sha512-P3wH4cR6c8s6QDXMj+SbV++FEOJ7v64+iYNIfkhPAgsIdkfZAFM8uGc5RMyNyd+o8HR98otPQAJOnMxKSFJk1g== - -"@firebase/firestore@4.7.4-canary.e577a408c": - version "4.7.4-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.4-canary.e577a408c.tgz#128eaca443b9e545c1f79722647ed491baf77184" - integrity sha512-+WSXt6T1Zo2gIAnt0eSvEIZvbBMT5cgaQMUjzGdGixdOayetdKQsF0rOIy1b43ciUJrpECBqdeNIzAWLUxCnDg== - dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" - "@firebase/webchannel-wrapper" "1.0.2-canary.e577a408c" +"@firebase/firestore-types@3.0.3": + version "3.0.3" + resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz#7d0c3dd8850c0193d8f5ee0cc8f11961407742c1" + integrity sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q== + +"@firebase/firestore@4.7.5": + version "4.7.5" + resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.5.tgz#a34d215b28b2888841ed5e06fa6db2ae2246098a" + integrity sha512-OO3rHvjC07jL2ITN255xH/UzCVSvh6xG8oTzQdFScQvFbcm1fjCL1hgAdpDZcx3vVcKMV+6ktr8wbllkB8r+FQ== + dependencies: + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" + "@firebase/webchannel-wrapper" "1.0.3" "@grpc/grpc-js" "~1.9.0" "@grpc/proto-loader" "^0.7.8" tslib "^2.1.0" -"@firebase/functions-compat@0.3.15-canary.e577a408c": - version "0.3.15-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.15-canary.e577a408c.tgz#603b63a0abb80576f60e920522f232ea73e35584" - integrity sha512-RJDI10YNUCWkLMXGFdqCOcrqkdquVRKhhHT5x0mJcaFwMgdYKBjh/u+vyNTkLM6M2KLTCMLalOJyGNtXIvL2xQ== +"@firebase/functions-compat@0.3.16": + version "0.3.16" + resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.16.tgz#397980bc6d40b614be70350b62200188ae4bb289" + integrity sha512-FL7EXehiiBisNIR7mlb0i+moyWKLVfcEJgh/Wq6ZV6BdrCObpCTz7w5EvuRIEFX5e9cNL2oWInKg8S5X4HtINg== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/functions" "0.11.9-canary.e577a408c" - "@firebase/functions-types" "0.6.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/functions" "0.11.10" + "@firebase/functions-types" "0.6.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/functions-types@0.6.2-canary.e577a408c": - version "0.6.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.2-canary.e577a408c.tgz#c1d1f73bf528d9f770ea5c125ca8dedadc560c03" - integrity sha512-SJIi3pvzVrdwtoWeQUZGQOHXG8FHm57eRMs6NgrZLm4lkEQSNvhyzoL1g+vrhMCp95y1N7LzMjsiGEVKI9iITw== - -"@firebase/functions@0.11.9-canary.e577a408c": - version "0.11.9-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.9-canary.e577a408c.tgz#253e4a0b212440ef6521998ae1e03ca4571ce6c5" - integrity sha512-1IXDmr88c4b8WpFBrZXlvHCwA4pblnjP0Kx+1zr+ZS8HA5zIzLBjj5u8085BvU5ajbm8H5PqLoIopUp0tMMKjA== - dependencies: - "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" - "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/messaging-interop-types" "0.2.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/functions-types@0.6.3": + version "0.6.3" + resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz#f5faf770248b13f45d256f614230da6a11bfb654" + integrity sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg== + +"@firebase/functions@0.11.10": + version "0.11.10" + resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.10.tgz#da908e936f9dcd2fc1bf22447500f7bf96d7615b" + integrity sha512-TP+Dzebazhw6+GduBdWn1kOJRFH84G2z+BW3pNVfkpFRkc//+uT1Uw2+dLpMGSSBRG7FrcDG91vcPnOFCzr15w== + dependencies: + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.11" + "@firebase/messaging-interop-types" "0.2.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/installations-compat@0.2.10-canary.e577a408c": - version "0.2.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.10-canary.e577a408c.tgz#a786ba61d0e13407ac84a7513165d463abd2b2d4" - integrity sha512-3bOVauoRCUOCTG3QgjtMa4lGarERlK+6YGVjN53uDaBMMcxAJS/5Gv/SMcCVJhyHTdTb4JV5qLHH8hchHYgu5Q== +"@firebase/installations-compat@0.2.11": + version "0.2.11" + resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.11.tgz#8bd9e3fbcf9a7fabcfa2386264be6a224567cdb5" + integrity sha512-SHRgw5LTa6v8LubmJZxcOCwEd1MfWQPUtKdiuCx2VMWnapX54skZd1PkQg0K4l3k+4ujbI2cn7FE6Li9hbChBw== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/installations-types" "0.5.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/installations" "0.6.11" + "@firebase/installations-types" "0.5.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/installations-types@0.5.2-canary.e577a408c": - version "0.5.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.2-canary.e577a408c.tgz#caaafd066379c6340cd6ce74fa43a55cfaa8d4da" - integrity sha512-LhSt9fB89XK6DtI/r9wlCYpwO8jPaEjkLxWp5W4ZJ3XwqhaM3ndf2VVrS5z3xrInqSR83faKvvsoZTFvsGJbIA== +"@firebase/installations-types@0.5.3": + version "0.5.3" + resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz#cac8a14dd49f09174da9df8ae453f9b359c3ef2f" + integrity sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA== -"@firebase/installations@0.6.10-canary.e577a408c": - version "0.6.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.10-canary.e577a408c.tgz#20e281227afe34f8f506ce121bf4ea7eedd9f593" - integrity sha512-OqU2vWKBDulpcMmotmsRW/wFuXER6ilrgDee6xt+E4RWdURNvJ/DpDcfFm934/Hw16pcTQDSzseAXBqss1S06g== +"@firebase/installations@0.6.11": + version "0.6.11" + resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.11.tgz#0ac38af96ec737f458aa93d07e0499bd1dde9bdd" + integrity sha512-w8fY8mw6fxJzsZM2ufmTtomopXl1+bn/syYon+Gpn+0p0nO1cIUEVEFrFazTLaaL9q1CaVhc3HmseRTsI3igAA== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/util" "1.10.2" idb "7.1.1" tslib "^2.1.0" -"@firebase/logger@0.4.3-canary.e577a408c": - version "0.4.3-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.3-canary.e577a408c.tgz#a54f0b42e2bbcf474ef82983a14ad7efaec1c502" - integrity sha512-P62nyiW3TGU2cc2OnoCx7YOjpUj5AKIKuUvjn8W4wSuKB2eHF75w2sWCtAaOugXUYMp/QoSSLEpwMSJO7Xg6HA== +"@firebase/logger@0.4.4": + version "0.4.4" + resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.4.tgz#29e8379d20fd1149349a195ee6deee4573a86f48" + integrity sha512-mH0PEh1zoXGnaR8gD1DeGeNZtWFKbnz9hDO91dIml3iou1gpOnLqXQ2dJfB71dj6dpmUjcQ6phY3ZZJbjErr9g== dependencies: tslib "^2.1.0" -"@firebase/messaging-compat@0.2.13-canary.e577a408c": - version "0.2.13-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.13-canary.e577a408c.tgz#9bfc8700fec9f510195ceab6c4a7a006c853bc4a" - integrity sha512-HdoepMBydMjXvnWJaq/0N82DBmCcwojT8XHnx6UUjhC2gmZuy/dmHcwOi1OC53zm4dYt+u9sx3TdCPn3Zt6ysA== +"@firebase/messaging-compat@0.2.14": + version "0.2.14" + resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.14.tgz#c6532a1cc1bebe55aca486c30f48688f68b50f18" + integrity sha512-r9weK8jTEA2aGiwy0IbMQPnzuJ0DHkOQaMxGJOlU2QZ1a7fh6RHpNtaoM+LKnn6u1NQgmAOWYNr9vezVQEm9zw== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/messaging" "0.12.13-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/messaging" "0.12.14" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/messaging-interop-types@0.2.2-canary.e577a408c": - version "0.2.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2-canary.e577a408c.tgz#004aac98993a3b28e62b942d26e3688239e4c49c" - integrity sha512-lhSi6wwyUa2spoqDmxMNbMMtj/sqPSp2KIzT/VJs1PV1flc5g81Mo5DxMwcUFx0fjNCvMd74rmpXYXtwgJUWoA== - -"@firebase/messaging@0.12.13-canary.e577a408c": - version "0.12.13-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.13-canary.e577a408c.tgz#f48f88152ddfeeffddee2b0cbda7079f15f8975f" - integrity sha512-43nN/xaWFt6UKgBKN8EAmkoiH8+rQyGlT05H3HkScN+XyXDP9W288KGGImjYfQmlaTa9b3hCz1aEg1N14pQsYw== - dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/messaging-interop-types" "0.2.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/messaging-interop-types@0.2.3": + version "0.2.3" + resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz#e647c9cd1beecfe6a6e82018a6eec37555e4da3e" + integrity sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q== + +"@firebase/messaging@0.12.14": + version "0.12.14" + resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.14.tgz#21d32de01f2abbb262c35185d50043bce18d4fb4" + integrity sha512-cSGP34jJswFvME8tdMDkvJvW6T1jEekyMSyq84AMBZ0KEpJbDWuC9n4wKT2lxUm1jaL651iZnn6g51yCl77ICg== + dependencies: + "@firebase/component" "0.6.11" + "@firebase/installations" "0.6.11" + "@firebase/messaging-interop-types" "0.2.3" + "@firebase/util" "1.10.2" idb "7.1.1" tslib "^2.1.0" -"@firebase/performance-compat@0.2.10-canary.e577a408c": - version "0.2.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.10-canary.e577a408c.tgz#d03f609b16e9f8c21f7375b1001811b63c595aa2" - integrity sha512-ms0HMNCj6J9HfxuqorWI+bbwDtyBW+Yoo6ORgNnxsWp/A9Upi3AdfL+cqfhbMbQlntp+o9AIqCi+cdy3BX8SBA== +"@firebase/performance-compat@0.2.11": + version "0.2.11" + resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.11.tgz#35799c62d4c477d4b82d9824359a2bd88386db12" + integrity sha512-DqeNBy51W2xzlklyC7Ht9JQ94HhTA08PCcM4MDeyG/ol3fqum/+YgtHWQ2IQuduqH9afETthZqLwCZiSgY7hiA== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/performance" "0.6.10-canary.e577a408c" - "@firebase/performance-types" "0.2.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/performance" "0.6.11" + "@firebase/performance-types" "0.2.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/performance-types@0.2.2-canary.e577a408c": - version "0.2.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.2-canary.e577a408c.tgz#d450c685ea8ce41fa3bf8d0ce9c172993e65f367" - integrity sha512-7dITRmK66uVzYssTrpuKZ9D1zEUebNz3LGHsRrtqLe1uCAVWwlUt7H14p7vLWJVlCv27Wx3eiSGhyOqPPwmqgQ== - -"@firebase/performance@0.6.10-canary.e577a408c": - version "0.6.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.10-canary.e577a408c.tgz#7aa8e3d5fe2cd1f20a7ec9ff26dbff7e78d74a64" - integrity sha512-Ds2cavuif/fQA+n/P/IhhCDxtxtI9XB+0CUFaJhT39aUUoLMHH9lh4+/LNoYifs3NXVxRcF4+goKGon2DntbbQ== - dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" +"@firebase/performance-types@0.2.3": + version "0.2.3" + resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz#5ce64e90fa20ab5561f8b62a305010cf9fab86fb" + integrity sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ== + +"@firebase/performance@0.6.11": + version "0.6.11" + resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.11.tgz#c07c0e30117f9b2890d8995259e07424f6d9e265" + integrity sha512-FlkJFeqLlIeh5T4Am3uE38HVzggliDIEFy/fErEc1faINOUFCb6vQBEoNZGaXvRnTR8lh3X/hP7tv37C7BsK9g== + dependencies: + "@firebase/component" "0.6.11" + "@firebase/installations" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/remote-config-compat@0.2.10-canary.e577a408c": - version "0.2.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.10-canary.e577a408c.tgz#9229a2412cc9549db54e4cad35e11bd8940409c8" - integrity sha512-Vdju2neGfb/eA0ifgv7L0TLkY3HHcISkPaLWDLN+D+7XUIPbisKIeQM6zstCPEnwrcRxWvb0ky63bXx+xVWcHg== +"@firebase/remote-config-compat@0.2.11": + version "0.2.11" + resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.11.tgz#5c3660acf673b1787837cc7eba3a07bc958989f5" + integrity sha512-zfIjpwPrGuIOZDmduukN086qjhZ1LnbJi/iYzgua+2qeTlO0XdlE1v66gJPwygGB3TOhT0yb9EiUZ3nBNttMqg== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/remote-config" "0.4.10-canary.e577a408c" - "@firebase/remote-config-types" "0.3.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/remote-config" "0.4.11" + "@firebase/remote-config-types" "0.3.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/remote-config-types@0.3.2-canary.e577a408c": - version "0.3.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.2-canary.e577a408c.tgz#896a72b491f774dd6824a53388b78f4b978e367b" - integrity sha512-u2MWoUqvWUorLrzVqRMZgAK0AgV5OblfR3wG9JUA8vGrbCLWOY4J9RKdKtUaHMstn+4XIbQWV6HLgCy7Yn/e1A== +"@firebase/remote-config-types@0.3.3": + version "0.3.3" + resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.3.tgz#8105382aabf0ee94607a6081889af122d305dd0d" + integrity sha512-YlRI9CHxrk3lpQuFup9N1eohpwdWayKZUNZ/YeQ0PZoncJ66P32UsKUKqVXOaieTjJIOh7yH8JEzRdht5s+d6g== -"@firebase/remote-config@0.4.10-canary.e577a408c": - version "0.4.10-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.10-canary.e577a408c.tgz#06e9a0c6f194e640e569650e4594ec423aa3061d" - integrity sha512-dJDsovw6kcV9RhHPWNlwjTd3BLGvW6BhwgV7gWJKhmeGuDkKdAPsZcvmZVLZ9TJ50vdeeILiwBKajw5jGHU6rA== +"@firebase/remote-config@0.4.11": + version "0.4.11" + resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.11.tgz#7d664e12148c3135c177739020c754aa41d6e542" + integrity sha512-9z0rgKuws2nj+7cdiqF+NY1QR4na6KnuOvP+jQvgilDOhGtKOcCMq5XHiu66i73A9kFhyU6QQ2pHXxcmaq1pBw== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/installations" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/storage-compat@0.3.13-canary.e577a408c": - version "0.3.13-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.13-canary.e577a408c.tgz#f2b38f1816bfb1263269de44f5d5cd498bd20374" - integrity sha512-JYqYbUQfcMR6u7GPvYDBzxcxUPnj63zh8VaQLUYKMCxbFvkpF5J5xnJ+wlY0/rypfWOzW87MVvsnn/uruHfBrw== +"@firebase/storage-compat@0.3.14": + version "0.3.14" + resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.14.tgz#1779f44c517bb6d8d93245ac53a9bc1ecb2e1225" + integrity sha512-Ok5FmXJiapaNAOQ8W8qppnfwgP8540jw2B8M0c4TFZqF4BD+CoKBxW0dRtOuLNGadLhzqqkDZZZtkexxrveQqA== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/storage" "0.13.3-canary.e577a408c" - "@firebase/storage-types" "0.8.2-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/storage" "0.13.4" + "@firebase/storage-types" "0.8.3" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/storage-types@0.8.2-canary.e577a408c": - version "0.8.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.2-canary.e577a408c.tgz#ec7ccc1265ef0a820d1c67f29dac78947cce84d0" - integrity sha512-9QMdcKWJBhAo9bCeWLhwQToMt1dYWGSMxU3gvKkR+b5us/IKaq+bAt5fwXXWXJNRKsTkkrWcJd4sCZxF20cz+A== +"@firebase/storage-types@0.8.3": + version "0.8.3" + resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz#2531ef593a3452fc12c59117195d6485c6632d3d" + integrity sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg== -"@firebase/storage@0.13.3-canary.e577a408c": - version "0.13.3-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.3-canary.e577a408c.tgz#dd46f4702deef731c1b94b17f05d4ed98d652511" - integrity sha512-ethukzObt6FEAm3+JCE7W3sCryKxU7nE9E0aiXWOabwAQduaCJK4dguzly60PvSJkwTTA68W1O6tYjRwnz8PDg== +"@firebase/storage@0.13.4": + version "0.13.4" + resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.4.tgz#83a3b638ffb8dbb8cb4f58d25c0961dfebc7cd9d" + integrity sha512-b1KaTTRiMupFurIhpGIbReaWev0k5O3ouTHkAPcEssT+FvU3q/1JwzvkX4+ZdB60Fc43Mbp8qQ1gWfT0Z2FP9Q== dependencies: - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/component" "0.6.11" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/util@1.10.1-canary.e577a408c": - version "1.10.1-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.1-canary.e577a408c.tgz#3d21ab72c9684e3156c949020595f5503e186e85" - integrity sha512-AKonAsktdHqtUDi+lXVdLq674q7WDicxB7evEgE9ffHFh5lsZIDgdyGZeYHb9xJ3aYEzNGiqHUbXyks7BA9YXA== +"@firebase/util@1.10.2": + version "1.10.2" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.2.tgz#4dbb565cfbdf51b4fb2081c5093dba3037d49a35" + integrity sha512-qnSHIoE9FK+HYnNhTI8q14evyqbc/vHRivfB4TgCIUOl4tosmKSQlp7ltymOlMP4xVIJTg5wrkfcZ60X4nUf7Q== dependencies: tslib "^2.1.0" -"@firebase/vertexai@1.0.0-canary.e577a408c": - version "1.0.0-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.0-canary.e577a408c.tgz#fdb49a6489356a59dc3177235eb35810ab296761" - integrity sha512-z5hnHyBBnT0MDticDdV+UN0rbwb1nlVd+9yHedd+KlzzZ7n9fjlwbSlea8cv3Zk78z23lIoMAo90AXEL7QuiFw== +"@firebase/vertexai@1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.1.tgz#e07fb84da1dfa4c6da358b2e2ab167ec9f69a19a" + integrity sha512-f48MGSofhaS05ebpN7zMIv4tBqYf19pXr5/4njKtNZVLbjxUswDma0SuFDoO+IwgbdkhFxgtNctM+C1zfI/O1Q== dependencies: - "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" - "@firebase/component" "0.6.10-canary.e577a408c" - "@firebase/logger" "0.4.3-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/component" "0.6.11" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.10.2" tslib "^2.1.0" -"@firebase/webchannel-wrapper@1.0.2-canary.e577a408c": - version "1.0.2-canary.e577a408c" - resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.2-canary.e577a408c.tgz#5b3c9e0e227c81c8a3f57bec5ed915815da27ef2" - integrity sha512-oMcvpf7jYk1oZXmSaiViphM0mZA7GLpH+MDtmmsMODxTQ8PdVMV0y+4g0Jz4hCnVOG4m1DyvtTOCKAB96E8a3g== +"@firebase/webchannel-wrapper@1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz#a73bab8eb491d7b8b7be2f0e6c310647835afe83" + integrity sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ== "@grpc/grpc-js@~1.9.0": version "1.9.15" @@ -1432,11 +1388,214 @@ protobufjs "^7.2.5" yargs "^17.7.2" -"@istanbuljs/schema@^0.1.2": +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": version "0.1.3" resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.5": version "0.3.5" resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" @@ -1469,7 +1628,7 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -1555,15 +1714,62 @@ resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@rollup/rollup-linux-x64-gnu@4.9.5": - version "4.9.5" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz#85946ee4d068bd12197aeeec2c6f679c94978a49" - integrity sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@socket.io/component-emitter@~3.1.0": - version "3.1.2" - resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz#821f8442f4175d8f0467b9daf26e3a18e2d02af2" - integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== +"@sinonjs/commons@^3.0.0": + version "3.0.1" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +"@types/babel__core@^7.1.14": + version "7.20.5" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.8" + resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" + integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.4" + resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.6" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" + integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== + dependencies: + "@babel/types" "^7.20.7" "@types/body-parser@*": version "1.19.5" @@ -1580,11 +1786,6 @@ dependencies: "@types/node" "*" -"@types/chai@4.3.14": - version "4.3.14" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" - integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== - "@types/connect-history-api-fallback@^1.5.4": version "1.5.4" resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" @@ -1600,18 +1801,6 @@ dependencies: "@types/node" "*" -"@types/cookie@^0.4.1": - version "0.4.1" - resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" - integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== - -"@types/cors@^2.8.12": - version "2.8.17" - resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz#5d718a5e494a8166f569d986794e49c48b216b2b" - integrity sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA== - dependencies: - "@types/node" "*" - "@types/eslint-scope@^3.7.3": version "3.7.7" resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -1678,6 +1867,13 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/graceful-fs@^4.1.3": + version "4.1.9" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== + dependencies: + "@types/node" "*" + "@types/http-errors@*": version "2.0.4" resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" @@ -1690,6 +1886,42 @@ dependencies: "@types/node" "*" +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@types/istanbul-lib-report@*": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.4" + resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/jest@29.5.14": + version "29.5.14" + resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" + integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + "@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" @@ -1700,11 +1932,6 @@ resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== -"@types/mocha@9.1.1": - version "9.1.1" - resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - "@types/node-forge@^1.3.0": version "1.3.11" resolved "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz#0972ea538ddb0f4d9c2fa0ec5db5724773a604da" @@ -1712,7 +1939,7 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.7.0": +"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "22.8.0" resolved "https://registry.npmjs.org/@types/node/-/node-22.8.0.tgz#193c6f82f9356ce0e6bba86b59f2ffe06e7e320b" integrity sha512-84rafSBHC/z1i1E3p0cJwKA+CfYDNSXX9WSZBRopjIzLET8oNt6ht2tei4C7izwDeEiLLfdeSVBv1egOH916hg== @@ -1765,6 +1992,16 @@ dependencies: "@types/node" "*" +"@types/stack-utils@^2.0.0": + version "2.0.3" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== + +"@types/tough-cookie@*": + version "4.0.5" + resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + "@types/ws@^8.5.10": version "8.5.12" resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e" @@ -1772,10 +2009,17 @@ dependencies: "@types/node" "*" -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== +"@types/yargs-parser@*": + version "21.0.3" + resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== + +"@types/yargs@^17.0.8": + version "17.0.33" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" + integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== + dependencies: + "@types/yargs-parser" "*" "@webassemblyjs/ast@1.11.1": version "1.11.1" @@ -1923,6 +2167,11 @@ resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +abab@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: version "1.3.8" resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -1931,6 +2180,14 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== + dependencies: + acorn "^8.1.0" + acorn-walk "^8.0.2" + acorn-import-assertions@^1.7.6: version "1.9.0" resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" @@ -1943,11 +2200,23 @@ acorn-walk@^8.0.2: dependencies: acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.11.0, acorn@^8.7.1, acorn@^8.8.2: +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: + version "8.14.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + +acorn@^8.7.1, acorn@^8.8.2: version "8.13.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== +agent-base@6: + version "6.0.2" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -1987,10 +2256,12 @@ ajv@^8.0.0, ajv@^8.9.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" ansi-html-community@^0.0.8: version "0.0.8" @@ -2009,7 +2280,12 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" -anymatch@~3.1.2: +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -2017,52 +2293,35 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" array-flatten@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== -asn1.js@^4.10.1: - version "4.10.1" - resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -assert@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" - integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== - dependencies: - call-bind "^1.0.2" - is-nan "^1.3.2" - object-is "^1.1.5" - object.assign "^4.1.4" - util "^0.12.5" - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -async@^3.0.1: - version "3.2.6" - resolved "https://registry.npmjs.org/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" - integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== - -available-typed-arrays@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" - integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== - dependencies: - possible-typed-array-names "^1.0.0" +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +babel-jest@29.7.0, babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" babel-loader@8.3.0: version "8.3.0" @@ -2074,6 +2333,27 @@ babel-loader@8.3.0: make-dir "^3.1.0" schema-utils "^2.6.5" +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" @@ -2083,7 +2363,7 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.2" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.4, babel-plugin-polyfill-corejs3@^0.10.6: +babel-plugin-polyfill-corejs3@^0.10.6: version "0.10.6" resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== @@ -2098,21 +2378,40 @@ babel-plugin-polyfill-regenerator@^0.6.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.6.2" +babel-preset-current-node-syntax@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" + integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -base64id@2.0.0, base64id@~2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" - integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== - batch@0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" @@ -2128,17 +2427,7 @@ binary-extensions@^2.0.0: resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -body-parser@1.20.3, body-parser@^1.19.0: +body-parser@1.20.3: version "1.20.3" resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== @@ -2172,126 +2461,35 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: +braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" -brorand@^1.0.1, brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== - -browser-resolve@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b" - integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ== - dependencies: - resolve "^1.17.0" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.0.4, browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz#06e530907fe2949dc21fc3c2e2302e10b1437238" - integrity sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ== - dependencies: - bn.js "^5.2.1" - randombytes "^2.1.0" - safe-buffer "^5.2.1" - -browserify-sign@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz#7afe4c01ec7ee59a89a558a4b75bd85ae62d4208" - integrity sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw== - dependencies: - bn.js "^5.2.1" - browserify-rsa "^4.1.0" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.5" - hash-base "~3.0" - inherits "^2.0.4" - parse-asn1 "^5.1.7" - readable-stream "^2.3.8" - safe-buffer "^5.2.1" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - -browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== +browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== dependencies: caniuse-lite "^1.0.30001669" electron-to-chromium "^1.5.41" node-releases "^2.0.18" update-browserslist-db "^1.1.1" +bser@2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== - -buffer@^5.4.3: - version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== - bundle-name@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz#f3b96b34160d6431a19d7688135af7cfb8797889" @@ -2309,7 +2507,7 @@ bytes@3.1.2: resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7: +call-bind@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== @@ -2320,7 +2518,17 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7: get-intrinsic "^1.2.4" set-function-length "^1.2.1" -camelcase@^6.0.0: +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.2.0: version "6.3.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -2330,20 +2538,7 @@ caniuse-lite@^1.0.30001669: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== -chai@4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" - integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.3" - deep-eql "^4.1.3" - get-func-name "^2.0.2" - loupe "^2.3.6" - pathval "^1.1.1" - type-detect "^4.0.8" - -chalk@^4.1.0: +chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2351,29 +2546,12 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -check-error@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" - integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== - dependencies: - get-func-name "^2.0.2" - -chokidar@3.5.3: - version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -chokidar@^3.5.1, chokidar@^3.6.0: +chokidar@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -2393,22 +2571,15 @@ chrome-trace-event@^1.0.2: resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" +cjs-module-lexer@^1.0.0: + version "1.4.1" + resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" + integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== cliui@^8.0.1: version "8.0.1" @@ -2428,10 +2599,15 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== +co@^4.6.0: + version "4.6.0" + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== color-convert@^2.0.1: version "2.0.1" @@ -2450,20 +2626,12 @@ colorette@^2.0.10, colorette@^2.0.14: resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -colors@1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -combine-source-map@^0.8.0: - version "0.8.0" - resolved "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" - integrity sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: - convert-source-map "~1.1.0" - inline-source-map "~0.6.0" - lodash.memoize "~3.0.3" - source-map "~0.5.3" + delayed-stream "~1.0.0" commander@^10.0.1: version "10.0.1" @@ -2510,26 +2678,6 @@ connect-history-api-fallback@^2.0.0: resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== -connect@^3.7.0: - version "3.7.0" - resolved "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" - integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ== - dependencies: - debug "2.6.9" - finalhandler "1.1.2" - parseurl "~1.3.3" - utils-merge "1.0.1" - -console-browserify@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" - integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== - content-disposition@0.5.4: version "0.5.4" resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" @@ -2542,21 +2690,11 @@ content-type@~1.0.4, content-type@~1.0.5: resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -convert-source-map@~1.1.0: - version "1.1.3" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" - integrity sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg== - cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -2567,12 +2705,7 @@ cookie@0.7.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -cookie@~0.7.2: - version "0.7.2" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== - -core-js-compat@^3.31.0, core-js-compat@^3.38.0, core-js-compat@^3.38.1: +core-js-compat@^3.38.0, core-js-compat@^3.38.1: version "3.38.1" resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz#2bc7a298746ca5a7bcb9c164bcb120f2ebc09a09" integrity sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw== @@ -2584,44 +2717,18 @@ core-util-is@~1.0.0: resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cors@~2.8.5: - version "2.8.5" - resolved "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -create-ecdh@^4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" cross-spawn@^7.0.3: version "7.0.3" @@ -2632,33 +2739,31 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@^3.12.0: - version "3.12.1" - resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz#bb8921bec9acc81633379aa8f52d69b0b69e0dac" - integrity sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ== - dependencies: - browserify-cipher "^1.0.1" - browserify-sign "^4.2.3" - create-ecdh "^4.0.4" - create-hash "^1.2.0" - create-hmac "^1.1.7" - diffie-hellman "^5.0.3" - hash-base "~3.0.4" - inherits "^2.0.4" - pbkdf2 "^3.1.2" - public-encrypt "^4.0.3" - randombytes "^2.1.0" - randomfill "^1.0.4" +cssom@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg== +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -date-format@^4.0.14: - version "4.0.14" - resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz#7a8e584434fb169a521c8b7aa481f355810d9400" - integrity sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg== +cssstyle@^2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== + dependencies: + cssom "~0.3.6" + +data-urls@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" debug@2.6.9: version "2.6.9" @@ -2667,31 +2772,27 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4.3.3: - version "4.3.3" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@~4.3.4: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.7" resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== dependencies: ms "^2.1.3" -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== +decimal.js@^10.4.2: + version "10.4.3" + resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== -deep-eql@^4.1.3: - version "4.1.4" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz#d0d3912865911bb8fac5afb4e3acfa6a28dc72b7" - integrity sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg== - dependencies: - type-detect "^4.0.0" +dedent@^1.0.0: + version "1.5.3" + resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" + integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== default-browser-id@^5.0.0: version "5.0.0" @@ -2706,14 +2807,7 @@ default-browser@^5.2.1: bundle-name "^4.1.0" default-browser-id "^5.0.0" -defaults@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" - integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== - dependencies: - clone "^1.0.2" - -define-data-property@^1.0.1, define-data-property@^1.1.4: +define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== @@ -2727,14 +2821,10 @@ define-lazy-prop@^3.0.0: resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== -define-properties@^1.1.3, define-properties@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" - integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== - dependencies: - define-data-property "^1.0.1" - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== depd@2.0.0: version "2.0.0" @@ -2746,47 +2836,25 @@ depd@~1.1.2: resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== -des.js@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" - integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - destroy@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + detect-node@^2.0.4: version "2.1.0" resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== -di@^0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA== - -diff@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -diffie-hellman@^5.0.3: - version "5.0.3" - resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== dns-packet@^5.2.2: version "5.6.1" @@ -2795,20 +2863,12 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" -dom-serialize@^2.2.1: - version "2.2.1" - resolved "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ== +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -domain-browser@^4.16.0: - version "4.23.0" - resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.23.0.tgz#427ebb91efcb070f05cffdfb8a4e9a6c25f8c94b" - integrity sha512-ArzcM/II1wCCujdCNyQjXrAFwS4mrLh4C7DZWlaI8mdh7h3BfKdNd3bKXITfl2PT9FtfQqaGvhi1vPRQPimjGA== + webidl-conversions "^7.0.0" ee-first@1.1.1: version "1.1.1" @@ -2820,18 +2880,10 @@ electron-to-chromium@^1.5.41: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== -elliptic@^6.5.3, elliptic@^6.5.5: - version "6.5.7" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" - integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" @@ -2853,27 +2905,6 @@ encodeurl@~2.0.0: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== -engine.io-parser@~5.2.1: - version "5.2.3" - resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz#00dc5b97b1f233a23c9398d0209504cf5f94d92f" - integrity sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q== - -engine.io@~6.6.0: - version "6.6.2" - resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz#32bd845b4db708f8c774a4edef4e5c8a98b3da72" - integrity sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw== - dependencies: - "@types/cookie" "^0.4.1" - "@types/cors" "^2.8.12" - "@types/node" ">=10.0.0" - accepts "~1.3.4" - base64id "2.0.0" - cookie "~0.7.2" - cors "~2.8.5" - debug "~4.3.1" - engine.io-parser "~5.2.1" - ws "~8.17.1" - enhanced-resolve@^5.10.0: version "5.17.1" resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" @@ -2882,18 +2913,23 @@ enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" -ent@~2.2.0: - version "2.2.1" - resolved "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz#68dc99a002f115792c26239baedaaea9e70c0ca2" - integrity sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A== - dependencies: - punycode "^1.4.1" +entities@^4.5.0: + version "4.5.0" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== envinfo@^7.7.3: version "7.14.0" resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + es-define-property@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" @@ -2921,10 +2957,21 @@ escape-html@~1.0.3: resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionalDependencies: + source-map "~0.6.1" eslint-scope@5.1.1: version "5.1.1" @@ -2934,6 +2981,11 @@ eslint-scope@5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -2971,13 +3023,36 @@ events@^3.2.0: resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.0.0, expect@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" express@^4.19.2: version "4.21.1" @@ -3016,17 +3091,12 @@ express@^4.19.2: utils-merge "1.0.1" vary "~1.1.2" -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -3048,6 +3118,13 @@ faye-websocket@0.11.4, faye-websocket@^0.11.3: dependencies: websocket-driver ">=0.5.1" +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + fill-range@^7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -3055,19 +3132,6 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - finalhandler@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" @@ -3090,15 +3154,7 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^4.0.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3106,61 +3162,58 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" -firebase@11.0.1-canary.e577a408c: - version "11.0.1-canary.e577a408c" - resolved "https://registry.npmjs.org/firebase/-/firebase-11.0.1-canary.e577a408c.tgz#8ff1226de8f2e986a8c1506c345b8ab25377d7ae" - integrity sha512-/PqcZ4owoH/ahTbliiNPmuNT4LYcH6YlbCR3kvzm4RK/hbFD572wzFxhpukKSzvjhhng+xXG+CuMBOU1rtyIPQ== - dependencies: - "@firebase/analytics" "0.10.9-canary.e577a408c" - "@firebase/analytics-compat" "0.2.15-canary.e577a408c" - "@firebase/app" "0.10.15-canary.e577a408c" - "@firebase/app-check" "0.8.9-canary.e577a408c" - "@firebase/app-check-compat" "0.3.16-canary.e577a408c" - "@firebase/app-compat" "0.2.45-canary.e577a408c" - "@firebase/app-types" "0.9.2-canary.e577a408c" - "@firebase/auth" "1.8.0-canary.e577a408c" - "@firebase/auth-compat" "0.5.15-canary.e577a408c" - "@firebase/data-connect" "0.1.1-canary.e577a408c" - "@firebase/database" "1.0.9-canary.e577a408c" - "@firebase/database-compat" "2.0.0-canary.e577a408c" - "@firebase/firestore" "4.7.4-canary.e577a408c" - "@firebase/firestore-compat" "0.3.39-canary.e577a408c" - "@firebase/functions" "0.11.9-canary.e577a408c" - "@firebase/functions-compat" "0.3.15-canary.e577a408c" - "@firebase/installations" "0.6.10-canary.e577a408c" - "@firebase/installations-compat" "0.2.10-canary.e577a408c" - "@firebase/messaging" "0.12.13-canary.e577a408c" - "@firebase/messaging-compat" "0.2.13-canary.e577a408c" - "@firebase/performance" "0.6.10-canary.e577a408c" - "@firebase/performance-compat" "0.2.10-canary.e577a408c" - "@firebase/remote-config" "0.4.10-canary.e577a408c" - "@firebase/remote-config-compat" "0.2.10-canary.e577a408c" - "@firebase/storage" "0.13.3-canary.e577a408c" - "@firebase/storage-compat" "0.3.13-canary.e577a408c" - "@firebase/util" "1.10.1-canary.e577a408c" - "@firebase/vertexai" "1.0.0-canary.e577a408c" +firebase@11.0.2: + version "11.0.2" + resolved "https://registry.npmjs.org/firebase/-/firebase-11.0.2.tgz#5de236ee1f2fa517279595e5d4199428da772f48" + integrity sha512-w4T8BSJpzdZA25QRch5ahLsgB6uRvg1LEic4BaC5rTD1YygroI1AXp+W+rbMnr8d8EjfAv6t4k8doULIjc1P8Q== + dependencies: + "@firebase/analytics" "0.10.10" + "@firebase/analytics-compat" "0.2.16" + "@firebase/app" "0.10.16" + "@firebase/app-check" "0.8.10" + "@firebase/app-check-compat" "0.3.17" + "@firebase/app-compat" "0.2.46" + "@firebase/app-types" "0.9.3" + "@firebase/auth" "1.8.1" + "@firebase/auth-compat" "0.5.16" + "@firebase/data-connect" "0.1.2" + "@firebase/database" "1.0.10" + "@firebase/database-compat" "2.0.1" + "@firebase/firestore" "4.7.5" + "@firebase/firestore-compat" "0.3.40" + "@firebase/functions" "0.11.10" + "@firebase/functions-compat" "0.3.16" + "@firebase/installations" "0.6.11" + "@firebase/installations-compat" "0.2.11" + "@firebase/messaging" "0.12.14" + "@firebase/messaging-compat" "0.2.14" + "@firebase/performance" "0.6.11" + "@firebase/performance-compat" "0.2.11" + "@firebase/remote-config" "0.4.11" + "@firebase/remote-config-compat" "0.2.11" + "@firebase/storage" "0.13.4" + "@firebase/storage-compat" "0.3.14" + "@firebase/util" "1.10.2" + "@firebase/vertexai" "1.0.1" flat@^5.0.2: version "5.0.2" resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.2.7: - version "3.3.1" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== - follow-redirects@^1.0.0: version "1.15.9" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== +form-data@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: - is-callable "^1.1.3" + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" forwarded@0.2.0: version "0.2.0" @@ -3172,21 +3225,12 @@ fresh@0.5.2: resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.3.2: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.3" resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -3206,11 +3250,6 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.1, get-func-name@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" - integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== - get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" @@ -3222,6 +3261,16 @@ get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: has-symbols "^1.0.3" hasown "^2.0.0" +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -3234,19 +3283,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@7.2.0: - version "7.2.0" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3, glob@^7.1.6, glob@^7.1.7: +glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3270,16 +3307,11 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - handle-thing@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" @@ -3290,7 +3322,7 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: +has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== @@ -3307,38 +3339,6 @@ has-symbols@^1.0.3: resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" - integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== - dependencies: - has-symbols "^1.0.3" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash-base@~3.0, hash-base@~3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - hasown@^2.0.0, hasown@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" @@ -3346,20 +3346,6 @@ hasown@^2.0.0, hasown@^2.0.2: dependencies: function-bind "^1.1.2" -he@1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" @@ -3370,6 +3356,13 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" +html-encoding-sniffer@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== + dependencies: + whatwg-encoding "^2.0.0" + html-entities@^2.4.0: version "2.5.2" resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" @@ -3411,6 +3404,15 @@ http-parser-js@>=0.5.1: resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + http-proxy-middleware@^2.0.3: version "2.0.7" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" @@ -3431,10 +3433,18 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== +https-proxy-agent@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== hyperdyperid@^1.2.0: version "1.2.0" @@ -3448,16 +3458,18 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + idb@7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ== -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - import-local@^3.0.2: version "3.2.0" resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" @@ -3466,6 +3478,11 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -3474,7 +3491,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3484,13 +3501,6 @@ inherits@2.0.3: resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== -inline-source-map@~0.6.0: - version "0.6.3" - resolved "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz#db9d553037fa74bf95dfbff186375fcf5c563cdd" - integrity sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w== - dependencies: - source-map "~0.5.3" - interpret@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" @@ -3506,13 +3516,10 @@ ipaddr.js@^2.1.0: resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== -is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-binary-path@~2.1.0: version "2.1.0" @@ -3521,11 +3528,6 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-callable@^1.1.3: - version "1.2.7" - resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== - is-core-module@^2.13.0: version "2.15.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" @@ -3548,12 +3550,10 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" @@ -3569,14 +3569,6 @@ is-inside-container@^1.0.0: dependencies: is-docker "^3.0.0" -is-nan@^1.3.2: - version "1.3.2" - resolved "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" - integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - is-network-error@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz#d26a760e3770226d11c169052f266a4803d9c997" @@ -3587,11 +3579,6 @@ is-number@^7.0.0: resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - is-plain-obj@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" @@ -3604,17 +3591,15 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-typed-array@^1.1.3: - version "1.1.13" - resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" - integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== - dependencies: - which-typed-array "^1.1.14" +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-wsl@^3.1.0: version "3.1.0" @@ -3628,11 +3613,6 @@ isarray@~1.0.0: resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== -isbinaryfile@^4.0.8: - version "4.0.10" - resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" - integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -3643,21 +3623,33 @@ isobject@^3.0.1: resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -istanbul-lib-coverage@^3.0.0: +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== -istanbul-lib-instrument@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: - "@babel/core" "^7.7.5" + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" + istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.3" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" + integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== + dependencies: + "@babel/core" "^7.23.9" + "@babel/parser" "^7.23.9" + "@istanbuljs/schema" "^0.1.3" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" @@ -3676,7 +3668,7 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.0: +istanbul-reports@^3.1.3: version "3.1.7" resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== @@ -3684,6 +3676,358 @@ istanbul-reports@^3.0.0: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-jsdom@29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/jsdom" "^20.0.0" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + jsdom "^20.0.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== + +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.3" + +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -3693,24 +4037,77 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== + dependencies: + "@types/node" "*" + jest-util "^29.7.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== + dependencies: + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" + import-local "^3.0.2" + jest-cli "^29.7.0" + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsdom@^20.0.0: + version "20.0.3" + resolved "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== + dependencies: + abab "^2.0.6" + acorn "^8.8.1" + acorn-globals "^7.0.0" + cssom "^0.5.0" + cssstyle "^2.3.0" + data-urls "^3.0.2" + decimal.js "^10.4.2" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + ws "^8.11.0" + xml-name-validator "^4.0.0" jsesc@^3.0.2, jsesc@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== -json-parse-even-better-errors@^2.3.1: +json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -3720,145 +4117,26 @@ json-schema-traverse@^0.4.1: resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - -json5@^2.1.2, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -karma-chrome-launcher@3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz#eb9c95024f2d6dfbb3748d3415ac9b381906b9a9" - integrity sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q== - dependencies: - which "^1.2.1" - -karma-mocha@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz#4b0254a18dfee71bdbe6188d9a6861bf86b0cd7d" - integrity sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ== - dependencies: - minimist "^1.2.3" - -karma-spec-reporter@0.0.36: - version "0.0.36" - resolved "https://registry.npmjs.org/karma-spec-reporter/-/karma-spec-reporter-0.0.36.tgz#c54dc155dec2ded1f92ea68dbbdd67fcedbef350" - integrity sha512-11bvOl1x6ryKZph7kmbmMpbi8vsngEGxGOoeTlIcDaH3ab3j8aPJnZ+r+K/SS0sBSGy5VGkGYO2+hLct7hw/6w== - dependencies: - colors "1.4.0" - -karma-typescript-es6-transform@5.5.4: - version "5.5.4" - resolved "https://registry.npmjs.org/karma-typescript-es6-transform/-/karma-typescript-es6-transform-5.5.4.tgz#bca1eb2f3ba50601c083fe6277ae6df0f7cdb7c8" - integrity sha512-SKUNU4cAxNgmJnF/zCAzMRnBaciQjFumSDrsf1j8TTJvAtwAk/tLM+hru88Dr4Q4SmFUFa+PzIK8NJmykQ2F7Q== - dependencies: - "@babel/core" "^7.11.1" - "@babel/preset-env" "^7.11.0" - acorn "^8.1.0" - acorn-walk "^8.0.2" - log4js "^6.3.0" - magic-string "^0.25.7" +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -karma-typescript@5.5.4: - version "5.5.4" - resolved "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.4.tgz#969871512b8476dfc7a496f48da9ca9c73d710e5" - integrity sha512-D7nQ96xu/UekuqCmiPimnCuOFqp8+BxiND6MU6IJVN37E7DgXzr7SUeTzwuTHtKSYpgxKv4iOTUteYTxpeZL9A== - dependencies: - acorn "^8.1.0" - acorn-walk "^8.0.2" - assert "^2.0.0" - async "^3.0.1" - browser-resolve "^2.0.0" - browserify-zlib "^0.2.0" - buffer "^5.4.3" - combine-source-map "^0.8.0" - console-browserify "^1.2.0" - constants-browserify "^1.0.0" - convert-source-map "^1.7.0" - crypto-browserify "^3.12.0" - diff "^4.0.1" - domain-browser "^4.16.0" - events "^3.2.0" - glob "^7.1.6" - https-browserify "^1.0.0" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.0" - json-stringify-safe "^5.0.1" - lodash "^4.17.19" - log4js "^6.3.0" - minimatch "^3.0.4" - os-browserify "^0.3.0" - pad "^3.2.0" - path-browserify "^1.0.0" - process "^0.11.10" - punycode "^2.1.1" - querystring-es3 "^0.2.1" - readable-stream "^3.1.1" - source-map "^0.7.3" - stream-browserify "^3.0.0" - stream-http "^3.1.0" - string_decoder "^1.3.0" - timers-browserify "^2.0.11" - tmp "^0.2.1" - tty-browserify "^0.0.1" - url "^0.11.0" - util "^0.12.1" - vm-browserify "^1.1.2" - -karma@6.4.2: - version "6.4.2" - resolved "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz#a983f874cee6f35990c4b2dcc3d274653714de8e" - integrity sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ== - dependencies: - "@colors/colors" "1.5.0" - body-parser "^1.19.0" - braces "^3.0.2" - chokidar "^3.5.1" - connect "^3.7.0" - di "^0.0.1" - dom-serialize "^2.2.1" - glob "^7.1.7" - graceful-fs "^4.2.6" - http-proxy "^1.18.1" - isbinaryfile "^4.0.8" - lodash "^4.17.21" - log4js "^6.4.1" - mime "^2.5.2" - minimatch "^3.0.4" - mkdirp "^0.5.5" - qjobs "^1.2.0" - range-parser "^1.2.1" - rimraf "^3.0.2" - socket.io "^4.4.1" - source-map "^0.6.1" - tmp "^0.2.1" - ua-parser-js "^0.7.30" - yargs "^16.1.1" +json5@^2.1.2, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== kind-of@^6.0.2: version "6.0.3" resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + launch-editor@^2.6.1: version "2.9.1" resolved "https://registry.npmjs.org/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047" @@ -3867,6 +4145,16 @@ launch-editor@^2.6.1: picocolors "^1.0.0" shell-quote "^1.8.1" +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" @@ -3888,13 +4176,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -3905,47 +4186,11 @@ lodash.debounce@^4.0.8: resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.memoize@~3.0.3: - version "3.0.4" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" - integrity sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A== - -lodash@^4.17.19, lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -log4js@^6.3.0, log4js@^6.4.1: - version "6.9.1" - resolved "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz#aba5a3ff4e7872ae34f8b4c533706753709e38b6" - integrity sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g== - dependencies: - date-format "^4.0.14" - debug "^4.3.4" - flatted "^3.2.7" - rfdc "^1.3.0" - streamroller "^3.1.5" - long@^5.0.0: version "5.2.3" resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== -loupe@^2.3.6: - version "2.3.7" - resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" - integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== - dependencies: - get-func-name "^2.0.1" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -3953,13 +4198,6 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== - dependencies: - sourcemap-codec "^1.4.8" - make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -3974,14 +4212,12 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" + tmpl "1.0.5" media-typer@0.3.0: version "0.3.0" @@ -4013,7 +4249,7 @@ methods@~1.1.2: resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^4.0.2: +micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.8" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -4021,14 +4257,6 @@ micromatch@^4.0.2: braces "^3.0.3" picomatch "^2.3.1" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -4039,7 +4267,7 @@ mime-db@1.52.0: resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447" integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== -mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -4051,28 +4279,16 @@ mime@1.6.0: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.5.2: - version "2.6.0" - resolved "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" - integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: +minimalistic-assert@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== - -minimatch@4.2.1: - version "4.2.1" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" - integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== - dependencies: - brace-expansion "^1.1.7" - minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -4080,58 +4296,11 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.3, minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp@^0.5.5: - version "0.5.6" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -mocha@9.2.2: - version "9.2.2" - resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" - integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.3" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.2.0" - growl "1.10.5" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "4.2.1" - ms "2.1.3" - nanoid "3.3.1" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - which "2.0.2" - workerpool "6.2.0" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - ms@2.1.3, ms@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" @@ -4145,10 +4314,10 @@ multicast-dns@^7.2.5: dns-packet "^5.2.2" thunky "^1.0.2" -nanoid@3.3.1: - version "3.3.1" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== negotiator@0.6.3: version "0.6.3" @@ -4165,6 +4334,11 @@ node-forge@^1: resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + node-releases@^2.0.18: version "2.0.18" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" @@ -4175,39 +4349,23 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -object-assign@^4: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nwsapi@^2.2.2: + version "2.2.16" + resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== object-inspect@^1.13.1: version "1.13.2" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== -object-is@^1.1.5: - version "1.1.6" - resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" - integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object.assign@^4.1.4: - version "4.1.5" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" - integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== - dependencies: - call-bind "^1.0.5" - define-properties "^1.2.1" - has-symbols "^1.0.3" - object-keys "^1.1.1" - obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -4220,13 +4378,6 @@ on-finished@2.4.1, on-finished@^2.4.1: dependencies: ee-first "1.1.1" -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== - dependencies: - ee-first "1.1.1" - on-headers@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" @@ -4239,6 +4390,13 @@ once@^1.3.0: dependencies: wrappy "1" +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + open@^10.0.3: version "10.1.0" resolved "https://registry.npmjs.org/open/-/open-10.1.0.tgz#a7795e6e5d519abe4286d9937bb24b51122598e1" @@ -4249,11 +4407,6 @@ open@^10.0.3: is-inside-container "^1.0.0" is-wsl "^3.1.0" -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -4261,7 +4414,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2: +p-limit@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -4275,13 +4428,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-retry@^6.2.0: version "6.2.0" resolved "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz#8d6df01af298750009691ce2f9b3ad2d5968f3bd" @@ -4296,42 +4442,28 @@ p-try@^2.0.0: resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -pad@^3.2.0: - version "3.3.0" - resolved "https://registry.npmjs.org/pad/-/pad-3.3.0.tgz#364c264ba0b1600468d85db1b8ddb9b522522d70" - integrity sha512-2/G2Q8J/lbkJ3Zf595U9jattrUkM1rwTr3s4n9smp3+ALe66V+t3I75SG0qjWzuQgmXOgiUS0/qE97S+0hP7Cw== +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: - wcwidth "^1.0.1" - optionalDependencies: - "@rollup/rollup-linux-x64-gnu" "4.9.5" - -pako@~1.0.5: - version "1.0.11" - resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" -parse-asn1@^5.0.0, parse-asn1@^5.1.7: - version "5.1.7" - resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz#73cdaaa822125f9647165625eb45f8a051d2df06" - integrity sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg== +parse5@^7.0.0, parse5@^7.1.1: + version "7.2.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== dependencies: - asn1.js "^4.10.1" - browserify-aes "^1.2.0" - evp_bytestokey "^1.0.3" - hash-base "~3.0" - pbkdf2 "^3.1.2" - safe-buffer "^5.2.1" + entities "^4.5.0" parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -path-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -4342,7 +4474,7 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^3.1.0: +path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== @@ -4357,32 +4489,21 @@ path-to-regexp@0.1.10: resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - -pbkdf2@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pirates@^4.0.4: + version "4.0.6" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" @@ -4390,20 +4511,27 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -possible-typed-array-names@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" - integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== +pretty-format@^29.0.0, pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.11.10: - version "0.11.10" - resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" protobufjs@^7.2.5: version "7.4.0" @@ -4431,60 +4559,42 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -public-encrypt@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== +psl@^1.1.33: + version "1.15.0" + resolved "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== + punycode "^2.3.1" -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -qjobs@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== +pure-rand@^6.0.0: + version "6.1.0" + resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" + integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== -qs@6.13.0, qs@^6.12.3: +qs@6.13.0: version "6.13.0" resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: side-channel "^1.0.6" -querystring-es3@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: +randombytes@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" -randomfill@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" @@ -4500,7 +4610,12 @@ raw-body@2.5.2: iconv-lite "0.4.24" unpipe "1.0.0" -readable-stream@^2.0.1, readable-stream@^2.3.8: +react-is@^18.0.0: + version "18.3.1" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + +readable-stream@^2.0.1: version "2.3.8" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -4513,7 +4628,7 @@ readable-stream@^2.0.1, readable-stream@^2.3.8: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.5.0, readable-stream@^3.6.0: +readable-stream@^3.0.6: version "3.6.2" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -4611,7 +4726,12 @@ resolve-from@^5.0.0: resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0: +resolve.exports@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" + integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== + +resolve@^1.14.2, resolve@^1.20.0: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4625,26 +4745,6 @@ retry@^0.13.1: resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== -rfdc@^1.3.0: - version "1.4.1" - resolved "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" - integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - run-applescript@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz#e5a553c2bffd620e169d276c1cd8f1b64778fbeb" @@ -4655,16 +4755,23 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -"safer-buffer@>= 2.1.2 < 3": +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + schema-utils@^2.6.5: version "2.7.1" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" @@ -4711,7 +4818,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3: +semver@^7.5.3, semver@^7.5.4: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -4735,13 +4842,6 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - serialize-javascript@^6.0.1: version "6.0.2" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" @@ -4784,11 +4884,6 @@ set-function-length@^1.2.1: gopd "^1.0.1" has-property-descriptors "^1.0.2" -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" @@ -4799,14 +4894,6 @@ setprototypeof@1.2.0: resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -4841,34 +4928,20 @@ side-channel@^1.0.6: get-intrinsic "^1.2.4" object-inspect "^1.13.1" -socket.io-adapter@~2.5.2: - version "2.5.5" - resolved "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz#c7a1f9c703d7756844751b6ff9abfc1780664082" - integrity sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg== - dependencies: - debug "~4.3.4" - ws "~8.17.1" +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -socket.io-parser@~4.2.4: - version "4.2.4" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" - integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -socket.io@^4.4.1: - version "4.8.1" - resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz#fa0eaff965cc97fdf4245e8d4794618459f7558a" - integrity sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg== - dependencies: - accepts "~1.3.4" - base64id "~2.0.0" - cors "~2.8.5" - debug "~4.3.2" - engine.io "~6.6.0" - socket.io-adapter "~2.5.2" - socket.io-parser "~4.2.4" +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== sockjs@^0.3.24: version "0.3.24" @@ -4879,6 +4952,14 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -4887,26 +4968,11 @@ source-map-support@~0.5.20: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - -source-map@~0.5.3: - version "0.5.7" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - spdy-transport@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" @@ -4930,42 +4996,35 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + statuses@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.4.0 < 2", statuses@~1.5.0: +"statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stream-browserify@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" - integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== - dependencies: - inherits "~2.0.4" - readable-stream "^3.5.0" - -stream-http@^3.1.0: - version "3.2.0" - resolved "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" - integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.4" - readable-stream "^3.6.0" - xtend "^4.0.2" - -streamroller@^3.1.5: - version "3.1.5" - resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz#1263182329a45def1ffaef58d31b15d13d2ee7ff" - integrity sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw== +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: - date-format "^4.0.14" - debug "^4.3.4" - fs-extra "^8.1.0" + char-regex "^1.0.2" + strip-ansi "^6.0.0" string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" @@ -4976,7 +5035,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1, string_decoder@^1.3.0: +string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -4997,18 +5056,21 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-json-comments@3.1.1: +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@8.1.1, supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -5016,11 +5078,23 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -5047,6 +5121,15 @@ terser@^5.26.0: commander "^2.20.0" source-map-support "~0.5.20" +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + thingies@^1.20.0: version "1.21.0" resolved "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1" @@ -5057,17 +5140,10 @@ thunky@^1.0.2: resolved "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -timers-browserify@^2.0.11: - version "2.0.12" - resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" - integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== - dependencies: - setimmediate "^1.0.4" - -tmp@^0.2.1: - version "0.2.3" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" - integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-regex-range@^5.0.1: version "5.0.1" @@ -5081,6 +5157,23 @@ toidentifier@1.0.1: resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +tough-cookie@^4.1.2: + version "4.1.4" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + +tr46@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== + dependencies: + punycode "^2.1.1" + tree-dump@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" @@ -5091,15 +5184,15 @@ tslib@^2.0.0, tslib@^2.1.0: resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz#d124c86c3c05a40a91e6fdea4021bd31d377971b" integrity sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA== -tty-browserify@^0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" - integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-detect@^4.0.0, type-detect@^4.0.8: - version "4.1.0" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" - integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-is@~1.6.18: version "1.6.18" @@ -5114,11 +5207,6 @@ typescript@5.5.4: resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== -ua-parser-js@^0.7.30: - version "0.7.39" - resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.39.tgz#c71efb46ebeabc461c4612d22d54f88880fabe7e" - integrity sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w== - undici-types@~6.19.8: version "6.19.8" resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" @@ -5147,10 +5235,10 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" @@ -5172,30 +5260,19 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url@^0.11.0: - version "0.11.4" - resolved "https://registry.npmjs.org/url/-/url-0.11.4.tgz#adca77b3562d56b72746e76b330b7f27b6721f3c" - integrity sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg== +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: - punycode "^1.4.1" - qs "^6.12.3" + querystringify "^2.1.1" + requires-port "^1.0.0" util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@^0.12.1, util@^0.12.5: - version "0.12.5" - resolved "https://registry.npmjs.org/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" - integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - which-typed-array "^1.1.2" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -5206,20 +5283,33 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -vary@^1, vary@~1.1.2: +v8-to-istanbul@^9.0.1: + version "9.3.0" + resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" + integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +vary@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== -vm-browserify@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" - integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== + dependencies: + xml-name-validator "^4.0.0" -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung== +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" watchpack@^2.4.0: version "2.4.2" @@ -5236,12 +5326,10 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== - dependencies: - defaults "^1.0.3" +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== webpack-cli@5.1.4: version "5.1.4" @@ -5366,41 +5454,38 @@ websocket-extensions@>=0.1.1: resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -which-typed-array@^1.1.14, which-typed-array@^1.1.2: - version "1.1.15" - resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" - integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== +whatwg-encoding@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== + +whatwg-url@^11.0.0: + version "11.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.2" + tr46 "^3.0.0" + webidl-conversions "^7.0.0" -which@2.0.2, which@^2.0.1: +which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -which@^1.2.1: - version "1.3.1" - resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - wildcard@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== -workerpool@6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" - integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -5415,20 +5500,28 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@^8.18.0: +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +ws@^8.11.0, ws@^8.18.0: version "8.18.0" resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== -ws@~8.17.1: - version "8.17.1" - resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" - integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== -xtend@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== y18n@^5.0.5: version "5.0.8" @@ -5440,45 +5533,12 @@ yallist@^3.0.2: resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@16.2.0, yargs@^16.1.1: - version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^17.7.2: +yargs@^17.3.1, yargs@^17.7.2: version "17.7.2" resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From cbec4b985419a3ae30db3bb7d3872d51ae4ac717 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 10 Dec 2024 08:21:11 -0800 Subject: [PATCH 052/295] Add ts-node dep - needed to read jest.config.ts (#8670) --- e2e/package.json | 1 + e2e/yarn.lock | 90 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 99cf42f2d69..df9787e1ad3 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -29,6 +29,7 @@ "babel-loader": "8.3.0", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", + "ts-node": "10.9.2", "typescript": "5.5.4", "webpack": "5.76.0", "webpack-cli": "5.1.4", diff --git a/e2e/yarn.lock b/e2e/yarn.lock index f94b7e65ac2..e2454e7da6d 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -975,6 +975,13 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@discoveryjs/json-ext@^0.5.0": version "0.5.7" resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" @@ -1605,7 +1612,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== @@ -1628,6 +1635,14 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" @@ -1738,6 +1753,26 @@ resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/babel__core@^7.1.14": version "7.20.5" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -2193,14 +2228,14 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== -acorn-walk@^8.0.2: +acorn-walk@^8.0.2, acorn-walk@^8.1.1: version "8.3.4" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== dependencies: acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.4.1, acorn@^8.8.1: version "8.14.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== @@ -2293,6 +2328,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2730,6 +2770,11 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2856,6 +2901,11 @@ diff-sequences@^29.6.3: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dns-packet@^5.2.2: version "5.6.1" resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" @@ -4212,6 +4262,11 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -5179,6 +5234,25 @@ tree-dump@^1.0.1: resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== +ts-node@10.9.2: + version "10.9.2" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tslib@^2.0.0, tslib@^2.1.0: version "2.8.0" resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz#d124c86c3c05a40a91e6fdea4021bd31d377971b" @@ -5283,6 +5357,11 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-to-istanbul@^9.0.1: version "9.3.0" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" @@ -5551,6 +5630,11 @@ yargs@^17.3.1, yargs@^17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From a9a0b828322db7082a945f708a24be4d5a8021e6 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:29:04 -0700 Subject: [PATCH 053/295] Remove type references from the core Firestore API surface. This will support multiple entrypoints work. --- common/api-review/firestore-lite.api.md | 9 +++------ common/api-review/firestore.api.md | 9 +++------ packages/firestore/src/api/database.ts | 10 ---------- packages/firestore/src/api/pipeline_impl.ts | 6 ++++++ packages/firestore/src/lite-api/database.ts | 10 ---------- packages/firestore/src/lite-api/pipeline_impl.ts | 12 ++++++++++++ packages/firestore/src/lite-api/reference.ts | 10 ---------- .../firestore/test/integration/api/pipeline.test.ts | 2 +- 8 files changed, 25 insertions(+), 43 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 36d02015529..07af0bacd6e 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -1056,8 +1056,6 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; - // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta - pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1657,7 +1655,6 @@ export class Query | null; readonly firestore: Firestore; - pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2208,8 +2205,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9248:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9249:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9278:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9245:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9274:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 4b1e3bcc0b2..270c71fe955 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -1119,8 +1119,6 @@ export interface FindNearestOptions { // @public export class Firestore { get app(): FirebaseApp; - // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta - pipeline(): PipelineSource; toJSON(): object; type: 'firestore-lite' | 'firestore'; } @@ -1925,7 +1923,6 @@ export class Query | null; readonly firestore: Firestore; - pipeline(): Pipeline; readonly type: 'query' | 'collection'; withConverter(converter: null): Query; withConverter(converter: FirestoreDataConverter): Query; @@ -2512,8 +2509,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10204:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10200:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index bf36d469552..0757378a74c 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -46,7 +46,6 @@ import { connectFirestoreEmulator, Firestore as LiteFirestore } from '../lite-api/database'; -import type { PipelineSource } from '../lite-api/pipeline-source'; import { Query } from '../lite-api/reference'; import { indexedDbClearPersistence, @@ -129,15 +128,6 @@ export class Firestore extends LiteFirestore { await terminate; } } - - /** - * Pipeline query. - */ - pipeline(): PipelineSource { - throw new Error( - 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' - ); - } } /** diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts index b28821dbfe2..5d58266b343 100644 --- a/packages/firestore/src/api/pipeline_impl.ts +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -28,6 +28,12 @@ import { Firestore, ensureFirestoreConfigured } from './database'; import { DocumentReference, Query } from './reference'; import { ExpUserDataWriter } from './user_data_writer'; +declare module './database' { + interface Firestore { + pipeline(): PipelineSource; + } +} + /** * Experimental Modular API for console testing. * @param firestore diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 880ede2bed8..33b6afa8092 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -43,7 +43,6 @@ import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; // `import type` to avoid bundling the source for // pipelines if `useFluentPipelines()` is not called -import type { PipelineSource } from './pipeline-source'; import { DEFAULT_HOST, FirestoreSettingsImpl, @@ -176,15 +175,6 @@ export class Firestore implements FirestoreService { removeComponents(this); return Promise.resolve(); } - - /** - * Pipeline query. - */ - pipeline(): PipelineSource { - throw new Error( - 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' - ); - } } /** diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index c9ebe8ac7f5..f3556dc6f09 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -27,6 +27,18 @@ import { DocumentReference, Query } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { newUserDataReader } from './user_data_reader'; +declare module './database' { + interface Firestore { + pipeline(): PipelineSource; + } +} + +declare module './reference' { + interface Query { + pipeline(): Pipeline; + } +} + /** * Modular API for console experimentation. * @param pipeline Execute this pipeline. diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index db0949e9fbc..26ae2fbd433 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -37,7 +37,6 @@ import { AutoId } from '../util/misc'; import { Firestore } from './database'; import { FieldPath } from './field_path'; import { FieldValue } from './field_value'; -import type { Pipeline } from './pipeline'; import { FirestoreDataConverter } from './snapshot'; import { NestedUpdateFields, Primitive } from './types'; @@ -178,15 +177,6 @@ export class Query< this._query ); } - - /** - * Pipeline query. - */ - pipeline(): Pipeline { - throw new Error( - 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' - ); - } } /** diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 6d499a2a4df..ddedc966eb4 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -69,7 +69,7 @@ use(chaiAsPromised); setLogLevel('debug'); -apiDescribe.only('Pipelines', persistence => { +apiDescribe('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; let randomCol: CollectionReference; From 76c3641dc1e148a90d5a0891d7c66cc34a47b0fb Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 11 Dec 2024 12:33:21 -0800 Subject: [PATCH 054/295] Use ubuntu-latest for Firefox CI tests (#8671) --- .github/workflows/test-changed-auth.yml | 11 ++--------- .github/workflows/test-changed-firestore.yml | 18 ++++-------------- .github/workflows/test-changed.yml | 9 ++------- 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index f94d058fb04..e88ce3b7a52 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -70,19 +70,12 @@ jobs: run: xvfb-run yarn test:changed auth test-firefox: name: Test Auth on Firefox If Changed - # Whatever version of Firefox comes with 22.04 is causing Firefox - # startup to hang when launched by karma. Need to look further into - # why. - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: install Firefox stable - run: | - sudo apt-get update - sudo apt-get install firefox - sudo apt-get install wget - + run: npx @puppeteer/browsers install firefox@stable - name: Checkout Repo uses: actions/checkout@v4 with: diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 7a181702d35..259e9164d7f 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -169,17 +169,12 @@ jobs: compat-test-firefox: name: Test Firestore Compatible on Firefox - # Whatever version of Firefox comes with 22.04 is causing Firefox - # startup to hang when launched by karma. Need to look further into - # why. - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: build if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: install Firefox stable - run: | - sudo apt-get update - sudo apt-get install firefox + run: npx @puppeteer/browsers install firefox@stable - name: Set up Node (20) uses: actions/setup-node@v3 with: @@ -202,17 +197,12 @@ jobs: strategy: matrix: test-name: ["test:browser", "test:travis", "test:lite:browser", "test:browser:prod:nameddb", "test:lite:browser:nameddb"] - # Whatever version of Firefox comes with 22.04 is causing Firefox - # startup to hang when launched by karma. Need to look further into - # why. - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: build if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: install Firefox stable - run: | - sudo apt-get update - sudo apt-get install firefox + run: npx @puppeteer/browsers install firefox@stable - name: Download build archive uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 6499a825725..7dc0ef60a37 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -50,10 +50,7 @@ jobs: test-firefox: name: Test Packages With Changed Files in Firefox - # Whatever version of Firefox comes with 22.04 is causing Firefox - # startup to hang when launched by karma. Need to look further into - # why. - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout Repo @@ -65,9 +62,7 @@ jobs: with: node-version: 22.10.0 - name: install Firefox stable - run: | - sudo apt-get update - sudo apt-get install firefox + run: npx @puppeteer/browsers install firefox@stable - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json From e43d924f579446fda9efbae09e5ced04f3cd12cb Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 12 Dec 2024 05:56:29 -0800 Subject: [PATCH 055/295] Version Packages (#8672) Version Packages for release v11.1.0 --- .changeset/bright-scissors-care.md | 6 ------ .changeset/four-baboons-behave.md | 5 ----- .changeset/funny-weeks-attack.md | 5 ----- .changeset/neat-beans-rescue.md | 5 ----- integration/compat-interop/package.json | 12 ++++++------ integration/firebase/package.json | 2 +- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/CHANGELOG.md | 6 ++++++ packages/data-connect/package.json | 4 ++-- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 18 ++++++++++++++++++ packages/firebase/package.json | 18 +++++++++--------- packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 4 ++-- packages/functions-compat/CHANGELOG.md | 7 +++++++ packages/functions-compat/package.json | 6 +++--- packages/functions/CHANGELOG.md | 6 ++++++ packages/functions/package.json | 4 ++-- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/CHANGELOG.md | 7 +++++++ packages/messaging-compat/package.json | 6 +++--- packages/messaging/CHANGELOG.md | 6 ++++++ packages/messaging/package.json | 4 ++-- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- packages/vertexai/CHANGELOG.md | 6 ++++++ packages/vertexai/package.json | 4 ++-- repo-scripts/size-analysis/package.json | 2 +- 46 files changed, 125 insertions(+), 77 deletions(-) delete mode 100644 .changeset/bright-scissors-care.md delete mode 100644 .changeset/four-baboons-behave.md delete mode 100644 .changeset/funny-weeks-attack.md delete mode 100644 .changeset/neat-beans-rescue.md diff --git a/.changeset/bright-scissors-care.md b/.changeset/bright-scissors-care.md deleted file mode 100644 index b97b22b7248..00000000000 --- a/.changeset/bright-scissors-care.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/functions': minor -'firebase': minor ---- - -Add `.stream()` api for callable functions for consuming streaming responses. diff --git a/.changeset/four-baboons-behave.md b/.changeset/four-baboons-behave.md deleted file mode 100644 index 63c51a44c7e..00000000000 --- a/.changeset/four-baboons-behave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Clear fetch timeout after request completion. Fixes an issue that caused Node scripts to hang due to a pending timeout. diff --git a/.changeset/funny-weeks-attack.md b/.changeset/funny-weeks-attack.md deleted file mode 100644 index 54e26f5c749..00000000000 --- a/.changeset/funny-weeks-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/data-connect": patch ---- - -Fixed issue where multiple calls to connectDataConnectEmulator caused an exception diff --git a/.changeset/neat-beans-rescue.md b/.changeset/neat-beans-rescue.md deleted file mode 100644 index 278e5511da0..00000000000 --- a/.changeset/neat-beans-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/messaging': patch ---- - -Fix an issue where PushManager.subscribe() is called too soon after registering the default service worker. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 2b69327d1a0..7a9909c82a5 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,16 +8,16 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.10.16", - "@firebase/app-compat": "0.2.46", + "@firebase/app": "0.10.17", + "@firebase/app-compat": "0.2.47", "@firebase/analytics": "0.10.10", "@firebase/analytics-compat": "0.2.16", "@firebase/auth": "1.8.1", "@firebase/auth-compat": "0.5.16", - "@firebase/functions": "0.11.10", - "@firebase/functions-compat": "0.3.16", - "@firebase/messaging": "0.12.14", - "@firebase/messaging-compat": "0.2.14", + "@firebase/functions": "0.12.0", + "@firebase/functions-compat": "0.3.17", + "@firebase/messaging": "0.12.15", + "@firebase/messaging-compat": "0.2.15", "@firebase/performance": "0.6.11", "@firebase/performance-compat": "0.2.11", "@firebase/remote-config": "0.4.11", diff --git a/integration/firebase/package.json b/integration/firebase/package.json index 1b09cec2066..5406179f570 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -7,7 +7,7 @@ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { - "firebase": "11.0.2", + "firebase": "11.1.0", "@types/chai": "4.3.14", "@types/mocha": "9.1.1", "chai": "4.4.1", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 36f85e49a44..12c99e05918 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,7 +14,7 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "@firebase/firestore": "4.7.5" }, "devDependencies": { diff --git a/integration/messaging/package.json b/integration/messaging/package.json index a15a3af76e3..eb573f08198 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.0.2", + "firebase": "11.1.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 62e6a44748a..0220eafdf4e 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 4274daf2601..b3873a15bd7 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 6900ed957a7..2716d3474fe 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 4ef65cabc48..fd98e1567ad 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 711b44e7ca6..3f1b9d8fd19 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.47 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.10.17 + ## 0.2.46 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 13c63a539ca..4b6a7dda9ad 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.46", + "version": "0.2.47", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "@firebase/util": "1.10.2", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.11", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 7afb9b6fe81..f9b9989b2ad 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.10.17 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.10.16 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 5a751a846b2..64bcde54dc6 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.10.16", + "version": "0.10.17", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index c879b32c82c..d5b4eee9e8c 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 3accfee8f70..3b2904a414f 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 1e58217ac54..12c16191ee8 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +## 0.1.3 + +### Patch Changes + +- [`cb4309f13`](https://github.com/firebase/firebase-js-sdk/commit/cb4309f13a01a6c66eb502ae6f5d6fa93560ab06) [#8664](https://github.com/firebase/firebase-js-sdk/pull/8664) - Fixed issue where multiple calls to connectDataConnectEmulator caused an exception + ## 0.1.2 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index e2bab36a6f9..d7a8f31016e 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.1.2", + "version": "0.1.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 53b64fe0c9e..a997a64161d 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 3cdc6b5b574..b45a2649da3 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 91177890023..7edd041e36d 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,23 @@ # firebase +## 11.1.0 + +### Minor Changes + +- [`f05509e8c`](https://github.com/firebase/firebase-js-sdk/commit/f05509e8c526ce44656389ab9997a6e5ee957a3d) [#8609](https://github.com/firebase/firebase-js-sdk/pull/8609) - Add `.stream()` api for callable functions for consuming streaming responses. + +### Patch Changes + +- Updated dependencies [[`f05509e8c`](https://github.com/firebase/firebase-js-sdk/commit/f05509e8c526ce44656389ab9997a6e5ee957a3d), [`c540ba9ee`](https://github.com/firebase/firebase-js-sdk/commit/c540ba9eedd189ec8ac0932124d2cc400d1bd1d6), [`cb4309f13`](https://github.com/firebase/firebase-js-sdk/commit/cb4309f13a01a6c66eb502ae6f5d6fa93560ab06), [`1294e64c8`](https://github.com/firebase/firebase-js-sdk/commit/1294e64c813b6dbfb64f8dc24d90ec69a66f71ae)]: + - @firebase/functions@0.12.0 + - @firebase/app@0.10.17 + - @firebase/vertexai@1.0.2 + - @firebase/data-connect@0.1.3 + - @firebase/messaging@0.12.15 + - @firebase/functions-compat@0.3.17 + - @firebase/app-compat@0.2.47 + - @firebase/messaging-compat@0.2.15 + ## 11.0.2 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 38154234474..5047db48085 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.0.2", + "version": "11.1.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,22 +399,22 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.10.16", - "@firebase/app-compat": "0.2.46", + "@firebase/app": "0.10.17", + "@firebase/app-compat": "0.2.47", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.8.1", "@firebase/auth-compat": "0.5.16", - "@firebase/data-connect": "0.1.2", + "@firebase/data-connect": "0.1.3", "@firebase/database": "1.0.10", "@firebase/database-compat": "2.0.1", "@firebase/firestore": "4.7.5", "@firebase/firestore-compat": "0.3.40", - "@firebase/functions": "0.11.10", - "@firebase/functions-compat": "0.3.16", + "@firebase/functions": "0.12.0", + "@firebase/functions-compat": "0.3.17", "@firebase/installations": "0.6.11", "@firebase/installations-compat": "0.2.11", - "@firebase/messaging": "0.12.14", - "@firebase/messaging-compat": "0.2.14", + "@firebase/messaging": "0.12.15", + "@firebase/messaging-compat": "0.2.15", "@firebase/storage": "0.13.4", "@firebase/storage-compat": "0.3.14", "@firebase/performance": "0.6.11", @@ -426,7 +426,7 @@ "@firebase/app-check": "0.8.10", "@firebase/app-check-compat": "0.3.17", "@firebase/util": "1.10.2", - "@firebase/vertexai": "1.0.1" + "@firebase/vertexai": "1.0.2" }, "devDependencies": { "rollup": "2.79.1", diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 500ee4ef5ca..07431070d4e 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -53,7 +53,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "@types/eslint": "7.29.0", "rollup": "2.79.1", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index cde6244a769..7eae2da0203 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -106,8 +106,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.16", - "@firebase/app-compat": "0.2.46", + "@firebase/app": "0.10.17", + "@firebase/app-compat": "0.2.47", "@firebase/auth": "1.8.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index a3039cf5f8f..a2ffe7f3468 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/functions-compat +## 0.3.17 + +### Patch Changes + +- Updated dependencies [[`f05509e8c`](https://github.com/firebase/firebase-js-sdk/commit/f05509e8c526ce44656389ab9997a6e5ee957a3d)]: + - @firebase/functions@0.12.0 + ## 0.3.16 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 43f1c0dbbb2..85d5e7b0ede 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.16", + "version": "0.3.17", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -63,7 +63,7 @@ "typings": "dist/src/index.d.ts", "dependencies": { "@firebase/component": "0.6.11", - "@firebase/functions": "0.11.10", + "@firebase/functions": "0.12.0", "@firebase/functions-types": "0.6.3", "@firebase/util": "1.10.2", "tslib": "^2.1.0" diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index c96b0c93394..3774565f48e 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/functions +## 0.12.0 + +### Minor Changes + +- [`f05509e8c`](https://github.com/firebase/firebase-js-sdk/commit/f05509e8c526ce44656389ab9997a6e5ee957a3d) [#8609](https://github.com/firebase/firebase-js-sdk/pull/8609) - Add `.stream()` api for callable functions for consuming streaming responses. + ## 0.11.10 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index cc53d9120fb..331c5e94724 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.11.10", + "version": "0.12.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 33a409e0606..15630f28769 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index d6240ba4666..df0ab284b85 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index bc1d3388138..caabdcc525e 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/messaging-compat +## 0.2.15 + +### Patch Changes + +- Updated dependencies [[`1294e64c8`](https://github.com/firebase/firebase-js-sdk/commit/1294e64c813b6dbfb64f8dc24d90ec69a66f71ae)]: + - @firebase/messaging@0.12.15 + ## 0.2.14 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index fc398773866..6e4c248d935 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.14", + "version": "0.2.15", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.14", + "@firebase/messaging": "0.12.15", "@firebase/component": "0.6.11", "@firebase/util": "1.10.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", "ts-essentials": "9.3.0", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 53878d9abeb..d3e39df3b7c 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/messaging +## 0.12.15 + +### Patch Changes + +- [`1294e64c8`](https://github.com/firebase/firebase-js-sdk/commit/1294e64c813b6dbfb64f8dc24d90ec69a66f71ae) [#8661](https://github.com/firebase/firebase-js-sdk/pull/8661) (fixes [#7784](https://github.com/firebase/firebase-js-sdk/issues/7784)) - Fix an issue where PushManager.subscribe() is called too soon after registering the default service worker. + ## 0.12.14 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 5ae4a192fe0..51f0492cfe3 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.14", + "version": "0.12.15", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-json": "4.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index ce9cab87c7c..685e534c724 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.46" + "@firebase/app-compat": "0.2.47" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index 0c48828325a..7011c4a50f6 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -46,7 +46,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index dd23e6bf8a3..369c4127e0f 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.46" + "@firebase/app-compat": "0.2.47" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 3eba22c156f..75d856c7e11 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 4bb26cf22cc..0465bb55d78 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.46", + "@firebase/app-compat": "0.2.47", "@firebase/auth-compat": "0.5.16", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 42d5d3720ea..4b71174ca0a 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "@firebase/auth": "1.8.1", "rollup": "2.79.1", "@rollup/plugin-alias": "5.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 7d9aaa4df97..384d32cbc4a 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 15bfaaaf621..a3409024d5a 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/vertexai +## 1.0.2 + +### Patch Changes + +- [`c540ba9ee`](https://github.com/firebase/firebase-js-sdk/commit/c540ba9eedd189ec8ac0932124d2cc400d1bd1d6) [#8663](https://github.com/firebase/firebase-js-sdk/pull/8663) - Clear fetch timeout after request completion. Fixes an issue that caused Node scripts to hang due to a pending timeout. + ## 1.0.1 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index a3595df3aef..869bdfa3054 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.0.1", + "version": "1.0.2", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.16", + "@firebase/app": "0.10.17", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index c0fc5b8e817..cf5cfdf985e 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -42,7 +42,7 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/logger": "0.4.4", - "@firebase/app": "0.10.16" + "@firebase/app": "0.10.17" }, "repository": { "directory": "repo-scripts/size-analysis", From 46c91bc3bec2deb8079298ba2ddbcefc6d2cdd34 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 12 Dec 2024 13:12:38 -0500 Subject: [PATCH 056/295] Disable TOC array indentation (#8637) * Disable TOC array indentation * add function streaming toc docs --- docs-devsite/_toc.yaml | 1166 ++++++++++++------------ repo-scripts/api-documenter/src/toc.ts | 3 +- 2 files changed, 585 insertions(+), 584 deletions(-) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 9d60c12906c..ca06d4f9398 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -1,584 +1,584 @@ toc: - - title: firebase - path: /docs/reference/js/index - - title: analytics - path: /docs/reference/js/analytics.md - section: - - title: Analytics - path: /docs/reference/js/analytics.analytics.md - - title: AnalyticsCallOptions - path: /docs/reference/js/analytics.analyticscalloptions.md - - title: AnalyticsSettings - path: /docs/reference/js/analytics.analyticssettings.md - - title: ConsentSettings - path: /docs/reference/js/analytics.consentsettings.md - - title: ControlParams - path: /docs/reference/js/analytics.controlparams.md - - title: CustomParams - path: /docs/reference/js/analytics.customparams.md - - title: EventParams - path: /docs/reference/js/analytics.eventparams.md - - title: GtagConfigParams - path: /docs/reference/js/analytics.gtagconfigparams.md - - title: Item - path: /docs/reference/js/analytics.item.md - - title: Promotion - path: /docs/reference/js/analytics.promotion.md - - title: SettingsOptions - path: /docs/reference/js/analytics.settingsoptions.md - - title: app - path: /docs/reference/js/app.md - section: - - title: FirebaseApp - path: /docs/reference/js/app.firebaseapp.md - - title: FirebaseAppSettings - path: /docs/reference/js/app.firebaseappsettings.md - - title: FirebaseOptions - path: /docs/reference/js/app.firebaseoptions.md - - title: FirebaseServerApp - path: /docs/reference/js/app.firebaseserverapp.md - - title: FirebaseServerAppSettings - path: /docs/reference/js/app.firebaseserverappsettings.md - - title: app-check - path: /docs/reference/js/app-check.md - section: - - title: AppCheck - path: /docs/reference/js/app-check.appcheck.md - - title: AppCheckOptions - path: /docs/reference/js/app-check.appcheckoptions.md - - title: AppCheckToken - path: /docs/reference/js/app-check.appchecktoken.md - - title: AppCheckTokenResult - path: /docs/reference/js/app-check.appchecktokenresult.md - - title: CustomProvider - path: /docs/reference/js/app-check.customprovider.md - - title: CustomProviderOptions - path: /docs/reference/js/app-check.customprovideroptions.md - - title: ReCaptchaEnterpriseProvider - path: /docs/reference/js/app-check.recaptchaenterpriseprovider.md - - title: ReCaptchaV3Provider - path: /docs/reference/js/app-check.recaptchav3provider.md - - title: auth - path: /docs/reference/js/auth.md - section: - - title: ActionCodeInfo - path: /docs/reference/js/auth.actioncodeinfo.md - - title: ActionCodeSettings - path: /docs/reference/js/auth.actioncodesettings.md - - title: ActionCodeURL - path: /docs/reference/js/auth.actioncodeurl.md - - title: AdditionalUserInfo - path: /docs/reference/js/auth.additionaluserinfo.md - - title: ApplicationVerifier - path: /docs/reference/js/auth.applicationverifier.md - - title: Auth - path: /docs/reference/js/auth.auth.md - - title: AuthCredential - path: /docs/reference/js/auth.authcredential.md - - title: AuthError - path: /docs/reference/js/auth.autherror.md - - title: AuthErrorMap - path: /docs/reference/js/auth.autherrormap.md - - title: AuthProvider - path: /docs/reference/js/auth.authprovider.md - - title: AuthSettings - path: /docs/reference/js/auth.authsettings.md - - title: Config - path: /docs/reference/js/auth.config.md - - title: ConfirmationResult - path: /docs/reference/js/auth.confirmationresult.md - - title: Dependencies - path: /docs/reference/js/auth.dependencies.md - - title: EmailAuthCredential - path: /docs/reference/js/auth.emailauthcredential.md - - title: EmailAuthProvider - path: /docs/reference/js/auth.emailauthprovider.md - - title: EmulatorConfig - path: /docs/reference/js/auth.emulatorconfig.md - - title: FacebookAuthProvider - path: /docs/reference/js/auth.facebookauthprovider.md - - title: GithubAuthProvider - path: /docs/reference/js/auth.githubauthprovider.md - - title: GoogleAuthProvider - path: /docs/reference/js/auth.googleauthprovider.md - - title: IdTokenResult - path: /docs/reference/js/auth.idtokenresult.md - - title: MultiFactorAssertion - path: /docs/reference/js/auth.multifactorassertion.md - - title: MultiFactorError - path: /docs/reference/js/auth.multifactorerror.md - - title: MultiFactorInfo - path: /docs/reference/js/auth.multifactorinfo.md - - title: MultiFactorResolver - path: /docs/reference/js/auth.multifactorresolver.md - - title: MultiFactorSession - path: /docs/reference/js/auth.multifactorsession.md - - title: MultiFactorUser - path: /docs/reference/js/auth.multifactoruser.md - - title: OAuthCredential - path: /docs/reference/js/auth.oauthcredential.md - - title: OAuthCredentialOptions - path: /docs/reference/js/auth.oauthcredentialoptions.md - - title: OAuthProvider - path: /docs/reference/js/auth.oauthprovider.md - - title: ParsedToken - path: /docs/reference/js/auth.parsedtoken.md - - title: PasswordPolicy - path: /docs/reference/js/auth.passwordpolicy.md - - title: PasswordValidationStatus - path: /docs/reference/js/auth.passwordvalidationstatus.md - - title: Persistence - path: /docs/reference/js/auth.persistence.md - - title: PhoneAuthCredential - path: /docs/reference/js/auth.phoneauthcredential.md - - title: PhoneAuthProvider - path: /docs/reference/js/auth.phoneauthprovider.md - - title: PhoneMultiFactorAssertion - path: /docs/reference/js/auth.phonemultifactorassertion.md - - title: PhoneMultiFactorEnrollInfoOptions - path: /docs/reference/js/auth.phonemultifactorenrollinfooptions.md - - title: PhoneMultiFactorGenerator - path: /docs/reference/js/auth.phonemultifactorgenerator.md - - title: PhoneMultiFactorInfo - path: /docs/reference/js/auth.phonemultifactorinfo.md - - title: PhoneMultiFactorSignInInfoOptions - path: /docs/reference/js/auth.phonemultifactorsignininfooptions.md - - title: PhoneSingleFactorInfoOptions - path: /docs/reference/js/auth.phonesinglefactorinfooptions.md - - title: PopupRedirectResolver - path: /docs/reference/js/auth.popupredirectresolver.md - - title: ReactNativeAsyncStorage - path: /docs/reference/js/auth.reactnativeasyncstorage.md - - title: RecaptchaParameters - path: /docs/reference/js/auth.recaptchaparameters.md - - title: RecaptchaVerifier - path: /docs/reference/js/auth.recaptchaverifier.md - - title: SAMLAuthProvider - path: /docs/reference/js/auth.samlauthprovider.md - - title: TotpMultiFactorAssertion - path: /docs/reference/js/auth.totpmultifactorassertion.md - - title: TotpMultiFactorGenerator - path: /docs/reference/js/auth.totpmultifactorgenerator.md - - title: TotpMultiFactorInfo - path: /docs/reference/js/auth.totpmultifactorinfo.md - - title: TotpSecret - path: /docs/reference/js/auth.totpsecret.md - - title: TwitterAuthProvider - path: /docs/reference/js/auth.twitterauthprovider.md - - title: User - path: /docs/reference/js/auth.user.md - - title: UserCredential - path: /docs/reference/js/auth.usercredential.md - - title: UserInfo - path: /docs/reference/js/auth.userinfo.md - - title: UserMetadata - path: /docs/reference/js/auth.usermetadata.md - - title: database - path: /docs/reference/js/database.md - section: - - title: Database - path: /docs/reference/js/database.database.md - - title: DatabaseReference - path: /docs/reference/js/database.databasereference.md - - title: DataSnapshot - path: /docs/reference/js/database.datasnapshot.md - - title: IteratedDataSnapshot - path: /docs/reference/js/database.iterateddatasnapshot.md - - title: ListenOptions - path: /docs/reference/js/database.listenoptions.md - - title: OnDisconnect - path: /docs/reference/js/database.ondisconnect.md - - title: Query - path: /docs/reference/js/database.query.md - - title: QueryConstraint - path: /docs/reference/js/database.queryconstraint.md - - title: ThenableReference - path: /docs/reference/js/database.thenablereference.md - - title: TransactionOptions - path: /docs/reference/js/database.transactionoptions.md - - title: TransactionResult - path: /docs/reference/js/database.transactionresult.md - - title: firestore - path: /docs/reference/js/firestore_.md - section: - - title: AggregateField - path: /docs/reference/js/firestore_.aggregatefield.md - - title: AggregateQuerySnapshot - path: /docs/reference/js/firestore_.aggregatequerysnapshot.md - - title: AggregateSpec - path: /docs/reference/js/firestore_.aggregatespec.md - - title: Bytes - path: /docs/reference/js/firestore_.bytes.md - - title: CollectionReference - path: /docs/reference/js/firestore_.collectionreference.md - - title: DocumentChange - path: /docs/reference/js/firestore_.documentchange.md - - title: DocumentData - path: /docs/reference/js/firestore_.documentdata.md - - title: DocumentReference - path: /docs/reference/js/firestore_.documentreference.md - - title: DocumentSnapshot - path: /docs/reference/js/firestore_.documentsnapshot.md - - title: ExperimentalLongPollingOptions - path: /docs/reference/js/firestore_.experimentallongpollingoptions.md - - title: FieldPath - path: /docs/reference/js/firestore_.fieldpath.md - - title: FieldValue - path: /docs/reference/js/firestore_.fieldvalue.md - - title: Firestore - path: /docs/reference/js/firestore_.firestore.md - - title: FirestoreDataConverter - path: /docs/reference/js/firestore_.firestoredataconverter.md - - title: FirestoreError - path: /docs/reference/js/firestore_.firestoreerror.md - - title: FirestoreSettings - path: /docs/reference/js/firestore_.firestoresettings.md - - title: GeoPoint - path: /docs/reference/js/firestore_.geopoint.md - - title: Index - path: /docs/reference/js/firestore_.index.md - - title: IndexConfiguration - path: /docs/reference/js/firestore_.indexconfiguration.md - - title: IndexField - path: /docs/reference/js/firestore_.indexfield.md - - title: LoadBundleTask - path: /docs/reference/js/firestore_.loadbundletask.md - - title: LoadBundleTaskProgress - path: /docs/reference/js/firestore_.loadbundletaskprogress.md - - title: MemoryCacheSettings - path: /docs/reference/js/firestore_.memorycachesettings.md - - title: MemoryEagerGarbageCollector - path: /docs/reference/js/firestore_.memoryeagergarbagecollector.md - - title: MemoryLocalCache - path: /docs/reference/js/firestore_.memorylocalcache.md - - title: MemoryLruGarbageCollector - path: /docs/reference/js/firestore_.memorylrugarbagecollector.md - - title: PersistenceSettings - path: /docs/reference/js/firestore_.persistencesettings.md - - title: PersistentCacheIndexManager - path: /docs/reference/js/firestore_.persistentcacheindexmanager.md - - title: PersistentCacheSettings - path: /docs/reference/js/firestore_.persistentcachesettings.md - - title: PersistentLocalCache - path: /docs/reference/js/firestore_.persistentlocalcache.md - - title: PersistentMultipleTabManager - path: /docs/reference/js/firestore_.persistentmultipletabmanager.md - - title: PersistentSingleTabManager - path: /docs/reference/js/firestore_.persistentsingletabmanager.md - - title: PersistentSingleTabManagerSettings - path: /docs/reference/js/firestore_.persistentsingletabmanagersettings.md - - title: Query - path: /docs/reference/js/firestore_.query.md - - title: QueryCompositeFilterConstraint - path: /docs/reference/js/firestore_.querycompositefilterconstraint.md - - title: QueryConstraint - path: /docs/reference/js/firestore_.queryconstraint.md - - title: QueryDocumentSnapshot - path: /docs/reference/js/firestore_.querydocumentsnapshot.md - - title: QueryEndAtConstraint - path: /docs/reference/js/firestore_.queryendatconstraint.md - - title: QueryFieldFilterConstraint - path: /docs/reference/js/firestore_.queryfieldfilterconstraint.md - - title: QueryLimitConstraint - path: /docs/reference/js/firestore_.querylimitconstraint.md - - title: QueryOrderByConstraint - path: /docs/reference/js/firestore_.queryorderbyconstraint.md - - title: QuerySnapshot - path: /docs/reference/js/firestore_.querysnapshot.md - - title: QueryStartAtConstraint - path: /docs/reference/js/firestore_.querystartatconstraint.md - - title: SnapshotListenOptions - path: /docs/reference/js/firestore_.snapshotlistenoptions.md - - title: SnapshotMetadata - path: /docs/reference/js/firestore_.snapshotmetadata.md - - title: SnapshotOptions - path: /docs/reference/js/firestore_.snapshotoptions.md - - title: Timestamp - path: /docs/reference/js/firestore_.timestamp.md - - title: Transaction - path: /docs/reference/js/firestore_.transaction.md - - title: TransactionOptions - path: /docs/reference/js/firestore_.transactionoptions.md - - title: Unsubscribe - path: /docs/reference/js/firestore_.unsubscribe.md - - title: VectorValue - path: /docs/reference/js/firestore_.vectorvalue.md - - title: WriteBatch - path: /docs/reference/js/firestore_.writebatch.md - - title: firestore/lite - path: /docs/reference/js/firestore_lite.md - section: - - title: AggregateField - path: /docs/reference/js/firestore_lite.aggregatefield.md - - title: AggregateQuerySnapshot - path: /docs/reference/js/firestore_lite.aggregatequerysnapshot.md - - title: AggregateSpec - path: /docs/reference/js/firestore_lite.aggregatespec.md - - title: Bytes - path: /docs/reference/js/firestore_lite.bytes.md - - title: CollectionReference - path: /docs/reference/js/firestore_lite.collectionreference.md - - title: DocumentData - path: /docs/reference/js/firestore_lite.documentdata.md - - title: DocumentReference - path: /docs/reference/js/firestore_lite.documentreference.md - - title: DocumentSnapshot - path: /docs/reference/js/firestore_lite.documentsnapshot.md - - title: FieldPath - path: /docs/reference/js/firestore_lite.fieldpath.md - - title: FieldValue - path: /docs/reference/js/firestore_lite.fieldvalue.md - - title: Firestore - path: /docs/reference/js/firestore_lite.firestore.md - - title: FirestoreDataConverter - path: /docs/reference/js/firestore_lite.firestoredataconverter.md - - title: FirestoreError - path: /docs/reference/js/firestore_lite.firestoreerror.md - - title: GeoPoint - path: /docs/reference/js/firestore_lite.geopoint.md - - title: Query - path: /docs/reference/js/firestore_lite.query.md - - title: QueryCompositeFilterConstraint - path: /docs/reference/js/firestore_lite.querycompositefilterconstraint.md - - title: QueryConstraint - path: /docs/reference/js/firestore_lite.queryconstraint.md - - title: QueryDocumentSnapshot - path: /docs/reference/js/firestore_lite.querydocumentsnapshot.md - - title: QueryEndAtConstraint - path: /docs/reference/js/firestore_lite.queryendatconstraint.md - - title: QueryFieldFilterConstraint - path: /docs/reference/js/firestore_lite.queryfieldfilterconstraint.md - - title: QueryLimitConstraint - path: /docs/reference/js/firestore_lite.querylimitconstraint.md - - title: QueryOrderByConstraint - path: /docs/reference/js/firestore_lite.queryorderbyconstraint.md - - title: QuerySnapshot - path: /docs/reference/js/firestore_lite.querysnapshot.md - - title: QueryStartAtConstraint - path: /docs/reference/js/firestore_lite.querystartatconstraint.md - - title: Settings - path: /docs/reference/js/firestore_lite.settings.md - - title: Timestamp - path: /docs/reference/js/firestore_lite.timestamp.md - - title: Transaction - path: /docs/reference/js/firestore_lite.transaction.md - - title: TransactionOptions - path: /docs/reference/js/firestore_lite.transactionoptions.md - - title: VectorValue - path: /docs/reference/js/firestore_lite.vectorvalue.md - - title: WriteBatch - path: /docs/reference/js/firestore_lite.writebatch.md - - title: functions - path: /docs/reference/js/functions.md - section: - - title: Functions - path: /docs/reference/js/functions.functions.md - - title: FunctionsError - path: /docs/reference/js/functions.functionserror.md - - title: HttpsCallable - path: /docs/reference/js/functions.httpscallable.md - - title: HttpsCallableOptions - path: /docs/reference/js/functions.httpscallableoptions.md - - title: HttpsCallableResult - path: /docs/reference/js/functions.httpscallableresult.md - - title: HttpsCallableStreamOptions - path: /docs/reference/js/functions.httpscallablestreamoptions.md - - title: HttpsCallableStreamResult - path: /docs/reference/js/functions.httpscallablestreamresult.md - - title: installations - path: /docs/reference/js/installations.md - section: - - title: Installations - path: /docs/reference/js/installations.installations.md - - title: messaging - path: /docs/reference/js/messaging_.md - section: - - title: FcmOptions - path: /docs/reference/js/messaging_.fcmoptions.md - - title: GetTokenOptions - path: /docs/reference/js/messaging_.gettokenoptions.md - - title: MessagePayload - path: /docs/reference/js/messaging_.messagepayload.md - - title: Messaging - path: /docs/reference/js/messaging_.messaging.md - - title: NotificationPayload - path: /docs/reference/js/messaging_.notificationpayload.md - - title: messaging/sw - path: /docs/reference/js/messaging_sw.md - section: - - title: FcmOptions - path: /docs/reference/js/messaging_sw.fcmoptions.md - - title: GetTokenOptions - path: /docs/reference/js/messaging_sw.gettokenoptions.md - - title: MessagePayload - path: /docs/reference/js/messaging_sw.messagepayload.md - - title: Messaging - path: /docs/reference/js/messaging_sw.messaging.md - - title: NotificationPayload - path: /docs/reference/js/messaging_sw.notificationpayload.md - - title: performance - path: /docs/reference/js/performance.md - section: - - title: FirebasePerformance - path: /docs/reference/js/performance.firebaseperformance.md - - title: PerformanceSettings - path: /docs/reference/js/performance.performancesettings.md - - title: PerformanceTrace - path: /docs/reference/js/performance.performancetrace.md - - title: remote-config - path: /docs/reference/js/remote-config.md - section: - - title: RemoteConfig - path: /docs/reference/js/remote-config.remoteconfig.md - - title: RemoteConfigSettings - path: /docs/reference/js/remote-config.remoteconfigsettings.md - - title: Value - path: /docs/reference/js/remote-config.value.md - - title: storage - path: /docs/reference/js/storage.md - section: - - title: FirebaseStorage - path: /docs/reference/js/storage.firebasestorage.md - - title: FullMetadata - path: /docs/reference/js/storage.fullmetadata.md - - title: ListOptions - path: /docs/reference/js/storage.listoptions.md - - title: ListResult - path: /docs/reference/js/storage.listresult.md - - title: SettableMetadata - path: /docs/reference/js/storage.settablemetadata.md - - title: StorageError - path: /docs/reference/js/storage.storageerror.md - - title: StorageObserver - path: /docs/reference/js/storage.storageobserver.md - - title: StorageReference - path: /docs/reference/js/storage.storagereference.md - - title: UploadMetadata - path: /docs/reference/js/storage.uploadmetadata.md - - title: UploadResult - path: /docs/reference/js/storage.uploadresult.md - - title: UploadTask - path: /docs/reference/js/storage.uploadtask.md - - title: UploadTaskSnapshot - path: /docs/reference/js/storage.uploadtasksnapshot.md - - title: vertexai - path: /docs/reference/js/vertexai.md - section: - - title: ArraySchema - path: /docs/reference/js/vertexai.arrayschema.md - - title: BaseParams - path: /docs/reference/js/vertexai.baseparams.md - - title: BooleanSchema - path: /docs/reference/js/vertexai.booleanschema.md - - title: ChatSession - path: /docs/reference/js/vertexai.chatsession.md - - title: Citation - path: /docs/reference/js/vertexai.citation.md - - title: CitationMetadata - path: /docs/reference/js/vertexai.citationmetadata.md - - title: Content - path: /docs/reference/js/vertexai.content.md - - title: CountTokensRequest - path: /docs/reference/js/vertexai.counttokensrequest.md - - title: CountTokensResponse - path: /docs/reference/js/vertexai.counttokensresponse.md - - title: CustomErrorData - path: /docs/reference/js/vertexai.customerrordata.md - - title: Date_2 - path: /docs/reference/js/vertexai.date_2.md - - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md - - title: ErrorDetails - path: /docs/reference/js/vertexai.errordetails.md - - title: FileData - path: /docs/reference/js/vertexai.filedata.md - - title: FileDataPart - path: /docs/reference/js/vertexai.filedatapart.md - - title: FunctionCall - path: /docs/reference/js/vertexai.functioncall.md - - title: FunctionCallingConfig - path: /docs/reference/js/vertexai.functioncallingconfig.md - - title: FunctionCallPart - path: /docs/reference/js/vertexai.functioncallpart.md - - title: FunctionDeclaration - path: /docs/reference/js/vertexai.functiondeclaration.md - - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai.functiondeclarationstool.md - - title: FunctionResponse - path: /docs/reference/js/vertexai.functionresponse.md - - title: FunctionResponsePart - path: /docs/reference/js/vertexai.functionresponsepart.md - - title: GenerateContentCandidate - path: /docs/reference/js/vertexai.generatecontentcandidate.md - - title: GenerateContentRequest - path: /docs/reference/js/vertexai.generatecontentrequest.md - - title: GenerateContentResponse - path: /docs/reference/js/vertexai.generatecontentresponse.md - - title: GenerateContentResult - path: /docs/reference/js/vertexai.generatecontentresult.md - - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai.generatecontentstreamresult.md - - title: GenerationConfig - path: /docs/reference/js/vertexai.generationconfig.md - - title: GenerativeContentBlob - path: /docs/reference/js/vertexai.generativecontentblob.md - - title: GenerativeModel - path: /docs/reference/js/vertexai.generativemodel.md - - title: GroundingAttribution - path: /docs/reference/js/vertexai.groundingattribution.md - - title: GroundingMetadata - path: /docs/reference/js/vertexai.groundingmetadata.md - - title: InlineDataPart - path: /docs/reference/js/vertexai.inlinedatapart.md - - title: IntegerSchema - path: /docs/reference/js/vertexai.integerschema.md - - title: ModelParams - path: /docs/reference/js/vertexai.modelparams.md - - title: NumberSchema - path: /docs/reference/js/vertexai.numberschema.md - - title: ObjectSchema - path: /docs/reference/js/vertexai.objectschema.md - - title: ObjectSchemaInterface - path: /docs/reference/js/vertexai.objectschemainterface.md - - title: PromptFeedback - path: /docs/reference/js/vertexai.promptfeedback.md - - title: RequestOptions - path: /docs/reference/js/vertexai.requestoptions.md - - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai.retrievedcontextattribution.md - - title: SafetyRating - path: /docs/reference/js/vertexai.safetyrating.md - - title: SafetySetting - path: /docs/reference/js/vertexai.safetysetting.md - - title: Schema - path: /docs/reference/js/vertexai.schema.md - - title: SchemaInterface - path: /docs/reference/js/vertexai.schemainterface.md - - title: SchemaParams - path: /docs/reference/js/vertexai.schemaparams.md - - title: SchemaRequest - path: /docs/reference/js/vertexai.schemarequest.md - - title: SchemaShared - path: /docs/reference/js/vertexai.schemashared.md - - title: Segment - path: /docs/reference/js/vertexai.segment.md - - title: StartChatParams - path: /docs/reference/js/vertexai.startchatparams.md - - title: StringSchema - path: /docs/reference/js/vertexai.stringschema.md - - title: TextPart - path: /docs/reference/js/vertexai.textpart.md - - title: ToolConfig - path: /docs/reference/js/vertexai.toolconfig.md - - title: UsageMetadata - path: /docs/reference/js/vertexai.usagemetadata.md - - title: VertexAI - path: /docs/reference/js/vertexai.vertexai.md - - title: VertexAIError - path: /docs/reference/js/vertexai.vertexaierror.md - - title: VertexAIOptions - path: /docs/reference/js/vertexai.vertexaioptions.md - - title: VideoMetadata - path: /docs/reference/js/vertexai.videometadata.md - - title: WebAttribution - path: /docs/reference/js/vertexai.webattribution.md +- title: firebase + path: /docs/reference/js/index +- title: analytics + path: /docs/reference/js/analytics.md + section: + - title: Analytics + path: /docs/reference/js/analytics.analytics.md + - title: AnalyticsCallOptions + path: /docs/reference/js/analytics.analyticscalloptions.md + - title: AnalyticsSettings + path: /docs/reference/js/analytics.analyticssettings.md + - title: ConsentSettings + path: /docs/reference/js/analytics.consentsettings.md + - title: ControlParams + path: /docs/reference/js/analytics.controlparams.md + - title: CustomParams + path: /docs/reference/js/analytics.customparams.md + - title: EventParams + path: /docs/reference/js/analytics.eventparams.md + - title: GtagConfigParams + path: /docs/reference/js/analytics.gtagconfigparams.md + - title: Item + path: /docs/reference/js/analytics.item.md + - title: Promotion + path: /docs/reference/js/analytics.promotion.md + - title: SettingsOptions + path: /docs/reference/js/analytics.settingsoptions.md +- title: app + path: /docs/reference/js/app.md + section: + - title: FirebaseApp + path: /docs/reference/js/app.firebaseapp.md + - title: FirebaseAppSettings + path: /docs/reference/js/app.firebaseappsettings.md + - title: FirebaseOptions + path: /docs/reference/js/app.firebaseoptions.md + - title: FirebaseServerApp + path: /docs/reference/js/app.firebaseserverapp.md + - title: FirebaseServerAppSettings + path: /docs/reference/js/app.firebaseserverappsettings.md +- title: app-check + path: /docs/reference/js/app-check.md + section: + - title: AppCheck + path: /docs/reference/js/app-check.appcheck.md + - title: AppCheckOptions + path: /docs/reference/js/app-check.appcheckoptions.md + - title: AppCheckToken + path: /docs/reference/js/app-check.appchecktoken.md + - title: AppCheckTokenResult + path: /docs/reference/js/app-check.appchecktokenresult.md + - title: CustomProvider + path: /docs/reference/js/app-check.customprovider.md + - title: CustomProviderOptions + path: /docs/reference/js/app-check.customprovideroptions.md + - title: ReCaptchaEnterpriseProvider + path: /docs/reference/js/app-check.recaptchaenterpriseprovider.md + - title: ReCaptchaV3Provider + path: /docs/reference/js/app-check.recaptchav3provider.md +- title: auth + path: /docs/reference/js/auth.md + section: + - title: ActionCodeInfo + path: /docs/reference/js/auth.actioncodeinfo.md + - title: ActionCodeSettings + path: /docs/reference/js/auth.actioncodesettings.md + - title: ActionCodeURL + path: /docs/reference/js/auth.actioncodeurl.md + - title: AdditionalUserInfo + path: /docs/reference/js/auth.additionaluserinfo.md + - title: ApplicationVerifier + path: /docs/reference/js/auth.applicationverifier.md + - title: Auth + path: /docs/reference/js/auth.auth.md + - title: AuthCredential + path: /docs/reference/js/auth.authcredential.md + - title: AuthError + path: /docs/reference/js/auth.autherror.md + - title: AuthErrorMap + path: /docs/reference/js/auth.autherrormap.md + - title: AuthProvider + path: /docs/reference/js/auth.authprovider.md + - title: AuthSettings + path: /docs/reference/js/auth.authsettings.md + - title: Config + path: /docs/reference/js/auth.config.md + - title: ConfirmationResult + path: /docs/reference/js/auth.confirmationresult.md + - title: Dependencies + path: /docs/reference/js/auth.dependencies.md + - title: EmailAuthCredential + path: /docs/reference/js/auth.emailauthcredential.md + - title: EmailAuthProvider + path: /docs/reference/js/auth.emailauthprovider.md + - title: EmulatorConfig + path: /docs/reference/js/auth.emulatorconfig.md + - title: FacebookAuthProvider + path: /docs/reference/js/auth.facebookauthprovider.md + - title: GithubAuthProvider + path: /docs/reference/js/auth.githubauthprovider.md + - title: GoogleAuthProvider + path: /docs/reference/js/auth.googleauthprovider.md + - title: IdTokenResult + path: /docs/reference/js/auth.idtokenresult.md + - title: MultiFactorAssertion + path: /docs/reference/js/auth.multifactorassertion.md + - title: MultiFactorError + path: /docs/reference/js/auth.multifactorerror.md + - title: MultiFactorInfo + path: /docs/reference/js/auth.multifactorinfo.md + - title: MultiFactorResolver + path: /docs/reference/js/auth.multifactorresolver.md + - title: MultiFactorSession + path: /docs/reference/js/auth.multifactorsession.md + - title: MultiFactorUser + path: /docs/reference/js/auth.multifactoruser.md + - title: OAuthCredential + path: /docs/reference/js/auth.oauthcredential.md + - title: OAuthCredentialOptions + path: /docs/reference/js/auth.oauthcredentialoptions.md + - title: OAuthProvider + path: /docs/reference/js/auth.oauthprovider.md + - title: ParsedToken + path: /docs/reference/js/auth.parsedtoken.md + - title: PasswordPolicy + path: /docs/reference/js/auth.passwordpolicy.md + - title: PasswordValidationStatus + path: /docs/reference/js/auth.passwordvalidationstatus.md + - title: Persistence + path: /docs/reference/js/auth.persistence.md + - title: PhoneAuthCredential + path: /docs/reference/js/auth.phoneauthcredential.md + - title: PhoneAuthProvider + path: /docs/reference/js/auth.phoneauthprovider.md + - title: PhoneMultiFactorAssertion + path: /docs/reference/js/auth.phonemultifactorassertion.md + - title: PhoneMultiFactorEnrollInfoOptions + path: /docs/reference/js/auth.phonemultifactorenrollinfooptions.md + - title: PhoneMultiFactorGenerator + path: /docs/reference/js/auth.phonemultifactorgenerator.md + - title: PhoneMultiFactorInfo + path: /docs/reference/js/auth.phonemultifactorinfo.md + - title: PhoneMultiFactorSignInInfoOptions + path: /docs/reference/js/auth.phonemultifactorsignininfooptions.md + - title: PhoneSingleFactorInfoOptions + path: /docs/reference/js/auth.phonesinglefactorinfooptions.md + - title: PopupRedirectResolver + path: /docs/reference/js/auth.popupredirectresolver.md + - title: ReactNativeAsyncStorage + path: /docs/reference/js/auth.reactnativeasyncstorage.md + - title: RecaptchaParameters + path: /docs/reference/js/auth.recaptchaparameters.md + - title: RecaptchaVerifier + path: /docs/reference/js/auth.recaptchaverifier.md + - title: SAMLAuthProvider + path: /docs/reference/js/auth.samlauthprovider.md + - title: TotpMultiFactorAssertion + path: /docs/reference/js/auth.totpmultifactorassertion.md + - title: TotpMultiFactorGenerator + path: /docs/reference/js/auth.totpmultifactorgenerator.md + - title: TotpMultiFactorInfo + path: /docs/reference/js/auth.totpmultifactorinfo.md + - title: TotpSecret + path: /docs/reference/js/auth.totpsecret.md + - title: TwitterAuthProvider + path: /docs/reference/js/auth.twitterauthprovider.md + - title: User + path: /docs/reference/js/auth.user.md + - title: UserCredential + path: /docs/reference/js/auth.usercredential.md + - title: UserInfo + path: /docs/reference/js/auth.userinfo.md + - title: UserMetadata + path: /docs/reference/js/auth.usermetadata.md +- title: database + path: /docs/reference/js/database.md + section: + - title: Database + path: /docs/reference/js/database.database.md + - title: DatabaseReference + path: /docs/reference/js/database.databasereference.md + - title: DataSnapshot + path: /docs/reference/js/database.datasnapshot.md + - title: IteratedDataSnapshot + path: /docs/reference/js/database.iterateddatasnapshot.md + - title: ListenOptions + path: /docs/reference/js/database.listenoptions.md + - title: OnDisconnect + path: /docs/reference/js/database.ondisconnect.md + - title: Query + path: /docs/reference/js/database.query.md + - title: QueryConstraint + path: /docs/reference/js/database.queryconstraint.md + - title: ThenableReference + path: /docs/reference/js/database.thenablereference.md + - title: TransactionOptions + path: /docs/reference/js/database.transactionoptions.md + - title: TransactionResult + path: /docs/reference/js/database.transactionresult.md +- title: firestore + path: /docs/reference/js/firestore_.md + section: + - title: AggregateField + path: /docs/reference/js/firestore_.aggregatefield.md + - title: AggregateQuerySnapshot + path: /docs/reference/js/firestore_.aggregatequerysnapshot.md + - title: AggregateSpec + path: /docs/reference/js/firestore_.aggregatespec.md + - title: Bytes + path: /docs/reference/js/firestore_.bytes.md + - title: CollectionReference + path: /docs/reference/js/firestore_.collectionreference.md + - title: DocumentChange + path: /docs/reference/js/firestore_.documentchange.md + - title: DocumentData + path: /docs/reference/js/firestore_.documentdata.md + - title: DocumentReference + path: /docs/reference/js/firestore_.documentreference.md + - title: DocumentSnapshot + path: /docs/reference/js/firestore_.documentsnapshot.md + - title: ExperimentalLongPollingOptions + path: /docs/reference/js/firestore_.experimentallongpollingoptions.md + - title: FieldPath + path: /docs/reference/js/firestore_.fieldpath.md + - title: FieldValue + path: /docs/reference/js/firestore_.fieldvalue.md + - title: Firestore + path: /docs/reference/js/firestore_.firestore.md + - title: FirestoreDataConverter + path: /docs/reference/js/firestore_.firestoredataconverter.md + - title: FirestoreError + path: /docs/reference/js/firestore_.firestoreerror.md + - title: FirestoreSettings + path: /docs/reference/js/firestore_.firestoresettings.md + - title: GeoPoint + path: /docs/reference/js/firestore_.geopoint.md + - title: Index + path: /docs/reference/js/firestore_.index.md + - title: IndexConfiguration + path: /docs/reference/js/firestore_.indexconfiguration.md + - title: IndexField + path: /docs/reference/js/firestore_.indexfield.md + - title: LoadBundleTask + path: /docs/reference/js/firestore_.loadbundletask.md + - title: LoadBundleTaskProgress + path: /docs/reference/js/firestore_.loadbundletaskprogress.md + - title: MemoryCacheSettings + path: /docs/reference/js/firestore_.memorycachesettings.md + - title: MemoryEagerGarbageCollector + path: /docs/reference/js/firestore_.memoryeagergarbagecollector.md + - title: MemoryLocalCache + path: /docs/reference/js/firestore_.memorylocalcache.md + - title: MemoryLruGarbageCollector + path: /docs/reference/js/firestore_.memorylrugarbagecollector.md + - title: PersistenceSettings + path: /docs/reference/js/firestore_.persistencesettings.md + - title: PersistentCacheIndexManager + path: /docs/reference/js/firestore_.persistentcacheindexmanager.md + - title: PersistentCacheSettings + path: /docs/reference/js/firestore_.persistentcachesettings.md + - title: PersistentLocalCache + path: /docs/reference/js/firestore_.persistentlocalcache.md + - title: PersistentMultipleTabManager + path: /docs/reference/js/firestore_.persistentmultipletabmanager.md + - title: PersistentSingleTabManager + path: /docs/reference/js/firestore_.persistentsingletabmanager.md + - title: PersistentSingleTabManagerSettings + path: /docs/reference/js/firestore_.persistentsingletabmanagersettings.md + - title: Query + path: /docs/reference/js/firestore_.query.md + - title: QueryCompositeFilterConstraint + path: /docs/reference/js/firestore_.querycompositefilterconstraint.md + - title: QueryConstraint + path: /docs/reference/js/firestore_.queryconstraint.md + - title: QueryDocumentSnapshot + path: /docs/reference/js/firestore_.querydocumentsnapshot.md + - title: QueryEndAtConstraint + path: /docs/reference/js/firestore_.queryendatconstraint.md + - title: QueryFieldFilterConstraint + path: /docs/reference/js/firestore_.queryfieldfilterconstraint.md + - title: QueryLimitConstraint + path: /docs/reference/js/firestore_.querylimitconstraint.md + - title: QueryOrderByConstraint + path: /docs/reference/js/firestore_.queryorderbyconstraint.md + - title: QuerySnapshot + path: /docs/reference/js/firestore_.querysnapshot.md + - title: QueryStartAtConstraint + path: /docs/reference/js/firestore_.querystartatconstraint.md + - title: SnapshotListenOptions + path: /docs/reference/js/firestore_.snapshotlistenoptions.md + - title: SnapshotMetadata + path: /docs/reference/js/firestore_.snapshotmetadata.md + - title: SnapshotOptions + path: /docs/reference/js/firestore_.snapshotoptions.md + - title: Timestamp + path: /docs/reference/js/firestore_.timestamp.md + - title: Transaction + path: /docs/reference/js/firestore_.transaction.md + - title: TransactionOptions + path: /docs/reference/js/firestore_.transactionoptions.md + - title: Unsubscribe + path: /docs/reference/js/firestore_.unsubscribe.md + - title: VectorValue + path: /docs/reference/js/firestore_.vectorvalue.md + - title: WriteBatch + path: /docs/reference/js/firestore_.writebatch.md +- title: firestore/lite + path: /docs/reference/js/firestore_lite.md + section: + - title: AggregateField + path: /docs/reference/js/firestore_lite.aggregatefield.md + - title: AggregateQuerySnapshot + path: /docs/reference/js/firestore_lite.aggregatequerysnapshot.md + - title: AggregateSpec + path: /docs/reference/js/firestore_lite.aggregatespec.md + - title: Bytes + path: /docs/reference/js/firestore_lite.bytes.md + - title: CollectionReference + path: /docs/reference/js/firestore_lite.collectionreference.md + - title: DocumentData + path: /docs/reference/js/firestore_lite.documentdata.md + - title: DocumentReference + path: /docs/reference/js/firestore_lite.documentreference.md + - title: DocumentSnapshot + path: /docs/reference/js/firestore_lite.documentsnapshot.md + - title: FieldPath + path: /docs/reference/js/firestore_lite.fieldpath.md + - title: FieldValue + path: /docs/reference/js/firestore_lite.fieldvalue.md + - title: Firestore + path: /docs/reference/js/firestore_lite.firestore.md + - title: FirestoreDataConverter + path: /docs/reference/js/firestore_lite.firestoredataconverter.md + - title: FirestoreError + path: /docs/reference/js/firestore_lite.firestoreerror.md + - title: GeoPoint + path: /docs/reference/js/firestore_lite.geopoint.md + - title: Query + path: /docs/reference/js/firestore_lite.query.md + - title: QueryCompositeFilterConstraint + path: /docs/reference/js/firestore_lite.querycompositefilterconstraint.md + - title: QueryConstraint + path: /docs/reference/js/firestore_lite.queryconstraint.md + - title: QueryDocumentSnapshot + path: /docs/reference/js/firestore_lite.querydocumentsnapshot.md + - title: QueryEndAtConstraint + path: /docs/reference/js/firestore_lite.queryendatconstraint.md + - title: QueryFieldFilterConstraint + path: /docs/reference/js/firestore_lite.queryfieldfilterconstraint.md + - title: QueryLimitConstraint + path: /docs/reference/js/firestore_lite.querylimitconstraint.md + - title: QueryOrderByConstraint + path: /docs/reference/js/firestore_lite.queryorderbyconstraint.md + - title: QuerySnapshot + path: /docs/reference/js/firestore_lite.querysnapshot.md + - title: QueryStartAtConstraint + path: /docs/reference/js/firestore_lite.querystartatconstraint.md + - title: Settings + path: /docs/reference/js/firestore_lite.settings.md + - title: Timestamp + path: /docs/reference/js/firestore_lite.timestamp.md + - title: Transaction + path: /docs/reference/js/firestore_lite.transaction.md + - title: TransactionOptions + path: /docs/reference/js/firestore_lite.transactionoptions.md + - title: VectorValue + path: /docs/reference/js/firestore_lite.vectorvalue.md + - title: WriteBatch + path: /docs/reference/js/firestore_lite.writebatch.md +- title: functions + path: /docs/reference/js/functions.md + section: + - title: Functions + path: /docs/reference/js/functions.functions.md + - title: FunctionsError + path: /docs/reference/js/functions.functionserror.md + - title: HttpsCallable + path: /docs/reference/js/functions.httpscallable.md + - title: HttpsCallableOptions + path: /docs/reference/js/functions.httpscallableoptions.md + - title: HttpsCallableResult + path: /docs/reference/js/functions.httpscallableresult.md + - title: HttpsCallableStreamOptions + path: /docs/reference/js/functions.httpscallablestreamoptions.md + - title: HttpsCallableStreamResult + path: /docs/reference/js/functions.httpscallablestreamresult.md +- title: installations + path: /docs/reference/js/installations.md + section: + - title: Installations + path: /docs/reference/js/installations.installations.md +- title: messaging + path: /docs/reference/js/messaging_.md + section: + - title: FcmOptions + path: /docs/reference/js/messaging_.fcmoptions.md + - title: GetTokenOptions + path: /docs/reference/js/messaging_.gettokenoptions.md + - title: MessagePayload + path: /docs/reference/js/messaging_.messagepayload.md + - title: Messaging + path: /docs/reference/js/messaging_.messaging.md + - title: NotificationPayload + path: /docs/reference/js/messaging_.notificationpayload.md +- title: messaging/sw + path: /docs/reference/js/messaging_sw.md + section: + - title: FcmOptions + path: /docs/reference/js/messaging_sw.fcmoptions.md + - title: GetTokenOptions + path: /docs/reference/js/messaging_sw.gettokenoptions.md + - title: MessagePayload + path: /docs/reference/js/messaging_sw.messagepayload.md + - title: Messaging + path: /docs/reference/js/messaging_sw.messaging.md + - title: NotificationPayload + path: /docs/reference/js/messaging_sw.notificationpayload.md +- title: performance + path: /docs/reference/js/performance.md + section: + - title: FirebasePerformance + path: /docs/reference/js/performance.firebaseperformance.md + - title: PerformanceSettings + path: /docs/reference/js/performance.performancesettings.md + - title: PerformanceTrace + path: /docs/reference/js/performance.performancetrace.md +- title: remote-config + path: /docs/reference/js/remote-config.md + section: + - title: RemoteConfig + path: /docs/reference/js/remote-config.remoteconfig.md + - title: RemoteConfigSettings + path: /docs/reference/js/remote-config.remoteconfigsettings.md + - title: Value + path: /docs/reference/js/remote-config.value.md +- title: storage + path: /docs/reference/js/storage.md + section: + - title: FirebaseStorage + path: /docs/reference/js/storage.firebasestorage.md + - title: FullMetadata + path: /docs/reference/js/storage.fullmetadata.md + - title: ListOptions + path: /docs/reference/js/storage.listoptions.md + - title: ListResult + path: /docs/reference/js/storage.listresult.md + - title: SettableMetadata + path: /docs/reference/js/storage.settablemetadata.md + - title: StorageError + path: /docs/reference/js/storage.storageerror.md + - title: StorageObserver + path: /docs/reference/js/storage.storageobserver.md + - title: StorageReference + path: /docs/reference/js/storage.storagereference.md + - title: UploadMetadata + path: /docs/reference/js/storage.uploadmetadata.md + - title: UploadResult + path: /docs/reference/js/storage.uploadresult.md + - title: UploadTask + path: /docs/reference/js/storage.uploadtask.md + - title: UploadTaskSnapshot + path: /docs/reference/js/storage.uploadtasksnapshot.md +- title: vertexai + path: /docs/reference/js/vertexai.md + section: + - title: ArraySchema + path: /docs/reference/js/vertexai.arrayschema.md + - title: BaseParams + path: /docs/reference/js/vertexai.baseparams.md + - title: BooleanSchema + path: /docs/reference/js/vertexai.booleanschema.md + - title: ChatSession + path: /docs/reference/js/vertexai.chatsession.md + - title: Citation + path: /docs/reference/js/vertexai.citation.md + - title: CitationMetadata + path: /docs/reference/js/vertexai.citationmetadata.md + - title: Content + path: /docs/reference/js/vertexai.content.md + - title: CountTokensRequest + path: /docs/reference/js/vertexai.counttokensrequest.md + - title: CountTokensResponse + path: /docs/reference/js/vertexai.counttokensresponse.md + - title: CustomErrorData + path: /docs/reference/js/vertexai.customerrordata.md + - title: Date_2 + path: /docs/reference/js/vertexai.date_2.md + - title: EnhancedGenerateContentResponse + path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md + - title: ErrorDetails + path: /docs/reference/js/vertexai.errordetails.md + - title: FileData + path: /docs/reference/js/vertexai.filedata.md + - title: FileDataPart + path: /docs/reference/js/vertexai.filedatapart.md + - title: FunctionCall + path: /docs/reference/js/vertexai.functioncall.md + - title: FunctionCallingConfig + path: /docs/reference/js/vertexai.functioncallingconfig.md + - title: FunctionCallPart + path: /docs/reference/js/vertexai.functioncallpart.md + - title: FunctionDeclaration + path: /docs/reference/js/vertexai.functiondeclaration.md + - title: FunctionDeclarationsTool + path: /docs/reference/js/vertexai.functiondeclarationstool.md + - title: FunctionResponse + path: /docs/reference/js/vertexai.functionresponse.md + - title: FunctionResponsePart + path: /docs/reference/js/vertexai.functionresponsepart.md + - title: GenerateContentCandidate + path: /docs/reference/js/vertexai.generatecontentcandidate.md + - title: GenerateContentRequest + path: /docs/reference/js/vertexai.generatecontentrequest.md + - title: GenerateContentResponse + path: /docs/reference/js/vertexai.generatecontentresponse.md + - title: GenerateContentResult + path: /docs/reference/js/vertexai.generatecontentresult.md + - title: GenerateContentStreamResult + path: /docs/reference/js/vertexai.generatecontentstreamresult.md + - title: GenerationConfig + path: /docs/reference/js/vertexai.generationconfig.md + - title: GenerativeContentBlob + path: /docs/reference/js/vertexai.generativecontentblob.md + - title: GenerativeModel + path: /docs/reference/js/vertexai.generativemodel.md + - title: GroundingAttribution + path: /docs/reference/js/vertexai.groundingattribution.md + - title: GroundingMetadata + path: /docs/reference/js/vertexai.groundingmetadata.md + - title: InlineDataPart + path: /docs/reference/js/vertexai.inlinedatapart.md + - title: IntegerSchema + path: /docs/reference/js/vertexai.integerschema.md + - title: ModelParams + path: /docs/reference/js/vertexai.modelparams.md + - title: NumberSchema + path: /docs/reference/js/vertexai.numberschema.md + - title: ObjectSchema + path: /docs/reference/js/vertexai.objectschema.md + - title: ObjectSchemaInterface + path: /docs/reference/js/vertexai.objectschemainterface.md + - title: PromptFeedback + path: /docs/reference/js/vertexai.promptfeedback.md + - title: RequestOptions + path: /docs/reference/js/vertexai.requestoptions.md + - title: RetrievedContextAttribution + path: /docs/reference/js/vertexai.retrievedcontextattribution.md + - title: SafetyRating + path: /docs/reference/js/vertexai.safetyrating.md + - title: SafetySetting + path: /docs/reference/js/vertexai.safetysetting.md + - title: Schema + path: /docs/reference/js/vertexai.schema.md + - title: SchemaInterface + path: /docs/reference/js/vertexai.schemainterface.md + - title: SchemaParams + path: /docs/reference/js/vertexai.schemaparams.md + - title: SchemaRequest + path: /docs/reference/js/vertexai.schemarequest.md + - title: SchemaShared + path: /docs/reference/js/vertexai.schemashared.md + - title: Segment + path: /docs/reference/js/vertexai.segment.md + - title: StartChatParams + path: /docs/reference/js/vertexai.startchatparams.md + - title: StringSchema + path: /docs/reference/js/vertexai.stringschema.md + - title: TextPart + path: /docs/reference/js/vertexai.textpart.md + - title: ToolConfig + path: /docs/reference/js/vertexai.toolconfig.md + - title: UsageMetadata + path: /docs/reference/js/vertexai.usagemetadata.md + - title: VertexAI + path: /docs/reference/js/vertexai.vertexai.md + - title: VertexAIError + path: /docs/reference/js/vertexai.vertexaierror.md + - title: VertexAIOptions + path: /docs/reference/js/vertexai.vertexaioptions.md + - title: VideoMetadata + path: /docs/reference/js/vertexai.videometadata.md + - title: WebAttribution + path: /docs/reference/js/vertexai.webattribution.md diff --git a/repo-scripts/api-documenter/src/toc.ts b/repo-scripts/api-documenter/src/toc.ts index b4887949407..7a922507c48 100644 --- a/repo-scripts/api-documenter/src/toc.ts +++ b/repo-scripts/api-documenter/src/toc.ts @@ -60,7 +60,8 @@ export function generateToc({ yaml.dump( { toc }, { - quotingType: '"' + quotingType: '"', + noArrayIndent: true } ) ); From 32bf02111dc0b85ca9a13278725945e4f9bcce73 Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:11:58 -0500 Subject: [PATCH 057/295] Fix: sort document reference by long type id (#8673) --- .../src/local/memory_remote_document_cache.ts | 12 +- packages/firestore/src/model/path.ts | 55 ++++-- .../test/integration/api/database.test.ts | 181 +++++++++++++++++- 3 files changed, 235 insertions(+), 13 deletions(-) diff --git a/packages/firestore/src/local/memory_remote_document_cache.ts b/packages/firestore/src/local/memory_remote_document_cache.ts index 2b145acdf9d..42a0010d4ac 100644 --- a/packages/firestore/src/local/memory_remote_document_cache.ts +++ b/packages/firestore/src/local/memory_remote_document_cache.ts @@ -47,6 +47,11 @@ interface MemoryRemoteDocumentCacheEntry { size: number; } +/** + * The smallest value representable by a 64-bit signed integer (long). + */ +const MIN_LONG_VALUE = '-9223372036854775808'; + type DocumentEntryMap = SortedMap; function documentEntryMap(): DocumentEntryMap { return new SortedMap( @@ -171,7 +176,12 @@ class MemoryRemoteDocumentCacheImpl implements MemoryRemoteDocumentCache { // Documents are ordered by key, so we can use a prefix scan to narrow down // the documents we need to match the query against. const collectionPath = query.path; - const prefix = new DocumentKey(collectionPath.child('')); + // Document keys are ordered first by numeric value ("__id__"), + // then lexicographically by string value. Start the iterator at the minimum + // possible Document key value. + const prefix = new DocumentKey( + collectionPath.child('__id' + MIN_LONG_VALUE + '__') + ); const iterator = this.docs.getIteratorFrom(prefix); while (iterator.hasNext()) { const { diff --git a/packages/firestore/src/model/path.ts b/packages/firestore/src/model/path.ts index 3b68a67c68f..64cb0376a0e 100644 --- a/packages/firestore/src/model/path.ts +++ b/packages/firestore/src/model/path.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { Integer } from '@firebase/webchannel-wrapper/bloom-blob'; + import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; @@ -163,28 +165,59 @@ abstract class BasePath> { return this.segments.slice(this.offset, this.limit()); } + /** + * Compare 2 paths segment by segment, prioritizing numeric IDs + * (e.g., "__id123__") in numeric ascending order, followed by string + * segments in lexicographical order. + */ static comparator>( p1: BasePath, p2: BasePath ): number { const len = Math.min(p1.length, p2.length); for (let i = 0; i < len; i++) { - const left = p1.get(i); - const right = p2.get(i); - if (left < right) { - return -1; - } - if (left > right) { - return 1; + const comparison = BasePath.compareSegments(p1.get(i), p2.get(i)); + if (comparison !== 0) { + return comparison; } } - if (p1.length < p2.length) { + return Math.sign(p1.length - p2.length); + } + + private static compareSegments(lhs: string, rhs: string): number { + const isLhsNumeric = BasePath.isNumericId(lhs); + const isRhsNumeric = BasePath.isNumericId(rhs); + + if (isLhsNumeric && !isRhsNumeric) { + // Only lhs is numeric return -1; - } - if (p1.length > p2.length) { + } else if (!isLhsNumeric && isRhsNumeric) { + // Only rhs is numeric return 1; + } else if (isLhsNumeric && isRhsNumeric) { + // both numeric + return BasePath.extractNumericId(lhs).compare( + BasePath.extractNumericId(rhs) + ); + } else { + // both non-numeric + if (lhs < rhs) { + return -1; + } + if (lhs > rhs) { + return 1; + } + return 0; } - return 0; + } + + // Checks if a segment is a numeric ID (starts with "__id" and ends with "__"). + private static isNumericId(segment: string): boolean { + return segment.startsWith('__id') && segment.endsWith('__'); + } + + private static extractNumericId(segment: string): Integer { + return Integer.fromString(segment.substring(4, segment.length - 2)); } } diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 81dc7362a22..1cda49d9229 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -79,7 +79,8 @@ import { withTestDocAndInitialData, withNamedTestDbsOrSkipUnlessUsingEmulator, toDataArray, - checkOnlineAndOfflineResultsMatch + checkOnlineAndOfflineResultsMatch, + toIds } from '../util/helpers'; import { DEFAULT_SETTINGS, DEFAULT_PROJECT_ID } from '../util/settings'; @@ -2245,4 +2246,182 @@ apiDescribe('Database', persistence => { }); }); }); + + describe('sort documents by DocumentId', () => { + it('snapshot listener sorts query by DocumentId same way as get query', async () => { + const testDocs = { + 'A': { a: 1 }, + 'a': { a: 1 }, + 'Aa': { a: 1 }, + '7': { a: 1 }, + '12': { a: 1 }, + '__id7__': { a: 1 }, + '__id12__': { a: 1 }, + '__id-2__': { a: 1 }, + '_id1__': { a: 1 }, + '__id1_': { a: 1 }, + '__id': { a: 1 }, + // largest long numbers + '__id9223372036854775807__': { a: 1 }, + '__id9223372036854775806__': { a: 1 }, + // smallest long numbers + '__id-9223372036854775808__': { a: 1 }, + '__id-9223372036854775807__': { a: 1 } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy(documentId())); + const expectedDocs = [ + '__id-9223372036854775808__', + '__id-9223372036854775807__', + '__id-2__', + '__id7__', + '__id12__', + '__id9223372036854775806__', + '__id9223372036854775807__', + '12', + '7', + 'A', + 'Aa', + '__id', + '__id1_', + '_id1__', + 'a' + ]; + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(expectedDocs); + + unsubscribe(); + }); + }); + + it('snapshot listener sorts filtered query by DocumentId same way as get query', async () => { + const testDocs = { + 'A': { a: 1 }, + 'a': { a: 1 }, + 'Aa': { a: 1 }, + '7': { a: 1 }, + '12': { a: 1 }, + '__id7__': { a: 1 }, + '__id12__': { a: 1 }, + '__id-2__': { a: 1 }, + '_id1__': { a: 1 }, + '__id1_': { a: 1 }, + '__id': { a: 1 }, + // largest long numbers + '__id9223372036854775807__': { a: 1 }, + '__id9223372036854775806__': { a: 1 }, + // smallest long numbers + '__id-9223372036854775808__': { a: 1 }, + '__id-9223372036854775807__': { a: 1 } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const filteredQuery = query( + collectionRef, + orderBy(documentId()), + where(documentId(), '>', '__id7__'), + where(documentId(), '<=', 'Aa') + ); + const expectedDocs = [ + '__id12__', + '__id9223372036854775806__', + '__id9223372036854775807__', + '12', + '7', + 'A', + 'Aa' + ]; + + const getSnapshot = await getDocsFromServer(filteredQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(filteredQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(expectedDocs); + unsubscribe(); + }); + }); + + // eslint-disable-next-line no-restricted-properties + (persistence.gc === 'lru' ? describe : describe.skip)('offline', () => { + it('SDK orders query the same way online and offline', async () => { + const testDocs = { + 'A': { a: 1 }, + 'a': { a: 1 }, + 'Aa': { a: 1 }, + '7': { a: 1 }, + '12': { a: 1 }, + '__id7__': { a: 1 }, + '__id12__': { a: 1 }, + '__id-2__': { a: 1 }, + '_id1__': { a: 1 }, + '__id1_': { a: 1 }, + '__id': { a: 1 }, + // largest long numbers + '__id9223372036854775807__': { a: 1 }, + '__id9223372036854775806__': { a: 1 }, + // smallest long numbers + '__id-9223372036854775808__': { a: 1 }, + '__id-9223372036854775807__': { a: 1 } + }; + + return withTestCollection( + persistence, + testDocs, + async collectionRef => { + const orderedQuery = query(collectionRef, orderBy(documentId())); + let expectedDocs = [ + '__id-9223372036854775808__', + '__id-9223372036854775807__', + '__id-2__', + '__id7__', + '__id12__', + '__id9223372036854775806__', + '__id9223372036854775807__', + '12', + '7', + 'A', + 'Aa', + '__id', + '__id1_', + '_id1__', + 'a' + ]; + await checkOnlineAndOfflineResultsMatch( + orderedQuery, + ...expectedDocs + ); + + const filteredQuery = query( + collectionRef, + orderBy(documentId()), + where(documentId(), '>', '__id7__'), + where(documentId(), '<=', 'Aa') + ); + expectedDocs = [ + '__id12__', + '__id9223372036854775806__', + '__id9223372036854775807__', + '12', + '7', + 'A', + 'Aa' + ]; + await checkOnlineAndOfflineResultsMatch( + filteredQuery, + ...expectedDocs + ); + } + ); + }); + }); + }); }); From df90a2e215d3e66dc93f621528f04d2516d207bf Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:06:23 -0700 Subject: [PATCH 058/295] Fixes for Constant.of(...) (#8677) --- common/api-review/firestore-lite.api.md | 11 +- common/api-review/firestore.api.md | 11 +- .../firestore/src/lite-api/expressions.ts | 13 +- .../test/integration/api/pipeline.test.ts | 111 ++++++++++++++++++ 4 files changed, 129 insertions(+), 17 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 07af0bacd6e..7435e2a250e 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -375,14 +375,13 @@ export class Constant { static of(value: string): Constant; static of(value: boolean): Constant; static of(value: null): Constant; - static of(value: undefined): Constant; static of(value: GeoPoint): Constant; static of(value: Timestamp): Constant; static of(value: Date): Constant; - static of(value: Uint8Array): Constant; + static of(value: Bytes): Constant; static of(value: DocumentReference): Constant; static of(value: any[]): Constant; - static of(value: Map): Constant; + static of(value: Record): Constant; static of(value: VectorValue): Constant; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; @@ -2205,8 +2204,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9245:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9274:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9239:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9268:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 270c71fe955..37317520020 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -390,14 +390,13 @@ export class Constant { static of(value: string): Constant; static of(value: boolean): Constant; static of(value: null): Constant; - static of(value: undefined): Constant; static of(value: GeoPoint): Constant; static of(value: Timestamp): Constant; static of(value: Date): Constant; - static of(value: Uint8Array): Constant; + static of(value: Bytes): Constant; static of(value: DocumentReference): Constant; static of(value: any[]): Constant; - static of(value: Map): Constant; + static of(value: Record): Constant; static of(value: VectorValue): Constant; regexContains(pattern: string): RegexContains; regexContains(pattern: Constant): RegexContains; @@ -2509,8 +2508,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10200:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10167:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10167:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10194:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 3ec68601e9e..261f8112c4d 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -30,6 +30,7 @@ import { } from '../remote/serializer'; import { hardAssert } from '../util/assert'; +import { Bytes } from './bytes'; import { documentId, FieldPath } from './field_path'; import { GeoPoint } from './geo_point'; import { Pipeline } from './pipeline'; @@ -2084,6 +2085,8 @@ export class Constant extends Expr { /** * Creates a `Constant` instance for an undefined value. + * @private + * @internal * * @param value The undefined value. * @return A new `Constant` instance. @@ -2115,12 +2118,12 @@ export class Constant extends Expr { static of(value: Date): Constant; /** - * Creates a `Constant` instance for a Uint8Array value. + * Creates a `Constant` instance for a Bytes value. * - * @param value The Uint8Array value. + * @param value The Bytes value. * @return A new `Constant` instance. */ - static of(value: Uint8Array): Constant; + static of(value: Bytes): Constant; /** * Creates a `Constant` instance for a DocumentReference value. @@ -2130,9 +2133,9 @@ export class Constant extends Expr { */ static of(value: DocumentReference): Constant; - // TODO(pipeline) if we make this public, then the Proto types should also be documented /** * Creates a `Constant` instance for a Firestore proto value. + * For internal use only. * @private * @internal * @param value The Firestore proto value. @@ -2154,7 +2157,7 @@ export class Constant extends Expr { * @param value The map value. * @return A new `Constant` instance. */ - static of(value: Map): Constant; + static of(value: Record): Constant; /** * Creates a `Constant` instance for a VectorValue value. diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index ddedc966eb4..1376947f482 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -18,6 +18,9 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import { Bytes, vector } from '../../../src/api'; +import { GeoPoint } from '../../../src/lite-api/geo_point'; +import { Timestamp } from '../../../src/lite-api/timestamp'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { @@ -476,6 +479,114 @@ apiDescribe('Pipelines', persistence => { ); }); + it('accepts and returns all data types', async () => { + const refDate = new Date(); + const refTimestamp = Timestamp.now(); + const constants = [ + Constant.of(1).as('number'), + Constant.of('a string').as('string'), + Constant.of(true).as('boolean'), + Constant.of(null).as('null'), + Constant.of(new GeoPoint(0.1, 0.2)).as('geoPoint'), + Constant.of(refTimestamp).as('timestamp'), + Constant.of(refDate).as('date'), + Constant.of( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes'), + Constant.of(doc(firestore, 'foo', 'bar')).as('documentReference'), + Constant.of(vector([1, 2, 3])).as('vectorValue'), + Constant.of({ + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': refDate, + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }).as('map'), + Constant.of([ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + refDate, + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ]).as('array') + ]; + + const results = await randomCol + .pipeline() + .limit(1) + .select(...constants) + .execute(); + + expectResults(results, { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'bytes': Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }, + 'array': [ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + Timestamp.fromDate(refDate), + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ] + }); + }); + it('cond works', async () => { const results = await randomCol .pipeline() From ddc3192b568a5b65dd7c93286403d4c9b0a7f4e8 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 7 Jan 2025 09:54:08 -0800 Subject: [PATCH 059/295] Set e2e test workflow to poll npm to check the version is available (#8684) --- .github/workflows/e2e-test.yml | 6 +++ scripts/release/poll-npm-publish.js | 68 +++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 scripts/release/poll-npm-publish.js diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index f22f77e0fe5..0857860571f 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -50,6 +50,12 @@ jobs: TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }} run: | echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js + - name: Poll npm until version to test is available for install + run: | + echo "Polling npm for firebase@${{ github.event.client_payload.versionOrTag }}" + node ../scripts/release/poll-npm-publish.js + env: + VERSION: ${{ github.event.client_payload.versionOrTag }} - name: Yarn install run: | echo "Installing firebase@${{ github.event.client_payload.versionOrTag }}" diff --git a/scripts/release/poll-npm-publish.js b/scripts/release/poll-npm-publish.js new file mode 100644 index 00000000000..ffaf3e97179 --- /dev/null +++ b/scripts/release/poll-npm-publish.js @@ -0,0 +1,68 @@ +/** + * @license + * Copyright 2025 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. + */ + +const { exec } = require('child_process'); + +const MAX_ATTEMPTS = 15; +const RETRY_DELAY_SECONDS = 60; + +async function pollNpmPublish() { + const version = process.env.VERSION; + + if (!version) { + console.log(`Couldn't find env var VERSION.`); + return; + } + + const getNpmPublishedVersion = () => + new Promise((resolve, reject) => { + exec(`npm view firebase@${version} version`, (error, stdout) => { + if (error) { + reject(error); + } + const version = stdout.trim(); + if (!version.match(/^\d+\.\d+\.\d+$/)) { + reject( + new Error( + `npm view did not return a valid semver version. Received: ${version}` + ) + ); + } + resolve(version); + }); + }); + for (let i = 0; i < MAX_ATTEMPTS; i++) { + const latestPublishedVersion = await getNpmPublishedVersion(); + if (latestPublishedVersion === process.env.VERSION) { + console.log(`Found firebase@${version} in the npm registry.`); + return; + } + console.log(`Didn't find firebase@${version} in the npm registry.`); + if (i < MAX_ATTEMPTS - 1) { + console.log(`Trying again in ${RETRY_DELAY_SECONDS} seconds.`); + await new Promise(resolve => + setTimeout(resolve, RETRY_DELAY_SECONDS * 1000) + ); + } + } + console.log( + `Was not able to find firebase@${version} on npm. Ending process.` + ); + process.exit(1); +} + +pollNpmPublish(); From f3a8df72adffa374d025d9a6aaafb449402b0860 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 7 Jan 2025 12:39:18 -0800 Subject: [PATCH 060/295] fix regex to include non-numeric (#8692) --- scripts/release/poll-npm-publish.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/release/poll-npm-publish.js b/scripts/release/poll-npm-publish.js index ffaf3e97179..c9d454eb683 100644 --- a/scripts/release/poll-npm-publish.js +++ b/scripts/release/poll-npm-publish.js @@ -35,10 +35,10 @@ async function pollNpmPublish() { reject(error); } const version = stdout.trim(); - if (!version.match(/^\d+\.\d+\.\d+$/)) { + if (!version.match(/^\d+(\.[-\d\w]+)+$/)) { reject( new Error( - `npm view did not return a valid semver version. Received: ${version}` + `npm view did not return a valid tag. Received: ${version}` ) ); } From 7bf2aec6328b06c9c7dda91354630c0d59f2b411 Mon Sep 17 00:00:00 2001 From: Ashish Kothari Date: Wed, 8 Jan 2025 15:27:02 +0530 Subject: [PATCH 061/295] feat(rc): Add custom signals support (#8602) Add support for custom signal targeting in Remote Config. Using this feature, developers can set custom signals (key/value pairs) in their apps and use them for building custom targeting conditions in their templates. Design doc (internal): [go/rc-custom-targeting-dd](http://goto.google.com/rc-custom-targeting-dd) API Proposal (internal): [go/remote-config-custom-targeting-signals-api-review](https://goto.google.com/remote-config-custom-targeting-signals-api-review) --- .changeset/hip-apricots-end.md | 7 ++ common/api-review/remote-config.api.md | 9 ++ docs-devsite/_toc.yaml | 2 + docs-devsite/remote-config.customsignals.md | 23 +++++ docs-devsite/remote-config.md | 23 +++++ packages/firebase/compat/index.d.ts | 1 + packages/remote-config-types/index.d.ts | 13 +++ packages/remote-config/src/api.ts | 64 ++++++++++++- .../src/client/remote_config_fetch_client.ts | 8 ++ .../remote-config/src/client/rest_client.ts | 5 +- packages/remote-config/src/constants.ts | 3 + packages/remote-config/src/errors.ts | 8 +- packages/remote-config/src/public_types.ts | 17 ++++ packages/remote-config/src/storage/storage.ts | 92 +++++++++++++++++-- .../src/storage/storage_cache.ts | 17 +++- .../remote-config/test/remote_config.test.ts | 52 ++++++++++- .../test/storage/storage.test.ts | 54 +++++++++++ .../test/storage/storage_cache.test.ts | 27 ++++++ 18 files changed, 411 insertions(+), 14 deletions(-) create mode 100644 .changeset/hip-apricots-end.md create mode 100644 docs-devsite/remote-config.customsignals.md diff --git a/.changeset/hip-apricots-end.md b/.changeset/hip-apricots-end.md new file mode 100644 index 00000000000..40bfedbaeec --- /dev/null +++ b/.changeset/hip-apricots-end.md @@ -0,0 +1,7 @@ +--- +'@firebase/remote-config-types': minor +'@firebase/remote-config': minor +'firebase': minor +--- + +Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. diff --git a/common/api-review/remote-config.api.md b/common/api-review/remote-config.api.md index 980d8f3d287..bf6cf4761de 100644 --- a/common/api-review/remote-config.api.md +++ b/common/api-review/remote-config.api.md @@ -9,6 +9,12 @@ import { FirebaseApp } from '@firebase/app'; // @public export function activate(remoteConfig: RemoteConfig): Promise; +// @public +export interface CustomSignals { + // (undocumented) + [key: string]: string | number | null; +} + // @public export function ensureInitialized(remoteConfig: RemoteConfig): Promise; @@ -62,6 +68,9 @@ export interface RemoteConfigSettings { minimumFetchIntervalMillis: number; } +// @public +export function setCustomSignals(remoteConfig: RemoteConfig, customSignals: CustomSignals): Promise; + // @public export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void; diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index ca06d4f9398..4ab67bcd6ef 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -428,6 +428,8 @@ toc: - title: remote-config path: /docs/reference/js/remote-config.md section: + - title: CustomSignals + path: /docs/reference/js/remote-config.customsignals.md - title: RemoteConfig path: /docs/reference/js/remote-config.remoteconfig.md - title: RemoteConfigSettings diff --git a/docs-devsite/remote-config.customsignals.md b/docs-devsite/remote-config.customsignals.md new file mode 100644 index 00000000000..98bd371ad7b --- /dev/null +++ b/docs-devsite/remote-config.customsignals.md @@ -0,0 +1,23 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CustomSignals interface +Defines the type for representing custom signals and their values. + +

The values in CustomSignals must be one of the following types: + +

  • string
  • number
  • null
+ +Signature: + +```typescript +export interface CustomSignals +``` diff --git a/docs-devsite/remote-config.md b/docs-devsite/remote-config.md index 371ab7ff157..40319453a3f 100644 --- a/docs-devsite/remote-config.md +++ b/docs-devsite/remote-config.md @@ -28,6 +28,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | [getNumber(remoteConfig, key)](./remote-config.md#getnumber_476c09f) | Gets the value for the given key as a number.Convenience method for calling remoteConfig.getValue(key).asNumber(). | | [getString(remoteConfig, key)](./remote-config.md#getstring_476c09f) | Gets the value for the given key as a string. Convenience method for calling remoteConfig.getValue(key).asString(). | | [getValue(remoteConfig, key)](./remote-config.md#getvalue_476c09f) | Gets the [Value](./remote-config.value.md#value_interface) for the given key. | +| [setCustomSignals(remoteConfig, customSignals)](./remote-config.md#setcustomsignals_aeeb95e) | Sets the custom signals for the app instance. | | [setLogLevel(remoteConfig, logLevel)](./remote-config.md#setloglevel_039a45b) | Defines the log level to use. | | function() | | [isSupported()](./remote-config.md#issupported) | This method provides two different checks:1. Check if IndexedDB exists in the browser environment. 2. Check if the current browser context allows IndexedDB open() calls. | @@ -36,6 +37,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | Interface | Description | | --- | --- | +| [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.

The values in CustomSignals must be one of the following types:

  • string
  • number
  • null
| | [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The Firebase Remote Config service interface. | | [RemoteConfigSettings](./remote-config.remoteconfigsettings.md#remoteconfigsettings_interface) | Defines configuration options for the Remote Config SDK. | | [Value](./remote-config.value.md#value_interface) | Wraps a value with metadata and type-safe getters. | @@ -276,6 +278,27 @@ export declare function getValue(remoteConfig: RemoteConfig, key: string): Value The value for the given key. +### setCustomSignals(remoteConfig, customSignals) {:#setcustomsignals_aeeb95e} + +Sets the custom signals for the app instance. + +Signature: + +```typescript +export declare function setCustomSignals(remoteConfig: RemoteConfig, customSignals: CustomSignals): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| remoteConfig | [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) instance. | +| customSignals | [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Map (key, value) of the custom signals to be set for the app instance. If a key already exists, the value is overwritten. Setting the value of a custom signal to null unsets the signal. The signals will be persisted locally on the client. | + +Returns: + +Promise<void> + ### setLogLevel(remoteConfig, logLevel) {:#setloglevel_039a45b} Defines the log level to use. diff --git a/packages/firebase/compat/index.d.ts b/packages/firebase/compat/index.d.ts index efda7c954a5..92c7bd2c278 100644 --- a/packages/firebase/compat/index.d.ts +++ b/packages/firebase/compat/index.d.ts @@ -2046,6 +2046,7 @@ declare namespace firebase.remoteConfig { * Defines levels of Remote Config logging. */ export type LogLevel = 'debug' | 'error' | 'silent'; + /** * This method provides two different checks: * diff --git a/packages/remote-config-types/index.d.ts b/packages/remote-config-types/index.d.ts index a088f665310..7fbaf7c3e5c 100644 --- a/packages/remote-config-types/index.d.ts +++ b/packages/remote-config-types/index.d.ts @@ -173,6 +173,19 @@ export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; */ export type LogLevel = 'debug' | 'error' | 'silent'; +/** + * Defines the type for representing custom signals and their values. + * + *

The values in CustomSignals must be one of the following types: + * + *

    + *
  • string + *
  • number + *
  • null + *
+ */ +export type CustomSignals = { [key: string]: string | number | null }; + declare module '@firebase/component' { interface NameServiceMapping { 'remoteConfig-compat': RemoteConfig; diff --git a/packages/remote-config/src/api.ts b/packages/remote-config/src/api.ts index aeae67d450e..607d4944d26 100644 --- a/packages/remote-config/src/api.ts +++ b/packages/remote-config/src/api.ts @@ -17,12 +17,17 @@ import { _getProvider, FirebaseApp, getApp } from '@firebase/app'; import { + CustomSignals, LogLevel as RemoteConfigLogLevel, RemoteConfig, Value } from './public_types'; import { RemoteConfigAbortSignal } from './client/remote_config_fetch_client'; -import { RC_COMPONENT_NAME } from './constants'; +import { + RC_COMPONENT_NAME, + RC_CUSTOM_SIGNAL_KEY_MAX_LENGTH, + RC_CUSTOM_SIGNAL_VALUE_MAX_LENGTH +} from './constants'; import { ErrorCode, hasErrorCode } from './errors'; import { RemoteConfig as RemoteConfigImpl } from './remote_config'; import { Value as ValueImpl } from './value'; @@ -114,11 +119,18 @@ export async function fetchConfig(remoteConfig: RemoteConfig): Promise { abortSignal.abort(); }, rc.settings.fetchTimeoutMillis); + const customSignals = rc._storageCache.getCustomSignals(); + if (customSignals) { + rc._logger.debug( + `Fetching config with custom signals: ${JSON.stringify(customSignals)}` + ); + } // Catches *all* errors thrown by client so status can be set consistently. try { await rc._client.fetch({ cacheMaxAgeMillis: rc.settings.minimumFetchIntervalMillis, - signal: abortSignal + signal: abortSignal, + customSignals }); await rc._storageCache.setLastFetchStatus('success'); @@ -258,3 +270,51 @@ export function setLogLevel( function getAllKeys(obj1: {} = {}, obj2: {} = {}): string[] { return Object.keys({ ...obj1, ...obj2 }); } + +/** + * Sets the custom signals for the app instance. + * + * @param remoteConfig - The {@link RemoteConfig} instance. + * @param customSignals - Map (key, value) of the custom signals to be set for the app instance. If + * a key already exists, the value is overwritten. Setting the value of a custom signal to null + * unsets the signal. The signals will be persisted locally on the client. + * + * @public + */ +export async function setCustomSignals( + remoteConfig: RemoteConfig, + customSignals: CustomSignals +): Promise { + const rc = getModularInstance(remoteConfig) as RemoteConfigImpl; + if (Object.keys(customSignals).length === 0) { + return; + } + + // eslint-disable-next-line guard-for-in + for (const key in customSignals) { + if (key.length > RC_CUSTOM_SIGNAL_KEY_MAX_LENGTH) { + rc._logger.error( + `Custom signal key ${key} is too long, max allowed length is ${RC_CUSTOM_SIGNAL_KEY_MAX_LENGTH}.` + ); + return; + } + const value = customSignals[key]; + if ( + typeof value === 'string' && + value.length > RC_CUSTOM_SIGNAL_VALUE_MAX_LENGTH + ) { + rc._logger.error( + `Value supplied for custom signal ${key} is too long, max allowed length is ${RC_CUSTOM_SIGNAL_VALUE_MAX_LENGTH}.` + ); + return; + } + } + + try { + await rc._storageCache.setCustomSignals(customSignals); + } catch (error) { + rc._logger.error( + `Error encountered while setting custom signals: ${error}` + ); + } +} diff --git a/packages/remote-config/src/client/remote_config_fetch_client.ts b/packages/remote-config/src/client/remote_config_fetch_client.ts index 25e00299855..71ea66d5e50 100644 --- a/packages/remote-config/src/client/remote_config_fetch_client.ts +++ b/packages/remote-config/src/client/remote_config_fetch_client.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { CustomSignals } from '../public_types'; + /** * Defines a client, as in https://en.wikipedia.org/wiki/Client%E2%80%93server_model, for the * Remote Config server (https://firebase.google.com/docs/reference/remote-config/rest). @@ -99,6 +101,12 @@ export interface FetchRequest { *

Comparable to passing `headers = { 'If-None-Match': }` to the native Fetch API. */ eTag?: string; + + /** The custom signals stored for the app instance. + * + *

Optional in case no custom signals are set for the instance. + */ + customSignals?: CustomSignals; } /** diff --git a/packages/remote-config/src/client/rest_client.ts b/packages/remote-config/src/client/rest_client.ts index 87fdae3c3d6..9d87ffbb1ac 100644 --- a/packages/remote-config/src/client/rest_client.ts +++ b/packages/remote-config/src/client/rest_client.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { CustomSignals } from '../public_types'; import { FetchResponse, RemoteConfigFetchClient, @@ -41,6 +42,7 @@ interface FetchRequestBody { app_instance_id_token: string; app_id: string; language_code: string; + custom_signals?: CustomSignals; /* eslint-enable camelcase */ } @@ -92,7 +94,8 @@ export class RestClient implements RemoteConfigFetchClient { app_instance_id: installationId, app_instance_id_token: installationToken, app_id: this.appId, - language_code: getUserLanguage() + language_code: getUserLanguage(), + custom_signals: request.customSignals /* eslint-enable camelcase */ }; diff --git a/packages/remote-config/src/constants.ts b/packages/remote-config/src/constants.ts index 365d9037f86..d7d286909a5 100644 --- a/packages/remote-config/src/constants.ts +++ b/packages/remote-config/src/constants.ts @@ -16,3 +16,6 @@ */ export const RC_COMPONENT_NAME = 'remote-config'; +export const RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS = 100; +export const RC_CUSTOM_SIGNAL_KEY_MAX_LENGTH = 250; +export const RC_CUSTOM_SIGNAL_VALUE_MAX_LENGTH = 500; diff --git a/packages/remote-config/src/errors.ts b/packages/remote-config/src/errors.ts index eac9a25657b..762eeb899ee 100644 --- a/packages/remote-config/src/errors.ts +++ b/packages/remote-config/src/errors.ts @@ -31,7 +31,8 @@ export const enum ErrorCode { FETCH_THROTTLE = 'fetch-throttle', FETCH_PARSE = 'fetch-client-parse', FETCH_STATUS = 'fetch-status', - INDEXED_DB_UNAVAILABLE = 'indexed-db-unavailable' + INDEXED_DB_UNAVAILABLE = 'indexed-db-unavailable', + CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS = 'custom-signal-max-allowed-signals' } const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = { @@ -67,7 +68,9 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = { [ErrorCode.FETCH_STATUS]: 'Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.', [ErrorCode.INDEXED_DB_UNAVAILABLE]: - 'Indexed DB is not supported by current browser' + 'Indexed DB is not supported by current browser', + [ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS]: + 'Setting more than {$maxSignals} custom signals is not supported.' }; // Note this is effectively a type system binding a code to params. This approach overlaps with the @@ -86,6 +89,7 @@ interface ErrorParams { [ErrorCode.FETCH_THROTTLE]: { throttleEndTimeMillis: number }; [ErrorCode.FETCH_PARSE]: { originalErrorMessage: string }; [ErrorCode.FETCH_STATUS]: { httpStatus: number }; + [ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS]: { maxSignals: number }; } export const ERROR_FACTORY = new ErrorFactory( diff --git a/packages/remote-config/src/public_types.ts b/packages/remote-config/src/public_types.ts index d489809e451..365d5e5905f 100644 --- a/packages/remote-config/src/public_types.ts +++ b/packages/remote-config/src/public_types.ts @@ -134,6 +134,23 @@ export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; */ export type LogLevel = 'debug' | 'error' | 'silent'; +/** + * Defines the type for representing custom signals and their values. + * + *

The values in CustomSignals must be one of the following types: + * + *

    + *
  • string + *
  • number + *
  • null + *
+ * + * @public + */ +export interface CustomSignals { + [key: string]: string | number | null; +} + declare module '@firebase/component' { interface NameServiceMapping { 'remote-config': RemoteConfig; diff --git a/packages/remote-config/src/storage/storage.ts b/packages/remote-config/src/storage/storage.ts index baa7ab46b52..52e660f1fdb 100644 --- a/packages/remote-config/src/storage/storage.ts +++ b/packages/remote-config/src/storage/storage.ts @@ -15,12 +15,13 @@ * limitations under the License. */ -import { FetchStatus } from '@firebase/remote-config-types'; +import { FetchStatus, CustomSignals } from '@firebase/remote-config-types'; import { FetchResponse, FirebaseRemoteConfigObject } from '../client/remote_config_fetch_client'; import { ERROR_FACTORY, ErrorCode } from '../errors'; +import { RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS } from '../constants'; import { FirebaseError } from '@firebase/util'; /** @@ -70,7 +71,8 @@ type ProjectNamespaceKeyFieldValue = | 'last_successful_fetch_timestamp_millis' | 'last_successful_fetch_response' | 'settings' - | 'throttle_metadata'; + | 'throttle_metadata' + | 'custom_signals'; // Visible for testing. export function openDatabase(): Promise { @@ -181,10 +183,64 @@ export class Storage { return this.delete('throttle_metadata'); } - async get(key: ProjectNamespaceKeyFieldValue): Promise { + getCustomSignals(): Promise { + return this.get('custom_signals'); + } + + async setCustomSignals(customSignals: CustomSignals): Promise { const db = await this.openDbPromise; + const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite'); + const storedSignals = await this.getWithTransaction( + 'custom_signals', + transaction + ); + const combinedSignals = { + ...storedSignals, + ...customSignals + }; + // Filter out key-value assignments with null values since they are signals being unset + const updatedSignals = Object.fromEntries( + Object.entries(combinedSignals) + .filter(([_, v]) => v !== null) + .map(([k, v]) => { + // Stringify numbers to store a map of string keys and values which can be sent + // as-is in a fetch call. + if (typeof v === 'number') { + return [k, v.toString()]; + } + return [k, v]; + }) + ); + + // Throw an error if the number of custom signals to be stored exceeds the limit + if ( + Object.keys(updatedSignals).length > RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS + ) { + throw ERROR_FACTORY.create(ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS, { + maxSignals: RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS + }); + } + + await this.setWithTransaction( + 'custom_signals', + updatedSignals, + transaction + ); + return updatedSignals; + } + + /** + * Gets a value from the database using the provided transaction. + * + * @param key The key of the value to get. + * @param transaction The transaction to use for the operation. + * @returns The value associated with the key, or undefined if no such value exists. + */ + async getWithTransaction( + key: ProjectNamespaceKeyFieldValue, + transaction: IDBTransaction + ): Promise { return new Promise((resolve, reject) => { - const transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly'); const objectStore = transaction.objectStore(APP_NAMESPACE_STORE); const compositeKey = this.createCompositeKey(key); try { @@ -210,10 +266,20 @@ export class Storage { }); } - async set(key: ProjectNamespaceKeyFieldValue, value: T): Promise { - const db = await this.openDbPromise; + /** + * Sets a value in the database using the provided transaction. + * + * @param key The key of the value to set. + * @param value The value to set. + * @param transaction The transaction to use for the operation. + * @returns A promise that resolves when the operation is complete. + */ + async setWithTransaction( + key: ProjectNamespaceKeyFieldValue, + value: T, + transaction: IDBTransaction + ): Promise { return new Promise((resolve, reject) => { - const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite'); const objectStore = transaction.objectStore(APP_NAMESPACE_STORE); const compositeKey = this.createCompositeKey(key); try { @@ -237,6 +303,18 @@ export class Storage { }); } + async get(key: ProjectNamespaceKeyFieldValue): Promise { + const db = await this.openDbPromise; + const transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly'); + return this.getWithTransaction(key, transaction); + } + + async set(key: ProjectNamespaceKeyFieldValue, value: T): Promise { + const db = await this.openDbPromise; + const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite'); + return this.setWithTransaction(key, value, transaction); + } + async delete(key: ProjectNamespaceKeyFieldValue): Promise { const db = await this.openDbPromise; return new Promise((resolve, reject) => { diff --git a/packages/remote-config/src/storage/storage_cache.ts b/packages/remote-config/src/storage/storage_cache.ts index 302ba9a2487..fc419b0068e 100644 --- a/packages/remote-config/src/storage/storage_cache.ts +++ b/packages/remote-config/src/storage/storage_cache.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { FetchStatus } from '@firebase/remote-config-types'; +import { FetchStatus, CustomSignals } from '@firebase/remote-config-types'; import { FirebaseRemoteConfigObject } from '../client/remote_config_fetch_client'; import { Storage } from './storage'; @@ -31,6 +31,7 @@ export class StorageCache { private lastFetchStatus?: FetchStatus; private lastSuccessfulFetchTimestampMillis?: number; private activeConfig?: FirebaseRemoteConfigObject; + private customSignals?: CustomSignals; /** * Memory-only getters @@ -47,6 +48,10 @@ export class StorageCache { return this.activeConfig; } + getCustomSignals(): CustomSignals | undefined { + return this.customSignals; + } + /** * Read-ahead getter */ @@ -55,6 +60,7 @@ export class StorageCache { const lastSuccessfulFetchTimestampMillisPromise = this.storage.getLastSuccessfulFetchTimestampMillis(); const activeConfigPromise = this.storage.getActiveConfig(); + const customSignalsPromise = this.storage.getCustomSignals(); // Note: // 1. we consistently check for undefined to avoid clobbering defined values @@ -78,6 +84,11 @@ export class StorageCache { if (activeConfig) { this.activeConfig = activeConfig; } + + const customSignals = await customSignalsPromise; + if (customSignals) { + this.customSignals = customSignals; + } } /** @@ -99,4 +110,8 @@ export class StorageCache { this.activeConfig = activeConfig; return this.storage.setActiveConfig(activeConfig); } + + async setCustomSignals(customSignals: CustomSignals): Promise { + this.customSignals = await this.storage.setCustomSignals(customSignals); + } } diff --git a/packages/remote-config/test/remote_config.test.ts b/packages/remote-config/test/remote_config.test.ts index f53f4a72c86..51304bc3b2f 100644 --- a/packages/remote-config/test/remote_config.test.ts +++ b/packages/remote-config/test/remote_config.test.ts @@ -42,7 +42,8 @@ import { getString, getValue, setLogLevel, - fetchConfig + fetchConfig, + setCustomSignals } from '../src/api'; import * as api from '../src/api'; import { fetchAndActivate } from '../src'; @@ -93,6 +94,48 @@ describe('RemoteConfig', () => { loggerLogLevelSpy.restore(); }); + describe('setCustomSignals', () => { + beforeEach(() => { + storageCache.setCustomSignals = sinon.stub(); + storage.setCustomSignals = sinon.stub(); + logger.error = sinon.stub(); + }); + + it('call storage API to store signals', async () => { + await setCustomSignals(rc, { key: 'value' }); + + expect(storageCache.setCustomSignals).to.have.been.calledWith({ + key: 'value' + }); + }); + + it('logs an error when supplied with a custom signal key greater than 250 characters', async () => { + const longKey = 'a'.repeat(251); + const customSignals = { [longKey]: 'value' }; + + await setCustomSignals(rc, customSignals); + + expect(storageCache.setCustomSignals).to.not.have.been.called; + expect(logger.error).to.have.been.called; + }); + + it('logs an error when supplied with a custom signal value greater than 500 characters', async () => { + const longValue = 'a'.repeat(501); + const customSignals = { 'key': longValue }; + + await setCustomSignals(rc, customSignals); + + expect(storageCache.setCustomSignals).to.not.have.been.called; + expect(logger.error).to.have.been.called; + }); + + it('empty custom signals map does nothing', async () => { + await setCustomSignals(rc, {}); + + expect(storageCache.setCustomSignals).to.not.have.been.called; + }); + }); + // Adapts getUserLanguage tests from packages/auth/test/utils_test.js for TypeScript. describe('setLogLevel', () => { it('proxies to the FirebaseLogger instance', () => { @@ -449,6 +492,7 @@ describe('RemoteConfig', () => { .stub() .returns(Promise.resolve({ status: 200 } as FetchResponse)); storageCache.setLastFetchStatus = sinon.stub(); + storageCache.getCustomSignals = sinon.stub(); timeoutStub = sinon.stub(window, 'setTimeout'); }); @@ -517,5 +561,11 @@ describe('RemoteConfig', () => { 'failure' ); }); + + it('sends custom signals', async () => { + await fetchConfig(rc); + + expect(storageCache.getCustomSignals).to.have.been.called; + }); }); }); diff --git a/packages/remote-config/test/storage/storage.test.ts b/packages/remote-config/test/storage/storage.test.ts index 92cc12225e8..7a865107791 100644 --- a/packages/remote-config/test/storage/storage.test.ts +++ b/packages/remote-config/test/storage/storage.test.ts @@ -117,4 +117,58 @@ describe('Storage', () => { expect(actualMetadata).to.be.undefined; }); + + it('sets and gets custom signals', async () => { + const customSignals = { key: 'value', key1: 'value1', key2: 1 }; + const customSignalsInStorage = { + key: 'value', + key1: 'value1', + key2: '1' + }; + + await storage.setCustomSignals(customSignals); + + const storedCustomSignals = await storage.getCustomSignals(); + + expect(storedCustomSignals).to.deep.eq(customSignalsInStorage); + }); + + it('upserts custom signals when key is present in storage', async () => { + const customSignals = { key: 'value', key1: 'value1' }; + const updatedSignals = { key: 'value', key1: 'value2' }; + + await storage.setCustomSignals(customSignals); + + await storage.setCustomSignals({ key1: 'value2' }); + + const storedCustomSignals = await storage.getCustomSignals(); + + expect(storedCustomSignals).to.deep.eq(updatedSignals); + }); + + it('deletes custom signal when value supplied is null', async () => { + const customSignals = { key: 'value', key1: 'value1' }; + const updatedSignals = { key: 'value' }; + + await storage.setCustomSignals(customSignals); + + await storage.setCustomSignals({ key1: null }); + + const storedCustomSignals = await storage.getCustomSignals(); + + expect(storedCustomSignals).to.deep.eq(updatedSignals); + }); + + it('throws an error when supplied with excess custom signals', async () => { + const customSignals: { [key: string]: string } = {}; + for (let i = 0; i < 101; i++) { + customSignals[`key${i}`] = `value${i}`; + } + + await expect( + storage.setCustomSignals(customSignals) + ).to.eventually.be.rejectedWith( + 'Remote Config: Setting more than 100 custom signals is not supported.' + ); + }); }); diff --git a/packages/remote-config/test/storage/storage_cache.test.ts b/packages/remote-config/test/storage/storage_cache.test.ts index e7cfb0ef0da..8d11cfac46a 100644 --- a/packages/remote-config/test/storage/storage_cache.test.ts +++ b/packages/remote-config/test/storage/storage_cache.test.ts @@ -37,6 +37,7 @@ describe('StorageCache', () => { const status = 'success'; const lastSuccessfulFetchTimestampMillis = 123; const activeConfig = { key: 'value' }; + const customSignals = { 'key': 'value' }; storage.getLastFetchStatus = sinon .stub() @@ -47,12 +48,16 @@ describe('StorageCache', () => { storage.getActiveConfig = sinon .stub() .returns(Promise.resolve(activeConfig)); + storage.getCustomSignals = sinon + .stub() + .returns(Promise.resolve(customSignals)); await storageCache.loadFromStorage(); expect(storage.getLastFetchStatus).to.have.been.called; expect(storage.getLastSuccessfulFetchTimestampMillis).to.have.been.called; expect(storage.getActiveConfig).to.have.been.called; + expect(storage.getCustomSignals).to.have.been.called; expect(storageCache.getLastFetchStatus()).to.eq(status); expect(storageCache.getLastSuccessfulFetchTimestampMillis()).to.deep.eq( @@ -81,4 +86,26 @@ describe('StorageCache', () => { expect(storage.setActiveConfig).to.have.been.calledWith(activeConfig); }); }); + + describe('setCustomSignals', () => { + const customSignals = { key: 'value' }; + + beforeEach(() => { + storage.setCustomSignals = sinon + .stub() + .returns(Promise.resolve(customSignals)); + }); + + it('writes to memory cache', async () => { + await storageCache.setCustomSignals(customSignals); + + expect(storageCache.getCustomSignals()).to.deep.eq(customSignals); + }); + + it('writes to persistent storage', async () => { + await storageCache.setCustomSignals(customSignals); + + expect(storage.setCustomSignals).to.have.been.calledWith(customSignals); + }); + }); }); From 25a6204c1531b6c772e5368d12b2411ae1d21bbc Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 8 Jan 2025 10:20:46 -0600 Subject: [PATCH 062/295] Replace uuidv4 generator with `crypto.randomUUID()` (#8600) * Replace uuidv4 generator with `crypto.randomUUID()` The uuidv4 generator in util used `Math.random()`, which does not provide strong uniqueness guarantees (https://www.bocoup.com/blog/random-numbers). The places where the uuidv4 generator were used didn't require strong uniqueness guarantees (nothing security related), but I think it's good to move away from this from util in case we try to use it in the future. A better built-in alternative is `crypto.randomUUID()`, which does provide strong uniqueness guarantees. Since this is a more modern JS built-in, it's only [defined in secure contexts](https://blog.mozilla.org/security/2018/01/15/secure-contexts-everywhere/). Is this something we're concerned about? Are there any App Check users with apps running in non-secure environments? * Update API reports * Add changeset * Add comment about availability restricted to secure contexts --------- Co-authored-by: dlarocque --- .changeset/fluffy-rules-pretend.md | 6 +++++ common/api-review/util.api.md | 3 --- packages/app-check/src/storage.ts | 5 ++-- packages/data-connect/test/queries.test.ts | 5 ++-- packages/database/test/helpers/util.ts | 3 +-- packages/util/index.node.ts | 1 - packages/util/index.ts | 1 - packages/util/src/uuid.ts | 29 ---------------------- 8 files changed, 12 insertions(+), 41 deletions(-) create mode 100644 .changeset/fluffy-rules-pretend.md delete mode 100644 packages/util/src/uuid.ts diff --git a/.changeset/fluffy-rules-pretend.md b/.changeset/fluffy-rules-pretend.md new file mode 100644 index 00000000000..f0507222b35 --- /dev/null +++ b/.changeset/fluffy-rules-pretend.md @@ -0,0 +1,6 @@ +--- +'@firebase/app-check': patch +'@firebase/util': patch +--- + +Generate UUIDs with `crypto.randomUUID()` instead of custom uuidv4 function that uses `Math.random()`. diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 91d2f04cb40..8c62ff229ac 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -476,9 +476,6 @@ export interface Subscribe { // @public (undocumented) export type Unsubscribe = () => void; -// @public -export const uuidv4: () => string; - // Warning: (ae-missing-release-tag) "validateArgCount" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/app-check/src/storage.ts b/packages/app-check/src/storage.ts index 3f7257e1945..36f34f00e16 100644 --- a/packages/app-check/src/storage.ts +++ b/packages/app-check/src/storage.ts @@ -16,7 +16,7 @@ */ import { FirebaseApp } from '@firebase/app'; -import { isIndexedDBAvailable, uuidv4 } from '@firebase/util'; +import { isIndexedDBAvailable } from '@firebase/util'; import { readDebugTokenFromIndexedDB, readTokenFromIndexedDB, @@ -77,7 +77,8 @@ export async function readOrCreateDebugTokenFromStorage(): Promise { if (!existingDebugToken) { // create a new debug token - const newToken = uuidv4(); + // This function is only available in secure contexts. See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts + const newToken = crypto.randomUUID(); // We don't need to block on writing to indexeddb // In case persistence failed, a new debug token will be generated every time the page is refreshed. // It renders the debug token useless because you have to manually register(whitelist) the new token in the firebase console again and again. diff --git a/packages/data-connect/test/queries.test.ts b/packages/data-connect/test/queries.test.ts index dd7e4e6c9e3..8b630242a4e 100644 --- a/packages/data-connect/test/queries.test.ts +++ b/packages/data-connect/test/queries.test.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { uuidv4 } from '@firebase/util'; import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -51,11 +50,11 @@ interface TaskListResponse { const SEEDED_DATA = [ { - id: uuidv4(), + id: crypto.randomUUID(), content: 'task 1' }, { - id: uuidv4(), + id: crypto.randomUUID(), content: 'task 2' } ]; diff --git a/packages/database/test/helpers/util.ts b/packages/database/test/helpers/util.ts index 91c627c9a14..73eb04a8c5e 100644 --- a/packages/database/test/helpers/util.ts +++ b/packages/database/test/helpers/util.ts @@ -16,7 +16,6 @@ */ import { FirebaseApp, initializeApp } from '@firebase/app'; -import { uuidv4 } from '@firebase/util'; import { expect } from 'chai'; import { @@ -105,7 +104,7 @@ export function waitFor(waitTimeInMS: number) { // Creates a unique reference using uuid export function getUniqueRef(db: Database) { - const path = uuidv4(); + const path = crypto.randomUUID(); return ref(db, path); } diff --git a/packages/util/index.node.ts b/packages/util/index.node.ts index 9c3b54b1c86..d839460713c 100644 --- a/packages/util/index.node.ts +++ b/packages/util/index.node.ts @@ -38,7 +38,6 @@ export * from './src/sha1'; export * from './src/subscribe'; export * from './src/validation'; export * from './src/utf8'; -export * from './src/uuid'; export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; diff --git a/packages/util/index.ts b/packages/util/index.ts index 38b944cd9b5..51c27c31099 100644 --- a/packages/util/index.ts +++ b/packages/util/index.ts @@ -33,7 +33,6 @@ export * from './src/sha1'; export * from './src/subscribe'; export * from './src/validation'; export * from './src/utf8'; -export * from './src/uuid'; export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; diff --git a/packages/util/src/uuid.ts b/packages/util/src/uuid.ts deleted file mode 100644 index d931d4644e2..00000000000 --- a/packages/util/src/uuid.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2022 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. - */ - -/** - * Copied from https://stackoverflow.com/a/2117523 - * Generates a new uuid. - * @public - */ -export const uuidv4 = function (): string { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { - const r = (Math.random() * 16) | 0, - v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; From 645487bc4f31bd55e00bbe9fcf1920c9b21f51a1 Mon Sep 17 00:00:00 2001 From: "Nhien (Ricky) Lam" <62775270+NhienLam@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:11:25 -0800 Subject: [PATCH 063/295] Update CODEOWNERS for Auth (#8694) --- .github/CODEOWNERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a90241dea57..ec2416ecb23 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -37,10 +37,10 @@ packages/messaging-interop-types @zwu52 @firebase/jssdk-global-approvers integration/messaging @zwu52 @firebase/jssdk-global-approvers # Auth Code -packages/auth @lisajian @Xiaoshouzi-gh @sam-gc @firebase/jssdk-global-approvers -packages/auth-compat @lisajian @Xiaoshouzi-gh @sam-gc @firebase/jssdk-global-approvers -packages/auth-types @lisajian @Xiaoshouzi-gh @sam-gc @firebase/jssdk-global-approvers -packages/auth-interop-types @lisajian @Xiaoshouzi-gh @sam-gc @firebase/jssdk-global-approvers +packages/auth @lisajian @Xiaoshouzi-gh @sam-gc @pashanka @mansisampat @nhienlam @firebase/jssdk-global-approvers +packages/auth-compat @lisajian @Xiaoshouzi-gh @sam-gc @pashanka @mansisampat @nhienlam @firebase/jssdk-global-approvers +packages/auth-types @lisajian @Xiaoshouzi-gh @sam-gc @pashanka @mansisampat @nhienlam @firebase/jssdk-global-approvers +packages/auth-interop-types @lisajian @Xiaoshouzi-gh @sam-gc @pashanka @mansisampat @nhienlam @firebase/jssdk-global-approvers # Testing Code packages/rules-unit-testing @avolkovi @sam-gc @yuchenshi @firebase/jssdk-global-approvers From a133053305095ac85bbf30200107e2a7a593aa77 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:48:17 -0800 Subject: [PATCH 064/295] Update GitHub Artifact Actions to v4 (#8128) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-all.yml | 10 +++++----- .github/workflows/test-changed-firestore.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 68983f50a38..8b624bf7cf7 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -57,7 +57,7 @@ jobs: gzip build.tar - name: Upload build archive if: ${{ !cancelled() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build.tar.gz path: build.tar.gz @@ -74,7 +74,7 @@ jobs: run: | npx @puppeteer/browsers install chrome@stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -125,7 +125,7 @@ jobs: run: | echo $CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -165,7 +165,7 @@ jobs: run: | npx @puppeteer/browsers install chrome@stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -209,7 +209,7 @@ jobs: run: | npx @puppeteer/browsers install chrome@stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 259e9164d7f..25726ffae1a 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -72,7 +72,7 @@ jobs: gzip build.tar - name: Upload build archive if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.check-changed.outcome != 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build.tar.gz path: build.tar.gz @@ -93,7 +93,7 @@ jobs: sudo apt-get update sudo apt-get install google-chrome-stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -121,7 +121,7 @@ jobs: sudo apt-get update sudo apt-get install google-chrome-stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -151,7 +151,7 @@ jobs: sudo apt-get update sudo apt-get install google-chrome-stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -180,7 +180,7 @@ jobs: with: node-version: 22.10.0 - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -204,7 +204,7 @@ jobs: - name: install Firefox stable run: npx @puppeteer/browsers install firefox@stable - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact From c19a051ce490398f49fbf9bdb7181a986b66fa14 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 9 Jan 2025 10:17:03 -0800 Subject: [PATCH 065/295] Updated FDC to include promise instead of promiselike (#8667) --- .changeset/tame-tigers-approve.md | 6 +++++ common/api-review/data-connect.api.md | 12 ++-------- packages/data-connect/src/api/Mutation.ts | 6 ++--- packages/data-connect/src/api/query.ts | 4 ++-- packages/data-connect/src/network/fetch.ts | 9 ++++++-- .../src/network/transport/index.ts | 8 ++----- .../src/network/transport/rest.ts | 22 +++++-------------- packages/data-connect/test/unit/fetch.test.ts | 12 ++++++++-- 8 files changed, 38 insertions(+), 41 deletions(-) create mode 100644 .changeset/tame-tigers-approve.md diff --git a/.changeset/tame-tigers-approve.md b/.changeset/tame-tigers-approve.md new file mode 100644 index 00000000000..42ce75ecfc0 --- /dev/null +++ b/.changeset/tame-tigers-approve.md @@ -0,0 +1,6 @@ +--- +"@firebase/data-connect": minor +"firebase": minor +--- + +Updated to include promise instead of promiselike diff --git a/common/api-review/data-connect.api.md b/common/api-review/data-connect.api.md index b2c6fb01931..952d8b4dc10 100644 --- a/common/api-review/data-connect.api.md +++ b/common/api-review/data-connect.api.md @@ -11,14 +11,6 @@ import { FirebaseError } from '@firebase/util'; import { LogLevelString } from '@firebase/logger'; import { Provider } from '@firebase/component'; -// @public (undocumented) -export interface CancellableOperation extends PromiseLike<{ - data: T; -}> { - // (undocumented) - cancel: () => void; -} - // @public export function connectDataConnectEmulator(dc: DataConnect, host: string, port?: number, sslEnabled?: boolean): void; @@ -88,7 +80,7 @@ export function getDataConnect(app: FirebaseApp, options: ConnectorConfig): Data export const MUTATION_STR = "mutation"; // @public -export interface MutationPromise extends PromiseLike> { +export interface MutationPromise extends Promise> { } // @public (undocumented) @@ -144,7 +136,7 @@ export interface OpResult { export const QUERY_STR = "query"; // @public -export interface QueryPromise extends PromiseLike> { +export interface QueryPromise extends Promise> { } // @public diff --git a/packages/data-connect/src/api/Mutation.ts b/packages/data-connect/src/api/Mutation.ts index ca2efdb7a30..570b28b0eab 100644 --- a/packages/data-connect/src/api/Mutation.ts +++ b/packages/data-connect/src/api/Mutation.ts @@ -76,7 +76,7 @@ export function mutationRef( * @internal */ export class MutationManager { - private _inflight: Array> = []; + private _inflight: Array> = []; constructor(private _transport: DataConnectTransport) {} executeMutation( mutationRef: MutationRef @@ -95,7 +95,7 @@ export class MutationManager { return obj; }); this._inflight.push(result); - const removePromise = (): Array> => + const removePromise = (): Array> => (this._inflight = this._inflight.filter(promise => promise !== result)); result.then(removePromise, removePromise); return withRefPromise; @@ -113,7 +113,7 @@ export interface MutationResult * Mutation return value from `executeMutation` */ export interface MutationPromise - extends PromiseLike> { + extends Promise> { // reserved for special actions like cancellation } diff --git a/packages/data-connect/src/api/query.ts b/packages/data-connect/src/api/query.ts index a4ab17b7ceb..00382686dab 100644 --- a/packages/data-connect/src/api/query.ts +++ b/packages/data-connect/src/api/query.ts @@ -67,7 +67,7 @@ export interface QueryResult * Promise returned from `executeQuery` */ export interface QueryPromise - extends PromiseLike> { + extends Promise> { // reserved for special actions like cancellation } @@ -124,7 +124,7 @@ export function queryRef( dataConnect: dcInstance, refType: QUERY_STR, name: queryName, - variables: variables as Variables + variables: variables }; } /** diff --git a/packages/data-connect/src/network/fetch.ts b/packages/data-connect/src/network/fetch.ts index 06ef6dd8285..d5d2a439432 100644 --- a/packages/data-connect/src/network/fetch.ts +++ b/packages/data-connect/src/network/fetch.ts @@ -30,9 +30,14 @@ function getGoogApiClientValue(_isUsingGen: boolean): string { } return str; } +export interface DataConnectFetchBody { + name: string; + operationName: string; + variables: T; +} export function dcFetch( url: string, - body: U, + body: DataConnectFetchBody, { signal }: AbortController, appId: string | null, accessToken: string | null, @@ -95,7 +100,7 @@ export function dcFetch( logError('DataConnect error while performing request: ' + stringified); throw new DataConnectError(Code.OTHER, stringified); } - return res as { data: T; errors: Error[] }; + return res; }); } interface MessageObject { diff --git a/packages/data-connect/src/network/transport/index.ts b/packages/data-connect/src/network/transport/index.ts index 5518faa0f95..f4bb801f9b3 100644 --- a/packages/data-connect/src/network/transport/index.ts +++ b/packages/data-connect/src/network/transport/index.ts @@ -26,19 +26,15 @@ export interface DataConnectTransport { invokeQuery( queryName: string, body?: U - ): PromiseLike<{ data: T; errors: Error[] }>; + ): Promise<{ data: T; errors: Error[] }>; invokeMutation( queryName: string, body?: U - ): PromiseLike<{ data: T; errors: Error[] }>; + ): Promise<{ data: T; errors: Error[] }>; useEmulator(host: string, port?: number, sslEnabled?: boolean): void; onTokenChanged: (token: string | null) => void; } -export interface CancellableOperation extends PromiseLike<{ data: T }> { - cancel: () => void; -} - /** * @internal */ diff --git a/packages/data-connect/src/network/transport/rest.ts b/packages/data-connect/src/network/transport/rest.ts index 85847868c5d..0a49fc9e269 100644 --- a/packages/data-connect/src/network/transport/rest.ts +++ b/packages/data-connect/src/network/transport/rest.ts @@ -161,7 +161,7 @@ export class RESTTransport implements DataConnectTransport { invokeQuery: ( queryName: string, body?: U - ) => PromiseLike<{ data: T; errors: Error[] }> = ( + ) => Promise<{ data: T; errors: Error[] }> = ( queryName: string, body: U ) => { @@ -174,7 +174,7 @@ export class RESTTransport implements DataConnectTransport { name: `projects/${this._project}/locations/${this._location}/services/${this._serviceName}/connectors/${this._connectorName}`, operationName: queryName, variables: body - } as unknown as U, // TODO(mtewani): This is a patch, fix this. + }, abortController, this.appId, this._accessToken, @@ -182,16 +182,12 @@ export class RESTTransport implements DataConnectTransport { this._isUsingGen ) ); - - return { - then: withAuth.then.bind(withAuth), - catch: withAuth.catch.bind(withAuth) - }; + return withAuth; }; invokeMutation: ( queryName: string, body?: U - ) => PromiseLike<{ data: T; errors: Error[] }> = ( + ) => Promise<{ data: T; errors: Error[] }> = ( mutationName: string, body: U ) => { @@ -203,7 +199,7 @@ export class RESTTransport implements DataConnectTransport { name: `projects/${this._project}/locations/${this._location}/services/${this._serviceName}/connectors/${this._connectorName}`, operationName: mutationName, variables: body - } as unknown as U, + }, abortController, this.appId, this._accessToken, @@ -211,12 +207,6 @@ export class RESTTransport implements DataConnectTransport { this._isUsingGen ); }); - - return { - then: taskResult.then.bind(taskResult), - // catch: taskResult.catch.bind(taskResult), - // finally: taskResult.finally.bind(taskResult), - cancel: () => abortController.abort() - }; + return taskResult; }; } diff --git a/packages/data-connect/test/unit/fetch.test.ts b/packages/data-connect/test/unit/fetch.test.ts index a50ac188724..3d9a9b04523 100644 --- a/packages/data-connect/test/unit/fetch.test.ts +++ b/packages/data-connect/test/unit/fetch.test.ts @@ -42,7 +42,11 @@ describe('fetch', () => { await expect( dcFetch( 'http://localhost', - {}, + { + name: 'n', + operationName: 'n', + variables: {} + }, {} as AbortController, null, null, @@ -61,7 +65,11 @@ describe('fetch', () => { await expect( dcFetch( 'http://localhost', - {}, + { + name: 'n', + operationName: 'n', + variables: {} + }, {} as AbortController, null, null, From a0e0a1c2cfd1c6b5fceb2da364afd2c2b3e13545 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:40:37 -0800 Subject: [PATCH 066/295] Update actions/setup-node action to v4 (#8186) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/canary-deploy.yml | 2 +- .github/workflows/check-changeset.yml | 2 +- .github/workflows/check-docs.yml | 2 +- .github/workflows/check-pkg-paths.yml | 2 +- .github/workflows/deploy-config.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/health-metrics-pull-request.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/prerelease-manual-deploy.yml | 2 +- .github/workflows/release-prod.yml | 2 +- .github/workflows/release-staging.yml | 2 +- .github/workflows/test-all.yml | 10 +++++----- .github/workflows/test-changed-auth.yml | 4 ++-- .github/workflows/test-changed-fcm-integration.yml | 2 +- .../workflows/test-changed-firestore-integration.yml | 2 +- .github/workflows/test-changed-firestore.yml | 12 ++++++------ .github/workflows/test-changed-misc.yml | 2 +- .github/workflows/test-changed.yml | 4 ++-- .github/workflows/test-firebase-integration.yml | 2 +- .github/workflows/update-api-reports.yml | 2 +- 20 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/canary-deploy.yml b/.github/workflows/canary-deploy.yml index b2139d4df0c..2a9a6a803a6 100644 --- a/.github/workflows/canary-deploy.yml +++ b/.github/workflows/canary-deploy.yml @@ -32,7 +32,7 @@ jobs: # Canary release script requires git history and tags. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index fa93c2c6cc9..3514f409c81 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -35,7 +35,7 @@ jobs: # This makes Actions fetch all Git history so check_changeset script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index 34ad997fbc4..de182b3eeb0 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -28,7 +28,7 @@ jobs: # get all history for the diff fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/check-pkg-paths.yml b/.github/workflows/check-pkg-paths.yml index 3d6fb1099e3..96dfc6f6556 100644 --- a/.github/workflows/check-pkg-paths.yml +++ b/.github/workflows/check-pkg-paths.yml @@ -28,7 +28,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/deploy-config.yml b/.github/workflows/deploy-config.yml index f01d8dcc9b3..0c3604e4704 100644 --- a/.github/workflows/deploy-config.yml +++ b/.github/workflows/deploy-config.yml @@ -36,7 +36,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 8dc971a1a8c..f0bbd672fc3 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -32,7 +32,7 @@ jobs: # get all history for the diff fetch-depth: 0 - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/health-metrics-pull-request.yml b/.github/workflows/health-metrics-pull-request.yml index 8c7aba8fb50..cd6ca442a6e 100644 --- a/.github/workflows/health-metrics-pull-request.yml +++ b/.github/workflows/health-metrics-pull-request.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 22.10.0 - uses: 'google-github-actions/auth@v0' @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 22.10.0 - uses: 'google-github-actions/auth@v0' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 82bb1410226..b6883bea303 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: yarn install diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index 7821734e85a..e5ccabdd144 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -35,7 +35,7 @@ jobs: # Canary release script requires git history and tags. fetch-depth: 0 - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 1ac9d1f3ee7..f5a5b808629 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Checkout release branch (with history) diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 94b66c6c7a5..d014167766d 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -47,7 +47,7 @@ jobs: if: github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch') steps: - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Merge main into release diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 8b624bf7cf7..02f8eda2a9c 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -41,7 +41,7 @@ jobs: npx @puppeteer/browsers install chrome@stable - uses: actions/checkout@v3 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -80,7 +80,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -131,7 +131,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -171,7 +171,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -215,7 +215,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - run: cp config/ci.config.json config/project.json diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index e88ce3b7a52..445c2bfb9b8 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -57,7 +57,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -82,7 +82,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install diff --git a/.github/workflows/test-changed-fcm-integration.yml b/.github/workflows/test-changed-fcm-integration.yml index ee7b680f70d..ff6023274a4 100644 --- a/.github/workflows/test-changed-fcm-integration.yml +++ b/.github/workflows/test-changed-fcm-integration.yml @@ -39,7 +39,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index b288ea49ed0..d9269a6d1ac 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -69,7 +69,7 @@ jobs: continue-on-error: true - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 25726ffae1a..e5a45745f7b 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -38,7 +38,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable @@ -85,7 +85,7 @@ jobs: if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable @@ -113,7 +113,7 @@ jobs: if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable @@ -143,7 +143,7 @@ jobs: if: ${{ github.event_name != 'pull_request' }} steps: - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable @@ -176,7 +176,7 @@ jobs: - name: install Firefox stable run: npx @puppeteer/browsers install firefox@stable - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Download build archive @@ -265,7 +265,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup diff --git a/.github/workflows/test-changed-misc.yml b/.github/workflows/test-changed-misc.yml index 3cabe64f2b3..ebcb2d1d366 100644 --- a/.github/workflows/test-changed-misc.yml +++ b/.github/workflows/test-changed-misc.yml @@ -32,7 +32,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 7dc0ef60a37..68a3e2b7830 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -32,7 +32,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable @@ -58,7 +58,7 @@ jobs: with: fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Firefox stable diff --git a/.github/workflows/test-firebase-integration.yml b/.github/workflows/test-firebase-integration.yml index 9a99e6f82a3..26a0cb2ead0 100644 --- a/.github/workflows/test-firebase-integration.yml +++ b/.github/workflows/test-firebase-integration.yml @@ -32,7 +32,7 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: install Chrome stable diff --git a/.github/workflows/update-api-reports.yml b/.github/workflows/update-api-reports.yml index 761d7020c7a..c961889de98 100644 --- a/.github/workflows/update-api-reports.yml +++ b/.github/workflows/update-api-reports.yml @@ -31,7 +31,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} token: ${{ github.token }} - name: Set up node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Yarn install From d16a4874b71ae21ef54e85fc1b43fc92319f7ef1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:26:57 -0800 Subject: [PATCH 067/295] chore(deps): update actions/github-script action to v7 (#8154) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/merge-release-branch.yml | 2 +- .github/workflows/release-staging.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-release-branch.yml b/.github/workflows/merge-release-branch.yml index 19a3f6efd86..7142908b78a 100644 --- a/.github/workflows/merge-release-branch.yml +++ b/.github/workflows/merge-release-branch.yml @@ -37,7 +37,7 @@ jobs: run: | echo "Merging release ${{ steps.get-version.outputs.RELEASE_VERSION }}" - name: Merge to main - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index d014167766d..c4adefb44a8 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -51,7 +51,7 @@ jobs: with: node-version: 22.10.0 - name: Merge main into release - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.OSS_BOT_GITHUB_TOKEN }} script: | From 0755a723db80edd204d904ea1d05b95eadb2c5fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:55:15 -0800 Subject: [PATCH 068/295] chore(deps): update actions/checkout action to v4 (#8153) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/health-metrics-pull-request.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/test-all.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/health-metrics-pull-request.yml b/.github/workflows/health-metrics-pull-request.yml index cd6ca442a6e..ff7bd7286c1 100644 --- a/.github/workflows/health-metrics-pull-request.yml +++ b/.github/workflows/health-metrics-pull-request.yml @@ -38,7 +38,7 @@ jobs: if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -55,7 +55,7 @@ jobs: if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b6883bea303..3ae2ae0a074 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up node (20) uses: actions/setup-node@v4 with: diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 02f8eda2a9c..b7d40bc7245 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -39,7 +39,7 @@ jobs: - name: install Chrome stable run: | npx @puppeteer/browsers install chrome@stable - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Node (20) uses: actions/setup-node@v4 with: From 6a8263446854e5e91930cd888c9f8e55c8041b1f Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 14 Jan 2025 14:58:01 -0800 Subject: [PATCH 069/295] Use versions instead of commits in vertexai responses actions scripts (#8702) --- .../workflows/check-vertexai-responses.yml | 72 ++++++++++--------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 61f9cd45549..418ada2fc34 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -19,36 +19,44 @@ on: pull_request jobs: check-version: runs-on: ubuntu-latest + # Allow GITHUB_TOKEN to have write permissions + permissions: + contents: write steps: - - uses: actions/checkout@v4 - - name: Clone mock responses - run: scripts/update_vertexai_responses.sh - - name: Find cloned and latest versions - run: | - CLONED=$(git describe --tags) - LATEST=$(git tag --sort=v:refname | tail -n1) - echo "cloned_tag=$CLONED" >> $GITHUB_ENV - echo "latest_tag=$LATEST" >> $GITHUB_ENV - working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data - - name: Find comment from previous run if exists - uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e - id: fc - with: - issue-number: ${{github.event.number}} - body-includes: Vertex AI Mock Responses Check - - name: Comment on PR if newer version is available - if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} - uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 - with: - issue-number: ${{github.event.number}} - body: > - ### Vertex AI Mock Responses Check :warning: - - A newer major version of the mock responses for Vertex AI unit tests is available. - [update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh) - should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - - name: Delete comment when version gets updated - if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} + - uses: actions/checkout@v4 + - name: Clone mock responses + run: scripts/update_vertexai_responses.sh + - name: Find cloned and latest versions + run: | + CLONED=$(git describe --tags) + LATEST=$(git tag --sort=v:refname | tail -n1) + echo "cloned_tag=$CLONED" >> $GITHUB_ENV + echo "latest_tag=$LATEST" >> $GITHUB_ENV + working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data + - name: Find comment from previous run if exists + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{github.event.number}} + body-includes: Vertex AI Mock Responses Check + - name: Comment on PR if newer version is available + if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{github.event.number}} + body: > + ### Vertex AI Mock Responses Check :warning: + + A newer major version of the mock responses for Vertex AI unit tests is available. + [update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh) + should be updated to clone the latest version of the responses: `${{env.latest_tag}}` + - name: Delete comment when version gets updated + if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fc.outputs.comment-id }}, + }) From 21164c20198de0d3fd0b81bcbbfefa9724065815 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 14 Jan 2025 15:20:50 -0800 Subject: [PATCH 070/295] Add FDC Integration Tests (#8703) --- .../workflows/test-firebase-integration.yml | 2 +- packages/data-connect/README.md | 5 + packages/data-connect/package.json | 8 +- packages/data-connect/src/api/query.ts | 2 +- .../src/network/transport/rest.ts | 1 + packages/data-connect/test/.firebaserc | 5 + packages/data-connect/test/.gitignore | 69 ++ .../.dataconnect/schema/main/input.gql | 49 - .../.dataconnect/schema/main/mutation.gql | 8 - .../.dataconnect/schema/main/query.gql | 4 - .../.dataconnect/schema/prelude.gql | 953 ------------------ .../test/dataconnect/connector/connector.yaml | 4 +- .../test/dataconnect/connector/mutations.gql | 10 + .../test/dataconnect/connector/queries.gql | 17 + .../test/dataconnect/dataconnect.yaml | 7 +- .../test/dataconnect/schema/schema.gql | 7 +- packages/data-connect/test/firebase.json | 10 + packages/data-connect/test/queries.test.ts | 91 +- .../test/unit/dataconnect.test.ts | 30 +- .../test/unit/transportoptions.test.ts | 3 +- packages/data-connect/test/unit/utils.test.ts | 7 +- packages/data-connect/test/util.ts | 13 +- .../emulators/dataconnect-emulator.ts | 26 +- .../emulator-testing/emulators/emulator.ts | 24 +- 24 files changed, 248 insertions(+), 1107 deletions(-) create mode 100644 packages/data-connect/README.md create mode 100644 packages/data-connect/test/.firebaserc create mode 100644 packages/data-connect/test/.gitignore delete mode 100755 packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql delete mode 100755 packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql delete mode 100755 packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql delete mode 100755 packages/data-connect/test/dataconnect/.dataconnect/schema/prelude.gql create mode 100644 packages/data-connect/test/firebase.json diff --git a/.github/workflows/test-firebase-integration.yml b/.github/workflows/test-firebase-integration.yml index 26a0cb2ead0..d77a49ecf3b 100644 --- a/.github/workflows/test-firebase-integration.yml +++ b/.github/workflows/test-firebase-integration.yml @@ -46,4 +46,4 @@ jobs: - name: build run: yarn build:changed firebase-integration - name: Run tests on changed packages - run: yarn test:changed firebase-integration \ No newline at end of file + run: yarn test:changed firebase-integration diff --git a/packages/data-connect/README.md b/packages/data-connect/README.md new file mode 100644 index 00000000000..40d6f526624 --- /dev/null +++ b/packages/data-connect/README.md @@ -0,0 +1,5 @@ +# Firebase Data Connect + +## Local Development + +Check `test/dataconnect.yaml` to ensure that the correct values are filled in. diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index d7a8f31016e..ed3ec31cdd2 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -31,10 +31,10 @@ "prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'", "build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p --npm-path npm test:emulator", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator", - "test:all": "run-p --npm-path npm lint test:unit", - "test:browser": "karma start --single-run", + "test": "run-p --npm-path npm lint test:emulator", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p --npm-path npm lint test:browser test:node", + "test:browser": "karma start", "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", "test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", "test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts", diff --git a/packages/data-connect/src/api/query.ts b/packages/data-connect/src/api/query.ts index 00382686dab..a1cd0726160 100644 --- a/packages/data-connect/src/api/query.ts +++ b/packages/data-connect/src/api/query.ts @@ -124,7 +124,7 @@ export function queryRef( dataConnect: dcInstance, refType: QUERY_STR, name: queryName, - variables: variables + variables }; } /** diff --git a/packages/data-connect/src/network/transport/rest.ts b/packages/data-connect/src/network/transport/rest.ts index 0a49fc9e269..7c8500b733d 100644 --- a/packages/data-connect/src/network/transport/rest.ts +++ b/packages/data-connect/src/network/transport/rest.ts @@ -166,6 +166,7 @@ export class RESTTransport implements DataConnectTransport { body: U ) => { const abortController = new AbortController(); + // TODO(mtewani): Update to proper value const withAuth = this.withRetry(() => dcFetch( diff --git a/packages/data-connect/test/.firebaserc b/packages/data-connect/test/.firebaserc new file mode 100644 index 00000000000..5ea9e18457f --- /dev/null +++ b/packages/data-connect/test/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "jscore-sandbox-141b5" + } +} diff --git a/packages/data-connect/test/.gitignore b/packages/data-connect/test/.gitignore new file mode 100644 index 00000000000..b17f6310755 --- /dev/null +++ b/packages/data-connect/test/.gitignore @@ -0,0 +1,69 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +firebase-debug.log* +firebase-debug.*.log* + +# Firebase cache +.firebase/ + +# Firebase config + +# Uncomment this if you'd like others to create their own Firebase project. +# For a team working on the same Firebase project(s), it is recommended to leave +# it commented so all members can deploy to the same project(s) in .firebaserc. +# .firebaserc + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# dataconnect generated files +.dataconnect diff --git a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql b/packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql deleted file mode 100755 index 8c472f99a6e..00000000000 --- a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql +++ /dev/null @@ -1,49 +0,0 @@ -scalar Movie_Key -input Movie_Data { - id: String - id_expr: String_Expr - description: String - description_expr: String_Expr - genre: String - genre_expr: String_Expr - name: String - name_expr: String_Expr - test: String - test_expr: String_Expr -} -input Movie_Filter { - _and: [Movie_Filter!] - _not: Movie_Filter - _or: [Movie_Filter!] - id: String_Filter - description: String_Filter - genre: String_Filter - name: String_Filter - test: String_Filter -} -input Movie_ListFilter { - count: Int_Filter - exist: Movie_Filter -} -input Movie_ListUpdate { - append: [Movie_Data!] - delete: Int - i: Int - prepend: [Movie_Data!] - set: [Movie_Data!] - update: [Movie_Update!] -} -input Movie_Order { - id: OrderDirection - description: OrderDirection - genre: OrderDirection - name: OrderDirection - test: OrderDirection -} -input Movie_Update { - id: [String_Update!] - description: [String_Update!] - genre: [String_Update!] - name: [String_Update!] - test: [String_Update!] -} diff --git a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql b/packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql deleted file mode 100755 index b6896486e4a..00000000000 --- a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql +++ /dev/null @@ -1,8 +0,0 @@ -extend type Mutation { - movie_insert(data: Movie_Data!): Movie_Key! - movie_upsert(data: Movie_Data!, update: Movie_Update): Movie_Key! - movie_update(id: String, id_expr: String_Expr, key: Movie_Key, data: Movie_Data, update: Movie_Update): Movie_Key - movie_updateMany(where: Movie_Filter, all: Boolean = false, data: Movie_Data, update: Movie_Update): Int! - movie_delete(id: String, id_expr: String_Expr, key: Movie_Key): Movie_Key - movie_deleteMany(where: Movie_Filter, all: Boolean = false): Int! -} diff --git a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql b/packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql deleted file mode 100755 index 53ee30ce8ad..00000000000 --- a/packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql +++ /dev/null @@ -1,4 +0,0 @@ -extend type Query { - movie(id: String, id_expr: String_Expr, key: Movie_Key): Movie - movies(where: Movie_Filter, orderBy: [Movie_Order!], limit: Int = 100): [Movie!] -} diff --git a/packages/data-connect/test/dataconnect/.dataconnect/schema/prelude.gql b/packages/data-connect/test/dataconnect/.dataconnect/schema/prelude.gql deleted file mode 100755 index 4007a693025..00000000000 --- a/packages/data-connect/test/dataconnect/.dataconnect/schema/prelude.gql +++ /dev/null @@ -1,953 +0,0 @@ -"Conditions on a string value" -input String_Filter { - isNull: Boolean - eq: String - eq_expr: String_Expr - ne: String - ne_expr: String_Expr - in: [String!] - nin: [String!] - gt: String - ge: String - lt: String - le: String - contains: String - startsWith: String - endsWith: String - pattern: String_Pattern -} - -""" -The pattern match condition on a string. Specify either like or regex. -https://www.postgresql.org/docs/current/functions-matching.html -""" -input String_Pattern { - "the LIKE expression to use" - like: String - "the POSIX regular expression" - regex: String - "when true, it's case-insensitive. In Postgres: ILIKE, ~*" - ignoreCase: Boolean - "when true, invert the condition. In Postgres: NOT LIKE, !~" - invert: Boolean -} - -"Conditions on a string list" -input String_ListFilter { - includes: String - excludes: String - includesAll: [String!] - excludesAll: [String!] -} - -"Conditions on a UUID value" -input UUID_Filter { - isNull: Boolean - eq: UUID - ne: UUID - in: [UUID!] - nin: [UUID!] -} - -"Conditions on a UUID list" -input UUID_ListFilter { - includes: UUID - excludes: UUID - includesAll: [UUID!] - excludesAll: [UUID!] -} - -"Conditions on an Int value" -input Int_Filter { - isNull: Boolean - eq: Int - ne: Int - in: [Int!] - nin: [Int!] - gt: Int - ge: Int - lt: Int - le: Int -} - -"Conditions on an Int list" -input Int_ListFilter { - includes: Int - excludes: Int - includesAll: [Int!] - excludesAll: [Int!] -} - -"Conditions on an Int64 value" -input Int64_Filter { - isNull: Boolean - eq: Int64 - ne: Int64 - in: [Int64!] - nin: [Int64!] - gt: Int64 - ge: Int64 - lt: Int64 - le: Int64 -} - -"Conditions on an Int64 list" -input Int64_ListFilter { - includes: Int64 - excludes: Int64 - includesAll: [Int64!] - excludesAll: [Int64!] -} - -"Conditions on a Float value" -input Float_Filter { - isNull: Boolean - eq: Float - ne: Float - in: [Float!] - nin: [Float!] - gt: Float - ge: Float - lt: Float - le: Float -} - -"Conditions on a Float list" -input Float_ListFilter { - includes: Float - excludes: Float - includesAll: [Float!] - excludesAll: [Float!] -} - -"Conditions on a Boolean value" -input Boolean_Filter { - isNull: Boolean - eq: Boolean - ne: Boolean - in: [Boolean!] - nin: [Boolean!] -} - -"Conditions on a Boolean list" -input Boolean_ListFilter { - includes: Boolean - excludes: Boolean - includesAll: [Boolean!] - excludesAll: [Boolean!] -} - -"Conditions on a Date value" -input Date_Filter { - isNull: Boolean - eq: Date - ne: Date - in: [Date!] - nin: [Date!] - gt: Date - ge: Date - lt: Date - le: Date - """ - Offset the date filters by a fixed duration. - last 3 months is {ge: {today: true}, offset: {months: -3}} - """ - offset: Date_Offset -} - -"Duration to offset a date value" -input Date_Offset { - days: Int - months: Int - years: Int -} - -"Conditions on a Date list" -input Date_ListFilter { - includes: Date - excludes: Date - includesAll: [Date!] - excludesAll: [Date!] -} - -"Conditions on an Timestamp value" -input Timestamp_Filter { - isNull: Boolean - eq: Timestamp - eq_expr: Timestamp_Expr - ne: Timestamp - ne_expr: Timestamp_Expr - in: [Timestamp!] - nin: [Timestamp!] - gt: Timestamp - gt_expr: Timestamp_Expr - ge: Timestamp - ge_expr: Timestamp_Expr - lt: Timestamp - lt_expr: Timestamp_Expr - le: Timestamp - le_expr: Timestamp_Expr - - """ - Offset timestamp input by a fixed duration. - in 12h is {le: {now: true}, offset: {hours: 12}} - """ - offset: Timestamp_Offset @deprecated -} - -"Duration to offset a timestamp value" -input Timestamp_Offset @fdc_deprecated { - milliseconds: Int - seconds: Int - minutes: Int - hours: Int - days: Int - months: Int - years: Int -} - -"Conditions on a Timestamp list" -input Timestamp_ListFilter { - includes: Timestamp - includes_expr: Timestamp_Expr - excludes: Timestamp - excludes_expr: Timestamp_Expr - includesAll: [Timestamp!] - excludesAll: [Timestamp!] -} - -"Conditions on an Any value" -input Any_Filter { - isNull: Boolean - eq: Any - ne: Any - in: [Any!] - nin: [Any!] -} - -"Conditions on a Any list" -input Any_ListFilter { - includes: Any - excludes: Any - includesAll: [Any!] - excludesAll: [Any!] -} - -"Conditions on an AuthUID value" -input AuthUID_Filter @fdc_deprecated { - eq: AuthUID - ne: AuthUID - in: [AuthUID!] - nin: [AuthUID!] - isNull: Boolean -} - -input AuthUID_ListFilter @fdc_deprecated { - "When true, will match if the list includes the id of the current user." - includes: AuthUID - excludes: AuthUID - includesAll: [AuthUID!] - excludesAll: [AuthUID!] -} - -"Conditions on an Vector value" -input Vector_Filter { - eq: Vector - ne: Vector - in: [Vector!] - nin: [Vector!] - isNull: Boolean -} - -input Vector_ListFilter { - "When true, will match if the list includes the supplied vector." - includes: Vector - excludes: Vector - includesAll: [Vector!] - excludesAll: [Vector!] -} -type Query { - _service: _Service! -} - -type Mutation { - # This is just a dummy field so that Mutation is always non-empty. - _firebase: Void @fdc_deprecated(reason: "dummy field -- does nothing useful") -} - -type _Service { - sdl: String! -} - -"(Internal) Added to things that may be removed from FDC and will soon be no longer usable in schema or operations." -directive @fdc_deprecated(reason: String = "No longer supported") on - | SCHEMA - | SCALAR - | OBJECT - | FIELD_DEFINITION - | ARGUMENT_DEFINITION - | INTERFACE - | UNION - | ENUM - | ENUM_VALUE - | INPUT_OBJECT - | INPUT_FIELD_DEFINITION - -"(Internal) Added to scalars representing quoted CEL expressions." -directive @fdc_celExpression( - "The expected CEL type that the expression should evaluate to." - returnType: String -) on SCALAR - -"(Internal) Added to scalars representing quoted SQL expressions." -directive @fdc_sqlExpression( - "The expected SQL type that the expression should evaluate to." - dataType: String -) on SCALAR - -"(Internal) Added to types that may not be used as variables." -directive @fdc_forbiddenAsVariableType on SCALAR | OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT - -"(Internal) Added to types that may not be used as fields in schema." -directive @fdc_forbiddenAsFieldType on SCALAR | OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT - -"Provides a frequently used example for this type / field / argument." -directive @fdc_example( - "A GraphQL literal value (verbatim) whose type matches the target." - value: Any - "A human-readable text description of what `value` means in this context." - description: String -) repeatable on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | INPUT_OBJECT | INPUT_FIELD_DEFINITION - -"(Internal) Marks this field / argument as conflicting with others in the same group." -directive @fdc_oneOf( - "The group name where fields / arguments conflict with each other." - group: String! = "" - "If true, exactly one field / argument in the group must be specified." - required: Boolean! = false -) repeatable on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION -"AccessLevel specifies coarse access policies for common situations." -enum AccessLevel { - """ - This operation can be executed by anyone with or without authentication. - Equivalent to @auth(expr: "true") - """ - PUBLIC - - """ - This operation can only be executed with a valid Firebase Auth ID token. - Note: it allows anonymous auth and unverified accounts, so may be subjected to abuses. - It’s equivalent to @auth(expr: "auth.uid != nil") - """ - USER_ANON - - """ - This operation can only be executed by a non-anonymous Firebase Auth account. - It’s equivalent to @auth(expr: "auth.uid != nil && auth.token.firebase.sign_in_provider != 'anonymous'")" - """ - USER - - """ - This operation can only be executed by a verified Firebase Auth account. - It’s equivalent to @auth(expr: "auth.uid != nil && auth.token.email_verified")" - """ - USER_EMAIL_VERIFIED - - """ - This operation can not be executed with no IAM credentials. - It’s equivalent to @auth(expr: "false") - """ - NO_ACCESS -} - -""" -Defines the auth policy for a query or mutation. This directive must be added to -any operation you wish to be accessible from a client application. If left -unspecified, defaults to `@auth(level: NO_ACCESS)`. -""" -directive @auth( - "The minimal level of access required to perform this operation." - level: AccessLevel @fdc_oneOf(required: true) - """ - A CEL expression that allows access to this operation if the expression - evaluates to `true`. - """ - expr: Boolean_Expr @fdc_oneOf(required: true) -) on QUERY | MUTATION -""" -Mark this field as a customized resolver. -It may takes customized input arguments and return customized types. - -TODO(b/315857408): Funnel this through API review. - -See: -- go/firemat:custom-resolvers -- go/custom-resolvers-hackweek -""" -directive @resolver on FIELD_DEFINITION -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") -scalar Int64 -scalar Date -scalar Timestamp @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time") -scalar Any -scalar Void -""" -AuthUID is a string representing a Firebase Auth uid. When passing a literal -value for an AuthUID in a query, you may instead pass `{current: true}` and the -currently signed in user's uid will be injected instead. For example: - -```gql -type Order { - customerId: AuthUID! - # ... -} - -query myOrders { - orders: (where: { - customerId: {eq: {current: true}} - }) { customerId } -} -``` -""" -scalar AuthUID @fdc_deprecated -scalar Vector -"Define the intervals used in timestamps and dates (subset)" -enum TimestampInterval @fdc_deprecated { - second - minute - hour - day - week - month - year -} - -input Timestamp_Sentinel @fdc_deprecated { - "Return the current time." - now: Boolean, - "Defines a timestamp relative to the current time. Offset values can be positive or negative." - fromNow: Timestamp_Offset - "Truncate the current/offset time to the specified interval." - truncateTo: TimestampInterval -} - -""" -A Common Expression Language (CEL) expression that returns a boolean at runtime. - -The expression can reference the `auth` variable, which is null if Firebase Auth -is not used. Otherwise, it contains the following fields: - - - `auth.uid`: The current user ID. - - `auth.token`: A map of all token fields (i.e. "claims"). -""" -scalar Boolean_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "bool") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth != null", description: "Allow only if a Firebase Auth user is present.") - -""" -A Common Expression Language (CEL) expression that returns a string at runtime. - -Limitation: Right now, only a few expressions are supported. Those are listed -using the @fdc_example directive on this scalar. -""" -scalar String_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "string") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth.uid", description: "The ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)") - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID (version 4) string, formatted as 32 lower-case hex digits without delimiters.") - -""" -A Common Expression Language (CEL) expression that returns a Timestamp at runtime. - -Limitation: Right now, only a few expressions are supported. Those are listed -using the @fdc_example directive on this scalar. -""" -scalar Timestamp_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "google.protobuf.Timestamp") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "request.time", description: "The timestamp when the request is received (with microseconds precision).") - -""" -A Common Expression Language (CEL) expression that returns a UUID string at runtime. - -Limitation: Right now, only a few expressions are supported. Those are listed -using the @fdc_example directive on this scalar. -""" -scalar UUID_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "string") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID (version 4) every time.") - -""" -A Common Expression Language (CEL) expression whose return type is unspecified. - -Limitation: Only a limited set of expressions are supported for now for each -type. For type XXX, see the @fdc_example directives on XXX_Expr for a full list. -""" -scalar Any_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth.uid", description: "The ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)") - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID version 4 (formatted as 32 lower-case hex digits without delimiters if result type is String).") - @fdc_example(value: "request.time", description: "The timestamp when the request is received (with microseconds precision).") - -""" -A PostgreSQL value expression whose return type is unspecified. -""" -scalar Any_SQL - @specifiedBy(url: "https://www.postgresql.org/docs/current/sql-expressions.html") - @fdc_sqlExpression - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType -""" -Defines a relational database table. - -Given `type TableName @table`, - - - `TableName` is the GQL type name. - - `tableName` is the singular name. Override with `@table(singular)`. - - `tableNames` is the plural name. Override with `@table(plural)`. - - `table_name` is the SQL table id. Override with `@table(name)`. - -Only a table type can be configured further with: - - - Customized data types. See `@col`. - - Index. See `@index` - - Unique constraint. See `@unqiue` - - Relation. See `@ref` - - Embedded Json. See `@embed` - -A scalar field map to a SQL database column. -An object field (like `type TableName @table { field: AnotherType }`) are either - - - a relation reference field if `AnotherType` is annotated with `@table`. - - an embedded json field if `field` is annotated with `@embed`. - -""" -directive @table( - "Override the SQL database table name. Defaults to ." - name: String - "Override the singular name. Default is the camel case of the type name." - singular: String - "Override the plural name. Default is generated based on English patterns." - plural: String - "The primary key of the table. Defaults to a single field `id: UUID!`. Generate if missing." - key: [String!] -) on OBJECT - -""" -Defines a relational database view. - -Given `type ViewName @view`, - - `ViewName` is the GQL type name. - - `viewName` is the singular name. Override with `@view(singular)`. - - `viewNames` is the plural name. Override with `@view(plural)`. - - `view_name` is the SQL view id. Override with `@view(name)`. - When `@view(sql)` is defined, it uses the given raw SQL as the view instead. - -A view type can be used just as a table type with queries. -A view type may have a nullable `@ref` field to another table, but cannot be -referenced in a `@ref`. - -WARNING: Firebase Data Connect does not validate the SQL of the view or -evaluate whether it matches the defined fields. - -If the SQL view is invalid or undefined, related requests may fail. -If the SQL view return incompatible types. Firebase Data Connect will surface -an error in the response. -""" -directive @view( - """ - The SQL view name. If no `name` or `sql` are provided, defaults to - snake_case of the singular type name. - """ - name: String @fdc_oneOf - """ - SQL SELECT statement to use as the basis for this type. Note that all SQL - identifiers should be snake_case and all GraphQL identifiers should be - camelCase. - """ - sql: String @fdc_oneOf - "Override the singular name. Default is the camel case of the type name." - singular: String - "Override the plural name. Default is generated based on English patterns." - plural: String -) on OBJECT - -""" -Specify additional column options. - -Given `type TableName @table { fieldName: Int } ` - - - `field_name` is the SQL column name. Override with `@col(name)`. - -""" -directive @col( - "The SQL database column name. Defaults to ." - name: String - """ - Override SQL columns data type. - Each GraphQL type could map to many SQL data types. - Refer to Postgres supported data types and mappings to GQL. - """ - dataType: String - """ - Defines a fixed column size for certain scalar types. - - - For Vector, size is required. It establishes the length of the vector. - - For String, size converts `text` type to `varchar(size)`. - """ - size: Int -) on FIELD_DEFINITION - - -""" -Define an embedded JSON field represented as Postgres `jsonb` (or `json`). - -Given `type TableName @table { fieldName: EmbeddedType @embed }` -`EmbeddedType` must NOT have `@table`. - - - Store JSON object if `EmbeddedType`. Required column if `EmbeddedType!`. - - Store JSON array if `[EmbeddedType]`. Required column if `[EmbeddedType]!`. - -""" -directive @embed on FIELD_DEFINITION - -""" -Define a reference field to another table. - -Given `type TableName @table { refField: AnotherTableName }`, it defines a foreign-key constraint - - - with id `table_name_ref_field_fkey` (override with `@ref(constraintName)`) - - from `table_name.ref_field` (override with `@ref(fields)`) - - to `another_table_name.id` (override with `@ref(references)`) - -Does not support `[AnotherTableName]` because array fields cannot have foreign-key constraints. -Nullability determines whether the reference is required. - - - `refField: AnotherTableName`: optional reference, SET_NULL on delete. - - `refField: AnotherTableName!`: required reference, CASCADE on delete. - -Consider all types of SQL relations: - - - many-to-one relations involve a reference field on the many-side. - - many-to-maybe-one if `refField: AnotherTableName`. - - many-to-exactly-one if `refField: AnotherTableName!`. - - one-to-one relations involve a unique reference field on one side. - - maybe-one-to-maybe-one if `refField: AnotherTableName @unique`. - - maybe-one-to-exact-one if `refField: AnotherTableName! @unique`. - - exact-one-to-exact-one shall be represented as a single table instead. - - many-to-many relations involve a join table. - - Its primary keys must be two non-null reference fields to tables bridged together to guarantee at most one relation per pair. - -type TableNameToAnotherTableName @table(key: ["refField", "anotherRefField"]) { - refField: TableName! - anotherRefField: AnotherTableName! -} - -""" -directive @ref( - "The SQL database foreign key constraint name. Default to __fkey." - constraintName: String - """ - Foreign key fields. Default to . - """ - fields: [String!] - "The fields that the foreign key references in the other table. Default to the primary key." - references: [String!] -) on FIELD_DEFINITION - -enum IndexFieldOrder { ASC DESC } - -""" -Defines a database index to optimize query performance. - -Given `type TableName @table @index(fields: [“fieldName”, “secondFieldName”])`, -`table_name_field_name_second_field_name_aa_idx` is the SQL index id. -`table_name_field_name_second_field_name_ad_idx` if `order: [ASC DESC]`. -`table_name_field_name_second_field_name_dd_idx` if `order: [DESC DESC]`. - -Given `type TableName @table { fieldName: Int @index } ` -`table_name_field_name_idx` is the SQL index id. -`order` matters less for single field indexes because they can be scanned in both ways. - -Override with `@index(name)` in case of index name conflicts. -""" -directive @index( - "The SQL database index id. Defaults to __idx." - name: String - """ - Only allowed and required when used on OBJECT. - The fields to create an index on. - """ - fields: [String!] - """ - Only allowed when used on OBJECT. - Index order of each column. Default to all ASC. - """ - order: [IndexFieldOrder!] -) repeatable on FIELD_DEFINITION | OBJECT - -""" -Defines a unique constraint. - -Given `type TableName @table @unique(fields: [“fieldName”, “secondFieldName”])`, -`table_name_field_name_second_field_name_uidx` is the SQL unique index id. -Given `type TableName @table { fieldName: Int @unique } ` -`table_name_field_name_idx` is the SQL unique index id. - -Override with `@unique(indexName)` in case of index name conflicts. -""" -directive @unique( - "The SQL database unique index name. Defaults to __uidx." - indexName: String - """ - Only allowed and required when used on OBJECT. - The fields to create a unique constraint on. - """ - fields: [String!] -) repeatable on FIELD_DEFINITION | OBJECT - -"Define the direction of an orderby query" -enum OrderDirection { - ASC - DESC -} - -""" -Defines what siliarlity function to use for fetching vectors. -Details here: https://github.com/pgvector/pgvector?tab=readme-ov-file#vector-functions -""" -enum VectorSimilarityMethod { - L2 - COSINE - INNER_PRODUCT -} - -enum ColDefault @fdc_deprecated { - """ - Generates a random UUID (v4) as the default column value. - Compatible with String or UUID typed fields. - """ - UUID - """ - Generates an auto-incrementing sequence as the default column value. - Compatible with Int and Int64 typed fields. - """ - SEQUENCE - """ - Populates the default column value with the current date or timestamp. - Compatible with Date and Timestamp typed fields. - """ - NOW -} - -""" -Specify the default column value. - -The supported arguments vary based on the field type. -""" -directive @default( - "A constant value. Validated against the field GraphQL type at compile-time." - value: Any @fdc_oneOf(required: true) - "(Deprecated) Built-in common ways to generate initial value." - generate: ColDefault @fdc_oneOf(required: true) @deprecated - "A CEL expression, whose return value must match the field data type." - expr: Any_Expr @fdc_oneOf(required: true) - """ - A raw SQL expression, whose SQL data type must match the underlying column. - - The value is any variable-free expression (in particular, cross-references to - other columns in the current table are not allowed). Subqueries are not allowed either. - https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-DEFAULT - """ - sql: Any_SQL @fdc_oneOf(required: true) -) on FIELD_DEFINITION -"Update input of a String value" -input String_Update { - set: String @fdc_oneOf(group: "set") - set_expr: String_Expr @fdc_oneOf(group: "set") -} - -"Update input of a String list value" -input String_ListUpdate { - set: [String!] - append: [String!] - prepend: [String!] - delete: Int - i: Int - update: String -} - -"Update input of a UUID value" -input UUID_Update { - set: UUID @fdc_oneOf(group: "set") - set_expr: UUID_Expr @fdc_oneOf(group: "set") -} - -"Update input of an ID list value" -input UUID_ListUpdate { - set: [UUID!] - append: [UUID!] - prepend: [UUID!] - delete: Int - i: Int - update: UUID -} - -"Update input of an Int value" -input Int_Update { - set: Int - inc: Int - dec: Int -} - -"Update input of an Int list value" -input Int_ListUpdate { - set: [Int!] - append: [Int!] - prepend: [Int!] - delete: Int - i: Int - update: Int -} - -"Update input of an Int64 value" -input Int64_Update { - set: Int64 - inc: Int64 - dec: Int64 -} - -"Update input of an Int64 list value" -input Int64_ListUpdate { - set: [Int64!] - append: [Int64!] - prepend: [Int64!] - delete: Int - i: Int - update: Int64 -} - -"Update input of a Float value" -input Float_Update { - set: Float - inc: Float - dec: Float -} - -"Update input of a Float list value" -input Float_ListUpdate { - set: [Float!] - append: [Float!] - prepend: [Float!] - delete: Int - i: Int - update: Float -} - -"Update input of a Boolean value" -input Boolean_Update { - set: Boolean -} - -"Update input of a Boolean list value" -input Boolean_ListUpdate { - set: [Boolean!] - append: [Boolean!] - prepend: [Boolean!] - delete: Int - i: Int - update: Boolean -} - -"Update input of a Date value" -input Date_Update { - set: Date - inc: Date_Offset - dec: Date_Offset -} - -"Update input of a Date list value" -input Date_ListUpdate { - set: [Date!] - append: [Date!] - prepend: [Date!] - delete: Int - i: Int - update: Date -} - -"Update input of a Timestamp value" -input Timestamp_Update { - set: Timestamp @fdc_oneOf(group: "set") - set_expr: Timestamp_Expr @fdc_oneOf(group: "set") - inc: Timestamp_Offset - dec: Timestamp_Offset -} - -"Update input of a Timestamp list value" -input Timestamp_ListUpdate { - set: [Timestamp!] - append: [Timestamp!] - prepend: [Timestamp!] - delete: Int - i: Int - update: Timestamp -} - -"Update input of an Any value" -input Any_Update { - set: Any -} - -"Update input of an Any list value" -input Any_ListUpdate { - set: [Any!] - append: [Any!] - prepend: [Any!] - delete: Int - i: Int - update: Any -} - -"Update input of an AuthUID value" -input AuthUID_Update @fdc_deprecated { - set: AuthUID -} - -"Update input of an AuthUID list value" -input AuthUID_ListUpdate @fdc_deprecated { - set: [AuthUID] - append: [AuthUID] - prepend: [AuthUID] - delete: Int - i: Int - update: AuthUID -} - -"Update input of an Vector value" -input Vector_Update { - set: Vector -} - -"Update input of a Vector list value" -input Vector_ListUpdate { - set: [Vector] - append: [Vector] - prepend: [Vector] - delete: Int - i: Int - update: Vector -} diff --git a/packages/data-connect/test/dataconnect/connector/connector.yaml b/packages/data-connect/test/dataconnect/connector/connector.yaml index 064d9c2c184..e945b44b00c 100644 --- a/packages/data-connect/test/dataconnect/connector/connector.yaml +++ b/packages/data-connect/test/dataconnect/connector/connector.yaml @@ -1,6 +1,6 @@ -connectorId: "movies" +connectorId: "tests" authMode: "PUBLIC" generate: javascriptSdk: outputDir: "./gen/web" - package: "@movie-app-ssr/movies" + package: "@test-app/tests" diff --git a/packages/data-connect/test/dataconnect/connector/mutations.gql b/packages/data-connect/test/dataconnect/connector/mutations.gql index e69de29bb2d..6a4f3d30142 100644 --- a/packages/data-connect/test/dataconnect/connector/mutations.gql +++ b/packages/data-connect/test/dataconnect/connector/mutations.gql @@ -0,0 +1,10 @@ +mutation RemovePost($id: UUID!) @auth(level: PUBLIC) { + post_delete(id: $id) +} +mutation AddPost($id: UUID!, $description: String!, $testId: String!) @auth(level: PUBLIC) { + post_insert(data: { + id: $id, + description: $description, + testId: $testId + }) +} diff --git a/packages/data-connect/test/dataconnect/connector/queries.gql b/packages/data-connect/test/dataconnect/connector/queries.gql index e69de29bb2d..49eb7533761 100644 --- a/packages/data-connect/test/dataconnect/connector/queries.gql +++ b/packages/data-connect/test/dataconnect/connector/queries.gql @@ -0,0 +1,17 @@ +query ListPosts($testId: String!) @auth(level: PUBLIC) { + posts(where: { + testId: { + eq: $testId + } + }) { + id, + description, + } +} + +query UnauthorizedQuery { + posts { + id, + description + } +} diff --git a/packages/data-connect/test/dataconnect/dataconnect.yaml b/packages/data-connect/test/dataconnect/dataconnect.yaml index 442e98e5592..06e5380c534 100644 --- a/packages/data-connect/test/dataconnect/dataconnect.yaml +++ b/packages/data-connect/test/dataconnect/dataconnect.yaml @@ -1,11 +1,12 @@ specVersion: "v1beta" -serviceId: "dataconnect" +serviceId: "fdc-service" location: "us-west2" schema: source: "./schema" datasource: postgresql: - database: "dataconnect-test" + database: "tests" cloudSql: - instanceId: "local" + instanceId: "prod" + # schemaValidation: "COMPATIBLE" connectorDirs: ["./connector"] diff --git a/packages/data-connect/test/dataconnect/schema/schema.gql b/packages/data-connect/test/dataconnect/schema/schema.gql index 1b9ca01d832..3ccfaa951a1 100644 --- a/packages/data-connect/test/dataconnect/schema/schema.gql +++ b/packages/data-connect/test/dataconnect/schema/schema.gql @@ -14,10 +14,7 @@ # product: Product! # quantity: Int! # } -type Movie @table { - id: String! - name: String! - genre: String! +type Post @table { description: String! - test: String + testId: String! } diff --git a/packages/data-connect/test/firebase.json b/packages/data-connect/test/firebase.json new file mode 100644 index 00000000000..6c9ad90b440 --- /dev/null +++ b/packages/data-connect/test/firebase.json @@ -0,0 +1,10 @@ +{ + "emulators": { + "dataconnect": { + "dataDir": "dataconnect/.dataconnect/pgliteData" + } + }, + "dataconnect": { + "source": "dataconnect" + } +} diff --git a/packages/data-connect/test/queries.test.ts b/packages/data-connect/test/queries.test.ts index 8b630242a4e..24db1e4508f 100644 --- a/packages/data-connect/test/queries.test.ts +++ b/packages/data-connect/test/queries.test.ts @@ -29,86 +29,86 @@ import { queryRef, QueryResult, SerializedRef, - subscribe, - terminate, SOURCE_CACHE, - SOURCE_SERVER + SOURCE_SERVER, + subscribe, + terminate } from '../src'; -import { setupQueries } from './emulatorSeeder'; import { getConnectionConfig, initDatabase, PROJECT_ID } from './util'; use(chaiAsPromised); -interface Task { +interface Post { id: string; - content: string; + description: string; } -interface TaskListResponse { - posts: Task[]; +interface PostListResponse { + posts: Post[]; } const SEEDED_DATA = [ { id: crypto.randomUUID(), - content: 'task 1' + description: 'task 1' }, { id: crypto.randomUUID(), - content: 'task 2' + description: 'task 2' } ]; const REAL_DATA = SEEDED_DATA.map(obj => ({ ...obj, id: obj.id.replace(/-/g, '') })); -function seedDatabase(instance: DataConnect): Promise { - // call mutation query that adds SEEDED_DATA to database - return new Promise((resolve, reject) => { - async function run(): Promise { - let idx = 0; - while (idx < SEEDED_DATA.length) { - const data = SEEDED_DATA[idx]; - const ref = mutationRef(instance, 'seedDatabase', data); - await executeMutation(ref); - idx++; - } - } - run().then(resolve, reject); - }); -} + async function deleteDatabase(instance: DataConnect): Promise { for (let i = 0; i < SEEDED_DATA.length; i++) { const data = SEEDED_DATA[i]; - const ref = mutationRef(instance, 'removePost', { id: data.id }); + const ref = mutationRef(instance, 'RemovePost', { id: data.id }); + await executeMutation(ref); + } +} +async function seedDatabase( + instance: DataConnect, + testId: string +): Promise { + for (let i = 0; i < SEEDED_DATA.length; i++) { + const data = { ...SEEDED_DATA[i], testId }; + const ref = mutationRef(instance, 'AddPost', data); await executeMutation(ref); } } +interface PostVariables { + testId: string; +} describe('DataConnect Tests', async () => { let dc: DataConnect; + const TEST_ID = crypto.randomUUID(); beforeEach(async () => { dc = initDatabase(); - await setupQueries('queries.schema.gql', [ - { type: 'query', name: 'post' }, - { type: 'mutation', name: 'mutations' } - ]); - await seedDatabase(dc); + await seedDatabase(dc, TEST_ID); }); afterEach(async () => { await deleteDatabase(dc); await terminate(dc); }); + function getPostsRef(): QueryRef { + return queryRef(dc, 'ListPosts', { + testId: TEST_ID + }); + } it('Can get all posts', async () => { - const taskListQuery = queryRef(dc, 'listPosts'); + const taskListQuery = getPostsRef(); const taskListRes = await executeQuery(taskListQuery); expect(taskListRes.data).to.deep.eq({ posts: REAL_DATA }); }); it(`instantly executes a query if one hasn't been subscribed to`, async () => { - const taskListQuery = queryRef(dc, 'listPosts'); - const promise = new Promise>( + const taskListQuery = getPostsRef(); + const promise = new Promise>( (resolve, reject) => { const unsubscribe = subscribe(taskListQuery, { onNext: res => { @@ -129,17 +129,17 @@ describe('DataConnect Tests', async () => { expect(res.source).to.eq(SOURCE_SERVER); }); it(`returns the result source as cache when data already exists`, async () => { - const taskListQuery = queryRef(dc, 'listPosts'); + const taskListQuery = getPostsRef(); const queryResult = await executeQuery(taskListQuery); const result = await waitForFirstEvent(taskListQuery); expect(result.data).to.eq(queryResult.data); expect(result.source).to.eq(SOURCE_CACHE); }); it(`returns the proper JSON when calling .toJSON()`, async () => { - const taskListQuery = queryRef(dc, 'listPosts'); + const taskListQuery = getPostsRef(); await executeQuery(taskListQuery); const result = await waitForFirstEvent(taskListQuery); - const serializedRef: SerializedRef = { + const serializedRef: SerializedRef = { data: { posts: REAL_DATA }, @@ -150,12 +150,14 @@ describe('DataConnect Tests', async () => { projectId: PROJECT_ID }, name: taskListQuery.name, - variables: undefined + variables: { testId: TEST_ID } }, source: SOURCE_CACHE }; - expect(result.toJSON()).to.deep.eq(serializedRef); - expect(result.source).to.deep.eq(SOURCE_CACHE); + const json = result.toJSON(); + expect(json.data).to.deep.eq(serializedRef.data); + expect(json.refInfo).to.deep.eq(serializedRef.refInfo); + expect(json.source).to.deep.eq(serializedRef.source); }); it(`throws an error when the user can't connect to the server`, async () => { // You can't point an existing data connect instance to a new emulator port, so we have to create a new one @@ -165,13 +167,16 @@ describe('DataConnect Tests', async () => { service: 'wrong' }); connectDataConnectEmulator(fakeInstance, 'localhost', 3512); - const taskListQuery = queryRef(fakeInstance, 'listPosts'); + const taskListQuery = queryRef(fakeInstance, 'ListPosts'); await expect(executeQuery(taskListQuery)).to.eventually.be.rejectedWith( - 'ECONNREFUSED' + /EADDRNOTAVAIL|ECONNREFUSED|Failed to fetch/ ); }); it('throws an error with just the message when the server responds with an error', async () => { - const invalidTaskListQuery = queryRef(dc, 'listPosts2'); + const invalidTaskListQuery = queryRef( + dc, + 'UnauthorizedQuery' + ); const message = 'unauthorized: you are not authorized to perform this operation'; await expect( diff --git a/packages/data-connect/test/unit/dataconnect.test.ts b/packages/data-connect/test/unit/dataconnect.test.ts index 314c8a068dc..76d04e3b502 100644 --- a/packages/data-connect/test/unit/dataconnect.test.ts +++ b/packages/data-connect/test/unit/dataconnect.test.ts @@ -18,9 +18,10 @@ import { deleteApp, initializeApp } from '@firebase/app'; import { expect } from 'chai'; -import { ConnectorConfig, getDataConnect } from '../../src'; +import { getDataConnect } from '../../src'; describe('Data Connect Test', () => { + beforeEach(() => {}); it('should throw an error if `projectId` is not provided', async () => { const app = initializeApp({ projectId: undefined }, 'a'); expect(() => @@ -30,24 +31,33 @@ describe('Data Connect Test', () => { ); await deleteApp(app); }); - it('should not throw an error if `projectId` is provided', () => { + it('should not throw an error if `projectId` is provided', async () => { const projectId = 'p'; - initializeApp({ projectId }); + const customApp = initializeApp({ projectId }, 'customApp'); expect(() => getDataConnect({ connector: 'c', location: 'l', service: 's' }) ).to.not.throw( 'Project ID must be provided. Did you pass in a proper projectId to initializeApp?' ); - const dc = getDataConnect({ connector: 'c', location: 'l', service: 's' }); + const dc = getDataConnect(customApp, { + connector: 'c', + location: 'l', + service: 's' + }); expect(dc.app.options.projectId).to.eq(projectId); + await deleteApp(customApp); }); - it('should throw an error if `connectorConfig` is not provided', () => { + it('should throw an error if `connectorConfig` is not provided', async () => { const projectId = 'p'; - initializeApp({ projectId }); - expect(() => getDataConnect({} as ConnectorConfig)).to.throw( - 'DC Option Required' - ); - const dc = getDataConnect({ connector: 'c', location: 'l', service: 's' }); + const customApp = initializeApp({ projectId }, 'customApp'); + // @ts-ignore + expect(() => getDataConnect(customApp)).to.throw('DC Option Required'); + const dc = getDataConnect(customApp, { + connector: 'c', + location: 'l', + service: 's' + }); expect(dc.app.options.projectId).to.eq(projectId); + await deleteApp(customApp); }); }); diff --git a/packages/data-connect/test/unit/transportoptions.test.ts b/packages/data-connect/test/unit/transportoptions.test.ts index 91e090e6a54..a7136b5c408 100644 --- a/packages/data-connect/test/unit/transportoptions.test.ts +++ b/packages/data-connect/test/unit/transportoptions.test.ts @@ -16,6 +16,8 @@ */ import { expect } from 'chai'; + +import { queryRef } from '../../src'; import { TransportOptions, areTransportOptionsEqual, @@ -23,7 +25,6 @@ import { getDataConnect } from '../../src/api/DataConnect'; import { app } from '../util'; -import { queryRef } from '../../src'; describe('Transport Options', () => { it('should return false if transport options are not equal', () => { const transportOptions1: TransportOptions = { diff --git a/packages/data-connect/test/unit/utils.test.ts b/packages/data-connect/test/unit/utils.test.ts index c69c1c8f511..666ca04ac3d 100644 --- a/packages/data-connect/test/unit/utils.test.ts +++ b/packages/data-connect/test/unit/utils.test.ts @@ -19,6 +19,7 @@ import { expect } from 'chai'; import { getDataConnect } from '../../src'; import { validateArgs } from '../../src/util/validateArgs'; +import { app } from '../util'; describe('Utils', () => { it('[Vars required: true] should throw if no arguments are provided', () => { const connectorConfig = { connector: 'c', location: 'l', service: 's' }; @@ -28,12 +29,12 @@ describe('Utils', () => { }); it('[vars required: false, vars provided: false] should return data connect instance and no variables', () => { const connectorConfig = { connector: 'c', location: 'l', service: 's' }; - const dc = getDataConnect(connectorConfig); + const dc = getDataConnect(app, connectorConfig); expect(validateArgs(connectorConfig)).to.deep.eq({ dc, vars: undefined }); }); it('[vars required: false, vars provided: false, data connect provided: true] should return data connect instance and no variables', () => { const connectorConfig = { connector: 'c', location: 'l', service: 's' }; - const dc = getDataConnect(connectorConfig); + const dc = getDataConnect(app, connectorConfig); expect(validateArgs(connectorConfig, dc)).to.deep.eq({ dc, vars: undefined @@ -41,7 +42,7 @@ describe('Utils', () => { }); it('[vars required: true, vars provided: true, data connect provided: true] should return data connect instance and variables', () => { const connectorConfig = { connector: 'c', location: 'l', service: 's' }; - const dc = getDataConnect(connectorConfig); + const dc = getDataConnect(app, connectorConfig); const vars = { a: 1 }; expect(validateArgs(connectorConfig, dc, vars)).to.deep.eq({ dc, vars }); }); diff --git a/packages/data-connect/test/util.ts b/packages/data-connect/test/util.ts index cd9149ed41e..625c263c311 100644 --- a/packages/data-connect/test/util.ts +++ b/packages/data-connect/test/util.ts @@ -24,13 +24,12 @@ import { getDataConnect } from '../src'; -export const USE_EMULATOR = true; export const EMULATOR_PORT = process.env.DC_EMULATOR_PORT; -// export const EMULATOR_PROJECT = process.env.PROJECT; -export const CONNECTOR_NAME = 'c'; -export const LOCATION_NAME = 'l'; -export const SERVICE_NAME = 'l'; -export const PROJECT_ID = 'p'; +const USE_EMULATOR = !!EMULATOR_PORT; +export const CONNECTOR_NAME = 'tests'; +export const LOCATION_NAME = 'us-west2'; +export const SERVICE_NAME = 'fdc-service'; +export const PROJECT_ID = USE_EMULATOR ? 'p' : 'jscore-sandbox-141b5'; export function getConnectionConfig(): ConnectorConfig { return { connector: CONNECTOR_NAME, @@ -46,7 +45,7 @@ export const app = initializeApp({ // Seed the database to have the proper fields to query, such as a list of tasks. export function initDatabase(): DataConnect { const instance = getDataConnect(getConnectionConfig()); - if (!instance.isEmulator) { + if (USE_EMULATOR) { connectDataConnectEmulator(instance, 'localhost', Number(EMULATOR_PORT)); } return instance; diff --git a/scripts/emulator-testing/emulators/dataconnect-emulator.ts b/scripts/emulator-testing/emulators/dataconnect-emulator.ts index efe5bdbe52c..5cea83b073b 100644 --- a/scripts/emulator-testing/emulators/dataconnect-emulator.ts +++ b/scripts/emulator-testing/emulators/dataconnect-emulator.ts @@ -18,26 +18,21 @@ import { platform } from 'os'; import { Emulator } from './emulator'; -const DATABASE_EMULATOR_VERSION = '1.3.7'; +const DATACONNECT_EMULATOR_VERSION = '1.7.5'; export class DataConnectEmulator extends Emulator { - // namespace: string; - - constructor(port = 3628) { + constructor(port = 9399) { const os = platform(); let urlString = ''; switch (os) { case 'darwin': - urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v1.3.7?alt=media&token=2cf32435-d479-4929-b963-a97ae1ac3f0b'; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; case 'linux': - urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v1.3.7?alt=media&token=fd33b4fc-2e27-4874-893a-2d1f0ecbf116'; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; case 'win32': - urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v1.3.7?alt=media&token=bd6e60b0-50b4-46db-aa6c-5fcc6e991f39'; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; default: throw new Error( @@ -45,7 +40,7 @@ export class DataConnectEmulator extends Emulator { ); } super( - `cli-v${DATABASE_EMULATOR_VERSION}`, + `cli-v${DATACONNECT_EMULATOR_VERSION}`, // Use locked version of emulator for test to be deterministic. // The latest version can be found from database emulator doc: // https://firebase.google.com/docs/database/security/test-rules-emulator @@ -54,4 +49,13 @@ export class DataConnectEmulator extends Emulator { ); this.isDataConnect = true; } + async setUp(): Promise { + await super.setUp(); + await fetch(`http://localhost:${this.port}/emulator/configure`, { + method: 'POST', + body: JSON.stringify({ + 'use_dummy': true + }) + }); + } } diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index f149debca14..0eeb1ca88bd 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -123,6 +123,20 @@ export abstract class Emulator { }); } + findDataConnectConfigDir() { + let path = './'; + const files = fs.readdirSync(path); + if (files.includes('dataconnect')) { + return path + 'dataconnect'; + } + if (files.includes('test')) { + return path + 'test/dataconnect'; + } + throw new Error( + 'Max Depth Exceeded. Please run from the data-connect/test folder' + ); + } + setUp(): Promise { return new Promise((resolve, reject) => { if (!this.binaryPath) { @@ -130,11 +144,17 @@ export abstract class Emulator { } let promise: ChildProcessPromise; if (this.isDataConnect) { + const dataConnectConfigDir = this.findDataConnectConfigDir(); promise = spawn(this.binaryPath, [ + '--v=2', 'dev', - '--local_connection_string', - "'postgresql://postgres:secretpassword@localhost:5432/postgres?sslmode=disable'" + `--listen=127.0.0.1:${this.port},[::1]:${this.port}`, + `--config_dir=${dataConnectConfigDir}` ]); + promise.childProcess.stdout?.on('data', console.log); + promise.childProcess.stderr?.on('data', res => + console.log(res.toString()) + ); } else { promise = spawn( 'java', From 0b318a9b851bf7e73b10ce63b6eb7a6a86768771 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 14 Jan 2025 18:47:02 -0500 Subject: [PATCH 071/295] Upgrade two more `download-artifact` v3 actions to v4 in Firestore workflow (#8706) There were a pair of `download-artifact` GitHub actions that were still set to `v3` instead of `v4`. The `v3` actions were unable to find the build archive in the test-changed-firestore workflow. This PR upgrades those to `v4` actions. --- .github/workflows/test-changed-firestore.yml | 4 ++-- config/karma.base.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index e5a45745f7b..0820d40835d 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -232,7 +232,7 @@ jobs: with: node-version: 22.10.0 - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact @@ -259,7 +259,7 @@ jobs: if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: Download build archive - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build.tar.gz - name: Unzip build artifact diff --git a/config/karma.base.js b/config/karma.base.js index 49824296740..fe53d3ac744 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -54,8 +54,8 @@ const config = { // Doing 65 seconds to allow for the 20 second firestore tests browserNoActivityTimeout: 65000, - // preprocess matching files before serving them to the browser - // available preprocessors: + // Preprocess matching files before serving them to the browser. + // Available preprocessors: // https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { 'test/**/*.ts': ['webpack', 'sourcemap'], From d094e60f417d26a3dac5a8d400c27f90dac22bc1 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 16 Jan 2025 05:37:42 -0800 Subject: [PATCH 072/295] Version Packages (#8705) v11.2.0 Release v11.2.0 Co-authored-by: github-actions[bot] --- .changeset/fluffy-rules-pretend.md | 6 --- .changeset/hip-apricots-end.md | 7 --- .changeset/tame-tigers-approve.md | 6 --- integration/compat-interop/package.json | 28 +++++------ integration/firebase/package.json | 2 +- integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 10 ++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 9 ++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 8 ++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 8 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 12 +++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 10 ++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 8 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 39 +++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 8 ++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 8 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 10 ++++ packages/remote-config-compat/package.json | 12 ++--- packages/remote-config-types/CHANGELOG.md | 6 +++ packages/remote-config-types/package.json | 2 +- packages/remote-config/CHANGELOG.md | 13 +++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 8 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 ++++ packages/vertexai/package.json | 8 ++-- repo-scripts/size-analysis/package.json | 4 +- 71 files changed, 480 insertions(+), 198 deletions(-) delete mode 100644 .changeset/fluffy-rules-pretend.md delete mode 100644 .changeset/hip-apricots-end.md delete mode 100644 .changeset/tame-tigers-approve.md diff --git a/.changeset/fluffy-rules-pretend.md b/.changeset/fluffy-rules-pretend.md deleted file mode 100644 index f0507222b35..00000000000 --- a/.changeset/fluffy-rules-pretend.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/app-check': patch -'@firebase/util': patch ---- - -Generate UUIDs with `crypto.randomUUID()` instead of custom uuidv4 function that uses `Math.random()`. diff --git a/.changeset/hip-apricots-end.md b/.changeset/hip-apricots-end.md deleted file mode 100644 index 40bfedbaeec..00000000000 --- a/.changeset/hip-apricots-end.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@firebase/remote-config-types': minor -'@firebase/remote-config': minor -'firebase': minor ---- - -Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. diff --git a/.changeset/tame-tigers-approve.md b/.changeset/tame-tigers-approve.md deleted file mode 100644 index 42ce75ecfc0..00000000000 --- a/.changeset/tame-tigers-approve.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@firebase/data-connect": minor -"firebase": minor ---- - -Updated to include promise instead of promiselike diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 7a9909c82a5..6b49f769766 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.10.17", - "@firebase/app-compat": "0.2.47", - "@firebase/analytics": "0.10.10", - "@firebase/analytics-compat": "0.2.16", - "@firebase/auth": "1.8.1", - "@firebase/auth-compat": "0.5.16", - "@firebase/functions": "0.12.0", - "@firebase/functions-compat": "0.3.17", - "@firebase/messaging": "0.12.15", - "@firebase/messaging-compat": "0.2.15", - "@firebase/performance": "0.6.11", - "@firebase/performance-compat": "0.2.11", - "@firebase/remote-config": "0.4.11", - "@firebase/remote-config-compat": "0.2.11" + "@firebase/app": "0.10.18", + "@firebase/app-compat": "0.2.48", + "@firebase/analytics": "0.10.11", + "@firebase/analytics-compat": "0.2.17", + "@firebase/auth": "1.8.2", + "@firebase/auth-compat": "0.5.17", + "@firebase/functions": "0.12.1", + "@firebase/functions-compat": "0.3.18", + "@firebase/messaging": "0.12.16", + "@firebase/messaging-compat": "0.2.16", + "@firebase/performance": "0.6.12", + "@firebase/performance-compat": "0.2.12", + "@firebase/remote-config": "0.5.0", + "@firebase/remote-config-compat": "0.2.12" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firebase/package.json b/integration/firebase/package.json index 5406179f570..824218cc7fb 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -7,7 +7,7 @@ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { - "firebase": "11.1.0", + "firebase": "11.2.0", "@types/chai": "4.3.14", "@types/mocha": "9.1.1", "chai": "4.4.1", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 12c99e05918..6d0c6e703ec 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.10.17", - "@firebase/firestore": "4.7.5" + "@firebase/app": "0.10.18", + "@firebase/firestore": "4.7.6" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index eb573f08198..f3863666d9a 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.1.0", + "firebase": "11.2.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 5db0624cecb..518e6d170f1 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.17 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/analytics@0.10.11 + - @firebase/component@0.6.12 + ## 0.2.16 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 0220eafdf4e..ffa55dc2f91 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.16", + "version": "0.2.17", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.11", - "@firebase/analytics": "0.10.10", + "@firebase/component": "0.6.12", + "@firebase/analytics": "0.10.11", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 73355bab4c1..df22d343ec0 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.11 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/installations@0.6.12 + ## 0.10.10 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index b3873a15bd7..bed1ec9cc14 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.10", + "version": "0.10.11", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.11", + "@firebase/installations": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 2d2fe443bde..b0e2a63572f 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.18 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/app-check@0.8.11 + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.3.17 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 2716d3474fe..2f6ed16c384 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.17", + "version": "0.3.18", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.10", + "@firebase/app-check": "0.8.11", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 74caa4107ce..4534121a89f 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/app-check +## 0.8.11 + +### Patch Changes + +- [`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc) [#8600](https://github.com/firebase/firebase-js-sdk/pull/8600) (fixes [#6462](https://github.com/firebase/firebase-js-sdk/issues/6462)) - Generate UUIDs with `crypto.randomUUID()` instead of custom uuidv4 function that uses `Math.random()`. + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.8.10 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index fd98e1567ad..1e45d9c9f4a 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.8.10", + "version": "0.8.11", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 3f1b9d8fd19..da8e8495229 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.2.48 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/app@0.10.18 + - @firebase/component@0.6.12 + ## 0.2.47 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 4b6a7dda9ad..4f3765c4776 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.47", + "version": "0.2.48", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.17", - "@firebase/util": "1.10.2", + "@firebase/app": "0.10.18", + "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index f9b9989b2ad..8f9b1f24fff 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app +## 0.10.18 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.10.17 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 64bcde54dc6..b37581acfdf 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.10.17", + "version": "0.10.18", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 15061bd7afc..0e0af27931b 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.17 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/auth@1.8.2 + - @firebase/component@0.6.12 + ## 0.5.16 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index d5b4eee9e8c..0792ce03100 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.16", + "version": "0.5.17", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.8.1", + "@firebase/auth": "1.8.2", "@firebase/auth-types": "0.12.3", - "@firebase/component": "0.6.11", - "@firebase/util": "1.10.2", + "@firebase/component": "0.6.12", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 2bfbfebe27b..32fe097263f 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.8.2 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 1.8.1 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 3b2904a414f..8ec7985aae2 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.8.1", + "version": "1.8.2", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 4402cb3ab96..7e085ea5d4f 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + ## 0.6.11 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index 9653a3e8180..5fd762a794b 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.11", + "version": "0.6.12", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 12c16191ee8..a871298f86b 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,17 @@ ## Unreleased +## 0.2.0 + +### Minor Changes + +- [`c19a051ce`](https://github.com/firebase/firebase-js-sdk/commit/c19a051ce490398f49fbf9bdb7181a986b66fa14) [#8667](https://github.com/firebase/firebase-js-sdk/pull/8667) - Updated to include promise instead of promiselike + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.1.3 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index d7a8f31016e..e5abc9e9ef8 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.1.3", + "version": "0.2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 3509fa8068e..1b99a153c1d 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.2 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/database@1.0.11 + - @firebase/database-types@1.0.8 + ## 2.0.1 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index a997a64161d..cf4ad024941 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.1", + "version": "2.0.2", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.10", - "@firebase/database-types": "1.0.7", + "@firebase/database": "1.0.11", + "@firebase/database-types": "1.0.8", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 51b56696ef8..92aa4d66b44 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.8 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + ## 1.0.7 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 4e190921d84..1b56609eb04 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.7", + "version": "1.0.8", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.10.2" + "@firebase/util": "1.10.3" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 638e395a45c..dc5f274533f 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Unreleased +## 1.0.11 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 1.0.10 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index b45a2649da3..62eaf630e6d 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.10", + "version": "1.0.11", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 7edd041e36d..7e0722d604a 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,44 @@ # firebase +## 11.2.0 + +### Minor Changes + +- [`7bf2aec63`](https://github.com/firebase/firebase-js-sdk/commit/7bf2aec6328b06c9c7dda91354630c0d59f2b411) [#8602](https://github.com/firebase/firebase-js-sdk/pull/8602) - Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. + +- [`c19a051ce`](https://github.com/firebase/firebase-js-sdk/commit/c19a051ce490398f49fbf9bdb7181a986b66fa14) [#8667](https://github.com/firebase/firebase-js-sdk/pull/8667) - Updated to include promise instead of promiselike + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc), [`7bf2aec63`](https://github.com/firebase/firebase-js-sdk/commit/7bf2aec6328b06c9c7dda91354630c0d59f2b411), [`c19a051ce`](https://github.com/firebase/firebase-js-sdk/commit/c19a051ce490398f49fbf9bdb7181a986b66fa14)]: + - @firebase/app-check@0.8.11 + - @firebase/util@1.10.3 + - @firebase/remote-config@0.5.0 + - @firebase/data-connect@0.2.0 + - @firebase/app-check-compat@0.3.18 + - @firebase/analytics@0.10.11 + - @firebase/analytics-compat@0.2.17 + - @firebase/app@0.10.18 + - @firebase/app-compat@0.2.48 + - @firebase/auth@1.8.2 + - @firebase/auth-compat@0.5.17 + - @firebase/database@1.0.11 + - @firebase/database-compat@2.0.2 + - @firebase/firestore@4.7.6 + - @firebase/firestore-compat@0.3.41 + - @firebase/functions@0.12.1 + - @firebase/functions-compat@0.3.18 + - @firebase/installations@0.6.12 + - @firebase/installations-compat@0.2.12 + - @firebase/messaging@0.12.16 + - @firebase/messaging-compat@0.2.16 + - @firebase/performance@0.6.12 + - @firebase/performance-compat@0.2.12 + - @firebase/remote-config-compat@0.2.12 + - @firebase/storage@0.13.5 + - @firebase/storage-compat@0.3.15 + - @firebase/vertexai@1.0.3 + ## 11.1.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 5047db48085..ec23c2123f7 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.1.0", + "version": "11.2.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.10.17", - "@firebase/app-compat": "0.2.47", + "@firebase/app": "0.10.18", + "@firebase/app-compat": "0.2.48", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.8.1", - "@firebase/auth-compat": "0.5.16", - "@firebase/data-connect": "0.1.3", - "@firebase/database": "1.0.10", - "@firebase/database-compat": "2.0.1", - "@firebase/firestore": "4.7.5", - "@firebase/firestore-compat": "0.3.40", - "@firebase/functions": "0.12.0", - "@firebase/functions-compat": "0.3.17", - "@firebase/installations": "0.6.11", - "@firebase/installations-compat": "0.2.11", - "@firebase/messaging": "0.12.15", - "@firebase/messaging-compat": "0.2.15", - "@firebase/storage": "0.13.4", - "@firebase/storage-compat": "0.3.14", - "@firebase/performance": "0.6.11", - "@firebase/performance-compat": "0.2.11", - "@firebase/remote-config": "0.4.11", - "@firebase/remote-config-compat": "0.2.11", - "@firebase/analytics": "0.10.10", - "@firebase/analytics-compat": "0.2.16", - "@firebase/app-check": "0.8.10", - "@firebase/app-check-compat": "0.3.17", - "@firebase/util": "1.10.2", - "@firebase/vertexai": "1.0.2" + "@firebase/auth": "1.8.2", + "@firebase/auth-compat": "0.5.17", + "@firebase/data-connect": "0.2.0", + "@firebase/database": "1.0.11", + "@firebase/database-compat": "2.0.2", + "@firebase/firestore": "4.7.6", + "@firebase/firestore-compat": "0.3.41", + "@firebase/functions": "0.12.1", + "@firebase/functions-compat": "0.3.18", + "@firebase/installations": "0.6.12", + "@firebase/installations-compat": "0.2.12", + "@firebase/messaging": "0.12.16", + "@firebase/messaging-compat": "0.2.16", + "@firebase/storage": "0.13.5", + "@firebase/storage-compat": "0.3.15", + "@firebase/performance": "0.6.12", + "@firebase/performance-compat": "0.2.12", + "@firebase/remote-config": "0.5.0", + "@firebase/remote-config-compat": "0.2.12", + "@firebase/analytics": "0.10.11", + "@firebase/analytics-compat": "0.2.17", + "@firebase/app-check": "0.8.11", + "@firebase/app-check-compat": "0.3.18", + "@firebase/util": "1.10.3", + "@firebase/vertexai": "1.0.3" }, "devDependencies": { "rollup": "2.79.1", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 6031b99639c..e4c812b4595 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.41 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/firestore@4.7.6 + ## 0.3.40 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 07431070d4e..4216152fef5 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.40", + "version": "0.3.41", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.11", - "@firebase/firestore": "4.7.5", - "@firebase/util": "1.10.2", + "@firebase/component": "0.6.12", + "@firebase/firestore": "4.7.6", + "@firebase/util": "1.10.3", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "@types/eslint": "7.29.0", "rollup": "2.79.1", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 311c6cb4fa0..8f6d442b21f 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/firestore +## 4.7.6 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 4.7.5 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 7eae2da0203..19b64159bce 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.5", + "version": "4.7.6", "engines": { "node": ">=18.0.0" }, @@ -94,9 +94,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -106,9 +106,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.17", - "@firebase/app-compat": "0.2.47", - "@firebase/auth": "1.8.1", + "@firebase/app": "0.10.18", + "@firebase/app-compat": "0.2.48", + "@firebase/auth": "1.8.2", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index a2ffe7f3468..c9a4c2eb334 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.18 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/functions@0.12.1 + ## 0.3.17 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 85d5e7b0ede..141534dcaa7 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.17", + "version": "0.3.18", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.11", - "@firebase/functions": "0.12.0", + "@firebase/component": "0.6.12", + "@firebase/functions": "0.12.1", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index 3774565f48e..cb91aa6ba71 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.1 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.12.0 ### Minor Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 331c5e94724..d860ebde8dd 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.0", + "version": "0.12.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 199010a4349..402e6832fb3 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/installations@0.6.12 + ## 0.2.11 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 15630f28769..47b1f9ad998 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.11", + "version": "0.2.12", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.11", + "@firebase/installations": "0.6.12", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 1d469d05f8d..7db5ae52a74 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.6.11 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index df0ab284b85..a337b35ba87 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.11", + "version": "0.6.12", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index caabdcc525e..e2afb3a29b6 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.16 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/messaging@0.12.16 + ## 0.2.15 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 6e4c248d935..c62d79c4068 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.15", + "version": "0.2.16", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.15", - "@firebase/component": "0.6.11", - "@firebase/util": "1.10.2", + "@firebase/messaging": "0.12.16", + "@firebase/component": "0.6.12", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", + "@firebase/app-compat": "0.2.48", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", "ts-essentials": "9.3.0", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index d3e39df3b7c..04217d909a8 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.16 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/installations@0.6.12 + ## 0.12.15 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 51f0492cfe3..8851077bea4 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.15", + "version": "0.12.16", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.11", + "@firebase/installations": "0.6.12", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-json": "4.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 51d89527e47..5a5ef93b67c 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/performance@0.6.12 + ## 0.2.11 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 685e534c724..eaa45c99e4f 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.11", + "version": "0.2.12", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.6.11", + "@firebase/performance": "0.6.12", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.47" + "@firebase/app-compat": "0.2.48" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index d045a8d2cb3..88369b38592 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.6.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/installations@0.6.12 + ## 0.6.11 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 7011c4a50f6..c613ac66877 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.6.11", + "version": "0.6.12", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,14 +39,14 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.11", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/installations": "0.6.12", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 7109ff834e4..61136c94d7a 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/remote-config-compat +## 0.2.12 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc), [`7bf2aec63`](https://github.com/firebase/firebase-js-sdk/commit/7bf2aec6328b06c9c7dda91354630c0d59f2b411)]: + - @firebase/util@1.10.3 + - @firebase/remote-config-types@0.4.0 + - @firebase/remote-config@0.5.0 + - @firebase/component@0.6.12 + ## 0.2.11 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 369c4127e0f..a5c0a7e9432 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.11", + "version": "0.2.12", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.4.11", - "@firebase/remote-config-types": "0.3.3", - "@firebase/util": "1.10.2", + "@firebase/remote-config": "0.5.0", + "@firebase/remote-config-types": "0.4.0", + "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.47" + "@firebase/app-compat": "0.2.48" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config-types/CHANGELOG.md b/packages/remote-config-types/CHANGELOG.md index 8847841c372..d4b52e801e8 100644 --- a/packages/remote-config-types/CHANGELOG.md +++ b/packages/remote-config-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/remote-config-types +## 0.4.0 + +### Minor Changes + +- [`7bf2aec63`](https://github.com/firebase/firebase-js-sdk/commit/7bf2aec6328b06c9c7dda91354630c0d59f2b411) [#8602](https://github.com/firebase/firebase-js-sdk/pull/8602) - Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. + ## 0.3.3 ### Patch Changes diff --git a/packages/remote-config-types/package.json b/packages/remote-config-types/package.json index 2f5d32ec5bf..7de29a27043 100644 --- a/packages/remote-config-types/package.json +++ b/packages/remote-config-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-types", - "version": "0.3.3", + "version": "0.4.0", "description": "@firebase/remote-config Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 207ed85ae8d..a31b328e7f9 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/remote-config +## 0.5.0 + +### Minor Changes + +- [`7bf2aec63`](https://github.com/firebase/firebase-js-sdk/commit/7bf2aec6328b06c9c7dda91354630c0d59f2b411) [#8602](https://github.com/firebase/firebase-js-sdk/pull/8602) - Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/installations@0.6.12 + ## 0.4.11 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 75d856c7e11..6e92d347b23 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.4.11", + "version": "0.5.0", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.11", + "@firebase/installations": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 66b1b606ef6..329586c5def 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.15 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + - @firebase/storage@0.13.5 + ## 0.3.14 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 0465bb55d78..fe0f1c5ab7e 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.14", + "version": "0.3.15", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.4", + "@firebase/storage": "0.13.5", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.47", - "@firebase/auth-compat": "0.5.16", + "@firebase/app-compat": "0.2.48", + "@firebase/auth-compat": "0.5.17", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 3e3e7608457..9e4760a7d7c 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.5 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 0.13.4 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 4b71174ca0a..b1204cca8fe 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.4", + "version": "0.13.5", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.10.2", - "@firebase/component": "0.6.11", + "@firebase/util": "1.10.3", + "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.17", - "@firebase/auth": "1.8.1", + "@firebase/app": "0.10.18", + "@firebase/auth": "1.8.2", "rollup": "2.79.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 384d32cbc4a..c87d1070201 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 5c22a8c29d2..1468fcb96de 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.10.3 + +### Patch Changes + +- [`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc) [#8600](https://github.com/firebase/firebase-js-sdk/pull/8600) (fixes [#6462](https://github.com/firebase/firebase-js-sdk/issues/6462)) - Generate UUIDs with `crypto.randomUUID()` instead of custom uuidv4 function that uses `Math.random()`. + ## 1.10.2 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index e569790968f..54389451bea 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.10.2", + "version": "1.10.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index a3409024d5a..d2329a94ed2 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.0.3 + +### Patch Changes + +- Updated dependencies [[`25a6204c1`](https://github.com/firebase/firebase-js-sdk/commit/25a6204c1531b6c772e5368d12b2411ae1d21bbc)]: + - @firebase/util@1.10.3 + - @firebase/component@0.6.12 + ## 1.0.2 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 869bdfa3054..5acf318b6e4 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.0.2", + "version": "1.0.3", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.11", + "@firebase/component": "0.6.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.17", + "@firebase/app": "0.10.18", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index cf5cfdf985e..b7cb63bdfa5 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -35,14 +35,14 @@ "typescript": "5.5.4", "terser": "5.16.1", "yargs": "17.7.2", - "@firebase/util": "1.10.2", + "@firebase/util": "1.10.3", "gzip-size": "6.0.0", "glob": "7.2.3" }, "license": "Apache-2.0", "devDependencies": { "@firebase/logger": "0.4.4", - "@firebase/app": "0.10.17" + "@firebase/app": "0.10.18" }, "repository": { "directory": "repo-scripts/size-analysis", From 3aefcc3e19c7cf67da68859e67210e5ddb000583 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:55:53 -0800 Subject: [PATCH 073/295] chore(deps): replace dependency npm-run-all with npm-run-all2 5.0.0 (#8112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- integration/firebase/package.json | 2 +- package.json | 2 +- yarn.lock | 37 +++++++++++-------------------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/integration/firebase/package.json b/integration/firebase/package.json index 824218cc7fb..8194fd31ba9 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -19,7 +19,7 @@ "karma-spec-reporter": "0.0.36", "karma-typescript": "5.5.4", "mocha": "9.2.2", - "npm-run-all": "4.1.5", + "npm-run-all2": "5.0.0", "typescript": "5.5.4" }, "engines": { diff --git a/package.json b/package.json index 62fe45a3256..6e1eed6506b 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "mocha": "9.2.2", "mz": "2.7.0", "node-polyfill-webpack-plugin": "2.0.1", - "npm-run-all": "4.1.5", + "npm-run-all2": "5.0.0", "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", diff --git a/yarn.lock b/yarn.lock index bd59a038213..17fc5dca649 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4244,7 +4244,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.2.1: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -13163,20 +13163,18 @@ npm-registry-fetch@^9.0.0: minizlib "^2.0.0" npm-package-arg "^8.0.0" -npm-run-all@4.1.5: - version "4.1.5" - resolved "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz" - integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ== +npm-run-all2@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-5.0.0.tgz#a95a0451ab8e971c9239d17aca7a39d4bc6658ed" + integrity sha512-twczQhEpj55UROtg0Xz0nzn83TanS5Re12g5g1hcdnyAhlWOt9VNHdSHf2Z6MO3/wOVqy9tEdi0ruJt5NnMgmw== dependencies: - ansi-styles "^3.2.1" - chalk "^2.4.1" - cross-spawn "^6.0.5" + ansi-styles "^4.2.1" + cross-spawn "^7.0.3" memorystream "^0.3.1" minimatch "^3.0.4" - pidtree "^0.3.0" - read-pkg "^3.0.0" + pidtree "^0.5.0" + read-pkg "^5.2.0" shell-quote "^1.6.1" - string.prototype.padend "^3.0.0" npm-run-path@^4.0.1: version "4.0.1" @@ -14030,10 +14028,10 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== -pidtree@^0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz" - integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== +pidtree@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.5.0.tgz#ad5fbc1de78b8a5f99d6fbdd4f6e4eee21d1aca1" + integrity sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA== pify@^2.0.0, pify@^2.3.0: version "2.3.0" @@ -16345,15 +16343,6 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string.prototype.padend@^3.0.0: - version "3.1.2" - resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz" - integrity sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" From 97d48c7650e2d4273b7f94c8964dfcb44113952a Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Jan 2025 10:38:40 -0500 Subject: [PATCH 074/295] Add App Check token to FirebaseServerApp (#8651) FirebaseServerApp now accepts an optional App Check token at initialization. The product SDKs will look for this token, and if it's present, the SDKs will use this value in lieu of calling getToken on App Check. This change affects the following SDKs: Auth, Cloud Functions, Data Connect, Firestore, Realtime Database, Vertex AI --- .changeset/kind-pets-sin.md | 15 +++++ common/api-review/app.api.md | 3 +- docs-devsite/app.firebaseserverappsettings.md | 19 +++++- packages/app/src/firebaseServerApp.test.ts | 59 +++++++++++++++++++ packages/app/src/firebaseServerApp.ts | 39 ++++++++++++ packages/app/src/internal.test.ts | 27 ++++++++- packages/app/src/internal.ts | 5 +- packages/app/src/public-types.ts | 17 +++++- packages/auth/src/core/auth/auth_impl.ts | 3 + .../flows/firebaseserverapp.test.ts | 31 ---------- packages/data-connect/src/api/DataConnect.ts | 2 +- .../src/core/AppCheckTokenProvider.ts | 17 ++++-- packages/database/src/api/Database.ts | 2 +- .../src/core/AppCheckTokenProvider.ts | 19 +++++- packages/firestore/lite/register.ts | 1 + packages/firestore/src/api/credentials.ts | 21 ++++++- packages/firestore/src/register.ts | 1 + packages/functions/src/context.ts | 11 +++- packages/functions/src/service.ts | 1 + packages/storage/src/service.ts | 9 ++- .../vertexai/src/models/generative-model.ts | 12 +++- 21 files changed, 262 insertions(+), 52 deletions(-) create mode 100644 .changeset/kind-pets-sin.md diff --git a/.changeset/kind-pets-sin.md b/.changeset/kind-pets-sin.md new file mode 100644 index 00000000000..7debbf4b220 --- /dev/null +++ b/.changeset/kind-pets-sin.md @@ -0,0 +1,15 @@ +--- +'@firebase/app': minor +'firebase': minor +'@firebase/data-connect': patch +'@firebase/firestore': patch +'@firebase/functions': patch +'@firebase/database': patch +'@firebase/vertexai': patch +'@firebase/storage': patch +'@firebase/auth': patch +--- + +`FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check +`getToken` method. This should unblock the use of App Check enforced products in SSR environments +where the App Check SDK cannot be initialized. diff --git a/common/api-review/app.api.md b/common/api-review/app.api.md index bdfb2a681f1..4e93f1ae87f 100644 --- a/common/api-review/app.api.md +++ b/common/api-review/app.api.md @@ -79,6 +79,7 @@ export interface FirebaseServerApp extends FirebaseApp { // @public export interface FirebaseServerAppSettings extends Omit { + appCheckToken?: string; authIdToken?: string; releaseOnDeref?: object; } @@ -115,7 +116,7 @@ export function initializeServerApp(options: FirebaseOptions | FirebaseApp, conf export function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions): obj is FirebaseApp; // @internal (undocumented) -export function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp): obj is FirebaseServerApp; +export function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp; // @public export function onLog(logCallback: LogCallback | null, options?: LogOptions): void; diff --git a/docs-devsite/app.firebaseserverappsettings.md b/docs-devsite/app.firebaseserverappsettings.md index bc46c5292d0..79d4fbe022a 100644 --- a/docs-devsite/app.firebaseserverappsettings.md +++ b/docs-devsite/app.firebaseserverappsettings.md @@ -23,16 +23,31 @@ export interface FirebaseServerAppSettings extends OmitInvoking getAuth with a FirebaseServerApp configured with a validated authIdToken causes an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed.If the token fails local verification, or if the Auth service has failed to validate it when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user on initialization.If a user is successfully signed in, then the Auth instance's onAuthStateChanged callback is invoked with the User object as per standard Auth flows. However, User objects created via an authIdToken do not have a refresh token. Attempted refreshToken operations fail. | +| [appCheckToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsappchecktoken) | string | An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize this App Check token in place of requiring an instance of App Check to be initialized.If the token fails local verification due to expiration or parsing errors, then a console error is logged at the time of initialization of the FirebaseServerApp instance. | +| [authIdToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsauthidtoken) | string | An optional Auth ID token used to resume a signed in user session from a client runtime environment.Invoking getAuth with a FirebaseServerApp configured with a validated authIdToken causes an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed.If the token fails local verification due to expiration or parsing errors, then a console error is logged at the time of initialization of the FirebaseServerApp instance.If the Auth service has failed to validate the token when the Auth SDK is initialized, then an warning is logged to the console and the Auth SDK will not sign in a user on initialization.If a user is successfully signed in, then the Auth instance's onAuthStateChanged callback is invoked with the User object as per standard Auth flows. However, User objects created via an authIdToken do not have a refresh token. Attempted refreshToken operations fail. | | [releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) | object | An optional object. If provided, the Firebase SDK uses a FinalizationRegistry object to monitor the garbage collection status of the provided object. The Firebase SDK releases its reference on the FirebaseServerApp instance when the provided releaseOnDeref object is garbage collected.You can use this field to reduce memory management overhead for your application. If provided, an app running in a SSR pass does not need to perform FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of SSR scope, for instance.)If an object is not provided then the application must clean up the FirebaseServerApp instance by invoking deleteApp.If the application provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then an error is thrown at FirebaseServerApp initialization. | +## FirebaseServerAppSettings.appCheckToken + +An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize this App Check token in place of requiring an instance of App Check to be initialized. + +If the token fails local verification due to expiration or parsing errors, then a console error is logged at the time of initialization of the `FirebaseServerApp` instance. + +Signature: + +```typescript +appCheckToken?: string; +``` + ## FirebaseServerAppSettings.authIdToken An optional Auth ID token used to resume a signed in user session from a client runtime environment. Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken` causes an automatic attempt to sign in the user that the `authIdToken` represents. The token needs to have been recently minted for this operation to succeed. -If the token fails local verification, or if the Auth service has failed to validate it when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user on initialization. +If the token fails local verification due to expiration or parsing errors, then a console error is logged at the time of initialization of the `FirebaseServerApp` instance. + +If the Auth service has failed to validate the token when the Auth SDK is initialized, then an warning is logged to the console and the Auth SDK will not sign in a user on initialization. If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback is invoked with the `User` object as per standard Auth flows. However, `User` objects created via an `authIdToken` do not have a refresh token. Attempted `refreshToken` operations fail. diff --git a/packages/app/src/firebaseServerApp.test.ts b/packages/app/src/firebaseServerApp.test.ts index bf2da5c06d5..de00687948e 100644 --- a/packages/app/src/firebaseServerApp.test.ts +++ b/packages/app/src/firebaseServerApp.test.ts @@ -20,6 +20,21 @@ import '../test/setup'; import { ComponentContainer } from '@firebase/component'; import { FirebaseServerAppImpl } from './firebaseServerApp'; import { FirebaseServerAppSettings } from './public-types'; +import { base64Encode } from '@firebase/util'; + +const BASE64_DUMMY = base64Encode('dummystrings'); // encodes to ZHVtbXlzdHJpbmdz + +// Creates a three part dummy token with an expiration claim in the second part. The expration +// time is based on the date offset provided. +function createServerAppTokenWithOffset(daysOffset: number): string { + const timeInSeconds = Math.trunc( + new Date().setDate(new Date().getDate() + daysOffset) / 1000 + ); + const secondPart = JSON.stringify({ exp: timeInSeconds }); + const token = + BASE64_DUMMY + '.' + base64Encode(secondPart) + '.' + BASE64_DUMMY; + return token; +} describe('FirebaseServerApp', () => { it('has various accessors', () => { @@ -155,4 +170,48 @@ describe('FirebaseServerApp', () => { expect(JSON.stringify(app)).to.eql(undefined); }); + + it('accepts a valid authIdToken expiration', () => { + const options = { apiKey: 'APIKEY' }; + const authIdToken = createServerAppTokenWithOffset(/*daysOffset=*/ 1); + const serverAppSettings: FirebaseServerAppSettings = { + automaticDataCollectionEnabled: false, + releaseOnDeref: options, + authIdToken + }; + let encounteredError = false; + try { + new FirebaseServerAppImpl( + options, + serverAppSettings, + 'testName', + new ComponentContainer('test') + ); + } catch (e) { + encounteredError = true; + } + expect(encounteredError).to.be.false; + }); + + it('accepts a valid appCheckToken expiration', () => { + const options = { apiKey: 'APIKEY' }; + const appCheckToken = createServerAppTokenWithOffset(/*daysOffset=*/ 1); + const serverAppSettings: FirebaseServerAppSettings = { + automaticDataCollectionEnabled: false, + releaseOnDeref: options, + appCheckToken + }; + let encounteredError = false; + try { + new FirebaseServerAppImpl( + options, + serverAppSettings, + 'testName', + new ComponentContainer('test') + ); + } catch (e) { + encounteredError = true; + } + expect(encounteredError).to.be.false; + }); }); diff --git a/packages/app/src/firebaseServerApp.ts b/packages/app/src/firebaseServerApp.ts index 0c41d4cd607..21232869c3c 100644 --- a/packages/app/src/firebaseServerApp.ts +++ b/packages/app/src/firebaseServerApp.ts @@ -26,6 +26,35 @@ import { ComponentContainer } from '@firebase/component'; import { FirebaseAppImpl } from './firebaseApp'; import { ERROR_FACTORY, AppError } from './errors'; import { name as packageName, version } from '../package.json'; +import { base64Decode } from '@firebase/util'; + +// Parse the token and check to see if the `exp` claim is in the future. +// Reports an error to the console if the token or claim could not be parsed, or if `exp` is in +// the past. +function validateTokenTTL(base64Token: string, tokenName: string): void { + const secondPart = base64Decode(base64Token.split('.')[1]); + if (secondPart === null) { + console.error( + `FirebaseServerApp ${tokenName} is invalid: second part could not be parsed.` + ); + return; + } + const expClaim = JSON.parse(secondPart).exp; + if (expClaim === undefined) { + console.error( + `FirebaseServerApp ${tokenName} is invalid: expiration claim could not be parsed` + ); + return; + } + const exp = JSON.parse(secondPart).exp * 1000; + const now = new Date().getTime(); + const diff = exp - now; + if (diff <= 0) { + console.error( + `FirebaseServerApp ${tokenName} is invalid: the token has expired.` + ); + } +} export class FirebaseServerAppImpl extends FirebaseAppImpl @@ -67,6 +96,16 @@ export class FirebaseServerAppImpl ...serverConfig }; + // Ensure that the current time is within the `authIdtoken` window of validity. + if (this._serverConfig.authIdToken) { + validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken'); + } + + // Ensure that the current time is within the `appCheckToken` window of validity. + if (this._serverConfig.appCheckToken) { + validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken'); + } + this._finalizationRegistry = null; if (typeof FinalizationRegistry !== 'undefined') { this._finalizationRegistry = new FinalizationRegistry(() => { diff --git a/packages/app/src/internal.test.ts b/packages/app/src/internal.test.ts index 47ea2e80c40..78baf400b8c 100644 --- a/packages/app/src/internal.test.ts +++ b/packages/app/src/internal.test.ts @@ -19,7 +19,7 @@ import { expect } from 'chai'; import { stub } from 'sinon'; import '../test/setup'; import { createTestComponent, TestService } from '../test/util'; -import { initializeApp, getApps, deleteApp } from './api'; +import { initializeApp, initializeServerApp, getApps, deleteApp } from './api'; import { FirebaseAppImpl } from './firebaseApp'; import { _addComponent, @@ -28,9 +28,11 @@ import { _components, _clearComponents, _getProvider, - _removeServiceInstance + _removeServiceInstance, + _isFirebaseServerApp } from './internal'; import { logger } from './logger'; +import { isBrowser } from '@firebase/util'; declare module '@firebase/component' { interface NameServiceMapping { @@ -161,4 +163,25 @@ describe('Internal API tests', () => { expect(instance1).to.not.equal(instance2); }); }); + + describe('_isFirebaseServerApp', () => { + it('detects a valid FirebaseServerApp', () => { + if (!isBrowser()) { + // FirebaseServerApp isn't supported for execution in browser environments. + const app = initializeServerApp({}, {}); + expect(_isFirebaseServerApp(app)).to.be.true; + } + }); + it('a standard FirebaseApp returns false', () => { + const app = initializeApp({}); + expect(_isFirebaseServerApp(app)).to.be.false; + }); + it('a null object returns false', () => { + expect(_isFirebaseServerApp(null)).to.be.false; + }); + it('undefined returns false', () => { + let app: undefined; + expect(_isFirebaseServerApp(app)).to.be.false; + }); + }); }); diff --git a/packages/app/src/internal.ts b/packages/app/src/internal.ts index 7e0c1545962..cbcdcb26501 100644 --- a/packages/app/src/internal.ts +++ b/packages/app/src/internal.ts @@ -168,8 +168,11 @@ export function _isFirebaseApp( * @internal */ export function _isFirebaseServerApp( - obj: FirebaseApp | FirebaseServerApp + obj: FirebaseApp | FirebaseServerApp | null | undefined ): obj is FirebaseServerApp { + if (obj === null || obj === undefined) { + return false; + } return (obj as FirebaseServerApp).settings !== undefined; } diff --git a/packages/app/src/public-types.ts b/packages/app/src/public-types.ts index ff25de93a46..ea68579a7e9 100644 --- a/packages/app/src/public-types.ts +++ b/packages/app/src/public-types.ts @@ -185,9 +185,11 @@ export interface FirebaseServerAppSettings * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token * needs to have been recently minted for this operation to succeed. * - * If the token fails local verification, or if the Auth service has failed to validate it when - * the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not - * sign in a user on initialization. + * If the token fails local verification due to expiration or parsing errors, then a console error + * is logged at the time of initialization of the `FirebaseServerApp` instance. + * + * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an + * warning is logged to the console and the Auth SDK will not sign in a user on initialization. * * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback * is invoked with the `User` object as per standard Auth flows. However, `User` objects @@ -196,6 +198,15 @@ export interface FirebaseServerAppSettings */ authIdToken?: string; + /** + * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize + * this App Check token in place of requiring an instance of App Check to be initialized. + * + * If the token fails local verification due to expiration or parsing errors, then a console error + * is logged at the time of initialization of the `FirebaseServerApp` instance. + */ + appCheckToken?: string; + /** * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry` * object to monitor the garbage collection status of the provided object. The diff --git a/packages/auth/src/core/auth/auth_impl.ts b/packages/auth/src/core/auth/auth_impl.ts index fd6f1a82a76..45a2c99ea0b 100644 --- a/packages/auth/src/core/auth/auth_impl.ts +++ b/packages/auth/src/core/auth/auth_impl.ts @@ -845,6 +845,9 @@ export class AuthImpl implements AuthInternal, _FirebaseService { } async _getAppCheckToken(): Promise { + if (_isFirebaseServerApp(this.app) && this.app.settings.appCheckToken) { + return this.app.settings.appCheckToken; + } const appCheckTokenResult = await this.appCheckServiceProvider .getImmediate({ optional: true }) ?.getToken(); diff --git a/packages/auth/test/integration/flows/firebaseserverapp.test.ts b/packages/auth/test/integration/flows/firebaseserverapp.test.ts index fc61bf561bf..71c64b8554a 100644 --- a/packages/auth/test/integration/flows/firebaseserverapp.test.ts +++ b/packages/auth/test/integration/flows/firebaseserverapp.test.ts @@ -166,37 +166,6 @@ describe('Integration test: Auth FirebaseServerApp tests', () => { await deleteApp(serverApp); }); - it('invalid token does not sign in user', async () => { - if (isBrowser()) { - return; - } - const authIdToken = '{ invalid token }'; - const firebaseServerAppSettings = { authIdToken }; - - const serverApp = initializeServerApp( - getAppConfig(), - firebaseServerAppSettings - ); - const serverAppAuth = getTestInstanceForServerApp(serverApp); - expect(serverAppAuth.currentUser).to.be.null; - - let numberServerLogins = 0; - onAuthStateChanged(serverAppAuth, serverAuthUser => { - if (serverAuthUser) { - numberServerLogins++; - } - }); - - await new Promise(resolve => { - setTimeout(resolve, signInWaitDuration); - }); - - expect(numberServerLogins).to.equal(0); - expect(serverAppAuth.currentUser).to.be.null; - - await deleteApp(serverApp); - }); - it('signs in with email credentials user', async () => { if (isBrowser()) { return; diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index 30ec344f3ef..53eb0c97ed5 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -151,7 +151,7 @@ export class DataConnect { } if (this._appCheckProvider) { this._appCheckTokenProvider = new AppCheckTokenProvider( - this.app.name, + this.app, this._appCheckProvider ); } diff --git a/packages/data-connect/src/core/AppCheckTokenProvider.ts b/packages/data-connect/src/core/AppCheckTokenProvider.ts index d9cdaeb6f39..4b49a8f674a 100644 --- a/packages/data-connect/src/core/AppCheckTokenProvider.ts +++ b/packages/data-connect/src/core/AppCheckTokenProvider.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { FirebaseApp, _isFirebaseServerApp } from '@firebase/app'; import { AppCheckInternalComponentName, AppCheckTokenListener, @@ -29,10 +30,14 @@ import { Provider } from '@firebase/component'; */ export class AppCheckTokenProvider { private appCheck?: FirebaseAppCheckInternal; + private serverAppAppCheckToken?: string; constructor( - private appName_: string, + app: FirebaseApp, private appCheckProvider?: Provider ) { + if (_isFirebaseServerApp(app) && app.settings.appCheckToken) { + this.serverAppAppCheckToken = app.settings.appCheckToken; + } this.appCheck = appCheckProvider?.getImmediate({ optional: true }); if (!this.appCheck) { void appCheckProvider @@ -42,7 +47,11 @@ export class AppCheckTokenProvider { } } - getToken(forceRefresh?: boolean): Promise { + getToken(): Promise { + if (this.serverAppAppCheckToken) { + return Promise.resolve({ token: this.serverAppAppCheckToken }); + } + if (!this.appCheck) { return new Promise((resolve, reject) => { // Support delayed initialization of FirebaseAppCheck. This allows our @@ -51,14 +60,14 @@ export class AppCheckTokenProvider { // becomes available before the timoeout below expires. setTimeout(() => { if (this.appCheck) { - this.getToken(forceRefresh).then(resolve, reject); + this.getToken().then(resolve, reject); } else { resolve(null); } }, 0); }); } - return this.appCheck.getToken(forceRefresh); + return this.appCheck.getToken(); } addTokenChangeListener(listener: AppCheckTokenListener): void { diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 3182365dda0..72ae85c08a1 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -164,7 +164,7 @@ export function repoManagerDatabaseFromApp( repoInfo, app, authTokenProvider, - new AppCheckTokenProvider(app.name, appCheckProvider) + new AppCheckTokenProvider(app, appCheckProvider) ); return new Database(repo, app); } diff --git a/packages/database/src/core/AppCheckTokenProvider.ts b/packages/database/src/core/AppCheckTokenProvider.ts index 2bdd8fdadac..612cb902e5f 100644 --- a/packages/database/src/core/AppCheckTokenProvider.ts +++ b/packages/database/src/core/AppCheckTokenProvider.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { FirebaseApp, _isFirebaseServerApp } from '@firebase/app'; // eslint-disable-line import/no-extraneous-dependencies import { AppCheckInternalComponentName, AppCheckTokenListener, @@ -30,10 +31,16 @@ import { warn } from './util/util'; */ export class AppCheckTokenProvider { private appCheck?: FirebaseAppCheckInternal; + private serverAppAppCheckToken?: string; + private appName: string; constructor( - private appName_: string, + app: FirebaseApp, private appCheckProvider?: Provider ) { + this.appName = app.name; + if (_isFirebaseServerApp(app) && app.settings.appCheckToken) { + this.serverAppAppCheckToken = app.settings.appCheckToken; + } this.appCheck = appCheckProvider?.getImmediate({ optional: true }); if (!this.appCheck) { appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck)); @@ -41,6 +48,14 @@ export class AppCheckTokenProvider { } getToken(forceRefresh?: boolean): Promise { + if (this.serverAppAppCheckToken) { + if (forceRefresh) { + throw new Error( + 'Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.' + ); + } + return Promise.resolve({ token: this.serverAppAppCheckToken }); + } if (!this.appCheck) { return new Promise((resolve, reject) => { // Support delayed initialization of FirebaseAppCheck. This allows our @@ -67,7 +82,7 @@ export class AppCheckTokenProvider { notifyForInvalidToken(): void { warn( - `Provided AppCheck credentials for the app named "${this.appName_}" ` + + `Provided AppCheck credentials for the app named "${this.appName}" ` + 'are invalid. This usually indicates your app was not initialized correctly.' ); } diff --git a/packages/firestore/lite/register.ts b/packages/firestore/lite/register.ts index 9bd7b014fa2..300f9d5ec94 100644 --- a/packages/firestore/lite/register.ts +++ b/packages/firestore/lite/register.ts @@ -49,6 +49,7 @@ export function registerFirestore(): void { container.getProvider('auth-internal') ), new LiteAppCheckTokenProvider( + app, container.getProvider('app-check-internal') ), databaseIdFromApp(app, databaseId), diff --git a/packages/firestore/src/api/credentials.ts b/packages/firestore/src/api/credentials.ts index 5da9a32209b..b542ec80b91 100644 --- a/packages/firestore/src/api/credentials.ts +++ b/packages/firestore/src/api/credentials.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { FirebaseApp, _isFirebaseServerApp } from '@firebase/app'; import { AppCheckInternalComponentName, AppCheckTokenListener, @@ -495,10 +496,16 @@ export class FirebaseAppCheckTokenProvider private forceRefresh = false; private appCheck: FirebaseAppCheckInternal | null = null; private latestAppCheckToken: string | null = null; + private serverAppAppCheckToken: string | null = null; constructor( + app: FirebaseApp, private appCheckProvider: Provider - ) {} + ) { + if (_isFirebaseServerApp(app) && app.settings.appCheckToken) { + this.serverAppAppCheckToken = app.settings.appCheckToken; + } + } start( asyncQueue: AsyncQueue, @@ -562,6 +569,9 @@ export class FirebaseAppCheckTokenProvider } getToken(): Promise { + if (this.serverAppAppCheckToken) { + return Promise.resolve(new AppCheckToken(this.serverAppAppCheckToken)); + } debugAssert( this.tokenListener != null, 'FirebaseAppCheckTokenProvider not started.' @@ -622,16 +632,25 @@ export class EmptyAppCheckTokenProvider implements CredentialsProvider { /** AppCheck token provider for the Lite SDK. */ export class LiteAppCheckTokenProvider implements CredentialsProvider { private appCheck: FirebaseAppCheckInternal | null = null; + private serverAppAppCheckToken: string | null = null; constructor( + app: FirebaseApp, private appCheckProvider: Provider ) { + if (_isFirebaseServerApp(app) && app.settings.appCheckToken) { + this.serverAppAppCheckToken = app.settings.appCheckToken; + } appCheckProvider.onInit(appCheck => { this.appCheck = appCheck; }); } getToken(): Promise { + if (this.serverAppAppCheckToken) { + return Promise.resolve(new AppCheckToken(this.serverAppAppCheckToken)); + } + if (!this.appCheck) { return Promise.resolve(null); } diff --git a/packages/firestore/src/register.ts b/packages/firestore/src/register.ts index 573ac6f2020..82b450b3834 100644 --- a/packages/firestore/src/register.ts +++ b/packages/firestore/src/register.ts @@ -47,6 +47,7 @@ export function registerFirestore( container.getProvider('auth-internal') ), new FirebaseAppCheckTokenProvider( + app, container.getProvider('app-check-internal') ), databaseIdFromApp(app, databaseId), diff --git a/packages/functions/src/context.ts b/packages/functions/src/context.ts index 0013e2c54f6..4ac4bbe2cb9 100644 --- a/packages/functions/src/context.ts +++ b/packages/functions/src/context.ts @@ -16,6 +16,7 @@ */ import { Provider } from '@firebase/component'; +import { _isFirebaseServerApp, FirebaseApp } from '@firebase/app'; import { AppCheckInternalComponentName, FirebaseAppCheckInternal @@ -47,11 +48,16 @@ export class ContextProvider { private auth: FirebaseAuthInternal | null = null; private messaging: MessagingInternal | null = null; private appCheck: FirebaseAppCheckInternal | null = null; + private serverAppAppCheckToken: string | null = null; constructor( + readonly app: FirebaseApp, authProvider: Provider, messagingProvider: Provider, appCheckProvider: Provider ) { + if (_isFirebaseServerApp(app) && app.settings.appCheckToken) { + this.serverAppAppCheckToken = app.settings.appCheckToken; + } this.auth = authProvider.getImmediate({ optional: true }); this.messaging = messagingProvider.getImmediate({ optional: true @@ -76,7 +82,7 @@ export class ContextProvider { } if (!this.appCheck) { - appCheckProvider.get().then( + appCheckProvider?.get().then( appCheck => (this.appCheck = appCheck), () => { /* get() never rejects */ @@ -122,6 +128,9 @@ export class ContextProvider { async getAppCheckToken( limitedUseAppCheckTokens?: boolean ): Promise { + if (this.serverAppAppCheckToken) { + return this.serverAppAppCheckToken; + } if (this.appCheck) { const result = limitedUseAppCheckTokens ? await this.appCheck.getLimitedUseToken() diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index ec459472b5a..34cb732bf71 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -112,6 +112,7 @@ export class FunctionsService implements _FirebaseService { readonly fetchImpl: typeof fetch = (...args) => fetch(...args) ) { this.contextProvider = new ContextProvider( + app, authProvider, messagingProvider, appCheckProvider diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 6777cb7b659..422e3e1a188 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -24,7 +24,11 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; // eslint-disable-next-line import/no-extraneous-dependencies -import { FirebaseApp, FirebaseOptions } from '@firebase/app'; +import { + FirebaseApp, + FirebaseOptions, + _isFirebaseServerApp +} from '@firebase/app'; import { CONFIG_STORAGE_BUCKET_KEY, DEFAULT_HOST, @@ -262,6 +266,9 @@ export class FirebaseStorageImpl implements FirebaseStorage { } async _getAppCheckToken(): Promise { + if (_isFirebaseServerApp(this.app) && this.app.settings.appCheckToken) { + return this.app.settings.appCheckToken; + } const appCheck = this._appCheckProvider.getImmediate({ optional: true }); if (appCheck) { const result = await appCheck.getToken(); diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index e719529967c..b44dc1131a3 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -46,6 +46,7 @@ import { import { VertexAI } from '../public-types'; import { ApiSettings } from '../types/internal'; import { VertexAIService } from '../service'; +import { _isFirebaseServerApp } from '@firebase/app'; /** * Class for generative model APIs. @@ -82,7 +83,16 @@ export class GenerativeModel { project: vertexAI.app.options.projectId, location: vertexAI.location }; - if ((vertexAI as VertexAIService).appCheck) { + + if ( + _isFirebaseServerApp(vertexAI.app) && + vertexAI.app.settings.appCheckToken + ) { + const token = vertexAI.app.settings.appCheckToken; + this._apiSettings.getAppCheckToken = () => { + return Promise.resolve({ token }); + }; + } else if ((vertexAI as VertexAIService).appCheck) { this._apiSettings.getAppCheckToken = () => (vertexAI as VertexAIService).appCheck!.getToken(); } From 2af68a5f730d0c079a547edf10f6afd0c26f426f Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 21 Jan 2025 11:41:05 -0800 Subject: [PATCH 075/295] Update rollup-plugin-terser dep (#8709) --- packages/auth/demo/package.json | 2 +- packages/firebase/compat/rollup.config.js | 2 +- packages/firebase/package.json | 2 +- packages/firebase/rollup.config.js | 2 +- packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 2 +- packages/firestore/rollup.config.js | 2 +- packages/firestore/rollup.config.lite.js | 2 +- packages/firestore/rollup.shared.js | 2 +- yarn.lock | 68 ++++++++++++++--------- 10 files changed, 52 insertions(+), 34 deletions(-) diff --git a/packages/auth/demo/package.json b/packages/auth/demo/package.json index 15ea2f48463..86418bcab07 100644 --- a/packages/auth/demo/package.json +++ b/packages/auth/demo/package.json @@ -29,7 +29,7 @@ "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-terser": "7.0.2", + "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", "@rollup/plugin-node-resolve": "13.3.0", diff --git a/packages/firebase/compat/rollup.config.js b/packages/firebase/compat/rollup.config.js index 1f850011b13..446df35e61d 100644 --- a/packages/firebase/compat/rollup.config.js +++ b/packages/firebase/compat/rollup.config.js @@ -22,7 +22,7 @@ import sourcemaps from 'rollup-plugin-sourcemaps'; import rollupTypescriptPlugin from 'rollup-plugin-typescript2'; import typescript from 'typescript'; import { uglify } from 'rollup-plugin-uglify'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import json from '@rollup/plugin-json'; import pkg from '../package.json'; import compatPkg from './package.json'; diff --git a/packages/firebase/package.json b/packages/firebase/package.json index ec23c2123f7..380f3048fb6 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -433,7 +433,7 @@ "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-terser": "7.0.2", + "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", "gulp": "4.0.2", diff --git a/packages/firebase/rollup.config.js b/packages/firebase/rollup.config.js index fda0dc0ebb0..f96ff01666c 100644 --- a/packages/firebase/rollup.config.js +++ b/packages/firebase/rollup.config.js @@ -23,7 +23,7 @@ import { resolve } from 'path'; import resolveModule from '@rollup/plugin-node-resolve'; import rollupTypescriptPlugin from 'rollup-plugin-typescript2'; import sourcemaps from 'rollup-plugin-sourcemaps'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import typescript from 'typescript'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 4216152fef5..dd8dfc75daa 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -57,7 +57,7 @@ "@types/eslint": "7.29.0", "rollup": "2.79.1", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-terser": "7.0.2", + "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-node-resolve": "13.3.0", "ts-node": "10.9.2", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 19b64159bce..d0b5a7a2e57 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -121,7 +121,7 @@ "rollup-plugin-copy-assets": "2.0.3", "rollup-plugin-replace": "2.2.0", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-terser": "7.0.2", + "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-dts": "5.3.1", "ts-node": "10.9.2", diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index c9604fee55d..8d93aab992e 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -19,7 +19,7 @@ import { version as grpcVersion } from '@grpc/grpc-js/package.json'; import alias from '@rollup/plugin-alias'; import json from '@rollup/plugin-json'; import replace from 'rollup-plugin-replace'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import dts from 'rollup-plugin-dts'; import typescriptPlugin from 'rollup-plugin-typescript2'; import tmp from 'tmp'; diff --git a/packages/firestore/rollup.config.lite.js b/packages/firestore/rollup.config.lite.js index 25209966fe8..9ff4d57a8d8 100644 --- a/packages/firestore/rollup.config.lite.js +++ b/packages/firestore/rollup.config.lite.js @@ -23,7 +23,7 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import typescript from 'typescript'; import sourcemaps from 'rollup-plugin-sourcemaps'; import replace from 'rollup-plugin-replace'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import pkg from './lite/package.json'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index 1b33ddf0b1b..aa90fc51edb 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -20,7 +20,7 @@ const json = require('@rollup/plugin-json'); const alias = require('@rollup/plugin-alias'); const typescriptPlugin = require('rollup-plugin-typescript2'); const typescript = require('typescript'); -const { terser } = require('rollup-plugin-terser'); +const { terser } = require('@rollup/plugin-terser'); const path = require('path'); const sourcemaps = require('rollup-plugin-sourcemaps'); diff --git a/yarn.lock b/yarn.lock index 17fc5dca649..910f54284fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20,7 +20,7 @@ call-me-maybe "^1.0.1" js-yaml "^4.1.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz" integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== @@ -1889,6 +1889,14 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.11" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz" @@ -2993,6 +3001,15 @@ estree-walker "^2.0.1" magic-string "^0.25.7" +"@rollup/plugin-terser@0.4.4": + version "0.4.4" + resolved "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz#15dffdb3f73f121aa4fbb37e7ca6be9aeea91962" + integrity sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A== + dependencies: + serialize-javascript "^6.0.1" + smob "^1.0.0" + terser "^5.17.4" + "@rollup/plugin-virtual@2.1.0": version "2.1.0" resolved "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.1.0.tgz" @@ -4060,6 +4077,11 @@ acorn@^8.7.1: resolved "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz" integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== +acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + acorn@^8.9.0: version "8.12.1" resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" @@ -10982,15 +11004,6 @@ jest-worker@^24.0.0: merge-stream "^2.0.0" supports-color "^6.1.0" -jest-worker@^26.2.1: - version "26.6.2" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - jest-worker@^27.0.6, jest-worker@^27.2.0: version "27.2.0" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz" @@ -15292,16 +15305,6 @@ rollup-plugin-sourcemaps@0.6.3: "@rollup/pluginutils" "^3.0.9" source-map-resolve "^0.6.0" -rollup-plugin-terser@7.0.2: - version "7.0.2" - resolved "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz" - integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== - dependencies: - "@babel/code-frame" "^7.10.4" - jest-worker "^26.2.1" - serialize-javascript "^4.0.0" - terser "^5.0.0" - rollup-plugin-typescript2@0.31.2: version "0.31.2" resolved "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.31.2.tgz" @@ -15629,10 +15632,10 @@ serialize-javascript@^2.1.2: resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -15855,6 +15858,11 @@ smartwrap@^2.0.2: wcwidth "^1.0.1" yargs "^15.1.0" +smob@^1.0.0: + version "1.5.0" + resolved "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz#85d79a1403abf128d24d3ebc1cdc5e1a9548d3ab" + integrity sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig== + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" @@ -16698,7 +16706,17 @@ terser@5.16.1: commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.0.0, terser@^5.7.2: +terser@^5.17.4: + version "5.37.0" + resolved "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" + integrity sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + +terser@^5.7.2: version "5.9.0" resolved "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz" integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== From 3c1559b7e313b04a13463a651648756db476eda5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:56:06 -0800 Subject: [PATCH 076/295] chore(deps): update actions/github-script action to v7 (#8711) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/check-vertexai-responses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 418ada2fc34..d2d356890d0 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -52,7 +52,7 @@ jobs: should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - name: Delete comment when version gets updated if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | github.rest.issues.deleteComment({ From 2ec1c768271b8432ef15fc4ba46e825ee15f3ee1 Mon Sep 17 00:00:00 2001 From: Bryan Atkinson Date: Wed, 22 Jan 2025 10:30:56 -0500 Subject: [PATCH 077/295] Fireperf web vitals (#8644) * Add support for capturing web vitals metrics in Firebase performance for Web (Largest Contentful Paint, Interaction to Next Paint, Cumulative Layout Shift) * Modifies export to use sendBeacon instead of fetch API, and shifts the upload time to the first time the page is hidden or unloaded. --- .changeset/kind-dingos-work.md | 6 + packages/performance/package.json | 11 +- packages/performance/src/constants.ts | 9 + packages/performance/src/resources/trace.ts | 48 +++- .../performance/src/resources/web_vitals.ts | 27 +++ .../performance/src/services/api_service.ts | 14 ++ .../services/oob_resources_service.test.ts | 225 ++++++++++++++++-- .../src/services/oob_resources_service.ts | 128 +++++++--- .../src/services/perf_logger.test.ts | 12 +- .../performance/src/services/perf_logger.ts | 39 +-- .../src/services/transport_service.test.ts | 101 +++----- .../src/services/transport_service.ts | 94 +++----- .../performance/src/utils/metric_utils.ts | 10 +- yarn.lock | 5 + 14 files changed, 522 insertions(+), 207 deletions(-) create mode 100644 .changeset/kind-dingos-work.md create mode 100644 packages/performance/src/resources/web_vitals.ts diff --git a/.changeset/kind-dingos-work.md b/.changeset/kind-dingos-work.md new file mode 100644 index 00000000000..486a6dfb6cf --- /dev/null +++ b/.changeset/kind-dingos-work.md @@ -0,0 +1,6 @@ +--- +'@firebase/performance': minor +'firebase': minor +--- + +Collect web vital metrics (INP,CLS,LCP) as part of page load event. diff --git a/packages/performance/package.json b/packages/performance/package.json index c613ac66877..493ccc46dc3 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -14,9 +14,7 @@ }, "./package.json": "./package.json" }, - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", @@ -42,7 +40,8 @@ "@firebase/installations": "0.6.12", "@firebase/util": "1.10.3", "@firebase/component": "0.6.12", - "tslib": "^2.1.0" + "tslib": "^2.1.0", + "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { @@ -62,9 +61,7 @@ }, "typings": "dist/src/index.d.ts", "nyc": { - "extension": [ - ".ts" - ], + "extension": [".ts"], "reportDir": "./coverage/node" } } diff --git a/packages/performance/src/constants.ts b/packages/performance/src/constants.ts index 2cac126da97..66350190603 100644 --- a/packages/performance/src/constants.ts +++ b/packages/performance/src/constants.ts @@ -33,6 +33,15 @@ export const FIRST_CONTENTFUL_PAINT_COUNTER_NAME = '_fcp'; export const FIRST_INPUT_DELAY_COUNTER_NAME = '_fid'; +export const LARGEST_CONTENTFUL_PAINT_METRIC_NAME = '_lcp'; +export const LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME = 'lcp_element'; + +export const INTERACTION_TO_NEXT_PAINT_METRIC_NAME = '_inp'; +export const INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME = 'inp_interactionTarget'; + +export const CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME = '_cls'; +export const CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME = 'cls_largestShiftTarget'; + export const CONFIG_LOCAL_STORAGE_KEY = '@firebase/performance/config'; export const CONFIG_EXPIRY_LOCAL_STORAGE_KEY = diff --git a/packages/performance/src/resources/trace.ts b/packages/performance/src/resources/trace.ts index 792bf1677ea..d6657f14ba6 100644 --- a/packages/performance/src/resources/trace.ts +++ b/packages/performance/src/resources/trace.ts @@ -22,10 +22,16 @@ import { OOB_TRACE_PAGE_LOAD_PREFIX, FIRST_PAINT_COUNTER_NAME, FIRST_CONTENTFUL_PAINT_COUNTER_NAME, - FIRST_INPUT_DELAY_COUNTER_NAME + FIRST_INPUT_DELAY_COUNTER_NAME, + LARGEST_CONTENTFUL_PAINT_METRIC_NAME, + LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME, + INTERACTION_TO_NEXT_PAINT_METRIC_NAME, + INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME, + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME, + CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME } from '../constants'; import { Api } from '../services/api_service'; -import { logTrace } from '../services/perf_logger'; +import { logTrace, flushLogs } from '../services/perf_logger'; import { ERROR_FACTORY, ErrorCode } from '../utils/errors'; import { isValidCustomAttributeName, @@ -37,6 +43,7 @@ import { } from '../utils/metric_utils'; import { PerformanceTrace } from '../public_types'; import { PerformanceController } from '../controllers/perf'; +import { CoreVitalMetric, WebVitalMetrics } from './web_vitals'; const enum TraceState { UNINITIALIZED = 1, @@ -279,6 +286,7 @@ export class Trace implements PerformanceTrace { performanceController: PerformanceController, navigationTimings: PerformanceNavigationTiming[], paintTimings: PerformanceEntry[], + webVitalMetrics: WebVitalMetrics, firstInputDelay?: number ): void { const route = Api.getInstance().getUrl(); @@ -340,7 +348,43 @@ export class Trace implements PerformanceTrace { } } + this.addWebVitalMetric( + trace, + LARGEST_CONTENTFUL_PAINT_METRIC_NAME, + LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME, + webVitalMetrics.lcp + ); + this.addWebVitalMetric( + trace, + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME, + CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME, + webVitalMetrics.cls + ); + this.addWebVitalMetric( + trace, + INTERACTION_TO_NEXT_PAINT_METRIC_NAME, + INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME, + webVitalMetrics.inp + ); + + // Page load logs are sent at unload time and so should be logged and + // flushed immediately. logTrace(trace); + flushLogs(); + } + + static addWebVitalMetric( + trace: Trace, + metricKey: string, + attributeKey: string, + metric?: CoreVitalMetric + ): void { + if (metric) { + trace.putMetric(metricKey, Math.floor(metric.value * 1000)); + if (metric.elementAttribution) { + trace.putAttribute(attributeKey, metric.elementAttribution); + } + } } static createUserTimingTrace( diff --git a/packages/performance/src/resources/web_vitals.ts b/packages/performance/src/resources/web_vitals.ts new file mode 100644 index 00000000000..850768b4655 --- /dev/null +++ b/packages/performance/src/resources/web_vitals.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2024 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. + */ + +export interface CoreVitalMetric { + value: number; + elementAttribution?: string; +} + +export interface WebVitalMetrics { + cls?: CoreVitalMetric; + inp?: CoreVitalMetric; + lcp?: CoreVitalMetric; +} diff --git a/packages/performance/src/services/api_service.ts b/packages/performance/src/services/api_service.ts index 494574f650c..97c3f2943c4 100644 --- a/packages/performance/src/services/api_service.ts +++ b/packages/performance/src/services/api_service.ts @@ -18,6 +18,14 @@ import { ERROR_FACTORY, ErrorCode } from '../utils/errors'; import { isIndexedDBAvailable, areCookiesEnabled } from '@firebase/util'; import { consoleLogger } from '../utils/console_logger'; +import { + CLSMetricWithAttribution, + INPMetricWithAttribution, + LCPMetricWithAttribution, + onCLS as vitalsOnCLS, + onINP as vitalsOnINP, + onLCP as vitalsOnLCP +} from 'web-vitals/attribution'; declare global { interface Window { @@ -47,6 +55,9 @@ export class Api { private readonly PerformanceObserver: typeof PerformanceObserver; private readonly windowLocation: Location; readonly onFirstInputDelay?: (fn: (fid: number) => void) => void; + readonly onLCP: (fn: (metric: LCPMetricWithAttribution) => void) => void; + readonly onINP: (fn: (metric: INPMetricWithAttribution) => void) => void; + readonly onCLS: (fn: (metric: CLSMetricWithAttribution) => void) => void; readonly localStorage?: Storage; readonly document: Document; readonly navigator: Navigator; @@ -68,6 +79,9 @@ export class Api { if (window.perfMetrics && window.perfMetrics.onFirstInputDelay) { this.onFirstInputDelay = window.perfMetrics.onFirstInputDelay; } + this.onLCP = vitalsOnLCP; + this.onINP = vitalsOnINP; + this.onCLS = vitalsOnCLS; } getUrl(): string { diff --git a/packages/performance/src/services/oob_resources_service.test.ts b/packages/performance/src/services/oob_resources_service.test.ts index 6f8ba259a94..e927d21fd09 100644 --- a/packages/performance/src/services/oob_resources_service.test.ts +++ b/packages/performance/src/services/oob_resources_service.test.ts @@ -18,6 +18,7 @@ import { spy, stub, + restore as sinonRestore, SinonSpy, SinonStub, useFakeTimers, @@ -26,13 +27,23 @@ import { import { expect } from 'chai'; import { Api, setupApi, EntryType } from './api_service'; import * as iidService from './iid_service'; -import { setupOobResources } from './oob_resources_service'; +import { setupOobResources, resetForUnitTests } from './oob_resources_service'; import { Trace } from '../resources/trace'; import '../../test/setup'; import { PerformanceController } from '../controllers/perf'; import { FirebaseApp } from '@firebase/app'; import { FirebaseInstallations } from '@firebase/installations-types'; +import { WebVitalMetrics } from '../resources/web_vitals'; +import { + CLSAttribution, + CLSMetricWithAttribution, + INPAttribution, + INPMetricWithAttribution, + LCPAttribution, + LCPMetricWithAttribution +} from 'web-vitals/attribution'; +// eslint-disable-next-line no-restricted-properties describe('Firebase Performance > oob_resources_service', () => { const MOCK_ID = 'idasdfsffe'; @@ -82,23 +93,36 @@ describe('Firebase Performance > oob_resources_service', () => { let getIidStub: SinonStub<[], string | undefined>; let apiGetInstanceSpy: SinonSpy<[], Api>; + let eventListenerSpy: SinonSpy< + [ + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions | undefined + ], + void + >; let getEntriesByTypeStub: SinonStub<[EntryType], PerformanceEntry[]>; let setupObserverStub: SinonStub< [EntryType, (entry: PerformanceEntry) => void], void >; - let createOobTraceStub: SinonStub< + let createOobTraceSpy: SinonSpy< [ PerformanceController, PerformanceNavigationTiming[], PerformanceEntry[], + WebVitalMetrics, (number | undefined)? ], void >; let clock: SinonFakeTimers; + let lcpSpy: SinonSpy<[(m: LCPMetricWithAttribution) => void], void>; + let inpSpy: SinonSpy<[(m: INPMetricWithAttribution) => void], void>; + let clsSpy: SinonSpy<[(m: CLSMetricWithAttribution) => void], void>; - setupApi(self); + const mockWindow = { ...self }; + setupApi(mockWindow); const fakeFirebaseConfig = { apiKey: 'api-key', @@ -120,9 +144,22 @@ describe('Firebase Performance > oob_resources_service', () => { fakeInstallations ); + function callEventListener(name: string): void { + for (let i = eventListenerSpy.callCount; i > 0; i--) { + const [eventName, eventFn] = eventListenerSpy.getCall(i - 1).args; + if (eventName === name) { + if (typeof eventFn === 'function') { + eventFn(new CustomEvent(name)); + } + } + } + } + beforeEach(() => { + resetForUnitTests(); getIidStub = stub(iidService, 'getIid'); - apiGetInstanceSpy = spy(Api, 'getInstance'); + eventListenerSpy = spy(mockWindow.document, 'addEventListener'); + clock = useFakeTimers(); getEntriesByTypeStub = stub(Api.prototype, 'getEntriesByType').callsFake( entry => { @@ -133,11 +170,20 @@ describe('Firebase Performance > oob_resources_service', () => { } ); setupObserverStub = stub(Api.prototype, 'setupObserver'); - createOobTraceStub = stub(Trace, 'createOobTrace'); + createOobTraceSpy = spy(Trace, 'createOobTrace'); + const api = Api.getInstance(); + lcpSpy = spy(api, 'onLCP'); + inpSpy = spy(api, 'onINP'); + clsSpy = spy(api, 'onCLS'); + apiGetInstanceSpy = spy(Api, 'getInstance'); }); afterEach(() => { clock.restore(); + sinonRestore(); + const api = Api.getInstance(); + //@ts-ignore Assignment to read-only property. + api.onFirstInputDelay = undefined; }); describe('setupOobResources', () => { @@ -158,36 +204,51 @@ describe('Firebase Performance > oob_resources_service', () => { expect(setupObserverStub).to.be.calledWith('resource'); }); - it('sets up page load trace collection', () => { + it('does not create page load trace before hidden', () => { getIidStub.returns(MOCK_ID); setupOobResources(performanceController); clock.tick(1); expect(apiGetInstanceSpy).to.be.called; + expect(createOobTraceSpy).not.to.be.called; + }); + + it('creates page load trace after hidden', () => { + getIidStub.returns(MOCK_ID); + setupOobResources(performanceController); + clock.tick(1); + + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + expect(getEntriesByTypeStub).to.be.calledWith('navigation'); expect(getEntriesByTypeStub).to.be.calledWith('paint'); - expect(createOobTraceStub).to.be.calledWithExactly( + expect(createOobTraceSpy).to.be.calledWithExactly( performanceController, [NAVIGATION_PERFORMANCE_ENTRY], - [PAINT_PERFORMANCE_ENTRY] + [PAINT_PERFORMANCE_ENTRY], + {}, + undefined ); }); - it('waits for first input delay if polyfill is available', () => { + it('creates page load trace after pagehide', () => { getIidStub.returns(MOCK_ID); - const api = Api.getInstance(); - //@ts-ignore Assignment to read-only property. - api.onFirstInputDelay = stub(); setupOobResources(performanceController); clock.tick(1); - expect(api.onFirstInputDelay).to.be.called; - expect(createOobTraceStub).not.to.be.called; - clock.tick(5000); - expect(createOobTraceStub).to.be.calledWithExactly( + callEventListener('pagehide'); + clock.tick(1); + + expect(getEntriesByTypeStub).to.be.calledWith('navigation'); + expect(getEntriesByTypeStub).to.be.calledWith('paint'); + expect(createOobTraceSpy).to.be.calledWithExactly( performanceController, [NAVIGATION_PERFORMANCE_ENTRY], - [PAINT_PERFORMANCE_ENTRY] + [PAINT_PERFORMANCE_ENTRY], + {}, + undefined ); }); @@ -206,10 +267,16 @@ describe('Firebase Performance > oob_resources_service', () => { clock.tick(1); firstInputDelayCallback(FIRST_INPUT_DELAY); - expect(createOobTraceStub).to.be.calledWithExactly( + // Force the page load event to be sent + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + + expect(createOobTraceSpy).to.be.calledWithExactly( performanceController, [NAVIGATION_PERFORMANCE_ENTRY], [PAINT_PERFORMANCE_ENTRY], + {}, FIRST_INPUT_DELAY ); }); @@ -223,5 +290,127 @@ describe('Firebase Performance > oob_resources_service', () => { expect(getEntriesByTypeStub).to.be.calledWith('measure'); expect(setupObserverStub).to.be.calledWith('measure'); }); + + it('sends LCP metrics with attribution', () => { + getIidStub.returns(MOCK_ID); + setupOobResources(performanceController); + clock.tick(1); + + lcpSpy.getCall(-1).args[0]({ + value: 12.34, + attribution: { + element: 'some-element' + } as LCPAttribution + } as LCPMetricWithAttribution); + + // Force the page load event to be sent + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + + expect(createOobTraceSpy).to.be.calledWithExactly( + performanceController, + [NAVIGATION_PERFORMANCE_ENTRY], + [PAINT_PERFORMANCE_ENTRY], + { + lcp: { value: 12.34, elementAttribution: 'some-element' } + }, + undefined + ); + }); + + it('sends INP metrics with attribution', () => { + getIidStub.returns(MOCK_ID); + setupOobResources(performanceController); + clock.tick(1); + + inpSpy.getCall(-1).args[0]({ + value: 0.198, + attribution: { + interactionTarget: 'another-element' + } as INPAttribution + } as INPMetricWithAttribution); + + // Force the page load event to be sent + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + + expect(createOobTraceSpy).to.be.calledWithExactly( + performanceController, + [NAVIGATION_PERFORMANCE_ENTRY], + [PAINT_PERFORMANCE_ENTRY], + { + inp: { value: 0.198, elementAttribution: 'another-element' } + }, + undefined + ); + }); + + it('sends CLS metrics with attribution', () => { + getIidStub.returns(MOCK_ID); + setupOobResources(performanceController); + clock.tick(1); + + clsSpy.getCall(-1).args[0]({ + value: 0.3, + // eslint-disable-next-line + attribution: { + largestShiftTarget: 'large-shift-element' + } as CLSAttribution + } as CLSMetricWithAttribution); + + // Force the page load event to be sent + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + + expect(createOobTraceSpy).to.be.calledWithExactly( + performanceController, + [NAVIGATION_PERFORMANCE_ENTRY], + [PAINT_PERFORMANCE_ENTRY], + { + cls: { value: 0.3, elementAttribution: 'large-shift-element' } + }, + undefined + ); + }); + + it('sends all core web vitals metrics', () => { + getIidStub.returns(MOCK_ID); + setupOobResources(performanceController); + clock.tick(1); + + lcpSpy.getCall(-1).args[0]({ + value: 5.91, + attribution: { element: 'an-element' } as LCPAttribution + } as LCPMetricWithAttribution); + inpSpy.getCall(-1).args[0]({ + value: 0.1 + } as INPMetricWithAttribution); + clsSpy.getCall(-1).args[0]({ + value: 0.3, + attribution: { + largestShiftTarget: 'large-shift-element' + } as CLSAttribution + } as CLSMetricWithAttribution); + + // Force the page load event to be sent + stub(mockWindow.document, 'visibilityState').value('hidden'); + callEventListener('visibilitychange'); + clock.tick(1); + + expect(createOobTraceSpy).to.be.calledWithExactly( + performanceController, + [NAVIGATION_PERFORMANCE_ENTRY], + [PAINT_PERFORMANCE_ENTRY], + { + lcp: { value: 5.91, elementAttribution: 'an-element' }, + inp: { value: 0.1, elementAttribution: undefined }, + cls: { value: 0.3, elementAttribution: 'large-shift-element' } + }, + undefined + ); + }); }); }); diff --git a/packages/performance/src/services/oob_resources_service.ts b/packages/performance/src/services/oob_resources_service.ts index aede0fa85c9..7e27e247b8d 100644 --- a/packages/performance/src/services/oob_resources_service.ts +++ b/packages/performance/src/services/oob_resources_service.ts @@ -15,14 +15,24 @@ * limitations under the License. */ -import { Api } from './api_service'; -import { Trace } from '../resources/trace'; -import { createNetworkRequestEntry } from '../resources/network_request'; +import { + CLSMetricWithAttribution, + INPMetricWithAttribution, + LCPMetricWithAttribution +} from 'web-vitals/attribution'; + import { TRACE_MEASURE_PREFIX } from '../constants'; -import { getIid } from './iid_service'; import { PerformanceController } from '../controllers/perf'; +import { createNetworkRequestEntry } from '../resources/network_request'; +import { Trace } from '../resources/trace'; +import { WebVitalMetrics } from '../resources/web_vitals'; -const FID_WAIT_TIME_MS = 5000; +import { Api } from './api_service'; +import { getIid } from './iid_service'; + +let webVitalMetrics: WebVitalMetrics = {}; +let sentPageLoadTrace: boolean = false; +let firstInputDelay: number | undefined; export function setupOobResources( performanceController: PerformanceController @@ -31,8 +41,9 @@ export function setupOobResources( if (!getIid()) { return; } - // The load event might not have fired yet, and that means performance navigation timing - // object has a duration of 0. The setup should run after all current tasks in js queue. + // The load event might not have fired yet, and that means performance + // navigation timing object has a duration of 0. The setup should run after + // all current tasks in js queue. setTimeout(() => setupOobTraces(performanceController), 0); setTimeout(() => setupNetworkRequests(performanceController), 0); setTimeout(() => setupUserTimingTraces(performanceController), 0); @@ -53,41 +64,46 @@ function setupNetworkRequests( function setupOobTraces(performanceController: PerformanceController): void { const api = Api.getInstance(); - const navigationTimings = api.getEntriesByType( - 'navigation' - ) as PerformanceNavigationTiming[]; - const paintTimings = api.getEntriesByType('paint'); - // If First Input Delay polyfill is added to the page, report the fid value. - // https://github.com/GoogleChromeLabs/first-input-delay + // Better support for Safari + if ('onpagehide' in window) { + api.document.addEventListener('pagehide', () => + sendOobTrace(performanceController) + ); + } else { + api.document.addEventListener('unload', () => + sendOobTrace(performanceController) + ); + } + api.document.addEventListener('visibilitychange', () => { + if (api.document.visibilityState === 'hidden') { + sendOobTrace(performanceController); + } + }); + if (api.onFirstInputDelay) { - // If the fid call back is not called for certain time, continue without it. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let timeoutId: any = setTimeout(() => { - Trace.createOobTrace( - performanceController, - navigationTimings, - paintTimings - ); - timeoutId = undefined; - }, FID_WAIT_TIME_MS); api.onFirstInputDelay((fid: number) => { - if (timeoutId) { - clearTimeout(timeoutId); - Trace.createOobTrace( - performanceController, - navigationTimings, - paintTimings, - fid - ); - } + firstInputDelay = fid; }); - } else { - Trace.createOobTrace( - performanceController, - navigationTimings, - paintTimings - ); } + + api.onLCP((metric: LCPMetricWithAttribution) => { + webVitalMetrics.lcp = { + value: metric.value, + elementAttribution: metric.attribution?.element + }; + }); + api.onCLS((metric: CLSMetricWithAttribution) => { + webVitalMetrics.cls = { + value: metric.value, + elementAttribution: metric.attribution?.largestShiftTarget + }; + }); + api.onINP((metric: INPMetricWithAttribution) => { + webVitalMetrics.inp = { + value: metric.value, + elementAttribution: metric.attribution?.interactionTarget + }; + }); } function setupUserTimingTraces( @@ -110,7 +126,8 @@ function createUserTimingTrace( measure: PerformanceEntry ): void { const measureName = measure.name; - // Do not create a trace, if the user timing marks and measures are created by the sdk itself. + // Do not create a trace, if the user timing marks and measures are created by + // the sdk itself. if ( measureName.substring(0, TRACE_MEASURE_PREFIX.length) === TRACE_MEASURE_PREFIX @@ -119,3 +136,36 @@ function createUserTimingTrace( } Trace.createUserTimingTrace(performanceController, measureName); } + +function sendOobTrace(performanceController: PerformanceController): void { + if (!sentPageLoadTrace) { + sentPageLoadTrace = true; + const api = Api.getInstance(); + const navigationTimings = api.getEntriesByType( + 'navigation' + ) as PerformanceNavigationTiming[]; + const paintTimings = api.getEntriesByType('paint'); + + // On page unload web vitals may be updated so queue the oob trace creation + // so that these updates have time to be included. + setTimeout(() => { + Trace.createOobTrace( + performanceController, + navigationTimings, + paintTimings, + webVitalMetrics, + firstInputDelay + ); + }, 0); + } +} + +/** + * This service will only export the page load trace once. This function allows + * resetting it for unit tests + */ +export function resetForUnitTests(): void { + sentPageLoadTrace = false; + firstInputDelay = undefined; + webVitalMetrics = {}; +} diff --git a/packages/performance/src/services/perf_logger.test.ts b/packages/performance/src/services/perf_logger.test.ts index f0b167707b1..3116769f7e1 100644 --- a/packages/performance/src/services/perf_logger.test.ts +++ b/packages/performance/src/services/perf_logger.test.ts @@ -32,11 +32,12 @@ import { mergeStrings } from '../utils/string_merger'; import { FirebaseInstallations } from '@firebase/installations-types'; import { PerformanceController } from '../controllers/perf'; +// eslint-disable-next-line no-restricted-properties describe('Performance Monitoring > perf_logger', () => { const IID = 'idasdfsffe'; const PAGE_URL = 'http://mock-page.com'; const APP_ID = '1:123:web:2er'; - const VISIBILITY_STATE = 3; + const VISIBILITY_STATE = attributeUtils.VisibilityState.UNKNOWN; const EFFECTIVE_CONNECTION_TYPE = 2; const SERVICE_WORKER_STATUS = 3; const TIME_ORIGIN = 1556512199893.9033; @@ -222,7 +223,9 @@ describe('Performance Monitoring > perf_logger', () => { "application_process_state":0},"trace_metric":{"name":"_wt_${PAGE_URL}","is_auto":true,\ "client_start_time_us":${flooredStartTime},"duration_us":${DURATION * 1000},\ "counters":{"domInteractive":10000,"domContentLoadedEventEnd":20000,"loadEventEnd":10000,\ -"_fp":40000,"_fcp":50000,"_fid":90000}}}`; +"_fp":40000,"_fcp":50000,"_fid":90000,"_lcp":3999,"_cls":250,"_inp":100},\ +"custom_attributes":{"lcp_element":"lcp-element","cls_largestShiftTarget":"cls-element",\ +"inp_interactionTarget":"inp-element"}}}`; stub(initializationService, 'isPerfInitialized').returns(true); getIidStub.returns(IID); SettingsService.getInstance().loggingEnabled = true; @@ -275,6 +278,11 @@ describe('Performance Monitoring > perf_logger', () => { performanceController, navigationTimings, paintTimings, + { + lcp: { value: 3.999, elementAttribution: 'lcp-element' }, + inp: { value: 0.1, elementAttribution: 'inp-element' }, + cls: { value: 0.25, elementAttribution: 'cls-element' } + }, 90 ); clock.tick(1); diff --git a/packages/performance/src/services/perf_logger.ts b/packages/performance/src/services/perf_logger.ts index 60bffb051e9..57bd7cdeca4 100644 --- a/packages/performance/src/services/perf_logger.ts +++ b/packages/performance/src/services/perf_logger.ts @@ -23,14 +23,13 @@ import { SettingsService } from './settings_service'; import { getServiceWorkerStatus, getVisibilityState, - VisibilityState, getEffectiveConnectionType } from '../utils/attributes_utils'; import { isPerfInitialized, getInitializationPromise } from './initialization_service'; -import { transportHandler } from './transport_service'; +import { transportHandler, flushQueuedEvents } from './transport_service'; import { SDK_VERSION } from '../constants'; import { FirebaseApp } from '@firebase/app'; import { getAppId } from '../utils/app_utils'; @@ -85,19 +84,28 @@ interface TraceMetric { custom_attributes?: { [key: string]: string }; } -let logger: ( - resource: NetworkRequest | Trace, - resourceType: ResourceType -) => void | undefined; +interface Logger { + send: ( + resource: NetworkRequest | Trace, + resourceType: ResourceType + ) => void | undefined; + flush: () => void; +} + +let logger: Logger; +// // This method is not called before initialization. function sendLog( resource: NetworkRequest | Trace, resourceType: ResourceType ): void { if (!logger) { - logger = transportHandler(serializer); + logger = { + send: transportHandler(serializer), + flush: flushQueuedEvents + }; } - logger(resource, resourceType); + logger.send(resource, resourceType); } export function logTrace(trace: Trace): void { @@ -115,11 +123,6 @@ export function logTrace(trace: Trace): void { return; } - // Only log the page load auto traces if page is visible. - if (trace.isAuto && getVisibilityState() !== VisibilityState.VISIBLE) { - return; - } - if (isPerfInitialized()) { sendTraceLog(trace); } else { @@ -132,6 +135,12 @@ export function logTrace(trace: Trace): void { } } +export function flushLogs(): void { + if (logger) { + logger.flush(); + } +} + function sendTraceLog(trace: Trace): void { if (!getIid()) { return; @@ -145,7 +154,7 @@ function sendTraceLog(trace: Trace): void { return; } - setTimeout(() => sendLog(trace, ResourceType.Trace), 0); + sendLog(trace, ResourceType.Trace); } export function logNetworkRequest(networkRequest: NetworkRequest): void { @@ -177,7 +186,7 @@ export function logNetworkRequest(networkRequest: NetworkRequest): void { return; } - setTimeout(() => sendLog(networkRequest, ResourceType.NetworkRequest), 0); + sendLog(networkRequest, ResourceType.NetworkRequest); } function serializer( diff --git a/packages/performance/src/services/transport_service.test.ts b/packages/performance/src/services/transport_service.test.ts index c249206c33e..124ce1f415b 100644 --- a/packages/performance/src/services/transport_service.test.ts +++ b/packages/performance/src/services/transport_service.test.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { stub, useFakeTimers, SinonStub, SinonFakeTimers, match } from 'sinon'; +import { stub, useFakeTimers, SinonFakeTimers, SinonStub } from 'sinon'; import { use, expect } from 'chai'; import sinonChai from 'sinon-chai'; import { @@ -27,7 +27,12 @@ import { SettingsService } from './settings_service'; use(sinonChai); +/* eslint-disable no-restricted-properties */ describe('Firebase Performance > transport_service', () => { + let sendBeaconStub: SinonStub< + [url: string | URL, data?: BodyInit | null | undefined], + boolean + >; let fetchStub: SinonStub< [RequestInfo | URL, RequestInit?], Promise @@ -35,7 +40,6 @@ describe('Firebase Performance > transport_service', () => { const INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000; const DEFAULT_SEND_INTERVAL_MS = 10 * 1000; const MAX_EVENT_COUNT_PER_REQUEST = 1000; - const TRANSPORT_DELAY_INTERVAL = 10000; // Starts date at timestamp 1 instead of 0, otherwise it causes validation errors. let clock: SinonFakeTimers; const testTransportHandler = transportHandler((...args) => { @@ -43,15 +47,18 @@ describe('Firebase Performance > transport_service', () => { }); beforeEach(() => { - fetchStub = stub(window, 'fetch'); clock = useFakeTimers(1); setupTransportService(); + sendBeaconStub = stub(navigator, 'sendBeacon'); + sendBeaconStub.returns(true); + fetchStub = stub(window, 'fetch'); }); afterEach(() => { - fetchStub.restore(); clock.restore(); resetTransportService(); + sendBeaconStub.restore(); + fetchStub.restore(); }); it('throws an error when logging an empty message', () => { @@ -61,43 +68,24 @@ describe('Firebase Performance > transport_service', () => { }); it('does not attempt to log an event after INITIAL_SEND_TIME_DELAY_MS if queue is empty', () => { - fetchStub.resolves( - new Response('', { - status: 200, - headers: { 'Content-type': 'application/json' } - }) - ); - clock.tick(INITIAL_SEND_TIME_DELAY_MS); + expect(sendBeaconStub).to.not.have.been.called; expect(fetchStub).to.not.have.been.called; }); it('attempts to log an event after DEFAULT_SEND_INTERVAL_MS if queue not empty', async () => { - fetchStub.resolves( - new Response('', { - status: 200, - headers: { 'Content-type': 'application/json' } - }) - ); - clock.tick(INITIAL_SEND_TIME_DELAY_MS); testTransportHandler('someEvent'); clock.tick(DEFAULT_SEND_INTERVAL_MS); - expect(fetchStub).to.have.been.calledOnce; + expect(sendBeaconStub).to.have.been.calledOnce; + expect(fetchStub).to.not.have.been.called; }); it('successful send a message to transport', () => { - const setting = SettingsService.getInstance(); - const flTransportFullUrl = - setting.flTransportEndpointUrl + '?key=' + setting.transportKey; - fetchStub.withArgs(flTransportFullUrl, match.any).resolves( - // DELETE_REQUEST means event dispatch is successful. - generateSuccessResponse() - ); - testTransportHandler('event1'); clock.tick(INITIAL_SEND_TIME_DELAY_MS); - expect(fetchStub).to.have.been.calledOnce; + expect(sendBeaconStub).to.have.been.calledOnce; + expect(fetchStub).to.not.have.been.called; }); it('sends up to the maximum event limit in one request', async () => { @@ -106,11 +94,6 @@ describe('Firebase Performance > transport_service', () => { const flTransportFullUrl = setting.flTransportEndpointUrl + '?key=' + setting.transportKey; - // Returns successful response from fl for logRequests. - const response = generateSuccessResponse(); - stub(response, 'json').resolves(JSON.parse(generateSuccessResponseBody())); - fetchStub.resolves(response); - // Act // Generate 1020 events, which should be dispatched in two batches (1000 events and 20 events). for (let i = 0; i < 1020; i++) { @@ -131,10 +114,10 @@ describe('Firebase Performance > transport_service', () => { 'event_time_ms': '1' }); } - expect(fetchStub).which.to.have.been.calledWith(flTransportFullUrl, { - method: 'POST', - body: JSON.stringify(firstLogRequest) - }); + expect(sendBeaconStub).which.to.have.been.calledWith( + flTransportFullUrl, + JSON.stringify(firstLogRequest) + ); // Expects the second logRequest which contains remaining 20 events; const secondLogRequest = generateLogRequest('15501'); for (let i = 0; i < 20; i++) { @@ -144,10 +127,24 @@ describe('Firebase Performance > transport_service', () => { 'event_time_ms': '1' }); } - expect(fetchStub).calledWith(flTransportFullUrl, { - method: 'POST', - body: JSON.stringify(secondLogRequest) - }); + expect(sendBeaconStub).calledWith( + flTransportFullUrl, + JSON.stringify(secondLogRequest) + ); + expect(fetchStub).to.not.have.been.called; + }); + + it('falls back to fetch if sendBeacon fails.', async () => { + sendBeaconStub.returns(false); + fetchStub.resolves( + new Response('{}', { + status: 200, + headers: { 'Content-type': 'application/json' } + }) + ); + testTransportHandler('event1'); + clock.tick(INITIAL_SEND_TIME_DELAY_MS); + expect(fetchStub).to.have.been.calledOnce; }); function generateLogRequest(requestTimeMs: string): any { @@ -161,26 +158,4 @@ describe('Firebase Performance > transport_service', () => { 'log_event': [] as any }; } - - function generateSuccessResponse(): Response { - return new Response(generateSuccessResponseBody(), { - status: 200, - headers: { 'Content-type': 'application/json' } - }); - } - - function generateSuccessResponseBody(): string { - return ( - '{\ - "nextRequestWaitMillis": "' + - TRANSPORT_DELAY_INTERVAL + - '",\ - "logResponseDetails": [\ - {\ - "responseAction": "DELETE_REQUEST"\ - }\ - ]\ - }' - ); - } }); diff --git a/packages/performance/src/services/transport_service.ts b/packages/performance/src/services/transport_service.ts index b90090e3209..cf5e3972972 100644 --- a/packages/performance/src/services/transport_service.ts +++ b/packages/performance/src/services/transport_service.ts @@ -21,14 +21,10 @@ import { consoleLogger } from '../utils/console_logger'; const DEFAULT_SEND_INTERVAL_MS = 10 * 1000; const INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000; -// If end point does not work, the call will be tried for these many times. -const DEFAULT_REMAINING_TRIES = 3; const MAX_EVENT_COUNT_PER_REQUEST = 1000; -let remainingTries = DEFAULT_REMAINING_TRIES; +const DEFAULT_REMAINING_TRIES = 3; -interface LogResponseDetails { - responseAction?: string; -} +let remainingTries = DEFAULT_REMAINING_TRIES; interface BatchEvent { message: string; @@ -81,12 +77,10 @@ function processQueue(timeOffset: number): void { return; } - // If there are no events to process, wait for DEFAULT_SEND_INTERVAL_MS and try again. - if (!queue.length) { - return processQueue(DEFAULT_SEND_INTERVAL_MS); + if (queue.length > 0) { + dispatchQueueEvents(); } - - dispatchQueueEvents(); + processQueue(DEFAULT_SEND_INTERVAL_MS); }, timeOffset); } @@ -114,60 +108,32 @@ function dispatchQueueEvents(): void { }; /* eslint-enable camelcase */ - sendEventsToFl(data, staged).catch(() => { - // If the request fails for some reason, add the events that were attempted - // back to the primary queue to retry later. - queue = [...staged, ...queue]; - remainingTries--; - consoleLogger.info(`Tries left: ${remainingTries}.`); - processQueue(DEFAULT_SEND_INTERVAL_MS); - }); -} - -function sendEventsToFl( - data: TransportBatchLogFormat, - staged: BatchEvent[] -): Promise { - return postToFlEndpoint(data) - .then(res => { - if (!res.ok) { - consoleLogger.info('Call to Firebase backend failed.'); - } - return res.json(); - }) - .then(res => { - // Find the next call wait time from the response. - const transportWait = Number(res.nextRequestWaitMillis); - let requestOffset = DEFAULT_SEND_INTERVAL_MS; - if (!isNaN(transportWait)) { - requestOffset = Math.max(transportWait, requestOffset); - } - - // Delete request if response include RESPONSE_ACTION_UNKNOWN or DELETE_REQUEST action. - // Otherwise, retry request using normal scheduling if response include RETRY_REQUEST_LATER. - const logResponseDetails: LogResponseDetails[] = res.logResponseDetails; - if ( - Array.isArray(logResponseDetails) && - logResponseDetails.length > 0 && - logResponseDetails[0].responseAction === 'RETRY_REQUEST_LATER' - ) { - queue = [...staged, ...queue]; - consoleLogger.info(`Retry transport request later.`); - } - + postToFlEndpoint(data) + .then(() => { remainingTries = DEFAULT_REMAINING_TRIES; - // Schedule the next process. - processQueue(requestOffset); + }) + .catch(() => { + // If the request fails for some reason, add the events that were attempted + // back to the primary queue to retry later. + queue = [...staged, ...queue]; + remainingTries--; + consoleLogger.info(`Tries left: ${remainingTries}.`); + processQueue(DEFAULT_SEND_INTERVAL_MS); }); } -function postToFlEndpoint(data: TransportBatchLogFormat): Promise { +function postToFlEndpoint(data: TransportBatchLogFormat): Promise { const flTransportFullUrl = SettingsService.getInstance().getFlTransportFullUrl(); - return fetch(flTransportFullUrl, { - method: 'POST', - body: JSON.stringify(data) - }); + const body = JSON.stringify(data); + + return navigator.sendBeacon && navigator.sendBeacon(flTransportFullUrl, body) + ? Promise.resolve() + : fetch(flTransportFullUrl, { + method: 'POST', + body, + keepalive: true + }).then(); } function addToQueue(evt: BatchEvent): void { @@ -191,3 +157,13 @@ export function transportHandler( }); }; } + +/** + * Force flush the queued events. Useful at page unload time to ensure all + * events are uploaded. + */ +export function flushQueuedEvents(): void { + while (queue.length > 0) { + dispatchQueueEvents(); + } +} diff --git a/packages/performance/src/utils/metric_utils.ts b/packages/performance/src/utils/metric_utils.ts index 9bbc4886aef..699fb83da3a 100644 --- a/packages/performance/src/utils/metric_utils.ts +++ b/packages/performance/src/utils/metric_utils.ts @@ -19,7 +19,10 @@ import { FIRST_PAINT_COUNTER_NAME, FIRST_CONTENTFUL_PAINT_COUNTER_NAME, FIRST_INPUT_DELAY_COUNTER_NAME, - OOB_TRACE_PAGE_LOAD_PREFIX + OOB_TRACE_PAGE_LOAD_PREFIX, + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME, + INTERACTION_TO_NEXT_PAINT_METRIC_NAME, + LARGEST_CONTENTFUL_PAINT_METRIC_NAME } from '../constants'; import { consoleLogger } from '../utils/console_logger'; @@ -28,7 +31,10 @@ const RESERVED_AUTO_PREFIX = '_'; const oobMetrics = [ FIRST_PAINT_COUNTER_NAME, FIRST_CONTENTFUL_PAINT_COUNTER_NAME, - FIRST_INPUT_DELAY_COUNTER_NAME + FIRST_INPUT_DELAY_COUNTER_NAME, + LARGEST_CONTENTFUL_PAINT_METRIC_NAME, + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME, + INTERACTION_TO_NEXT_PAINT_METRIC_NAME ]; /** diff --git a/yarn.lock b/yarn.lock index 910f54284fe..a7f5a7208dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17834,6 +17834,11 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-vitals@^4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== + webdriver-js-extender@2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz" From d8aabaf9eba6ef1c3feaf4feb6de24eca5f09e75 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 23 Jan 2025 10:55:59 -0800 Subject: [PATCH 078/295] Update a lot of dependencies (#8716) --- .changeset/config.json | 1 - .../workflows/test-firebase-integration.yml | 49 - integration/firebase/karma.conf.js | 36 - integration/firebase/package.json | 28 - integration/firebase/test/namespace.test.ts | 38 - .../firebase/test/namespaceDefinition.json | 231 - integration/firebase/test/typings.d.ts | 21 - integration/firebase/test/validator.js | 109 - integration/firebase/tsconfig.json | 19 - integration/firestore/package.json | 8 - package.json | 58 +- packages/database/src/internal/index.ts | 2 +- packages/storage/test/unit/task.test.ts | 20 +- repo-scripts/size-analysis/bundle/webpack.ts | 4 +- repo-scripts/size-analysis/package.json | 30 +- scripts/ci-test/testConfig.ts | 4 - yarn.lock | 3958 ++++++++++------- 17 files changed, 2472 insertions(+), 2144 deletions(-) delete mode 100644 .github/workflows/test-firebase-integration.yml delete mode 100644 integration/firebase/karma.conf.js delete mode 100644 integration/firebase/package.json delete mode 100644 integration/firebase/test/namespace.test.ts delete mode 100644 integration/firebase/test/namespaceDefinition.json delete mode 100644 integration/firebase/test/typings.d.ts delete mode 100644 integration/firebase/test/validator.js delete mode 100644 integration/firebase/tsconfig.json diff --git a/.changeset/config.json b/.changeset/config.json index 936ef9d7512..942e7e703f5 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -10,7 +10,6 @@ "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [ - "firebase-namespace-integration-test", "firebase-firestore-integration-test", "firebase-messaging-integration-test", "firebase-compat-interop-test", diff --git a/.github/workflows/test-firebase-integration.yml b/.github/workflows/test-firebase-integration.yml deleted file mode 100644 index d77a49ecf3b..00000000000 --- a/.github/workflows/test-firebase-integration.yml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2023 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. - -name: Test Firebase Namespace - -on: pull_request - -env: - # Bump Node memory limit - NODE_OPTIONS: "--max_old_space_size=4096" - -jobs: - test: - name: Test Firebase Namespace - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - # This makes Actions fetch all Git history so run-changed script can diff properly. - fetch-depth: 0 - - name: Set up Node (20) - uses: actions/setup-node@v4 - with: - node-version: 22.10.0 - - name: install Chrome stable - run: | - sudo apt-get update - sudo apt-get install google-chrome-stable - - name: Test setup and yarn install - run: | - cp config/ci.config.json config/project.json - yarn - - name: build - run: yarn build:changed firebase-integration - - name: Run tests on changed packages - run: yarn test:changed firebase-integration diff --git a/integration/firebase/karma.conf.js b/integration/firebase/karma.conf.js deleted file mode 100644 index c1210c70fe0..00000000000 --- a/integration/firebase/karma.conf.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2017 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. - */ - -const karma = require('karma'); -const path = require('path'); -const karmaBase = require('../../config/karma.base'); - -const files = ['test/**/*.test.*']; - -module.exports = function (config) { - const karmaConfig = Object.assign({}, karmaBase, { - // files to load into karma - files: files, - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'] - }); - - config.set(karmaConfig); -}; - -module.exports.files = files; diff --git a/integration/firebase/package.json b/integration/firebase/package.json deleted file mode 100644 index 8194fd31ba9..00000000000 --- a/integration/firebase/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "firebase-namespace-integration-test", - "private": true, - "version": "0.2.1", - "scripts": { - "test": "karma start", - "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" - }, - "devDependencies": { - "firebase": "11.2.0", - "@types/chai": "4.3.14", - "@types/mocha": "9.1.1", - "chai": "4.4.1", - "karma": "6.4.2", - "karma-babel-preprocessor": "8.0.2", - "karma-chrome-launcher": "3.2.0", - "karma-firefox-launcher": "2.1.3", - "karma-mocha": "2.0.1", - "karma-spec-reporter": "0.0.36", - "karma-typescript": "5.5.4", - "mocha": "9.2.2", - "npm-run-all2": "5.0.0", - "typescript": "5.5.4" - }, - "engines": { - "node": ">=18.0.0" - } -} diff --git a/integration/firebase/test/namespace.test.ts b/integration/firebase/test/namespace.test.ts deleted file mode 100644 index 052044935ed..00000000000 --- a/integration/firebase/test/namespace.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2017 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 firebase from 'firebase/compat/app'; -import 'firebase/compat/auth'; -import 'firebase/compat/database'; -import 'firebase/compat/storage'; -import 'firebase/compat/messaging'; -import * as namespaceDefinition from './namespaceDefinition.json'; -import validateNamespace from './validator'; - -firebase.initializeApp({ - apiKey: 'test-api-key', - authDomain: 'test-project-name.firebaseapp.com', - databaseURL: 'https://test-project-name.firebaseio.com', - projectId: 'test-project-name', - storageBucket: 'test-project-name.appspot.com', - messagingSenderId: '012345678910', - appId: 'myAppId' -}); - -describe('Firebase Namespace Validation', function () { - validateNamespace(namespaceDefinition, firebase); -}); diff --git a/integration/firebase/test/namespaceDefinition.json b/integration/firebase/test/namespaceDefinition.json deleted file mode 100644 index cc3b8f3a2e8..00000000000 --- a/integration/firebase/test/namespaceDefinition.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "initializeApp": { - "__type": "function", - "__args": 2 - }, - "app": { - "__type": "function", - "__args": 1, - "App": { - "__type": "function" - }, - "__return": { - "name": { - "__type": "string" - }, - "options": { - "__type": "object" - }, - "delete": { - "__type": "function" - }, - "INTERNAL": { - "getToken": { - "__type": "function" - }, - "addAuthTokenListener": { - "__type": "function" - }, - "removeAuthTokenListener": { - "__type": "function" - } - } - } - }, - "SDK_VERSION": { - "__type": "string" - }, - "apps": { - "__type": "array" - }, - "INTERNAL": { - "__type": "object", - "registerComponent": { - "__type": "function" - }, - "extendNamespace": { - "__type": "function" - }, - "createFirebaseNamespace": { - "__type": "function" - }, - "createSubscribe": { - "__type": "function" - }, - "removeApp": { - "__type": "function" - }, - "ErrorFactory": { - "__type": "function" - }, - "deepExtend": { - "__type": "function" - } - }, - "auth": { - "__type": "function", - "Auth": { - "__type": "function" - }, - "Error": { - "__type": "function" - }, - "EmailAuthProvider": { - "__type": "function" - }, - "FacebookAuthProvider": { - "__type": "function" - }, - "GithubAuthProvider": { - "__type": "function" - }, - "GoogleAuthProvider": { - "__type": "function" - }, - "TwitterAuthProvider": { - "__type": "function" - }, - "__return": { - "app": { - "__type": "object" - }, - "INTERNAL": { - "delete": { - "__type": "function" - } - } - } - }, - "database": { - "__type": "function", - "Database": { - "__type": "function" - }, - "Query": { - "__type": "function" - }, - "Reference": { - "__type": "function" - }, - "enableLogging": { - "__type": "function" - }, - "ServerValue": { - "__type": "object", - "TIMESTAMP": { - "__type": "object" - } - }, - "__return": { - "app": { - "__type": "object" - }, - "INTERNAL": { - "delete": { - "__type": "function" - } - }, - "ref": { - "__type": "function" - }, - "refFromURL": { - "__type": "function" - }, - "goOnline": { - "__type": "function" - }, - "goOffline": { - "__type": "function" - } - } - }, - "storage": { - "__type": "function", - "Storage": { - "__type": "function" - }, - "Reference": { - "__type": "function" - }, - "TaskEvent": { - "__type": "object", - "STATE_CHANGED": { - "__type": "string" - } - }, - "TaskState": { - "__type": "object", - "RUNNING": { - "__type": "string" - }, - "PAUSED": { - "__type": "string" - }, - "SUCCESS": { - "__type": "string" - }, - "CANCELED": { - "__type": "string" - }, - "ERROR": { - "__type": "string" - } - }, - "StringFormat": { - "__type": "object", - "RAW": { - "__type": "string" - }, - "BASE64": { - "__type": "string" - }, - "BASE64URL": { - "__type": "string" - }, - "DATA_URL": { - "__type": "string" - } - }, - "__return": { - "app": { - "__type": "object" - }, - "INTERNAL": { - "delete": { - "__type": "function" - } - }, - "ref": { - "__type": "function" - }, - "refFromURL": { - "__type": "function" - } - } - }, - "messaging": { - "__type": "function", - "__return": { - "app": { - "__type": "object" - }, - "INTERNAL": { - "delete": { - "__type": "function" - } - }, - "getToken": { - "__type": "function" - }, - "onMessage": { - "__type": "function" - }, - "deleteToken": { - "__type": "function" - }, - "onBackgroundMessage": { - "__type": "function" - } - } - } -} \ No newline at end of file diff --git a/integration/firebase/test/typings.d.ts b/integration/firebase/test/typings.d.ts deleted file mode 100644 index b59c269ac31..00000000000 --- a/integration/firebase/test/typings.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2017 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. - */ - -declare module '*.json' { - const value: any; - export default value; -} diff --git a/integration/firebase/test/validator.js b/integration/firebase/test/validator.js deleted file mode 100644 index 9f4fdc42c18..00000000000 --- a/integration/firebase/test/validator.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @license - * Copyright 2017 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. - */ - -let validatedVersion = false; - -function validateNamespace(definition, candidate) { - const __expect = require('chai').expect; - const keys = Object.keys(definition).filter(key => !~key.indexOf('__')); - - if (!validatedVersion) { - describe('Firebase SDK Version', function () { - it('Should be properly defined', function () { - __expect(candidate.SDK_VERSION).to.equal( - require('../../../packages/firebase/package.json').version - ); - }); - }); - validatedVersion = true; - } - - // Validate Keys - keys.forEach(key => { - /** - * This object that we capture here could potentially - * contain multiple layers of APIs. We recursively - * spin up the validations as needed but defer them - * till after we have validated the current API - */ - const definitionChunk = definition[key]; - const candidateChunk = candidate[key]; - - /** - * Grab all of the keys that aren't meta properties and capture - * them for more testing later - */ - const internalKeys = Object.keys(definitionChunk).filter( - iKey => !~iKey.indexOf('__') - ); - const returnKeys = Object.keys(definitionChunk).filter( - iKey => ~iKey.indexOf('__return') - ); - - describe(`${key}`, function () { - /** - * Tests of the actual API - */ - if (definitionChunk.__type) { - it(`Should be a \`${definitionChunk.__type}\``, function () { - __expect(candidateChunk).to.be.a(definitionChunk.__type); - }); - } - - /** - * If both the definition and candidate pieces are truthy - * then we can continue validation of the nested layers - */ - if (definitionChunk && candidateChunk) { - validateNamespace(definitionChunk, candidateChunk); - } - - /** - * Keys marked with `__return` allow us to validate the - * return value of a specific part of the API - * - * e.g. - * { - * ... - * app: { - * __return: { - * - * } - * } - * } - */ - if ( - definitionChunk.__type === 'function' && - definitionChunk.__return && - typeof candidateChunk === 'function' - ) { - try { - candidateChunk(); - } catch (e) { - it(`Throws because current browser is unsupported`, () => { - __expect(e.code).to.have.string('unsupported-browser'); - }); - return; - } - validateNamespace(definitionChunk.__return, candidateChunk()); - } - }); - }); -} - -module.exports = validateNamespace; -module.exports.default = validateNamespace; diff --git a/integration/firebase/tsconfig.json b/integration/firebase/tsconfig.json deleted file mode 100644 index 735f3df7fbd..00000000000 --- a/integration/firebase/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../config/tsconfig.base.json", - "compileOnSave": false, - "compilerOptions": { - "allowJs": true, - "declaration": false, - "module": "commonjs", - "moduleResolution": "node", - "noImplicitAny": true, - "outDir": "dist", - "target": "es2017", - "sourceMap": true, - "esModuleInterop": true - }, - "exclude": [ - "node_modules", - "dist" - ] -} diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 6d0c6e703ec..b02f3677ac0 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -22,15 +22,7 @@ "gulp": "4.0.2", "gulp-filter": "7.0.0", "gulp-replace": "1.1.4", - "karma": "6.4.2", - "karma-chrome-launcher": "3.2.0", - "karma-firefox-launcher": "2.1.3", - "karma-mocha": "2.0.1", - "karma-spec-reporter": "0.0.36", - "mocha": "9.2.2", - "ts-loader": "9.5.1", "typescript": "5.5.4", - "webpack": "5.76.0", "webpack-stream": "7.0.0" }, "engines": { diff --git a/package.json b/package.json index 6e1eed6506b..c0dc348446d 100644 --- a/package.json +++ b/package.json @@ -62,17 +62,17 @@ "repo-scripts/*" ], "devDependencies": { - "@babel/core": "7.24.4", - "@babel/plugin-transform-modules-commonjs": "7.24.1", - "@babel/preset-env": "7.24.4", - "@babel/preset-typescript": "7.24.1", - "@babel/register": "7.23.7", - "@changesets/changelog-github": "0.4.8", - "@changesets/cli": "2.26.2", - "@types/chai": "4.3.14", + "@babel/core": "7.26.0", + "@babel/plugin-transform-modules-commonjs": "7.26.3", + "@babel/preset-env": "7.26.0", + "@babel/preset-typescript": "7.26.0", + "@babel/register": "7.25.9", + "@changesets/changelog-github": "0.5.0", + "@changesets/cli": "2.27.11", + "@types/chai": "4.3.20", "@types/chai-as-promised": "7.1.8", "@types/child-process-promise": "2.2.6", - "@types/clone": "2.1.1", + "@types/clone": "2.1.4", "@types/eslint": "7.29.0", "@types/inquirer": "8.2.10", "@types/js-yaml": "4.0.9", @@ -80,31 +80,31 @@ "@types/long": "4.0.2", "@types/mocha": "9.1.1", "@types/mz": "2.7.8", - "@types/node": "18.19.57", + "@types/node": "18.19.71", "@types/request": "2.48.12", "@types/sinon": "9.0.11", "@types/sinon-chai": "3.2.12", "@types/tmp": "0.2.6", "@types/trusted-types": "2.0.7", - "@types/yargs": "17.0.32", - "@typescript-eslint/eslint-plugin": "7.16.1", + "@types/yargs": "17.0.33", + "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/eslint-plugin-tslint": "7.0.2", - "@typescript-eslint/parser": "7.16.1", + "@typescript-eslint/parser": "7.18.0", "api-documenter-me": "0.1.1", "api-extractor-me": "0.1.2", - "babel-loader": "8.3.0", - "chai": "4.4.1", - "chai-as-promised": "7.1.1", + "babel-loader": "8.4.1", + "chai": "4.5.0", + "chai-as-promised": "7.1.2", "chalk": "4.1.2", "child-process-promise": "2.2.1", "clone": "2.1.2", "coveralls": "3.1.1", "del": "6.1.1", "dependency-graph": "0.11.0", - "eslint": "8.56.0", - "eslint-plugin-import": "2.26.0", + "eslint": "8.57.1", + "eslint-plugin-import": "2.31.0", "eslint-plugin-unused-imports": "3.2.0", - "express": "4.19.2", + "express": "4.21.2", "find-free-port": "2.0.0", "firebase-tools": "11.30.0", "glob": "7.2.3", @@ -113,7 +113,7 @@ "inquirer": "8.2.6", "istanbul-instrumenter-loader": "3.0.1", "js-yaml": "4.1.0", - "karma": "6.4.2", + "karma": "6.4.4", "karma-chrome-launcher": "3.2.0", "karma-cli": "2.0.0", "karma-coverage-istanbul-reporter": "3.0.3", @@ -135,30 +135,30 @@ "mocha": "9.2.2", "mz": "2.7.0", "node-polyfill-webpack-plugin": "2.0.1", - "npm-run-all2": "5.0.0", + "npm-run-all2": "5.0.2", "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", - "playwright": "1.46.1", + "playwright": "1.49.1", "postinstall-postinstall": "2.1.0", - "prettier": "2.8.7", + "prettier": "2.8.8", "protractor": "5.4.2", "request": "2.88.2", - "semver": "7.5.3", - "simple-git": "3.24.0", + "semver": "7.6.3", + "simple-git": "3.27.0", "sinon": "9.2.4", "sinon-chai": "3.7.0", "source-map-loader": "1.1.3", - "sqlite3": "5.1.6", - "terser": "5.16.1", - "ts-loader": "9.5.1", + "sqlite3": "5.1.7", + "terser": "5.37.0", + "ts-loader": "9.5.2", "ts-node": "10.9.2", "tsec": "0.2.8", "tslint": "6.1.3", "typedoc": "0.16.11", "typescript": "5.5.4", "watch": "1.0.2", - "webpack": "5.76.0", + "webpack": "5.97.1", "yargs": "17.7.2" } } diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index 99fa4e1369f..40aed85122b 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -31,8 +31,8 @@ import { Provider } from '@firebase/component'; -import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; +import { Database } from '../api.standalone'; import { setSDKVersion } from '../core/version'; /** diff --git a/packages/storage/test/unit/task.test.ts b/packages/storage/test/unit/task.test.ts index 8a4f8bf6d78..90d453ca96d 100644 --- a/packages/storage/test/unit/task.test.ts +++ b/packages/storage/test/unit/task.test.ts @@ -207,8 +207,14 @@ describe('Firebase Storage > Upload Task', () => { } const fixedAssertEquals = promiseAssertWrapper(assert.equal); - const fixedAssertFalse = promiseAssertWrapper(assert.isFalse); - const fixedAssertTrue = promiseAssertWrapper(assert.isTrue); + const fixedAssertFalse: ( + value: unknown, + message?: string + ) => asserts value is false = promiseAssertWrapper(assert.isFalse); + const fixedAssertTrue: ( + value: unknown, + message?: string + ) => asserts value is true = promiseAssertWrapper(assert.isTrue); const fixedAssertFail = promiseAssertWrapper(assert.fail); const events: string[] = []; @@ -391,8 +397,14 @@ describe('Firebase Storage > Upload Task', () => { } const fixedAssertEquals = promiseAssertWrapper(assert.equal); - const fixedAssertFalse = promiseAssertWrapper(assert.isFalse); - const fixedAssertTrue = promiseAssertWrapper(assert.isTrue); + const fixedAssertFalse: ( + value: unknown, + message?: string + ) => asserts value is false = promiseAssertWrapper(assert.isFalse); + const fixedAssertTrue: ( + value: unknown, + message?: string + ) => asserts value is true = promiseAssertWrapper(assert.isTrue); const fixedAssertFail = promiseAssertWrapper(assert.fail); const events: string[] = []; diff --git a/repo-scripts/size-analysis/bundle/webpack.ts b/repo-scripts/size-analysis/bundle/webpack.ts index 93f8523c37b..611212b26b9 100644 --- a/repo-scripts/size-analysis/bundle/webpack.ts +++ b/repo-scripts/size-analysis/bundle/webpack.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import webpack from 'webpack'; +import webpack, { OutputFileSystem } from 'webpack'; // @ts-ignore import virtualModulesPlugin from 'webpack-virtual-modules'; import { createFsFromVolume, IFs, Volume } from 'memfs'; @@ -61,7 +61,7 @@ export async function bundleWithWebpack( }); // use virtual file system for output to avoid I/O - compiler.outputFileSystem = getMemoryFileSystem(); + compiler.outputFileSystem = getMemoryFileSystem() as OutputFileSystem; return new Promise((res, rej) => { compiler.run((err, stats) => { diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index b7cb63bdfa5..1ee0ba0cfcf 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -18,31 +18,29 @@ "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha **/*.test.ts --config ../../config/mocharc.node.js --timeout 60000", "build": "rollup -c" }, - "dependencies": { - "rollup": "2.79.1", + "license": "Apache-2.0", + "devDependencies": { + "@firebase/app": "0.10.18", + "@firebase/logger": "0.4.4", + "@firebase/util": "1.10.3", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-virtual": "2.1.0", - "webpack": "5.76.0", "@types/webpack": "5.28.5", - "webpack-virtual-modules": "0.5.0", "child-process-promise": "2.2.1", + "glob": "7.2.3", + "gzip-size": "6.0.0", "memfs": "3.5.3", + "rollup": "2.79.1", + "rollup-plugin-replace": "2.2.0", + "rollup-plugin-typescript2": "0.31.2", + "terser": "5.16.1", "tmp": "0.2.1", "typescript": "5.5.4", - "terser": "5.16.1", - "yargs": "17.7.2", - "@firebase/util": "1.10.3", - "gzip-size": "6.0.0", - "glob": "7.2.3" - }, - "license": "Apache-2.0", - "devDependencies": { - "@firebase/logger": "0.4.4", - "@firebase/app": "0.10.18" + "webpack": "5.97.1", + "webpack-virtual-modules": "0.6.2", + "yargs": "17.7.2" }, "repository": { "directory": "repo-scripts/size-analysis", diff --git a/scripts/ci-test/testConfig.ts b/scripts/ci-test/testConfig.ts index 0202c699154..757eb4a8364 100644 --- a/scripts/ci-test/testConfig.ts +++ b/scripts/ci-test/testConfig.ts @@ -51,7 +51,6 @@ export const testConfig: { '@firebase/firestore-compat', 'firebase-firestore-integration-test', 'firebase-messaging-integration-test', - 'firebase-namespace-integration-test', 'firebase-compat-typings-test', '@firebase/rules-unit-testing', '@firebase/auth', @@ -71,9 +70,6 @@ export const testConfig: { 'misc': { 'onlyIncludePackages': ['@firebase/rules-unit-testing'] }, - 'firebase-integration': { - 'alwaysIncludePackages': ['firebase-namespace-integration-test'] - }, 'auth': { 'onlyIncludePackages': ['@firebase/auth', '@firebase/auth-compat'] } diff --git a/yarn.lock b/yarn.lock index a7f5a7208dd..2b614f6ed54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,7 +34,7 @@ dependencies: "@babel/highlight" "^7.22.5" -"@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.1", "@babel/code-frame@^7.24.2": +"@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.1": version "7.24.2" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== @@ -42,6 +42,15 @@ "@babel/highlight" "^7.24.2" picocolors "^1.0.0" +"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": + version "7.26.2" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/compat-data@^7.15.0": version "7.15.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz" @@ -52,31 +61,26 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz" integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/compat-data@^7.23.5": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz#31c1f66435f2a9c329bb5716a6d6186c516c3742" - integrity sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA== - -"@babel/compat-data@^7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.4.tgz#6f102372e9094f25d908ca0d34fc74c74606059a" - integrity sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ== +"@babel/compat-data@^7.26.0", "@babel/compat-data@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz#df93ac37f4417854130e21d72c66ff3d4b897fc7" + integrity sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg== -"@babel/core@7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.24.4.tgz#1f758428e88e0d8c563874741bc4ffc4f71a4717" - integrity sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg== +"@babel/core@7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.2" - "@babel/generator" "^7.24.4" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.24.4" - "@babel/parser" "^7.24.4" - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.1" - "@babel/types" "^7.24.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -123,15 +127,16 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" -"@babel/generator@^7.24.4", "@babel/generator@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.24.5.tgz#e5afc068f932f05616b66713e28d0f04e99daeb3" - integrity sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA== +"@babel/generator@^7.26.0", "@babel/generator@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz#e44d4ab3176bbcaf78a5725da5f1dc28802a9458" + integrity sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw== dependencies: - "@babel/types" "^7.24.5" + "@babel/parser" "^7.26.5" + "@babel/types" "^7.26.5" "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" + jsesc "^3.0.2" "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" @@ -140,19 +145,12 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" - integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== +"@babel/helper-annotate-as-pure@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== dependencies: - "@babel/types" "^7.22.15" + "@babel/types" "^7.25.9" "@babel/helper-compilation-targets@^7.15.4": version "7.15.4" @@ -175,30 +173,28 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== +"@babel/helper-compilation-targets@^7.25.9": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" + integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" + "@babel/compat-data" "^7.26.5" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.24.1", "@babel/helper-create-class-features-plugin@^7.24.4", "@babel/helper-create-class-features-plugin@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.5.tgz#7d19da92c7e0cd8d11c09af2ce1b8e7512a6e723" - integrity sha512-uRc4Cv8UQWnE4NXlYTIIdM7wfFkOqlFztcC/gVXDKohKoVB3OyonfelUBaJzSwpBntZ2KYGF/9S7asCHsXwW6g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-member-expression-to-functions" "^7.24.5" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.24.1" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.24.5" +"@babel/helper-create-class-features-plugin@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" + integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/traverse" "^7.25.9" semver "^6.3.1" "@babel/helper-create-regexp-features-plugin@^7.18.6": @@ -209,25 +205,16 @@ "@babel/helper-annotate-as-pure" "^7.18.6" regexpu-core "^5.1.0" -"@babel/helper-create-regexp-features-plugin@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" - integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - regexpu-core "^5.3.1" - semver "^6.3.1" - -"@babel/helper-create-regexp-features-plugin@^7.22.5": - version "7.22.9" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz" - integrity sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw== +"@babel/helper-create-regexp-features-plugin@^7.25.9": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" + integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - regexpu-core "^5.3.1" + "@babel/helper-annotate-as-pure" "^7.25.9" + regexpu-core "^6.2.0" semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.6.1", "@babel/helper-define-polyfill-provider@^0.6.2": +"@babel/helper-define-polyfill-provider@^0.6.2": version "0.6.2" resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz#18594f789c3594acb24cfdb4a7f7b7d2e8bd912d" integrity sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ== @@ -265,12 +252,13 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-member-expression-to-functions@^7.23.0", "@babel/helper-member-expression-to-functions@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.5.tgz#5981e131d5c7003c7d1fa1ad49e86c9b097ec475" - integrity sha512-4owRteeihKWKamtqg4JmWSsEZU445xpFRXPEwp44HbgbxdWlUV1b4Agg4lkA806Lil5XM/e+FJyS0vj5T6vmcA== +"@babel/helper-member-expression-to-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" + integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== dependencies: - "@babel/types" "^7.24.5" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" "@babel/helper-module-imports@^7.15.4": version "7.15.4" @@ -279,12 +267,13 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-imports@^7.22.15", "@babel/helper-module-imports@^7.24.1": - version "7.24.3" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz#6ac476e6d168c7c23ff3ba3cf4f7841d46ac8128" - integrity sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg== +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== dependencies: - "@babel/types" "^7.24.0" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" "@babel/helper-module-transforms@^7.15.4": version "7.15.7" @@ -300,16 +289,14 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.6" -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== +"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" @@ -318,14 +305,14 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-optimise-call-expression@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz" - integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== +"@babel/helper-optimise-call-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" + integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.25.9" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": version "7.14.5" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== @@ -340,19 +327,19 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== -"@babel/helper-plugin-utils@^7.24.0", "@babel/helper-plugin-utils@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.5.tgz#a924607dd254a65695e5bd209b98b902b3b2f11a" - integrity sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ== +"@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" + integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== -"@babel/helper-remap-async-to-generator@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" - integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== +"@babel/helper-remap-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" + integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-wrap-function" "^7.22.20" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-wrap-function" "^7.25.9" + "@babel/traverse" "^7.25.9" "@babel/helper-replace-supers@^7.15.4": version "7.15.4" @@ -364,14 +351,14 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/helper-replace-supers@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz#7085bd19d4a0b7ed8f405c1ed73ccb70f323abc1" - integrity sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ== +"@babel/helper-replace-supers@^7.25.9": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz#6cb04e82ae291dae8e72335dfe438b0725f14c8d" + integrity sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-member-expression-to-functions" "^7.23.0" - "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/traverse" "^7.26.5" "@babel/helper-simple-access@^7.15.4": version "7.15.4" @@ -380,19 +367,13 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz" - integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== +"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" + integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== dependencies: - "@babel/types" "^7.22.5" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" "@babel/helper-split-export-declaration@^7.15.4": version "7.15.4" @@ -408,13 +389,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.5.tgz#b9a67f06a46b0b339323617c8c6213b9055a78b6" - integrity sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q== - dependencies: - "@babel/types" "^7.24.5" - "@babel/helper-string-parser@^7.19.4": version "7.19.4" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz" @@ -425,11 +399,16 @@ resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-string-parser@^7.23.4", "@babel/helper-string-parser@^7.24.1": +"@babel/helper-string-parser@^7.23.4": version "7.24.1" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" @@ -445,10 +424,10 @@ resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-identifier@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" - integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== "@babel/helper-validator-option@^7.14.5": version "7.14.5" @@ -460,19 +439,19 @@ resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz" integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== -"@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== -"@babel/helper-wrap-function@^7.22.20": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.5.tgz#335f934c0962e2c1ed1fb9d79e06a56115067c09" - integrity sha512-/xxzuNvgRl4/HLNKvnFwdhdgN3cpLxgLROeLDl83Yx0AJ1SGvq1ak0OszTOjDfiB8Vx03eJbeDWh9r+jCCWttw== +"@babel/helper-wrap-function@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" + integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== dependencies: - "@babel/helper-function-name" "^7.23.0" - "@babel/template" "^7.24.0" - "@babel/types" "^7.24.5" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" "@babel/helpers@^7.15.4": version "7.15.4" @@ -483,14 +462,13 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/helpers@^7.24.4": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.5.tgz#fedeb87eeafa62b621160402181ad8585a22a40a" - integrity sha512-CiQmBMMpMQHwM5m01YnrM6imUG1ebgYJ+fAIW4FZe6m4qHTPaRHti+R8cggAwkdz4oXhtO4/K9JWlh+8hIfR2Q== +"@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== dependencies: - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.5" - "@babel/types" "^7.24.5" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" "@babel/highlight@^7.14.5": version "7.14.5" @@ -530,42 +508,51 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== -"@babel/parser@^7.24.4", "@babel/parser@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz#4a4d5ab4315579e5398a82dcf636ca80c3392790" - integrity sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg== +"@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.5.tgz#6fec9aebddef25ca57a935c86dbb915ae2da3e1f" + integrity sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw== + dependencies: + "@babel/types" "^7.26.5" -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.24.4": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.5.tgz#4c3685eb9cd790bcad2843900fe0250c91ccf895" - integrity sha512-LdXRi1wEMTrHVR4Zc9F8OewC3vdm5h4QB6L71zy6StmYeqGi1b3ttIO8UC+BfZKcH9jdr4aI249rBkm+3+YvHw== +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" + integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.24.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.1.tgz#b645d9ba8c2bc5b7af50f0fe949f9edbeb07c8cf" - integrity sha512-y4HqEnkelJIOQGd+3g1bTeKsA5c6qM7eOn7VggGVbBc0y8MLSKHacwcIE2PplNlQSj0PqS9rrXL/nkPVK+kUNg== +"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" + integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.1.tgz#da8261f2697f0f41b0855b91d3a20a1fbfd271d3" - integrity sha512-Hj791Ii4ci8HqnaKHAlLNs+zaLXb0EzSDhiAWp5VNlyvCNymYfacs64pxTxbH1znW/NcArSmwpmG9IKE/TUVVQ== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" + integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.24.1" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.1.tgz#1181d9685984c91d657b8ddf14f0487a6bab2988" - integrity sha512-m9m/fXsXLiHfwdgydIFnpk+7jlVbnvlK5B2EKiPdLUb6WX654ZaaEWJUjk8TftRbZpK0XibovlLWX4KIZhV6jw== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" + integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" + integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" @@ -586,49 +573,28 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.8.3": version "7.12.13" resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-import-assertions@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.1.tgz#db3aad724153a00eaac115a3fb898de544e34971" - integrity sha512-IuwnI5XnuF189t91XbxmXeCDz3qs6iDRO7GJ++wcfgeXNs/8FmIlKcpDSXNVyuLQxlwvskmI3Ct73wUODkJBlQ== +"@babel/plugin-syntax-import-assertions@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" + integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-attributes@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.1.tgz#c66b966c63b714c4eec508fcf5763b1f2d381093" - integrity sha512-zhQTMH0X2nVLnb04tz+s7AMuasX8U0FnpE+nHTOhSOINjWMnopoZTxtIKsd45n4GQ/HIZLyfIpoul8e2m0DnRA== +"@babel/plugin-syntax-import-attributes@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -642,14 +608,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz#3f6ca04b8c841811dbc3c5c5f837934e0d626c10" - integrity sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA== +"@babel/plugin-syntax-jsx@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -663,7 +629,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -691,26 +657,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-top-level-await@^7.8.3": version "7.14.5" resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz#b3bcc51f396d15f3591683f90239de143c076844" - integrity sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw== +"@babel/plugin-syntax-typescript@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" + integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-typescript@^7.7.2": version "7.14.5" @@ -727,488 +686,477 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.1.tgz#2bf263617060c9cc45bcdbf492b8cc805082bf27" - integrity sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw== +"@babel/plugin-transform-arrow-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" + integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.24.3": - version "7.24.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.3.tgz#8fa7ae481b100768cc9842c8617808c5352b8b89" - integrity sha512-Qe26CMYVjpQxJ8zxM1340JFNjZaF+ISWpr1Kt/jGo+ZTUzKkfw/pphEWbRCb+lmSM6k/TOgfYLvmbHkUQ0asIg== +"@babel/plugin-transform-async-generator-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" + integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-remap-async-to-generator" "^7.22.20" - "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-async-to-generator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.1.tgz#0e220703b89f2216800ce7b1c53cb0cf521c37f4" - integrity sha512-AawPptitRXp1y0n4ilKcGbRYWfbbzFWz2NqNu7dacYDtFtz0CMjG64b3LQsb3KIgnf4/obcUL78hfaOS7iCUfw== +"@babel/plugin-transform-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" + integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== dependencies: - "@babel/helper-module-imports" "^7.24.1" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-remap-async-to-generator" "^7.22.20" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.1.tgz#1c94799e20fcd5c4d4589523bbc57b7692979380" - integrity sha512-TWWC18OShZutrv9C6mye1xwtam+uNi2bnTOCBUd5sZxyHOiWbU6ztSROofIMrK84uweEZC219POICK/sTYwfgg== +"@babel/plugin-transform-block-scoped-functions@^7.25.9": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" + integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-transform-block-scoping@^7.24.4": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.5.tgz#89574191397f85661d6f748d4b89ee4d9ee69a2a" - integrity sha512-sMfBc3OxghjC95BkYrYocHL3NaOplrcaunblzwXhGmlPwpmfsxr4vK+mBBt49r+S240vahmv+kUxkeKgs+haCw== +"@babel/plugin-transform-block-scoping@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" + integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== dependencies: - "@babel/helper-plugin-utils" "^7.24.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-class-properties@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.1.tgz#bcbf1aef6ba6085cfddec9fc8d58871cf011fc29" - integrity sha512-OMLCXi0NqvJfORTaPQBwqLXHhb93wkBKZ4aNwMl6WtehO7ar+cmp+89iPEQPqxAnxsOKTaMcs3POz3rKayJ72g== +"@babel/plugin-transform-class-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" + integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.1" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-class-static-block@^7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.4.tgz#1a4653c0cf8ac46441ec406dece6e9bc590356a4" - integrity sha512-B8q7Pz870Hz/q9UgP8InNpY01CSLDSCyqX7zcRuv3FcPl87A2G17lASroHWaCtbdIcbYzOZ7kWmXFKbijMSmFg== +"@babel/plugin-transform-class-static-block@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" + integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.4" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-classes@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.5.tgz#05e04a09df49a46348299a0e24bfd7e901129339" - integrity sha512-gWkLP25DFj2dwe9Ck8uwMOpko4YsqyfZJrOmqqcegeDYEbp7rmn4U6UQZNj08UF6MaX39XenSpKRCvpDRBtZ7Q== +"@babel/plugin-transform-classes@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" + integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.24.5" - "@babel/helper-replace-supers" "^7.24.1" - "@babel/helper-split-export-declaration" "^7.24.5" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/traverse" "^7.25.9" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.1.tgz#bc7e787f8e021eccfb677af5f13c29a9934ed8a7" - integrity sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/template" "^7.24.0" - -"@babel/plugin-transform-destructuring@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.5.tgz#80843ee6a520f7362686d1a97a7b53544ede453c" - integrity sha512-SZuuLyfxvsm+Ah57I/i1HVjveBENYK9ue8MJ7qkc7ndoNjqquJiElzA7f5yaAXjyW2hKojosOTAQQRX50bPSVg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.5" - -"@babel/plugin-transform-dotall-regex@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.1.tgz#d56913d2f12795cc9930801b84c6f8c47513ac13" - integrity sha512-p7uUxgSoZwZ2lPNMzUkqCts3xlp8n+o05ikjy7gbtFJSt9gdU88jAmtfmOxHM14noQXBxfgzf2yRWECiNVhTCw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.24.0" - -"@babel/plugin-transform-duplicate-keys@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.1.tgz#5347a797fe82b8d09749d10e9f5b83665adbca88" - integrity sha512-msyzuUnvsjsaSaocV6L7ErfNsa5nDWL1XKNnDePLgmz+WdU4w/J8+AxBMrWfi9m4IxfL5sZQKUPQKDQeeAT6lA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - -"@babel/plugin-transform-dynamic-import@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.1.tgz#2a5a49959201970dd09a5fca856cb651e44439dd" - integrity sha512-av2gdSTyXcJVdI+8aFZsCAtR29xJt0S5tas+Ef8NvBNmD1a+N/3ecMLeMBgfcK+xzsjdLDT6oHt+DFPyeqUbDA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-transform-exponentiation-operator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.1.tgz#6650ebeb5bd5c012d5f5f90a26613a08162e8ba4" - integrity sha512-U1yX13dVBSwS23DEAqU+Z/PkwE9/m7QQy8Y9/+Tdb8UWYaGNDYwTLi19wqIAiROr8sXVum9A/rtiH5H0boUcTw== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.15" - "@babel/helper-plugin-utils" "^7.24.0" - -"@babel/plugin-transform-export-namespace-from@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.1.tgz#f033541fc036e3efb2dcb58eedafd4f6b8078acd" - integrity sha512-Ft38m/KFOyzKw2UaJFkWG9QnHPG/Q/2SkOrRk4pNBPg5IPZ+dOxcmkK5IyuBcxiNPyyYowPGUReyBvrvZs7IlQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-transform-for-of@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.1.tgz#67448446b67ab6c091360ce3717e7d3a59e202fd" - integrity sha512-OxBdcnF04bpdQdR3i4giHZNZQn7cm8RQKcSwA17wAAqEELo1ZOwp5FFgeptWUQXFyT9kwHo10aqqauYkRZPCAg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - -"@babel/plugin-transform-function-name@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.1.tgz#8cba6f7730626cc4dfe4ca2fa516215a0592b361" - integrity sha512-BXmDZpPlh7jwicKArQASrj8n22/w6iymRnvHYYd2zO30DbE277JO20/7yXJT3QxDPtiQiOxQBbZH4TpivNXIxA== +"@babel/plugin-transform-computed-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" + integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== dependencies: - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/template" "^7.25.9" -"@babel/plugin-transform-json-strings@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.1.tgz#08e6369b62ab3e8a7b61089151b161180c8299f7" - integrity sha512-U7RMFmRvoasscrIFy5xA4gIp8iWnWubnKkKuUGJjsuOH7GfbMkB+XZzeslx2kLdEGdOJDamEmCqOks6e8nv8DQ== +"@babel/plugin-transform-destructuring@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" + integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-literals@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.1.tgz#0a1982297af83e6b3c94972686067df588c5c096" - integrity sha512-zn9pwz8U7nCqOYIiBaOxoQOtYmMODXTJnkxG4AtX8fPmnCRYWBOHD0qcpwS9e2VDSp1zNJYpdnFMIKb8jmwu6g== +"@babel/plugin-transform-dotall-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" + integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-logical-assignment-operators@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.1.tgz#719d8aded1aa94b8fb34e3a785ae8518e24cfa40" - integrity sha512-OhN6J4Bpz+hIBqItTeWJujDOfNP+unqv/NJgyhlpSqgBTPm37KkMmZV6SYcOj+pnDbdcl1qRGV/ZiIjX9Iy34w== +"@babel/plugin-transform-duplicate-keys@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" + integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-member-expression-literals@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.1.tgz#896d23601c92f437af8b01371ad34beb75df4489" - integrity sha512-4ojai0KysTWXzHseJKa1XPNXKRbuUrhkOPY4rEGeR+7ChlJVKxFa3H3Bz+7tWaGKgJAXUWKOGmltN+u9B3+CVg== +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" + integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-amd@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.1.tgz#b6d829ed15258536977e9c7cc6437814871ffa39" - integrity sha512-lAxNHi4HVtjnHd5Rxg3D5t99Xm6H7b04hUS7EHIXcUl2EV4yl1gWdqZrNzXnSrHveL9qMdbODlLF55mvgjAfaQ== +"@babel/plugin-transform-dynamic-import@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" + integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@7.24.1", "@babel/plugin-transform-modules-commonjs@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz#e71ba1d0d69e049a22bf90b3867e263823d3f1b9" - integrity sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw== +"@babel/plugin-transform-exponentiation-operator@^7.25.9": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-systemjs@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.1.tgz#2b9625a3d4e445babac9788daec39094e6b11e3e" - integrity sha512-mqQ3Zh9vFO1Tpmlt8QPnbwGHzNz3lpNEMxQb1kAemn/erstyqw1r9KeOlOfo3y6xAnFEcOv2tSyrXfmMk+/YZA== +"@babel/plugin-transform-export-namespace-from@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" + integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== dependencies: - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-umd@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.1.tgz#69220c66653a19cf2c0872b9c762b9a48b8bebef" - integrity sha512-tuA3lpPj+5ITfcCluy6nWonSL7RvaG0AOTeAuvXqEKS34lnLzXpDb0dcP6K8jD0zWZFNDVly90AGFJPnm4fOYg== +"@babel/plugin-transform-for-of@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" + integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz" - integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== +"@babel/plugin-transform-function-name@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" + integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-new-target@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.1.tgz#29c59988fa3d0157de1c871a28cd83096363cc34" - integrity sha512-/rurytBM34hYy0HKZQyA0nHbQgQNFm4Q/BOc9Hflxi2X3twRof7NaE5W46j4kQitm7SvACVRXsa6N/tSZxvPug== +"@babel/plugin-transform-json-strings@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" + integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.1.tgz#0cd494bb97cb07d428bd651632cb9d4140513988" - integrity sha512-iQ+caew8wRrhCikO5DrUYx0mrmdhkaELgFa+7baMcVuhxIkN7oxt06CZ51D65ugIb1UWRQ8oQe+HXAVM6qHFjw== +"@babel/plugin-transform-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" + integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-numeric-separator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.1.tgz#5bc019ce5b3435c1cadf37215e55e433d674d4e8" - integrity sha512-7GAsGlK4cNL2OExJH1DzmDeKnRv/LXq0eLUSvudrehVA5Rgg4bIrqEUW29FbKMBRT0ztSqisv7kjP+XIC4ZMNw== +"@babel/plugin-transform-logical-assignment-operators@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" + integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-rest-spread@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.5.tgz#f91bbcb092ff957c54b4091c86bda8372f0b10ef" - integrity sha512-7EauQHszLGM3ay7a161tTQH7fj+3vVM/gThlz5HpFtnygTxjrlvoeq7MPVA1Vy9Q555OB8SnAOsMkLShNkkrHA== +"@babel/plugin-transform-member-expression-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" + integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== dependencies: - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.5" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.24.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-super@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.1.tgz#e71d6ab13483cca89ed95a474f542bbfc20a0520" - integrity sha512-oKJqR3TeI5hSLRxudMjFQ9re9fBVUU0GICqM3J1mi8MqlhVr6hC/ZN4ttAyMuQR6EZZIY6h/exe5swqGNNIkWQ== +"@babel/plugin-transform-modules-amd@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" + integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-replace-supers" "^7.24.1" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-optional-catch-binding@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.1.tgz#92a3d0efe847ba722f1a4508669b23134669e2da" - integrity sha512-oBTH7oURV4Y+3EUrf6cWn1OHio3qG/PVwO5J03iSJmBg6m2EhKjkAu/xuaXaYwWW9miYtvbWv4LNf0AmR43LUA== +"@babel/plugin-transform-modules-commonjs@7.26.3", "@babel/plugin-transform-modules-commonjs@^7.25.9": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-optional-chaining@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.5.tgz#a6334bebd7f9dd3df37447880d0bd64b778e600f" - integrity sha512-xWCkmwKT+ihmA6l7SSTpk8e4qQl/274iNbSKRRS8mpqFR32ksy36+a+LWY8OXCCEefF8WFlnOHVsaDI2231wBg== +"@babel/plugin-transform-modules-systemjs@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" + integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== dependencies: - "@babel/helper-plugin-utils" "^7.24.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-parameters@^7.24.1", "@babel/plugin-transform-parameters@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.5.tgz#5c3b23f3a6b8fed090f9b98f2926896d3153cc62" - integrity sha512-9Co00MqZ2aoky+4j2jhofErthm6QVLKbpQrvz20c3CH9KQCLHyNB+t2ya4/UrRpQGR+Wrwjg9foopoeSdnHOkA== +"@babel/plugin-transform-modules-umd@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" + integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== dependencies: - "@babel/helper-plugin-utils" "^7.24.5" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-methods@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.1.tgz#a0faa1ae87eff077e1e47a5ec81c3aef383dc15a" - integrity sha512-tGvisebwBO5em4PaYNqt4fkw56K2VALsAbAakY0FjTYqJp7gfdrgr7YX76Or8/cpik0W6+tj3rZ0uHU9Oil4tw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" + integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.1" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-property-in-object@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.5.tgz#f5d1fcad36e30c960134cb479f1ca98a5b06eda5" - integrity sha512-JM4MHZqnWR04jPMujQDTBVRnqxpLLpx2tkn7iPn+Hmsc0Gnb79yvRWOkvqFOx3Z7P7VxiRIR22c4eGSNj87OBQ== +"@babel/plugin-transform-new-target@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" + integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.24.5" - "@babel/helper-plugin-utils" "^7.24.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-property-literals@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.1.tgz#d6a9aeab96f03749f4eebeb0b6ea8e90ec958825" - integrity sha512-LetvD7CrHmEx0G442gOomRr66d7q8HzzGGr4PMHGr+5YIm6++Yke+jxj246rpvsbyhJwCLxcTn6zW1P1BSenqA== +"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": + version "7.26.6" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" + integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-transform-regenerator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.1.tgz#625b7545bae52363bdc1fbbdc7252b5046409c8c" - integrity sha512-sJwZBCzIBE4t+5Q4IGLaaun5ExVMRY0lYwos/jNecjMrVCygCdph3IKv0tkP5Fc87e/1+bebAmEAGBfnRD+cnw== +"@babel/plugin-transform-numeric-separator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" + integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - regenerator-transform "^0.15.2" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-reserved-words@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.1.tgz#8de729f5ecbaaf5cf83b67de13bad38a21be57c1" - integrity sha512-JAclqStUfIwKN15HrsQADFgeZt+wexNQ0uLhuqvqAUFoqPMjEcFCYZBhq0LUdz6dZK/mD+rErhW71fbx8RYElg== +"@babel/plugin-transform-object-rest-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" + integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" -"@babel/plugin-transform-shorthand-properties@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.1.tgz#ba9a09144cf55d35ec6b93a32253becad8ee5b55" - integrity sha512-LyjVB1nsJ6gTTUKRjRWx9C1s9hE7dLfP/knKdrfeH9UPtAGjYGgxIbFfx7xyLIEWs7Xe1Gnf8EWiUqfjLhInZA== +"@babel/plugin-transform-object-super@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" + integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" -"@babel/plugin-transform-spread@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.1.tgz#a1acf9152cbf690e4da0ba10790b3ac7d2b2b391" - integrity sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g== +"@babel/plugin-transform-optional-catch-binding@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" + integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-sticky-regex@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.1.tgz#f03e672912c6e203ed8d6e0271d9c2113dc031b9" - integrity sha512-9v0f1bRXgPVcPrngOQvLXeGNNVLc8UjMVfebo9ka0WF3/7+aVUHmaJVT3sa0XCzEFioPfPHZiOcYG9qOsH63cw== +"@babel/plugin-transform-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" + integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.1.tgz#15e2166873a30d8617e3e2ccadb86643d327aab7" - integrity sha512-WRkhROsNzriarqECASCNu/nojeXCDTE/F2HmRgOzi7NGvyfYGq1NEjKBK3ckLfRgGc6/lPAqP0vDOSw3YtG34g== +"@babel/plugin-transform-parameters@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" + integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.5.tgz#703cace5ef74155fb5eecab63cbfc39bdd25fe12" - integrity sha512-UTGnhYVZtTAjdwOTzT+sCyXmTn8AhaxOS/MjG9REclZ6ULHWF9KoCZur0HSGU7hk8PdBFKKbYe6+gqdXWz84Jg== +"@babel/plugin-transform-private-methods@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" + integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== dependencies: - "@babel/helper-plugin-utils" "^7.24.5" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typescript@^7.24.1": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.5.tgz#bcba979e462120dc06a75bd34c473a04781931b8" - integrity sha512-E0VWu/hk83BIFUWnsKZ4D81KXjN5L3MobvevOHErASk9IPwKHOkTgvqzvNo1yP/ePJWqqK2SpUR5z+KQbl6NVw== +"@babel/plugin-transform-private-property-in-object@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" + integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.24.5" - "@babel/helper-plugin-utils" "^7.24.5" - "@babel/plugin-syntax-typescript" "^7.24.1" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-escapes@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.1.tgz#fb3fa16676549ac7c7449db9b342614985c2a3a4" - integrity sha512-RlkVIcWT4TLI96zM660S877E7beKlQw7Ig+wqkKBiWfj0zH5Q4h50q6er4wzZKRNSYpfo6ILJ+hrJAGSX2qcNw== +"@babel/plugin-transform-property-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" + integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-property-regex@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.1.tgz#56704fd4d99da81e5e9f0c0c93cabd91dbc4889e" - integrity sha512-Ss4VvlfYV5huWApFsF8/Sq0oXnGO+jB+rijFEFugTd3cwSObUSnUi88djgR5528Csl0uKlrI331kRqe56Ov2Ng== +"@babel/plugin-transform-regenerator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" + integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-plugin-utils" "^7.25.9" + regenerator-transform "^0.15.2" -"@babel/plugin-transform-unicode-regex@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.1.tgz#57c3c191d68f998ac46b708380c1ce4d13536385" - integrity sha512-2A/94wgZgxfTsiLaQ2E36XAOdcZmGAaEEgVmxQWwZXWkGhvoHbaqXcKnU8zny4ycpu3vNqg0L/PcCiYtHtA13g== +"@babel/plugin-transform-regexp-modifiers@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" + integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.24.0" - -"@babel/plugin-transform-unicode-sets-regex@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.1.tgz#c1ea175b02afcffc9cf57a9c4658326625165b7f" - integrity sha512-fqj4WuzzS+ukpgerpAoOnMfQXwUHFxXUZUE84oL2Kao2N8uSlvcpnAidKASgsNgzZHBsHWvcm8s9FPWUhAb8fA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.24.0" - -"@babel/preset-env@7.24.4": - version "7.24.4" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.4.tgz#46dbbcd608771373b88f956ffb67d471dce0d23b" - integrity sha512-7Kl6cSmYkak0FK/FXjSEnLJ1N9T/WA2RkMhu17gZ/dsxKJUuTYNIylahPTzqpLyJN4WhDif8X0XK1R8Wsguo/A== - dependencies: - "@babel/compat-data" "^7.24.4" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-validator-option" "^7.23.5" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.24.4" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.24.1" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.24.1" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.24.1" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-reserved-words@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" + integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-shorthand-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" + integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" + integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + +"@babel/plugin-transform-sticky-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" + integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-template-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" + integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-typeof-symbol@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" + integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-typescript@^7.25.9": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.5.tgz#6d9b48e8ee40a45a3ed12ebc013449fdf261714c" + integrity sha512-GJhPO0y8SD5EYVCy2Zr+9dSZcEgaSmq5BLR0Oc25TOEhC+ba49vUAGZFjy8v79z9E1mdldq4x9d1xgh4L1d5dQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-syntax-typescript" "^7.25.9" + +"@babel/plugin-transform-unicode-escapes@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" + integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-property-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" + integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" + integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-sets-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" + integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/preset-env@7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" + integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== + dependencies: + "@babel/compat-data" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" + "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.24.1" - "@babel/plugin-syntax-import-attributes" "^7.24.1" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-syntax-import-assertions" "^7.26.0" + "@babel/plugin-syntax-import-attributes" "^7.26.0" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.24.1" - "@babel/plugin-transform-async-generator-functions" "^7.24.3" - "@babel/plugin-transform-async-to-generator" "^7.24.1" - "@babel/plugin-transform-block-scoped-functions" "^7.24.1" - "@babel/plugin-transform-block-scoping" "^7.24.4" - "@babel/plugin-transform-class-properties" "^7.24.1" - "@babel/plugin-transform-class-static-block" "^7.24.4" - "@babel/plugin-transform-classes" "^7.24.1" - "@babel/plugin-transform-computed-properties" "^7.24.1" - "@babel/plugin-transform-destructuring" "^7.24.1" - "@babel/plugin-transform-dotall-regex" "^7.24.1" - "@babel/plugin-transform-duplicate-keys" "^7.24.1" - "@babel/plugin-transform-dynamic-import" "^7.24.1" - "@babel/plugin-transform-exponentiation-operator" "^7.24.1" - "@babel/plugin-transform-export-namespace-from" "^7.24.1" - "@babel/plugin-transform-for-of" "^7.24.1" - "@babel/plugin-transform-function-name" "^7.24.1" - "@babel/plugin-transform-json-strings" "^7.24.1" - "@babel/plugin-transform-literals" "^7.24.1" - "@babel/plugin-transform-logical-assignment-operators" "^7.24.1" - "@babel/plugin-transform-member-expression-literals" "^7.24.1" - "@babel/plugin-transform-modules-amd" "^7.24.1" - "@babel/plugin-transform-modules-commonjs" "^7.24.1" - "@babel/plugin-transform-modules-systemjs" "^7.24.1" - "@babel/plugin-transform-modules-umd" "^7.24.1" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" - "@babel/plugin-transform-new-target" "^7.24.1" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.24.1" - "@babel/plugin-transform-numeric-separator" "^7.24.1" - "@babel/plugin-transform-object-rest-spread" "^7.24.1" - "@babel/plugin-transform-object-super" "^7.24.1" - "@babel/plugin-transform-optional-catch-binding" "^7.24.1" - "@babel/plugin-transform-optional-chaining" "^7.24.1" - "@babel/plugin-transform-parameters" "^7.24.1" - "@babel/plugin-transform-private-methods" "^7.24.1" - "@babel/plugin-transform-private-property-in-object" "^7.24.1" - "@babel/plugin-transform-property-literals" "^7.24.1" - "@babel/plugin-transform-regenerator" "^7.24.1" - "@babel/plugin-transform-reserved-words" "^7.24.1" - "@babel/plugin-transform-shorthand-properties" "^7.24.1" - "@babel/plugin-transform-spread" "^7.24.1" - "@babel/plugin-transform-sticky-regex" "^7.24.1" - "@babel/plugin-transform-template-literals" "^7.24.1" - "@babel/plugin-transform-typeof-symbol" "^7.24.1" - "@babel/plugin-transform-unicode-escapes" "^7.24.1" - "@babel/plugin-transform-unicode-property-regex" "^7.24.1" - "@babel/plugin-transform-unicode-regex" "^7.24.1" - "@babel/plugin-transform-unicode-sets-regex" "^7.24.1" + "@babel/plugin-transform-arrow-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-to-generator" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoping" "^7.25.9" + "@babel/plugin-transform-class-properties" "^7.25.9" + "@babel/plugin-transform-class-static-block" "^7.26.0" + "@babel/plugin-transform-classes" "^7.25.9" + "@babel/plugin-transform-computed-properties" "^7.25.9" + "@babel/plugin-transform-destructuring" "^7.25.9" + "@babel/plugin-transform-dotall-regex" "^7.25.9" + "@babel/plugin-transform-duplicate-keys" "^7.25.9" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-dynamic-import" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-export-namespace-from" "^7.25.9" + "@babel/plugin-transform-for-of" "^7.25.9" + "@babel/plugin-transform-function-name" "^7.25.9" + "@babel/plugin-transform-json-strings" "^7.25.9" + "@babel/plugin-transform-literals" "^7.25.9" + "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" + "@babel/plugin-transform-member-expression-literals" "^7.25.9" + "@babel/plugin-transform-modules-amd" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-systemjs" "^7.25.9" + "@babel/plugin-transform-modules-umd" "^7.25.9" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-new-target" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-numeric-separator" "^7.25.9" + "@babel/plugin-transform-object-rest-spread" "^7.25.9" + "@babel/plugin-transform-object-super" "^7.25.9" + "@babel/plugin-transform-optional-catch-binding" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" + "@babel/plugin-transform-private-methods" "^7.25.9" + "@babel/plugin-transform-private-property-in-object" "^7.25.9" + "@babel/plugin-transform-property-literals" "^7.25.9" + "@babel/plugin-transform-regenerator" "^7.25.9" + "@babel/plugin-transform-regexp-modifiers" "^7.26.0" + "@babel/plugin-transform-reserved-words" "^7.25.9" + "@babel/plugin-transform-shorthand-properties" "^7.25.9" + "@babel/plugin-transform-spread" "^7.25.9" + "@babel/plugin-transform-sticky-regex" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-unicode-escapes" "^7.25.9" + "@babel/plugin-transform-unicode-property-regex" "^7.25.9" + "@babel/plugin-transform-unicode-regex" "^7.25.9" + "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" "@babel/preset-modules" "0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.4" + babel-plugin-polyfill-corejs3 "^0.10.6" babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.31.0" + core-js-compat "^3.38.1" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -1220,21 +1168,21 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-typescript@7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.1.tgz#89bdf13a3149a17b3b2a2c9c62547f06db8845ec" - integrity sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ== +"@babel/preset-typescript@7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz#4a570f1b8d104a242d923957ffa1eaff142a106d" + integrity sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg== dependencies: - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-validator-option" "^7.23.5" - "@babel/plugin-syntax-jsx" "^7.24.1" - "@babel/plugin-transform-modules-commonjs" "^7.24.1" - "@babel/plugin-transform-typescript" "^7.24.1" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-syntax-jsx" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-typescript" "^7.25.9" -"@babel/register@7.23.7": - version "7.23.7" - resolved "https://registry.npmjs.org/@babel/register/-/register-7.23.7.tgz#485a5e7951939d21304cae4af1719fdb887bc038" - integrity sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ== +"@babel/register@7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/register/-/register-7.25.9.tgz#1c465acf7dc983d70ccc318eb5b887ecb04f021b" + integrity sha512-8D43jXtGsYmEeDvm4MWHYUpWf8iiXgWYx3fW7E7Wb7Oe6FWqJPl5K6TuFW0dOwNZzEE5rjlaSJYH9JjrUKJszA== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -1242,18 +1190,6 @@ pirates "^4.0.6" source-map-support "^0.5.16" -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - -"@babel/runtime@^7.20.1": - version "7.20.13" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz" - integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== - dependencies: - regenerator-runtime "^0.13.11" - "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz" @@ -1270,7 +1206,7 @@ "@babel/parser" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/template@^7.22.15", "@babel/template@^7.24.0": +"@babel/template@^7.22.15": version "7.24.0" resolved "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== @@ -1279,7 +1215,16 @@ "@babel/parser" "^7.24.0" "@babel/types" "^7.24.0" -"@babel/traverse@^7.15.4", "@babel/traverse@^7.24.1", "@babel/traverse@^7.7.2": +"@babel/template@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": version "7.24.1" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz#d65c36ac9dd17282175d1e4a3c49d5b7988f530c" integrity sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ== @@ -1295,19 +1240,16 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.5.tgz#972aa0bc45f16983bf64aa1f877b2dd0eea7e6f8" - integrity sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA== +"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.5.tgz#6d0be3e772ff786456c1a37538208286f6e79021" + integrity sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ== dependencies: - "@babel/code-frame" "^7.24.2" - "@babel/generator" "^7.24.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.24.5" - "@babel/parser" "^7.24.5" - "@babel/types" "^7.24.5" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.5" + "@babel/parser" "^7.26.5" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.5" debug "^4.3.1" globals "^11.1.0" @@ -1337,15 +1279,6 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" -"@babel/types@^7.22.15", "@babel/types@^7.24.5": - version "7.24.5" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" - integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== - dependencies: - "@babel/helper-string-parser" "^7.24.1" - "@babel/helper-validator-identifier" "^7.24.5" - to-fast-properties "^2.0.0" - "@babel/types@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz" @@ -1364,16 +1297,24 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@changesets/apply-release-plan@^6.1.4": - version "6.1.4" - resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz" - integrity sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew== +"@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz#7a1e1c01d28e26d1fe7f8ec9567b3b92b9d07747" + integrity sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/config" "^2.3.1" - "@changesets/get-version-range-type" "^0.3.2" - "@changesets/git" "^2.0.0" - "@changesets/types" "^5.2.1" + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@changesets/apply-release-plan@^7.0.7": + version "7.0.7" + resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.7.tgz#cabeaed77de07c6bd9878a9bc5ffd3ea7db7f7ff" + integrity sha512-qnPOcmmmnD0MfMg9DjU1/onORFyRpDXkMMl2IJg9mECY6RnxL3wN0TCCc92b2sXt1jt8DgjAUUsZYGUGTdYIXA== + dependencies: + "@changesets/config" "^3.0.5" + "@changesets/get-version-range-type" "^0.4.0" + "@changesets/git" "^3.0.2" + "@changesets/should-skip-package" "^0.1.1" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" detect-indent "^6.0.0" fs-extra "^7.0.1" @@ -1383,105 +1324,99 @@ resolve-from "^5.0.0" semver "^7.5.3" -"@changesets/assemble-release-plan@^5.2.4": - version "5.2.4" - resolved "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz" - integrity sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg== +"@changesets/assemble-release-plan@^6.0.5": + version "6.0.5" + resolved "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.5.tgz#d987b01c2d91c8b2f81eedd2df56ba355e4ce536" + integrity sha512-IgvBWLNKZd6k4t72MBTBK3nkygi0j3t3zdC1zrfusYo0KpdsvnDjrMM9vPnTCLCMlfNs55jRL4gIMybxa64FCQ== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.6" - "@changesets/types" "^5.2.1" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.2" + "@changesets/should-skip-package" "^0.1.1" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" semver "^7.5.3" -"@changesets/changelog-git@^0.1.14": - version "0.1.14" - resolved "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz" - integrity sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA== +"@changesets/changelog-git@^0.2.0": + version "0.2.0" + resolved "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.0.tgz#1f3de11becafff5a38ebe295038a602403c93a86" + integrity sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ== dependencies: - "@changesets/types" "^5.2.1" + "@changesets/types" "^6.0.0" -"@changesets/changelog-github@0.4.8": - version "0.4.8" - resolved "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz" - integrity sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw== +"@changesets/changelog-github@0.5.0": + version "0.5.0" + resolved "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz#ae96e5029209f7386527b3821d9c988b1ab16662" + integrity sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA== dependencies: - "@changesets/get-github-info" "^0.5.2" - "@changesets/types" "^5.2.1" + "@changesets/get-github-info" "^0.6.0" + "@changesets/types" "^6.0.0" dotenv "^8.1.0" -"@changesets/cli@2.26.2": - version "2.26.2" - resolved "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz" - integrity sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig== - dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/apply-release-plan" "^6.1.4" - "@changesets/assemble-release-plan" "^5.2.4" - "@changesets/changelog-git" "^0.1.14" - "@changesets/config" "^2.3.1" - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.6" - "@changesets/get-release-plan" "^3.0.17" - "@changesets/git" "^2.0.0" - "@changesets/logger" "^0.0.5" - "@changesets/pre" "^1.0.14" - "@changesets/read" "^0.5.9" - "@changesets/types" "^5.2.1" - "@changesets/write" "^0.2.3" +"@changesets/cli@2.27.11": + version "2.27.11" + resolved "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.11.tgz#1d510044b350a7c78a8b55a0591637d7ad224469" + integrity sha512-1QislpE+nvJgSZZo9+Lj3Lno5pKBgN46dAV8IVxKJy9wX8AOrs9nn5pYVZuDpoxWJJCALmbfOsHkyxujgetQSg== + dependencies: + "@changesets/apply-release-plan" "^7.0.7" + "@changesets/assemble-release-plan" "^6.0.5" + "@changesets/changelog-git" "^0.2.0" + "@changesets/config" "^3.0.5" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.2" + "@changesets/get-release-plan" "^4.0.6" + "@changesets/git" "^3.0.2" + "@changesets/logger" "^0.1.1" + "@changesets/pre" "^2.0.1" + "@changesets/read" "^0.6.2" + "@changesets/should-skip-package" "^0.1.1" + "@changesets/types" "^6.0.0" + "@changesets/write" "^0.3.2" "@manypkg/get-packages" "^1.1.3" - "@types/is-ci" "^3.0.0" - "@types/semver" "^7.5.0" ansi-colors "^4.1.3" - chalk "^2.1.0" - enquirer "^2.3.0" + ci-info "^3.7.0" + enquirer "^2.4.1" external-editor "^3.1.0" fs-extra "^7.0.1" - human-id "^1.0.2" - is-ci "^3.0.1" - meow "^6.0.0" - outdent "^0.5.0" + mri "^1.2.0" p-limit "^2.2.0" - preferred-pm "^3.0.0" + package-manager-detector "^0.2.0" + picocolors "^1.1.0" resolve-from "^5.0.0" semver "^7.5.3" - spawndamnit "^2.0.0" + spawndamnit "^3.0.1" term-size "^2.1.0" - tty-table "^4.1.5" -"@changesets/config@^2.3.1": - version "2.3.1" - resolved "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz" - integrity sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w== +"@changesets/config@^3.0.5": + version "3.0.5" + resolved "https://registry.npmjs.org/@changesets/config/-/config-3.0.5.tgz#cb59e9f338a4b35d3266af8a32799cb940d54ee0" + integrity sha512-QyXLSSd10GquX7hY0Mt4yQFMEeqnO5z/XLpbIr4PAkNNoQNKwDyiSrx4yd749WddusH1v3OSiA0NRAYmH/APpQ== dependencies: - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.6" - "@changesets/logger" "^0.0.5" - "@changesets/types" "^5.2.1" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.2" + "@changesets/logger" "^0.1.1" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" fs-extra "^7.0.1" - micromatch "^4.0.2" + micromatch "^4.0.8" -"@changesets/errors@^0.1.4": - version "0.1.4" - resolved "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz" - integrity sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q== +"@changesets/errors@^0.2.0": + version "0.2.0" + resolved "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz#3c545e802b0f053389cadcf0ed54e5636ff9026a" + integrity sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow== dependencies: extendable-error "^0.1.5" -"@changesets/get-dependents-graph@^1.3.6": - version "1.3.6" - resolved "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz" - integrity sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q== +"@changesets/get-dependents-graph@^2.1.2": + version "2.1.2" + resolved "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.1.2.tgz#108304652d4bf22c9fee9f1d31dcf9908c24ca51" + integrity sha512-sgcHRkiBY9i4zWYBwlVyAjEM9sAzs4wYVwJUdnbDLnVG3QwAaia1Mk5P8M7kraTOZN+vBET7n8KyB0YXCbFRLQ== dependencies: - "@changesets/types" "^5.2.1" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" - chalk "^2.1.0" - fs-extra "^7.0.1" + picocolors "^1.1.0" semver "^7.5.3" -"@changesets/get-github-info@0.5.2", "@changesets/get-github-info@^0.5.2": +"@changesets/get-github-info@0.5.2": version "0.5.2" resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz" integrity sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg== @@ -1489,76 +1424,87 @@ dataloader "^1.4.0" node-fetch "^2.5.0" -"@changesets/get-release-plan@^3.0.17": - version "3.0.17" - resolved "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz" - integrity sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw== - dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/assemble-release-plan" "^5.2.4" - "@changesets/config" "^2.3.1" - "@changesets/pre" "^1.0.14" - "@changesets/read" "^0.5.9" - "@changesets/types" "^5.2.1" +"@changesets/get-github-info@^0.6.0": + version "0.6.0" + resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz#faba66a20a3a5a0cbabea28efd43c9ede7429f11" + integrity sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA== + dependencies: + dataloader "^1.4.0" + node-fetch "^2.5.0" + +"@changesets/get-release-plan@^4.0.6": + version "4.0.6" + resolved "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.6.tgz#40d70c2524be51a70b7e1a778826854bb6c8562a" + integrity sha512-FHRwBkY7Eili04Y5YMOZb0ezQzKikTka4wL753vfUA5COSebt7KThqiuCN9BewE4/qFGgF/5t3AuzXx1/UAY4w== + dependencies: + "@changesets/assemble-release-plan" "^6.0.5" + "@changesets/config" "^3.0.5" + "@changesets/pre" "^2.0.1" + "@changesets/read" "^0.6.2" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" -"@changesets/get-version-range-type@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz" - integrity sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg== +"@changesets/get-version-range-type@^0.4.0": + version "0.4.0" + resolved "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz#429a90410eefef4368502c41c63413e291740bf5" + integrity sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ== -"@changesets/git@^2.0.0": - version "2.0.0" - resolved "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz" - integrity sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A== +"@changesets/git@^3.0.2": + version "3.0.2" + resolved "https://registry.npmjs.org/@changesets/git/-/git-3.0.2.tgz#669c700049dc3b8ba53f46de45f5c4b1e6ddea3b" + integrity sha512-r1/Kju9Y8OxRRdvna+nxpQIsMsRQn9dhhAZt94FLDeu0Hij2hnOozW8iqnHBgvu+KdnJppCveQwK4odwfw/aWQ== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/errors" "^0.1.4" - "@changesets/types" "^5.2.1" + "@changesets/errors" "^0.2.0" "@manypkg/get-packages" "^1.1.3" is-subdir "^1.1.1" - micromatch "^4.0.2" - spawndamnit "^2.0.0" + micromatch "^4.0.8" + spawndamnit "^3.0.1" -"@changesets/logger@^0.0.5": - version "0.0.5" - resolved "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz" - integrity sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw== +"@changesets/logger@^0.1.1": + version "0.1.1" + resolved "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.1.tgz#9926ac4dc8fb00472fe1711603b6b4755d64b435" + integrity sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg== dependencies: - chalk "^2.1.0" + picocolors "^1.1.0" -"@changesets/parse@^0.3.16": - version "0.3.16" - resolved "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz" - integrity sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg== +"@changesets/parse@^0.4.0": + version "0.4.0" + resolved "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.0.tgz#5cabbd9844b3b213cb83f5edb5768454c70dd2b4" + integrity sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw== dependencies: - "@changesets/types" "^5.2.1" + "@changesets/types" "^6.0.0" js-yaml "^3.13.1" -"@changesets/pre@^1.0.14": - version "1.0.14" - resolved "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz" - integrity sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ== +"@changesets/pre@^2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.1.tgz#3ed60f9d218b3b81d3074d72139582da11a94d5f" + integrity sha512-vvBJ/If4jKM4tPz9JdY2kGOgWmCowUYOi5Ycv8dyLnEE8FgpYYUo1mgJZxcdtGGP3aG8rAQulGLyyXGSLkIMTQ== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/errors" "^0.1.4" - "@changesets/types" "^5.2.1" + "@changesets/errors" "^0.2.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" fs-extra "^7.0.1" -"@changesets/read@^0.5.9": - version "0.5.9" - resolved "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz" - integrity sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ== +"@changesets/read@^0.6.2": + version "0.6.2" + resolved "https://registry.npmjs.org/@changesets/read/-/read-0.6.2.tgz#816cf75dd22a70e75ac279474e44be52fb3fb91b" + integrity sha512-wjfQpJvryY3zD61p8jR87mJdyx2FIhEcdXhKUqkja87toMrP/3jtg/Yg29upN+N4Ckf525/uvV7a4tzBlpk6gg== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/git" "^2.0.0" - "@changesets/logger" "^0.0.5" - "@changesets/parse" "^0.3.16" - "@changesets/types" "^5.2.1" - chalk "^2.1.0" + "@changesets/git" "^3.0.2" + "@changesets/logger" "^0.1.1" + "@changesets/parse" "^0.4.0" + "@changesets/types" "^6.0.0" fs-extra "^7.0.1" p-filter "^2.1.0" + picocolors "^1.1.0" + +"@changesets/should-skip-package@^0.1.1": + version "0.1.1" + resolved "https://registry.npmjs.org/@changesets/should-skip-package/-/should-skip-package-0.1.1.tgz#76218ef4ce7691351a6dffdb356e8893267b0b3a" + integrity sha512-H9LjLbF6mMHLtJIc/eHR9Na+MifJ3VxtgP/Y+XLn4BF7tDTEN1HNYtH6QMcjP1uxp9sjaFYmW8xqloaCi/ckTg== + dependencies: + "@changesets/types" "^6.0.0" + "@manypkg/get-packages" "^1.1.3" "@changesets/types@3.3.0": version "3.3.0" @@ -1570,18 +1516,17 @@ resolved "https://registry.npmjs.org/@changesets/types/-/types-4.0.1.tgz" integrity sha512-zVfv752D8K2tjyFmxU/vnntQ+dPu+9NupOSguA/2Zuym4tVxRh0ylArgKZ1bOAi2eXfGlZMxJU/kj7uCSI15RQ== -"@changesets/types@^5.2.1": - version "5.2.1" - resolved "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz" - integrity sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg== +"@changesets/types@^6.0.0": + version "6.0.0" + resolved "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz#e46abda9890610dd1fbe1617730173d2267544bd" + integrity sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ== -"@changesets/write@^0.2.3": - version "0.2.3" - resolved "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz" - integrity sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw== +"@changesets/write@^0.3.2": + version "0.3.2" + resolved "https://registry.npmjs.org/@changesets/write/-/write-0.3.2.tgz#bee64e4ccdff480872df5d1e38f2b913cb940116" + integrity sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw== dependencies: - "@babel/runtime" "^7.20.1" - "@changesets/types" "^5.2.1" + "@changesets/types" "^6.0.0" fs-extra "^7.0.1" human-id "^1.0.2" prettier "^2.7.1" @@ -1639,6 +1584,11 @@ resolved "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== +"@eslint/js@8.57.1": + version "8.57.1" + resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2" + integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== + "@gar/promisify@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz" @@ -1758,12 +1708,21 @@ debug "^4.3.1" minimatch "^3.0.5" +"@humanwhocodes/config-array@^0.13.0": + version "0.13.0" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" + integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== + dependencies: + "@humanwhocodes/object-schema" "^2.0.3" + debug "^4.3.1" + minimatch "^3.0.5" + "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2": +"@humanwhocodes/object-schema@^2.0.2", "@humanwhocodes/object-schema@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== @@ -3032,6 +2991,11 @@ estree-walker "^2.0.1" picomatch "^2.2.2" +"@rtsao/scc@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" + integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== + "@rushstack/node-core-library@3.36.0": version "3.36.0" resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.0.tgz" @@ -3156,10 +3120,10 @@ resolved "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz" integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== -"@socket.io/base64-arraybuffer@~1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz" - integrity sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ== +"@socket.io/component-emitter@~3.1.0": + version "3.1.2" + resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz#821f8442f4175d8f0467b9daf26e3a18e2d02af2" + integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== "@szmarczak/http-timer@^4.0.5": version "4.0.6" @@ -3250,10 +3214,10 @@ resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz" integrity sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ== -"@types/chai@4.3.14": - version "4.3.14" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" - integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== +"@types/chai@4.3.20": + version "4.3.20" + resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz#cb291577ed342ca92600430841a00329ba05cecc" + integrity sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ== "@types/child-process-promise@2.2.6": version "2.2.6" @@ -3262,15 +3226,10 @@ dependencies: "@types/node" "*" -"@types/clone@2.1.1": - version "2.1.1" - resolved "https://registry.npmjs.org/@types/clone/-/clone-2.1.1.tgz" - integrity sha512-BZIU34bSYye0j/BFcPraiDZ5ka6MJADjcDVELGf7glr9K+iE8NYVjFslJFVWzskSxkLLyCrSPScE82/UUoBSvg== - -"@types/component-emitter@^1.2.10": - version "1.2.10" - resolved "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz" - integrity sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== +"@types/clone@2.1.4": + version "2.1.4" + resolved "https://registry.npmjs.org/@types/clone/-/clone-2.1.4.tgz#9680f886c935dcf596273f1218abb71efb01531a" + integrity sha512-NKRWaEGaVGVLnGLB2GazvDaZnyweW9FJLLFL5LhywGJB3aqGMT9R/EUoJoSRP4nzofYnZysuDmrEJtJdAqUOtQ== "@types/connect@*": version "3.4.35" @@ -3304,10 +3263,10 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.4" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz" - integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== dependencies: "@types/eslint" "*" "@types/estree" "*" @@ -3330,10 +3289,10 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/expect@^1.20.4": version "1.20.4" @@ -3394,13 +3353,6 @@ "@types/through" "*" rxjs "^7.2.0" -"@types/is-ci@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.0.tgz" - integrity sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ== - dependencies: - ci-info "^3.1.0" - "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.3" resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz" @@ -3430,7 +3382,7 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== -"@types/json-schema@^7.0.12": +"@types/json-schema@^7.0.12", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -3514,6 +3466,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@18.19.71": + version "18.19.71" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.71.tgz#96d4f0a0be735ead6c8998c62a4b2c0012a5d09a" + integrity sha512-evXpcgtZm8FY4jqBSN8+DmOTcVkkvTmAayeo4Wf3m1xAruyVGzGuDh/Fb/WWX2yLItUiho42ozyJjB0dw//Tkw== + dependencies: + undici-types "~5.26.4" + "@types/node@>=12.12.47": version "16.9.6" resolved "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz" @@ -3684,10 +3643,10 @@ resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz" integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== -"@types/yargs@17.0.32": - version "17.0.32" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" - integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== +"@types/yargs@17.0.33": + version "17.0.33" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" + integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== dependencies: "@types/yargs-parser" "*" @@ -3712,30 +3671,30 @@ dependencies: "@typescript-eslint/utils" "7.0.2" -"@typescript-eslint/eslint-plugin@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz#f5f5da52db674b1f2cdb9d5f3644e5b2ec750465" - integrity sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A== +"@typescript-eslint/eslint-plugin@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3" + integrity sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.16.1" - "@typescript-eslint/type-utils" "7.16.1" - "@typescript-eslint/utils" "7.16.1" - "@typescript-eslint/visitor-keys" "7.16.1" + "@typescript-eslint/scope-manager" "7.18.0" + "@typescript-eslint/type-utils" "7.18.0" + "@typescript-eslint/utils" "7.18.0" + "@typescript-eslint/visitor-keys" "7.18.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.1.tgz#84c581cf86c8b2becd48d33ddc41a6303d57b274" - integrity sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA== +"@typescript-eslint/parser@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0" + integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg== dependencies: - "@typescript-eslint/scope-manager" "7.16.1" - "@typescript-eslint/types" "7.16.1" - "@typescript-eslint/typescript-estree" "7.16.1" - "@typescript-eslint/visitor-keys" "7.16.1" + "@typescript-eslint/scope-manager" "7.18.0" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/typescript-estree" "7.18.0" + "@typescript-eslint/visitor-keys" "7.18.0" debug "^4.3.4" "@typescript-eslint/scope-manager@7.0.2": @@ -3746,21 +3705,21 @@ "@typescript-eslint/types" "7.0.2" "@typescript-eslint/visitor-keys" "7.0.2" -"@typescript-eslint/scope-manager@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.1.tgz#2b43041caabf8ddd74512b8b550b9fc53ca3afa1" - integrity sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw== +"@typescript-eslint/scope-manager@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz#c928e7a9fc2c0b3ed92ab3112c614d6bd9951c83" + integrity sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA== dependencies: - "@typescript-eslint/types" "7.16.1" - "@typescript-eslint/visitor-keys" "7.16.1" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/visitor-keys" "7.18.0" -"@typescript-eslint/type-utils@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz#4d7ae4f3d9e3c8cbdabae91609b1a431de6aa6ca" - integrity sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA== +"@typescript-eslint/type-utils@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz#2165ffaee00b1fbbdd2d40aa85232dab6998f53b" + integrity sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA== dependencies: - "@typescript-eslint/typescript-estree" "7.16.1" - "@typescript-eslint/utils" "7.16.1" + "@typescript-eslint/typescript-estree" "7.18.0" + "@typescript-eslint/utils" "7.18.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -3769,10 +3728,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.2.tgz#b6edd108648028194eb213887d8d43ab5750351c" integrity sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA== -"@typescript-eslint/types@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz#bbab066276d18e398bc64067b23f1ce84dfc6d8c" - integrity sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ== +"@typescript-eslint/types@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz#b90a57ccdea71797ffffa0321e744f379ec838c9" + integrity sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ== "@typescript-eslint/typescript-estree@7.0.2": version "7.0.2" @@ -3788,13 +3747,13 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/typescript-estree@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz#9b145ba4fd1dde1986697e1ce57dc501a1736dd3" - integrity sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ== +"@typescript-eslint/typescript-estree@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz#b5868d486c51ce8f312309ba79bdb9f331b37931" + integrity sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA== dependencies: - "@typescript-eslint/types" "7.16.1" - "@typescript-eslint/visitor-keys" "7.16.1" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/visitor-keys" "7.18.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -3815,15 +3774,15 @@ "@typescript-eslint/typescript-estree" "7.0.2" semver "^7.5.4" -"@typescript-eslint/utils@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.1.tgz#df42dc8ca5a4603016fd102db0346cdab415cdb7" - integrity sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA== +"@typescript-eslint/utils@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz#bca01cde77f95fc6a8d5b0dbcbfb3d6ca4be451f" + integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.16.1" - "@typescript-eslint/types" "7.16.1" - "@typescript-eslint/typescript-estree" "7.16.1" + "@typescript-eslint/scope-manager" "7.18.0" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/typescript-estree" "7.18.0" "@typescript-eslint/visitor-keys@7.0.2": version "7.0.2" @@ -3833,12 +3792,12 @@ "@typescript-eslint/types" "7.0.2" eslint-visitor-keys "^3.4.1" -"@typescript-eslint/visitor-keys@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz#4287bcf44c34df811ff3bb4d269be6cfc7d8c74b" - integrity sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg== +"@typescript-eslint/visitor-keys@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz#0564629b6124d67607378d0f0332a0495b25e7d7" + integrity sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg== dependencies: - "@typescript-eslint/types" "7.16.1" + "@typescript-eslint/types" "7.18.0" eslint-visitor-keys "^3.4.3" "@ungap/promise-all-settled@1.1.2": @@ -3859,21 +3818,44 @@ "@webassemblyjs/helper-numbers" "1.11.1" "@webassemblyjs/helper-wasm-bytecode" "1.11.1" +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== + dependencies: + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/floating-point-hex-parser@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== + "@webassemblyjs/helper-api-error@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== + "@webassemblyjs/helper-buffer@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== + "@webassemblyjs/helper-numbers@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" @@ -3883,11 +3865,25 @@ "@webassemblyjs/helper-api-error" "1.11.1" "@xtuc/long" "4.2.2" +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" + "@xtuc/long" "4.2.2" + "@webassemblyjs/helper-wasm-bytecode@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== + "@webassemblyjs/helper-wasm-section@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" @@ -3898,6 +3894,16 @@ "@webassemblyjs/helper-wasm-bytecode" "1.11.1" "@webassemblyjs/wasm-gen" "1.11.1" +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/ieee754@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" @@ -3905,6 +3911,13 @@ dependencies: "@xtuc/ieee754" "^1.2.0" +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== + dependencies: + "@xtuc/ieee754" "^1.2.0" + "@webassemblyjs/leb128@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" @@ -3912,11 +3925,23 @@ dependencies: "@xtuc/long" "4.2.2" +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== + dependencies: + "@xtuc/long" "4.2.2" + "@webassemblyjs/utf8@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + "@webassemblyjs/wasm-edit@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" @@ -3931,6 +3956,20 @@ "@webassemblyjs/wasm-parser" "1.11.1" "@webassemblyjs/wast-printer" "1.11.1" +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + "@webassemblyjs/wasm-gen@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" @@ -3942,6 +3981,17 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + "@webassemblyjs/wasm-opt@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" @@ -3952,6 +4002,16 @@ "@webassemblyjs/wasm-gen" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wasm-parser@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" @@ -3964,6 +4024,18 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + "@webassemblyjs/wast-printer@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" @@ -3972,7 +4044,15 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@xtuc/ieee754@^1.2.0": +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== @@ -4047,7 +4127,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.0.2, acorn-walk@^8.1.1, acorn-walk@^8.2.0: +acorn-walk@^8.1.1, acorn-walk@^8.2.0: version "8.2.0" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -4057,7 +4137,12 @@ acorn@^6.4.1: resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^8.1.0, acorn@^8.4.1: +acorn@^8.14.0, acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + +acorn@^8.4.1: version "8.5.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== @@ -4072,16 +4157,6 @@ acorn@^8.7.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== -acorn@^8.7.1: - version "8.9.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz" - integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== - -acorn@^8.8.2: - version "8.14.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" - integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== - acorn@^8.9.0: version "8.12.1" resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" @@ -4142,7 +4217,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-formats@^2.1.0: +ajv-formats@^2.1.0, ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== @@ -4154,6 +4229,13 @@ ajv-keywords@^3.5.2: resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + ajv@^5.0.0: version "5.5.2" resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz" @@ -4184,6 +4266,16 @@ ajv@^8.0.0, ajv@^8.3.0: require-from-string "^2.0.2" uri-js "^4.2.2" +ajv@^8.9.0: + version "8.17.1" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-align@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz" @@ -4266,7 +4358,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.2.1: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -4493,6 +4585,14 @@ array-buffer-byte-length@^1.0.1: call-bind "^1.0.5" is-array-buffer "^3.0.4" +array-buffer-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b" + integrity sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== + dependencies: + call-bound "^1.0.3" + is-array-buffer "^3.0.5" + array-differ@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz" @@ -4523,7 +4623,7 @@ array-ify@^1.0.0: resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= -array-includes@^3.1.4: +array-includes@^3.1.8: version "3.1.8" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== @@ -4586,25 +4686,37 @@ array-unique@^0.3.2: resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.3: - version "1.3.0" - resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz" - integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== +array.prototype.findlastindex@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" + integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" - es-shim-unscopables "^1.0.0" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" -array.prototype.flat@^1.2.5: - version "1.3.2" - resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" - integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== +array.prototype.flat@^1.3.2: + version "1.3.3" + resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz#534aaf9e6e8dd79fb6b9a9917f839ef1ec63afe5" + integrity sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg== dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-shim-unscopables "^1.0.0" + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-shim-unscopables "^1.0.2" + +array.prototype.flatmap@^1.3.2: + version "1.3.3" + resolved "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz#712cc792ae70370ae40586264629e33aab5dd38b" + integrity sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-shim-unscopables "^1.0.2" arraybuffer.prototype.slice@^1.0.3: version "1.0.3" @@ -4620,6 +4732,19 @@ arraybuffer.prototype.slice@^1.0.3: is-array-buffer "^3.0.4" is-shared-array-buffer "^1.0.2" +arraybuffer.prototype.slice@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz#9d760d84dbdd06d0cbf92c8849615a1a7ab3183c" + integrity sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + is-array-buffer "^3.0.4" + arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" @@ -4739,7 +4864,7 @@ async@^2.6.4: dependencies: lodash "^4.17.14" -async@^3.0.1, async@^3.1.0, async@^3.2.0: +async@^3.1.0, async@^3.2.0: version "3.2.1" resolved "https://registry.npmjs.org/async/-/async-3.2.1.tgz" integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== @@ -4813,13 +4938,13 @@ babel-generator@^6.18.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-loader@8.3.0: - version "8.3.0" - resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz" - integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== +babel-loader@8.4.1: + version "8.4.1" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" + integrity sha512-nXzRChX+Z1GoE6yWavBQg6jDslyFF3SDjl2paADuoQtQW10JqShJt62R6eJQ5m/pjJFDT8xgKIWSP85OY8eXeA== dependencies: find-cache-dir "^3.3.1" - loader-utils "^2.0.0" + loader-utils "^2.0.4" make-dir "^3.1.0" schema-utils "^2.6.5" @@ -4850,13 +4975,13 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.2" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.4: - version "0.10.4" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz#789ac82405ad664c20476d0233b485281deb9c77" - integrity sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg== +babel-plugin-polyfill-corejs3@^0.10.6: + version "0.10.6" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" + integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.1" - core-js-compat "^3.36.1" + "@babel/helper-define-polyfill-provider" "^0.6.2" + core-js-compat "^3.38.0" babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.2" @@ -5120,6 +5245,24 @@ body-parser@1.20.2: type-is "~1.6.18" unpipe "1.0.0" +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.13.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + boxen@^5.0.0: version "5.1.2" resolved "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz" @@ -5172,25 +5315,18 @@ braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -breakword@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/breakword/-/breakword-1.0.5.tgz" - integrity sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg== +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - wcwidth "^1.0.1" + fill-range "^7.1.1" brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-resolve@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz" - integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ== - dependencies: - resolve "^1.17.0" - browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" @@ -5269,7 +5405,7 @@ browserslist@^4.14.5, browserslist@^4.16.6: nanocolors "^0.1.5" node-releases "^1.1.76" -browserslist@^4.21.10, browserslist@^4.21.9: +browserslist@^4.21.9: version "4.21.10" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz" integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== @@ -5279,15 +5415,15 @@ browserslist@^4.21.10, browserslist@^4.21.9: node-releases "^2.0.13" update-browserslist-db "^1.0.11" -browserslist@^4.22.2, browserslist@^4.23.0: - version "4.23.0" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" - integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== +browserslist@^4.24.0, browserslist@^4.24.3: + version "4.24.4" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== dependencies: - caniuse-lite "^1.0.30001587" - electron-to-chromium "^1.4.668" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" browserstack@^1.5.1: version "1.6.1" @@ -5328,7 +5464,7 @@ buffer-xor@^1.0.3: resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@^5.4.3, buffer@^5.5.0: +buffer@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -5480,6 +5616,14 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840" + integrity sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" @@ -5499,6 +5643,24 @@ call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: get-intrinsic "^1.2.4" set-function-length "^1.2.1" +call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + +call-bound@^1.0.2, call-bound@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681" + integrity sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== + dependencies: + call-bind-apply-helpers "^1.0.1" + get-intrinsic "^1.2.6" + call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz" @@ -5533,11 +5695,16 @@ camelcase@^6.0.0, camelcase@^6.2.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001587: +caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001517: version "1.0.30001669" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== +caniuse-lite@^1.0.30001688: + version "1.0.30001695" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz#39dfedd8f94851132795fdf9b79d29659ad9c4d4" + integrity sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw== + cardinal@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz" @@ -5551,10 +5718,10 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chai-as-promised@7.1.1: - version "7.1.1" - resolved "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz" - integrity sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== +chai-as-promised@7.1.2: + version "7.1.2" + resolved "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz#70cd73b74afd519754161386421fb71832c6d041" + integrity sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw== dependencies: check-error "^1.0.2" @@ -5578,6 +5745,19 @@ chai@4.4.1: pathval "^1.1.1" type-detect "^4.0.8" +chai@4.5.0: + version "4.5.0" + resolved "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz#707e49923afdd9b13a8b0b47d33d732d13812fd8" + integrity sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.1.0" + chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" @@ -5686,7 +5866,7 @@ chokidar@^3.0.2, chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -chownr@^1.1.4: +chownr@^1.1.1, chownr@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -5719,16 +5899,16 @@ ci-info@^2.0.0: resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.0, ci-info@^3.2.0: - version "3.3.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz" - integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== - ci-info@^3.1.1: version "3.2.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== +ci-info@^3.2.0: + version "3.3.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz" + integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== + ci-info@^3.7.0: version "3.8.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz" @@ -6027,16 +6207,6 @@ columnify@^1.5.4: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combine-source-map@^0.8.0: - version "0.8.0" - resolved "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz" - integrity sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos= - dependencies: - convert-source-map "~1.1.0" - inline-source-map "~0.6.0" - lodash.memoize "~3.0.3" - source-map "~0.5.3" - combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" @@ -6082,7 +6252,7 @@ compare-versions@^6.1.0: resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a" integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg== -component-emitter@^1.2.1, component-emitter@~1.3.0: +component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== @@ -6305,11 +6475,6 @@ convert-source-map@^2.0.0: resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -convert-source-map@~1.1.0: - version "1.1.3" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz" - integrity sha1-SCnId+n+SbMWHzvzZziI4gRpmGA= - cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" @@ -6325,10 +6490,15 @@ cookie@0.6.0: resolved "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== -cookie@~0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== + +cookie@~0.7.2: + version "0.7.2" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" + integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== copy-descriptor@^0.1.0: version "0.1.1" @@ -6343,19 +6513,12 @@ copy-props@^2.0.1: each-props "^1.3.2" is-plain-object "^5.0.0" -core-js-compat@^3.31.0: - version "3.32.1" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.1.tgz" - integrity sha512-GSvKDv4wE0bPnQtjklV101juQ85g6H3rm5PDP20mqlS5j0kXF3pP97YvAu5hl+uFHqMictp3b2VxOHljWMAtuA== - dependencies: - browserslist "^4.21.10" - -core-js-compat@^3.36.1: - version "3.37.1" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz#c844310c7852f4bdf49b8d339730b97e17ff09ee" - integrity sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg== +core-js-compat@^3.38.0, core-js-compat@^3.38.1: + version "3.40.0" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" + integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== dependencies: - browserslist "^4.23.0" + browserslist "^4.24.3" core-js@^2.4.0: version "2.6.12" @@ -6474,15 +6637,6 @@ cross-spawn@^4.0.2: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz" @@ -6503,6 +6657,15 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +cross-spawn@^7.0.5: + version "7.0.6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.12.0: version "3.12.0" resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz" @@ -6534,36 +6697,11 @@ css@^3.0.0: source-map "^0.6.1" source-map-resolve "^0.6.0" -csv-generate@^3.4.3: - version "3.4.3" - resolved "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz" - integrity sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw== - -csv-parse@^4.16.3: - version "4.16.3" - resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz" - integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg== - csv-parse@^5.0.4: version "5.3.0" resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-5.3.0.tgz" integrity sha512-UXJCGwvJ2fep39purtAn27OUYmxB1JQto+zhZ4QlJpzsirtSFbzLvip1aIgziqNdZp/TptvsKEV5BZSxe10/DQ== -csv-stringify@^5.6.5: - version "5.6.5" - resolved "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz" - integrity sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A== - -csv@^5.5.0: - version "5.5.3" - resolved "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz" - integrity sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g== - dependencies: - csv-generate "^3.4.3" - csv-parse "^4.16.3" - csv-stringify "^5.6.5" - stream-transform "^2.1.3" - custom-event@~1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz" @@ -6611,6 +6749,15 @@ data-view-buffer@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" +data-view-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" + integrity sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + data-view-byte-length@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" @@ -6620,6 +6767,15 @@ data-view-byte-length@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" +data-view-byte-length@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz#9e80f7ca52453ce3e93d25a35318767ea7704735" + integrity sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-data-view "^1.0.2" + data-view-byte-offset@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" @@ -6629,6 +6785,15 @@ data-view-byte-offset@^1.0.0: es-errors "^1.3.0" is-data-view "^1.0.1" +data-view-byte-offset@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz#068307f9b71ab76dbbe10291389e020856606191" + integrity sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-data-view "^1.0.1" + dataloader@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz" @@ -6639,11 +6804,6 @@ date-fns@^1.27.2: resolved "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -date-format@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.3.tgz" - integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ== - date-format@^4.0.4, date-format@^4.0.5: version "4.0.5" resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.5.tgz" @@ -6663,7 +6823,7 @@ debug-fabulous@^1.0.0: memoizee "0.4.X" object-assign "4.X" -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -6705,6 +6865,20 @@ debug@^4.3.4: dependencies: ms "2.1.2" +debug@^4.3.5: + version "4.4.0" + resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" + +debug@~4.3.4: + version "4.3.7" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" @@ -6819,14 +6993,6 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" -define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== - dependencies: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - define-properties@^1.2.0, define-properties@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" @@ -7048,7 +7214,7 @@ dom-serialize@^2.2.1: extend "^3.0.0" void-elements "^2.0.0" -domain-browser@^4.16.0, domain-browser@^4.22.0: +domain-browser@^4.22.0: version "4.22.0" resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz" integrity sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw== @@ -7072,6 +7238,15 @@ dotenv@^8.1.0: resolved "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +dunder-proto@^1.0.0, dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + duplexer@^0.1.1, duplexer@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" @@ -7135,10 +7310,10 @@ electron-to-chromium@^1.4.477: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.505.tgz" integrity sha512-0A50eL5BCCKdxig2SsCXhpuztnB9PfUgRMojj5tMvt8O54lbwz3t6wNgnpiTRosw5QjlJB7ixhVyeg8daLQwSQ== -electron-to-chromium@^1.4.668: - version "1.4.722" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.722.tgz#99ae3484c5fc0f387d39ad98d77e1f259b9f4074" - integrity sha512-5nLE0TWFFpZ80Crhtp4pIp8LXCztjYX41yUcV6b+bKR2PqzjskTMOOlBi1VjBHlvHwS+4gar7kNKOrsbsewEZQ== +electron-to-chromium@^1.5.73: + version "1.5.84" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.84.tgz#8e334ca206bb293a20b16418bf454783365b0a95" + integrity sha512-I+DQ8xgafao9Ha6y0qjHHvpZ9OfyA1qKlkHkjywxzniORU2awxyz7f/iVJcULmrF2yrM3nHQf+iDjJtbbexd/g== elegant-spinner@^1.0.1: version "1.0.1" @@ -7196,6 +7371,11 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + encoding@^0.1.12, encoding@^0.1.13: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" @@ -7210,28 +7390,26 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -engine.io-parser@~5.0.3: - version "5.0.3" - resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz" - integrity sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg== - dependencies: - "@socket.io/base64-arraybuffer" "~1.0.2" +engine.io-parser@~5.2.1: + version "5.2.3" + resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz#00dc5b97b1f233a23c9398d0209504cf5f94d92f" + integrity sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q== -engine.io@~6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz" - integrity sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg== +engine.io@~6.6.0: + version "6.6.2" + resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz#32bd845b4db708f8c774a4edef4e5c8a98b3da72" + integrity sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw== dependencies: "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" "@types/node" ">=10.0.0" accepts "~1.3.4" base64id "2.0.0" - cookie "~0.4.1" + cookie "~0.7.2" cors "~2.8.5" debug "~4.3.1" - engine.io-parser "~5.0.3" - ws "~8.2.3" + engine.io-parser "~5.2.1" + ws "~8.17.1" enhanced-resolve@^5.0.0: version "5.16.0" @@ -7241,10 +7419,10 @@ enhanced-resolve@^5.0.0: graceful-fs "^4.2.4" tapable "^2.2.0" -enhanced-resolve@^5.10.0: - version "5.15.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz" - integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== +enhanced-resolve@^5.17.1: + version "5.18.0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404" + integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -7257,12 +7435,13 @@ enhanced-resolve@^5.8.0: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.0: - version "2.3.6" - resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== +enquirer@^2.4.1: + version "2.4.1" + resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== dependencies: ansi-colors "^4.1.1" + strip-ansi "^6.0.1" ent@~2.2.0: version "2.2.0" @@ -7322,35 +7501,6 @@ es-abstract@^1.18.0-next.2, es-abstract@^1.18.5: string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.1" -es-abstract@^1.19.0, es-abstract@^1.19.2, es-abstract@^1.19.5: - version "1.20.0" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.0.tgz" - integrity sha512-URbD8tgRthKD3YcC39vbvSDrX23upXnPcnGAjQfgxXF5ID75YcENawc9ZX/9iTP9ptUyfCLIxTTuMYoRfiOVKA== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - function.prototype.name "^1.1.5" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-property-descriptors "^1.0.0" - has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.2" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" - is-string "^1.0.7" - is-weakref "^1.0.2" - object-inspect "^1.12.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - regexp.prototype.flags "^1.4.1" - string.prototype.trimend "^1.0.5" - string.prototype.trimstart "^1.0.5" - unbox-primitive "^1.0.2" - es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2: version "1.23.3" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" @@ -7403,6 +7553,63 @@ es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23 unbox-primitive "^1.0.2" which-typed-array "^1.1.15" +es-abstract@^1.23.5, es-abstract@^1.23.9: + version "1.23.9" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz#5b45994b7de78dada5c1bebf1379646b32b9d606" + integrity sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA== + dependencies: + array-buffer-byte-length "^1.0.2" + arraybuffer.prototype.slice "^1.0.4" + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.3" + data-view-buffer "^1.0.2" + data-view-byte-length "^1.0.2" + data-view-byte-offset "^1.0.1" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-set-tostringtag "^2.1.0" + es-to-primitive "^1.3.0" + function.prototype.name "^1.1.8" + get-intrinsic "^1.2.7" + get-proto "^1.0.0" + get-symbol-description "^1.1.0" + globalthis "^1.0.4" + gopd "^1.2.0" + has-property-descriptors "^1.0.2" + has-proto "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + internal-slot "^1.1.0" + is-array-buffer "^3.0.5" + is-callable "^1.2.7" + is-data-view "^1.0.2" + is-regex "^1.2.1" + is-shared-array-buffer "^1.0.4" + is-string "^1.1.1" + is-typed-array "^1.1.15" + is-weakref "^1.1.0" + math-intrinsics "^1.1.0" + object-inspect "^1.13.3" + object-keys "^1.1.1" + object.assign "^4.1.7" + own-keys "^1.0.1" + regexp.prototype.flags "^1.5.3" + safe-array-concat "^1.1.3" + safe-push-apply "^1.0.0" + safe-regex-test "^1.1.0" + set-proto "^1.0.0" + string.prototype.trim "^1.2.10" + string.prototype.trimend "^1.0.9" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.3" + typed-array-byte-length "^1.0.3" + typed-array-byte-offset "^1.0.4" + typed-array-length "^1.0.7" + unbox-primitive "^1.1.0" + which-typed-array "^1.1.18" + es-define-property@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" @@ -7410,6 +7617,11 @@ es-define-property@^1.0.0: dependencies: get-intrinsic "^1.2.4" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + es-errors@^1.2.1, es-errors@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" @@ -7420,10 +7632,10 @@ es-module-lexer@^0.7.1: resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz" integrity sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw== -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.6.0" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== es-object-atoms@^1.0.0: version "1.0.0" @@ -7441,12 +7653,22 @@ es-set-tostringtag@^2.0.3: has-tostringtag "^1.0.2" hasown "^2.0.1" -es-shim-unscopables@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz" - integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== dependencies: - has "^1.0.3" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + +es-shim-unscopables@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" + integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== + dependencies: + hasown "^2.0.0" es-to-primitive@^1.2.1: version "1.2.1" @@ -7457,6 +7679,15 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es-to-primitive@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" + integrity sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== + dependencies: + is-callable "^1.2.7" + is-date-object "^1.0.5" + is-symbol "^1.0.4" + es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.64" resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz#12e4ffb48f1ba2ea777f1fcdd1918ef73ea21714" @@ -7529,6 +7760,11 @@ escalade@^3.1.1: resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-goat@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz" @@ -7566,7 +7802,7 @@ escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" -eslint-import-resolver-node@^0.3.6: +eslint-import-resolver-node@^0.3.9: version "0.3.9" resolved "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== @@ -7575,31 +7811,37 @@ eslint-import-resolver-node@^0.3.6: is-core-module "^2.13.0" resolve "^1.22.4" -eslint-module-utils@^2.7.3: - version "2.8.1" - resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz#52f2404300c3bd33deece9d7372fb337cc1d7c34" - integrity sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q== +eslint-module-utils@^2.12.0: + version "2.12.0" + resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" + integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== dependencies: debug "^3.2.7" -eslint-plugin-import@2.26.0: - version "2.26.0" - resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" - integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== +eslint-plugin-import@2.31.0: + version "2.31.0" + resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" + integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== dependencies: - array-includes "^3.1.4" - array.prototype.flat "^1.2.5" - debug "^2.6.9" + "@rtsao/scc" "^1.1.0" + array-includes "^3.1.8" + array.prototype.findlastindex "^1.2.5" + array.prototype.flat "^1.3.2" + array.prototype.flatmap "^1.3.2" + debug "^3.2.7" doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.3" - has "^1.0.3" - is-core-module "^2.8.1" + eslint-import-resolver-node "^0.3.9" + eslint-module-utils "^2.12.0" + hasown "^2.0.2" + is-core-module "^2.15.1" is-glob "^4.0.3" minimatch "^3.1.2" - object.values "^1.1.5" - resolve "^1.22.0" - tsconfig-paths "^3.14.1" + object.fromentries "^2.0.8" + object.groupby "^1.0.3" + object.values "^1.2.0" + semver "^6.3.1" + string.prototype.trimend "^1.0.8" + tsconfig-paths "^3.15.0" eslint-plugin-unused-imports@3.2.0: version "3.2.0" @@ -7683,6 +7925,50 @@ eslint@8.56.0: strip-ansi "^6.0.1" text-table "^0.2.0" +eslint@8.57.1: + version "8.57.1" + resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz#7df109654aba7e3bbe5c8eae533c5e461d3c6ca9" + integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.57.1" + "@humanwhocodes/config-array" "^0.13.0" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" + esniff@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz#a4d4b43a5c71c7ec51c51098c1d8a29081f9b308" @@ -7872,6 +8158,11 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" +expand-template@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" + integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== + expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz" @@ -7928,6 +8219,43 @@ express@4.19.2: utils-merge "1.0.1" vary "~1.1.2" +express@4.21.2: + version "4.21.2" + resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.3" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.7.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~2.0.0" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.3.1" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.3" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.12" + proxy-addr "~2.0.7" + qs "6.13.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.19.0" + serve-static "1.16.2" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + express@^4.16.4: version "4.17.1" resolved "https://registry.npmjs.org/express/-/express-4.17.1.tgz" @@ -8109,6 +8437,11 @@ fast-text-encoding@^1.0.0, fast-text-encoding@^1.0.3: resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz" integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== +fast-uri@^3.0.1: + version "3.0.6" + resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== + fast-url-parser@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz" @@ -8215,6 +8548,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + filter-obj@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz" @@ -8251,6 +8591,19 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== + dependencies: + debug "2.6.9" + encodeurl "~2.0.0" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + find-cache-dir@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz" @@ -8314,16 +8667,8 @@ find-up@^4.0.0, find-up@^4.1.0: resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-yarn-workspace-root2@1.2.16: - version "1.2.16" - resolved "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz" - integrity sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA== - dependencies: - micromatch "^4.0.2" - pkg-dir "^4.2.0" + locate-path "^5.0.0" + path-exists "^4.0.0" find-yarn-workspace-root@^2.0.0: version "2.0.0" @@ -8447,7 +8792,7 @@ flat@^5.0.2: resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.1.0, flatted@^3.2.4: +flatted@^3.1.0: version "3.2.4" resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== @@ -8684,16 +9029,6 @@ function-bind@^1.1.2: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== -function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" - function.prototype.name@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" @@ -8704,7 +9039,19 @@ function.prototype.name@^1.1.6: es-abstract "^1.22.1" functions-have-names "^1.2.3" -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +function.prototype.name@^1.1.8: + version "1.1.8" + resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz#e68e1df7b259a5c949eeef95cdbde53edffabb78" + integrity sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + functions-have-names "^1.2.3" + hasown "^2.0.2" + is-callable "^1.2.7" + +functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -8840,6 +9187,22 @@ get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@ has-symbols "^1.0.3" hasown "^2.0.0" +get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7: + version "1.2.7" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044" + integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + function-bind "^1.1.2" + get-proto "^1.0.0" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" @@ -8860,6 +9223,14 @@ get-port@^5.1.1: resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== +get-proto@^1.0.0, get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stream@^5.1.0: version "5.2.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" @@ -8889,6 +9260,15 @@ get-symbol-description@^1.0.2: es-errors "^1.3.0" get-intrinsic "^1.2.4" +get-symbol-description@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" + integrity sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + get-uri@3: version "3.0.2" resolved "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz" @@ -8962,6 +9342,11 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz" @@ -9118,6 +9503,14 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + globby@10.0.1: version "10.0.1" resolved "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz" @@ -9245,6 +9638,11 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + got@11.8.2: version "11.8.2" resolved "https://registry.npmjs.org/got/-/got-11.8.2.tgz" @@ -9277,16 +9675,11 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== -graceful-fs@^4.2.10, graceful-fs@^4.2.9: +graceful-fs@^4.2.10, graceful-fs@^4.2.11: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - graphemer@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" @@ -9477,6 +9870,13 @@ has-proto@^1.0.1, has-proto@^1.0.3: resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== +has-proto@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz#5de5a6eabd95fdffd9818b43055e8065e39fe9d5" + integrity sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ== + dependencies: + dunder-proto "^1.0.0" + has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" @@ -9487,6 +9887,11 @@ has-symbols@^1.0.3: resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + has-tostringtag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" @@ -9952,13 +10357,6 @@ init-package-json@^2.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" -inline-source-map@~0.6.0: - version "0.6.2" - resolved "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz" - integrity sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU= - dependencies: - source-map "~0.5.3" - inquirer@8.2.6: version "8.2.6" resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz" @@ -10043,6 +10441,15 @@ internal-slot@^1.0.7: hasown "^2.0.0" side-channel "^1.0.4" +internal-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz#1eac91762947d2f7056bc838d93e13b2e9604961" + integrity sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.2" + side-channel "^1.1.0" + interpret@^1.0.0, interpret@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" @@ -10118,6 +10525,15 @@ is-array-buffer@^3.0.4: call-bind "^1.0.2" get-intrinsic "^1.2.1" +is-array-buffer@^3.0.5: + version "3.0.5" + resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" + integrity sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + get-intrinsic "^1.2.6" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" @@ -10128,6 +10544,16 @@ is-arrayish@^0.3.1: resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== +is-async-function@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.0.tgz#1d1080612c493608e93168fc4458c245074c06a6" + integrity sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ== + dependencies: + call-bound "^1.0.3" + get-proto "^1.0.1" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" @@ -10135,6 +10561,13 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" +is-bigint@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" + integrity sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== + dependencies: + has-bigints "^1.0.2" + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" @@ -10157,6 +10590,14 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-boolean-object@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz#c20d0c654be05da4fbc23c562635c019e93daf89" + integrity sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng== + dependencies: + call-bound "^1.0.2" + has-tostringtag "^1.0.2" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" @@ -10207,6 +10648,13 @@ is-core-module@^2.13.0: dependencies: has "^1.0.3" +is-core-module@^2.15.1: + version "2.16.1" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== + dependencies: + hasown "^2.0.2" + is-core-module@^2.2.0, is-core-module@^2.5.0: version "2.6.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz" @@ -10242,6 +10690,15 @@ is-data-view@^1.0.1: dependencies: is-typed-array "^1.1.13" +is-data-view@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz#bae0a41b9688986c2188dda6657e56b8f9e63b8e" + integrity sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw== + dependencies: + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + is-typed-array "^1.1.13" + is-date-object@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" @@ -10249,6 +10706,14 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-date-object@^1.0.5, is-date-object@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz#ad85541996fc7aa8b2729701d27b7319f95d82f7" + integrity sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg== + dependencies: + call-bound "^1.0.2" + has-tostringtag "^1.0.2" + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" @@ -10289,6 +10754,13 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= +is-finalizationregistry@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz#eefdcdc6c94ddd0674d9c85887bf93f944a97c90" + integrity sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg== + dependencies: + call-bound "^1.0.3" + is-finite@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz" @@ -10311,6 +10783,16 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-generator-function@^1.0.10: + version "1.1.0" + resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" + integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== + dependencies: + call-bound "^1.0.3" + get-proto "^1.0.0" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" + is-generator-function@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz" @@ -10357,6 +10839,11 @@ is-lambda@^1.0.1: resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz" integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== + is-module@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz" @@ -10380,11 +10867,6 @@ is-negative-zero@^2.0.1: resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz" integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== -is-negative-zero@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" - integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== - is-negative-zero@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" @@ -10402,6 +10884,14 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" +is-number-object@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz#144b21e95a1bc148205dcc2814a9134ec41b2541" + integrity sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw== + dependencies: + call-bound "^1.0.3" + has-tostringtag "^1.0.2" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" @@ -10507,6 +10997,16 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-regex@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" + integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== + dependencies: + call-bound "^1.0.2" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + is-relative@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz" @@ -10514,6 +11014,11 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" @@ -10528,6 +11033,13 @@ is-shared-array-buffer@^1.0.3: dependencies: call-bind "^1.0.7" +is-shared-array-buffer@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz#9b67844bd9b7f246ba0708c3a93e34269c774f6f" + integrity sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A== + dependencies: + call-bound "^1.0.3" + is-ssh@^1.3.0: version "1.3.3" resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.3.tgz" @@ -10557,6 +11069,14 @@ is-string@^1.0.5, is-string@^1.0.7: dependencies: has-tostringtag "^1.0.0" +is-string@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz#92ea3f3d5c5b6e039ca8677e5ac8d07ea773cbb9" + integrity sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== + dependencies: + call-bound "^1.0.3" + has-tostringtag "^1.0.2" + is-subdir@^1.1.1: version "1.2.0" resolved "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz" @@ -10571,6 +11091,15 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +is-symbol@^1.0.4, is-symbol@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz#f47761279f532e2b05a7024a7506dbbedacd0634" + integrity sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w== + dependencies: + call-bound "^1.0.2" + has-symbols "^1.1.0" + safe-regex-test "^1.1.0" + is-text-path@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" @@ -10585,6 +11114,13 @@ is-typed-array@^1.1.13: dependencies: which-typed-array "^1.1.14" +is-typed-array@^1.1.14, is-typed-array@^1.1.15: + version "1.1.15" + resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== + dependencies: + which-typed-array "^1.1.16" + is-typed-array@^1.1.3, is-typed-array@^1.1.7: version "1.1.8" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz" @@ -10628,6 +11164,11 @@ is-valid-glob@^1.0.0: resolved "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz" integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" @@ -10635,6 +11176,21 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +is-weakref@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz#47e3472ae95a63fa9cf25660bcf0c181c39770ef" + integrity sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q== + dependencies: + call-bound "^1.0.2" + +is-weakset@^2.0.3: + version "2.0.4" + resolved "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz#c9f5deb0bc1906c6d6f1027f284ddf459249daca" + integrity sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ== + dependencies: + call-bound "^1.0.3" + get-intrinsic "^1.2.6" + is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" @@ -10813,7 +11369,7 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.0, istanbul-reports@^3.0.2: +istanbul-reports@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz" integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== @@ -11013,6 +11569,15 @@ jest-worker@^27.0.6, jest-worker@^27.2.0: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jju@^1.1.0, jju@~1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz" @@ -11049,7 +11614,7 @@ js-yaml@4.1.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.6.1: +js-yaml@^3.13.1, js-yaml@^3.6.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -11080,11 +11645,21 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= +jsesc@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== + json-bigint@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" @@ -11276,11 +11851,6 @@ jws@^4.0.0: jwa "^2.0.0" safe-buffer "^5.0.1" -karma-babel-preprocessor@8.0.2: - version "8.0.2" - resolved "https://registry.npmjs.org/karma-babel-preprocessor/-/karma-babel-preprocessor-8.0.2.tgz" - integrity sha512-6ZUnHwaK2EyhgxbgeSJW6n6WZUYSEdekHIV/qDUnPgMkVzQBHEvd07d2mTL5AQjV8uTUgH6XslhaPrp+fHWH2A== - karma-chrome-launcher@3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz" @@ -11351,55 +11921,6 @@ karma-summary-reporter@3.1.1: dependencies: chalk "^4.0.0" -karma-typescript@5.5.4: - version "5.5.4" - resolved "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.4.tgz" - integrity sha512-D7nQ96xu/UekuqCmiPimnCuOFqp8+BxiND6MU6IJVN37E7DgXzr7SUeTzwuTHtKSYpgxKv4iOTUteYTxpeZL9A== - dependencies: - acorn "^8.1.0" - acorn-walk "^8.0.2" - assert "^2.0.0" - async "^3.0.1" - browser-resolve "^2.0.0" - browserify-zlib "^0.2.0" - buffer "^5.4.3" - combine-source-map "^0.8.0" - console-browserify "^1.2.0" - constants-browserify "^1.0.0" - convert-source-map "^1.7.0" - crypto-browserify "^3.12.0" - diff "^4.0.1" - domain-browser "^4.16.0" - events "^3.2.0" - glob "^7.1.6" - https-browserify "^1.0.0" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.0" - json-stringify-safe "^5.0.1" - lodash "^4.17.19" - log4js "^6.3.0" - minimatch "^3.0.4" - os-browserify "^0.3.0" - pad "^3.2.0" - path-browserify "^1.0.0" - process "^0.11.10" - punycode "^2.1.1" - querystring-es3 "^0.2.1" - readable-stream "^3.1.1" - source-map "^0.7.3" - stream-browserify "^3.0.0" - stream-http "^3.1.0" - string_decoder "^1.3.0" - timers-browserify "^2.0.11" - tmp "^0.2.1" - tty-browserify "^0.0.1" - url "^0.11.0" - util "^0.12.1" - vm-browserify "^1.1.2" - karma-webkit-launcher@2.6.0: version "2.6.0" resolved "https://registry.npmjs.org/karma-webkit-launcher/-/karma-webkit-launcher-2.6.0.tgz#2e3ba096b69139e608d9ce6e89816a17f358b700" @@ -11417,10 +11938,10 @@ karma-webpack@5.0.0: minimatch "^3.0.4" webpack-merge "^4.1.5" -karma@6.4.2: - version "6.4.2" - resolved "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz" - integrity sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ== +karma@6.4.4: + version "6.4.4" + resolved "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz#dfa5a426cf5a8b53b43cd54ef0d0d09742351492" + integrity sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w== dependencies: "@colors/colors" "1.5.0" body-parser "^1.19.0" @@ -11441,7 +11962,7 @@ karma@6.4.2: qjobs "^1.2.0" range-parser "^1.2.1" rimraf "^3.0.2" - socket.io "^4.4.1" + socket.io "^4.7.2" source-map "^0.6.1" tmp "^0.2.1" ua-parser-js "^0.7.30" @@ -11485,11 +12006,6 @@ klaw-sync@^6.0.0: dependencies: graceful-fs "^4.1.11" -kleur@^4.1.4: - version "4.1.5" - resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz" - integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== - kuler@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz" @@ -11718,16 +12234,6 @@ load-json-file@^6.2.0: strip-bom "^4.0.0" type-fest "^0.6.0" -load-yaml-file@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz" - integrity sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw== - dependencies: - graceful-fs "^4.1.5" - js-yaml "^3.13.0" - pify "^4.0.1" - strip-bom "^3.0.0" - loader-runner@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" @@ -11751,6 +12257,15 @@ loader-utils@^2.0.0: emojis-list "^3.0.0" json5 "^2.1.2" +loader-utils@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" @@ -11853,11 +12368,6 @@ lodash.isplainobject@^4.0.6: resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz" integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= -lodash.memoize@~3.0.3: - version "3.0.4" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz" - integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" @@ -11939,17 +12449,6 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" -log4js@^6.3.0: - version "6.4.0" - resolved "https://registry.npmjs.org/log4js/-/log4js-6.4.0.tgz" - integrity sha512-ysc/XUecZJuN8NoKOssk3V0cQ29xY4fra6fnigZa5VwxFsCsvdqsdnEuAxNN89LlHpbE4KUD3zGcn+kFqonSVQ== - dependencies: - date-format "^4.0.3" - debug "^4.3.3" - flatted "^3.2.4" - rfdc "^1.3.0" - streamroller "^3.0.2" - log4js@^6.4.1: version "6.4.2" resolved "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz" @@ -12219,6 +12718,11 @@ matchdep@^2.0.0: resolve "^1.4.0" stack-trace "0.0.10" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" @@ -12267,23 +12771,6 @@ memorystream@^0.3.1: resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= -meow@^6.0.0: - version "6.1.1" - resolved "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz" - integrity sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "^4.0.2" - normalize-package-data "^2.5.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" - meow@^8.0.0: version "8.1.2" resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" @@ -12306,6 +12793,11 @@ merge-descriptors@1.0.1: resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" @@ -12353,6 +12845,14 @@ micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" +micromatch@^4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz" @@ -12484,7 +12984,7 @@ minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist-options@4.1.0, minimist-options@^4.0.2: +minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== @@ -12611,10 +13111,10 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mixme@^0.5.1: - version "0.5.4" - resolved "https://registry.npmjs.org/mixme/-/mixme-0.5.4.tgz" - integrity sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw== +mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: + version "0.5.3" + resolved "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== mkdirp-infer-owner@^2.0.0: version "2.0.0" @@ -12708,6 +13208,11 @@ morgan@^1.10.0, morgan@^1.8.2: on-finished "~2.3.0" on-headers "~1.0.2" +mri@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -12723,7 +13228,7 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -12795,6 +13300,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +napi-build-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" + integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" @@ -12841,11 +13351,23 @@ nise@^4.0.4: just-extend "^4.0.2" path-to-regexp "^1.7.0" +node-abi@^3.3.0: + version "3.73.0" + resolved "https://registry.npmjs.org/node-abi/-/node-abi-3.73.0.tgz#4459ea77e71969edba8588387eecb05e2c2cff3b" + integrity sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg== + dependencies: + semver "^7.3.5" + node-addon-api@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== +node-addon-api@^7.0.0: + version "7.1.1" + resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== + node-emoji@^1.11.0: version "1.11.0" resolved "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz" @@ -13007,10 +13529,10 @@ node-releases@^2.0.13: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== node-version@^1.0.0: version "1.2.0" @@ -13176,12 +13698,12 @@ npm-registry-fetch@^9.0.0: minizlib "^2.0.0" npm-package-arg "^8.0.0" -npm-run-all2@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-5.0.0.tgz#a95a0451ab8e971c9239d17aca7a39d4bc6658ed" - integrity sha512-twczQhEpj55UROtg0Xz0nzn83TanS5Re12g5g1hcdnyAhlWOt9VNHdSHf2Z6MO3/wOVqy9tEdi0ruJt5NnMgmw== +npm-run-all2@5.0.2: + version "5.0.2" + resolved "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-5.0.2.tgz#7dae8e11ba90be9edd05379414a01407416b336c" + integrity sha512-S2G6FWZ3pNWAAKm2PFSOtEAG/N+XO/kz3+9l6V91IY+Y3XFSt7Lp7DV92KCgEboEW0hRTu0vFaMe4zXDZYaOyA== dependencies: - ansi-styles "^4.2.1" + ansi-styles "^5.0.0" cross-spawn "^7.0.3" memorystream "^0.3.1" minimatch "^3.0.4" @@ -13293,16 +13815,16 @@ object-inspect@^1.11.0, object-inspect@^1.9.0: resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== -object-inspect@^1.12.0: - version "1.12.0" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== - object-inspect@^1.13.1: version "1.13.1" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== +object-inspect@^1.13.3: + version "1.13.3" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== + object-is@^1.0.1: version "1.1.5" resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz" @@ -13343,6 +13865,18 @@ object.assign@^4.1.5: has-symbols "^1.0.3" object-keys "^1.1.1" +object.assign@^4.1.7: + version "4.1.7" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" + integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + has-symbols "^1.1.0" + object-keys "^1.1.1" + object.defaults@^1.0.0, object.defaults@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz" @@ -13353,6 +13887,16 @@ object.defaults@^1.0.0, object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" +object.fromentries@^2.0.8: + version "2.0.8" + resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" + integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + object.getownpropertydescriptors@^2.0.3: version "2.1.2" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz" @@ -13362,6 +13906,15 @@ object.getownpropertydescriptors@^2.0.3: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" +object.groupby@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" + integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + object.map@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz" @@ -13385,12 +13938,13 @@ object.reduce@^1.0.0: for-own "^1.0.0" make-iterator "^1.0.0" -object.values@^1.1.5: - version "1.2.0" - resolved "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" - integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== +object.values@^1.2.0: + version "1.2.1" + resolved "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz#deed520a50809ff7f75a7cfd4bc64c7a038c6216" + integrity sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.3" define-properties "^1.2.1" es-object-atoms "^1.0.0" @@ -13557,6 +14111,15 @@ outdent@^0.5.0: resolved "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz" integrity sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q== +own-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz#e4006910a2bf913585289676eebd6f390cf51358" + integrity sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg== + dependencies: + get-intrinsic "^1.2.6" + object-keys "^1.1.1" + safe-push-apply "^1.0.0" + p-cancelable@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz" @@ -13728,6 +14291,11 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" +package-manager-detector@^0.2.0: + version "0.2.8" + resolved "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.8.tgz#f5ace2dbd37666af54e5acec11bc37c8450f72d0" + integrity sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA== + package-name-regex@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.6.tgz" @@ -13758,13 +14326,6 @@ pacote@^11.2.6: ssri "^8.0.1" tar "^6.1.0" -pad@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz" - integrity sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg== - dependencies: - wcwidth "^1.0.1" - pako@~1.0.2, pako@~1.0.5: version "1.0.11" resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz" @@ -13894,7 +14455,7 @@ patch-package@7.0.2: tmp "^0.0.33" yaml "^2.2.2" -path-browserify@^1.0.0, path-browserify@^1.0.1: +path-browserify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz" integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== @@ -13972,6 +14533,11 @@ path-strip-sep@^1.0.17: dependencies: tslib "^2" +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" @@ -14036,11 +14602,21 @@ picocolors@^1.0.0: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.0, picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + pidtree@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.5.0.tgz#ad5fbc1de78b8a5f99d6fbdd4f6e4eee21d1aca1" @@ -14111,17 +14687,17 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -playwright-core@1.46.1: - version "1.46.1" - resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz#28f3ab35312135dda75b0c92a3e5c0e7edb9cc8b" - integrity sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A== +playwright-core@1.49.1: + version "1.49.1" + resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz#32c62f046e950f586ff9e35ed490a424f2248015" + integrity sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg== -playwright@1.46.1: - version "1.46.1" - resolved "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz#ea562bc48373648e10420a10c16842f0b227c218" - integrity sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng== +playwright@1.49.1: + version "1.49.1" + resolved "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz#830266dbca3008022afa7b4783565db9944ded7c" + integrity sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA== dependencies: - playwright-core "1.46.1" + playwright-core "1.49.1" optionalDependencies: fsevents "2.3.2" @@ -14177,15 +14753,23 @@ postinstall-postinstall@2.1.0: resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz" integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== -preferred-pm@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz" - integrity sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ== +prebuild-install@^7.1.1: + version "7.1.2" + resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz#a5fd9986f5a6251fbc47e1e5c65de71e68c0a056" + integrity sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ== dependencies: - find-up "^5.0.0" - find-yarn-workspace-root2 "1.2.16" - path-exists "^4.0.0" - which-pm "2.0.0" + detect-libc "^2.0.0" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^3.3.0" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^4.0.0" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" prelude-ls@^1.2.1: version "1.2.1" @@ -14202,6 +14786,11 @@ prettier@2.8.7: resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz" integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@2.8.8: + version "2.8.8" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + prettier@^2.7.1: version "2.7.1" resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz" @@ -14496,6 +15085,13 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" +qs@6.13.0: + version "6.13.0" + resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== + dependencies: + side-channel "^1.0.6" + qs@6.7.0: version "6.7.0" resolved "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz" @@ -14598,7 +15194,7 @@ raw-body@^2.2.0, raw-body@^2.3.3: iconv-lite "0.4.24" unpipe "1.0.0" -rc@^1.2.8: +rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -14854,6 +15450,20 @@ redeyed@~2.1.0: dependencies: esprima "~4.0.0" +reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: + version "1.0.10" + resolved "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" + integrity sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-abstract "^1.23.9" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.7" + get-proto "^1.0.1" + which-builtin-type "^1.2.1" + regenerate-unicode-properties@^10.1.0: version "10.1.0" resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz" @@ -14861,6 +15471,13 @@ regenerate-unicode-properties@^10.1.0: dependencies: regenerate "^1.4.2" +regenerate-unicode-properties@^10.2.0: + version "10.2.0" + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" + integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== + dependencies: + regenerate "^1.4.2" + regenerate@^1.4.2: version "1.4.2" resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" @@ -14871,11 +15488,6 @@ regenerator-runtime@^0.11.0: resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.13.11: - version "0.13.11" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== - regenerator-runtime@^0.13.4: version "0.13.9" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz" @@ -14896,15 +15508,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.4.1: - version "1.4.3" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - functions-have-names "^1.2.2" - regexp.prototype.flags@^1.5.2: version "1.5.2" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" @@ -14915,6 +15518,18 @@ regexp.prototype.flags@^1.5.2: es-errors "^1.3.0" set-function-name "^2.0.1" +regexp.prototype.flags@^1.5.3: + version "1.5.4" + resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" + integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + es-errors "^1.3.0" + get-proto "^1.0.1" + gopd "^1.2.0" + set-function-name "^2.0.2" + regexpu-core@^5.1.0: version "5.2.1" resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.1.tgz" @@ -14927,15 +15542,15 @@ regexpu-core@^5.1.0: unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.0.0" -regexpu-core@^5.3.1: - version "5.3.2" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz" - integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== +regexpu-core@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" + integrity sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA== dependencies: - "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" + regenerate-unicode-properties "^10.2.0" + regjsgen "^0.8.0" + regjsparser "^0.12.0" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" @@ -14958,6 +15573,18 @@ regjsgen@^0.7.1: resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz" integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== +regjsgen@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" + integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== + +regjsparser@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz#0e846df6c6530586429377de56e0475583b088dc" + integrity sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== + dependencies: + jsesc "~3.0.2" + regjsparser@^0.9.1: version "0.9.1" resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz" @@ -15135,7 +15762,7 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17. is-core-module "^2.2.0" path-parse "^1.0.6" -resolve@^1.22.0, resolve@^1.22.4: +resolve@^1.22.4: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -15397,6 +16024,17 @@ safe-array-concat@^1.1.2: has-symbols "^1.0.3" isarray "^2.0.5" +safe-array-concat@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz#c9e54ec4f603b0bbb8e7e5007a5ee7aecd1538c3" + integrity sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + get-intrinsic "^1.2.6" + has-symbols "^1.1.0" + isarray "^2.0.5" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" @@ -15407,6 +16045,14 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-push-apply@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz#01850e981c1602d398c85081f360e4e6d03d27f5" + integrity sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA== + dependencies: + es-errors "^1.3.0" + isarray "^2.0.5" + safe-regex-test@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" @@ -15416,6 +16062,15 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" +safe-regex-test@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" + integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-regex "^1.2.1" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" @@ -15481,6 +16136,25 @@ schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" + secure-compare@3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz" @@ -15551,12 +16225,10 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.5.3: - version "7.5.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== - dependencies: - lru-cache "^6.0.0" +semver@7.6.3, semver@^7.5.4, semver@^7.6.0: + version "7.6.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" @@ -15570,11 +16242,6 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semve dependencies: lru-cache "^6.0.0" -semver@^7.5.4, semver@^7.6.0: - version "7.6.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - semver@~7.3.0: version "7.3.7" resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" @@ -15620,6 +16287,25 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" +send@0.19.0: + version "0.19.0" + resolved "https://registry.npmjs.org/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + serialize-javascript@6.0.0, serialize-javascript@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" @@ -15632,7 +16318,7 @@ serialize-javascript@^2.1.2: resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -serialize-javascript@^6.0.1: +serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== @@ -15659,12 +16345,22 @@ serve-static@1.15.0: parseurl "~1.3.3" send "0.18.0" +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== + dependencies: + encodeurl "~2.0.0" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.19.0" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-function-length@^1.2.1: +set-function-length@^1.2.1, set-function-length@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== @@ -15676,7 +16372,7 @@ set-function-length@^1.2.1: gopd "^1.0.1" has-property-descriptors "^1.0.2" -set-function-name@^2.0.1: +set-function-name@^2.0.1, set-function-name@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== @@ -15686,6 +16382,15 @@ set-function-name@^2.0.1: functions-have-names "^1.2.3" has-property-descriptors "^1.0.2" +set-proto@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz#0760dbcff30b2d7e801fd6e19983e56da337565e" + integrity sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw== + dependencies: + dunder-proto "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" @@ -15764,6 +16469,35 @@ shelljs@^0.8.3: interpret "^1.0.0" rechoir "^0.6.2" +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + +side-channel-weakmap@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" @@ -15773,6 +16507,17 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +side-channel@^1.0.6, side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" + signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.4" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz" @@ -15783,14 +16528,33 @@ signal-exit@^3.0.7: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -simple-git@3.24.0: - version "3.24.0" - resolved "https://registry.npmjs.org/simple-git/-/simple-git-3.24.0.tgz#33a8c88dc6fa74e53eaf3d6bfc27d0182a49ec00" - integrity sha512-QqAKee9Twv+3k8IFOFfPB2hnk6as6Y6ACUpwCtQvRYBAes23Wv3SZlHVobAzqcE8gfsisCvPw3HGW3HYM+VYYw== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== + dependencies: + decompress-response "^6.0.0" + once "^1.3.1" + simple-concat "^1.0.0" + +simple-git@3.27.0: + version "3.27.0" + resolved "https://registry.npmjs.org/simple-git/-/simple-git-3.27.0.tgz#f4b09e807bda56a4a3968f635c0e4888d3decbd5" + integrity sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" - debug "^4.3.4" + debug "^4.3.5" simple-swizzle@^0.2.2: version "0.2.2" @@ -15846,18 +16610,6 @@ smart-buffer@^4.1.0, smart-buffer@^4.2.0: resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -smartwrap@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/smartwrap/-/smartwrap-2.0.2.tgz" - integrity sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA== - dependencies: - array.prototype.flat "^1.2.3" - breakword "^1.0.5" - grapheme-splitter "^1.0.4" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - yargs "^15.1.0" - smob@^1.0.0: version "1.5.0" resolved "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz#85d79a1403abf128d24d3ebc1cdc5e1a9548d3ab" @@ -15893,31 +16645,34 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socket.io-adapter@~2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz" - integrity sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg== +socket.io-adapter@~2.5.2: + version "2.5.5" + resolved "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz#c7a1f9c703d7756844751b6ff9abfc1780664082" + integrity sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg== + dependencies: + debug "~4.3.4" + ws "~8.17.1" -socket.io-parser@~4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz" - integrity sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g== +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== dependencies: - "@types/component-emitter" "^1.2.10" - component-emitter "~1.3.0" + "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" -socket.io@^4.4.1: - version "4.5.0" - resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.5.0.tgz" - integrity sha512-slTYqU2jCgMjXwresG8grhUi/cC6GjzmcfqArzaH3BN/9I/42eZk9yamNvZJdBfTubkjEdKAKs12NEztId+bUA== +socket.io@^4.7.2: + version "4.8.1" + resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz#fa0eaff965cc97fdf4245e8d4794618459f7558a" + integrity sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg== dependencies: accepts "~1.3.4" base64id "~2.0.0" + cors "~2.8.5" debug "~4.3.2" - engine.io "~6.2.0" - socket.io-adapter "~2.4.0" - socket.io-parser "~4.0.4" + engine.io "~6.6.0" + socket.io-adapter "~2.5.2" + socket.io-parser "~4.2.4" socks-proxy-agent@5, socks-proxy-agent@^5.0.0: version "5.0.1" @@ -16027,7 +16782,7 @@ source-map-url@^0.4.0: resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz" integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -16037,16 +16792,16 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3, source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - source-map@^0.7.4: version "0.7.4" resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz" @@ -16069,13 +16824,13 @@ spawn-wrap@^2.0.0: signal-exit "^3.0.2" which "^2.0.1" -spawndamnit@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz" - integrity sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA== +spawndamnit@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/spawndamnit/-/spawndamnit-3.0.1.tgz#44410235d3dc4e21f8e4f740ae3266e4486c2aed" + integrity sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg== dependencies: - cross-spawn "^5.1.0" - signal-exit "^3.0.2" + cross-spawn "^7.0.5" + signal-exit "^4.0.1" spdx-compare@^1.0.0: version "1.0.0" @@ -16164,7 +16919,19 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sqlite3@5.1.6, sqlite3@^5.0.2: +sqlite3@5.1.7: + version "5.1.7" + resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz#59ca1053c1ab38647396586edad019b1551041b7" + integrity sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog== + dependencies: + bindings "^1.5.0" + node-addon-api "^7.0.0" + prebuild-install "^7.1.1" + tar "^6.1.11" + optionalDependencies: + node-gyp "8.x" + +sqlite3@^5.0.2: version "5.1.6" resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz" integrity sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw== @@ -16252,7 +17019,7 @@ stream-exhaust@^1.0.1: resolved "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz" integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== -stream-http@^3.1.0, stream-http@^3.2.0: +stream-http@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz" integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== @@ -16274,13 +17041,6 @@ stream-shift@^1.0.0: resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -stream-transform@^2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz" - integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ== - dependencies: - mixme "^0.5.1" - streamfilter@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz" @@ -16288,15 +17048,6 @@ streamfilter@^3.0.0: dependencies: readable-stream "^3.0.6" -streamroller@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz" - integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA== - dependencies: - date-format "^4.0.3" - debug "^4.1.1" - fs-extra "^10.0.0" - streamroller@^3.0.4: version "3.0.5" resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.0.5.tgz" @@ -16351,6 +17102,19 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string.prototype.trim@^1.2.10: + version "1.2.10" + resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz#40b2dd5ee94c959b4dcfb1d65ce72e90da480c81" + integrity sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + define-data-property "^1.1.4" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-object-atoms "^1.0.0" + has-property-descriptors "^1.0.2" + string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" @@ -16369,15 +17133,6 @@ string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.19.5" - string.prototype.trimend@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" @@ -16387,6 +17142,16 @@ string.prototype.trimend@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" +string.prototype.trimend@^1.0.9: + version "1.0.9" + resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" + integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.2" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz" @@ -16395,15 +17160,6 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.19.5" - string.prototype.trimstart@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" @@ -16607,7 +17363,17 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tar-stream@^2.2.0: +tar-fs@^2.0.0: + version "2.1.2" + resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz#425f154f3404cb16cb8ff6e671d45ab2ed9596c5" + integrity sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.1.4" + +tar-stream@^2.1.4, tar-stream@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== @@ -16696,6 +17462,17 @@ terser-webpack-plugin@^5.1.3: source-map "^0.6.1" terser "^5.7.2" +terser-webpack-plugin@^5.3.10: + version "5.3.11" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz#93c21f44ca86634257cac176f884f942b7ba3832" + integrity sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ== + dependencies: + "@jridgewell/trace-mapping" "^0.3.25" + jest-worker "^27.4.5" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" + terser@5.16.1: version "5.16.1" resolved "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz" @@ -16706,7 +17483,7 @@ terser@5.16.1: commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.17.4: +terser@5.37.0, terser@^5.17.4, terser@^5.31.1: version "5.37.0" resolved "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" integrity sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA== @@ -16809,7 +17586,7 @@ time-stamp@^1.0.0: resolved "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz" integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= -timers-browserify@^2.0.11, timers-browserify@^2.0.12: +timers-browserify@^2.0.12: version "2.0.12" resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz" integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== @@ -16998,10 +17775,10 @@ ts-essentials@9.3.0: resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.3.0.tgz" integrity sha512-XeiCboEyBG8UqXZtXl59bWEi4ZgOqRsogFDI6WDGIF1LmzbYiAkIwjkXN6zZWWl4re/lsOqMlYfe8KA0XiiEPw== -ts-loader@9.5.1: - version "9.5.1" - resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.1.tgz#63d5912a86312f1fbe32cef0859fb8b2193d9b89" - integrity sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg== +ts-loader@9.5.2: + version "9.5.2" + resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.2.tgz#1f3d7f4bb709b487aaa260e8f19b301635d08020" + integrity sha512-Qo4piXvOTWcMGIgRiuFa6nHNm+54HbYaZCKqc9eeZCLRy3XqafQgwX2F7mofrbJG3g7EEb+lkiR+z2Lic2s3Zw== dependencies: chalk "^4.1.0" enhanced-resolve "^5.0.0" @@ -17028,7 +17805,7 @@ ts-node@10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tsconfig-paths@^3.14.1: +tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== @@ -17097,19 +17874,6 @@ tty-browserify@^0.0.1: resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz" integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== -tty-table@^4.1.5: - version "4.1.6" - resolved "https://registry.npmjs.org/tty-table/-/tty-table-4.1.6.tgz" - integrity sha512-kRj5CBzOrakV4VRRY5kUWbNYvo/FpOsz65DzI5op9P+cHov3+IqPbo1JE1ZnQGkHdZgNFDsrEjrfqqy/Ply9fw== - dependencies: - chalk "^4.1.2" - csv "^5.5.0" - kleur "^4.1.4" - smartwrap "^2.0.2" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - yargs "^17.1.1" - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" @@ -17141,10 +17905,10 @@ type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== +type-detect@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" + integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== type-fest@^0.18.0: version "0.18.1" @@ -17218,6 +17982,15 @@ typed-array-buffer@^1.0.2: es-errors "^1.3.0" is-typed-array "^1.1.13" +typed-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" + integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-typed-array "^1.1.14" + typed-array-byte-length@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" @@ -17229,6 +18002,17 @@ typed-array-byte-length@^1.0.1: has-proto "^1.0.3" is-typed-array "^1.1.13" +typed-array-byte-length@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz#8407a04f7d78684f3d252aa1a143d2b77b4160ce" + integrity sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg== + dependencies: + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.14" + typed-array-byte-offset@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" @@ -17241,6 +18025,19 @@ typed-array-byte-offset@^1.0.2: has-proto "^1.0.3" is-typed-array "^1.1.13" +typed-array-byte-offset@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz#ae3698b8ec91a8ab945016108aef00d5bff12355" + integrity sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + for-each "^0.3.3" + gopd "^1.2.0" + has-proto "^1.2.0" + is-typed-array "^1.1.15" + reflect.getprototypeof "^1.0.9" + typed-array-length@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz#57155207c76e64a3457482dfdc1c9d1d3c4c73a3" @@ -17253,6 +18050,18 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typed-array-length@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" + integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + reflect.getprototypeof "^1.0.6" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" @@ -17361,6 +18170,16 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +unbox-primitive@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz#8d9d2c9edeea8460c7f35033a88867944934d1e2" + integrity sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw== + dependencies: + call-bound "^1.0.3" + has-bigints "^1.0.2" + has-symbols "^1.1.0" + which-boxed-primitive "^1.1.1" + unc-path-regex@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz" @@ -17549,13 +18368,13 @@ update-browserslist-db@^1.0.11: escalade "^3.1.1" picocolors "^1.0.0" -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== +update-browserslist-db@^1.1.1: + version "1.1.2" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz#97e9c96ab0ae7bcac08e9ae5151d26e6bc6b5580" + integrity sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" update-notifier-cjs@^5.1.6: version "5.1.6" @@ -17626,7 +18445,7 @@ util-promisify@^2.1.0: dependencies: object.getownpropertydescriptors "^2.0.3" -util@^0.12.0, util@^0.12.1: +util@^0.12.0: version "0.12.4" resolved "https://registry.npmjs.org/util/-/util-0.12.4.tgz" integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== @@ -17819,10 +18638,10 @@ watchpack@^2.2.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== +watchpack@^2.4.1: + version "2.4.2" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -17910,39 +18729,38 @@ webpack-stream@7.0.0: through "^2.3.8" vinyl "^2.2.1" -webpack-virtual-modules@0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz" - integrity sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw== - -webpack@5.76.0: - version "5.76.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz" - integrity sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" +webpack-virtual-modules@0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz#057faa9065c8acf48f24cb57ac0e77739ab9a7e8" + integrity sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ== + +webpack@5.97.1: + version "5.97.1" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" + integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.17.1" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^3.2.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" webpack-sources "^3.2.3" webpack@^5: @@ -18053,6 +18871,46 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz#d76ec27df7fa165f18d5808374a5fe23c29b176e" + integrity sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA== + dependencies: + is-bigint "^1.1.0" + is-boolean-object "^1.2.1" + is-number-object "^1.1.1" + is-string "^1.1.1" + is-symbol "^1.1.1" + +which-builtin-type@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz#89183da1b4907ab089a6b02029cc5d8d6574270e" + integrity sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q== + dependencies: + call-bound "^1.0.2" + function.prototype.name "^1.1.6" + has-tostringtag "^1.0.2" + is-async-function "^2.0.0" + is-date-object "^1.1.0" + is-finalizationregistry "^1.1.0" + is-generator-function "^1.0.10" + is-regex "^1.2.1" + is-weakref "^1.0.2" + isarray "^2.0.5" + which-boxed-primitive "^1.1.0" + which-collection "^1.0.2" + which-typed-array "^1.1.16" + +which-collection@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== + dependencies: + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz" @@ -18063,14 +18921,6 @@ which-module@^2.0.0: resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-pm@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz" - integrity sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w== - dependencies: - load-yaml-file "^0.2.0" - path-exists "^4.0.0" - which-typed-array@^1.1.14, which-typed-array@^1.1.15: version "1.1.15" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" @@ -18082,6 +18932,18 @@ which-typed-array@^1.1.14, which-typed-array@^1.1.15: gopd "^1.0.1" has-tostringtag "^1.0.2" +which-typed-array@^1.1.16, which-typed-array@^1.1.18: + version "1.1.18" + resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz#df2389ebf3fbb246a71390e90730a9edb6ce17ad" + integrity sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.3" + for-each "^0.3.3" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + which-typed-array@^1.1.2: version "1.1.7" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz" @@ -18299,10 +19161,10 @@ ws@^7.2.3: resolved "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz" integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== -ws@~8.2.3: - version "8.2.3" - resolved "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz" - integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== +ws@~8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xdg-basedir@^4.0.0: version "4.0.0" @@ -18382,7 +19244,7 @@ yargs-parser@>=5.0.0-security.0, yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^18.1.2, yargs-parser@^18.1.3: +yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -18439,7 +19301,7 @@ yargs@17.7.2, yargs@^17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yargs@^15.0.2, yargs@^15.1.0: +yargs@^15.0.2: version "15.4.1" resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== From 24a90eeb0ab4162d3ae09b5dfa804edfef8f65d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:41:55 -0800 Subject: [PATCH 079/295] chore(config): migrate config renovate.json (#8723) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- renovate.json | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/renovate.json b/renovate.json index 4c91e21a94c..61c219fbd5c 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,5 @@ { - "extends": [ - "config:js-lib" - ], + "extends": ["config:js-lib"], "lockFileMaintenance": { "enabled": true }, @@ -9,7 +7,7 @@ { "matchUpdateTypes": ["patch", "minor"], "groupName": "all non-major dependencies", - "excludePackageNames": ["typescript"] + "matchPackageNames": ["!typescript"] } ], "ignoreDeps": [ @@ -20,13 +18,7 @@ "@microsoft/tsdoc", "idb" ], - "ignorePaths": [ - "auth/demo", - "auth/cordova/demo", - "auth-compat/demo" - ], - "assignees": [ - "@hsubox76" - ], + "ignorePaths": ["auth/demo", "auth/cordova/demo", "auth-compat/demo"], + "assignees": ["@hsubox76"], "schedule": "before 3am on Friday" } From 190cd6217ccfd322cbac18e779d9b2411ac09dff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:38:12 -0800 Subject: [PATCH 080/295] chore(deps): update actions/setup-node action to v4 (#8712) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-changed-auth.yml | 2 +- .github/workflows/test-changed-firestore.yml | 4 ++-- .github/workflows/test-changed.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index 445c2bfb9b8..b72c7cd9e2d 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -106,7 +106,7 @@ jobs: with: fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 0820d40835d..46d36059d14 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -210,7 +210,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install @@ -228,7 +228,7 @@ jobs: if: ${{ needs.build.outputs.changed == 'true'}} steps: - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Download build archive diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 68a3e2b7830..948267aa9e7 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -85,7 +85,7 @@ jobs: with: fetch-depth: 0 - name: Set up Node (20) - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.10.0 - name: Test setup and yarn install From d75102f842aeff0538a028ecf771909ab3c91310 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:43:30 -0800 Subject: [PATCH 081/295] chore(deps): update dependency firebase-tools to v13 [security] (#8607) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 394 +++++++++++++++++++++++++-------------------------- 2 files changed, 198 insertions(+), 198 deletions(-) diff --git a/package.json b/package.json index c0dc348446d..daec36bcaee 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "eslint-plugin-unused-imports": "3.2.0", "express": "4.21.2", "find-free-port": "2.0.0", - "firebase-tools": "11.30.0", + "firebase-tools": "13.6.0", "glob": "7.2.3", "http-server": "14.1.1", "indexeddbshim": "10.1.0", diff --git a/yarn.lock b/yarn.lock index 2b614f6ed54..1701dd4f468 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3147,6 +3147,11 @@ resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tootallnate/quickjs-emscripten@^0.23.0": + version "0.23.0" + resolved "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" + integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== + "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz" @@ -4127,7 +4132,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.1.1, acorn-walk@^8.2.0: +acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -4152,11 +4157,6 @@ acorn@^8.5.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== -acorn@^8.7.0: - version "8.8.2" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== - acorn@^8.9.0: version "8.12.1" resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" @@ -4177,7 +4177,7 @@ adm-zip@^0.4.9, adm-zip@~0.4.3: resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== -agent-base@6, agent-base@^6.0.0, agent-base@^6.0.2: +agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== @@ -4191,6 +4191,11 @@ agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" +agent-base@^7.1.0, agent-base@^7.1.2: + version "7.1.3" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" + integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== + agentkeepalive@^4.1.3: version "4.1.4" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz" @@ -4305,9 +4310,9 @@ ansi-escapes@^3.0.0: resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: version "4.3.2" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: type-fest "^0.21.3" @@ -4816,9 +4821,9 @@ assign-symbols@^1.0.0: resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@^0.13.2: +ast-types@^0.13.4: version "0.13.4" - resolved "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz" + resolved "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== dependencies: tslib "^2.0.1" @@ -5124,6 +5129,11 @@ basic-auth@^2.0.1, basic-auth@~2.0.1: dependencies: safe-buffer "5.1.2" +basic-ftp@^5.0.2: + version "5.0.5" + resolved "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz#14a474f5fffecca1f4f406f1c26b18f800225ac0" + integrity sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg== + bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" @@ -6735,10 +6745,10 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@3: - version "3.0.1" - resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz" - integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +data-uri-to-buffer@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz#8a58bb67384b261a38ef18bea1810cb01badd28b" + integrity sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw== data-view-buffer@^1.0.1: version "1.0.1" @@ -6926,6 +6936,14 @@ deep-eql@^4.1.3: dependencies: type-detect "^4.0.0" +deep-equal-in-any-order@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/deep-equal-in-any-order/-/deep-equal-in-any-order-2.0.6.tgz#9fb208dfc6836e35e2d4c942db85fc291820318a" + integrity sha512-RfnWHQzph10YrUjvWwhd15Dne8ciSJcZ3U6OD7owPwiVwsdE5IFSoZGg8rlwJD11ES+9H5y8j3fCofviRHOqLQ== + dependencies: + lodash.mapvalues "^4.6.0" + sort-any "^2.0.0" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" @@ -6936,7 +6954,7 @@ deep-freeze@0.0.1: resolved "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz" integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -7024,15 +7042,14 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -degenerator@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/degenerator/-/degenerator-3.0.1.tgz" - integrity sha512-LFsIFEeLPlKvAKXu7j3ssIG6RT0TbI7/GhsqrI0DnHASEQjXQ0LUSYcjJteGgRGmZbl1TnMSxpNQIAiJ7Du5TQ== +degenerator@^5.0.0: + version "5.0.1" + resolved "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz#9403bf297c6dad9a1ece409b37db27954f91f2f5" + integrity sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ== dependencies: - ast-types "^0.13.2" - escodegen "^1.8.1" - esprima "^4.0.0" - vm2 "^3.9.3" + ast-types "^0.13.4" + escodegen "^2.1.0" + esprima "^4.0.1" del@6.1.1: version "6.1.1" @@ -7790,15 +7807,14 @@ escape-string-regexp@^2.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@^1.8.1: - version "1.14.3" - resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== +escodegen@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== dependencies: esprima "^4.0.1" - estraverse "^4.2.0" + estraverse "^5.2.0" esutils "^2.0.2" - optionator "^0.8.1" optionalDependencies: source-map "~0.6.1" @@ -8007,7 +8023,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -8427,7 +8443,7 @@ fast-levenshtein@^1.0.0: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz" integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -8502,9 +8518,9 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -figures@^3.0.0: +figures@^3.0.0, figures@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz" + resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== dependencies: escape-string-regexp "^1.0.5" @@ -8521,11 +8537,6 @@ file-uri-to-path@1.0.0: resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== -file-uri-to-path@2: - version "2.0.0" - resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz" - integrity sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg== - filesize@^6.1.0: version "6.4.0" resolved "https://registry.npmjs.org/filesize/-/filesize-6.4.0.tgz" @@ -8708,10 +8719,10 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" -firebase-tools@11.30.0: - version "11.30.0" - resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-11.30.0.tgz" - integrity sha512-rNMhtsFKy35AZqfy0obY2Kgsfmg8N1duEx2UDT14NsMHB7xt2Z7cUd92bkAoQAfD0jAOd7LhRT/7E6J5yB+kGw== +firebase-tools@13.6.0: + version "13.6.0" + resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-13.6.0.tgz#c71278868f192f5a0a7e0ad3a9227e2810e66bff" + integrity sha512-BXXkFkw8FupINBJHd+aPFRKpvIf8R5P1GyOnWjwsk06kgXXdfFuuYctxkL8e82N4sUomdNP5Q/ru/u2esnoSQA== dependencies: "@google-cloud/pubsub" "^3.0.1" abort-controller "^3.0.0" @@ -8729,15 +8740,18 @@ firebase-tools@11.30.0: cross-env "^5.1.3" cross-spawn "^7.0.3" csv-parse "^5.0.4" + deep-equal-in-any-order "^2.0.6" exegesis "^4.1.0" exegesis-express "^4.0.0" express "^4.16.4" filesize "^6.1.0" form-data "^4.0.0" fs-extra "^10.1.0" + fuzzy "^0.1.3" glob "^7.1.2" google-auth-library "^7.11.0" - inquirer "^8.2.0" + inquirer "^8.2.6" + inquirer-autocomplete-prompt "^2.0.1" js-yaml "^3.13.1" jsonwebtoken "^9.0.0" leven "^3.1.0" @@ -8754,11 +8768,10 @@ firebase-tools@11.30.0: p-limit "^3.0.1" portfinder "^1.0.32" progress "^2.0.3" - proxy-agent "^5.0.0" - request "^2.87.0" + proxy-agent "^6.3.0" retry "^0.13.1" rimraf "^3.0.0" - semver "^5.7.1" + semver "^7.5.2" stream-chain "^2.2.4" stream-json "^1.7.3" strip-ansi "^6.0.1" @@ -9011,14 +9024,6 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -ftp@^0.3.10: - version "0.3.10" - resolved "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz" - integrity sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0= - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" @@ -9056,6 +9061,11 @@ functions-have-names@^1.2.3: resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +fuzzy@^0.1.3: + version "0.1.3" + resolved "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" + integrity sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w== + gauge@^3.0.0: version "3.0.2" resolved "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz" @@ -9269,17 +9279,14 @@ get-symbol-description@^1.1.0: es-errors "^1.3.0" get-intrinsic "^1.2.6" -get-uri@3: - version "3.0.2" - resolved "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz" - integrity sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg== +get-uri@^6.0.1: + version "6.0.4" + resolved "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz#6daaee9e12f9759e19e55ba313956883ef50e0a7" + integrity sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ== dependencies: - "@tootallnate/once" "1" - data-uri-to-buffer "3" - debug "4" - file-uri-to-path "2" - fs-extra "^8.1.0" - ftp "^0.3.10" + basic-ftp "^5.0.2" + data-uri-to-buffer "^6.0.2" + debug "^4.3.4" get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" @@ -10094,7 +10101,7 @@ http-parser-js@>=0.5.1: resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz" integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== -http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1: +http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== @@ -10112,6 +10119,14 @@ http-proxy-agent@^5.0.0: agent-base "6" debug "4" +http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: + version "7.0.2" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" + integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + http-proxy@^1.18.1: version "1.18.1" resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz" @@ -10162,7 +10177,7 @@ https-browserify@^1.0.0: resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@5, https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: +https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz" integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== @@ -10186,6 +10201,14 @@ https-proxy-agent@^5.0.1: agent-base "6" debug "4" +https-proxy-agent@^7.0.6: + version "7.0.6" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" + integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== + dependencies: + agent-base "^7.1.2" + debug "4" + human-id@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz" @@ -10324,7 +10347,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -10357,9 +10380,20 @@ init-package-json@^2.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" -inquirer@8.2.6: +inquirer-autocomplete-prompt@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-2.0.1.tgz#72868aada4d9d36814a6054cbd1ececc63aab0c6" + integrity sha512-jUHrH0btO7j5r8DTQgANf2CBkTZChoVySD8zF/wp5fZCOLIuUbleXhf4ZY5jNBOc1owA3gdfWtfZuppfYBhcUg== + dependencies: + ansi-escapes "^4.3.2" + figures "^3.2.0" + picocolors "^1.0.0" + run-async "^2.4.1" + rxjs "^7.5.4" + +inquirer@8.2.6, inquirer@^8.2.6: version "8.2.6" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== dependencies: ansi-escapes "^4.2.1" @@ -10397,27 +10431,6 @@ inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" -inquirer@^8.2.0: - version "8.2.4" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz" - integrity sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^7.0.0" - install-artifact-from-github@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.2.tgz" @@ -10467,6 +10480,14 @@ invert-kv@^1.0.0: resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= +ip-address@^9.0.5: + version "9.0.5" + resolved "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" + integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== + dependencies: + jsbn "1.1.0" + sprintf-js "^1.1.3" + ip-regex@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz" @@ -11630,6 +11651,11 @@ js-yaml@~3.13.1: argparse "^1.0.7" esprima "^4.0.0" +jsbn@1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" + integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" @@ -12092,14 +12118,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - libnpmaccess@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz" @@ -12368,6 +12386,11 @@ lodash.isplainobject@^4.0.6: resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz" integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= +lodash.mapvalues@^4.6.0: + version "4.6.0" + resolved "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + integrity sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" @@ -12527,7 +12550,7 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^7.7.1: +lru-cache@^7.14.1, lru-cache@^7.7.1: version "7.18.3" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== @@ -13325,9 +13348,9 @@ neo-async@^2.6.0, neo-async@^2.6.2: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -netmask@^2.0.1: +netmask@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz" + resolved "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== next-tick@1, next-tick@^1.1.0: @@ -14030,18 +14053,6 @@ optimist@~0.6.0: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - optionator@^0.9.3: version "0.9.4" resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -14257,29 +14268,27 @@ p-waterfall@^2.1.1: dependencies: p-reduce "^2.0.0" -pac-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz" - integrity sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ== +pac-proxy-agent@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz#da7c3b5c4cccc6655aaafb701ae140fb23f15df2" + integrity sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw== dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - get-uri "3" - http-proxy-agent "^4.0.1" - https-proxy-agent "5" - pac-resolver "^5.0.0" - raw-body "^2.2.0" - socks-proxy-agent "5" + "@tootallnate/quickjs-emscripten" "^0.23.0" + agent-base "^7.1.2" + debug "^4.3.4" + get-uri "^6.0.1" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.6" + pac-resolver "^7.0.1" + socks-proxy-agent "^8.0.5" -pac-resolver@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/pac-resolver/-/pac-resolver-5.0.0.tgz" - integrity sha512-H+/A6KitiHNNW+bxBKREk2MCGSxljfqRX76NjummWEYIat7ldVXRU3dhRIE3iXZ0nvGBk6smv3nntxKkzRL8NA== +pac-resolver@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz#54675558ea368b64d210fd9c92a640b5f3b8abb6" + integrity sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg== dependencies: - degenerator "^3.0.1" - ip "^1.1.5" - netmask "^2.0.1" + degenerator "^5.0.0" + netmask "^2.0.2" package-hash@^4.0.0: version "4.0.0" @@ -14776,11 +14785,6 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - prettier@2.8.7: version "2.8.7" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz" @@ -14970,21 +14974,21 @@ proxy-addr@~2.0.5, proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz" - integrity sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g== +proxy-agent@^6.3.0: + version "6.5.0" + resolved "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz#9e49acba8e4ee234aacb539f89ed9c23d02f232d" + integrity sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A== dependencies: - agent-base "^6.0.0" - debug "4" - http-proxy-agent "^4.0.0" - https-proxy-agent "^5.0.0" - lru-cache "^5.1.1" - pac-proxy-agent "^5.0.0" - proxy-from-env "^1.0.0" - socks-proxy-agent "^5.0.0" + agent-base "^7.1.2" + debug "^4.3.4" + http-proxy-agent "^7.0.1" + https-proxy-agent "^7.0.6" + lru-cache "^7.14.1" + pac-proxy-agent "^7.1.0" + proxy-from-env "^1.1.0" + socks-proxy-agent "^8.0.5" -proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: +proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== @@ -15184,7 +15188,7 @@ raw-body@2.5.2: iconv-lite "0.4.24" unpipe "1.0.0" -raw-body@^2.2.0, raw-body@^2.3.3: +raw-body@^2.3.3: version "2.4.1" resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz" integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== @@ -15340,16 +15344,6 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@1.1.x: - version "1.1.14" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - "readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" @@ -15981,9 +15975,9 @@ router@^1.3.1: setprototypeof "1.2.0" utils-merge "1.0.1" -run-async@^2.4.0: +run-async@^2.4.0, run-async@^2.4.1: version "2.4.1" - resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" + resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: @@ -16007,6 +16001,13 @@ rxjs@^7.2.0: dependencies: tslib "~2.1.0" +rxjs@^7.5.4: + version "7.8.1" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + rxjs@^7.5.5: version "7.5.5" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" @@ -16225,7 +16226,7 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.6.3, semver@^7.5.4, semver@^7.6.0: +semver@7.6.3, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -16674,7 +16675,7 @@ socket.io@^4.7.2: socket.io-adapter "~2.5.2" socket.io-parser "~4.2.4" -socks-proxy-agent@5, socks-proxy-agent@^5.0.0: +socks-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz" integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== @@ -16701,6 +16702,15 @@ socks-proxy-agent@^7.0.0: debug "^4.3.3" socks "^2.6.2" +socks-proxy-agent@^8.0.5: + version "8.0.5" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" + integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== + dependencies: + agent-base "^7.1.2" + debug "^4.3.4" + socks "^2.8.3" + socks@^2.3.3, socks@^2.6.1: version "2.6.1" resolved "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz" @@ -16717,6 +16727,21 @@ socks@^2.6.2: ip "^2.0.0" smart-buffer "^4.2.0" +socks@^2.8.3: + version "2.8.3" + resolved "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" + integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== + dependencies: + ip-address "^9.0.5" + smart-buffer "^4.2.0" + +sort-any@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/sort-any/-/sort-any-2.0.0.tgz#62a5409c9905c9483f03e41e17f46cc451aa7c55" + integrity sha512-T9JoiDewQEmWcnmPn/s9h/PH9t3d/LSWi0RgVmXSuDYeZXTZOZ1/wrK2PHaptuR1VXe3clLLt0pD6sgVOwjNEA== + dependencies: + lodash "^4.17.21" + sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz" @@ -16914,6 +16939,11 @@ split@^1.0.0: dependencies: through "2" +sprintf-js@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" + integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -17176,11 +17206,6 @@ string_decoder@^1.1.1, string_decoder@^1.3.0: dependencies: safe-buffer "~5.2.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" @@ -17893,13 +17918,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" @@ -18602,14 +18620,6 @@ vm-browserify@^1.1.2: resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -vm2@^3.9.3: - version "3.9.17" - resolved "https://registry.npmjs.org/vm2/-/vm2-3.9.17.tgz" - integrity sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw== - dependencies: - acorn "^8.7.0" - acorn-walk "^8.2.0" - void-elements@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz" @@ -19026,11 +19036,6 @@ word-wrap@^1.2.5: resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" @@ -19184,11 +19189,6 @@ xmlbuilder@~11.0.0: resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" - integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= - xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" From 105d248bd4ddf5d38d5fa7b8a3ec57af2abf459a Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 23 Jan 2025 14:57:41 -0800 Subject: [PATCH 082/295] Have renovate ignore karma-webpack (#8725) --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 61c219fbd5c..84f519c91cb 100644 --- a/renovate.json +++ b/renovate.json @@ -16,7 +16,8 @@ "rollup-plugin-copy-assets", "typedoc", "@microsoft/tsdoc", - "idb" + "idb", + "karma-webpack" ], "ignorePaths": ["auth/demo", "auth/cordova/demo", "auth-compat/demo"], "assignees": ["@hsubox76"], From 178ad99b9758b1661d72e87fa48b1d4c81c627b5 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Fri, 24 Jan 2025 10:46:39 -0500 Subject: [PATCH 083/295] Workflow CI: Update CHROME_VALIDATED_VERSION for Auth tests (#8722) Update our CI's logged `CHROME_VALIDATED_VERSION` to the currently tested version. We haven't updated it in a while. Keeping this up to date should reduce support burden later. --- .github/workflows/test-all.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index b7d40bc7245..dabab3befda 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -23,8 +23,8 @@ env: # the behavior to use the new URLs. CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/ CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public - CHROME_VALIDATED_VERSION: linux-120.0.6099.71 - CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." + CHROME_VALIDATED_VERSION: linux-132.0.6834.110 + CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass, or rollback the installed Chrome version if tests fail." artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" @@ -117,13 +117,9 @@ jobs: npx @puppeteer/browsers install chrome@stable chromeVersionString=$(ls chrome) if [ "$CHROME_VALIDATED_VERSION" != "$chromeVersionString" ]; then - echo "::warning ::The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." + echo "::warning ::${CHROME_VERSION_MISMATCH_MESSAGE}" echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString" - echo "CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE" >> "$GITHUB_ENV" fi - - name: Test Evn TEMP - run: | - echo $CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE - name: Download build archive uses: actions/download-artifact@v4 with: From 59ae45e483f7c9b58552b65f2b3c30bbb2ab400a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:12:40 -0800 Subject: [PATCH 084/295] chore(deps): update dependency @rollup/plugin-json to v6 (#8727) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/package.json | 2 +- packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/firestore/package.json | 2 +- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/vertexai/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- yarn.lock | 30 ++++++++++++++++------ 23 files changed, 44 insertions(+), 30 deletions(-) diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ffa55dc2f91..0e50f815b95 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -24,7 +24,7 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/analytics/package.json b/packages/analytics/package.json index bed1ec9cc14..04d355db083 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -50,7 +50,7 @@ "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 2f6ed16c384..136c8f8d9e9 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -46,7 +46,7 @@ "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 1e45d9c9f4a..549952605b4 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -47,7 +47,7 @@ "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 4f3765c4776..b07216da96e 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -45,7 +45,7 @@ }, "devDependencies": { "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" diff --git a/packages/app/package.json b/packages/app/package.json index b37581acfdf..13d559b2ca9 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -45,7 +45,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 0792ce03100..327ae216cb5 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -58,7 +58,7 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app-compat": "0.2.48", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/packages/auth/package.json b/packages/auth/package.json index 8ec7985aae2..1a01abde449 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -132,7 +132,7 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", "chromedriver": "119.0.1", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index d0b5a7a2e57..4bb8d65ee06 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -110,7 +110,7 @@ "@firebase/app-compat": "0.2.48", "@firebase/auth": "1.8.2", "@rollup/plugin-alias": "5.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", "@types/json-stable-stringify": "1.0.36", "chai-exclude": "2.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 141534dcaa7..f46ccc3bc2b 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/functions/package.json b/packages/functions/package.json index d860ebde8dd..d15d563a3aa 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -51,7 +51,7 @@ "devDependencies": { "@firebase/app": "0.10.18", "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 47b1f9ad998..4299b616a60 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -47,7 +47,7 @@ "@firebase/app-compat": "0.2.48", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", diff --git a/packages/installations/package.json b/packages/installations/package.json index a337b35ba87..34481a64f3c 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -52,7 +52,7 @@ "@firebase/app": "0.10.18", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index c62d79c4068..f79649f4ef0 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -45,7 +45,7 @@ }, "devDependencies": { "@firebase/app-compat": "0.2.48", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "ts-essentials": "9.3.0", "typescript": "5.5.4" diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 8851077bea4..e07da34ea45 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -63,7 +63,7 @@ "@firebase/app": "0.10.18", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "ts-essentials": "10.0.2", "typescript": "5.5.4" }, diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index eaa45c99e4f..ae04fe61a14 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", diff --git a/packages/performance/package.json b/packages/performance/package.json index 493ccc46dc3..7ede315be8a 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ "devDependencies": { "@firebase/app": "0.10.18", "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index a5c0a7e9432..7116a6999d9 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4", diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index fe0f1c5ab7e..fb576dcabfa 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -47,7 +47,7 @@ "@firebase/app-compat": "0.2.48", "@firebase/auth-compat": "0.5.17", "rollup": "2.79.1", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/storage/package.json b/packages/storage/package.json index b1204cca8fe..b88b6782ef4 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -58,7 +58,7 @@ "@firebase/auth": "1.8.2", "rollup": "2.79.1", "@rollup/plugin-alias": "5.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.31.2", "typescript": "5.5.4" }, diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 5acf318b6e4..7e0e313f393 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -57,7 +57,7 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 1ee0ba0cfcf..62daf7689dd 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -24,7 +24,7 @@ "@firebase/logger": "0.4.4", "@firebase/util": "1.10.3", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", "@rollup/plugin-virtual": "2.1.0", "@types/webpack": "5.28.5", diff --git a/yarn.lock b/yarn.lock index 1701dd4f468..c5aae630549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2932,12 +2932,12 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-json@4.1.0": - version "4.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz" - integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== +"@rollup/plugin-json@6.1.0": + version "6.1.0" + resolved "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz#fbe784e29682e9bb6dee28ea75a1a83702e7b805" + integrity sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA== dependencies: - "@rollup/pluginutils" "^3.0.8" + "@rollup/pluginutils" "^5.1.0" "@rollup/plugin-node-resolve@13.3.0": version "13.3.0" @@ -2974,7 +2974,7 @@ resolved "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.1.0.tgz" integrity sha512-CPPAtlKT53HFqC8jFHb/V5WErpU8Hrq2TyCR0A7kPQMlF2wNUf0o1xuAc+Qxj8NCZM0Z3Yvl+FbUXfJjVWqDwA== -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -2991,6 +2991,15 @@ estree-walker "^2.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^5.1.0": + version "5.1.4" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a" + integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^4.0.2" + "@rtsao/scc@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" @@ -3294,7 +3303,7 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/estree@^1.0.6": +"@types/estree@^1.0.0", "@types/estree@^1.0.6": version "1.0.6" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== @@ -8043,7 +8052,7 @@ estree-walker@^1.0.1: resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== -estree-walker@^2.0.1: +estree-walker@^2.0.1, estree-walker@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== @@ -14626,6 +14635,11 @@ picomatch@^2.3.1: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pidtree@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.5.0.tgz#ad5fbc1de78b8a5f99d6fbdd4f6e4eee21d1aca1" From fb5df426bdb9a9b22b1587528df49f7950b729d7 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:12:14 -0700 Subject: [PATCH 085/295] PPL multiple entry points (#8717) * Multiple entry points for main package. * MEP for firestore lite building * Fix issue with external exports * Refactor to support multiple entry points for the lite SDK. Fixes import issues and makes code organization across /pipelines and /lite/pipeliens * Type and comment cleanup * Make PipelineSource generic and remove useFluentPipelines * Remove converter and placeholders for converter. * cleanup: remove documentReferenceFactory * Linting and formatting * Update the typings export for pipelines and lite pipelines so that it auguments the Firestore and Query classes. * Add missing Expr export * Lint fixes * TODOs cleanup * update api review * Query to Proto with integration tests * API tweaks from review. Selectable, FilterCondition, and Accumulator are abstract classes not interfaces. Removed extraneous Pipeline.sort overload * Remove console.log statements from prune-dts.ts * code cleanup in prune-dts * Add missing imports to pipelines.ts --- .../firestore-lite-pipelines.api.md | 2020 ++++++++++++++ common/api-review/firestore-lite.api.md | 12 +- common/api-review/firestore-pipelines.api.md | 1354 +++++++++ common/api-review/firestore.api.md | 978 ++----- .../firebase/firestore/pipelines/index.ts | 18 + .../firebase/firestore/pipelines/package.json | 7 + packages/firebase/package.json | 12 + packages/firestore/.eslintrc.js | 2 +- packages/firestore/externs.json | 2 + packages/firestore/lite/index.ts | 167 -- .../firestore/lite/pipelines/package.json | 14 + .../firestore/lite/pipelines/pipelines.d.ts | 28 + .../firestore/lite/pipelines/pipelines.ts | 210 ++ packages/firestore/package.json | 45 +- packages/firestore/pipelines/package.json | 14 + packages/firestore/pipelines/pipelines.d.ts | 31 + .../firestore/pipelines/pipelines.node.ts | 18 + packages/firestore/pipelines/pipelines.rn.ts | 18 + packages/firestore/pipelines/pipelines.ts | 51 + packages/firestore/rollup.config.js | 48 +- packages/firestore/rollup.config.lite.js | 54 +- packages/firestore/src/all_packages.ts | 25 + packages/firestore/src/api.ts | 169 -- packages/firestore/src/api/pipeline-source.ts | 100 - packages/firestore/src/api/pipeline.ts | 82 +- packages/firestore/src/api/pipeline_impl.ts | 92 +- packages/firestore/src/api_pipelines.ts | 13 +- .../firestore/src/core/firestore_client.ts | 2 +- packages/firestore/src/core/pipeline-util.ts | 281 +- packages/firestore/src/lite-api/database.ts | 2 - .../firestore/src/lite-api/expressions.ts | 172 +- .../firestore/src/lite-api/pipeline-result.ts | 25 +- .../firestore/src/lite-api/pipeline-source.ts | 73 +- packages/firestore/src/lite-api/pipeline.ts | 204 +- .../firestore/src/lite-api/pipeline_impl.ts | 66 +- packages/firestore/src/lite-api/stage.ts | 13 +- packages/firestore/src/remote/datastore.ts | 2 +- packages/firestore/src/util/proto.ts | 155 ++ .../test/integration/api/pipeline.test.ts | 2455 +++++++++++------ .../test/integration/util/firebase_export.ts | 1 + repo-scripts/prune-dts/extract-public-api.ts | 19 +- repo-scripts/prune-dts/prune-dts.ts | 127 +- 42 files changed, 6472 insertions(+), 2709 deletions(-) create mode 100644 common/api-review/firestore-lite-pipelines.api.md create mode 100644 common/api-review/firestore-pipelines.api.md create mode 100644 packages/firebase/firestore/pipelines/index.ts create mode 100644 packages/firebase/firestore/pipelines/package.json create mode 100644 packages/firestore/lite/pipelines/package.json create mode 100644 packages/firestore/lite/pipelines/pipelines.d.ts create mode 100644 packages/firestore/lite/pipelines/pipelines.ts create mode 100644 packages/firestore/pipelines/package.json create mode 100644 packages/firestore/pipelines/pipelines.d.ts create mode 100644 packages/firestore/pipelines/pipelines.node.ts create mode 100644 packages/firestore/pipelines/pipelines.rn.ts create mode 100644 packages/firestore/pipelines/pipelines.ts create mode 100644 packages/firestore/src/all_packages.ts delete mode 100644 packages/firestore/src/api/pipeline-source.ts create mode 100644 packages/firestore/src/util/proto.ts diff --git a/common/api-review/firestore-lite-pipelines.api.md b/common/api-review/firestore-lite-pipelines.api.md new file mode 100644 index 00000000000..d1536c8a626 --- /dev/null +++ b/common/api-review/firestore-lite-pipelines.api.md @@ -0,0 +1,2020 @@ +## API Report File for "@firebase/firestore-lite-pipelines" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { FirebaseApp } from '@firebase/app'; + +// @beta +export interface Accumulator { + // (undocumented) + accumulator: true; + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export type AccumulatorTarget = ExprWithAlias; + +// @beta (undocumented) +export class Add extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function add(left: Accumulator, right: Accumulator): Add; + +// @beta +export function add(left: Accumulator, right: any): Add; + +// @beta +export function add(left: string, right: Accumulator): Add; + +// @beta +export function add(left: string, right: any): Add; + +// @beta (undocumented) +export class AddFields implements Stage { + constructor(fields: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Aggregate implements Stage { + constructor(accumulators: Map, groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class And extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta (undocumented) +export class ArrayConcat extends FirestoreFunction { + constructor(array: Accumulator, elements: Accumulator[]); + } + +// @beta +export function arrayConcat(array: Accumulator, elements: Accumulator[]): ArrayConcat; + +// @beta +export function arrayConcat(array: Accumulator, elements: any[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: Accumulator[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: any[]): ArrayConcat; + +// @beta (undocumented) +export class ArrayContains extends FirestoreFunction implements FilterCondition { + constructor(array: Accumulator, element: Accumulator); + // (undocumented) + filterable: true; +} + +// @beta +export function arrayContains(array: Accumulator, element: Accumulator): ArrayContains; + +// @beta +export function arrayContains(array: Accumulator, element: any): ArrayContains; + +// @beta +export function arrayContains(array: string, element: Accumulator): ArrayContains; + +// @beta +export function arrayContains(array: string, element: any): ArrayContains; + +// @beta (undocumented) +export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { + constructor(array: Accumulator, values: Accumulator[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAll(array: Accumulator, values: Accumulator[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: Accumulator, values: any[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: Accumulator[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; + +// @beta (undocumented) +export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { + constructor(array: Accumulator, values: Accumulator[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAny(array: Accumulator, values: Accumulator[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: Accumulator, values: any[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: Accumulator[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; + +// @beta (undocumented) +export class ArrayElement extends FirestoreFunction { + constructor(); +} + +// @beta (undocumented) +export class ArrayLength extends FirestoreFunction { + constructor(array: Accumulator); + } + +// @beta +export function arrayLength(array: Accumulator): ArrayLength; + +// @beta (undocumented) +export class ArrayReverse extends FirestoreFunction { + constructor(array: Accumulator); + } + +// @beta +export function ascending(expr: Accumulator): Ordering; + +// @beta (undocumented) +export class Avg extends FirestoreFunction implements Accumulator { + constructor(value: Accumulator, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta (undocumented) +export class ByteLength extends FirestoreFunction { + constructor(value: Accumulator); + } + +// @beta +export function byteLength(expr: Accumulator): ByteLength; + +// @beta +export function byteLength(field: string): ByteLength; + +// @beta (undocumented) +export class CharLength extends FirestoreFunction { + constructor(value: Accumulator); + } + +// @beta +export function charLength(field: string): CharLength; + +// @beta +export function charLength(expr: Accumulator): CharLength; + +// @beta (undocumented) +export class CollectionGroupSource implements Stage { + constructor(collectionId: string); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class CollectionSource implements Stage { + constructor(collectionPath: string); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Cond extends FirestoreFunction { + constructor(condition: FilterCondition, thenExpr: Accumulator, elseExpr: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function cond(condition: FilterCondition, thenExpr: Accumulator, elseExpr: Accumulator): Cond; + +// @beta +export class Constant { + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + static of(value: number): Constant; + static of(value: string): Constant; + static of(value: boolean): Constant; + static of(value: null): Constant; + static of(value: undefined): Constant; + // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts + static of(value: GeoPoint): Constant; + // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts + static of(value: Timestamp): Constant; + static of(value: Date): Constant; + static of(value: Uint8Array): Constant; + // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts + static of(value: DocumentReference): Constant; + static of(value: any[]): Constant; + static of(value: Map): Constant; + static of(value: VectorValue): Constant; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + static vector(value: number[] | VectorValue): Constant; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class CosineDistance extends FirestoreFunction { + constructor(vector1: Accumulator, vector2: Accumulator); + } + +// @beta +export function cosineDistance(expr: string, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: Accumulator): CosineDistance; + +// @beta +export function cosineDistance(expr: Accumulator, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: Accumulator, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: Accumulator, other: Accumulator): CosineDistance; + +// @beta (undocumented) +export class Count extends FirestoreFunction implements Accumulator { + constructor(value: Accumulator | undefined, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function countAll(): Count; + +// @beta (undocumented) +export class DatabaseSource implements Stage { + // (undocumented) + name: string; +} + +// @beta +export function descending(expr: Accumulator): Ordering; + +// @beta (undocumented) +export class Distinct implements Stage { + constructor(groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Divide extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function divide(left: Accumulator, right: Accumulator): Divide; + +// @beta +export function divide(left: Accumulator, right: any): Divide; + +// @beta +export function divide(left: string, right: Accumulator): Divide; + +// @beta +export function divide(left: string, right: any): Divide; + +// @beta (undocumented) +export class DocumentsSource implements Stage { + constructor(docPaths: string[]); + // (undocumented) + name: string; + // (undocumented) + static of(refs: DocumentReference[]): DocumentsSource; +} + +// @beta (undocumented) +export class DotProduct extends FirestoreFunction { + constructor(vector1: Accumulator, vector2: Accumulator); + } + +// @beta +export function dotProduct(expr: string, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: string, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: string, other: Accumulator): DotProduct; + +// @beta +export function dotProduct(expr: Accumulator, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: Accumulator, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: Accumulator, other: Accumulator): DotProduct; + +// @beta (undocumented) +export class EndsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, suffix: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function endsWith(expr: string, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: string, suffix: Accumulator): EndsWith; + +// @beta +export function endsWith(expr: Accumulator, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: Accumulator, suffix: Accumulator): EndsWith; + +// @beta (undocumented) +export class Eq extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function eq(left: Accumulator, right: Accumulator): Eq; + +// @beta +export function eq(left: Accumulator, right: any): Eq; + +// @beta +export function eq(left: string, right: Accumulator): Eq; + +// @beta +export function eq(left: string, right: any): Eq; + +// @beta (undocumented) +export class EqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, others: Accumulator[]); + // (undocumented) + filterable: true; + } + +// @beta +export function eqAny(element: Accumulator, others: Accumulator[]): EqAny; + +// @beta +export function eqAny(element: Accumulator, others: any[]): EqAny; + +// @beta +export function eqAny(element: string, others: Accumulator[]): EqAny; + +// @beta +export function eqAny(element: string, others: any[]): EqAny; + +// @beta (undocumented) +export class EuclideanDistance extends FirestoreFunction { + constructor(vector1: Accumulator, vector2: Accumulator); + } + +// @beta +export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: Accumulator): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Accumulator, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Accumulator, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Accumulator, other: Accumulator): EuclideanDistance; + +// @beta +export function execute(pipeline: Pipeline): Promise; + +// @beta (undocumented) +export class Exists extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator); + // (undocumented) + filterable: true; +} + +// @beta +export function exists(value: Accumulator): Exists; + +// @beta +export function exists(field: string): Exists; + +// @beta +export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; + +// @beta (undocumented) +export class ExprWithAlias implements Selectable { + constructor(expr: T, alias: string); + add(other: Accumulator): Add; + add(other: any): Add; + // (undocumented) + readonly alias: string; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + readonly expr: T; + // (undocumented) + exprType: ExprType; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export class Field implements Selectable { + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldName(): string; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + static of(name: string): Field; + // Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts + // + // (undocumented) + static of(path: FieldPath): Field; + // (undocumented) + static of(pipeline: Pipeline, name: string): Field; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class Fields implements Selectable { + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldList(): Field[]; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + // (undocumented) + static of(name: string, ...others: string[]): Fields; + // (undocumented) + static ofAll(): Fields; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export interface FilterCondition { + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + // (undocumented) + filterable: true; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class FindNearest implements Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export interface FindNearestOptions { + // (undocumented) + distanceField?: string; + // (undocumented) + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + // (undocumented) + field: Field; + // (undocumented) + limit?: number; + // (undocumented) + vectorValue: VectorValue | number[]; +} + +// @beta +export class FirestoreFunction { + constructor(name: string, params: Accumulator[]); + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export function genericFunction(name: string, params: Accumulator[]): FirestoreFunction; + +// @beta (undocumented) +export class GenericStage implements Stage { + constructor(name: string, params: unknown[]); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Gt extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function gt(left: Accumulator, right: Accumulator): Gt; + +// @beta +export function gt(left: Accumulator, right: any): Gt; + +// @beta +export function gt(left: string, right: Accumulator): Gt; + +// @beta +export function gt(left: string, right: any): Gt; + +// @beta (undocumented) +export class Gte extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function gte(left: Accumulator, right: Accumulator): Gte; + +// @beta +export function gte(left: Accumulator, right: any): Gte; + +// @beta +export function gte(left: string, right: Accumulator): Gte; + +// @beta +export function gte(left: string, right: any): Gte; + +// @beta (undocumented) +export class IsNan extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator); + // (undocumented) + filterable: true; +} + +// @beta +export function isNan(value: Accumulator): IsNan; + +// @beta +export function isNan(value: string): IsNan; + +// @beta (undocumented) +export class Like extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, pattern: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function like(left: string, pattern: string): Like; + +// @beta +export function like(left: string, pattern: Accumulator): Like; + +// @beta +export function like(left: Accumulator, pattern: string): Like; + +// @beta +export function like(left: Accumulator, pattern: Accumulator): Like; + +// @beta (undocumented) +export class Limit implements Stage { + constructor(limit: number, convertedFromLimitTolast?: boolean); + // (undocumented) + readonly convertedFromLimitTolast: boolean; + // (undocumented) + readonly limit: number; + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class LogicalMaximum extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function logicalMaximum(left: Accumulator, right: Accumulator): LogicalMaximum; + +// @beta +export function logicalMaximum(left: Accumulator, right: any): LogicalMaximum; + +// @beta +export function logicalMaximum(left: string, right: Accumulator): LogicalMaximum; + +// @beta +export function logicalMaximum(left: string, right: any): LogicalMaximum; + +// @beta (undocumented) +export class LogicalMinimum extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function logicalMinimum(left: Accumulator, right: Accumulator): LogicalMinimum; + +// @beta +export function logicalMinimum(left: Accumulator, right: any): LogicalMinimum; + +// @beta +export function logicalMinimum(left: string, right: Accumulator): LogicalMinimum; + +// @beta +export function logicalMinimum(left: string, right: any): LogicalMinimum; + +// @beta (undocumented) +export class Lt extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function lt(left: Accumulator, right: Accumulator): Lt; + +// @beta +export function lt(left: Accumulator, right: any): Lt; + +// @beta +export function lt(left: string, right: Accumulator): Lt; + +// @beta +export function lt(left: string, right: any): Lt; + +// @beta (undocumented) +export class Lte extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function lte(left: Accumulator, right: Accumulator): Lte; + +// @beta +export function lte(left: Accumulator, right: any): Lte; + +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Accumulator" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta +// +// @public +export function lte(left: string, right: Accumulator): Lte; + +// @beta +export function lte(left: string, right: any): Lte; + +// @beta (undocumented) +export class MapGet extends FirestoreFunction { + constructor(map: Accumulator, name: string); +} + +// @beta +export function mapGet(mapField: string, subField: string): MapGet; + +// @beta +export function mapGet(mapExpr: Accumulator, subField: string): MapGet; + +// @beta (undocumented) +export class Maximum extends FirestoreFunction implements Accumulator { + constructor(value: Accumulator, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function maximum(value: Accumulator): Maximum; + +// @beta +export function maximum(value: string): Maximum; + +// @beta (undocumented) +export class Minimum extends FirestoreFunction implements Accumulator { + constructor(value: Accumulator, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function minimum(value: Accumulator): Minimum; + +// @beta +export function minimum(value: string): Minimum; + +// @beta (undocumented) +export class Mod extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function mod(left: Accumulator, right: Accumulator): Mod; + +// @beta +export function mod(left: Accumulator, right: any): Mod; + +// @beta +export function mod(left: string, right: Accumulator): Mod; + +// @beta +export function mod(left: string, right: any): Mod; + +// @beta (undocumented) +export class Multiply extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function multiply(left: Accumulator, right: Accumulator): Multiply; + +// @beta +export function multiply(left: Accumulator, right: any): Multiply; + +// @beta +export function multiply(left: string, right: Accumulator): Multiply; + +// @beta +export function multiply(left: string, right: any): Multiply; + +// @beta (undocumented) +export class Neq extends FirestoreFunction implements FilterCondition { + constructor(left: Accumulator, right: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function neq(left: Accumulator, right: Accumulator): Neq; + +// @beta +export function neq(left: Accumulator, right: any): Neq; + +// @beta +export function neq(left: string, right: Accumulator): Neq; + +// @beta +export function neq(left: string, right: any): Neq; + +// @beta (undocumented) +export class Not extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator); + // (undocumented) + filterable: true; +} + +// @beta +export function not(filter: FilterCondition): Not; + +// @beta +export function notEqAny(element: Accumulator, others: Accumulator[]): FirestoreFunction; + +// @beta +export function notEqAny(element: Accumulator, others: any[]): FirestoreFunction; + +// @beta +export function notEqAny(element: string, others: Accumulator[]): FirestoreFunction; + +// @beta +export function notEqAny(element: string, others: any[]): FirestoreFunction; + +// @beta (undocumented) +export class Offset implements Stage { + constructor(offset: number); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export class Or extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta +export class Ordering { + constructor(expr: Accumulator, direction: 'ascending' | 'descending'); + // (undocumented) + readonly direction: 'ascending' | 'descending'; + // (undocumented) + readonly expr: Accumulator; +} + +// @public +export class Pipeline { + /* Excluded from this release type: _db */ + // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta + addFields(...fields: Selectable[]): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + /* Excluded from this release type: _userDataWriter */ + aggregate(options: { + accumulators: AccumulatorTarget[]; + groups?: Array; + }): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta + distinct(...groups: Array): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + execute(): Promise; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta + // + // (undocumented) + findNearest(options: FindNearestOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ + genericStage(name: string, params: any[]): Pipeline; + /* Excluded from this release type: _userDataWriter */ + limit(limit: number): Pipeline; + /* Excluded from this release type: _userDataWriter */ + offset(offset: number): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta + select(...selections: Array): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta + sort(...orderings: Ordering[]): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // (undocumented) + sort(options: { + orderings: Ordering[]; + }): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta + where(condition: FilterCondition): Pipeline; +} + +// Warning: (ae-forgotten-export) The symbol "Firestore" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta +// +// @public +export function pipeline(firestore: Firestore): PipelineSource; + +// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts +// +// @public +export function pipeline(query: Query): Pipeline; + +// Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts +// +// @beta +export class PipelineResult { + /* Excluded from this release type: _ref */ + /* Excluded from this release type: _fields */ + /* Excluded from this release type: __constructor */ + get createTime(): Timestamp | undefined; + data(): AppModelType | undefined; + get executionTime(): Timestamp; + get(fieldPath: string | FieldPath): any; + get id(): string | undefined; + get ref(): DocumentReference | undefined; + get updateTime(): Timestamp | undefined; +} + +// @beta +export class PipelineSource { + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + // (undocumented) + collection(collectionPath: string): PipelineType; + // (undocumented) + collectionGroup(collectionId: string): PipelineType; + // (undocumented) + database(): PipelineType; + // (undocumented) + documents(docs: DocumentReference[]): PipelineType; +} + +// @beta (undocumented) +export class RegexContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, pattern: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function regexContains(left: string, pattern: string): RegexContains; + +// @beta +export function regexContains(left: string, pattern: Accumulator): RegexContains; + +// @beta +export function regexContains(left: Accumulator, pattern: string): RegexContains; + +// @beta +export function regexContains(left: Accumulator, pattern: Accumulator): RegexContains; + +// @beta (undocumented) +export class RegexMatch extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, pattern: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function regexMatch(left: string, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: string, pattern: Accumulator): RegexMatch; + +// @beta +export function regexMatch(left: Accumulator, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: Accumulator, pattern: Accumulator): RegexMatch; + +// @beta (undocumented) +export class ReplaceAll extends FirestoreFunction { + constructor(value: Accumulator, find: Accumulator, replace: Accumulator); + } + +// @beta +export function replaceAll(value: Accumulator, find: string, replace: string): ReplaceAll; + +// @beta +export function replaceAll(value: Accumulator, find: Accumulator, replace: Accumulator): ReplaceAll; + +// @beta +export function replaceAll(field: string, find: string, replace: string): ReplaceAll; + +// @beta (undocumented) +export class ReplaceFirst extends FirestoreFunction { + constructor(value: Accumulator, find: Accumulator, replace: Accumulator); + } + +// @beta +export function replaceFirst(value: Accumulator, find: string, replace: string): ReplaceFirst; + +// @beta +export function replaceFirst(value: Accumulator, find: Accumulator, replace: Accumulator): ReplaceFirst; + +// @beta +export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; + +// @beta (undocumented) +export class Reverse extends FirestoreFunction { + constructor(value: Accumulator); + } + +// @beta +export function reverse(expr: Accumulator): Reverse; + +// @beta +export function reverse(field: string): Reverse; + +// @beta (undocumented) +export class Select implements Stage { + constructor(projections: Map); + // (undocumented) + name: string; + } + +// @beta +export interface Selectable { + add(other: Accumulator): Add; + add(other: any): Add; + arrayConcat(...arrays: Accumulator[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Accumulator): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Accumulator): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Accumulator): Divide; + divide(other: any): Divide; + dotProduct(other: Accumulator): DotProduct; + dotProduct(other: VectorValue): DotProduct; + // (undocumented) + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Accumulator): EndsWith; + eq(other: Accumulator): Eq; + eq(other: any): Eq; + eqAny(...others: Accumulator[]): EqAny; + // (undocumented) + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Accumulator): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + // (undocumented) + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + exprType: ExprType; + gt(other: Accumulator): Gt; + gt(other: any): Gt; + gte(other: Accumulator): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + // (undocumented) + like(pattern: Accumulator): Like; + logicalMaximum(other: Accumulator): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Accumulator): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Accumulator): Lt; + lt(other: any): Lt; + lte(other: Accumulator): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Accumulator): Mod; + mod(other: any): Mod; + multiply(other: Accumulator): Multiply; + multiply(other: any): Multiply; + neq(other: Accumulator): Neq; + neq(other: any): Neq; + notEqAny(...others: Accumulator[]): FirestoreFunction; + // (undocumented) + notEqAny(...others: any[]): FirestoreFunction; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Accumulator): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Accumulator): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; + reverse(): Reverse; + // (undocumented) + selectable: true; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Accumulator): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Accumulator): StrContains; + subtract(other: Accumulator): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta (undocumented) +export class Sort implements Stage { + constructor(orders: Ordering[]); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export interface Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class StartsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, prefix: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function startsWith(expr: string, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: string, prefix: Accumulator): StartsWith; + +// @beta +export function startsWith(expr: Accumulator, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: Accumulator, prefix: Accumulator): StartsWith; + +// @beta (undocumented) +export class StrConcat extends FirestoreFunction { + constructor(first: Accumulator, rest: Accumulator[]); + } + +// @beta +export function strConcat(first: string, ...elements: Array): StrConcat; + +// @beta +export function strConcat(first: Accumulator, ...elements: Array): StrConcat; + +// @beta (undocumented) +export class StrContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Accumulator, substring: Accumulator); + // (undocumented) + filterable: true; + } + +// @beta +export function strContains(left: string, substring: string): StrContains; + +// @beta +export function strContains(left: string, substring: Accumulator): StrContains; + +// @beta +export function strContains(left: Accumulator, substring: string): StrContains; + +// @beta +export function strContains(left: Accumulator, substring: Accumulator): StrContains; + +// @beta (undocumented) +export class Subtract extends FirestoreFunction { + constructor(left: Accumulator, right: Accumulator); + } + +// @beta +export function subtract(left: Accumulator, right: Accumulator): Subtract; + +// @beta +export function subtract(left: Accumulator, right: any): Subtract; + +// @beta +export function subtract(left: string, right: Accumulator): Subtract; + +// @beta +export function subtract(left: string, right: any): Subtract; + +// @beta (undocumented) +export class Sum extends FirestoreFunction implements Accumulator { + constructor(value: Accumulator, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta (undocumented) +export class TimestampAdd extends FirestoreFunction { + constructor(timestamp: Accumulator, unit: Accumulator, amount: Accumulator); + } + +// @beta +export function timestampAdd(timestamp: Accumulator, unit: Accumulator, amount: Accumulator): TimestampAdd; + +// @beta +export function timestampAdd(timestamp: Accumulator, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta +export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta (undocumented) +export class TimestampSub extends FirestoreFunction { + constructor(timestamp: Accumulator, unit: Accumulator, amount: Accumulator); + } + +// @beta +export function timestampSub(timestamp: Accumulator, unit: Accumulator, amount: Accumulator): TimestampSub; + +// @beta +export function timestampSub(timestamp: Accumulator, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta +export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta (undocumented) +export class TimestampToUnixMicros extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function timestampToUnixMicros(expr: Accumulator): TimestampToUnixMicros; + +// @beta +export function timestampToUnixMicros(field: string): TimestampToUnixMicros; + +// @beta (undocumented) +export class TimestampToUnixMillis extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function timestampToUnixMillis(expr: Accumulator): TimestampToUnixMillis; + +// @beta +export function timestampToUnixMillis(field: string): TimestampToUnixMillis; + +// @beta (undocumented) +export class TimestampToUnixSeconds extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function timestampToUnixSeconds(expr: Accumulator): TimestampToUnixSeconds; + +// @beta +export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; + +// @beta (undocumented) +export class ToLower extends FirestoreFunction { + constructor(expr: Accumulator); + } + +// @beta +export function toLower(expr: string): ToLower; + +// @beta +export function toLower(expr: Accumulator): ToLower; + +// @beta (undocumented) +export class ToUpper extends FirestoreFunction { + constructor(expr: Accumulator); + } + +// @beta +export function toUpper(expr: string): ToUpper; + +// @beta +export function toUpper(expr: Accumulator): ToUpper; + +// @beta (undocumented) +export class Trim extends FirestoreFunction { + constructor(expr: Accumulator); + } + +// @beta +export function trim(expr: string): Trim; + +// @beta +export function trim(expr: Accumulator): Trim; + +// @beta (undocumented) +export class UnixMicrosToTimestamp extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function unixMicrosToTimestamp(expr: Accumulator): UnixMicrosToTimestamp; + +// @beta +export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; + +// @beta (undocumented) +export class UnixMillisToTimestamp extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function unixMillisToTimestamp(expr: Accumulator): UnixMillisToTimestamp; + +// @beta +export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; + +// @beta (undocumented) +export class UnixSecondsToTimestamp extends FirestoreFunction { + constructor(input: Accumulator); + } + +// @beta +export function unixSecondsToTimestamp(expr: Accumulator): UnixSecondsToTimestamp; + +// @beta +export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; + +// @beta (undocumented) +export class VectorLength extends FirestoreFunction { + constructor(value: Accumulator); + } + +// @beta +export function vectorLength(expr: Accumulator): VectorLength; + +// @beta +export function vectorLength(field: string): VectorLength; + +// @beta (undocumented) +export class Where implements Stage { + constructor(condition: FilterCondition); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Xor extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta +export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor; + + +// Warnings were encountered during analysis: +// +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10253:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10254:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10283:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta + +// (No @packageDocumentation comment for this package) + +``` diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 7435e2a250e..29c373ff3c1 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -1310,7 +1310,11 @@ export function like(left: Constant, pattern: Constant): Like; // @beta (undocumented) export class Limit implements Stage { - constructor(limit: number); + constructor(limit: number, convertedFromLimitTolast?: boolean); + // (undocumented) + readonly convertedFromLimitTolast: boolean; + // (undocumented) + readonly limit: number; // (undocumented) name: string; } @@ -2204,8 +2208,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9238:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9239:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9268:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9239:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9240:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9269:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/common/api-review/firestore-pipelines.api.md b/common/api-review/firestore-pipelines.api.md new file mode 100644 index 00000000000..375f5dfd976 --- /dev/null +++ b/common/api-review/firestore-pipelines.api.md @@ -0,0 +1,1354 @@ +## API Report File for "@firebase/firestore-pipelines" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { FirebaseApp } from '@firebase/app'; + +// @beta +export interface Accumulator extends Expr { + // (undocumented) + accumulator: true; +} + +// @beta +export type AccumulatorTarget = ExprWithAlias; + +// @beta (undocumented) +export class Add extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function add(left: Expr, right: Expr): Add; + +// @beta +export function add(left: Expr, right: any): Add; + +// @beta +export function add(left: string, right: Expr): Add; + +// @beta +export function add(left: string, right: any): Add; + +// @beta (undocumented) +export class AddFields implements Stage { + constructor(fields: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Aggregate implements Stage { + constructor(accumulators: Map, groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class And extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta +export function andFunction(left: FilterCondition, ...right: FilterCondition[]): And; + +// @beta (undocumented) +export class ArrayConcat extends FirestoreFunction { + constructor(array: Expr, elements: Expr[]); + } + +// @beta +export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; + +// @beta +export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; + +// @beta +export function arrayConcat(array: string, elements: any[]): ArrayConcat; + +// @beta (undocumented) +export class ArrayContains extends FirestoreFunction implements FilterCondition { + constructor(array: Expr, element: Expr); + // (undocumented) + filterable: true; +} + +// @beta +export function arrayContains(array: Expr, element: Expr): ArrayContains; + +// @beta +export function arrayContains(array: Expr, element: any): ArrayContains; + +// @beta +export function arrayContains(array: string, element: Expr): ArrayContains; + +// @beta +export function arrayContains(array: string, element: any): ArrayContains; + +// @beta (undocumented) +export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { + constructor(array: Expr, values: Expr[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: Expr[]): ArrayContainsAll; + +// @beta +export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; + +// @beta (undocumented) +export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { + constructor(array: Expr, values: Expr[]); + // (undocumented) + filterable: true; + } + +// @beta +export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: Expr[]): ArrayContainsAny; + +// @beta +export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; + +// @beta (undocumented) +export class ArrayElement extends FirestoreFunction { + constructor(); +} + +// @beta (undocumented) +export class ArrayLength extends FirestoreFunction { + constructor(array: Expr); + } + +// @beta +export function arrayLength(array: Expr): ArrayLength; + +// @beta (undocumented) +export class ArrayReverse extends FirestoreFunction { + constructor(array: Expr); + } + +// @beta +export function ascending(expr: Expr): Ordering; + +// @beta (undocumented) +export class Avg extends FirestoreFunction implements Accumulator { + constructor(value: Expr, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function avgFunction(value: Expr): Avg; + +// @beta +export function avgFunction(value: string): Avg; + +// @beta (undocumented) +export class ByteLength extends FirestoreFunction { + constructor(value: Expr); + } + +// @beta +export function byteLength(expr: Expr): ByteLength; + +// @beta +export function byteLength(field: string): ByteLength; + +// @beta (undocumented) +export class CharLength extends FirestoreFunction { + constructor(value: Expr); + } + +// @beta +export function charLength(field: string): CharLength; + +// @beta +export function charLength(expr: Expr): CharLength; + +// @beta (undocumented) +export class CollectionGroupSource implements Stage { + constructor(collectionId: string); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class CollectionSource implements Stage { + constructor(collectionPath: string); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Cond extends FirestoreFunction { + constructor(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function cond(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr): Cond; + +// @beta +export class Constant extends Expr { + // (undocumented) + exprType: ExprType; + static of(value: number): Constant; + static of(value: string): Constant; + static of(value: boolean): Constant; + static of(value: null): Constant; + static of(value: undefined): Constant; + // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts + static of(value: GeoPoint): Constant; + // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts + static of(value: Timestamp): Constant; + static of(value: Date): Constant; + static of(value: Uint8Array): Constant; + // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts + static of(value: DocumentReference): Constant; + static of(value: any[]): Constant; + static of(value: Map): Constant; + // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts + static of(value: VectorValue): Constant; + static vector(value: number[] | VectorValue): Constant; +} + +// @beta (undocumented) +export class CosineDistance extends FirestoreFunction { + constructor(vector1: Expr, vector2: Expr); + } + +// @beta +export function cosineDistance(expr: string, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: string, other: Expr): CosineDistance; + +// @beta +export function cosineDistance(expr: Expr, other: number[]): CosineDistance; + +// @beta +export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; + +// @beta +export function cosineDistance(expr: Expr, other: Expr): CosineDistance; + +// @beta (undocumented) +export class Count extends FirestoreFunction implements Accumulator { + constructor(value: Expr | undefined, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function countAll(): Count; + +// @beta +export function countFunction(value: Expr): Count; + +// Warning: (ae-incompatible-release-tags) The symbol "countFunction" is marked as @public, but its signature references "Count" which is marked as @beta +// +// @public +export function countFunction(value: string): Count; + +// @beta (undocumented) +export class DatabaseSource implements Stage { + // (undocumented) + name: string; +} + +// @beta +export function descending(expr: Expr): Ordering; + +// @beta (undocumented) +export class Distinct implements Stage { + constructor(groups: Map); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Divide extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function divide(left: Expr, right: Expr): Divide; + +// @beta +export function divide(left: Expr, right: any): Divide; + +// @beta +export function divide(left: string, right: Expr): Divide; + +// @beta +export function divide(left: string, right: any): Divide; + +// @beta (undocumented) +export class DocumentsSource implements Stage { + constructor(docPaths: string[]); + // (undocumented) + name: string; + // (undocumented) + static of(refs: DocumentReference[]): DocumentsSource; +} + +// @beta (undocumented) +export class DotProduct extends FirestoreFunction { + constructor(vector1: Expr, vector2: Expr); + } + +// @beta +export function dotProduct(expr: string, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: string, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: string, other: Expr): DotProduct; + +// @beta +export function dotProduct(expr: Expr, other: number[]): DotProduct; + +// @beta +export function dotProduct(expr: Expr, other: VectorValue): DotProduct; + +// @beta +export function dotProduct(expr: Expr, other: Expr): DotProduct; + +// @beta (undocumented) +export class EndsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, suffix: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function endsWith(expr: string, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: string, suffix: Expr): EndsWith; + +// @beta +export function endsWith(expr: Expr, suffix: string): EndsWith; + +// @beta +export function endsWith(expr: Expr, suffix: Expr): EndsWith; + +// @beta (undocumented) +export class Eq extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function eq(left: Expr, right: Expr): Eq; + +// @beta +export function eq(left: Expr, right: any): Eq; + +// @beta +export function eq(left: string, right: Expr): Eq; + +// @beta +export function eq(left: string, right: any): Eq; + +// @beta (undocumented) +export class EqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, others: Expr[]); + // (undocumented) + filterable: true; + } + +// @beta +export function eqAny(element: Expr, others: Expr[]): EqAny; + +// @beta +export function eqAny(element: Expr, others: any[]): EqAny; + +// @beta +export function eqAny(element: string, others: Expr[]): EqAny; + +// @beta +export function eqAny(element: string, others: any[]): EqAny; + +// @beta (undocumented) +export class EuclideanDistance extends FirestoreFunction { + constructor(vector1: Expr, vector2: Expr); + } + +// @beta +export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Expr, other: number[]): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Expr, other: VectorValue): EuclideanDistance; + +// @beta +export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; + +// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta +// +// @public (undocumented) +export function execute(pipeline: Pipeline): Promise; + +// @beta (undocumented) +export class Exists extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr); + // (undocumented) + filterable: true; +} + +// @beta +export function exists(value: Expr): Exists; + +// @beta +export function exists(field: string): Exists; + +// @beta +export abstract class Expr { + add(other: Expr): Add; + add(other: any): Add; + arrayConcat(...arrays: Expr[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Expr): ArrayContains; + arrayContains(element: any): ArrayContains; + arrayContainsAll(...values: Expr[]): ArrayContainsAll; + arrayContainsAll(...values: any[]): ArrayContainsAll; + arrayContainsAny(...values: Expr[]): ArrayContainsAny; + arrayContainsAny(...values: any[]): ArrayContainsAny; + arrayLength(): ArrayLength; + as(name: string): ExprWithAlias; + ascending(): Ordering; + avg(): Avg; + byteLength(): ByteLength; + charLength(): CharLength; + cosineDistance(other: Expr): CosineDistance; + cosineDistance(other: VectorValue): CosineDistance; + cosineDistance(other: number[]): CosineDistance; + count(): Count; + descending(): Ordering; + divide(other: Expr): Divide; + divide(other: any): Divide; + dotProduct(other: Expr): DotProduct; + dotProduct(other: VectorValue): DotProduct; + dotProduct(other: number[]): DotProduct; + endsWith(suffix: string): EndsWith; + endsWith(suffix: Expr): EndsWith; + eq(other: Expr): Eq; + eq(other: any): Eq; + eqAny(...others: Expr[]): EqAny; + eqAny(...others: any[]): EqAny; + euclideanDistance(other: Expr): EuclideanDistance; + euclideanDistance(other: VectorValue): EuclideanDistance; + euclideanDistance(other: number[]): EuclideanDistance; + exists(): Exists; + // (undocumented) + abstract exprType: ExprType; + gt(other: Expr): Gt; + gt(other: any): Gt; + gte(other: Expr): Gte; + gte(other: any): Gte; + isNaN(): IsNan; + like(pattern: string): Like; + like(pattern: Expr): Like; + logicalMaximum(other: Expr): LogicalMaximum; + logicalMaximum(other: any): LogicalMaximum; + logicalMinimum(other: Expr): LogicalMinimum; + logicalMinimum(other: any): LogicalMinimum; + lt(other: Expr): Lt; + lt(other: any): Lt; + lte(other: Expr): Lte; + lte(other: any): Lte; + mapGet(subfield: string): MapGet; + maximum(): Maximum; + minimum(): Minimum; + mod(other: Expr): Mod; + mod(other: any): Mod; + multiply(other: Expr): Multiply; + multiply(other: any): Multiply; + neq(other: Expr): Neq; + neq(other: any): Neq; + notEqAny(...others: Expr[]): NotEqAny; + notEqAny(...others: any[]): NotEqAny; + regexContains(pattern: string): RegexContains; + regexContains(pattern: Expr): RegexContains; + regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: Expr): RegexMatch; + replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: Expr, replace: Expr): ReplaceAll; + replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: Expr, replace: Expr): ReplaceFirst; + reverse(): Reverse; + startsWith(prefix: string): StartsWith; + startsWith(prefix: Expr): StartsWith; + strConcat(...elements: Array): StrConcat; + strContains(substring: string): StrContains; + strContains(expr: Expr): StrContains; + subtract(other: Expr): Subtract; + subtract(other: any): Subtract; + sum(): Sum; + timestampAdd(unit: Expr, amount: Expr): TimestampAdd; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + timestampSub(unit: Expr, amount: Expr): TimestampSub; + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + timestampToUnixMicros(): TimestampToUnixMicros; + timestampToUnixMillis(): TimestampToUnixMillis; + timestampToUnixSeconds(): TimestampToUnixSeconds; + toLower(): ToLower; + toUpper(): ToUpper; + trim(): Trim; + unixMicrosToTimestamp(): UnixMicrosToTimestamp; + unixMillisToTimestamp(): UnixMillisToTimestamp; + unixSecondsToTimestamp(): UnixSecondsToTimestamp; + vectorLength(): VectorLength; +} + +// @beta +export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; + +// @beta (undocumented) +export class ExprWithAlias extends Expr implements Selectable { + constructor(expr: T, alias: string); + // (undocumented) + readonly alias: string; + // (undocumented) + readonly expr: T; + // (undocumented) + exprType: ExprType; + // (undocumented) + selectable: true; +} + +// @beta +export class Field extends Expr implements Selectable { + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldName(): string; + static of(name: string): Field; + // Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts + // + // (undocumented) + static of(path: FieldPath): Field; + // (undocumented) + static of(pipeline: Pipeline, name: string): Field; + // (undocumented) + selectable: true; +} + +// @beta (undocumented) +export class Fields extends Expr implements Selectable { + // (undocumented) + exprType: ExprType; + // (undocumented) + fieldList(): Field[]; + // (undocumented) + static of(name: string, ...others: string[]): Fields; + // (undocumented) + static ofAll(): Fields; + // (undocumented) + selectable: true; +} + +// @beta +export interface FilterCondition extends Expr { + // (undocumented) + filterable: true; +} + +// @beta (undocumented) +export class FindNearest implements Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export interface FindNearestOptions { + // (undocumented) + distanceField?: string; + // (undocumented) + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + // (undocumented) + field: Field; + // (undocumented) + limit?: number; + // (undocumented) + vectorValue: VectorValue | number[]; +} + +// @beta +export class FirestoreFunction extends Expr { + constructor(name: string, params: Expr[]); + // (undocumented) + exprType: ExprType; + } + +// @beta +export function genericFunction(name: string, params: Expr[]): FirestoreFunction; + +// @beta (undocumented) +export class GenericStage implements Stage { + constructor(name: string, params: unknown[]); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Gt extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function gt(left: Expr, right: Expr): Gt; + +// @beta +export function gt(left: Expr, right: any): Gt; + +// @beta +export function gt(left: string, right: Expr): Gt; + +// @beta +export function gt(left: string, right: any): Gt; + +// @beta (undocumented) +export class Gte extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function gte(left: Expr, right: Expr): Gte; + +// @beta +export function gte(left: Expr, right: any): Gte; + +// @beta +export function gte(left: string, right: Expr): Gte; + +// @beta +export function gte(left: string, right: any): Gte; + +// @beta (undocumented) +export class IsNan extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr); + // (undocumented) + filterable: true; +} + +// @beta +export function isNan(value: Expr): IsNan; + +// @beta +export function isNan(value: string): IsNan; + +// @beta (undocumented) +export class Like extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, pattern: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function like(left: string, pattern: string): Like; + +// @beta +export function like(left: string, pattern: Expr): Like; + +// @beta +export function like(left: Expr, pattern: string): Like; + +// @beta +export function like(left: Expr, pattern: Expr): Like; + +// @beta (undocumented) +export class Limit implements Stage { + constructor(limit: number, convertedFromLimitTolast?: boolean); + // (undocumented) + readonly convertedFromLimitTolast: boolean; + // (undocumented) + readonly limit: number; + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class LogicalMaximum extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; + +// @beta +export function logicalMaximum(left: Expr, right: any): LogicalMaximum; + +// @beta +export function logicalMaximum(left: string, right: Expr): LogicalMaximum; + +// @beta +export function logicalMaximum(left: string, right: any): LogicalMaximum; + +// @beta (undocumented) +export class LogicalMinimum extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; + +// @beta +export function logicalMinimum(left: Expr, right: any): LogicalMinimum; + +// @beta +export function logicalMinimum(left: string, right: Expr): LogicalMinimum; + +// @beta +export function logicalMinimum(left: string, right: any): LogicalMinimum; + +// @beta (undocumented) +export class Lt extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function lt(left: Expr, right: Expr): Lt; + +// @beta +export function lt(left: Expr, right: any): Lt; + +// @beta +export function lt(left: string, right: Expr): Lt; + +// @beta +export function lt(left: string, right: any): Lt; + +// @beta (undocumented) +export class Lte extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function lte(left: Expr, right: Expr): Lte; + +// @beta +export function lte(left: Expr, right: any): Lte; + +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta +// +// @public +export function lte(left: string, right: Expr): Lte; + +// @beta +export function lte(left: string, right: any): Lte; + +// @beta (undocumented) +export class MapGet extends FirestoreFunction { + constructor(map: Expr, name: string); +} + +// @beta +export function mapGet(mapField: string, subField: string): MapGet; + +// @beta +export function mapGet(mapExpr: Expr, subField: string): MapGet; + +// @beta (undocumented) +export class Maximum extends FirestoreFunction implements Accumulator { + constructor(value: Expr, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function maximum(value: Expr): Maximum; + +// @beta +export function maximum(value: string): Maximum; + +// @beta (undocumented) +export class Minimum extends FirestoreFunction implements Accumulator { + constructor(value: Expr, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function minimum(value: Expr): Minimum; + +// @beta +export function minimum(value: string): Minimum; + +// @beta (undocumented) +export class Mod extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function mod(left: Expr, right: Expr): Mod; + +// @beta +export function mod(left: Expr, right: any): Mod; + +// @beta +export function mod(left: string, right: Expr): Mod; + +// @beta +export function mod(left: string, right: any): Mod; + +// @beta (undocumented) +export class Multiply extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function multiply(left: Expr, right: Expr): Multiply; + +// @beta +export function multiply(left: Expr, right: any): Multiply; + +// @beta +export function multiply(left: string, right: Expr): Multiply; + +// @beta +export function multiply(left: string, right: any): Multiply; + +// @beta (undocumented) +export class Neq extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, right: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function neq(left: Expr, right: Expr): Neq; + +// @beta +export function neq(left: Expr, right: any): Neq; + +// @beta +export function neq(left: string, right: Expr): Neq; + +// @beta +export function neq(left: string, right: any): Neq; + +// @beta (undocumented) +export class Not extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr); + // (undocumented) + filterable: true; +} + +// @beta +export function not(filter: FilterCondition): Not; + +// @beta (undocumented) +export class NotEqAny extends FirestoreFunction implements FilterCondition { + constructor(left: Expr, others: Expr[]); + // (undocumented) + filterable: true; + } + +// @beta +export function notEqAny(element: Expr, others: Expr[]): NotEqAny; + +// @beta +export function notEqAny(element: Expr, others: any[]): NotEqAny; + +// @beta +export function notEqAny(element: string, others: Expr[]): NotEqAny; + +// @beta +export function notEqAny(element: string, others: any[]): NotEqAny; + +// @beta (undocumented) +export class Offset implements Stage { + constructor(offset: number); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export class Or extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta +export class Ordering { + constructor(expr: Expr, direction: 'ascending' | 'descending'); + // (undocumented) + readonly direction: 'ascending' | 'descending'; + // (undocumented) + readonly expr: Expr; +} + +// @beta +export function orFunction(left: FilterCondition, ...right: FilterCondition[]): Or; + +// @public (undocumented) +export class Pipeline { + /* Excluded from this release type: newPipeline */ + // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta + addFields(...fields: Selectable[]): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta + distinct(...groups: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + execute(): Promise; + // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta + // + // (undocumented) + findNearest(options: FindNearestOptions): Pipeline; + genericStage(name: string, params: any[]): Pipeline; + limit(limit: number): Pipeline; + offset(offset: number): Pipeline; + readUserData: any; + // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta + select(...selections: Array): Pipeline; + // (undocumented) + selectablesToMap: any; + // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta + sort(...orderings: Ordering[]): Pipeline; + // (undocumented) + sort(options: { orderings: Ordering[]; }): Pipeline; + // (undocumented) + stages: any; + // (undocumented) + userDataReader: any; + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta + where(condition: FilterCondition): Pipeline; +} + +// Warning: (ae-forgotten-export) The symbol "Firestore" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta +// +// @public +export function pipeline(firestore: Firestore): PipelineSource; + +// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts +// +// @public +export function pipeline(query: Query): Pipeline; + +// Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts +// +// @beta +export class PipelineResult { + /* Excluded from this release type: _ref */ + /* Excluded from this release type: _fields */ + /* Excluded from this release type: __constructor */ + get createTime(): Timestamp | undefined; + data(): AppModelType | undefined; + get executionTime(): Timestamp; + get(fieldPath: string | FieldPath): any; + get id(): string | undefined; + get ref(): DocumentReference | undefined; + get updateTime(): Timestamp | undefined; +} + +// @beta +export class PipelineSource { + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + // (undocumented) + collection(collectionPath: string): PipelineType; + // (undocumented) + collectionGroup(collectionId: string): PipelineType; + // (undocumented) + database(): PipelineType; + // (undocumented) + documents(docs: DocumentReference[]): PipelineType; +} + +// @beta (undocumented) +export class RegexContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, pattern: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function regexContains(left: string, pattern: string): RegexContains; + +// @beta +export function regexContains(left: string, pattern: Expr): RegexContains; + +// @beta +export function regexContains(left: Expr, pattern: string): RegexContains; + +// @beta +export function regexContains(left: Expr, pattern: Expr): RegexContains; + +// @beta (undocumented) +export class RegexMatch extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, pattern: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function regexMatch(left: string, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: string, pattern: Expr): RegexMatch; + +// @beta +export function regexMatch(left: Expr, pattern: string): RegexMatch; + +// @beta +export function regexMatch(left: Expr, pattern: Expr): RegexMatch; + +// @beta (undocumented) +export class ReplaceAll extends FirestoreFunction { + constructor(value: Expr, find: Expr, replace: Expr); + } + +// @beta +export function replaceAll(value: Expr, find: string, replace: string): ReplaceAll; + +// @beta +export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; + +// @beta +export function replaceAll(field: string, find: string, replace: string): ReplaceAll; + +// @beta (undocumented) +export class ReplaceFirst extends FirestoreFunction { + constructor(value: Expr, find: Expr, replace: Expr); + } + +// @beta +export function replaceFirst(value: Expr, find: string, replace: string): ReplaceFirst; + +// @beta +export function replaceFirst(value: Expr, find: Expr, replace: Expr): ReplaceFirst; + +// @beta +export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; + +// @beta (undocumented) +export class Reverse extends FirestoreFunction { + constructor(value: Expr); + } + +// @beta +export function reverse(expr: Expr): Reverse; + +// @beta +export function reverse(field: string): Reverse; + +// @beta (undocumented) +export class Select implements Stage { + constructor(projections: Map); + // (undocumented) + name: string; + } + +// @beta +export interface Selectable extends Expr { + // (undocumented) + selectable: true; +} + +// @beta (undocumented) +export class Sort implements Stage { + constructor(orders: Ordering[]); + // (undocumented) + name: string; + } + +// @beta (undocumented) +export interface Stage { + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class StartsWith extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, prefix: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function startsWith(expr: string, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: string, prefix: Expr): StartsWith; + +// @beta +export function startsWith(expr: Expr, prefix: string): StartsWith; + +// @beta +export function startsWith(expr: Expr, prefix: Expr): StartsWith; + +// @beta (undocumented) +export class StrConcat extends FirestoreFunction { + constructor(first: Expr, rest: Expr[]); + } + +// @beta +export function strConcat(first: string, ...elements: Array): StrConcat; + +// @beta +export function strConcat(first: Expr, ...elements: Array): StrConcat; + +// @beta (undocumented) +export class StrContains extends FirestoreFunction implements FilterCondition { + constructor(expr: Expr, substring: Expr); + // (undocumented) + filterable: true; + } + +// @beta +export function strContains(left: string, substring: string): StrContains; + +// @beta +export function strContains(left: string, substring: Expr): StrContains; + +// @beta +export function strContains(left: Expr, substring: string): StrContains; + +// @beta +export function strContains(left: Expr, substring: Expr): StrContains; + +// @beta (undocumented) +export class Subtract extends FirestoreFunction { + constructor(left: Expr, right: Expr); + } + +// @beta +export function subtract(left: Expr, right: Expr): Subtract; + +// @beta +export function subtract(left: Expr, right: any): Subtract; + +// @beta +export function subtract(left: string, right: Expr): Subtract; + +// @beta +export function subtract(left: string, right: any): Subtract; + +// @beta (undocumented) +export class Sum extends FirestoreFunction implements Accumulator { + constructor(value: Expr, distinct: boolean); + // (undocumented) + accumulator: true; + } + +// @beta +export function sumFunction(value: Expr): Sum; + +// @beta +export function sumFunction(value: string): Sum; + +// @beta (undocumented) +export class TimestampAdd extends FirestoreFunction { + constructor(timestamp: Expr, unit: Expr, amount: Expr); + } + +// @beta +export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): TimestampAdd; + +// @beta +export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta +export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; + +// @beta (undocumented) +export class TimestampSub extends FirestoreFunction { + constructor(timestamp: Expr, unit: Expr, amount: Expr); + } + +// @beta +export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): TimestampSub; + +// @beta +export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta +export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; + +// @beta (undocumented) +export class TimestampToUnixMicros extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; + +// @beta +export function timestampToUnixMicros(field: string): TimestampToUnixMicros; + +// @beta (undocumented) +export class TimestampToUnixMillis extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; + +// @beta +export function timestampToUnixMillis(field: string): TimestampToUnixMillis; + +// @beta (undocumented) +export class TimestampToUnixSeconds extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; + +// @beta +export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; + +// @beta (undocumented) +export class ToLower extends FirestoreFunction { + constructor(expr: Expr); + } + +// @beta +export function toLower(expr: string): ToLower; + +// @beta +export function toLower(expr: Expr): ToLower; + +// @beta (undocumented) +export class ToUpper extends FirestoreFunction { + constructor(expr: Expr); + } + +// @beta +export function toUpper(expr: string): ToUpper; + +// @beta +export function toUpper(expr: Expr): ToUpper; + +// @beta (undocumented) +export class Trim extends FirestoreFunction { + constructor(expr: Expr); + } + +// @beta +export function trim(expr: string): Trim; + +// @beta +export function trim(expr: Expr): Trim; + +// @beta (undocumented) +export class UnixMicrosToTimestamp extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; + +// @beta +export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; + +// @beta (undocumented) +export class UnixMillisToTimestamp extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; + +// @beta +export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; + +// @beta (undocumented) +export class UnixSecondsToTimestamp extends FirestoreFunction { + constructor(input: Expr); + } + +// @beta +export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; + +// @beta +export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; + +// @beta (undocumented) +export class VectorLength extends FirestoreFunction { + constructor(value: Expr); + } + +// @beta +export function vectorLength(expr: Expr): VectorLength; + +// @beta +export function vectorLength(field: string): VectorLength; + +// @beta (undocumented) +export class Where implements Stage { + constructor(condition: FilterCondition); + // (undocumented) + name: string; +} + +// @beta (undocumented) +export class Xor extends FirestoreFunction implements FilterCondition { + constructor(conditions: FilterCondition[]); + // (undocumented) + filterable: true; +} + +// @beta +export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor; + + +// Warnings were encountered during analysis: +// +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:3983:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:3983:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4010:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta + +// (No @packageDocumentation comment for this package) + +``` diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 37317520020..6f0e14206c2 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -10,27 +10,27 @@ import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; // @beta -export interface Accumulator { +export interface Accumulator extends Expr { // (undocumented) accumulator: true; } // @beta -export type AccumulatorTarget = ExprWithAlias; +export type AccumulatorTarget = ExprWithAlias; // @beta (undocumented) export class Add extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function add(left: Constant, right: Constant): Add; +export function add(left: Expr, right: Expr): Add; // @beta -export function add(left: Constant, right: any): Add; +export function add(left: Expr, right: any): Add; // @beta -export function add(left: string, right: Constant): Add; +export function add(left: string, right: Expr): Add; // @beta export function add(left: string, right: any): Add; @@ -40,7 +40,7 @@ export function addDoc(reference // @beta (undocumented) export class AddFields implements Stage { - constructor(fields: Map); + constructor(fields: Map); // (undocumented) name: string; } @@ -52,7 +52,7 @@ export type AddPrefixToKeys, groups: Map); + constructor(accumulators: Map, groups: Map); // (undocumented) name: string; } @@ -95,7 +95,7 @@ export type AggregateType = 'count' | 'avg' | 'sum'; // @beta (undocumented) export class And extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterExpr[]); + constructor(conditions: (FilterCondition)[]); // (undocumented) filterable: true; } @@ -104,78 +104,78 @@ export class And extends FirestoreFunction implements FilterCondition { export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; // @beta -export function andFunction(left: FilterExpr, ...right: FilterExpr[]): And; +export function andFunction(left: FilterCondition, ...right: (FilterCondition)[]): And; // @beta (undocumented) export class ArrayConcat extends FirestoreFunction { - constructor(array: Constant, elements: Constant[]); + constructor(array: Expr, elements: Expr[]); } // @beta -export function arrayConcat(array: Constant, elements: Constant[]): ArrayConcat; +export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; // @beta -export function arrayConcat(array: Constant, elements: any[]): ArrayConcat; +export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; // @beta -export function arrayConcat(array: string, elements: Constant[]): ArrayConcat; +export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; // @beta export function arrayConcat(array: string, elements: any[]): ArrayConcat; // @beta (undocumented) export class ArrayContains extends FirestoreFunction implements FilterCondition { - constructor(array: Constant, element: Constant); + constructor(array: Expr, element: Expr); // (undocumented) filterable: true; } // @beta -export function arrayContains(array: Constant, element: Constant): ArrayContains; +export function arrayContains(array: Expr, element: Expr): ArrayContains; // @beta -export function arrayContains(array: Constant, element: any): ArrayContains; +export function arrayContains(array: Expr, element: any): ArrayContains; // @beta -export function arrayContains(array: string, element: Constant): ArrayContains; +export function arrayContains(array: string, element: Expr): ArrayContains; // @beta export function arrayContains(array: string, element: any): ArrayContains; // @beta (undocumented) export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { - constructor(array: Constant, values: Constant[]); + constructor(array: Expr, values: Expr[]); // (undocumented) filterable: true; } // @beta -export function arrayContainsAll(array: Constant, values: Constant[]): ArrayContainsAll; +export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; // @beta -export function arrayContainsAll(array: Constant, values: any[]): ArrayContainsAll; +export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; // @beta -export function arrayContainsAll(array: string, values: Constant[]): ArrayContainsAll; +export function arrayContainsAll(array: string, values: Expr[]): ArrayContainsAll; // @beta export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; // @beta (undocumented) export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { - constructor(array: Constant, values: Constant[]); + constructor(array: Expr, values: Expr[]); // (undocumented) filterable: true; } // @beta -export function arrayContainsAny(array: Constant, values: Constant[]): ArrayContainsAny; +export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; // @beta -export function arrayContainsAny(array: Constant, values: any[]): ArrayContainsAny; +export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; // @beta -export function arrayContainsAny(array: string, values: Constant[]): ArrayContainsAny; +export function arrayContainsAny(array: string, values: Expr[]): ArrayContainsAny; // @beta export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; @@ -187,49 +187,49 @@ export class ArrayElement extends FirestoreFunction { // @beta (undocumented) export class ArrayLength extends FirestoreFunction { - constructor(array: Constant); + constructor(array: Expr); } // @beta -export function arrayLength(array: Constant): ArrayLength; +export function arrayLength(array: Expr): ArrayLength; // @public export function arrayRemove(...elements: unknown[]): FieldValue; // @beta (undocumented) export class ArrayReverse extends FirestoreFunction { - constructor(array: Constant); + constructor(array: Expr); } // @public export function arrayUnion(...elements: unknown[]): FieldValue; // @beta -export function ascending(expr: Constant): Ordering; +export function ascending(expr: Expr): Ordering; // @public export function average(field: string | FieldPath): AggregateField; // @beta (undocumented) export class Avg extends FirestoreFunction implements Accumulator { - constructor(value: Constant, distinct: boolean); + constructor(value: Expr, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function avgFunction(value: Constant): Avg; +export function avgFunction(value: Expr): Avg; // @beta export function avgFunction(value: string): Avg; // @beta (undocumented) export class ByteLength extends FirestoreFunction { - constructor(value: Constant); + constructor(value: Expr); } // @beta -export function byteLength(expr: Constant): ByteLength; +export function byteLength(expr: Expr): ByteLength; // @beta export function byteLength(field: string): ByteLength; @@ -249,14 +249,14 @@ export const CACHE_SIZE_UNLIMITED = -1; // @beta (undocumented) export class CharLength extends FirestoreFunction { - constructor(value: Constant); + constructor(value: Expr); } // @beta export function charLength(field: string): CharLength; // @beta -export function charLength(expr: Constant): CharLength; +export function charLength(expr: Expr): CharLength; // @public export type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; @@ -301,14 +301,14 @@ export class CollectionSource implements Stage { } // @beta (undocumented) -export class Cond extends FirestoreFunction implements FilterCondition { - constructor(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant); +export class Cond extends FirestoreFunction { + constructor(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr); // (undocumented) filterable: true; } // @beta -export function cond(condition: FilterExpr, thenExpr: Constant, elseExpr: Constant): Cond; +export function cond(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr): Cond; // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { @@ -316,125 +316,28 @@ export function connectFirestoreEmulator(firestore: Firestore, host: string, por }): void; // @beta -export class Constant { - add(other: Constant): Add; - add(other: any): Add; - arrayConcat(arrays: Constant[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat; - arrayContains(element: Constant): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Constant[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Constant[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Constant): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Constant): Divide; - divide(other: any): Divide; - dotProduct(other: Constant): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Constant): EndsWith; - eq(other: Constant): Eq; - eq(other: any): Eq; - eqAny(...others: Constant[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Constant): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; +export class Constant extends Expr { // (undocumented) exprType: ExprType; - gt(other: Constant): Gt; - gt(other: any): Gt; - gte(other: Constant): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Constant): Like; - logicalMaximum(other: Constant): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Constant): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Constant): Lt; - lt(other: any): Lt; - lte(other: Constant): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Constant): Mod; - mod(other: any): Mod; - multiply(other: Constant): Multiply; - multiply(other: any): Multiply; - neq(other: Constant): Neq; - neq(other: any): Neq; - notEqAny(...others: Constant[]): NotEqAny; - // (undocumented) - notEqAny(...others: any[]): NotEqAny; static of(value: number): Constant; static of(value: string): Constant; static of(value: boolean): Constant; static of(value: null): Constant; + static of(value: undefined): Constant; static of(value: GeoPoint): Constant; static of(value: Timestamp): Constant; static of(value: Date): Constant; - static of(value: Bytes): Constant; + static of(value: Uint8Array): Constant; static of(value: DocumentReference): Constant; static of(value: any[]): Constant; - static of(value: Record): Constant; + static of(value: Map): Constant; static of(value: VectorValue): Constant; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Constant): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Constant): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Constant, replace: Constant): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Constant, replace: Constant): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Constant): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Constant): StrContains; - subtract(other: Constant): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Constant, amount: Constant): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Constant, amount: Constant): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; static vector(value: number[] | VectorValue): Constant; - vectorLength(): VectorLength; } // @beta (undocumented) export class CosineDistance extends FirestoreFunction { - constructor(vector1: Constant, vector2: Constant); + constructor(vector1: Expr, vector2: Expr); } // @beta @@ -444,20 +347,20 @@ export function cosineDistance(expr: string, other: number[]): CosineDistance; export function cosineDistance(expr: string, other: VectorValue): CosineDistance; // @beta -export function cosineDistance(expr: string, other: Constant): CosineDistance; +export function cosineDistance(expr: string, other: Expr): CosineDistance; // @beta -export function cosineDistance(expr: Constant, other: number[]): CosineDistance; +export function cosineDistance(expr: Expr, other: number[]): CosineDistance; // @beta -export function cosineDistance(expr: Constant, other: VectorValue): CosineDistance; +export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; // @beta -export function cosineDistance(expr: Constant, other: Constant): CosineDistance; +export function cosineDistance(expr: Expr, other: Expr): CosineDistance; // @beta (undocumented) export class Count extends FirestoreFunction implements Accumulator { - constructor(value: Constant | undefined, distinct: boolean); + constructor(value: Expr | undefined, distinct: boolean); // (undocumented) accumulator: true; } @@ -469,7 +372,7 @@ export function count(): AggregateField; export function countAll(): Count; // @beta -export function countFunction(value: Constant): Count; +export function countFunction(value: Expr): Count; // Warning: (ae-incompatible-release-tags) The symbol "countFunction" is marked as @public, but its signature references "Count" which is marked as @beta // @@ -492,7 +395,7 @@ export function deleteDoc(refere export function deleteField(): FieldValue; // @beta -export function descending(expr: Constant): Ordering; +export function descending(expr: Expr): Ordering; // @public export function disableNetwork(firestore: Firestore): Promise; @@ -502,24 +405,24 @@ export function disablePersistentCacheIndexAutoCreation(indexManager: Persistent // @beta (undocumented) export class Distinct implements Stage { - constructor(groups: Map); + constructor(groups: Map); // (undocumented) name: string; } // @beta (undocumented) export class Divide extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function divide(left: Constant, right: Constant): Divide; +export function divide(left: Expr, right: Expr): Divide; // @beta -export function divide(left: Constant, right: any): Divide; +export function divide(left: Expr, right: any): Divide; // @beta -export function divide(left: string, right: Constant): Divide; +export function divide(left: string, right: Expr): Divide; // @beta export function divide(left: string, right: any): Divide; @@ -586,7 +489,7 @@ export class DocumentsSource implements Stage { // @beta (undocumented) export class DotProduct extends FirestoreFunction { - constructor(vector1: Constant, vector2: Constant); + constructor(vector1: Expr, vector2: Expr); } // @beta @@ -596,16 +499,16 @@ export function dotProduct(expr: string, other: number[]): DotProduct; export function dotProduct(expr: string, other: VectorValue): DotProduct; // @beta -export function dotProduct(expr: string, other: Constant): DotProduct; +export function dotProduct(expr: string, other: Expr): DotProduct; // @beta -export function dotProduct(expr: Constant, other: number[]): DotProduct; +export function dotProduct(expr: Expr, other: number[]): DotProduct; // @beta -export function dotProduct(expr: Constant, other: VectorValue): DotProduct; +export function dotProduct(expr: Expr, other: VectorValue): DotProduct; // @beta -export function dotProduct(expr: Constant, other: Constant): DotProduct; +export function dotProduct(expr: Expr, other: Expr): DotProduct; export { EmulatorMockTokenOptions } @@ -635,7 +538,7 @@ export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; // @beta (undocumented) export class EndsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, suffix: Constant); + constructor(expr: Expr, suffix: Expr); // (undocumented) filterable: true; } @@ -644,55 +547,55 @@ export class EndsWith extends FirestoreFunction implements FilterCondition { export function endsWith(expr: string, suffix: string): EndsWith; // @beta -export function endsWith(expr: string, suffix: Constant): EndsWith; +export function endsWith(expr: string, suffix: Expr): EndsWith; // @beta -export function endsWith(expr: Constant, suffix: string): EndsWith; +export function endsWith(expr: Expr, suffix: string): EndsWith; // @beta -export function endsWith(expr: Constant, suffix: Constant): EndsWith; +export function endsWith(expr: Expr, suffix: Expr): EndsWith; // @beta (undocumented) export class Eq extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); // (undocumented) filterable: true; } // @beta -export function eq(left: Constant, right: Constant): Eq; +export function eq(left: Expr, right: Expr): Eq; // @beta -export function eq(left: Constant, right: any): Eq; +export function eq(left: Expr, right: any): Eq; // @beta -export function eq(left: string, right: Constant): Eq; +export function eq(left: string, right: Expr): Eq; // @beta export function eq(left: string, right: any): Eq; // @beta (undocumented) export class EqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, others: Constant[]); + constructor(left: Expr, others: Expr[]); // (undocumented) filterable: true; } // @beta -export function eqAny(element: Constant, others: Constant[]): EqAny; +export function eqAny(element: Expr, others: Expr[]): EqAny; // @beta -export function eqAny(element: Constant, others: any[]): EqAny; +export function eqAny(element: Expr, others: any[]): EqAny; // @beta -export function eqAny(element: string, others: Constant[]): EqAny; +export function eqAny(element: string, others: Expr[]): EqAny; // @beta export function eqAny(element: string, others: any[]): EqAny; // @beta (undocumented) export class EuclideanDistance extends FirestoreFunction { - constructor(vector1: Constant, vector2: Constant); + constructor(vector1: Expr, vector2: Expr); } // @beta @@ -702,31 +605,31 @@ export function euclideanDistance(expr: string, other: number[]): EuclideanDista export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; // @beta -export function euclideanDistance(expr: string, other: Constant): EuclideanDistance; +export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; // @beta -export function euclideanDistance(expr: Constant, other: number[]): EuclideanDistance; +export function euclideanDistance(expr: Expr, other: number[]): EuclideanDistance; // @beta -export function euclideanDistance(expr: Constant, other: VectorValue): EuclideanDistance; +export function euclideanDistance(expr: Expr, other: VectorValue): EuclideanDistance; // @beta -export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance; +export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta // // @public (undocumented) -export function execute(pipeline: Pipeline): Promise>>; +export function execute(pipeline: Pipeline): Promise; // @beta (undocumented) export class Exists extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant); + constructor(expr: Expr); // (undocumented) filterable: true; } // @beta -export function exists(value: Constant): Exists; +export function exists(value: Expr): Exists; // @beta export function exists(field: string): Exists; @@ -737,22 +640,16 @@ export interface ExperimentalLongPollingOptions { } // @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; - -// @beta (undocumented) -export class ExprWithAlias implements Selectable { - constructor(expr: T, alias: string); - add(other: Constant): Add; +export abstract class Expr { + add(other: Expr): Add; add(other: any): Add; - // (undocumented) - alias: string; - arrayConcat(arrays: Constant[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat; - arrayContains(element: Constant): ArrayContains; + arrayConcat(...arrays: Expr[]): ArrayConcat; + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayContains(element: Expr): ArrayContains; arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Constant[]): ArrayContainsAll; + arrayContainsAll(...values: Expr[]): ArrayContainsAll; arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Constant[]): ArrayContainsAny; + arrayContainsAny(...values: Expr[]): ArrayContainsAny; arrayContainsAny(...values: any[]): ArrayContainsAny; arrayLength(): ArrayLength; as(name: string): ExprWithAlias; @@ -760,83 +657,74 @@ export class ExprWithAlias implements Selectable { avg(): Avg; byteLength(): ByteLength; charLength(): CharLength; - cosineDistance(other: Constant): CosineDistance; + cosineDistance(other: Expr): CosineDistance; cosineDistance(other: VectorValue): CosineDistance; cosineDistance(other: number[]): CosineDistance; count(): Count; descending(): Ordering; - divide(other: Constant): Divide; + divide(other: Expr): Divide; divide(other: any): Divide; - dotProduct(other: Constant): DotProduct; + dotProduct(other: Expr): DotProduct; dotProduct(other: VectorValue): DotProduct; - // (undocumented) dotProduct(other: number[]): DotProduct; endsWith(suffix: string): EndsWith; - endsWith(suffix: Constant): EndsWith; - eq(other: Constant): Eq; + endsWith(suffix: Expr): EndsWith; + eq(other: Expr): Eq; eq(other: any): Eq; - eqAny(...others: Constant[]): EqAny; - // (undocumented) + eqAny(...others: Expr[]): EqAny; eqAny(...others: any[]): EqAny; - euclideanDistance(other: Constant): EuclideanDistance; + euclideanDistance(other: Expr): EuclideanDistance; euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) euclideanDistance(other: number[]): EuclideanDistance; exists(): Exists; // (undocumented) - expr: T; - // (undocumented) - exprType: ExprType; - gt(other: Constant): Gt; + abstract exprType: ExprType; + gt(other: Expr): Gt; gt(other: any): Gt; - gte(other: Constant): Gte; + gte(other: Expr): Gte; gte(other: any): Gte; isNaN(): IsNan; like(pattern: string): Like; - // (undocumented) - like(pattern: Constant): Like; - logicalMaximum(other: Constant): LogicalMaximum; + like(pattern: Expr): Like; + logicalMaximum(other: Expr): LogicalMaximum; logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Constant): LogicalMinimum; + logicalMinimum(other: Expr): LogicalMinimum; logicalMinimum(other: any): LogicalMinimum; - lt(other: Constant): Lt; + lt(other: Expr): Lt; lt(other: any): Lt; - lte(other: Constant): Lte; + lte(other: Expr): Lte; lte(other: any): Lte; mapGet(subfield: string): MapGet; maximum(): Maximum; minimum(): Minimum; - mod(other: Constant): Mod; + mod(other: Expr): Mod; mod(other: any): Mod; - multiply(other: Constant): Multiply; + multiply(other: Expr): Multiply; multiply(other: any): Multiply; - neq(other: Constant): Neq; + neq(other: Expr): Neq; neq(other: any): Neq; - notEqAny(...others: Constant[]): NotEqAny; - // (undocumented) + notEqAny(...others: Expr[]): NotEqAny; notEqAny(...others: any[]): NotEqAny; regexContains(pattern: string): RegexContains; - regexContains(pattern: Constant): RegexContains; + regexContains(pattern: Expr): RegexContains; regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Constant): RegexMatch; + regexMatch(pattern: Expr): RegexMatch; replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Constant, replace: Constant): ReplaceAll; + replaceAll(find: Expr, replace: Expr): ReplaceAll; replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Constant, replace: Constant): ReplaceFirst; + replaceFirst(find: Expr, replace: Expr): ReplaceFirst; reverse(): Reverse; - // (undocumented) - selectable: true; startsWith(prefix: string): StartsWith; - startsWith(prefix: Constant): StartsWith; - strConcat(...elements: Array): StrConcat; + startsWith(prefix: Expr): StartsWith; + strConcat(...elements: Array): StrConcat; strContains(substring: string): StrContains; - strContains(expr: Constant): StrContains; - subtract(other: Constant): Subtract; + strContains(expr: Expr): StrContains; + subtract(other: Expr): Subtract; subtract(other: any): Subtract; sum(): Sum; - timestampAdd(unit: Constant, amount: Constant): TimestampAdd; + timestampAdd(unit: Expr, amount: Expr): TimestampAdd; timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Constant, amount: Constant): TimestampSub; + timestampSub(unit: Expr, amount: Expr): TimestampSub; timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; timestampToUnixMicros(): TimestampToUnixMicros; timestampToUnixMillis(): TimestampToUnixMillis; @@ -851,116 +739,34 @@ export class ExprWithAlias implements Selectable { } // @beta -export class Field implements Selectable { - add(other: Constant): Add; - add(other: any): Add; - arrayConcat(arrays: Constant[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat; - arrayContains(element: Constant): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Constant[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Constant[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Constant): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Constant): Divide; - divide(other: any): Divide; - dotProduct(other: Constant): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Constant): EndsWith; - eq(other: Constant): Eq; - eq(other: any): Eq; - eqAny(...others: Constant[]): EqAny; +export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; + +// @beta (undocumented) +export class ExprWithAlias extends Expr implements Selectable { + constructor(expr: T, alias: string); // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Constant): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; + readonly alias: string; // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; + readonly expr: T; // (undocumented) exprType: ExprType; // (undocumented) - fieldName(): string; - gt(other: Constant): Gt; - gt(other: any): Gt; - gte(other: Constant): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; + selectable: true; +} + +// @beta +export class Field extends Expr implements Selectable { // (undocumented) - like(pattern: Constant): Like; - logicalMaximum(other: Constant): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Constant): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Constant): Lt; - lt(other: any): Lt; - lte(other: Constant): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Constant): Mod; - mod(other: any): Mod; - multiply(other: Constant): Multiply; - multiply(other: any): Multiply; - neq(other: Constant): Neq; - neq(other: any): Neq; - notEqAny(...others: Constant[]): NotEqAny; + exprType: ExprType; // (undocumented) - notEqAny(...others: any[]): NotEqAny; + fieldName(): string; static of(name: string): Field; // (undocumented) static of(path: FieldPath): Field; // (undocumented) static of(pipeline: Pipeline, name: string): Field; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Constant): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Constant): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Constant, replace: Constant): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Constant, replace: Constant): ReplaceFirst; - reverse(): Reverse; // (undocumented) selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Constant): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Constant): StrContains; - subtract(other: Constant): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Constant, amount: Constant): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Constant, amount: Constant): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; } // @public @@ -970,115 +776,17 @@ export class FieldPath { } // @beta (undocumented) -export class Fields implements Selectable { - add(other: Constant): Add; - add(other: any): Add; - arrayConcat(arrays: Constant[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat; - arrayContains(element: Constant): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Constant[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Constant[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Constant): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Constant): Divide; - divide(other: any): Divide; - dotProduct(other: Constant): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Constant): EndsWith; - eq(other: Constant): Eq; - eq(other: any): Eq; - eqAny(...others: Constant[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Constant): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; +export class Fields extends Expr implements Selectable { // (undocumented) exprType: ExprType; // (undocumented) fieldList(): Field[]; - gt(other: Constant): Gt; - gt(other: any): Gt; - gte(other: Constant): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Constant): Like; - logicalMaximum(other: Constant): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Constant): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Constant): Lt; - lt(other: any): Lt; - lte(other: Constant): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Constant): Mod; - mod(other: any): Mod; - multiply(other: Constant): Multiply; - multiply(other: any): Multiply; - neq(other: Constant): Neq; - neq(other: any): Neq; - notEqAny(...others: Constant[]): NotEqAny; - // (undocumented) - notEqAny(...others: any[]): NotEqAny; // (undocumented) static of(name: string, ...others: string[]): Fields; // (undocumented) static ofAll(): Fields; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Constant): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Constant): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Constant, replace: Constant): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Constant, replace: Constant): ReplaceFirst; - reverse(): Reverse; // (undocumented) selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Constant): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Constant): StrContains; - subtract(other: Constant): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Constant, amount: Constant): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Constant, amount: Constant): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; } // @public @@ -1087,14 +795,11 @@ export abstract class FieldValue { } // @beta -export interface FilterCondition { +export interface FilterCondition extends Expr { // (undocumented) filterable: true; } -// @beta -export type FilterExpr = Constant & FilterCondition; - // @beta (undocumented) export class FindNearest implements Stage { // (undocumented) @@ -1140,109 +845,11 @@ export class FirestoreError extends FirebaseError { export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; // @beta -export class FirestoreFunction { - constructor(name: string, params: Constant[]); - add(other: Constant): Add; - add(other: any): Add; - arrayConcat(arrays: Constant[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat; - arrayContains(element: Constant): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Constant[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Constant[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Constant): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Constant): Divide; - divide(other: any): Divide; - dotProduct(other: Constant): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Constant): EndsWith; - eq(other: Constant): Eq; - eq(other: any): Eq; - eqAny(...others: Constant[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Constant): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; +export class FirestoreFunction extends Expr { + constructor(name: string, params: Expr[]); // (undocumented) exprType: ExprType; - gt(other: Constant): Gt; - gt(other: any): Gt; - gte(other: Constant): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Constant): Like; - logicalMaximum(other: Constant): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Constant): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Constant): Lt; - lt(other: any): Lt; - lte(other: Constant): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Constant): Mod; - mod(other: any): Mod; - multiply(other: Constant): Multiply; - multiply(other: any): Multiply; - neq(other: Constant): Neq; - neq(other: any): Neq; - notEqAny(...others: Constant[]): NotEqAny; - // (undocumented) - notEqAny(...others: any[]): NotEqAny; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Constant): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Constant): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Constant, replace: Constant): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Constant, replace: Constant): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Constant): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Constant): StrContains; - subtract(other: Constant): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Constant, amount: Constant): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Constant, amount: Constant): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; -} + } // @public export type FirestoreLocalCache = MemoryLocalCache | PersistentLocalCache; @@ -1260,7 +867,7 @@ export interface FirestoreSettings { } // @beta -export function genericFunction(name: string, params: Constant[]): FirestoreFunction; +export function genericFunction(name: string, params: Expr[]): FirestoreFunction; // @beta (undocumented) export class GenericStage implements Stage { @@ -1324,38 +931,38 @@ export function getPersistentCacheIndexManager(firestore: Firestore): Persistent // @beta (undocumented) export class Gt extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); // (undocumented) filterable: true; } // @beta -export function gt(left: Constant, right: Constant): Gt; +export function gt(left: Expr, right: Expr): Gt; // @beta -export function gt(left: Constant, right: any): Gt; +export function gt(left: Expr, right: any): Gt; // @beta -export function gt(left: string, right: Constant): Gt; +export function gt(left: string, right: Expr): Gt; // @beta export function gt(left: string, right: any): Gt; // @beta (undocumented) export class Gte extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); // (undocumented) filterable: true; } // @beta -export function gte(left: Constant, right: Constant): Gte; +export function gte(left: Expr, right: Expr): Gte; // @beta -export function gte(left: Constant, right: any): Gte; +export function gte(left: Expr, right: any): Gte; // @beta -export function gte(left: string, right: Constant): Gte; +export function gte(left: string, right: Expr): Gte; // @beta export function gte(left: string, right: any): Gte; @@ -1392,20 +999,20 @@ export function initializeFirestore(app: FirebaseApp, settings: FirestoreSetting // @beta (undocumented) export class IsNan extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant); + constructor(expr: Expr); // (undocumented) filterable: true; } // @beta -export function isNan(value: Constant): IsNan; +export function isNan(value: Expr): IsNan; // @beta export function isNan(value: string): IsNan; // @beta (undocumented) export class Like extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, pattern: Constant); + constructor(expr: Expr, pattern: Expr); // (undocumented) filterable: true; } @@ -1414,13 +1021,13 @@ export class Like extends FirestoreFunction implements FilterCondition { export function like(left: string, pattern: string): Like; // @beta -export function like(left: string, pattern: Constant): Like; +export function like(left: string, pattern: Expr): Like; // @beta -export function like(left: Constant, pattern: string): Like; +export function like(left: Expr, pattern: string): Like; // @beta -export function like(left: Constant, pattern: Constant): Like; +export function like(left: Expr, pattern: Expr): Like; // @beta (undocumented) export class Limit implements Stage { @@ -1459,34 +1066,34 @@ export interface LoadBundleTaskProgress { // @beta (undocumented) export class LogicalMaximum extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function logicalMaximum(left: Constant, right: Constant): LogicalMaximum; +export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; // @beta -export function logicalMaximum(left: Constant, right: any): LogicalMaximum; +export function logicalMaximum(left: Expr, right: any): LogicalMaximum; // @beta -export function logicalMaximum(left: string, right: Constant): LogicalMaximum; +export function logicalMaximum(left: string, right: Expr): LogicalMaximum; // @beta export function logicalMaximum(left: string, right: any): LogicalMaximum; // @beta (undocumented) export class LogicalMinimum extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function logicalMinimum(left: Constant, right: Constant): LogicalMinimum; +export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; // @beta -export function logicalMinimum(left: Constant, right: any): LogicalMinimum; +export function logicalMinimum(left: Expr, right: any): LogicalMinimum; // @beta -export function logicalMinimum(left: string, right: Constant): LogicalMinimum; +export function logicalMinimum(left: string, right: Expr): LogicalMinimum; // @beta export function logicalMinimum(left: string, right: any): LogicalMinimum; @@ -1495,65 +1102,65 @@ export { LogLevel } // @beta (undocumented) export class Lt extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); // (undocumented) filterable: true; } // @beta -export function lt(left: Constant, right: Constant): Lt; +export function lt(left: Expr, right: Expr): Lt; // @beta -export function lt(left: Constant, right: any): Lt; +export function lt(left: Expr, right: any): Lt; // @beta -export function lt(left: string, right: Constant): Lt; +export function lt(left: string, right: Expr): Lt; // @beta export function lt(left: string, right: any): Lt; // @beta (undocumented) export class Lte extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); // (undocumented) filterable: true; } // @beta -export function lte(left: Constant, right: Constant): Lte; +export function lte(left: Expr, right: Expr): Lte; // @beta -export function lte(left: Constant, right: any): Lte; +export function lte(left: Expr, right: any): Lte; -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta // // @public -export function lte(left: string, right: Constant): Lte; +export function lte(left: string, right: Expr): Lte; // @beta export function lte(left: string, right: any): Lte; // @beta (undocumented) export class MapGet extends FirestoreFunction { - constructor(map: Constant, name: string); + constructor(map: Expr, name: string); } // @beta export function mapGet(mapField: string, subField: string): MapGet; // @beta -export function mapGet(mapExpr: Constant, subField: string): MapGet; +export function mapGet(mapExpr: Expr, subField: string): MapGet; // @beta (undocumented) export class Maximum extends FirestoreFunction implements Accumulator { - constructor(value: Constant, distinct: boolean); + constructor(value: Expr, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function maximum(value: Constant): Maximum; +export function maximum(value: Expr): Maximum; // @beta export function maximum(value: string): Maximum; @@ -1597,47 +1204,47 @@ export function memoryLruGarbageCollector(settings?: { // @beta (undocumented) export class Minimum extends FirestoreFunction implements Accumulator { - constructor(value: Constant, distinct: boolean); + constructor(value: Expr, distinct: boolean); // (undocumented) accumulator: true; } // @beta -export function minimum(value: Constant): Minimum; +export function minimum(value: Expr): Minimum; // @beta export function minimum(value: string): Minimum; // @beta (undocumented) export class Mod extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function mod(left: Constant, right: Constant): Mod; +export function mod(left: Expr, right: Expr): Mod; // @beta -export function mod(left: Constant, right: any): Mod; +export function mod(left: Expr, right: any): Mod; // @beta -export function mod(left: string, right: Constant): Mod; +export function mod(left: string, right: Expr): Mod; // @beta export function mod(left: string, right: any): Mod; // @beta (undocumented) export class Multiply extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function multiply(left: Constant, right: Constant): Multiply; +export function multiply(left: Expr, right: Expr): Multiply; // @beta -export function multiply(left: Constant, right: any): Multiply; +export function multiply(left: Expr, right: any): Multiply; // @beta -export function multiply(left: string, right: Constant): Multiply; +export function multiply(left: string, right: Expr): Multiply; // @beta export function multiply(left: string, right: any): Multiply; @@ -1647,19 +1254,19 @@ export function namedQuery(firestore: Firestore, name: string): Promise> = UnionToInter // @beta (undocumented) export class Not extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant); + constructor(expr: Expr); // (undocumented) filterable: true; } // @beta -export function not(filter: FilterExpr): Not; +export function not(filter: FilterCondition): Not; // @beta (undocumented) export class NotEqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Constant, others: Constant[]); + constructor(left: Expr, others: Expr[]); // (undocumented) filterable: true; } // @beta -export function notEqAny(element: Constant, others: Constant[]): NotEqAny; +export function notEqAny(element: Expr, others: Expr[]): NotEqAny; // @beta -export function notEqAny(element: Constant, others: any[]): NotEqAny; +export function notEqAny(element: Expr, others: any[]): NotEqAny; // @beta -export function notEqAny(element: string, others: Constant[]): NotEqAny; +export function notEqAny(element: string, others: Expr[]): NotEqAny; // @beta export function notEqAny(element: string, others: any[]): NotEqAny; @@ -1757,7 +1364,7 @@ export function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Uns // @beta (undocumented) export class Or extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterExpr[]); + constructor(conditions: (FilterCondition)[]); // (undocumented) filterable: true; } @@ -1773,11 +1380,15 @@ export type OrderByDirection = 'desc' | 'asc'; // @beta export class Ordering { - constructor(expr: Constant, direction: 'ascending' | 'descending'); - } + constructor(expr: Expr, direction: 'ascending' | 'descending'); + // (undocumented) + readonly direction: 'ascending' | 'descending'; + // (undocumented) + readonly expr: Expr; +} // @beta -export function orFunction(left: FilterExpr, ...right: FilterExpr[]): Or; +export function orFunction(left: FilterCondition, ...right: (FilterCondition)[]): Or; // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { @@ -1836,49 +1447,45 @@ export interface PersistentSingleTabManagerSettings { export type PersistentTabManager = PersistentSingleTabManager | PersistentMultipleTabManager; // @public (undocumented) -export class Pipeline { - /* Excluded from this release type: __constructor */ +export class Pipeline { /* Excluded from this release type: newPipeline */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta - addFields(...fields: Selectable[]): Pipeline; + addFields(...fields: Selectable[]): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; - aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; - // (undocumented) - converter: any; + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta - distinct(...groups: Array): Pipeline; + distinct(...groups: Array): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta - execute(): Promise>>; + execute(): Promise; // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) - findNearest(options: FindNearestOptions): Pipeline; - genericStage(name: string, params: any[]): Pipeline; - limit(limit: number): Pipeline; - offset(offset: number): Pipeline; + findNearest(options: FindNearestOptions): Pipeline; + genericStage(name: string, params: any[]): Pipeline; + limit(limit: number): Pipeline; + offset(offset: number): Pipeline; readUserData: any; // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta - select(...selections: Array): Pipeline; + select(...selections: Array): Pipeline; // (undocumented) selectablesToMap: any; // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta - sort(...orderings: Ordering[]): Pipeline; + sort(...orderings: Ordering[]): Pipeline; // (undocumented) - sort(options: { orderings: Ordering[]; }): Pipeline; + sort(options: { orderings: Ordering[]; }): Pipeline; // (undocumented) stages: any; // (undocumented) userDataReader: any; // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta - where(condition: FilterCondition & Constant): Pipeline; + where(condition: FilterCondition): Pipeline; } // Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta // // @public -export function pipeline(firestore: Firestore): PipelineSource; +export function pipeline(firestore: Firestore): PipelineSource; // @public export function pipeline(query: Query): Pipeline; @@ -1898,20 +1505,17 @@ export class PipelineResult { } // @beta -export class PipelineSource { - /* Excluded from this release type: _db */ - /* Excluded from this release type: _userDataReader */ - /* Excluded from this release type: _userDataWriter */ - /* Excluded from this release type: _documentReferenceFactory */ +export class PipelineSource { + /* Excluded from this release type: _createPipeline */ /* Excluded from this release type: __constructor */ // (undocumented) - collection(collectionPath: string): Pipeline; + collection(collectionPath: string): PipelineType; // (undocumented) - collectionGroup(collectionId: string): Pipeline; + collectionGroup(collectionId: string): PipelineType; // (undocumented) - database(): Pipeline; + database(): PipelineType; // (undocumented) - documents(docs: DocumentReference[]): Pipeline; + documents(docs: DocumentReference[]): PipelineType; } // @public @@ -2002,7 +1606,7 @@ export function refEqual(left: D // @beta (undocumented) export class RegexContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, pattern: Constant); + constructor(expr: Expr, pattern: Expr); // (undocumented) filterable: true; } @@ -2011,17 +1615,17 @@ export class RegexContains extends FirestoreFunction implements FilterCondition export function regexContains(left: string, pattern: string): RegexContains; // @beta -export function regexContains(left: string, pattern: Constant): RegexContains; +export function regexContains(left: string, pattern: Expr): RegexContains; // @beta -export function regexContains(left: Constant, pattern: string): RegexContains; +export function regexContains(left: Expr, pattern: string): RegexContains; // @beta -export function regexContains(left: Constant, pattern: Constant): RegexContains; +export function regexContains(left: Expr, pattern: Expr): RegexContains; // @beta (undocumented) export class RegexMatch extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, pattern: Constant); + constructor(expr: Expr, pattern: Expr); // (undocumented) filterable: true; } @@ -2030,49 +1634,49 @@ export class RegexMatch extends FirestoreFunction implements FilterCondition { export function regexMatch(left: string, pattern: string): RegexMatch; // @beta -export function regexMatch(left: string, pattern: Constant): RegexMatch; +export function regexMatch(left: string, pattern: Expr): RegexMatch; // @beta -export function regexMatch(left: Constant, pattern: string): RegexMatch; +export function regexMatch(left: Expr, pattern: string): RegexMatch; // @beta -export function regexMatch(left: Constant, pattern: Constant): RegexMatch; +export function regexMatch(left: Expr, pattern: Expr): RegexMatch; // @beta (undocumented) export class ReplaceAll extends FirestoreFunction { - constructor(value: Constant, find: Constant, replace: Constant); + constructor(value: Expr, find: Expr, replace: Expr); } // @beta -export function replaceAll(value: Constant, find: string, replace: string): ReplaceAll; +export function replaceAll(value: Expr, find: string, replace: string): ReplaceAll; // @beta -export function replaceAll(value: Constant, find: Constant, replace: Constant): ReplaceAll; +export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; // @beta export function replaceAll(field: string, find: string, replace: string): ReplaceAll; // @beta (undocumented) export class ReplaceFirst extends FirestoreFunction { - constructor(value: Constant, find: Constant, replace: Constant); + constructor(value: Expr, find: Expr, replace: Expr); } // @beta -export function replaceFirst(value: Constant, find: string, replace: string): ReplaceFirst; +export function replaceFirst(value: Expr, find: string, replace: string): ReplaceFirst; // @beta -export function replaceFirst(value: Constant, find: Constant, replace: Constant): ReplaceFirst; +export function replaceFirst(value: Expr, find: Expr, replace: Expr): ReplaceFirst; // @beta export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; // @beta (undocumented) export class Reverse extends FirestoreFunction { - constructor(value: Constant); + constructor(value: Expr); } // @beta -export function reverse(expr: Constant): Reverse; +export function reverse(expr: Expr): Reverse; // @beta export function reverse(field: string): Reverse; @@ -2082,20 +1686,17 @@ export function runTransaction(firestore: Firestore, updateFunction: (transac // @beta (undocumented) export class Select implements Stage { - constructor(projections: Map); + constructor(projections: Map); // (undocumented) name: string; } // @beta -export interface Selectable { +export interface Selectable extends Expr { // (undocumented) selectable: true; } -// @beta -export type SelectableExpr = Constant & Selectable; - // @public export function serverTimestamp(): FieldValue; @@ -2169,7 +1770,7 @@ export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; // @beta (undocumented) export class StartsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, prefix: Constant); + constructor(expr: Expr, prefix: Expr); // (undocumented) filterable: true; } @@ -2178,28 +1779,28 @@ export class StartsWith extends FirestoreFunction implements FilterCondition { export function startsWith(expr: string, prefix: string): StartsWith; // @beta -export function startsWith(expr: string, prefix: Constant): StartsWith; +export function startsWith(expr: string, prefix: Expr): StartsWith; // @beta -export function startsWith(expr: Constant, prefix: string): StartsWith; +export function startsWith(expr: Expr, prefix: string): StartsWith; // @beta -export function startsWith(expr: Constant, prefix: Constant): StartsWith; +export function startsWith(expr: Expr, prefix: Expr): StartsWith; // @beta (undocumented) export class StrConcat extends FirestoreFunction { - constructor(first: Constant, rest: Constant[]); + constructor(first: Expr, rest: Expr[]); } // @beta -export function strConcat(first: string, ...elements: Array): StrConcat; +export function strConcat(first: string, ...elements: Array): StrConcat; // @beta -export function strConcat(first: Constant, ...elements: Array): StrConcat; +export function strConcat(first: Expr, ...elements: Array): StrConcat; // @beta (undocumented) export class StrContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Constant, substring: Constant); + constructor(expr: Expr, substring: Expr); // (undocumented) filterable: true; } @@ -2208,34 +1809,34 @@ export class StrContains extends FirestoreFunction implements FilterCondition { export function strContains(left: string, substring: string): StrContains; // @beta -export function strContains(left: string, substring: Constant): StrContains; +export function strContains(left: string, substring: Expr): StrContains; // @beta -export function strContains(left: Constant, substring: string): StrContains; +export function strContains(left: Expr, substring: string): StrContains; // @beta -export function strContains(left: Constant, substring: Constant): StrContains; +export function strContains(left: Expr, substring: Expr): StrContains; // @beta (undocumented) export class Subtract extends FirestoreFunction { - constructor(left: Constant, right: Constant); + constructor(left: Expr, right: Expr); } // @beta -export function subtract(left: Constant, right: Constant): Subtract; +export function subtract(left: Expr, right: Expr): Subtract; // @beta -export function subtract(left: Constant, right: any): Subtract; +export function subtract(left: Expr, right: any): Subtract; // @beta -export function subtract(left: string, right: Constant): Subtract; +export function subtract(left: string, right: Expr): Subtract; // @beta export function subtract(left: string, right: any): Subtract; // @beta (undocumented) export class Sum extends FirestoreFunction implements Accumulator { - constructor(value: Constant, distinct: boolean); + constructor(value: Expr, distinct: boolean); // (undocumented) accumulator: true; } @@ -2244,7 +1845,7 @@ export class Sum extends FirestoreFunction implements Accumulator { export function sum(field: string | FieldPath): AggregateField; // @beta -export function sumFunction(value: Constant): Sum; +export function sumFunction(value: Expr): Sum; // @beta export function sumFunction(value: string): Sum; @@ -2278,86 +1879,86 @@ export class Timestamp { // @beta (undocumented) export class TimestampAdd extends FirestoreFunction { - constructor(timestamp: Constant, unit: Constant, amount: Constant); + constructor(timestamp: Expr, unit: Expr, amount: Expr); } // @beta -export function timestampAdd(timestamp: Constant, unit: Constant, amount: Constant): TimestampAdd; +export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): TimestampAdd; // @beta -export function timestampAdd(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; // @beta export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; // @beta (undocumented) export class TimestampSub extends FirestoreFunction { - constructor(timestamp: Constant, unit: Constant, amount: Constant); + constructor(timestamp: Expr, unit: Expr, amount: Expr); } // @beta -export function timestampSub(timestamp: Constant, unit: Constant, amount: Constant): TimestampSub; +export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): TimestampSub; // @beta -export function timestampSub(timestamp: Constant, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; // @beta export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; // @beta (undocumented) export class TimestampToUnixMicros extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function timestampToUnixMicros(expr: Constant): TimestampToUnixMicros; +export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; // @beta export function timestampToUnixMicros(field: string): TimestampToUnixMicros; // @beta (undocumented) export class TimestampToUnixMillis extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function timestampToUnixMillis(expr: Constant): TimestampToUnixMillis; +export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; // @beta export function timestampToUnixMillis(field: string): TimestampToUnixMillis; // @beta (undocumented) export class TimestampToUnixSeconds extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function timestampToUnixSeconds(expr: Constant): TimestampToUnixSeconds; +export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; // @beta export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; // @beta (undocumented) export class ToLower extends FirestoreFunction { - constructor(expr: Constant); + constructor(expr: Expr); } // @beta export function toLower(expr: string): ToLower; // @beta -export function toLower(expr: Constant): ToLower; +export function toLower(expr: Expr): ToLower; // @beta (undocumented) export class ToUpper extends FirestoreFunction { - constructor(expr: Constant); + constructor(expr: Expr); } // @beta export function toUpper(expr: string): ToUpper; // @beta -export function toUpper(expr: Constant): ToUpper; +export function toUpper(expr: Expr): ToUpper; // @public export class Transaction { @@ -2376,47 +1977,47 @@ export interface TransactionOptions { // @beta (undocumented) export class Trim extends FirestoreFunction { - constructor(expr: Constant); + constructor(expr: Expr); } // @beta export function trim(expr: string): Trim; // @beta -export function trim(expr: Constant): Trim; +export function trim(expr: Expr): Trim; // @public export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; // @beta (undocumented) export class UnixMicrosToTimestamp extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function unixMicrosToTimestamp(expr: Constant): UnixMicrosToTimestamp; +export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; // @beta export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; // @beta (undocumented) export class UnixMillisToTimestamp extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function unixMillisToTimestamp(expr: Constant): UnixMillisToTimestamp; +export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; // @beta export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; // @beta (undocumented) export class UnixSecondsToTimestamp extends FirestoreFunction { - constructor(input: Constant); + constructor(input: Expr); } // @beta -export function unixSecondsToTimestamp(expr: Constant): UnixSecondsToTimestamp; +export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; // @beta export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; @@ -2437,19 +2038,16 @@ export function updateDoc(refere // @public export function updateDoc(reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise; -// @public (undocumented) -export function useFluentPipelines(): void; - // @public export function vector(values?: number[]): VectorValue; // @beta (undocumented) export class VectorLength extends FirestoreFunction { - constructor(value: Constant); + constructor(value: Expr); } // @beta -export function vectorLength(expr: Constant): VectorLength; +export function vectorLength(expr: Expr): VectorLength; // @beta export function vectorLength(field: string): VectorLength; @@ -2466,7 +2064,7 @@ export function waitForPendingWrites(firestore: Firestore): Promise; // @beta (undocumented) export class Where implements Stage { - constructor(condition: FilterCondition & Constant); + constructor(condition: FilterCondition); // (undocumented) name: string; } @@ -2497,19 +2095,19 @@ export function writeBatch(firestore: Firestore): WriteBatch; // @beta (undocumented) export class Xor extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterExpr[]); + constructor(conditions: (FilterCondition)[]); // (undocumented) filterable: true; } // @beta -export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor; +export function xor(left: FilterCondition, ...right: (FilterCondition)[]): Xor; // Warnings were encountered during analysis: // -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10167:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10167:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10194:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5962:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5962:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5989:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firebase/firestore/pipelines/index.ts b/packages/firebase/firestore/pipelines/index.ts new file mode 100644 index 00000000000..be062f16e96 --- /dev/null +++ b/packages/firebase/firestore/pipelines/index.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2024 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. + */ + +export * from '@firebase/firestore/pipelines'; diff --git a/packages/firebase/firestore/pipelines/package.json b/packages/firebase/firestore/pipelines/package.json new file mode 100644 index 00000000000..e63cb928b0f --- /dev/null +++ b/packages/firebase/firestore/pipelines/package.json @@ -0,0 +1,7 @@ +{ + "name": "firebase/firestore/pipelines", + "main": "dist/pipelines.cjs.js", + "browser": "dist/esm/pipelines.esm.js", + "module": "dist/esm/pipelines.esm.js", + "typings": "dist/firestore/lite/pipelines.d.ts" +} diff --git a/packages/firebase/package.json b/packages/firebase/package.json index f716238f483..ee9fe733892 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -131,6 +131,18 @@ }, "default": "./firestore/dist/esm/index.esm.js" }, + "./firestore/pipelines": { + "types": "./firestore/dist/firestore/pipelines.d.ts", + "node": { + "require": "./firestore/dist/pipelines.cjs.js", + "import": "./firestore/dist/pipelines.mjs" + }, + "browser": { + "require": "./firestore/dist/pipelines.cjs.js", + "import": "./firestore/dist/esm/pipelines.esm.js" + }, + "default": "./firestore/dist/esm/pipelines.esm.js" + }, "./firestore/lite": { "types": "./firestore/lite/dist/firestore/lite/index.d.ts", "node": { diff --git a/packages/firestore/.eslintrc.js b/packages/firestore/.eslintrc.js index 5dd443333d9..9ffb1d0279b 100644 --- a/packages/firestore/.eslintrc.js +++ b/packages/firestore/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { tsconfigRootDir: __dirname }, plugins: ['import'], - ignorePatterns: ['compat/*'], + ignorePatterns: ['compat/*', 'pipelines.d.ts'], rules: { 'no-console': ['error', { allow: ['warn', 'error'] }], '@typescript-eslint/no-unused-vars': [ diff --git a/packages/firestore/externs.json b/packages/firestore/externs.json index f7fbbabeb14..22da710fe3a 100644 --- a/packages/firestore/externs.json +++ b/packages/firestore/externs.json @@ -17,7 +17,9 @@ "packages/app-check-interop-types/index.d.ts", "packages/auth-interop-types/index.d.ts", "packages/firestore/dist/lite/internal.d.ts", + "packages/firestore/dist/lite/internal.pipelines.d.ts", "packages/firestore/dist/internal.d.ts", + "packages/firestore/dist/internal.pipelines.d.ts", "packages/firestore-types/index.d.ts", "packages/firebase/compat/index.d.ts", "packages/component/dist/src/component.d.ts", diff --git a/packages/firestore/lite/index.ts b/packages/firestore/lite/index.ts index d001457ac50..b751f0a8254 100644 --- a/packages/firestore/lite/index.ts +++ b/packages/firestore/lite/index.ts @@ -27,173 +27,6 @@ import { registerFirestore } from './register'; registerFirestore(); -export { PipelineSource } from '../src/lite-api/pipeline-source'; - -export { PipelineResult } from '../src/lite-api/pipeline-result'; - -export { Pipeline } from '../src/lite-api/pipeline'; - -export { - useFluentPipelines, - pipeline, - execute -} from '../src/lite-api/pipeline_impl'; - -export { - Stage, - FindNearestOptions, - AddFields, - Aggregate, - Distinct, - CollectionSource, - CollectionGroupSource, - DatabaseSource, - DocumentsSource, - Where, - FindNearest, - Limit, - Offset, - Select, - Sort, - GenericStage -} from '../src/lite-api/stage'; - -export { - add, - subtract, - multiply, - divide, - mod, - eq, - neq, - lt, - lte, - gt, - gte, - arrayConcat, - arrayContains, - arrayContainsAny, - arrayContainsAll, - arrayLength, - eqAny, - notEqAny, - xor, - cond, - not, - logicalMaximum, - logicalMinimum, - exists, - isNan, - reverse, - replaceFirst, - replaceAll, - byteLength, - charLength, - like, - regexContains, - regexMatch, - strContains, - startsWith, - endsWith, - toLower, - toUpper, - trim, - strConcat, - mapGet, - countAll, - minimum, - maximum, - cosineDistance, - dotProduct, - euclideanDistance, - vectorLength, - unixMicrosToTimestamp, - timestampToUnixMicros, - unixMillisToTimestamp, - timestampToUnixMillis, - unixSecondsToTimestamp, - timestampToUnixSeconds, - timestampAdd, - timestampSub, - genericFunction, - ascending, - descending, - ExprWithAlias, - Field, - Fields, - Constant, - FirestoreFunction, - Add, - Subtract, - Multiply, - Divide, - Mod, - Eq, - Neq, - Lt, - Lte, - Gt, - Gte, - ArrayConcat, - ArrayReverse, - ArrayContains, - ArrayContainsAll, - ArrayContainsAny, - ArrayLength, - ArrayElement, - EqAny, - IsNan, - Exists, - Not, - And, - Or, - Xor, - Cond, - LogicalMaximum, - LogicalMinimum, - Reverse, - ReplaceFirst, - ReplaceAll, - CharLength, - ByteLength, - Like, - RegexContains, - RegexMatch, - StrContains, - StartsWith, - EndsWith, - ToLower, - ToUpper, - Trim, - StrConcat, - MapGet, - Count, - Sum, - Avg, - Minimum, - Maximum, - CosineDistance, - DotProduct, - EuclideanDistance, - VectorLength, - UnixMicrosToTimestamp, - TimestampToUnixMicros, - UnixMillisToTimestamp, - TimestampToUnixMillis, - UnixSecondsToTimestamp, - TimestampToUnixSeconds, - TimestampAdd, - TimestampSub, - Ordering, - ExprType, - AccumulatorTarget, - FilterExpr, - SelectableExpr, - Selectable, - FilterCondition, - Accumulator -} from '../src/lite-api/expressions'; - export { aggregateQuerySnapshotEqual, getCount, diff --git a/packages/firestore/lite/pipelines/package.json b/packages/firestore/lite/pipelines/package.json new file mode 100644 index 00000000000..349e25e3ac3 --- /dev/null +++ b/packages/firestore/lite/pipelines/package.json @@ -0,0 +1,14 @@ +{ + "name": "@firebase/firestore-lite-pipelines", + "description": "Pipelines for the lite Firestore SDK", + "main": "../../dist/lite/pipelines.node.cjs.js", + "main-esm": "../../dist/lite/pipelines.node.mjs", + "module": "../../dist/lite/pipelines.browser.esm2017.js", + "browser": "../../dist/lite/pipelines.browser.esm2017.js", + "react-native": "../../dist/lite/pipelines.rn.esm2017.js", + "typings": "../../dist/lite/pipelines.d.ts", + "private": true, + "engines": { + "node": ">=18.0.0" + } +} diff --git a/packages/firestore/lite/pipelines/pipelines.d.ts b/packages/firestore/lite/pipelines/pipelines.d.ts new file mode 100644 index 00000000000..e1243ebe907 --- /dev/null +++ b/packages/firestore/lite/pipelines/pipelines.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2024 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 { PipelineSource, Pipeline } from '../../dist/lite/pipelines'; + +// Augument the Firestore class with the pipeline() method. +// This is stripped from dist/lite/pipelines.d.ts during the build +// so it needs to be re-added here. +declare module '@firebase/firestore' { + interface Firestore { + pipeline(): PipelineSource; + } +} + +export * from '../../dist/lite/pipelines'; diff --git a/packages/firestore/lite/pipelines/pipelines.ts b/packages/firestore/lite/pipelines/pipelines.ts new file mode 100644 index 00000000000..d3e31f5e52b --- /dev/null +++ b/packages/firestore/lite/pipelines/pipelines.ts @@ -0,0 +1,210 @@ +/** + * Firestore Lite Pipelines + * + * @remarks Firestore Lite is a small online-only SDK that allows read + * and write access to your Firestore database. All operations connect + * directly to the backend, and `onSnapshot()` APIs are not supported. + * @packageDocumentation + */ +/** + * @license + * Copyright 2024 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. + */ + +// External exports: ./index +// These external exports will be stripped from the dist/pipelines.d.ts file +// by the prune-dts script, in order to reduce type duplication. However, these +// types need to be exported here to ensure that api-extractor behaves +// correctly. If a type from api.ts is missing from this export, then +// api-extractor may rename it with a suffix `_#`, e.g. `YourType_2`. +export type { + Timestamp, + DocumentReference, + VectorValue, + GeoPoint, + FieldPath, + DocumentData, + Query, + Firestore, + FirestoreDataConverter, + WithFieldValue, + PartialWithFieldValue, + SetOptions, + QueryDocumentSnapshot, + Primitive, + FieldValue, + Bytes +} from '../index'; + +export { PipelineSource } from '../../src/lite-api/pipeline-source'; + +export { PipelineResult } from '../../src/lite-api/pipeline-result'; + +export { Pipeline } from '../../src/lite-api/pipeline'; + +export { pipeline, execute } from '../../src/lite-api/pipeline_impl'; + +export { + Stage, + FindNearestOptions, + AddFields, + Aggregate, + Distinct, + CollectionSource, + CollectionGroupSource, + DatabaseSource, + DocumentsSource, + Where, + FindNearest, + Limit, + Offset, + Select, + Sort, + GenericStage +} from '../../src/lite-api/stage'; + +export { + add, + subtract, + multiply, + divide, + mod, + eq, + neq, + lt, + lte, + gt, + gte, + arrayConcat, + arrayContains, + arrayContainsAny, + arrayContainsAll, + arrayLength, + eqAny, + notEqAny, + xor, + cond, + not, + logicalMaximum, + logicalMinimum, + exists, + isNan, + reverse, + replaceFirst, + replaceAll, + byteLength, + charLength, + like, + regexContains, + regexMatch, + strContains, + startsWith, + endsWith, + toLower, + toUpper, + trim, + strConcat, + mapGet, + countAll, + minimum, + maximum, + cosineDistance, + dotProduct, + euclideanDistance, + vectorLength, + unixMicrosToTimestamp, + timestampToUnixMicros, + unixMillisToTimestamp, + timestampToUnixMillis, + unixSecondsToTimestamp, + timestampToUnixSeconds, + timestampAdd, + timestampSub, + genericFunction, + ascending, + descending, + ExprWithAlias, + Field, + Fields, + Constant, + FirestoreFunction, + Add, + Subtract, + Multiply, + Divide, + Mod, + Eq, + Neq, + Lt, + Lte, + Gt, + Gte, + ArrayConcat, + ArrayReverse, + ArrayContains, + ArrayContainsAll, + ArrayContainsAny, + ArrayLength, + ArrayElement, + EqAny, + IsNan, + Exists, + Not, + And, + Or, + Xor, + Cond, + LogicalMaximum, + LogicalMinimum, + Reverse, + ReplaceFirst, + ReplaceAll, + CharLength, + ByteLength, + Like, + RegexContains, + RegexMatch, + StrContains, + StartsWith, + EndsWith, + ToLower, + ToUpper, + Trim, + StrConcat, + MapGet, + Count, + Sum, + Avg, + Minimum, + Maximum, + CosineDistance, + DotProduct, + EuclideanDistance, + VectorLength, + UnixMicrosToTimestamp, + TimestampToUnixMicros, + UnixMillisToTimestamp, + TimestampToUnixMillis, + UnixSecondsToTimestamp, + TimestampToUnixSeconds, + TimestampAdd, + TimestampSub, + Ordering, + ExprType, + AccumulatorTarget, + Selectable, + FilterCondition, + Accumulator +} from '../../src/lite-api/expressions'; diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 896aaa55d6e..a615a5559a5 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -48,11 +48,14 @@ "test:minified": "(cd ../../integration/firestore ; yarn test)", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report:main": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/index.d.ts", + "api-report:all-packages": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/all_packages.d.ts --rollupDts ./dist/private.all_packages.d.ts --untrimmedRollupDts ./dist/internal.all_packages.d.ts --publicDts ./dist/all_packages.d.ts", + "api-report:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-pipelines --packageRoot . --typescriptDts ./dist/firestore/pipelines/pipelines.d.ts --rollupDts ./dist/private.pipelines.d.ts --untrimmedRollupDts ./dist/internal.pipelines.d.ts --publicDts ./dist/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/index.d.ts", "api-report:lite": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite --packageRoot . --typescriptDts ./dist/firestore/lite/index.d.ts --rollupDts ./dist/lite/private.d.ts --untrimmedRollupDts ./dist/lite/internal.d.ts --publicDts ./dist/lite/index.d.ts", + "api-report:lite:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite-pipelines --packageRoot . --typescriptDts ./dist/firestore/lite/pipelines/pipelines.d.ts --rollupDts ./dist/lite/private.pipelines.d.ts --untrimmedRollupDts ./dist/lite/internal.pipelines.d.ts --publicDts ./dist/lite/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/index.d.ts", "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", - "api-report": "run-s --npm-path npm api-report:main api-report:lite && yarn api-report:api-json", + "api-report": "run-s --npm-path npm api-report:main api-report:pipelines api-report:all-packages api-report:lite api-report:lite:pipelines && yarn api-report:api-json", "doc": "api-documenter markdown --input temp --output docs", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts" + "typings:public": "node ../../scripts/build/use_typings.js ./dist/all-packages.d.ts" }, "exports": { ".": { @@ -76,18 +79,44 @@ }, "react-native": "./dist/lite/index.rn.esm2017.js", "browser": { - "require": "./dist/lite/index.cjs.js", + "require": "./dist/lite/index.browser.cjs.js", "import": "./dist/lite/index.browser.esm2017.js" }, "default": "./dist/lite/index.browser.esm2017.js" }, + "./lite/pipelines": { + "types": "./dist/lite/pipelines.d.ts", + "node": { + "require": "./dist/lite/pipelines.node.cjs.js", + "import": "./dist/lite/pipelines.node.mjs" + }, + "react-native": "./dist/lite/pipelines.rn.esm2017.js", + "browser": { + "require": "./dist/lite/pipelines.browser.cjs.js", + "import": "./dist/lite/pipelines.browser.esm2017.js" + }, + "default": "./dist/lite/pipelines.browser.esm2017.js" + }, + "./pipelines": { + "types": "./pipelines/pipelines.d.ts", + "node": { + "require": "./dist/pipelines.node.cjs.js", + "import": "./dist/pipelines.node.mjs" + }, + "react-native": "./dist/index.rn.esm2017.js", + "browser": { + "require": "./dist/pipelines.cjs.js", + "import": "./dist/pipelines.esm2017.js" + }, + "default": "./dist/pipelines.esm2017.js" + }, "./package.json": "./package.json" }, - "main": "dist/index.node.cjs.js", - "main-esm": "dist/index.node.mjs", + "main": "dist/node-cjs/index.node.cjs.js", + "main-esm": "dist/node-esm/index.node.mjs", "react-native": "dist/index.rn.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/browser-esm2017/index.esm2017.js", + "module": "dist/browser-esm2017/index.esm2017.js", "license": "Apache-2.0", "files": [ "dist", @@ -135,7 +164,7 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "typings": "dist/firestore/src/index.d.ts", + "types": "dist/index.d.ts", "nyc": { "extension": [ ".ts" diff --git a/packages/firestore/pipelines/package.json b/packages/firestore/pipelines/package.json new file mode 100644 index 00000000000..aab036bfdb0 --- /dev/null +++ b/packages/firestore/pipelines/package.json @@ -0,0 +1,14 @@ +{ + "name": "@firebase/firestore/pipelines", + "description": "pipelines", + "main": "../dist/pipelines.node.cjs.js", + "main-esm": "../dist/pipelines.node.mjs", + "module": "../dist/pipelines.browser.esm2017.js", + "browser": "../dist/pipelines.browser.esm2017.js", + "react-native": "../dist/pipelines.rn.esm2017.js", + "typings": "./pipelines.d.ts", + "private": true, + "engines": { + "node": ">=18.0.0" + } +} diff --git a/packages/firestore/pipelines/pipelines.d.ts b/packages/firestore/pipelines/pipelines.d.ts new file mode 100644 index 00000000000..5e7944e5731 --- /dev/null +++ b/packages/firestore/pipelines/pipelines.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2024 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 {PipelineSource, Pipeline} from "../dist/pipelines"; + +// Augument the Firestore and Query classes with the pipeline() method. +// This is stripped from dist/lite/pipelines.d.ts during the build +// so it needs to be re-added here. +declare module '@firebase/firestore' { + interface Firestore { + pipeline(): PipelineSource; + } + interface Query { + pipeline(): Pipeline; + } +} + +export * from "../dist/pipelines"; diff --git a/packages/firestore/pipelines/pipelines.node.ts b/packages/firestore/pipelines/pipelines.node.ts new file mode 100644 index 00000000000..fc0e91de0fc --- /dev/null +++ b/packages/firestore/pipelines/pipelines.node.ts @@ -0,0 +1,18 @@ +/** + * @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. + */ + +export * from '../src/api_pipelines'; diff --git a/packages/firestore/pipelines/pipelines.rn.ts b/packages/firestore/pipelines/pipelines.rn.ts new file mode 100644 index 00000000000..d5d4597190d --- /dev/null +++ b/packages/firestore/pipelines/pipelines.rn.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2024 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. + */ + +export * from '../src/api_pipelines'; diff --git a/packages/firestore/pipelines/pipelines.ts b/packages/firestore/pipelines/pipelines.ts new file mode 100644 index 00000000000..b056059adf4 --- /dev/null +++ b/packages/firestore/pipelines/pipelines.ts @@ -0,0 +1,51 @@ +/** + * Cloud Firestore + * + * @packageDocumentation + */ + +/** + * @license + * Copyright 2024 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. + */ + +// External exports: ./api +// These external exports will be stripped from the dist/pipelines.d.ts file +// by the prune-dts script, in order to reduce type duplication. However, these +// types need to be exported here to ensure that api-extractor behaves +// correctly. If a type from api.ts is missing from this export, then +// api-extractor may rename it with a suffix `_#`, e.g. `YourType_2`. +export type { + Timestamp, + DocumentReference, + VectorValue, + GeoPoint, + FieldPath, + DocumentData, + Query, + Firestore, + FirestoreDataConverter, + WithFieldValue, + PartialWithFieldValue, + SetOptions, + QueryDocumentSnapshot, + SnapshotOptions, + Primitive, + FieldValue, + SnapshotMetadata, + Bytes +} from '../src/api'; + +export * from '../src/api_pipelines'; diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index c9604fee55d..cac0a9c741b 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -61,9 +61,11 @@ const allBuilds = [ // this is an intermediate build used to generate the actual esm and cjs builds // which add build target reporting { - input: './src/index.node.ts', + input: ['./src/index.node.ts', './pipelines/pipelines.node.ts'], output: { - file: pkg['main-esm'], + dir: 'dist/intermediate', + entryFileNames: '[name].mjs', + chunkFileNames: 'common-[hash].node.mjs', format: 'es', sourcemap: true }, @@ -76,9 +78,14 @@ const allBuilds = [ }, // Node CJS build { - input: pkg['main-esm'], + input: [ + 'dist/intermediate/index.node.mjs', + 'dist/intermediate/pipelines.node.mjs' + ], output: { - file: pkg.main, + dir: 'dist/', + entryFileNames: '[name].cjs.js', + chunkFileNames: 'common-[hash].node.cjs.js', format: 'cjs', sourcemap: true }, @@ -103,9 +110,14 @@ const allBuilds = [ }, // Node ESM build with build target reporting { - input: pkg['main-esm'], + input: [ + 'dist/intermediate/index.node.mjs', + 'dist/intermediate/pipelines.node.mjs' + ], output: { - file: pkg['main-esm'], + dir: 'dist/', + entryFileNames: '[name].mjs', + chunkFileNames: 'common-[hash].node.mjs', format: 'es', sourcemap: true }, @@ -122,9 +134,11 @@ const allBuilds = [ // this is an intermediate build used to generate the actual esm and cjs builds // which add build target reporting { - input: './src/index.ts', + input: ['./src/index.ts', './pipelines/pipelines.ts'], output: { - file: pkg.browser, + dir: 'dist/intermediate', + entryFileNames: '[name].js', + chunkFileNames: 'common-[hash].js', format: 'es', sourcemap: true }, @@ -136,10 +150,12 @@ const allBuilds = [ }, // Convert es2017 build to cjs { - input: pkg['browser'], + input: ['dist/intermediate/index.js', 'dist/intermediate/pipelines.js'], output: [ { - file: './dist/index.cjs.js', + dir: 'dist/', + entryFileNames: '[name].cjs.js', + chunkFileNames: 'common-[hash].cjs.js', format: 'cjs', sourcemap: true } @@ -155,10 +171,12 @@ const allBuilds = [ }, // es2017 build with build target reporting { - input: pkg['browser'], + input: ['dist/intermediate/index.js', 'dist/intermediate/pipelines.js'], output: [ { - file: pkg['browser'], + dir: 'dist/', + entryFileNames: '[name].esm2017.js', + chunkFileNames: 'common-[hash].esm2017.js', format: 'es', sourcemap: true } @@ -174,9 +192,11 @@ const allBuilds = [ }, // RN build { - input: './src/index.rn.ts', + input: ['./src/index.rn.ts', './pipelines/pipelines.rn.ts'], output: { - file: pkg['react-native'], + dir: 'dist/', + entryFileNames: '[name].js', + chunkFileNames: 'common-[hash].rn.js', format: 'es', sourcemap: true }, diff --git a/packages/firestore/rollup.config.lite.js b/packages/firestore/rollup.config.lite.js index 25209966fe8..2c7707c3ba0 100644 --- a/packages/firestore/rollup.config.lite.js +++ b/packages/firestore/rollup.config.lite.js @@ -56,9 +56,11 @@ const allBuilds = [ // this is an intermediate build used to generate the actual esm and cjs builds // which add build target reporting { - input: './lite/index.ts', + input: ['./lite/index.ts', './lite/pipelines/pipelines.ts'], output: { - file: path.resolve('./lite', pkg['main-esm']), + dir: 'dist/intermediate/lite/', + entryFileNames: '[name].node.mjs', + chunkFileNames: 'common-[hash].node.mjs', format: 'es', sourcemap: true }, @@ -77,9 +79,14 @@ const allBuilds = [ }, // Node CJS build { - input: path.resolve('./lite', pkg['main-esm']), + input: [ + 'dist/intermediate/lite/index.node.mjs', + 'dist/intermediate/lite/pipelines.node.mjs' + ], output: { - file: path.resolve('./lite', pkg.main), + dir: 'dist/lite/', + entryFileNames: '[name].cjs.js', + chunkFileNames: 'common-[hash].node.cjs.js', format: 'cjs', sourcemap: true }, @@ -102,9 +109,14 @@ const allBuilds = [ }, // Node ESM build { - input: path.resolve('./lite', pkg['main-esm']), + input: [ + 'dist/intermediate/lite/index.node.mjs', + 'dist/intermediate/lite/pipelines.node.mjs' + ], output: { - file: path.resolve('./lite', pkg['main-esm']), + dir: 'dist/lite/', + entryFileNames: '[name].mjs', + chunkFileNames: 'common-[hash].node.mjs', format: 'es', sourcemap: true }, @@ -121,9 +133,11 @@ const allBuilds = [ // this is an intermediate build used to generate the actual esm and cjs builds // which add build target reporting { - input: './lite/index.ts', + input: ['./lite/index.ts', './lite/pipelines/pipelines.ts'], output: { - file: path.resolve('./lite', pkg.browser), + dir: 'dist/intermediate/lite/', + entryFileNames: '[name].browser.js', + chunkFileNames: 'common-[hash].browser.js', format: 'es', sourcemap: true }, @@ -142,10 +156,15 @@ const allBuilds = [ }, // Convert es2017 build to CJS { - input: path.resolve('./lite', pkg.browser), + input: [ + 'dist/intermediate/lite/index.browser.js', + 'dist/intermediate/lite/pipelines.browser.js' + ], output: [ { - file: './dist/lite/index.cjs.js', + dir: 'dist/lite/', + entryFileNames: '[name].cjs.js', + chunkFileNames: 'common-[hash].cjs.js', format: 'es', sourcemap: true } @@ -161,10 +180,15 @@ const allBuilds = [ }, // Browser es2017 build { - input: path.resolve('./lite', pkg.browser), + input: [ + 'dist/intermediate/lite/index.browser.js', + 'dist/intermediate/lite/pipelines.browser.js' + ], output: [ { - file: path.resolve('./lite', pkg.browser), + dir: 'dist/lite/', + entryFileNames: '[name].esm2017.js', + chunkFileNames: 'common-[hash].esm2017.js', format: 'es', sourcemap: true } @@ -180,9 +204,11 @@ const allBuilds = [ }, // RN build { - input: './lite/index.ts', + input: ['./lite/index.ts', './lite/pipelines/pipelines.ts'], output: { - file: path.resolve('./lite', pkg['react-native']), + dir: 'dist/lite/', + entryFileNames: '[name].rn.esm2017.js', + chunkFileNames: 'common-[hash].rn.esm2017.js', format: 'es', sourcemap: true }, diff --git a/packages/firestore/src/all_packages.ts b/packages/firestore/src/all_packages.ts new file mode 100644 index 00000000000..82babeea706 --- /dev/null +++ b/packages/firestore/src/all_packages.ts @@ -0,0 +1,25 @@ +/** + * Cloud Firestore + * + * @packageDocumentation + */ + +/** + * @license + * Copyright 2024 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. + */ + +export * from './api'; +export * from './api_pipelines'; diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 7619312d2d5..14390d57b49 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -15,175 +15,6 @@ * limitations under the License. */ -export { PipelineSource } from './lite-api/pipeline-source'; - -export { PipelineResult } from './lite-api/pipeline-result'; - -export { Pipeline } from './api/pipeline'; - -export { useFluentPipelines, pipeline, execute } from './api/pipeline_impl'; - -export { - Stage, - FindNearestOptions, - AddFields, - Aggregate, - Distinct, - CollectionSource, - CollectionGroupSource, - DatabaseSource, - DocumentsSource, - Where, - FindNearest, - Limit, - Offset, - Select, - Sort, - GenericStage -} from './lite-api/stage'; - -export { - add, - subtract, - multiply, - divide, - mod, - eq, - neq, - lt, - lte, - gt, - gte, - arrayConcat, - arrayContains, - arrayContainsAny, - arrayContainsAll, - arrayLength, - eqAny, - notEqAny, - xor, - cond, - not, - logicalMaximum, - logicalMinimum, - exists, - isNan, - reverse, - replaceFirst, - replaceAll, - byteLength, - charLength, - like, - regexContains, - regexMatch, - strContains, - startsWith, - endsWith, - toLower, - toUpper, - trim, - strConcat, - mapGet, - countAll, - countFunction, - sumFunction, - avgFunction, - andFunction, - orFunction, - minimum, - maximum, - cosineDistance, - dotProduct, - euclideanDistance, - vectorLength, - unixMicrosToTimestamp, - timestampToUnixMicros, - unixMillisToTimestamp, - timestampToUnixMillis, - unixSecondsToTimestamp, - timestampToUnixSeconds, - timestampAdd, - timestampSub, - genericFunction, - ascending, - descending, - ExprWithAlias, - Field, - Fields, - Constant, - FirestoreFunction, - Add, - Subtract, - Multiply, - Divide, - Mod, - Eq, - Neq, - Lt, - Lte, - Gt, - Gte, - ArrayConcat, - ArrayReverse, - ArrayContains, - ArrayContainsAll, - ArrayContainsAny, - ArrayLength, - ArrayElement, - EqAny, - NotEqAny, - IsNan, - Exists, - Not, - And, - Or, - Xor, - Cond, - LogicalMaximum, - LogicalMinimum, - Reverse, - ReplaceFirst, - ReplaceAll, - CharLength, - ByteLength, - Like, - RegexContains, - RegexMatch, - StrContains, - StartsWith, - EndsWith, - ToLower, - ToUpper, - Trim, - StrConcat, - MapGet, - Count, - Sum, - Avg, - Minimum, - Maximum, - CosineDistance, - DotProduct, - EuclideanDistance, - VectorLength, - UnixMicrosToTimestamp, - TimestampToUnixMicros, - UnixMillisToTimestamp, - TimestampToUnixMillis, - UnixSecondsToTimestamp, - TimestampToUnixSeconds, - TimestampAdd, - TimestampSub, - Ordering, - ExprType, - AccumulatorTarget, - FilterExpr, - SelectableExpr, - Selectable, - FilterCondition, - Accumulator -} from './lite-api/expressions'; - export { aggregateFieldEqual, aggregateQuerySnapshotEqual, diff --git a/packages/firestore/src/api/pipeline-source.ts b/packages/firestore/src/api/pipeline-source.ts deleted file mode 100644 index 3ad66cab9e9..00000000000 --- a/packages/firestore/src/api/pipeline-source.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @license - * Copyright 2024 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 { PipelineSource as LitePipelineSoure } from '../lite-api/pipeline-source'; -import { - CollectionGroupSource, - CollectionSource, - DatabaseSource, - DocumentsSource -} from '../lite-api/stage'; -import { UserDataReader } from '../lite-api/user_data_reader'; -import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; -import { DocumentKey } from '../model/document_key'; -import { cast } from '../util/input_validation'; - -import { Firestore } from './database'; -import { Pipeline } from './pipeline'; -import { DocumentReference } from './reference'; - -/** - * Represents the source of a Firestore {@link Pipeline}. - * @beta - */ -export class PipelineSource extends LitePipelineSoure { - /** - * @internal - * @private - * @param _db - * @param _userDataReader - * @param _userDataWriter - * @param _documentReferenceFactory - */ - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor( - _db: Firestore, - _userDataReader: UserDataReader, - _userDataWriter: AbstractUserDataWriter, - _documentReferenceFactory: (id: DocumentKey) => DocumentReference - ) { - super(_db, _userDataReader, _userDataWriter, _documentReferenceFactory); - } - - collection(collectionPath: string): Pipeline { - const _db = cast(this._db, Firestore); - return new Pipeline( - _db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new CollectionSource(collectionPath)] - ); - } - - collectionGroup(collectionId: string): Pipeline { - const _db = cast(this._db, Firestore); - return new Pipeline( - _db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new CollectionGroupSource(collectionId)] - ); - } - - database(): Pipeline { - const _db = cast(this._db, Firestore); - return new Pipeline( - _db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new DatabaseSource()] - ); - } - - documents(docs: DocumentReference[]): Pipeline { - const _db = cast(this._db, Firestore); - return new Pipeline( - _db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [DocumentsSource.of(docs)] - ); - } -} diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index de2cb16d9aa..aaddf00274b 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -15,56 +15,24 @@ * limitations under the License. */ +import { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult } from '../lite-api/pipeline-result'; -import { DocumentData, DocumentReference } from '../lite-api/reference'; +import { DocumentReference } from '../lite-api/reference'; import { Stage } from '../lite-api/stage'; import { UserDataReader } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; -import { DocumentKey } from '../model/document_key'; +import { cast } from '../util/input_validation'; -import { Firestore } from './database'; +import { ensureFirestoreConfigured, Firestore } from './database'; -export class Pipeline< - AppModelType = DocumentData -> extends LitePipeline { +export class Pipeline extends LitePipeline { /** * @internal * @private * @param db * @param userDataReader * @param userDataWriter - * @param documentReferenceFactory - * @param stages - * @param converter - */ - constructor( - db: Firestore, - userDataReader: UserDataReader, - userDataWriter: AbstractUserDataWriter, - documentReferenceFactory: (id: DocumentKey) => DocumentReference, - stages: Stage[], - // TODO(pipeline) support converter - //private converter: FirestorePipelineConverter = defaultPipelineConverter() - converter: unknown = {} - ) { - super( - db, - userDataReader, - userDataWriter, - documentReferenceFactory, - stages, - converter - ); - } - - /** - * @internal - * @private - * @param db - * @param userDataReader - * @param userDataWriter - * @param documentReferenceFactory * @param stages * @param converter * @protected @@ -73,18 +41,10 @@ export class Pipeline< db: Firestore, userDataReader: UserDataReader, userDataWriter: AbstractUserDataWriter, - documentReferenceFactory: (id: DocumentKey) => DocumentReference, stages: Stage[], converter: unknown = {} - ): Pipeline { - return new Pipeline( - db, - userDataReader, - userDataWriter, - documentReferenceFactory, - stages, - converter - ); + ): Pipeline { + return new Pipeline(db, userDataReader, userDataWriter, stages); } /** @@ -118,9 +78,29 @@ export class Pipeline< * * @return A Promise representing the asynchronous pipeline execution. */ - execute(): Promise>> { - throw new Error( - 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' - ); + execute(): Promise { + const firestore = cast(this._db, Firestore); + const client = ensureFirestoreConfigured(firestore); + return firestoreClientExecutePipeline(client, this).then(result => { + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + this._userDataWriter, + element.key?.path + ? new DocumentReference(firestore, null, element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + ) + ); + + return docs; + }); } } diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts index 5d58266b343..9e7c25e69ab 100644 --- a/packages/firestore/src/api/pipeline_impl.ts +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -16,21 +16,21 @@ */ import { Pipeline } from '../api/pipeline'; -import { PipelineSource } from '../api/pipeline-source'; -import { firestoreClientExecutePipeline } from '../core/firestore_client'; +import { toPipeline } from '../core/pipeline-util'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult } from '../lite-api/pipeline-result'; +import { PipelineSource } from '../lite-api/pipeline-source'; +import { Stage } from '../lite-api/stage'; import { newUserDataReader } from '../lite-api/user_data_reader'; -import { DocumentKey } from '../model/document_key'; import { cast } from '../util/input_validation'; -import { Firestore, ensureFirestoreConfigured } from './database'; -import { DocumentReference, Query } from './reference'; +import { Firestore } from './database'; +import { Query } from './reference'; import { ExpUserDataWriter } from './user_data_writer'; declare module './database' { interface Firestore { - pipeline(): PipelineSource; + pipeline(): PipelineSource; } } @@ -38,7 +38,7 @@ declare module './database' { * Experimental Modular API for console testing. * @param firestore */ -export function pipeline(firestore: Firestore): PipelineSource; +export function pipeline(firestore: Firestore): PipelineSource; /** * Experimental Modular API for console testing. @@ -48,72 +48,36 @@ export function pipeline(query: Query): Pipeline; export function pipeline( firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { +): PipelineSource | Pipeline { if (firestoreOrQuery instanceof Firestore) { const firestore = firestoreOrQuery; - return new PipelineSource( - firestore, - newUserDataReader(firestore), - new ExpUserDataWriter(firestore), - (key: DocumentKey) => { - return new DocumentReference(firestore, null, key); - } - ); + return new PipelineSource((stages: Stage[]) => { + return new Pipeline( + firestore, + newUserDataReader(firestore), + new ExpUserDataWriter(firestore), + stages + ); + }); } else { - let result; const query = firestoreOrQuery; const db = cast(query.firestore, Firestore); - if (query._query.collectionGroup) { - result = pipeline(db).collectionGroup(query._query.collectionGroup); - } else { - result = pipeline(db).collection(query._query.path.canonicalString()); - } - - // TODO(pipeline) convert existing query filters, limits, etc into - // pipeline stages - return result; + const litePipeline: LitePipeline = toPipeline(query._query, db); + return cast(litePipeline, Pipeline); } } -export function useFluentPipelines(): void { - Firestore.prototype.pipeline = function (): PipelineSource { - return pipeline(this); - }; - - Query.prototype.pipeline = function (): Pipeline { - return pipeline(this); - }; - Pipeline.prototype.execute = function (): Promise { - return execute(this); - }; +export function execute(pipeline: LitePipeline): Promise { + return pipeline.execute(); } -export function execute( - pipeline: LitePipeline -): Promise>> { - const firestore = cast(pipeline._db, Firestore); - const client = ensureFirestoreConfigured(firestore); - return firestoreClientExecutePipeline(client, pipeline).then(result => { - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - pipeline._userDataWriter, - element.key?.path - ? pipeline._documentReferenceFactory(element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - //this.converter - ) - ); +// Augment the Firestore class with the pipeline() factory method +Firestore.prototype.pipeline = function (): PipelineSource { + return pipeline(this); +}; - return docs; - }); -} +// Augment the Query class with the pipeline() factory method +Query.prototype.pipeline = function (): Pipeline { + return pipeline(this); +}; diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts index bcd54dca314..90fe836932f 100644 --- a/packages/firestore/src/api_pipelines.ts +++ b/packages/firestore/src/api_pipelines.ts @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { PipelineSource } from './lite-api/pipeline-source'; export { PipelineResult } from './lite-api/pipeline-result'; -export { Pipeline } from './lite-api/pipeline'; +export { Pipeline } from './api/pipeline'; -export { useFluentPipelines, execute, pipeline } from './api/pipeline_impl'; +export { pipeline, execute } from './api/pipeline_impl'; export { Stage, @@ -106,6 +107,7 @@ export { genericFunction, ascending, descending, + Expr, ExprWithAlias, Field, Fields, @@ -173,11 +175,12 @@ export { TimestampToUnixSeconds, TimestampAdd, TimestampSub, - Ordering, + Ordering +} from './lite-api/expressions'; + +export type { ExprType, AccumulatorTarget, - FilterExpr, - SelectableExpr, Selectable, FilterCondition, Accumulator diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index ad485c7f77a..bb0771d2335 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -557,7 +557,7 @@ export function firestoreClientRunAggregateQuery( export function firestoreClientExecutePipeline( client: FirestoreClient, - pipeline: Pipeline + pipeline: Pipeline ): Promise { const deferred = new Deferred(); diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 38c291a4710..0800eba85ea 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -15,28 +15,29 @@ * limitations under the License. */ +import { Firestore } from '../api/database'; import { Constant, - Expr, Field, FilterCondition, not, andFunction, - orFunction + orFunction, + Ordering, + And, + lt, + gt, + lte, + gte, + eq, + Or } from '../lite-api/expressions'; +import { Pipeline } from '../lite-api/pipeline'; +import { doc } from '../lite-api/reference'; import { isNanValue, isNullValue } from '../model/values'; -import { - ArrayValue as ProtoArrayValue, - Function as ProtoFunction, - LatLng as ProtoLatLng, - MapValue as ProtoMapValue, - Pipeline as ProtoPipeline, - Timestamp as ProtoTimestamp, - Value as ProtoValue -} from '../protos/firestore_proto_api'; import { fail } from '../util/assert'; -import { isPlainObject } from '../util/input_validation'; +import { Bound } from './bound'; import { CompositeFilter as CompositeFilterInternal, CompositeOperator, @@ -44,137 +45,18 @@ import { Filter as FilterInternal, Operator } from './filter'; +import { Direction } from './order_by'; +import { + isCollectionGroupQuery, + isDocumentQuery, + LimitType, + Query, + queryNormalizedOrderBy +} from './query'; /* eslint @typescript-eslint/no-explicit-any: 0 */ -function isITimestamp(obj: any): obj is ProtoTimestamp { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ( - 'seconds' in obj && - (obj.seconds === null || - typeof obj.seconds === 'number' || - typeof obj.seconds === 'string') && - 'nanos' in obj && - (obj.nanos === null || typeof obj.nanos === 'number') - ) { - return true; - } - - return false; -} -function isILatLng(obj: any): obj is ProtoLatLng { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ( - 'latitude' in obj && - (obj.latitude === null || typeof obj.latitude === 'number') && - 'longitude' in obj && - (obj.longitude === null || typeof obj.longitude === 'number') - ) { - return true; - } - - return false; -} -function isIArrayValue(obj: any): obj is ProtoArrayValue { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ('values' in obj && (obj.values === null || Array.isArray(obj.values))) { - return true; - } - - return false; -} -function isIMapValue(obj: any): obj is ProtoMapValue { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ('fields' in obj && (obj.fields === null || isPlainObject(obj.fields))) { - return true; - } - - return false; -} -function isIFunction(obj: any): obj is ProtoFunction { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ( - 'name' in obj && - (obj.name === null || typeof obj.name === 'string') && - 'args' in obj && - (obj.args === null || Array.isArray(obj.args)) - ) { - return true; - } - - return false; -} - -function isIPipeline(obj: any): obj is ProtoPipeline { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - if ('stages' in obj && (obj.stages === null || Array.isArray(obj.stages))) { - return true; - } - - return false; -} - -export function isFirestoreValue(obj: any): obj is ProtoValue { - if (typeof obj !== 'object' || obj === null) { - return false; // Must be a non-null object - } - - // Check optional properties and their types - if ( - ('nullValue' in obj && - (obj.nullValue === null || obj.nullValue === 'NULL_VALUE')) || - ('booleanValue' in obj && - (obj.booleanValue === null || typeof obj.booleanValue === 'boolean')) || - ('integerValue' in obj && - (obj.integerValue === null || - typeof obj.integerValue === 'number' || - typeof obj.integerValue === 'string')) || - ('doubleValue' in obj && - (obj.doubleValue === null || typeof obj.doubleValue === 'number')) || - ('timestampValue' in obj && - (obj.timestampValue === null || isITimestamp(obj.timestampValue))) || - ('stringValue' in obj && - (obj.stringValue === null || typeof obj.stringValue === 'string')) || - ('bytesValue' in obj && - (obj.bytesValue === null || obj.bytesValue instanceof Uint8Array)) || - ('referenceValue' in obj && - (obj.referenceValue === null || - typeof obj.referenceValue === 'string')) || - ('geoPointValue' in obj && - (obj.geoPointValue === null || isILatLng(obj.geoPointValue))) || - ('arrayValue' in obj && - (obj.arrayValue === null || isIArrayValue(obj.arrayValue))) || - ('mapValue' in obj && - (obj.mapValue === null || isIMapValue(obj.mapValue))) || - ('fieldReferenceValue' in obj && - (obj.fieldReferenceValue === null || - typeof obj.fieldReferenceValue === 'string')) || - ('functionValue' in obj && - (obj.functionValue === null || isIFunction(obj.functionValue))) || - ('pipelineValue' in obj && - (obj.pipelineValue === null || isIPipeline(obj.pipelineValue))) - ) { - return true; - } - - return false; -} - -export function toPipelineFilterCondition( - f: FilterInternal -): FilterCondition & Expr { +export function toPipelineFilterCondition(f: FilterInternal): FilterCondition { if (f instanceof FieldFilterInternal) { const field = Field.of(f.field.toString()); if (isNanValue(f.value)) { @@ -250,3 +132,122 @@ export function toPipelineFilterCondition( throw new Error(`Failed to convert filter to pipeline conditions: ${f}`); } + +function reverseOrderings(orderings: Ordering[]): Ordering[] { + return orderings.map( + o => + new Ordering( + o.expr, + o.direction === 'ascending' ? 'descending' : 'ascending' + ) + ); +} + +export function toPipeline(query: Query, db: Firestore): Pipeline { + let pipeline: Pipeline; + if (isCollectionGroupQuery(query)) { + pipeline = db.pipeline().collectionGroup(query.collectionGroup!); + } else if (isDocumentQuery(query)) { + pipeline = db.pipeline().documents([doc(db, query.path.canonicalString())]); + } else { + pipeline = db.pipeline().collection(query.path.canonicalString()); + } + + // filters + for (const filter of query.filters) { + pipeline = pipeline.where(toPipelineFilterCondition(filter)); + } + + // orders + const orders = queryNormalizedOrderBy(query); + const existsConditions = orders.map(order => + Field.of(order.field.canonicalString()).exists() + ); + if (existsConditions.length > 1) { + pipeline = pipeline.where( + andFunction(existsConditions[0], ...existsConditions.slice(1)) + ); + } else { + pipeline = pipeline.where(existsConditions[0]); + } + + const orderings = orders.map(order => + order.dir === Direction.ASCENDING + ? Field.of(order.field.canonicalString()).ascending() + : Field.of(order.field.canonicalString()).descending() + ); + + if (query.limitType === LimitType.Last) { + pipeline = pipeline.sort(...reverseOrderings(orderings)); + // cursors + if (query.startAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.startAt, orderings, 'before') + ); + } + + if (query.endAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.endAt, orderings, 'after') + ); + } + + pipeline = pipeline._limit(query.limit!, true); + pipeline = pipeline.sort(...orderings); + } else { + pipeline = pipeline.sort(...orderings); + if (query.startAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.startAt, orderings, 'after') + ); + } + if (query.endAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.endAt, orderings, 'before') + ); + } + + if (query.limit !== null) { + pipeline = pipeline.limit(query.limit); + } + } + + return pipeline; +} + +function whereConditionsFromCursor( + bound: Bound, + orderings: Ordering[], + position: 'before' | 'after' +): FilterCondition { + const cursors = bound.position.map(value => Constant._fromProto(value)); + const filterFunc = position === 'before' ? lt : gt; + const filterInclusiveFunc = position === 'before' ? lte : gte; + + const orConditions = []; + for (let i = 1; i <= orderings.length; i++) { + const cursorSubset = cursors.slice(0, i); + + const conditions = cursorSubset.map((cursor, index) => { + if (index < cursorSubset.length - 1) { + return eq(orderings[index].expr as Field, cursor); + } else if (!!bound.inclusive && i === orderings.length) { + return filterInclusiveFunc(orderings[index].expr as Field, cursor); + } else { + return filterFunc(orderings[index].expr as Field, cursor); + } + }); + + if (conditions.length === 1) { + orConditions.push(conditions[0]); + } else { + orConditions.push(new And(conditions)); + } + } + + if (orConditions.length === 1) { + return orConditions[0]; + } else { + return new Or(orConditions); + } +} diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 33b6afa8092..9ea4d4ec52e 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -41,8 +41,6 @@ import { cast } from '../util/input_validation'; import { logWarn } from '../util/log'; import { FirestoreService, removeComponents } from './components'; -// `import type` to avoid bundling the source for -// pipelines if `useFluentPipelines()` is not called import { DEFAULT_HOST, FirestoreSettingsImpl, diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 261f8112c4d..03e5c5e747e 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -29,6 +29,7 @@ import { UserData } from '../remote/serializer'; import { hardAssert } from '../util/assert'; +import { isFirestoreValue } from '../util/proto'; import { Bytes } from './bytes'; import { documentId, FieldPath } from './field_path'; @@ -44,59 +45,6 @@ import { } from './user_data_reader'; import { VectorValue } from './vector_value'; -/** - * @beta - * - * An interface that represents a selectable expression. - */ -export interface Selectable { - selectable: true; -} - -/** - * @beta - * - * An interface that represents a filter condition. - */ -export interface FilterCondition { - filterable: true; -} - -/** - * @beta - * - * An interface that represents an accumulator. - */ -export interface Accumulator { - accumulator: true; - /** - * @private - * @internal - */ - _toProto(serializer: JsonProtoSerializer): ProtoValue; -} - -/** - * @beta - * - * An accumulator target, which is an expression with an alias that also implements the Accumulator interface. - */ -export type AccumulatorTarget = ExprWithAlias; - -/** - * @beta - * - * A filter expression, which is an expression that also implements the FilterCondition interface. - */ -export type FilterExpr = Expr & FilterCondition; - -/** - * @beta - * - * A selectable expression, which is an expression that also implements the Selectable interface. - */ -export type SelectableExpr = Expr & Selectable; - /** * @beta * @@ -127,6 +75,8 @@ export type ExprType = * method calls to create complex expressions. */ export abstract class Expr implements ProtoSerializable, UserData { + abstract exprType: ExprType; + /** * Creates an expression that adds this expression to another expression. * @@ -667,21 +617,21 @@ export abstract class Expr implements ProtoSerializable, UserData { * @param arrays The array expressions to concatenate. * @return A new `Expr` representing the concatenated array. */ - arrayConcat(arrays: Expr[]): ArrayConcat; + arrayConcat(...arrays: Expr[]): ArrayConcat; /** - * Creates an expression that concatenates an array expression with one or more other arrays. + * Creates an expression that concatenates an array with one or more other arrays. * * ```typescript * // Combine the 'tags' array with a new array and an array field * Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); * ``` * - * @param arrays The array expressions or values to concatenate. - * @return A new `Expr` representing the concatenated array. + * @param arrays The arrays to concatenate. + * @return A new `Expr` representing the concatenated arrays. */ - arrayConcat(arrays: any[]): ArrayConcat; - arrayConcat(arrays: any[]): ArrayConcat { + arrayConcat(...arrays: any[][]): ArrayConcat; + arrayConcat(...arrays: any[]): ArrayConcat { const exprValues = arrays.map(value => value instanceof Expr ? value : Constant.of(value) ); @@ -1835,12 +1785,52 @@ export abstract class Expr implements ProtoSerializable, UserData { /** * @beta + * + * An interface that represents a selectable expression. + */ +export abstract class Selectable extends Expr { + selectable: true = true; +} + +/** + * @beta + * + * An interface that represents a filter condition. + */ +export abstract class FilterCondition extends Expr { + filterable: true = true; +} + +/** + * @beta + * + * An interface that represents an accumulator. + */ +export abstract class Accumulator extends Expr { + accumulator: true = true; + + /** + * @private + * @internal + */ + abstract _toProto(serializer: JsonProtoSerializer): ProtoValue; +} + +/** + * @beta + * + * An accumulator target, which is an expression with an alias that also implements the Accumulator interface. */ -export class ExprWithAlias extends Expr implements Selectable { +export type AccumulatorTarget = ExprWithAlias; + +/** + * @beta + */ +export class ExprWithAlias extends Selectable { exprType: ExprType = 'ExprWithAlias'; selectable = true as const; - constructor(public expr: T, public alias: string) { + constructor(readonly expr: T, readonly alias: string) { super(); } @@ -1909,7 +1899,7 @@ class ListOfExprs extends Expr { * const cityField = Field.of("address.city"); * ``` */ -export class Field extends Expr implements Selectable { +export class Field extends Selectable { exprType: ExprType = 'Field'; selectable = true as const; @@ -1939,7 +1929,6 @@ export class Field extends Expr implements Selectable { */ static of(name: string): Field; static of(path: FieldPath): Field; - static of(pipeline: Pipeline, name: string): Field; static of( pipelineOrName: Pipeline | string | FieldPath, name?: string @@ -1986,7 +1975,7 @@ export class Field extends Expr implements Selectable { /** * @beta */ -export class Fields extends Expr implements Selectable { +export class Fields extends Selectable { exprType: ExprType = 'Field'; selectable = true as const; @@ -2190,6 +2179,16 @@ export class Constant extends Expr { } } + /** + * @private + * @internal + */ + static _fromProto(value: ProtoValue): Constant { + const result = new Constant(value); + result._protoValue = value; + return result; + } + /** * @private * @internal @@ -2211,8 +2210,13 @@ export class Constant extends Expr { UserDataSource.Argument, 'Constant.of' ); - if (this.value === undefined) { - // TODO how should we treat the value of `undefined`? + + if (isFirestoreValue(this.value)) { + // Special case where value is a proto value. + // This can occur when converting a Query to Pipeline. + this._protoValue = this.value; + } else if (this.value === undefined) { + // TODO(pipeline) how should we treat the value of `undefined`? this._protoValue = parseData(null, context)!; } else { this._protoValue = parseData(this.value, context)!; @@ -2560,7 +2564,7 @@ export class Not extends FirestoreFunction implements FilterCondition { * @beta */ export class And extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterExpr[]) { + constructor(private conditions: FilterCondition[]) { super('and', conditions); } @@ -2571,7 +2575,7 @@ export class And extends FirestoreFunction implements FilterCondition { * @beta */ export class Or extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterExpr[]) { + constructor(private conditions: FilterCondition[]) { super('or', conditions); } filterable = true as const; @@ -2581,7 +2585,7 @@ export class Or extends FirestoreFunction implements FilterCondition { * @beta */ export class Xor extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterExpr[]) { + constructor(private conditions: FilterCondition[]) { super('xor', conditions); } filterable = true as const; @@ -2590,9 +2594,9 @@ export class Xor extends FirestoreFunction implements FilterCondition { /** * @beta */ -export class Cond extends FirestoreFunction implements FilterCondition { +export class Cond extends FirestoreFunction { constructor( - private condition: FilterExpr, + private condition: FilterCondition, private thenExpr: Expr, private elseExpr: Expr ) { @@ -4324,8 +4328,8 @@ export function arrayContainsAny( * Creates an expression that checks if an array expression contains all the specified elements. * * ```typescript - * // Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" - * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + * // Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1" + * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), Constant.of("SciFi"), Constant.of("Adventure")]); * ``` * * @param array The array expression to check. @@ -4340,7 +4344,7 @@ export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; * Creates an expression that checks if an array expression contains all the specified elements. * * ```typescript - * // Check if the 'tags' array contains both of the values from field 'tag1', 'tag2' and "tag3" + * // Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1" * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); * ``` * @@ -4586,7 +4590,7 @@ export function notEqAny(element: Expr | string, others: any[]): NotEqAny { * @param right Additional filter conditions to 'XOR' together. * @return A new {@code Expr} representing the logical 'XOR' operation. */ -export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor { +export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor { return new Xor([left, ...right]); } @@ -4608,7 +4612,7 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor { * @return A new {@code Expr} representing the conditional expression. */ export function cond( - condition: FilterExpr, + condition: FilterCondition, thenExpr: Expr, elseExpr: Expr ): Cond { @@ -4628,7 +4632,7 @@ export function cond( * @param filter The filter condition to negate. * @return A new {@code Expr} representing the negated filter condition. */ -export function not(filter: FilterExpr): Not { +export function not(filter: FilterCondition): Not { return new Not(filter); } @@ -6694,7 +6698,10 @@ export function genericFunction( * @param right Additional filter conditions to 'AND' together. * @return A new {@code Expr} representing the logical 'AND' operation. */ -export function andFunction(left: FilterExpr, ...right: FilterExpr[]): And { +export function andFunction( + left: FilterCondition, + ...right: FilterCondition[] +): And { return new And([left, ...right]); } @@ -6713,7 +6720,10 @@ export function andFunction(left: FilterExpr, ...right: FilterExpr[]): And { * @param right Additional filter conditions to 'OR' together. * @return A new {@code Expr} representing the logical 'OR' operation. */ -export function orFunction(left: FilterExpr, ...right: FilterExpr[]): Or { +export function orFunction( + left: FilterCondition, + ...right: FilterCondition[] +): Or { return new Or([left, ...right]); } @@ -6762,8 +6772,8 @@ export function descending(expr: Expr): Ordering { */ export class Ordering { constructor( - private expr: Expr, - private direction: 'ascending' | 'descending' + readonly expr: Expr, + readonly direction: 'ascending' | 'descending' ) {} /** diff --git a/packages/firestore/src/lite-api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts index f3951099ba2..dc0a6412481 100644 --- a/packages/firestore/src/lite-api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -72,8 +72,6 @@ export class PipelineResult { executionTime?: Timestamp, createTime?: Timestamp, updateTime?: Timestamp - // TODO converter - //readonly converter: FirestorePipelineConverter = defaultPipelineConverter() ) { this._ref = ref; this._userDataWriter = userDataWriter; @@ -160,26 +158,9 @@ export class PipelineResult { return undefined; } - // TODO(pipelines) - // We only want to use the converter and create a new QueryDocumentSnapshot - // if a converter has been provided. - // if (!!this.converter && this.converter !== defaultPipelineConverter()) { - // return this.converter.fromFirestore( - // new PipelineResult< DocumentData>( - // this._serializer, - // this.ref, - // this._fieldsProto, - // this._executionTime, - // this.createTime, - // this.updateTime, - // defaultPipelineConverter() - // ) - // ); - // } else {{ return this._userDataWriter.convertValue( this._fields.value ) as AppModelType; - //} } /** @@ -217,9 +198,9 @@ export class PipelineResult { } } -export function pipelineResultEqual( - left: PipelineResult, - right: PipelineResult +export function pipelineResultEqual( + left: PipelineResult, + right: PipelineResult ): boolean { if (left === right) { return true; diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index 99da8fee8c6..856096037f8 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -15,93 +15,46 @@ * limitations under the License. */ -import { DocumentKey } from '../model/document_key'; - -import { Firestore } from './database'; -import { Pipeline } from './pipeline'; import { DocumentReference } from './reference'; import { CollectionGroupSource, CollectionSource, DatabaseSource, - DocumentsSource + DocumentsSource, + Stage } from './stage'; -import { UserDataReader } from './user_data_reader'; -import { AbstractUserDataWriter } from './user_data_writer'; /** * Represents the source of a Firestore {@link Pipeline}. * @beta */ -export class PipelineSource { +export class PipelineSource { /** * @internal * @private - * @param _db - * @param _userDataReader - * @param _userDataWriter - * @param _documentReferenceFactory + * @param _createPipeline */ constructor( /** * @internal * @private */ - public _db: Firestore, - /** - * @internal - * @private - */ - public _userDataReader: UserDataReader, - /** - * @internal - * @private - */ - public _userDataWriter: AbstractUserDataWriter, - /** - * @internal - * @private - */ - public _documentReferenceFactory: (id: DocumentKey) => DocumentReference + public _createPipeline: (stages: Stage[]) => PipelineType ) {} - collection(collectionPath: string): Pipeline { - return new Pipeline( - this._db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new CollectionSource(collectionPath)] - ); + collection(collectionPath: string): PipelineType { + return this._createPipeline([new CollectionSource(collectionPath)]); } - collectionGroup(collectionId: string): Pipeline { - return new Pipeline( - this._db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new CollectionGroupSource(collectionId)] - ); + collectionGroup(collectionId: string): PipelineType { + return this._createPipeline([new CollectionGroupSource(collectionId)]); } - database(): Pipeline { - return new Pipeline( - this._db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [new DatabaseSource()] - ); + database(): PipelineType { + return this._createPipeline([new DatabaseSource()]); } - documents(docs: DocumentReference[]): Pipeline { - return new Pipeline( - this._db, - this._userDataReader, - this._userDataWriter, - this._documentReferenceFactory, - [DocumentsSource.of(docs)] - ); + documents(docs: DocumentReference[]): PipelineType { + return this._createPipeline([DocumentsSource.of(docs)]); } } diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index a1b9ad481e9..2145952c004 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -17,19 +17,20 @@ /* eslint @typescript-eslint/no-explicit-any: 0 */ -import { DocumentKey } from '../model/document_key'; import { ObjectValue } from '../model/object_value'; import { ExecutePipelineRequest, StructuredPipeline, Stage as ProtoStage } from '../protos/firestore_proto_api'; +import { invokeExecutePipeline } from '../remote/datastore'; import { getEncodedDatabaseId, JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; +import { getDatastore } from './components'; import { Firestore } from './database'; import { Accumulator, @@ -43,7 +44,7 @@ import { Selectable } from './expressions'; import { PipelineResult } from './pipeline-result'; -import { DocumentData, DocumentReference } from './reference'; +import { DocumentReference } from './reference'; import { AddFields, Aggregate, @@ -119,18 +120,14 @@ function isReadableUserData(value: any): value is ReadableUserData { /** * Base-class implementation */ -export class Pipeline - implements ProtoSerializable -{ +export class Pipeline implements ProtoSerializable { /** * @internal * @private * @param _db * @param userDataReader * @param _userDataWriter - * @param _documentReferenceFactory * @param stages - * @param converter */ constructor( /** @@ -144,15 +141,7 @@ export class Pipeline * @private */ public _userDataWriter: AbstractUserDataWriter, - /** - * @internal - * @private - */ - public _documentReferenceFactory: (id: DocumentKey) => DocumentReference, - private stages: Stage[], - // TODO(pipeline) support converter - //private converter: FirestorePipelineConverter = defaultPipelineConverter() - private converter: unknown = {} + private stages: Stage[] ) {} /** @@ -181,7 +170,7 @@ export class Pipeline * @param fields The fields to add to the documents, specified as {@link Selectable}s. * @return A new Pipeline object with this stage appended to the stage list. */ - addFields(...fields: Selectable[]): Pipeline { + addFields(...fields: Selectable[]): Pipeline { const copy = this.stages.map(s => s); copy.push( new AddFields( @@ -192,9 +181,7 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -229,7 +216,7 @@ export class Pipeline * Selectable} expressions or {@code string} values representing field names. * @return A new Pipeline object with this stage appended to the stage list. */ - select(...selections: Array): Pipeline { + select(...selections: Array): Pipeline { const copy = this.stages.map(s => s); let projections: Map = this.selectablesToMap(selections); projections = this.readUserData('select', projections); @@ -238,9 +225,7 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -297,27 +282,17 @@ export class Pipeline * @param db * @param userDataReader * @param userDataWriter - * @param documentReferenceFactory * @param stages - * @param converter * @protected */ protected newPipeline( db: Firestore, userDataReader: UserDataReader, userDataWriter: AbstractUserDataWriter, - documentReferenceFactory: (id: DocumentKey) => DocumentReference, stages: Stage[], converter: unknown = {} - ): Pipeline { - return new Pipeline( - db, - userDataReader, - userDataWriter, - documentReferenceFactory, - stages, - converter - ); + ): Pipeline { + return new Pipeline(db, userDataReader, userDataWriter, stages); } /** @@ -351,7 +326,7 @@ export class Pipeline * @param condition The {@link FilterCondition} to apply. * @return A new Pipeline object with this stage appended to the stage list. */ - where(condition: FilterCondition & Expr): Pipeline { + where(condition: FilterCondition): Pipeline { const copy = this.stages.map(s => s); this.readUserData('where', condition); copy.push(new Where(condition)); @@ -359,9 +334,7 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -385,16 +358,14 @@ export class Pipeline * @param offset The number of documents to skip. * @return A new Pipeline object with this stage appended to the stage list. */ - offset(offset: number): Pipeline { + offset(offset: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Offset(offset)); return this.newPipeline( this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -423,16 +394,25 @@ export class Pipeline * @param limit The maximum number of documents to return. * @return A new Pipeline object with this stage appended to the stage list. */ - limit(limit: number): Pipeline { + limit(limit: number): Pipeline { const copy = this.stages.map(s => s); copy.push(new Limit(limit)); return this.newPipeline( this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy + ); + } + + _limit(limit: number, convertedFromLimitTolast: boolean): Pipeline { + const copy = this.stages.map(s => s); + copy.push(new Limit(limit, convertedFromLimitTolast)); + return this.newPipeline( + this._db, + this.userDataReader, + this._userDataWriter, + copy ); } @@ -464,7 +444,7 @@ export class Pipeline * value combinations or {@code string}s representing field names. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - distinct(...groups: Array): Pipeline { + distinct(...groups: Array): Pipeline { const copy = this.stages.map(s => s); copy.push( new Distinct( @@ -475,9 +455,7 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -503,7 +481,7 @@ export class Pipeline * and provide a name for the accumulated results. * @return A new Pipeline object with this stage appended to the stage list. */ - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate(...accumulators: AccumulatorTarget[]): Pipeline; /** * Performs optionally grouped aggregation operations on the documents from previous stages. * @@ -539,7 +517,7 @@ export class Pipeline aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; - }): Pipeline; + }): Pipeline; aggregate( optionsOrTarget: | AccumulatorTarget @@ -548,7 +526,7 @@ export class Pipeline groups?: Array; }, ...rest: AccumulatorTarget[] - ): Pipeline { + ): Pipeline { const copy = this.stages.map(s => s); if ('accumulators' in optionsOrTarget) { copy.push( @@ -588,14 +566,11 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } - findNearest(options: FindNearestOptions): Pipeline; - findNearest(options: FindNearestOptions): Pipeline { + findNearest(options: FindNearestOptions): Pipeline { const copy = this.stages.map(s => s); const parseContext = this.userDataReader.createContext( UserDataSource.Argument, @@ -616,7 +591,6 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, copy ); } @@ -645,8 +619,7 @@ export class Pipeline * @param orders One or more {@link Ordering} instances specifying the sorting criteria. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - sort(...orderings: Ordering[]): Pipeline; - sort(options: { orderings: Ordering[] }): Pipeline; + sort(...orderings: Ordering[]): Pipeline; sort( optionsOrOrderings: | Ordering @@ -654,7 +627,7 @@ export class Pipeline orderings: Ordering[]; }, ...rest: Ordering[] - ): Pipeline { + ): Pipeline { const copy = this.stages.map(s => s); // Option object if ('orderings' in optionsOrOrderings) { @@ -677,9 +650,7 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } @@ -703,7 +674,7 @@ export class Pipeline * @param params A list of parameters to configure the generic stage's behavior. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - genericStage(name: string, params: any[]): Pipeline { + genericStage(name: string, params: any[]): Pipeline { const copy = this.stages.map(s => s); params.forEach(param => { if (isReadableUserData(param)) { @@ -715,78 +686,10 @@ export class Pipeline this._db, this.userDataReader, this._userDataWriter, - this._documentReferenceFactory, - copy, - this.converter + copy ); } - // TODO(pipeline) support converter - // withConverter(converter: null): Pipeline; - // withConverter( - // converter: FirestorePipelineConverter - // ): Pipeline; - // /** - // * Applies a custom data converter to this Query, allowing you to use your - // * own custom model objects with Firestore. When you call get() on the - // * returned Query, the provided converter will convert between Firestore - // * data of type `NewDbModelType` and your custom type `NewAppModelType`. - // * - // * Using the converter allows you to specify generic type arguments when - // * storing and retrieving objects from Firestore. - // * - // * Passing in `null` as the converter parameter removes the current - // * converter. - // * - // * @example - // * ``` - // * class Post { - // * constructor(readonly title: string, readonly author: string) {} - // * - // * toString(): string { - // * return this.title + ', by ' + this.author; - // * } - // * } - // * - // * const postConverter = { - // * toFirestore(post: Post): FirebaseFirestore.DocumentData { - // * return {title: post.title, author: post.author}; - // * }, - // * fromFirestore( - // * snapshot: FirebaseFirestore.QueryDocumentSnapshot - // * ): Post { - // * const data = snapshot.data(); - // * return new Post(data.title, data.author); - // * } - // * }; - // * - // * const postSnap = await Firestore() - // * .collection('posts') - // * .withConverter(postConverter) - // * .doc().get(); - // * const post = postSnap.data(); - // * if (post !== undefined) { - // * post.title; // string - // * post.toString(); // Should be defined - // * post.someNonExistentProperty; // TS error - // * } - // * - // * ``` - // * @param {FirestoreDataConverter | null} converter Converts objects to and - // * from Firestore. Passing in `null` removes the current converter. - // * @return A Query that uses the provided converter. - // */ - // withConverter( - // converter: FirestorePipelineConverter | null - // ): Pipeline { - // const copy = this.stages.map(s => s); - // return this.newPipeline( - // this.db, - // copy, - // converter ?? defaultPipelineConverter() - // ); - // } - /** * Executes this pipeline and returns a Promise to represent the asynchronous operation. * @@ -818,10 +721,29 @@ export class Pipeline * * @return A Promise representing the asynchronous pipeline execution. */ - execute(): Promise>> { - throw new Error( - 'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.' - ); + execute(): Promise { + const datastore = getDatastore(this._db); + return invokeExecutePipeline(datastore, this).then(result => { + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + this._userDataWriter, + element.key?.path + ? new DocumentReference(this._db, null, element.key) + : undefined, + element.fields, + element.executionTime?.toTimestamp(), + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + ) + ); + + return docs; + }); } /** diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index f3556dc6f09..98b121ad485 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -15,21 +15,18 @@ * limitations under the License. */ -import { DocumentKey } from '../model/document_key'; -import { invokeExecutePipeline } from '../remote/datastore'; - -import { getDatastore } from './components'; import { Firestore } from './database'; import { Pipeline } from './pipeline'; import { PipelineResult } from './pipeline-result'; import { PipelineSource } from './pipeline-source'; -import { DocumentReference, Query } from './reference'; +import { Query } from './reference'; import { LiteUserDataWriter } from './reference_impl'; +import { Stage } from './stage'; import { newUserDataReader } from './user_data_reader'; declare module './database' { interface Firestore { - pipeline(): PipelineSource; + pipeline(): PipelineSource; } } @@ -44,39 +41,15 @@ declare module './reference' { * @param pipeline Execute this pipeline. * @beta */ -export function execute( - pipeline: Pipeline -): Promise>> { - const datastore = getDatastore(pipeline._db); - return invokeExecutePipeline(datastore, pipeline).then(result => { - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - pipeline._userDataWriter, - element.key?.path - ? pipeline._documentReferenceFactory(element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - //this.converter - ) - ); - - return docs; - }); +export function execute(pipeline: Pipeline): Promise { + return pipeline.execute(); } /** * Experimental Modular API for console testing. * @param firestore */ -export function pipeline(firestore: Firestore): PipelineSource; +export function pipeline(firestore: Firestore): PipelineSource; /** * Experimental Modular API for console testing. @@ -86,19 +59,14 @@ export function pipeline(query: Query): Pipeline; export function pipeline( firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { +): PipelineSource | Pipeline { if (firestoreOrQuery instanceof Firestore) { const db = firestoreOrQuery; const userDataWriter = new LiteUserDataWriter(db); const userDataReader = newUserDataReader(db); - return new PipelineSource( - db, - userDataReader, - userDataWriter, - (key: DocumentKey) => { - return new DocumentReference(db, null, key); - } - ); + return new PipelineSource((stages: Stage[]) => { + return new Pipeline(db, userDataReader, userDataWriter, stages); + }); } else { let pipeline; const query = firestoreOrQuery; @@ -119,12 +87,10 @@ export function pipeline( } } -export function useFluentPipelines(): void { - Firestore.prototype.pipeline = function (): PipelineSource { - return pipeline(this); - }; +Firestore.prototype.pipeline = function (): PipelineSource { + return pipeline(this); +}; - Query.prototype.pipeline = function (): Pipeline { - return pipeline(this); - }; -} +Query.prototype.pipeline = function (): Pipeline { + return pipeline(this); +}; diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index b4fe237f79c..46f8fe60654 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -27,6 +27,7 @@ import { toMapValue, toStringValue } from '../remote/serializer'; +import { hardAssert } from '../util/assert'; import { Accumulator, @@ -204,7 +205,7 @@ export class DocumentsSource implements Stage { export class Where implements Stage { name = 'where'; - constructor(private condition: FilterCondition & Expr) {} + constructor(private condition: FilterCondition) {} /** * @internal @@ -289,7 +290,15 @@ export class FindNearest implements Stage { export class Limit implements Stage { name = 'limit'; - constructor(private limit: number) {} + constructor( + readonly limit: number, + readonly convertedFromLimitTolast: boolean = false + ) { + hardAssert( + !isNaN(limit) && limit !== Infinity && limit !== -Infinity, + 'Invalid limit value' + ); + } /** * @internal diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index 5fbff4392ac..00c1e7fca9e 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -241,7 +241,7 @@ export async function invokeBatchGetDocumentsRpc( export async function invokeExecutePipeline( datastore: Datastore, - pipeline: Pipeline + pipeline: Pipeline ): Promise { const datastoreImpl = debugCast(datastore, DatastoreImpl); const executePipelineRequest = pipeline._toProto(datastoreImpl.serializer); diff --git a/packages/firestore/src/util/proto.ts b/packages/firestore/src/util/proto.ts new file mode 100644 index 00000000000..a99f73cfa9c --- /dev/null +++ b/packages/firestore/src/util/proto.ts @@ -0,0 +1,155 @@ +/** + * @license + * Copyright 2024 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 { + ArrayValue as ProtoArrayValue, + Function as ProtoFunction, + LatLng as ProtoLatLng, + MapValue as ProtoMapValue, + Pipeline as ProtoPipeline, + Timestamp as ProtoTimestamp, + Value as ProtoValue +} from '../protos/firestore_proto_api'; + +import { isPlainObject } from './input_validation'; + +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +function isITimestamp(obj: any): obj is ProtoTimestamp { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'seconds' in obj && + (obj.seconds === null || + typeof obj.seconds === 'number' || + typeof obj.seconds === 'string') && + 'nanos' in obj && + (obj.nanos === null || typeof obj.nanos === 'number') + ) { + return true; + } + + return false; +} +function isILatLng(obj: any): obj is ProtoLatLng { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'latitude' in obj && + (obj.latitude === null || typeof obj.latitude === 'number') && + 'longitude' in obj && + (obj.longitude === null || typeof obj.longitude === 'number') + ) { + return true; + } + + return false; +} +function isIArrayValue(obj: any): obj is ProtoArrayValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('values' in obj && (obj.values === null || Array.isArray(obj.values))) { + return true; + } + + return false; +} +function isIMapValue(obj: any): obj is ProtoMapValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('fields' in obj && (obj.fields === null || isPlainObject(obj.fields))) { + return true; + } + + return false; +} +function isIFunction(obj: any): obj is ProtoFunction { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ( + 'name' in obj && + (obj.name === null || typeof obj.name === 'string') && + 'args' in obj && + (obj.args === null || Array.isArray(obj.args)) + ) { + return true; + } + + return false; +} + +function isIPipeline(obj: any): obj is ProtoPipeline { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + if ('stages' in obj && (obj.stages === null || Array.isArray(obj.stages))) { + return true; + } + + return false; +} + +export function isFirestoreValue(obj: any): obj is ProtoValue { + if (typeof obj !== 'object' || obj === null) { + return false; // Must be a non-null object + } + + // Check optional properties and their types + if ( + ('nullValue' in obj && + (obj.nullValue === null || obj.nullValue === 'NULL_VALUE')) || + ('booleanValue' in obj && + (obj.booleanValue === null || typeof obj.booleanValue === 'boolean')) || + ('integerValue' in obj && + (obj.integerValue === null || + typeof obj.integerValue === 'number' || + typeof obj.integerValue === 'string')) || + ('doubleValue' in obj && + (obj.doubleValue === null || typeof obj.doubleValue === 'number')) || + ('timestampValue' in obj && + (obj.timestampValue === null || isITimestamp(obj.timestampValue))) || + ('stringValue' in obj && + (obj.stringValue === null || typeof obj.stringValue === 'string')) || + ('bytesValue' in obj && + (obj.bytesValue === null || obj.bytesValue instanceof Uint8Array)) || + ('referenceValue' in obj && + (obj.referenceValue === null || + typeof obj.referenceValue === 'string')) || + ('geoPointValue' in obj && + (obj.geoPointValue === null || isILatLng(obj.geoPointValue))) || + ('arrayValue' in obj && + (obj.arrayValue === null || isIArrayValue(obj.arrayValue))) || + ('mapValue' in obj && + (obj.mapValue === null || isIMapValue(obj.mapValue))) || + ('fieldReferenceValue' in obj && + (obj.fieldReferenceValue === null || + typeof obj.fieldReferenceValue === 'string')) || + ('functionValue' in obj && + (obj.functionValue === null || isIFunction(obj.functionValue))) || + ('pipelineValue' in obj && + (obj.pipelineValue === null || isIPipeline(obj.pipelineValue))) + ) { + return true; + } + + return false; +} diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 1376947f482..48441c26065 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -58,1046 +58,1671 @@ import { setDoc, startsWith, subtract, - useFluentPipelines, setLogLevel, cond, eqAny, logicalMaximum, logicalMinimum, - notEqAny + notEqAny, + query, + where, + FieldPath, + orderBy, + limit, + limitToLast, + startAt, + startAfter, + endAt, + endBefore, + collectionGroup, + collection, + and, + documentId, + addDoc, + getDoc } from '../util/firebase_export'; -import { apiDescribe, withTestCollection } from '../util/helpers'; +import { + apiDescribe, + PERSISTENCE_MODE_UNSPECIFIED, + withTestCollection +} from '../util/helpers'; use(chaiAsPromised); setLogLevel('debug'); -apiDescribe('Pipelines', persistence => { +apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); - let firestore: Firestore; - let randomCol: CollectionReference; - - // async function addDocs( - // ...docs: DocumentData[] - // ): Promise { - // let id = 0; // Guarantees consistent ordering for the first documents - // const refs: DocumentReference[] = []; - // for (const data of docs) { - // const ref = doc(randomCol, 'doc' + id++); - // await setDoc(ref, data); - // refs.push(ref); - // } - // return refs; - // } - - async function testCollectionWithDocs(docs: { - [id: string]: DocumentData; - }): Promise> { - for (const id in docs) { - if (docs.hasOwnProperty(id)) { - const ref = doc(randomCol, id); - await setDoc(ref, docs[id]); + + describe('books tests', () => { + let firestore: Firestore; + let randomCol: CollectionReference; + + async function testCollectionWithDocs(docs: { + [id: string]: DocumentData; + }): Promise> { + for (const id in docs) { + if (docs.hasOwnProperty(id)) { + const ref = doc(randomCol, id); + await setDoc(ref, docs[id]); + } } + return randomCol; } - return randomCol; - } - - function expectResults( - result: Array>, - ...docs: string[] - ): void; - function expectResults( - result: Array>, - ...data: DocumentData[] - ): void; - - function expectResults( - result: Array>, - ...data: DocumentData[] | string[] - ): void { - expect(result.length).to.equal(data.length); - - if (data.length > 0) { - if (typeof data[0] === 'string') { - const actualIds = result.map(result => result.ref?.id); - expect(actualIds).to.deep.equal(data); - } else { - result.forEach(r => { - expect(r.data()).to.deep.equal(data.shift()); - }); + + function expectResults( + result: Array>, + ...docs: string[] + ): void; + function expectResults( + result: Array>, + ...data: DocumentData[] + ): void; + + function expectResults( + result: Array>, + ...data: DocumentData[] | string[] + ): void { + expect(result.length).to.equal(data.length); + + if (data.length > 0) { + if (typeof data[0] === 'string') { + const actualIds = result.map(result => result.ref?.id); + expect(actualIds).to.deep.equal(data); + } else { + result.forEach(r => { + expect(r.data()).to.deep.equal(data.shift()); + }); + } } } - } - - // async function compareQueryAndPipeline(query: Query): Promise { - // const queryResults = await getDocs(query); - // const pipeline = query.pipeline(); - // const pipelineResults = await pipeline.execute(); - // - // expect(queryResults.docs.map(s => s._fieldsProto)).to.deep.equal( - // pipelineResults.map(r => r._fieldsProto) - // ); - // return queryResults; - // } - - async function setupBookDocs(): Promise> { - const bookDocs: { [id: string]: DocumentData } = { - book1: { - title: "The Hitchhiker's Guide to the Galaxy", - author: 'Douglas Adams', - genre: 'Science Fiction', - published: 1979, - rating: 4.2, - tags: ['comedy', 'space', 'adventure'], - awards: { - hugo: true, - nebula: false, - others: { unknown: { year: 1980 } } - }, - nestedField: { 'level.1': { 'level.2': true } } - }, - book2: { - title: 'Pride and Prejudice', - author: 'Jane Austen', - genre: 'Romance', - published: 1813, - rating: 4.5, - tags: ['classic', 'social commentary', 'love'], - awards: { none: true } - }, - book3: { - title: 'One Hundred Years of Solitude', - author: 'Gabriel García Márquez', - genre: 'Magical Realism', - published: 1967, - rating: 4.3, - tags: ['family', 'history', 'fantasy'], - awards: { nobel: true, nebula: false } - }, - book4: { - title: 'The Lord of the Rings', - author: 'J.R.R. Tolkien', - genre: 'Fantasy', - published: 1954, - rating: 4.7, - tags: ['adventure', 'magic', 'epic'], - awards: { hugo: false, nebula: false } - }, - book5: { - title: "The Handmaid's Tale", - author: 'Margaret Atwood', - genre: 'Dystopian', - published: 1985, - rating: 4.1, - tags: ['feminism', 'totalitarianism', 'resistance'], - awards: { 'arthur c. clarke': true, 'booker prize': false } - }, - book6: { - title: 'Crime and Punishment', - author: 'Fyodor Dostoevsky', - genre: 'Psychological Thriller', - published: 1866, - rating: 4.3, - tags: ['philosophy', 'crime', 'redemption'], - awards: { none: true } - }, - book7: { - title: 'To Kill a Mockingbird', - author: 'Harper Lee', - genre: 'Southern Gothic', - published: 1960, - rating: 4.2, - tags: ['racism', 'injustice', 'coming-of-age'], - awards: { pulitzer: true } - }, - book8: { - title: '1984', - author: 'George Orwell', - genre: 'Dystopian', - published: 1949, - rating: 4.2, - tags: ['surveillance', 'totalitarianism', 'propaganda'], - awards: { prometheus: true } - }, - book9: { - title: 'The Great Gatsby', - author: 'F. Scott Fitzgerald', - genre: 'Modernist', - published: 1925, - rating: 4.0, - tags: ['wealth', 'american dream', 'love'], - awards: { none: true } - }, - book10: { - title: 'Dune', - author: 'Frank Herbert', - genre: 'Science Fiction', - published: 1965, - rating: 4.6, - tags: ['politics', 'desert', 'ecology'], - awards: { hugo: true, nebula: true } - } - }; - return testCollectionWithDocs(bookDocs); - } - - let testDeferred: Deferred | undefined; - let withTestCollectionPromise: Promise | undefined; - - beforeEach(async () => { - const setupDeferred = new Deferred(); - testDeferred = new Deferred(); - withTestCollectionPromise = withTestCollection( - persistence, - {}, - async (collectionRef, firestoreInstance) => { - randomCol = collectionRef; - firestore = firestoreInstance; - await setupBookDocs(); - setupDeferred.resolve(); - - return testDeferred?.promise; - } - ); - await setupDeferred.promise; - }); + async function setupBookDocs(): Promise> { + const bookDocs: { [id: string]: DocumentData } = { + book1: { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + book2: { + title: 'Pride and Prejudice', + author: 'Jane Austen', + genre: 'Romance', + published: 1813, + rating: 4.5, + tags: ['classic', 'social commentary', 'love'], + awards: { none: true } + }, + book3: { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + genre: 'Magical Realism', + published: 1967, + rating: 4.3, + tags: ['family', 'history', 'fantasy'], + awards: { nobel: true, nebula: false } + }, + book4: { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false } + }, + book5: { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + genre: 'Dystopian', + published: 1985, + rating: 4.1, + tags: ['feminism', 'totalitarianism', 'resistance'], + awards: { 'arthur c. clarke': true, 'booker prize': false } + }, + book6: { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + genre: 'Psychological Thriller', + published: 1866, + rating: 4.3, + tags: ['philosophy', 'crime', 'redemption'], + awards: { none: true } + }, + book7: { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + genre: 'Southern Gothic', + published: 1960, + rating: 4.2, + tags: ['racism', 'injustice', 'coming-of-age'], + awards: { pulitzer: true } + }, + book8: { + title: '1984', + author: 'George Orwell', + genre: 'Dystopian', + published: 1949, + rating: 4.2, + tags: ['surveillance', 'totalitarianism', 'propaganda'], + awards: { prometheus: true } + }, + book9: { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + genre: 'Modernist', + published: 1925, + rating: 4.0, + tags: ['wealth', 'american dream', 'love'], + awards: { none: true } + }, + book10: { + title: 'Dune', + author: 'Frank Herbert', + genre: 'Science Fiction', + published: 1965, + rating: 4.6, + tags: ['politics', 'desert', 'ecology'], + awards: { hugo: true, nebula: true } + } + }; + return testCollectionWithDocs(bookDocs); + } - afterEach(async () => { - testDeferred?.resolve(); - await withTestCollectionPromise; - }); + let testDeferred: Deferred | undefined; + let withTestCollectionPromise: Promise | undefined; + + beforeEach(async () => { + const setupDeferred = new Deferred(); + testDeferred = new Deferred(); + withTestCollectionPromise = withTestCollection( + persistence, + {}, + async (collectionRef, firestoreInstance) => { + randomCol = collectionRef; + firestore = firestoreInstance; + await setupBookDocs(); + setupDeferred.resolve(); + + return testDeferred?.promise; + } + ); - describe('fluent API', () => { - before(() => { - useFluentPipelines(); + await setupDeferred.promise; }); - it('empty results as expected', async () => { - const result = await firestore - .pipeline() - .collection(randomCol.path) - .limit(0) - .execute(); - expect(result.length).to.equal(0); + afterEach(async () => { + testDeferred?.resolve(); + await withTestCollectionPromise; }); - it('full results as expected', async () => { - const result = await firestore - .pipeline() - .collection(randomCol.path) - .execute(); - expect(result.length).to.equal(10); - }); + describe('fluent API', () => { + it('empty results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .limit(0) + .execute(); + expect(result.length).to.equal(0); + }); - it('returns aggregate results as expected', async () => { - let result = await firestore - .pipeline() - .collection(randomCol.path) - .aggregate(countAll().as('count')) - .execute(); - expectResults(result, { count: 10 }); - - result = await randomCol - .pipeline() - .where(eq('genre', 'Science Fiction')) - .aggregate( - countAll().as('count'), - avgFunction('rating').as('avgRating'), - Field.of('rating').maximum().as('maxRating') - ) - .execute(); - expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); - }); + it('full results as expected', async () => { + const result = await firestore + .pipeline() + .collection(randomCol.path) + .execute(); + expect(result.length).to.equal(10); + }); + + it('returns aggregate results as expected', async () => { + let result = await firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countAll().as('count')) + .execute(); + expectResults(result, { count: 10 }); + + result = await randomCol + .pipeline() + .where(eq('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + avgFunction('rating').as('avgRating'), + Field.of('rating').maximum().as('maxRating') + ) + .execute(); + expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + }); - it('rejects groups without accumulators', async () => { - await expect( - randomCol + it('rejects groups without accumulators', async () => { + await expect( + randomCol + .pipeline() + .where(lt('published', 1900)) + .aggregate({ + accumulators: [], + groups: ['genre'] + }) + .execute() + ).to.be.rejected; + }); + + it('returns distinct values as expected', async () => { + const results = await randomCol + .pipeline() + .distinct('genre', 'author') + .sort(Field.of('genre').ascending(), Field.of('author').ascending()) + .execute(); + expectResults( + results, + { genre: 'Dystopian', author: 'George Orwell' }, + { genre: 'Dystopian', author: 'Margaret Atwood' }, + { genre: 'Fantasy', author: 'J.R.R. Tolkien' }, + { genre: 'Magical Realism', author: 'Gabriel García Márquez' }, + { genre: 'Modernist', author: 'F. Scott Fitzgerald' }, + { genre: 'Psychological Thriller', author: 'Fyodor Dostoevsky' }, + { genre: 'Romance', author: 'Jane Austen' }, + { genre: 'Science Fiction', author: 'Douglas Adams' }, + { genre: 'Science Fiction', author: 'Frank Herbert' }, + { genre: 'Southern Gothic', author: 'Harper Lee' } + ); + }); + + it('returns group and accumulate results', async () => { + const results = await randomCol .pipeline() - .where(lt('published', 1900)) + .where(lt(Field.of('published'), 1984)) .aggregate({ - accumulators: [], + accumulators: [avgFunction('rating').as('avgRating')], groups: ['genre'] }) - .execute() - ).to.be.rejected; - }); - - // skip: toLower not supported - // it.skip('returns distinct values as expected', async () => { - // const results = await randomCol - // .pipeline() - // .where(lt('published', 1900)) - // .distinct(Field.of('genre').toLower().as('lowerGenre')) - // .execute(); - // expectResults( - // results, - // { lowerGenre: 'romance' }, - // { lowerGenre: 'psychological thriller' } - // ); - // }); - - it('returns group and accumulate results', async () => { - const results = await randomCol - .pipeline() - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()) - .execute(); - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } - ); - }); + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()) + .execute(); + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); - it('returns min and max accumulations', async () => { - const results = await randomCol - .pipeline() - .aggregate( - countAll().as('count'), - Field.of('rating').maximum().as('maxRating'), - Field.of('published').minimum().as('minPublished') - ) - .execute(); - expectResults(results, { - count: 10, - maxRating: 4.7, - minPublished: 1813 + it('returns min and max accumulations', async () => { + const results = await randomCol + .pipeline() + .aggregate( + countAll().as('count'), + Field.of('rating').maximum().as('maxRating'), + Field.of('published').minimum().as('minPublished') + ) + .execute(); + expectResults(results, { + count: 10, + maxRating: 4.7, + minPublished: 1813 + }); }); - }); - it('can select fields', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'author') - .sort(Field.of('author').ascending()) - .execute(); - expectResults( - results, - { - title: "The Hitchhiker's Guide to the Galaxy", - author: 'Douglas Adams' - }, - { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, - { title: 'Dune', author: 'Frank Herbert' }, - { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, - { - title: 'One Hundred Years of Solitude', - author: 'Gabriel García Márquez' - }, - { title: '1984', author: 'George Orwell' }, - { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, - { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, - { title: 'Pride and Prejudice', author: 'Jane Austen' }, - { title: "The Handmaid's Tale", author: 'Margaret Atwood' } - ); - }); + it('can select fields', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(Field.of('author').ascending()) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' + }, + { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, + { title: 'Dune', author: 'Frank Herbert' }, + { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez' + }, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, + { title: 'Pride and Prejudice', author: 'Jane Austen' }, + { title: "The Handmaid's Tale", author: 'Margaret Atwood' } + ); + }); - it('where with and', async () => { - const results = await randomCol - .pipeline() - .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) - .execute(); - expectResults(results, 'book10'); - }); + it('where with and', async () => { + const results = await randomCol + .pipeline() + .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) + .execute(); + expectResults(results, 'book10'); + }); - it('where with or', async () => { - const results = await randomCol - .pipeline() - .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) - .select('title') - .execute(); - expectResults( - results, - { title: 'Pride and Prejudice' }, - { title: "The Handmaid's Tale" }, - { title: '1984' } - ); - }); + it('where with or', async () => { + const results = await randomCol + .pipeline() + .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) + .select('title') + .execute(); + expectResults( + results, + { title: 'Pride and Prejudice' }, + { title: "The Handmaid's Tale" }, + { title: '1984' } + ); + }); - it('offset and limits', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .sort(Field.of('author').ascending()) - .offset(5) - .limit(3) - .select('title', 'author') - .execute(); - expectResults( - results, - { title: '1984', author: 'George Orwell' }, - { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, - { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } - ); - }); + it('offset and limits', async () => { + const results = await firestore + .pipeline() + .collection(randomCol.path) + .sort(Field.of('author').ascending()) + .offset(5) + .limit(3) + .select('title', 'author') + .execute(); + expectResults( + results, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); + }); - it('logical min works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - logicalMinimum(Constant.of(1960), Field.of('published')).as( - 'published-safe' + it('logical min works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + logicalMinimum(Constant.of(1960), Field.of('published')).as( + 'published-safe' + ) ) - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); - expectResults( - results, - { title: '1984', 'published-safe': 1949 }, - { title: 'Crime and Punishment', 'published-safe': 1866 }, - { title: 'Dune', 'published-safe': 1960 } - ); - }); + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1949 }, + { title: 'Crime and Punishment', 'published-safe': 1866 }, + { title: 'Dune', 'published-safe': 1960 } + ); + }); - it('logical max works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - logicalMaximum(Constant.of(1960), Field.of('published')).as( - 'published-safe' + it('logical max works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + logicalMaximum(Constant.of(1960), Field.of('published')).as( + 'published-safe' + ) ) - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); - expectResults( - results, - { title: '1984', 'published-safe': 1960 }, - { title: 'Crime and Punishment', 'published-safe': 1960 }, - { title: 'Dune', 'published-safe': 1965 } - ); - }); + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); - it('accepts and returns all data types', async () => { - const refDate = new Date(); - const refTimestamp = Timestamp.now(); - const constants = [ - Constant.of(1).as('number'), - Constant.of('a string').as('string'), - Constant.of(true).as('boolean'), - Constant.of(null).as('null'), - Constant.of(new GeoPoint(0.1, 0.2)).as('geoPoint'), - Constant.of(refTimestamp).as('timestamp'), - Constant.of(refDate).as('date'), - Constant.of( - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) - ).as('bytes'), - Constant.of(doc(firestore, 'foo', 'bar')).as('documentReference'), - Constant.of(vector([1, 2, 3])).as('vectorValue'), - Constant.of({ + it('accepts and returns all data types', async () => { + const refDate = new Date(); + const refTimestamp = Timestamp.now(); + const constants = [ + Constant.of(1).as('number'), + Constant.of('a string').as('string'), + Constant.of(true).as('boolean'), + Constant.of(null).as('null'), + Constant.of(new GeoPoint(0.1, 0.2)).as('geoPoint'), + Constant.of(refTimestamp).as('timestamp'), + Constant.of(refDate).as('date'), + Constant.of( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes'), + Constant.of(doc(firestore, 'foo', 'bar')).as('documentReference'), + Constant.of(vector([1, 2, 3])).as('vectorValue'), + Constant.of({ + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': refDate, + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }).as('map'), + Constant.of([ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + refDate, + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ]).as('array') + ]; + + const results = await randomCol + .pipeline() + .limit(1) + .select(...constants) + .execute(); + + expectResults(results, { 'number': 1, 'string': 'a string', 'boolean': true, 'null': null, 'geoPoint': new GeoPoint(0.1, 0.2), 'timestamp': refTimestamp, - 'date': refDate, - 'uint8Array': Bytes.fromUint8Array( + 'date': Timestamp.fromDate(refDate), + 'bytes': Bytes.fromUint8Array( new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) ), 'documentReference': doc(firestore, 'foo', 'bar'), 'vectorValue': vector([1, 2, 3]), 'map': { - 'number': 2, - 'string': 'b string' + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }, + 'array': [ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + Timestamp.fromDate(refDate), + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ] + }); + }); + + it('cond works', async () => { + const results = await randomCol + .pipeline() + .select( + 'title', + cond( + lt(Field.of('published'), 1960), + Constant.of(1960), + Field.of('published') + ).as('published-safe') + ) + .sort(Field.of('title').ascending()) + .limit(3) + .execute(); + expectResults( + results, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); + + it('eqAny works', async () => { + const results = await randomCol + .pipeline() + .where(eqAny('published', [1979, 1999, 1967])) + .select('title') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'One Hundred Years of Solitude' } + ); + }); + + it('notEqAny works', async () => { + const results = await randomCol + .pipeline() + .where( + notEqAny( + 'published', + [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] + ) + ) + .select('title') + .execute(); + expectResults(results, { title: 'Pride and Prejudice' }); + }); + + it('arrayContains works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContains('tags', 'comedy')) + .select('title') + .execute(); + expectResults(results, { + title: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('arrayContainsAny works', async () => { + const results = await randomCol + .pipeline() + .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .select('title') + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'Pride and Prejudice' } + ); + }); + + it('arrayContainsAll works', async () => { + const results = await randomCol + .pipeline() + .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) + .select('title') + .execute(); + expectResults(results, { title: 'The Lord of the Rings' }); + }); + + it('arrayLength works', async () => { + const results = await randomCol + .pipeline() + .select(Field.of('tags').arrayLength().as('tagsCount')) + .where(eq('tagsCount', 3)) + .execute(); + expect(results.length).to.equal(10); + }); + + // skip: arrayConcat not supported + // it.skip('arrayConcat works', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] + // }); + // }); + + it('testStrConcat', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('author') + .strConcat(' - ', Field.of('title')) + .as('bookInfo') + ) + .limit(1) + .execute(); + expectResults(results, { + bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testStartsWith', async () => { + const results = await randomCol + .pipeline() + .where(startsWith('title', 'The')) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'The Great Gatsby' }, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Lord of the Rings' } + ); + }); + + it('testEndsWith', async () => { + const results = await randomCol + .pipeline() + .where(endsWith('title', 'y')) + .select('title') + .sort(Field.of('title').descending()) + .execute(); + expectResults( + results, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Great Gatsby' } + ); + }); + + it('testLength', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('title').charLength().as('titleLength'), + Field.of('title') + ) + .where(gt('titleLength', 20)) + .sort(Field.of('title').ascending()) + .execute(); + + expectResults( + results, + + { + titleLength: 29, + title: 'One Hundred Years of Solitude' }, - 'array': [1, 'c string'] - }).as('map'), - Constant.of([ - 1, - 'a string', - true, - null, - new GeoPoint(0.1, 0.2), - refTimestamp, - refDate, - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), - doc(firestore, 'foo', 'bar'), - vector([1, 2, 3]), { - 'number': 2, - 'string': 'b string' - } - ]).as('array') - ]; - - const results = await randomCol - .pipeline() - .limit(1) - .select(...constants) - .execute(); - - expectResults(results, { - 'number': 1, - 'string': 'a string', - 'boolean': true, - 'null': null, - 'geoPoint': new GeoPoint(0.1, 0.2), - 'timestamp': refTimestamp, - 'date': Timestamp.fromDate(refDate), - 'bytes': Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), - 'documentReference': doc(firestore, 'foo', 'bar'), - 'vectorValue': vector([1, 2, 3]), - 'map': { - 'number': 1, - 'string': 'a string', - 'boolean': true, - 'null': null, - 'geoPoint': new GeoPoint(0.1, 0.2), - 'timestamp': refTimestamp, - 'date': Timestamp.fromDate(refDate), - 'uint8Array': Bytes.fromUint8Array( - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) - ), - 'documentReference': doc(firestore, 'foo', 'bar'), - 'vectorValue': vector([1, 2, 3]), - 'map': { - 'number': 2, - 'string': 'b string' + titleLength: 36, + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + titleLength: 21, + title: 'The Lord of the Rings' }, - 'array': [1, 'c string'] - }, - 'array': [ - 1, - 'a string', - true, - null, - new GeoPoint(0.1, 0.2), - refTimestamp, - Timestamp.fromDate(refDate), - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), - doc(firestore, 'foo', 'bar'), - vector([1, 2, 3]), { - 'number': 2, - 'string': 'b string' + titleLength: 21, + title: 'To Kill a Mockingbird' } - ] + ); }); - }); - it('cond works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - cond( - lt(Field.of('published'), 1960), - Constant.of(1960), - Field.of('published') - ).as('published-safe') - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); - expectResults( - results, - { title: '1984', 'published-safe': 1960 }, - { title: 'Crime and Punishment', 'published-safe': 1960 }, - { title: 'Dune', 'published-safe': 1965 } - ); - }); + // skip: toLower not supported + // it.skip('testToLowercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('title').toLower().as('lowercaseTitle')) + // .limit(1) + // .execute(); + // expectResults(results, { + // lowercaseTitle: "the hitchhiker's guide to the galaxy" + // }); + // }); + + // skip: toUpper not supported + // it.skip('testToUppercase', async () => { + // const results = await randomCol + // .pipeline() + // .select(Field.of('author').toUpper().as('uppercaseAuthor')) + // .limit(1) + // .execute(); + // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + // }); + + // skip: trim not supported + // it.skip('testTrim', async () => { + // const results = await randomCol + // .pipeline() + // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) + // .select( + // Field.of('spacedTitle').trim().as('trimmedTitle'), + // Field.of('spacedTitle') + // ) + // .limit(1) + // .execute(); + // expectResults(results, { + // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + // }); + // }); + + it('testLike', async () => { + const results = await randomCol + .pipeline() + .where(like('title', '%Guide%')) + .select('title') + .execute(); + expectResults(results, { + title: "The Hitchhiker's Guide to the Galaxy" + }); + }); - it('eqAny works', async () => { - const results = await randomCol - .pipeline() - .where(eqAny('published', [1979, 1999, 1967])) - .select('title') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'One Hundred Years of Solitude' } - ); - }); + it('testRegexContains', async () => { + const results = await randomCol + .pipeline() + .where(regexContains('title', '(?i)(the|of)')) + .execute(); + expect(results.length).to.equal(5); + }); - it('notEqAny works', async () => { - const results = await randomCol - .pipeline() - .where( - notEqAny( - 'published', - [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] + it('testRegexMatches', async () => { + const results = await randomCol + .pipeline() + .where(regexMatch('title', '.*(?i)(the|of).*')) + .execute(); + expect(results.length).to.equal(5); + }); + + it('testArithmeticOperations', async () => { + const results = await randomCol + .pipeline() + .select( + add(Field.of('rating'), 1).as('ratingPlusOne'), + subtract(Field.of('published'), 1900).as('yearsSince1900'), + Field.of('rating').multiply(10).as('ratingTimesTen'), + Field.of('rating').divide(2).as('ratingDividedByTwo') ) - ) - .select('title') - .execute(); - expectResults(results, { title: 'Pride and Prejudice' }); - }); + .limit(1) + .execute(); + expectResults(results, { + ratingPlusOne: 5.2, + yearsSince1900: 79, + ratingTimesTen: 42, + ratingDividedByTwo: 2.1 + }); + }); - it('arrayContains works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContains('tags', 'comedy')) - .select('title') - .execute(); - expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); - }); + it('testComparisonOperators', async () => { + const results = await randomCol + .pipeline() + .where( + andFunction( + gt('rating', 4.2), + lte(Field.of('rating'), 4.5), + neq('genre', 'Science Fiction') + ) + ) + .select('rating', 'title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { rating: 4.3, title: 'Crime and Punishment' }, + { + rating: 4.3, + title: 'One Hundred Years of Solitude' + }, + { rating: 4.5, title: 'Pride and Prejudice' } + ); + }); - it('arrayContainsAny works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContainsAny('tags', ['comedy', 'classic'])) - .select('title') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'Pride and Prejudice' } - ); - }); + it('testLogicalOperators', async () => { + const results = await randomCol + .pipeline() + .where( + orFunction( + andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), + lt('published', 1900) + ) + ) + .select('title') + .sort(Field.of('title').ascending()) + .execute(); + expectResults( + results, + { title: 'Crime and Punishment' }, + { title: 'Dune' }, + { title: 'Pride and Prejudice' } + ); + }); - it('arrayContainsAll works', async () => { - const results = await randomCol - .pipeline() - .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) - .select('title') - .execute(); - expectResults(results, { title: 'The Lord of the Rings' }); - }); + it('testChecks', async () => { + const results = await randomCol + .pipeline() + .where(not(Field.of('rating').isNaN())) + .select( + Field.of('rating').eq(null).as('ratingIsNull'), + not(Field.of('rating').isNaN()).as('ratingIsNotNaN') + ) + .limit(1) + .execute(); + expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); + }); + + it('testMapGet', async () => { + const results = await randomCol + .pipeline() + .select( + Field.of('awards').mapGet('hugo').as('hugoAward'), + Field.of('awards').mapGet('others').as('others'), + Field.of('title') + ) + .where(eq('hugoAward', true)) + .execute(); + expectResults( + results, + { + hugoAward: true, + title: "The Hitchhiker's Guide to the Galaxy", + others: { unknown: { year: 1980 } } + }, + { hugoAward: true, title: 'Dune', others: null } + ); + }); + + // it('testParent', async () => { + // const results = await randomCol + // .pipeline() + // .select( + // parent(randomCol.doc('chile').collection('subCollection').path).as( + // 'parent' + // ) + // ) + // .limit(1) + // .execute(); + // expect(results[0].data().parent.endsWith('/books')).to.be.true; + // }); + // + // it('testCollectionId', async () => { + // const results = await randomCol + // .pipeline() + // .select(collectionId(randomCol.doc('chile')).as('collectionId')) + // .limit(1) + // .execute(); + // expectResults(results, {collectionId: 'books'}); + // }); + + it('testDistanceFunctions', async () => { + const sourceVector = [0.1, 0.1]; + const targetVector = [0.5, 0.8]; + const results = await randomCol + .pipeline() + .select( + cosineDistance(Constant.vector(sourceVector), targetVector).as( + 'cosineDistance' + ), + dotProduct(Constant.vector(sourceVector), targetVector).as( + 'dotProductDistance' + ), + euclideanDistance(Constant.vector(sourceVector), targetVector).as( + 'euclideanDistance' + ) + ) + .limit(1) + .execute(); + + expectResults(results, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + }); + + it('testNestedFields', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select('title', 'awards.hugo') + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'awards.hugo': true + }, + { title: 'Dune', 'awards.hugo': true } + ); + }); + + it('test mapGet with field name including . notation', async () => { + const results = await randomCol + .pipeline() + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ) + .execute(); + expectResults( + results, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'nestedField.level.`1`': null, + nested: true + }, + { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + ); + }); - it('arrayLength works', async () => { - const results = await randomCol - .pipeline() - .select(Field.of('tags').arrayLength().as('tagsCount')) - .where(eq('tagsCount', 3)) - .execute(); - expect(results.length).to.equal(10); + it('supports internal serialization to proto', async () => { + const pipeline = firestore + .pipeline() + .collection('books') + .where(eq('awards.hugo', true)) + .select( + 'title', + Field.of('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ); + + const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); + expect(proto).not.to.be.null; + }); + + describe('pagination', () => { + async function addBooks( + collection: CollectionReference + ): Promise { + await setDoc(doc(randomCol, 'book11'), { + title: 'Jonathan Strange & Mr Norrell', + author: 'Susanna Clarke', + genre: 'Fantasy', + published: 2004, + rating: 4.6, + tags: [ + 'historical fantasy', + 'magic', + 'alternate history', + 'england' + ], + awards: { hugo: false, nebula: false } + }); + await setDoc(doc(randomCol, 'book12'), { + title: 'The Master and Margarita', + author: 'Mikhail Bulgakov', + genre: 'Satire', + published: 1967, // Though written much earlier + rating: 4.6, + tags: [ + 'russian literature', + 'supernatural', + 'philosophy', + 'dark comedy' + ], + awards: {} + }); + await setDoc(doc(randomCol, 'book13'), { + title: 'A Long Way to a Small, Angry Planet', + author: 'Becky Chambers', + genre: 'Science Fiction', + published: 2014, + rating: 4.6, + tags: [ + 'space opera', + 'found family', + 'character-driven', + 'optimistic' + ], + awards: { hugo: false, nebula: false, kitschies: true } + }); + } + + it('supports pagination with filters', async () => { + await addBooks(randomCol); + const pageSize = 2; + const pipeline = randomCol + .pipeline() + .select('title', 'rating', '__name__') + .sort( + Field.of('rating').descending(), + Field.of('__name__').ascending() + ); + + let results = await pipeline.limit(pageSize).execute(); + expectResults( + results, + { title: 'The Lord of the Rings', rating: 4.7 }, + { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } + ); + + const lastDoc = results[results.length - 1]; + + results = await pipeline + .where( + orFunction( + andFunction( + Field.of('rating').eq(lastDoc.get('rating')), + Field.of('__path__').gt(lastDoc.ref?.path) + ), + Field.of('rating').lt(lastDoc.get('rating')) + ) + ) + .limit(pageSize) + .execute(); + expectResults( + results, + { title: 'Pride and Prejudice', rating: 4.5 }, + { title: 'Crime and Punishment', rating: 4.3 } + ); + }); + + it('supports pagination with offsets', async () => { + await addBooks(randomCol); + + const secondFilterField = '__path__'; + + const pipeline = randomCol + .pipeline() + .select('title', 'rating', secondFilterField) + .sort( + Field.of('rating').descending(), + Field.of(secondFilterField).ascending() + ); + + const pageSize = 2; + let currPage = 0; + + let results = await pipeline + .offset(currPage++ * pageSize) + .limit(pageSize) + .execute(); + + expectResults( + results, + { + title: 'The Lord of the Rings', + rating: 4.7 + }, + { title: 'Dune', rating: 4.6 } + ); + + results = await pipeline + .offset(currPage++ * pageSize) + .limit(pageSize) + .execute(); + expectResults( + results, + { + title: 'Jonathan Strange & Mr Norrell', + rating: 4.6 + }, + { title: 'The Master and Margarita', rating: 4.6 } + ); + + results = await pipeline + .offset(currPage++ * pageSize) + .limit(pageSize) + .execute(); + expectResults( + results, + { + title: 'A Long Way to a Small, Angry Planet', + rating: 4.6 + }, + { + title: 'Pride and Prejudice', + rating: 4.5 + } + ); + }); + }); }); - // skip: arrayConcat not supported - // it.skip('arrayConcat works', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] - // }); - // }); - - it('testStrConcat', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('author').strConcat(' - ', Field.of('title')).as('bookInfo') - ) - .limit(1) - .execute(); - expectResults(results, { - bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + describe('modular API', () => { + it('works when creating a pipeline from a Firestore instance', async () => { + const myPipeline = pipeline(firestore) + .collection(randomCol.path) + .where(lt(Field.of('published'), 1984)) + .aggregate({ + accumulators: [avgFunction('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()); + + const results = await execute(myPipeline); + + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + + it('works when creating a pipeline from a collection', async () => { + const myPipeline = pipeline(randomCol) + .where(lt(Field.of('published'), 1984)) + .aggregate({ + accumulators: [avgFunction('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .sort(Field.of('avgRating').descending()); + + const results = await execute(myPipeline); + + expectResults( + results, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); }); }); + }); - it('testStartsWith', async () => { - const results = await randomCol - .pipeline() - .where(startsWith('title', 'The')) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { title: 'The Great Gatsby' }, - { title: "The Handmaid's Tale" }, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Lord of the Rings' } + // This is the Query integration tests from the lite API (no cache support) + // with some additional test cases added for more complete coverage. + describe('Query to Pipeline', () => { + function verifyResults( + actual: Array>, + ...expected: DocumentData[] + ): void { + expect(actual.length).to.equal(expected.length); + + for (let i = 0; i < expected.length; ++i) { + expect(actual[i].data()).to.deep.equal(expected[i]); + } + } + + it('supports default query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { 1: { foo: 1 } }, + async collRef => { + const result = await collRef.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } ); }); - it('testEndsWith', async () => { - const results = await randomCol - .pipeline() - .where(endsWith('title', 'y')) - .select('title') - .sort(Field.of('title').descending()) - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Great Gatsby' } + it('supports filtered query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, where('foo', '==', 1)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } ); }); - it('testLength', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('title').charLength().as('titleLength'), - Field.of('title') - ) - .where(gt('titleLength', 20)) - .sort(Field.of('title').ascending()) - .execute(); - - expectResults( - results, - + it('supports filtered query (with FieldPath)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - titleLength: 29, - title: 'One Hundred Years of Solitude' + 1: { foo: 1 }, + 2: { foo: 2 } }, + async collRef => { + const query1 = query(collRef, where(new FieldPath('foo'), '==', 1)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } + ); + }); + + it('supports ordered query (with default order)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - titleLength: 36, - title: "The Hitchhiker's Guide to the Galaxy" + 1: { foo: 1 }, + 2: { foo: 2 } }, + async collRef => { + const query1 = query(collRef, orderBy('foo')); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }, { foo: 2 }); + } + ); + }); + + it('supports ordered query (with asc)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - titleLength: 21, - title: 'The Lord of the Rings' + 1: { foo: 1 }, + 2: { foo: 2 } }, - { - titleLength: 21, - title: 'To Kill a Mockingbird' + async collRef => { + const query1 = query(collRef, orderBy('foo', 'asc')); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }, { foo: 2 }); } ); }); - // skip: toLower not supported - // it.skip('testToLowercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('title').toLower().as('lowercaseTitle')) - // .limit(1) - // .execute(); - // expectResults(results, { - // lowercaseTitle: "the hitchhiker's guide to the galaxy" - // }); - // }); - - // skip: toUpper not supported - // it.skip('testToUppercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('author').toUpper().as('uppercaseAuthor')) - // .limit(1) - // .execute(); - // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); - // }); - - // skip: trim not supported - // it.skip('testTrim', async () => { - // const results = await randomCol - // .pipeline() - // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) - // .select( - // Field.of('spacedTitle').trim().as('trimmedTitle'), - // Field.of('spacedTitle') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", - // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" - // }); - // }); - - it('testLike', async () => { - const results = await randomCol - .pipeline() - .where(like('title', '%Guide%')) - .select('title') - .execute(); - expectResults(results, { title: "The Hitchhiker's Guide to the Galaxy" }); + it('supports ordered query (with desc)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo', 'desc')); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }, { foo: 1 }); + } + ); }); - it('testRegexContains', async () => { - const results = await randomCol - .pipeline() - .where(regexContains('title', '(?i)(the|of)')) - .execute(); - expect(results.length).to.equal(5); + it('supports limit query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo'), limit(1)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } + ); }); - it('testRegexMatches', async () => { - const results = await randomCol - .pipeline() - .where(regexMatch('title', '.*(?i)(the|of).*')) - .execute(); - expect(results.length).to.equal(5); + it('supports limitToLast query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 }, + 3: { foo: 3 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo'), limitToLast(2)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }, { foo: 3 }); + } + ); }); - it('testArithmeticOperations', async () => { - const results = await randomCol - .pipeline() - .select( - add(Field.of('rating'), 1).as('ratingPlusOne'), - subtract(Field.of('published'), 1900).as('yearsSince1900'), - Field.of('rating').multiply(10).as('ratingTimesTen'), - Field.of('rating').divide(2).as('ratingDividedByTwo') - ) - .limit(1) - .execute(); - expectResults(results, { - ratingPlusOne: 5.2, - yearsSince1900: 79, - ratingTimesTen: 42, - ratingDividedByTwo: 2.1 - }); + it('supports startAt', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo'), startAt(2)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }); + } + ); }); - it('testComparisonOperators', async () => { - const results = await randomCol - .pipeline() - .where( - andFunction( - gt('rating', 4.2), - lte(Field.of('rating'), 4.5), - neq('genre', 'Science Fiction') - ) - ) - .select('rating', 'title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { rating: 4.3, title: 'Crime and Punishment' }, + it('supports startAfter (with DocumentReference)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - rating: 4.3, - title: 'One Hundred Years of Solitude' + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } }, - { rating: 4.5, title: 'Pride and Prejudice' } + async collRef => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + let result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } ); }); - it('testLogicalOperators', async () => { - const results = await randomCol - .pipeline() - .where( - orFunction( - andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), - lt('published', 1900) - ) - ) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { title: 'Crime and Punishment' }, - { title: 'Dune' }, - { title: 'Pride and Prejudice' } + it('supports startAt (with DocumentReference)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async collRef => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + let result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 2, foo: 1, bar: 1, baz: 2 }, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } ); }); - it('testChecks', async () => { - const results = await randomCol - .pipeline() - .where(not(Field.of('rating').isNaN())) - .select( - Field.of('rating').eq(null).as('ratingIsNull'), - not(Field.of('rating').isNaN()).as('ratingIsNotNaN') - ) - .limit(1) - .execute(); - expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); + it('supports startAfter', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo'), startAfter(1)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }); + } + ); }); - it('testMapGet', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('awards').mapGet('hugo').as('hugoAward'), - Field.of('awards').mapGet('others').as('others'), - Field.of('title') - ) - .where(eq('hugoAward', true)) - .execute(); - expectResults( - results, + it('supports endAt', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - hugoAward: true, - title: "The Hitchhiker's Guide to the Galaxy", - others: { unknown: { year: 1980 } } + 1: { foo: 1 }, + 2: { foo: 2 } }, - { hugoAward: true, title: 'Dune', others: null } + async collRef => { + const query1 = query(collRef, orderBy('foo'), endAt(1)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } ); }); - // it('testParent', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // parent(randomCol.doc('chile').collection('subCollection').path).as( - // 'parent' - // ) - // ) - // .limit(1) - // .execute(); - // expect(results[0].data().parent.endsWith('/books')).to.be.true; - // }); - // - // it('testCollectionId', async () => { - // const results = await randomCol - // .pipeline() - // .select(collectionId(randomCol.doc('chile')).as('collectionId')) - // .limit(1) - // .execute(); - // expectResults(results, {collectionId: 'books'}); - // }); - - it('testDistanceFunctions', async () => { - const sourceVector = [0.1, 0.1]; - const targetVector = [0.5, 0.8]; - const results = await randomCol - .pipeline() - .select( - cosineDistance(Constant.vector(sourceVector), targetVector).as( - 'cosineDistance' - ), - dotProduct(Constant.vector(sourceVector), targetVector).as( - 'dotProductDistance' - ), - euclideanDistance(Constant.vector(sourceVector), targetVector).as( - 'euclideanDistance' - ) - ) - .limit(1) - .execute(); - - expectResults(results, { - cosineDistance: 0.02560880430538015, - dotProductDistance: 0.13, - euclideanDistance: 0.806225774829855 - }); + it('supports endBefore', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + const query1 = query(collRef, orderBy('foo'), endBefore(2)); + const result = await query1.pipeline().execute(); + verifyResults(result, { foo: 1 }); + } + ); }); - it('testNestedFields', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select('title', 'awards.hugo') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy", 'awards.hugo': true }, - { title: 'Dune', 'awards.hugo': true } + it('supports pagination', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async collRef => { + let query1 = query(collRef, orderBy('foo'), limit(1)); + const pipeline1 = query1.pipeline(); + let result = await pipeline1.execute(); + verifyResults(result, { foo: 1 }); + + // Pass the document snapshot from the previous result + query1 = query(query1, startAfter(result[0].get('foo'))); + result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }); + } ); }); - it('test mapGet with field name including . notation', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') - ) - .execute(); - expectResults( - results, + it('supports pagination on DocumentIds', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, { - title: "The Hitchhiker's Guide to the Galaxy", - 'nestedField.level.`1`': null, - nested: true + 1: { foo: 1 }, + 2: { foo: 2 } }, - { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + async collRef => { + let query1 = query( + collRef, + orderBy('foo'), + orderBy(documentId(), 'asc'), + limit(1) + ); + const pipeline1 = query1.pipeline(); + let result = await pipeline1.execute(); + verifyResults(result, { foo: 1 }); + + // Pass the document snapshot from the previous result + query1 = query( + query1, + startAfter(result[0].get('foo'), result[0].ref?.id) + ); + result = await query1.pipeline().execute(); + verifyResults(result, { foo: 2 }); + } ); }); - it('supports internal serialization to proto', async () => { - const pipeline = firestore - .pipeline() - .collection('books') - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') - ); - - const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); - expect(proto).not.to.be.null; + it('supports collection groups', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + {}, + async collRef => { + const collectionGroupId = `${collRef.id}group`; + + const fooDoc = doc( + collRef.firestore, + `${collRef.id}/foo/${collectionGroupId}/doc1` + ); + const barDoc = doc( + collRef.firestore, + `${collRef.id}/bar/baz/boo/${collectionGroupId}/doc2` + ); + await setDoc(fooDoc, { foo: 1 }); + await setDoc(barDoc, { bar: 1 }); + + const query1 = collectionGroup(collRef.firestore, collectionGroupId); + const result = await query1.pipeline().execute(); + + verifyResults(result, { bar: 1 }, { foo: 1 }); + } + ); }); - // TODO(pipeline) support converter - // it('pipeline converter works', async () => { - // interface AppModel {myTitle: string; myAuthor: string; myPublished: number} - // const converter: FirestorePipelineConverter = { - // fromFirestore(result: FirebaseFirestore.PipelineResult): AppModel { - // return { - // myTitle: result.data()!.title as string, - // myAuthor: result.data()!.author as string, - // myPublished: result.data()!.published as number, - // }; - // }, - // }; - // - // const results = await firestore - // .pipeline() - // .collection(randomCol.path) - // .sort(Field.of('published').ascending()) - // .limit(2) - // .withConverter(converter) - // .execute(); - // - // const objs = results.map(r => r.data()); - // expect(objs[0]).to.deep.equal({ - // myAuthor: 'Jane Austen', - // myPublished: 1813, - // myTitle: 'Pride and Prejudice', - // }); - // expect(objs[1]).to.deep.equal({ - // myAuthor: 'Fyodor Dostoevsky', - // myPublished: 1866, - // myTitle: 'Crime and Punishment', - // }); - // }); - }); + it('supports query over collection path with special characters', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + {}, + async collRef => { + const docWithSpecials = doc(collRef, 'so!@#$%^&*()_+special'); + + const collectionWithSpecials = collection( + docWithSpecials, + 'so!@#$%^&*()_+special' + ); + await addDoc(collectionWithSpecials, { foo: 1 }); + await addDoc(collectionWithSpecials, { foo: 2 }); + + const result = await query( + collectionWithSpecials, + orderBy('foo', 'asc') + ) + .pipeline() + .execute(); - describe('modular API', () => { - it('works when creating a pipeline from a Firestore instance', async () => { - const myPipeline = pipeline(firestore) - .collection(randomCol.path) - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()); - - const results = await execute(myPipeline); - - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } + verifyResults(result, { foo: 1 }, { foo: 2 }); + } + ); + }); + + it('supports multiple inequality on same field', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + '01': { id: 1, foo: 1, bar: 1, baz: 1 }, + '02': { id: 2, foo: 1, bar: 1, baz: 2 }, + '03': { id: 3, foo: 1, bar: 1, baz: 2 }, + '04': { id: 4, foo: 1, bar: 2, baz: 1 }, + '05': { id: 5, foo: 1, bar: 2, baz: 2 }, + '06': { id: 6, foo: 1, bar: 2, baz: 2 }, + '07': { id: 7, foo: 2, bar: 1, baz: 1 }, + '08': { id: 8, foo: 2, bar: 1, baz: 2 }, + '09': { id: 9, foo: 2, bar: 1, baz: 2 }, + '10': { id: 10, foo: 2, bar: 2, baz: 1 }, + '11': { id: 11, foo: 2, bar: 2, baz: 2 }, + '12': { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async collRef => { + const query1 = query( + collRef, + and(where('id', '>', 2), where('id', '<=', 10)) + ); + const result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 } + ); + } ); }); - it('works when creating a pipeline from a collection', async () => { - const myPipeline = pipeline(randomCol) - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()); - - const results = await execute(myPipeline); - - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } + it('supports multiple inequality on different fields', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + '01': { id: 1, foo: 1, bar: 1, baz: 1 }, + '02': { id: 2, foo: 1, bar: 1, baz: 2 }, + '03': { id: 3, foo: 1, bar: 1, baz: 2 }, + '04': { id: 4, foo: 1, bar: 2, baz: 1 }, + '05': { id: 5, foo: 1, bar: 2, baz: 2 }, + '06': { id: 6, foo: 1, bar: 2, baz: 2 }, + '07': { id: 7, foo: 2, bar: 1, baz: 1 }, + '08': { id: 8, foo: 2, bar: 1, baz: 2 }, + '09': { id: 9, foo: 2, bar: 1, baz: 2 }, + '10': { id: 10, foo: 2, bar: 2, baz: 1 }, + '11': { id: 11, foo: 2, bar: 2, baz: 2 }, + '12': { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async collRef => { + const query1 = query( + collRef, + and(where('id', '>=', 2), where('baz', '<', 2)) + ); + const result = await query1.pipeline().execute(); + verifyResults( + result, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 10, foo: 2, bar: 2, baz: 1 } + ); + } ); }); }); diff --git a/packages/firestore/test/integration/util/firebase_export.ts b/packages/firestore/test/integration/util/firebase_export.ts index f58b3ce045b..a6739dfe72f 100644 --- a/packages/firestore/test/integration/util/firebase_export.ts +++ b/packages/firestore/test/integration/util/firebase_export.ts @@ -51,4 +51,5 @@ export function newTestFirestore( } export * from '../../../src'; +export * from '../../../pipelines/pipelines'; export { PrivateSettings }; diff --git a/repo-scripts/prune-dts/extract-public-api.ts b/repo-scripts/prune-dts/extract-public-api.ts index c7517399565..4e3c0c3c1fc 100644 --- a/repo-scripts/prune-dts/extract-public-api.ts +++ b/repo-scripts/prune-dts/extract-public-api.ts @@ -141,7 +141,8 @@ export async function generateApi( typescriptDtsPath: string, rollupDtsPath: string, untrimmedRollupDtsPath: string, - publicDtsPath: string + publicDtsPath: string, + otherExportDtsPaths: string[] ): Promise { console.log(`Configuring API Extractor for ${packageName}`); writeTypeScriptConfig(packageRoot); @@ -160,7 +161,7 @@ export async function generateApi( }); console.log('Generated rollup DTS'); - pruneDts(rollupDtsPath, publicDtsPath); + pruneDts(rollupDtsPath, publicDtsPath, otherExportDtsPaths); console.log('Pruned DTS file'); await addBlankLines(publicDtsPath); console.log('Added blank lines after imports'); @@ -221,6 +222,13 @@ const argv = yargs 'The output file for the customer-facing .d.ts file that only ' + 'includes the public APIs', require: true + }, + otherExportsPublicDtsFiles: { + type: 'string', + desc: + 'Optional. A comma-separated list of customer-facing of .d.ts' + + 'files for other exports from this package.', + require: false } }) .parseSync(); @@ -231,5 +239,10 @@ void generateApi( path.resolve(argv.typescriptDts), path.resolve(argv.rollupDts), path.resolve(argv.untrimmedRollupDts), - path.resolve(argv.publicDts) + path.resolve(argv.publicDts), + argv.otherExportsPublicDtsFiles + ? argv.otherExportsPublicDtsFiles + .split(',') + .map(filePath => path.resolve(filePath)) + : [] ); diff --git a/repo-scripts/prune-dts/prune-dts.ts b/repo-scripts/prune-dts/prune-dts.ts index 70cfc2933bb..087d12a3d4b 100644 --- a/repo-scripts/prune-dts/prune-dts.ts +++ b/repo-scripts/prune-dts/prune-dts.ts @@ -18,6 +18,7 @@ import * as yargs from 'yargs'; import * as ts from 'typescript'; import * as fs from 'fs'; +import * as path from 'path'; import { ESLint } from 'eslint'; /** @@ -33,16 +34,32 @@ import { ESLint } from 'eslint'; * @param inputLocation The file path to the .d.ts produced by API explorer. * @param outputLocation The output location for the pruned .d.ts file. */ -export function pruneDts(inputLocation: string, outputLocation: string): void { +export function pruneDts( + inputLocation: string, + outputLocation: string, + otherExportFileLocations: string[] = [] +): void { const compilerOptions = {}; const host = ts.createCompilerHost(compilerOptions); - const program = ts.createProgram([inputLocation], compilerOptions, host); + const program = ts.createProgram( + [inputLocation, ...otherExportFileLocations], + compilerOptions, + host + ); const printer: ts.Printer = ts.createPrinter(); const sourceFile = program.getSourceFile(inputLocation)!; + const otherExportSourceFiles = otherExportFileLocations + .map(otherFileLocation => program.getSourceFile(otherFileLocation)) + .filter(value => value !== undefined) as ts.SourceFile[]; const result: ts.TransformationResult = ts.transform(sourceFile, [ - dropPrivateApiTransformer.bind(null, program, host) + dropPrivateApiTransformer.bind( + null, + program, + host, + otherExportSourceFiles + ) ]); const transformedSourceFile: ts.SourceFile = result.transformed[0]; let content = printer.printFile(transformedSourceFile); @@ -503,14 +520,59 @@ function extractExportedSymbol( return undefined; } +function findExternalExport( + typeChecker: ts.TypeChecker, + sourceFile: ts.SourceFile, + node: + | ts.InterfaceDeclaration + | ts.ClassDeclaration + | ts.TypeAliasDeclaration + | ts.EnumDeclaration, + otherExportSourceFiles: ts.SourceFile[] +): ts.SourceFile | undefined { + if (!node.name) return undefined; + + const localSymbolName = node.name.text; + + for (const otherExportSourceFile of otherExportSourceFiles) { + const otherExportedSymbols = typeChecker.getExportsOfModule( + typeChecker.getSymbolAtLocation(otherExportSourceFile)! + ); + + for (const symbol of otherExportedSymbols) { + // TODO: ideally this would compare definitions to handle the case + // of name collisions with different definitions. However, this + // implementation currently does not handle function exports, + // which is the only place we expect name collisions. + if (symbol.name === localSymbolName) { + return otherExportSourceFile; + } + } + } + + return undefined; +} + function dropPrivateApiTransformer( program: ts.Program, host: ts.CompilerHost, + otherExportSourceFiles: ts.SourceFile[], context: ts.TransformationContext ): ts.Transformer { const typeChecker = program.getTypeChecker(); return (sourceFile: ts.SourceFile) => { + const imports: Record> = {}; + + function ensureImportsForFile(filename: string): Array { + let importsForFile = imports[filename]; + if (!importsForFile) { + importsForFile = []; + imports[filename] = importsForFile; + } + return importsForFile; + } + function visit(node: ts.Node): ts.Node { if ( ts.isInterfaceDeclaration(node) || @@ -531,6 +593,30 @@ function dropPrivateApiTransformer( } } + if ( + ts.isInterfaceDeclaration(node) || + ts.isClassDeclaration(node) || + ts.isTypeAliasDeclaration(node) || + ts.isEnumDeclaration(node) + ) { + // Remove any types that are exported externally + const externalExportFile = findExternalExport( + typeChecker, + sourceFile, + node, + otherExportSourceFiles + ); + if (externalExportFile && node.name) { + ensureImportsForFile( + path.relative( + path.dirname(sourceFile.fileName), + externalExportFile.fileName + ) + ).push(node.name.text); + return ts.factory.createNotEmittedStatement(node); + } + } + if (ts.isConstructorDeclaration(node)) { // Replace internal constructors with private constructors. return maybeHideConstructor(node); @@ -580,7 +666,40 @@ function dropPrivateApiTransformer( context ) as T; } - return visitNodeAndChildren(sourceFile); + const result = visitNodeAndChildren(sourceFile); + + const moreImports: ts.ImportDeclaration[] = []; + for (let filename in imports) { + const importSpecifiers: ts.ImportSpecifier[] = []; + for (let identifier of imports[filename]) { + importSpecifiers.push( + ts.factory.createImportSpecifier( + false, + undefined, + ts.factory.createIdentifier(identifier) + ) + ); + } + let outFileName = filename.startsWith('.') ? filename : `./${filename}`; + outFileName = outFileName.replace('.d.ts', ''); + const importDeclaration = ts.factory.createImportDeclaration( + [], + ts.factory.createImportClause( + true, + undefined, + ts.factory.createNamedImports(importSpecifiers) + ), + ts.factory.createStringLiteral(outFileName, true) + ); + + moreImports.push(importDeclaration); + } + + return ts.factory.updateSourceFile( + result, + [...moreImports, ...result.statements], + true + ); }; } From 99766e0b894a1c64a1eb7c1edf309fd9d01a0bdd Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Mon, 27 Jan 2025 15:49:47 -0500 Subject: [PATCH 086/295] Update dev dependency firebase-tools 13.6.0 -> 13.29.2 --- package.json | 2 +- yarn.lock | 1296 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 847 insertions(+), 451 deletions(-) diff --git a/package.json b/package.json index daec36bcaee..3ce1a544a72 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "eslint-plugin-unused-imports": "3.2.0", "express": "4.21.2", "find-free-port": "2.0.0", - "firebase-tools": "13.6.0", + "firebase-tools": "13.29.2", "glob": "7.2.3", "http-server": "14.1.1", "indexeddbshim": "10.1.0", diff --git a/yarn.lock b/yarn.lock index c5aae630549..23fe358deb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1552,6 +1552,11 @@ enabled "2.0.x" kuler "^2.0.0" +"@electric-sql/pglite@^0.2.0": + version "0.2.16" + resolved "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.2.16.tgz#df586341c8143ea997db0e51aae30c2dc1a634fa" + integrity sha512-dCSHpoOKuTxecaYhWDRp2yFTN3XWcMPMrBVl5yOR8VZEUprz4+R3iuU7BipmlsqBnBDO/6l9H/C2ZwJdunkWyw== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -1599,57 +1604,73 @@ resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@google-cloud/paginator@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-4.0.0.tgz" - integrity sha512-wNmCZl+2G2DmgT/VlF+AROf80SoaC/CwS8trwmjNaq26VRNK8yPbU5F/Vy+R9oDAGKWQU2k8+Op5H4kFJVXFaQ== +"@google-cloud/cloud-sql-connector@^1.3.3": + version "1.6.0" + resolved "https://registry.npmjs.org/@google-cloud/cloud-sql-connector/-/cloud-sql-connector-1.6.0.tgz#3ab3d4a4ce18077cd2cae118cfdf7cffaa7c51d6" + integrity sha512-YkgPaxHbWRjp8YS7OCZAGge4qwX/pwFKT/cxKxV5PYyeS4CbaY6URF2f5Lo6Pabn6bs2AxwjB/SA9UeCdLbj7A== + dependencies: + "@googleapis/sqladmin" "^24.0.0" + gaxios "^6.1.1" + google-auth-library "^9.2.0" + p-throttle "^7.0.0" + +"@google-cloud/paginator@^5.0.0": + version "5.0.2" + resolved "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz#86ad773266ce9f3b82955a8f75e22cd012ccc889" + integrity sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg== dependencies: arrify "^2.0.0" extend "^3.0.2" -"@google-cloud/precise-date@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@google-cloud/precise-date/-/precise-date-3.0.0.tgz" - integrity sha512-bc+R9MgVTo/I6/+zZOAej7EpFlQMhzd6gJwJesEetpnJwW1MsxbkB82CQMrCc516CgZ8ypC020Xs+ylBTm9pRA== - -"@google-cloud/projectify@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-3.0.0.tgz" - integrity sha512-HRkZsNmjScY6Li8/kb70wjGlDDyLkVk3KvoEo9uIoxSjYLJasGiCch9+PqRVDOCGUFvEIqyogl+BeqILL4OJHA== +"@google-cloud/precise-date@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@google-cloud/precise-date/-/precise-date-4.0.0.tgz#e179893a3ad628b17a6fabdfcc9d468753aac11a" + integrity sha512-1TUx3KdaU3cN7nfCdNf+UVqA/PSX29Cjcox3fZZBtINlRrXVTmUkQnCKv2MbBUbCopbK4olAT1IHl76uZyCiVA== -"@google-cloud/promisify@^2.0.0": - version "2.0.4" - resolved "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-2.0.4.tgz" - integrity sha512-j8yRSSqswWi1QqUGKVEKOG03Q7qOoZP6/h2zN2YO+F5h2+DHU0bSrHCK9Y7lo2DI9fBd8qGAw795sf+3Jva4yA== +"@google-cloud/projectify@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz#d600e0433daf51b88c1fa95ac7f02e38e80a07be" + integrity sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA== -"@google-cloud/pubsub@^3.0.1": - version "3.1.0" - resolved "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-3.1.0.tgz" - integrity sha512-SNrLRkZDrIxLwUYZ+PN1XZWzGdQOqCwPkFX2+bVUG5M66VmK+uCfQ5oMBDZ4pm1PZGOYaKMxINtpRNmMsBtejg== - dependencies: - "@google-cloud/paginator" "^4.0.0" - "@google-cloud/precise-date" "^3.0.0" - "@google-cloud/projectify" "^3.0.0" - "@google-cloud/promisify" "^2.0.0" - "@opentelemetry/api" "^1.0.0" - "@opentelemetry/semantic-conventions" "~1.3.0" - "@types/duplexify" "^3.6.0" - "@types/long" "^4.0.0" +"@google-cloud/promisify@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz#a906e533ebdd0f754dca2509933334ce58b8c8b1" + integrity sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g== + +"@google-cloud/pubsub@^4.5.0": + version "4.10.0" + resolved "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-4.10.0.tgz#f1380fccecd87910758c747b0711f722aae06a50" + integrity sha512-HLlIA8qGr6PxAnjK4YjSi2swqEiXjGAC2Tj9GHMNYFtL4uubTIJLHv4CtbJ/Gzem5Cb1HRjuubt/H0oTuRLV0g== + dependencies: + "@google-cloud/paginator" "^5.0.0" + "@google-cloud/precise-date" "^4.0.0" + "@google-cloud/projectify" "^4.0.0" + "@google-cloud/promisify" "^4.0.0" + "@opentelemetry/api" "~1.9.0" + "@opentelemetry/semantic-conventions" "~1.28.0" arrify "^2.0.0" extend "^3.0.2" - google-auth-library "^8.0.2" - google-gax "^3.0.1" + google-auth-library "^9.3.0" + google-gax "^4.3.3" + heap-js "^2.2.0" is-stream-ended "^0.1.4" lodash.snakecase "^4.1.1" p-defer "^3.0.0" -"@grpc/grpc-js@~1.6.0": - version "1.6.7" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.6.7.tgz" - integrity sha512-eBM03pu9hd3VqDQG+kHahiG1x80RGkkqqRb1Pchcwqej/KkAH95gAvKs6laqaHCycYaPK+TKuNQnOz9UXYA8qw== +"@googleapis/sqladmin@^24.0.0": + version "24.0.0" + resolved "https://registry.npmjs.org/@googleapis/sqladmin/-/sqladmin-24.0.0.tgz#5e8ee25d2b99f65108dd7b3642bb392a400ca32c" + integrity sha512-Sj2MerYrr4Z6ksK81Scj0gIdFjC3bC0vcqdM+TSfnOskg6d9iIALWdFDc3xgNHQWO58rUb6HjBzr1XbuNjYlPg== dependencies: - "@grpc/proto-loader" "^0.6.4" - "@types/node" ">=12.12.47" + googleapis-common "^7.0.0" + +"@grpc/grpc-js@^1.10.9": + version "1.12.5" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.12.5.tgz#0064a28fe9b1ec54ac27e1c9bf70720aa01285e8" + integrity sha512-d3iiHxdpg5+ZcJ6jnDSOT8Z0O0VMVGy34jAnYLUX8yd36b1qn8f1TwOA/Lc7TsOh03IkPJ38eGI5qD2EjNkoEA== + dependencies: + "@grpc/proto-loader" "^0.7.13" + "@js-sdsl/ordered-map" "^4.4.2" "@grpc/grpc-js@~1.9.0": version "1.9.1" @@ -1659,16 +1680,15 @@ "@grpc/proto-loader" "^0.7.8" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.6.12", "@grpc/proto-loader@^0.6.4": - version "0.6.13" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.13.tgz" - integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== +"@grpc/proto-loader@^0.7.13": + version "0.7.13" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" + integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== dependencies: - "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^6.11.3" - yargs "^16.2.0" + long "^5.0.0" + protobufjs "^7.2.5" + yargs "^17.7.2" "@grpc/proto-loader@^0.7.8": version "0.7.10" @@ -1732,6 +1752,18 @@ resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" @@ -1890,6 +1922,11 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@js-sdsl/ordered-map@^4.4.2": + version "4.4.2" + resolved "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" + integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" @@ -2828,15 +2865,20 @@ dependencies: "@octokit/openapi-types" "^10.5.0" -"@opentelemetry/api@^1.0.0": - version "1.0.3" - resolved "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz" - integrity sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ== +"@opentelemetry/api@~1.9.0": + version "1.9.0" + resolved "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" + integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== -"@opentelemetry/semantic-conventions@~1.3.0": - version "1.3.1" - resolved "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.3.1.tgz" - integrity sha512-wU5J8rUoo32oSef/rFpOT1HIjLjAv3qIDHkw1QIhODV3OpAVHi5oVzlouozg9obUmZKtbZ0qUe/m7FP0y0yBzA== +"@opentelemetry/semantic-conventions@~1.28.0": + version "1.28.0" + resolved "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz#337fb2bca0453d0726696e745f50064411f646d6" + integrity sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA== + +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== "@pnpm/config.env-replace@^1.1.0": version "1.1.0" @@ -3094,6 +3136,11 @@ resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz" integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw== +"@sindresorhus/is@^4.6.0": + version "4.6.0" + resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.3" resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz" @@ -3262,13 +3309,6 @@ resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz" integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== -"@types/duplexify@^3.6.0": - version "3.6.0" - resolved "https://registry.npmjs.org/@types/duplexify/-/duplexify-3.6.0.tgz" - integrity sha512-5zOA53RUlzN74bvrSGwjudssD9F3a797sDZQkiYpUOxW+WHaXTCPz4/d5Dgi6FKnOqZ2CpaTo0DhgIfsXAOE/A== - dependencies: - "@types/node" "*" - "@types/eslint-scope@^3.7.0": version "3.7.1" resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz" @@ -3426,7 +3466,7 @@ "@types/node" "*" rxjs "^6.5.1" -"@types/long@4.0.2", "@types/long@^4.0.0", "@types/long@^4.0.1": +"@types/long@4.0.2", "@types/long@^4.0.0": version "4.0.2" resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== @@ -3534,7 +3574,7 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/request@2.48.12": +"@types/request@2.48.12", "@types/request@^2.48.8": version "2.48.12" resolved "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz#0f590f615a10f87da18e9790ac94c29ec4c5ef30" integrity sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw== @@ -4231,6 +4271,13 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +ajv-formats@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578" + integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ== + dependencies: + ajv "^8.0.0" + ajv-formats@^2.1.0, ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" @@ -4260,7 +4307,7 @@ ajv@^5.0.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6: +ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -4280,7 +4327,7 @@ ajv@^8.0.0, ajv@^8.3.0: require-from-string "^2.0.2" uri-js "^4.2.2" -ajv@^8.9.0: +ajv@^8.17.1, ajv@^8.9.0: version "8.17.1" resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== @@ -4326,12 +4373,12 @@ ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: dependencies: type-fest "^0.21.3" -ansi-escapes@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz" - integrity sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA== +ansi-escapes@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz#00fc19f491bbb18e1d481b97868204f92109bfe7" + integrity sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw== dependencies: - type-fest "^1.0.2" + environment "^1.0.0" ansi-gray@^0.1.1: version "0.1.1" @@ -4360,6 +4407,11 @@ ansi-regex@^5.0.0, ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1, ansi-regex@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" + integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" @@ -4384,16 +4436,16 @@ ansi-styles@^5.0.0: resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz" integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= -ansicolors@~0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" - integrity sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk= - any-observable@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz" @@ -4482,34 +4534,31 @@ aproba@^1.0.3: resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -archiver-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz" - integrity sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw== +archiver-utils@^5.0.0, archiver-utils@^5.0.2: + version "5.0.2" + resolved "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz#63bc719d951803efc72cf961a56ef810760dd14d" + integrity sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA== dependencies: - glob "^7.1.4" + glob "^10.0.0" graceful-fs "^4.2.0" + is-stream "^2.0.1" lazystream "^1.0.0" - lodash.defaults "^4.2.0" - lodash.difference "^4.5.0" - lodash.flatten "^4.4.0" - lodash.isplainobject "^4.0.6" - lodash.union "^4.6.0" + lodash "^4.17.15" normalize-path "^3.0.0" - readable-stream "^2.0.0" + readable-stream "^4.0.0" -archiver@^5.0.0: - version "5.3.0" - resolved "https://registry.npmjs.org/archiver/-/archiver-5.3.0.tgz" - integrity sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg== +archiver@^7.0.0: + version "7.0.1" + resolved "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz#c9d91c350362040b8927379c7aa69c0655122f61" + integrity sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ== dependencies: - archiver-utils "^2.1.0" - async "^3.2.0" - buffer-crc32 "^0.2.1" - readable-stream "^3.6.0" - readdir-glob "^1.0.0" - tar-stream "^2.2.0" - zip-stream "^4.1.0" + archiver-utils "^5.0.2" + async "^3.2.4" + buffer-crc32 "^1.0.0" + readable-stream "^4.0.0" + readdir-glob "^1.1.2" + tar-stream "^3.0.0" + zip-stream "^6.0.1" archy@^1.0.0: version "1.0.0" @@ -4852,10 +4901,10 @@ async-each@^1.0.1: resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -async-lock@1.3.2: - version "1.3.2" - resolved "https://registry.npmjs.org/async-lock/-/async-lock-1.3.2.tgz" - integrity sha512-phnXdS3RP7PPcmP6NWWzWMU0sLTeyvtZCxBPpZdkYE3seGLKSQZs9FrmVO/qwypq98FUtWWUEYxziLkdGk5nnA== +async-lock@1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/async-lock/-/async-lock-1.4.1.tgz#56b8718915a9b68b10fce2f2a9a3dddf765ef53f" + integrity sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ== async-settle@^1.0.0: version "1.0.0" @@ -4878,11 +4927,16 @@ async@^2.6.4: dependencies: lodash "^4.17.14" -async@^3.1.0, async@^3.2.0: +async@^3.1.0: version "3.2.1" resolved "https://registry.npmjs.org/async/-/async-3.2.1.tgz" integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== +async@^3.2.4: + version "3.2.6" + resolved "https://registry.npmjs.org/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" @@ -4929,6 +4983,11 @@ axios@^1.6.0: form-data "^4.0.0" proxy-from-env "^1.1.0" +b4a@^1.6.4: + version "1.6.7" + resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" + integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz" @@ -5098,6 +5157,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +bare-events@^2.2.0: + version "2.5.4" + resolved "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz#16143d435e1ed9eafd1ab85f12b89b3357a41745" + integrity sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA== + base64-arraybuffer-es6@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-1.0.0.tgz" @@ -5458,7 +5522,12 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -buffer-crc32@^0.2.1, buffer-crc32@^0.2.13, buffer-crc32@~0.2.3: +buffer-crc32@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz#a10993b9055081d55304bd9feb4a072de179f405" + integrity sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w== + +buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= @@ -5724,14 +5793,6 @@ caniuse-lite@^1.0.30001688: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz#39dfedd8f94851132795fdf9b79d29659ad9c4d4" integrity sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw== -cardinal@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz" - integrity sha1-fMEFXYItISlU0HsIXeolHMe8VQU= - dependencies: - ansicolors "~0.3.2" - redeyed "~2.1.0" - caseless@~0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" @@ -5805,10 +5866,15 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4 escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz" - integrity sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w== +chalk@^5.3.0: + version "5.4.1" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" + integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== chardet@^0.7.0: version "0.7.0" @@ -5870,7 +5936,7 @@ chokidar@^2.0.0: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.0.2, chokidar@^3.5.1: +chokidar@^3.5.1: version "3.5.2" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== @@ -5885,6 +5951,21 @@ chokidar@^3.0.2, chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1, chownr@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" @@ -5982,15 +6063,27 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" +cli-highlight@^2.1.11: + version "2.1.11" + resolved "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" + integrity sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg== + dependencies: + chalk "^4.0.0" + highlight.js "^10.7.1" + mz "^2.4.0" + parse5 "^5.1.1" + parse5-htmlparser2-tree-adapter "^6.0.0" + yargs "^16.0.0" + cli-spinners@^2.5.0: version "2.6.0" resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz" integrity sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q== -cli-table3@^0.6.1: - version "0.6.2" - resolved "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz" - integrity sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw== +cli-table3@^0.6.5: + version "0.6.5" + resolved "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz#013b91351762739c16a9567c21a04632e449bf2f" + integrity sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ== dependencies: string-width "^4.2.0" optionalDependencies: @@ -6238,15 +6331,15 @@ commander@^10.0.0: resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^2.12.1, commander@^2.20.0, commander@^2.20.3, commander@^2.7.1: +commander@^2.12.1, commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.7.1: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^4.0.1: - version "4.1.1" - resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== commenting@~1.1.0: version "1.1.0" @@ -6276,15 +6369,16 @@ component-emitter@^1.2.1: resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== -compress-commons@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.1.tgz" - integrity sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ== +compress-commons@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz#26d31251a66b9d6ba23a84064ecd3a6a71d2609e" + integrity sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg== dependencies: - buffer-crc32 "^0.2.13" - crc32-stream "^4.0.2" + crc-32 "^1.2.0" + crc32-stream "^6.0.0" + is-stream "^2.0.1" normalize-path "^3.0.0" - readable-stream "^3.6.0" + readable-stream "^4.0.0" compressible@~2.0.16: version "2.0.18" @@ -6597,13 +6691,13 @@ crc-32@^1.2.0: exit-on-epipe "~1.0.1" printj "~1.1.0" -crc32-stream@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.2.tgz" - integrity sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w== +crc32-stream@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz#8529a3868f8b27abb915f6c3617c0fadedbf9430" + integrity sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g== dependencies: crc-32 "^1.2.0" - readable-stream "^3.4.0" + readable-stream "^4.0.0" create-ecdh@^4.0.0: version "4.0.4" @@ -6641,12 +6735,12 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-env@^5.1.3: - version "5.2.1" - resolved "https://registry.npmjs.org/cross-env/-/cross-env-5.2.1.tgz" - integrity sha512-1yHhtcfAd1r4nwQgknowuUNfIT9E8dOMMspC36g45dN+iD1blloi7xp8X/xAIDnjHWyt1uQ8PHk2fkNaym7soQ== +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== dependencies: - cross-spawn "^6.0.5" + cross-spawn "^7.0.1" cross-spawn@^4.0.2: version "4.0.2" @@ -6656,17 +6750,6 @@ cross-spawn@^4.0.2: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" @@ -6676,7 +6759,7 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -cross-spawn@^7.0.5: +cross-spawn@^7.0.1, cross-spawn@^7.0.5: version "7.0.6" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -7211,6 +7294,11 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + integrity sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ== + dmg@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/dmg/-/dmg-0.1.0.tgz" @@ -7306,6 +7394,11 @@ each-props@^1.3.2: is-plain-object "^2.0.1" object.defaults "^1.1.0" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz" @@ -7382,6 +7475,16 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +emojilib@^2.4.0: + version "2.4.0" + resolved "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz#ac518a8bb0d5f76dda57289ccb2fdf9d39ae721e" + integrity sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw== + emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" @@ -7484,6 +7587,11 @@ envinfo@^7.7.4: resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== +environment@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz#8e86c66b180f363c7ab311787e0259665f45a9f1" + integrity sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q== + err-code@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz" @@ -8013,7 +8121,7 @@ espree@^9.6.0, espree@^9.6.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" -esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: +esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -8160,6 +8268,29 @@ exegesis@^4.1.0: raw-body "^2.3.3" semver "^7.0.0" +exegesis@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/exegesis/-/exegesis-4.2.0.tgz#2d248542b3c58a3c51f33fe9f05be1da1d908b4a" + integrity sha512-MOzRyqhvl+hTA4+W4p0saWRIPlu0grIx4ykjMEYgGLiqr/z9NCIlwSq2jF0gyxNjPZD3xyHgmkW6BSaLVUdctg== + dependencies: + "@apidevtools/json-schema-ref-parser" "^9.0.3" + ajv "^8.3.0" + ajv-formats "^2.1.0" + body-parser "^1.18.3" + content-type "^1.0.4" + deep-freeze "0.0.1" + events-listener "^1.1.0" + glob "^10.3.10" + json-ptr "^3.0.1" + json-schema-traverse "^1.0.0" + lodash "^4.17.11" + openapi3-ts "^3.1.1" + promise-breaker "^6.0.0" + pump "^3.0.0" + qs "^6.6.0" + raw-body "^2.3.3" + semver "^7.0.0" + exit-on-epipe@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz" @@ -8420,6 +8551,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-fifo@^1.2.0, fast-fifo@^1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" + integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== + fast-glob@^3.0.3, fast-glob@^3.1.1: version "3.2.7" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz" @@ -8457,11 +8593,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fast-text-encoding@^1.0.0, fast-text-encoding@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz" - integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== - fast-uri@^3.0.1: version "3.0.6" resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" @@ -8728,46 +8859,51 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" -firebase-tools@13.6.0: - version "13.6.0" - resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-13.6.0.tgz#c71278868f192f5a0a7e0ad3a9227e2810e66bff" - integrity sha512-BXXkFkw8FupINBJHd+aPFRKpvIf8R5P1GyOnWjwsk06kgXXdfFuuYctxkL8e82N4sUomdNP5Q/ru/u2esnoSQA== +firebase-tools@13.29.2: + version "13.29.2" + resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-13.29.2.tgz#30e6a22da541448eb8182eb40e0e39a1e5e4bcdf" + integrity sha512-6P4PR4TcrATPI+ut0qhh7gW3GJ0HYaLC2Fr5lesAXkrdAYw7OvOGDzXaRFuORwkCS5grVQuCcJVSsVbjXKAkew== dependencies: - "@google-cloud/pubsub" "^3.0.1" + "@electric-sql/pglite" "^0.2.0" + "@google-cloud/cloud-sql-connector" "^1.3.3" + "@google-cloud/pubsub" "^4.5.0" abort-controller "^3.0.0" - ajv "^6.12.6" - archiver "^5.0.0" - async-lock "1.3.2" + ajv "^8.17.1" + ajv-formats "3.0.1" + archiver "^7.0.0" + async-lock "1.4.1" body-parser "^1.19.0" - chokidar "^3.0.2" + chokidar "^3.6.0" cjson "^0.3.1" cli-table "0.3.11" colorette "^2.0.19" - commander "^4.0.1" + commander "^5.1.0" configstore "^5.0.1" cors "^2.8.5" - cross-env "^5.1.3" - cross-spawn "^7.0.3" + cross-env "^7.0.3" + cross-spawn "^7.0.5" csv-parse "^5.0.4" deep-equal-in-any-order "^2.0.6" - exegesis "^4.1.0" + exegesis "^4.2.0" exegesis-express "^4.0.0" express "^4.16.4" filesize "^6.1.0" form-data "^4.0.0" fs-extra "^10.1.0" fuzzy "^0.1.3" - glob "^7.1.2" - google-auth-library "^7.11.0" + gaxios "^6.7.0" + glob "^10.4.1" + google-auth-library "^9.11.0" inquirer "^8.2.6" inquirer-autocomplete-prompt "^2.0.1" - js-yaml "^3.13.1" + js-yaml "^3.14.1" jsonwebtoken "^9.0.0" leven "^3.1.0" libsodium-wrappers "^0.7.10" lodash "^4.17.21" - marked "^4.0.14" - marked-terminal "^5.1.1" + lsofi "1.0.0" + marked "^13.0.2" + marked-terminal "^7.0.0" mime "^2.5.2" minimatch "^3.0.4" morgan "^1.10.0" @@ -8775,26 +8911,27 @@ firebase-tools@13.6.0: open "^6.3.0" ora "^5.4.1" p-limit "^3.0.1" + pg "^8.11.3" portfinder "^1.0.32" progress "^2.0.3" proxy-agent "^6.3.0" retry "^0.13.1" - rimraf "^3.0.0" semver "^7.5.2" + sql-formatter "^15.3.0" stream-chain "^2.2.4" stream-json "^1.7.3" - strip-ansi "^6.0.1" - superstatic "^9.0.3" + superstatic "^9.1.0" tar "^6.1.11" tcp-port-used "^1.0.2" - tmp "^0.2.1" + tmp "^0.2.3" triple-beam "^1.3.0" universal-analytics "^0.5.3" update-notifier-cjs "^5.1.6" uuid "^8.3.2" winston "^3.0.0" winston-transport "^4.4.0" - ws "^7.2.3" + ws "^7.5.10" + yaml "^2.4.1" flagged-respawn@^1.0.0: version "1.0.1" @@ -8874,6 +9011,14 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" @@ -9118,41 +9263,23 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -gaxios@^4.0.0: - version "4.3.2" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-4.3.2.tgz" - integrity sha512-T+ap6GM6UZ0c4E6yb1y/hy2UB6hTrqhglp3XfmU9qbLCGRYhLVV5aRPpC4EmoG8N8zOnkYCgoBz+ScvGAARY6Q== +gaxios@^6.0.0, gaxios@^6.0.3, gaxios@^6.1.1, gaxios@^6.7.0: + version "6.7.1" + resolved "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz#ebd9f7093ede3ba502685e73390248bb5b7f71fb" + integrity sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ== dependencies: - abort-controller "^3.0.0" extend "^3.0.2" - https-proxy-agent "^5.0.0" + https-proxy-agent "^7.0.1" is-stream "^2.0.0" - node-fetch "^2.6.1" + node-fetch "^2.6.9" + uuid "^9.0.1" -gaxios@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz" - integrity sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw== - dependencies: - extend "^3.0.2" - https-proxy-agent "^5.0.0" - is-stream "^2.0.0" - node-fetch "^2.6.7" - -gcp-metadata@^4.2.0: - version "4.3.1" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz" - integrity sha512-x850LS5N7V1F3UcV7PoupzGsyD6iVwTVvsh3tbXfkctZnBnjW5yu5z1/3k3SehF7TyoTIe78rJs02GMMy+LF+A== - dependencies: - gaxios "^4.0.0" - json-bigint "^1.0.0" - -gcp-metadata@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz" - integrity sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA== +gcp-metadata@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz#9b0dd2b2445258e7597f2024332d20611cbd6b8c" + integrity sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg== dependencies: - gaxios "^5.0.0" + gaxios "^6.0.0" json-bigint "^1.0.0" geckodriver@2.0.4: @@ -9250,6 +9377,11 @@ get-proto@^1.0.0, get-proto@^1.0.1: dunder-proto "^1.0.1" es-object-atoms "^1.0.0" +get-stdin@=8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" + integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== + get-stream@^5.1.0: version "5.2.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" @@ -9433,7 +9565,7 @@ glob-watcher@^5.0.3: normalize-path "^3.0.0" object.defaults "^1.1.0" -glob@7.2.0, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: +glob@7.2.0, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: version "7.2.0" resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -9457,6 +9589,18 @@ glob@7.2.3, glob@~7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^10.0.0, glob@^10.3.10, glob@^10.4.1: + version "10.4.5" + resolved "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^8.0.1: version "8.1.0" resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz" @@ -9584,68 +9728,47 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -google-auth-library@^7.11.0: - version "7.14.1" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.14.1.tgz" - integrity sha512-5Rk7iLNDFhFeBYc3s8l1CqzbEBcdhwR193RlD4vSNFajIcINKI8W8P0JLmBpwymHqqWbX34pJDQu39cSy/6RsA== +google-auth-library@^9.11.0, google-auth-library@^9.2.0, google-auth-library@^9.3.0, google-auth-library@^9.7.0: + version "9.15.1" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz#0c5d84ed1890b2375f1cd74f03ac7b806b392928" + integrity sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng== dependencies: - arrify "^2.0.0" base64-js "^1.3.0" ecdsa-sig-formatter "^1.0.11" - fast-text-encoding "^1.0.0" - gaxios "^4.0.0" - gcp-metadata "^4.2.0" - gtoken "^5.0.4" + gaxios "^6.1.1" + gcp-metadata "^6.1.0" + gtoken "^7.0.0" jws "^4.0.0" - lru-cache "^6.0.0" - -google-auth-library@^8.0.2: - version "8.1.1" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.1.1.tgz" - integrity sha512-eG3pCfrLgVJe19KhAeZwW0m1LplNEo0FX1GboWf3hu18zD2jq8TUH2K8900AB2YRAuJ7A+1aSXDp1BODjwwRzg== - dependencies: - arrify "^2.0.0" - base64-js "^1.3.0" - ecdsa-sig-formatter "^1.0.11" - fast-text-encoding "^1.0.0" - gaxios "^5.0.0" - gcp-metadata "^5.0.0" - gtoken "^6.0.0" - jws "^4.0.0" - lru-cache "^6.0.0" -google-gax@^3.0.1: - version "3.1.3" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-3.1.3.tgz" - integrity sha512-hWF2WbfD3o1Fnfq3qf0Wnr3DuQczC/5ebGYGB5swUZXl8sT5y5mhDbxOKAg+xUzhiPgnQADNyFk0uIsA+NKRIw== +google-gax@^4.3.3: + version "4.4.1" + resolved "https://registry.npmjs.org/google-gax/-/google-gax-4.4.1.tgz#95a9cf7ee7777ac22d1926a45b5f886dd8beecae" + integrity sha512-Phyp9fMfA00J3sZbJxbbB4jC55b7DBjE3F6poyL3wKMEBVKA79q6BGuHcTiM28yOzVql0NDbRL8MLLh8Iwk9Dg== dependencies: - "@grpc/grpc-js" "~1.6.0" - "@grpc/proto-loader" "^0.6.12" + "@grpc/grpc-js" "^1.10.9" + "@grpc/proto-loader" "^0.7.13" "@types/long" "^4.0.0" abort-controller "^3.0.0" duplexify "^4.0.0" - fast-text-encoding "^1.0.3" - google-auth-library "^8.0.2" - is-stream-ended "^0.1.4" - node-fetch "^2.6.1" + google-auth-library "^9.3.0" + node-fetch "^2.7.0" object-hash "^3.0.0" - proto3-json-serializer "^1.0.0" - protobufjs "6.11.3" - retry-request "^5.0.0" - -google-p12-pem@^3.0.3: - version "3.1.2" - resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.2.tgz" - integrity sha512-tjf3IQIt7tWCDsa0ofDQ1qqSCNzahXDxdAGJDbruWqu3eCg5CKLYKN+hi0s6lfvzYZ1GDVr+oDF9OOWlDSdf0A== - dependencies: - node-forge "^0.10.0" + proto3-json-serializer "^2.0.2" + protobufjs "^7.3.2" + retry-request "^7.0.0" + uuid "^9.0.1" -google-p12-pem@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz" - integrity sha512-lRTMn5ElBdDixv4a86bixejPSRk1boRtUowNepeKEVvYiFlkLuAJUVpEz6PfObDHYEKnZWq/9a2zC98xu62A9w== +googleapis-common@^7.0.0: + version "7.2.0" + resolved "https://registry.npmjs.org/googleapis-common/-/googleapis-common-7.2.0.tgz#5c19102c9af1e5d27560be5e69ee2ccf68755d42" + integrity sha512-/fhDZEJZvOV3X5jmD+fKxMqma5q2Q9nZNSF3kn1F18tpxmA86BcTxAGBQdM0N89Z3bEaIs+HVznSmFJEAmMTjA== dependencies: - node-forge "^1.3.1" + extend "^3.0.2" + gaxios "^6.0.3" + google-auth-library "^9.7.0" + qs "^6.7.0" + url-template "^2.0.8" + uuid "^9.0.0" gopd@^1.0.1: version "1.0.1" @@ -9706,22 +9829,12 @@ growl@1.10.5: resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -gtoken@^5.0.4: - version "5.3.1" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.3.1.tgz" - integrity sha512-yqOREjzLHcbzz1UrQoxhBtpk8KjrVhuqPE7od1K2uhyxG2BHjKZetlbLw/SPZak/QqTIQW+addS+EcjqQsZbwQ== - dependencies: - gaxios "^4.0.0" - google-p12-pem "^3.0.3" - jws "^4.0.0" - -gtoken@^6.0.0: - version "6.1.0" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-6.1.0.tgz" - integrity sha512-WPZcFw34wh2LUvbCUWI70GDhOlO7qHpSvFHFqq7d3Wvsf8dIJedE0lnUdOmsKuC0NgflKmF0LxIF38vsGeHHiQ== +gtoken@^7.0.0: + version "7.1.0" + resolved "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz#d61b4ebd10132222817f7222b1e6064bd463fc26" + integrity sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw== dependencies: - gaxios "^4.0.0" - google-p12-pem "^4.0.0" + gaxios "^6.0.0" jws "^4.0.0" gulp-cli@^2.2.0: @@ -10022,6 +10135,16 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +heap-js@^2.2.0: + version "2.6.0" + resolved "https://registry.npmjs.org/heap-js/-/heap-js-2.6.0.tgz#72a2fc9efdb8b7b103c351b6e936d18325104a15" + integrity sha512-trFMIq3PATiFRiQmNNeHtsrkwYRByIXUbYNbotiY9RLVfMkdwZdd2eQ38mGt7BRiCKBaj1DyBAIHmm7mmXPuuw== + +highlight.js@^10.7.1: + version "10.7.3" + resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" + integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== + highlight.js@^9.17.1: version "9.18.5" resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz" @@ -10210,7 +10333,7 @@ https-proxy-agent@^5.0.1: agent-base "6" debug "4" -https-proxy-agent@^7.0.6: +https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.6: version "7.0.6" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== @@ -10922,6 +11045,13 @@ is-number-object@^1.1.1: call-bound "^1.0.3" has-tostringtag "^1.0.2" +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg== + dependencies: + kind-of "^3.0.2" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" @@ -11007,6 +11137,11 @@ is-plain-object@^5.0.0: resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-promise@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" + integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== + is-promise@^2.1.0, is-promise@^2.2.2: version "2.2.2" resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz" @@ -11087,7 +11222,7 @@ is-stream@^1.1.0: resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-stream@^2.0.0: +is-stream@^2.0.0, is-stream@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== @@ -11415,6 +11550,15 @@ istextorbinary@^3.0.0: binaryextensions "^2.2.0" textextensions "^3.2.0" +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jasmine-core@~2.8.0: version "2.8.0" resolved "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz" @@ -11644,7 +11788,7 @@ js-yaml@4.1.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.1, js-yaml@^3.6.1: +js-yaml@^3.13.1, js-yaml@^3.14.1, js-yaml@^3.6.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -12348,21 +12492,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.defaults@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz" - integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= - -lodash.difference@^4.5.0: - version "4.5.0" - resolved "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz" - integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw= - -lodash.flatten@^4.4.0: - version "4.4.0" - resolved "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz" - integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= - lodash.flattendeep@^4.4.0: version "4.4.0" resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz" @@ -12390,11 +12519,6 @@ lodash.isobject@^2.4.1: dependencies: lodash._objecttypes "~2.4.1" -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz" - integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= - lodash.mapvalues@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" @@ -12435,11 +12559,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.union@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz" - integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= - lodash@4.17.21, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0, lodash@~4.17.15, lodash@~4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" @@ -12508,11 +12627,6 @@ long@3.2.0: resolved "https://registry.npmjs.org/long/-/long-3.2.0.tgz" integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -long@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - long@^5.0.0: version "5.2.3" resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz" @@ -12537,6 +12651,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" @@ -12571,6 +12690,14 @@ lru-queue@^0.1.0: dependencies: es5-ext "~0.10.2" +lsofi@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/lsofi/-/lsofi-1.0.0.tgz#ed65a9d1d811b835b8c51b61762cefa64eb96a8d" + integrity sha512-MKr9vM1MSm+TSKfI05IYxpKV1NCxpJaBLnELyIf784zYJ5KV9lGCE1EvpA2DtXDNM3fCuFeCwXUzim/fyQRi+A== + dependencies: + is-number "^2.1.0" + through2 "^2.0.1" + lunr@^2.3.8: version "2.3.9" resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz" @@ -12718,27 +12845,28 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -marked-terminal@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.1.1.tgz" - integrity sha512-+cKTOx9P4l7HwINYhzbrBSyzgxO2HaHKGZGuB1orZsMIgXYaJyfidT81VXRdpelW/PcHEWxywscePVgI/oUF6g== +marked-terminal@^7.0.0: + version "7.2.1" + resolved "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.2.1.tgz#9c1ae073a245a03c6a13e3eeac6f586f29856068" + integrity sha512-rQ1MoMFXZICWNsKMiiHwP/Z+92PLKskTPXj+e7uwXmuMPkNn7iTqC+IvDekVm1MPeC9wYQeLxeFaOvudRR/XbQ== dependencies: - ansi-escapes "^5.0.0" - cardinal "^2.1.1" - chalk "^5.0.0" - cli-table3 "^0.6.1" - node-emoji "^1.11.0" - supports-hyperlinks "^2.2.0" + ansi-escapes "^7.0.0" + ansi-regex "^6.1.0" + chalk "^5.3.0" + cli-highlight "^2.1.11" + cli-table3 "^0.6.5" + node-emoji "^2.1.3" + supports-hyperlinks "^3.1.0" marked@^0.8.0: version "0.8.2" resolved "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz" integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw== -marked@^4.0.14: - version "4.0.18" - resolved "https://registry.npmjs.org/marked/-/marked-4.0.18.tgz" - integrity sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw== +marked@^13.0.2: + version "13.0.3" + resolved "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz#5c5b4a5d0198060c7c9bc6ef9420a7fed30f822d" + integrity sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA== matchdep@^2.0.0: version "2.0.0" @@ -12995,7 +13123,7 @@ minimatch@^3.0.3, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: +minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.6" resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== @@ -13120,6 +13248,11 @@ minipass@^3.1.6: dependencies: yallist "^4.0.0" +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + minizlib@^1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" @@ -13229,6 +13362,11 @@ moment@~2.29.3: resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== +moo@^0.5.0: + version "0.5.2" + resolved "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz#f9fe82473bc7c184b0d32e2215d3f6e67278733c" + integrity sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q== + morgan@^1.10.0, morgan@^1.8.2: version "1.10.0" resolved "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz" @@ -13286,9 +13424,9 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -mz@2.7.0: +mz@2.7.0, mz@^2.4.0: version "2.7.0" - resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" + resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" @@ -13342,6 +13480,16 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= +nearley@^2.20.1: + version "2.20.1" + resolved "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz#246cd33eff0d012faf197ff6774d7ac78acdd474" + integrity sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ== + dependencies: + commander "^2.19.0" + moo "^0.5.0" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + negotiator@0.6.2, negotiator@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz" @@ -13367,11 +13515,6 @@ next-tick@1, next-tick@^1.1.0: resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - nise@^4.0.4: version "4.1.0" resolved "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz" @@ -13400,12 +13543,15 @@ node-addon-api@^7.0.0: resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== -node-emoji@^1.11.0: - version "1.11.0" - resolved "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz" - integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A== +node-emoji@^2.1.3: + version "2.2.0" + resolved "https://registry.npmjs.org/node-emoji/-/node-emoji-2.2.0.tgz#1d000e3c76e462577895be1b436f4aa2d6760eb0" + integrity sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw== dependencies: - lodash "^4.17.21" + "@sindresorhus/is" "^4.6.0" + char-regex "^1.0.2" + emojilib "^2.4.0" + skin-tone "^2.0.0" node-fetch@^2.5.0, node-fetch@^2.6.1: version "2.6.5" @@ -13421,15 +13567,12 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-forge@^0.10.0: - version "0.10.0" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz" - integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== - -node-forge@^1.3.1: - version "1.3.1" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz" - integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== +node-fetch@^2.6.9, node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" node-gyp@8.x: version "8.4.1" @@ -14049,6 +14192,13 @@ openapi3-ts@^2.0.1: dependencies: yaml "^1.10.0" +openapi3-ts@^3.1.1: + version "3.2.0" + resolved "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-3.2.0.tgz#7e30d33c480e938e67e809ab16f419bc9beae3f8" + integrity sha512-/ykNWRV5Qs0Nwq7Pc0nJ78fgILvOT/60OxEmB3v7yQ8a8Bwcm43D4diaYazG/KBn6czA+52XYy931WFLMCUeSg== + dependencies: + yaml "^2.2.1" + opener@^1.5.1: version "1.5.2" resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz" @@ -14253,6 +14403,11 @@ p-reduce@^2.0.0, p-reduce@^2.1.0: resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== +p-throttle@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/p-throttle/-/p-throttle-7.0.0.tgz#d2650e884dad46fd626a9a5cfc3fb239cb799dee" + integrity sha512-aio0v+S0QVkH1O+9x4dHtD4dgCExACcL+3EtNaGqC01GBudS9ijMuUsmN8OVScyV4OOp0jqdLShZFuSlbL/AsA== + p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz" @@ -14309,6 +14464,11 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" +package-json-from-dist@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + package-manager-detector@^0.2.0: version "0.2.8" resolved "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.8.tgz#f5ace2dbd37666af54e5acec11bc37c8450f72d0" @@ -14443,6 +14603,23 @@ parse-url@^6.0.0: parse-path "^4.0.0" protocols "^1.4.0" +parse5-htmlparser2-tree-adapter@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== + dependencies: + parse5 "^6.0.1" + +parse5@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== + +parse5@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" @@ -14517,11 +14694,6 @@ path-is-network-drive@^1.0.20: dependencies: tslib "^2" -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" @@ -14544,6 +14716,14 @@ path-root@^0.1.1: dependencies: path-root-regex "^0.1.0" +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-strip-sep@^1.0.17: version "1.0.17" resolved "https://registry.npmjs.org/path-strip-sep/-/path-strip-sep-1.0.17.tgz" @@ -14568,6 +14748,11 @@ path-to-regexp@^1.7.0, path-to-regexp@^1.8.0: dependencies: isarray "0.0.1" +path-to-regexp@^8.0.0: + version "8.2.0" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz#73990cc29e57a3ff2a0d914095156df5db79e8b4" + integrity sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ== + path-type@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" @@ -14615,6 +14800,62 @@ performance-now@^2.1.0: resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +pg-cloudflare@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz#e6d5833015b170e23ae819e8c5d7eaedb472ca98" + integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q== + +pg-connection-string@^2.7.0: + version "2.7.0" + resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz#f1d3489e427c62ece022dba98d5262efcb168b37" + integrity sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA== + +pg-int8@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== + +pg-pool@^3.7.0: + version "3.7.0" + resolved "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz#d4d3c7ad640f8c6a2245adc369bafde4ebb8cbec" + integrity sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g== + +pg-protocol@^1.7.0: + version "1.7.0" + resolved "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz#ec037c87c20515372692edac8b63cf4405448a93" + integrity sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ== + +pg-types@^2.1.0: + version "2.2.0" + resolved "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg@^8.11.3: + version "8.13.1" + resolved "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz#6498d8b0a87ff76c2df7a32160309d3168c0c080" + integrity sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ== + dependencies: + pg-connection-string "^2.7.0" + pg-pool "^3.7.0" + pg-protocol "^1.7.0" + pg-types "^2.1.0" + pgpass "1.x" + optionalDependencies: + pg-cloudflare "^1.1.1" + +pgpass@1.x: + version "1.0.5" + resolved "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz#9b873e4a564bb10fa7a7dbd55312728d422a223d" + integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== + dependencies: + split2 "^4.1.0" + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" @@ -14771,6 +15012,28 @@ postcss@^7.0.16: source-map "^0.6.1" supports-color "^6.1.0" +postgres-array@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== + +postgres-date@~1.0.4: + version "1.0.7" + resolved "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" + integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== + dependencies: + xtend "^4.0.0" + postinstall-postinstall@2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz" @@ -14861,6 +15124,11 @@ promise-breaker@^5.0.0: resolved "https://registry.npmjs.org/promise-breaker/-/promise-breaker-5.0.0.tgz" integrity sha512-mgsWQuG4kJ1dtO6e/QlNDLFtMkMzzecsC69aI5hlLEjGHFNpHrvGhFi4LiK5jg2SMQj74/diH+wZliL9LpGsyA== +promise-breaker@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/promise-breaker/-/promise-breaker-6.0.0.tgz#107d2b70f161236abdb4ac5a736c7eb8df489d0f" + integrity sha512-BthzO9yTPswGf7etOBiHCVuugs2N01/Q/94dIPls48z2zCmrnDptUUZzfIb+41xq0MnYZ/BzmOd6ikDR4ibNZA== + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz" @@ -14891,31 +15159,12 @@ proto-list@~1.2.1: resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= -proto3-json-serializer@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.0.2.tgz" - integrity sha512-wHxf8jYZ/LUP3M7XmULDKnbxBn+Bvk6SM+tDCPVTp9vraIzUi9hHsOBb1n2Y0VV0ukx4zBN/2vzMQYs4KWwRpg== +proto3-json-serializer@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz#5b705203b4d58f3880596c95fad64902617529dd" + integrity sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ== dependencies: - protobufjs "^6.11.3" - -protobufjs@6.11.3: - version "6.11.3" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" - integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" ">=13.7.0" - long "^4.0.0" + protobufjs "^7.2.5" protobufjs@7.2.6, protobufjs@^7.2.4: version "7.2.6" @@ -14935,10 +15184,10 @@ protobufjs@7.2.6, protobufjs@^7.2.4: "@types/node" ">=13.7.0" long "^5.0.0" -protobufjs@^6.11.3: - version "6.11.4" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" - integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== +protobufjs@^7.2.5, protobufjs@^7.3.2: + version "7.4.0" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" + integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -14950,9 +15199,8 @@ protobufjs@^6.11.3: "@protobufjs/path" "^1.1.2" "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" "@types/node" ">=13.7.0" - long "^4.0.0" + long "^5.0.0" protocols@^1.1.0, protocols@^1.4.0: version "1.4.8" @@ -15122,6 +15370,13 @@ qs@^6.4.0, qs@^6.6.0, qs@^6.9.4: dependencies: side-channel "^1.0.4" +qs@^6.7.0: + version "6.14.0" + resolved "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" + integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== + dependencies: + side-channel "^1.1.0" + qs@~6.5.2: version "6.5.2" resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz" @@ -15152,6 +15407,11 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +queue-tick@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz#f6f07ac82c1fd60f82e098b417a80e52f1f4c142" + integrity sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag== + quick-lru@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" @@ -15162,6 +15422,19 @@ quick-lru@^5.1.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + integrity sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A== + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" @@ -15403,12 +15676,12 @@ readable-stream@^4.0.0: events "^3.3.0" process "^0.11.10" -readdir-glob@^1.0.0: - version "1.1.1" - resolved "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.1.tgz" - integrity sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA== +readdir-glob@^1.1.2: + version "1.1.3" + resolved "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz#c3d831f51f5e7bfa62fa2ffbe4b508c640f09584" + integrity sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA== dependencies: - minimatch "^3.0.4" + minimatch "^5.1.0" readdir-scoped-modules@^1.0.0: version "1.1.0" @@ -15451,13 +15724,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -redeyed@~2.1.0: - version "2.1.1" - resolved "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz" - integrity sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs= - dependencies: - esprima "~4.0.0" - reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: version "1.0.10" resolved "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" @@ -15832,13 +16098,14 @@ ret@~0.1.10: resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retry-request@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/retry-request/-/retry-request-5.0.1.tgz" - integrity sha512-lxFKrlBt0OZzCWh/V0uPEN0vlr3OhdeXnpeY5OES+ckslm791Cb1D5P7lJUSnY7J5hiCjcyaUGmzCnIGDCUBig== +retry-request@^7.0.0: + version "7.0.2" + resolved "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz#60bf48cfb424ec01b03fca6665dee91d06dd95f3" + integrity sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w== dependencies: - debug "^4.1.1" + "@types/request" "^2.48.8" extend "^3.0.2" + teeny-request "^9.0.0" retry@^0.12.0: version "0.12.0" @@ -15976,16 +16243,16 @@ rollup@2.79.1: optionalDependencies: fsevents "~2.3.2" -router@^1.3.1: - version "1.3.5" - resolved "https://registry.npmjs.org/router/-/router-1.3.5.tgz" - integrity sha512-kozCJZUhuSJ5VcLhSb3F8fsmGXy+8HaDbKCAerR1G6tq3mnMZFMuSohbFvGv1c5oMFipijDjRZuuN/Sq5nMf3g== +router@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/router/-/router-2.0.0.tgz#8692720b95de83876870d7bc638dd3c7e1ae8a27" + integrity sha512-dIM5zVoG8xhC6rnSN8uoAgFARwTE7BQs8YwHEvK0VCmfxQXMaOuA1uiR1IPwsW7JyK5iTt7Od/TC9StasS2NPQ== dependencies: array-flatten "3.0.0" - debug "2.6.9" + is-promise "4.0.0" methods "~1.1.2" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "^8.0.0" setprototypeof "1.2.0" utils-merge "1.0.1" @@ -16235,7 +16502,7 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -16446,13 +16713,6 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -16460,11 +16720,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" @@ -16595,6 +16850,13 @@ sinon@9.2.4: nise "^4.0.4" supports-color "^7.1.0" +skin-tone@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz#4e3933ab45c0d4f4f781745d64b9f4c208e41237" + integrity sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA== + dependencies: + unicode-emoji-modifier-base "^1.0.0" + slash@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz" @@ -16946,6 +17208,11 @@ split2@^3.0.0: dependencies: readable-stream "^3.0.0" +split2@^4.1.0: + version "4.2.0" + resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== + split@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" @@ -16963,6 +17230,15 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= +sql-formatter@^15.3.0: + version "15.4.10" + resolved "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.4.10.tgz#f7f4745aa1b9fc3c8ce493bf882610ca6200dedf" + integrity sha512-zQfiuxU1F/C7TNu+880BdL+fuvJTd1Kj8R0wv48dfZ27NR3z1PWvQFkH8ai/HrIy+NyvXCaZBkJHp/EeZFXSOA== + dependencies: + argparse "^2.0.1" + get-stdin "=8.0.0" + nearley "^2.20.1" + sqlite3@5.1.7: version "5.1.7" resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz#59ca1053c1ab38647396586edad019b1551041b7" @@ -17058,6 +17334,13 @@ stream-chain@^2.2.4, stream-chain@^2.2.5: resolved "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz" integrity sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA== +stream-events@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5" + integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg== + dependencies: + stubs "^3.0.0" + stream-exhaust@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz" @@ -17101,6 +17384,17 @@ streamroller@^3.0.4: debug "^4.3.3" fs-extra "^10.0.1" +streamx@^2.15.0: + version "2.21.1" + resolved "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz#f02979d8395b6b637d08a589fb514498bed55845" + integrity sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw== + dependencies: + fast-fifo "^1.3.2" + queue-tick "^1.0.1" + text-decoder "^1.1.0" + optionalDependencies: + bare-events "^2.2.0" + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz" @@ -17111,6 +17405,15 @@ string-argv@~0.3.1: resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" @@ -17146,6 +17449,15 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.trim@^1.2.10: version "1.2.10" resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz#40b2dd5ee94c959b4dcfb1d65ce72e90da480c81" @@ -17227,6 +17539,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" @@ -17255,6 +17574,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" @@ -17308,10 +17634,15 @@ strong-log-transformer@^2.1.0: minimist "^1.2.0" through "^2.3.4" -superstatic@^9.0.3: - version "9.0.3" - resolved "https://registry.npmjs.org/superstatic/-/superstatic-9.0.3.tgz" - integrity sha512-e/tmW0bsnQ/33ivK6y3CapJT0Ovy4pk/ohNPGhIAGU2oasoNLRQ1cv6enua09NU9w6Y0H/fBu07cjzuiWvLXxw== +stubs@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" + integrity sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw== + +superstatic@^9.1.0: + version "9.1.0" + resolved "https://registry.npmjs.org/superstatic/-/superstatic-9.1.0.tgz#ef046c3bd4e8756e004168428a0c72f420491aba" + integrity sha512-1PcxGREb5My6iX/DL9x+3+XFY5lM2nOiPBQV45RwbpM5bHGsStz+Lduts7y8W+xo68pHa7F8atTF52+dwfwxcw== dependencies: basic-auth-connect "^1.0.0" commander "^10.0.0" @@ -17329,7 +17660,7 @@ superstatic@^9.0.3: on-finished "^2.2.0" on-headers "^1.0.0" path-to-regexp "^1.8.0" - router "^1.3.1" + router "^2.0.0" update-notifier-cjs "^5.1.6" optionalDependencies: re2 "^1.17.7" @@ -17367,10 +17698,10 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== +supports-hyperlinks@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.1.0.tgz#b56150ff0173baacc15f21956450b61f2b18d3ac" + integrity sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -17412,7 +17743,7 @@ tar-fs@^2.0.0: pump "^3.0.0" tar-stream "^2.1.4" -tar-stream@^2.1.4, tar-stream@^2.2.0: +tar-stream@^2.1.4: version "2.2.0" resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== @@ -17423,6 +17754,15 @@ tar-stream@^2.1.4, tar-stream@^2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" +tar-stream@^3.0.0: + version "3.1.7" + resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" + integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== + dependencies: + b4a "^1.6.4" + fast-fifo "^1.2.0" + streamx "^2.15.0" + tar@6.1.9: version "6.1.9" resolved "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz" @@ -17468,6 +17808,17 @@ tcp-port-used@^1.0.2: debug "4.3.1" is2 "^2.0.6" +teeny-request@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz#18140de2eb6595771b1b02203312dfad79a4716d" + integrity sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g== + dependencies: + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + node-fetch "^2.6.9" + stream-events "^1.0.5" + uuid "^9.0.0" + temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz" @@ -17550,6 +17901,13 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-decoder@^1.1.0: + version "1.2.3" + resolved "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz#b19da364d981b2326d5f43099c310cc80d770c65" + integrity sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA== + dependencies: + b4a "^1.6.4" + text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" @@ -17592,9 +17950,9 @@ through2-filter@^3.0.0: through2 "~2.0.0" xtend "~4.0.0" -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: +through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0: version "2.0.5" - resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: readable-stream "~2.3.6" @@ -17671,6 +18029,11 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmp@^0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== + tmpl@1.0.x: version "1.0.5" resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" @@ -17972,11 +18335,6 @@ type-fest@^0.8.0, type-fest@^0.8.1: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^1.0.2: - version "1.4.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz" - integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== - type-fest@^2.14.0: version "2.19.0" resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz" @@ -18253,6 +18611,11 @@ unicode-canonical-property-names-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== +unicode-emoji-modifier-base@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz#dbbd5b54ba30f287e2a8d5a249da6c0cef369459" + integrity sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g== + unicode-match-property-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" @@ -18452,6 +18815,11 @@ url-join@^4.0.1: resolved "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz" integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + integrity sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw== + url@^0.11.0: version "0.11.0" resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz" @@ -18520,6 +18888,11 @@ uuid@^8.0.0, uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uuid@^9.0.0, uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" @@ -19065,6 +19438,15 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" @@ -19099,6 +19481,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" @@ -19175,10 +19566,10 @@ ws@>=8.11.0: resolved "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz" integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig== -ws@^7.2.3: - version "7.5.5" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== +ws@^7.5.10: + version "7.5.10" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@~8.17.1: version "8.17.1" @@ -19203,7 +19594,7 @@ xmlbuilder@~11.0.0: resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== @@ -19243,6 +19634,11 @@ yaml@^1.10.0: resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.2.1, yaml@^2.4.1: + version "2.7.0" + resolved "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" + integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== + yaml@^2.2.2: version "2.3.1" resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz" @@ -19289,9 +19685,9 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0, yargs@^16.1.1, yargs@^16.2.0: +yargs@16.2.0, yargs@^16.0.0, yargs@^16.1.1, yargs@^16.2.0: version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -19404,11 +19800,11 @@ z-schema@~5.0.2: optionalDependencies: commander "^2.20.3" -zip-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.0.tgz" - integrity sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A== +zip-stream@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz#e141b930ed60ccaf5d7fa9c8260e0d1748a2bbfb" + integrity sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA== dependencies: - archiver-utils "^2.1.0" - compress-commons "^4.1.0" - readable-stream "^3.6.0" + archiver-utils "^5.0.0" + compress-commons "^6.0.2" + readable-stream "^4.0.0" From dafae52afda0b653a763b071960ee87010a63aa1 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 27 Jan 2025 17:40:14 -0600 Subject: [PATCH 087/295] Discard earliest heartbeat once there are 30 heartbeats (#8724) * Delete earliest heartbeats only once there are 30 heartbeats * Add changeset * Use max heartbeat const in tests * Fix test name in all caps * Fix test names * Formatting --- .changeset/yellow-rice-kneel.md | 5 ++ packages/app/src/heartbeatService.test.ts | 66 ++++++++++++++++++++--- packages/app/src/heartbeatService.ts | 46 ++++++++++++---- 3 files changed, 101 insertions(+), 16 deletions(-) create mode 100644 .changeset/yellow-rice-kneel.md diff --git a/.changeset/yellow-rice-kneel.md b/.changeset/yellow-rice-kneel.md new file mode 100644 index 00000000000..66bf4c41307 --- /dev/null +++ b/.changeset/yellow-rice-kneel.md @@ -0,0 +1,5 @@ +--- +'@firebase/app': patch +--- + +Discard the earliest heartbeat once a limit of 30 heartbeats in storage has been hit. diff --git a/packages/app/src/heartbeatService.test.ts b/packages/app/src/heartbeatService.test.ts index 95ac71ca42d..57f97ec7468 100644 --- a/packages/app/src/heartbeatService.test.ts +++ b/packages/app/src/heartbeatService.test.ts @@ -20,14 +20,16 @@ import '../test/setup'; import { countBytes, HeartbeatServiceImpl, - extractHeartbeatsForHeader + extractHeartbeatsForHeader, + getEarliestHeartbeatIdx, + MAX_NUM_STORED_HEARTBEATS } from './heartbeatService'; import { Component, ComponentType, ComponentContainer } from '@firebase/component'; -import { PlatformLoggerService } from './types'; +import { PlatformLoggerService, SingleDateHeartbeat } from './types'; import { FirebaseApp } from './public-types'; import * as firebaseUtil from '@firebase/util'; import { SinonStub, stub, useFakeTimers } from 'sinon'; @@ -173,7 +175,6 @@ describe('HeartbeatServiceImpl', () => { let writeStub: SinonStub; let userAgentString = USER_AGENT_STRING_1; const mockIndexedDBHeartbeats = [ - // Chosen so one will exceed 30 day limit and one will not. { agent: 'old-user-agent', date: '1969-12-01' @@ -236,15 +237,14 @@ describe('HeartbeatServiceImpl', () => { }); } }); - it(`triggerHeartbeat() writes new heartbeats and retains old ones newer than 30 days`, async () => { + it(`triggerHeartbeat() writes new heartbeats and retains old ones`, async () => { userAgentString = USER_AGENT_STRING_2; clock.tick(3 * 24 * 60 * 60 * 1000); await heartbeatService.triggerHeartbeat(); if (firebaseUtil.isIndexedDBAvailable()) { expect(writeStub).to.be.calledWith({ heartbeats: [ - // The first entry exceeds the 30 day retention limit. - mockIndexedDBHeartbeats[1], + ...mockIndexedDBHeartbeats, { agent: USER_AGENT_STRING_2, date: '1970-01-04' } ] }); @@ -260,6 +260,7 @@ describe('HeartbeatServiceImpl', () => { ); if (firebaseUtil.isIndexedDBAvailable()) { expect(heartbeatHeaders).to.include('old-user-agent'); + expect(heartbeatHeaders).to.include('1969-12-01'); expect(heartbeatHeaders).to.include('1969-12-31'); } expect(heartbeatHeaders).to.include(USER_AGENT_STRING_2); @@ -273,6 +274,40 @@ describe('HeartbeatServiceImpl', () => { const emptyHeaders = await heartbeatService.getHeartbeatsHeader(); expect(emptyHeaders).to.equal(''); }); + it('triggerHeartbeat() removes the earliest heartbeat once the max number of heartbeats is exceeded', async () => { + // Trigger heartbeats until we reach the limit + const numHeartbeats = + heartbeatService._heartbeatsCache?.heartbeats.length!; + for (let i = numHeartbeats; i <= MAX_NUM_STORED_HEARTBEATS; i++) { + await heartbeatService.triggerHeartbeat(); + clock.tick(24 * 60 * 60 * 1000); + } + + expect(heartbeatService._heartbeatsCache?.heartbeats.length).to.equal( + MAX_NUM_STORED_HEARTBEATS + ); + const earliestHeartbeatDate = getEarliestHeartbeatIdx( + heartbeatService._heartbeatsCache?.heartbeats! + ); + const earliestHeartbeat = + heartbeatService._heartbeatsCache?.heartbeats[earliestHeartbeatDate]!; + await heartbeatService.triggerHeartbeat(); + expect(heartbeatService._heartbeatsCache?.heartbeats.length).to.equal( + MAX_NUM_STORED_HEARTBEATS + ); + expect( + heartbeatService._heartbeatsCache?.heartbeats.indexOf(earliestHeartbeat) + ).to.equal(-1); + }); + it('triggerHeartbeat() never causes the heartbeat count to exceed the max', async () => { + for (let i = 0; i <= 50; i++) { + await heartbeatService.triggerHeartbeat(); + clock.tick(24 * 60 * 60 * 1000); + expect( + heartbeatService._heartbeatsCache?.heartbeats.length + ).to.be.lessThanOrEqual(MAX_NUM_STORED_HEARTBEATS); + } + }); }); describe('If IndexedDB records that a header was sent today', () => { @@ -280,7 +315,6 @@ describe('HeartbeatServiceImpl', () => { let writeStub: SinonStub; const userAgentString = USER_AGENT_STRING_1; const mockIndexedDBHeartbeats = [ - // Chosen so one will exceed 30 day limit and one will not. { agent: 'old-user-agent', date: '1969-12-01' @@ -426,4 +460,22 @@ describe('HeartbeatServiceImpl', () => { ); }); }); + + describe('getEarliestHeartbeatIdx()', () => { + it('returns -1 if the heartbeats array is empty', () => { + const heartbeats: SingleDateHeartbeat[] = []; + const idx = getEarliestHeartbeatIdx(heartbeats); + expect(idx).to.equal(-1); + }); + + it('returns the index of the earliest date', () => { + const heartbeats = [ + { agent: generateUserAgentString(2), date: '2022-01-02' }, + { agent: generateUserAgentString(1), date: '2022-01-01' }, + { agent: generateUserAgentString(3), date: '2022-01-03' } + ]; + const idx = getEarliestHeartbeatIdx(heartbeats); + expect(idx).to.equal(1); + }); + }); }); diff --git a/packages/app/src/heartbeatService.ts b/packages/app/src/heartbeatService.ts index 83a2b63993e..ad602484d1f 100644 --- a/packages/app/src/heartbeatService.ts +++ b/packages/app/src/heartbeatService.ts @@ -36,8 +36,7 @@ import { import { logger } from './logger'; const MAX_HEADER_BYTES = 1024; -// 30 days -const STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000; +export const MAX_NUM_STORED_HEARTBEATS = 30; export class HeartbeatServiceImpl implements HeartbeatService { /** @@ -109,14 +108,19 @@ export class HeartbeatServiceImpl implements HeartbeatService { } else { // There is no entry for this date. Create one. this._heartbeatsCache.heartbeats.push({ date, agent }); + + // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date. + // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed. + if ( + this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS + ) { + const earliestHeartbeatIdx = getEarliestHeartbeatIdx( + this._heartbeatsCache.heartbeats + ); + this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1); + } } - // Remove entries older than 30 days. - this._heartbeatsCache.heartbeats = - this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => { - const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf(); - const now = Date.now(); - return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS; - }); + return this._storage.overwrite(this._heartbeatsCache); } catch (e) { logger.warn(e); @@ -303,3 +307,27 @@ export function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number { JSON.stringify({ version: 2, heartbeats: heartbeatsCache }) ).length; } + +/** + * Returns the index of the heartbeat with the earliest date. + * If the heartbeats array is empty, -1 is returned. + */ +export function getEarliestHeartbeatIdx( + heartbeats: SingleDateHeartbeat[] +): number { + if (heartbeats.length === 0) { + return -1; + } + + let earliestHeartbeatIdx = 0; + let earliestHeartbeatDate = heartbeats[0].date; + + for (let i = 1; i < heartbeats.length; i++) { + if (heartbeats[i].date < earliestHeartbeatDate) { + earliestHeartbeatDate = heartbeats[i].date; + earliestHeartbeatIdx = i; + } + } + + return earliestHeartbeatIdx; +} From 01f36ea41011fdd6ec77e4b1a799193bef58aa91 Mon Sep 17 00:00:00 2001 From: Alexander <74536256+alexander-at-t@users.noreply.github.com> Date: Wed, 29 Jan 2025 02:00:30 +0200 Subject: [PATCH 088/295] Fix negative offset of reconnect delay (#8718) (#8719) RTDB Fix negative offset of reconnect delay. Fixes #8718. --- .changeset/chilled-clocks-remember.md | 6 ++++++ packages/database/src/core/PersistentConnection.ts | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/chilled-clocks-remember.md diff --git a/.changeset/chilled-clocks-remember.md b/.changeset/chilled-clocks-remember.md new file mode 100644 index 00000000000..cbc0ec71a1f --- /dev/null +++ b/.changeset/chilled-clocks-remember.md @@ -0,0 +1,6 @@ +--- +"@firebase/database": patch +'firebase': patch +--- + +Fix a potential for a negative offset when calculating last reconnect times. This could cause lengthy reconnect delays in some scenarios. Fixes #8718. diff --git a/packages/database/src/core/PersistentConnection.ts b/packages/database/src/core/PersistentConnection.ts index 4e12b37088b..4070c4fea98 100644 --- a/packages/database/src/core/PersistentConnection.ts +++ b/packages/database/src/core/PersistentConnection.ts @@ -797,8 +797,10 @@ export class PersistentConnection extends ServerActions { this.lastConnectionEstablishedTime_ = null; } - const timeSinceLastConnectAttempt = - new Date().getTime() - this.lastConnectionAttemptTime_; + const timeSinceLastConnectAttempt = Math.max( + 0, + new Date().getTime() - this.lastConnectionAttemptTime_ + ); let reconnectDelay = Math.max( 0, this.reconnectDelay_ - timeSinceLastConnectAttempt From 28eaaf4bab0efcd790f1df5073921685a498dccc Mon Sep 17 00:00:00 2001 From: jposuna <49734+jposuna@users.noreply.github.com> Date: Thu, 30 Jan 2025 11:36:51 -0800 Subject: [PATCH 089/295] Swap Performance's owner from jposuna to visumickey (#8737) --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ec2416ecb23..9d414cc7315 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -51,9 +51,9 @@ packages/installations-compat @avolkovi @yoyomyo @firebase/jssdk-global-approver packages/installations-types @avolkovi @yoyomyo @firebase/jssdk-global-approvers # Performance Code -packages/performance @jposuna @firebase/jssdk-global-approvers -packages/performance-compat @jposuna @firebase/jssdk-global-approvers -packages/performance-types @jposuna @firebase/jssdk-global-approvers +packages/performance @visumickey @firebase/jssdk-global-approvers +packages/performance-compat @visumickey @firebase/jssdk-global-approvers +packages/performance-types @visumickey @firebase/jssdk-global-approvers # Analytics Code packages/analytics @hsubox76 @firebase/jssdk-global-approvers From 82373b372228577779e4d8617f6d412c53680e71 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 30 Jan 2025 14:24:03 -0600 Subject: [PATCH 090/295] Give `check-version` job pull request write permissions (#8743) * Add pull_request write permissions * fix typo --- .github/workflows/check-vertexai-responses.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index d2d356890d0..0ce811a6cc0 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -22,6 +22,7 @@ jobs: # Allow GITHUB_TOKEN to have write permissions permissions: contents: write + pull-requests: write steps: - uses: actions/checkout@v4 - name: Clone mock responses From d1c6e311dbae1b5864d8c7254b0242024cf1d6c0 Mon Sep 17 00:00:00 2001 From: "Nhien (Ricky) Lam" <62775270+NhienLam@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:31:48 -0800 Subject: [PATCH 091/295] Skip flaky auth recaptcha test (#8753) --- .../auth/test/integration/flows/recaptcha_enterprise.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts b/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts index 00cec9dfd7e..a2036f35367 100644 --- a/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts +++ b/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts @@ -104,6 +104,10 @@ describe('Integration test: phone auth with reCAPTCHA Enterprise ENFORCE mode', }); it('throws error if recaptcha token is invalid', async function () { + // Test is ignored for now as it fails with auth/too-many-requests. + // TODO: Increase quota or remove this test + this.skip(); + if (emulatorUrl) { this.skip(); } From 2f92a7402ebf6723b2d8b8d464913ee7d692c054 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 4 Feb 2025 13:31:24 -0800 Subject: [PATCH 092/295] Update dependencies in packages and repo-scripts (#8729) --- config/api-extractor.json | 2 +- package.json | 10 +- packages/analytics-compat/package.json | 4 +- packages/analytics-compat/tsconfig.json | 6 +- .../analytics-interop-types/tsconfig.json | 4 +- packages/analytics-types/tsconfig.json | 4 +- packages/analytics/package.json | 4 +- packages/analytics/rollup.config.js | 6 +- packages/app-check-compat/package.json | 4 +- .../app-check-interop-types/tsconfig.json | 4 +- packages/app-check-types/tsconfig.json | 4 +- packages/app-check/package.json | 4 +- packages/app-compat/package.json | 4 +- packages/app-types/tsconfig.json | 4 +- packages/app/package.json | 4 +- packages/app/rollup.config.js | 6 +- packages/app/tsconfig.json | 6 +- packages/auth-compat/package.json | 6 +- packages/auth-compat/tsconfig.json | 6 +- packages/auth-interop-types/tsconfig.json | 4 +- packages/auth-types/tsconfig.json | 4 +- packages/auth/package.json | 6 +- packages/auth/rollup.config.js | 7 +- packages/auth/tsconfig.json | 7 +- packages/component/package.json | 4 +- packages/component/rollup.config.js | 10 +- packages/component/src/provider.ts | 6 +- packages/component/tsconfig.json | 6 +- packages/data-connect/package.json | 4 +- packages/data-connect/rollup.config.js | 4 + packages/data-connect/tsconfig.json | 5 +- packages/database-compat/tsconfig.json | 6 +- packages/database-types/tsconfig.json | 4 +- packages/database/package.json | 4 +- packages/database/rollup.config.js | 4 + packages/database/tsconfig.json | 6 +- packages/firebase/package.json | 6 +- packages/firebase/tsconfig.json | 6 +- packages/firestore-compat/package.json | 4 +- packages/firestore-types/tsconfig.json | 4 +- packages/firestore/package.json | 14 +- packages/firestore/rollup.config.js | 3 + packages/firestore/rollup.shared.js | 1 - .../test/unit/specs/describe_spec.ts | 6 +- packages/functions-compat/package.json | 4 +- packages/functions-compat/tsconfig.json | 6 +- packages/functions-types/tsconfig.json | 4 +- packages/functions/package.json | 4 +- packages/functions/rollup.config.js | 6 +- packages/functions/tsconfig.json | 6 +- packages/installations-compat/package.json | 4 +- packages/installations/package.json | 4 +- packages/installations/rollup.config.js | 6 +- packages/logger/package.json | 4 +- packages/logger/tsconfig.json | 6 +- packages/messaging-compat/package.json | 4 +- packages/messaging-compat/tsconfig.json | 9 +- .../messaging-interop-types/tsconfig.json | 14 +- packages/messaging/package.json | 6 +- packages/messaging/rollup.config.js | 6 +- packages/messaging/tsconfig.json | 9 +- packages/performance-compat/package.json | 4 +- packages/performance-types/tsconfig.json | 4 +- packages/performance/package.json | 4 +- packages/performance/rollup.config.js | 6 +- packages/remote-config-compat/package.json | 4 +- packages/remote-config-types/tsconfig.json | 4 +- packages/remote-config/package.json | 4 +- packages/remote-config/rollup.config.js | 6 +- packages/remote-config/tsconfig.json | 8 +- .../rules-unit-testing/api-extractor.json | 2 +- packages/rules-unit-testing/package.json | 8 +- packages/rules-unit-testing/rollup.config.js | 6 +- packages/rules-unit-testing/tsconfig.json | 4 +- packages/storage-compat/package.json | 4 +- packages/storage-compat/tsconfig.json | 6 +- packages/storage-types/tsconfig.json | 4 +- packages/storage/package.json | 6 +- packages/storage/rollup.config.js | 4 + packages/storage/tsconfig.json | 6 +- packages/template-types/tsconfig.json | 4 +- packages/template/package.json | 4 +- packages/template/tsconfig.json | 6 +- packages/util/package.json | 4 +- packages/util/tsconfig.json | 6 +- packages/vertexai/package.json | 4 +- packages/vertexai/rollup.config.js | 2 + packages/vertexai/tsconfig.json | 8 +- packages/webchannel-wrapper/package.json | 4 +- packages/webchannel-wrapper/tsconfig.json | 2 +- repo-scripts/api-documenter/package.json | 7 +- repo-scripts/changelog-generator/package.json | 4 +- repo-scripts/prune-dts/package.json | 6 +- repo-scripts/size-analysis/package.json | 8 +- .../build/rollup_emit_module_package_file.js | 2 +- yarn.lock | 9563 +++++++---------- 96 files changed, 3865 insertions(+), 6192 deletions(-) diff --git a/config/api-extractor.json b/config/api-extractor.json index 3dd3d985f81..5d3e13e2867 100644 --- a/config/api-extractor.json +++ b/config/api-extractor.json @@ -100,7 +100,7 @@ * * DEFAULT VALUE: false */ - // "skipLibCheck": true, + "skipLibCheck": true, }, /** diff --git a/package.json b/package.json index 3ce1a544a72..a48fe698ff4 100644 --- a/package.json +++ b/package.json @@ -62,13 +62,13 @@ "repo-scripts/*" ], "devDependencies": { - "@babel/core": "7.26.0", + "@babel/core": "7.26.7", "@babel/plugin-transform-modules-commonjs": "7.26.3", - "@babel/preset-env": "7.26.0", + "@babel/preset-env": "7.26.7", "@babel/preset-typescript": "7.26.0", "@babel/register": "7.25.9", "@changesets/changelog-github": "0.5.0", - "@changesets/cli": "2.27.11", + "@changesets/cli": "2.27.12", "@types/chai": "4.3.20", "@types/chai-as-promised": "7.1.8", "@types/child-process-promise": "2.2.6", @@ -80,7 +80,7 @@ "@types/long": "4.0.2", "@types/mocha": "9.1.1", "@types/mz": "2.7.8", - "@types/node": "18.19.71", + "@types/node": "18.19.74", "@types/request": "2.48.12", "@types/sinon": "9.0.11", "@types/sinon-chai": "3.2.12", @@ -139,7 +139,7 @@ "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", - "playwright": "1.49.1", + "playwright": "1.50.0", "postinstall-postinstall": "2.1.0", "prettier": "2.8.8", "protractor": "5.4.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 0e50f815b95..0001d69fe1f 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -23,9 +23,9 @@ }, "devDependencies": { "@firebase/app-compat": "0.2.48", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/analytics-compat/tsconfig.json b/packages/analytics-compat/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/analytics-compat/tsconfig.json +++ b/packages/analytics-compat/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/analytics-interop-types/tsconfig.json b/packages/analytics-interop-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/analytics-interop-types/tsconfig.json +++ b/packages/analytics-interop-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/analytics-types/tsconfig.json b/packages/analytics-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/analytics-types/tsconfig.json +++ b/packages/analytics-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 04d355db083..9f8d16692d9 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -48,11 +48,11 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/analytics/rollup.config.js b/packages/analytics/rollup.config.js index 6acafe03b5d..a22194d1d4a 100644 --- a/packages/analytics/rollup.config.js +++ b/packages/analytics/rollup.config.js @@ -22,6 +22,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = [ ...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies)) @@ -29,7 +30,10 @@ const deps = [ const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 136c8f8d9e9..15d8a1776e4 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -44,11 +44,11 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app-compat": "0.2.48", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/app-check-interop-types/tsconfig.json b/packages/app-check-interop-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/app-check-interop-types/tsconfig.json +++ b/packages/app-check-interop-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/app-check-types/tsconfig.json b/packages/app-check-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/app-check-types/tsconfig.json +++ b/packages/app-check-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 549952605b4..16a980e8314 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -45,11 +45,11 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index b07216da96e..72cf92ba5e1 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -44,10 +44,10 @@ "tslib": "^2.1.0" }, "devDependencies": { - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/app-types/tsconfig.json b/packages/app-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/app-types/tsconfig.json +++ b/packages/app-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/app/package.json b/packages/app/package.json index 13d559b2ca9..16802129b80 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -46,9 +46,9 @@ "license": "Apache-2.0", "devDependencies": { "@rollup/plugin-json": "6.1.0", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-dts": "5.3.1", "typescript": "5.5.4" }, diff --git a/packages/app/rollup.config.js b/packages/app/rollup.config.js index ec5a279a1c2..8314734a746 100644 --- a/packages/app/rollup.config.js +++ b/packages/app/rollup.config.js @@ -23,6 +23,7 @@ import dts from 'rollup-plugin-dts'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) @@ -30,7 +31,10 @@ const deps = Object.keys( const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index 735ea623511..d20427b2bec 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -4,7 +4,5 @@ "outDir": "dist", "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 327ae216cb5..bde63677936 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -59,10 +59,10 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "@rollup/plugin-json": "6.1.0", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", - "selenium-webdriver": "4.8.0", + "rollup-plugin-typescript2": "0.36.0", + "selenium-webdriver": "4.28.1", "typescript": "5.5.4" }, "repository": { diff --git a/packages/auth-compat/tsconfig.json b/packages/auth-compat/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/auth-compat/tsconfig.json +++ b/packages/auth-compat/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/auth-interop-types/tsconfig.json b/packages/auth-interop-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/auth-interop-types/tsconfig.json +++ b/packages/auth-interop-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/auth-types/tsconfig.json b/packages/auth-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/auth-types/tsconfig.json +++ b/packages/auth-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/auth/package.json b/packages/auth/package.json index 1a01abde449..cfaed2c5000 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -136,10 +136,10 @@ "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", "chromedriver": "119.0.1", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-typescript2": "0.31.2", - "selenium-webdriver": "4.8.0", + "rollup-plugin-typescript2": "0.36.0", + "selenium-webdriver": "4.28.1", "totp-generator": "0.0.14", "typescript": "5.5.4" }, diff --git a/packages/auth/rollup.config.js b/packages/auth/rollup.config.js index 6af229962bd..01ca456e0ac 100644 --- a/packages/auth/rollup.config.js +++ b/packages/auth/rollup.config.js @@ -24,6 +24,7 @@ import alias from '@rollup/plugin-alias'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) @@ -47,7 +48,10 @@ const nodeAliasPlugin = alias({ const buildPlugins = [ json(), strip({ functions: ['debugAssert.*'] }), - typescriptPlugin({ typescript }) + typescriptPlugin({ + typescript, + tsconfigOverride: { exclude: [...tsconfig.exclude, '**/*.test.ts'] } + }) ]; const browserBuilds = [ @@ -191,6 +195,7 @@ const webWorkerBuild = { }), typescriptPlugin({ typescript, + exclude: [...tsconfig.exclude, '**/*.test.*'], compilerOptions: { lib: [ // Remove dom after we figure out why navigator stuff doesn't exist diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json index 03897eed09c..f8d06916d09 100644 --- a/packages/auth/tsconfig.json +++ b/packages/auth/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*", - "demo/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*", "demo/**/*"] +} diff --git a/packages/component/package.json b/packages/component/package.json index 5fd762a794b..a139c563255 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -36,8 +36,8 @@ }, "license": "Apache-2.0", "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/component/rollup.config.js b/packages/component/rollup.config.js index 11d18692c8c..17d92f77bb8 100644 --- a/packages/component/rollup.config.js +++ b/packages/component/rollup.config.js @@ -19,12 +19,20 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import typescript from 'typescript'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const buildPlugins = [typescriptPlugin({ typescript })]; +const buildPlugins = [ + typescriptPlugin({ + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } + }) +]; const esmBuild = { input: 'index.ts', diff --git a/packages/component/src/provider.ts b/packages/component/src/provider.ts index 267bae976f7..35005893e96 100644 --- a/packages/component/src/provider.ts +++ b/packages/component/src/provider.ts @@ -319,7 +319,7 @@ export class Provider { instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier), options }); - this.instances.set(instanceIdentifier, instance); + this.instances.set(instanceIdentifier, instance!); this.instancesOptions.set(instanceIdentifier, options); /** @@ -327,7 +327,7 @@ export class Provider { * Note this.component.onInstanceCreated is different, which is used by the component creator, * while onInit listeners are registered by consumers of the provider. */ - this.invokeOnInitCallbacks(instance, instanceIdentifier); + this.invokeOnInitCallbacks(instance!, instanceIdentifier); /** * Order is important @@ -339,7 +339,7 @@ export class Provider { this.component.onInstanceCreated( this.container, instanceIdentifier, - instance + instance! ); } catch { // ignore errors in the onInstanceCreatedCallback diff --git a/packages/component/tsconfig.json b/packages/component/tsconfig.json index 735ea623511..d20427b2bec 100644 --- a/packages/component/tsconfig.json +++ b/packages/component/tsconfig.json @@ -4,7 +4,5 @@ "outDir": "dist", "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 8936f11a3eb..567c44ecf8a 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -56,8 +56,8 @@ }, "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/data-connect/rollup.config.js b/packages/data-connect/rollup.config.js index 56b6464d274..ab0119ca5d2 100644 --- a/packages/data-connect/rollup.config.js +++ b/packages/data-connect/rollup.config.js @@ -22,6 +22,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = [ ...Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies }), @@ -38,6 +39,9 @@ function onWarn(warning, defaultWarn) { const buildPlugins = [ typescriptPlugin({ typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + }, abortOnError: false }), json({ preferConst: true }) diff --git a/packages/data-connect/tsconfig.json b/packages/data-connect/tsconfig.json index 838f5c0d3c3..58561f50f5d 100644 --- a/packages/data-connect/tsconfig.json +++ b/packages/data-connect/tsconfig.json @@ -4,8 +4,5 @@ "outDir": "dist", "strict": false }, - "exclude": [ - "dist/**/*", - "test/**/*" - ] + "exclude": ["dist/**/*", "test/**/*"] } diff --git a/packages/database-compat/tsconfig.json b/packages/database-compat/tsconfig.json index ce12ac3c5dc..cda7e399a2c 100644 --- a/packages/database-compat/tsconfig.json +++ b/packages/database-compat/tsconfig.json @@ -5,7 +5,5 @@ "strict": false, "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/database-types/tsconfig.json b/packages/database-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/database-types/tsconfig.json +++ b/packages/database-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/database/package.json b/packages/database/package.json index 62eaf630e6d..aa357464c69 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -58,8 +58,8 @@ }, "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/rollup.config.js b/packages/database/rollup.config.js index 293eaf06811..bdd6b8ae36c 100644 --- a/packages/database/rollup.config.js +++ b/packages/database/rollup.config.js @@ -22,6 +22,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = [ ...Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies }), @@ -38,6 +39,9 @@ function onWarn(warning, defaultWarn) { const buildPlugins = [ typescriptPlugin({ typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + }, abortOnError: false }), json({ preferConst: true }) diff --git a/packages/database/tsconfig.json b/packages/database/tsconfig.json index ce12ac3c5dc..cda7e399a2c 100644 --- a/packages/database/tsconfig.json +++ b/packages/database/tsconfig.json @@ -5,7 +5,5 @@ "strict": false, "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 380f3048fb6..cab75ad6e28 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -429,18 +429,18 @@ "@firebase/vertexai": "1.0.3" }, "devDependencies": { - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-sourcemaps": "0.6.3", "@rollup/plugin-terser": "0.4.4", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-uglify": "6.0.4", "gulp": "4.0.2", "gulp-sourcemaps": "3.0.0", "gulp-replace": "1.1.4", "typescript": "5.5.4", - "rollup-plugin-license": "3.0.1" + "rollup-plugin-license": "3.5.3" }, "components": [ "analytics", diff --git a/packages/firebase/tsconfig.json b/packages/firebase/tsconfig.json index 741f57b2ae4..53e45c82eae 100644 --- a/packages/firebase/tsconfig.json +++ b/packages/firebase/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "**/dist/**/*" - ] -} \ No newline at end of file + "exclude": ["**/dist/**/*"] +} diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index dd8dfc75daa..435f979864f 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -55,10 +55,10 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "@types/eslint": "7.29.0", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", "@rollup/plugin-terser": "0.4.4", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-node-resolve": "13.3.0", "ts-node": "10.9.2", "typescript": "5.5.4" diff --git a/packages/firestore-types/tsconfig.json b/packages/firestore-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/firestore-types/tsconfig.json +++ b/packages/firestore-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 4bb8d65ee06..1545033bd98 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -109,20 +109,20 @@ "@firebase/app": "0.10.18", "@firebase/app-compat": "0.2.48", "@firebase/auth": "1.8.2", - "@rollup/plugin-alias": "5.1.0", + "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", - "@types/json-stable-stringify": "1.0.36", - "chai-exclude": "2.1.0", - "json-stable-stringify": "1.1.1", - "protobufjs": "7.2.6", - "rollup": "2.79.1", + "@types/json-stable-stringify": "1.1.0", + "chai-exclude": "2.1.1", + "json-stable-stringify": "1.2.1", + "protobufjs": "7.4.0", + "rollup": "2.79.2", "rollup-plugin-copy": "3.5.0", "rollup-plugin-copy-assets": "2.0.3", "rollup-plugin-replace": "2.2.0", "rollup-plugin-sourcemaps": "0.6.3", "@rollup/plugin-terser": "0.4.4", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-dts": "5.3.1", "ts-node": "10.9.2", "typescript": "5.5.4" diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index 8d93aab992e..f9a29bef742 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -28,6 +28,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const sourcemaps = require('rollup-plugin-sourcemaps'); const util = require('./rollup.shared'); @@ -35,6 +36,7 @@ const util = require('./rollup.shared'); const nodePlugins = [ typescriptPlugin({ typescript, + exclude: [...tsconfig.exclude, '**/*.test.ts'], cacheDir: tmp.dirSync(), abortOnError: true, transformers: [util.removeAssertTransformer] @@ -48,6 +50,7 @@ const nodePlugins = [ const browserPlugins = [ typescriptPlugin({ typescript, + exclude: [...tsconfig.exclude, '**/*.test.ts'], cacheDir: tmp.dirSync(), abortOnError: true, transformers: [util.removeAssertAndPrefixInternalTransformer] diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index aa90fc51edb..728f03df2fe 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -22,7 +22,6 @@ const typescriptPlugin = require('rollup-plugin-typescript2'); const typescript = require('typescript'); const { terser } = require('@rollup/plugin-terser'); const path = require('path'); -const sourcemaps = require('rollup-plugin-sourcemaps'); const { renameInternals } = require('./scripts/rename-internals'); const { extractPublicIdentifiers } = require('./scripts/extract-api'); diff --git a/packages/firestore/test/unit/specs/describe_spec.ts b/packages/firestore/test/unit/specs/describe_spec.ts index 464cddf2321..0b95cef1897 100644 --- a/packages/firestore/test/unit/specs/describe_spec.ts +++ b/packages/firestore/test/unit/specs/describe_spec.ts @@ -256,7 +256,7 @@ export function describeSpec( space: 2, cmp: stringifyComparator }); - writeJSONFile(output); + writeJSONFile(output || ''); } } @@ -300,8 +300,8 @@ function stringifyGroup(s: string): number { * some logically-first keys before others. */ function stringifyComparator( - a: stringify.Element, - b: stringify.Element + a: { key: string; value: unknown }, + b: { key: string; value: unknown } ): number { const aGroup = stringifyGroup(a.key); const bGroup = stringifyGroup(b.key); diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index f46ccc3bc2b..0cd65b0e88b 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -30,9 +30,9 @@ }, "devDependencies": { "@firebase/app-compat": "0.2.48", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/functions-compat/tsconfig.json b/packages/functions-compat/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/functions-compat/tsconfig.json +++ b/packages/functions-compat/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/functions-types/tsconfig.json b/packages/functions-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/functions-types/tsconfig.json +++ b/packages/functions-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/functions/package.json b/packages/functions/package.json index d15d563a3aa..c8d7a73267e 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -50,9 +50,9 @@ }, "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/functions/rollup.config.js b/packages/functions/rollup.config.js index 8d00f21d755..06899e7224c 100644 --- a/packages/functions/rollup.config.js +++ b/packages/functions/rollup.config.js @@ -20,6 +20,7 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import replace from 'rollup-plugin-replace'; import typescript from 'typescript'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; @@ -29,7 +30,10 @@ const deps = Object.keys( const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/functions/tsconfig.json b/packages/functions/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/functions/tsconfig.json +++ b/packages/functions/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 4299b616a60..de43a4cfc85 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -45,11 +45,11 @@ }, "devDependencies": { "@firebase/app-compat": "0.2.48", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-uglify": "6.0.4", "typescript": "5.5.4" }, diff --git a/packages/installations/package.json b/packages/installations/package.json index 34481a64f3c..7db39fa9aa4 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -50,11 +50,11 @@ }, "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "13.3.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-uglify": "6.0.4", "typescript": "5.5.4" }, diff --git a/packages/installations/rollup.config.js b/packages/installations/rollup.config.js index 7d083c63320..bf2b61f73f0 100644 --- a/packages/installations/rollup.config.js +++ b/packages/installations/rollup.config.js @@ -20,6 +20,7 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import replace from 'rollup-plugin-replace'; import typescript from 'typescript'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; @@ -27,7 +28,10 @@ const deps = [...Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies })]; const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/logger/package.json b/packages/logger/package.json index cc3eecd584f..f8661d3fdf7 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -35,8 +35,8 @@ "tslib": "^2.1.0" }, "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/logger/tsconfig.json +++ b/packages/logger/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index f79649f4ef0..a81f6b50c12 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -46,8 +46,8 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", - "ts-essentials": "9.3.0", + "rollup-plugin-typescript2": "0.36.0", + "ts-essentials": "9.4.2", "typescript": "5.5.4" }, "repository": { diff --git a/packages/messaging-compat/tsconfig.json b/packages/messaging-compat/tsconfig.json index 4b63b47c5b5..90f9c26f657 100644 --- a/packages/messaging-compat/tsconfig.json +++ b/packages/messaging-compat/tsconfig.json @@ -3,13 +3,8 @@ "compilerOptions": { "outDir": "dist", "noUnusedLocals": true, - "lib": [ - "dom", - "es2017" - ], + "lib": ["dom", "es2017"], "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/messaging-interop-types/tsconfig.json b/packages/messaging-interop-types/tsconfig.json index 94e5b1c1b3e..ad532c5f58b 100644 --- a/packages/messaging-interop-types/tsconfig.json +++ b/packages/messaging-interop-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../config/tsconfig.base.json", - "compilerOptions": { - "noEmit": true - }, - "exclude": [ - "dist/**/*" - ] - } \ No newline at end of file + "extends": "../../config/tsconfig.base.json", + "compilerOptions": { + "noEmit": true + }, + "exclude": ["dist/**/*"] +} diff --git a/packages/messaging/package.json b/packages/messaging/package.json index e07da34ea45..1d9860d6824 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -61,10 +61,10 @@ }, "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", - "ts-essentials": "10.0.2", + "ts-essentials": "10.0.4", "typescript": "5.5.4" }, "repository": { diff --git a/packages/messaging/rollup.config.js b/packages/messaging/rollup.config.js index 506f0d30261..9342be135f2 100644 --- a/packages/messaging/rollup.config.js +++ b/packages/messaging/rollup.config.js @@ -17,6 +17,7 @@ import json from '@rollup/plugin-json'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; import typescript from 'typescript'; import replace from 'rollup-plugin-replace'; import typescriptPlugin from 'rollup-plugin-typescript2'; @@ -29,7 +30,10 @@ const deps = Object.keys( const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/messaging/tsconfig.json b/packages/messaging/tsconfig.json index 4b63b47c5b5..90f9c26f657 100644 --- a/packages/messaging/tsconfig.json +++ b/packages/messaging/tsconfig.json @@ -3,13 +3,8 @@ "compilerOptions": { "outDir": "dist", "noUnusedLocals": true, - "lib": [ - "dom", - "es2017" - ], + "lib": ["dom", "es2017"], "downlevelIteration": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index ae04fe61a14..48cea0d261b 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -46,10 +46,10 @@ "tslib": "^2.1.0" }, "devDependencies": { - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", "@firebase/app-compat": "0.2.48" }, diff --git a/packages/performance-types/tsconfig.json b/packages/performance-types/tsconfig.json index 09f747b4d46..4e0ae05eebc 100644 --- a/packages/performance-types/tsconfig.json +++ b/packages/performance-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/performance/package.json b/packages/performance/package.json index 7ede315be8a..4b2284fa335 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -46,9 +46,9 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/performance/rollup.config.js b/packages/performance/rollup.config.js index ca9fdde7f54..006dcf54337 100644 --- a/packages/performance/rollup.config.js +++ b/packages/performance/rollup.config.js @@ -22,6 +22,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) @@ -29,7 +30,10 @@ const deps = Object.keys( const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 7116a6999d9..54b45f2a3cd 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -45,10 +45,10 @@ "tslib": "^2.1.0" }, "devDependencies": { - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", "@firebase/app-compat": "0.2.48" }, diff --git a/packages/remote-config-types/tsconfig.json b/packages/remote-config-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/remote-config-types/tsconfig.json +++ b/packages/remote-config-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 6e92d347b23..4b10504956d 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -49,8 +49,8 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/remote-config/rollup.config.js b/packages/remote-config/rollup.config.js index a7209c67e09..36622f4dae2 100644 --- a/packages/remote-config/rollup.config.js +++ b/packages/remote-config/rollup.config.js @@ -22,6 +22,7 @@ import typescript from 'typescript'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) @@ -29,7 +30,10 @@ const deps = Object.keys( const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }), json({ preferConst: true }) ]; diff --git a/packages/remote-config/tsconfig.json b/packages/remote-config/tsconfig.json index a4b8678284b..f2942111423 100644 --- a/packages/remote-config/tsconfig.json +++ b/packages/remote-config/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../config/tsconfig.base.json", "compilerOptions": { "outDir": "dist", - "resolveJsonModule": true, + "resolveJsonModule": true }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/rules-unit-testing/api-extractor.json b/packages/rules-unit-testing/api-extractor.json index 620d10a071c..12ef61e843d 100644 --- a/packages/rules-unit-testing/api-extractor.json +++ b/packages/rules-unit-testing/api-extractor.json @@ -1,5 +1,5 @@ { "extends": "../../config/api-extractor.json", // Point it to your entry point d.ts file. - "mainEntryPointFilePath": "/dist/index.d.ts" + "mainEntryPointFilePath": "/dist/rules-unit-testing/index.d.ts" } \ No newline at end of file diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index 851e01e285a..033e4f752bc 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -6,7 +6,7 @@ "main": "dist/index.cjs.js", "exports": { ".": { - "types": "./dist/index.d.ts", + "types": "./dist/rules-unit-testing/index.d.ts", "node": { "import": "./dist/esm/index.esm.js", "require": "./dist/index.cjs.js" @@ -39,8 +39,8 @@ }, "license": "Apache-2.0", "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2" + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0" }, "peerDependencies": { "firebase": "^11.0.0" @@ -50,7 +50,7 @@ "type": "git", "url": "git+https://github.com/firebase/firebase-js-sdk.git" }, - "typings": "dist/index.d.ts", + "typings": "dist/rules-unit-testing/index.d.ts", "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" } diff --git a/packages/rules-unit-testing/rollup.config.js b/packages/rules-unit-testing/rollup.config.js index 5811401fb74..55755326dda 100644 --- a/packages/rules-unit-testing/rollup.config.js +++ b/packages/rules-unit-testing/rollup.config.js @@ -17,12 +17,16 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; import typescript from 'typescript'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; const buildPlugins = [ typescriptPlugin({ - typescript + typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + } }) ]; diff --git a/packages/rules-unit-testing/tsconfig.json b/packages/rules-unit-testing/tsconfig.json index 09f747b4d46..4e0ae05eebc 100644 --- a/packages/rules-unit-testing/tsconfig.json +++ b/packages/rules-unit-testing/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index fb576dcabfa..49264e65669 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -46,9 +46,9 @@ "devDependencies": { "@firebase/app-compat": "0.2.48", "@firebase/auth-compat": "0.5.17", - "rollup": "2.79.1", + "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "files": [ diff --git a/packages/storage-compat/tsconfig.json b/packages/storage-compat/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/storage-compat/tsconfig.json +++ b/packages/storage-compat/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/storage-types/tsconfig.json b/packages/storage-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/storage-types/tsconfig.json +++ b/packages/storage-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/storage/package.json b/packages/storage/package.json index b88b6782ef4..6988c86b581 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -56,10 +56,10 @@ "devDependencies": { "@firebase/app": "0.10.18", "@firebase/auth": "1.8.2", - "rollup": "2.79.1", - "@rollup/plugin-alias": "5.1.0", + "rollup": "2.79.2", + "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/storage/rollup.config.js b/packages/storage/rollup.config.js index 093cca0c654..4ce92722281 100644 --- a/packages/storage/rollup.config.js +++ b/packages/storage/rollup.config.js @@ -23,6 +23,7 @@ import alias from '@rollup/plugin-alias'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; function generateAliasConfig(platform) { return { @@ -44,6 +45,9 @@ const nodeDeps = [...deps, 'util']; const buildPlugins = [ typescriptPlugin({ typescript, + tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts'] + }, abortOnError: false }), json({ preferConst: true }) diff --git a/packages/storage/tsconfig.json b/packages/storage/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/storage/tsconfig.json +++ b/packages/storage/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/template-types/tsconfig.json b/packages/template-types/tsconfig.json index 9a785433d90..ad532c5f58b 100644 --- a/packages/template-types/tsconfig.json +++ b/packages/template-types/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": [ - "dist/**/*" - ] + "exclude": ["dist/**/*"] } diff --git a/packages/template/package.json b/packages/template/package.json index c87d1070201..94394230b71 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -49,8 +49,8 @@ "license": "Apache-2.0", "devDependencies": { "@firebase/app": "0.10.18", - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/template/tsconfig.json b/packages/template/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/template/tsconfig.json +++ b/packages/template/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/util/package.json b/packages/util/package.json index 54389451bea..c7b182a84ec 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -45,8 +45,8 @@ "tslib": "^2.1.0" }, "devDependencies": { - "rollup": "2.79.1", - "rollup-plugin-typescript2": "0.31.2", + "rollup": "2.79.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/util/tsconfig.json b/packages/util/tsconfig.json index a06ed9a374c..4e0ae05eebc 100644 --- a/packages/util/tsconfig.json +++ b/packages/util/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 7e0e313f393..0f32eb39441 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -58,9 +58,9 @@ "devDependencies": { "@firebase/app": "0.10.18", "@rollup/plugin-json": "6.1.0", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/vertexai/rollup.config.js b/packages/vertexai/rollup.config.js index 3a1313a6bff..e93dd0319b5 100644 --- a/packages/vertexai/rollup.config.js +++ b/packages/vertexai/rollup.config.js @@ -20,6 +20,7 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; import replace from 'rollup-plugin-replace'; import typescript from 'typescript'; import pkg from './package.json'; +import tsconfig from './tsconfig.json'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; @@ -31,6 +32,7 @@ const buildPlugins = [ typescriptPlugin({ typescript, tsconfigOverride: { + exclude: [...tsconfig.exclude, '**/*.test.ts', 'test-utils'], compilerOptions: { target: 'es2017' } diff --git a/packages/vertexai/tsconfig.json b/packages/vertexai/tsconfig.json index ca3b32571f5..4e0ae05eebc 100644 --- a/packages/vertexai/tsconfig.json +++ b/packages/vertexai/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../config/tsconfig.base.json", "compilerOptions": { - "outDir": "dist", + "outDir": "dist" }, - "exclude": [ - "dist/**/*" - ] -} \ No newline at end of file + "exclude": ["dist/**/*"] +} diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index 5ab2fa18e53..07b6385ed07 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -33,10 +33,10 @@ "devDependencies": { "closure-net": "git+https://github.com/google/closure-net.git#0412666", "@rollup/plugin-commonjs": "21.1.0", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-copy": "3.5.0", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-typescript2": "0.31.2", + "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/webchannel-wrapper/tsconfig.json b/packages/webchannel-wrapper/tsconfig.json index 23e05a91330..dcb864330e7 100644 --- a/packages/webchannel-wrapper/tsconfig.json +++ b/packages/webchannel-wrapper/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "declaration": false, "outDir": "dist", - "downlevelIteration": true, + "downlevelIteration": true }, "include": ["../../node_modules/closure-net/firebase"] } diff --git a/repo-scripts/api-documenter/package.json b/repo-scripts/api-documenter/package.json index b824be66e65..66dd35f3c49 100644 --- a/repo-scripts/api-documenter/package.json +++ b/repo-scripts/api-documenter/package.json @@ -23,8 +23,8 @@ "dependencies": { "api-extractor-model-me": "0.1.1", "@microsoft/tsdoc": "0.12.24", - "@rushstack/node-core-library": "3.59.7", - "@rushstack/ts-command-line": "4.19.1", + "@rushstack/node-core-library": "3.66.1", + "@rushstack/ts-command-line": "4.23.3", "colors": "~1.4.0", "resolve": "~1.22.0", "tslib": "^2.1.0", @@ -33,7 +33,8 @@ "devDependencies": { "@types/js-yaml": "4.0.9", "@types/resolve": "1.20.6", - "mocha-chai-jest-snapshot": "1.1.3" + "jest-resolve": "29.7.0", + "mocha-chai-jest-snapshot": "1.1.6" }, "engines": { "node": ">=18.0.0" diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 14986d98c33..71095ac9787 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -18,8 +18,8 @@ }, "dependencies": { "@changesets/types": "3.3.0", - "@changesets/get-github-info": "0.5.2", - "@types/node": "18.19.57" + "@changesets/get-github-info": "0.6.0", + "@types/node": "18.19.74" }, "license": "Apache-2.0", "devDependencies": { diff --git a/repo-scripts/prune-dts/package.json b/repo-scripts/prune-dts/package.json index 8b1128b29b0..7a0890b00e2 100644 --- a/repo-scripts/prune-dts/package.json +++ b/repo-scripts/prune-dts/package.json @@ -13,9 +13,9 @@ }, "license": "Apache-2.0", "dependencies": { - "eslint": "8.56.0", + "eslint": "8.57.1", "eslint-plugin-unused-imports": "3.2.0", - "prettier": "2.8.7" + "prettier": "2.8.8" }, "repository": { "directory": "repo-scripts/prune-dts", @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/eslint": "7.29.0", - "@types/prettier": "2.7.2", + "@types/prettier": "2.7.3", "mocha": "9.2.2" } } diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 62daf7689dd..80d5500216e 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -32,11 +32,11 @@ "glob": "7.2.3", "gzip-size": "6.0.0", "memfs": "3.5.3", - "rollup": "2.79.1", + "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", - "rollup-plugin-typescript2": "0.31.2", - "terser": "5.16.1", - "tmp": "0.2.1", + "rollup-plugin-typescript2": "0.36.0", + "terser": "5.37.0", + "tmp": "0.2.3", "typescript": "5.5.4", "webpack": "5.97.1", "webpack-virtual-modules": "0.6.2", diff --git a/scripts/build/rollup_emit_module_package_file.js b/scripts/build/rollup_emit_module_package_file.js index 626d984fc62..aad6be959c6 100644 --- a/scripts/build/rollup_emit_module_package_file.js +++ b/scripts/build/rollup_emit_module_package_file.js @@ -26,7 +26,7 @@ */ export function emitModulePackageFile() { return { - generateBundle() { + generateBundle(options) { this.emitFile({ fileName: 'package.json', source: `{"type":"module"}`, diff --git a/yarn.lock b/yarn.lock index 23fe358deb4..e240303fd0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,46 +3,24 @@ "@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + version "2.3.0" + resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" "@apidevtools/json-schema-ref-parser@^9.0.3": - version "9.0.9" - resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz" - integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w== + version "9.1.2" + resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz#8ff5386b365d4c9faa7c8b566ff16a46a577d9b8" + integrity sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg== dependencies: "@jsdevtools/ono" "^7.1.3" "@types/json-schema" "^7.0.6" call-me-maybe "^1.0.1" js-yaml "^4.1.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/code-frame@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== - dependencies: - "@babel/highlight" "^7.22.5" - -"@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.1": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" - integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== - dependencies: - "@babel/highlight" "^7.24.2" - picocolors "^1.0.0" - -"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.2": version "7.26.2" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== @@ -51,83 +29,33 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== - -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": - version "7.22.9" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz" - integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== - -"@babel/compat-data@^7.26.0", "@babel/compat-data@^7.26.5": +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.26.5": version "7.26.5" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz#df93ac37f4417854130e21d72c66ff3d4b897fc7" integrity sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg== -"@babel/core@7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== +"@babel/core@7.26.7", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.7.5": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz#0439347a183b97534d52811144d763a17f9d2b24" + integrity sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.5" + "@babel/helper-compilation-targets" "^7.26.5" "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" + "@babel/helpers" "^7.26.7" + "@babel/parser" "^7.26.7" "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" + "@babel/traverse" "^7.26.7" + "@babel/types" "^7.26.7" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.15.5" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== - dependencies: - "@babel/types" "^7.15.4" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz#e67e06f68568a4ebf194d1c6014235344f0476d0" - integrity sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A== - dependencies: - "@babel/types" "^7.24.0" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" - -"@babel/generator@^7.26.0", "@babel/generator@^7.26.5": +"@babel/generator@^7.26.5", "@babel/generator@^7.7.2": version "7.26.5" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz#e44d4ab3176bbcaf78a5725da5f1dc28802a9458" integrity sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw== @@ -138,13 +66,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== - dependencies: - "@babel/types" "^7.18.6" - "@babel/helper-annotate-as-pure@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" @@ -152,28 +73,7 @@ dependencies: "@babel/types" "^7.25.9" -"@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.22.6": - version "7.22.10" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz" - integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q== - dependencies: - "@babel/compat-data" "^7.22.9" - "@babel/helper-validator-option" "^7.22.5" - browserslist "^4.21.9" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-compilation-targets@^7.25.9": +"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9", "@babel/helper-compilation-targets@^7.26.5": version "7.26.5" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== @@ -197,15 +97,7 @@ "@babel/traverse" "^7.25.9" semver "^6.3.1" -"@babel/helper-create-regexp-features-plugin@^7.18.6": - version "7.19.0" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz" - integrity sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.1.0" - -"@babel/helper-create-regexp-features-plugin@^7.25.9": +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": version "7.26.3" resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== @@ -214,10 +106,10 @@ regexpu-core "^6.2.0" semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.6.2": - version "0.6.2" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz#18594f789c3594acb24cfdb4a7f7b7d2e8bd912d" - integrity sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ== +"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": + version "0.6.3" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== dependencies: "@babel/helper-compilation-targets" "^7.22.6" "@babel/helper-plugin-utils" "^7.22.5" @@ -225,33 +117,6 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== - dependencies: - "@babel/types" "^7.15.4" - "@babel/helper-member-expression-to-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" @@ -260,13 +125,6 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== - dependencies: - "@babel/types" "^7.15.4" - "@babel/helper-module-imports@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" @@ -275,20 +133,6 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== - dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - "@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" @@ -298,13 +142,6 @@ "@babel/helper-validator-identifier" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== - dependencies: - "@babel/types" "^7.15.4" - "@babel/helper-optimise-call-expression@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" @@ -312,22 +149,7 @@ dependencies: "@babel/types" "^7.25.9" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-plugin-utils@^7.18.6": - version "7.19.0" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz" - integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== - -"@babel/helper-plugin-utils@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz" - integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== - -"@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.26.5": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.26.5", "@babel/helper-plugin-utils@^7.8.0": version "7.26.5" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== @@ -341,16 +163,6 @@ "@babel/helper-wrap-function" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - "@babel/helper-replace-supers@^7.25.9": version "7.26.5" resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz#6cb04e82ae291dae8e72335dfe438b0725f14c8d" @@ -360,13 +172,6 @@ "@babel/helper-optimise-call-expression" "^7.25.9" "@babel/traverse" "^7.26.5" -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== - dependencies: - "@babel/types" "^7.15.4" - "@babel/helper-skip-transparent-expression-wrappers@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" @@ -375,70 +180,16 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== - -"@babel/helper-string-parser@^7.23.4": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" - integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== - "@babel/helper-string-parser@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - "@babel/helper-validator-identifier@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== - "@babel/helper-validator-option@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" @@ -453,67 +204,20 @@ "@babel/traverse" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== - dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helpers@^7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" - integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== +"@babel/helpers@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.7.tgz#fd1d2a7c431b6e39290277aacfd8367857c576a4" + integrity sha512-8NHiL98vsi0mbPQmYAGWwfcFaOy4j2HY49fXJCfuDcdE7fMIsH9a7GdaeXpIBsbT7307WU8KCMp5pUVDNL4f9A== dependencies: "@babel/template" "^7.25.9" - "@babel/types" "^7.26.0" - -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.24.2": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz#3f539503efc83d3c59080a10e6634306e0370d26" - integrity sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": - version "7.15.7" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== - -"@babel/parser@^7.24.0", "@babel/parser@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" - integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== + "@babel/types" "^7.26.7" -"@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.5.tgz#6fec9aebddef25ca57a935c86dbb915ae2da3e1f" - integrity sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw== +"@babel/parser@^7.14.7", "@babel/parser@^7.25.9", "@babel/parser@^7.26.5", "@babel/parser@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz#e114cd099e5f7d17b05368678da0fb9f69b3385c" + integrity sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w== dependencies: - "@babel/types" "^7.26.5" + "@babel/types" "^7.26.7" "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" @@ -556,30 +260,37 @@ "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-bigint@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-import-assertions@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" @@ -587,100 +298,100 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-attributes@^7.26.0": +"@babel/plugin-syntax-import-attributes@^7.24.7", "@babel/plugin-syntax-import-attributes@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.25.9": +"@babel/plugin-syntax-jsx@^7.25.9", "@babel/plugin-syntax-jsx@^7.7.2": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.25.9": +"@babel/plugin-syntax-typescript@^7.25.9", "@babel/plugin-syntax-typescript@^7.7.2": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" @@ -711,7 +422,7 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.25.9": +"@babel/plugin-transform-block-scoped-functions@^7.26.5": version "7.26.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== @@ -798,7 +509,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.25.9": +"@babel/plugin-transform-exponentiation-operator@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== @@ -865,7 +576,7 @@ "@babel/helper-module-transforms" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@7.26.3", "@babel/plugin-transform-modules-commonjs@^7.25.9": +"@babel/plugin-transform-modules-commonjs@7.26.3", "@babel/plugin-transform-modules-commonjs@^7.25.9", "@babel/plugin-transform-modules-commonjs@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== @@ -906,7 +617,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": +"@babel/plugin-transform-nullish-coalescing-operator@^7.26.6": version "7.26.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== @@ -1035,17 +746,17 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" - integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== +"@babel/plugin-transform-typeof-symbol@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz#d0e33acd9223744c1e857dbd6fa17bd0a3786937" + integrity sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typescript@^7.25.9": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.5.tgz#6d9b48e8ee40a45a3ed12ebc013449fdf261714c" - integrity sha512-GJhPO0y8SD5EYVCy2Zr+9dSZcEgaSmq5BLR0Oc25TOEhC+ba49vUAGZFjy8v79z9E1mdldq4x9d1xgh4L1d5dQ== + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.7.tgz#64339515ea3eff610160f62499c3ef437d0ac83d" + integrity sha512-5cJurntg+AT+cgelGP9Bt788DKiAw9gIMSMU2NJrLAilnj0m8WZWUNZPSLOmadYsujHutpgElO+50foX+ib/Wg== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" "@babel/helper-create-class-features-plugin" "^7.25.9" @@ -1084,14 +795,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" - integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== +"@babel/preset-env@7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.7.tgz#24d38e211f4570b8d806337035cc3ae798e0c36d" + integrity sha512-Ycg2tnXwixaXOVb29rana8HNPgLVBof8qqtNQ9LE22IoyZboQbGSxI6ZySMdW3K5nAe6gu35IaJefUJflhUFTQ== dependencies: - "@babel/compat-data" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/compat-data" "^7.26.5" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-validator-option" "^7.25.9" "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" @@ -1105,7 +816,7 @@ "@babel/plugin-transform-arrow-functions" "^7.25.9" "@babel/plugin-transform-async-generator-functions" "^7.25.9" "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.26.5" "@babel/plugin-transform-block-scoping" "^7.25.9" "@babel/plugin-transform-class-properties" "^7.25.9" "@babel/plugin-transform-class-static-block" "^7.26.0" @@ -1116,7 +827,7 @@ "@babel/plugin-transform-duplicate-keys" "^7.25.9" "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.26.3" "@babel/plugin-transform-export-namespace-from" "^7.25.9" "@babel/plugin-transform-for-of" "^7.25.9" "@babel/plugin-transform-function-name" "^7.25.9" @@ -1125,12 +836,12 @@ "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" "@babel/plugin-transform-member-expression-literals" "^7.25.9" "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.26.3" "@babel/plugin-transform-modules-systemjs" "^7.25.9" "@babel/plugin-transform-modules-umd" "^7.25.9" "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.26.6" "@babel/plugin-transform-numeric-separator" "^7.25.9" "@babel/plugin-transform-object-rest-spread" "^7.25.9" "@babel/plugin-transform-object-super" "^7.25.9" @@ -1147,7 +858,7 @@ "@babel/plugin-transform-spread" "^7.25.9" "@babel/plugin-transform-sticky-regex" "^7.25.9" "@babel/plugin-transform-template-literals" "^7.25.9" - "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.26.7" "@babel/plugin-transform-unicode-escapes" "^7.25.9" "@babel/plugin-transform-unicode-property-regex" "^7.25.9" "@babel/plugin-transform-unicode-regex" "^7.25.9" @@ -1161,7 +872,7 @@ "@babel/preset-modules@0.1.6-no-external-plugins": version "0.1.6-no-external-plugins" - resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz" + resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -1191,29 +902,11 @@ source-map-support "^0.5.16" "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz" - integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.7.tgz#f4e7fe527cd710f8dc0618610b61b4b060c3c341" + integrity sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ== dependencies: - regenerator-runtime "^0.13.4" - -"@babel/template@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/template@^7.22.15": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" - integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/parser" "^7.24.0" - "@babel/types" "^7.24.0" + regenerator-runtime "^0.14.0" "@babel/template@^7.25.9": version "7.25.9" @@ -1224,91 +917,36 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz#d65c36ac9dd17282175d1e4a3c49d5b7988f530c" - integrity sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ== - dependencies: - "@babel/code-frame" "^7.24.1" - "@babel/generator" "^7.24.1" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.24.1" - "@babel/types" "^7.24.0" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.5.tgz#6d0be3e772ff786456c1a37538208286f6e79021" - integrity sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ== +"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.5", "@babel/traverse@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz#99a0a136f6a75e7fb8b0a1ace421e0b25994b8bb" + integrity sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA== dependencies: "@babel/code-frame" "^7.26.2" "@babel/generator" "^7.26.5" - "@babel/parser" "^7.26.5" + "@babel/parser" "^7.26.7" "@babel/template" "^7.25.9" - "@babel/types" "^7.26.5" + "@babel/types" "^7.26.7" debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz#d5ea892c07f2ec371ac704420f4dcdb07b5f9598" - integrity sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw== - dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - -"@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.4.4": - version "7.15.6" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== - dependencies: - "@babel/helper-validator-identifier" "^7.14.9" - to-fast-properties "^2.0.0" - -"@babel/types@^7.18.6": - version "7.19.4" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.19.4.tgz" - integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@babel/types@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz" - integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== - dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" - to-fast-properties "^2.0.0" - -"@babel/types@^7.23.0", "@babel/types@^7.24.0": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" - integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== - dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - -"@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz#7a1e1c01d28e26d1fe7f8ec9567b3b92b9d07747" - integrity sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg== +"@babel/types@^7.25.9", "@babel/types@^7.26.5", "@babel/types@^7.26.7", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz#5e2b89c0768e874d4d061961f3a5a153d71dc17a" + integrity sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg== dependencies: "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@changesets/apply-release-plan@^7.0.7": - version "7.0.7" - resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.7.tgz#cabeaed77de07c6bd9878a9bc5ffd3ea7db7f7ff" - integrity sha512-qnPOcmmmnD0MfMg9DjU1/onORFyRpDXkMMl2IJg9mECY6RnxL3wN0TCCc92b2sXt1jt8DgjAUUsZYGUGTdYIXA== +"@bazel/runfiles@^6.3.1": + version "6.3.1" + resolved "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz#3f8824b2d82853377799d42354b4df78ab0ace0b" + integrity sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA== + +"@changesets/apply-release-plan@^7.0.8": + version "7.0.8" + resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.8.tgz#9cfd46036789ad433fd855f34d41cd9ca1658aa0" + integrity sha512-qjMUj4DYQ1Z6qHawsn7S71SujrExJ+nceyKKyI9iB+M5p9lCL55afuEd6uLBPRpLGWQwkwvWegDHtwHJb1UjpA== dependencies: "@changesets/config" "^3.0.5" "@changesets/get-version-range-type" "^0.4.0" @@ -1352,12 +990,12 @@ "@changesets/types" "^6.0.0" dotenv "^8.1.0" -"@changesets/cli@2.27.11": - version "2.27.11" - resolved "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.11.tgz#1d510044b350a7c78a8b55a0591637d7ad224469" - integrity sha512-1QislpE+nvJgSZZo9+Lj3Lno5pKBgN46dAV8IVxKJy9wX8AOrs9nn5pYVZuDpoxWJJCALmbfOsHkyxujgetQSg== +"@changesets/cli@2.27.12": + version "2.27.12" + resolved "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.12.tgz#1df106605ce243c21b180254dd658adbfba4e5b6" + integrity sha512-9o3fOfHYOvBnyEn0mcahB7wzaA3P4bGJf8PNqGit5PKaMEFdsRixik+txkrJWd2VX+O6wRFXpxQL8j/1ANKE9g== dependencies: - "@changesets/apply-release-plan" "^7.0.7" + "@changesets/apply-release-plan" "^7.0.8" "@changesets/assemble-release-plan" "^6.0.5" "@changesets/changelog-git" "^0.2.0" "@changesets/config" "^3.0.5" @@ -1416,15 +1054,7 @@ picocolors "^1.1.0" semver "^7.5.3" -"@changesets/get-github-info@0.5.2": - version "0.5.2" - resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz" - integrity sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg== - dependencies: - dataloader "^1.4.0" - node-fetch "^2.5.0" - -"@changesets/get-github-info@^0.6.0": +"@changesets/get-github-info@0.6.0", "@changesets/get-github-info@^0.6.0": version "0.6.0" resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz#faba66a20a3a5a0cbabea28efd43c9ede7429f11" integrity sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA== @@ -1508,13 +1138,13 @@ "@changesets/types@3.3.0": version "3.3.0" - resolved "https://registry.npmjs.org/@changesets/types/-/types-3.3.0.tgz" + resolved "https://registry.npmjs.org/@changesets/types/-/types-3.3.0.tgz#04cd8184b2d2da760667bd89bf9b930938dbd96e" integrity sha512-rJamRo+OD/MQekImfIk07JZwYSB18iU6fYL8xOg0gfAiTh1a1+OlR1fPIxm55I7RsWw812is2YcPPwXdIewrhA== "@changesets/types@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@changesets/types/-/types-4.0.1.tgz" - integrity sha512-zVfv752D8K2tjyFmxU/vnntQ+dPu+9NupOSguA/2Zuym4tVxRh0ylArgKZ1bOAi2eXfGlZMxJU/kj7uCSI15RQ== + version "4.1.0" + resolved "https://registry.npmjs.org/@changesets/types/-/types-4.1.0.tgz#fb8f7ca2324fd54954824e864f9a61a82cb78fe0" + integrity sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw== "@changesets/types@^6.0.0": version "6.0.0" @@ -1533,20 +1163,25 @@ "@colors/colors@1.5.0": version "1.5.0" - resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz" + resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@colors/colors@1.6.0", "@colors/colors@^1.6.0": + version "1.6.0" + resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0" + integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA== + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" - resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@dabh/diagnostics@^2.0.2": - version "2.0.2" - resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz" - integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== + version "2.0.3" + resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" + integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA== dependencies: colorspace "1.1.x" enabled "2.0.x" @@ -1558,16 +1193,16 @@ integrity sha512-dCSHpoOKuTxecaYhWDRp2yFTN3XWcMPMrBVl5yOR8VZEUprz4+R3iuU7BipmlsqBnBDO/6l9H/C2ZwJdunkWyw== "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": - version "4.4.0" - resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + version "4.4.1" + resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz#d1145bf2c20132d6400495d6df4bf59362fd9d56" + integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== dependencies: - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.3" "@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.6.1": - version "4.11.0" - resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" - integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== + version "4.12.1" + resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== "@eslint/eslintrc@^2.1.4": version "2.1.4" @@ -1584,24 +1219,14 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.56.0": - version "8.56.0" - resolved "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" - integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== - "@eslint/js@8.57.1": version "8.57.1" resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2" integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== "@gar/promisify@^1.0.1": - version "1.1.2" - resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz" - integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== - -"@gar/promisify@^1.1.3": version "1.1.3" - resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" + resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== "@google-cloud/cloud-sql-connector@^1.3.3": @@ -1673,14 +1298,14 @@ "@js-sdsl/ordered-map" "^4.4.2" "@grpc/grpc-js@~1.9.0": - version "1.9.1" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.1.tgz" - integrity sha512-AvDEPQT4teS+J8++cTE5tku4rYCwpPwPguESJUummLs/Ug/O5Bouofnc1mxaDORmwA9QkrJ+PfRQ1Qs7adQgJg== + version "1.9.15" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz#433d7ac19b1754af690ea650ab72190bd700739b" + integrity sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ== dependencies: "@grpc/proto-loader" "^0.7.8" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.7.13": +"@grpc/proto-loader@^0.7.13", "@grpc/proto-loader@^0.7.8": version "0.7.13" resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== @@ -1690,19 +1315,9 @@ protobufjs "^7.2.5" yargs "^17.7.2" -"@grpc/proto-loader@^0.7.8": - version "0.7.10" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz" - integrity sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ== - dependencies: - lodash.camelcase "^4.3.0" - long "^5.0.0" - protobufjs "^7.2.4" - yargs "^17.7.2" - "@gulp-sourcemaps/identity-map@^2.0.1": version "2.0.1" - resolved "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz" + resolved "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz#a6e8b1abec8f790ec6be2b8c500e6e68037c0019" integrity sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q== dependencies: acorn "^6.4.1" @@ -1713,21 +1328,12 @@ "@gulp-sourcemaps/map-sources@^1.0.0": version "1.0.0" - resolved "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz" - integrity sha1-iQrnxdjId/bThIYCFazp1+yUW9o= + resolved "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz#890ae7c5d8c877f6d384860215ace9d7ec945bda" + integrity sha512-o/EatdaGt8+x2qpb0vFLC/2Gug/xYPRXb6a+ET1wGYKozKN3krDWC/zZFZAtrzxJHuDL12mwdfEFKcKMNvc55A== dependencies: normalize-path "^2.0.1" through2 "^2.0.3" -"@humanwhocodes/config-array@^0.11.13": - version "0.11.14" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - debug "^4.3.1" - minimatch "^3.0.5" - "@humanwhocodes/config-array@^0.13.0": version "0.13.0" resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" @@ -1742,14 +1348,14 @@ resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2", "@humanwhocodes/object-schema@^2.0.3": +"@humanwhocodes/object-schema@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== "@hutson/parse-repository-url@^3.0.0": version "3.0.2" - resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz" + resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== "@isaacs/cliui@^8.0.2": @@ -1766,7 +1372,7 @@ "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" + resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== dependencies: camelcase "^5.3.1" @@ -1777,109 +1383,97 @@ "@istanbuljs/schema@^0.1.2": version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" + resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.0": - version "27.2.0" - resolved "https://registry.npmjs.org/@jest/console/-/console-27.2.0.tgz" - integrity sha512-35z+RqsK2CCgNxn+lWyK8X4KkaDtfL4BggT7oeZ0JffIiAiEYFYPo5B67V50ZubqDS1ehBrdCR2jduFnIrZOYw== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.0" - jest-util "^27.2.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/test-result@^27.0.6": - version "27.2.0" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-27.2.0.tgz" - integrity sha512-JPPqn8h0RGr4HyeY1Km+FivDIjTFzDROU46iAvzVjD42ooGwYoqYO/MQTilhfajdz6jpVnnphFrKZI5OYrBONA== +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: - "@jest/console" "^27.2.0" - "@jest/types" "^27.1.1" + "@sinclair/typebox" "^0.27.8" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/transform@^27.2.1": - version "27.2.1" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-27.2.1.tgz" - integrity sha512-xmB5vh81KK8DiiCMtI5vI59mP+GggNmc9BiN+fg4mKdQHV369+WuZc1Lq2xWFCOCsRPHt24D9h7Idp4YaMB1Ww== +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.1.1" - babel-plugin-istanbul "^6.0.0" + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" - jest-regex-util "^27.0.6" - jest-util "^27.2.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" micromatch "^4.0.4" - pirates "^4.0.1" + pirates "^4.0.4" slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" + write-file-atomic "^4.0.2" -"@jest/types@^27.1.1": - version "27.1.1" - resolved "https://registry.npmjs.org/@jest/types/-/types-27.1.1.tgz" - integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: + "@jest/schemas" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^16.0.0" + "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0": - version "0.3.2" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== - dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - "@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + version "0.3.8" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" + integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== dependencies: "@jridgewell/set-array" "^1.2.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.5" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz" - integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== - -"@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - "@jridgewell/set-array@^1.2.1": version "1.2.1" resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - "@jridgewell/source-map@^0.3.3": version "0.3.6" resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" @@ -1888,25 +1482,20 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.11" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz" - integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== - -"@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": - version "1.4.15" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.0" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -1914,14 +1503,6 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@js-sdsl/ordered-map@^4.4.2": version "4.4.2" resolved "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" @@ -1929,24 +1510,24 @@ "@jsdevtools/ono@^7.1.3": version "7.1.3" - resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" + resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== "@kwsites/file-exists@^1.1.1": version "1.1.1" - resolved "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz" + resolved "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99" integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw== dependencies: debug "^4.1.1" "@kwsites/promise-deferred@^1.1.1": version "1.1.1" - resolved "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz" + resolved "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919" integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw== "@lerna/add@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" integrity sha512-cpmAH1iS3k8JBxNvnMqrGTTjbY/ZAiKa1ChJzFevMYY3eeqbvhsBKnBcxjRXtdrJ6bd3dCQM+ZtK+0i682Fhng== dependencies: "@lerna/bootstrap" "4.0.0" @@ -1962,7 +1543,7 @@ "@lerna/bootstrap@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-4.0.0.tgz#5f5c5e2c6cfc8fcec50cb2fbe569a8c607101891" integrity sha512-RkS7UbeM2vu+kJnHzxNRCLvoOP9yGNgkzRdy4UV2hNalD7EP41bLvRVOwRYQ7fhc2QcbhnKNdOBihYRL0LcKtw== dependencies: "@lerna/command" "4.0.0" @@ -1990,7 +1571,7 @@ "@lerna/changed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/changed/-/changed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/changed/-/changed-4.0.0.tgz#b9fc76cea39b9292a6cd263f03eb57af85c9270b" integrity sha512-cD+KuPRp6qiPOD+BO6S6SN5cARspIaWSOqGBpGnYzLb4uWT8Vk4JzKyYtc8ym1DIwyoFXHosXt8+GDAgR8QrgQ== dependencies: "@lerna/collect-updates" "4.0.0" @@ -2000,7 +1581,7 @@ "@lerna/check-working-tree@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-4.0.0.tgz#257e36a602c00142e76082a19358e3e1ae8dbd58" integrity sha512-/++bxM43jYJCshBiKP5cRlCTwSJdRSxVmcDAXM+1oUewlZJVSVlnks5eO0uLxokVFvLhHlC5kHMc7gbVFPHv6Q== dependencies: "@lerna/collect-uncommitted" "4.0.0" @@ -2009,7 +1590,7 @@ "@lerna/child-process@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-4.0.0.tgz#341b96a57dffbd9705646d316e231df6fa4df6e1" integrity sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q== dependencies: chalk "^4.1.0" @@ -2018,7 +1599,7 @@ "@lerna/clean@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/clean/-/clean-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/clean/-/clean-4.0.0.tgz#8f778b6f2617aa2a936a6b5e085ae62498e57dc5" integrity sha512-uugG2iN9k45ITx2jtd8nEOoAtca8hNlDCUM0N3lFgU/b1mEQYAPRkqr1qs4FLRl/Y50ZJ41wUz1eazS+d/0osA== dependencies: "@lerna/command" "4.0.0" @@ -2032,7 +1613,7 @@ "@lerna/cli@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/cli/-/cli-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/cli/-/cli-4.0.0.tgz#8eabd334558836c1664df23f19acb95e98b5bbf3" integrity sha512-Neaw3GzFrwZiRZv2g7g6NwFjs3er1vhraIniEs0jjVLPMNC4eata0na3GfE5yibkM/9d3gZdmihhZdZ3EBdvYA== dependencies: "@lerna/global-options" "4.0.0" @@ -2042,7 +1623,7 @@ "@lerna/collect-uncommitted@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-4.0.0.tgz#855cd64612969371cfc2453b90593053ff1ba779" integrity sha512-ufSTfHZzbx69YNj7KXQ3o66V4RC76ffOjwLX0q/ab//61bObJ41n03SiQEhSlmpP+gmFbTJ3/7pTe04AHX9m/g== dependencies: "@lerna/child-process" "4.0.0" @@ -2051,7 +1632,7 @@ "@lerna/collect-updates@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-4.0.0.tgz#8e208b1bafd98a372ff1177f7a5e288f6bea8041" integrity sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw== dependencies: "@lerna/child-process" "4.0.0" @@ -2062,7 +1643,7 @@ "@lerna/command@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/command/-/command-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/command/-/command-4.0.0.tgz#991c7971df8f5bf6ae6e42c808869a55361c1b98" integrity sha512-LM9g3rt5FsPNFqIHUeRwWXLNHJ5NKzOwmVKZ8anSp4e1SPrv2HNc1V02/9QyDDZK/w+5POXH5lxZUI1CHaOK/A== dependencies: "@lerna/child-process" "4.0.0" @@ -2078,7 +1659,7 @@ "@lerna/conventional-commits@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-4.0.0.tgz#660fb2c7b718cb942ead70110df61f18c6f99750" integrity sha512-CSUQRjJHFrH8eBn7+wegZLV3OrNc0Y1FehYfYGhjLE2SIfpCL4bmfu/ViYuHh9YjwHaA+4SX6d3hR+xkeseKmw== dependencies: "@lerna/validation-error" "4.0.0" @@ -2095,7 +1676,7 @@ "@lerna/create-symlink@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-4.0.0.tgz#8c5317ce5ae89f67825443bd7651bf4121786228" integrity sha512-I0phtKJJdafUiDwm7BBlEUOtogmu8+taxq6PtIrxZbllV9hWg59qkpuIsiFp+no7nfRVuaasNYHwNUhDAVQBig== dependencies: cmd-shim "^4.1.0" @@ -2104,7 +1685,7 @@ "@lerna/create@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/create/-/create-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/create/-/create-4.0.0.tgz#b6947e9b5dfb6530321952998948c3e63d64d730" integrity sha512-mVOB1niKByEUfxlbKTM1UNECWAjwUdiioIbRQZEeEabtjCL69r9rscIsjlGyhGWCfsdAG5wfq4t47nlDXdLLag== dependencies: "@lerna/child-process" "4.0.0" @@ -2128,7 +1709,7 @@ "@lerna/describe-ref@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-4.0.0.tgz#53c53b4ea65fdceffa072a62bfebe6772c45d9ec" integrity sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ== dependencies: "@lerna/child-process" "4.0.0" @@ -2136,7 +1717,7 @@ "@lerna/diff@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/diff/-/diff-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/diff/-/diff-4.0.0.tgz#6d3071817aaa4205a07bf77cfc6e932796d48b92" integrity sha512-jYPKprQVg41+MUMxx6cwtqsNm0Yxx9GDEwdiPLwcUTFx+/qKCEwifKNJ1oGIPBxyEHX2PFCOjkK39lHoj2qiag== dependencies: "@lerna/child-process" "4.0.0" @@ -2146,7 +1727,7 @@ "@lerna/exec@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/exec/-/exec-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/exec/-/exec-4.0.0.tgz#eb6cb95cb92d42590e9e2d628fcaf4719d4a8be6" integrity sha512-VGXtL/b/JfY84NB98VWZpIExfhLOzy0ozm/0XaS4a2SmkAJc5CeUfrhvHxxkxiTBLkU+iVQUyYEoAT0ulQ8PCw== dependencies: "@lerna/child-process" "4.0.0" @@ -2159,7 +1740,7 @@ "@lerna/filter-options@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-4.0.0.tgz#ac94cc515d7fa3b47e2f7d74deddeabb1de5e9e6" integrity sha512-vV2ANOeZhOqM0rzXnYcFFCJ/kBWy/3OA58irXih9AMTAlQLymWAK0akWybl++sUJ4HB9Hx12TOqaXbYS2NM5uw== dependencies: "@lerna/collect-updates" "4.0.0" @@ -2169,7 +1750,7 @@ "@lerna/filter-packages@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-4.0.0.tgz#b1f70d70e1de9cdd36a4e50caa0ac501f8d012f2" integrity sha512-+4AJIkK7iIiOaqCiVTYJxh/I9qikk4XjNQLhE3kixaqgMuHl1NQ99qXRR0OZqAWB9mh8Z1HA9bM5K1HZLBTOqA== dependencies: "@lerna/validation-error" "4.0.0" @@ -2178,14 +1759,14 @@ "@lerna/get-npm-exec-opts@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-4.0.0.tgz#dc955be94a4ae75c374ef9bce91320887d34608f" integrity sha512-yvmkerU31CTWS2c7DvmAWmZVeclPBqI7gPVr5VATUKNWJ/zmVcU4PqbYoLu92I9Qc4gY1TuUplMNdNuZTSL7IQ== dependencies: npmlog "^4.1.2" "@lerna/get-packed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-4.0.0.tgz#0989d61624ac1f97e393bdad2137c49cd7a37823" integrity sha512-rfWONRsEIGyPJTxFzC8ECb3ZbsDXJbfqWYyeeQQDrJRPnEJErlltRLPLgC2QWbxFgFPsoDLeQmFHJnf0iDfd8w== dependencies: fs-extra "^9.1.0" @@ -2194,7 +1775,7 @@ "@lerna/github-client@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/github-client/-/github-client-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/github-client/-/github-client-4.0.0.tgz#2ced67721363ef70f8e12ffafce4410918f4a8a4" integrity sha512-2jhsldZtTKXYUBnOm23Lb0Fx8G4qfSXF9y7UpyUgWUj+YZYd+cFxSuorwQIgk5P4XXrtVhsUesIsli+BYSThiw== dependencies: "@lerna/child-process" "4.0.0" @@ -2205,7 +1786,7 @@ "@lerna/gitlab-client@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-4.0.0.tgz#00dad73379c7b38951d4b4ded043504c14e2b67d" integrity sha512-OMUpGSkeDWFf7BxGHlkbb35T7YHqVFCwBPSIR6wRsszY8PAzCYahtH3IaJzEJyUg6vmZsNl0FSr3pdA2skhxqA== dependencies: node-fetch "^2.6.1" @@ -2214,12 +1795,12 @@ "@lerna/global-options@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/global-options/-/global-options-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/global-options/-/global-options-4.0.0.tgz#c7d8b0de6a01d8a845e2621ea89e7f60f18c6a5f" integrity sha512-TRMR8afAHxuYBHK7F++Ogop2a82xQjoGna1dvPOY6ltj/pEx59pdgcJfYcynYqMkFIk8bhLJJN9/ndIfX29FTQ== "@lerna/has-npm-version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-4.0.0.tgz#d3fc3292c545eb28bd493b36e6237cf0279f631c" integrity sha512-LQ3U6XFH8ZmLCsvsgq1zNDqka0Xzjq5ibVN+igAI5ccRWNaUsE/OcmsyMr50xAtNQMYMzmpw5GVLAivT2/YzCg== dependencies: "@lerna/child-process" "4.0.0" @@ -2227,7 +1808,7 @@ "@lerna/import@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/import/-/import-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/import/-/import-4.0.0.tgz#bde656c4a451fa87ae41733ff8a8da60547c5465" integrity sha512-FaIhd+4aiBousKNqC7TX1Uhe97eNKf5/SC7c5WZANVWtC7aBWdmswwDt3usrzCNpj6/Wwr9EtEbYROzxKH8ffg== dependencies: "@lerna/child-process" "4.0.0" @@ -2241,7 +1822,7 @@ "@lerna/info@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/info/-/info-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/info/-/info-4.0.0.tgz#b9fb0e479d60efe1623603958a831a88b1d7f1fc" integrity sha512-8Uboa12kaCSZEn4XRfPz5KU9XXoexSPS4oeYGj76s2UQb1O1GdnEyfjyNWoUl1KlJ2i/8nxUskpXIftoFYH0/Q== dependencies: "@lerna/command" "4.0.0" @@ -2250,7 +1831,7 @@ "@lerna/init@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/init/-/init-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/init/-/init-4.0.0.tgz#dadff67e6dfb981e8ccbe0e6a310e837962f6c7a" integrity sha512-wY6kygop0BCXupzWj5eLvTUqdR7vIAm0OgyV9WHpMYQGfs1V22jhztt8mtjCloD/O0nEe4tJhdG62XU5aYmPNQ== dependencies: "@lerna/child-process" "4.0.0" @@ -2261,7 +1842,7 @@ "@lerna/link@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/link/-/link-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/link/-/link-4.0.0.tgz#c3a38aabd44279d714e90f2451e31b63f0fb65ba" integrity sha512-KlvPi7XTAcVOByfaLlOeYOfkkDcd+bejpHMCd1KcArcFTwijOwXOVi24DYomIeHvy6HsX/IUquJ4PPUJIeB4+w== dependencies: "@lerna/command" "4.0.0" @@ -2272,7 +1853,7 @@ "@lerna/list@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/list/-/list-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/list/-/list-4.0.0.tgz#24b4e6995bd73f81c556793fe502b847efd9d1d7" integrity sha512-L2B5m3P+U4Bif5PultR4TI+KtW+SArwq1i75QZ78mRYxPc0U/piau1DbLOmwrdqr99wzM49t0Dlvl6twd7GHFg== dependencies: "@lerna/command" "4.0.0" @@ -2282,7 +1863,7 @@ "@lerna/listable@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/listable/-/listable-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/listable/-/listable-4.0.0.tgz#d00d6cb4809b403f2b0374fc521a78e318b01214" integrity sha512-/rPOSDKsOHs5/PBLINZOkRIX1joOXUXEtyUs5DHLM8q6/RP668x/1lFhw6Dx7/U+L0+tbkpGtZ1Yt0LewCLgeQ== dependencies: "@lerna/query-graph" "4.0.0" @@ -2291,7 +1872,7 @@ "@lerna/log-packed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-4.0.0.tgz#95168fe2e26ac6a71e42f4be857519b77e57a09f" integrity sha512-+dpCiWbdzgMAtpajLToy9PO713IHoE6GV/aizXycAyA07QlqnkpaBNZ8DW84gHdM1j79TWockGJo9PybVhrrZQ== dependencies: byte-size "^7.0.0" @@ -2301,7 +1882,7 @@ "@lerna/npm-conf@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-4.0.0.tgz#b259fd1e1cee2bf5402b236e770140ff9ade7fd2" integrity sha512-uS7H02yQNq3oejgjxAxqq/jhwGEE0W0ntr8vM3EfpCW1F/wZruwQw+7bleJQ9vUBjmdXST//tk8mXzr5+JXCfw== dependencies: config-chain "^1.1.12" @@ -2309,7 +1890,7 @@ "@lerna/npm-dist-tag@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-4.0.0.tgz#d1e99b4eccd3414142f0548ad331bf2d53f3257a" integrity sha512-F20sg28FMYTgXqEQihgoqSfwmq+Id3zT23CnOwD+XQMPSy9IzyLf1fFVH319vXIw6NF6Pgs4JZN2Qty6/CQXGw== dependencies: "@lerna/otplease" "4.0.0" @@ -2319,7 +1900,7 @@ "@lerna/npm-install@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-4.0.0.tgz#31180be3ab3b7d1818a1a0c206aec156b7094c78" integrity sha512-aKNxq2j3bCH3eXl3Fmu4D54s/YLL9WSwV8W7X2O25r98wzrO38AUN6AB9EtmAx+LV/SP15et7Yueg9vSaanRWg== dependencies: "@lerna/child-process" "4.0.0" @@ -2332,7 +1913,7 @@ "@lerna/npm-publish@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-4.0.0.tgz#84eb62e876fe949ae1fd62c60804423dbc2c4472" integrity sha512-vQb7yAPRo5G5r77DRjHITc9piR9gvEKWrmfCH7wkfBnGWEqu7n8/4bFQ7lhnkujvc8RXOsYpvbMQkNfkYibD/w== dependencies: "@lerna/otplease" "4.0.0" @@ -2346,7 +1927,7 @@ "@lerna/npm-run-script@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-4.0.0.tgz#dfebf4f4601442e7c0b5214f9fb0d96c9350743b" integrity sha512-Jmyh9/IwXJjOXqKfIgtxi0bxi1pUeKe5bD3S81tkcy+kyng/GNj9WSqD5ZggoNP2NP//s4CLDAtUYLdP7CU9rA== dependencies: "@lerna/child-process" "4.0.0" @@ -2355,21 +1936,21 @@ "@lerna/otplease@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/otplease/-/otplease-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/otplease/-/otplease-4.0.0.tgz#84972eb43448f8a1077435ba1c5e59233b725850" integrity sha512-Sgzbqdk1GH4psNiT6hk+BhjOfIr/5KhGBk86CEfHNJTk9BK4aZYyJD4lpDbDdMjIV4g03G7pYoqHzH765T4fxw== dependencies: "@lerna/prompt" "4.0.0" "@lerna/output@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/output/-/output-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/output/-/output-4.0.0.tgz#b1d72215c0e35483e4f3e9994debc82c621851f2" integrity sha512-Un1sHtO1AD7buDQrpnaYTi2EG6sLF+KOPEAMxeUYG5qG3khTs2Zgzq5WE3dt2N/bKh7naESt20JjIW6tBELP0w== dependencies: npmlog "^4.1.2" "@lerna/pack-directory@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-4.0.0.tgz#8b617db95d20792f043aaaa13a9ccc0e04cb4c74" integrity sha512-NJrmZNmBHS+5aM+T8N6FVbaKFScVqKlQFJNY2k7nsJ/uklNKsLLl6VhTQBPwMTbf6Tf7l6bcKzpy7aePuq9UiQ== dependencies: "@lerna/get-packed" "4.0.0" @@ -2382,7 +1963,7 @@ "@lerna/package-graph@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-4.0.0.tgz#16a00253a8ac810f72041481cb46bcee8d8123dd" integrity sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw== dependencies: "@lerna/prerelease-id-from-version" "4.0.0" @@ -2393,7 +1974,7 @@ "@lerna/package@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/package/-/package-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/package/-/package-4.0.0.tgz#1b4c259c4bcff45c876ee1d591a043aacbc0d6b7" integrity sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q== dependencies: load-json-file "^6.2.0" @@ -2402,14 +1983,14 @@ "@lerna/prerelease-id-from-version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz#c7e0676fcee1950d85630e108eddecdd5b48c916" integrity sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg== dependencies: semver "^7.3.4" "@lerna/profiler@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/profiler/-/profiler-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/profiler/-/profiler-4.0.0.tgz#8a53ab874522eae15d178402bff90a14071908e9" integrity sha512-/BaEbqnVh1LgW/+qz8wCuI+obzi5/vRE8nlhjPzdEzdmWmZXuCKyWSEzAyHOJWw1ntwMiww5dZHhFQABuoFz9Q== dependencies: fs-extra "^9.1.0" @@ -2418,7 +1999,7 @@ "@lerna/project@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/project/-/project-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/project/-/project-4.0.0.tgz#ff84893935833533a74deff30c0e64ddb7f0ba6b" integrity sha512-o0MlVbDkD5qRPkFKlBZsXZjoNTWPyuL58564nSfZJ6JYNmgAptnWPB2dQlAc7HWRZkmnC2fCkEdoU+jioPavbg== dependencies: "@lerna/package" "4.0.0" @@ -2436,7 +2017,7 @@ "@lerna/prompt@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/prompt/-/prompt-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/prompt/-/prompt-4.0.0.tgz#5ec69a803f3f0db0ad9f221dad64664d3daca41b" integrity sha512-4Ig46oCH1TH5M7YyTt53fT6TuaKMgqUUaqdgxvp6HP6jtdak6+amcsqB8YGz2eQnw/sdxunx84DfI9XpoLj4bQ== dependencies: inquirer "^7.3.3" @@ -2444,7 +2025,7 @@ "@lerna/publish@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/publish/-/publish-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/publish/-/publish-4.0.0.tgz#f67011305adeba120066a3b6d984a5bb5fceef65" integrity sha512-K8jpqjHrChH22qtkytA5GRKIVFEtqBF6JWj1I8dWZtHs4Jywn8yB1jQ3BAMLhqmDJjWJtRck0KXhQQKzDK2UPg== dependencies: "@lerna/check-working-tree" "4.0.0" @@ -2478,21 +2059,21 @@ "@lerna/pulse-till-done@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-4.0.0.tgz#04bace7d483a8205c187b806bcd8be23d7bb80a3" integrity sha512-Frb4F7QGckaybRhbF7aosLsJ5e9WuH7h0KUkjlzSByVycxY91UZgaEIVjS2oN9wQLrheLMHl6SiFY0/Pvo0Cxg== dependencies: npmlog "^4.1.2" "@lerna/query-graph@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-4.0.0.tgz#09dd1c819ac5ee3f38db23931143701f8a6eef63" integrity sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg== dependencies: "@lerna/package-graph" "4.0.0" "@lerna/resolve-symlink@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-4.0.0.tgz#6d006628a210c9b821964657a9e20a8c9a115e14" integrity sha512-RtX8VEUzqT+uLSCohx8zgmjc6zjyRlh6i/helxtZTMmc4+6O4FS9q5LJas2uGO2wKvBlhcD6siibGt7dIC3xZA== dependencies: fs-extra "^9.1.0" @@ -2501,7 +2082,7 @@ "@lerna/rimraf-dir@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-4.0.0.tgz#2edf3b62d4eb0ef4e44e430f5844667d551ec25a" integrity sha512-QNH9ABWk9mcMJh2/muD9iYWBk1oQd40y6oH+f3wwmVGKYU5YJD//+zMiBI13jxZRtwBx0vmBZzkBkK1dR11cBg== dependencies: "@lerna/child-process" "4.0.0" @@ -2511,7 +2092,7 @@ "@lerna/run-lifecycle@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-4.0.0.tgz#e648a46f9210a9bcd7c391df6844498cb5079334" integrity sha512-IwxxsajjCQQEJAeAaxF8QdEixfI7eLKNm4GHhXHrgBu185JcwScFZrj9Bs+PFKxwb+gNLR4iI5rpUdY8Y0UdGQ== dependencies: "@lerna/npm-conf" "4.0.0" @@ -2520,7 +2101,7 @@ "@lerna/run-topologically@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-4.0.0.tgz#af846eeee1a09b0c2be0d1bfb5ef0f7b04bb1827" integrity sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA== dependencies: "@lerna/query-graph" "4.0.0" @@ -2528,7 +2109,7 @@ "@lerna/run@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run/-/run-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run/-/run-4.0.0.tgz#4bc7fda055a729487897c23579694f6183c91262" integrity sha512-9giulCOzlMPzcZS/6Eov6pxE9gNTyaXk0Man+iCIdGJNMrCnW7Dme0Z229WWP/UoxDKg71F2tMsVVGDiRd8fFQ== dependencies: "@lerna/command" "4.0.0" @@ -2543,7 +2124,7 @@ "@lerna/symlink-binary@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-4.0.0.tgz#21009f62d53a425f136cb4c1a32c6b2a0cc02d47" integrity sha512-zualodWC4q1QQc1pkz969hcFeWXOsVYZC5AWVtAPTDfLl+TwM7eG/O6oP+Rr3fFowspxo6b1TQ6sYfDV6HXNWA== dependencies: "@lerna/create-symlink" "4.0.0" @@ -2553,7 +2134,7 @@ "@lerna/symlink-dependencies@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-4.0.0.tgz#8910eca084ae062642d0490d8972cf2d98e9ebbd" integrity sha512-BABo0MjeUHNAe2FNGty1eantWp8u83BHSeIMPDxNq0MuW2K3CiQRaeWT3EGPAzXpGt0+hVzBrA6+OT0GPn7Yuw== dependencies: "@lerna/create-symlink" "4.0.0" @@ -2565,19 +2146,19 @@ "@lerna/timer@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/timer/-/timer-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/timer/-/timer-4.0.0.tgz#a52e51bfcd39bfd768988049ace7b15c1fd7a6da" integrity sha512-WFsnlaE7SdOvjuyd05oKt8Leg3ENHICnvX3uYKKdByA+S3g+TCz38JsNs7OUZVt+ba63nC2nbXDlUnuT2Xbsfg== "@lerna/validation-error@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-4.0.0.tgz#af9d62fe8304eaa2eb9a6ba1394f9aa807026d35" integrity sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw== dependencies: npmlog "^4.1.2" "@lerna/version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/version/-/version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/version/-/version-4.0.0.tgz#532659ec6154d8a8789c5ab53878663e244e3228" integrity sha512-otUgiqs5W9zGWJZSCCMRV/2Zm2A9q9JwSDS7s/tlKq4mWCYriWo7+wsHEA/nPTMDyYyBO5oyZDj+3X50KDUzeA== dependencies: "@lerna/check-working-tree" "4.0.0" @@ -2609,7 +2190,7 @@ "@lerna/write-log-file@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-4.0.0.tgz#18221a38a6a307d6b0a5844dd592ad53fa27091e" integrity sha512-XRG5BloiArpXRakcnPHmEHJp+4AtnhRtpDIHSghmXD5EichI1uD73J7FgPp30mm2pDRq3FdqB0NbwSEsJ9xFQg== dependencies: npmlog "^4.1.2" @@ -2617,7 +2198,7 @@ "@manypkg/find-root@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz" + resolved "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz#a62d8ed1cd7e7d4c11d9d52a8397460b5d4ad29f" integrity sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA== dependencies: "@babel/runtime" "^7.5.5" @@ -2627,7 +2208,7 @@ "@manypkg/get-packages@^1.1.3": version "1.1.3" - resolved "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.3.tgz" + resolved "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.3.tgz#e184db9bba792fa4693de4658cfb1463ac2c9c47" integrity sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A== dependencies: "@babel/runtime" "^7.5.5" @@ -2637,29 +2218,14 @@ globby "^11.0.0" read-yaml-file "^1.1.0" -"@mapbox/node-pre-gyp@^1.0.0": - version "1.0.10" - resolved "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz" - integrity sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA== - dependencies: - detect-libc "^2.0.0" - https-proxy-agent "^5.0.0" - make-dir "^3.1.0" - node-fetch "^2.6.7" - nopt "^5.0.0" - npmlog "^5.0.1" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.11" - "@microsoft/tsdoc@0.12.24": version "0.12.24" - resolved "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.24.tgz" + resolved "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.24.tgz#30728e34ebc90351dd3aff4e18d038eed2c3e098" integrity sha512-Mfmij13RUTmHEMi9vRUhMXD7rnGR2VvxeNYtaGtaJ4redwwjT4UXYJ+nzmVJF7hhd4pn/Fx5sncDKxMVFJSWPg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: "@nodelib/fs.stat" "2.0.5" @@ -2667,41 +2233,51 @@ "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@npmcli/agent@^2.0.0": + version "2.2.2" + resolved "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.2.tgz#967604918e62f620a648c7975461c9c9e74fc5d5" + integrity sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og== + dependencies: + agent-base "^7.1.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.1" + lru-cache "^10.0.1" + socks-proxy-agent "^8.0.3" + "@npmcli/ci-detect@^1.0.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz" - integrity sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q== + version "1.4.0" + resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz#18478bbaa900c37bfbd8a2006a6262c62e8b0fe1" + integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q== "@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.0.0.tgz" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== + version "1.1.1" + resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" + integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== dependencies: "@gar/promisify" "^1.0.1" semver "^7.3.5" -"@npmcli/fs@^2.1.0": - version "2.1.2" - resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz" - integrity sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ== +"@npmcli/fs@^3.1.0": + version "3.1.1" + resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.1.tgz#59cdaa5adca95d135fc00f2bb53f5771575ce726" + integrity sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg== dependencies: - "@gar/promisify" "^1.1.3" semver "^7.3.5" "@npmcli/git@^2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz" + resolved "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" integrity sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw== dependencies: "@npmcli/promise-spawn" "^1.3.2" @@ -2715,7 +2291,7 @@ "@npmcli/installed-package-contents@^1.0.6": version "1.0.7" - resolved "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz" + resolved "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz#ab7408c6147911b970a8abe261ce512232a3f4fa" integrity sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw== dependencies: npm-bundled "^1.1.1" @@ -2723,35 +2299,27 @@ "@npmcli/move-file@^1.0.1": version "1.1.2" - resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz" + resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== dependencies: mkdirp "^1.0.4" rimraf "^3.0.2" -"@npmcli/move-file@^2.0.0": - version "2.0.1" - resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz" - integrity sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ== - dependencies: - mkdirp "^1.0.4" - rimraf "^3.0.2" - "@npmcli/node-gyp@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.2.tgz" - integrity sha512-yrJUe6reVMpktcvagumoqD9r08fH1iRo01gn1u0zoCApa9lnZGEigVKUd2hzsCId4gdtkZZIVscLhNxMECKgRg== + version "1.0.3" + resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" + integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== "@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": version "1.3.2" - resolved "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz" + resolved "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz#42d4e56a8e9274fba180dabc0aea6e38f29274f5" integrity sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg== dependencies: infer-owner "^1.0.4" "@npmcli/run-script@^1.8.2": version "1.8.6" - resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz" + resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz#18314802a6660b0d4baa4c3afe7f1ad39d8c28b7" integrity sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g== dependencies: "@npmcli/node-gyp" "^1.0.2" @@ -2761,19 +2329,19 @@ "@octokit/auth-token@^2.4.4": version "2.5.0" - resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz" + resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== dependencies: "@octokit/types" "^6.0.3" "@octokit/core@^3.5.1": - version "3.5.1" - resolved "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz" - integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== + version "3.6.0" + resolved "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" + integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== dependencies: "@octokit/auth-token" "^2.4.4" "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.6.0" + "@octokit/request" "^5.6.3" "@octokit/request-error" "^2.0.5" "@octokit/types" "^6.0.3" before-after-hook "^2.2.0" @@ -2781,7 +2349,7 @@ "@octokit/endpoint@^6.0.1": version "6.0.12" - resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz" + resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== dependencies: "@octokit/types" "^6.0.3" @@ -2790,80 +2358,80 @@ "@octokit/graphql@^4.5.8": version "4.8.0" - resolved "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz" + resolved "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== dependencies: "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.5.0": - version "10.6.0" - resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-10.6.0.tgz" - integrity sha512-/iQtZq+zuQJrwawFyjixh333xPu4/KJKk0bFM/Omm4kFlTGw0dWXfq6xCOe5DqONW0faW29Cc9r6p2mvl72aTQ== +"@octokit/openapi-types@^12.11.0": + version "12.11.0" + resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" + integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" - resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz" + resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.16.0": - version "2.16.5" - resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.5.tgz" - integrity sha512-2PfRGymdBypqRes4Xelu0BAZZRCV/Qg0xgo8UB10UKoghCM+zg640+T5WkRsRD0edwfLBPP3VsJgDyDTG4EIYg== +"@octokit/plugin-paginate-rest@^2.16.8": + version "2.21.3" + resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" + integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== dependencies: - "@octokit/types" "^6.31.0" + "@octokit/types" "^6.40.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz" + resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.11.1": - version "5.11.1" - resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.1.tgz" - integrity sha512-EE69SuO08wtnIy9q/HftGDr7/Im1txzDfeYr+I4T/JkMSNEiedUUE5RuCWkEQAwwbeEU4kVTwSEQZb9Af77/PA== +"@octokit/plugin-rest-endpoint-methods@^5.12.0": + version "5.16.2" + resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" + integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== dependencies: - "@octokit/types" "^6.30.0" + "@octokit/types" "^6.39.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz" + resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== dependencies: "@octokit/types" "^6.0.3" deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.6.0": - version "5.6.1" - resolved "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz" - integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== +"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": + version "5.6.3" + resolved "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.16.1" is-plain-object "^5.0.0" - node-fetch "^2.6.1" + node-fetch "^2.6.7" universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.11.0" - resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.11.0.tgz" - integrity sha512-e30+ERbA4nXkzkaCDgfxS9H1A43Z1GvV5nqLfkxS81rYKbFE6+sEsrXsTRzV1aWLsRIQ+B75Vgnyzjw/ioTyVA== + version "18.12.0" + resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" + integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== dependencies: "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.0" + "@octokit/plugin-paginate-rest" "^2.16.8" "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "5.11.1" + "@octokit/plugin-rest-endpoint-methods" "^5.12.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.30.0", "@octokit/types@^6.31.0": - version "6.31.0" - resolved "https://registry.npmjs.org/@octokit/types/-/types-6.31.0.tgz" - integrity sha512-xobpvYmMYoFSxZB6jL1TPTMMZkxZIBlY145ZKibBJDKCczP1FrLLougtuVOZywGVZdcYs8oq2Bxb3aMjqIFeiw== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.41.0" + resolved "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" + integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== dependencies: - "@octokit/openapi-types" "^10.5.0" + "@octokit/openapi-types" "^12.11.0" "@opentelemetry/api@~1.9.0": version "1.9.0" @@ -2882,20 +2450,20 @@ "@pnpm/config.env-replace@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz" + resolved "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c" integrity sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w== "@pnpm/network.ca-file@^1.0.1": version "1.0.2" - resolved "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz" + resolved "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz#2ab05e09c1af0cdf2fcf5035bea1484e222f7983" integrity sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA== dependencies: graceful-fs "4.2.10" "@pnpm/npm-conf@^2.1.0": - version "2.1.1" - resolved "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.1.1.tgz" - integrity sha512-yfRcuupmxxeDOSxvw4g+wFCrGiPD0L32f5WMzqMXp7Rl93EOCdFiDcaSNnZ10Up9GdNqkj70UTa8hfhPFphaZA== + version "2.3.1" + resolved "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz#bb375a571a0bd63ab0a23bece33033c683e9b6b0" + integrity sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw== dependencies: "@pnpm/config.env-replace" "^1.1.0" "@pnpm/network.ca-file" "^1.0.1" @@ -2903,67 +2471,65 @@ "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz" - integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== "@protobufjs/base64@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz" + resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== "@protobufjs/codegen@^2.0.4": version "2.0.4" - resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz" + resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== "@protobufjs/eventemitter@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz" - integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== "@protobufjs/fetch@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz" - integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== dependencies: "@protobufjs/aspromise" "^1.1.1" "@protobufjs/inquire" "^1.1.0" "@protobufjs/float@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz" - integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== "@protobufjs/inquire@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz" - integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== "@protobufjs/path@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz" - integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== "@protobufjs/pool@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz" - integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== "@protobufjs/utf8@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz" - integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@rollup/plugin-alias@5.1.0": - version "5.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz#99a94accc4ff9a3483be5baeedd5d7da3b597e93" - integrity sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ== - dependencies: - slash "^4.0.0" +"@rollup/plugin-alias@5.1.1": + version "5.1.1" + resolved "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.1.tgz#53601d88cda8b1577aa130b4a6e452283605bf26" + integrity sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ== "@rollup/plugin-commonjs@21.1.0": version "21.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz" + resolved "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz#45576d7b47609af2db87f55a6d4b46e44fc3a553" integrity sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA== dependencies: "@rollup/pluginutils" "^3.1.0" @@ -2983,7 +2549,7 @@ "@rollup/plugin-node-resolve@13.3.0": version "13.3.0" - resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== dependencies: "@rollup/pluginutils" "^3.1.0" @@ -2995,7 +2561,7 @@ "@rollup/plugin-strip@2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-strip/-/plugin-strip-2.1.0.tgz" + resolved "https://registry.npmjs.org/@rollup/plugin-strip/-/plugin-strip-2.1.0.tgz#04c2d2ccfb2c6b192bb70447fbf26e336379a333" integrity sha512-OKlIlXMFlH4nVxq0beNSIKVw0LkpNUpVjjvfzH5OAOAR5dhLZgLZBzwYX4ifIAs18YDrreMcZH4xnKmW9fI2AQ== dependencies: "@rollup/pluginutils" "^3.1.0" @@ -3013,12 +2579,12 @@ "@rollup/plugin-virtual@2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.1.0.tgz" + resolved "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.1.0.tgz#a77bfd0dff74f0203401c75287ff4d1a1cfbc816" integrity sha512-CPPAtlKT53HFqC8jFHb/V5WErpU8Hrq2TyCR0A7kPQMlF2wNUf0o1xuAc+Qxj8NCZM0Z3Yvl+FbUXfJjVWqDwA== "@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": version "3.1.0" - resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== dependencies: "@types/estree" "0.0.39" @@ -3027,7 +2593,7 @@ "@rollup/pluginutils@^4.1.2": version "4.2.1" - resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== dependencies: estree-walker "^2.0.1" @@ -3049,7 +2615,7 @@ "@rushstack/node-core-library@3.36.0": version "3.36.0" - resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.0.tgz" + resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.0.tgz#95dace39d763c8695d6607c421f95c6ac65b0ed4" integrity sha512-bID2vzXpg8zweXdXgQkKToEdZwVrVCN9vE9viTRk58gqzYaTlz4fMId6V3ZfpXN6H0d319uGi2KDlm+lUEeqCg== dependencies: "@types/node" "10.17.13" @@ -3062,10 +2628,10 @@ timsort "~0.3.0" z-schema "~3.18.3" -"@rushstack/node-core-library@3.59.7": - version "3.59.7" - resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.7.tgz" - integrity sha512-ln1Drq0h+Hwa1JVA65x5mlSgUrBa1uHL+V89FqVWQgXd1vVIMhrtqtWGQrhTnFHxru5ppX+FY39VWELF/FjQCw== +"@rushstack/node-core-library@3.66.1": + version "3.66.1" + resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.66.1.tgz#a1c61a47ab626d5bd435fea33fe938f47007a8de" + integrity sha512-ker69cVKAoar7MMtDFZC4CzcDxjwqIhFzqEnYI5NRN/8M3om6saWCVx/A7vL2t/jFCJsnzQplRDqA7c78pytng== dependencies: colors "~1.2.1" fs-extra "~7.0.1" @@ -3075,48 +2641,50 @@ semver "~7.5.4" z-schema "~5.0.2" -"@rushstack/node-core-library@4.0.2": - version "4.0.2" - resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz#e26854a3314b279d57e8abdb4acce7797d02f554" - integrity sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg== +"@rushstack/node-core-library@5.10.2": + version "5.10.2" + resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.10.2.tgz#8d12bc5bd9244ea57f441877246efb0a1b7b7df6" + integrity sha512-xOF/2gVJZTfjTxbo4BDj9RtQq/HFnrrKdtem4JkyRLnwsRz2UDTg8gA1/et10fBx5RxmZD9bYVGST69W8ME5OQ== dependencies: + ajv "~8.13.0" + ajv-draft-04 "~1.0.0" + ajv-formats "~3.0.1" fs-extra "~7.0.1" import-lazy "~4.0.0" jju "~1.4.0" resolve "~1.22.1" semver "~7.5.4" - z-schema "~5.0.2" "@rushstack/rig-package@0.2.9": version "0.2.9" - resolved "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.9.tgz" + resolved "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.9.tgz#57ef94e7f7703b18e275b603d3f59a1a16580716" integrity sha512-4tqsZ/m+BjeNAGeAJYzPF53CT96TsAYeZ3Pq3T4tb1pGGM3d3TWfkmALZdKNhpRlAeShKUrb/o/f/0sAuK/1VQ== dependencies: "@types/node" "10.17.13" resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/terminal@0.10.0": - version "0.10.0" - resolved "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.10.0.tgz#e81909fa0e5c8016b6df4739f0f381f44358269f" - integrity sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw== +"@rushstack/terminal@0.14.5": + version "0.14.5" + resolved "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.5.tgz#4b0e79b139b4372901956f920b5a4a405a1d09d8" + integrity sha512-TEOpNwwmsZVrkp0omnuTUTGZRJKTr6n6m4OITiNjkqzLAkcazVpwR1SOtBg6uzpkIBLgrcNHETqI8rbw3uiUfw== dependencies: - "@rushstack/node-core-library" "4.0.2" + "@rushstack/node-core-library" "5.10.2" supports-color "~8.1.1" -"@rushstack/ts-command-line@4.19.1": - version "4.19.1" - resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.19.1.tgz#288ee54dd607e558a8be07705869c16c31b5c3ef" - integrity sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg== +"@rushstack/ts-command-line@4.23.3": + version "4.23.3" + resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.3.tgz#a42fe413159c0f3f2c57afdceedf91a5b75c2d67" + integrity sha512-HazKL8fv4HMQMzrKJCrOrhyBPPdzk7iajUXgsASwjQ8ROo1cmgyqxt/k9+SdmrNLGE1zATgRqMUH3s/6smbRMA== dependencies: - "@rushstack/terminal" "0.10.0" + "@rushstack/terminal" "0.14.5" "@types/argparse" "1.0.38" argparse "~1.0.9" string-argv "~0.3.1" "@rushstack/ts-command-line@4.7.8": version "4.7.8" - resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.7.8.tgz" + resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.7.8.tgz#3aa77cf544c571be3206fc2bcba20c7a096ed254" integrity sha512-8ghIWhkph7NnLCMDJtthpsb7TMOsVGXVDvmxjE/CeklTqjbbUFBjGXizJfpbEkRQTELuZQ2+vGn7sGwIWKN2uA== dependencies: "@types/argparse" "1.0.38" @@ -3126,45 +2694,38 @@ "@samverschueren/stream-to-observable@^0.3.0": version "0.3.1" - resolved "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz" + resolved "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301" integrity sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ== dependencies: any-observable "^0.3.0" -"@sindresorhus/is@^4.0.0": - version "4.2.0" - resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz" - integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@sindresorhus/is@^4.6.0": +"@sindresorhus/is@^4.0.0", "@sindresorhus/is@^4.6.0": version "4.6.0" resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": - version "1.8.3" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + version "1.8.6" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" "@sinonjs/fake-timers@^6.0.0", "@sinonjs/fake-timers@^6.0.1": version "6.0.1" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz" + resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== dependencies: "@sinonjs/commons" "^1.7.0" -"@sinonjs/fake-timers@^7.1.0": - version "7.1.2" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz" - integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== - dependencies: - "@sinonjs/commons" "^1.7.0" - "@sinonjs/samsam@^5.3.1": version "5.3.1" - resolved "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz" + resolved "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz#375a45fe6ed4e92fca2fb920e007c48232a6507f" integrity sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg== dependencies: "@sinonjs/commons" "^1.6.0" @@ -3172,9 +2733,9 @@ type-detect "^4.0.8" "@sinonjs/text-encoding@^0.7.1": - version "0.7.1" - resolved "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz" - integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== + version "0.7.3" + resolved "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz#282046f03e886e352b2d5f5da5eb755e01457f3f" + integrity sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA== "@socket.io/component-emitter@~3.1.0": version "3.1.2" @@ -3183,7 +2744,7 @@ "@szmarczak/http-timer@^4.0.5": version "4.0.6" - resolved "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz" + resolved "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== dependencies: defer-to-connect "^2.0.0" @@ -3195,12 +2756,12 @@ "@tootallnate/once@1": version "1.1.2" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@tootallnate/once@2": version "2.0.0" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@tootallnate/quickjs-emscripten@^0.23.0": @@ -3209,59 +2770,52 @@ integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== "@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== "@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + version "1.0.3" + resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + version "1.0.4" + resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/argparse@1.0.38": version "1.0.38" - resolved "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz" + resolved "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9" integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA== -"@types/babel__traverse@^7.0.4": - version "7.14.2" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz" - integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== - dependencies: - "@babel/types" "^7.3.0" - -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== +"@types/body-parser@*": + version "1.19.5" + resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" + integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg== dependencies: "@types/connect" "*" "@types/node" "*" "@types/cacheable-request@^6.0.1": - version "6.0.2" - resolved "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz" - integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== + version "6.0.3" + resolved "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" + integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== dependencies: "@types/http-cache-semantics" "*" - "@types/keyv" "*" + "@types/keyv" "^3.1.4" "@types/node" "*" - "@types/responselike" "*" + "@types/responselike" "^1.0.0" "@types/caseless@*": - version "0.12.2" - resolved "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz" - integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== + version "0.12.5" + resolved "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz#db9468cb1b1b5a925b8f34822f1669df0c5472f5" + integrity sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg== "@types/chai-as-promised@7.1.8": version "7.1.8" @@ -3271,9 +2825,11 @@ "@types/chai" "*" "@types/chai@*": - version "4.2.22" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz" - integrity sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ== + version "5.0.1" + resolved "https://registry.npmjs.org/@types/chai/-/chai-5.0.1.tgz#2c3705555cf11f5f59c836a84c44afcfe4e5689d" + integrity sha512-5T8ajsg3M/FOncpLYW7sdOcD6yf4+722sze/tc4KQV0P8Z2rAr3SAuHCIkYmYpt8VbcQlnz8SxlOlPQYefe4cA== + dependencies: + "@types/deep-eql" "*" "@types/chai@4.3.20": version "4.3.20" @@ -3293,29 +2849,23 @@ integrity sha512-NKRWaEGaVGVLnGLB2GazvDaZnyweW9FJLLFL5LhywGJB3aqGMT9R/EUoJoSRP4nzofYnZysuDmrEJtJdAqUOtQ== "@types/connect@*": - version "3.4.35" - resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + version "3.4.38" + resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== dependencies: "@types/node" "*" -"@types/cookie@^0.4.1": - version "0.4.1" - resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz" - integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== - "@types/cors@^2.8.12": - version "2.8.12" - resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz" - integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== - -"@types/eslint-scope@^3.7.0": - version "3.7.1" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz" - integrity sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g== + version "2.8.17" + resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz#5d718a5e494a8166f569d986794e49c48b216b2b" + integrity sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA== dependencies: - "@types/eslint" "*" - "@types/estree" "*" + "@types/node" "*" + +"@types/deep-eql@*": + version "4.0.2" + resolved "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz#334311971d3a07121e7eb91b684a605e7eea9cbd" + integrity sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw== "@types/eslint-scope@^3.7.7": version "3.7.7" @@ -3325,42 +2875,46 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint@*", "@types/eslint@7.29.0": +"@types/eslint@*": + version "9.6.1" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/eslint@7.29.0": version "7.29.0" - resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz#e56ddc8e542815272720bb0b4ccc2aff9c3e1c78" integrity sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng== dependencies: "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.50": - version "0.0.50" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== +"@types/estree@*", "@types/estree@^1.0.0", "@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/estree@0.0.39": version "0.0.39" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/estree@^1.0.0", "@types/estree@^1.0.6": - version "1.0.6" - resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" - integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== - "@types/expect@^1.20.4": version "1.20.4" - resolved "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz" + resolved "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== "@types/express-serve-static-core@^4.17.33": - version "4.17.33" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz" - integrity sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA== + version "4.19.6" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz#e01324c2a024ff367d92c66f48553ced0ab50267" + integrity sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A== dependencies: "@types/node" "*" "@types/qs" "*" "@types/range-parser" "*" + "@types/send" "*" "@types/express@4.17.21": version "4.17.21" @@ -3373,31 +2927,36 @@ "@types/serve-static" "*" "@types/fs-extra@^8.0.1": - version "8.1.2" - resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.2.tgz" - integrity sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg== + version "8.1.5" + resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.5.tgz#33aae2962d3b3ec9219b5aca2555ee00274f5927" + integrity sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ== dependencies: "@types/node" "*" "@types/glob@^7.1.1": - version "7.1.4" - resolved "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz" - integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== + version "7.2.0" + resolved "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== dependencies: "@types/minimatch" "*" "@types/node" "*" -"@types/graceful-fs@^4.1.2": - version "4.1.5" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== +"@types/graceful-fs@^4.1.3": + version "4.1.9" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/http-cache-semantics@*": - version "4.0.1" - resolved "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz" - integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + version "4.0.4" + resolved "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" + integrity sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA== + +"@types/http-errors@*": + version "2.0.4" + resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" + integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA== "@types/inquirer@8.2.10": version "8.2.10" @@ -3408,21 +2967,21 @@ rxjs "^7.2.0" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.3" - resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + version "2.0.6" + resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" @@ -3431,30 +2990,25 @@ resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== -"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8": - version "7.0.9" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@types/json-schema@^7.0.12", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== -"@types/json-stable-stringify@1.0.36": - version "1.0.36" - resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.36.tgz#fe6c6001a69ff8160a772da08779448a333c7ddd" - integrity sha512-b7bq23s4fgBB76n34m2b3RBf6M369B0Z9uRR8aHTMd8kZISRkmDEpPD8hhpYvDFzr3bJCPES96cm3Q6qRNDbQw== +"@types/json-stable-stringify@1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#41393e6b7a9a67221607346af4a79783aeb28aea" + integrity sha512-ESTsHWB72QQq+pjUFIbEz9uSCZppD31YrVkbt2rnUciTYEvcwN6uZIhX5JZeBHqRlFJ41x/7MewCs7E2Qux6Cg== "@types/json5@^0.0.29": version "0.0.29" - resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== -"@types/keyv@*": - version "3.1.3" - resolved "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz" - integrity sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg== +"@types/keyv@^3.1.4": + version "3.1.4" + resolved "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== dependencies: "@types/node" "*" @@ -3468,32 +3022,37 @@ "@types/long@4.0.2", "@types/long@^4.0.0": version "4.0.2" - resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" + resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== -"@types/mime@*": - version "3.0.1" - resolved "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz" - integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== +"@types/mime@^1": + version "1.3.5" + resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" + integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== -"@types/minimatch@*", "@types/minimatch@^3.0.3": - version "3.0.5" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz" - integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== +"@types/minimatch@*": + version "5.1.2" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== "@types/minimatch@3.0.3": version "3.0.3" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== +"@types/minimatch@^3.0.3": + version "3.0.5" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== + "@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + version "1.2.5" + resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" + integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== "@types/mocha@9.1.1": version "9.1.1" - resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz" + resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/mz@2.7.8": @@ -3503,76 +3062,59 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@>=10.0.0", "@types/node@^12.7.1": - version "12.20.50" - resolved "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz" - integrity sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA== +"@types/node@*", "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.7.0": + version "22.10.10" + resolved "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz#85fe89f8bf459dc57dfef1689bd5b52ad1af07e6" + integrity sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww== + dependencies: + undici-types "~6.20.0" "@types/node@10.17.13": version "10.17.13" - resolved "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz" + resolved "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@18.19.57": - version "18.19.57" - resolved "https://registry.npmjs.org/@types/node/-/node-18.19.57.tgz#a075ff6bb71a947d410a9d7ad2b6cb010a0c5230" - integrity sha512-I2ioBd/IPrYDMv9UNR5NlPElOZ68QB7yY5V2EsLtSrTO0LM0PnCEFF9biLWHf5k+sIy4ohueCV9t4gk1AEdlVA== - dependencies: - undici-types "~5.26.4" - -"@types/node@18.19.71": - version "18.19.71" - resolved "https://registry.npmjs.org/@types/node/-/node-18.19.71.tgz#96d4f0a0be735ead6c8998c62a4b2c0012a5d09a" - integrity sha512-evXpcgtZm8FY4jqBSN8+DmOTcVkkvTmAayeo4Wf3m1xAruyVGzGuDh/Fb/WWX2yLItUiho42ozyJjB0dw//Tkw== +"@types/node@18.19.74": + version "18.19.74" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.74.tgz#4d093acd2a558ebbc5f0efa4e20ce63791b0cc58" + integrity sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A== dependencies: undici-types "~5.26.4" -"@types/node@>=12.12.47": - version "16.9.6" - resolved "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz" - integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== - -"@types/node@>=13.7.0": - version "20.9.0" - resolved "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz" - integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== - dependencies: - undici-types "~5.26.4" +"@types/node@^12.7.1": + version "12.20.55" + resolved "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" + integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + version "2.4.4" + resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" + integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== "@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== - -"@types/prettier@2.7.2": - version "2.7.2" - resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + version "4.0.2" + resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" + integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== -"@types/prettier@^2.1.5": - version "2.3.2" - resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.3.2.tgz" - integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== +"@types/prettier@2.7.3": + version "2.7.3" + resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/q@^0.0.32": version "0.0.32" - resolved "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz" - integrity sha1-vShOV8hPEyXacCur/IKlMoGQwMU= + resolved "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5" + integrity sha512-qYi3YV9inU/REEfxwVcGZzbS3KG/Xs90lv0Pr+lDtuVjBPGd1A+eciXzVSaRvLify132BfcvhvEjeVahrUl0Ug== "@types/qs@*": - version "6.9.7" - resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + version "6.9.18" + resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz#877292caa91f7c1b213032b34626505b746624c2" + integrity sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA== "@types/range-parser@*": - version "1.2.4" - resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + version "1.2.7" + resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" + integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== "@types/request@2.48.12", "@types/request@^2.48.8": version "2.48.12" @@ -3586,7 +3128,7 @@ "@types/resolve@1.17.1": version "1.17.1" - resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz" + resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== dependencies: "@types/node" "*" @@ -3596,30 +3138,39 @@ resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.6.tgz#e6e60dad29c2c8c206c026e6dd8d6d1bdda850b8" integrity sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ== -"@types/responselike@*", "@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== +"@types/responselike@^1.0.0": + version "1.0.3" + resolved "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz#cc29706f0a397cfe6df89debfe4bf5cea159db50" + integrity sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw== dependencies: "@types/node" "*" "@types/selenium-webdriver@^3.0.0": - version "3.0.19" - resolved "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.19.tgz" - integrity sha512-OFUilxQg+rWL2FMxtmIgCkUDlJB6pskkpvmew7yeXfzzsOBb5rc+y2+DjHm+r3r1ZPPcJefK3DveNSYWGiy68g== + version "3.0.26" + resolved "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.26.tgz#fc7d87d580affa2e52685b2e881bc201819a5836" + integrity sha512-dyIGFKXfUFiwkMfNGn1+F6b80ZjR3uSYv1j6xVJSDlft5waZ2cwkHW4e7zNzvq7hiEackcgvBpmnXZrI1GltPg== "@types/semver@^7.5.0": - version "7.5.0" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz" - integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + version "7.5.8" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== + +"@types/send@*": + version "0.17.4" + resolved "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a" + integrity sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA== + dependencies: + "@types/mime" "^1" + "@types/node" "*" "@types/serve-static@*": - version "1.15.0" - resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz" - integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== + version "1.15.7" + resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz#22174bbd74fb97fe303109738e9b5c2f3064f714" + integrity sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw== dependencies: - "@types/mime" "*" + "@types/http-errors" "*" "@types/node" "*" + "@types/send" "*" "@types/sinon-chai@3.2.12": version "3.2.12" @@ -3629,34 +3180,27 @@ "@types/chai" "*" "@types/sinon" "*" -"@types/sinon@*": - version "10.0.3" - resolved "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.3.tgz" - integrity sha512-XUaFuUOQ3A/r6gS1qCU/USMleascaqGeQpGR1AZ5JdRtBPlzijRzKsik1TuGzvdtPA0mdq42JqaJmJ+Afg1LJg== - dependencies: - "@sinonjs/fake-timers" "^7.1.0" - -"@types/sinon@9.0.11": +"@types/sinon@*", "@types/sinon@9.0.11": version "9.0.11" - resolved "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.11.tgz" + resolved "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.11.tgz#7af202dda5253a847b511c929d8b6dda170562eb" integrity sha512-PwP4UY33SeeVKodNE37ZlOsR9cReypbMJOhZ7BVE0lB+Hix3efCOxiJWiE5Ia+yL9Cn2Ch72EjFTRze8RZsNtg== dependencies: "@types/sinonjs__fake-timers" "*" "@types/sinonjs__fake-timers@*": - version "6.0.4" - resolved "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz" - integrity sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A== + version "8.1.5" + resolved "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz#5fd3592ff10c1e9695d377020c033116cc2889f2" + integrity sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ== "@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + version "2.0.3" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/through@*": - version "0.0.30" - resolved "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz" - integrity sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg== + version "0.0.33" + resolved "https://registry.npmjs.org/@types/through/-/through-0.0.33.tgz#14ebf599320e1c7851e7d598149af183c6b9ea56" + integrity sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ== dependencies: "@types/node" "*" @@ -3666,9 +3210,14 @@ integrity sha512-chhaNf2oKHlRkDGt+tiKE2Z5aJ6qalm7Z9rlLdBwmOiAAf09YQvvoLXjWK4HWPF1xU/fqvMgfNfpVoBscA/tKA== "@types/tough-cookie@*": - version "4.0.1" - resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.1.tgz" - integrity sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg== + version "4.0.5" + resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + +"@types/triple-beam@^1.3.2": + version "1.3.5" + resolved "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" + integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw== "@types/trusted-types@2.0.7": version "2.0.7" @@ -3693,28 +3242,21 @@ webpack "^5" "@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== + version "21.0.3" + resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== -"@types/yargs@17.0.33": +"@types/yargs@17.0.33", "@types/yargs@^17.0.8": version "17.0.33" resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - "@types/yauzl@^2.9.1": - version "2.9.2" - resolved "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz" - integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== + version "2.10.3" + resolved "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999" + integrity sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q== dependencies: "@types/node" "*" @@ -3856,21 +3398,13 @@ "@ungap/promise-all-settled@1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" + resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== "@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== - -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== - dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + version "1.3.0" + resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8" + integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== "@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": version "1.14.1" @@ -3880,45 +3414,21 @@ "@webassemblyjs/helper-numbers" "1.13.2" "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== - "@webassemblyjs/floating-point-hex-parser@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== - "@webassemblyjs/helper-api-error@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== - "@webassemblyjs/helper-buffer@1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== - dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@xtuc/long" "4.2.2" - "@webassemblyjs/helper-numbers@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" @@ -3928,26 +3438,11 @@ "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== - "@webassemblyjs/helper-wasm-bytecode@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/helper-wasm-section@1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" @@ -3958,13 +3453,6 @@ "@webassemblyjs/helper-wasm-bytecode" "1.13.2" "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== - dependencies: - "@xtuc/ieee754" "^1.2.0" - "@webassemblyjs/ieee754@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" @@ -3972,13 +3460,6 @@ dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== - dependencies: - "@xtuc/long" "4.2.2" - "@webassemblyjs/leb128@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" @@ -3986,30 +3467,11 @@ dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - "@webassemblyjs/utf8@1.13.2": version "1.13.2" resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - "@webassemblyjs/wasm-edit@^1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" @@ -4024,17 +3486,6 @@ "@webassemblyjs/wasm-parser" "1.14.1" "@webassemblyjs/wast-printer" "1.14.1" -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - "@webassemblyjs/wasm-gen@1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" @@ -4046,16 +3497,6 @@ "@webassemblyjs/leb128" "1.13.2" "@webassemblyjs/utf8" "1.13.2" -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wasm-opt@1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" @@ -4066,18 +3507,6 @@ "@webassemblyjs/wasm-gen" "1.14.1" "@webassemblyjs/wasm-parser" "1.14.1" -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - "@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" @@ -4090,14 +3519,6 @@ "@webassemblyjs/leb128" "1.13.2" "@webassemblyjs/utf8" "1.13.2" -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@xtuc/long" "4.2.2" - "@webassemblyjs/wast-printer@1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" @@ -4108,134 +3529,109 @@ "@xtuc/ieee754@^1.2.0": version "1.2.0" - resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" + resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== "@xtuc/long@4.2.2": version "4.2.2" - resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" + resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -"@yarn-tool/resolve-package@^1.0.40": - version "1.0.47" - resolved "https://registry.npmjs.org/@yarn-tool/resolve-package/-/resolve-package-1.0.47.tgz" - integrity sha512-Zaw58gQxjQceJqhqybJi1oUDaORT8i2GTgwICPs8v/X/Pkx35FXQba69ldHVg5pQZ6YLKpROXgyHvBaCJOFXiA== - dependencies: - pkg-dir "< 6 >= 5" - tslib "^2" - upath2 "^3.1.13" - "@yarnpkg/lockfile@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz" + resolved "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== JSONStream@^1.0.4: version "1.3.5" - resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" + resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== dependencies: jsonparse "^1.2.0" through ">=2.2.7 <3" abab@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== + version "2.0.6" + resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abbrev@1, abbrev@^1.0.0: +abbrev@1: version "1.1.1" - resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" + resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abbrev@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" + integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== + abort-controller@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" + resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== dependencies: event-target-shim "^5.0.0" -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -accepts@~1.3.8: +accepts@~1.3.4, accepts@~1.3.8: version "1.3.8" - resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz" + resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: mime-types "~2.1.34" negotiator "0.6.3" -acorn-import-assertions@^1.7.6: - version "1.7.6" - resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.7.6.tgz" - integrity sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA== - acorn-jsx@^5.3.2: version "5.3.2" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + version "8.3.4" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" acorn@^6.4.1: version "6.4.2" - resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" + resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^8.14.0, acorn@^8.8.2: +acorn@^8.11.0, acorn@^8.14.0, acorn@^8.4.1, acorn@^8.8.2, acorn@^8.9.0: version "8.14.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== -acorn@^8.4.1: - version "8.5.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== - -acorn@^8.5.0: - version "8.7.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== - -acorn@^8.9.0: - version "8.12.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== - add-stream@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz" - integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= + resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" + integrity sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ== adm-zip@0.5.5: version "0.5.5" - resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.5.tgz" + resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.5.tgz#b6549dbea741e4050309f1bb4d47c47397ce2c4f" integrity sha512-IWwXKnCbirdbyXSfUDvCCrmYrOHANRZcc8NcRrvTlIApdl7PwE9oGcsYvNeJPAVY1M+70b4PxXGKIf8AEuiQ6w== -adm-zip@^0.4.9, adm-zip@~0.4.3: +adm-zip@^0.5.2: + version "0.5.16" + resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz#0b5e4c779f07dedea5805cdccb1147071d94a909" + integrity sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ== + +adm-zip@~0.4.3: version "0.4.16" - resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" + resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== agent-base@6, agent-base@^6.0.2: version "6.0.2" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: debug "4" agent-base@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== dependencies: es6-promisify "^5.0.0" @@ -4246,32 +3642,26 @@ agent-base@^7.1.0, agent-base@^7.1.2: integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== agentkeepalive@^4.1.3: - version "4.1.4" - resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz" - integrity sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ== - dependencies: - debug "^4.1.0" - depd "^1.1.2" - humanize-ms "^1.2.1" - -agentkeepalive@^4.2.1: - version "4.3.0" - resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.3.0.tgz" - integrity sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg== + version "4.6.0" + resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz#35f73e94b3f40bf65f105219c623ad19c136ea6a" + integrity sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ== dependencies: - debug "^4.1.0" - depd "^2.0.0" humanize-ms "^1.2.1" aggregate-error@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" + resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-formats@3.0.1: +ajv-draft-04@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz#3b64761b268ba0b9e668f0b41ba53fce0ad77fc8" + integrity sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw== + +ajv-formats@3.0.1, ajv-formats@~3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578" integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ== @@ -4280,14 +3670,14 @@ ajv-formats@3.0.1: ajv-formats@^2.1.0, ajv-formats@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" + resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== dependencies: ajv "^8.0.0" ajv-keywords@^3.5.2: version "3.5.2" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== ajv-keywords@^5.1.0: @@ -4299,8 +3689,8 @@ ajv-keywords@^5.1.0: ajv@^5.0.0: version "5.5.2" - resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= + resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + integrity sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw== dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -4309,7 +3699,7 @@ ajv@^5.0.0: ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" @@ -4317,17 +3707,7 @@ ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.3.0: - version "8.11.0" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ajv@^8.17.1, ajv@^8.9.0: +ajv@^8.0.0, ajv@^8.17.1, ajv@^8.3.0, ajv@^8.9.0: version "8.17.1" resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== @@ -4337,33 +3717,43 @@ ajv@^8.17.1, ajv@^8.9.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" +ajv@~8.13.0: + version "8.13.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz#a3939eaec9fb80d217ddf0c3376948c023f28c91" + integrity sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA== + dependencies: + fast-deep-equal "^3.1.3" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.4.1" + ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + version "3.0.1" + resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: - string-width "^3.0.0" + string-width "^4.1.0" -ansi-colors@4.1.1, ansi-colors@^4.1.1: +ansi-colors@4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-colors@^1.0.1: version "1.1.0" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== dependencies: ansi-wrap "^0.1.0" -ansi-colors@^4.1.3: +ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== ansi-escapes@^3.0.0: version "3.2.0" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: @@ -4382,29 +3772,24 @@ ansi-escapes@^7.0.0: ansi-gray@^0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz" - integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= + resolved "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" + integrity sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw== dependencies: ansi-wrap "0.1.0" ansi-regex@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + version "3.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== -ansi-regex@^5.0.0, ansi-regex@^5.0.1: +ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1, ansi-regex@^6.1.0: @@ -4414,26 +3799,26 @@ ansi-regex@^6.0.1, ansi-regex@^6.1.0: ansi-styles@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== ansi-styles@^3.2.1: version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" ansi-styles@^5.0.0: version "5.2.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== ansi-styles@^6.1.0: @@ -4443,38 +3828,38 @@ ansi-styles@^6.1.0: ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz" - integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= + resolved "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" + integrity sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw== any-observable@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz" + resolved "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== any-promise@^1.0.0: version "1.3.0" - resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== anymatch@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + version "3.1.3" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" api-documenter-me@0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/api-documenter-me/-/api-documenter-me-0.1.1.tgz" + resolved "https://registry.npmjs.org/api-documenter-me/-/api-documenter-me-0.1.1.tgz#961abb299c3737b01f2dd7aa10b0caf1c9110538" integrity sha512-h6CjdRZUcv6lK3VfnX8CDF+2CfA5DBqg3EfR+HOEZp4AggQfKZ4D5vegvdt5P2n+b95GRounfU5u3TJ2PAIlLQ== dependencies: "@microsoft/tsdoc" "0.12.24" @@ -4487,7 +3872,7 @@ api-documenter-me@0.1.1: api-extractor-me@0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/api-extractor-me/-/api-extractor-me-0.1.2.tgz" + resolved "https://registry.npmjs.org/api-extractor-me/-/api-extractor-me-0.1.2.tgz#ca0771a459c5982676565bae58fc955fbada8bbb" integrity sha512-wgZeRMhIG1HRsvfjDRSHoamMPa2OHw+smMJOyU1WMXhsq4MvhVpM4sVFfWwzFmyKoh6tzxi26A6GGL/idGXsnw== dependencies: "@microsoft/tsdoc" "0.12.24" @@ -4504,7 +3889,7 @@ api-extractor-me@0.1.2: api-extractor-model-me@0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/api-extractor-model-me/-/api-extractor-model-me-0.1.1.tgz" + resolved "https://registry.npmjs.org/api-extractor-model-me/-/api-extractor-model-me-0.1.1.tgz#e656e9d31e50976dd2a8d1d6e351bac4a6149932" integrity sha512-Ez801ZMADfkseOWNRFquvyQYDm3D9McpxfkKMWL6JFCGcpub0miJ+TFNphIR1nSZbrsxz3kIeOovNMY4VlL6Bw== dependencies: "@microsoft/tsdoc" "0.12.24" @@ -4512,26 +3897,26 @@ api-extractor-model-me@0.1.1: append-buffer@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz" - integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= + resolved "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + integrity sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA== dependencies: buffer-equal "^1.0.0" append-transform@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz" + resolved "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz#99d9d29c7b38391e6f428d28ce136551f0b77e12" integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== dependencies: default-require-extensions "^3.0.0" aproba@^1.0.3: version "1.2.0" - resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" + resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== "aproba@^1.0.3 || ^2.0.0", aproba@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz" + resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== archiver-utils@^5.0.0, archiver-utils@^5.0.2: @@ -4562,20 +3947,12 @@ archiver@^7.0.0: archy@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" - integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= - -are-we-there-yet@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz" - integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== - dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" + resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== are-we-there-yet@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz#679df222b278c64f2cdba1175cdc00b0d96164bd" integrity sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg== dependencies: delegates "^1.0.0" @@ -4583,7 +3960,7 @@ are-we-there-yet@^3.0.0: are-we-there-yet@~1.1.2: version "1.1.7" - resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== dependencies: delegates "^1.0.0" @@ -4591,64 +3968,56 @@ are-we-there-yet@~1.1.2: arg@^4.1.0: version "4.1.3" - resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== argparse@^1.0.7, argparse@~1.0.9: version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argparse@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== argsarray@^0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz" - integrity sha1-bnIHtOzbObCviDA/pa4ivajfYcs= + resolved "https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz#6e7207b4ecdb39b0af88303fa5ae22bda8df61cb" + integrity sha512-u96dg2GcAKtpTrBdDoFIM7PjcBA+6rSP0OR94MOReNRyUECL6MtQt5XXmRr4qrftYaef9+l5hcpO5te7sML1Cg== arr-diff@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== arr-filter@^1.1.1: version "1.1.2" - resolved "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz" - integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= + resolved "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA== dependencies: make-iterator "^1.0.0" arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" + resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-map@^2.0.0, arr-map@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz" - integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= + resolved "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw== dependencies: make-iterator "^1.0.0" arr-union@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-buffer-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" - integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== - dependencies: - call-bind "^1.0.5" - is-array-buffer "^3.0.4" + resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== -array-buffer-byte-length@^1.0.2: +array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b" integrity sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== @@ -4658,33 +4027,33 @@ array-buffer-byte-length@^1.0.2: array-differ@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz" + resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== array-each@^1.0.0, array-each@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz" - integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= + resolved "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" + integrity sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA== array-find-index@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz" + resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw== array-flatten@1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== array-flatten@3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz" + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz#6428ca2ee52c7b823192ec600fa3ed2f157cd541" integrity sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA== array-ify@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" - integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= + resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== array-includes@^3.1.8: version "3.1.8" @@ -4700,27 +4069,27 @@ array-includes@^3.1.8: array-initial@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz" - integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= + resolved "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw== dependencies: array-slice "^1.0.0" is-number "^4.0.0" array-last@^1.1.1: version "1.3.0" - resolved "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz" + resolved "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== dependencies: is-number "^4.0.0" array-slice@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz" + resolved "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== array-sort@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz" + resolved "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== dependencies: default-compare "^1.0.0" @@ -4729,25 +4098,25 @@ array-sort@^1.0.0: array-union@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= + resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng== dependencies: array-uniq "^1.0.1" array-union@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" + resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== array-uniq@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== array-unique@^0.3.2: version "0.3.2" - resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== array.prototype.findlastindex@^1.2.5: version "1.2.5" @@ -4781,19 +4150,18 @@ array.prototype.flatmap@^1.3.2: es-abstract "^1.23.5" es-shim-unscopables "^1.0.2" -arraybuffer.prototype.slice@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" - integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== +array.prototype.reduce@^1.0.6: + version "1.0.7" + resolved "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.7.tgz#6aadc2f995af29cb887eb866d981dc85ab6f7dc7" + integrity sha512-mzmiUCVwtiD4lgxYP8g7IYy8El8p2CSMePvIbTS7gchKir/L1fgJrk0yDKmAX6mnRQFKNADYIk8nNlTris5H1Q== dependencies: - array-buffer-byte-length "^1.0.1" - call-bind "^1.0.5" + call-bind "^1.0.7" define-properties "^1.2.1" - es-abstract "^1.22.3" - es-errors "^1.2.1" - get-intrinsic "^1.2.3" - is-array-buffer "^3.0.4" - is-shared-array-buffer "^1.0.2" + es-abstract "^1.23.2" + es-array-method-boxes-properly "^1.0.0" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + is-string "^1.0.7" arraybuffer.prototype.slice@^1.0.4: version "1.0.4" @@ -4810,23 +4178,23 @@ arraybuffer.prototype.slice@^1.0.4: arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== arrify@^2.0.0, arrify@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" + resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== as-array@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/as-array/-/as-array-2.0.0.tgz" - integrity sha1-TwSAXYf4/OjlEbwhCPjl46KH1Uc= + resolved "https://registry.npmjs.org/as-array/-/as-array-2.0.0.tgz#4f04805d87f8fce8e511bc2108f8e5e3a287d547" + integrity sha512-1Sd1LrodN0XYxYeZcN1J4xYZvmvTwD5tDWaPUGPIzH1mFsmzsPnVtd2exWhecMjtZk/wYWjNZJiD3b1SLCeJqg== asap@^2.0.0: version "2.0.6" - resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" - integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== asn1.js@^4.10.1: version "4.10.1" @@ -4837,47 +4205,38 @@ asn1.js@^4.10.1: inherits "^2.0.1" minimalistic-assert "^1.0.0" -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + version "0.2.6" + resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== assert@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz" - integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== + version "2.1.0" + resolved "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" + integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== dependencies: - es6-object-assign "^1.1.0" - is-nan "^1.2.1" - object-is "^1.0.1" - util "^0.12.0" + call-bind "^1.0.2" + is-nan "^1.3.2" + object-is "^1.1.5" + object.assign "^4.1.4" + util "^0.12.5" assertion-error@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" + resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== assign-symbols@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== ast-types@^0.13.4: version "0.13.4" @@ -4888,7 +4247,7 @@ ast-types@^0.13.4: async-done@^1.2.0, async-done@^1.2.2: version "1.3.2" - resolved "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz" + resolved "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== dependencies: end-of-stream "^1.1.0" @@ -4897,9 +4256,14 @@ async-done@^1.2.0, async-done@^1.2.2: stream-exhaust "^1.0.1" async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + version "1.0.6" + resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.6.tgz#52f1d9403818c179b7561e11a5d1b77eb2160e77" + integrity sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg== + +async-function@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz#509c9fca60eaf85034c6829838188e4e4c8ffb2b" + integrity sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA== async-lock@1.4.1: version "1.4.1" @@ -4908,55 +4272,38 @@ async-lock@1.4.1: async-settle@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz" - integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= + resolved "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw== dependencies: async-done "^1.2.2" -async@^2.1.2, async@^2.6.2: - version "2.6.3" - resolved "https://registry.npmjs.org/async/-/async-2.6.3.tgz" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -async@^2.6.4: +async@^2.1.2, async@^2.6.4: version "2.6.4" - resolved "https://registry.npmjs.org/async/-/async-2.6.4.tgz" + resolved "https://registry.npmjs.org/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" -async@^3.1.0: - version "3.2.1" - resolved "https://registry.npmjs.org/async/-/async-3.2.1.tgz" - integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== - -async@^3.2.4: +async@^3.2.3, async@^3.2.4: version "3.2.6" resolved "https://registry.npmjs.org/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== asynckit@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== at-least-node@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" + resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== atob@^2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" + resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== - available-typed-arrays@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" @@ -4966,18 +4313,18 @@ available-typed-arrays@^1.0.7: aws-sign2@~0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + version "1.13.2" + resolved "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef" + integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== axios@^1.6.0: - version "1.6.8" - resolved "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" - integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + version "1.7.9" + resolved "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" + integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -4990,8 +4337,8 @@ b4a@^1.6.4: babel-code-frame@^6.26.0: version "6.26.0" - resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g== dependencies: chalk "^1.1.3" esutils "^2.0.2" @@ -4999,7 +4346,7 @@ babel-code-frame@^6.26.0: babel-generator@^6.18.0: version "6.26.1" - resolved "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz" + resolved "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" @@ -5023,29 +4370,29 @@ babel-loader@8.4.1: babel-messages@^6.23.0: version "6.23.0" - resolved "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + resolved "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w== dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@istanbuljs/load-nyc-config" "^1.0.0" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" + istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" babel-plugin-polyfill-corejs2@^0.4.10: - version "0.4.11" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" - integrity sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q== + version "0.4.12" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz#ca55bbec8ab0edeeef3d7b8ffd75322e210879a9" + integrity sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== dependencies: "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.6.2" + "@babel/helper-define-polyfill-provider" "^0.6.3" semver "^6.3.1" babel-plugin-polyfill-corejs3@^0.10.6: @@ -5057,42 +4404,45 @@ babel-plugin-polyfill-corejs3@^0.10.6: core-js-compat "^3.38.0" babel-plugin-polyfill-regenerator@^0.6.1: - version "0.6.2" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz#addc47e240edd1da1058ebda03021f382bba785e" - integrity sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg== + version "0.6.3" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz#abeb1f3f1c762eace37587f42548b08b57789bc8" + integrity sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" + "@babel/helper-define-polyfill-provider" "^0.6.3" babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + version "1.1.0" + resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" + integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" - resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" babel-template@^6.16.0: version "6.26.0" - resolved "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + resolved "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg== dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -5102,8 +4452,8 @@ babel-template@^6.16.0: babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" - resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA== dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -5117,8 +4467,8 @@ babel-traverse@^6.18.0, babel-traverse@^6.26.0: babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" - resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g== dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -5127,13 +4477,13 @@ babel-types@^6.18.0, babel-types@^6.26.0: babylon@^6.18.0: version "6.18.0" - resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz" + resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== bach@^1.0.0: version "1.2.0" - resolved "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz" - integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= + resolved "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg== dependencies: arr-filter "^1.1.1" arr-flatten "^1.0.1" @@ -5146,15 +4496,15 @@ bach@^1.0.0: now-and-later "^2.0.0" backbone@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz" - integrity sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ== + version "1.6.0" + resolved "https://registry.npmjs.org/backbone/-/backbone-1.6.0.tgz#5cdfa25257819b223109a77a74dde26d38995930" + integrity sha512-13PUjmsgw/49EowNcQvfG4gmczz1ximTMhUktj0Jfrjth0MVaTxehpU+qYYX4MxnuIuhmvBLC6/ayxuAGnOhbA== dependencies: underscore ">=1.8.3" balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== bare-events@^2.2.0: @@ -5164,22 +4514,22 @@ bare-events@^2.2.0: base64-arraybuffer-es6@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-1.0.0.tgz" + resolved "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-1.0.0.tgz#dde6ca5f79b5505e86c7ed66af3b14b57c0ce29a" integrity sha512-cPau+CwFZLR/HeQrOCWhbmGcUiyfl8kvnKoazNX9zW/Tn7nKJCRe9Vfz2qOEf/rODgCTCvvCXMf0acV8vB0uOw== base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== base64id@2.0.0, base64id@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz" + resolved "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== base@^0.11.1: version "0.11.2" - resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz" + resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" @@ -5191,13 +4541,15 @@ base@^0.11.1: pascalcase "^0.1.1" basic-auth-connect@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz" - integrity sha1-/bC0OWLKe0BFanwrtI/hc9otISI= + version "1.1.0" + resolved "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.1.0.tgz#b44af37d5b3bd7561b56491e58cf26ae1578f0c7" + integrity sha512-rKcWjfiRZ3p5WS9e5q6msXa07s6DaFAMXoyowV+mb2xQG+oYdw2QEUyKi0Xp95JvXzShlM+oGy5QuqSK6TfC1Q== + dependencies: + tsscmp "^1.0.6" basic-auth@^2.0.1, basic-auth@~2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz" + resolved "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg== dependencies: safe-buffer "5.1.2" @@ -5209,58 +4561,58 @@ basic-ftp@^5.0.2: bcrypt-pbkdf@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== dependencies: tweetnacl "^0.14.3" before-after-hook@^2.2.0: - version "2.2.2" - resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz" - integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== + version "2.2.3" + resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== better-path-resolve@1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz" + resolved "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz#13a35a1104cdd48a7b74bf8758f96a1ee613f99d" integrity sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g== dependencies: is-windows "^1.0.0" big.js@^5.2.2: version "5.2.2" - resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz" + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== bignumber.js@^9.0.0: - version "9.0.1" - resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== + version "9.1.2" + resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== binary-extensions@^1.0.0: version "1.13.1" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + version "2.3.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== binaryextensions@^2.2.0: version "2.3.0" - resolved "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.3.0.tgz" + resolved "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.3.0.tgz#1d269cbf7e6243ea886aa41453c3651ccbe13c22" integrity sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg== bindings@^1.5.0: version "1.5.0" - resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" + resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: file-uri-to-path "1.0.0" bl@^4.0.3, bl@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" + resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== dependencies: buffer "^5.5.0" @@ -5269,47 +4621,26 @@ bl@^4.0.3, bl@^4.1.0: blocking-proxy@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-1.0.1.tgz" + resolved "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-1.0.1.tgz#81d6fd1fe13a4c0d6957df7f91b75e98dac40cb2" integrity sha512-KE8NFMZr3mN2E0HcvCgRtX7DjhiIQrwle+nSVJVC/yqFb9+xznHl2ZcoBp2L9qzkI4t4cBFJ1efXF8Dwi132RA== dependencies: minimist "^1.2.0" bluebird@3.7.2: version "3.7.2" - resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + version "4.12.1" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" + integrity sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg== bn.js@^5.2.1: version "5.2.1" resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.19.0, body-parser@^1.18.3, body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - body-parser@1.20.2: version "1.20.2" resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" @@ -5328,7 +4659,7 @@ body-parser@1.20.2: type-is "~1.6.18" unpipe "1.0.0" -body-parser@1.20.3: +body-parser@1.20.3, body-parser@^1.18.3, body-parser@^1.19.0: version "1.20.3" resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== @@ -5348,7 +4679,7 @@ body-parser@1.20.3: boxen@^5.0.0: version "5.1.2" - resolved "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz" + resolved "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== dependencies: ansi-align "^3.0.0" @@ -5362,7 +4693,7 @@ boxen@^5.0.0: brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -5370,14 +4701,14 @@ brace-expansion@^1.1.7: brace-expansion@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" braces@^2.3.1, braces@^2.3.2: version "2.3.2" - resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" + resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" @@ -5391,14 +4722,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -braces@^3.0.3: +braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -5407,17 +4731,17 @@ braces@^3.0.3: brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browser-stdout@1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" + resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: +browserify-aes@^1.0.4, browserify-aes@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" @@ -5427,9 +4751,9 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" -browserify-cipher@^1.0.0: +browserify-cipher@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz" + resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: browserify-aes "^1.0.4" @@ -5438,7 +4762,7 @@ browserify-cipher@^1.0.0: browserify-des@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz" + resolved "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: cipher-base "^1.0.1" @@ -5447,14 +4771,15 @@ browserify-des@^1.0.0: safe-buffer "^5.1.2" browserify-rsa@^4.0.0, browserify-rsa@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== + version "4.1.1" + resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz#06e530907fe2949dc21fc3c2e2302e10b1437238" + integrity sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ== dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" + bn.js "^5.2.1" + randombytes "^2.1.0" + safe-buffer "^5.2.1" -browserify-sign@^4.0.0: +browserify-sign@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz#7afe4c01ec7ee59a89a558a4b75bd85ae62d4208" integrity sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw== @@ -5472,32 +4797,11 @@ browserify-sign@^4.0.0: browserify-zlib@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz" + resolved "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: pako "~1.0.5" -browserslist@^4.14.5, browserslist@^4.16.6: - version "4.17.1" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz" - integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== - dependencies: - caniuse-lite "^1.0.30001259" - electron-to-chromium "^1.3.846" - escalade "^3.1.1" - nanocolors "^0.1.5" - node-releases "^1.1.76" - -browserslist@^4.21.9: - version "4.21.10" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz" - integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== - dependencies: - caniuse-lite "^1.0.30001517" - electron-to-chromium "^1.4.477" - node-releases "^2.0.13" - update-browserslist-db "^1.0.11" - browserslist@^4.24.0, browserslist@^4.24.3: version "4.24.4" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" @@ -5510,14 +4814,14 @@ browserslist@^4.24.0, browserslist@^4.24.3: browserstack@^1.5.1: version "1.6.1" - resolved "https://registry.npmjs.org/browserstack/-/browserstack-1.6.1.tgz" + resolved "https://registry.npmjs.org/browserstack/-/browserstack-1.6.1.tgz#e051f9733ec3b507659f395c7a4765a1b1e358b3" integrity sha512-GxtFjpIaKdbAyzHfFDKixKO8IBT7wR3NjbzrGc78nNs/Ciys9wU3/nBtsqsWv5nDSrdI5tz0peKuzCPuNXNUiw== dependencies: https-proxy-agent "^2.2.1" bser@2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" + resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== dependencies: node-int64 "^0.4.0" @@ -5529,32 +4833,32 @@ buffer-crc32@^1.0.0: buffer-crc32@~0.2.3: version "0.2.13" - resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== buffer-equal-constant-time@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz" - integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= + resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== buffer-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz" - integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= + version "1.0.1" + resolved "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.1.tgz#2f7651be5b1b3f057fcd6e7ee16cf34767077d90" + integrity sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg== buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-xor@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== buffer@^5.5.0: version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" + resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== dependencies: base64-js "^1.3.1" @@ -5562,7 +4866,7 @@ buffer@^5.5.0: buffer@^6.0.3: version "6.0.3" - resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: base64-js "^1.3.1" @@ -5570,52 +4874,42 @@ buffer@^6.0.3: builtin-modules@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== -builtin-modules@^3.0.0: - version "3.2.0" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz" - integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== builtin-status-codes@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== builtins@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz" - integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= + resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== byline@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz" - integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= + resolved "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + integrity sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q== byte-size@^7.0.0: version "7.0.1" - resolved "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz" + resolved "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz#b1daf3386de7ab9d706b941a748dbfc71130dee3" integrity sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A== -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - bytes@3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== cacache@^15.0.5, cacache@^15.2.0: version "15.3.0" - resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz" + resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== dependencies: "@npmcli/fs" "^1.0.0" @@ -5637,33 +4931,27 @@ cacache@^15.0.5, cacache@^15.2.0: tar "^6.0.2" unique-filename "^1.1.1" -cacache@^16.1.0: - version "16.1.3" - resolved "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz" - integrity sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ== - dependencies: - "@npmcli/fs" "^2.1.0" - "@npmcli/move-file" "^2.0.0" - chownr "^2.0.0" - fs-minipass "^2.1.0" - glob "^8.0.1" - infer-owner "^1.0.4" - lru-cache "^7.7.1" - minipass "^3.1.6" - minipass-collect "^1.0.2" +cacache@^18.0.0: + version "18.0.4" + resolved "https://registry.npmjs.org/cacache/-/cacache-18.0.4.tgz#4601d7578dadb59c66044e157d02a3314682d6a5" + integrity sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ== + dependencies: + "@npmcli/fs" "^3.1.0" + fs-minipass "^3.0.0" + glob "^10.2.2" + lru-cache "^10.0.1" + minipass "^7.0.3" + minipass-collect "^2.0.1" minipass-flush "^1.0.5" minipass-pipeline "^1.2.4" - mkdirp "^1.0.4" p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^9.0.0" + ssri "^10.0.0" tar "^6.1.11" - unique-filename "^2.0.0" + unique-filename "^3.0.0" cache-base@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz" + resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" @@ -5678,13 +4966,13 @@ cache-base@^1.0.1: cacheable-lookup@^5.0.3: version "5.0.4" - resolved "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz" + resolved "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== cacheable-request@^7.0.1: - version "7.0.2" - resolved "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz" - integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + version "7.0.4" + resolved "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" + integrity sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg== dependencies: clone-response "^1.0.2" get-stream "^5.1.0" @@ -5696,7 +4984,7 @@ cacheable-request@^7.0.1: caching-transform@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz" + resolved "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== dependencies: hasha "^5.0.0" @@ -5712,26 +5000,7 @@ call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1: es-errors "^1.3.0" function-bind "^1.1.2" -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" - integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - set-function-length "^1.2.1" - -call-bind@^1.0.8: +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.7, call-bind@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== @@ -5750,18 +5019,18 @@ call-bound@^1.0.2, call-bound@^1.0.3: get-intrinsic "^1.2.6" call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz" - integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + version "1.0.2" + resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" + integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== callsites@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase-keys@^6.2.2: version "6.2.2" - resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" + resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== dependencies: camelcase "^5.3.1" @@ -5770,23 +5039,18 @@ camelcase-keys@^6.2.2: camelcase@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= + resolved "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg== camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.0.0, camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001517: - version "1.0.30001669" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz" - integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== + version "6.3.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001688: version "1.0.30001695" @@ -5795,8 +5059,8 @@ caniuse-lite@^1.0.30001688: caseless@~0.12.0: version "0.12.0" - resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== chai-as-promised@7.1.2: version "7.1.2" @@ -5805,10 +5069,10 @@ chai-as-promised@7.1.2: dependencies: check-error "^1.0.2" -chai-exclude@2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/chai-exclude/-/chai-exclude-2.1.0.tgz" - integrity sha512-IBnm50Mvl3O1YhPpTgbU8MK0Gw7NHcb18WT2TxGdPKOMtdtZVKLHmQwdvOF7mTlHVQStbXuZKFwkevFtbHjpVg== +chai-exclude@2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/chai-exclude/-/chai-exclude-2.1.1.tgz#840d2760170698cbd8b3c41b2122024a779aeb9a" + integrity sha512-IHgNmgAFOkyRPnmOtZio9UsOHQ6RnzVr2LOs+5V9urYYqjhV/ERLQapC0Eq2DmID5eDWyngAcBxNUm0ZK0QbrQ== dependencies: fclone "^1.0.11" @@ -5840,7 +5104,7 @@ chai@4.5.0: chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" @@ -5848,8 +5112,8 @@ chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -5857,9 +5121,9 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" @@ -5878,15 +5142,10 @@ char-regex@^1.0.2: chardet@^0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -check-error@^1.0.3: +check-error@^1.0.2, check-error@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== @@ -5895,8 +5154,8 @@ check-error@^1.0.3: child-process-promise@2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/child-process-promise/-/child-process-promise-2.2.1.tgz" - integrity sha1-RzChHvYQ+tRQuPIjx50x172tgHQ= + resolved "https://registry.npmjs.org/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074" + integrity sha512-Fi4aNdqBsr0mv+jgWxcZ/7rAIC2mgihrptyVI4foh/rrjY/3BNjfP9+oaiFx/fzim+1ZyCNBae0DlyfQhSugog== dependencies: cross-spawn "^4.0.2" node-version "^1.0.0" @@ -5904,7 +5163,7 @@ child-process-promise@2.2.1: chokidar@3.5.3: version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" @@ -5919,7 +5178,7 @@ chokidar@3.5.3: chokidar@^2.0.0: version "2.1.8" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== dependencies: anymatch "^2.0.0" @@ -5936,22 +5195,7 @@ chokidar@^2.0.0: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chokidar@^3.6.0: +chokidar@^3.5.1, chokidar@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -5968,18 +5212,18 @@ chokidar@^3.6.0: chownr@^1.1.1, chownr@^1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" + resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== chownr@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz" + resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + version "1.0.4" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== chromedriver@119.0.1: version "119.0.1" @@ -5996,42 +5240,32 @@ chromedriver@119.0.1: ci-info@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.1: - version "3.2.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz" - integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== - -ci-info@^3.2.0: - version "3.3.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz" - integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== - -ci-info@^3.7.0: - version "3.8.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz" - integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== +ci-info@^3.2.0, ci-info@^3.7.0: + version "3.9.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + version "1.0.6" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz#8fe672437d01cd6c4561af5334e0cc50ff1955f7" + integrity sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw== dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" + inherits "^2.0.4" + safe-buffer "^5.2.1" cjson@^0.3.1: version "0.3.3" - resolved "https://registry.npmjs.org/cjson/-/cjson-0.3.3.tgz" - integrity sha1-qS2ceG5b+bkwgGMp7gXV0yYbSvo= + resolved "https://registry.npmjs.org/cjson/-/cjson-0.3.3.tgz#a92d9c786e5bf9b930806329ee05d5d3261b4afa" + integrity sha512-yKNcXi/Mvi5kb1uK0sahubYiyfUO2EUgOp4NcY9+8NX5Xmc+4yeNogZuLFkpLBBj7/QI9MjRUIuXrV9XOw5kVg== dependencies: json-parse-helpfulerror "^1.0.3" class-utils@^0.3.5: version "0.3.6" - resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz" + resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" @@ -6041,24 +5275,24 @@ class-utils@^0.3.5: clean-stack@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" + resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== cli-boxes@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz" + resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== dependencies: restore-cursor "^2.0.0" cli-cursor@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== dependencies: restore-cursor "^3.1.0" @@ -6076,9 +5310,9 @@ cli-highlight@^2.1.11: yargs "^16.0.0" cli-spinners@^2.5.0: - version "2.6.0" - resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz" - integrity sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q== + version "2.9.2" + resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== cli-table3@^0.6.5: version "0.6.5" @@ -6091,28 +5325,28 @@ cli-table3@^0.6.5: cli-table@0.3.11: version "0.3.11" - resolved "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz" + resolved "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz#ac69cdecbe81dccdba4889b9a18b7da312a9d3ee" integrity sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ== dependencies: colors "1.0.3" cli-truncate@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz" - integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= + resolved "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + integrity sha512-f4r4yJnbT++qUPI9NR4XLDLq41gQ+uqnPItWG0F5ZkehuNiTTa3EY0S4AqTSUOeJ7/zU41oWPQSNkW5BqPL9bg== dependencies: slice-ansi "0.0.4" string-width "^1.0.1" cli-width@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz" + resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== cliui@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + resolved "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w== dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -6120,7 +5354,7 @@ cliui@^3.2.0: cliui@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" + resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== dependencies: string-width "^4.2.0" @@ -6129,7 +5363,7 @@ cliui@^6.0.0: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" @@ -6138,7 +5372,7 @@ cliui@^7.0.2: cliui@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" @@ -6147,12 +5381,12 @@ cliui@^8.0.1: clone-buffer@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz" - integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= + resolved "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g== clone-deep@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" + resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== dependencies: is-plain-object "^2.0.4" @@ -6160,30 +5394,30 @@ clone-deep@^4.0.1: shallow-clone "^3.0.0" clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + version "1.0.3" + resolved "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== dependencies: mimic-response "^1.0.0" clone-stats@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz" - integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= + resolved "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag== clone@2.1.2, clone@^2.1.1: version "2.1.2" - resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= + resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== clone@^1.0.2: version "1.0.4" - resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== cloneable-readable@^1.0.0: version "1.1.3" - resolved "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz" + resolved "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== dependencies: inherits "^2.0.1" @@ -6196,30 +5430,30 @@ cloneable-readable@^1.0.0: cmd-shim@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.1.0.tgz" + resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" integrity sha512-lb9L7EM4I/ZRVuljLPEtUJOP+xiQVknZ4ZMpMgEp4JzNldPb27HU03hi6K1/6CoIuit/Zm/LQXySErFeXxDprw== dependencies: mkdirp-infer-owner "^2.0.0" co@^4.6.0: version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== code-point-at@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + version "1.0.2" + resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== collection-map@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz" - integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= + resolved "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA== dependencies: arr-map "^2.0.2" for-own "^1.0.0" @@ -6227,113 +5461,113 @@ collection-map@^1.0.0: collection-visit@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== dependencies: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.1: +color-convert@^1.9.0, color-convert@^1.9.3: version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.5.2: - version "1.6.0" - resolved "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz" - integrity sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA== +color-string@^1.6.0: + version "1.9.1" + resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" + integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" -color-support@^1.1.2, color-support@^1.1.3: +color-support@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz" + resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -color@3.0.x: - version "3.0.0" - resolved "https://registry.npmjs.org/color/-/color-3.0.0.tgz" - integrity sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w== +color@^3.1.3: + version "3.2.1" + resolved "https://registry.npmjs.org/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" + integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== dependencies: - color-convert "^1.9.1" - color-string "^1.5.2" + color-convert "^1.9.3" + color-string "^1.6.0" colorette@^1.1.0: version "1.4.0" - resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz" + resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== colorette@^2.0.19: - version "2.0.19" - resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz" - integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + version "2.0.20" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== colors@1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= + resolved "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw== -colors@1.4.0, colors@^1.2.1, colors@~1.4.0: +colors@1.4.0, colors@~1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz" + resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== colors@~1.2.1: version "1.2.5" - resolved "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz" + resolved "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc" integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg== colorspace@1.1.x: - version "1.1.2" - resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz" - integrity sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ== + version "1.1.4" + resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" + integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w== dependencies: - color "3.0.x" + color "^3.1.3" text-hex "1.0.x" columnify@^1.5.4: - version "1.5.4" - resolved "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" - integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= + version "1.6.0" + resolved "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" + integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== dependencies: - strip-ansi "^3.0.0" + strip-ansi "^6.0.1" wcwidth "^1.0.0" combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" commander@^10.0.0: version "10.0.1" - resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" + resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^2.12.1, commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.7.1: +commander@^2.12.1, commander@^2.19.0, commander@^2.20.0, commander@^2.7.1: version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^5.1.0: @@ -6343,31 +5577,31 @@ commander@^5.1.0: commenting@~1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/commenting/-/commenting-1.1.0.tgz" + resolved "https://registry.npmjs.org/commenting/-/commenting-1.1.0.tgz#fae14345c6437b8554f30bc6aa6c1e1633033590" integrity sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA== commondir@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== compare-func@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" + resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== dependencies: array-ify "^1.0.0" dot-prop "^5.1.0" compare-versions@^6.1.0: - version "6.1.0" - resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a" - integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg== + version "6.1.1" + resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9" + integrity sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg== component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + version "1.3.1" + resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz#ef1d5796f7d93f135ee6fb684340b26403c97d17" + integrity sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ== compress-commons@^6.0.2: version "6.0.2" @@ -6380,34 +5614,34 @@ compress-commons@^6.0.2: normalize-path "^3.0.0" readable-stream "^4.0.0" -compressible@~2.0.16: +compressible@~2.0.18: version "2.0.18" - resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz" + resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== dependencies: mime-db ">= 1.43.0 < 2" compression@^1.7.0: - version "1.7.4" - resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz" - integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== + version "1.7.5" + resolved "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz#fdd256c0a642e39e314c478f6c2cd654edd74c93" + integrity sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q== dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.16" + bytes "3.1.2" + compressible "~2.0.18" debug "2.6.9" + negotiator "~0.6.4" on-headers "~1.0.2" - safe-buffer "5.1.2" + safe-buffer "5.2.1" vary "~1.1.2" concat-map@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== concat-stream@^1.6.0: version "1.6.2" - resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" @@ -6417,7 +5651,7 @@ concat-stream@^1.6.0: concat-stream@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== dependencies: buffer-from "^1.0.0" @@ -6427,7 +5661,7 @@ concat-stream@^2.0.0: config-chain@^1.1.11, config-chain@^1.1.12: version "1.1.13" - resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz" + resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ== dependencies: ini "^1.3.4" @@ -6435,7 +5669,7 @@ config-chain@^1.1.11, config-chain@^1.1.12: configstore@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz" + resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== dependencies: dot-prop "^5.2.0" @@ -6447,7 +5681,7 @@ configstore@^5.0.1: connect@^3.7.0: version "3.7.0" - resolved "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz" + resolved "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ== dependencies: debug "2.6.9" @@ -6457,46 +5691,34 @@ connect@^3.7.0: console-browserify@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz" + resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== constants-browserify@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" + resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== content-disposition@0.5.4: version "0.5.4" - resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz" + resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: safe-buffer "5.2.1" -content-type@^1.0.4, content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -content-type@~1.0.5: +content-type@^1.0.4, content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== conventional-changelog-angular@^5.0.12: version "5.0.13" - resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== dependencies: compare-func "^2.0.0" @@ -6504,7 +5726,7 @@ conventional-changelog-angular@^5.0.12: conventional-changelog-core@^4.2.2: version "4.2.4" - resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== dependencies: add-stream "^1.0.0" @@ -6524,17 +5746,17 @@ conventional-changelog-core@^4.2.2: conventional-changelog-preset-loader@^2.3.4: version "2.3.4" - resolved "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== conventional-changelog-writer@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz" - integrity sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g== + version "5.0.1" + resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" + integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== dependencies: conventional-commits-filter "^2.0.7" dateformat "^3.0.0" - handlebars "^4.7.6" + handlebars "^4.7.7" json-stringify-safe "^5.0.1" lodash "^4.17.15" meow "^8.0.0" @@ -6544,16 +5766,16 @@ conventional-changelog-writer@^5.0.0: conventional-commits-filter@^2.0.7: version "2.0.7" - resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz" + resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== dependencies: lodash.ismatch "^4.4.0" modify-values "^1.0.0" conventional-commits-parser@^3.2.0: - version "3.2.2" - resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz" - integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== + version "3.2.4" + resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" + integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" @@ -6564,7 +5786,7 @@ conventional-commits-parser@^3.2.0: conventional-recommended-bump@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz" + resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" integrity sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw== dependencies: concat-stream "^2.0.0" @@ -6576,12 +5798,10 @@ conventional-recommended-bump@^6.1.0: meow "^8.0.0" q "^1.5.1" -convert-source-map@^1.0.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" +convert-source-map@^1.0.0, convert-source-map@^1.5.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== convert-source-map@^2.0.0: version "2.0.0" @@ -6590,13 +5810,8 @@ convert-source-map@^2.0.0: cookie-signature@1.0.6: version "1.0.6" - resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== cookie@0.6.0: version "0.6.0" @@ -6608,19 +5823,19 @@ cookie@0.7.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -cookie@~0.7.2: - version "0.7.2" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== +cookie@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz#27360701532116bd3f1f9416929d176afe1e4610" + integrity sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA== copy-descriptor@^0.1.0: version "0.1.1" - resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== copy-props@^2.0.1: version "2.0.5" - resolved "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz" + resolved "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz#03cf9ae328d4ebb36f8f1d804448a6af9ee3f2d2" integrity sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw== dependencies: each-props "^1.3.2" @@ -6635,22 +5850,22 @@ core-js-compat@^3.38.0, core-js-compat@^3.38.1: core-js@^2.4.0: version "2.6.12" - resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" + resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-util-is@1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== core-util-is@~1.0.0: version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cors@^2.8.5, cors@~2.8.5: version "2.8.5" - resolved "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz" + resolved "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== dependencies: object-assign "^4" @@ -6658,13 +5873,13 @@ cors@^2.8.5, cors@~2.8.5: corser@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz" - integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c= + resolved "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87" + integrity sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ== cosmiconfig@^7.0.0: - version "7.0.1" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz" - integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + version "7.1.0" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" + integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -6674,7 +5889,7 @@ cosmiconfig@^7.0.0: coveralls@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz" + resolved "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081" integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== dependencies: js-yaml "^3.13.1" @@ -6684,12 +5899,9 @@ coveralls@3.1.1: request "^2.88.2" crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.1.0" + version "1.2.2" + resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== crc32-stream@^6.0.0: version "6.0.0" @@ -6699,9 +5911,9 @@ crc32-stream@^6.0.0: crc-32 "^1.2.0" readable-stream "^4.0.0" -create-ecdh@^4.0.0: +create-ecdh@^4.0.4: version "4.0.4" - resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz" + resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== dependencies: bn.js "^4.1.0" @@ -6709,7 +5921,7 @@ create-ecdh@^4.0.0: create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" @@ -6718,9 +5930,9 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: +create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" - resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" @@ -6732,7 +5944,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: create-require@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-env@^7.0.3: @@ -6744,22 +5956,13 @@ cross-env@^7.0.3: cross-spawn@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz" - integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + integrity sha512-yAXz/pA1tD8Gtg2S98Ekf/sewp3Lcp3YoFKJ4Hkp5h5yLWnKVTDU0kwjKJ8NDCYcfTLfyGkzTikst+jWypT1iA== dependencies: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -cross-spawn@^7.0.1, cross-spawn@^7.0.5: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3, cross-spawn@^7.0.5: version "7.0.6" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -6769,30 +5972,31 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.5: which "^2.0.1" crypto-browserify@^3.12.0: - version "3.12.0" - resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + version "3.12.1" + resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz#bb8921bec9acc81633379aa8f52d69b0b69e0dac" + integrity sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ== dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" + browserify-cipher "^1.0.1" + browserify-sign "^4.2.3" + create-ecdh "^4.0.4" + create-hash "^1.2.0" + create-hmac "^1.1.7" + diffie-hellman "^5.0.3" + hash-base "~3.0.4" + inherits "^2.0.4" + pbkdf2 "^3.1.2" + public-encrypt "^4.0.3" + randombytes "^2.1.0" + randomfill "^1.0.4" crypto-random-string@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz" + resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== css@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/css/-/css-3.0.0.tgz" + resolved "https://registry.npmjs.org/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== dependencies: inherits "^2.0.4" @@ -6800,24 +6004,16 @@ css@^3.0.0: source-map-resolve "^0.6.0" csv-parse@^5.0.4: - version "5.3.0" - resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-5.3.0.tgz" - integrity sha512-UXJCGwvJ2fep39purtAn27OUYmxB1JQto+zhZ4QlJpzsirtSFbzLvip1aIgziqNdZp/TptvsKEV5BZSxe10/DQ== + version "5.6.0" + resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-5.6.0.tgz#219beace2a3e9f28929999d2aa417d3fb3071c7f" + integrity sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q== custom-event@~1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= + resolved "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" + integrity sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg== -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -d@^1.0.2: +d@1, d@^1.0.1, d@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/d/-/d-1.0.2.tgz#2aefd554b81981e7dccf72d6842ae725cb17e5de" integrity sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw== @@ -6827,13 +6023,13 @@ d@^1.0.2: dargs@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz" + resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== dashdash@^1.12.0: version "1.14.1" - resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== dependencies: assert-plus "^1.0.0" @@ -6842,15 +6038,6 @@ data-uri-to-buffer@^6.0.2: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz#8a58bb67384b261a38ef18bea1810cb01badd28b" integrity sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw== -data-view-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" - integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - data-view-buffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" @@ -6860,15 +6047,6 @@ data-view-buffer@^1.0.2: es-errors "^1.3.0" is-data-view "^1.0.2" -data-view-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" - integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-data-view "^1.0.1" - data-view-byte-length@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz#9e80f7ca52453ce3e93d25a35318767ea7704735" @@ -6878,15 +6056,6 @@ data-view-byte-length@^1.0.2: es-errors "^1.3.0" is-data-view "^1.0.2" -data-view-byte-offset@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" - integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - data-view-byte-offset@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz#068307f9b71ab76dbbe10291389e020856606191" @@ -6898,27 +6067,27 @@ data-view-byte-offset@^1.0.1: dataloader@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz" + resolved "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw== date-fns@^1.27.2: version "1.30.1" - resolved "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz" + resolved "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -date-format@^4.0.4, date-format@^4.0.5: - version "4.0.5" - resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.5.tgz" - integrity sha512-zBhRiN/M0gDxUoM2xRtzTjJzSg0XEi1ofYpF84PfXeS3hN2PsGxmc7jw3DNQtFlimRbMmob5FC3G0cJq6jQQpw== +date-format@^4.0.14: + version "4.0.14" + resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz#7a8e584434fb169a521c8b7aa481f355810d9400" + integrity sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg== dateformat@^3.0.0: version "3.0.3" - resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" + resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== debug-fabulous@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz" + resolved "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz#af8a08632465224ef4174a9f06308c3c2a1ebc8e" integrity sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg== dependencies: debug "3.X" @@ -6932,49 +6101,35 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: dependencies: ms "2.0.0" -debug@3.X, debug@^3.1.0, debug@^3.1.1, debug@^3.2.7: +debug@3.X, debug@^3.1.0, debug@^3.2.7: version "3.2.7" - resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" + resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" -debug@4, debug@4.3.3, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2: - version "4.3.3" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5: + version "4.4.0" + resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: - ms "2.1.2" + ms "^2.1.3" debug@4.3.1: version "4.3.1" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== dependencies: ms "2.1.2" -debug@^4.3.2: - version "4.3.5" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" - integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== - dependencies: - ms "2.1.2" - -debug@^4.3.4: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +debug@4.3.3: + version "4.3.3" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" -debug@^4.3.5: - version "4.4.0" - resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== - dependencies: - ms "^2.1.3" - -debug@~4.3.4: +debug@~4.3.1, debug@~4.3.2, debug@~4.3.4: version "4.3.7" resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== @@ -6983,48 +6138,48 @@ debug@~4.3.4: debuglog@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" - integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= + resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw== decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= + version "1.1.1" + resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz#04a2d523b2f18d80d0158a43b895d56dff8d19d8" + integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== dependencies: decamelize "^1.1.0" map-obj "^1.0.0" decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decamelize@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + version "0.2.2" + resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== decompress-response@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz" + resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== dependencies: mimic-response "^3.1.0" dedent@^0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-eql@^4.1.3: - version "4.1.3" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" - integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + version "4.1.4" + resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz#d0d3912865911bb8fac5afb4e3acfa6a28dc72b7" + integrity sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg== dependencies: type-detect "^4.0.0" @@ -7038,53 +6193,53 @@ deep-equal-in-any-order@^2.0.6: deep-extend@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" + resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-freeze@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz" - integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= + resolved "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" + integrity sha512-Z+z8HiAvsGwmjqlphnHW5oz6yWlOwu6EQfFTjmeTWlDeda3FS2yv3jhq35TX/ewmsnqB+RX2IdsIOyjJCQN5tg== deep-is@^0.1.3: version "0.1.4" - resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" + resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + version "4.3.1" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== default-compare@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz" + resolved "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== dependencies: kind-of "^5.0.2" default-require-extensions@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz" - integrity sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg== + version "3.0.1" + resolved "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz#bfae00feeaeada68c2ae256c62540f60b80625bd" + integrity sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw== dependencies: strip-bom "^4.0.0" default-resolution@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz" - integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= + resolved "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ== defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + version "1.0.4" + resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== dependencies: clone "^1.0.2" defer-to-connect@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz" + resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== define-data-property@^1.0.1, define-data-property@^1.1.4: @@ -7096,14 +6251,7 @@ define-data-property@^1.0.1, define-data-property@^1.1.4: es-errors "^1.3.0" gopd "^1.0.1" -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-properties@^1.2.0, define-properties@^1.2.1: +define-properties@^1.1.3, define-properties@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== @@ -7114,21 +6262,21 @@ define-properties@^1.2.0, define-properties@^1.2.1: define-property@^0.2.5: version "0.2.5" - resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz" + resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" @@ -7145,7 +6293,7 @@ degenerator@^5.0.0: del@6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/del/-/del-6.1.1.tgz" + resolved "https://registry.npmjs.org/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" integrity sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg== dependencies: globby "^11.0.1" @@ -7159,8 +6307,8 @@ del@6.1.1: del@^2.2.0: version "2.2.2" - resolved "https://registry.npmjs.org/del/-/del-2.2.2.tgz" - integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= + resolved "https://registry.npmjs.org/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + integrity sha512-Z4fzpbIRjOu7lO5jCETSWoqUDVe0IPOlfugBsF6suen2LKDlVb4QZpKEM9P+buNJ4KI1eN7I083w/pbKUpsrWQ== dependencies: globby "^5.0.0" is-path-cwd "^1.0.0" @@ -7172,115 +6320,105 @@ del@^2.2.0: delayed-stream@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@2.0.0, depd@^2.0.0, depd@~2.0.0: +depd@2.0.0, depd@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" + resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -depd@^1.1.2, depd@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - dependency-graph@0.11.0: version "0.11.0" - resolved "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.11.0.tgz" + resolved "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" + resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + version "1.1.0" + resolved "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" -destroy@1.2.0: +destroy@1.2.0, destroy@^1.0.4: version "1.2.0" - resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz" + resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== -destroy@^1.0.4, destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - detect-file@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz" - integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + resolved "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q== detect-indent@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A== dependencies: repeating "^2.0.0" detect-indent@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz" - integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== detect-indent@^6.0.0: version "6.1.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== detect-libc@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz" - integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== + version "2.0.3" + resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" + integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== detect-newline@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha512-CwffZFvlJffUg9zZA0uqrjQayUTC8ob94pnr5sFwaVv3IOmkfUHcWH+jXaQK3askE51Cqe8/9Ql/0uXNwqZ8Zg== dezalgo@^1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz" - integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= + version "1.0.4" + resolved "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81" + integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig== dependencies: asap "^2.0.0" wrappy "1" di@^0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/di/-/di-0.0.1.tgz" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + resolved "https://registry.npmjs.org/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" + integrity sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA== -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.0.6.tgz" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== diff@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" + resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== diff@^4.0.1, diff@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diffie-hellman@^5.0.0: +diffie-hellman@^5.0.3: version "5.0.3" - resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz" + resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: bn.js "^4.1.0" @@ -7289,7 +6427,7 @@ diffie-hellman@^5.0.0: dir-glob@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" + resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== dependencies: path-type "^4.0.0" @@ -7301,27 +6439,27 @@ discontinuous-range@1.0.0: dmg@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/dmg/-/dmg-0.1.0.tgz" - integrity sha1-s46iEH9vCwcEQrv3mb/E8q7apfg= + resolved "https://registry.npmjs.org/dmg/-/dmg-0.1.0.tgz#b38ea2107f6f0b070442bbf799bfc4f2aedaa5f8" + integrity sha512-aDAeN44J3qeBJHjao+FEy/wpyLvVF1DTiS/o95Cx1E7W65AVgHp1rPyk6Sgrm5zNNTkMfktNm+MGvPw/Kh6Ldw== doctrine@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" doctrine@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" dom-serialize@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= + resolved "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" + integrity sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ== dependencies: custom-event "~1.0.0" ent "~2.2.0" @@ -7329,27 +6467,27 @@ dom-serialize@^2.2.1: void-elements "^2.0.0" domain-browser@^4.22.0: - version "4.22.0" - resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz" - integrity sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw== + version "4.23.0" + resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.23.0.tgz#427ebb91efcb070f05cffdfb8a4e9a6c25f8c94b" + integrity sha512-ArzcM/II1wCCujdCNyQjXrAFwS4mrLh4C7DZWlaI8mdh7h3BfKdNd3bKXITfl2PT9FtfQqaGvhi1vPRQPimjGA== dot-prop@^5.1.0, dot-prop@^5.2.0: version "5.3.0" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== dependencies: is-obj "^2.0.0" dot-prop@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== dependencies: is-obj "^2.0.0" dotenv@^8.1.0: version "8.6.0" - resolved "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== dunder-proto@^1.0.0, dunder-proto@^1.0.1: @@ -7363,12 +6501,12 @@ dunder-proto@^1.0.0, dunder-proto@^1.0.1: duplexer@^0.1.1, duplexer@^0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" + resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== duplexify@^3.6.0: version "3.7.1" - resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz" + resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== dependencies: end-of-stream "^1.0.0" @@ -7377,18 +6515,18 @@ duplexify@^3.6.0: stream-shift "^1.0.0" duplexify@^4.0.0: - version "4.1.2" - resolved "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz" - integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== + version "4.1.3" + resolved "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz#a07e1c0d0a2c001158563d32592ba58bddb0236f" + integrity sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA== dependencies: end-of-stream "^1.4.1" inherits "^2.0.3" readable-stream "^3.1.1" - stream-shift "^1.0.0" + stream-shift "^1.0.2" each-props@^1.3.2: version "1.3.2" - resolved "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz" + resolved "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== dependencies: is-plain-object "^2.0.1" @@ -7401,61 +6539,38 @@ eastasianwidth@^0.2.0: ecc-jsbn@~0.1.1: version "0.1.2" - resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: version "1.0.11" - resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz" + resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== dependencies: safe-buffer "^5.0.1" ee-first@1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.3.846: - version "1.3.849" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.849.tgz" - integrity sha512-RweyW60HPOqIcxoKTGr38Yvtf2aliSUqX8dB3e9geJ0Bno0YLjcOX5F7/DPVloBkJWaPZ7xOM1A0Yme2T1A34w== - -electron-to-chromium@^1.4.477: - version "1.4.505" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.505.tgz" - integrity sha512-0A50eL5BCCKdxig2SsCXhpuztnB9PfUgRMojj5tMvt8O54lbwz3t6wNgnpiTRosw5QjlJB7ixhVyeg8daLQwSQ== + resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.5.73: - version "1.5.84" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.84.tgz#8e334ca206bb293a20b16418bf454783365b0a95" - integrity sha512-I+DQ8xgafao9Ha6y0qjHHvpZ9OfyA1qKlkHkjywxzniORU2awxyz7f/iVJcULmrF2yrM3nHQf+iDjJtbbexd/g== + version "1.5.87" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.87.tgz#3a89bec85e43a8b32445ec938228e4ec982e0f79" + integrity sha512-mPFwmEWmRivw2F8x3w3l2m6htAUN97Gy0kwpO++2m9iT1Gt8RCFVUfv9U/sIbHJ6rY4P6/ooqFL/eL7ock+pPg== elegant-spinner@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz" - integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= - -elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" + resolved "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + integrity sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ== -elliptic@^6.5.5: - version "6.5.5" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" - integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== +elliptic@^6.5.3, elliptic@^6.5.5: + version "6.6.1" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" + integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== dependencies: bn.js "^4.11.9" brorand "^1.1.0" @@ -7465,14 +6580,9 @@ elliptic@^6.5.5: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== emoji-regex@^9.2.2: @@ -7487,18 +6597,18 @@ emojilib@^2.4.0: emojis-list@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" + resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== enabled@2.0.x: version "2.0.0" - resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz" + resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== encodeurl@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== encodeurl@~2.0.0: version "2.0.0" @@ -7507,14 +6617,14 @@ encodeurl@~2.0.0: encoding@^0.1.12, encoding@^0.1.13: version "0.1.13" - resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" + resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== dependencies: iconv-lite "^0.6.2" end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" - resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" @@ -7525,30 +6635,21 @@ engine.io-parser@~5.2.1: integrity sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q== engine.io@~6.6.0: - version "6.6.2" - resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz#32bd845b4db708f8c774a4edef4e5c8a98b3da72" - integrity sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw== + version "6.6.3" + resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.6.3.tgz#a2ec69f72bf17c709ed832868bf17eb1a80a6470" + integrity sha512-2hkLItQMBkoYSagneiisupWGvsQlWXqzhSMvsjaM8GYbnfUsX7tzYQq9QARnate5LRedVTX+MbkSZAANAr3NtQ== dependencies: - "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" "@types/node" ">=10.0.0" accepts "~1.3.4" base64id "2.0.0" - cookie "~0.7.2" + cookie "~1.0.2" cors "~2.8.5" debug "~4.3.1" engine.io-parser "~5.2.1" ws "~8.17.1" -enhanced-resolve@^5.0.0: - version "5.16.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz#65ec88778083056cb32487faa9aef82ed0864787" - integrity sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - -enhanced-resolve@^5.17.1: +enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1: version "5.18.0" resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404" integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ== @@ -7556,14 +6657,6 @@ enhanced-resolve@^5.17.1: graceful-fs "^4.2.4" tapable "^2.2.0" -enhanced-resolve@^5.8.0: - version "5.8.3" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz" - integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - enquirer@^2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" @@ -7573,19 +6666,24 @@ enquirer@^2.4.1: strip-ansi "^6.0.1" ent@~2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + version "2.2.2" + resolved "https://registry.npmjs.org/ent/-/ent-2.2.2.tgz#22a5ed2fd7ce0cbcff1d1474cf4909a44bdb6e85" + integrity sha512-kKvD1tO6BM+oK9HzCPpUdRb4vKFQY/FPTFmurMvh6LlN68VMrdj77w8yp51/kDbpkFOS9J8w5W6zIzgM2H8/hw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + punycode "^1.4.1" + safe-regex-test "^1.1.0" env-paths@^2.2.0: version "2.2.1" - resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" + resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== envinfo@^7.7.4: - version "7.8.1" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.14.0" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" + integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== environment@^1.0.0: version "1.1.0" @@ -7594,100 +6692,24 @@ environment@^1.0.0: err-code@^2.0.2: version "2.0.3" - resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz" + resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== errno@^0.1.3: version "0.1.8" - resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz" + resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== dependencies: prr "~1.0.1" error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.2, es-abstract@^1.18.5: - version "1.18.6" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz" - integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-string "^1.0.7" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2: - version "1.23.3" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" - integrity sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A== - dependencies: - array-buffer-byte-length "^1.0.1" - arraybuffer.prototype.slice "^1.0.3" - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - data-view-buffer "^1.0.1" - data-view-byte-length "^1.0.1" - data-view-byte-offset "^1.0.0" - es-define-property "^1.0.0" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-set-tostringtag "^2.0.3" - es-to-primitive "^1.2.1" - function.prototype.name "^1.1.6" - get-intrinsic "^1.2.4" - get-symbol-description "^1.0.2" - globalthis "^1.0.3" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - has-proto "^1.0.3" - has-symbols "^1.0.3" - hasown "^2.0.2" - internal-slot "^1.0.7" - is-array-buffer "^3.0.4" - is-callable "^1.2.7" - is-data-view "^1.0.1" - is-negative-zero "^2.0.3" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.3" - is-string "^1.0.7" - is-typed-array "^1.1.13" - is-weakref "^1.0.2" - object-inspect "^1.13.1" - object-keys "^1.1.1" - object.assign "^4.1.5" - regexp.prototype.flags "^1.5.2" - safe-array-concat "^1.1.2" - safe-regex-test "^1.0.3" - string.prototype.trim "^1.2.9" - string.prototype.trimend "^1.0.8" - string.prototype.trimstart "^1.0.8" - typed-array-buffer "^1.0.2" - typed-array-byte-length "^1.0.1" - typed-array-byte-offset "^1.0.2" - typed-array-length "^1.0.6" - unbox-primitive "^1.0.2" - which-typed-array "^1.1.15" - -es-abstract@^1.23.5, es-abstract@^1.23.9: +es-abstract@^1.23.2, es-abstract@^1.23.5, es-abstract@^1.23.9: version "1.23.9" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz#5b45994b7de78dada5c1bebf1379646b32b9d606" integrity sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA== @@ -7744,49 +6766,33 @@ es-abstract@^1.23.5, es-abstract@^1.23.9: unbox-primitive "^1.1.0" which-typed-array "^1.1.18" -es-define-property@^1.0.0: +es-array-method-boxes-properly@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" - integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== - dependencies: - get-intrinsic "^1.2.4" + resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== -es-define-property@^1.0.1: +es-define-property@^1.0.0, es-define-property@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== -es-errors@^1.2.1, es-errors@^1.3.0: +es-errors@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^0.7.1: - version "0.7.1" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz" - integrity sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw== - es-module-lexer@^1.2.1: version "1.6.0" resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== es-object-atoms@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" - integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== + version "1.1.1" + resolved "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== dependencies: es-errors "^1.3.0" -es-set-tostringtag@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" - integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== - dependencies: - get-intrinsic "^1.2.4" - has-tostringtag "^1.0.2" - hasown "^2.0.1" - es-set-tostringtag@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" @@ -7804,15 +6810,6 @@ es-shim-unscopables@^1.0.2: dependencies: hasown "^2.0.0" -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - es-to-primitive@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" @@ -7822,7 +6819,7 @@ es-to-primitive@^1.3.0: is-date-object "^1.0.5" is-symbol "^1.0.4" -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@~0.10.14, es5-ext@~0.10.2: version "0.10.64" resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz#12e4ffb48f1ba2ea777f1fcdd1918ef73ea21714" integrity sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg== @@ -7834,44 +6831,31 @@ es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@ es6-error@^4.0.1: version "4.1.1" - resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz" + resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== es6-iterator@^2.0.1, es6-iterator@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== dependencies: d "1" es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-object-assign@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz" - integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw= - es6-promise@^4.0.3: version "4.2.8" - resolved "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz" + resolved "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + resolved "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== dependencies: es6-promise "^4.0.3" -es6-symbol@^3.1.1: - version "3.1.3" - resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -es6-symbol@^3.1.3: +es6-symbol@^3.1.1, es6-symbol@^3.1.3: version "3.1.4" resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz#f4e7d28013770b4208ecbf3e0bf14d3bcb557b8c" integrity sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg== @@ -7881,7 +6865,7 @@ es6-symbol@^3.1.3: es6-weak-map@^2.0.1, es6-weak-map@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz" + resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== dependencies: d "1" @@ -7889,39 +6873,34 @@ es6-weak-map@^2.0.1, es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escalade@^3.2.0: +escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-goat@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz" + resolved "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== escape-html@~1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== escodegen@^2.1.0: @@ -7985,12 +6964,12 @@ eslint-plugin-unused-imports@3.2.0: eslint-rule-composer@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz" + resolved "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== eslint-scope@5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: esrecurse "^4.3.0" @@ -8004,60 +6983,11 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== - eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@8.56.0: - version "8.56.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz#4957ce8da409dc0809f99ab07a1b94832ab74b15" - integrity sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.56.0" - "@humanwhocodes/config-array" "^0.11.13" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - ajv "^6.12.4" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" - eslint@8.57.1: version "8.57.1" resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz#7df109654aba7e3bbe5c8eae533c5e461d3c6ca9" @@ -8123,7 +7053,7 @@ espree@^9.6.0, espree@^9.6.1: esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.4.2: @@ -8135,82 +7065,82 @@ esquery@^1.4.2: esrecurse@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" estraverse@^4.1.1: version "4.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== estree-walker@^0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== estree-walker@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== estree-walker@^2.0.1, estree-walker@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== esutils@^2.0.2: version "2.0.3" - resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== etag@~1.8.1: version "1.8.1" - resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== event-emitter@^0.3.5: version "0.3.5" - resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" - integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= + resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== dependencies: d "1" es5-ext "~0.10.14" event-target-shim@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" + resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== eventemitter3@^4.0.0, eventemitter3@^4.0.4: version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" + resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== events-listener@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/events-listener/-/events-listener-1.1.0.tgz" + resolved "https://registry.npmjs.org/events-listener/-/events-listener-1.1.0.tgz#dd49b4628480eba58fde31b870ee346b3990b349" integrity sha512-Kd3EgYfODHueq6GzVfs/VUolh2EgJsS8hkO3KpnDrxVjU3eq63eXM2ujXkhPP+OkeUOhL8CxdfZbQXzryb5C4g== events@^3.2.0, events@^3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" + resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== eventtargeter@0.8.0: version "0.8.0" - resolved "https://registry.npmjs.org/eventtargeter/-/eventtargeter-0.8.0.tgz" + resolved "https://registry.npmjs.org/eventtargeter/-/eventtargeter-0.8.0.tgz#ca23a8c465bca44f7e5aa00efe365a699bb44915" integrity sha512-ldFAonAo7vyXeBDcTTOoxTtdibw1JvADllLkldxxdqb4+8LPoibU+e9XGQkD98l5wavImIab1jNwuzMtnR2MAg== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" @@ -8218,14 +7148,14 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: exec-sh@^0.2.0: version "0.2.2" - resolved "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz" + resolved "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== dependencies: merge "^1.2.0" execa@^5.0.0: version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== dependencies: cross-spawn "^7.0.3" @@ -8240,35 +7170,12 @@ execa@^5.0.0: exegesis-express@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/exegesis-express/-/exegesis-express-4.0.0.tgz" + resolved "https://registry.npmjs.org/exegesis-express/-/exegesis-express-4.0.0.tgz#f5f8486f6f0d81739e8e27ce75ce0f61ba3f3578" integrity sha512-V2hqwTtYRj0bj43K4MCtm0caD97YWkqOUHFMRCBW5L1x9IjyqOEc7Xa4oQjjiFbeFOSQzzwPV+BzXsQjSz08fw== dependencies: exegesis "^4.1.0" -exegesis@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/exegesis/-/exegesis-4.1.0.tgz" - integrity sha512-iqc55n+hmv8d1KYNMjq7bCcp4u74oRY6MBcj6Vsux7Wd4mRvlgahKqrBTyLIWwscNjEF3qvPmeJ0RPTj8ORMNg== - dependencies: - "@apidevtools/json-schema-ref-parser" "^9.0.3" - ajv "^8.3.0" - ajv-formats "^2.1.0" - body-parser "^1.18.3" - content-type "^1.0.4" - deep-freeze "0.0.1" - events-listener "^1.1.0" - glob "^7.1.3" - json-ptr "^3.0.1" - json-schema-traverse "^1.0.0" - lodash "^4.17.11" - openapi3-ts "^2.0.1" - promise-breaker "^5.0.0" - pump "^3.0.0" - qs "^6.6.0" - raw-body "^2.3.3" - semver "^7.0.0" - -exegesis@^4.2.0: +exegesis@^4.1.0, exegesis@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/exegesis/-/exegesis-4.2.0.tgz#2d248542b3c58a3c51f33fe9f05be1da1d908b4a" integrity sha512-MOzRyqhvl+hTA4+W4p0saWRIPlu0grIx4ykjMEYgGLiqr/z9NCIlwSq2jF0gyxNjPZD3xyHgmkW6BSaLVUdctg== @@ -8291,20 +7198,15 @@ exegesis@^4.2.0: raw-body "^2.3.3" semver "^7.0.0" -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - exit@^0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== expand-brackets@^2.1.4: version "2.1.4" - resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -8321,22 +7223,26 @@ expand-template@^2.0.3: expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz" - integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + resolved "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw== dependencies: homedir-polyfill "^1.0.1" -expect@^27.2.1: - version "27.2.1" - resolved "https://registry.npmjs.org/expect/-/expect-27.2.1.tgz" - integrity sha512-ekOA2mBtT2phxcoPVHCXIzbJxCvRXhx2fr7m28IgGdZxUOh8UvxvoRz1FcPlfgZMpE92biHB6woIcAKXqR28hA== +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - "@jest/types" "^27.1.1" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-regex-util "^27.0.6" + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + +exponential-backoff@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" + integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== express@4.19.2: version "4.19.2" @@ -8375,7 +7281,7 @@ express@4.19.2: utils-merge "1.0.1" vary "~1.1.2" -express@4.21.2: +express@4.21.2, express@^4.16.4: version "4.21.2" resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== @@ -8406,55 +7312,12 @@ express@4.21.2: safe-buffer "5.2.1" send "0.19.0" serve-static "1.16.2" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -express@^4.16.4: - version "4.17.1" - resolved "https://registry.npmjs.org/express/-/express-4.17.1.tgz" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" + setprototypeof "1.2.0" + statuses "2.0.1" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" -ext@^1.1.2: - version "1.6.0" - resolved "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.0" - ext@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" @@ -8464,32 +7327,32 @@ ext@^1.7.0: extend-shallow@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" extend@^3.0.0, extend@^3.0.2, extend@~3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" + resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== extendable-error@^0.1.5: version "0.1.7" - resolved "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz" + resolved "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz#60b9adf206264ac920058a7395685ae4670c2b96" integrity sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg== external-editor@^3.0.3, external-editor@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" @@ -8498,7 +7361,7 @@ external-editor@^3.0.3, external-editor@^3.1.0: extglob@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz" + resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" @@ -8512,7 +7375,7 @@ extglob@^2.0.4: extract-zip@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz" + resolved "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== dependencies: debug "^4.1.1" @@ -8523,17 +7386,17 @@ extract-zip@^2.0.1: extsprintf@1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + version "1.4.1" + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== fancy-log@^1.3.2, fancy-log@^1.3.3: version "1.3.3" - resolved "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz" + resolved "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== dependencies: ansi-gray "^0.1.1" @@ -8543,12 +7406,12 @@ fancy-log@^1.3.2, fancy-log@^1.3.3: fast-deep-equal@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + integrity sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw== fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-fifo@^1.2.0, fast-fifo@^1.3.2: @@ -8556,42 +7419,31 @@ fast-fifo@^1.2.0, fast-fifo@^1.3.2: resolved "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.0.3, fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== +fast-glob@^3.0.3, fast-glob@^3.2.9: + version "3.3.3" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" + integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.4" + micromatch "^4.0.8" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-levenshtein@^1.0.0: version "1.1.4" - resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz" - integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" + integrity sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw== fast-levenshtein@^2.0.6: version "2.0.6" - resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fast-uri@^3.0.1: version "3.0.6" @@ -8600,61 +7452,66 @@ fast-uri@^3.0.1: fast-url-parser@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz" - integrity sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0= + resolved "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" + integrity sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ== dependencies: punycode "^1.3.2" fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + version "1.18.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz#d631d7e25faffea81887fe5ea8c9010e1b36fee0" + integrity sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw== dependencies: reusify "^1.0.4" faye-websocket@0.11.4: version "0.11.4" - resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz" + resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== dependencies: websocket-driver ">=0.5.1" fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + version "2.0.2" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" fclone@^1.0.11: version "1.0.11" - resolved "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz" + resolved "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz#10e85da38bfea7fc599341c296ee1d77266ee640" integrity sha512-GDqVQezKzRABdeqflsgMr7ktzgF9CyS+p2oe0jJqUY6izSSbhPIQJDpoU4PtGcD7VPM9xh/dVrTu6z1nwgmEGw== fd-slicer@~1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= + resolved "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== dependencies: pend "~1.2.0" +fdir@6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz#fcca5a23ea20e767b15e081ee13b3e6488ee0bb0" + integrity sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ== + fecha@^4.2.0: - version "4.2.1" - resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz" - integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q== + version "4.2.3" + resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" + integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw== figures@^1.7.0: version "1.7.0" - resolved "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= + resolved "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ== dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" figures@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== dependencies: escape-string-regexp "^1.0.5" @@ -8667,38 +7524,31 @@ figures@^3.0.0, figures@^3.2.0: file-entry-cache@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" file-uri-to-path@1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" + resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== filesize@^6.1.0: version "6.4.0" - resolved "https://registry.npmjs.org/filesize/-/filesize-6.4.0.tgz" + resolved "https://registry.npmjs.org/filesize/-/filesize-6.4.0.tgz#914f50471dd66fdca3cefe628bd0cde4ef769bcd" integrity sha512-mjFIpOHC4jbfcTfoh4rkWpI31mF7viw9ikj/JyLoKzqlwG/YsefKfvYlYhdYdg/9mtK2z1AzgN/0LvVQ3zdlSQ== fill-range@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range "^2.1.0" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -8708,17 +7558,17 @@ fill-range@^7.1.1: filter-obj@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz" - integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= + resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== filter-obj@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-2.0.2.tgz" + resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-2.0.2.tgz#fff662368e505d69826abb113f0f6a98f56e9d5f" integrity sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg== -finalhandler@1.1.2, finalhandler@~1.1.2: +finalhandler@1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== dependencies: debug "2.6.9" @@ -8731,7 +7581,7 @@ finalhandler@1.1.2, finalhandler@~1.1.2: finalhandler@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== dependencies: debug "2.6.9" @@ -8757,7 +7607,7 @@ finalhandler@1.3.1: find-cache-dir@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== dependencies: commondir "^1.0.1" @@ -8766,7 +7616,7 @@ find-cache-dir@^2.0.0: find-cache-dir@^3.2.0, find-cache-dir@^3.3.1, find-cache-dir@^3.3.2: version "3.3.2" - resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== dependencies: commondir "^1.0.1" @@ -8775,17 +7625,17 @@ find-cache-dir@^3.2.0, find-cache-dir@^3.3.1, find-cache-dir@^3.3.2: find-free-port@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/find-free-port/-/find-free-port-2.0.0.tgz" - integrity sha1-SyLl9leesaOMQaxryz7+0bbamxs= + resolved "https://registry.npmjs.org/find-free-port/-/find-free-port-2.0.0.tgz#4b22e5f6579eb1a38c41ac6bcb3efed1b6da9b1b" + integrity sha512-J1j8gfEVf5FN4PR5w5wrZZ7NYs2IvqsHcd03cAeQx3Ec/mo+lKceaVNhpsRKoZpZKbId88o8qh+dwUwzBV6WCg== find-package-json@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/find-package-json/-/find-package-json-1.2.0.tgz" + resolved "https://registry.npmjs.org/find-package-json/-/find-package-json-1.2.0.tgz#4057d1b943f82d8445fe52dc9cf456f6b8b58083" integrity sha512-+SOGcLGYDJHtyqHd87ysBhmaeQ95oWspDKnMXBrnQ9Eq4OkLNqejgoaD8xVWu6GPa0B6roa6KinCMEMcVeqONw== find-up@5.0.0, find-up@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" @@ -8793,29 +7643,29 @@ find-up@5.0.0, find-up@^5.0.0: find-up@^1.0.0: version "1.1.2" - resolved "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + resolved "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA== dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" find-up@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== dependencies: locate-path "^2.0.0" find-up@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" @@ -8823,15 +7673,15 @@ find-up@^4.0.0, find-up@^4.1.0: find-yarn-workspace-root@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz" + resolved "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== dependencies: micromatch "^4.0.2" findup-sync@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz" - integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= + resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" + integrity sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g== dependencies: detect-file "^1.0.0" is-glob "^3.1.0" @@ -8840,7 +7690,7 @@ findup-sync@^2.0.0: findup-sync@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz" + resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== dependencies: detect-file "^1.0.0" @@ -8850,7 +7700,7 @@ findup-sync@^3.0.0: fined@^1.0.1: version "1.2.0" - resolved "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz" + resolved "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== dependencies: expand-tilde "^2.0.2" @@ -8935,35 +7785,31 @@ firebase-tools@13.29.2: flagged-respawn@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz" + resolved "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.2.0" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: - flatted "^3.1.0" + flatted "^3.2.9" + keyv "^4.5.3" rimraf "^3.0.2" flat@^5.0.2: version "5.0.2" - resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" + resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.1.0: - version "3.2.4" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz" - integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== - -flatted@^3.2.5: - version "3.2.5" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz" - integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +flatted@^3.2.7, flatted@^3.2.9: + version "3.3.2" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" + integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== flush-write-stream@^1.0.2: version "1.1.1" - resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz" + resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== dependencies: inherits "^2.0.3" @@ -8971,41 +7817,36 @@ flush-write-stream@^1.0.2: fn.name@1.x.x: version "1.1.0" - resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz" + resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.0.0, follow-redirects@^1.15.6: - version "1.15.6" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + version "1.15.9" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + version "0.3.4" + resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.4.tgz#814517ffc303d1399b2564d8165318e735d0341c" + integrity sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw== dependencies: - is-callable "^1.1.3" + is-callable "^1.2.7" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== for-own@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz" - integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= + resolved "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg== dependencies: for-in "^1.0.1" -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - foreground-child@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz" + resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== dependencies: cross-spawn "^7.0.0" @@ -9021,22 +7862,23 @@ foreground-child@^3.1.0: forever-agent@~0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== form-data@^2.5.0: - version "2.5.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz" - integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== + version "2.5.2" + resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.2.tgz#dc653743d1de2fcc340ceea38079daf6e9069fd2" + integrity sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q== dependencies: asynckit "^0.4.0" combined-stream "^1.0.6" mime-types "^2.1.12" + safe-buffer "^5.2.1" form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + version "4.0.1" + resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -9044,7 +7886,7 @@ form-data@^4.0.0: form-data@~2.3.2: version "2.3.3" - resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz" + resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" @@ -9053,52 +7895,34 @@ form-data@~2.3.2: forwarded@0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz" + resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== fragment-cache@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== dependencies: map-cache "^0.2.2" fresh@0.5.2: version "0.5.2" - resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== fromentries@^1.2.0: version "1.3.2" - resolved "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz" + resolved "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== fs-constants@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" + resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-extra@^10.0.1: - version "10.0.1" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz" - integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-extra@^10.1.0: +fs-extra@^10.0.0, fs-extra@^10.1.0: version "10.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== dependencies: graceful-fs "^4.2.0" @@ -9107,7 +7931,7 @@ fs-extra@^10.1.0: fs-extra@^7.0.1, fs-extra@~7.0.1: version "7.0.1" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== dependencies: graceful-fs "^4.1.2" @@ -9116,7 +7940,7 @@ fs-extra@^7.0.1, fs-extra@~7.0.1: fs-extra@^8.1.0: version "8.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== dependencies: graceful-fs "^4.2.0" @@ -9125,7 +7949,7 @@ fs-extra@^8.1.0: fs-extra@^9.0.0, fs-extra@^9.1.0: version "9.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" @@ -9135,70 +7959,67 @@ fs-extra@^9.0.0, fs-extra@^9.1.0: fs-minipass@^1.2.7: version "1.2.7" - resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: minipass "^2.6.0" fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== dependencies: minipass "^3.0.0" +fs-minipass@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz#79a85981c4dc120065e96f62086bf6f9dc26cc54" + integrity sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw== + dependencies: + minipass "^7.0.3" + fs-mkdirp-stream@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz" - integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= + resolved "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + integrity sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ== dependencies: graceful-fs "^4.1.11" through2 "^2.0.3" fs-monkey@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.4.tgz" - integrity sha512-INM/fWAxMICjttnD0DX1rBvinKskj5G1w+oy/pnm9u/tSlnBrzFonJMcalKJ30P8RRsPzKcCG7Q8l0jx5Fh9YQ== + version "1.0.6" + resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz#8ead082953e88d992cf3ff844faa907b26756da2" + integrity sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg== fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@2.3.2, fsevents@^2.3.2, fsevents@~2.3.2: +fsevents@2.3.2: version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== fsevents@^1.2.7: version "1.2.13" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== dependencies: bindings "^1.5.0" nan "^2.12.1" -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +fsevents@^2.3.2, fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== -function.prototype.name@^1.1.6: - version "1.1.6" - resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" - integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - functions-have-names "^1.2.3" - -function.prototype.name@^1.1.8: +function.prototype.name@^1.1.6, function.prototype.name@^1.1.8: version "1.1.8" resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz#e68e1df7b259a5c949eeef95cdbde53edffabb78" integrity sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q== @@ -9212,7 +8033,7 @@ function.prototype.name@^1.1.8: functions-have-names@^1.2.3: version "1.2.3" - resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" + resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== fuzzy@^0.1.3: @@ -9220,24 +8041,9 @@ fuzzy@^0.1.3: resolved "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" integrity sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w== -gauge@^3.0.0: - version "3.0.2" - resolved "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz" - integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.2" - console-control-strings "^1.0.0" - has-unicode "^2.0.1" - object-assign "^4.1.1" - signal-exit "^3.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.2" - gauge@^4.0.3: version "4.0.4" - resolved "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz" + resolved "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" integrity sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg== dependencies: aproba "^1.0.3 || ^2.0.0" @@ -9251,8 +8057,8 @@ gauge@^4.0.3: gauge@~2.7.3: version "2.7.4" - resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -9284,7 +8090,7 @@ gcp-metadata@^6.1.0: geckodriver@2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/geckodriver/-/geckodriver-2.0.4.tgz" + resolved "https://registry.npmjs.org/geckodriver/-/geckodriver-2.0.4.tgz#2f644ede43ce7bea10336d57838179da0f7374d9" integrity sha512-3Fu75v6Ov8h5Vt25+djJU56MJA2gRctgjhvG5xGzLFTQjltPz7nojQdBHbmgWznUt3CHl8VaiDn8MaepY7B0dA== dependencies: adm-zip "0.5.5" @@ -9295,17 +8101,17 @@ geckodriver@2.0.4: gensync@^1.0.0-beta.2: version "1.0.0-beta.2" - resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.1, get-func-name@^2.0.2: @@ -9313,27 +8119,7 @@ get-func-name@^2.0.1, get-func-name@^2.0.2: resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: - version "1.2.4" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" - integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== - dependencies: - es-errors "^1.3.0" - function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" - -get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044" integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA== @@ -9351,12 +8137,12 @@ get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7: get-package-type@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-pkg-repo@^4.0.0: version "4.2.1" - resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz" + resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz#75973e1c8050c73f48190c52047c4cee3acbf385" integrity sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA== dependencies: "@hutson/parse-repository-url" "^3.0.0" @@ -9366,7 +8152,7 @@ get-pkg-repo@^4.0.0: get-port@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz" + resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== get-proto@^1.0.0, get-proto@^1.0.1: @@ -9384,33 +8170,16 @@ get-stdin@=8.0.0: get-stream@^5.1.0: version "5.2.0" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== dependencies: pump "^3.0.0" get-stream@^6.0.0: version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -get-symbol-description@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" - integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== - dependencies: - call-bind "^1.0.5" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - get-symbol-description@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" @@ -9431,20 +8200,20 @@ get-uri@^6.0.1: get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" - resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== getpass@^0.1.1: version "0.1.7" - resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== dependencies: assert-plus "^1.0.0" git-raw-commits@^2.0.8: - version "2.0.10" - resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz" - integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== + version "2.0.11" + resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" + integrity sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A== dependencies: dargs "^7.0.0" lodash "^4.17.15" @@ -9454,15 +8223,15 @@ git-raw-commits@^2.0.8: git-remote-origin-url@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz" - integrity sha1-UoJlna4hBxRaERJhEq0yFuxfpl8= + resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" + integrity sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw== dependencies: gitconfiglocal "^1.0.0" pify "^2.3.0" git-semver-tags@^4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz" + resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" integrity sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA== dependencies: meow "^8.0.0" @@ -9470,7 +8239,7 @@ git-semver-tags@^4.1.1: git-up@^4.0.0: version "4.0.5" - resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz" + resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" integrity sha512-YUvVDg/vX3d0syBsk/CKUTib0srcQME0JyHkL5BaYdwLsiCslPWmDSi8PUMo9pXYjrryMcmsCoCgsTpSCJEQaA== dependencies: is-ssh "^1.3.0" @@ -9478,15 +8247,15 @@ git-up@^4.0.0: git-url-parse@^11.4.4: version "11.6.0" - resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz" + resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== dependencies: git-up "^4.0.0" gitconfiglocal@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz" - integrity sha1-QdBF84UaXqiPA/JMocYXgRRGS5s= + resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" + integrity sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ== dependencies: ini "^1.3.2" @@ -9497,15 +8266,15 @@ github-from-package@0.0.0: glob-parent@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" @@ -9519,13 +8288,13 @@ glob-parent@^6.0.2: glob-slash@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/glob-slash/-/glob-slash-1.0.0.tgz" - integrity sha1-/lLvpDMjP3Si/mTHq7m8hIICq5U= + resolved "https://registry.npmjs.org/glob-slash/-/glob-slash-1.0.0.tgz#fe52efa433233f74a2fe64c7abb9bc848202ab95" + integrity sha512-ZwFh34WZhZX28ntCMAP1mwyAJkn8+Omagvt/GvA+JQM/qgT0+MR2NPF3vhvgdshfdvDyGZXs8fPXW84K32Wjuw== glob-slasher@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/glob-slasher/-/glob-slasher-1.0.1.tgz" - integrity sha1-dHoOW7IiZC7hDT4FRD4QlJPLD44= + resolved "https://registry.npmjs.org/glob-slasher/-/glob-slasher-1.0.1.tgz#747a0e5bb222642ee10d3e05443e109493cb0f8e" + integrity sha512-5MUzqFiycIKLMD1B0dYOE4hGgLLUZUNGGYO4BExdwT32wUwW3DBOE7lMQars7vB1q43Fb3Tyt+HmgLKsJhDYdg== dependencies: glob-slash "^1.0.0" lodash.isobject "^2.4.1" @@ -9533,8 +8302,8 @@ glob-slasher@^1.0.1: glob-stream@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz" - integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= + resolved "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + integrity sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw== dependencies: extend "^3.0.0" glob "^7.1.1" @@ -9549,12 +8318,12 @@ glob-stream@^6.1.0: glob-to-regexp@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" + resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob-watcher@^5.0.3: version "5.0.5" - resolved "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz" + resolved "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== dependencies: anymatch "^2.0.0" @@ -9565,9 +8334,9 @@ glob-watcher@^5.0.3: normalize-path "^3.0.0" object.defaults "^1.1.0" -glob@7.2.0, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: +glob@7.2.0: version "7.2.0" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" @@ -9577,9 +8346,9 @@ glob@7.2.0, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glo once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.2.3, glob@~7.2.0: +glob@7.2.3, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" @@ -9589,7 +8358,7 @@ glob@7.2.3, glob@~7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^10.0.0, glob@^10.3.10, glob@^10.4.1: +glob@^10.0.0, glob@^10.2.2, glob@^10.3.10, glob@^10.4.1: version "10.4.5" resolved "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== @@ -9601,27 +8370,16 @@ glob@^10.0.0, glob@^10.3.10, glob@^10.4.1: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" -glob@^8.0.1: - version "8.1.0" - resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz" - integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" - global-dirs@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz" - integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== + version "3.0.1" + resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" + integrity sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA== dependencies: ini "2.0.0" global-modules@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz" + resolved "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== dependencies: global-prefix "^1.0.1" @@ -9630,8 +8388,8 @@ global-modules@^1.0.0: global-prefix@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz" - integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg== dependencies: expand-tilde "^2.0.2" homedir-polyfill "^1.0.1" @@ -9641,7 +8399,7 @@ global-prefix@^1.0.1: globals@^11.1.0: version "11.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: @@ -9653,16 +8411,9 @@ globals@^13.19.0: globals@^9.18.0: version "9.18.0" - resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz" + resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -globalthis@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" - integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== - dependencies: - define-properties "^1.1.3" - globalthis@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" @@ -9673,7 +8424,7 @@ globalthis@^1.0.4: globby@10.0.1: version "10.0.1" - resolved "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz" + resolved "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== dependencies: "@types/glob" "^7.1.1" @@ -9685,21 +8436,9 @@ globby@10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.0, globby@^11.0.1, globby@^11.0.2: - version "11.0.4" - resolved "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -globby@^11.1.0: +globby@^11.0.0, globby@^11.0.1, globby@^11.0.2, globby@^11.1.0: version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" + resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" @@ -9711,8 +8450,8 @@ globby@^11.1.0: globby@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz" - integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= + resolved "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + integrity sha512-HJRTIH2EeH44ka+LWig+EqT2ONSYpVlNfx6pyd592/VF1TbfljJ7elwie7oSwcViLGqOdWocSdu2txwBF9bjmQ== dependencies: array-union "^1.0.1" arrify "^1.0.0" @@ -9723,7 +8462,7 @@ globby@^5.0.0: glogg@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz" + resolved "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== dependencies: sparkles "^1.0.0" @@ -9770,21 +8509,14 @@ googleapis-common@^7.0.0: url-template "^2.0.8" uuid "^9.0.0" -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" - -gopd@^1.2.0: +gopd@^1.0.1, gopd@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== got@11.8.2: version "11.8.2" - resolved "https://registry.npmjs.org/got/-/got-11.8.2.tgz" + resolved "https://registry.npmjs.org/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== dependencies: "@sindresorhus/is" "^4.0.0" @@ -9801,32 +8533,22 @@ got@11.8.2: graceful-fs@4.2.10: version "4.2.10" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6: - version "4.2.8" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.9" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== - -graceful-fs@^4.2.10, graceful-fs@^4.2.11: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphemer@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" + resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== growl@1.10.5: version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" + resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== gtoken@^7.0.0: @@ -9839,7 +8561,7 @@ gtoken@^7.0.0: gulp-cli@^2.2.0: version "2.3.0" - resolved "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz" + resolved "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== dependencies: ansi-colors "^1.0.1" @@ -9863,7 +8585,7 @@ gulp-cli@^2.2.0: gulp-filter@7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz" + resolved "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz#e0712f3e57b5d647f802a1880255cafb54abf158" integrity sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw== dependencies: multimatch "^5.0.0" @@ -9873,7 +8595,7 @@ gulp-filter@7.0.0: gulp-replace@1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.1.4.tgz" + resolved "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.1.4.tgz#06a0e9ee36f30e343c1e0a2dd760ec32c8a3d3b2" integrity sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw== dependencies: "@types/node" "*" @@ -9884,7 +8606,7 @@ gulp-replace@1.1.4: gulp-sourcemaps@3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz" + resolved "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz#2e154e1a2efed033c0e48013969e6f30337b2743" integrity sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ== dependencies: "@gulp-sourcemaps/identity-map" "^2.0.1" @@ -9901,7 +8623,7 @@ gulp-sourcemaps@3.0.0: gulp@4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz" + resolved "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== dependencies: glob-watcher "^5.0.3" @@ -9911,25 +8633,25 @@ gulp@4.0.2: gulplog@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz" - integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= + resolved "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + integrity sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw== dependencies: glogg "^1.0.0" gzip-size@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz" + resolved "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q== dependencies: duplexer "^0.1.2" -handlebars@^4.7.2, handlebars@^4.7.6: - version "4.7.7" - resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== +handlebars@^4.7.2, handlebars@^4.7.7: + version "4.7.8" + resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" + integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== dependencies: minimist "^1.2.5" - neo-async "^2.6.0" + neo-async "^2.6.2" source-map "^0.6.1" wordwrap "^1.0.0" optionalDependencies: @@ -9937,12 +8659,12 @@ handlebars@^4.7.2, handlebars@^4.7.6: har-schema@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== har-validator@~5.1.3: version "5.1.5" - resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz" + resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== dependencies: ajv "^6.12.3" @@ -9950,55 +8672,38 @@ har-validator@~5.1.3: hard-rejection@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" + resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== has-ansi@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== dependencies: ansi-regex "^2.0.0" -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + version "1.1.0" + resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz#28607e965ac967e03cd2a2c70a2636a1edad49fe" + integrity sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg== has-flag@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== - dependencies: - get-intrinsic "^1.1.1" - -has-property-descriptors@^1.0.2: +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== dependencies: es-define-property "^1.0.0" -has-proto@^1.0.1, has-proto@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" - integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== - has-proto@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz#5de5a6eabd95fdffd9818b43055e8065e39fe9d5" @@ -10006,28 +8711,11 @@ has-proto@^1.2.0: dependencies: dunder-proto "^1.0.0" -has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-symbols@^1.1.0: +has-symbols@^1.0.3, has-symbols@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - has-tostringtag@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" @@ -10037,13 +8725,13 @@ has-tostringtag@^1.0.2: has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== has-value@^0.3.1: version "0.3.1" - resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -10051,8 +8739,8 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -10060,49 +8748,42 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== has-values@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== dependencies: is-number "^3.0.0" kind-of "^4.0.0" has-yarn@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz" + resolved "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - hash-base@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== dependencies: inherits "^2.0.4" readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash-base@~3.0: - version "3.0.4" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow== +hash-base@~3.0, hash-base@~3.0.4: + version "3.0.5" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz#52480e285395cf7fba17dc4c9e47acdc7f248a8a" + integrity sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg== dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" + inherits "^2.0.4" + safe-buffer "^5.2.1" hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" @@ -10110,20 +8791,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: hasha@^5.0.0: version "5.2.2" - resolved "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz" + resolved "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz#a48477989b3b327aea3c04f53096d816d97522a1" integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ== dependencies: is-stream "^2.0.0" type-fest "^0.8.0" -hasown@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" - integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== - dependencies: - function-bind "^1.1.2" - -hasown@^2.0.1, hasown@^2.0.2: +hasown@^2.0.0, hasown@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== @@ -10132,7 +8806,7 @@ hasown@^2.0.1, hasown@^2.0.2: he@1.2.0, he@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" + resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== heap-js@^2.2.0: @@ -10147,13 +8821,13 @@ highlight.js@^10.7.1: highlight.js@^9.17.1: version "9.18.5" - resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz" + resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz#d18a359867f378c138d6819edfc2a8acd5f29825" integrity sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA== hmac-drbg@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -10161,65 +8835,43 @@ hmac-drbg@^1.0.1: homedir-polyfill@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz" + resolved "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== dependencies: parse-passwd "^1.0.0" hosted-git-info@^2.1.4: version "2.8.9" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== + version "4.1.0" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== dependencies: lru-cache "^6.0.0" html-encoding-sniffer@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz" + resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== dependencies: whatwg-encoding "^2.0.0" html-escaper@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" + resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: +http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@1.7.3, http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-errors@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: depd "2.0.0" @@ -10229,13 +8881,13 @@ http-errors@2.0.0: toidentifier "1.0.1" http-parser-js@>=0.5.1: - version "0.5.3" - resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz" - integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== + version "0.5.9" + resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.9.tgz#b817b3ca0edea6236225000d795378707c169cec" + integrity sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw== http-proxy-agent@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== dependencies: "@tootallnate/once" "1" @@ -10244,7 +8896,7 @@ http-proxy-agent@^4.0.1: http-proxy-agent@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== dependencies: "@tootallnate/once" "2" @@ -10261,7 +8913,7 @@ http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: http-proxy@^1.18.1: version "1.18.1" - resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz" + resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== dependencies: eventemitter3 "^4.0.0" @@ -10270,7 +8922,7 @@ http-proxy@^1.18.1: http-server@14.1.1: version "14.1.1" - resolved "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz" + resolved "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz#d60fbb37d7c2fdff0f0fbff0d0ee6670bd285e2e" integrity sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A== dependencies: basic-auth "^2.0.1" @@ -10289,8 +8941,8 @@ http-server@14.1.1: http-signature@~1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -10298,7 +8950,7 @@ http-signature@~1.2.0: http2-wrapper@^1.0.0-beta.5.2: version "1.0.3" - resolved "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz" + resolved "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== dependencies: quick-lru "^5.1.1" @@ -10306,12 +8958,12 @@ http2-wrapper@^1.0.0-beta.5.2: https-browserify@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== -https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: +https-proxy-agent@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== dependencies: agent-base "6" @@ -10319,15 +8971,15 @@ https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: https-proxy-agent@^2.2.1: version "2.2.4" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== dependencies: agent-base "^4.3.0" debug "^3.1.0" -https-proxy-agent@^5.0.1: +https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: agent-base "6" @@ -10343,80 +8995,70 @@ https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.6: human-id@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz" + resolved "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz#e654d4b2b0d8b07e45da9f6020d8af17ec0a5df3" integrity sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw== human-signals@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== humanize-ms@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz" - integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= + resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== dependencies: ms "^2.0.0" iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@0.6.3, iconv-lite@^0.6.2: version "0.6.3" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== dependencies: safer-buffer ">= 2.1.2 < 3.0.0" idb@7.1.1: version "7.1.1" - resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz" + resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ== ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== ignore-walk@^3.0.3: version "3.0.4" - resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz" + resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ== dependencies: minimatch "^3.0.4" -ignore@^5.1.1, ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - -ignore@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" - integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== +ignore@^5.1.1, ignore@^5.2.0, ignore@^5.3.1: + version "5.3.2" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== immediate@^3.2.2: version "3.3.0" - resolved "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz" + resolved "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== immediate@~3.0.5: version "3.0.6" - resolved "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + resolved "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== import-fresh@^3.2.1: version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" @@ -10424,40 +9066,40 @@ import-fresh@^3.2.1: import-lazy@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz" - integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + resolved "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A== import-lazy@~4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz" + resolved "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.2.0" + resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" imurmurhash@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== indent-string@^3.0.0: version "3.2.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= + resolved "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + integrity sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ== indent-string@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== indexeddbshim@10.1.0: version "10.1.0" - resolved "https://registry.npmjs.org/indexeddbshim/-/indexeddbshim-10.1.0.tgz" + resolved "https://registry.npmjs.org/indexeddbshim/-/indexeddbshim-10.1.0.tgz#94e285b772e845acc5c494bc5f9630f302dd7bbe" integrity sha512-jzB4GAs4g+KtlyEZXI3NY1fLMRj6FP5I7XiKpqa0leMsxAp4CMPoFjSoyvC4mwVyZ6/5krpRMgRVDl9OFINz+w== dependencies: eventtargeter "0.8.0" @@ -10468,40 +9110,35 @@ indexeddbshim@10.1.0: infer-owner@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz" + resolved "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== inflight@^1.0.4: version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz" + resolved "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.8" - resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^2.0.2: version "2.0.5" - resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-2.0.5.tgz" + resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-2.0.5.tgz#78b85f3c36014db42d8f32117252504f68022646" integrity sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA== dependencies: npm-package-arg "^8.1.5" @@ -10546,7 +9183,7 @@ inquirer@8.2.6, inquirer@^8.2.6: inquirer@^7.3.3: version "7.3.3" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== dependencies: ansi-escapes "^4.2.1" @@ -10563,28 +9200,10 @@ inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" -install-artifact-from-github@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.2.tgz" - integrity sha512-yCFcLvqk0yQdxx0uJz4t9Z3adDMLAYrcGYv546uRXCSvxE+GqNYhhz/KmrGcUKGI/gVLR9n/e/zM9jX/+ASMJQ== - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -internal-slot@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" - integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== - dependencies: - es-errors "^1.3.0" - hasown "^2.0.0" - side-channel "^1.0.4" +install-artifact-from-github@^1.3.5: + version "1.3.5" + resolved "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.5.tgz#88c96fe40e5eb21d45586d564208c648a1dbf38d" + integrity sha512-gZHC7f/cJgXz7MXlHFBxPVMsvIbev1OQN1uKQYKVJDydGNm9oYf9JstbU4Atnh/eSvk41WtEovoRm+8IF686xg== internal-slot@^1.1.0: version "1.1.0" @@ -10597,20 +9216,20 @@ internal-slot@^1.1.0: interpret@^1.0.0, interpret@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" + resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== invariant@^2.2.2: version "2.2.4" - resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" + resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ== ip-address@^9.0.5: version "9.0.5" @@ -10622,63 +9241,38 @@ ip-address@^9.0.5: ip-regex@^4.1.0: version "4.3.0" - resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz" + resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== -ip@^1.1.5: - version "1.1.9" - resolved "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz#8dfbcc99a754d07f425310b86a99546b1151e396" - integrity sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ== - -ip@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105" - integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ== - ipaddr.js@1.9.1: version "1.9.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== is-absolute@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== dependencies: is-relative "^1.0.0" is-windows "^1.0.1" -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== +is-accessor-descriptor@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz#3223b10628354644b86260db29b3e693f5ceedd4" + integrity sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA== dependencies: - kind-of "^6.0.0" + hasown "^2.0.0" is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-array-buffer@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" - integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== + version "1.2.0" + resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" + integrity sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.1" + call-bound "^1.0.2" + has-tostringtag "^1.0.2" -is-array-buffer@^3.0.5: +is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: version "3.0.5" resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" integrity sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== @@ -10689,31 +9283,25 @@ is-array-buffer@^3.0.5: is-arrayish@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-arrayish@^0.3.1: version "0.3.2" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== is-async-function@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.0.tgz#1d1080612c493608e93168fc4458c245074c06a6" - integrity sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ== + version "2.1.1" + resolved "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz#3e69018c8e04e73b738793d020bfe884b9fd3523" + integrity sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ== dependencies: + async-function "^1.0.0" call-bound "^1.0.3" get-proto "^1.0.1" has-tostringtag "^1.0.2" safe-regex-test "^1.1.0" -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - is-bigint@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" @@ -10723,26 +9311,18 @@ is-bigint@^1.1.0: is-binary-path@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== dependencies: binary-extensions "^1.0.0" is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - is-boolean-object@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz#c20d0c654be05da4fbc23c562635c019e93daf89" @@ -10753,97 +9333,50 @@ is-boolean-object@^1.2.1: is-buffer@^1.1.5: version "1.1.6" - resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-builtin-module@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz" - integrity sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg== + version "3.2.1" + resolved "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== dependencies: - builtin-modules "^3.0.0" + builtin-modules "^3.3.0" -is-callable@^1.1.3, is-callable@^1.2.7: +is-callable@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - is-ci@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== dependencies: ci-info "^2.0.0" -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-ci/-/is-ci-3.0.0.tgz" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - is-ci@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz" + resolved "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== dependencies: ci-info "^3.2.0" -is-core-module@^2.13.0: - version "2.13.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz" - integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== - dependencies: - has "^1.0.3" - -is-core-module@^2.15.1: +is-core-module@^2.13.0, is-core-module@^2.15.1, is-core-module@^2.16.0, is-core-module@^2.5.0: version "2.16.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== dependencies: hasown "^2.0.2" -is-core-module@^2.2.0, is-core-module@^2.5.0: - version "2.6.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== - dependencies: - has "^1.0.3" - -is-core-module@^2.8.1: - version "2.9.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-data-view@^1.0.1: +is-data-descriptor@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" - integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== + resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz#2109164426166d32ea38c405c1e0945d9e6a4eeb" + integrity sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw== dependencies: - is-typed-array "^1.1.13" + hasown "^2.0.0" -is-data-view@^1.0.2: +is-data-view@^1.0.1, is-data-view@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz#bae0a41b9688986c2188dda6657e56b8f9e63b8e" integrity sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw== @@ -10852,13 +9385,6 @@ is-data-view@^1.0.2: get-intrinsic "^1.2.6" is-typed-array "^1.1.13" -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - is-date-object@^1.0.5, is-date-object@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz#ad85541996fc7aa8b2729701d27b7319f95d82f7" @@ -10868,44 +9394,42 @@ is-date-object@^1.0.5, is-date-object@^1.1.0: has-tostringtag "^1.0.2" is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + version "0.1.7" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz#2727eb61fd789dcd5bdf0ed4569f551d2fe3be33" + integrity sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg== dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + version "1.0.3" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz#92d27cb3cd311c4977a4db47df457234a13cb306" + integrity sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw== dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" is-docker@^2.0.0: version "2.2.1" - resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" + resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== is-extendable@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-finalizationregistry@^1.1.0: version "1.1.1" @@ -10916,27 +9440,27 @@ is-finalizationregistry@^1.1.0: is-finite@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz" + resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== is-fullwidth-code-point@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-generator-function@^1.0.10: +is-generator-function@^1.0.10, is-generator-function@^1.0.7: version "1.1.0" resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== @@ -10946,37 +9470,23 @@ is-generator-function@^1.0.10: has-tostringtag "^1.0.2" safe-regex-test "^1.1.0" -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - is-glob@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + resolved "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-installed-globally@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz" + resolved "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== dependencies: global-dirs "^3.0.0" @@ -10984,13 +9494,13 @@ is-installed-globally@^0.4.0: is-interactive@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== is-lambda@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz" - integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= + resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" + integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== is-map@^2.0.3: version "2.0.3" @@ -10999,12 +9509,12 @@ is-map@^2.0.3: is-module@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz" - integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + resolved "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== -is-nan@^1.2.1: +is-nan@^1.3.2: version "1.3.2" - resolved "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz" + resolved "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== dependencies: call-bind "^1.0.0" @@ -11012,31 +9522,14 @@ is-nan@^1.2.1: is-negated-glob@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz" - integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= - -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-negative-zero@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" - integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + resolved "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug== is-npm@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz" + resolved "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== -is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - is-number-object@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz#144b21e95a1bc148205dcc2814a9134ec41b2541" @@ -11054,87 +9547,87 @@ is-number@^2.1.0: is-number@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz" + resolved "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-number@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-obj@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== is-observable@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz" + resolved "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== dependencies: symbol-observable "^1.1.0" is-path-cwd@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= + resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + integrity sha512-cnS56eR9SPAscL77ik76ATVqoPARTqPIVkMDVxRaWH06zT+6+CzIroYRJ0VVvm0Z1zfAvxvz9i/D3Ppjaqt5Nw== is-path-cwd@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz" + resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== is-path-in-cwd@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz" + resolved "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== dependencies: is-path-inside "^1.0.0" is-path-inside@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= + resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha512-qhsCR/Esx4U4hg/9I19OVUAJkGWtjRYHMRgUMZE2TDdj+Ag+kttZanLupfddNyglzz50cUlmWzUaI37GDfNx/g== dependencies: path-is-inside "^1.0.1" is-path-inside@^3.0.2, is-path-inside@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" + resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== is-plain-obj@^2.0.0, is-plain-obj@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-plain-object@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g== is-plain-object@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== is-promise@4.0.0: @@ -11144,23 +9637,15 @@ is-promise@4.0.0: is-promise@^2.1.0, is-promise@^2.2.2: version "2.2.2" - resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== is-reference@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + resolved "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + "@types/estree" "*" is-regex@^1.2.1: version "1.2.1" @@ -11174,7 +9659,7 @@ is-regex@^1.2.1: is-relative@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== dependencies: is-unc-path "^1.0.0" @@ -11184,20 +9669,6 @@ is-set@^2.0.3: resolved "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== -is-shared-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" - integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== - dependencies: - call-bind "^1.0.2" - -is-shared-array-buffer@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" - integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== - dependencies: - call-bind "^1.0.7" - is-shared-array-buffer@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz#9b67844bd9b7f246ba0708c3a93e34269c774f6f" @@ -11206,35 +9677,28 @@ is-shared-array-buffer@^1.0.4: call-bound "^1.0.3" is-ssh@^1.3.0: - version "1.3.3" - resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.3.tgz" - integrity sha512-NKzJmQzJfEEma3w5cJNcUMxoXfDjz0Zj0eyCalHn2E6VOwlzjZo0yuO2fcBSf8zhFuVCL/82/r5gRcoi6aEPVQ== + version "1.4.0" + resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz#4f8220601d2839d8fa624b3106f8e8884f01b8b2" + integrity sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ== dependencies: - protocols "^1.1.0" + protocols "^2.0.1" is-stream-ended@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz" + resolved "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz#f50224e95e06bce0e356d440a4827cd35b267eda" integrity sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw== is-stream@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== is-stream@^2.0.0, is-stream@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-string@^1.1.1: +is-string@^1.0.7, is-string@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz#92ea3f3d5c5b6e039ca8677e5ac8d07ea773cbb9" integrity sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== @@ -11244,18 +9708,11 @@ is-string@^1.1.1: is-subdir@^1.1.1: version "1.2.0" - resolved "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz" + resolved "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz#b791cd28fab5202e91a08280d51d9d7254fd20d4" integrity sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw== dependencies: better-path-resolve "1.0.0" -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - is-symbol@^1.0.4, is-symbol@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz#f47761279f532e2b05a7024a7506dbbedacd0634" @@ -11267,81 +9724,56 @@ is-symbol@^1.0.4, is-symbol@^1.1.1: is-text-path@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" - integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= + resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + integrity sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w== dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.13: - version "1.1.13" - resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" - integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== - dependencies: - which-typed-array "^1.1.14" - -is-typed-array@^1.1.14, is-typed-array@^1.1.15: +is-typed-array@^1.1.13, is-typed-array@^1.1.14, is-typed-array@^1.1.15, is-typed-array@^1.1.3: version "1.1.15" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== dependencies: which-typed-array "^1.1.16" -is-typed-array@^1.1.3, is-typed-array@^1.1.7: - version "1.1.8" - resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz" - integrity sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== is-unc-path@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== dependencies: unc-path-regex "^0.1.2" is-unicode-supported@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" + resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== is-url@^1.2.2, is-url@^1.2.4: version "1.2.4" - resolved "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz" + resolved "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q== is-valid-glob@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz" - integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + resolved "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA== is-weakmap@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" - -is-weakref@^1.1.0: +is-weakref@^1.0.2, is-weakref@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz#47e3472ae95a63fa9cf25660bcf0c181c39770ef" integrity sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q== @@ -11358,30 +9790,30 @@ is-weakset@^2.0.3: is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" + resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== is-wsl@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== dependencies: is-docker "^2.0.0" is-yarn-global@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz" + resolved "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== is2@^2.0.6: - version "2.0.7" - resolved "https://registry.npmjs.org/is2/-/is2-2.0.7.tgz" - integrity sha512-4vBQoURAXC6hnLFxD4VW7uc04XiwTTl/8ydYJxKvPwkWQrSjInkuM5VZVg6BGr1/natq69zDuvO9lGpLClJqvA== + version "2.0.9" + resolved "https://registry.npmjs.org/is2/-/is2-2.0.9.tgz#ff63b441f90de343fa8fac2125ee170da8e8240d" + integrity sha512-rZkHeBn9Zzq52sd9IUIV3a5mfwBY+o2HePMh0wkGBM4z4qjvy2GwVxQ6nNXSfw6MmVP6gf1QIlWjiOavhM3x5g== dependencies: deep-is "^0.1.3" ip-regex "^4.1.0" @@ -11389,13 +9821,13 @@ is2@^2.0.6: isarray@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== isarray@1.0.0, isarray@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isarray@^2.0.5: version "2.0.5" @@ -11403,30 +9835,35 @@ isarray@^2.0.5: integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== isbinaryfile@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz" - integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== + version "4.0.10" + resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== isexe@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isexe@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d" + integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ== isobject@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== isomorphic-fetch@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz" + resolved "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== dependencies: node-fetch "^2.6.1" @@ -11434,12 +9871,12 @@ isomorphic-fetch@^3.0.0: isstream@~0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== istanbul-instrumenter-loader@3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-3.0.1.tgz" + resolved "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-3.0.1.tgz#9957bd59252b373fae5c52b7b5188e6fde2a0949" integrity sha512-a5SPObZgS0jB/ixaKSMdn6n/gXSrK2S6q/UfRJBT3e6gQmVjwZROTODQsYW5ZNwOu78hG62Y3fWlebaVOL0C+w== dependencies: convert-source-map "^1.5.0" @@ -11449,29 +9886,29 @@ istanbul-instrumenter-loader@3.0.1: istanbul-lib-coverage@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== istanbul-lib-coverage@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: - version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz" - integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.2" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-hook@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== dependencies: append-transform "^2.0.0" istanbul-lib-instrument@^1.7.3: version "1.10.2" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== dependencies: babel-generator "^6.18.0" @@ -11484,7 +9921,7 @@ istanbul-lib-instrument@^1.7.3: istanbul-lib-instrument@^4.0.0: version "4.0.3" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== dependencies: "@babel/core" "^7.7.5" @@ -11492,31 +9929,41 @@ istanbul-lib-instrument@^4.0.0: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + istanbul-lib-processinfo@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz" - integrity sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw== + version "2.0.3" + resolved "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz#366d454cd0dcb7eb6e0e419378e60072c8626169" + integrity sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg== dependencies: archy "^1.0.0" - cross-spawn "^7.0.0" - istanbul-lib-coverage "^3.0.0-alpha.1" - make-dir "^3.0.0" + cross-spawn "^7.0.3" + istanbul-lib-coverage "^3.2.0" p-map "^3.0.0" rimraf "^3.0.0" - uuid "^3.3.3" + uuid "^8.3.2" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^3.0.6: version "3.0.6" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== dependencies: debug "^4.1.1" @@ -11526,25 +9973,25 @@ istanbul-lib-source-maps@^3.0.6: source-map "^0.6.1" istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + version "4.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + version "3.1.7" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" istextorbinary@^3.0.0: version "3.3.0" - resolved "https://registry.npmjs.org/istextorbinary/-/istextorbinary-3.3.0.tgz" + resolved "https://registry.npmjs.org/istextorbinary/-/istextorbinary-3.3.0.tgz#06b1c57d948da11461bd237c00ce09e9902964f2" integrity sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ== dependencies: binaryextensions "^2.2.0" @@ -11561,13 +10008,13 @@ jackspeak@^3.1.2: jasmine-core@~2.8.0: version "2.8.0" - resolved "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + resolved "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ== jasmine@2.8.0: version "2.8.0" - resolved "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + resolved "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha512-KbdGQTf5jbZgltoHs31XGiChAPumMSY64OZMWLNYnEnMfG5uwGBhffePwuskexjT+/Jea/gU3qAU8344hNohSw== dependencies: exit "^0.1.2" glob "^7.0.6" @@ -11575,222 +10022,209 @@ jasmine@2.8.0: jasminewd2@^2.1.0: version "2.2.0" - resolved "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz" - integrity sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4= + resolved "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e" + integrity sha512-Rn0nZe4rfDhzA63Al3ZGh0E+JTmM6ESZYXJGKuqKGZObsAB9fwXPD03GjtIEvJBDOhN94T5MzbwZSqzFHSQPzg== -jest-diff@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-27.2.0.tgz" - integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== dependencies: chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.0" - -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.0.6.tgz" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== - -jest-haste-map@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.2.0.tgz" - integrity sha512-laFet7QkNlWjwZtMGHCucLvF8o9PAh2cgePRck1+uadSM4E4XH9J4gnx4do+a6do8ZV5XHNEAXEkIoNg5XUH2Q== - dependencies: - "@jest/types" "^27.1.1" - "@types/graceful-fs" "^4.1.2" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^27.0.6" - jest-serializer "^27.0.6" - jest-util "^27.2.0" - jest-worker "^27.2.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" micromatch "^4.0.4" - walker "^1.0.7" + walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-matcher-utils@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.2.0.tgz" - integrity sha512-F+LG3iTwJ0gPjxBX6HCyrARFXq6jjiqhwBQeskkJQgSLeF1j6ui1RTV08SR7O51XTUhtc8zqpDj8iCG4RGmdKw== +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" - jest-diff "^27.2.0" - jest-get-type "^27.0.6" - pretty-format "^27.2.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" -jest-message-util@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.2.0.tgz" - integrity sha512-y+sfT/94CiP8rKXgwCOzO1mUazIEdEhrLjuiu+RKmCP+8O/TJTSne9dqQRbFIHBtlR2+q7cddJlWGir8UATu5w== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.1" + "@jest/types" "^29.6.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.2.0" + pretty-format "^29.7.0" slash "^3.0.0" stack-utils "^2.0.3" jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + version "1.2.3" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.0.6.tgz" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.2.0.tgz" - integrity sha512-v09p9Ib/VtpHM6Cz+i9lEAv1Z/M5NVxsyghRHRMEUOqwPQs3zwTdwp1xS3O/k5LocjKiGS0OTaJoBSpjbM2Jlw== +jest-resolve@29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: - "@jest/types" "^27.1.1" chalk "^4.0.0" - escalade "^3.1.1" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" + resolve.exports "^2.0.0" slash "^3.0.0" -jest-serializer@^27.0.6: - version "27.0.6" - resolved "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.0.6.tgz" - integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.4" - -jest-snapshot@^27.0.6: - version "27.2.1" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.2.1.tgz" - integrity sha512-8CTg2YrgZuQbPHW7G0YvLTj4yTRXLmSeEO+ka3eC5lbu5dsTRyoDNS1L7x7EFUTyYQhFH9HQG1/TNlbUgR9Lug== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: - "@babel/core" "^7.7.2" + "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" - "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.1" - "@jest/types" "^27.1.1" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.1.5" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.1" - graceful-fs "^4.2.4" - jest-diff "^27.2.0" - jest-get-type "^27.0.6" - jest-haste-map "^27.2.0" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-resolve "^27.2.0" - jest-util "^27.2.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^27.2.0" - semver "^7.3.2" + pretty-format "^29.7.0" + semver "^7.5.3" -jest-util@^27.0.6, jest-util@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-27.2.0.tgz" - integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^3.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-27.2.0.tgz" - integrity sha512-uIEZGkFKk3+4liA81Xu0maG5aGDyPLdp+4ed244c+Ql0k3aLWQYcMbaMLXOIFcb83LPHzYzqQ8hwNnIxTqfAGQ== +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.0.6" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^27.2.0" + pretty-format "^29.7.0" jest-worker@^24.0.0: version "24.9.0" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== dependencies: merge-stream "^2.0.0" supports-color "^6.1.0" -jest-worker@^27.0.6, jest-worker@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz" - integrity sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA== +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^27.4.5: - version "27.5.1" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" - integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" jju@^1.1.0, jju@~1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz" - integrity sha1-o6vicYryQaKykE+EpiWXDzia4yo= + resolved "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" + integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA== join-path@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/join-path/-/join-path-1.1.1.tgz" - integrity sha1-EFNaEm0ky9Zff/zfFe8uYxB2tQU= + resolved "https://registry.npmjs.org/join-path/-/join-path-1.1.1.tgz#10535a126d24cbd65f7ffcdf15ef2e631076b505" + integrity sha512-jnt9OC34sLXMLJ6YfPQ2ZEKrR9mB5ZbSnQb4LPaOx1c5rTzxpR33L18jjp0r75mGGTJmsil3qwN1B5IBeTnSSA== dependencies: as-array "^2.0.0" url-join "0.0.1" valid-url "^1" jquery@^3.4.1: - version "3.6.0" - resolved "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz" - integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== + version "3.7.1" + resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-tokens@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" js-yaml@^3.13.1, js-yaml@^3.14.1, js-yaml@^3.6.1: version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" @@ -11798,7 +10232,7 @@ js-yaml@^3.13.1, js-yaml@^3.14.1, js-yaml@^3.6.1: js-yaml@~3.13.1: version "3.13.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== dependencies: argparse "^1.0.7" @@ -11811,29 +10245,19 @@ jsbn@1.1.0: jsbn@~0.1.0: version "0.1.1" - resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== jsesc@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA== jsesc@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - jsesc@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" @@ -11841,77 +10265,78 @@ jsesc@~3.0.2: json-bigint@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" + resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== dependencies: bignumber.js "^9.0.0" json-buffer@3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" + resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-parse-helpfulerror@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz" - integrity sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w= + resolved "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz#13f14ce02eed4e981297b64eb9e3b932e2dd13dc" + integrity sha512-XgP0FGR77+QhUxjXkwOMkC94k3WtqEBfcnjWqhRd82qTat4SWKRE+9kUnynz/shm3I4ea2+qISvTIeGTNU7kJg== dependencies: jju "^1.1.0" json-ptr@^3.0.1: version "3.1.1" - resolved "https://registry.npmjs.org/json-ptr/-/json-ptr-3.1.1.tgz" + resolved "https://registry.npmjs.org/json-ptr/-/json-ptr-3.1.1.tgz#184c3d48db659fa9bbc1519f7db6f390ddffb659" integrity sha512-SiSJQ805W1sDUCD1+/t1/1BIrveq2Fe9HJqENxZmMCILmrPI7WhS/pePpIOx85v6/H2z1Vy7AI08GV2TzfXocg== json-schema-traverse@^0.3.0: version "0.3.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + integrity sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA== json-schema-traverse@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz#52d4361b47d49168bcc4e564189a42e5a7439454" - integrity sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg== +json-stable-stringify@1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz#addb683c2b78014d0b78d704c2fcbdf0695a60e2" + integrity sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA== dependencies: - call-bind "^1.0.5" + call-bind "^1.0.8" + call-bound "^1.0.3" isarray "^2.0.5" jsonify "^0.0.1" object-keys "^1.1.1" json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== json5@^1.0.1, json5@^1.0.2: version "1.0.2" @@ -11927,14 +10352,14 @@ json5@^2.1.2, json5@^2.2.3: jsonfile@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== optionalDependencies: graceful-fs "^4.1.6" jsonfile@^6.0.1: version "6.1.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== dependencies: universalify "^2.0.0" @@ -11943,40 +10368,46 @@ jsonfile@^6.0.1: jsonify@^0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz" + resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== jsonwebtoken@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz" - integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== + version "9.0.2" + resolved "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" + integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== dependencies: jws "^3.2.2" - lodash "^4.17.21" + lodash.includes "^4.3.0" + lodash.isboolean "^3.0.3" + lodash.isinteger "^4.0.4" + lodash.isnumber "^3.0.3" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.once "^4.0.0" ms "^2.1.1" - semver "^7.3.8" + semver "^7.5.4" jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" jssha@^3.1.2: - version "3.3.0" - resolved "https://registry.npmjs.org/jssha/-/jssha-3.3.0.tgz" - integrity sha512-w9OtT4ALL+fbbwG3gw7erAO0jvS5nfvrukGPMWIAoea359B26ALXGpzy4YJSp9yGnpUvuvOw1nSjSoHDfWSr1w== + version "3.3.1" + resolved "https://registry.npmjs.org/jssha/-/jssha-3.3.1.tgz#c5b7fc7fb9aa745461923b87df0e247dd59c7ea8" + integrity sha512-VCMZj12FCFMQYcFLPRm/0lOBbLi8uM2BhXPTqw3U4YAfs4AZfiApOoBLoN8cQE60Z50m1MYMTQVCfgF/KaCVhQ== -jszip@^3.1.3, jszip@^3.10.0, jszip@^3.6.0: +jszip@^3.1.3, jszip@^3.10.1: version "3.10.1" resolved "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g== @@ -11988,17 +10419,17 @@ jszip@^3.1.3, jszip@^3.10.0, jszip@^3.6.0: just-debounce@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz" + resolved "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz#2f81a3ad4121a76bc7cb45dbf704c0d76a8e5ddf" integrity sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ== just-extend@^4.0.2: version "4.2.1" - resolved "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz" + resolved "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== jwa@^1.4.1: version "1.4.1" - resolved "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz" + resolved "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== dependencies: buffer-equal-constant-time "1.0.1" @@ -12007,7 +10438,7 @@ jwa@^1.4.1: jwa@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz" + resolved "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== dependencies: buffer-equal-constant-time "1.0.1" @@ -12016,7 +10447,7 @@ jwa@^2.0.0: jws@^3.2.2: version "3.2.2" - resolved "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz" + resolved "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== dependencies: jwa "^1.4.1" @@ -12024,7 +10455,7 @@ jws@^3.2.2: jws@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz" + resolved "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== dependencies: jwa "^2.0.0" @@ -12032,21 +10463,21 @@ jws@^4.0.0: karma-chrome-launcher@3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz" + resolved "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz#eb9c95024f2d6dfbb3748d3415ac9b381906b9a9" integrity sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q== dependencies: which "^1.2.1" karma-cli@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/karma-cli/-/karma-cli-2.0.0.tgz" + resolved "https://registry.npmjs.org/karma-cli/-/karma-cli-2.0.0.tgz#481548d28661af4cc68f3d8e09708f17d2cba931" integrity sha512-1Kb28UILg1ZsfqQmeELbPzuEb5C6GZJfVIk0qOr8LNYQuYWmAaqP16WpbpKEjhejDrDYyYOwwJXSZO6u7q5Pvw== dependencies: resolve "^1.3.3" karma-coverage-istanbul-reporter@3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-3.0.3.tgz" + resolved "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-3.0.3.tgz#f3b5303553aadc8e681d40d360dfdc19bc7e9fe9" integrity sha512-wE4VFhG/QZv2Y4CdAYWDbMmcAHeS926ZIji4z+FkB2aF/EposRb6DP6G5ncT/wXhqUfAb/d7kZrNKPonbvsATw== dependencies: istanbul-lib-coverage "^3.0.0" @@ -12065,8 +10496,8 @@ karma-firefox-launcher@2.1.3: karma-mocha-reporter@2.2.5: version "2.2.5" - resolved "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz" - integrity sha1-FRIAlejtgZGG5HoLAS8810GJVWA= + resolved "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560" + integrity sha512-Hr6nhkIp0GIJJrvzY8JFeHpQZNseuIakGac4bpw8K1+5F0tLb6l7uvXRa8mt2Z+NVwYgCct4QAfp2R2QP6o00w== dependencies: chalk "^2.1.0" log-symbols "^2.1.0" @@ -12074,28 +10505,28 @@ karma-mocha-reporter@2.2.5: karma-mocha@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz" + resolved "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz#4b0254a18dfee71bdbe6188d9a6861bf86b0cd7d" integrity sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ== dependencies: minimist "^1.2.3" karma-sourcemap-loader@0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.4.0.tgz" + resolved "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.4.0.tgz#b01d73f8f688f533bcc8f5d273d43458e13b5488" integrity sha512-xCRL3/pmhAYF3I6qOrcn0uhbQevitc2DERMPH82FMnG+4WReoGcGFZb1pURf2a5apyrOHRdvD+O6K7NljqKHyA== dependencies: graceful-fs "^4.2.10" karma-spec-reporter@0.0.36: version "0.0.36" - resolved "https://registry.npmjs.org/karma-spec-reporter/-/karma-spec-reporter-0.0.36.tgz" + resolved "https://registry.npmjs.org/karma-spec-reporter/-/karma-spec-reporter-0.0.36.tgz#c54dc155dec2ded1f92ea68dbbdd67fcedbef350" integrity sha512-11bvOl1x6ryKZph7kmbmMpbi8vsngEGxGOoeTlIcDaH3ab3j8aPJnZ+r+K/SS0sBSGy5VGkGYO2+hLct7hw/6w== dependencies: colors "1.4.0" karma-summary-reporter@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/karma-summary-reporter/-/karma-summary-reporter-3.1.1.tgz" + resolved "https://registry.npmjs.org/karma-summary-reporter/-/karma-summary-reporter-3.1.1.tgz#53d31560a8196027a88c01ae9ac69029286a3da8" integrity sha512-7MkR8aXBZh5e773SDyzgAQhFg1FsAb4xYi7HYIludpYCPRVS+JxF8Qjxnix7OVVMDArq+prXzVNn+2U5+h1U1w== dependencies: chalk "^4.0.0" @@ -12110,7 +10541,7 @@ karma-webkit-launcher@2.6.0: karma-webpack@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz" + resolved "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz#2a2c7b80163fe7ffd1010f83f5507f95ef39f840" integrity sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA== dependencies: glob "^7.1.3" @@ -12147,79 +10578,79 @@ karma@6.4.4: ua-parser-js "^0.7.30" yargs "^16.1.1" -keyv@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz" - integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== +keyv@^4.0.0, keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0, kind-of@^5.0.2: +kind-of@^5.0.2: version "5.1.0" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== klaw-sync@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz" + resolved "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== dependencies: graceful-fs "^4.1.11" kuler@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz" + resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== last-run@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz" - integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= + resolved "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ== dependencies: default-resolution "^2.0.0" es6-weak-map "^2.0.1" lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= + version "1.0.1" + resolved "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz#494c831062f1f9408251ec44db1cba29242a2638" + integrity sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw== dependencies: readable-stream "^2.0.5" lcid@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw== dependencies: invert-kv "^1.0.0" lcov-parse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz" - integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= + resolved "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + integrity sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ== lcov-result-merger@3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz" + resolved "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz#66d4b12ced4830855404db82622ac9e450304205" integrity sha512-Krg9p24jGaIT93RBMA8b5qLHDEiAXTavaTiEdMAZaJS93PsBKIcg/89cw/8rgeSfRuQX+I9x7h73SHFjCZ6cHg== dependencies: through2 "^2.0.3" @@ -12229,14 +10660,14 @@ lcov-result-merger@3.3.0: lead@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz" - integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= + resolved "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + integrity sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow== dependencies: flush-write-stream "^1.0.2" lerna@4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz" + resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz#b139d685d50ea0ca1be87713a7c2f44a5b678e9e" integrity sha512-DD/i1znurfOmNJb0OBw66NmNqiM8kF6uIrzrJ0wGE3VNdzeOhz9ziWLYiRaZDGGwgbcjOo6eIfcx9O5Qynz+kg== dependencies: "@lerna/add" "4.0.0" @@ -12260,12 +10691,12 @@ lerna@4.0.0: leven@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" + resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== levn@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" + resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: prelude-ls "^1.2.1" @@ -12273,7 +10704,7 @@ levn@^0.4.1: libnpmaccess@^4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz" + resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz#dfb0e5b0a53c315a2610d300e46b4ddeb66e7eec" integrity sha512-sPeTSNImksm8O2b6/pf3ikv4N567ERYEpeKRPSmqlNt1dTZbvgpJIzg5vAhXHpw2ISBsELFRelk0jEahj1c6nQ== dependencies: aproba "^2.0.0" @@ -12283,7 +10714,7 @@ libnpmaccess@^4.0.1: libnpmpublish@^4.0.0: version "4.0.2" - resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-4.0.2.tgz" + resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-4.0.2.tgz#be77e8bf5956131bcb45e3caa6b96a842dec0794" integrity sha512-+AD7A2zbVeGRCFI2aO//oUmapCwy7GHqPXFJh3qpToSRNU+tXKJ2YFUgjt04LPPAf2dlEH95s6EhIHM1J7bmOw== dependencies: normalize-package-data "^3.0.2" @@ -12293,27 +10724,27 @@ libnpmpublish@^4.0.0: ssri "^8.0.1" libsodium-wrappers@^0.7.10: - version "0.7.10" - resolved "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz" - integrity sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg== + version "0.7.15" + resolved "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.15.tgz#53f13e483820272a3d55b23be2e34402ac988055" + integrity sha512-E4anqJQwcfiC6+Yrl01C1m8p99wEhLmJSs0VQqST66SbQXXBoaJY0pF4BNjRYa/sOQAxx6lXAaAFIlx+15tXJQ== dependencies: - libsodium "^0.7.0" + libsodium "^0.7.15" -libsodium@^0.7.0: - version "0.7.10" - resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz" - integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ== +libsodium@^0.7.15: + version "0.7.15" + resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.15.tgz#ac284e3dcb1c29ae9526c5581cdada6a072f6d20" + integrity sha512-sZwRknt/tUpE2AwzHq3jEyUU5uvIZHtSssktXq7owd++3CSgn8RGrv6UZJJBpP7+iBghBqe7Z06/2M31rI2NKw== lie@~3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz" + resolved "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ== dependencies: immediate "~3.0.5" liftoff@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz" + resolved "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== dependencies: extend "^3.0.0" @@ -12326,18 +10757,18 @@ liftoff@^3.1.0: resolve "^1.1.7" lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== listr-silent-renderer@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz" - integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= + resolved "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + integrity sha512-L26cIFm7/oZeSNVhWB6faeorXhMg4HNlb/dS/7jHhr708jxlXrtrBWo4YUxZQkc6dGoxEAe6J/D3juTRBUzjtA== listr-update-renderer@^0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz" + resolved "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== dependencies: chalk "^1.1.3" @@ -12351,7 +10782,7 @@ listr-update-renderer@^0.5.0: listr-verbose-renderer@^0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz" + resolved "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== dependencies: chalk "^2.4.1" @@ -12361,7 +10792,7 @@ listr-verbose-renderer@^0.5.0: listr@0.14.3: version "0.14.3" - resolved "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz" + resolved "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== dependencies: "@samverschueren/stream-to-observable" "^0.3.0" @@ -12376,8 +10807,8 @@ listr@0.14.3: load-json-file@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A== dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -12387,8 +10818,8 @@ load-json-file@^1.0.0: load-json-file@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== dependencies: graceful-fs "^4.1.2" parse-json "^4.0.0" @@ -12397,7 +10828,7 @@ load-json-file@^4.0.0: load-json-file@^6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" integrity sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ== dependencies: graceful-fs "^4.1.15" @@ -12406,29 +10837,20 @@ load-json-file@^6.2.0: type-fest "^0.6.0" loader-runner@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" - integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + version "4.3.0" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.1.0: - version "1.4.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.2" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - -loader-utils@^2.0.4: +loader-utils@^2.0.0, loader-utils@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== @@ -12439,15 +10861,15 @@ loader-utils@^2.0.4: locate-path@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== dependencies: p-locate "^2.0.0" path-exists "^3.0.0" locate-path@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" @@ -12455,70 +10877,100 @@ locate-path@^3.0.0: locate-path@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" locate-path@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" lodash._objecttypes@~2.4.1: version "2.4.1" - resolved "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz" - integrity sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE= + resolved "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz#7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11" + integrity sha512-XpqGh1e7hhkOzftBfWE7zt+Yn9mVHFkDhicVttvKLsoCMLVVL+xTQjfjB4X4vtznauxv0QZ5ZAeqjvat0dh62Q== lodash._reinterpolate@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= + resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== lodash.camelcase@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== lodash.clone@^4.3.2: version "4.5.0" - resolved "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= + resolved "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" + integrity sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg== lodash.debounce@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== lodash.flattendeep@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz" - integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ== lodash.get@^4.0.0, lodash.get@^4.4.2: version "4.4.2" - resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz" - integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== + +lodash.isboolean@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" + integrity sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg== lodash.isequal@^4.0.0, lodash.isequal@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + +lodash.isinteger@^4.0.4: + version "4.0.4" + resolved "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" + integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA== lodash.ismatch@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz" - integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= + resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" + integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== + +lodash.isnumber@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" + integrity sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw== lodash.isobject@^2.4.1: version "2.4.1" - resolved "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz" - integrity sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU= + resolved "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" + integrity sha512-sTebg2a1PoicYEZXD5PBdQcTlIJ6hUslrlWr7iV0O7n+i4596s2NQ9I5CaZ5FbXSfya/9WQsrYLANUJv9paYVA== dependencies: lodash._objecttypes "~2.4.1" +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== + lodash.mapvalues@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" @@ -12526,27 +10978,32 @@ lodash.mapvalues@^4.6.0: lodash.merge@^4.6.2: version "4.6.2" - resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" + resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.once@^4.0.0: + version "4.1.1" + resolved "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" + integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== + lodash.snakecase@^4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz" - integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= + resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== lodash.some@^4.2.2: version "4.6.0" - resolved "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= + resolved "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" + integrity sha512-j7MJE+TuT51q9ggt4fSgVqro163BEFjAt3u97IqU+JA2DkWl80nFTrowzLpZ/BnpN7rrl0JA/593NAdd8p/scQ== lodash.startcase@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz" - integrity sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg= + resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" + integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg== lodash.template@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz" + resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: lodash._reinterpolate "^3.0.0" @@ -12554,24 +11011,24 @@ lodash.template@^4.5.0: lodash.templatesettings@^4.0.0: version "4.2.0" - resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz" + resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: lodash._reinterpolate "^3.0.0" lodash@4.17.21, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0, lodash@~4.17.15, lodash@~4.17.21: version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-driver@^1.2.7: version "1.2.7" - resolved "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz" + resolved "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== log-symbols@4.1.0, log-symbols@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" @@ -12579,62 +11036,63 @@ log-symbols@4.1.0, log-symbols@^4.1.0: log-symbols@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz" - integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ== dependencies: chalk "^1.0.0" log-symbols@^2.1.0: version "2.2.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== dependencies: chalk "^2.0.1" log-update@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz" - integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= + resolved "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg== dependencies: ansi-escapes "^3.0.0" cli-cursor "^2.0.0" wrap-ansi "^3.0.1" log4js@^6.4.1: - version "6.4.2" - resolved "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz" - integrity sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg== + version "6.9.1" + resolved "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz#aba5a3ff4e7872ae34f8b4c533706753709e38b6" + integrity sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g== dependencies: - date-format "^4.0.4" - debug "^4.3.3" - flatted "^3.2.5" + date-format "^4.0.14" + debug "^4.3.4" + flatted "^3.2.7" rfdc "^1.3.0" - streamroller "^3.0.4" + streamroller "^3.1.5" -logform@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/logform/-/logform-2.3.0.tgz" - integrity sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ== +logform@^2.7.0: + version "2.7.0" + resolved "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz#cfca97528ef290f2e125a08396805002b2d060d1" + integrity sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ== dependencies: - colors "^1.2.1" + "@colors/colors" "1.6.0" + "@types/triple-beam" "^1.3.2" fecha "^4.2.0" ms "^2.1.1" - safe-stable-stringify "^1.1.0" + safe-stable-stringify "^2.3.1" triple-beam "^1.3.0" long@3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/long/-/long-3.2.0.tgz" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + resolved "https://registry.npmjs.org/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha512-ZYvPPOMqUwPoDsbJaR10iQJYnMuZhRTvHYl62ErLIEX7RgFlziSBUUvrt3OVfc47QlHHpzPZYP17g3Fv7oeJkg== long@^5.0.0: - version "5.2.3" - resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz" - integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + version "5.2.4" + resolved "https://registry.npmjs.org/long/-/long-5.2.4.tgz#ee651d5c7c25901cfca5e67220ae9911695e99b2" + integrity sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg== loose-envify@^1.0.0: version "1.4.0" - resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" @@ -12648,17 +11106,17 @@ loupe@^2.3.6: lowercase-keys@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz" + resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== -lru-cache@^10.2.0: +lru-cache@^10.0.1, lru-cache@^10.2.0: version "10.4.3" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== lru-cache@^4.0.1: version "4.1.5" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== dependencies: pseudomap "^1.0.2" @@ -12666,27 +11124,27 @@ lru-cache@^4.0.1: lru-cache@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" lru-cache@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== dependencies: yallist "^4.0.0" -lru-cache@^7.14.1, lru-cache@^7.7.1: +lru-cache@^7.14.1: version "7.18.3" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== lru-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz" - integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= + resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== dependencies: es5-ext "~0.10.2" @@ -12700,33 +11158,26 @@ lsofi@1.0.0: lunr@^2.3.8: version "2.3.9" - resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz" + resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== magic-string@^0.25.2, magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + version "0.25.9" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: - sourcemap-codec "^1.4.4" - -magic-string@^0.30.2: - version "0.30.8" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz#14e8624246d2bedba70d5462aa99ac9681844613" - integrity sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ== - dependencies: - "@jridgewell/sourcemap-codec" "^1.4.15" + sourcemap-codec "^1.4.8" -magic-string@~0.26.2: - version "0.26.7" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz" - integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow== +magic-string@^0.30.2, magic-string@~0.30.0: + version "0.30.17" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453" + integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA== dependencies: - sourcemap-codec "^1.4.8" + "@jridgewell/sourcemap-codec" "^1.5.0" make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== dependencies: pify "^4.0.1" @@ -12734,41 +11185,44 @@ make-dir@^2.0.0, make-dir@^2.1.0: make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-error@^1.1.1: version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^10.0.3: - version "10.2.1" - resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz" - integrity sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w== +make-fetch-happen@^13.0.0: + version "13.0.1" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz#273ba2f78f45e1f3a6dca91cede87d9fa4821e36" + integrity sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA== dependencies: - agentkeepalive "^4.2.1" - cacache "^16.1.0" - http-cache-semantics "^4.1.0" - http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.0" + "@npmcli/agent" "^2.0.0" + cacache "^18.0.0" + http-cache-semantics "^4.1.1" is-lambda "^1.0.1" - lru-cache "^7.7.1" - minipass "^3.1.6" - minipass-collect "^1.0.2" - minipass-fetch "^2.0.3" + minipass "^7.0.2" + minipass-fetch "^3.0.0" minipass-flush "^1.0.5" minipass-pipeline "^1.2.4" negotiator "^0.6.3" + proc-log "^4.2.0" promise-retry "^2.0.1" - socks-proxy-agent "^7.0.0" - ssri "^9.0.0" + ssri "^10.0.0" make-fetch-happen@^8.0.9: version "8.0.14" - resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== dependencies: agentkeepalive "^4.1.3" @@ -12789,7 +11243,7 @@ make-fetch-happen@^8.0.9: make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0: version "9.1.0" - resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== dependencies: agentkeepalive "^4.1.3" @@ -12811,37 +11265,37 @@ make-fetch-happen@^9.0.1, make-fetch-happen@^9.1.0: make-iterator@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz" + resolved "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== dependencies: kind-of "^6.0.2" -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: - tmpl "1.0.x" + tmpl "1.0.5" map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== map-obj@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== map-obj@^4.0.0: version "4.3.0" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== map-visit@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== dependencies: object-visit "^1.0.0" @@ -12860,7 +11314,7 @@ marked-terminal@^7.0.0: marked@^0.8.0: version "0.8.2" - resolved "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz" + resolved "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz#4faad28d26ede351a7a1aaa5fec67915c869e355" integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw== marked@^13.0.2: @@ -12870,8 +11324,8 @@ marked@^13.0.2: matchdep@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz" - integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= + resolved "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" + integrity sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA== dependencies: findup-sync "^2.0.0" micromatch "^3.0.4" @@ -12885,7 +11339,7 @@ math-intrinsics@^1.1.0: md5.js@^1.3.4: version "1.3.5" - resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" @@ -12894,23 +11348,23 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== memfs@3.5.3: version "3.5.3" - resolved "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz" + resolved "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz#d9b40fe4f8d5788c5f895bda804cd0d9eeee9f3b" integrity sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw== dependencies: fs-monkey "^1.0.4" memoizee@0.4.X: - version "0.4.15" - resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz" - integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== + version "0.4.17" + resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.17.tgz#942a5f8acee281fa6fb9c620bddc57e3b7382949" + integrity sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA== dependencies: - d "^1.0.1" - es5-ext "^0.10.53" + d "^1.0.2" + es5-ext "^0.10.64" es6-weak-map "^2.0.3" event-emitter "^0.3.5" is-promise "^2.2.2" @@ -12920,7 +11374,7 @@ memoizee@0.4.X: memory-fs@^0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz" + resolved "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== dependencies: errno "^0.1.3" @@ -12928,12 +11382,12 @@ memory-fs@^0.5.0: memorystream@^0.3.1: version "0.3.1" - resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== meow@^8.0.0: version "8.1.2" - resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" + resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== dependencies: "@types/minimist" "^1.2.0" @@ -12950,8 +11404,8 @@ meow@^8.0.0: merge-descriptors@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== merge-descriptors@1.0.3: version "1.0.3" @@ -12960,27 +11414,27 @@ merge-descriptors@1.0.3: merge-stream@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@1.4.1, merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== merge@^1.2.0: version "1.2.1" - resolved "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz" + resolved "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== methods@~1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" @@ -12997,15 +11451,7 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -micromatch@^4.0.8: +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -13015,89 +11461,77 @@ micromatch@^4.0.8: miller-rabin@^4.0.0: version "4.0.1" - resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz" + resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== dependencies: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== - mime-db@1.52.0: version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== "mime-db@>= 1.43.0 < 2": - version "1.50.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== - -mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.32" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== - dependencies: - mime-db "1.49.0" + version "1.53.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447" + integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== -mime-types@^2.1.35, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.35, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" mime@1.6.0, mime@^1.6.0: version "1.6.0" - resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" + resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== mime@^2.5.2: - version "2.5.2" - resolved "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== + version "2.6.0" + resolved "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== mimic-fn@^1.0.0: version "1.2.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-fn@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== mimic-response@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz" + resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== mimic-response@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz" + resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== min-indent@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== minimatch@4.2.1: version "4.2.1" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== dependencies: brace-expansion "^1.1.7" @@ -13109,30 +11543,23 @@ minimatch@9.0.3: dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.0, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.0.3, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.0, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1, minimatch@^5.1.0: +minimatch@^5.1.0: version "5.1.6" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== dependencies: brace-expansion "^2.0.1" minimatch@^6.1.6: version "6.2.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz#2b70fd13294178c69c04dfc05aebdb97a4e79e42" integrity sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg== dependencies: brace-expansion "^2.0.1" @@ -13146,38 +11573,40 @@ minimatch@^9.0.4: minimist-options@4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" + resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== minimist@~0.0.1: version "0.0.10" - resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw== minipass-collect@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz" + resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== dependencies: minipass "^3.0.0" +minipass-collect@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz#1621bc77e12258a12c60d34e2276ec5c20680863" + integrity sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw== + dependencies: + minipass "^7.0.3" + minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: version "1.4.1" - resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz" + resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== dependencies: minipass "^3.1.0" @@ -13186,12 +11615,12 @@ minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: optionalDependencies: encoding "^0.1.12" -minipass-fetch@^2.0.3: - version "2.1.2" - resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz" - integrity sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA== +minipass-fetch@^3.0.0: + version "3.0.5" + resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.5.tgz#f0f97e40580affc4a35cc4a1349f05ae36cb1e4c" + integrity sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg== dependencies: - minipass "^3.1.6" + minipass "^7.0.3" minipass-sized "^1.0.3" minizlib "^2.1.2" optionalDependencies: @@ -13199,70 +11628,68 @@ minipass-fetch@^2.0.3: minipass-flush@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz" + resolved "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== dependencies: minipass "^3.0.0" minipass-json-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz" - integrity sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg== + version "1.0.2" + resolved "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.2.tgz#5121616c77a11c406c3ffa77509e0b77bb267ec3" + integrity sha512-myxeeTm57lYs8pH2nxPzmEEg8DGIgW+9mv6D4JZD2pa81I/OBjeU7PtICXV6c9eRGTA5JMDsuIPUZRCyBMYNhg== dependencies: jsonparse "^1.3.1" minipass "^3.0.0" minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: version "1.2.4" - resolved "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz" + resolved "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== dependencies: minipass "^3.0.0" minipass-sized@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz" + resolved "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== dependencies: minipass "^3.0.0" minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" - resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz" + resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.5" - resolved "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz" - integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw== - dependencies: - yallist "^4.0.0" - -minipass@^3.1.6: version "3.3.6" - resolved "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz" + resolved "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== dependencies: yallist "^4.0.0" -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.2, minipass@^7.0.3, minipass@^7.1.2: version "7.1.2" resolved "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== minizlib@^1.3.3: version "1.3.3" - resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: minipass "^2.9.0" minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== dependencies: minipass "^3.0.0" @@ -13270,7 +11697,7 @@ minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: mixin-deep@^1.2.0: version "1.3.2" - resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz" + resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" @@ -13283,48 +11710,41 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: mkdirp-infer-owner@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz" + resolved "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz#55d3b368e7d89065c38f32fd38e638f0ab61d316" integrity sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw== dependencies: chownr "^2.0.0" infer-owner "^1.0.4" mkdirp "^1.0.3" -mkdirp@1.0.4, mkdirp@^1.0.3, mkdirp@^1.0.4, mkdirp@~1.0.4: +mkdirp@1.0.4, mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mkdirp@^0.5.6: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@^0.5.6: version "0.5.6" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== dependencies: minimist "^1.2.6" -mocha-chai-jest-snapshot@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.3.tgz" - integrity sha512-i2Vb+6mXKBMapNAbVUiM11CPJgkJ1BKwouH98Bcx0trgAcVZxdRt4pNlbLZogjQEj/gCmjrW5Y8hmYWWDoXwGg== +mocha-chai-jest-snapshot@1.1.6: + version "1.1.6" + resolved "https://registry.npmjs.org/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.6.tgz#cba844aeec6e19ef830992eb71817745c75e2e09" + integrity sha512-DSPZ5PtY1Rome58XSeS2/mggDJ60BIXDMlh58wsdkGfm1VvqTjjpFkjmR3g1iCtFAtPDXDmR9mYck1MygUEArA== dependencies: - "@jest/test-result" "^27.0.6" + "@jest/test-result" "^29.7.0" chalk "^4.1.2" find-package-json "^1.2.0" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" - yargs "^17.1.1" + yargs "^17.7.2" mocha@9.2.2: version "9.2.2" - resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz" + resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== dependencies: "@ungap/promise-all-settled" "1.1.2" @@ -13354,13 +11774,18 @@ mocha@9.2.2: modify-values@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz" + resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -moment@~2.29.3: - version "2.29.4" - resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz" - integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== +moment@~2.30.1: + version "2.30.1" + resolved "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" + integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== + +moo@^0.5.0: + version "0.5.2" + resolved "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz#f9fe82473bc7c184b0d32e2215d3f6e67278733c" + integrity sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q== moo@^0.5.0: version "0.5.2" @@ -13369,7 +11794,7 @@ moo@^0.5.0: morgan@^1.10.0, morgan@^1.8.2: version "1.10.0" - resolved "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz" + resolved "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" integrity sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ== dependencies: basic-auth "~2.0.1" @@ -13385,27 +11810,22 @@ mri@^1.2.0: ms@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== multimatch@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz" + resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz#932b800963cea7a31a033328fa1e0c3a1874dbe6" integrity sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA== dependencies: "@types/minimatch" "^3.0.3" @@ -13416,12 +11836,12 @@ multimatch@^5.0.0: mute-stdout@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz" + resolved "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== mute-stream@0.0.8, mute-stream@~0.0.4: version "0.0.8" - resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== mz@2.7.0, mz@^2.4.0: @@ -13433,29 +11853,19 @@ mz@2.7.0, mz@^2.4.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.12.1: - version "2.15.0" - resolved "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz" - integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== - -nan@^2.17.0: - version "2.17.0" - resolved "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== - -nanocolors@^0.1.5: - version "0.1.12" - resolved "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz" - integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== +nan@^2.12.1, nan@^2.20.0: + version "2.22.0" + resolved "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" + integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== nanoid@3.3.1: version "3.3.1" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== nanomatch@^1.2.9: version "1.2.13" - resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz" + resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" @@ -13470,15 +11880,15 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" - integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== +napi-build-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz#13c22c0187fcfccce1461844136372a47ddc027e" + integrity sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA== natural-compare@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== nearley@^2.20.1: version "2.20.1" @@ -13490,19 +11900,19 @@ nearley@^2.20.1: railroad-diagrams "^1.0.0" randexp "0.4.6" -negotiator@0.6.2, negotiator@^0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -negotiator@0.6.3, negotiator@^0.6.3: +negotiator@0.6.3: version "0.6.3" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -neo-async@^2.6.0, neo-async@^2.6.2: +negotiator@^0.6.2, negotiator@^0.6.3, negotiator@~0.6.4: + version "0.6.4" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz#777948e2452651c570b712dd01c23e262713fff7" + integrity sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w== + +neo-async@^2.6.2: version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== netmask@^2.0.2: @@ -13510,14 +11920,14 @@ netmask@^2.0.2: resolved "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== -next-tick@1, next-tick@^1.1.0: +next-tick@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" + resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== nise@^4.0.4: version "4.1.0" - resolved "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz" + resolved "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz#8fb75a26e90b99202fa1e63f448f58efbcdedaf6" integrity sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA== dependencies: "@sinonjs/commons" "^1.7.0" @@ -13533,11 +11943,6 @@ node-abi@^3.3.0: dependencies: semver "^7.3.5" -node-addon-api@^4.2.0: - version "4.3.0" - resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz" - integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== - node-addon-api@^7.0.0: version "7.1.1" resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" @@ -13553,21 +11958,7 @@ node-emoji@^2.1.3: emojilib "^2.4.0" skin-tone "^2.0.0" -node-fetch@^2.5.0, node-fetch@^2.6.1: - version "2.6.5" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz" - integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^2.6.9, node-fetch@^2.7.0: +node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -13576,7 +11967,7 @@ node-fetch@^2.6.9, node-fetch@^2.7.0: node-gyp@8.x: version "8.4.1" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== dependencies: env-paths "^2.2.0" @@ -13590,9 +11981,25 @@ node-gyp@8.x: tar "^6.1.2" which "^2.0.2" +node-gyp@^10.2.0: + version "10.3.1" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-10.3.1.tgz#1dd1a1a1c6c5c59da1a76aea06a062786b2c8a1a" + integrity sha512-Pp3nFHBThHzVtNY7U6JfPjvT/DTE8+o/4xKsLQtBoU+j2HLsGlhcfzflAoUreaJbNmYnX+LlLi0qjV8kpyO6xQ== + dependencies: + env-paths "^2.2.0" + exponential-backoff "^3.1.1" + glob "^10.3.10" + graceful-fs "^4.2.6" + make-fetch-happen "^13.0.0" + nopt "^7.0.0" + proc-log "^4.1.0" + semver "^7.3.5" + tar "^6.2.1" + which "^4.0.0" + node-gyp@^5.0.2: version "5.1.1" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e" integrity sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw== dependencies: env-paths "^2.2.0" @@ -13609,7 +12016,7 @@ node-gyp@^5.0.2: node-gyp@^7.1.0: version "7.1.2" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz#21a810aebb187120251c3bcec979af1587b188ae" integrity sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ== dependencies: env-paths "^2.2.0" @@ -13623,42 +12030,21 @@ node-gyp@^7.1.0: tar "^6.0.2" which "^2.0.2" -node-gyp@^9.3.0: - version "9.3.1" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.1.tgz" - integrity sha512-4Q16ZCqq3g8awk6UplT7AuxQ35XN4R/yf/+wSAwcBUAjg7l58RTactWaP8fIDTi0FzI7YcVLujwExakZlfWkXg== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.6" - make-fetch-happen "^10.0.3" - nopt "^6.0.0" - npmlog "^6.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.2" - which "^2.0.2" - node-int64@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-localstorage@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/node-localstorage/-/node-localstorage-1.3.1.tgz" + resolved "https://registry.npmjs.org/node-localstorage/-/node-localstorage-1.3.1.tgz#3177ef42837f398aee5dd75e319b281e40704243" integrity sha512-NMWCSWWc6JbHT5PyWlNT2i8r7PgGYXVntmKawY83k/M0UJScZ5jirb61TLnqKwd815DfBQu+lR3sRw08SPzIaQ== dependencies: write-file-atomic "^1.1.4" -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - node-polyfill-webpack-plugin@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz" + resolved "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz#141d86f177103a8517c71d99b7c6a46edbb1bb58" integrity sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A== dependencies: assert "^2.0.0" @@ -13689,21 +12075,11 @@ node-polyfill-webpack-plugin@2.0.1: node-preload@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz" + resolved "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== dependencies: process-on-spawn "^1.0.0" -node-releases@^1.1.76: - version "1.1.76" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz" - integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== - -node-releases@^2.0.13: - version "2.0.13" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz" - integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== - node-releases@^2.0.19: version "2.0.19" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" @@ -13711,17 +12087,17 @@ node-releases@^2.0.19: node-version@^1.0.0: version "1.2.0" - resolved "https://registry.npmjs.org/node-version/-/node-version-1.2.0.tgz" + resolved "https://registry.npmjs.org/node-version/-/node-version-1.2.0.tgz#34fde3ffa8e1149bd323983479dda620e1b5060d" integrity sha512-ma6oU4Sk0qOoKEAymVoTvk8EdXEobdS7m/mAGhDJ8Rouugho48crHBORAmy5BoOcv8wraPM6xumapQp5hl4iIQ== noop-fn@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/noop-fn/-/noop-fn-1.0.0.tgz" - integrity sha1-XzPUfxPSFQ35PgywNmmemC94/78= + resolved "https://registry.npmjs.org/noop-fn/-/noop-fn-1.0.0.tgz#5f33d47f13d2150df93e0cb036699e982f78ffbf" + integrity sha512-pQ8vODlgXt2e7A3mIbFDlizkr46r75V+BJxVAyat8Jl7YmI513gG5cfyRL0FedKraoZ+VAouI1h4/IWpus5pcQ== nopt@^4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz" + resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48" integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== dependencies: abbrev "1" @@ -13729,21 +12105,21 @@ nopt@^4.0.1: nopt@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz" + resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== dependencies: abbrev "1" -nopt@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz" - integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== +nopt@^7.0.0: + version "7.2.1" + resolved "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz#1cac0eab9b8e97c9093338446eddd40b2c8ca1e7" + integrity sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w== dependencies: - abbrev "^1.0.0" + abbrev "^2.0.0" normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" @@ -13753,7 +12129,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package- normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: version "3.0.3" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== dependencies: hosted-git-info "^4.0.1" @@ -13763,45 +12139,45 @@ normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== dependencies: remove-trailing-separator "^1.0.1" normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== normalize-url@^6.0.1, normalize-url@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== now-and-later@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz" + resolved "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== dependencies: once "^1.3.2" npm-bundled@^1.1.1: version "1.1.2" - resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz" + resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ== dependencies: npm-normalize-package-bin "^1.0.1" npm-install-checks@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz" + resolved "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz#a37facc763a2fde0497ef2c6d0ac7c3fbe00d7b4" integrity sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w== dependencies: semver "^7.1.1" npm-lifecycle@^3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz" + resolved "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz#9882d3642b8c82c815782a12e6a1bfeed0026309" integrity sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g== dependencies: byline "^5.0.0" @@ -13815,12 +12191,12 @@ npm-lifecycle@^3.1.5: npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz" + resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5: version "8.1.5" - resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz" + resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== dependencies: hosted-git-info "^4.0.1" @@ -13829,7 +12205,7 @@ npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-pack npm-packlist@^2.1.4: version "2.2.2" - resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz#076b97293fa620f632833186a7a8f65aaa6148c8" integrity sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg== dependencies: glob "^7.1.6" @@ -13839,7 +12215,7 @@ npm-packlist@^2.1.4: npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz" + resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz#7b5484ca2c908565f43b7f27644f36bb816f5148" integrity sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA== dependencies: npm-install-checks "^4.0.0" @@ -13849,7 +12225,7 @@ npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: npm-registry-fetch@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz" + resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76" integrity sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA== dependencies: make-fetch-happen "^9.0.1" @@ -13861,7 +12237,7 @@ npm-registry-fetch@^11.0.0: npm-registry-fetch@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz" + resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz#86f3feb4ce00313bc0b8f1f8f69daae6face1661" integrity sha512-PuFYYtnQ8IyVl6ib9d3PepeehcUeHN9IO5N/iCRhyg9tStQcqGQBRVHmfmMWPDERU3KwZoHFvbJ4FPXPspvzbA== dependencies: "@npmcli/ci-detect" "^1.0.0" @@ -13888,14 +12264,14 @@ npm-run-all2@5.0.2: npm-run-path@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" npmlog@^4.1.2: version "4.1.2" - resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" @@ -13903,19 +12279,9 @@ npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" -npmlog@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz" - integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== - dependencies: - are-we-there-yet "^2.0.0" - console-control-strings "^1.1.0" - gauge "^3.0.0" - set-blocking "^2.0.0" - npmlog@^6.0.0: version "6.0.2" - resolved "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" integrity sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg== dependencies: are-we-there-yet "^3.0.0" @@ -13925,12 +12291,12 @@ npmlog@^6.0.0: number-is-nan@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== nyc@15.1.0: version "15.1.0" - resolved "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz" + resolved "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" integrity sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A== dependencies: "@istanbuljs/load-nyc-config" "^1.0.0" @@ -13963,18 +12329,18 @@ nyc@15.1.0: oauth-sign@~0.9.0: version "0.9.0" - resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz" + resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@4.X, object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@4.X, object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== object-copy@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" @@ -13982,65 +12348,35 @@ object-copy@^0.1.0: object-hash@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz" + resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -object-inspect@^1.13.1: - version "1.13.1" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" - integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== - object-inspect@^1.13.3: version "1.13.3" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== +object-is@^1.1.5: + version "1.1.6" + resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" + integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + call-bind "^1.0.7" + define-properties "^1.2.1" -object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.assign@^4.1.5: - version "4.1.5" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" - integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== dependencies: - call-bind "^1.0.5" - define-properties "^1.2.1" - has-symbols "^1.0.3" - object-keys "^1.1.1" + isobject "^3.0.0" -object.assign@^4.1.7: +object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.4, object.assign@^4.1.7: version "4.1.7" resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== @@ -14054,8 +12390,8 @@ object.assign@^4.1.7: object.defaults@^1.0.0, object.defaults@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz" - integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= + resolved "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" + integrity sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA== dependencies: array-each "^1.0.1" array-slice "^1.0.0" @@ -14073,13 +12409,17 @@ object.fromentries@^2.0.8: es-object-atoms "^1.0.0" object.getownpropertydescriptors@^2.0.3: - version "2.1.2" - resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + version "2.1.8" + resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.8.tgz#2f1fe0606ec1a7658154ccd4f728504f69667923" + integrity sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + array.prototype.reduce "^1.0.6" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + gopd "^1.0.1" + safe-array-concat "^1.1.2" object.groupby@^1.0.3: version "1.0.3" @@ -14092,23 +12432,23 @@ object.groupby@^1.0.3: object.map@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz" - integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= + resolved "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" + integrity sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w== dependencies: for-own "^1.0.0" make-iterator "^1.0.0" object.pick@^1.2.0, object.pick@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== dependencies: isobject "^3.0.1" object.reduce@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz" - integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= + resolved "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw== dependencies: for-own "^1.0.0" make-iterator "^1.0.0" @@ -14123,75 +12463,68 @@ object.values@^1.2.0: define-properties "^1.2.1" es-object-atoms "^1.0.0" -on-finished@2.4.1: +on-finished@2.4.1, on-finished@^2.2.0: version "2.4.1" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: ee-first "1.1.1" -on-finished@^2.2.0, on-finished@~2.3.0: +on-finished@~2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== dependencies: ee-first "1.1.1" on-headers@^1.0.0, on-headers@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz" + resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" one-time@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz" + resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== dependencies: fn.name "1.x.x" onetime@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== dependencies: mimic-fn "^1.0.0" onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" open@^6.3.0: version "6.4.0" - resolved "https://registry.npmjs.org/open/-/open-6.4.0.tgz" + resolved "https://registry.npmjs.org/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" integrity sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg== dependencies: is-wsl "^1.1.0" open@^7.4.2: version "7.4.2" - resolved "https://registry.npmjs.org/open/-/open-7.4.2.tgz" + resolved "https://registry.npmjs.org/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== dependencies: is-docker "^2.0.0" is-wsl "^2.1.1" -openapi3-ts@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-2.0.1.tgz" - integrity sha512-v6X3iwddhi276siej96jHGIqTx3wzVfMTmpGJEQDt7GPI7pI6sywItURLzpEci21SBRpPN/aOWSF5mVfFVNmcg== - dependencies: - yaml "^1.10.0" - openapi3-ts@^3.1.1: version "3.2.0" resolved "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-3.2.0.tgz#7e30d33c480e938e67e809ab16f419bc9beae3f8" @@ -14201,13 +12534,13 @@ openapi3-ts@^3.1.1: opener@^1.5.1: version "1.5.2" - resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz" + resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== optimist@~0.6.0: version "0.6.1" - resolved "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + resolved "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g== dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -14226,7 +12559,7 @@ optionator@^0.9.3: ora@5.4.1, ora@^5.4.1: version "5.4.1" - resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz" + resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== dependencies: bl "^4.1.0" @@ -14241,36 +12574,36 @@ ora@5.4.1, ora@^5.4.1: ordered-read-streams@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz" - integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= + resolved "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + integrity sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw== dependencies: readable-stream "^2.0.1" os-browserify@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== os-homedir@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== os-locale@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + resolved "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g== dependencies: lcid "^1.0.0" os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== osenv@^0.1.4: version "0.1.5" - resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz" + resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" @@ -14278,7 +12611,7 @@ osenv@^0.1.4: outdent@^0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz" + resolved "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz#9e10982fdc41492bb473ad13840d22f9655be2ff" integrity sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q== own-keys@^1.0.1: @@ -14292,107 +12625,107 @@ own-keys@^1.0.1: p-cancelable@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz" + resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== p-defer@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz" + resolved "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz#d1dceb4ee9b2b604b1d94ffec83760175d4e6f83" integrity sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw== p-filter@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" integrity sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw== dependencies: p-map "^2.0.0" p-finally@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-limit@^1.1.0: version "1.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" -p-limit@^3.0.1, p-limit@^3.0.2, p-limit@^3.1.0: +p-limit@^3.0.1, p-limit@^3.0.2: version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" p-locate@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-locate@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" p-map-series@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz#7560d4c452d9da0c07e692fdbfe6e2c81a2a91f2" integrity sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q== p-map@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== p-map@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz" + resolved "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== dependencies: aggregate-error "^3.0.0" p-map@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" + resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== dependencies: aggregate-error "^3.0.0" p-pipe@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz" + resolved "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz#48b57c922aa2e1af6a6404cb7c6bf0eb9cc8e60e" integrity sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw== p-queue@^6.6.2: version "6.6.2" - resolved "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz" + resolved "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== dependencies: eventemitter3 "^4.0.4" @@ -14400,7 +12733,7 @@ p-queue@^6.6.2: p-reduce@^2.0.0, p-reduce@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== p-throttle@^7.0.0: @@ -14410,24 +12743,24 @@ p-throttle@^7.0.0: p-timeout@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz" + resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== dependencies: p-finally "^1.0.0" p-try@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== p-try@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== p-waterfall@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz" + resolved "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz#63153a774f472ccdc4eb281cdb2967fcf158b2ee" integrity sha512-RRTnDb2TBG/epPRI2yYXsimO0v3BXC8Yd3ogr1545IaqKK17VGhbWVeGGN+XfCm/08OK8635nH31c8bATkHuSw== dependencies: p-reduce "^2.0.0" @@ -14456,7 +12789,7 @@ pac-resolver@^7.0.1: package-hash@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz" + resolved "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz#3537f654665ec3cc38827387fc904c163c54f506" integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== dependencies: graceful-fs "^4.1.15" @@ -14476,12 +12809,12 @@ package-manager-detector@^0.2.0: package-name-regex@~2.0.6: version "2.0.6" - resolved "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.6.tgz" + resolved "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.6.tgz#b54bcb04d950e38082b7bb38fa558e01c1679334" integrity sha512-gFL35q7kbE/zBaPA3UKhp2vSzcPYx2ecbYuwv1ucE9Il6IIgBDweBlH8D68UFGZic2MkllKa2KHCfC1IQBQUYA== pacote@^11.2.6: version "11.3.5" - resolved "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz" + resolved "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== dependencies: "@npmcli/git" "^2.1.0" @@ -14506,28 +12839,17 @@ pacote@^11.2.6: pako@~1.0.2, pako@~1.0.5: version "1.0.11" - resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz" + resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== parent-module@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0: - version "5.1.6" - resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-asn1@^5.1.7: +parse-asn1@^5.0.0, parse-asn1@^5.1.7: version "5.1.7" resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz#73cdaaa822125f9647165625eb45f8a051d2df06" integrity sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg== @@ -14541,8 +12863,8 @@ parse-asn1@^5.1.7: parse-filepath@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz" - integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= + resolved "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q== dependencies: is-absolute "^1.0.0" map-cache "^0.2.0" @@ -14550,22 +12872,22 @@ parse-filepath@^1.0.1: parse-json@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + resolved "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ== dependencies: error-ex "^1.2.0" parse-json@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" parse-json@^5.0.0: version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" @@ -14575,18 +12897,18 @@ parse-json@^5.0.0: parse-node-version@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz" + resolved "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== parse-passwd@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz" - integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= + resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== parse-path@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.3.tgz" - integrity sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA== + version "4.0.4" + resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.4.tgz#4bf424e6b743fb080831f03b536af9fc43f0ffea" + integrity sha512-Z2lWUis7jlmXC1jeOG9giRO2+FsuyNipeQ43HAjqAZjwSe3SEf+q/84FGPHoso3kyntbxa4c4i77t3m6fGf8cw== dependencies: is-ssh "^1.3.0" protocols "^1.4.0" @@ -14594,9 +12916,9 @@ parse-path@^4.0.0: query-string "^6.13.8" parse-url@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/parse-url/-/parse-url-6.0.0.tgz" - integrity sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw== + version "6.0.5" + resolved "https://registry.npmjs.org/parse-url/-/parse-url-6.0.5.tgz#4acab8982cef1846a0f8675fa686cef24b2f6f9b" + integrity sha512-e35AeLTSIlkw/5GFq70IN7po8fmDUjpDPY1rIK+VubRfsUvBonjQ+PBZG+vWMACnQSmNlvl524IucoDmcioMxA== dependencies: is-ssh "^1.3.0" normalize-url "^6.1.0" @@ -14622,13 +12944,13 @@ parse5@^6.0.1: parseurl@~1.3.3: version "1.3.3" - resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" + resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== pascalcase@^0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== patch-package@7.0.2: version "7.0.2" @@ -14652,67 +12974,60 @@ patch-package@7.0.2: path-browserify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz" + resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== path-dirname@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== path-exists@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + resolved "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ== dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-is-inside@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-is-network-drive@^1.0.20: - version "1.0.20" - resolved "https://registry.npmjs.org/path-is-network-drive/-/path-is-network-drive-1.0.20.tgz" - integrity sha512-p5wCWlRB4+ggzxWshqHH9aF3kAuVu295NaENXmVhThbZPJQBeJdxZTP6CIoUR+kWHDUW56S9YcaO1gXnc/BOxw== - dependencies: - tslib "^2" + resolved "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w== path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-root-regex@^0.1.0: version "0.1.2" - resolved "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz" - integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= + resolved "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ== path-root@^0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz" - integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= + resolved "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg== dependencies: path-root-regex "^0.1.0" @@ -14724,13 +13039,6 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-strip-sep@^1.0.17: - version "1.0.17" - resolved "https://registry.npmjs.org/path-strip-sep/-/path-strip-sep-1.0.17.tgz" - integrity sha512-+2zIC2fNgdilgV7pTrktY6oOxxZUo9x5zJYfTzxsGze5kSGDDwhA5/0WlBn+sUyv/WuuyYn3OfM+Ue5nhdQUgA== - dependencies: - tslib "^2" - path-to-regexp@0.1.12: version "0.1.12" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" @@ -14738,13 +13046,13 @@ path-to-regexp@0.1.12: path-to-regexp@0.1.7: version "0.1.7" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== path-to-regexp@^1.7.0, path-to-regexp@^1.8.0: - version "1.8.0" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== + version "1.9.0" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz#5dc0753acbf8521ca2e0f137b4578b917b10cf24" + integrity sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g== dependencies: isarray "0.0.1" @@ -14755,8 +13063,8 @@ path-to-regexp@^8.0.0: path-type@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + resolved "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg== dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -14764,24 +13072,24 @@ path-type@^1.0.0: path-type@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz" + resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== dependencies: pify "^3.0.0" path-type@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== pathval@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" + resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pbkdf2@^3.0.3, pbkdf2@^3.1.2: +pbkdf2@^3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" @@ -14792,13 +13100,13 @@ pbkdf2@^3.0.3, pbkdf2@^3.1.2: pend@~1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + resolved "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== performance-now@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== pg-cloudflare@^1.1.1: version "1.1.1" @@ -14856,22 +13164,17 @@ pgpass@1.x: dependencies: split2 "^4.1.0" -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" + integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== -picocolors@^1.1.0, picocolors@^1.1.1: +picocolors@^1.0.0, picocolors@^1.1.0, picocolors@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -14888,86 +13191,72 @@ pidtree@^0.5.0: pify@^2.0.0, pify@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== pify@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pify@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pify@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== pinkie-promise@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw== dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" - resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" + resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== -pirates@^4.0.6: +pirates@^4.0.4, pirates@^4.0.6: version "4.0.6" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== -"pkg-dir@< 6 >= 5": - version "5.0.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - pkg-dir@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: find-up "^3.0.0" pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" -playwright-core@1.49.1: - version "1.49.1" - resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz#32c62f046e950f586ff9e35ed490a424f2248015" - integrity sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg== +playwright-core@1.50.0: + version "1.50.0" + resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.0.tgz#28dd6a1488211c193933695ed337a5b44d46867c" + integrity sha512-CXkSSlr4JaZs2tZHI40DsZUN/NIwgaUPsyLuOAaIZp2CyF2sN5MM5NJsyB188lFSSozFxQ5fPT4qM+f0tH/6wQ== -playwright@1.49.1: - version "1.49.1" - resolved "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz#830266dbca3008022afa7b4783565db9944ded7c" - integrity sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA== +playwright@1.50.0: + version "1.50.0" + resolved "https://registry.npmjs.org/playwright/-/playwright-1.50.0.tgz#ccaf334f948d78139922844de55a18f8ae785410" + integrity sha512-+GinGfGTrd2IfX1TA4N2gNmeIksSb+IAe589ZH+FlmpV3MYTx6+buChGIuDLQwrGNCw2lWibqV50fU510N7S+w== dependencies: - playwright-core "1.49.1" + playwright-core "1.50.0" optionalDependencies: fsevents "2.3.2" plugin-error@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz" + resolved "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== dependencies: ansi-colors "^1.0.1" @@ -14975,18 +13264,9 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" -portfinder@^1.0.28: - version "1.0.28" - resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz" - integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== - dependencies: - async "^2.6.2" - debug "^3.1.1" - mkdirp "^0.5.5" - -portfinder@^1.0.32: +portfinder@^1.0.28, portfinder@^1.0.32: version "1.0.32" - resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz" + resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" integrity sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg== dependencies: async "^2.6.4" @@ -14995,8 +13275,8 @@ portfinder@^1.0.32: posix-character-classes@^0.1.0: version "0.1.1" - resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== possible-typed-array-names@^1.0.0: version "1.0.0" @@ -15004,13 +13284,12 @@ possible-typed-array-names@^1.0.0: integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== postcss@^7.0.16: - version "7.0.36" - resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz" - integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== + version "7.0.39" + resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" + integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== dependencies: - chalk "^2.4.2" + picocolors "^0.2.1" source-map "^0.6.1" - supports-color "^6.1.0" postgres-array@~2.0.0: version "2.0.0" @@ -15036,20 +13315,20 @@ postgres-interval@^1.1.0: postinstall-postinstall@2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz" + resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== prebuild-install@^7.1.1: - version "7.1.2" - resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz#a5fd9986f5a6251fbc47e1e5c65de71e68c0a056" - integrity sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ== + version "7.1.3" + resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz#d630abad2b147443f20a212917beae68b8092eec" + integrity sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug== dependencies: detect-libc "^2.0.0" expand-template "^2.0.3" github-from-package "0.0.0" minimist "^1.2.3" mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" + napi-build-utils "^2.0.0" node-abi "^3.3.0" pump "^3.0.0" rc "^1.2.7" @@ -15059,71 +13338,55 @@ prebuild-install@^7.1.1: prelude-ls@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@2.8.7: - version "2.8.7" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== - -prettier@2.8.8: +prettier@2.8.8, prettier@^2.7.1: version "2.8.8" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -prettier@^2.7.1: - version "2.7.1" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== - -pretty-format@^27.2.0: - version "27.2.0" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-27.2.0.tgz" - integrity sha512-KyJdmgBkMscLqo8A7K77omgLx5PWPiXJswtTtFV7XgVZv2+qPk6UivpXXO+5k6ZEbWIbLoKdx1pZ6ldINzbwTA== +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== dependencies: - "@jest/types" "^27.1.1" - ansi-regex "^5.0.0" + "@jest/schemas" "^29.6.3" ansi-styles "^5.0.0" - react-is "^17.0.1" + react-is "^18.0.0" pretty-hrtime@^1.0.0: version "1.0.3" - resolved "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= + resolved "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" + integrity sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A== -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== +proc-log@^4.1.0, proc-log@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034" + integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA== process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== process-on-spawn@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz" - integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== + version "1.1.0" + resolved "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz#9d5999ba87b3bf0a8acb05322d69f2f5aa4fb763" + integrity sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q== dependencies: fromentries "^1.2.0" process@^0.11.10: version "0.11.10" - resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== progress@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz" + resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -promise-breaker@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/promise-breaker/-/promise-breaker-5.0.0.tgz" - integrity sha512-mgsWQuG4kJ1dtO6e/QlNDLFtMkMzzecsC69aI5hlLEjGHFNpHrvGhFi4LiK5jg2SMQj74/diH+wZliL9LpGsyA== - promise-breaker@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/promise-breaker/-/promise-breaker-6.0.0.tgz#107d2b70f161236abdb4ac5a736c7eb8df489d0f" @@ -15131,17 +13394,17 @@ promise-breaker@^6.0.0: promise-inflight@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== promise-polyfill@^6.0.1: version "6.1.0" - resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz" - integrity sha1-36lpQ+qcEh/KTem1hoyznTRy4Fc= + resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057" + integrity sha512-g0LWaH0gFsxovsU7R5LrrhHhWAWiHRnh1GPrhXnPgYsDkIqjRYUYSZEsej/wtleDrz5xVSIDbeKfidztp2XHFQ== promise-retry@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz" + resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== dependencies: err-code "^2.0.2" @@ -15149,15 +13412,15 @@ promise-retry@^2.0.1: promzard@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" - integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= + resolved "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + integrity sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw== dependencies: read "1" proto-list@~1.2.1: version "1.2.4" - resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" - integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= + resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== proto3-json-serializer@^2.0.2: version "2.0.2" @@ -15166,25 +13429,7 @@ proto3-json-serializer@^2.0.2: dependencies: protobufjs "^7.2.5" -protobufjs@7.2.6, protobufjs@^7.2.4: - version "7.2.6" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" - integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/node" ">=13.7.0" - long "^5.0.0" - -protobufjs@^7.2.5, protobufjs@^7.3.2: +protobufjs@7.4.0, protobufjs@^7.2.5, protobufjs@^7.3.2: version "7.4.0" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== @@ -15202,14 +13447,19 @@ protobufjs@^7.2.5, protobufjs@^7.3.2: "@types/node" ">=13.7.0" long "^5.0.0" -protocols@^1.1.0, protocols@^1.4.0: +protocols@^1.4.0: version "1.4.8" - resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz" + resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== +protocols@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86" + integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q== + protractor@5.4.2: version "5.4.2" - resolved "https://registry.npmjs.org/protractor/-/protractor-5.4.2.tgz" + resolved "https://registry.npmjs.org/protractor/-/protractor-5.4.2.tgz#329efe37f48b2141ab9467799be2d4d12eb48c13" integrity sha512-zlIj64Cr6IOWP7RwxVeD8O4UskLYPoyIcg0HboWJL9T79F1F0VWtKkGTr/9GN6BKL+/Q/GmM7C9kFVCfDbP5sA== dependencies: "@types/q" "^0.0.32" @@ -15228,9 +13478,9 @@ protractor@5.4.2: webdriver-js-extender "2.1.0" webdriver-manager "^12.0.6" -proxy-addr@~2.0.5, proxy-addr@~2.0.7: +proxy-addr@~2.0.7: version "2.0.7" - resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz" + resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== dependencies: forwarded "0.2.0" @@ -15252,27 +13502,29 @@ proxy-agent@^6.3.0: proxy-from-env@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" + resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== prr@~1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== pseudomap@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== psl@^1.1.28: - version "1.8.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + version "1.15.0" + resolved "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== + dependencies: + punycode "^2.3.1" -public-encrypt@^4.0.0: +public-encrypt@^4.0.3: version "4.0.3" - resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz" + resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: bn.js "^4.1.0" @@ -15284,69 +13536,64 @@ public-encrypt@^4.0.0: pump@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz" + resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== dependencies: end-of-stream "^1.1.0" once "^1.3.1" pump@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + version "3.0.2" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" + integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== dependencies: end-of-stream "^1.1.0" once "^1.3.1" pumpify@^1.3.5: version "1.5.1" - resolved "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz" + resolved "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== dependencies: duplexify "^3.6.0" inherits "^2.0.3" pump "^2.0.0" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.3.2: +punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pupa@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz" + resolved "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== dependencies: escape-goat "^2.0.0" q@1.4.1: version "1.4.1" - resolved "https://registry.npmjs.org/q/-/q-1.4.1.tgz" - integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= + resolved "https://registry.npmjs.org/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + integrity sha512-/CdEdaw49VZVmyIDGUQKDDT53c7qBkO6g5CefWz91Ae+l4+cRtcDYwMTXh6me4O8TMldeGHG3N2Bl84V78Ywbg== q@^1.4.1, q@^1.5.1: version "1.5.1" - resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== qjobs@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz" + resolved "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== qs@6.11.0: version "6.11.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz" + resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== dependencies: side-channel "^1.0.4" @@ -15358,19 +13605,7 @@ qs@6.13.0: dependencies: side-channel "^1.0.6" -qs@6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@^6.4.0, qs@^6.6.0, qs@^6.9.4: - version "6.10.1" - resolved "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - -qs@^6.7.0: +qs@^6.12.3, qs@^6.4.0, qs@^6.6.0, qs@^6.7.0, qs@^6.9.4: version "6.14.0" resolved "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== @@ -15378,13 +13613,13 @@ qs@^6.7.0: side-channel "^1.1.0" qs@~6.5.2: - version "6.5.2" - resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== query-string@^6.13.8: version "6.14.1" - resolved "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz" + resolved "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== dependencies: decode-uri-component "^0.2.0" @@ -15394,17 +13629,12 @@ query-string@^6.13.8: querystring-es3@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== queue-microtask@^1.2.2: version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== queue-tick@^1.0.1: @@ -15414,12 +13644,12 @@ queue-tick@^1.0.1: quick-lru@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== quick-lru@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== railroad-diagrams@^1.0.0: @@ -15437,14 +13667,14 @@ randexp@0.4.6: randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" -randomfill@^1.0.3: +randomfill@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz" + resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== dependencies: randombytes "^2.0.5" @@ -15452,20 +13682,10 @@ randomfill@^1.0.3: range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz" + resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -raw-body@2.5.2: +raw-body@2.5.2, raw-body@^2.3.3: version "2.5.2" resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== @@ -15475,19 +13695,9 @@ raw-body@2.5.2: iconv-lite "0.4.24" unpipe "1.0.0" -raw-body@^2.3.3: - version "2.4.1" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" - rc@^1.2.7, rc@^1.2.8: version "1.2.8" - resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" + resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" @@ -15496,27 +13706,27 @@ rc@^1.2.7, rc@^1.2.8: strip-json-comments "~2.0.1" re2@^1.17.7: - version "1.18.0" - resolved "https://registry.npmjs.org/re2/-/re2-1.18.0.tgz" - integrity sha512-MoCYZlJ9YUgksND9asyNF2/x532daXU/ARp1UeJbQ5flMY6ryKNEhrWt85aw3YluzOJlC3vXpGgK2a1jb0b4GA== + version "1.21.4" + resolved "https://registry.npmjs.org/re2/-/re2-1.21.4.tgz#d688edcc40da3cf542ee3a480a8b60e5900dd24d" + integrity sha512-MVIfXWJmsP28mRsSt8HeL750ifb8H5+oF2UDIxGaiJCr8fkMqhLZ7kcX9ADRk2dC8qeGKedB7UVYRfBVpEiLfA== dependencies: - install-artifact-from-github "^1.3.1" - nan "^2.17.0" - node-gyp "^9.3.0" + install-artifact-from-github "^1.3.5" + nan "^2.20.0" + node-gyp "^10.2.0" -react-is@^17.0.1: - version "17.0.2" - resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.0.0: + version "18.3.1" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== read-cmd-shim@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz" + resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== read-package-json-fast@^2.0.1: version "2.0.3" - resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz" + resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83" integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ== dependencies: json-parse-even-better-errors "^2.3.0" @@ -15524,7 +13734,7 @@ read-package-json-fast@^2.0.1: read-package-json@^2.0.0: version "2.1.2" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz#6992b2b66c7177259feb8eaac73c3acd28b9222a" integrity sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA== dependencies: glob "^7.1.1" @@ -15534,7 +13744,7 @@ read-package-json@^2.0.0: read-package-json@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-3.0.1.tgz" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-3.0.1.tgz#c7108f0b9390257b08c21e3004d2404c806744b9" integrity sha512-aLcPqxovhJTVJcsnROuuzQvv6oziQx4zd3JvG0vGCL5MjTONUc4uJ90zCBC6R7W7oUKBNoR/F8pkyfVwlbxqng== dependencies: glob "^7.1.1" @@ -15543,9 +13753,9 @@ read-package-json@^3.0.0: npm-normalize-package-bin "^1.0.0" read-package-json@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.1.tgz" - integrity sha512-P82sbZJ3ldDrWCOSKxJT0r/CXMWR0OR3KRh55SgKo3p91GSIEEC32v3lSHAvO/UcH3/IoL7uqhOFBduAnwdldw== + version "4.1.2" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.2.tgz#b444d047de7c75d4a160cb056d00c0693c1df703" + integrity sha512-Dqer4pqzamDE2O4M55xp1qZMuLPqi4ldk2ya648FOMHRjwMzFhuxVrG04wd0c38IsvkVdr3vgHI6z+QTPdAjrQ== dependencies: glob "^7.1.1" json-parse-even-better-errors "^2.3.0" @@ -15554,7 +13764,7 @@ read-package-json@^4.1.1: read-package-tree@^5.3.1: version "5.3.1" - resolved "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz" + resolved "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== dependencies: read-package-json "^2.0.0" @@ -15563,23 +13773,23 @@ read-package-tree@^5.3.1: read-pkg-up@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A== dependencies: find-up "^1.0.0" read-pkg "^1.0.0" read-pkg-up@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw== dependencies: find-up "^2.0.0" read-pkg "^3.0.0" read-pkg-up@^7.0.1: version "7.0.1" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: find-up "^4.1.0" @@ -15588,8 +13798,8 @@ read-pkg-up@^7.0.1: read-pkg@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ== dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -15597,8 +13807,8 @@ read-pkg@^1.0.0: read-pkg@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA== dependencies: load-json-file "^4.0.0" normalize-package-data "^2.3.2" @@ -15606,7 +13816,7 @@ read-pkg@^3.0.0: read-pkg@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: "@types/normalize-package-data" "^2.4.0" @@ -15616,7 +13826,7 @@ read-pkg@^5.2.0: read-yaml-file@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz" + resolved "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz#9362bbcbdc77007cc8ea4519fe1c0b821a7ce0d8" integrity sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA== dependencies: graceful-fs "^4.1.5" @@ -15626,34 +13836,21 @@ read-yaml-file@^1.1.0: read@1, read@~1.0.1: version "1.0.7" - resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz" - integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= + resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ== dependencies: mute-stream "~0.0.4" -"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== +"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0, readable-stream@^3.6.2: + version "3.6.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@^2.3.7, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^2.3.8: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@^2.3.8, readable-stream@~2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -15667,14 +13864,15 @@ readable-stream@^2.3.8: util-deprecate "~1.0.1" readable-stream@^4.0.0: - version "4.4.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.0.tgz" - integrity sha512-kDMOq0qLtxV9f/SQv522h8cxZBqNZXuXNyjyezmfAAuribMyVXziljpQ/uQhfE1XLg2/TLTW2DsnoE4VAi/krg== + version "4.7.0" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz#cedbd8a1146c13dfff8dab14068028d58c15ac91" + integrity sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg== dependencies: abort-controller "^3.0.0" buffer "^6.0.3" events "^3.3.0" process "^0.11.10" + string_decoder "^1.3.0" readdir-glob@^1.1.2: version "1.1.3" @@ -15685,7 +13883,7 @@ readdir-glob@^1.1.2: readdir-scoped-modules@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz" + resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== dependencies: debuglog "^1.0.1" @@ -15695,7 +13893,7 @@ readdir-scoped-modules@^1.0.0: readdirp@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: graceful-fs "^4.1.11" @@ -15704,21 +13902,21 @@ readdirp@^2.2.1: readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" rechoir@^0.6.2: version "0.6.2" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== dependencies: resolve "^1.1.6" redent@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" + resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== dependencies: indent-string "^4.0.0" @@ -15738,13 +13936,6 @@ reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: get-proto "^1.0.1" which-builtin-type "^1.2.1" -regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties@^10.2.0: version "10.2.0" resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" @@ -15754,44 +13945,34 @@ regenerate-unicode-properties@^10.2.0: regenerate@^1.4.2: version "1.4.2" - resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" + resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== regenerator-runtime@^0.11.0: version "0.11.1" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== regenerator-transform@^0.15.2: version "0.15.2" - resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz" + resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz" + resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.5.2: - version "1.5.2" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" - integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== - dependencies: - call-bind "^1.0.6" - define-properties "^1.2.1" - es-errors "^1.3.0" - set-function-name "^2.0.1" - regexp.prototype.flags@^1.5.3: version "1.5.4" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" @@ -15804,18 +13985,6 @@ regexp.prototype.flags@^1.5.3: gopd "^1.2.0" set-function-name "^2.0.2" -regexpu-core@^5.1.0: - version "5.2.1" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.1.tgz" - integrity sha512-HrnlNtpvqP1Xkb28tMhBUO2EbyUHdQlsnlAhzWcwHy8WJR53UWr7/MAvqrsQKMbV4qdpv03oTMG8iIhfsPFktQ== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsgen "^0.7.1" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" - regexpu-core@^6.2.0: version "6.2.0" resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" @@ -15829,24 +13998,19 @@ regexpu-core@^6.2.0: unicode-match-property-value-ecmascript "^2.1.0" registry-auth-token@^5.0.1: - version "5.0.2" - resolved "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz" - integrity sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ== + version "5.0.3" + resolved "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.3.tgz#417d758c8164569de8cf5cabff16cc937902dcc6" + integrity sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA== dependencies: "@pnpm/npm-conf" "^2.1.0" registry-url@^5.1.0: version "5.1.0" - resolved "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz" + resolved "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== dependencies: rc "^1.2.8" -regjsgen@^0.7.1: - version "0.7.1" - resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz" - integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== - regjsgen@^0.8.0: version "0.8.0" resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" @@ -15859,23 +14023,16 @@ regjsparser@^0.12.0: dependencies: jsesc "~3.0.2" -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== - dependencies: - jsesc "~0.5.0" - release-zalgo@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz" - integrity sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA= + resolved "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + integrity sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA== dependencies: es6-error "^4.0.1" remove-bom-buffer@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz" + resolved "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== dependencies: is-buffer "^1.1.5" @@ -15883,8 +14040,8 @@ remove-bom-buffer@^3.0.0: remove-bom-stream@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz" - integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= + resolved "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + integrity sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA== dependencies: remove-bom-buffer "^3.0.0" safe-buffer "^5.1.0" @@ -15892,35 +14049,35 @@ remove-bom-stream@^1.2.0: remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== repeat-element@^1.1.2: version "1.1.4" - resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz" + resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== repeat-string@^1.6.1: version "1.6.1" - resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== repeating@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A== dependencies: is-finite "^1.0.0" replace-ext@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz" + resolved "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== replace-homedir@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz" - integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= + resolved "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" + integrity sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg== dependencies: homedir-polyfill "^1.0.1" is-absolute "^1.0.0" @@ -15928,7 +14085,7 @@ replace-homedir@^1.0.0: replacestream@^4.0.3: version "4.0.3" - resolved "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz" + resolved "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz#3ee5798092be364b1cdb1484308492cb3dff2f36" integrity sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA== dependencies: escape-string-regexp "^1.0.3" @@ -15937,7 +14094,7 @@ replacestream@^4.0.3: request@2.88.2, request@^2.87.0, request@^2.88.0, request@^2.88.2: version "2.88.2" - resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz" + resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== dependencies: aws-sign2 "~0.7.0" @@ -15963,85 +14120,82 @@ request@2.88.2, request@^2.87.0, request@^2.88.0, request@^2.88.2: require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== require-main-filename@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug== require-main-filename@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== requires-port@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== resolve-alpn@^1.0.0: version "1.2.1" - resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz" + resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== resolve-cwd@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: resolve-from "^5.0.0" resolve-dir@^1.0.0, resolve-dir@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz" - integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + resolved "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg== dependencies: expand-tilde "^2.0.0" global-modules "^1.0.0" resolve-from@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-from@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve-options@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz" - integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= + resolved "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + integrity sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A== dependencies: value-or-function "^3.0.0" resolve-url@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0: - version "1.20.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" +resolve.exports@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" + integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== -resolve@^1.22.4: - version "1.22.8" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.4, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@~1.22.0, resolve@~1.22.1: + version "1.22.10" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" + integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== dependencies: - is-core-module "^2.13.0" + is-core-module "^2.16.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -16052,42 +14206,24 @@ resolve@~1.17.0: dependencies: path-parse "^1.0.6" -resolve@~1.22.0: - version "1.22.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@~1.22.1: - version "1.22.4" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz" - integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - responselike@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz" - integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== + version "2.0.1" + resolved "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== dependencies: lowercase-keys "^2.0.0" restore-cursor@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== dependencies: onetime "^2.0.0" signal-exit "^3.0.2" restore-cursor@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== dependencies: onetime "^5.1.0" @@ -16095,7 +14231,7 @@ restore-cursor@^3.1.0: ret@~0.1.10: version "0.1.15" - resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" + resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== retry-request@^7.0.0: @@ -16109,41 +14245,41 @@ retry-request@^7.0.0: retry@^0.12.0: version "0.12.0" - resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== retry@^0.13.1: version "0.13.1" - resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz" + resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== reusify@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + version "1.4.1" + resolved "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" - resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" @@ -16151,7 +14287,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rollup-plugin-copy-assets@2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/rollup-plugin-copy-assets/-/rollup-plugin-copy-assets-2.0.3.tgz" + resolved "https://registry.npmjs.org/rollup-plugin-copy-assets/-/rollup-plugin-copy-assets-2.0.3.tgz#9a9098894c3ded16d2eee8c4108055e332b5f59f" integrity sha512-ETShhQGb9SoiwcNrvb3BhUNSGR89Jao0+XxxfzzLW1YsUzx8+rMO4z9oqWWmo6OHUmfNQRvqRj0cAyPkS9lN9w== dependencies: fs-extra "^7.0.1" @@ -16176,24 +14312,23 @@ rollup-plugin-dts@5.3.1: optionalDependencies: "@babel/code-frame" "^7.22.5" -rollup-plugin-license@3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-3.0.1.tgz" - integrity sha512-/lec6Y94Y3wMfTDeYTO/jSXII0GQ/XkDZCiqkMKxyU5D5nGPaxr/2JNYvAgYsoCYuOLGOanKDPjCCQiTT96p7A== +rollup-plugin-license@3.5.3: + version "3.5.3" + resolved "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-3.5.3.tgz#b02ffa4fd4c81464db450d06478e03e5605d9d5f" + integrity sha512-r3wImZSo2d6sEk9BRJtlzeI/upjyjnpthy06Fdl0EzqRrlg3ULb9KQR7xHJI0zuayW/8bchEXSF5dO6dha4OyA== dependencies: commenting "~1.1.0" - glob "~7.2.0" + fdir "6.3.0" lodash "~4.17.21" - magic-string "~0.26.2" - mkdirp "~1.0.4" - moment "~2.29.3" + magic-string "~0.30.0" + moment "~2.30.1" package-name-regex "~2.0.6" spdx-expression-validate "~2.0.0" spdx-satisfies "~5.0.1" rollup-plugin-replace@2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz" + resolved "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz#f41ae5372e11e7a217cde349c8b5d5fd115e70e3" integrity sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA== dependencies: magic-string "^0.25.2" @@ -16201,27 +14336,26 @@ rollup-plugin-replace@2.2.0: rollup-plugin-sourcemaps@0.6.3: version "0.6.3" - resolved "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz" + resolved "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed" integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw== dependencies: "@rollup/pluginutils" "^3.0.9" source-map-resolve "^0.6.0" -rollup-plugin-typescript2@0.31.2: - version "0.31.2" - resolved "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.31.2.tgz" - integrity sha512-hRwEYR1C8xDGVVMFJQdEVnNAeWRvpaY97g5mp3IeLnzhNXzSVq78Ye/BJ9PAaUfN4DXa/uDnqerifMOaMFY54Q== +rollup-plugin-typescript2@0.36.0: + version "0.36.0" + resolved "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz#309564eb70d710412f5901344ca92045e180ed53" + integrity sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw== dependencies: "@rollup/pluginutils" "^4.1.2" - "@yarn-tool/resolve-package" "^1.0.40" find-cache-dir "^3.3.2" fs-extra "^10.0.0" - resolve "^1.20.0" - tslib "^2.3.1" + semver "^7.5.4" + tslib "^2.6.2" rollup-plugin-uglify@6.0.4: version "6.0.4" - resolved "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.4.tgz" + resolved "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.4.tgz#65a0959d91586627f1e46a7db966fd504ec6c4e6" integrity sha512-ddgqkH02klveu34TF0JqygPwZnsbhHVI6t8+hGTcYHngPkQb5MIHI0XiztXIN/d6V9j+efwHAqEL7LspSxQXGw== dependencies: "@babel/code-frame" "^7.0.0" @@ -16231,15 +14365,15 @@ rollup-plugin-uglify@6.0.4: rollup-pluginutils@^2.6.0: version "2.8.2" - resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz" + resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" -rollup@2.79.1: - version "2.79.1" - resolved "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== +rollup@2.79.2: + version "2.79.2" + resolved "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz#f150e4a5db4b121a21a747d762f701e5e9f49090" + integrity sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ== optionalDependencies: fsevents "~2.3.2" @@ -16263,50 +14397,26 @@ run-async@^2.4.0, run-async@^2.4.1: run-parallel@^1.1.9: version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== dependencies: queue-microtask "^1.2.2" rxjs@^6.3.3, rxjs@^6.5.1, rxjs@^6.6.0: version "6.6.7" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.2.0: - version "7.3.0" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.3.0.tgz" - integrity sha512-p2yuGIg9S1epc3vrjKf6iVb3RCaAYjYskkO+jHIaV0IjOPlJop4UnodOoFb2xeNwlguqLYvGw1b1McillYb5Gw== - dependencies: - tslib "~2.1.0" - -rxjs@^7.5.4: +rxjs@^7.2.0, rxjs@^7.5.4, rxjs@^7.5.5: version "7.8.1" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== dependencies: tslib "^2.1.0" -rxjs@^7.5.5: - version "7.5.5" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" - integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== - dependencies: - tslib "^2.1.0" - -safe-array-concat@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" - integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== - dependencies: - call-bind "^1.0.7" - get-intrinsic "^1.2.4" - has-symbols "^1.0.3" - isarray "^2.0.5" - -safe-array-concat@^1.1.3: +safe-array-concat@^1.1.2, safe-array-concat@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz#c9e54ec4f603b0bbb8e7e5007a5ee7aecd1538c3" integrity sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q== @@ -16319,12 +14429,12 @@ safe-array-concat@^1.1.3: safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-push-apply@^1.0.0: @@ -16335,15 +14445,6 @@ safe-push-apply@^1.0.0: es-errors "^1.3.0" isarray "^2.0.5" -safe-regex-test@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" - integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-regex "^1.1.4" - safe-regex-test@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" @@ -16355,24 +14456,24 @@ safe-regex-test@^1.1.0: safe-regex@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== dependencies: ret "~0.1.10" -safe-stable-stringify@^1.1.0: - version "1.1.1" - resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz" - integrity sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw== +safe-stable-stringify@^2.3.1: + version "2.5.0" + resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz#4ca2f8e385f2831c432a719b108a3bf7af42a1dd" + integrity sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA== "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sauce-connect-launcher@^1.2.7: version "1.3.2" - resolved "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-1.3.2.tgz" + resolved "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-1.3.2.tgz#dfc675a258550809a8eaf457eb9162b943ddbaf0" integrity sha512-wf0coUlidJ7rmeClgVVBh6Kw55/yalZCY/Un5RgjSnTXRAeGqagnTsTYpZaqC4dCtrY4myuYpOAZXCdbO7lHfQ== dependencies: adm-zip "~0.4.3" @@ -16383,42 +14484,33 @@ sauce-connect-launcher@^1.2.7: saucelabs@^1.5.0: version "1.5.0" - resolved "https://registry.npmjs.org/saucelabs/-/saucelabs-1.5.0.tgz" + resolved "https://registry.npmjs.org/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== dependencies: https-proxy-agent "^2.2.1" sax@>=0.6.0: - version "1.2.4" - resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + version "1.4.1" + resolved "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" + integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== schema-utils@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz" - integrity sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8= + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" + integrity sha512-QaVYBaD9U8scJw2EBWnCBY+LJ0AD+/2edTaigDs0XLDLBfJmSUK9KGqktg1rb32U3z4j/XwvFwHHH1YfbYFd7Q== dependencies: ajv "^5.0.0" schema-utils@^2.6.5: version "2.7.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== dependencies: "@types/json-schema" "^7.0.5" ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== - dependencies: - "@types/json-schema" "^7.0.8" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - -schema-utils@^3.2.0: +schema-utils@^3.0.0, schema-utils@^3.2.0: version "3.3.0" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== @@ -16439,12 +14531,12 @@ schema-utils@^4.3.0: secure-compare@3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz" - integrity sha1-8aAymzCLIh+uN7mXTz1XjQypmeM= + resolved "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz#f1a0329b308b221fae37b9974f3d578d0ca999e3" + integrity sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw== selenium-assistant@6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/selenium-assistant/-/selenium-assistant-6.1.1.tgz" + resolved "https://registry.npmjs.org/selenium-assistant/-/selenium-assistant-6.1.1.tgz#07e7f6c958b641a306c2fbde1a0304ba524dd6a6" integrity sha512-WgjmsDJdpCGvINNQofMJxE3d3/G/AVutdihbxLE8aHGUu6NlAiWd8i6WVdrzAp03Thht6yd63Z+JkOW7EXdPEw== dependencies: chalk "^2.4.2" @@ -16461,7 +14553,7 @@ selenium-assistant@6.1.1: selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: version "3.6.0" - resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz" + resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz#2ba87a1662c020b8988c981ae62cb2a01298eafc" integrity sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q== dependencies: jszip "^3.1.3" @@ -16469,45 +14561,36 @@ selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: tmp "0.0.30" xml2js "^0.4.17" -selenium-webdriver@4.8.0: - version "4.8.0" - resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.8.0.tgz" - integrity sha512-s/HL8WNwy1ggHR244+tAhjhyKMJnZLt1HKJ6Gn7nQgVjB/ybDF+46Uui0qI2J7AjPNJzlUmTncdC/jg/kKkn0A== - dependencies: - jszip "^3.10.0" - tmp "^0.2.1" - ws ">=8.11.0" - -selenium-webdriver@^4.0.0-alpha.7: - version "4.0.0-rc-1" - resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-rc-1.tgz" - integrity sha512-bcrwFPRax8fifRP60p7xkWDGSJJoMkPAzufMlk5K2NyLPht/YZzR2WcIk1+3gR8VOCLlst1P2PI+MXACaFzpIw== +selenium-webdriver@4.28.1, selenium-webdriver@^4.0.0-alpha.7: + version "4.28.1" + resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.28.1.tgz#0f6cc4fbc83cee3fdf8b116257656892957b72da" + integrity sha512-TwbTpu/NUQkorBODGAkGowJ8sar63bvqi66/tjqhS05rBl34HkVp8DoRg1cOv2iSnNonVSbkxazS3wjbc+NRtg== dependencies: - jszip "^3.6.0" - rimraf "^3.0.2" - tmp "^0.2.1" - ws ">=7.4.6" + "@bazel/runfiles" "^6.3.1" + jszip "^3.10.1" + tmp "^0.2.3" + ws "^8.18.0" semver-diff@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz" + resolved "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== dependencies: semver "^6.3.0" semver-greatest-satisfied-range@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz" - integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= + resolved "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" + integrity sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ== dependencies: sver-compat "^1.5.0" "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.6.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.6.3, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0: +semver@7.6.3, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -16517,42 +14600,23 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@~7.5.4: - version "7.5.4" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - semver@~7.3.0: - version "7.3.7" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + version "7.3.8" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" -send@0.17.1: - version "0.17.1" - resolved "https://registry.npmjs.org/send/-/send-0.17.1.tgz" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== +semver@~7.5.4: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" + lru-cache "^6.0.0" send@0.18.0: version "0.18.0" - resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz" + resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== dependencies: debug "2.6.9" @@ -16588,16 +14652,16 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@6.0.0, serialize-javascript@^6.0.0: +serialize-javascript@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" serialize-javascript@^2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: @@ -16607,19 +14671,9 @@ serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: dependencies: randombytes "^2.1.0" -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - serve-static@1.15.0: version "1.15.0" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== dependencies: encodeurl "~1.0.2" @@ -16639,10 +14693,10 @@ serve-static@1.16.2: set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-function-length@^1.2.1, set-function-length@^1.2.2: +set-function-length@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== @@ -16654,7 +14708,7 @@ set-function-length@^1.2.1, set-function-length@^1.2.2: gopd "^1.0.1" has-property-descriptors "^1.0.2" -set-function-name@^2.0.1, set-function-name@^2.0.2: +set-function-name@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== @@ -16675,7 +14729,7 @@ set-proto@^1.0.0: set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" + resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" @@ -16685,22 +14739,17 @@ set-value@^2.0.0, set-value@^2.0.1: setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== setprototypeof@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" - resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" @@ -16708,32 +14757,32 @@ sha.js@^2.4.0, sha.js@^2.4.8: shallow-clone@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" + resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: kind-of "^6.0.2" shebang-command@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== shell-quote@^1.6.1: - version "1.8.1" - resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" - integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== + version "1.8.2" + resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz#d2d83e057959d53ec261311e9e9b8f51dcb2934a" + integrity sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA== shelljs@^0.8.3: - version "0.8.4" - resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz" - integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== + version "0.8.5" + resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -16768,16 +14817,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -side-channel@^1.0.6, side-channel@^1.1.0: +side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -16788,14 +14828,9 @@ side-channel@^1.0.6, side-channel@^1.1.0: side-channel-map "^1.0.1" side-channel-weakmap "^1.0.2" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.4" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz" - integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== - -signal-exit@^3.0.7: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signal-exit@^4.0.1: @@ -16828,19 +14863,19 @@ simple-git@3.27.0: simple-swizzle@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= + resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg== dependencies: is-arrayish "^0.3.1" sinon-chai@3.7.0: version "3.7.0" - resolved "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz" + resolved "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz#cfb7dec1c50990ed18c153f1840721cf13139783" integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== sinon@9.2.4: version "9.2.4" - resolved "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz" + resolved "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz#e55af4d3b174a4443a8762fa8421c2976683752b" integrity sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg== dependencies: "@sinonjs/commons" "^1.8.1" @@ -16859,32 +14894,27 @@ skin-tone@^2.0.0: slash@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz" + resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== slash@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slash@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" - integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== - slice-ansi@0.0.4: version "0.0.4" - resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + integrity sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw== slide@^1.1.5, slide@^1.1.6: version "1.1.6" - resolved "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" - integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + resolved "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw== -smart-buffer@^4.1.0, smart-buffer@^4.2.0: +smart-buffer@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz" + resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== smob@^1.0.0: @@ -16894,7 +14924,7 @@ smob@^1.0.0: snapdragon-node@^2.0.1: version "2.1.1" - resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" + resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" @@ -16903,14 +14933,14 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz" + resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" - resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz" + resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" @@ -16953,7 +14983,7 @@ socket.io@^4.7.2: socks-proxy-agent@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== dependencies: agent-base "^6.0.2" @@ -16961,24 +14991,15 @@ socks-proxy-agent@^5.0.0: socks "^2.3.3" socks-proxy-agent@^6.0.0: - version "6.1.0" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz" - integrity sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg== - dependencies: - agent-base "^6.0.2" - debug "^4.3.1" - socks "^2.6.1" - -socks-proxy-agent@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz" - integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== + version "6.2.1" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz#2687a31f9d7185e38d530bef1944fe1f1496d6ce" + integrity sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ== dependencies: agent-base "^6.0.2" debug "^4.3.3" socks "^2.6.2" -socks-proxy-agent@^8.0.5: +socks-proxy-agent@^8.0.3, socks-proxy-agent@^8.0.5: version "8.0.5" resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== @@ -16987,23 +15008,7 @@ socks-proxy-agent@^8.0.5: debug "^4.3.4" socks "^2.8.3" -socks@^2.3.3, socks@^2.6.1: - version "2.6.1" - resolved "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz" - integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== - dependencies: - ip "^1.1.5" - smart-buffer "^4.1.0" - -socks@^2.6.2: - version "2.7.1" - resolved "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz" - integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== - dependencies: - ip "^2.0.0" - smart-buffer "^4.2.0" - -socks@^2.8.3: +socks@^2.3.3, socks@^2.6.2, socks@^2.8.3: version "2.8.3" resolved "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== @@ -17020,21 +15025,21 @@ sort-any@^2.0.0: sort-keys@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz" - integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + integrity sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg== dependencies: is-plain-obj "^1.0.0" sort-keys@^4.0.0: version "4.2.0" - resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz" + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz#6b7638cee42c506fff8c1cecde7376d21315be18" integrity sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg== dependencies: is-plain-obj "^2.0.0" source-map-loader@1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/source-map-loader/-/source-map-loader-1.1.3.tgz" + resolved "https://registry.npmjs.org/source-map-loader/-/source-map-loader-1.1.3.tgz#7dbc2fe7ea09d3e43c51fd9fc478b7f016c1f820" integrity sha512-6YHeF+XzDOrT/ycFJNI53cgEsp/tHTMl37hi7uVyqFAlTXW109JazaQCkbc+jjoL2637qkH1amLi+JzrIpt5lA== dependencies: abab "^2.0.5" @@ -17046,7 +15051,7 @@ source-map-loader@1.1.3: source-map-resolve@^0.5.0: version "0.5.3" - resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== dependencies: atob "^2.1.2" @@ -17057,40 +15062,40 @@ source-map-resolve@^0.5.0: source-map-resolve@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== dependencies: atob "^2.1.2" decode-uri-component "^0.2.0" source-map-support@^0.5.16, source-map-support@~0.5.20: - version "0.5.20" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map-support@~0.4.0: version "0.4.18" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" source-map-url@^0.4.0: version "0.4.1" - resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz" + resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@^0.7.4: @@ -17098,24 +15103,19 @@ source-map@^0.7.4: resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== -source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8: +sourcemap-codec@^1.4.8: version "1.4.8" - resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz" + resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== sparkles@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz" + resolved "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== spawn-wrap@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz" + resolved "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== dependencies: foreground-child "^2.0.0" @@ -17135,7 +15135,7 @@ spawndamnit@^3.0.1: spdx-compare@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz" + resolved "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz#2c55f117362078d7409e6d7b08ce70a857cd3ed7" integrity sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A== dependencies: array-find-index "^1.0.2" @@ -17143,21 +15143,21 @@ spdx-compare@^1.0.0: spdx-ranges "^2.0.0" spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + version "3.2.0" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + version "2.5.0" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" + integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== spdx-expression-parse@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== dependencies: spdx-exceptions "^2.1.0" @@ -17165,24 +15165,24 @@ spdx-expression-parse@^3.0.0: spdx-expression-validate@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz" + resolved "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz#25c9408e1c63fad94fff5517bb7101ffcd23350b" integrity sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + version "3.0.21" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz#6d6e980c9df2b6fc905343a3b2d702a6239536c3" + integrity sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg== spdx-ranges@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz" + resolved "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz#87573927ba51e92b3f4550ab60bfc83dd07bac20" integrity sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA== spdx-satisfies@~5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz" + resolved "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz#9feeb2524686c08e5f7933c16248d4fdf07ed6a6" integrity sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw== dependencies: spdx-compare "^1.0.0" @@ -17191,19 +15191,19 @@ spdx-satisfies@~5.0.1: split-on-first@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz" + resolved "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" - resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz" + resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" split2@^3.0.0: version "3.2.2" - resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" + resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== dependencies: readable-stream "^3.0.0" @@ -17215,7 +15215,7 @@ split2@^4.1.0: split@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" + resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== dependencies: through "2" @@ -17227,45 +15227,34 @@ sprintf-js@^1.1.3: sprintf-js@~1.0.2: version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== sql-formatter@^15.3.0: - version "15.4.10" - resolved "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.4.10.tgz#f7f4745aa1b9fc3c8ce493bf882610ca6200dedf" - integrity sha512-zQfiuxU1F/C7TNu+880BdL+fuvJTd1Kj8R0wv48dfZ27NR3z1PWvQFkH8ai/HrIy+NyvXCaZBkJHp/EeZFXSOA== + version "15.4.9" + resolved "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.4.9.tgz#75722b497d39fd05d6d17d5e03c5f44658126c25" + integrity sha512-5vmt2HlCAVozxsBZuXWkAki/KGawaK+b5GG5x+BtXOFVpN/8cqppblFUxHl4jxdA0cvo14lABhM+KBnrUapOlw== dependencies: argparse "^2.0.1" get-stdin "=8.0.0" nearley "^2.20.1" -sqlite3@5.1.7: +sqlite3@5.1.7, sqlite3@^5.0.2: version "5.1.7" resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz#59ca1053c1ab38647396586edad019b1551041b7" integrity sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog== dependencies: bindings "^1.5.0" - node-addon-api "^7.0.0" - prebuild-install "^7.1.1" - tar "^6.1.11" - optionalDependencies: - node-gyp "8.x" - -sqlite3@^5.0.2: - version "5.1.6" - resolved "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz" - integrity sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw== - dependencies: - "@mapbox/node-pre-gyp" "^1.0.0" - node-addon-api "^4.2.0" + node-addon-api "^7.0.0" + prebuild-install "^7.1.1" tar "^6.1.11" optionalDependencies: node-gyp "8.x" sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + version "1.18.0" + resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" + integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -17277,53 +15266,53 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +ssri@^10.0.0: + version "10.0.6" + resolved "https://registry.npmjs.org/ssri/-/ssri-10.0.6.tgz#a8aade2de60ba2bce8688e3fa349bad05c7dc1e5" + integrity sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ== + dependencies: + minipass "^7.0.3" + ssri@^8.0.0, ssri@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz" + resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== dependencies: minipass "^3.1.1" -ssri@^9.0.0: - version "9.0.1" - resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz" - integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== - dependencies: - minipass "^3.1.1" - stack-trace@0.0.10, stack-trace@0.0.x: version "0.0.10" - resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg== stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" static-extend@^0.1.1: version "0.1.2" - resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== dependencies: define-property "^0.2.5" object-copy "^0.1.0" statuses@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" + resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: +statuses@~1.5.0: version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== stream-browserify@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz" + resolved "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== dependencies: inherits "~2.0.4" @@ -17331,7 +15320,7 @@ stream-browserify@^3.0.0: stream-chain@^2.2.4, stream-chain@^2.2.5: version "2.2.5" - resolved "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz" + resolved "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz#b30967e8f14ee033c5b9a19bbe8a2cba90ba0d09" integrity sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA== stream-events@^1.0.5: @@ -17343,12 +15332,12 @@ stream-events@^1.0.5: stream-exhaust@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz" + resolved "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== stream-http@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz" + resolved "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== dependencies: builtin-status-codes "^3.0.0" @@ -17357,32 +15346,32 @@ stream-http@^3.2.0: xtend "^4.0.2" stream-json@^1.7.3: - version "1.7.4" - resolved "https://registry.npmjs.org/stream-json/-/stream-json-1.7.4.tgz" - integrity sha512-ja2dde1v7dOlx5/vmavn8kLrxvNfs7r2oNc5DYmNJzayDDdudyCSuTB1gFjH4XBVTIwxiMxL4i059HX+ZiouXg== + version "1.9.1" + resolved "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz#e3fec03e984a503718946c170db7d74556c2a187" + integrity sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw== dependencies: stream-chain "^2.2.5" -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== +stream-shift@^1.0.0, stream-shift@^1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz#85b8fab4d71010fc3ba8772e8046cc49b8a3864b" + integrity sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ== streamfilter@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz" + resolved "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz#8c61b08179a6c336c6efccc5df30861b7a9675e7" integrity sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA== dependencies: readable-stream "^3.0.6" -streamroller@^3.0.4: - version "3.0.5" - resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.0.5.tgz" - integrity sha512-5uzTEUIi4OB5zy/H30kbUN/zpDNJsFUA+Z47ZL8EfrP93lcZvRLEqdbhdunEPa7CouuAzXXsHpCJ9dg90Umw7g== +streamroller@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz#1263182329a45def1ffaef58d31b15d13d2ee7ff" + integrity sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw== dependencies: - date-format "^4.0.5" - debug "^4.3.3" - fs-extra "^10.0.1" + date-format "^4.0.14" + debug "^4.3.4" + fs-extra "^8.1.0" streamx@^2.15.0: version "2.21.1" @@ -17397,13 +15386,13 @@ streamx@^2.15.0: strict-uri-encode@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== string-argv@~0.3.1: - version "0.3.1" - resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz" - integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== + version "0.3.2" + resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" + integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" @@ -17416,38 +15405,29 @@ string-argv@~0.3.1: string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== +string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: - emoji-regex "^7.0.1" is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" + strip-ansi "^4.0.0" string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" @@ -17471,34 +15451,7 @@ string.prototype.trim@^1.2.10: es-object-atoms "^1.0.0" has-property-descriptors "^1.0.2" -string.prototype.trim@^1.2.9: - version "1.2.9" - resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" - integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.0" - es-object-atoms "^1.0.0" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimend@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" - integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -string.prototype.trimend@^1.0.9: +string.prototype.trimend@^1.0.8, string.prototype.trimend@^1.0.9: version "1.0.9" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== @@ -17508,14 +15461,6 @@ string.prototype.trimend@^1.0.9: define-properties "^1.2.1" es-object-atoms "^1.0.0" -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - string.prototype.trimstart@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" @@ -17527,14 +15472,14 @@ string.prototype.trimstart@^1.0.8: string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" string_decoder@~1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" @@ -17548,28 +15493,21 @@ string_decoder@~1.1.1: strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" @@ -17583,51 +15521,51 @@ strip-ansi@^7.0.1: strip-bom-string@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" - integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= + resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" + integrity sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== strip-bom@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g== dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-bom@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-final-newline@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== strip-indent@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== dependencies: min-indent "^1.0.0" strip-json-comments@3.1.1, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== strip-json-comments@~2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== strong-log-transformer@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz" + resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== dependencies: duplexer "^0.1.1" @@ -17667,33 +15605,33 @@ superstatic@^9.1.0: supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1, supports-color@~8.1.1: version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" supports-color@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== supports-color@^5.3.0: version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== dependencies: has-flag "^3.0.0" supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" @@ -17708,29 +15646,29 @@ supports-hyperlinks@^3.1.0: supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" + resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== sver-compat@^1.5.0: version "1.5.0" - resolved "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz" - integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= + resolved "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" + integrity sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg== dependencies: es6-iterator "^2.0.1" es6-symbol "^3.1.1" symbol-observable@^1.1.0: version "1.2.0" - resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz" + resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== "sync-promise@git+https://github.com/brettz9/sync-promise.git#full-sync-missing-promise-features": version "1.0.1" - resolved "git+https://git@github.com/brettz9/sync-promise.git#25845a49a00aa2d2c985a5149b97c86a1fcdc75a" + resolved "git+https://github.com/brettz9/sync-promise.git#25845a49a00aa2d2c985a5149b97c86a1fcdc75a" tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" - resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" + resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== tar-fs@^2.0.0: @@ -17745,7 +15683,7 @@ tar-fs@^2.0.0: tar-stream@^2.1.4: version "2.2.0" - resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" + resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== dependencies: bl "^4.0.3" @@ -17765,7 +15703,7 @@ tar-stream@^3.0.0: tar@6.1.9: version "6.1.9" - resolved "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz" + resolved "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz#5646ef51342ac55456b2466e44da810439978db1" integrity sha512-XjLaMNl76o07zqZC/aW4lwegdY07baOH1T8w3AEfrHAdyg/oYO4ctjzEBq9Gy9fEP9oHqLIgvx6zuGDGe+bc8Q== dependencies: chownr "^2.0.0" @@ -17777,7 +15715,7 @@ tar@6.1.9: tar@^4.4.12: version "4.4.19" - resolved "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz" + resolved "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== dependencies: chownr "^1.1.4" @@ -17788,21 +15726,21 @@ tar@^4.4.12: safe-buffer "^5.2.1" yallist "^3.1.1" -tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: - version "6.1.11" - resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== +tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2, tar@^6.2.1: + version "6.2.1" + resolved "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" tcp-port-used@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/tcp-port-used/-/tcp-port-used-1.0.2.tgz" + resolved "https://registry.npmjs.org/tcp-port-used/-/tcp-port-used-1.0.2.tgz#9652b7436eb1f4cfae111c79b558a25769f6faea" integrity sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA== dependencies: debug "4.3.1" @@ -17821,12 +15759,12 @@ teeny-request@^9.0.0: temp-dir@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz" - integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= + resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + integrity sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ== temp-write@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz" + resolved "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz#cd2e0825fc826ae72d201dc26eef3bf7e6fc9320" integrity sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw== dependencies: graceful-fs "^4.1.15" @@ -17837,21 +15775,9 @@ temp-write@^4.0.0: term-size@^2.1.0: version "2.2.1" - resolved "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz" + resolved "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== -terser-webpack-plugin@^5.1.3: - version "5.2.4" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz" - integrity sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA== - dependencies: - jest-worker "^27.0.6" - p-limit "^3.1.0" - schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - source-map "^0.6.1" - terser "^5.7.2" - terser-webpack-plugin@^5.3.10: version "5.3.11" resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz#93c21f44ca86634257cac176f884f942b7ba3832" @@ -17863,16 +15789,6 @@ terser-webpack-plugin@^5.3.10: serialize-javascript "^6.0.2" terser "^5.31.1" -terser@5.16.1: - version "5.16.1" - resolved "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz" - integrity sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw== - dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" - commander "^2.20.0" - source-map-support "~0.5.20" - terser@5.37.0, terser@^5.17.4, terser@^5.31.1: version "5.37.0" resolved "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" @@ -17883,18 +15799,9 @@ terser@5.37.0, terser@^5.17.4, terser@^5.31.1: commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.7.2: - version "5.9.0" - resolved "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz" - integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - test-exclude@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: "@istanbuljs/schema" "^0.1.2" @@ -17910,47 +15817,46 @@ text-decoder@^1.1.0: text-extensions@^1.0.0: version "1.9.0" - resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" + resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== text-hex@1.0.x: version "1.0.0" - resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz" + resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== text-table@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== textextensions@^3.2.0: version "3.3.0" - resolved "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz" + resolved "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz#03530d5287b86773c08b77458589148870cc71d3" integrity sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw== thenify-all@^1.0.0: version "1.6.0" - resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.1" - resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" + resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== dependencies: any-promise "^1.0.0" through2-filter@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz" - integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== + version "3.1.0" + resolved "https://registry.npmjs.org/through2-filter/-/through2-filter-3.1.0.tgz#4a1b45d2b76b3ac93ec137951e372c268efc1a4e" + integrity sha512-VhZsTsfrIJjyUi6GeecnwcOJlmoqgIdGFDjqnV5ape+F1DN8GejfPO66XyIhoinxmxGImiUTrq9RwpTN5yszGA== dependencies: - through2 "~2.0.0" - xtend "~4.0.0" + through2 "^4.0.2" -through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0: +through2@^2.0.0, through2@^2.0.1, through2@^2.0.3: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== @@ -17960,128 +15866,116 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0: through2@^3.0.1: version "3.0.2" - resolved "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz" + resolved "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== dependencies: inherits "^2.0.4" readable-stream "2 || 3" -through2@^4.0.0: +through2@^4.0.0, through2@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" + resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== dependencies: readable-stream "3" through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8: version "2.3.8" - resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== time-stamp@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz" - integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= + resolved "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" + integrity sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw== timers-browserify@^2.0.12: version "2.0.12" - resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz" + resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== dependencies: setimmediate "^1.0.4" timers-ext@^0.1.7: - version "0.1.7" - resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz" - integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + version "0.1.8" + resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.8.tgz#b4e442f10b7624a29dd2aa42c295e257150cf16c" + integrity sha512-wFH7+SEAcKfJpfLPkrgMPvvwnEtj8W4IurvEyrKsDleXnKLCDw71w8jltvfLa8Rm4qQxxT4jmDBYbJG/z7qoww== dependencies: - es5-ext "~0.10.46" - next-tick "1" + es5-ext "^0.10.64" + next-tick "^1.1.0" timsort@~0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz" - integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= + resolved "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" + integrity sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A== tiny-queue@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz" - integrity sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY= + resolved "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046" + integrity sha512-EijGsv7kzd9I9g0ByCl6h42BWNGUZrlCSejfrb3AKeHC33SGbASu1VDf5O3rRiiUOhAC9CHdZxFPbZu0HmR70A== tmp@0.0.30: version "0.0.30" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha512-HXdTB7lvMwcb55XFfrTM8CPr/IYREk4hVBFaQ4b/6nInrluSL86hfHm7vu0luYKCfyBZp2trCjpc8caC3vVM3w== dependencies: os-tmpdir "~1.0.1" -tmp@0.2.1, tmp@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" +tmp@0.2.3, tmp@^0.2.1, tmp@^0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== tmp@^0.0.33: version "0.0.33" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" -tmp@^0.2.3: - version "0.2.3" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" - integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== - -tmpl@1.0.x: +tmpl@1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" + resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-absolute-glob@^2.0.0, to-absolute-glob@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz" - integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= + resolved "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" + integrity sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA== dependencies: is-absolute "^1.0.0" is-negated-glob "^1.0.0" to-fast-properties@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og== to-object-path@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== dependencies: is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz" + resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" @@ -18091,31 +15985,26 @@ to-regex@^3.0.1, to-regex@^3.0.2: to-through@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz" - integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= + resolved "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + integrity sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q== dependencies: through2 "^2.0.3" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - toidentifier@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== totp-generator@0.0.14: version "0.0.14" - resolved "https://registry.npmjs.org/totp-generator/-/totp-generator-0.0.14.tgz" + resolved "https://registry.npmjs.org/totp-generator/-/totp-generator-0.0.14.tgz#c136bcb4030f9cab5b10ecd82d15cd2d5518234a" integrity sha512-vFZ8N2TdF4mCj8bUW460jI73LqS+JKccsZ8cttQSuXa3dkTmZo8q81Pq2yAuiPxCI5fPfUrfaKuU+7adjx5s4w== dependencies: jssha "^3.1.2" tough-cookie@~2.5.0: version "2.5.0" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== dependencies: psl "^1.1.28" @@ -18123,59 +16012,59 @@ tough-cookie@~2.5.0: toxic@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/toxic/-/toxic-1.0.1.tgz" + resolved "https://registry.npmjs.org/toxic/-/toxic-1.0.1.tgz#8c2e2528da591100adc3883f2c0e56acfb1c7288" integrity sha512-WI3rIGdcaKULYg7KVoB0zcjikqvcYYvcuT6D89bFPz2rVR0Rl0PK6x8/X62rtdLtBKIE985NzVf/auTtGegIIg== dependencies: lodash "^4.17.10" tr46@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" + resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" tr46@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz" + resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== dependencies: punycode "^2.1.1" tr46@~0.0.3: version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== trim-newlines@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" + resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== trim-right@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== -triple-beam@^1.2.0, triple-beam@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz" - integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== +triple-beam@^1.3.0: + version "1.4.1" + resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" + integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg== ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" - integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== + version "1.4.3" + resolved "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" + integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw== -ts-essentials@10.0.2: - version "10.0.2" - resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-10.0.2.tgz#8c7aa74ed79580ffe49df5ca28d06cc6bea0ff3c" - integrity sha512-Xwag0TULqriaugXqVdDiGZ5wuZpqABZlpwQ2Ho4GDyiu/R2Xjkp/9+zcFxL7uzeLl/QCPrflnvpVYyS3ouT7Zw== +ts-essentials@10.0.4: + version "10.0.4" + resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-10.0.4.tgz#db8381c2e44cddb3339a2286174c4763bc1dcedb" + integrity sha512-lwYdz28+S4nicm+jFi6V58LaAIpxzhg9rLdgNC1VsdP/xiFBseGhF1M/shwCk6zMmwahBZdXcl34LVHrEang3A== -ts-essentials@9.3.0: - version "9.3.0" - resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.3.0.tgz" - integrity sha512-XeiCboEyBG8UqXZtXl59bWEi4ZgOqRsogFDI6WDGIF1LmzbYiAkIwjkXN6zZWWl4re/lsOqMlYfe8KA0XiiEPw== +ts-essentials@9.4.2: + version "9.4.2" + resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.4.2.tgz#6d4bd23b46b61bf3e031816cc887e839eb62c33c" + integrity sha512-mB/cDhOvD7pg3YCLk2rOtejHjjdSi9in/IBYE13S+8WA5FBSraYf4V/ws55uvs0IvQ/l0wBOlXy5yBNZ9Bl8ZQ== ts-loader@9.5.2: version "9.5.2" @@ -18227,27 +16116,17 @@ tsec@0.2.8: tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.3.1: - version "2.4.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - -tslib@^2.0.1, tslib@^2.1.0: - version "2.3.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== - -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== +tslib@^2.0.1, tslib@^2.1.0, tslib@^2.6.2: + version "2.8.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== tslint@6.1.3: version "6.1.3" - resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" + resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904" integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg== dependencies: "@babel/code-frame" "^7.0.0" @@ -18264,113 +16143,99 @@ tslint@6.1.3: tslib "^1.13.0" tsutils "^2.29.0" +tsscmp@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" + integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== + tsutils@^2.29.0: version "2.29.0" - resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz" + resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== dependencies: tslib "^1.8.1" tty-browserify@^0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz" + resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== tunnel-agent@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" - resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: prelude-ls "^1.2.1" -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: +type-detect@4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-detect@^4.1.0: +type-detect@^4.0.0, type-detect@^4.0.8, type-detect@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== type-fest@^0.18.0: version "0.18.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== type-fest@^0.20.2: version "0.20.2" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== type-fest@^0.21.3: version "0.21.3" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-fest@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== type-fest@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== type-fest@^0.8.0, type-fest@^0.8.1: version "0.8.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== type-fest@^2.14.0: version "2.19.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== -type-is@~1.6.17, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" - resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz" + resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== dependencies: media-typer "0.3.0" mime-types "~2.1.24" -type@^1.0.1: - version "1.2.0" - resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.5.0: - version "2.5.0" - resolved "https://registry.npmjs.org/type/-/type-2.5.0.tgz" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== - type@^2.7.2: - version "2.7.2" - resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" - integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== - -typed-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" - integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-typed-array "^1.1.13" + version "2.7.3" + resolved "https://registry.npmjs.org/type/-/type-2.7.3.tgz#436981652129285cc3ba94f392886c2637ea0486" + integrity sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ== typed-array-buffer@^1.0.3: version "1.0.3" @@ -18381,17 +16246,6 @@ typed-array-buffer@^1.0.3: es-errors "^1.3.0" is-typed-array "^1.1.14" -typed-array-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" - integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - typed-array-byte-length@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz#8407a04f7d78684f3d252aa1a143d2b77b4160ce" @@ -18403,18 +16257,6 @@ typed-array-byte-length@^1.0.3: has-proto "^1.2.0" is-typed-array "^1.1.14" -typed-array-byte-offset@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" - integrity sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - typed-array-byte-offset@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz#ae3698b8ec91a8ab945016108aef00d5bff12355" @@ -18428,18 +16270,6 @@ typed-array-byte-offset@^1.0.4: is-typed-array "^1.1.15" reflect.getprototypeof "^1.0.9" -typed-array-length@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz#57155207c76e64a3457482dfdc1c9d1d3c4c73a3" - integrity sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - possible-typed-array-names "^1.0.0" - typed-array-length@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" @@ -18454,19 +16284,19 @@ typed-array-length@^1.0.7: typedarray-to-buffer@^3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" - resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== typedoc-default-themes@^0.7.2: version "0.7.2" - resolved "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.7.2.tgz" + resolved "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.7.2.tgz#1e9896f920b58e6da0bba9d7e643738d02405a5a" integrity sha512-fiFKlFO6VTqjcno8w6WpTsbCgXmfPHVjnLfYkmByZE7moaz+E2DSpAT+oHtDHv7E0BM5kAhPrHJELP2J2Y2T9A== dependencies: backbone "^1.4.0" @@ -18476,7 +16306,7 @@ typedoc-default-themes@^0.7.2: typedoc@0.16.11: version "0.16.11" - resolved "https://registry.npmjs.org/typedoc/-/typedoc-0.16.11.tgz" + resolved "https://registry.npmjs.org/typedoc/-/typedoc-0.16.11.tgz#95f862c6eba78533edc9af7096d2295b718eddc1" integrity sha512-YEa5i0/n0yYmLJISJ5+po6seYfJQJ5lQYcHCPF9ffTF92DB/TAZO/QrazX5skPHNPtmlIht5FdTXCM2kC7jQFQ== dependencies: "@types/minimatch" "3.0.3" @@ -18493,7 +16323,7 @@ typedoc@0.16.11: typescript@3.7.x: version "3.7.7" - resolved "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz" + resolved "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz#c931733e2ec10dda56b855b379cc488a72a81199" integrity sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA== typescript@5.5.4: @@ -18503,12 +16333,12 @@ typescript@5.5.4: typescript@~4.1.3: version "4.1.6" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz#1becd85d77567c3c741172339e93ce2e69932138" integrity sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow== typeson-registry@3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/typeson-registry/-/typeson-registry-3.0.0.tgz" + resolved "https://registry.npmjs.org/typeson-registry/-/typeson-registry-3.0.0.tgz#a7f5e023b0e3af3542252ec47648e96586d62ee9" integrity sha512-xPBsm6LhQnU2HOQq1770MjbtIXMd7s7Q7VWFyexe9hRVSIvx+PXPXh/Snh2+HgT6fffxAADVHIBCSjrVrsbrhw== dependencies: base64-arraybuffer-es6 "^1.0.0" @@ -18517,48 +16347,28 @@ typeson-registry@3.0.0: typeson@7.0.2, typeson@^7.0.1: version "7.0.2" - resolved "https://registry.npmjs.org/typeson/-/typeson-7.0.2.tgz" + resolved "https://registry.npmjs.org/typeson/-/typeson-7.0.2.tgz#5efe61693a3a255027bfd0e727bb8e9188ce67f3" integrity sha512-Rc/BXqUq+pgAc9D3Na+A2iiTlenfzZW9VA2H9DzpYWKOqUMwUaLyu6OQWXCIEiFs1AQ6Fssbed1/subMY/cEag== ua-parser-js@^0.7.30: - version "0.7.37" - resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz#e464e66dac2d33a7a1251d7d7a99d6157ec27832" - integrity sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA== + version "0.7.40" + resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.40.tgz#c87d83b7bb25822ecfa6397a0da5903934ea1562" + integrity sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ== uglify-js@^3.1.4, uglify-js@^3.4.9: - version "3.14.2" - resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz" - integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== + version "3.19.3" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" + integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== uid-number@0.0.6: version "0.0.6" - resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" - integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= + resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + integrity sha512-c461FXIljswCuscZn67xq9PpszkPT6RjheWFQTgCyabJrTUozElanb0YEqv2UGgk247YpcJkFBuSGNvBlpXM9w== umask@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz" - integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== - dependencies: - call-bind "^1.0.2" - has-bigints "^1.0.2" - has-symbols "^1.0.3" - which-boxed-primitive "^1.0.2" + resolved "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + integrity sha512-lE/rxOhmiScJu9L6RTNVgB/zZbF+vGC0/p6D3xnkAePI2o0sMyFG966iR5Ki50OI/0mNi2yaRnxfLsPmEZF/JA== unbox-primitive@^1.1.0: version "1.1.0" @@ -18572,22 +16382,22 @@ unbox-primitive@^1.1.0: unc-path-regex@^0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz" - integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg== underscore@>=1.8.3, underscore@^1.9.1: - version "1.13.1" - resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz" - integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== + version "1.13.7" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10" + integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g== undertaker-registry@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz" - integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= + resolved "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw== undertaker@^1.2.1: version "1.3.0" - resolved "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz" + resolved "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== dependencies: arr-flatten "^1.0.1" @@ -18606,10 +16416,15 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== + unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== + version "2.0.1" + resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" + integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== unicode-emoji-modifier-base@^1.0.0: version "1.0.0" @@ -18618,30 +16433,25 @@ unicode-emoji-modifier-base@^1.0.0: unicode-match-property-ecmascript@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" + resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz" - integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw== - unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + version "2.2.0" + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" + integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== unicode-property-aliases-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz" - integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== + version "2.1.0" + resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== union-value@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz" + resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" @@ -18651,42 +16461,42 @@ union-value@^1.0.0: union@~0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/union/-/union-0.5.0.tgz" + resolved "https://registry.npmjs.org/union/-/union-0.5.0.tgz#b2c11be84f60538537b846edb9ba266ba0090075" integrity sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA== dependencies: qs "^6.4.0" unique-filename@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz" + resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== dependencies: unique-slug "^2.0.0" -unique-filename@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz" - integrity sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A== +unique-filename@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea" + integrity sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g== dependencies: - unique-slug "^3.0.0" + unique-slug "^4.0.0" unique-slug@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz" + resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== dependencies: imurmurhash "^0.1.4" -unique-slug@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz" - integrity sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w== +unique-slug@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz#6bae6bb16be91351badd24cdce741f892a6532e3" + integrity sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ== dependencies: imurmurhash "^0.1.4" unique-stream@^2.0.2: version "2.3.1" - resolved "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz" + resolved "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== dependencies: json-stable-stringify-without-jsonify "^1.0.1" @@ -18694,75 +16504,57 @@ unique-stream@^2.0.2: unique-string@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz" + resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== dependencies: crypto-random-string "^2.0.0" universal-analytics@^0.5.3: version "0.5.3" - resolved "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.5.3.tgz" + resolved "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.5.3.tgz#ff2d9b850062cdd4a8f652448047982a183c8e96" integrity sha512-HXSMyIcf2XTvwZ6ZZQLfxfViRm/yTGoRgDeTbojtq6rezeyKB0sTBcKH2fhddnteAHRcHiKgr/ACpbgjGOC6RQ== dependencies: debug "^4.3.1" uuid "^8.0.0" universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + version "6.0.1" + resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz#15f20f55da3c930c57bddbf1734c6654d5fd35aa" + integrity sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ== universalify@^0.1.0: version "0.1.2" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + version "2.0.1" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== unset-value@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== dependencies: has-value "^0.3.1" isobject "^3.0.0" -upath2@^3.1.13: - version "3.1.19" - resolved "https://registry.npmjs.org/upath2/-/upath2-3.1.19.tgz" - integrity sha512-d23dQLi8nDWSRTIQwXtaYqMrHuca0As53fNiTLLFDmsGBbepsZepISaB2H1x45bDFN/n3Qw9bydvyZEacTrEWQ== - dependencies: - "@types/node" "*" - path-is-network-drive "^1.0.20" - path-strip-sep "^1.0.17" - tslib "^2" - upath@^1.1.1: version "1.2.0" - resolved "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz" + resolved "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== upath@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz" + resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== -update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - update-browserslist-db@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz#97e9c96ab0ae7bcac08e9ae5151d26e6bc6b5580" @@ -18772,9 +16564,9 @@ update-browserslist-db@^1.1.1: picocolors "^1.1.1" update-notifier-cjs@^5.1.6: - version "5.1.6" - resolved "https://registry.npmjs.org/update-notifier-cjs/-/update-notifier-cjs-5.1.6.tgz" - integrity sha512-wgxdSBWv3x/YpMzsWz5G4p4ec7JWD0HCl8W6bmNB6E5Gwo+1ym5oN4hiXpLf0mPySVEJEIsYlkshnplkg2OP9A== + version "5.1.7" + resolved "https://registry.npmjs.org/update-notifier-cjs/-/update-notifier-cjs-5.1.7.tgz#995733b43bdaeb136b999d55061fc385ef787a7f" + integrity sha512-eZWTh8F+VCEoC4UIh0pKmh8h4izj65VvLhCpJpVefUxdYe0fU3GBrC4Sbh1AoWA/miNPAb6UVlp2fUQNsfp+3g== dependencies: boxen "^5.0.0" chalk "^4.1.0" @@ -18793,26 +16585,26 @@ update-notifier-cjs@^5.1.6: semver-diff "^3.1.1" xdg-basedir "^4.0.0" -uri-js@^4.2.2: +uri-js@^4.2.2, uri-js@^4.4.1: version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== url-join@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz" - integrity sha1-HbSK1CLTQCRpqH99l73r/k+x48g= + resolved "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz#1db48ad422d3402469a87f7d97bdebfe4fb1e3c8" + integrity sha512-H6dnQ/yPAAVzMQRvEvyz01hhfQL5qRWSEt7BX8t9DqnPw9BjMb64fjIRq76Uvf1hkHp+mTZvEVJ5guXOT0Xqaw== url-join@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz" + resolved "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== url-template@^2.0.8: @@ -18821,45 +16613,33 @@ url-template@^2.0.8: integrity sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw== url@^0.11.0: - version "0.11.0" - resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + version "0.11.4" + resolved "https://registry.npmjs.org/url/-/url-0.11.4.tgz#adca77b3562d56b72746e76b330b7f27b6721f3c" + integrity sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg== dependencies: - punycode "1.3.2" - querystring "0.2.0" + punycode "^1.4.1" + qs "^6.12.3" use@^3.1.0: version "3.1.1" - resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz" + resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== util-promisify@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz" - integrity sha1-PCI2R2xNMsX/PEcAKt18E7moKlM= + resolved "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53" + integrity sha512-K+5eQPYs14b3+E+hmE2J6gCZ4JmMl9DbYS6BeP2CHq6WMuNxErxf5B/n0fz85L8zUuoO6rIzNNmIQDu/j+1OcA== dependencies: object.getownpropertydescriptors "^2.0.3" -util@^0.12.0: - version "0.12.4" - resolved "https://registry.npmjs.org/util/-/util-0.12.4.tgz" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - -util@^0.12.4: +util@^0.12.4, util@^0.12.5: version "0.12.5" - resolved "https://registry.npmjs.org/util/-/util-0.12.5.tgz" + resolved "https://registry.npmjs.org/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== dependencies: inherits "^2.0.3" @@ -18870,22 +16650,22 @@ util@^0.12.4: utils-merge@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@^10.0.0: version "10.0.0" resolved "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== -uuid@^3.3.2, uuid@^3.3.3: +uuid@^3.3.2: version "3.4.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.0.0, uuid@^8.3.2: version "8.3.2" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== uuid@^9.0.0, uuid@^9.0.1: @@ -18895,24 +16675,24 @@ uuid@^9.0.0, uuid@^9.0.1: v8-compile-cache-lib@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" + resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== v8flags@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz" + resolved "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== dependencies: homedir-polyfill "^1.0.1" valid-url@^1: version "1.0.9" - resolved "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz" - integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= + resolved "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" + integrity sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA== validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" - resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" @@ -18920,35 +16700,35 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: validate-npm-package-name@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz" - integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= + resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== dependencies: builtins "^1.0.3" validator@^13.7.0: - version "13.7.0" - resolved "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz" - integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== + version "13.12.0" + resolved "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f" + integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg== validator@^8.0.0: version "8.2.0" - resolved "https://registry.npmjs.org/validator/-/validator-8.2.0.tgz" + resolved "https://registry.npmjs.org/validator/-/validator-8.2.0.tgz#3c1237290e37092355344fef78c231249dab77b9" integrity sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA== value-or-function@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz" - integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= + resolved "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + integrity sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg== vary@^1, vary@~1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== verror@1.10.0: version "1.10.0" - resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -18956,7 +16736,7 @@ verror@1.10.0: vinyl-fs@^3.0.0, vinyl-fs@^3.0.2: version "3.0.3" - resolved "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz" + resolved "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== dependencies: fs-mkdirp-stream "^1.0.0" @@ -18979,8 +16759,8 @@ vinyl-fs@^3.0.0, vinyl-fs@^3.0.2: vinyl-sourcemap@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz" - integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= + resolved "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" + integrity sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA== dependencies: append-buffer "^1.0.2" convert-source-map "^1.5.0" @@ -18992,7 +16772,7 @@ vinyl-sourcemap@^1.1.0: vinyl@^2.0.0, vinyl@^2.1.0, vinyl@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz" + resolved "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== dependencies: clone "^2.1.1" @@ -19004,37 +16784,29 @@ vinyl@^2.0.0, vinyl@^2.1.0, vinyl@^2.2.1: vm-browserify@^1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz" + resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== void-elements@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + resolved "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" + integrity sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung== -walker@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: - makeerror "1.0.x" + makeerror "1.0.12" watch@1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/watch/-/watch-1.0.2.tgz" - integrity sha1-NApxe952Vyb6CqB9ch4BR6VR3ww= + resolved "https://registry.npmjs.org/watch/-/watch-1.0.2.tgz#340a717bde765726fa0aa07d721e0147a551df0c" + integrity sha512-1u+Z5n9Jc1E2c7qDO8SinPoZuHj7FgbgU1olSFoyaklduDvvtX7GMMtlE6OC9FTXq4KvNAOfj6Zu4vI1e9bAKA== dependencies: exec-sh "^0.2.0" minimist "^1.2.0" -watchpack@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz" - integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA== - dependencies: - glob-to-regexp "^0.4.1" - graceful-fs "^4.1.2" - watchpack@^2.4.1: version "2.4.2" resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" @@ -19045,8 +16817,8 @@ watchpack@^2.4.1: wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== dependencies: defaults "^1.0.3" @@ -19057,18 +16829,18 @@ web-vitals@^4.2.4: webdriver-js-extender@2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz" + resolved "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz#57d7a93c00db4cc8d556e4d3db4b5db0a80c3bb7" integrity sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ== dependencies: "@types/selenium-webdriver" "^3.0.0" selenium-webdriver "^3.0.1" webdriver-manager@^12.0.6: - version "12.1.8" - resolved "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.8.tgz" - integrity sha512-qJR36SXG2VwKugPcdwhaqcLQOD7r8P2Xiv9sfNbfZrKBnX243iAkOueX1yAmeNgIKhJ3YAT/F2gq6IiEZzahsg== + version "12.1.9" + resolved "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.9.tgz#8d83543b92711b7217b39fef4cda958a4703d2df" + integrity sha512-Yl113uKm8z4m/KMUVWHq1Sjtla2uxEBtx2Ue3AmIlnlPAKloDn/Lvmy6pqWCUersVISpdMeVpAaGbNnvMuT2LQ== dependencies: - adm-zip "^0.4.9" + adm-zip "^0.5.2" chalk "^1.1.1" del "^2.2.0" glob "^7.0.3" @@ -19082,39 +16854,34 @@ webdriver-manager@^12.0.6: webidl-conversions@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== webidl-conversions@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webidl-conversions@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== webpack-merge@^4.1.5: version "4.2.2" - resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz" + resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d" integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g== dependencies: lodash "^4.17.15" -webpack-sources@^3.2.0: - version "3.2.1" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz" - integrity sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA== - webpack-sources@^3.2.3: version "3.2.3" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" + resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack-stream@7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/webpack-stream/-/webpack-stream-7.0.0.tgz" + resolved "https://registry.npmjs.org/webpack-stream/-/webpack-stream-7.0.0.tgz#e6a1edb9568198499af872678e95031752d72f00" integrity sha512-XoAQTHyCaYMo6TS7Atv1HYhtmBgKiVLONJbzLBl2V3eibXQ2IT/MCRM841RW/r3vToKD5ivrTJFWgd/ghoxoRg== dependencies: fancy-log "^1.3.3" @@ -19131,7 +16898,7 @@ webpack-virtual-modules@0.6.2: resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz#057faa9065c8acf48f24cb57ac0e77739ab9a7e8" integrity sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ== -webpack@5.97.1: +webpack@5.97.1, webpack@^5: version "5.97.1" resolved "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== @@ -19160,39 +16927,9 @@ webpack@5.97.1: watchpack "^2.4.1" webpack-sources "^3.2.3" -webpack@^5: - version "5.53.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.53.0.tgz" - integrity sha512-RZ1Z3z3ni44snoWjfWeHFyzvd9HMVYDYC5VXmlYUT6NWgEOWdCNpad5Fve2CzzHoRED7WtsKe+FCyP5Vk4pWiQ== - dependencies: - "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.50" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.8.0" - es-module-lexer "^0.7.1" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.4" - json-parse-better-errors "^1.0.2" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.1.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.2.0" - webpack-sources "^3.2.0" - websocket-driver@>=0.5.1: version "0.7.4" - resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" + resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== dependencies: http-parser-js ">=0.5.1" @@ -19201,12 +16938,12 @@ websocket-driver@>=0.5.1: websocket-extensions@>=0.1.1: version "0.1.4" - resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz" + resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== "websql@git+https://github.com/brettz9/node-websql.git#configurable-secure3": version "2.0.1" - resolved "git+https://git@github.com/brettz9/node-websql.git#73f7e4051cda5e58de7669a54ab184d387b2f98d" + resolved "git+https://github.com/brettz9/node-websql.git#73f7e4051cda5e58de7669a54ab184d387b2f98d" dependencies: argsarray "^0.0.1" immediate "^3.2.2" @@ -19217,24 +16954,24 @@ websocket-extensions@>=0.1.1: whatwg-encoding@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz" + resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== dependencies: iconv-lite "0.6.3" whatwg-fetch@^3.4.1: - version "3.6.2" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz" - integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + version "3.6.20" + resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz#580ce6d791facec91d37c72890995a0b48d31c70" + integrity sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg== whatwg-mimetype@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" + resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-url@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== dependencies: tr46 "^3.0.0" @@ -19242,32 +16979,21 @@ whatwg-url@^11.0.0: whatwg-url@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" whatwg-url@^8.4.0: version "8.7.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" tr46 "^2.1.0" webidl-conversions "^6.1.0" -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz#d76ec27df7fa165f18d5808374a5fe23c29b176e" @@ -19310,26 +17036,15 @@ which-collection@^1.0.2: which-module@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ== which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which-typed-array@^1.1.14, which-typed-array@^1.1.15: - version "1.1.15" - resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" - integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.2" + version "2.0.1" + resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" + integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.16, which-typed-array@^1.1.18: +which-typed-array@^1.1.16, which-typed-array@^1.1.18, which-typed-array@^1.1.2: version "1.1.18" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz#df2389ebf3fbb246a71390e90730a9edb6ce17ad" integrity sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA== @@ -19341,28 +17056,16 @@ which-typed-array@^1.1.16, which-typed-array@^1.1.18: gopd "^1.2.0" has-tostringtag "^1.0.2" -which-typed-array@^1.1.2: - version "1.1.7" - resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz" - integrity sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.7" - which@2.0.2, which@^2.0.1, which@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" which@^1.2.1, which@^1.2.14, which@^1.2.9, which@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" @@ -19374,49 +17077,52 @@ which@^3.0.0: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== +which@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" + integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== dependencies: - string-width "^1.0.2 || 2" + isexe "^3.1.1" -wide-align@^1.1.2, wide-align@^1.1.5: +wide-align@^1.1.0, wide-align@^1.1.5: version "1.1.5" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" + resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== dependencies: string-width "^1.0.2 || 2 || 3 || 4" widest-line@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz" + resolved "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== dependencies: string-width "^4.0.0" -winston-transport@^4.4.0: - version "4.4.0" - resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz" - integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== +winston-transport@^4.4.0, winston-transport@^4.9.0: + version "4.9.0" + resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz#3bba345de10297654ea6f33519424560003b3bf9" + integrity sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A== dependencies: - readable-stream "^2.3.7" - triple-beam "^1.2.0" + logform "^2.7.0" + readable-stream "^3.6.2" + triple-beam "^1.3.0" winston@^3.0.0: - version "3.3.3" - resolved "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz" - integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw== + version "3.17.0" + resolved "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz#74b8665ce9b4ea7b29d0922cfccf852a08a11423" + integrity sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw== dependencies: + "@colors/colors" "^1.6.0" "@dabh/diagnostics" "^2.0.2" - async "^3.1.0" + async "^3.2.3" is-stream "^2.0.0" - logform "^2.2.0" + logform "^2.7.0" one-time "^1.0.0" readable-stream "^3.4.0" + safe-stable-stringify "^2.3.1" stack-trace "0.0.x" triple-beam "^1.3.0" - winston-transport "^4.4.0" + winston-transport "^4.9.0" word-wrap@^1.2.5: version "1.2.5" @@ -19425,17 +17131,17 @@ word-wrap@^1.2.5: wordwrap@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== wordwrap@~0.0.2: version "0.0.3" - resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw== workerpool@6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz" + resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": @@ -19449,23 +17155,23 @@ workerpool@6.2.0: wrap-ansi@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw== dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" wrap-ansi@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz" - integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== dependencies: ansi-styles "^4.0.0" @@ -19474,7 +17180,7 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -19492,13 +17198,13 @@ wrap-ansi@^8.1.0: wrappy@1: version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^1.1.4: version "1.3.4" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz" - integrity sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + integrity sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw== dependencies: graceful-fs "^4.1.11" imurmurhash "^0.1.4" @@ -19506,7 +17212,7 @@ write-file-atomic@^1.1.4: write-file-atomic@^2.4.2: version "2.4.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== dependencies: graceful-fs "^4.1.11" @@ -19515,7 +17221,7 @@ write-file-atomic@^2.4.2: write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: imurmurhash "^0.1.4" @@ -19523,9 +17229,17 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + write-json-file@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz" + resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== dependencies: detect-indent "^5.0.0" @@ -19537,7 +17251,7 @@ write-json-file@^3.2.0: write-json-file@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz" + resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz#908493d6fd23225344af324016e4ca8f702dd12d" integrity sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ== dependencies: detect-indent "^6.0.0" @@ -19549,28 +17263,23 @@ write-json-file@^4.3.0: write-pkg@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz" + resolved "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz#675cc04ef6c11faacbbc7771b24c0abbf2a20039" integrity sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA== dependencies: sort-keys "^2.0.0" type-fest "^0.4.1" write-json-file "^3.2.0" -ws@>=7.4.6: - version "8.2.2" - resolved "https://registry.npmjs.org/ws/-/ws-8.2.2.tgz" - integrity sha512-Q6B6H2oc8QY3llc3cB8kVmQ6pnJWVQbP7Q5algTcIxx7YEpc0oU4NBVHlztA7Ekzfhw2r0rPducMUiCGWKQRzw== - -ws@>=8.11.0: - version "8.12.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz" - integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig== - ws@^7.5.10: version "7.5.10" resolved "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== +ws@^8.18.0: + version "8.18.0" + resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + ws@~8.17.1: version "8.17.1" resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" @@ -19578,12 +17287,12 @@ ws@~8.17.1: xdg-basedir@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz" + resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== xml2js@^0.4.17: version "0.4.23" - resolved "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz" + resolved "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== dependencies: sax ">=0.6.0" @@ -19591,85 +17300,80 @@ xml2js@^0.4.17: xmlbuilder@~11.0.0: version "11.0.1" - resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz" + resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" + resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^3.2.1: version "3.2.2" - resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" + resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== y18n@^4.0.0: version "4.0.3" - resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz" + resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yallist@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yaml@^1.10.0: version "1.10.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" + resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yaml@^2.2.1, yaml@^2.4.1: +yaml@^2.2.1, yaml@^2.2.2, yaml@^2.4.1: version "2.7.0" resolved "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== -yaml@^2.2.2: - version "2.3.1" - resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz" - integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== - yargs-parser@20.2.4: version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@>=5.0.0-security.0, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@>=5.0.0-security.0, yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs-parser@^18.1.2: version "18.1.3" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== +yargs-parser@^20.2.2, yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-parser@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz#7ede329c1d8cdbbe209bd25cdb990e9b1ebbb394" integrity sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA== dependencies: camelcase "^3.0.0" @@ -19677,7 +17381,7 @@ yargs-parser@^5.0.1: yargs-unparser@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" + resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" @@ -19700,7 +17404,7 @@ yargs@16.2.0, yargs@^16.0.0, yargs@^16.1.1, yargs@^16.2.0: yargs@17.7.2, yargs@^17.7.2: version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" @@ -19713,7 +17417,7 @@ yargs@17.7.2, yargs@^17.7.2: yargs@^15.0.2: version "15.4.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== dependencies: cliui "^6.0.0" @@ -19728,22 +17432,9 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.1.1: - version "17.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.2.0.tgz" - integrity sha512-UPeZv4h9Xv510ibpt5rdsUNzgD78nMa1rhxxCgvkKiq06hlKCEHJLiJ6Ub8zDg/wR6hedEI6ovnd2vCvJ4nusA== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^7.1.0: version "7.1.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz#63a0a5d42143879fdbb30370741374e0641d55db" integrity sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA== dependencies: camelcase "^3.0.0" @@ -19762,25 +17453,25 @@ yargs@^7.1.0: yauzl@^2.10.0: version "2.10.0" - resolved "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= + resolved "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" yn@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== z-schema@~3.18.3: version "3.18.4" - resolved "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz" + resolved "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz#ea8132b279533ee60be2485a02f7e3e42541a9a2" integrity sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw== dependencies: lodash.get "^4.0.0" @@ -19790,15 +17481,15 @@ z-schema@~3.18.3: commander "^2.7.1" z-schema@~5.0.2: - version "5.0.3" - resolved "https://registry.npmjs.org/z-schema/-/z-schema-5.0.3.tgz" - integrity sha512-sGvEcBOTNum68x9jCpCVGPFJ6mWnkD0YxOcddDlJHRx3tKdB2q8pCHExMVZo/AV/6geuVJXG7hljDaWG8+5GDw== + version "5.0.6" + resolved "https://registry.npmjs.org/z-schema/-/z-schema-5.0.6.tgz#46d6a687b15e4a4369e18d6cb1c7b8618fc256c5" + integrity sha512-+XR1GhnWklYdfr8YaZv/iu+vY+ux7V5DS5zH1DQf6bO5ufrt/5cgNhVO5qyhsjFXvsqQb/f08DWE9b6uPscyAg== dependencies: lodash.get "^4.4.2" lodash.isequal "^4.5.0" validator "^13.7.0" optionalDependencies: - commander "^2.20.3" + commander "^10.0.0" zip-stream@^6.0.1: version "6.0.1" From 9d88e3a85a7253694dd7cf58d7eb834e41af2b79 Mon Sep 17 00:00:00 2001 From: "Nhien (Ricky) Lam" <62775270+NhienLam@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:18:02 -0800 Subject: [PATCH 093/295] Add ActionCodeSettings.linkDomain and deprecate ActionCodeSettings.dynamicLinkDomain (#8738) * Add linkDomain field to ActionCodeSettings (#8428) * Add linkDomain field to ActionCodeSettings * Update API reports * Update error message for ERROR_INVALID_HOSTING_LINK_DOMAIN to include that default hosting domains cannot be used. * Use constants for test values --------- Co-authored-by: NhienLam * FDL Deprecation & Hosting link Integration Test (#8603) * Implement Integration test for passwordless email sign-in via firebase-hosting links. * Add license to new test file created' did not match any files * Remove unwanted _ * Add support for setting custom hosting link domain in test app (#8614) * Add afterEach method and apply formatting to the hosting links integration test (#8615) * Mark ActionCodeSettings.dynamicLinkDomain as deprecated * Add changeset * Update API reports * Address review comments * Fix changeset * Update refdocs and address review comments * Update deprecated comment * Add FDL deprecation FAQ link * Fix linkDomain link in refdocs --------- Co-authored-by: NhienLam Co-authored-by: mansisampat --- .changeset/polite-lies-vanish.md | 7 ++ common/api-review/auth.api.md | 3 + docs-devsite/auth.actioncodesettings.md | 22 +++- docs-devsite/auth.md | 1 + packages/auth-types/index.d.ts | 1 + packages/auth/demo/public/index.html | 5 + packages/auth/demo/src/index.js | 7 +- packages/auth/karma.conf.js | 3 +- .../api/authentication/email_and_password.ts | 1 + packages/auth/src/api/errors.ts | 3 +- packages/auth/src/core/errors.ts | 11 +- .../strategies/action_code_settings.test.ts | 37 ++++-- .../core/strategies/action_code_settings.ts | 7 ++ .../auth/src/core/strategies/email.test.ts | 16 ++- .../strategies/email_and_password.test.ts | 8 +- .../src/core/strategies/email_link.test.ts | 8 +- packages/auth/src/model/public_types.ts | 23 ++-- .../integration/flows/hosting_link.test.ts | 106 ++++++++++++++++++ 18 files changed, 232 insertions(+), 37 deletions(-) create mode 100644 .changeset/polite-lies-vanish.md create mode 100644 packages/auth/test/integration/flows/hosting_link.test.ts diff --git a/.changeset/polite-lies-vanish.md b/.changeset/polite-lies-vanish.md new file mode 100644 index 00000000000..698359235e2 --- /dev/null +++ b/.changeset/polite-lies-vanish.md @@ -0,0 +1,7 @@ +--- +'firebase': minor +'@firebase/auth-types': minor +'@firebase/auth': minor +--- + +Added `ActionCodeSettings.linkDomain` to customize the Firebase Hosting link domain that is used in mobile out-of-band email action flows. Also, deprecated `ActionCodeSettings.dynamicLinkDomain`. diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index b011b803774..7ec0db38bdc 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -40,11 +40,13 @@ export interface ActionCodeSettings { minimumVersion?: string; packageName: string; }; + // @deprecated dynamicLinkDomain?: string; handleCodeInApp?: boolean; iOS?: { bundleId: string; }; + linkDomain?: string; url: string; } @@ -236,6 +238,7 @@ export const AuthErrorCodes: { readonly MISSING_RECAPTCHA_VERSION: "auth/missing-recaptcha-version"; readonly INVALID_RECAPTCHA_VERSION: "auth/invalid-recaptcha-version"; readonly INVALID_REQ_TYPE: "auth/invalid-req-type"; + readonly INVALID_HOSTING_LINK_DOMAIN: "auth/invalid-hosting-link-domain"; }; // @public diff --git a/docs-devsite/auth.actioncodesettings.md b/docs-devsite/auth.actioncodesettings.md index a12144adaf4..610bea0a429 100644 --- a/docs-devsite/auth.actioncodesettings.md +++ b/docs-devsite/auth.actioncodesettings.md @@ -26,13 +26,14 @@ export interface ActionCodeSettings | [dynamicLinkDomain](./auth.actioncodesettings.md#actioncodesettingsdynamiclinkdomain) | string | When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, example.page.link). | | [handleCodeInApp](./auth.actioncodesettings.md#actioncodesettingshandlecodeinapp) | boolean | When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed. | | [iOS](./auth.actioncodesettings.md#actioncodesettingsios) | { bundleId: string; } | Sets the iOS bundle ID. | +| [linkDomain](./auth.actioncodesettings.md#actioncodesettingslinkdomain) | string | The optional custom Firebase Hosting domain to use when the link is to be opened via a specified mobile app. The domain must be configured in Firebase Hosting and owned by the project. This cannot be a default Hosting domain (web.app or firebaseapp.com). | | [url](./auth.actioncodesettings.md#actioncodesettingsurl) | string | Sets the link continue/state URL. | ## ActionCodeSettings.android Sets the Android package name. -This will try to open the link in an android app if it is installed. If `installApp` is passed, it specifies whether to install the Android app if the device supports it and the app is not already installed. If this field is provided without a `packageName`, an error is thrown explaining that the `packageName` must be provided in conjunction with this field. If `minimumVersion` is specified, and an older version of the app is installed, the user is taken to the Play Store to upgrade the app. +This will try to open the link in an Android app if it is installed. Signature: @@ -46,6 +47,11 @@ android?: { ## ActionCodeSettings.dynamicLinkDomain +> Warning: This API is now obsolete. +> +> Firebase Dynamic Links is deprecated and will be shut down as early as August 2025. Instead, use [ActionCodeSettings.linkDomain](./auth.actioncodesettings.md#actioncodesettingslinkdomain) to set a custom domain for mobile links. Learn more in the [Dynamic Links deprecation FAQ](https://firebase.google.com/support/dynamic-links-faq). +> + When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, `example.page.link`). Signature: @@ -72,8 +78,6 @@ Sets the iOS bundle ID. This will try to open the link in an iOS app if it is installed. -App installation is not supported for iOS. - Signature: ```typescript @@ -82,11 +86,21 @@ iOS?: { }; ``` +## ActionCodeSettings.linkDomain + +The optional custom Firebase Hosting domain to use when the link is to be opened via a specified mobile app. The domain must be configured in Firebase Hosting and owned by the project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`). + +Signature: + +```typescript +linkDomain?: string; +``` + ## ActionCodeSettings.url Sets the link continue/state URL. -This has different meanings in different contexts: - When the link is handled in the web action widgets, this is the deep link in the `continueUrl` query parameter. - When the link is handled in the app directly, this is the `continueUrl` query parameter in the deep link of the Dynamic Link. +This has different meanings in different contexts: - When the link is handled in the web action widgets, this is the deep link in the `continueUrl` query parameter. - When the link is handled in the app directly, this is the `continueUrl` query parameter in the deep link of the Dynamic Link or Hosting link. Signature: diff --git a/docs-devsite/auth.md b/docs-devsite/auth.md index 83c91db1de2..82f8a3dc196 100644 --- a/docs-devsite/auth.md +++ b/docs-devsite/auth.md @@ -1956,6 +1956,7 @@ AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY: { readonly MISSING_RECAPTCHA_VERSION: "auth/missing-recaptcha-version"; readonly INVALID_RECAPTCHA_VERSION: "auth/invalid-recaptcha-version"; readonly INVALID_REQ_TYPE: "auth/invalid-req-type"; + readonly INVALID_HOSTING_LINK_DOMAIN: "auth/invalid-hosting-link-domain"; } ``` diff --git a/packages/auth-types/index.d.ts b/packages/auth-types/index.d.ts index bebf4e5b18a..4b0192df925 100644 --- a/packages/auth-types/index.d.ts +++ b/packages/auth-types/index.d.ts @@ -130,6 +130,7 @@ export type ActionCodeSettings = { iOS?: { bundleId: string }; url: string; dynamicLinkDomain?: string; + linkDomain?: string; }; export type AdditionalUserInfo = { diff --git a/packages/auth/demo/public/index.html b/packages/auth/demo/public/index.html index 030e730a835..78b14b8dd92 100644 --- a/packages/auth/demo/public/index.html +++ b/packages/auth/demo/public/index.html @@ -823,6 +823,11 @@ +
Mobile link
+
+ +
diff --git a/packages/auth/demo/src/index.js b/packages/auth/demo/src/index.js index 387e98799b4..876a345671a 100644 --- a/packages/auth/demo/src/index.js +++ b/packages/auth/demo/src/index.js @@ -49,8 +49,8 @@ import { signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, + signInWithEmailLink, TotpMultiFactorGenerator, - TotpSecret, unlink, updateEmail, updatePassword, @@ -995,6 +995,7 @@ function getActionCodeSettings() { const installApp = $('input[name=install-app]:checked').val() === 'Yes'; const handleCodeInApp = $('input[name=handle-in-app]:checked').val() === 'Yes'; + const hostingLinkDomain = $('#hostingLinkDomain').val(); if (url || apn || ibi) { actionCodeSettings['url'] = url; if (apn) { @@ -1010,6 +1011,9 @@ function getActionCodeSettings() { }; } actionCodeSettings['handleCodeInApp'] = handleCodeInApp; + if (hostingLinkDomain) { + actionCodeSettings['linkDomain'] = hostingLinkDomain; + } } return actionCodeSettings; } @@ -1020,6 +1024,7 @@ function onActionCodeSettingsReset() { $('#apn').val(''); $('#amv').val(''); $('#ibi').val(''); + $('#hostingLinkDomain').val(''); } /** diff --git a/packages/auth/karma.conf.js b/packages/auth/karma.conf.js index 161f4819d32..749ad0672c4 100644 --- a/packages/auth/karma.conf.js +++ b/packages/auth/karma.conf.js @@ -41,7 +41,8 @@ function getTestFiles(argv) { return [ 'test/integration/flows/totp.test.ts', 'test/integration/flows/password_policy.test.ts', - 'test/integration/flows/recaptcha_enterprise.test.ts' + 'test/integration/flows/recaptcha_enterprise.test.ts', + 'test/integration/flows/hosting_link.test.ts' ]; } return argv.local diff --git a/packages/auth/src/api/authentication/email_and_password.ts b/packages/auth/src/api/authentication/email_and_password.ts index 2f9664f72db..9012b95d213 100644 --- a/packages/auth/src/api/authentication/email_and_password.ts +++ b/packages/auth/src/api/authentication/email_and_password.ts @@ -70,6 +70,7 @@ export interface GetOobCodeRequest { dynamicLinkDomain?: string; tenantId?: string; targetProjectid?: string; + linkDomain?: string; } export interface VerifyEmailRequest extends GetOobCodeRequest { diff --git a/packages/auth/src/api/errors.ts b/packages/auth/src/api/errors.ts index d8f73f72821..0e59e3babbd 100644 --- a/packages/auth/src/api/errors.ts +++ b/packages/auth/src/api/errors.ts @@ -100,7 +100,8 @@ export const enum ServerError { MISSING_RECAPTCHA_VERSION = 'MISSING_RECAPTCHA_VERSION', INVALID_RECAPTCHA_VERSION = 'INVALID_RECAPTCHA_VERSION', INVALID_REQ_TYPE = 'INVALID_REQ_TYPE', - PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'PASSWORD_DOES_NOT_MEET_REQUIREMENTS' + PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'PASSWORD_DOES_NOT_MEET_REQUIREMENTS', + INVALID_HOSTING_LINK_DOMAIN = 'INVALID_HOSTING_LINK_DOMAIN' } /** diff --git a/packages/auth/src/core/errors.ts b/packages/auth/src/core/errors.ts index 9494658b9f0..0e7fb53059c 100644 --- a/packages/auth/src/core/errors.ts +++ b/packages/auth/src/core/errors.ts @@ -134,7 +134,8 @@ export const enum AuthErrorCode { INVALID_RECAPTCHA_VERSION = 'invalid-recaptcha-version', INVALID_REQ_TYPE = 'invalid-req-type', UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION = 'unsupported-password-policy-schema-version', - PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'password-does-not-meet-requirements' + PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'password-does-not-meet-requirements', + INVALID_HOSTING_LINK_DOMAIN = 'invalid-hosting-link-domain' } function _debugErrorMap(): ErrorMap { @@ -387,7 +388,10 @@ function _debugErrorMap(): ErrorMap { [AuthErrorCode.UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION]: 'The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.', [AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS]: - 'The password does not meet the requirements.' + 'The password does not meet the requirements.', + [AuthErrorCode.INVALID_HOSTING_LINK_DOMAIN]: + 'The provided Hosting link domain is not configured in Firebase Hosting or is not owned by ' + + 'the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`).' }; } @@ -598,5 +602,6 @@ export const AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = { MISSING_CLIENT_TYPE: 'auth/missing-client-type', MISSING_RECAPTCHA_VERSION: 'auth/missing-recaptcha-version', INVALID_RECAPTCHA_VERSION: 'auth/invalid-recaptcha-version', - INVALID_REQ_TYPE: 'auth/invalid-req-type' + INVALID_REQ_TYPE: 'auth/invalid-req-type', + INVALID_HOSTING_LINK_DOMAIN: 'auth/invalid-hosting-link-domain' } as const; diff --git a/packages/auth/src/core/strategies/action_code_settings.test.ts b/packages/auth/src/core/strategies/action_code_settings.test.ts index 36784151156..09bc672ee06 100644 --- a/packages/auth/src/core/strategies/action_code_settings.test.ts +++ b/packages/auth/src/core/strategies/action_code_settings.test.ts @@ -26,6 +26,10 @@ describe('core/strategies/action_code_settings', () => { let auth: TestAuth; const request: GetOobCodeRequest = {}; + const TEST_BUNDLE_ID = 'my-bundle'; + const TEST_FDL_DOMAIN = 'fdl-domain'; + const TEST_URL = 'my-url'; + beforeEach(async () => { auth = await testAuth(); }); @@ -35,10 +39,10 @@ describe('core/strategies/action_code_settings', () => { _setActionCodeSettingsOnRequest(auth, request, { handleCodeInApp: true, iOS: { - bundleId: 'my-bundle' + bundleId: TEST_BUNDLE_ID }, url: '', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: TEST_FDL_DOMAIN }) ).to.throw(FirebaseError, '(auth/invalid-continue-uri)'); }); @@ -48,9 +52,9 @@ describe('core/strategies/action_code_settings', () => { _setActionCodeSettingsOnRequest(auth, request, { handleCodeInApp: true, iOS: { - bundleId: 'my-´bundle' + bundleId: TEST_BUNDLE_ID }, - url: 'my-url' + url: TEST_URL }) ).to.not.throw(); }); @@ -60,14 +64,27 @@ describe('core/strategies/action_code_settings', () => { _setActionCodeSettingsOnRequest(auth, request, { handleCodeInApp: true, iOS: { - bundleId: 'my-´bundle' + bundleId: TEST_BUNDLE_ID }, - url: 'my-url', + url: TEST_URL, dynamicLinkDomain: '' }) ).to.throw(FirebaseError, '(auth/invalid-dynamic-link-domain)'); }); + it('should require a non empty Hosting link URL', () => { + expect(() => + _setActionCodeSettingsOnRequest(auth, request, { + handleCodeInApp: true, + iOS: { + bundleId: TEST_BUNDLE_ID + }, + url: TEST_URL, + linkDomain: '' + }) + ).to.throw(FirebaseError, '(auth/invalid-hosting-link-domain)'); + }); + it('should require a non-empty bundle ID', () => { expect(() => _setActionCodeSettingsOnRequest(auth, request, { @@ -75,8 +92,8 @@ describe('core/strategies/action_code_settings', () => { iOS: { bundleId: '' }, - url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + url: TEST_URL, + dynamicLinkDomain: TEST_FDL_DOMAIN }) ).to.throw(FirebaseError, '(auth/missing-ios-bundle-id)'); }); @@ -88,8 +105,8 @@ describe('core/strategies/action_code_settings', () => { android: { packageName: '' }, - url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + url: TEST_URL, + dynamicLinkDomain: TEST_FDL_DOMAIN }) ).to.throw(FirebaseError, '(auth/missing-android-pkg-name)'); }); diff --git a/packages/auth/src/core/strategies/action_code_settings.ts b/packages/auth/src/core/strategies/action_code_settings.ts index 4afa54f2ab3..e7e4c994838 100644 --- a/packages/auth/src/core/strategies/action_code_settings.ts +++ b/packages/auth/src/core/strategies/action_code_settings.ts @@ -37,9 +37,16 @@ export function _setActionCodeSettingsOnRequest( auth, AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN ); + _assert( + typeof actionCodeSettings.linkDomain === 'undefined' || + actionCodeSettings.linkDomain.length > 0, + auth, + AuthErrorCode.INVALID_HOSTING_LINK_DOMAIN + ); request.continueUrl = actionCodeSettings.url; request.dynamicLinkDomain = actionCodeSettings.dynamicLinkDomain; + request.linkDomain = actionCodeSettings.linkDomain; request.canHandleCodeInApp = actionCodeSettings.handleCodeInApp; if (actionCodeSettings.iOS) { diff --git a/packages/auth/src/core/strategies/email.test.ts b/packages/auth/src/core/strategies/email.test.ts index 85493a89aef..b2edc26ebb2 100644 --- a/packages/auth/src/core/strategies/email.test.ts +++ b/packages/auth/src/core/strategies/email.test.ts @@ -162,7 +162,8 @@ describe('core/strategies/sendEmailVerification', () => { bundleId: 'my-bundle' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ @@ -170,6 +171,7 @@ describe('core/strategies/sendEmailVerification', () => { idToken, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, iOSBundleId: 'my-bundle' }); @@ -190,13 +192,15 @@ describe('core/strategies/sendEmailVerification', () => { packageName: 'my-package' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ requestType: ActionCodeOperation.VERIFY_EMAIL, idToken, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, androidInstallApp: false, androidMinimumVersionCode: 'my-version', @@ -270,7 +274,8 @@ describe('core/strategies/verifyBeforeUpdateEmail', () => { bundleId: 'my-bundle' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ @@ -279,6 +284,7 @@ describe('core/strategies/verifyBeforeUpdateEmail', () => { newEmail, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, iOSBundleId: 'my-bundle' }); @@ -299,7 +305,8 @@ describe('core/strategies/verifyBeforeUpdateEmail', () => { packageName: 'my-package' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ requestType: ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL, @@ -307,6 +314,7 @@ describe('core/strategies/verifyBeforeUpdateEmail', () => { newEmail, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, androidInstallApp: false, androidMinimumVersionCode: 'my-version', diff --git a/packages/auth/src/core/strategies/email_and_password.test.ts b/packages/auth/src/core/strategies/email_and_password.test.ts index 047e86dc17f..e92f5abb32d 100644 --- a/packages/auth/src/core/strategies/email_and_password.test.ts +++ b/packages/auth/src/core/strategies/email_and_password.test.ts @@ -121,7 +121,8 @@ describe('core/strategies/sendPasswordResetEmail', () => { bundleId: 'my-bundle' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ @@ -129,6 +130,7 @@ describe('core/strategies/sendPasswordResetEmail', () => { email, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, iOSBundleId: 'my-bundle', clientType: 'CLIENT_TYPE_WEB' @@ -149,13 +151,15 @@ describe('core/strategies/sendPasswordResetEmail', () => { packageName: 'my-package' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ requestType: ActionCodeOperation.PASSWORD_RESET, email, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, androidInstallApp: false, androidMinimumVersionCode: 'my-version', diff --git a/packages/auth/src/core/strategies/email_link.test.ts b/packages/auth/src/core/strategies/email_link.test.ts index 97f8cdc7c7a..c58089bf497 100644 --- a/packages/auth/src/core/strategies/email_link.test.ts +++ b/packages/auth/src/core/strategies/email_link.test.ts @@ -124,7 +124,8 @@ describe('core/strategies/sendSignInLinkToEmail', () => { bundleId: 'my-bundle' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ @@ -132,6 +133,7 @@ describe('core/strategies/sendSignInLinkToEmail', () => { email, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, iOSBundleId: 'my-bundle', clientType: 'CLIENT_TYPE_WEB' @@ -152,13 +154,15 @@ describe('core/strategies/sendSignInLinkToEmail', () => { packageName: 'my-package' }, url: 'my-url', - dynamicLinkDomain: 'fdl-domain' + dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain' }); expect(mock.calls[0].request).to.eql({ requestType: ActionCodeOperation.EMAIL_SIGNIN, email, continueUrl: 'my-url', dynamicLinkDomain: 'fdl-domain', + linkDomain: 'hosting-link-domain', canHandleCodeInApp: true, androidInstallApp: false, androidMinimumVersionCode: 'my-version', diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index 07e56a6b9aa..ac1face6b6a 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -462,12 +462,7 @@ export interface ActionCodeSettings { * Sets the Android package name. * * @remarks - * This will try to open the link in an android app if it is - * installed. If `installApp` is passed, it specifies whether to install the Android app if the - * device supports it and the app is not already installed. If this field is provided without - * a `packageName`, an error is thrown explaining that the `packageName` must be provided in - * conjunction with this field. If `minimumVersion` is specified, and an older version of the - * app is installed, the user is taken to the Play Store to upgrade the app. + * This will try to open the link in an Android app if it is installed. */ android?: { installApp?: boolean; @@ -490,8 +485,6 @@ export interface ActionCodeSettings { * * @remarks * This will try to open the link in an iOS app if it is installed. - * - * App installation is not supported for iOS. */ iOS?: { bundleId: string; @@ -504,7 +497,7 @@ export interface ActionCodeSettings { * - When the link is handled in the web action widgets, this is the deep link in the * `continueUrl` query parameter. * - When the link is handled in the app directly, this is the `continueUrl` query parameter in - * the deep link of the Dynamic Link. + * the deep link of the Dynamic Link or Hosting link. */ url: string; /** @@ -513,8 +506,20 @@ export interface ActionCodeSettings { * * * @defaultValue The first domain is automatically selected. + * + * @deprecated Firebase Dynamic Links is deprecated and will be shut down as early as August + * 2025. Instead, use {@link ActionCodeSettings.linkDomain} to set a custom domain for mobile + * links. Learn more in the {@link https://firebase.google.com/support/dynamic-links-faq | Dynamic Links deprecation FAQ}. */ dynamicLinkDomain?: string; + /** + * The optional custom Firebase Hosting domain to use when the link is to be opened via + * a specified mobile app. The domain must be configured in Firebase Hosting and owned + * by the project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`). + * + * @defaultValue The default Hosting domain will be used (for example, `example.firebaseapp.com`). + */ + linkDomain?: string; } /** diff --git a/packages/auth/test/integration/flows/hosting_link.test.ts b/packages/auth/test/integration/flows/hosting_link.test.ts new file mode 100644 index 00000000000..7de8e29f534 --- /dev/null +++ b/packages/auth/test/integration/flows/hosting_link.test.ts @@ -0,0 +1,106 @@ +/** + * @license + * Copyright 2025 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. + */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { + ActionCodeSettings, + Auth, + sendSignInLinkToEmail +} from '@firebase/auth'; +import { expect, use } from 'chai'; +import { + cleanUpTestInstance, + getTestInstance, + randomEmail +} from '../../helpers/integration/helpers'; +import { getEmulatorUrl } from '../../helpers/integration/settings'; +import chaiAsPromised from 'chai-as-promised'; +import { FirebaseError } from '@firebase/util'; + +use(chaiAsPromised); + +// Assumes mobileLinksConfig.domain is set as "HOSTING_DOMAIN" in the test GCP-project. +describe('Integration test: hosting link validation', () => { + let auth: Auth; + let email: string; + + const AUTHORIZED_CUSTOM_DOMAIN = 'localhost/action_code_return'; + const ANDROID_PACKAGE_NAME = 'com.google.firebase.test.thin'; + const BASE_SETTINGS: ActionCodeSettings = { + url: 'http://' + AUTHORIZED_CUSTOM_DOMAIN, + handleCodeInApp: true, + android: { packageName: ANDROID_PACKAGE_NAME } + }; + const VALID_LINK_DOMAIN = 'jscore-sandbox.testdomaindonotuse.com'; + const INVALID_LINK_DOMAIN = 'invalid.testdomaindonotuse.com'; + const INVALID_LINK_DOMAIN_ERROR = 'auth/invalid-hosting-link-domain'; + const TEST_TENANT_ID = 'passpol-tenant-d7hha'; + + beforeEach(function () { + auth = getTestInstance(); + email = randomEmail(); + + if (getEmulatorUrl()) { + this.skip(); + } + }); + + afterEach(async () => { + await cleanUpTestInstance(auth); + }); + + it('allows user to sign in with default firebase hosting link', async () => { + // Sends email link to user using default hosting link. + await sendSignInLinkToEmail(auth, email, BASE_SETTINGS); + }); + + it('allows user to sign in to a tenant with default firebase hosting link', async () => { + auth.tenantId = TEST_TENANT_ID; + // Sends email link to user using default hosting link. + await sendSignInLinkToEmail(auth, email, BASE_SETTINGS); + }); + + it('allows user to sign in with custom firebase hosting link', async () => { + // Sends email link to user using custom hosting link. + await sendSignInLinkToEmail(auth, email, { + ...BASE_SETTINGS, + linkDomain: VALID_LINK_DOMAIN + }); + }); + + it('allows user to sign in to a tenant with custom firebase hosting link', async () => { + // Sends email link to user using custom hosting link. + auth.tenantId = TEST_TENANT_ID; + await sendSignInLinkToEmail(auth, email, { + ...BASE_SETTINGS, + linkDomain: VALID_LINK_DOMAIN + }); + }); + + it('sign in with invalid firebase hosting link throws exception', async () => { + // Throws an exception while sening email link to user using invalid hosting link. + await expect( + sendSignInLinkToEmail(auth, email, { + ...BASE_SETTINGS, + linkDomain: INVALID_LINK_DOMAIN + }) + ).to.be.rejectedWith( + FirebaseError, + new RegExp('.*' + INVALID_LINK_DOMAIN_ERROR + '.*') + ); + }); +}); From 721e5a7e97db5d2136c8338e2522dd07dbc3a29e Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Wed, 5 Feb 2025 11:56:47 -0500 Subject: [PATCH 094/295] FIX: sort strings in UTF-8 encoded byte order (#8691) --- .changeset/spotty-trainers-lay.md | 6 + .../local/indexeddb_remote_document_cache.ts | 4 + packages/firestore/src/model/path.ts | 11 +- packages/firestore/src/model/values.ts | 10 +- packages/firestore/src/util/misc.ts | 16 ++ .../test/integration/api/database.test.ts | 195 ++++++++++++++++++ 6 files changed, 231 insertions(+), 11 deletions(-) create mode 100644 .changeset/spotty-trainers-lay.md diff --git a/.changeset/spotty-trainers-lay.md b/.changeset/spotty-trainers-lay.md new file mode 100644 index 00000000000..64c30a73e76 --- /dev/null +++ b/.changeset/spotty-trainers-lay.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Fixed a server and sdk mismatch in unicode string sorting. diff --git a/packages/firestore/src/local/indexeddb_remote_document_cache.ts b/packages/firestore/src/local/indexeddb_remote_document_cache.ts index b3d4658d53d..9b23c64fcf5 100644 --- a/packages/firestore/src/local/indexeddb_remote_document_cache.ts +++ b/packages/firestore/src/local/indexeddb_remote_document_cache.ts @@ -655,5 +655,9 @@ export function dbKeyComparator(l: DocumentKey, r: DocumentKey): number { return cmp; } + // TODO(b/329441702): Document IDs should be sorted by UTF-8 encoded byte + // order, but IndexedDB sorts strings lexicographically. Document ID + // comparison here still relies on primitive comparison to avoid mismatches + // observed in snapshot listeners with Unicode characters in documentIds return primitiveComparator(left[left.length - 1], right[right.length - 1]); } diff --git a/packages/firestore/src/model/path.ts b/packages/firestore/src/model/path.ts index 64cb0376a0e..e7aeb6f61cc 100644 --- a/packages/firestore/src/model/path.ts +++ b/packages/firestore/src/model/path.ts @@ -19,6 +19,7 @@ import { Integer } from '@firebase/webchannel-wrapper/bloom-blob'; import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; +import { primitiveComparator, compareUtf8Strings } from '../util/misc'; export const DOCUMENT_KEY_NAME = '__name__'; @@ -181,7 +182,7 @@ abstract class BasePath> { return comparison; } } - return Math.sign(p1.length - p2.length); + return primitiveComparator(p1.length, p2.length); } private static compareSegments(lhs: string, rhs: string): number { @@ -201,13 +202,7 @@ abstract class BasePath> { ); } else { // both non-numeric - if (lhs < rhs) { - return -1; - } - if (lhs > rhs) { - return 1; - } - return 0; + return compareUtf8Strings(lhs, rhs); } } diff --git a/packages/firestore/src/model/values.ts b/packages/firestore/src/model/values.ts index 1977767515e..2e3417e674f 100644 --- a/packages/firestore/src/model/values.ts +++ b/packages/firestore/src/model/values.ts @@ -25,7 +25,11 @@ import { Value } from '../protos/firestore_proto_api'; import { fail } from '../util/assert'; -import { arrayEquals, primitiveComparator } from '../util/misc'; +import { + arrayEquals, + primitiveComparator, + compareUtf8Strings +} from '../util/misc'; import { forEach, objectSize } from '../util/obj'; import { isNegativeZero } from '../util/types'; @@ -251,7 +255,7 @@ export function valueCompare(left: Value, right: Value): number { getLocalWriteTime(right) ); case TypeOrder.StringValue: - return primitiveComparator(left.stringValue!, right.stringValue!); + return compareUtf8Strings(left.stringValue!, right.stringValue!); case TypeOrder.BlobValue: return compareBlobs(left.bytesValue!, right.bytesValue!); case TypeOrder.RefValue: @@ -400,7 +404,7 @@ function compareMaps(left: MapValue, right: MapValue): number { rightKeys.sort(); for (let i = 0; i < leftKeys.length && i < rightKeys.length; ++i) { - const keyCompare = primitiveComparator(leftKeys[i], rightKeys[i]); + const keyCompare = compareUtf8Strings(leftKeys[i], rightKeys[i]); if (keyCompare !== 0) { return keyCompare; } diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index acaff77abb6..4a508553e75 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -74,6 +74,22 @@ export interface Equatable { isEqual(other: T): boolean; } +/** Compare strings in UTF-8 encoded byte order */ +export function compareUtf8Strings(left: string, right: string): number { + // Convert the string to UTF-8 encoded bytes + const encodedLeft = new TextEncoder().encode(left); + const encodedRight = new TextEncoder().encode(right); + + for (let i = 0; i < Math.min(encodedLeft.length, encodedRight.length); i++) { + const comparison = primitiveComparator(encodedLeft[i], encodedRight[i]); + if (comparison !== 0) { + return comparison; + } + } + + return primitiveComparator(encodedLeft.length, encodedRight.length); +} + export interface Iterable { forEach: (cb: (v: V) => void) => void; } diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 1cda49d9229..1304b7b4aba 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -2424,4 +2424,199 @@ apiDescribe('Database', persistence => { }); }); }); + + describe('Sort unicode strings', () => { + const expectedDocs = ['b', 'a', 'c', 'f', 'e', 'd', 'g']; + it('snapshot listener sorts unicode strings the same as server', async () => { + const testDocs = { + 'a': { value: 'Łukasiewicz' }, + 'b': { value: 'Sierpiński' }, + 'c': { value: '岩澤' }, + 'd': { value: '🄟' }, + 'e': { value: 'P' }, + 'f': { value: '︒' }, + 'g': { value: '🐵' } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in array the same as server', async () => { + const testDocs = { + 'a': { value: ['Łukasiewicz'] }, + 'b': { value: ['Sierpiński'] }, + 'c': { value: ['岩澤'] }, + 'd': { value: ['🄟'] }, + 'e': { value: ['P'] }, + 'f': { value: ['︒'] }, + 'g': { value: ['🐵'] } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in map the same as server', async () => { + const testDocs = { + 'a': { value: { foo: 'Łukasiewicz' } }, + 'b': { value: { foo: 'Sierpiński' } }, + 'c': { value: { foo: '岩澤' } }, + 'd': { value: { foo: '🄟' } }, + 'e': { value: { foo: 'P' } }, + 'f': { value: { foo: '︒' } }, + 'g': { value: { foo: '🐵' } } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in map key the same as server', async () => { + const testDocs = { + 'a': { value: { 'Łukasiewicz': true } }, + 'b': { value: { 'Sierpiński': true } }, + 'c': { value: { '岩澤': true } }, + 'd': { value: { '🄟': true } }, + 'e': { value: { 'P': true } }, + 'f': { value: { '︒': true } }, + 'g': { value: { '🐵': true } } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in document key the same as server', async () => { + const testDocs = { + 'Łukasiewicz': { value: true }, + 'Sierpiński': { value: true }, + '岩澤': { value: true }, + '🄟': { value: true }, + 'P': { value: true }, + '︒': { value: true }, + '🐵': { value: true } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy(documentId())); + + const getSnapshot = await getDocsFromServer(orderedQuery); + const expectedDocs = [ + 'Sierpiński', + 'Łukasiewicz', + '岩澤', + '︒', + 'P', + '🄟', + '🐵' + ]; + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + // eslint-disable-next-line no-restricted-properties + (persistence.storage === 'indexeddb' ? it.skip : it)( + 'snapshot listener sorts unicode strings in document key the same as server with persistence', + async () => { + const testDocs = { + 'Łukasiewicz': { value: true }, + 'Sierpiński': { value: true }, + '岩澤': { value: true }, + '🄟': { value: true }, + 'P': { value: true }, + '︒': { value: true }, + '🐵': { value: true } + }; + + return withTestCollection( + persistence, + testDocs, + async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal([ + 'Sierpiński', + 'Łukasiewicz', + '岩澤', + '︒', + 'P', + '🄟', + '🐵' + ]); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + // TODO: IndexedDB sorts string lexicographically, and misses the document with ID '🄟','🐵' + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + } + ); + } + ); + }); }); From 313faf66b88ac5ff60a6301b58bd3b9a71ffe74e Mon Sep 17 00:00:00 2001 From: Stephen Rosa <84193009+stephenarosaj@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:59:33 -0800 Subject: [PATCH 095/295] Added more granular tracking for web frameworks --- .changeset/little-news-sniff.md | 6 + common/api-review/data-connect.api.md | 13 ++ packages/data-connect/src/api/DataConnect.ts | 17 ++- packages/data-connect/src/network/fetch.ts | 19 ++- .../src/network/transport/index.ts | 24 +++- .../src/network/transport/rest.ts | 15 ++- packages/data-connect/test/unit/fetch.test.ts | 121 ++++++++++++++++-- 7 files changed, 195 insertions(+), 20 deletions(-) create mode 100644 .changeset/little-news-sniff.md diff --git a/.changeset/little-news-sniff.md b/.changeset/little-news-sniff.md new file mode 100644 index 00000000000..79ec737d119 --- /dev/null +++ b/.changeset/little-news-sniff.md @@ -0,0 +1,6 @@ +--- +'@firebase/data-connect': minor +'firebase': minor +--- + +Add custom request headers based on the type of SDK (JS/TS, React, Angular, etc) that's invoking Data Connect requests. This will help us understand how users interact with Data Connect when using the Web SDK. \ No newline at end of file diff --git a/common/api-review/data-connect.api.md b/common/api-review/data-connect.api.md index 952d8b4dc10..1a698c229b4 100644 --- a/common/api-review/data-connect.api.md +++ b/common/api-review/data-connect.api.md @@ -11,6 +11,19 @@ import { FirebaseError } from '@firebase/util'; import { LogLevelString } from '@firebase/logger'; import { Provider } from '@firebase/component'; +// @public +export type CallerSdkType = 'Base' | 'Generated' | 'TanstackReactCore' | 'GeneratedReact' | 'TanstackAngularCore' | 'GeneratedAngular'; + +// @public (undocumented) +export const CallerSdkTypeEnum: { + readonly Base: "Base"; + readonly Generated: "Generated"; + readonly TanstackReactCore: "TanstackReactCore"; + readonly GeneratedReact: "GeneratedReact"; + readonly TanstackAngularCore: "TanstackAngularCore"; + readonly GeneratedAngular: "GeneratedAngular"; +}; + // @public export function connectDataConnectEmulator(dc: DataConnect, host: string, port?: number, sslEnabled?: boolean): void; diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index 53eb0c97ed5..dc170809143 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -33,7 +33,12 @@ import { } from '../core/FirebaseAuthProvider'; import { QueryManager } from '../core/QueryManager'; import { logDebug, logError } from '../logger'; -import { DataConnectTransport, TransportClass } from '../network'; +import { + CallerSdkType, + CallerSdkTypeEnum, + DataConnectTransport, + TransportClass +} from '../network'; import { RESTTransport } from '../network/transport/rest'; import { MutationManager } from './Mutation'; @@ -92,6 +97,7 @@ export class DataConnect { private _transportOptions?: TransportOptions; private _authTokenProvider?: AuthTokenProvider; _isUsingGeneratedSdk: boolean = false; + _callerSdkType: CallerSdkType = CallerSdkTypeEnum.Base; private _appCheckTokenProvider?: AppCheckTokenProvider; // @internal constructor( @@ -116,6 +122,12 @@ export class DataConnect { this._isUsingGeneratedSdk = true; } } + _setCallerSdkType(callerSdkType: CallerSdkType): void { + this._callerSdkType = callerSdkType; + if (this._initialized) { + this._transport._setCallerSdkType(callerSdkType); + } + } _delete(): Promise { _removeServiceInstance( this.app, @@ -164,7 +176,8 @@ export class DataConnect { this._authTokenProvider, this._appCheckTokenProvider, undefined, - this._isUsingGeneratedSdk + this._isUsingGeneratedSdk, + this._callerSdkType ); if (this._transportOptions) { this._transport.useEmulator( diff --git a/packages/data-connect/src/network/fetch.ts b/packages/data-connect/src/network/fetch.ts index d5d2a439432..166422ca14c 100644 --- a/packages/data-connect/src/network/fetch.ts +++ b/packages/data-connect/src/network/fetch.ts @@ -19,13 +19,23 @@ import { Code, DataConnectError } from '../core/error'; import { SDK_VERSION } from '../core/version'; import { logDebug, logError } from '../logger'; +import { CallerSdkType, CallerSdkTypeEnum } from './transport'; + let connectFetch: typeof fetch | null = globalThis.fetch; export function initializeFetch(fetchImpl: typeof fetch): void { connectFetch = fetchImpl; } -function getGoogApiClientValue(_isUsingGen: boolean): string { +function getGoogApiClientValue( + _isUsingGen: boolean, + _callerSdkType: CallerSdkType +): string { let str = 'gl-js/ fire/' + SDK_VERSION; - if (_isUsingGen) { + if ( + _callerSdkType !== CallerSdkTypeEnum.Base && + _callerSdkType !== CallerSdkTypeEnum.Generated + ) { + str += ' js/' + _callerSdkType.toLowerCase(); + } else if (_isUsingGen || _callerSdkType === CallerSdkTypeEnum.Generated) { str += ' js/gen'; } return str; @@ -42,14 +52,15 @@ export function dcFetch( appId: string | null, accessToken: string | null, appCheckToken: string | null, - _isUsingGen: boolean + _isUsingGen: boolean, + _callerSdkType: CallerSdkType ): Promise<{ data: T; errors: Error[] }> { if (!connectFetch) { throw new DataConnectError(Code.OTHER, 'No Fetch Implementation detected!'); } const headers: HeadersInit = { 'Content-Type': 'application/json', - 'X-Goog-Api-Client': getGoogApiClientValue(_isUsingGen) + 'X-Goog-Api-Client': getGoogApiClientValue(_isUsingGen, _callerSdkType) }; if (accessToken) { headers['X-Firebase-Auth-Token'] = accessToken; diff --git a/packages/data-connect/src/network/transport/index.ts b/packages/data-connect/src/network/transport/index.ts index f4bb801f9b3..8b106b4d636 100644 --- a/packages/data-connect/src/network/transport/index.ts +++ b/packages/data-connect/src/network/transport/index.ts @@ -19,6 +19,26 @@ import { DataConnectOptions, TransportOptions } from '../../api/DataConnect'; import { AppCheckTokenProvider } from '../../core/AppCheckTokenProvider'; import { AuthTokenProvider } from '../../core/FirebaseAuthProvider'; +/** + * enum representing different flavors of the SDK used by developers + * use the CallerSdkType for type-checking, and the CallerSdkTypeEnum for value-checking/assigning + */ +export type CallerSdkType = + | 'Base' // Core JS SDK + | 'Generated' // Generated JS SDK + | 'TanstackReactCore' // Tanstack non-generated React SDK + | 'GeneratedReact' // Generated React SDK + | 'TanstackAngularCore' // Tanstack non-generated Angular SDK + | 'GeneratedAngular'; // Generated Angular SDK +export const CallerSdkTypeEnum = { + Base: 'Base', // Core JS SDK + Generated: 'Generated', // Generated JS SDK + TanstackReactCore: 'TanstackReactCore', // Tanstack non-generated React SDK + GeneratedReact: 'GeneratedReact', // Tanstack non-generated Angular SDK + TanstackAngularCore: 'TanstackAngularCore', // Tanstack non-generated Angular SDK + GeneratedAngular: 'GeneratedAngular' // Generated Angular SDK +} as const; + /** * @internal */ @@ -33,6 +53,7 @@ export interface DataConnectTransport { ): Promise<{ data: T; errors: Error[] }>; useEmulator(host: string, port?: number, sslEnabled?: boolean): void; onTokenChanged: (token: string | null) => void; + _setCallerSdkType(callerSdkType: CallerSdkType): void; } /** @@ -45,5 +66,6 @@ export type TransportClass = new ( authProvider?: AuthTokenProvider, appCheckProvider?: AppCheckTokenProvider, transportOptions?: TransportOptions, - _isUsingGen?: boolean + _isUsingGen?: boolean, + _callerSdkType?: CallerSdkType ) => DataConnectTransport; diff --git a/packages/data-connect/src/network/transport/rest.ts b/packages/data-connect/src/network/transport/rest.ts index 7c8500b733d..0663bc026db 100644 --- a/packages/data-connect/src/network/transport/rest.ts +++ b/packages/data-connect/src/network/transport/rest.ts @@ -23,7 +23,7 @@ import { logDebug } from '../../logger'; import { addToken, urlBuilder } from '../../util/url'; import { dcFetch } from '../fetch'; -import { DataConnectTransport } from '.'; +import { CallerSdkType, CallerSdkTypeEnum, DataConnectTransport } from '.'; export class RESTTransport implements DataConnectTransport { private _host = ''; @@ -43,7 +43,8 @@ export class RESTTransport implements DataConnectTransport { private authProvider?: AuthTokenProvider | undefined, private appCheckProvider?: AppCheckTokenProvider | undefined, transportOptions?: TransportOptions | undefined, - private _isUsingGen = false + private _isUsingGen = false, + private _callerSdkType: CallerSdkType = CallerSdkTypeEnum.Base ) { if (transportOptions) { if (typeof transportOptions.port === 'number') { @@ -180,7 +181,8 @@ export class RESTTransport implements DataConnectTransport { this.appId, this._accessToken, this._appCheckToken, - this._isUsingGen + this._isUsingGen, + this._callerSdkType ) ); return withAuth; @@ -205,9 +207,14 @@ export class RESTTransport implements DataConnectTransport { this.appId, this._accessToken, this._appCheckToken, - this._isUsingGen + this._isUsingGen, + this._callerSdkType ); }); return taskResult; }; + + _setCallerSdkType(callerSdkType: CallerSdkType): void { + this._callerSdkType = callerSdkType; + } } diff --git a/packages/data-connect/test/unit/fetch.test.ts b/packages/data-connect/test/unit/fetch.test.ts index 3d9a9b04523..599260f8b10 100644 --- a/packages/data-connect/test/unit/fetch.test.ts +++ b/packages/data-connect/test/unit/fetch.test.ts @@ -20,25 +20,30 @@ import chaiAsPromised from 'chai-as-promised'; import * as sinon from 'sinon'; import { dcFetch, initializeFetch } from '../../src/network/fetch'; +import { CallerSdkType, CallerSdkTypeEnum } from '../../src/network/transport'; use(chaiAsPromised); -function mockFetch(json: object): void { +function mockFetch(json: object, reject: boolean): sinon.SinonStub { const fakeFetchImpl = sinon.stub().returns( Promise.resolve({ json: () => { return Promise.resolve(json); }, - status: 401 + status: reject ? 401 : 200 } as Response) ); initializeFetch(fakeFetchImpl); + return fakeFetchImpl; } describe('fetch', () => { it('should throw an error with just the message when the server responds with an error with a message property in the body', async () => { const message = 'Failed to connect to Postgres instance'; - mockFetch({ - code: 401, - message - }); + mockFetch( + { + code: 401, + message + }, + true + ); await expect( dcFetch( 'http://localhost', @@ -51,7 +56,8 @@ describe('fetch', () => { null, null, null, - false + false, + CallerSdkTypeEnum.Base ) ).to.eventually.be.rejectedWith(message); }); @@ -61,7 +67,7 @@ describe('fetch', () => { code: 401, message1: message }; - mockFetch(json); + mockFetch(json, true); await expect( dcFetch( 'http://localhost', @@ -74,8 +80,105 @@ describe('fetch', () => { null, null, null, - false + false, + CallerSdkTypeEnum.Base ) ).to.eventually.be.rejectedWith(JSON.stringify(json)); }); + it('should assign different values to custom headers based on the _callerSdkType argument (_isUsingGen is false)', async () => { + const json = { + code: 200, + message1: 'success' + }; + const fakeFetchImpl = mockFetch(json, false); + + for (const callerSdkType in CallerSdkTypeEnum) { + // this check is done to follow the best practices outlined by the "guard-for-in" eslint rule + if ( + Object.prototype.hasOwnProperty.call(CallerSdkTypeEnum, callerSdkType) + ) { + await dcFetch( + 'http://localhost', + { + name: 'n', + operationName: 'n', + variables: {} + }, + {} as AbortController, + null, + null, + null, + false, // _isUsingGen is false + callerSdkType as CallerSdkType + ); + + let expectedHeaderRegex: RegExp; + if (callerSdkType === CallerSdkTypeEnum.Base) { + // should not contain any "js/xxx" substring + expectedHeaderRegex = RegExp(/^((?!js\/\w).)*$/); + } else if (callerSdkType === CallerSdkTypeEnum.Generated) { + expectedHeaderRegex = RegExp(/js\/gen/); + } else { + expectedHeaderRegex = RegExp(`js\/${callerSdkType.toLowerCase()}`); + } + expect( + fakeFetchImpl.calledWithMatch( + 'http://localhost', + sinon.match.hasNested( + 'headers.X-Goog-Api-Client', + sinon.match(expectedHeaderRegex) + ) + ) + ).to.be.true; + } + } + }); + it('should assign custom headers based on _callerSdkType before checking to-be-deprecated _isUsingGen', async () => { + const json = { + code: 200, + message1: 'success' + }; + const fakeFetchImpl = mockFetch(json, false); + + for (const callerSdkType in CallerSdkTypeEnum) { + // this check is done to follow the best practices outlined by the "guard-for-in" eslint rule + if ( + Object.prototype.hasOwnProperty.call(CallerSdkTypeEnum, callerSdkType) + ) { + await dcFetch( + 'http://localhost', + { + name: 'n', + operationName: 'n', + variables: {} + }, + {} as AbortController, + null, + null, + null, + true, // _isUsingGen is true + callerSdkType as CallerSdkType + ); + + let expectedHeaderRegex: RegExp; + if ( + callerSdkType === CallerSdkTypeEnum.Generated || + callerSdkType === CallerSdkTypeEnum.Base + ) { + expectedHeaderRegex = RegExp(`js\/gen`); + } else { + expectedHeaderRegex = RegExp(`js\/${callerSdkType.toLowerCase()}`); + } + expect( + fakeFetchImpl.calledWithMatch( + 'http://localhost', + sinon.match.hasNested( + 'headers.X-Goog-Api-Client', + sinon.match(expectedHeaderRegex) + ) + ) + ).to.be.true; + } + } + }); }); From 5250e80066e07542e12f9c36813943a6ef99af90 Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:58:13 -0500 Subject: [PATCH 096/295] fix "TextEncoder undefined" issue in some platforms (#8765) --- packages/firestore/src/util/misc.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index 4a508553e75..6af1238398e 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -16,6 +16,7 @@ */ import { randomBytes } from '../platform/random_bytes'; +import { newTextEncoder } from '../platform/text_serializer'; import { debugAssert } from './assert'; @@ -77,8 +78,8 @@ export interface Equatable { /** Compare strings in UTF-8 encoded byte order */ export function compareUtf8Strings(left: string, right: string): number { // Convert the string to UTF-8 encoded bytes - const encodedLeft = new TextEncoder().encode(left); - const encodedRight = new TextEncoder().encode(right); + const encodedLeft = newTextEncoder().encode(left); + const encodedRight = newTextEncoder().encode(right); for (let i = 0; i < Math.min(encodedLeft.length, encodedRight.length); i++) { const comparison = primitiveComparator(encodedLeft[i], encodedRight[i]); From 4e6a5c67017f0f390f55867926c4098fe13476be Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 6 Feb 2025 12:15:07 -0800 Subject: [PATCH 097/295] Version Packages (#8766) Co-authored-by: github-actions[bot] --- .changeset/chilled-clocks-remember.md | 6 ---- .changeset/kind-dingos-work.md | 6 ---- .changeset/kind-pets-sin.md | 15 --------- .changeset/little-news-sniff.md | 6 ---- .changeset/polite-lies-vanish.md | 7 ---- .changeset/spotty-trainers-lay.md | 6 ---- .changeset/yellow-rice-kneel.md | 5 --- integration/compat-interop/package.json | 16 ++++----- integration/firestore/package.json | 4 +-- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 ++++ packages/app-compat/package.json | 4 +-- packages/app/CHANGELOG.md | 12 +++++++ packages/app/package.json | 2 +- packages/auth-compat/CHANGELOG.md | 8 +++++ packages/auth-compat/package.json | 8 ++--- packages/auth-types/CHANGELOG.md | 6 ++++ packages/auth-types/package.json | 2 +- packages/auth/CHANGELOG.md | 12 +++++++ packages/auth/package.json | 4 +-- packages/data-connect/CHANGELOG.md | 12 +++++++ packages/data-connect/package.json | 4 +-- packages/database-compat/CHANGELOG.md | 7 ++++ packages/database-compat/package.json | 6 ++-- packages/database/CHANGELOG.md | 10 ++++++ packages/database/package.json | 4 +-- packages/firebase/CHANGELOG.md | 38 ++++++++++++++++++++++ packages/firebase/package.json | 34 +++++++++---------- packages/firestore-compat/CHANGELOG.md | 7 ++++ packages/firestore-compat/package.json | 6 ++-- packages/firestore/CHANGELOG.md | 10 ++++++ packages/firestore/package.json | 8 ++--- packages/functions-compat/CHANGELOG.md | 7 ++++ packages/functions-compat/package.json | 6 ++-- packages/functions/CHANGELOG.md | 8 +++++ packages/functions/package.json | 4 +-- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/CHANGELOG.md | 7 ++++ packages/performance-compat/package.json | 6 ++-- packages/performance/CHANGELOG.md | 6 ++++ packages/performance/package.json | 12 ++++--- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/CHANGELOG.md | 7 ++++ packages/storage-compat/package.json | 8 ++--- packages/storage/CHANGELOG.md | 8 +++++ packages/storage/package.json | 6 ++-- packages/template/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 +++++ packages/vertexai/package.json | 4 +-- repo-scripts/size-analysis/package.json | 2 +- 58 files changed, 269 insertions(+), 136 deletions(-) delete mode 100644 .changeset/chilled-clocks-remember.md delete mode 100644 .changeset/kind-dingos-work.md delete mode 100644 .changeset/kind-pets-sin.md delete mode 100644 .changeset/little-news-sniff.md delete mode 100644 .changeset/polite-lies-vanish.md delete mode 100644 .changeset/spotty-trainers-lay.md delete mode 100644 .changeset/yellow-rice-kneel.md diff --git a/.changeset/chilled-clocks-remember.md b/.changeset/chilled-clocks-remember.md deleted file mode 100644 index cbc0ec71a1f..00000000000 --- a/.changeset/chilled-clocks-remember.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@firebase/database": patch -'firebase': patch ---- - -Fix a potential for a negative offset when calculating last reconnect times. This could cause lengthy reconnect delays in some scenarios. Fixes #8718. diff --git a/.changeset/kind-dingos-work.md b/.changeset/kind-dingos-work.md deleted file mode 100644 index 486a6dfb6cf..00000000000 --- a/.changeset/kind-dingos-work.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/performance': minor -'firebase': minor ---- - -Collect web vital metrics (INP,CLS,LCP) as part of page load event. diff --git a/.changeset/kind-pets-sin.md b/.changeset/kind-pets-sin.md deleted file mode 100644 index 7debbf4b220..00000000000 --- a/.changeset/kind-pets-sin.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@firebase/app': minor -'firebase': minor -'@firebase/data-connect': patch -'@firebase/firestore': patch -'@firebase/functions': patch -'@firebase/database': patch -'@firebase/vertexai': patch -'@firebase/storage': patch -'@firebase/auth': patch ---- - -`FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check -`getToken` method. This should unblock the use of App Check enforced products in SSR environments -where the App Check SDK cannot be initialized. diff --git a/.changeset/little-news-sniff.md b/.changeset/little-news-sniff.md deleted file mode 100644 index 79ec737d119..00000000000 --- a/.changeset/little-news-sniff.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/data-connect': minor -'firebase': minor ---- - -Add custom request headers based on the type of SDK (JS/TS, React, Angular, etc) that's invoking Data Connect requests. This will help us understand how users interact with Data Connect when using the Web SDK. \ No newline at end of file diff --git a/.changeset/polite-lies-vanish.md b/.changeset/polite-lies-vanish.md deleted file mode 100644 index 698359235e2..00000000000 --- a/.changeset/polite-lies-vanish.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'firebase': minor -'@firebase/auth-types': minor -'@firebase/auth': minor ---- - -Added `ActionCodeSettings.linkDomain` to customize the Firebase Hosting link domain that is used in mobile out-of-band email action flows. Also, deprecated `ActionCodeSettings.dynamicLinkDomain`. diff --git a/.changeset/spotty-trainers-lay.md b/.changeset/spotty-trainers-lay.md deleted file mode 100644 index 64c30a73e76..00000000000 --- a/.changeset/spotty-trainers-lay.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Fixed a server and sdk mismatch in unicode string sorting. diff --git a/.changeset/yellow-rice-kneel.md b/.changeset/yellow-rice-kneel.md deleted file mode 100644 index 66bf4c41307..00000000000 --- a/.changeset/yellow-rice-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/app': patch ---- - -Discard the earliest heartbeat once a limit of 30 heartbeats in storage has been hit. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 6b49f769766..4ee442f9e3e 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,18 +8,18 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.10.18", - "@firebase/app-compat": "0.2.48", + "@firebase/app": "0.11.0", + "@firebase/app-compat": "0.2.49", "@firebase/analytics": "0.10.11", "@firebase/analytics-compat": "0.2.17", - "@firebase/auth": "1.8.2", - "@firebase/auth-compat": "0.5.17", - "@firebase/functions": "0.12.1", - "@firebase/functions-compat": "0.3.18", + "@firebase/auth": "1.9.0", + "@firebase/auth-compat": "0.5.18", + "@firebase/functions": "0.12.2", + "@firebase/functions-compat": "0.3.19", "@firebase/messaging": "0.12.16", "@firebase/messaging-compat": "0.2.16", - "@firebase/performance": "0.6.12", - "@firebase/performance-compat": "0.2.12", + "@firebase/performance": "0.7.0", + "@firebase/performance-compat": "0.2.13", "@firebase/remote-config": "0.5.0", "@firebase/remote-config-compat": "0.2.12" }, diff --git a/integration/firestore/package.json b/integration/firestore/package.json index b02f3677ac0..9f4913959c3 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.10.18", - "@firebase/firestore": "4.7.6" + "@firebase/app": "0.11.0", + "@firebase/firestore": "4.7.7" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index f3863666d9a..aa2e37d3a35 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.2.0", + "firebase": "11.3.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 0001d69fe1f..16af74ca4d4 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 9f8d16692d9..d72382771e1 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 15d8a1776e4..67bf4a05c88 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 16a980e8314..f2019186753 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index da8e8495229..7e217f946f0 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.49 + +### Patch Changes + +- Updated dependencies [[`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a), [`dafae52`](https://github.com/firebase/firebase-js-sdk/commit/dafae52afda0b653a763b071960ee87010a63aa1)]: + - @firebase/app@0.11.0 + ## 0.2.48 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 72cf92ba5e1..a5cb36159ec 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.48", + "version": "0.2.49", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.12", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 8f9b1f24fff..a1c3d499f04 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app +## 0.11.0 + +### Minor Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + +### Patch Changes + +- [`dafae52`](https://github.com/firebase/firebase-js-sdk/commit/dafae52afda0b653a763b071960ee87010a63aa1) [#8724](https://github.com/firebase/firebase-js-sdk/pull/8724) - Discard the earliest heartbeat once a limit of 30 heartbeats in storage has been hit. + ## 0.10.18 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 16802129b80..66815fac527 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.10.18", + "version": "0.11.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 0e0af27931b..f09d93284f0 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth-compat +## 0.5.18 + +### Patch Changes + +- Updated dependencies [[`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a), [`9d88e3a`](https://github.com/firebase/firebase-js-sdk/commit/9d88e3a85a7253694dd7cf58d7eb834e41af2b79)]: + - @firebase/auth@1.9.0 + - @firebase/auth-types@0.13.0 + ## 0.5.17 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index bde63677936..1a1d2060304 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.17", + "version": "0.5.18", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.8.2", - "@firebase/auth-types": "0.12.3", + "@firebase/auth": "1.9.0", + "@firebase/auth-types": "0.13.0", "@firebase/component": "0.6.12", "@firebase/util": "1.10.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth-types/CHANGELOG.md b/packages/auth-types/CHANGELOG.md index b36e792b01c..16781f8b14a 100644 --- a/packages/auth-types/CHANGELOG.md +++ b/packages/auth-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/auth-types +## 0.13.0 + +### Minor Changes + +- [`9d88e3a`](https://github.com/firebase/firebase-js-sdk/commit/9d88e3a85a7253694dd7cf58d7eb834e41af2b79) [#8738](https://github.com/firebase/firebase-js-sdk/pull/8738) - Added `ActionCodeSettings.linkDomain` to customize the Firebase Hosting link domain that is used in mobile out-of-band email action flows. Also, deprecated `ActionCodeSettings.dynamicLinkDomain`. + ## 0.12.3 ### Patch Changes diff --git a/packages/auth-types/package.json b/packages/auth-types/package.json index 9b5191b3b44..66dced1d568 100644 --- a/packages/auth-types/package.json +++ b/packages/auth-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-types", - "version": "0.12.3", + "version": "0.13.0", "description": "@firebase/auth Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 32fe097263f..4787c31e154 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/auth +## 1.9.0 + +### Minor Changes + +- [`9d88e3a`](https://github.com/firebase/firebase-js-sdk/commit/9d88e3a85a7253694dd7cf58d7eb834e41af2b79) [#8738](https://github.com/firebase/firebase-js-sdk/pull/8738) - Added `ActionCodeSettings.linkDomain` to customize the Firebase Hosting link domain that is used in mobile out-of-band email action flows. Also, deprecated `ActionCodeSettings.dynamicLinkDomain`. + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 1.8.2 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index cfaed2c5000..8852857073e 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.8.2", + "version": "1.9.0", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index a871298f86b..8f0751043f0 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,17 @@ ## Unreleased +## 0.3.0 + +### Minor Changes + +- [`313faf6`](https://github.com/firebase/firebase-js-sdk/commit/313faf66b88ac5ff60a6301b58bd3b9a71ffe74e) [#8749](https://github.com/firebase/firebase-js-sdk/pull/8749) - Add custom request headers based on the type of SDK (JS/TS, React, Angular, etc) that's invoking Data Connect requests. This will help us understand how users interact with Data Connect when using the Web SDK. + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 0.2.0 ### Minor Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 567c44ecf8a..acbe1a6ab22 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.2.0", + "version": "0.3.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 1b99a153c1d..1e95bf2748a 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-compat +## 2.0.3 + +### Patch Changes + +- Updated dependencies [[`01f36ea`](https://github.com/firebase/firebase-js-sdk/commit/01f36ea41011fdd6ec77e4b1a799193bef58aa91), [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a)]: + - @firebase/database@1.0.12 + ## 2.0.2 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index cf4ad024941..26147f1b83b 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.2", + "version": "2.0.3", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,7 +49,7 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.11", + "@firebase/database": "1.0.12", "@firebase/database-types": "1.0.8", "@firebase/logger": "0.4.4", "@firebase/util": "1.10.3", @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index dc5f274533f..87c8c487326 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,15 @@ # Unreleased +## 1.0.12 + +### Patch Changes + +- [`01f36ea`](https://github.com/firebase/firebase-js-sdk/commit/01f36ea41011fdd6ec77e4b1a799193bef58aa91) [#8719](https://github.com/firebase/firebase-js-sdk/pull/8719) - Fix a potential for a negative offset when calculating last reconnect times. This could cause lengthy reconnect delays in some scenarios. Fixes #8718. + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 1.0.11 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index aa357464c69..5e15f2bc657 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.11", + "version": "1.0.12", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 7e0722d604a..f90bd18e76e 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,43 @@ # firebase +## 11.3.0 + +### Minor Changes + +- [`2ec1c76`](https://github.com/firebase/firebase-js-sdk/commit/2ec1c768271b8432ef15fc4ba46e825ee15f3ee1) [#8644](https://github.com/firebase/firebase-js-sdk/pull/8644) - Collect web vital metrics (INP,CLS,LCP) as part of page load event. + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + +- [`313faf6`](https://github.com/firebase/firebase-js-sdk/commit/313faf66b88ac5ff60a6301b58bd3b9a71ffe74e) [#8749](https://github.com/firebase/firebase-js-sdk/pull/8749) - Add custom request headers based on the type of SDK (JS/TS, React, Angular, etc) that's invoking Data Connect requests. This will help us understand how users interact with Data Connect when using the Web SDK. + +- [`9d88e3a`](https://github.com/firebase/firebase-js-sdk/commit/9d88e3a85a7253694dd7cf58d7eb834e41af2b79) [#8738](https://github.com/firebase/firebase-js-sdk/pull/8738) - Added `ActionCodeSettings.linkDomain` to customize the Firebase Hosting link domain that is used in mobile out-of-band email action flows. Also, deprecated `ActionCodeSettings.dynamicLinkDomain`. + +### Patch Changes + +- [`01f36ea`](https://github.com/firebase/firebase-js-sdk/commit/01f36ea41011fdd6ec77e4b1a799193bef58aa91) [#8719](https://github.com/firebase/firebase-js-sdk/pull/8719) - Fix a potential for a negative offset when calculating last reconnect times. This could cause lengthy reconnect delays in some scenarios. Fixes #8718. + +- [`721e5a7`](https://github.com/firebase/firebase-js-sdk/commit/721e5a7e97db5d2136c8338e2522dd07dbc3a29e) [#8691](https://github.com/firebase/firebase-js-sdk/pull/8691) - Fixed a server and sdk mismatch in unicode string sorting. + +- Updated dependencies [[`01f36ea`](https://github.com/firebase/firebase-js-sdk/commit/01f36ea41011fdd6ec77e4b1a799193bef58aa91), [`2ec1c76`](https://github.com/firebase/firebase-js-sdk/commit/2ec1c768271b8432ef15fc4ba46e825ee15f3ee1), [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a), [`313faf6`](https://github.com/firebase/firebase-js-sdk/commit/313faf66b88ac5ff60a6301b58bd3b9a71ffe74e), [`9d88e3a`](https://github.com/firebase/firebase-js-sdk/commit/9d88e3a85a7253694dd7cf58d7eb834e41af2b79), [`721e5a7`](https://github.com/firebase/firebase-js-sdk/commit/721e5a7e97db5d2136c8338e2522dd07dbc3a29e), [`dafae52`](https://github.com/firebase/firebase-js-sdk/commit/dafae52afda0b653a763b071960ee87010a63aa1)]: + - @firebase/database@1.0.12 + - @firebase/performance@0.7.0 + - @firebase/app@0.11.0 + - @firebase/data-connect@0.3.0 + - @firebase/firestore@4.7.7 + - @firebase/functions@0.12.2 + - @firebase/vertexai@1.0.4 + - @firebase/storage@0.13.6 + - @firebase/auth@1.9.0 + - @firebase/database-compat@2.0.3 + - @firebase/performance-compat@0.2.13 + - @firebase/app-compat@0.2.49 + - @firebase/firestore-compat@0.3.42 + - @firebase/functions-compat@0.3.19 + - @firebase/storage-compat@0.3.16 + - @firebase/auth-compat@0.5.18 + ## 11.2.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index cab75ad6e28..e6b40af2ca5 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.2.0", + "version": "11.3.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,26 +399,26 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.10.18", - "@firebase/app-compat": "0.2.48", + "@firebase/app": "0.11.0", + "@firebase/app-compat": "0.2.49", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.8.2", - "@firebase/auth-compat": "0.5.17", - "@firebase/data-connect": "0.2.0", - "@firebase/database": "1.0.11", - "@firebase/database-compat": "2.0.2", - "@firebase/firestore": "4.7.6", - "@firebase/firestore-compat": "0.3.41", - "@firebase/functions": "0.12.1", - "@firebase/functions-compat": "0.3.18", + "@firebase/auth": "1.9.0", + "@firebase/auth-compat": "0.5.18", + "@firebase/data-connect": "0.3.0", + "@firebase/database": "1.0.12", + "@firebase/database-compat": "2.0.3", + "@firebase/firestore": "4.7.7", + "@firebase/firestore-compat": "0.3.42", + "@firebase/functions": "0.12.2", + "@firebase/functions-compat": "0.3.19", "@firebase/installations": "0.6.12", "@firebase/installations-compat": "0.2.12", "@firebase/messaging": "0.12.16", "@firebase/messaging-compat": "0.2.16", - "@firebase/storage": "0.13.5", - "@firebase/storage-compat": "0.3.15", - "@firebase/performance": "0.6.12", - "@firebase/performance-compat": "0.2.12", + "@firebase/storage": "0.13.6", + "@firebase/storage-compat": "0.3.16", + "@firebase/performance": "0.7.0", + "@firebase/performance-compat": "0.2.13", "@firebase/remote-config": "0.5.0", "@firebase/remote-config-compat": "0.2.12", "@firebase/analytics": "0.10.11", @@ -426,7 +426,7 @@ "@firebase/app-check": "0.8.11", "@firebase/app-check-compat": "0.3.18", "@firebase/util": "1.10.3", - "@firebase/vertexai": "1.0.3" + "@firebase/vertexai": "1.0.4" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index e4c812b4595..9b1b0854f84 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.42 + +### Patch Changes + +- Updated dependencies [[`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a), [`721e5a7`](https://github.com/firebase/firebase-js-sdk/commit/721e5a7e97db5d2136c8338e2522dd07dbc3a29e)]: + - @firebase/firestore@4.7.7 + ## 0.3.41 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 435f979864f..9ac9b3762c1 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.41", + "version": "0.3.42", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.6.12", - "@firebase/firestore": "4.7.6", + "@firebase/firestore": "4.7.7", "@firebase/util": "1.10.3", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 8f6d442b21f..0ed946c5bc2 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/firestore +## 4.7.7 + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + +- [`721e5a7`](https://github.com/firebase/firebase-js-sdk/commit/721e5a7e97db5d2136c8338e2522dd07dbc3a29e) [#8691](https://github.com/firebase/firebase-js-sdk/pull/8691) - Fixed a server and sdk mismatch in unicode string sorting. + ## 4.7.6 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 1545033bd98..ba61209bc09 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.6", + "version": "4.7.7", "engines": { "node": ">=18.0.0" }, @@ -106,9 +106,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.18", - "@firebase/app-compat": "0.2.48", - "@firebase/auth": "1.8.2", + "@firebase/app": "0.11.0", + "@firebase/app-compat": "0.2.49", + "@firebase/auth": "1.9.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index c9a4c2eb334..3dbd97e785b 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/functions-compat +## 0.3.19 + +### Patch Changes + +- Updated dependencies [[`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a)]: + - @firebase/functions@0.12.2 + ## 0.3.18 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 0cd65b0e88b..d8568ff4fd4 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.18", + "version": "0.3.19", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -63,7 +63,7 @@ "typings": "dist/src/index.d.ts", "dependencies": { "@firebase/component": "0.6.12", - "@firebase/functions": "0.12.1", + "@firebase/functions": "0.12.2", "@firebase/functions-types": "0.6.3", "@firebase/util": "1.10.3", "tslib": "^2.1.0" diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index cb91aa6ba71..ab5e9bcf3ad 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.2 + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 0.12.1 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index c8d7a73267e..e4732e329c6 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.1", + "version": "0.12.2", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index de43a4cfc85..06f9e3e4cc0 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index 7db39fa9aa4..a09b416459c 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index a81f6b50c12..6e39ddf356b 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", + "@firebase/app-compat": "0.2.49", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 1d9860d6824..79348be0a5b 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 5a5ef93b67c..a7719dad258 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/performance-compat +## 0.2.13 + +### Patch Changes + +- Updated dependencies [[`2ec1c76`](https://github.com/firebase/firebase-js-sdk/commit/2ec1c768271b8432ef15fc4ba46e825ee15f3ee1)]: + - @firebase/performance@0.7.0 + ## 0.2.12 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 48cea0d261b..e8c6af49211 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.12", + "version": "0.2.13", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,7 +38,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.6.12", + "@firebase/performance": "0.7.0", "@firebase/performance-types": "0.2.3", "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.48" + "@firebase/app-compat": "0.2.49" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index 88369b38592..f64bfa0d33a 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/performance +## 0.7.0 + +### Minor Changes + +- [`2ec1c76`](https://github.com/firebase/firebase-js-sdk/commit/2ec1c768271b8432ef15fc4ba46e825ee15f3ee1) [#8644](https://github.com/firebase/firebase-js-sdk/pull/8644) - Collect web vital metrics (INP,CLS,LCP) as part of page load event. + ## 0.6.12 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 4b2284fa335..68dc6551d79 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.6.12", + "version": "0.7.0", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -14,7 +14,9 @@ }, "./package.json": "./package.json" }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", @@ -45,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -61,7 +63,9 @@ }, "typings": "dist/src/index.d.ts", "nyc": { - "extension": [".ts"], + "extension": [ + ".ts" + ], "reportDir": "./coverage/node" } } diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 54b45f2a3cd..0320731f032 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.48" + "@firebase/app-compat": "0.2.49" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 4b10504956d..f29007bd4bb 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 329586c5def..a0337721289 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/storage-compat +## 0.3.16 + +### Patch Changes + +- Updated dependencies [[`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a)]: + - @firebase/storage@0.13.6 + ## 0.3.15 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 49264e65669..1e98d1f2b39 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.15", + "version": "0.3.16", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.5", + "@firebase/storage": "0.13.6", "@firebase/storage-types": "0.8.3", "@firebase/util": "1.10.3", "@firebase/component": "0.6.12", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.48", - "@firebase/auth-compat": "0.5.17", + "@firebase/app-compat": "0.2.49", + "@firebase/auth-compat": "0.5.18", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 9e4760a7d7c..4c63f910777 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.6 + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 0.13.5 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 6988c86b581..7d294fef1a5 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.5", + "version": "0.13.6", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -54,8 +54,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.18", - "@firebase/auth": "1.8.2", + "@firebase/app": "0.11.0", + "@firebase/auth": "1.9.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 94394230b71..0e2fa91b079 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index d2329a94ed2..b495fcd8c02 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.0.4 + +### Patch Changes + +- [`97d48c7`](https://github.com/firebase/firebase-js-sdk/commit/97d48c7650e2d4273b7f94c8964dfcb44113952a) [#8651](https://github.com/firebase/firebase-js-sdk/pull/8651) - `FirebaseServerApp` can now be initalized with an App Check token instead of invoking the App Check + `getToken` method. This should unblock the use of App Check enforced products in SSR environments + where the App Check SDK cannot be initialized. + ## 1.0.3 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 0f32eb39441..a074afbc198 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.0.3", + "version": "1.0.4", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 80d5500216e..3cf50dddc98 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.18", + "@firebase/app": "0.11.0", "@firebase/logger": "0.4.4", "@firebase/util": "1.10.3", "@rollup/plugin-commonjs": "21.1.0", From deb917b5fabdd96fd7fc949902462d33993d65c9 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 10 Feb 2025 11:57:15 -0800 Subject: [PATCH 098/295] Adds a "firebase" changeset to release PR as needed (#8770) --- .gitignore | 5 +- scripts/ci/add_changeset.ts | 113 ++++++++++++++++++++++++++++++++---- 2 files changed, 107 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 1a6a719d18d..5aaf5c0b5be 100644 --- a/.gitignore +++ b/.gitignore @@ -100,4 +100,7 @@ docs/ # vertexai test data vertexai-sdk-test-data -mocks-lookup.ts \ No newline at end of file +mocks-lookup.ts + +# temp changeset output +changeset-temp.json \ No newline at end of file diff --git a/scripts/ci/add_changeset.ts b/scripts/ci/add_changeset.ts index 2279e2c0e60..63003d7868e 100644 --- a/scripts/ci/add_changeset.ts +++ b/scripts/ci/add_changeset.ts @@ -22,11 +22,12 @@ * For background, see https://github.com/firebase/firebase-js-sdk/issues/4235 */ -import { writeFileSync } from 'fs'; +import { writeFileSync, existsSync } from 'fs'; +import { join } from 'path'; import { projectRoot } from '../utils'; import { exec } from 'child-process-promise'; -const CONTENT = ` +const APP_CHANGESET_CONTENT = ` --- '@firebase/app': patch --- @@ -34,24 +35,99 @@ const CONTENT = ` Update SDK_VERSION. `; -const FILE_PATH = `${projectRoot}/.changeset/bump-sdk-version.md`; +function firebaseChangesetContent(type: ReleaseType, maxProducts: string[]) { + return ` +--- +'firebase': ${type} +--- + +Update root "firebase" package as a "${type}" release due to bumps in: +${maxProducts.join('\n')}. +`; +} + +const CHANGESET_DIR_PATH = `${projectRoot}/.changeset/`; + +interface ChangesetEntry { + releases: Array<{ + name: string; + type: ReleaseType; + }>; + summary: string; + id: string; +} + +type ReleaseType = 'none' | 'patch' | 'minor' | 'major'; + +const releaseTypeValues: Record = { + 'none': 0, + 'patch': 1, + 'minor': 2, + 'major': 3 +}; async function addChangeSet() { // check if a few firebase version is being released try { // The way actions/checkout works, there is no local `main` branch, but it // has access to the remote origin/main. - const { stdout } = await exec('yarn changeset status'); + await exec(`yarn changeset status --output changeset-temp.json`); + const changesets: ChangesetEntry[] = + require(`${projectRoot}/changeset-temp.json`).changesets; // only add a changeset for @firebase/app if // 1. we are publishing a new firebase version. and // 2. @firebase/app is not already being published - const firebaseRelease = stdout.includes('- firebase\n'); - const firebaseAppRelease = stdout.includes('- @firebase/app\n'); - if (firebaseRelease && !firebaseAppRelease) { + let firebaseRelease: ReleaseType = 'none'; + let firebaseAppRelease: ReleaseType = 'none'; + let maxProductRelease: ReleaseType = 'none'; + let maxProducts: string[] = []; + for (const changeset of changesets) { + for (const release of changeset.releases) { + // Track any 'firebase' release + if ( + release.name === 'firebase' && + releaseTypeValues[release.type] > releaseTypeValues[firebaseRelease] + ) { + firebaseRelease = release.type; + } + // Track any '@firebase/app' release + if ( + release.name === '@firebase/app' && + releaseTypeValues[release.type] > + releaseTypeValues[firebaseAppRelease] + ) { + firebaseAppRelease = release.type; + } + // Track any minor or greater release that isn't 'firebase' + if ( + release.name !== 'firebase' && + releaseTypeValues[release.type] >= + releaseTypeValues[maxProductRelease] + ) { + if ( + releaseTypeValues[release.type] === + releaseTypeValues[maxProductRelease] + ) { + maxProducts.push(release.name); + } else { + maxProducts = [release.name]; + } + maxProductRelease = release.type; + } + } + } + if ( + releaseTypeValues[firebaseRelease] > 0 && + releaseTypeValues[firebaseAppRelease] === 0 + ) { console.log('Creating a patch changeset for @firebase/app'); - writeFileSync(FILE_PATH, CONTENT, { - encoding: 'utf-8' - }); + writeFileSync( + join(CHANGESET_DIR_PATH, 'bump-sdk-version.md'), + APP_CHANGESET_CONTENT, + { + encoding: 'utf-8' + } + ); } else if (firebaseAppRelease) { console.log( 'Skip creating a patch changeset for @firebase/app because it is already part of the release' @@ -61,6 +137,23 @@ async function addChangeSet() { 'Skip creating a patch changeset for @firebase/app because firebase is not being released' ); } + if ( + releaseTypeValues[maxProductRelease] > releaseTypeValues['patch'] && + releaseTypeValues[maxProductRelease] > releaseTypeValues[firebaseRelease] + ) { + console.log( + `Creating a ${maxProductRelease} changeset for firebase due to ${maxProducts.join( + ', ' + )}` + ); + writeFileSync( + join(CHANGESET_DIR_PATH, 'bump-root-package.md'), + firebaseChangesetContent(maxProductRelease, maxProducts), + { + encoding: 'utf-8' + } + ); + } } catch (e) { // log the error, the exit without creating a changeset console.log('error:', e); From 45d427494491dfae8f9298c817333c7eb44aae15 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 10 Feb 2025 14:03:08 -0600 Subject: [PATCH 099/295] Use Node's `TextEncoder` in E2E JSDOM Environment (#8783) --- e2e/fix-jsdom-environment.ts | 9 +- e2e/package.json | 3 +- e2e/yarn.lock | 464 ++++++++++++++++++----------------- 3 files changed, 242 insertions(+), 234 deletions(-) diff --git a/e2e/fix-jsdom-environment.ts b/e2e/fix-jsdom-environment.ts index 6255969c6f9..c2885ab9c45 100644 --- a/e2e/fix-jsdom-environment.ts +++ b/e2e/fix-jsdom-environment.ts @@ -18,18 +18,21 @@ import JSDOMEnvironment from 'jest-environment-jsdom'; /** - * JSDOMEnvironment patch to polyfill missing fetch with native - * Node fetch + * JSDOMEnvironment patch to polyfill missing APIs with Node APIs. */ // https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string export default class FixJSDOMEnvironment extends JSDOMEnvironment { constructor(...args: ConstructorParameters) { super(...args); - // FIXME https://github.com/jsdom/jsdom/issues/1724 + // Fetch + // FIXME: https://github.com/jsdom/jsdom/issues/1724 this.global.fetch = fetch; this.global.Headers = Headers; this.global.Request = Request; this.global.Response = Response; + + // Util + this.global.TextEncoder = TextEncoder; } } diff --git a/e2e/package.json b/e2e/package.json index df9787e1ad3..78b9ced48ce 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -4,7 +4,6 @@ "description": "", "main": "index.js", "scripts": { - "setup": "node test-setup.js", "test": "yarn jest", "test:compat": "yarn jest tests/compat.test.ts", "test:modular": "yarn jest tests/modular.test.ts", @@ -18,7 +17,7 @@ "author": "", "license": "ISC", "dependencies": { - "firebase": "11.0.2" + "firebase": "11.3.0" }, "devDependencies": { "@babel/core": "7.26.0", diff --git a/e2e/yarn.lock b/e2e/yarn.lock index e2454e7da6d..53db962e2f9 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -987,15 +987,15 @@ resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@firebase/analytics-compat@0.2.16": - version "0.2.16" - resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.16.tgz#a84513988358494ef6f80ef626d4198da2b62381" - integrity sha512-Q/s+u/TEMSb2EDJFQMGsOzpSosybBl8HuoSEMyGZ99+0Pu7SIR9MPDGUjc8PKiCFQWDJ3QXxgqh1d/rujyAMbA== +"@firebase/analytics-compat@0.2.17": + version "0.2.17" + resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.17.tgz#c3cfc8ffb863d574ec26d86f9c8344d752832995" + integrity sha512-SJNVOeTvzdqZQvXFzj7yAirXnYcLDxh57wBFROfeowq/kRN1AqOw1tG6U4OiFOEhqi7s3xLze/LMkZatk2IEww== dependencies: - "@firebase/analytics" "0.10.10" + "@firebase/analytics" "0.10.11" "@firebase/analytics-types" "0.8.3" - "@firebase/component" "0.6.11" - "@firebase/util" "1.10.2" + "@firebase/component" "0.6.12" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/analytics-types@0.8.3": @@ -1003,27 +1003,27 @@ resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz#d08cd39a6209693ca2039ba7a81570dfa6c1518f" integrity sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg== -"@firebase/analytics@0.10.10": - version "0.10.10" - resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.10.tgz#68492c7ec3a341fd6caf3f89cbd9e7e7ad374140" - integrity sha512-Psdo7c9g2SLAYh6u1XRA+RZ7ab2JfBVuAt/kLzXkhKZL/gS2cQUCMsOW5p0RIlDPRKqpdNSmvujd2TeRWLKOkQ== +"@firebase/analytics@0.10.11": + version "0.10.11" + resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.11.tgz#6896413e92613573af775c45050af889a43676da" + integrity sha512-zwuPiRE0+hgcS95JZbJ6DFQN4xYFO8IyGxpeePTV51YJMwCf3lkBa6FnZ/iXIqDKcBPMgMuuEZozI0BJWaLEYg== dependencies: - "@firebase/component" "0.6.11" - "@firebase/installations" "0.6.11" + "@firebase/component" "0.6.12" + "@firebase/installations" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/app-check-compat@0.3.17": - version "0.3.17" - resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.17.tgz#ec0e0b52c4c5ea7cb6d976f9d1f892e97d19febc" - integrity sha512-a/eadrGsY0MVCBPhrNbKUhoYpms4UKTYLKO7nswwSFVsm3Rw6NslQQCNLfvljcDqP4E7alQDRGJXjkxd/5gJ+Q== +"@firebase/app-check-compat@0.3.18": + version "0.3.18" + resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.18.tgz#abe63858fca86b61ea431e0d9e58ccb8bac1b275" + integrity sha512-qjozwnwYmAIdrsVGrJk+hnF1WBois54IhZR6gO0wtZQoTvWL/GtiA2F31TIgAhF0ayUiZhztOv1RfC7YyrZGDQ== dependencies: - "@firebase/app-check" "0.8.10" + "@firebase/app-check" "0.8.11" "@firebase/app-check-types" "0.5.3" - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/app-check-interop-types@0.3.3": @@ -1036,25 +1036,25 @@ resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz#38ba954acf4bffe451581a32fffa20337f11d8e5" integrity sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng== -"@firebase/app-check@0.8.10": - version "0.8.10" - resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.10.tgz#7fa10c9242ecc181a0f45a68bfc268e12729ff02" - integrity sha512-DWFfxxif/t+Ow4MmRUevDX+A3hVxm1rUf6y5ZP4sIomfnVCO1NNahqtsv9rb1/tKGkTeoVT40weiTS/WjQG1mA== +"@firebase/app-check@0.8.11": + version "0.8.11" + resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.11.tgz#3c67148046fea0a0a9a1eecf1a17fdc31a76eda7" + integrity sha512-42zIfRI08/7bQqczAy7sY2JqZYEv3a1eNa4fLFdtJ54vNevbBIRSEA3fZgRqWFNHalh5ohsBXdrYgFqaRIuCcQ== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/app-compat@0.2.46": - version "0.2.46" - resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.46.tgz#67238416c9e45e9e8649dfe70304026af1cb0b08" - integrity sha512-9hSHWE5LMqtKIm13CnH5OZeMPbkVV3y5vgNZ5EMFHcG2ceRrncyNjG9No5XfWQw8JponZdGs4HlE4aMD/jxcFA== +"@firebase/app-compat@0.2.49": + version "0.2.49" + resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.49.tgz#715a519ce8566d37c44db399c02a4785359b7b22" + integrity sha512-vf838b9WrHs2GH6NfsvA27a3ngDzCnR7oxmc5LJHaJ7mWSCuce1iDRJ2B6raJ6SH9592XXvtW+kzRcPYhC/LoA== dependencies: - "@firebase/app" "0.10.16" - "@firebase/component" "0.6.11" + "@firebase/app" "0.11.0" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/app-types@0.9.3": @@ -1062,26 +1062,26 @@ resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz#8408219eae9b1fb74f86c24e7150a148460414ad" integrity sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw== -"@firebase/app@0.10.16": - version "0.10.16" - resolved "https://registry.npmjs.org/@firebase/app/-/app-0.10.16.tgz#c557ee8fa0085909b48d6e0a00e7403943bd836f" - integrity sha512-SUati2qH48gvVGnSsqMkZr1Iq7No52a3tJQ4itboSTM89Erezmw3v1RsfVymrDze9+KiOLmBpvLNKSvheITFjg== +"@firebase/app@0.11.0": + version "0.11.0" + resolved "https://registry.npmjs.org/@firebase/app/-/app-0.11.0.tgz#9f6333fe352283a2ecba9bddc0d66fa637cbf251" + integrity sha512-FaPl2RB2iClQK4IIAN4ruhzyGNRcvAwXk0Ltqdt55RiTmQ4aM2EAJicgI8QNQd2JIkeCT1K8JKsEba3T1/J7FA== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" idb "7.1.1" tslib "^2.1.0" -"@firebase/auth-compat@0.5.16": - version "0.5.16" - resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.16.tgz#ef365d2594c0706688abefb8dd61f32a677625f6" - integrity sha512-YlYwJMBqAyv0ESy3jDUyshMhZlbUiwAm6B6+uUmigNDHU+uq7j4SFiDJEZlFFIz397yBzKn06SUdqutdQzGnCA== +"@firebase/auth-compat@0.5.18": + version "0.5.18" + resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.18.tgz#ba1674287e6df4f95675866d6f960a9fc4a9abfc" + integrity sha512-dFBev8AMNb2AgIt9afwf/Ku4/0Wq9R9OFSeBB/xjyJt+RfQ9PnNWqU2oFphews23byLg6jle8twRA7iOYfRGRw== dependencies: - "@firebase/auth" "1.8.1" - "@firebase/auth-types" "0.12.3" - "@firebase/component" "0.6.11" - "@firebase/util" "1.10.2" + "@firebase/auth" "1.9.0" + "@firebase/auth-types" "0.13.0" + "@firebase/component" "0.6.12" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/auth-interop-types@0.2.4": @@ -1089,82 +1089,82 @@ resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz#176a08686b0685596ff03d7879b7e4115af53de0" integrity sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA== -"@firebase/auth-types@0.12.3": - version "0.12.3" - resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.3.tgz#650e54a36060b5ea012075ddbd3cb26566334c41" - integrity sha512-Zq9zI0o5hqXDtKg6yDkSnvMCMuLU6qAVS51PANQx+ZZX5xnzyNLEBO3GZgBUPsV5qIMFhjhqmLDxUqCbnAYy2A== +"@firebase/auth-types@0.13.0": + version "0.13.0" + resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.13.0.tgz#ae6e0015e3bd4bfe18edd0942b48a0a118a098d9" + integrity sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg== -"@firebase/auth@1.8.1": - version "1.8.1" - resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.8.1.tgz#8b508328f60bb069a11de8c7e1e4e39e01d5a796" - integrity sha512-LX9N/Cf5Z35r5yqm2+5M3+2bRRe/+RFaa/+u4HDni7TA27C/Xm4XHLKcWcLg1BzjrS4zngSaBEOSODvp6RFOqQ== +"@firebase/auth@1.9.0": + version "1.9.0" + resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.9.0.tgz#eea1ab78fd3d68db3cdef69a0d7fba3663a940c5" + integrity sha512-Xz2mbEYauF689qXG/4HppS2+/yGo9R7B6eNUBh3H2+XpAZTGdx8d8TFsW/BMTAK9Q95NB0pb1Bbvfx0lwofq8Q== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/component@0.6.11": - version "0.6.11" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.11.tgz#228a2ff5a6b0e5970b84d4dd298bf6ed0483018e" - integrity sha512-eQbeCgPukLgsKD0Kw5wQgsMDX5LeoI1MIrziNDjmc6XDq5ZQnuUymANQgAb2wp1tSF9zDSXyxJmIUXaKgN58Ug== +"@firebase/component@0.6.12": + version "0.6.12" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.12.tgz#08905a534e9b769164e7e1b1e80f6e7611eb67f3" + integrity sha512-YnxqjtohLbnb7raXt2YuA44cC1wA9GiehM/cmxrsoxKlFxBLy2V0OkRSj9gpngAE0UoJ421Wlav9ycO7lTPAUw== dependencies: - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/data-connect@0.1.2": - version "0.1.2" - resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.1.2.tgz#25c0d7c522089be4a44cbe7d2039dd3601448f81" - integrity sha512-Bcf29mntFCt5V7aceMe36wnkHrG7cwbMlUVbDHOlh2foQKx9VtSXEONw9r6FtL1sFobHVYOM5L6umX35f59m5g== +"@firebase/data-connect@0.3.0": + version "0.3.0" + resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.3.0.tgz#5602986c28e2ac94df2499a7cf68ad622957089e" + integrity sha512-inbLq0JyQD/d02Al3Lso0Hc8z1BVpB3dYSMFcQkeKhYyjn5bspLczLdasPbCOEUp8MOkLblLZhJuRs7Q/spFnw== dependencies: "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/database-compat@2.0.1": - version "2.0.1" - resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.1.tgz#063c4bff74782337117280fbf5b73b463a9a0638" - integrity sha512-IsFivOjdE1GrjTeKoBU/ZMenESKDXidFDzZzHBPQ/4P20ptGdrl3oLlWrV/QJqJ9lND4IidE3z4Xr5JyfUW1vg== +"@firebase/database-compat@2.0.3": + version "2.0.3" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.3.tgz#87f18e814c06d62fea4bfb10d3b833f4259345ca" + integrity sha512-uHGQrSUeJvsDfA+IyHW5O4vdRPsCksEzv4T4Jins+bmQgYy20ZESU4x01xrQCn/nzqKHuQMEW99CoCO7D+5NiQ== dependencies: - "@firebase/component" "0.6.11" - "@firebase/database" "1.0.10" - "@firebase/database-types" "1.0.7" + "@firebase/component" "0.6.12" + "@firebase/database" "1.0.12" + "@firebase/database-types" "1.0.8" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/database-types@1.0.7": - version "1.0.7" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.7.tgz#8a0819ca8c486fc967d3a9021a008c8f969576bf" - integrity sha512-I7zcLfJXrM0WM+ksFmFdAMdlq/DFmpeMNa+/GNsLyFo5u/lX5zzkPzGe3srVWqaBQBY5KprylDGxOsP6ETfL0A== +"@firebase/database-types@1.0.8": + version "1.0.8" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.8.tgz#eddcce594be118bf9aebb043b5a6d51cfb6de620" + integrity sha512-6lPWIGeufhUq1heofZULyVvWFhD01TUrkkB9vyhmksjZ4XF7NaivQp9rICMk7QNhqwa+uDCaj4j+Q8qqcSVZ9g== dependencies: "@firebase/app-types" "0.9.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" -"@firebase/database@1.0.10": - version "1.0.10" - resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.10.tgz#e23044d5fd2cdfd07e7bef57fd80643db07af33d" - integrity sha512-sWp2g92u7xT4BojGbTXZ80iaSIaL6GAL0pwvM0CO/hb0nHSnABAqsH7AhnWGsGvXuEvbPr7blZylPaR9J+GSuQ== +"@firebase/database@1.0.12": + version "1.0.12" + resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.12.tgz#4e1807b82dc734df8596eac44d7766ff96c2de24" + integrity sha512-psFl5t6rSFHq3i3fnU1QQlc4BB9Hnhh8TgEqvQlPPm8kDLw8gYxvjqYw3c5CZW0+zKR837nwT6im/wtJUivMKw== dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/firestore-compat@0.3.40": - version "0.3.40" - resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.40.tgz#3f4cfc2d25d2f25d9925cdf5903c0b49bfdaeebc" - integrity sha512-18HopMN811KYBc9Ptpr1Rewwio0XF09FF3jc5wtV6rGyAs815SlFFw5vW7ZeLd43zv9tlEc2FzM0H+5Vr9ZRxw== +"@firebase/firestore-compat@0.3.42": + version "0.3.42" + resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.42.tgz#0acad6d6e05df9764a86b0125886afdffedb08f2" + integrity sha512-L/JqnVw7Bf+2jcCmW1nCiknkIVVM5RIR4rHE1UrtInAvP9vo8pUhFEZVzbwX71SuCoHOwjiaPDvVSeOFachokg== dependencies: - "@firebase/component" "0.6.11" - "@firebase/firestore" "4.7.5" + "@firebase/component" "0.6.12" + "@firebase/firestore" "4.7.7" "@firebase/firestore-types" "3.0.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/firestore-types@3.0.3": @@ -1172,28 +1172,28 @@ resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz#7d0c3dd8850c0193d8f5ee0cc8f11961407742c1" integrity sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q== -"@firebase/firestore@4.7.5": - version "4.7.5" - resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.5.tgz#a34d215b28b2888841ed5e06fa6db2ae2246098a" - integrity sha512-OO3rHvjC07jL2ITN255xH/UzCVSvh6xG8oTzQdFScQvFbcm1fjCL1hgAdpDZcx3vVcKMV+6ktr8wbllkB8r+FQ== +"@firebase/firestore@4.7.7": + version "4.7.7" + resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.7.tgz#f9cf680e7402a833cf24a13d4f866ca1971e2c1b" + integrity sha512-DDYBjqSyd2vD3SjfRqI2Q9Ua1N0URP+1P0/SnNdVSp0/S5mkbaklIX/eU+199ze0XXnC61RYLqi6KYTYtGoz2A== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" "@firebase/webchannel-wrapper" "1.0.3" "@grpc/grpc-js" "~1.9.0" "@grpc/proto-loader" "^0.7.8" tslib "^2.1.0" -"@firebase/functions-compat@0.3.16": - version "0.3.16" - resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.16.tgz#397980bc6d40b614be70350b62200188ae4bb289" - integrity sha512-FL7EXehiiBisNIR7mlb0i+moyWKLVfcEJgh/Wq6ZV6BdrCObpCTz7w5EvuRIEFX5e9cNL2oWInKg8S5X4HtINg== +"@firebase/functions-compat@0.3.19": + version "0.3.19" + resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.19.tgz#f1d1ce51674a6ee8d5449b721374d35243dc3002" + integrity sha512-uw4tR8NcJCDu86UD63Za8A8SgFgmAVFb1XsGlkuBY7gpLyZWEFavWnwRkZ/8cUwpqUhp/SptXFZ1WFJSnOokLw== dependencies: - "@firebase/component" "0.6.11" - "@firebase/functions" "0.11.10" + "@firebase/component" "0.6.12" + "@firebase/functions" "0.12.2" "@firebase/functions-types" "0.6.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/functions-types@0.6.3": @@ -1201,27 +1201,27 @@ resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz#f5faf770248b13f45d256f614230da6a11bfb654" integrity sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg== -"@firebase/functions@0.11.10": - version "0.11.10" - resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.10.tgz#da908e936f9dcd2fc1bf22447500f7bf96d7615b" - integrity sha512-TP+Dzebazhw6+GduBdWn1kOJRFH84G2z+BW3pNVfkpFRkc//+uT1Uw2+dLpMGSSBRG7FrcDG91vcPnOFCzr15w== +"@firebase/functions@0.12.2": + version "0.12.2" + resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.12.2.tgz#bea33b35437278228be563dfc02520d8623d43f4" + integrity sha512-iKpFDoCYk/Qm+Qwv5ynRb9/yq64QOt0A0+t9NuekyAZnSoV56kSNq/PmsVmBauar5SlmEjhHk6QKdMBP9S0gXA== dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/messaging-interop-types" "0.2.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/installations-compat@0.2.11": - version "0.2.11" - resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.11.tgz#8bd9e3fbcf9a7fabcfa2386264be6a224567cdb5" - integrity sha512-SHRgw5LTa6v8LubmJZxcOCwEd1MfWQPUtKdiuCx2VMWnapX54skZd1PkQg0K4l3k+4ujbI2cn7FE6Li9hbChBw== +"@firebase/installations-compat@0.2.12": + version "0.2.12" + resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.12.tgz#ee6396f3cc787c0dd4fc5dd87fec1db9dbb40c97" + integrity sha512-RhcGknkxmFu92F6Jb3rXxv6a4sytPjJGifRZj8MSURPuv2Xu+/AispCXEfY1ZraobhEHTG5HLGsP6R4l9qB5aA== dependencies: - "@firebase/component" "0.6.11" - "@firebase/installations" "0.6.11" + "@firebase/component" "0.6.12" + "@firebase/installations" "0.6.12" "@firebase/installations-types" "0.5.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/installations-types@0.5.3": @@ -1229,13 +1229,13 @@ resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz#cac8a14dd49f09174da9df8ae453f9b359c3ef2f" integrity sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA== -"@firebase/installations@0.6.11": - version "0.6.11" - resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.11.tgz#0ac38af96ec737f458aa93d07e0499bd1dde9bdd" - integrity sha512-w8fY8mw6fxJzsZM2ufmTtomopXl1+bn/syYon+Gpn+0p0nO1cIUEVEFrFazTLaaL9q1CaVhc3HmseRTsI3igAA== +"@firebase/installations@0.6.12": + version "0.6.12" + resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.12.tgz#6d9ad14e60caa8fae4ec0120c0e46ceb9d6fbdae" + integrity sha512-ES/WpuAV2k2YtBTvdaknEo7IY8vaGjIjS3zhnHSAIvY9KwTR8XZFXOJoZ3nSkjN1A5R4MtEh+07drnzPDg9vaw== dependencies: - "@firebase/component" "0.6.11" - "@firebase/util" "1.10.2" + "@firebase/component" "0.6.12" + "@firebase/util" "1.10.3" idb "7.1.1" tslib "^2.1.0" @@ -1246,14 +1246,14 @@ dependencies: tslib "^2.1.0" -"@firebase/messaging-compat@0.2.14": - version "0.2.14" - resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.14.tgz#c6532a1cc1bebe55aca486c30f48688f68b50f18" - integrity sha512-r9weK8jTEA2aGiwy0IbMQPnzuJ0DHkOQaMxGJOlU2QZ1a7fh6RHpNtaoM+LKnn6u1NQgmAOWYNr9vezVQEm9zw== +"@firebase/messaging-compat@0.2.16": + version "0.2.16" + resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.16.tgz#533af4542a54b932146d175d5687aedd428be972" + integrity sha512-9HZZ88Ig3zQ0ok/Pwt4gQcNsOhoEy8hDHoGsV1am6ulgMuGuDVD2gl11Lere2ksL+msM12Lddi2x/7TCqmODZw== dependencies: - "@firebase/component" "0.6.11" - "@firebase/messaging" "0.12.14" - "@firebase/util" "1.10.2" + "@firebase/component" "0.6.12" + "@firebase/messaging" "0.12.16" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/messaging-interop-types@0.2.3": @@ -1261,28 +1261,28 @@ resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz#e647c9cd1beecfe6a6e82018a6eec37555e4da3e" integrity sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q== -"@firebase/messaging@0.12.14": - version "0.12.14" - resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.14.tgz#21d32de01f2abbb262c35185d50043bce18d4fb4" - integrity sha512-cSGP34jJswFvME8tdMDkvJvW6T1jEekyMSyq84AMBZ0KEpJbDWuC9n4wKT2lxUm1jaL651iZnn6g51yCl77ICg== +"@firebase/messaging@0.12.16": + version "0.12.16" + resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.16.tgz#bd8a768274bdc4368396bd9eaa356bffb998bef2" + integrity sha512-VJ8sCEIeP3+XkfbJA7410WhYGHdloYFZXoHe/vt+vNVDGw8JQPTQSVTRvjrUprEf5I4Tbcnpr2H34lS6zhCHSA== dependencies: - "@firebase/component" "0.6.11" - "@firebase/installations" "0.6.11" + "@firebase/component" "0.6.12" + "@firebase/installations" "0.6.12" "@firebase/messaging-interop-types" "0.2.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" idb "7.1.1" tslib "^2.1.0" -"@firebase/performance-compat@0.2.11": - version "0.2.11" - resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.11.tgz#35799c62d4c477d4b82d9824359a2bd88386db12" - integrity sha512-DqeNBy51W2xzlklyC7Ht9JQ94HhTA08PCcM4MDeyG/ol3fqum/+YgtHWQ2IQuduqH9afETthZqLwCZiSgY7hiA== +"@firebase/performance-compat@0.2.13": + version "0.2.13" + resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.13.tgz#29bb94909c10553b40ca97e7f7d0e163bad8a77d" + integrity sha512-pB0SMQj2TLQ6roDcX0YQDWvUnVgsVOl0VnUvyT/VBdCUuQYDHobZsPEuQsoEqmPA44KS/Gl0oyKqf+I8UPtRgw== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/performance" "0.6.11" + "@firebase/performance" "0.7.0" "@firebase/performance-types" "0.2.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/performance-types@0.2.3": @@ -1290,54 +1290,55 @@ resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz#5ce64e90fa20ab5561f8b62a305010cf9fab86fb" integrity sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ== -"@firebase/performance@0.6.11": - version "0.6.11" - resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.11.tgz#c07c0e30117f9b2890d8995259e07424f6d9e265" - integrity sha512-FlkJFeqLlIeh5T4Am3uE38HVzggliDIEFy/fErEc1faINOUFCb6vQBEoNZGaXvRnTR8lh3X/hP7tv37C7BsK9g== +"@firebase/performance@0.7.0": + version "0.7.0" + resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.0.tgz#1cd82039f7e06e0f059287dfa21705c68ec9a691" + integrity sha512-L91PwYuiJdKXKSRqsWNicvTppAJVzKjye03UlegeD6TkpKjb93T8AmJ9B0Mt0bcWHCNtnnRBCdSCvD2U9GZDjw== dependencies: - "@firebase/component" "0.6.11" - "@firebase/installations" "0.6.11" + "@firebase/component" "0.6.12" + "@firebase/installations" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" + web-vitals "^4.2.4" -"@firebase/remote-config-compat@0.2.11": - version "0.2.11" - resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.11.tgz#5c3660acf673b1787837cc7eba3a07bc958989f5" - integrity sha512-zfIjpwPrGuIOZDmduukN086qjhZ1LnbJi/iYzgua+2qeTlO0XdlE1v66gJPwygGB3TOhT0yb9EiUZ3nBNttMqg== +"@firebase/remote-config-compat@0.2.12": + version "0.2.12" + resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.12.tgz#ae0b597b3228deef0e3c6b2c6e631f19213eca4c" + integrity sha512-91jLWPtubIuPBngg9SzwvNCWzhMLcyBccmt7TNZP+y1cuYFNOWWHKUXQ3IrxCLB7WwLqQaEu7fTDAjHsTyBsSw== dependencies: - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/remote-config" "0.4.11" - "@firebase/remote-config-types" "0.3.3" - "@firebase/util" "1.10.2" + "@firebase/remote-config" "0.5.0" + "@firebase/remote-config-types" "0.4.0" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/remote-config-types@0.3.3": - version "0.3.3" - resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.3.tgz#8105382aabf0ee94607a6081889af122d305dd0d" - integrity sha512-YlRI9CHxrk3lpQuFup9N1eohpwdWayKZUNZ/YeQ0PZoncJ66P32UsKUKqVXOaieTjJIOh7yH8JEzRdht5s+d6g== +"@firebase/remote-config-types@0.4.0": + version "0.4.0" + resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.4.0.tgz#91b9a836d5ca30ced68c1516163b281fbb544537" + integrity sha512-7p3mRE/ldCNYt8fmWMQ/MSGRmXYlJ15Rvs9Rk17t8p0WwZDbeK7eRmoI1tvCPaDzn9Oqh+yD6Lw+sGLsLg4kKg== -"@firebase/remote-config@0.4.11": - version "0.4.11" - resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.11.tgz#7d664e12148c3135c177739020c754aa41d6e542" - integrity sha512-9z0rgKuws2nj+7cdiqF+NY1QR4na6KnuOvP+jQvgilDOhGtKOcCMq5XHiu66i73A9kFhyU6QQ2pHXxcmaq1pBw== +"@firebase/remote-config@0.5.0": + version "0.5.0" + resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.5.0.tgz#30212fa77adba8a62fc6408eb32122147ae80790" + integrity sha512-weiEbpBp5PBJTHUWR4GwI7ZacaAg68BKha5QnZ8Go65W4oQjEWqCW/rfskABI/OkrGijlL3CUmCB/SA6mVo0qA== dependencies: - "@firebase/component" "0.6.11" - "@firebase/installations" "0.6.11" + "@firebase/component" "0.6.12" + "@firebase/installations" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/storage-compat@0.3.14": - version "0.3.14" - resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.14.tgz#1779f44c517bb6d8d93245ac53a9bc1ecb2e1225" - integrity sha512-Ok5FmXJiapaNAOQ8W8qppnfwgP8540jw2B8M0c4TFZqF4BD+CoKBxW0dRtOuLNGadLhzqqkDZZZtkexxrveQqA== +"@firebase/storage-compat@0.3.16": + version "0.3.16" + resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.16.tgz#49ab9c572bb172e6335c099d95a48bee0f17cc98" + integrity sha512-EeMuok/s0r938lEomia8XILEqSYULm7HcYZ/GTZLDWur0kMf2ktuPVZiTdRiwEV3Iki7FtQO5txrQ/0pLRVLAw== dependencies: - "@firebase/component" "0.6.11" - "@firebase/storage" "0.13.4" + "@firebase/component" "0.6.12" + "@firebase/storage" "0.13.6" "@firebase/storage-types" "0.8.3" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/storage-types@0.8.3": @@ -1345,31 +1346,31 @@ resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz#2531ef593a3452fc12c59117195d6485c6632d3d" integrity sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg== -"@firebase/storage@0.13.4": - version "0.13.4" - resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.4.tgz#83a3b638ffb8dbb8cb4f58d25c0961dfebc7cd9d" - integrity sha512-b1KaTTRiMupFurIhpGIbReaWev0k5O3ouTHkAPcEssT+FvU3q/1JwzvkX4+ZdB60Fc43Mbp8qQ1gWfT0Z2FP9Q== +"@firebase/storage@0.13.6": + version "0.13.6" + resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.6.tgz#322def6cda335df991ce9787aa5ef5650db901bd" + integrity sha512-BEJLYQzVgAoglRl5VRIRZ91RRBZgS/O37/PSGQJBYNuoLmFZUrtwrlLTOAwG776NlO9VQR+K2j15/36Lr2EqHA== dependencies: - "@firebase/component" "0.6.11" - "@firebase/util" "1.10.2" + "@firebase/component" "0.6.12" + "@firebase/util" "1.10.3" tslib "^2.1.0" -"@firebase/util@1.10.2": - version "1.10.2" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.2.tgz#4dbb565cfbdf51b4fb2081c5093dba3037d49a35" - integrity sha512-qnSHIoE9FK+HYnNhTI8q14evyqbc/vHRivfB4TgCIUOl4tosmKSQlp7ltymOlMP4xVIJTg5wrkfcZ60X4nUf7Q== +"@firebase/util@1.10.3": + version "1.10.3" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.3.tgz#63fc5fea7b36236219c4875731597494416678d1" + integrity sha512-wfoF5LTy0m2ufUapV0ZnpcGQvuavTbJ5Qr1Ze9OJGL70cSMvhDyjS4w2121XdA3lGZSTOsDOyGhpoDtYwck85A== dependencies: tslib "^2.1.0" -"@firebase/vertexai@1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.1.tgz#e07fb84da1dfa4c6da358b2e2ab167ec9f69a19a" - integrity sha512-f48MGSofhaS05ebpN7zMIv4tBqYf19pXr5/4njKtNZVLbjxUswDma0SuFDoO+IwgbdkhFxgtNctM+C1zfI/O1Q== +"@firebase/vertexai@1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.4.tgz#1966ddfb32492d004f595f639e57162d488c84ba" + integrity sha512-Nkf/r4u166b4Id6zrrW0Qtg1KyZpQvvYchtkebamnHtIfY+Qnt51I/sx4Saos/WrmO8SnrSU850LfmJ7pehYXg== dependencies: "@firebase/app-check-interop-types" "0.3.3" - "@firebase/component" "0.6.11" + "@firebase/component" "0.6.12" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.2" + "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/webchannel-wrapper@1.0.3": @@ -3212,39 +3213,39 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -firebase@11.0.2: - version "11.0.2" - resolved "https://registry.npmjs.org/firebase/-/firebase-11.0.2.tgz#5de236ee1f2fa517279595e5d4199428da772f48" - integrity sha512-w4T8BSJpzdZA25QRch5ahLsgB6uRvg1LEic4BaC5rTD1YygroI1AXp+W+rbMnr8d8EjfAv6t4k8doULIjc1P8Q== - dependencies: - "@firebase/analytics" "0.10.10" - "@firebase/analytics-compat" "0.2.16" - "@firebase/app" "0.10.16" - "@firebase/app-check" "0.8.10" - "@firebase/app-check-compat" "0.3.17" - "@firebase/app-compat" "0.2.46" +firebase@11.3.0: + version "11.3.0" + resolved "https://registry.npmjs.org/firebase/-/firebase-11.3.0.tgz#3e6a61411cee00c1c7b307c546b5c7d40b3e2d1a" + integrity sha512-wLuBsWqg/M3pay2qOOLLKjTQxPUO2yrJgZLt4TKUwA3c3lrFNM2zc40uzD9LQdUk6H9HEK6bXjGPFrpwmu7HzA== + dependencies: + "@firebase/analytics" "0.10.11" + "@firebase/analytics-compat" "0.2.17" + "@firebase/app" "0.11.0" + "@firebase/app-check" "0.8.11" + "@firebase/app-check-compat" "0.3.18" + "@firebase/app-compat" "0.2.49" "@firebase/app-types" "0.9.3" - "@firebase/auth" "1.8.1" - "@firebase/auth-compat" "0.5.16" - "@firebase/data-connect" "0.1.2" - "@firebase/database" "1.0.10" - "@firebase/database-compat" "2.0.1" - "@firebase/firestore" "4.7.5" - "@firebase/firestore-compat" "0.3.40" - "@firebase/functions" "0.11.10" - "@firebase/functions-compat" "0.3.16" - "@firebase/installations" "0.6.11" - "@firebase/installations-compat" "0.2.11" - "@firebase/messaging" "0.12.14" - "@firebase/messaging-compat" "0.2.14" - "@firebase/performance" "0.6.11" - "@firebase/performance-compat" "0.2.11" - "@firebase/remote-config" "0.4.11" - "@firebase/remote-config-compat" "0.2.11" - "@firebase/storage" "0.13.4" - "@firebase/storage-compat" "0.3.14" - "@firebase/util" "1.10.2" - "@firebase/vertexai" "1.0.1" + "@firebase/auth" "1.9.0" + "@firebase/auth-compat" "0.5.18" + "@firebase/data-connect" "0.3.0" + "@firebase/database" "1.0.12" + "@firebase/database-compat" "2.0.3" + "@firebase/firestore" "4.7.7" + "@firebase/firestore-compat" "0.3.42" + "@firebase/functions" "0.12.2" + "@firebase/functions-compat" "0.3.19" + "@firebase/installations" "0.6.12" + "@firebase/installations-compat" "0.2.12" + "@firebase/messaging" "0.12.16" + "@firebase/messaging-compat" "0.2.16" + "@firebase/performance" "0.7.0" + "@firebase/performance-compat" "0.2.13" + "@firebase/remote-config" "0.5.0" + "@firebase/remote-config-compat" "0.2.12" + "@firebase/storage" "0.13.6" + "@firebase/storage-compat" "0.3.16" + "@firebase/util" "1.10.3" + "@firebase/vertexai" "1.0.4" flat@^5.0.2: version "5.0.2" @@ -5405,6 +5406,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +web-vitals@^4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== + webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" From 4d2fc6e828161bb47ae565b8c4057233ff8c520b Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Tue, 11 Feb 2025 20:44:15 +0200 Subject: [PATCH 100/295] Update Firebase index.d.ts type definition file reference (#8543) Signed-off-by: Emmanuel Ferdman --- .github/CODEOWNERS | 2 +- CONTRIBUTING.md | 2 +- packages/remote-config/src/remote_config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9d414cc7315..1ae328951f4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -72,7 +72,7 @@ packages/app-check-types @hsubox76 @firebase/jssdk-global-approvers packages/app-check-interop-types @hsubox76 @firebase/jssdk-global-approvers # Documentation Changes -packages/firebase/index.d.ts @egilmorez @firebase/jssdk-global-approvers +packages/firebase/compat/index.d.ts @egilmorez @firebase/jssdk-global-approvers scripts/docgen/content-sources/ @egilmorez @firebase/jssdk-global-approvers docs-devsite/ @firebase/firebase-techwriters diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8929e79b1b..6fcb906eb5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -206,7 +206,7 @@ Reference docs for the Firebase [JS SDK](https://firebase.google.com/docs/refere [Typedoc](https://typedoc.org/). Typedoc generates this documentation from the main -[firebase index.d.ts type definition file](packages/firebase/index.d.ts). Any updates to +[firebase index.d.ts type definition file](packages/firebase/compat/index.d.ts). Any updates to documentation should be made in that file. If any pages are added or removed by your change (by adding or removing a class or interface), the diff --git a/packages/remote-config/src/remote_config.ts b/packages/remote-config/src/remote_config.ts index 2f0df6a9f6a..bd2db66d0b3 100644 --- a/packages/remote-config/src/remote_config.ts +++ b/packages/remote-config/src/remote_config.ts @@ -32,7 +32,7 @@ const DEFAULT_CACHE_MAX_AGE_MILLIS = 12 * 60 * 60 * 1000; // Twelve hours. /** * Encapsulates business logic mapping network and storage dependencies to the public SDK API. * - * See {@link https://github.com/firebase/firebase-js-sdk/blob/main/packages/firebase/index.d.ts|interface documentation} for method descriptions. + * See {@link https://github.com/firebase/firebase-js-sdk/blob/main/packages/firebase/compat/index.d.ts|interface documentation} for method descriptions. */ export class RemoteConfig implements RemoteConfigType { /** From 3418ef8078ef2f8a7218e9a702cb42671f078b7d Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:34:57 -0500 Subject: [PATCH 101/295] Revert the UTF-8 encoding in string sorting (#8782) --- .changeset/slimy-chicken-mix.md | 6 + .../local/indexeddb_remote_document_cache.ts | 4 - packages/firestore/src/model/path.ts | 11 +- packages/firestore/src/model/values.ts | 10 +- packages/firestore/src/util/misc.ts | 17 -- .../test/integration/api/database.test.ts | 195 ------------------ 6 files changed, 17 insertions(+), 226 deletions(-) create mode 100644 .changeset/slimy-chicken-mix.md diff --git a/.changeset/slimy-chicken-mix.md b/.changeset/slimy-chicken-mix.md new file mode 100644 index 00000000000..3b0de94b287 --- /dev/null +++ b/.changeset/slimy-chicken-mix.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Reverted a change to use UTF-8 encoding in string comparisons which caused a performance issue. See [GitHub issue #8778](https://github.com/firebase/firebase-js-sdk/issues/8778) diff --git a/packages/firestore/src/local/indexeddb_remote_document_cache.ts b/packages/firestore/src/local/indexeddb_remote_document_cache.ts index 9b23c64fcf5..b3d4658d53d 100644 --- a/packages/firestore/src/local/indexeddb_remote_document_cache.ts +++ b/packages/firestore/src/local/indexeddb_remote_document_cache.ts @@ -655,9 +655,5 @@ export function dbKeyComparator(l: DocumentKey, r: DocumentKey): number { return cmp; } - // TODO(b/329441702): Document IDs should be sorted by UTF-8 encoded byte - // order, but IndexedDB sorts strings lexicographically. Document ID - // comparison here still relies on primitive comparison to avoid mismatches - // observed in snapshot listeners with Unicode characters in documentIds return primitiveComparator(left[left.length - 1], right[right.length - 1]); } diff --git a/packages/firestore/src/model/path.ts b/packages/firestore/src/model/path.ts index e7aeb6f61cc..64cb0376a0e 100644 --- a/packages/firestore/src/model/path.ts +++ b/packages/firestore/src/model/path.ts @@ -19,7 +19,6 @@ import { Integer } from '@firebase/webchannel-wrapper/bloom-blob'; import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; -import { primitiveComparator, compareUtf8Strings } from '../util/misc'; export const DOCUMENT_KEY_NAME = '__name__'; @@ -182,7 +181,7 @@ abstract class BasePath> { return comparison; } } - return primitiveComparator(p1.length, p2.length); + return Math.sign(p1.length - p2.length); } private static compareSegments(lhs: string, rhs: string): number { @@ -202,7 +201,13 @@ abstract class BasePath> { ); } else { // both non-numeric - return compareUtf8Strings(lhs, rhs); + if (lhs < rhs) { + return -1; + } + if (lhs > rhs) { + return 1; + } + return 0; } } diff --git a/packages/firestore/src/model/values.ts b/packages/firestore/src/model/values.ts index 2e3417e674f..1977767515e 100644 --- a/packages/firestore/src/model/values.ts +++ b/packages/firestore/src/model/values.ts @@ -25,11 +25,7 @@ import { Value } from '../protos/firestore_proto_api'; import { fail } from '../util/assert'; -import { - arrayEquals, - primitiveComparator, - compareUtf8Strings -} from '../util/misc'; +import { arrayEquals, primitiveComparator } from '../util/misc'; import { forEach, objectSize } from '../util/obj'; import { isNegativeZero } from '../util/types'; @@ -255,7 +251,7 @@ export function valueCompare(left: Value, right: Value): number { getLocalWriteTime(right) ); case TypeOrder.StringValue: - return compareUtf8Strings(left.stringValue!, right.stringValue!); + return primitiveComparator(left.stringValue!, right.stringValue!); case TypeOrder.BlobValue: return compareBlobs(left.bytesValue!, right.bytesValue!); case TypeOrder.RefValue: @@ -404,7 +400,7 @@ function compareMaps(left: MapValue, right: MapValue): number { rightKeys.sort(); for (let i = 0; i < leftKeys.length && i < rightKeys.length; ++i) { - const keyCompare = compareUtf8Strings(leftKeys[i], rightKeys[i]); + const keyCompare = primitiveComparator(leftKeys[i], rightKeys[i]); if (keyCompare !== 0) { return keyCompare; } diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index 6af1238398e..acaff77abb6 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -16,7 +16,6 @@ */ import { randomBytes } from '../platform/random_bytes'; -import { newTextEncoder } from '../platform/text_serializer'; import { debugAssert } from './assert'; @@ -75,22 +74,6 @@ export interface Equatable { isEqual(other: T): boolean; } -/** Compare strings in UTF-8 encoded byte order */ -export function compareUtf8Strings(left: string, right: string): number { - // Convert the string to UTF-8 encoded bytes - const encodedLeft = newTextEncoder().encode(left); - const encodedRight = newTextEncoder().encode(right); - - for (let i = 0; i < Math.min(encodedLeft.length, encodedRight.length); i++) { - const comparison = primitiveComparator(encodedLeft[i], encodedRight[i]); - if (comparison !== 0) { - return comparison; - } - } - - return primitiveComparator(encodedLeft.length, encodedRight.length); -} - export interface Iterable { forEach: (cb: (v: V) => void) => void; } diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 1304b7b4aba..1cda49d9229 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -2424,199 +2424,4 @@ apiDescribe('Database', persistence => { }); }); }); - - describe('Sort unicode strings', () => { - const expectedDocs = ['b', 'a', 'c', 'f', 'e', 'd', 'g']; - it('snapshot listener sorts unicode strings the same as server', async () => { - const testDocs = { - 'a': { value: 'Łukasiewicz' }, - 'b': { value: 'Sierpiński' }, - 'c': { value: '岩澤' }, - 'd': { value: '🄟' }, - 'e': { value: 'P' }, - 'f': { value: '︒' }, - 'g': { value: '🐵' } - }; - - return withTestCollection(persistence, testDocs, async collectionRef => { - const orderedQuery = query(collectionRef, orderBy('value')); - - const getSnapshot = await getDocsFromServer(orderedQuery); - expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); - }); - }); - - it('snapshot listener sorts unicode strings in array the same as server', async () => { - const testDocs = { - 'a': { value: ['Łukasiewicz'] }, - 'b': { value: ['Sierpiński'] }, - 'c': { value: ['岩澤'] }, - 'd': { value: ['🄟'] }, - 'e': { value: ['P'] }, - 'f': { value: ['︒'] }, - 'g': { value: ['🐵'] } - }; - - return withTestCollection(persistence, testDocs, async collectionRef => { - const orderedQuery = query(collectionRef, orderBy('value')); - - const getSnapshot = await getDocsFromServer(orderedQuery); - expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); - }); - }); - - it('snapshot listener sorts unicode strings in map the same as server', async () => { - const testDocs = { - 'a': { value: { foo: 'Łukasiewicz' } }, - 'b': { value: { foo: 'Sierpiński' } }, - 'c': { value: { foo: '岩澤' } }, - 'd': { value: { foo: '🄟' } }, - 'e': { value: { foo: 'P' } }, - 'f': { value: { foo: '︒' } }, - 'g': { value: { foo: '🐵' } } - }; - - return withTestCollection(persistence, testDocs, async collectionRef => { - const orderedQuery = query(collectionRef, orderBy('value')); - - const getSnapshot = await getDocsFromServer(orderedQuery); - expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); - }); - }); - - it('snapshot listener sorts unicode strings in map key the same as server', async () => { - const testDocs = { - 'a': { value: { 'Łukasiewicz': true } }, - 'b': { value: { 'Sierpiński': true } }, - 'c': { value: { '岩澤': true } }, - 'd': { value: { '🄟': true } }, - 'e': { value: { 'P': true } }, - 'f': { value: { '︒': true } }, - 'g': { value: { '🐵': true } } - }; - - return withTestCollection(persistence, testDocs, async collectionRef => { - const orderedQuery = query(collectionRef, orderBy('value')); - - const getSnapshot = await getDocsFromServer(orderedQuery); - expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); - }); - }); - - it('snapshot listener sorts unicode strings in document key the same as server', async () => { - const testDocs = { - 'Łukasiewicz': { value: true }, - 'Sierpiński': { value: true }, - '岩澤': { value: true }, - '🄟': { value: true }, - 'P': { value: true }, - '︒': { value: true }, - '🐵': { value: true } - }; - - return withTestCollection(persistence, testDocs, async collectionRef => { - const orderedQuery = query(collectionRef, orderBy(documentId())); - - const getSnapshot = await getDocsFromServer(orderedQuery); - const expectedDocs = [ - 'Sierpiński', - 'Łukasiewicz', - '岩澤', - '︒', - 'P', - '🄟', - '🐵' - ]; - expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); - }); - }); - - // eslint-disable-next-line no-restricted-properties - (persistence.storage === 'indexeddb' ? it.skip : it)( - 'snapshot listener sorts unicode strings in document key the same as server with persistence', - async () => { - const testDocs = { - 'Łukasiewicz': { value: true }, - 'Sierpiński': { value: true }, - '岩澤': { value: true }, - '🄟': { value: true }, - 'P': { value: true }, - '︒': { value: true }, - '🐵': { value: true } - }; - - return withTestCollection( - persistence, - testDocs, - async collectionRef => { - const orderedQuery = query(collectionRef, orderBy('value')); - - const getSnapshot = await getDocsFromServer(orderedQuery); - expect(toIds(getSnapshot)).to.deep.equal([ - 'Sierpiński', - 'Łukasiewicz', - '岩澤', - '︒', - 'P', - '🄟', - '🐵' - ]); - - const storeEvent = new EventsAccumulator(); - const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); - const watchSnapshot = await storeEvent.awaitEvent(); - // TODO: IndexedDB sorts string lexicographically, and misses the document with ID '🄟','🐵' - expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); - - unsubscribe(); - } - ); - } - ); - }); }); From 8b3bcfc28737d4e53aec46db284de5f73431d0ff Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Tue, 11 Feb 2025 12:17:01 -0800 Subject: [PATCH 102/295] Version Packages (#8786) Co-authored-by: github-actions[bot] --- .changeset/slimy-chicken-mix.md | 6 ------ integration/compat-interop/package.json | 4 ++-- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 12 ++++++++++++ packages/firebase/package.json | 10 +++++----- packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 6 +++--- packages/firestore/CHANGELOG.md | 6 ++++++ packages/firestore/package.json | 6 +++--- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- packages/vertexai/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 38 files changed, 81 insertions(+), 49 deletions(-) delete mode 100644 .changeset/slimy-chicken-mix.md diff --git a/.changeset/slimy-chicken-mix.md b/.changeset/slimy-chicken-mix.md deleted file mode 100644 index 3b0de94b287..00000000000 --- a/.changeset/slimy-chicken-mix.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Reverted a change to use UTF-8 encoding in string comparisons which caused a performance issue. See [GitHub issue #8778](https://github.com/firebase/firebase-js-sdk/issues/8778) diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 4ee442f9e3e..ee1775829b2 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.0", - "@firebase/app-compat": "0.2.49", + "@firebase/app": "0.11.1", + "@firebase/app-compat": "0.2.50", "@firebase/analytics": "0.10.11", "@firebase/analytics-compat": "0.2.17", "@firebase/auth": "1.9.0", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 9f4913959c3..dddfd6734ec 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.0", - "@firebase/firestore": "4.7.7" + "@firebase/app": "0.11.1", + "@firebase/firestore": "4.7.8" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index aa2e37d3a35..8766ad2b0f8 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.3.0", + "firebase": "11.3.1", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 16af74ca4d4..75886a3684e 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index d72382771e1..11922930ee2 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 67bf4a05c88..d1b783ff762 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index f2019186753..247f2f74116 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 7e217f946f0..fd037d0feca 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.50 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.11.1 + ## 0.2.49 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index a5cb36159ec..3f7a7209627 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.49", + "version": "0.2.50", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "@firebase/util": "1.10.3", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.12", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index a1c3d499f04..fc7cef4888f 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.11.1 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.11.0 ### Minor Changes diff --git a/packages/app/package.json b/packages/app/package.json index 66815fac527..dee646f25ba 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.0", + "version": "0.11.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 1a1d2060304..77f0e2c737c 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 8852857073e..6adf2a24075 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index acbe1a6ab22..d301fcbdc30 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 26147f1b83b..92373d15e66 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 5e15f2bc657..7d16cae41d9 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index f90bd18e76e..3cb4fefbc47 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,17 @@ # firebase +## 11.3.1 + +### Patch Changes + +- [`3418ef8`](https://github.com/firebase/firebase-js-sdk/commit/3418ef8078ef2f8a7218e9a702cb42671f078b7d) [#8782](https://github.com/firebase/firebase-js-sdk/pull/8782) - Reverted a change to use UTF-8 encoding in string comparisons which caused a performance issue. See [GitHub issue #8778](https://github.com/firebase/firebase-js-sdk/issues/8778) + +- Updated dependencies [[`3418ef8`](https://github.com/firebase/firebase-js-sdk/commit/3418ef8078ef2f8a7218e9a702cb42671f078b7d)]: + - @firebase/app@0.11.1 + - @firebase/firestore@4.7.8 + - @firebase/app-compat@0.2.50 + - @firebase/firestore-compat@0.3.43 + ## 11.3.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index e6b40af2ca5..eaea6eed6c3 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.3.0", + "version": "11.3.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,16 +399,16 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.0", - "@firebase/app-compat": "0.2.49", + "@firebase/app": "0.11.1", + "@firebase/app-compat": "0.2.50", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.9.0", "@firebase/auth-compat": "0.5.18", "@firebase/data-connect": "0.3.0", "@firebase/database": "1.0.12", "@firebase/database-compat": "2.0.3", - "@firebase/firestore": "4.7.7", - "@firebase/firestore-compat": "0.3.42", + "@firebase/firestore": "4.7.8", + "@firebase/firestore-compat": "0.3.43", "@firebase/functions": "0.12.2", "@firebase/functions-compat": "0.3.19", "@firebase/installations": "0.6.12", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 9b1b0854f84..384afbe0995 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.43 + +### Patch Changes + +- Updated dependencies [[`3418ef8`](https://github.com/firebase/firebase-js-sdk/commit/3418ef8078ef2f8a7218e9a702cb42671f078b7d)]: + - @firebase/firestore@4.7.8 + ## 0.3.42 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 9ac9b3762c1..2f1b869528c 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.42", + "version": "0.3.43", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.6.12", - "@firebase/firestore": "4.7.7", + "@firebase/firestore": "4.7.8", "@firebase/util": "1.10.3", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 0ed946c5bc2..7c894f1e6db 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/firestore +## 4.7.8 + +### Patch Changes + +- [`3418ef8`](https://github.com/firebase/firebase-js-sdk/commit/3418ef8078ef2f8a7218e9a702cb42671f078b7d) [#8782](https://github.com/firebase/firebase-js-sdk/pull/8782) - Reverted a change to use UTF-8 encoding in string comparisons which caused a performance issue. See [GitHub issue #8778](https://github.com/firebase/firebase-js-sdk/issues/8778) + ## 4.7.7 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index ba61209bc09..0cf22e035ad 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.7", + "version": "4.7.8", "engines": { "node": ">=18.0.0" }, @@ -106,8 +106,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.0", - "@firebase/app-compat": "0.2.49", + "@firebase/app": "0.11.1", + "@firebase/app-compat": "0.2.50", "@firebase/auth": "1.9.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index d8568ff4fd4..fc333293348 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index e4732e329c6..7bc4e00dd09 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 06f9e3e4cc0..9390ccc2f4e 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index a09b416459c..faec2b029c8 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 6e39ddf356b..b88085f143f 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 79348be0a5b..23842f922b5 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index e8c6af49211..1ed2af57ecf 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.49" + "@firebase/app-compat": "0.2.50" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index 68dc6551d79..3e2e418f9d7 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 0320731f032..d7e78661bde 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.49" + "@firebase/app-compat": "0.2.50" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index f29007bd4bb..8d4ceed3502 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 1e98d1f2b39..a6005e16f50 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.49", + "@firebase/app-compat": "0.2.50", "@firebase/auth-compat": "0.5.18", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 7d294fef1a5..87f2d60a632 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "@firebase/auth": "1.9.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index 0e2fa91b079..e1b98f64feb 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index a074afbc198..78e3f5a572c 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 3cf50dddc98..8ada93b7b1f 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.0", + "@firebase/app": "0.11.1", "@firebase/logger": "0.4.4", "@firebase/util": "1.10.3", "@rollup/plugin-commonjs": "21.1.0", From 69c33266dd1c0d8f264c7183a491854ef11c442f Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 11 Feb 2025 16:47:56 -0500 Subject: [PATCH 103/295] Emulator Idempotency: Firestore (#8780) Update `connectFirestoreEmulator` to support its invocation more than once. If the Firestore instance is already in use, and `connectFirestoreEmulator` is invoked with the same configuration, then the invocation will now succeed instead of assert. The implementation takes the Data Connect implementation as inspiration. Data Connect stores the parameters passed to `connectDataConnectEmulator` on the instance of Data Connect itself, so that they can be quickly checked to see if subsequent invocations match. This PR implements a similar storage and compare process with the optional `emulatorOptions` parameter (host and port are already stored). This PR unlocks support for SSR frameworks which render the page numerous times with the same instances of Firestore. Before this PR customers were required to guard against calling `connectFirestoreEmulator` in their SSR logic, which added to code complexity. Now the Firebase SDK does that guarding logic so that our users' apps don't have to. --- common/api-review/firestore-lite.api.md | 1 + packages/firestore/src/lite-api/database.ts | 30 +++++++++-- packages/firestore/src/lite-api/settings.ts | 3 ++ .../test/integration/api/validation.test.ts | 52 +++++++++++++++---- .../test/integration/util/settings.ts | 4 ++ .../firestore/test/unit/api/database.test.ts | 11 ++++ 6 files changed, 87 insertions(+), 14 deletions(-) diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 603e2349505..4a9ef4c0171 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -494,4 +494,5 @@ export class WriteBatch { // @public export function writeBatch(firestore: Firestore): WriteBatch; + ``` diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 9ea4d4ec52e..9a68e2a86d6 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -24,6 +24,7 @@ import { } from '@firebase/app'; import { createMockUserToken, + deepEqual, EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort } from '@firebase/util'; @@ -71,6 +72,9 @@ export class Firestore implements FirestoreService { private _settings = new FirestoreSettingsImpl({}); private _settingsFrozen = false; + private _emulatorOptions: { + mockUserToken?: EmulatorMockTokenOptions | string; + } = {}; // A task that is assigned when the terminate() is invoked and resolved when // all components have shut down. Otherwise, Firestore is not terminated, @@ -119,6 +123,8 @@ export class Firestore implements FirestoreService { ); } this._settings = new FirestoreSettingsImpl(settings); + this._emulatorOptions = settings.emulatorOptions || {}; + if (settings.credentials !== undefined) { this._authCredentials = makeAuthCredentialsProvider(settings.credentials); } @@ -128,6 +134,10 @@ export class Firestore implements FirestoreService { return this._settings; } + _getEmulatorOptions(): { mockUserToken?: EmulatorMockTokenOptions | string } { + return this._emulatorOptions; + } + _freezeSettings(): FirestoreSettingsImpl { this._settingsFrozen = true; return this._settings; @@ -316,20 +326,30 @@ export function connectFirestoreEmulator( ): void { firestore = cast(firestore, Firestore); const settings = firestore._getSettings(); + const existingConfig = { + ...settings, + emulatorOptions: firestore._getEmulatorOptions() + }; const newHostSetting = `${host}:${port}`; - if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + 'will be used.' ); } - - firestore._setSettings({ + const newConfig = { ...settings, host: newHostSetting, - ssl: false - }); + ssl: false, + emulatorOptions: options + }; + // No-op if the new configuration matches the current configuration. This supports SSR + // enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice. + if (deepEqual(newConfig, existingConfig)) { + return; + } + + firestore._setSettings(newConfig); if (options.mockUserToken) { let token: string; diff --git a/packages/firestore/src/lite-api/settings.ts b/packages/firestore/src/lite-api/settings.ts index 20551111a4f..a1bba373d13 100644 --- a/packages/firestore/src/lite-api/settings.ts +++ b/packages/firestore/src/lite-api/settings.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { EmulatorMockTokenOptions } from '@firebase/util'; + import { FirestoreLocalCache } from '../api/cache_config'; import { CredentialsSettings } from '../api/credentials'; import { @@ -80,6 +82,7 @@ export interface PrivateSettings extends FirestoreSettings { experimentalAutoDetectLongPolling?: boolean; experimentalLongPollingOptions?: ExperimentalLongPollingOptions; useFetchStreams?: boolean; + emulatorOptions?: { mockUserToken?: EmulatorMockTokenOptions | string }; localCache?: FirestoreLocalCache; } diff --git a/packages/firestore/test/integration/api/validation.test.ts b/packages/firestore/test/integration/api/validation.test.ts index 31f9d144142..9c74634affa 100644 --- a/packages/firestore/test/integration/api/validation.test.ts +++ b/packages/firestore/test/integration/api/validation.test.ts @@ -64,7 +64,9 @@ import { import { ALT_PROJECT_ID, DEFAULT_PROJECT_ID, - TARGET_DB_ID + TARGET_DB_ID, + USE_EMULATOR, + getEmulatorPort } from '../util/settings'; // We're using 'as any' to pass invalid values to APIs for testing purposes. @@ -179,7 +181,19 @@ apiDescribe('Validation:', persistence => { validationIt( persistence, - 'disallows calling connectFirestoreEmulator() after use', + 'connectFirestoreEmulator() can set mockUserToken object', + () => { + const db = newTestFirestore(newTestApp('test-project')); + // Verify that this doesn't throw. + connectFirestoreEmulator(db, '127.0.0.1', 9000, { + mockUserToken: { sub: 'foo' } + }); + } + ); + + validationIt( + persistence, + 'disallows calling connectFirestoreEmulator() for first time after use', async db => { const errorMsg = 'Firestore has already been started and its settings can no longer be changed.'; @@ -193,13 +207,33 @@ apiDescribe('Validation:', persistence => { validationIt( persistence, - 'connectFirestoreEmulator() can set mockUserToken object', - () => { - const db = newTestFirestore(newTestApp('test-project')); - // Verify that this doesn't throw. - connectFirestoreEmulator(db, '127.0.0.1', 9000, { - mockUserToken: { sub: 'foo' } - }); + 'allows calling connectFirestoreEmulator() after use with same config', + async db => { + if (USE_EMULATOR) { + const port = getEmulatorPort(); + connectFirestoreEmulator(db, '127.0.0.1', port); + await setDoc(doc(db, 'foo/bar'), {}); + expect(() => + connectFirestoreEmulator(db, '127.0.0.1', port) + ).to.not.throw(); + } + } + ); + + validationIt( + persistence, + 'disallows calling connectFirestoreEmulator() after use with different config', + async db => { + if (USE_EMULATOR) { + const errorMsg = + 'Firestore has already been started and its settings can no longer be changed.'; + const port = getEmulatorPort(); + connectFirestoreEmulator(db, '127.0.0.1', port); + await setDoc(doc(db, 'foo/bar'), {}); + expect(() => + connectFirestoreEmulator(db, '127.0.0.1', port + 1) + ).to.throw(errorMsg); + } } ); diff --git a/packages/firestore/test/integration/util/settings.ts b/packages/firestore/test/integration/util/settings.ts index 14bd4456c43..6fcb513a9a9 100644 --- a/packages/firestore/test/integration/util/settings.ts +++ b/packages/firestore/test/integration/util/settings.ts @@ -110,6 +110,10 @@ function getFirestoreHost(targetBackend: TargetBackend): string { } } +export function getEmulatorPort(): number { + return parseInt(process.env.FIRESTORE_EMULATOR_PORT || '8080', 10); +} + function getSslEnabled(targetBackend: TargetBackend): boolean { return targetBackend !== TargetBackend.EMULATOR; } diff --git a/packages/firestore/test/unit/api/database.test.ts b/packages/firestore/test/unit/api/database.test.ts index fd0e81cd05b..1cc1df51063 100644 --- a/packages/firestore/test/unit/api/database.test.ts +++ b/packages/firestore/test/unit/api/database.test.ts @@ -553,6 +553,17 @@ describe('Settings', () => { expect(db._getSettings().ssl).to.be.false; }); + it('gets privateSettings from useEmulator', () => { + // Use a new instance of Firestore in order to configure settings. + const db = newTestFirestore(); + const emulatorOptions = { mockUserToken: 'test' }; + connectFirestoreEmulator(db, '127.0.0.1', 9000, emulatorOptions); + + expect(db._getSettings().host).to.exist.and.to.equal('127.0.0.1:9000'); + expect(db._getSettings().ssl).to.exist.and.to.be.false; + expect(db._getEmulatorOptions()).to.equal(emulatorOptions); + }); + it('prefers host from useEmulator to host from settings', () => { // Use a new instance of Firestore in order to configure settings. const db = newTestFirestore(); From b3e68ca410d9b984736780098330bd6b8ee2e997 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 11 Feb 2025 16:48:34 -0500 Subject: [PATCH 104/295] Emulator Idempotency: Database (#8769) Update the `connectDatabaseEmulator` function to support its invocation more than once. If the Database instance is already in use, and `connectDatabaseEmulator` is invoked with the same configuration, then the invocation will now succeed instead of assert. This unlocks support for web frameworks which may render the page numerous times with the same instances of RTDB. Before this PR customers needed to add extra code to guard against calling `connectDatabaseEmulator` in their SSR logic. Now we do that guarding logic on their behalf which should simplify our customer's apps. Fixes #6824. --- .changeset/forty-bags-arrive.md | 8 +++++ .../database-compat/test/database.test.ts | 4 ++- packages/database/src/api/Database.ts | 27 ++++++++++----- packages/database/src/core/RepoInfo.ts | 9 +++-- .../database/test/exp/integration.test.ts | 34 +++++++++++++++++++ packages/database/test/helpers/util.ts | 4 +-- 6 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 .changeset/forty-bags-arrive.md diff --git a/.changeset/forty-bags-arrive.md b/.changeset/forty-bags-arrive.md new file mode 100644 index 00000000000..ee68fa5accc --- /dev/null +++ b/.changeset/forty-bags-arrive.md @@ -0,0 +1,8 @@ +--- +'@firebase/database-compat': patch +'@firebase/database': patch +'firebase': patch +--- + +Fixed: invoking `connectDatabaseEmulator` multiple times with the same parameters will no longer +cause an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). \ No newline at end of file diff --git a/packages/database-compat/test/database.test.ts b/packages/database-compat/test/database.test.ts index 8e984e211a6..fa21058591f 100644 --- a/packages/database-compat/test/database.test.ts +++ b/packages/database-compat/test/database.test.ts @@ -301,7 +301,9 @@ describe('Database Tests', () => { expect(() => { db.useEmulator('localhost', 1234); - }).to.throw(/Cannot call useEmulator/); + }).to.throw( + 'FIREBASE FATAL ERROR: connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.' + ); }); it('refFromURL returns an emulated ref with useEmulator', () => { diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 72ae85c08a1..32fd4674a44 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -27,6 +27,7 @@ import { Provider } from '@firebase/component'; import { getModularInstance, createMockUserToken, + deepEqual, EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort } from '@firebase/util'; @@ -38,7 +39,7 @@ import { FirebaseAuthTokenProvider } from '../core/AuthTokenProvider'; import { Repo, repoInterrupt, repoResume, repoStart } from '../core/Repo'; -import { RepoInfo } from '../core/RepoInfo'; +import { RepoInfo, RepoInfoEmulatorOptions } from '../core/RepoInfo'; import { parseRepoInfo } from '../core/util/libs/parser'; import { newEmptyPath, pathIsEmpty } from '../core/util/Path'; import { @@ -84,19 +85,20 @@ let useRestClient = false; */ function repoManagerApplyEmulatorSettings( repo: Repo, - host: string, - port: number, + hostAndPort: string, + emulatorOptions: RepoInfoEmulatorOptions, tokenProvider?: AuthTokenProvider ): void { repo.repoInfo_ = new RepoInfo( - `${host}:${port}`, + hostAndPort, /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams, - /*isUsingEmulator=*/ true + /*isUsingEmulator=*/ true, + emulatorOptions ); if (tokenProvider) { @@ -350,13 +352,22 @@ export function connectDatabaseEmulator( ): void { db = getModularInstance(db); db._checkNotDeleted('useEmulator'); + const hostAndPort = `${host}:${port}`; + const repo = db._repoInternal; if (db._instanceStarted) { + // If the instance has already been started, then silenty fail if this function is called again + // with the same parameters. If the parameters differ then assert. + if ( + hostAndPort === db._repoInternal.repoInfo_.host && + deepEqual(options, repo.repoInfo_.emulatorOptions) + ) { + return; + } fatal( - 'Cannot call useEmulator() after instance has already been initialized.' + 'connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.' ); } - const repo = db._repoInternal; let tokenProvider: EmulatorTokenProvider | undefined = undefined; if (repo.repoInfo_.nodeAdmin) { if (options.mockUserToken) { @@ -374,7 +385,7 @@ export function connectDatabaseEmulator( } // Modify the repo to apply emulator settings - repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider); + repoManagerApplyEmulatorSettings(repo, hostAndPort, options, tokenProvider); } /** diff --git a/packages/database/src/core/RepoInfo.ts b/packages/database/src/core/RepoInfo.ts index 9d4c1abe36b..1f8934c71d2 100644 --- a/packages/database/src/core/RepoInfo.ts +++ b/packages/database/src/core/RepoInfo.ts @@ -15,13 +15,17 @@ * limitations under the License. */ -import { assert } from '@firebase/util'; +import { assert, EmulatorMockTokenOptions } from '@firebase/util'; import { LONG_POLLING, WEBSOCKET } from '../realtime/Constants'; import { PersistentStorage } from './storage/storage'; import { each } from './util/util'; +export interface RepoInfoEmulatorOptions { + mockUserToken?: string | EmulatorMockTokenOptions; +} + /** * A class that holds metadata about a Repo object */ @@ -46,7 +50,8 @@ export class RepoInfo { public readonly nodeAdmin: boolean = false, public readonly persistenceKey: string = '', public readonly includeNamespaceInQueryParams: boolean = false, - public readonly isUsingEmulator: boolean = false + public readonly isUsingEmulator: boolean = false, + public readonly emulatorOptions: RepoInfoEmulatorOptions | null = null ) { this._host = host.toLowerCase(); this._domain = this._host.substr(this._host.indexOf('.') + 1); diff --git a/packages/database/test/exp/integration.test.ts b/packages/database/test/exp/integration.test.ts index adf5094f222..c27ea9da320 100644 --- a/packages/database/test/exp/integration.test.ts +++ b/packages/database/test/exp/integration.test.ts @@ -35,6 +35,7 @@ import { orderByKey } from '../../src/api/Reference_impl'; import { + connectDatabaseEmulator, getDatabase, goOffline, goOnline, @@ -46,8 +47,10 @@ import { EventAccumulatorFactory } from '../helpers/EventAccumulator'; import { DATABASE_ADDRESS, DATABASE_URL, + EMULATOR_PORT, getFreshRepo, getRWRefs, + USE_EMULATOR, waitFor, waitUntil, writeAndValidate @@ -138,6 +141,37 @@ describe('Database@exp Tests', () => { unsubscribe(); }); + if (USE_EMULATOR) { + it('can connect to emulator', async () => { + const db = getDatabase(defaultApp); + connectDatabaseEmulator(db, 'localhost', parseInt(EMULATOR_PORT, 10)); + await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`)); + }); + it('can change emulator config before network operations', async () => { + const db = getDatabase(defaultApp); + const port = parseInt(EMULATOR_PORT, 10); + connectDatabaseEmulator(db, 'localhost', port + 1); + connectDatabaseEmulator(db, 'localhost', port); + await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`)); + }); + it('can connect to emulator after network operations with same parameters', async () => { + const db = getDatabase(defaultApp); + const port = parseInt(EMULATOR_PORT, 10); + connectDatabaseEmulator(db, 'localhost', port); + await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`)); + connectDatabaseEmulator(db, 'localhost', port); + }); + it('cannot connect to emulator after network operations with different parameters', async () => { + const db = getDatabase(defaultApp); + const port = parseInt(EMULATOR_PORT, 10); + connectDatabaseEmulator(db, 'localhost', port); + await get(refFromURL(db, `${DATABASE_ADDRESS}/foo/bar`)); + expect(() => { + connectDatabaseEmulator(db, 'localhost', 9001); + }).to.throw(); + }); + } + it('can properly handle unknown deep merges', async () => { // Note: This test requires `testIndex` to be added as an index. // Please run `yarn test:setup` to ensure that this gets added. diff --git a/packages/database/test/helpers/util.ts b/packages/database/test/helpers/util.ts index 73eb04a8c5e..1e898d113f4 100644 --- a/packages/database/test/helpers/util.ts +++ b/packages/database/test/helpers/util.ts @@ -33,9 +33,9 @@ import { EventAccumulator } from './EventAccumulator'; // eslint-disable-next-line @typescript-eslint/no-require-imports export const TEST_PROJECT = require('../../../../config/project.json'); -const EMULATOR_PORT = process.env.RTDB_EMULATOR_PORT; +export const EMULATOR_PORT = process.env.RTDB_EMULATOR_PORT; const EMULATOR_NAMESPACE = process.env.RTDB_EMULATOR_NAMESPACE; -const USE_EMULATOR = !!EMULATOR_PORT; +export const USE_EMULATOR = !!EMULATOR_PORT; let freshRepoId = 0; const activeFreshApps: FirebaseApp[] = []; From 70e08cf95b5c43d3b98382a6f68fbd3c3555e31f Mon Sep 17 00:00:00 2001 From: Kevin Elko Date: Tue, 11 Feb 2025 16:56:59 -0500 Subject: [PATCH 105/295] SSR related improvements for RC client SDK. (#8699) SSR related improvements for RC client SDK. * Exposes an initialFetchResponse arg that pre-hydrates the client SDK state * Adds an argument that allows setting an alternate template ID to fetch from * Splits storage impls into a simple in-memory version that can be run in SSR contexts * Adds some basic tests for the API functions, which were previously untested --- .changeset/flat-plums-hope.md | 6 + common/api-review/remote-config.api.md | 21 +- docs-devsite/_toc.yaml | 6 + docs-devsite/remote-config.fetchresponse.md | 67 ++++++ ...emote-config.firebaseremoteconfigobject.md | 19 ++ docs-devsite/remote-config.md | 10 +- .../remote-config.remoteconfigoptions.md | 46 ++++ packages/remote-config/src/api.ts | 43 +++- .../src/client/caching_client.ts | 2 +- .../src/client/remote_config_fetch_client.ts | 46 +--- .../remote-config/src/client/rest_client.ts | 6 +- .../src/client/retrying_client.ts | 2 +- packages/remote-config/src/errors.ts | 2 + packages/remote-config/src/public_types.ts | 61 ++++++ packages/remote-config/src/register.ts | 23 +- packages/remote-config/src/storage/storage.ts | 133 ++++++++---- .../src/storage/storage_cache.ts | 2 +- packages/remote-config/test/api.test.ts | 152 +++++++++++++ .../test/client/caching_client.test.ts | 2 +- .../test/client/retrying_client.test.ts | 2 +- .../remote-config/test/remote_config.test.ts | 6 +- .../test/storage/storage.test.ts | 204 ++++++++++-------- 22 files changed, 647 insertions(+), 214 deletions(-) create mode 100644 .changeset/flat-plums-hope.md create mode 100644 docs-devsite/remote-config.fetchresponse.md create mode 100644 docs-devsite/remote-config.firebaseremoteconfigobject.md create mode 100644 docs-devsite/remote-config.remoteconfigoptions.md create mode 100644 packages/remote-config/test/api.test.ts diff --git a/.changeset/flat-plums-hope.md b/.changeset/flat-plums-hope.md new file mode 100644 index 00000000000..ac71c7269aa --- /dev/null +++ b/.changeset/flat-plums-hope.md @@ -0,0 +1,6 @@ +--- +'@firebase/remote-config': minor +'firebase': minor +--- + +Adds support for initial state hydration (from SSR contexts) diff --git a/common/api-review/remote-config.api.md b/common/api-review/remote-config.api.md index bf6cf4761de..213335929dd 100644 --- a/common/api-review/remote-config.api.md +++ b/common/api-review/remote-config.api.md @@ -24,9 +24,22 @@ export function fetchAndActivate(remoteConfig: RemoteConfig): Promise; // @public export function fetchConfig(remoteConfig: RemoteConfig): Promise; +// @public +export interface FetchResponse { + config?: FirebaseRemoteConfigObject; + eTag?: string; + status: number; +} + // @public export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; +// @public +export interface FirebaseRemoteConfigObject { + // (undocumented) + [key: string]: string; +} + // @public export function getAll(remoteConfig: RemoteConfig): Record; @@ -37,7 +50,7 @@ export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean; export function getNumber(remoteConfig: RemoteConfig, key: string): number; // @public (undocumented) -export function getRemoteConfig(app?: FirebaseApp): RemoteConfig; +export function getRemoteConfig(app?: FirebaseApp, options?: RemoteConfigOptions): RemoteConfig; // @public export function getString(remoteConfig: RemoteConfig, key: string): string; @@ -62,6 +75,12 @@ export interface RemoteConfig { settings: RemoteConfigSettings; } +// @public +export interface RemoteConfigOptions { + initialFetchResponse?: FetchResponse; + templateId?: string; +} + // @public export interface RemoteConfigSettings { fetchTimeoutMillis: number; diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 4ab67bcd6ef..bf0318389ba 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -430,8 +430,14 @@ toc: section: - title: CustomSignals path: /docs/reference/js/remote-config.customsignals.md + - title: FetchResponse + path: /docs/reference/js/remote-config.fetchresponse.md + - title: FirebaseRemoteConfigObject + path: /docs/reference/js/remote-config.firebaseremoteconfigobject.md - title: RemoteConfig path: /docs/reference/js/remote-config.remoteconfig.md + - title: RemoteConfigOptions + path: /docs/reference/js/remote-config.remoteconfigoptions.md - title: RemoteConfigSettings path: /docs/reference/js/remote-config.remoteconfigsettings.md - title: Value diff --git a/docs-devsite/remote-config.fetchresponse.md b/docs-devsite/remote-config.fetchresponse.md new file mode 100644 index 00000000000..414188e72bb --- /dev/null +++ b/docs-devsite/remote-config.fetchresponse.md @@ -0,0 +1,67 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FetchResponse interface +Defines a successful response (200 or 304). + +

Modeled after the native `Response` interface, but simplified for Remote Config's use case. + +Signature: + +```typescript +export interface FetchResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [config](./remote-config.fetchresponse.md#fetchresponseconfig) | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines the map of parameters returned as "entries" in the fetch response body.

Only defined for 200 responses. | +| [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value.

Only defined for 200 and 304 responses. | +| [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without.

The Remote Config client is modeled after the native Fetch interface, so HTTP status is first-class.

Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. | + +## FetchResponse.config + +Defines the map of parameters returned as "entries" in the fetch response body. + +

Only defined for 200 responses. + +Signature: + +```typescript +config?: FirebaseRemoteConfigObject; +``` + +## FetchResponse.eTag + +Defines the ETag response header value. + +

Only defined for 200 and 304 responses. + +Signature: + +```typescript +eTag?: string; +``` + +## FetchResponse.status + +The HTTP status, which is useful for differentiating success responses with data from those without. + +

The Remote Config client is modeled after the native `Fetch` interface, so HTTP status is first-class. + +

Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. + +Signature: + +```typescript +status: number; +``` diff --git a/docs-devsite/remote-config.firebaseremoteconfigobject.md b/docs-devsite/remote-config.firebaseremoteconfigobject.md new file mode 100644 index 00000000000..e7d89e5ec56 --- /dev/null +++ b/docs-devsite/remote-config.firebaseremoteconfigobject.md @@ -0,0 +1,19 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FirebaseRemoteConfigObject interface +Defines a self-descriptive reference for config key-value pairs. + +Signature: + +```typescript +export interface FirebaseRemoteConfigObject +``` diff --git a/docs-devsite/remote-config.md b/docs-devsite/remote-config.md index 40319453a3f..58d23cfd647 100644 --- a/docs-devsite/remote-config.md +++ b/docs-devsite/remote-config.md @@ -17,7 +17,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | Function | Description | | --- | --- | | function(app, ...) | -| [getRemoteConfig(app)](./remote-config.md#getremoteconfig_cf608e1) | | +| [getRemoteConfig(app, options)](./remote-config.md#getremoteconfig_61d368f) | | | function(remoteConfig, ...) | | [activate(remoteConfig)](./remote-config.md#activate_722a192) | Makes the last fetched config available to the getters. | | [ensureInitialized(remoteConfig)](./remote-config.md#ensureinitialized_722a192) | Ensures the last activated config are available to the getters. | @@ -38,7 +38,10 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | Interface | Description | | --- | --- | | [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.

The values in CustomSignals must be one of the following types:

  • string
  • number
  • null
| +| [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Defines a successful response (200 or 304).

Modeled after the native Response interface, but simplified for Remote Config's use case. | +| [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines a self-descriptive reference for config key-value pairs. | | [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The Firebase Remote Config service interface. | +| [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) | Options for Remote Config initialization. | | [RemoteConfigSettings](./remote-config.remoteconfigsettings.md#remoteconfigsettings_interface) | Defines configuration options for the Remote Config SDK. | | [Value](./remote-config.value.md#value_interface) | Wraps a value with metadata and type-safe getters. | @@ -52,12 +55,12 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm ## function(app, ...) -### getRemoteConfig(app) {:#getremoteconfig_cf608e1} +### getRemoteConfig(app, options) {:#getremoteconfig_61d368f} Signature: ```typescript -export declare function getRemoteConfig(app?: FirebaseApp): RemoteConfig; +export declare function getRemoteConfig(app?: FirebaseApp, options?: RemoteConfigOptions): RemoteConfig; ``` #### Parameters @@ -65,6 +68,7 @@ export declare function getRemoteConfig(app?: FirebaseApp): RemoteConfig; | Parameter | Type | Description | | --- | --- | --- | | app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance. | +| options | [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) | Optional. The [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) with which to instantiate the Remote Config instance. | Returns: diff --git a/docs-devsite/remote-config.remoteconfigoptions.md b/docs-devsite/remote-config.remoteconfigoptions.md new file mode 100644 index 00000000000..7caa96fa73b --- /dev/null +++ b/docs-devsite/remote-config.remoteconfigoptions.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RemoteConfigOptions interface +Options for Remote Config initialization. + +Signature: + +```typescript +export interface RemoteConfigOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [initialFetchResponse](./remote-config.remoteconfigoptions.md#remoteconfigoptionsinitialfetchresponse) | [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Hydrates the state with an initial fetch response. | +| [templateId](./remote-config.remoteconfigoptions.md#remoteconfigoptionstemplateid) | string | The ID of the template to use. If not provided, defaults to "firebase". | + +## RemoteConfigOptions.initialFetchResponse + +Hydrates the state with an initial fetch response. + +Signature: + +```typescript +initialFetchResponse?: FetchResponse; +``` + +## RemoteConfigOptions.templateId + +The ID of the template to use. If not provided, defaults to "firebase". + +Signature: + +```typescript +templateId?: string; +``` diff --git a/packages/remote-config/src/api.ts b/packages/remote-config/src/api.ts index 607d4944d26..1431864edd5 100644 --- a/packages/remote-config/src/api.ts +++ b/packages/remote-config/src/api.ts @@ -16,11 +16,13 @@ */ import { _getProvider, FirebaseApp, getApp } from '@firebase/app'; +import { deepEqual, getModularInstance } from '@firebase/util'; import { CustomSignals, LogLevel as RemoteConfigLogLevel, RemoteConfig, - Value + Value, + RemoteConfigOptions } from './public_types'; import { RemoteConfigAbortSignal } from './client/remote_config_fetch_client'; import { @@ -28,23 +30,54 @@ import { RC_CUSTOM_SIGNAL_KEY_MAX_LENGTH, RC_CUSTOM_SIGNAL_VALUE_MAX_LENGTH } from './constants'; -import { ErrorCode, hasErrorCode } from './errors'; +import { ERROR_FACTORY, ErrorCode, hasErrorCode } from './errors'; import { RemoteConfig as RemoteConfigImpl } from './remote_config'; import { Value as ValueImpl } from './value'; import { LogLevel as FirebaseLogLevel } from '@firebase/logger'; -import { getModularInstance } from '@firebase/util'; /** * * @param app - The {@link @firebase/app#FirebaseApp} instance. + * @param options - Optional. The {@link RemoteConfigOptions} with which to instantiate the + * Remote Config instance. * @returns A {@link RemoteConfig} instance. * * @public */ -export function getRemoteConfig(app: FirebaseApp = getApp()): RemoteConfig { +export function getRemoteConfig( + app: FirebaseApp = getApp(), + options: RemoteConfigOptions = {} +): RemoteConfig { app = getModularInstance(app); const rcProvider = _getProvider(app, RC_COMPONENT_NAME); - return rcProvider.getImmediate(); + if (rcProvider.isInitialized()) { + const initialOptions = rcProvider.getOptions() as RemoteConfigOptions; + if (deepEqual(initialOptions, options)) { + return rcProvider.getImmediate(); + } + throw ERROR_FACTORY.create(ErrorCode.ALREADY_INITIALIZED); + } + rcProvider.initialize({ options }); + const rc = rcProvider.getImmediate() as RemoteConfigImpl; + + if (options.initialFetchResponse) { + // We use these initial writes as the initialization promise since they will hydrate the same + // fields that `storageCache.loadFromStorage` would set. + rc._initializePromise = Promise.all([ + rc._storage.setLastSuccessfulFetchResponse(options.initialFetchResponse), + rc._storage.setActiveConfigEtag(options.initialFetchResponse?.eTag || ''), + rc._storageCache.setLastSuccessfulFetchTimestampMillis(Date.now()), + rc._storageCache.setLastFetchStatus('success'), + rc._storageCache.setActiveConfig( + options.initialFetchResponse?.config || {} + ) + ]).then(); + // The `storageCache` methods above set their in-memory fields synchronously, so it's + // safe to declare our initialization complete at this point. + rc._isInitializationComplete = true; + } + + return rc; } /** diff --git a/packages/remote-config/src/client/caching_client.ts b/packages/remote-config/src/client/caching_client.ts index c9de804d7e8..2c7009c54be 100644 --- a/packages/remote-config/src/client/caching_client.ts +++ b/packages/remote-config/src/client/caching_client.ts @@ -16,8 +16,8 @@ */ import { StorageCache } from '../storage/storage_cache'; +import { FetchResponse } from '../public_types'; import { - FetchResponse, RemoteConfigFetchClient, FetchRequest } from './remote_config_fetch_client'; diff --git a/packages/remote-config/src/client/remote_config_fetch_client.ts b/packages/remote-config/src/client/remote_config_fetch_client.ts index 71ea66d5e50..359bb7c0409 100644 --- a/packages/remote-config/src/client/remote_config_fetch_client.ts +++ b/packages/remote-config/src/client/remote_config_fetch_client.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { CustomSignals } from '../public_types'; +import { CustomSignals, FetchResponse } from '../public_types'; /** * Defines a client, as in https://en.wikipedia.org/wiki/Client%E2%80%93server_model, for the @@ -36,13 +36,6 @@ export interface RemoteConfigFetchClient { fetch(request: FetchRequest): Promise; } -/** - * Defines a self-descriptive reference for config key-value pairs. - */ -export interface FirebaseRemoteConfigObject { - [key: string]: string; -} - /** * Shims a minimal AbortSignal. * @@ -108,40 +101,3 @@ export interface FetchRequest { */ customSignals?: CustomSignals; } - -/** - * Defines a successful response (200 or 304). - * - *

Modeled after the native {@link Response} interface, but simplified for Remote Config's - * use case. - */ -export interface FetchResponse { - /** - * The HTTP status, which is useful for differentiating success responses with data from - * those without. - * - *

{@link RemoteConfigClient} is modeled after the native {@link GlobalFetch} interface, so - * HTTP status is first-class. - * - *

Disambiguation: the fetch response returns a legacy "state" value that is redundant with the - * HTTP status code. The former is normalized into the latter. - */ - status: number; - - /** - * Defines the ETag response header value. - * - *

Only defined for 200 and 304 responses. - */ - eTag?: string; - - /** - * Defines the map of parameters returned as "entries" in the fetch response body. - * - *

Only defined for 200 responses. - */ - config?: FirebaseRemoteConfigObject; - - // Note: we're not extracting experiment metadata until - // ABT and Analytics have Web SDKs. -} diff --git a/packages/remote-config/src/client/rest_client.ts b/packages/remote-config/src/client/rest_client.ts index 9d87ffbb1ac..57f55f53d88 100644 --- a/packages/remote-config/src/client/rest_client.ts +++ b/packages/remote-config/src/client/rest_client.ts @@ -15,11 +15,13 @@ * limitations under the License. */ -import { CustomSignals } from '../public_types'; import { + CustomSignals, FetchResponse, + FirebaseRemoteConfigObject +} from '../public_types'; +import { RemoteConfigFetchClient, - FirebaseRemoteConfigObject, FetchRequest } from './remote_config_fetch_client'; import { ERROR_FACTORY, ErrorCode } from '../errors'; diff --git a/packages/remote-config/src/client/retrying_client.ts b/packages/remote-config/src/client/retrying_client.ts index 874a37bd8f4..ea5bc6e2fe1 100644 --- a/packages/remote-config/src/client/retrying_client.ts +++ b/packages/remote-config/src/client/retrying_client.ts @@ -15,10 +15,10 @@ * limitations under the License. */ +import { FetchResponse } from '../public_types'; import { RemoteConfigAbortSignal, RemoteConfigFetchClient, - FetchResponse, FetchRequest } from './remote_config_fetch_client'; import { ThrottleMetadata, Storage } from '../storage/storage'; diff --git a/packages/remote-config/src/errors.ts b/packages/remote-config/src/errors.ts index 762eeb899ee..446bd2c6e7a 100644 --- a/packages/remote-config/src/errors.ts +++ b/packages/remote-config/src/errors.ts @@ -18,6 +18,7 @@ import { ErrorFactory, FirebaseError } from '@firebase/util'; export const enum ErrorCode { + ALREADY_INITIALIZED = 'already-initialized', REGISTRATION_WINDOW = 'registration-window', REGISTRATION_PROJECT_ID = 'registration-project-id', REGISTRATION_API_KEY = 'registration-api-key', @@ -36,6 +37,7 @@ export const enum ErrorCode { } const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = { + [ErrorCode.ALREADY_INITIALIZED]: 'Remote Config already initialized', [ErrorCode.REGISTRATION_WINDOW]: 'Undefined window object. This SDK only supports usage in a browser environment.', [ErrorCode.REGISTRATION_PROJECT_ID]: diff --git a/packages/remote-config/src/public_types.ts b/packages/remote-config/src/public_types.ts index 365d5e5905f..927bc84ca10 100644 --- a/packages/remote-config/src/public_types.ts +++ b/packages/remote-config/src/public_types.ts @@ -50,6 +50,67 @@ export interface RemoteConfig { lastFetchStatus: FetchStatus; } +/** + * Defines a self-descriptive reference for config key-value pairs. + */ +export interface FirebaseRemoteConfigObject { + [key: string]: string; +} + +/** + * Defines a successful response (200 or 304). + * + *

Modeled after the native `Response` interface, but simplified for Remote Config's + * use case. + */ +export interface FetchResponse { + /** + * The HTTP status, which is useful for differentiating success responses with data from + * those without. + * + *

The Remote Config client is modeled after the native `Fetch` interface, so + * HTTP status is first-class. + * + *

Disambiguation: the fetch response returns a legacy "state" value that is redundant with the + * HTTP status code. The former is normalized into the latter. + */ + status: number; + + /** + * Defines the ETag response header value. + * + *

Only defined for 200 and 304 responses. + */ + eTag?: string; + + /** + * Defines the map of parameters returned as "entries" in the fetch response body. + * + *

Only defined for 200 responses. + */ + config?: FirebaseRemoteConfigObject; + + // Note: we're not extracting experiment metadata until + // ABT and Analytics have Web SDKs. +} + +/** + * Options for Remote Config initialization. + * + * @public + */ +export interface RemoteConfigOptions { + /** + * The ID of the template to use. If not provided, defaults to "firebase". + */ + templateId?: string; + + /** + * Hydrates the state with an initial fetch response. + */ + initialFetchResponse?: FetchResponse; +} + /** * Indicates the source of a value. * diff --git a/packages/remote-config/src/register.ts b/packages/remote-config/src/register.ts index ff83e761888..dda6cc544de 100644 --- a/packages/remote-config/src/register.ts +++ b/packages/remote-config/src/register.ts @@ -23,11 +23,10 @@ import { isIndexedDBAvailable } from '@firebase/util'; import { Component, ComponentType, - ComponentContainer, - InstanceFactoryOptions + ComponentContainer } from '@firebase/component'; import { Logger, LogLevel as FirebaseLogLevel } from '@firebase/logger'; -import { RemoteConfig } from './public_types'; +import { RemoteConfig, RemoteConfigOptions } from './public_types'; import { name as packageName, version } from '../package.json'; import { ensureInitialized } from './api'; import { CachingClient } from './client/caching_client'; @@ -36,7 +35,7 @@ import { RetryingClient } from './client/retrying_client'; import { RC_COMPONENT_NAME } from './constants'; import { ErrorCode, ERROR_FACTORY } from './errors'; import { RemoteConfig as RemoteConfigImpl } from './remote_config'; -import { Storage } from './storage/storage'; +import { IndexedDbStorage, InMemoryStorage } from './storage/storage'; import { StorageCache } from './storage/storage_cache'; // This needs to be in the same file that calls `getProvider()` on the component // or it will get tree-shaken out. @@ -57,7 +56,7 @@ export function registerRemoteConfig(): void { function remoteConfigFactory( container: ComponentContainer, - { instanceIdentifier: namespace }: InstanceFactoryOptions + { options }: { options?: RemoteConfigOptions } ): RemoteConfig { /* Dependencies */ // getImmediate for FirebaseApp will always succeed @@ -67,14 +66,6 @@ export function registerRemoteConfig(): void { .getProvider('installations-internal') .getImmediate(); - // Guards against the SDK being used in non-browser environments. - if (typeof window === 'undefined') { - throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_WINDOW); - } - // Guards against the SDK being used when indexedDB is not available. - if (!isIndexedDBAvailable()) { - throw ERROR_FACTORY.create(ErrorCode.INDEXED_DB_UNAVAILABLE); - } // Normalizes optional inputs. const { projectId, apiKey, appId } = app.options; if (!projectId) { @@ -86,9 +77,11 @@ export function registerRemoteConfig(): void { if (!appId) { throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_APP_ID); } - namespace = namespace || 'firebase'; + const namespace = options?.templateId || 'firebase'; - const storage = new Storage(appId, app.name, namespace); + const storage = isIndexedDBAvailable() + ? new IndexedDbStorage(appId, app.name, namespace) + : new InMemoryStorage(); const storageCache = new StorageCache(storage); const logger = new Logger(packageName); diff --git a/packages/remote-config/src/storage/storage.ts b/packages/remote-config/src/storage/storage.ts index 52e660f1fdb..f03ff41377b 100644 --- a/packages/remote-config/src/storage/storage.ts +++ b/packages/remote-config/src/storage/storage.ts @@ -16,10 +16,7 @@ */ import { FetchStatus, CustomSignals } from '@firebase/remote-config-types'; -import { - FetchResponse, - FirebaseRemoteConfigObject -} from '../client/remote_config_fetch_client'; +import { FetchResponse, FirebaseRemoteConfigObject } from '../public_types'; import { ERROR_FACTORY, ErrorCode } from '../errors'; import { RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS } from '../constants'; import { FirebaseError } from '@firebase/util'; @@ -113,19 +110,7 @@ export function openDatabase(): Promise { /** * Abstracts data persistence. */ -export class Storage { - /** - * @param appId enables storage segmentation by app (ID + name). - * @param appName enables storage segmentation by app (ID + name). - * @param namespace enables storage segmentation by namespace. - */ - constructor( - private readonly appId: string, - private readonly appName: string, - private readonly namespace: string, - private readonly openDbPromise = openDatabase() - ) {} - +export abstract class Storage { getLastFetchStatus(): Promise { return this.get('last_fetch_status'); } @@ -187,6 +172,29 @@ export class Storage { return this.get('custom_signals'); } + abstract setCustomSignals( + customSignals: CustomSignals + ): Promise; + abstract get(key: ProjectNamespaceKeyFieldValue): Promise; + abstract set(key: ProjectNamespaceKeyFieldValue, value: T): Promise; + abstract delete(key: ProjectNamespaceKeyFieldValue): Promise; +} + +export class IndexedDbStorage extends Storage { + /** + * @param appId enables storage segmentation by app (ID + name). + * @param appName enables storage segmentation by app (ID + name). + * @param namespace enables storage segmentation by namespace. + */ + constructor( + private readonly appId: string, + private readonly appName: string, + private readonly namespace: string, + private readonly openDbPromise = openDatabase() + ) { + super(); + } + async setCustomSignals(customSignals: CustomSignals): Promise { const db = await this.openDbPromise; const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite'); @@ -194,33 +202,10 @@ export class Storage { 'custom_signals', transaction ); - const combinedSignals = { - ...storedSignals, - ...customSignals - }; - // Filter out key-value assignments with null values since they are signals being unset - const updatedSignals = Object.fromEntries( - Object.entries(combinedSignals) - .filter(([_, v]) => v !== null) - .map(([k, v]) => { - // Stringify numbers to store a map of string keys and values which can be sent - // as-is in a fetch call. - if (typeof v === 'number') { - return [k, v.toString()]; - } - return [k, v]; - }) + const updatedSignals = mergeCustomSignals( + customSignals, + storedSignals || {} ); - - // Throw an error if the number of custom signals to be stored exceeds the limit - if ( - Object.keys(updatedSignals).length > RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS - ) { - throw ERROR_FACTORY.create(ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS, { - maxSignals: RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS - }); - } - await this.setWithTransaction( 'custom_signals', updatedSignals, @@ -344,3 +329,65 @@ export class Storage { return [this.appId, this.appName, this.namespace, key].join(); } } + +export class InMemoryStorage extends Storage { + private storage: { [key: string]: unknown } = {}; + + async get(key: ProjectNamespaceKeyFieldValue): Promise { + return Promise.resolve(this.storage[key] as T); + } + + async set(key: ProjectNamespaceKeyFieldValue, value: T): Promise { + this.storage[key] = value; + return Promise.resolve(undefined); + } + + async delete(key: ProjectNamespaceKeyFieldValue): Promise { + this.storage[key] = undefined; + return Promise.resolve(); + } + + async setCustomSignals(customSignals: CustomSignals): Promise { + const storedSignals = (this.storage['custom_signals'] || + {}) as CustomSignals; + this.storage['custom_signals'] = mergeCustomSignals( + customSignals, + storedSignals + ); + return Promise.resolve(this.storage['custom_signals'] as CustomSignals); + } +} + +function mergeCustomSignals( + customSignals: CustomSignals, + storedSignals: CustomSignals +): CustomSignals { + const combinedSignals = { + ...storedSignals, + ...customSignals + }; + + // Filter out key-value assignments with null values since they are signals being unset + const updatedSignals = Object.fromEntries( + Object.entries(combinedSignals) + .filter(([_, v]) => v !== null) + .map(([k, v]) => { + // Stringify numbers to store a map of string keys and values which can be sent + // as-is in a fetch call. + if (typeof v === 'number') { + return [k, v.toString()]; + } + return [k, v]; + }) + ); + + // Throw an error if the number of custom signals to be stored exceeds the limit + if ( + Object.keys(updatedSignals).length > RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS + ) { + throw ERROR_FACTORY.create(ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS, { + maxSignals: RC_CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS + }); + } + return updatedSignals; +} diff --git a/packages/remote-config/src/storage/storage_cache.ts b/packages/remote-config/src/storage/storage_cache.ts index fc419b0068e..21add07ccd3 100644 --- a/packages/remote-config/src/storage/storage_cache.ts +++ b/packages/remote-config/src/storage/storage_cache.ts @@ -16,7 +16,7 @@ */ import { FetchStatus, CustomSignals } from '@firebase/remote-config-types'; -import { FirebaseRemoteConfigObject } from '../client/remote_config_fetch_client'; +import { FirebaseRemoteConfigObject } from '../public_types'; import { Storage } from './storage'; /** diff --git a/packages/remote-config/test/api.test.ts b/packages/remote-config/test/api.test.ts new file mode 100644 index 00000000000..b1fe658ebae --- /dev/null +++ b/packages/remote-config/test/api.test.ts @@ -0,0 +1,152 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + ensureInitialized, + fetchAndActivate, + FetchResponse, + getRemoteConfig, + getString +} from '../src'; +import '../test/setup'; +import { + deleteApp, + FirebaseApp, + initializeApp, + _addOrOverwriteComponent +} from '@firebase/app'; +import * as sinon from 'sinon'; +import { Component, ComponentType } from '@firebase/component'; +import { FirebaseInstallations } from '@firebase/installations-types'; +import { openDatabase, APP_NAMESPACE_STORE } from '../src/storage/storage'; + +const fakeFirebaseConfig = { + apiKey: 'api-key', + authDomain: 'project-id.firebaseapp.com', + databaseURL: 'https://project-id.firebaseio.com', + projectId: 'project-id', + storageBucket: 'project-id.appspot.com', + messagingSenderId: 'sender-id', + appId: '1:111:web:a1234' +}; + +async function clearDatabase(): Promise { + const db = await openDatabase(); + db.transaction([APP_NAMESPACE_STORE], 'readwrite') + .objectStore(APP_NAMESPACE_STORE) + .clear(); +} + +describe('Remote Config API', () => { + let app: FirebaseApp; + const STUB_FETCH_RESPONSE: FetchResponse = { + status: 200, + eTag: 'asdf', + config: { 'foobar': 'hello world' } + }; + let fetchStub: sinon.SinonStub; + + beforeEach(() => { + fetchStub = sinon.stub(window, 'fetch'); + app = initializeApp(fakeFirebaseConfig); + _addOrOverwriteComponent( + app, + new Component( + 'installations-internal', + () => { + return { + getId: () => Promise.resolve('fis-id'), + getToken: () => Promise.resolve('fis-token') + } as any as FirebaseInstallations; + }, + ComponentType.PUBLIC + ) as any + ); + }); + + afterEach(async () => { + fetchStub.restore(); + await clearDatabase(); + await deleteApp(app); + }); + + function setFetchResponse(response: FetchResponse = { status: 200 }): void { + fetchStub.returns( + Promise.resolve({ + ok: response.status === 200, + status: response.status, + headers: new Headers({ ETag: response.eTag || '' }), + json: () => + Promise.resolve({ + entries: response.config, + state: 'OK' + }) + } as Response) + ); + } + + it('allows multiple initializations if options are same', () => { + const rc = getRemoteConfig(app, { templateId: 'altTemplate' }); + const rc2 = getRemoteConfig(app, { templateId: 'altTemplate' }); + expect(rc).to.equal(rc2); + }); + + it('throws an error if options are different', () => { + getRemoteConfig(app); + expect(() => { + getRemoteConfig(app, { templateId: 'altTemplate' }); + }).to.throw(/Remote Config already initialized/); + }); + + it('makes a fetch call', async () => { + const rc = getRemoteConfig(app); + setFetchResponse(STUB_FETCH_RESPONSE); + await fetchAndActivate(rc); + await ensureInitialized(rc); + expect(getString(rc, 'foobar')).to.equal('hello world'); + }); + + it('calls fetch with default templateId', async () => { + const rc = getRemoteConfig(app); + setFetchResponse(); + await fetchAndActivate(rc); + await ensureInitialized(rc); + expect(fetchStub).to.be.calledOnceWith( + 'https://firebaseremoteconfig.googleapis.com/v1/projects/project-id/namespaces/firebase:fetch?key=api-key', + sinon.match.object + ); + }); + + it('calls fetch with alternate templateId', async () => { + const rc = getRemoteConfig(app, { templateId: 'altTemplate' }); + setFetchResponse(); + await fetchAndActivate(rc); + expect(fetchStub).to.be.calledOnceWith( + 'https://firebaseremoteconfig.googleapis.com/v1/projects/project-id/namespaces/altTemplate:fetch?key=api-key', + sinon.match.object + ); + }); + + it('hydrates with initialFetchResponse', async () => { + const rc = getRemoteConfig(app, { + initialFetchResponse: STUB_FETCH_RESPONSE + }); + await ensureInitialized(rc); + expect(getString(rc, 'foobar')).to.equal('hello world'); + }); +}); diff --git a/packages/remote-config/test/client/caching_client.test.ts b/packages/remote-config/test/client/caching_client.test.ts index a808dffb605..7f8fa04ca9d 100644 --- a/packages/remote-config/test/client/caching_client.test.ts +++ b/packages/remote-config/test/client/caching_client.test.ts @@ -17,9 +17,9 @@ import '../setup'; import { expect } from 'chai'; +import { FetchResponse } from '../../src'; import { RemoteConfigFetchClient, - FetchResponse, FetchRequest, RemoteConfigAbortSignal } from '../../src/client/remote_config_fetch_client'; diff --git a/packages/remote-config/test/client/retrying_client.test.ts b/packages/remote-config/test/client/retrying_client.test.ts index 65641b438bd..9b06ea5a957 100644 --- a/packages/remote-config/test/client/retrying_client.test.ts +++ b/packages/remote-config/test/client/retrying_client.test.ts @@ -18,10 +18,10 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import { Storage, ThrottleMetadata } from '../../src/storage/storage'; +import { FetchResponse } from '../../src'; import { RemoteConfigFetchClient, FetchRequest, - FetchResponse, RemoteConfigAbortSignal } from '../../src/client/remote_config_fetch_client'; import { diff --git a/packages/remote-config/test/remote_config.test.ts b/packages/remote-config/test/remote_config.test.ts index 51304bc3b2f..8010f54f26d 100644 --- a/packages/remote-config/test/remote_config.test.ts +++ b/packages/remote-config/test/remote_config.test.ts @@ -17,6 +17,7 @@ import { FirebaseApp } from '@firebase/app'; import { + FetchResponse, RemoteConfig as RemoteConfigType, LogLevel as RemoteConfigLogLevel } from '../src/public_types'; @@ -25,10 +26,7 @@ import * as sinon from 'sinon'; import { StorageCache } from '../src/storage/storage_cache'; import { Storage } from '../src/storage/storage'; import { RemoteConfig } from '../src/remote_config'; -import { - RemoteConfigFetchClient, - FetchResponse -} from '../src/client/remote_config_fetch_client'; +import { RemoteConfigFetchClient } from '../src/client/remote_config_fetch_client'; import { Value } from '../src/value'; import './setup'; import { ERROR_FACTORY, ErrorCode } from '../src/errors'; diff --git a/packages/remote-config/test/storage/storage.test.ts b/packages/remote-config/test/storage/storage.test.ts index 7a865107791..5b8418a1187 100644 --- a/packages/remote-config/test/storage/storage.test.ts +++ b/packages/remote-config/test/storage/storage.test.ts @@ -18,12 +18,14 @@ import '../setup'; import { expect } from 'chai'; import { - Storage, ThrottleMetadata, openDatabase, - APP_NAMESPACE_STORE + APP_NAMESPACE_STORE, + IndexedDbStorage, + InMemoryStorage, + Storage } from '../../src/storage/storage'; -import { FetchResponse } from '../../src/client/remote_config_fetch_client'; +import { FetchResponse } from '../../src'; // Clears global IndexedDB state. async function clearDatabase(): Promise { @@ -34,141 +36,161 @@ async function clearDatabase(): Promise { } describe('Storage', () => { - const storage = new Storage('appId', 'appName', 'namespace'); + const indexedDbTestCase = { + getStorage: () => new IndexedDbStorage('appId', 'appName', 'namespace'), + name: 'IndexedDbStorage' + }; + + const inMemoryStorage = { + getStorage: () => new InMemoryStorage(), + name: 'InMemoryStorage' + }; beforeEach(async () => { await clearDatabase(); }); - it('constructs a composite key', async () => { + it(`${indexedDbTestCase.name} constructs a composite key`, async () => { // This is defensive, but the cost of accidentally changing the key composition is high. - expect(storage.createCompositeKey('throttle_metadata')).to.eq( - 'appId,appName,namespace,throttle_metadata' - ); + expect( + indexedDbTestCase.getStorage().createCompositeKey('throttle_metadata') + ).to.eq('appId,appName,namespace,throttle_metadata'); }); - it('sets and gets last fetch attempt status', async () => { - const expectedStatus = 'success'; + for (const { name, getStorage } of [indexedDbTestCase, inMemoryStorage]) { + describe(name, () => { + let storage: Storage; - await storage.setLastFetchStatus(expectedStatus); + beforeEach(() => { + storage = getStorage(); + }); - const actualStatus = await storage.getLastFetchStatus(); + it('sets and gets last fetch attempt status', async () => { + const expectedStatus = 'success'; - expect(actualStatus).to.deep.eq(expectedStatus); - }); + await storage.setLastFetchStatus(expectedStatus); - it('sets and gets last fetch success timestamp', async () => { - const lastSuccessfulFetchTimestampMillis = 123; + const actualStatus = await storage.getLastFetchStatus(); - await storage.setLastSuccessfulFetchTimestampMillis( - lastSuccessfulFetchTimestampMillis - ); + expect(actualStatus).to.deep.eq(expectedStatus); + }); - const actualMetadata = - await storage.getLastSuccessfulFetchTimestampMillis(); + it('sets and gets last fetch success timestamp', async () => { + const lastSuccessfulFetchTimestampMillis = 123; - expect(actualMetadata).to.deep.eq(lastSuccessfulFetchTimestampMillis); - }); + await storage.setLastSuccessfulFetchTimestampMillis( + lastSuccessfulFetchTimestampMillis + ); - it('sets and gets last successful fetch response', async () => { - const lastSuccessfulFetchResponse = { status: 200 } as FetchResponse; + const actualMetadata = + await storage.getLastSuccessfulFetchTimestampMillis(); - await storage.setLastSuccessfulFetchResponse(lastSuccessfulFetchResponse); + expect(actualMetadata).to.deep.eq(lastSuccessfulFetchTimestampMillis); + }); - const actualConfig = await storage.getLastSuccessfulFetchResponse(); + it('sets and gets last successful fetch response', async () => { + const lastSuccessfulFetchResponse = { status: 200 } as FetchResponse; - expect(actualConfig).to.deep.eq(lastSuccessfulFetchResponse); - }); + await storage.setLastSuccessfulFetchResponse( + lastSuccessfulFetchResponse + ); - it('sets and gets active config', async () => { - const expectedConfig = { key: 'value' }; + const actualConfig = await storage.getLastSuccessfulFetchResponse(); - await storage.setActiveConfig(expectedConfig); + expect(actualConfig).to.deep.eq(lastSuccessfulFetchResponse); + }); - const storedConfig = await storage.getActiveConfig(); + it('sets and gets active config', async () => { + const expectedConfig = { key: 'value' }; - expect(storedConfig).to.deep.eq(expectedConfig); - }); + await storage.setActiveConfig(expectedConfig); - it('sets and gets active config etag', async () => { - const expectedEtag = 'etag'; + const storedConfig = await storage.getActiveConfig(); - await storage.setActiveConfigEtag(expectedEtag); + expect(storedConfig).to.deep.eq(expectedConfig); + }); - const storedConfigEtag = await storage.getActiveConfigEtag(); + it('sets and gets active config etag', async () => { + const expectedEtag = 'etag'; - expect(storedConfigEtag).to.deep.eq(expectedEtag); - }); + await storage.setActiveConfigEtag(expectedEtag); - it('sets, gets and deletes throttle metadata', async () => { - const expectedMetadata = { - throttleEndTimeMillis: 1 - } as ThrottleMetadata; + const storedConfigEtag = await storage.getActiveConfigEtag(); - await storage.setThrottleMetadata(expectedMetadata); + expect(storedConfigEtag).to.deep.eq(expectedEtag); + }); - let actualMetadata = await storage.getThrottleMetadata(); + it('sets, gets and deletes throttle metadata', async () => { + const expectedMetadata = { + throttleEndTimeMillis: 1 + } as ThrottleMetadata; - expect(actualMetadata).to.deep.eq(expectedMetadata); + await storage.setThrottleMetadata(expectedMetadata); - await storage.deleteThrottleMetadata(); + let actualMetadata = await storage.getThrottleMetadata(); - actualMetadata = await storage.getThrottleMetadata(); + expect(actualMetadata).to.deep.eq(expectedMetadata); - expect(actualMetadata).to.be.undefined; - }); + await storage.deleteThrottleMetadata(); - it('sets and gets custom signals', async () => { - const customSignals = { key: 'value', key1: 'value1', key2: 1 }; - const customSignalsInStorage = { - key: 'value', - key1: 'value1', - key2: '1' - }; + actualMetadata = await storage.getThrottleMetadata(); - await storage.setCustomSignals(customSignals); + expect(actualMetadata).to.be.undefined; + }); - const storedCustomSignals = await storage.getCustomSignals(); + it('sets and gets custom signals', async () => { + const customSignals = { key: 'value', key1: 'value1', key2: 1 }; + const customSignalsInStorage = { + key: 'value', + key1: 'value1', + key2: '1' + }; - expect(storedCustomSignals).to.deep.eq(customSignalsInStorage); - }); + await storage.setCustomSignals(customSignals); - it('upserts custom signals when key is present in storage', async () => { - const customSignals = { key: 'value', key1: 'value1' }; - const updatedSignals = { key: 'value', key1: 'value2' }; + const storedCustomSignals = await storage.getCustomSignals(); - await storage.setCustomSignals(customSignals); + expect(storedCustomSignals).to.deep.eq(customSignalsInStorage); + }); - await storage.setCustomSignals({ key1: 'value2' }); + it('upserts custom signals when key is present in storage', async () => { + const customSignals = { key: 'value', key1: 'value1' }; + const updatedSignals = { key: 'value', key1: 'value2' }; - const storedCustomSignals = await storage.getCustomSignals(); + await storage.setCustomSignals(customSignals); - expect(storedCustomSignals).to.deep.eq(updatedSignals); - }); + await storage.setCustomSignals({ key1: 'value2' }); - it('deletes custom signal when value supplied is null', async () => { - const customSignals = { key: 'value', key1: 'value1' }; - const updatedSignals = { key: 'value' }; + const storedCustomSignals = await storage.getCustomSignals(); - await storage.setCustomSignals(customSignals); + expect(storedCustomSignals).to.deep.eq(updatedSignals); + }); - await storage.setCustomSignals({ key1: null }); + it('deletes custom signal when value supplied is null', async () => { + const customSignals = { key: 'value', key1: 'value1' }; + const updatedSignals = { key: 'value' }; - const storedCustomSignals = await storage.getCustomSignals(); + await storage.setCustomSignals(customSignals); - expect(storedCustomSignals).to.deep.eq(updatedSignals); - }); + await storage.setCustomSignals({ key1: null }); - it('throws an error when supplied with excess custom signals', async () => { - const customSignals: { [key: string]: string } = {}; - for (let i = 0; i < 101; i++) { - customSignals[`key${i}`] = `value${i}`; - } - - await expect( - storage.setCustomSignals(customSignals) - ).to.eventually.be.rejectedWith( - 'Remote Config: Setting more than 100 custom signals is not supported.' - ); - }); + const storedCustomSignals = await storage.getCustomSignals(); + + expect(storedCustomSignals).to.deep.eq(updatedSignals); + }); + + it('throws an error when supplied with excess custom signals', async () => { + const customSignals: { [key: string]: string } = {}; + for (let i = 0; i < 101; i++) { + customSignals[`key${i}`] = `value${i}`; + } + + await expect( + storage.setCustomSignals(customSignals) + ).to.eventually.be.rejectedWith( + 'Remote Config: Setting more than 100 custom signals is not supported.' + ); + }); + }); + } }); From c791ecf3a03a0e4f56fcdc49b703578135bf8ce6 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 11 Feb 2025 16:59:18 -0500 Subject: [PATCH 106/295] Emulator Idempotency: Auth (#8750) Update the `connectAuthEmulator` function to support its invocation more than once. If the Auth instance is already in use, and `connectAuthEmulator` is invoked with the same configuration, then the invocation will now succeed instead of assert. This unlocks support for web frameworks which may render the page numerous times with the same instances of auth. Before this PR customers needed to add extra code to guard against calling `connectAuthEmulator` in their SSR logic. Now we do that guarding logic on their behalf which should simplify our customer's apps. Fixes #6824. --- .changeset/lemon-candles-vanish.md | 8 ++++ packages/auth/src/core/auth/emulator.test.ts | 35 +++++++++++++++++ packages/auth/src/core/auth/emulator.ts | 40 +++++++++++++++----- 3 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 .changeset/lemon-candles-vanish.md diff --git a/.changeset/lemon-candles-vanish.md b/.changeset/lemon-candles-vanish.md new file mode 100644 index 00000000000..715db44d0d7 --- /dev/null +++ b/.changeset/lemon-candles-vanish.md @@ -0,0 +1,8 @@ +--- +'@firebase/auth': patch +'firebase': patch +--- + +Fixed: invoking `connectAuthEmulator` multiple times with the same parameters will no longer cause +an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). + diff --git a/packages/auth/src/core/auth/emulator.test.ts b/packages/auth/src/core/auth/emulator.test.ts index 71a30883218..47c5d927c44 100644 --- a/packages/auth/src/core/auth/emulator.test.ts +++ b/packages/auth/src/core/auth/emulator.test.ts @@ -76,6 +76,41 @@ describe('core/auth/emulator', () => { ); }); + it('passes with same config if a network request has already been made', async () => { + expect(() => connectAuthEmulator(auth, 'http://127.0.0.1:2020')).to.not + .throw; + await user.delete(); + expect(() => connectAuthEmulator(auth, 'http://127.0.0.1:2020')).to.not + .throw; + }); + + it('fails with alternate config if a network request has already been made', async () => { + expect(() => connectAuthEmulator(auth, 'http://127.0.0.1:2020')).to.not + .throw; + await user.delete(); + expect(() => connectAuthEmulator(auth, 'http://127.0.0.1:2021')).to.throw( + FirebaseError, + 'auth/emulator-config-failed' + ); + }); + + it('subsequent calls update the endpoint appropriately', async () => { + connectAuthEmulator(auth, 'http://127.0.0.1:2021'); + expect(auth.emulatorConfig).to.eql({ + protocol: 'http', + host: '127.0.0.1', + port: 2021, + options: { disableWarnings: false } + }); + connectAuthEmulator(auth, 'http://127.0.0.1:2020'); + expect(auth.emulatorConfig).to.eql({ + protocol: 'http', + host: '127.0.0.1', + port: 2020, + options: { disableWarnings: false } + }); + }); + it('updates the endpoint appropriately', async () => { connectAuthEmulator(auth, 'http://127.0.0.1:2020'); await user.delete(); diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index f0ccb048f1f..60cc9403d3d 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,6 +18,7 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; +import { deepEqual } from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -47,12 +48,6 @@ export function connectAuthEmulator( options?: { disableWarnings: boolean } ): void { const authInternal = _castAuth(auth); - _assert( - authInternal._canInitEmulator, - authInternal, - AuthErrorCode.EMULATOR_CONFIG_FAILED - ); - _assert( /^https?:\/\//.test(url), authInternal, @@ -66,15 +61,42 @@ export function connectAuthEmulator( const portStr = port === null ? '' : `:${port}`; // Always replace path with "/" (even if input url had no path at all, or had a different one). - authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` }; - authInternal.settings.appVerificationDisabledForTesting = true; - authInternal.emulatorConfig = Object.freeze({ + const emulator = { url: `${protocol}//${host}${portStr}/` }; + const emulatorConfig = Object.freeze({ host, port, protocol: protocol.replace(':', ''), options: Object.freeze({ disableWarnings }) }); + // There are a few scenarios to guard against if the Auth instance has already started: + if (!authInternal._canInitEmulator) { + // Applications may not initialize the emulator for the first time if Auth has already started + // to make network requests. + _assert( + authInternal.config.emulator && authInternal.emulatorConfig, + authInternal, + AuthErrorCode.EMULATOR_CONFIG_FAILED + ); + + // Applications may not alter the configuration of the emulator (aka pass a different config) + // once Auth has started to make network requests. + _assert( + deepEqual(emulator, authInternal.config.emulator) && + deepEqual(emulatorConfig, authInternal.emulatorConfig), + authInternal, + AuthErrorCode.EMULATOR_CONFIG_FAILED + ); + + // It's valid, however, to invoke connectAuthEmulator() after Auth has started making + // connections, so long as the config matches the existing config. This results in a no-op. + return; + } + + authInternal.config.emulator = emulator; + authInternal.emulatorConfig = emulatorConfig; + authInternal.settings.appVerificationDisabledForTesting = true; + if (!disableWarnings) { emitEmulatorWarning(); } From 6a28a72ebd351381620da85fff25703d518e2c5c Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 12 Feb 2025 10:18:32 -0600 Subject: [PATCH 107/295] Upgrade dependencies (#8781) * first batch * @rollup/plugin-node-resolve 13 -> 16 --- e2e/package.json | 8 +- package.json | 14 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/auth-compat/demo/package.json | 2 +- packages/auth/demo/package.json | 2 +- packages/firebase/package.json | 2 +- packages/firestore-compat/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- repo-scripts/changelog-generator/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- yarn.lock | 276 +++++++++++------- 14 files changed, 185 insertions(+), 135 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 78b9ced48ce..1def58d80b3 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -20,19 +20,19 @@ "firebase": "11.3.0" }, "devDependencies": { - "@babel/core": "7.26.0", - "@babel/preset-env": "7.26.0", + "@babel/core": "7.26.8", + "@babel/preset-env": "7.26.8", "@babel/preset-typescript": "7.26.0", "@types/jest": "29.5.14", "babel-jest": "29.7.0", - "babel-loader": "8.3.0", + "babel-loader": "8.4.1", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "ts-node": "10.9.2", "typescript": "5.5.4", "webpack": "5.76.0", "webpack-cli": "5.1.4", - "webpack-dev-server": "5.1.0" + "webpack-dev-server": "5.2.0" }, "engines": { "node": ">=18.0.0" diff --git a/package.json b/package.json index a48fe698ff4..bff8b2c715e 100644 --- a/package.json +++ b/package.json @@ -62,9 +62,9 @@ "repo-scripts/*" ], "devDependencies": { - "@babel/core": "7.26.7", + "@babel/core": "7.26.8", "@babel/plugin-transform-modules-commonjs": "7.26.3", - "@babel/preset-env": "7.26.7", + "@babel/preset-env": "7.26.8", "@babel/preset-typescript": "7.26.0", "@babel/register": "7.25.9", "@changesets/changelog-github": "0.5.0", @@ -80,7 +80,7 @@ "@types/long": "4.0.2", "@types/mocha": "9.1.1", "@types/mz": "2.7.8", - "@types/node": "18.19.74", + "@types/node": "18.19.75", "@types/request": "2.48.12", "@types/sinon": "9.0.11", "@types/sinon-chai": "3.2.12", @@ -106,7 +106,7 @@ "eslint-plugin-unused-imports": "3.2.0", "express": "4.21.2", "find-free-port": "2.0.0", - "firebase-tools": "13.29.2", + "firebase-tools": "13.30.0", "glob": "7.2.3", "http-server": "14.1.1", "indexeddbshim": "10.1.0", @@ -139,18 +139,18 @@ "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", - "playwright": "1.50.0", + "playwright": "1.50.1", "postinstall-postinstall": "2.1.0", "prettier": "2.8.8", "protractor": "5.4.2", "request": "2.88.2", - "semver": "7.6.3", + "semver": "7.7.1", "simple-git": "3.27.0", "sinon": "9.2.4", "sinon-chai": "3.7.0", "source-map-loader": "1.1.3", "sqlite3": "5.1.7", - "terser": "5.37.0", + "terser": "5.38.1", "ts-loader": "9.5.2", "ts-node": "10.9.2", "tsec": "0.2.8", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index d72382771e1..3ef0096ff78 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -51,7 +51,7 @@ "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 67bf4a05c88..512d4ec3ccb 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -47,7 +47,7 @@ "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, diff --git a/packages/app-check/package.json b/packages/app-check/package.json index f2019186753..89b1e74343e 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -48,7 +48,7 @@ "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, diff --git a/packages/auth-compat/demo/package.json b/packages/auth-compat/demo/package.json index b6cc9d3c142..8e144174238 100644 --- a/packages/auth-compat/demo/package.json +++ b/packages/auth-compat/demo/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/auth/demo/package.json b/packages/auth/demo/package.json index 86418bcab07..3d9c38bbc5c 100644 --- a/packages/auth/demo/package.json +++ b/packages/auth/demo/package.json @@ -32,7 +32,7 @@ "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "lerna": "4.0.0" }, "repository": { diff --git a/packages/firebase/package.json b/packages/firebase/package.json index e6b40af2ca5..2c99c07fcce 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -431,7 +431,7 @@ "devDependencies": { "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-sourcemaps": "0.6.3", "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 9ac9b3762c1..15a41549db7 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -59,7 +59,7 @@ "rollup-plugin-sourcemaps": "0.6.3", "@rollup/plugin-terser": "0.4.4", "rollup-plugin-typescript2": "0.36.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "ts-node": "10.9.2", "typescript": "5.5.4" }, diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 06f9e3e4cc0..220f5409733 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -48,7 +48,7 @@ "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-uglify": "6.0.4", "typescript": "5.5.4" diff --git a/packages/installations/package.json b/packages/installations/package.json index a09b416459c..77124f2280c 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -53,7 +53,7 @@ "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "rollup-plugin-typescript2": "0.36.0", "rollup-plugin-uglify": "6.0.4", "typescript": "5.5.4" diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 71095ac9787..f03669596bc 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -19,7 +19,7 @@ "dependencies": { "@changesets/types": "3.3.0", "@changesets/get-github-info": "0.6.0", - "@types/node": "18.19.74" + "@types/node": "18.19.75" }, "license": "Apache-2.0", "devDependencies": { diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 3cf50dddc98..6d2a84ab88e 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -25,7 +25,7 @@ "@firebase/util": "1.10.3", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "13.3.0", + "@rollup/plugin-node-resolve": "16.0.0", "@rollup/plugin-virtual": "2.1.0", "@types/webpack": "5.28.5", "child-process-promise": "2.2.1", diff --git a/yarn.lock b/yarn.lock index e240303fd0f..5a27a2b310e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,7 +34,34 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz#df93ac37f4417854130e21d72c66ff3d4b897fc7" integrity sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg== -"@babel/core@7.26.7", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.7.5": +"@babel/compat-data@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" + integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== + +"@babel/core@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz#7742f11c75acea6b08a8e24c5c0c8c89e89bf53e" + integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.8" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.7" + "@babel/parser" "^7.26.8" + "@babel/template" "^7.26.8" + "@babel/traverse" "^7.26.8" + "@babel/types" "^7.26.8" + "@types/gensync" "^1.0.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.7.5": version "7.26.7" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz#0439347a183b97534d52811144d763a17f9d2b24" integrity sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA== @@ -66,6 +93,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz#f9c5e770309e12e3099ad8271e52f6caa15442ab" + integrity sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA== + dependencies: + "@babel/parser" "^7.26.8" + "@babel/types" "^7.26.8" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/helper-annotate-as-pure@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" @@ -106,7 +144,7 @@ regexpu-core "^6.2.0" semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": +"@babel/helper-define-polyfill-provider@^0.6.3": version "0.6.3" resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== @@ -219,6 +257,13 @@ dependencies: "@babel/types" "^7.26.7" +"@babel/parser@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.8.tgz#deca2b4d99e5e1b1553843b99823f118da6107c2" + integrity sha512-TZIQ25pkSoaKEYYaHbbxkfL36GNsQ6iFiBbeuzAkLnXayKR1yP1zFe+NxuZWWsUyvt8icPU9CCq0sgWGXR1GEw== + dependencies: + "@babel/types" "^7.26.8" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" @@ -404,14 +449,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" - integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== +"@babel/plugin-transform-async-generator-functions@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz#5e3991135e3b9c6eaaf5eff56d1ae5a11df45ff8" + integrity sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/traverse" "^7.26.8" "@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" @@ -739,12 +784,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" - integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== +"@babel/plugin-transform-template-literals@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz#966b15d153a991172a540a69ad5e1845ced990b5" + integrity sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typeof-symbol@^7.26.7": version "7.26.7" @@ -795,12 +840,12 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.26.7": - version "7.26.7" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.7.tgz#24d38e211f4570b8d806337035cc3ae798e0c36d" - integrity sha512-Ycg2tnXwixaXOVb29rana8HNPgLVBof8qqtNQ9LE22IoyZboQbGSxI6ZySMdW3K5nAe6gu35IaJefUJflhUFTQ== +"@babel/preset-env@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz#7af0090829b606d2046db99679004731e1dc364d" + integrity sha512-um7Sy+2THd697S4zJEfv/U5MHGJzkN2xhtsR3T/SWRbVSic62nbISh51VVfU9JiO/L/Z97QczHTaFVkOU8IzNg== dependencies: - "@babel/compat-data" "^7.26.5" + "@babel/compat-data" "^7.26.8" "@babel/helper-compilation-targets" "^7.26.5" "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-validator-option" "^7.25.9" @@ -814,7 +859,7 @@ "@babel/plugin-syntax-import-attributes" "^7.26.0" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.26.8" "@babel/plugin-transform-async-to-generator" "^7.25.9" "@babel/plugin-transform-block-scoped-functions" "^7.26.5" "@babel/plugin-transform-block-scoping" "^7.25.9" @@ -857,7 +902,7 @@ "@babel/plugin-transform-shorthand-properties" "^7.25.9" "@babel/plugin-transform-spread" "^7.25.9" "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.26.8" "@babel/plugin-transform-typeof-symbol" "^7.26.7" "@babel/plugin-transform-unicode-escapes" "^7.25.9" "@babel/plugin-transform-unicode-property-regex" "^7.25.9" @@ -865,9 +910,9 @@ "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" "@babel/preset-modules" "0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-corejs3 "^0.11.0" babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.38.1" + core-js-compat "^3.40.0" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -917,6 +962,15 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" +"@babel/template@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.8.tgz#db3898f47a17bab2f4c78ec1d0de38527c2ffe19" + integrity sha512-iNKaX3ZebKIsCvJ+0jd6embf+Aulaa3vNBqZ41kM7iTWjx5qzWKXGHiJUW3+nTpQ18SG11hdF8OAzKrpXkb96Q== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/parser" "^7.26.8" + "@babel/types" "^7.26.8" + "@babel/traverse@^7.25.9", "@babel/traverse@^7.26.5", "@babel/traverse@^7.26.7": version "7.26.7" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz#99a0a136f6a75e7fb8b0a1ace421e0b25994b8bb" @@ -930,6 +984,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz#0a8a9c2b7cc9519eed14275f4fd2278ad46e8cc9" + integrity sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.8" + "@babel/parser" "^7.26.8" + "@babel/template" "^7.26.8" + "@babel/types" "^7.26.8" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.25.9", "@babel/types@^7.26.5", "@babel/types@^7.26.7", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.26.7" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz#5e2b89c0768e874d4d061961f3a5a153d71dc17a" @@ -938,6 +1005,14 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.8.tgz#97dcdc190fab45be7f3dc073e3c11160d677c127" + integrity sha512-eUuWapzEGWFEpHFxgEaBG8e3n6S8L3MSu0oda755rOfabWPnh0Our1AozNFVUxGFIhbKgd1ksprsoDGMinTOTA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bazel/runfiles@^6.3.1": version "6.3.1" resolved "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz#3f8824b2d82853377799d42354b4df78ab0ace0b" @@ -1187,7 +1262,7 @@ enabled "2.0.x" kuler "^2.0.0" -"@electric-sql/pglite@^0.2.0": +"@electric-sql/pglite@^0.2.16": version "0.2.16" resolved "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.2.16.tgz#df586341c8143ea997db0e51aae30c2dc1a634fa" integrity sha512-dCSHpoOKuTxecaYhWDRp2yFTN3XWcMPMrBVl5yOR8VZEUprz4+R3iuU7BipmlsqBnBDO/6l9H/C2ZwJdunkWyw== @@ -2547,17 +2622,16 @@ dependencies: "@rollup/pluginutils" "^5.1.0" -"@rollup/plugin-node-resolve@13.3.0": - version "13.3.0" - resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" - integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== +"@rollup/plugin-node-resolve@16.0.0": + version "16.0.0" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.0.tgz#b1a0594661f40d7b061d82136e847354ff85f211" + integrity sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg== dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" deepmerge "^4.2.2" - is-builtin-module "^3.1.0" is-module "^1.0.0" - resolve "^1.19.0" + resolve "^1.22.1" "@rollup/plugin-strip@2.1.0": version "2.1.0" @@ -2599,7 +2673,7 @@ estree-walker "^2.0.1" picomatch "^2.2.2" -"@rollup/pluginutils@^5.1.0": +"@rollup/pluginutils@^5.0.1", "@rollup/pluginutils@^5.1.0": version "5.1.4" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a" integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ== @@ -2933,6 +3007,11 @@ dependencies: "@types/node" "*" +"@types/gensync@^1.0.0": + version "1.0.4" + resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz#7122d8f0cd3bf437f9725cc95b180197190cf50b" + integrity sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA== + "@types/glob@^7.1.1": version "7.2.0" resolved "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" @@ -3074,10 +3153,10 @@ resolved "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@18.19.74": - version "18.19.74" - resolved "https://registry.npmjs.org/@types/node/-/node-18.19.74.tgz#4d093acd2a558ebbc5f0efa4e20ce63791b0cc58" - integrity sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A== +"@types/node@18.19.75": + version "18.19.75" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz#be932799d1ab40779ffd16392a2b2300f81b565d" + integrity sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw== dependencies: undici-types "~5.26.4" @@ -3126,12 +3205,10 @@ "@types/tough-cookie" "*" form-data "^2.5.0" -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== "@types/resolve@1.20.6": version "1.20.6" @@ -4395,13 +4472,13 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.3" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.6: - version "0.10.6" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" - integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== +babel-plugin-polyfill-corejs3@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz#4e4e182f1bb37c7ba62e2af81d8dd09df31344f6" + integrity sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" - core-js-compat "^3.38.0" + "@babel/helper-define-polyfill-provider" "^0.6.3" + core-js-compat "^3.40.0" babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.3" @@ -4877,11 +4954,6 @@ builtin-modules@^1.1.1: resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== -builtin-modules@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -5841,7 +5913,7 @@ copy-props@^2.0.1: each-props "^1.3.2" is-plain-object "^5.0.0" -core-js-compat@^3.38.0, core-js-compat@^3.38.1: +core-js-compat@^3.40.0: version "3.40.0" resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== @@ -7709,12 +7781,12 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" -firebase-tools@13.29.2: - version "13.29.2" - resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-13.29.2.tgz#30e6a22da541448eb8182eb40e0e39a1e5e4bcdf" - integrity sha512-6P4PR4TcrATPI+ut0qhh7gW3GJ0HYaLC2Fr5lesAXkrdAYw7OvOGDzXaRFuORwkCS5grVQuCcJVSsVbjXKAkew== +firebase-tools@13.30.0: + version "13.30.0" + resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-13.30.0.tgz#64fe35402b7a6cb1df20897505a2d1ce3e0a03ba" + integrity sha512-YJ2eGqDNAyJwlw3b1t5d9yaY8a3yas732g9p72cMnO0q8bOhsq30B2spm/Y5YKnNM/xL5DT1KChqlxLEkloc+Q== dependencies: - "@electric-sql/pglite" "^0.2.0" + "@electric-sql/pglite" "^0.2.16" "@google-cloud/cloud-sql-connector" "^1.3.3" "@google-cloud/pubsub" "^4.5.0" abort-controller "^3.0.0" @@ -9336,13 +9408,6 @@ is-buffer@^1.1.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-builtin-module@^3.1.0: - version "3.2.1" - resolved "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" - integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== - dependencies: - builtin-modules "^3.3.0" - is-callable@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" @@ -11787,11 +11852,6 @@ moo@^0.5.0: resolved "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz#f9fe82473bc7c184b0d32e2215d3f6e67278733c" integrity sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q== -moo@^0.5.0: - version "0.5.2" - resolved "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz#f9fe82473bc7c184b0d32e2215d3f6e67278733c" - integrity sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q== - morgan@^1.10.0, morgan@^1.8.2: version "1.10.0" resolved "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" @@ -13240,17 +13300,17 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -playwright-core@1.50.0: - version "1.50.0" - resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.0.tgz#28dd6a1488211c193933695ed337a5b44d46867c" - integrity sha512-CXkSSlr4JaZs2tZHI40DsZUN/NIwgaUPsyLuOAaIZp2CyF2sN5MM5NJsyB188lFSSozFxQ5fPT4qM+f0tH/6wQ== +playwright-core@1.50.1: + version "1.50.1" + resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz#6a0484f1f1c939168f40f0ab3828c4a1592c4504" + integrity sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ== -playwright@1.50.0: - version "1.50.0" - resolved "https://registry.npmjs.org/playwright/-/playwright-1.50.0.tgz#ccaf334f948d78139922844de55a18f8ae785410" - integrity sha512-+GinGfGTrd2IfX1TA4N2gNmeIksSb+IAe589ZH+FlmpV3MYTx6+buChGIuDLQwrGNCw2lWibqV50fU510N7S+w== +playwright@1.50.1: + version "1.50.1" + resolved "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz#2f93216511d65404f676395bfb97b41aa052b180" + integrity sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw== dependencies: - playwright-core "1.50.0" + playwright-core "1.50.1" optionalDependencies: fsevents "2.3.2" @@ -14190,7 +14250,7 @@ resolve.exports@^2.0.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.4, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@~1.22.0, resolve@~1.22.1: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@~1.22.0, resolve@~1.22.1: version "1.22.10" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== @@ -14590,16 +14650,21 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.6.3, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: - version "7.6.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== +semver@7.7.1: + version "7.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: + version "7.6.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + semver@~7.3.0: version "7.3.8" resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" @@ -15394,7 +15459,7 @@ string-argv@~0.3.1: resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15412,15 +15477,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -15484,7 +15540,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15505,13 +15561,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -15799,6 +15848,16 @@ terser@5.37.0, terser@^5.17.4, terser@^5.31.1: commander "^2.20.0" source-map-support "~0.5.20" +terser@5.38.1: + version "5.38.1" + resolved "https://registry.npmjs.org/terser/-/terser-5.38.1.tgz#a18d83c8acf3175e847ab0b66839f3c318167c58" + integrity sha512-GWANVlPM/ZfYzuPHjq0nxT+EbOEDDN3Jwhwdg1D8TU8oSkktp8w64Uq4auuGLxFSoNTRDncTq2hQHX1Ld9KHkA== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -17144,7 +17203,7 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17178,15 +17237,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From c8e5b3e77f1ae8ed1e5300b477c4f42ac08d5f16 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 12 Feb 2025 11:43:04 -0600 Subject: [PATCH 108/295] Publish VertexAI API's tagged with `@beta` (#8788) --- packages/vertexai/api-extractor.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vertexai/api-extractor.json b/packages/vertexai/api-extractor.json index 8a3c6cb251e..831039d9713 100644 --- a/packages/vertexai/api-extractor.json +++ b/packages/vertexai/api-extractor.json @@ -5,6 +5,6 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "/dist/.d.ts", - "publicTrimmedFilePath": "/dist/-public.d.ts" + "betaTrimmedFilePath": "/dist/-public.d.ts" } -} \ No newline at end of file +} From 554c7bdc12cfde834ce5c4fa729a6cb790e1e5c2 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 12 Feb 2025 11:43:34 -0600 Subject: [PATCH 109/295] Filter empty text parts when streaming (#8736) * Filter empty text parts when streaming * Add changeset * Remove unused filterEmptyTextParts() * Move logic into a function * final * dont throw if mock response file isn't found * update responses version to 6 * Only ignore empty text parts in the aggregated response. * review fixes * Throw in `aggregateResponses` if `newPart` has no properties --- .changeset/seven-oranges-care.md | 5 ++ .../src/requests/stream-reader.test.ts | 66 ++++++++++++++++++- .../vertexai/src/requests/stream-reader.ts | 15 ++++- scripts/update_vertexai_responses.sh | 2 +- 4 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 .changeset/seven-oranges-care.md diff --git a/.changeset/seven-oranges-care.md b/.changeset/seven-oranges-care.md new file mode 100644 index 00000000000..41b59355bc7 --- /dev/null +++ b/.changeset/seven-oranges-care.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Filter out empty text parts from streaming responses. diff --git a/packages/vertexai/src/requests/stream-reader.test.ts b/packages/vertexai/src/requests/stream-reader.test.ts index eea72f9c7a6..b68c2423066 100644 --- a/packages/vertexai/src/requests/stream-reader.test.ts +++ b/packages/vertexai/src/requests/stream-reader.test.ts @@ -33,8 +33,10 @@ import { GenerateContentResponse, HarmCategory, HarmProbability, - SafetyRating + SafetyRating, + VertexAIErrorCode } from '../types'; +import { VertexAIError } from '../errors'; use(sinonChai); @@ -220,6 +222,23 @@ describe('processStream', () => { } expect(foundCitationMetadata).to.be.true; }); + it('removes empty text parts', async () => { + const fakeResponse = getMockResponseStreaming( + 'streaming-success-empty-text-part.txt' + ); + const result = processStream(fakeResponse as Response); + const aggregatedResponse = await result.response; + expect(aggregatedResponse.text()).to.equal('1'); + expect(aggregatedResponse.candidates?.length).to.equal(1); + expect(aggregatedResponse.candidates?.[0].content.parts.length).to.equal(1); + + // The chunk with the empty text part will still go through the stream + let numChunks = 0; + for await (const _ of result.stream) { + numChunks++; + } + expect(numChunks).to.equal(2); + }); }); describe('aggregateResponses', () => { @@ -403,4 +422,49 @@ describe('aggregateResponses', () => { ).to.equal(150); }); }); + + it('throws if a part has no properties', () => { + const responsesToAggregate: GenerateContentResponse[] = [ + { + candidates: [ + { + index: 0, + content: { + role: 'user', + parts: [{} as any] // Empty + }, + finishReason: FinishReason.STOP, + finishMessage: 'something', + safetyRatings: [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + probability: HarmProbability.NEGLIGIBLE + } as SafetyRating + ] + } + ], + promptFeedback: { + blockReason: BlockReason.SAFETY, + safetyRatings: [ + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + probability: HarmProbability.LOW + } as SafetyRating + ] + } + } + ]; + + try { + aggregateResponses(responsesToAggregate); + } catch (e) { + expect((e as VertexAIError).code).includes( + VertexAIErrorCode.INVALID_CONTENT + ); + expect((e as VertexAIError).message).to.include( + 'Part should have at least one property, but there are none. This is likely caused ' + + 'by a malformed response from the backend.' + ); + } + }); }); diff --git a/packages/vertexai/src/requests/stream-reader.ts b/packages/vertexai/src/requests/stream-reader.ts index 8162407d90b..5c419d114e0 100644 --- a/packages/vertexai/src/requests/stream-reader.ts +++ b/packages/vertexai/src/requests/stream-reader.ts @@ -62,6 +62,7 @@ async function getResponsePromise( ); return enhancedResponse; } + allResponses.push(value); } } @@ -184,14 +185,24 @@ export function aggregateResponses( } const newPart: Partial = {}; for (const part of candidate.content.parts) { - if (part.text) { + if (part.text !== undefined) { + // The backend can send empty text parts. If these are sent back + // (e.g. in chat history), the backend will respond with an error. + // To prevent this, ignore empty text parts. + if (part.text === '') { + continue; + } newPart.text = part.text; } if (part.functionCall) { newPart.functionCall = part.functionCall; } if (Object.keys(newPart).length === 0) { - newPart.text = ''; + throw new VertexAIError( + VertexAIErrorCode.INVALID_CONTENT, + 'Part should have at least one property, but there are none. This is likely caused ' + + 'by a malformed response from the backend.' + ); } aggregatedResponse.candidates[i].content.parts.push( newPart as Part diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index 101eac90d9f..20b9082861e 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v5.*' # The major version of mock responses to use +RESPONSES_VERSION='v6.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From b92592d98ba2e7f861ed02a59cfa81366c4f7231 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 13 Feb 2025 12:45:58 -0600 Subject: [PATCH 110/295] Change API Documenter (BETA) annotation to (Public Preview) (#8789) * Change (BETA) annotation to (Public Preview) * format * Minor bump --- docs-devsite/firestore_.index.md | 4 ++-- docs-devsite/firestore_.indexconfiguration.md | 2 +- docs-devsite/firestore_.indexfield.md | 6 +++--- docs-devsite/firestore_.md | 14 +++++++------- docs-devsite/firestore_lite.md | 6 +++--- repo-scripts/api-documenter/package.json | 2 +- .../src/documenters/MarkdownDocumenterHelpers.ts | 5 +++-- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs-devsite/firestore_.index.md b/docs-devsite/firestore_.index.md index 02a9b95f23c..8ab70e35fa6 100644 --- a/docs-devsite/firestore_.index.md +++ b/docs-devsite/firestore_.index.md @@ -30,8 +30,8 @@ export declare interface Index | Property | Type | Description | | --- | --- | --- | -| [collectionGroup](./firestore_.index.md#indexcollectiongroup) | string | (BETA) The ID of the collection to index. | -| [fields](./firestore_.index.md#indexfields) | [IndexField](./firestore_.indexfield.md#indexfield_interface)\[\] | (BETA) A list of fields to index. | +| [collectionGroup](./firestore_.index.md#indexcollectiongroup) | string | (Public Preview) The ID of the collection to index. | +| [fields](./firestore_.index.md#indexfields) | [IndexField](./firestore_.indexfield.md#indexfield_interface)\[\] | (Public Preview) A list of fields to index. | ## Index.collectionGroup diff --git a/docs-devsite/firestore_.indexconfiguration.md b/docs-devsite/firestore_.indexconfiguration.md index 4bf7e4278fb..e22725c5e0f 100644 --- a/docs-devsite/firestore_.indexconfiguration.md +++ b/docs-devsite/firestore_.indexconfiguration.md @@ -32,7 +32,7 @@ export declare interface IndexConfiguration | Property | Type | Description | | --- | --- | --- | -| [indexes](./firestore_.indexconfiguration.md#indexconfigurationindexes) | [Index](./firestore_.index.md#index_interface)\[\] | (BETA) A list of all Firestore indexes. | +| [indexes](./firestore_.indexconfiguration.md#indexconfigurationindexes) | [Index](./firestore_.index.md#index_interface)\[\] | (Public Preview) A list of all Firestore indexes. | ## IndexConfiguration.indexes diff --git a/docs-devsite/firestore_.indexfield.md b/docs-devsite/firestore_.indexfield.md index e05fae75804..384fe8b9c18 100644 --- a/docs-devsite/firestore_.indexfield.md +++ b/docs-devsite/firestore_.indexfield.md @@ -30,9 +30,9 @@ export declare interface IndexField | Property | Type | Description | | --- | --- | --- | -| [arrayConfig](./firestore_.indexfield.md#indexfieldarrayconfig) | 'CONTAINS' | (BETA) What type of array index to create. Set to CONTAINS for array-contains and array-contains-any indexes.Only one of arrayConfig or order should be set; | -| [fieldPath](./firestore_.indexfield.md#indexfieldfieldpath) | string | (BETA) The field path to index. | -| [order](./firestore_.indexfield.md#indexfieldorder) | 'ASCENDING' \| 'DESCENDING' | (BETA) What type of array index to create. Set to ASCENDING or 'DESCENDING for ==, !=, <=, <=, in and not-in\` filters.Only one of arrayConfig or order should be set. | +| [arrayConfig](./firestore_.indexfield.md#indexfieldarrayconfig) | 'CONTAINS' | (Public Preview) What type of array index to create. Set to CONTAINS for array-contains and array-contains-any indexes.Only one of arrayConfig or order should be set; | +| [fieldPath](./firestore_.indexfield.md#indexfieldfieldpath) | string | (Public Preview) The field path to index. | +| [order](./firestore_.indexfield.md#indexfieldorder) | 'ASCENDING' \| 'DESCENDING' | (Public Preview) What type of array index to create. Set to ASCENDING or 'DESCENDING for ==, !=, <=, <=, in and not-in\` filters.Only one of arrayConfig or order should be set. | ## IndexField.arrayConfig diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index 74e960c833b..ece87254ef1 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -17,7 +17,7 @@ https://github.com/firebase/firebase-js-sdk | --- | --- | | function(app, ...) | | [getFirestore(app)](./firestore_.md#getfirestore_cf608e1) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | -| [getFirestore(app, databaseId)](./firestore_.md#getfirestore_48de6cb) | (BETA) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| [getFirestore(app, databaseId)](./firestore_.md#getfirestore_48de6cb) | (Public Preview) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [initializeFirestore(app, settings, databaseId)](./firestore_.md#initializefirestore_fc7d200) | Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). | | function(firestore, ...) | | [clearIndexedDbPersistence(firestore)](./firestore_.md#clearindexeddbpersistence_231a8e0) | Clears the persistent storage. This includes pending writes and cached documents.Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of failed-precondition.Note: clearIndexedDbPersistence() is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. | @@ -35,8 +35,8 @@ https://github.com/firebase/firebase-js-sdk | [onSnapshotsInSync(firestore, observer)](./firestore_.md#onsnapshotsinsync_2f0dfa4) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [onSnapshotsInSync(firestore, onSync)](./firestore_.md#onsnapshotsinsync_1901c06) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [runTransaction(firestore, updateFunction, options)](./firestore_.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | -| [setIndexConfiguration(firestore, configuration)](./firestore_.md#setindexconfiguration_c362f04) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. | -| [setIndexConfiguration(firestore, json)](./firestore_.md#setindexconfiguration_90d0285) | (BETA) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. Invoke either enableIndexedDbPersistence() or enableMultiTabIndexedDbPersistence() before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored.The method accepts the JSON format exported by the Firebase CLI (firebase firestore:indexes). If the JSON format is invalid, this method throws an error. | +| [setIndexConfiguration(firestore, configuration)](./firestore_.md#setindexconfiguration_c362f04) | (Public Preview) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. If IndexedDb is not enabled, any index configuration is ignored. | +| [setIndexConfiguration(firestore, json)](./firestore_.md#setindexconfiguration_90d0285) | (Public Preview) Configures indexing for local query execution. Any previous index configuration is overridden. The Promise resolves once the index configuration has been persisted.The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.Indexes are only supported with IndexedDb persistence. Invoke either enableIndexedDbPersistence() or enableMultiTabIndexedDbPersistence() before setting an index configuration. If IndexedDb is not enabled, any index configuration is ignored.The method accepts the JSON format exported by the Firebase CLI (firebase firestore:indexes). If the JSON format is invalid, this method throws an error. | | [terminate(firestore)](./firestore_.md#terminate_231a8e0) | Terminates the provided [Firestore](./firestore_.firestore.md#firestore_class) instance.After calling terminate() only the clearIndexedDbPersistence() function may be used. Any other function will throw a FirestoreError.To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.md#getfirestore).Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved. If you have persistence enabled, the next time you start this instance, it will resume sending these writes to the server.Note: Under normal circumstances, calling terminate() is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with clearIndexedDbPersistence() to ensure that all local state is destroyed between test runs. | | [waitForPendingWrites(firestore)](./firestore_.md#waitforpendingwrites_231a8e0) | Waits until all currently pending writes for the active user have been acknowledged by the backend.The returned promise resolves immediately if there are no outstanding writes. Otherwise, the promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call waitForPendingWrites() again.Any outstanding waitForPendingWrites() promises are rejected during user changes. | | [writeBatch(firestore)](./firestore_.md#writebatch_231a8e0) | Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single [WriteBatch](./firestore_.writebatch.md#writebatch_class) is 500.Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data. | @@ -49,7 +49,7 @@ https://github.com/firebase/firebase-js-sdk | [persistentMultipleTabManager()](./firestore_.md#persistentmultipletabmanager) | Creates an instance of PersistentMultipleTabManager. | | [serverTimestamp()](./firestore_.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | | function(databaseId, ...) | -| [getFirestore(databaseId)](./firestore_.md#getfirestore_53dc891) | (BETA) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| [getFirestore(databaseId)](./firestore_.md#getfirestore_53dc891) | (Public Preview) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | function(elements, ...) | | [arrayRemove(elements)](./firestore_.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | @@ -170,9 +170,9 @@ https://github.com/firebase/firebase-js-sdk | [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.Note: This interface is "experimental" and is subject to change.See FirestoreSettings.experimentalAutoDetectLongPolling, FirestoreSettings.experimentalForceLongPolling, and FirestoreSettings.experimentalLongPollingOptions. | | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by withConverter() to transform user objects of type AppModelType into Firestore data of type DbModelType.Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as symbol and bigint), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement FirestoreDataConverter and register the converter with Firestore objects, such as DocumentReference or Query, to automatically convert AppModel to DbModel when storing into Firestore, and convert DbModel to AppModel when retrieving from Firestore. | | [FirestoreSettings](./firestore_.firestoresettings.md#firestoresettings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. | -| [Index](./firestore_.index.md#index_interface) | (BETA) The SDK definition of a Firestore index. | -| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (BETA) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | -| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (BETA) A single field element in an index configuration. | +| [Index](./firestore_.index.md#index_interface) | (Public Preview) The SDK definition of a Firestore index. | +| [IndexConfiguration](./firestore_.indexconfiguration.md#indexconfiguration_interface) | (Public Preview) A list of Firestore indexes to speed up local query execution.See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition. | +| [IndexField](./firestore_.indexfield.md#indexfield_interface) | (Public Preview) A single field element in an index configuration. | | [LoadBundleTaskProgress](./firestore_.loadbundletaskprogress.md#loadbundletaskprogress_interface) | Represents a progress update or a final state from loading bundles. | | [MemoryCacheSettings](./firestore_.memorycachesettings.md#memorycachesettings_interface) | An settings object to configure an MemoryLocalCache instance. | | [MemoryEagerGarbageCollector](./firestore_.memoryeagergarbagecollector.md#memoryeagergarbagecollector_interface) | A garbage collector deletes documents whenever they are not part of any active queries, and have no local mutations attached to them.This collector tries to ensure lowest memory footprints from the SDK, at the risk of documents not being cached for offline queries or for direct queries to the cache.Use factory function to create an instance of this collector. | diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md index da7d304e3d5..76c0a79820e 100644 --- a/docs-devsite/firestore_lite.md +++ b/docs-devsite/firestore_lite.md @@ -17,9 +17,9 @@ https://github.com/firebase/firebase-js-sdk | --- | --- | | function(app, ...) | | [getFirestore(app)](./firestore_lite.md#getfirestore_cf608e1) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | -| [getFirestore(app, databaseId)](./firestore_lite.md#getfirestore_48de6cb) | (BETA) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| [getFirestore(app, databaseId)](./firestore_lite.md#getfirestore_48de6cb) | (Public Preview) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [initializeFirestore(app, settings)](./firestore_lite.md#initializefirestore_87c6318) | Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). | -| [initializeFirestore(app, settings, databaseId)](./firestore_lite.md#initializefirestore_37baaaf) | (BETA) Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). | +| [initializeFirestore(app, settings, databaseId)](./firestore_lite.md#initializefirestore_37baaaf) | (Public Preview) Initializes a new instance of Cloud Firestore with the provided settings. Can only be called before any other functions, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). | | function(firestore, ...) | | [collection(firestore, path, pathSegments)](./firestore_lite.md#collection_1eb4c23) | Gets a CollectionReference instance that refers to the collection at the specified absolute path. | | [collectionGroup(firestore, collectionId)](./firestore_lite.md#collectiongroup_1838fc3) | Creates and returns a new Query instance that includes all documents in the database that are contained in a collection or subcollection with the given collectionId. | @@ -35,7 +35,7 @@ https://github.com/firebase/firebase-js-sdk | [getFirestore()](./firestore_lite.md#getfirestore) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [serverTimestamp()](./firestore_lite.md#servertimestamp) | Returns a sentinel used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) to include a server-generated timestamp in the written data. | | function(databaseId, ...) | -| [getFirestore(databaseId)](./firestore_lite.md#getfirestore_53dc891) | (BETA) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | +| [getFirestore(databaseId)](./firestore_lite.md#getfirestore_53dc891) | (Public Preview) Returns the existing [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the default [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | function(elements, ...) | | [arrayRemove(elements)](./firestore_lite.md#arrayremove_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_.md#setdoc_ee215ad) or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array. | | [arrayUnion(elements)](./firestore_lite.md#arrayunion_7d853aa) | Returns a special value that can be used with [setDoc()](./firestore_lite.md#setdoc_ee215ad) or [updateDoc()](./firestore_lite.md#updatedoc_51a65e3) that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements. | diff --git a/repo-scripts/api-documenter/package.json b/repo-scripts/api-documenter/package.json index 66dd35f3c49..585890922a1 100644 --- a/repo-scripts/api-documenter/package.json +++ b/repo-scripts/api-documenter/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/api-documenter", - "version": "0.4.0", + "version": "0.5.0", "description": "Read JSON files from api-extractor, generate documentation pages", "repository": { "directory": "repo-scripts/documenter", diff --git a/repo-scripts/api-documenter/src/documenters/MarkdownDocumenterHelpers.ts b/repo-scripts/api-documenter/src/documenters/MarkdownDocumenterHelpers.ts index eb8798d3705..f12b99c09aa 100644 --- a/repo-scripts/api-documenter/src/documenters/MarkdownDocumenterHelpers.ts +++ b/repo-scripts/api-documenter/src/documenters/MarkdownDocumenterHelpers.ts @@ -277,7 +277,8 @@ export function createTitleCell( } /** - * This generates a DocTableCell for an ApiItem including the summary section and "(BETA)" annotation. + * This generates a DocTableCell for an ApiItem. This includes the summary section, and release + * annotations for public preview APIs. * * @remarks * We mostly assume that the input is an ApiDocumentedItem, but it's easier to perform this as a runtime @@ -293,7 +294,7 @@ export function createDescriptionCell( if (apiItem.releaseTag === ReleaseTag.Beta) { section.appendNodesInParagraph([ new DocEmphasisSpan({ configuration, bold: true, italic: true }, [ - new DocPlainText({ configuration, text: '(BETA)' }) + new DocPlainText({ configuration, text: '(Public Preview)' }) ]), new DocPlainText({ configuration, text: ' ' }) ]); From 884cbd7d89d4dd9162858f108c39e75896c2db5a Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 18 Feb 2025 12:30:19 -0600 Subject: [PATCH 111/295] Create VertexAI Node CJS and ESM bundles (#8728) * Create Node CJS and ESM bundles * Add changeset * Run formatter * register version with node --- .changeset/stale-llamas-hide.md | 5 +++ packages/vertexai/package.json | 4 +-- packages/vertexai/rollup.config.js | 54 ++++++++++++++++++----------- packages/vertexai/src/index.node.ts | 53 ++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 23 deletions(-) create mode 100644 .changeset/stale-llamas-hide.md create mode 100644 packages/vertexai/src/index.node.ts diff --git a/.changeset/stale-llamas-hide.md b/.changeset/stale-llamas-hide.md new file mode 100644 index 00000000000..b46bcfb9885 --- /dev/null +++ b/.changeset/stale-llamas-hide.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Create Node CJS and ESM bundles. diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index a074afbc198..aaffaca12c0 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -13,8 +13,8 @@ ".": { "types": "./dist/vertexai-public.d.ts", "node": { - "require": "./dist/index.cjs.js", - "import": "./dist/esm/index.esm2017.js" + "require": "./dist/index.node.cjs.js", + "import": "./dist/index.node.mjs" }, "browser": { "require": "./dist/index.cjs.js", diff --git a/packages/vertexai/rollup.config.js b/packages/vertexai/rollup.config.js index e93dd0319b5..b3a1e5ebcf8 100644 --- a/packages/vertexai/rollup.config.js +++ b/packages/vertexai/rollup.config.js @@ -77,25 +77,37 @@ const browserBuilds = [ } ]; -// const nodeBuilds = [ -// { -// input: 'index.node.ts', -// output: { -// file: pkg.main, -// format: 'cjs', -// sourcemap: true -// }, -// plugins: buildPlugins, -// external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) -// }, -// { -// input: 'index.node.ts', -// output: [ -// { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } -// ], -// plugins: [...buildPlugins, emitModulePackageFile()], -// external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) -// } -// ]; +const nodeBuilds = [ + { + input: 'src/index.node.ts', + output: { + file: pkg.exports['.'].node.import, + format: 'es', + sourcemap: true + }, + plugins: [ + ...buildPlugins, + replace({ + ...generateBuildTargetReplaceConfig('esm', 2017) + }) + ], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) + }, + { + input: 'src/index.node.ts', + output: { + file: pkg.exports['.'].node.require, + format: 'cjs', + sourcemap: true + }, + plugins: [ + ...buildPlugins, + replace({ + ...generateBuildTargetReplaceConfig('cjs', 2017) + }) + ], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) + } +]; -export default [...browserBuilds]; +export default [...browserBuilds, ...nodeBuilds]; diff --git a/packages/vertexai/src/index.node.ts b/packages/vertexai/src/index.node.ts new file mode 100644 index 00000000000..6a18788141a --- /dev/null +++ b/packages/vertexai/src/index.node.ts @@ -0,0 +1,53 @@ +/** + * The Vertex AI in Firebase Web SDK. + * + * @packageDocumentation + */ + +/** + * @license + * Copyright 2025 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 { registerVersion, _registerComponent } from '@firebase/app'; +import { VertexAIService } from './service'; +import { VERTEX_TYPE } from './constants'; +import { Component, ComponentType } from '@firebase/component'; +import { name, version } from '../package.json'; + +function registerVertex(): void { + _registerComponent( + new Component( + VERTEX_TYPE, + (container, { instanceIdentifier: location }) => { + // getImmediate for FirebaseApp will always succeed + const app = container.getProvider('app').getImmediate(); + const auth = container.getProvider('auth-internal'); + const appCheckProvider = container.getProvider('app-check-internal'); + return new VertexAIService(app, auth, appCheckProvider, { location }); + }, + ComponentType.PUBLIC + ).setMultipleInstances(true) + ); + + registerVersion(name, version, 'node'); + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + registerVersion(name, version, '__BUILD_TARGET__'); +} + +registerVertex(); + +export * from './api'; +export * from './public-types'; From f68148253349b8e80fc649386fede51339266a3c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 19 Feb 2025 08:33:44 -0800 Subject: [PATCH 112/295] Catch errors in debug token exchange logic (#8792) --- .changeset/tough-kiwis-smile.md | 5 +++ packages/app-check/src/internal-api.test.ts | 23 +++++++++++ packages/app-check/src/internal-api.ts | 46 +++++++++++++-------- 3 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 .changeset/tough-kiwis-smile.md diff --git a/.changeset/tough-kiwis-smile.md b/.changeset/tough-kiwis-smile.md new file mode 100644 index 00000000000..47e6d4caff8 --- /dev/null +++ b/.changeset/tough-kiwis-smile.md @@ -0,0 +1,5 @@ +--- +'@firebase/app-check': patch +--- + +Fixed a bug that caused an error to be thrown when the debug exchange failed. diff --git a/packages/app-check/src/internal-api.test.ts b/packages/app-check/src/internal-api.test.ts index 360ec3a026a..1e43a5e7e21 100644 --- a/packages/app-check/src/internal-api.test.ts +++ b/packages/app-check/src/internal-api.test.ts @@ -176,6 +176,29 @@ describe('internal api', () => { errorStub.restore(); }); + it('resolves with a dummy token and an error if failed to get a token in debug mode', async () => { + const errorStub = stub(console, 'error'); + window.FIREBASE_APPCHECK_DEBUG_TOKEN = true; + const appCheck = initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + + const error = new Error('oops, something went wrong'); + stub(client, 'exchangeToken').returns(Promise.reject(error)); + + const token = await getToken(appCheck as AppCheckService); + + expect(token).to.deep.equal({ + token: formatDummyToken(defaultTokenErrorData), + error + }); + expect(errorStub.args[0][1].message).to.include( + 'oops, something went wrong' + ); + delete window.FIREBASE_APPCHECK_DEBUG_TOKEN; + errorStub.restore(); + }); + it('resolves with a dummy token and an error if recaptcha failed', async () => { const errorStub = stub(console, 'error'); const appCheck = initializeAppCheck(app, { diff --git a/packages/app-check/src/internal-api.ts b/packages/app-check/src/internal-api.ts index 728f2ca5e68..4eb3953614a 100644 --- a/packages/app-check/src/internal-api.ts +++ b/packages/app-check/src/internal-api.ts @@ -116,24 +116,36 @@ export async function getToken( * Check token using the debug token, and return it directly. */ if (isDebugMode()) { - // Avoid making another call to the exchange endpoint if one is in flight. - if (!state.exchangeTokenPromise) { - state.exchangeTokenPromise = exchangeToken( - getExchangeDebugTokenRequest(app, await getDebugToken()), - appCheck.heartbeatServiceProvider - ).finally(() => { - // Clear promise when settled - either resolved or rejected. - state.exchangeTokenPromise = undefined; - }); - shouldCallListeners = true; + try { + // Avoid making another call to the exchange endpoint if one is in flight. + if (!state.exchangeTokenPromise) { + state.exchangeTokenPromise = exchangeToken( + getExchangeDebugTokenRequest(app, await getDebugToken()), + appCheck.heartbeatServiceProvider + ).finally(() => { + // Clear promise when settled - either resolved or rejected. + state.exchangeTokenPromise = undefined; + }); + shouldCallListeners = true; + } + const tokenFromDebugExchange: AppCheckTokenInternal = + await state.exchangeTokenPromise; + // Write debug token to indexedDB. + await writeTokenToStorage(app, tokenFromDebugExchange); + // Write debug token to state. + state.token = tokenFromDebugExchange; + return { token: tokenFromDebugExchange.token }; + } catch (e) { + if ((e as FirebaseError).code === `appCheck/${AppCheckError.THROTTLED}`) { + // Warn if throttled, but do not treat it as an error. + logger.warn((e as FirebaseError).message); + } else { + // `getToken()` should never throw, but logging error text to console will aid debugging. + logger.error(e); + } + // Return dummy token and error + return makeDummyTokenResult(e as FirebaseError); } - const tokenFromDebugExchange: AppCheckTokenInternal = - await state.exchangeTokenPromise; - // Write debug token to indexedDB. - await writeTokenToStorage(app, tokenFromDebugExchange); - // Write debug token to state. - state.token = tokenFromDebugExchange; - return { token: tokenFromDebugExchange.token }; } /** From 84dfeca3958fb662b6e20195b80ca521e02b83ef Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 19 Feb 2025 11:42:01 -0500 Subject: [PATCH 113/295] Throw error if mock response file not found (#8739) --- packages/vertexai/test-utils/mock-response.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vertexai/test-utils/mock-response.ts b/packages/vertexai/test-utils/mock-response.ts index 8332d9eb36e..9b42c93427b 100644 --- a/packages/vertexai/test-utils/mock-response.ts +++ b/packages/vertexai/test-utils/mock-response.ts @@ -49,6 +49,9 @@ export function getMockResponseStreaming( filename: string, chunkLength: number = 20 ): Partial { + if (!(filename in mocksLookup)) { + throw Error(`Mock response file '${filename}' not found.`); + } const fullText = mocksLookup[filename]; return { @@ -57,6 +60,9 @@ export function getMockResponseStreaming( } export function getMockResponse(filename: string): Partial { + if (!(filename in mocksLookup)) { + throw Error(`Mock response file '${filename}' not found.`); + } const fullText = mocksLookup[filename]; return { ok: true, From 604133f8d23804797c092911c75907a4a3dbb7a6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 19 Feb 2025 16:36:49 -0500 Subject: [PATCH 114/295] Fix vectorvalue docs (#8453) * Fix vectorvalue docs * Use @link vector * Fix vector link with code tag --- docs-devsite/firestore_.md | 2 +- docs-devsite/firestore_.vectorvalue.md | 6 +++--- docs-devsite/firestore_lite.md | 2 +- docs-devsite/firestore_lite.vectorvalue.md | 6 +++--- packages/firestore/src/lite-api/vector_value.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index ece87254ef1..91d21e32708 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -157,7 +157,7 @@ https://github.com/firebase/firebase-js-sdk | [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. | | [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | | [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue | | [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | ## Interfaces diff --git a/docs-devsite/firestore_.vectorvalue.md b/docs-devsite/firestore_.vectorvalue.md index 7906970b2dd..e35e96ec9ec 100644 --- a/docs-devsite/firestore_.vectorvalue.md +++ b/docs-devsite/firestore_.vectorvalue.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VectorValue class -Represents a vector type in Firestore documents. Create an instance with . +Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue @@ -24,12 +24,12 @@ export declare class VectorValue | Method | Modifiers | Description | | --- | --- | --- | -| [isEqual(other)](./firestore_.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue has the same raw number arrays, returns false otherwise. | +| [isEqual(other)](./firestore_.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise. | | [toArray()](./firestore_.vectorvalue.md#vectorvaluetoarray) | | Returns a copy of the raw number array form of the vector. | ## VectorValue.isEqual() -Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise. +Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise. Signature: diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md index 76c0a79820e..20fafd66c59 100644 --- a/docs-devsite/firestore_lite.md +++ b/docs-devsite/firestore_lite.md @@ -119,7 +119,7 @@ https://github.com/firebase/firebase-js-sdk | [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). | | [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). | -| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with . VectorValue | +| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue | | [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. | ## Interfaces diff --git a/docs-devsite/firestore_lite.vectorvalue.md b/docs-devsite/firestore_lite.vectorvalue.md index 6c5aa1f4ca4..28eaf7f5f01 100644 --- a/docs-devsite/firestore_lite.vectorvalue.md +++ b/docs-devsite/firestore_lite.vectorvalue.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VectorValue class -Represents a vector type in Firestore documents. Create an instance with . +Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue @@ -24,12 +24,12 @@ export declare class VectorValue | Method | Modifiers | Description | | --- | --- | --- | -| [isEqual(other)](./firestore_lite.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue has the same raw number arrays, returns false otherwise. | +| [isEqual(other)](./firestore_lite.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise. | | [toArray()](./firestore_lite.vectorvalue.md#vectorvaluetoarray) | | Returns a copy of the raw number array form of the vector. | ## VectorValue.isEqual() -Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise. +Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise. Signature: diff --git a/packages/firestore/src/lite-api/vector_value.ts b/packages/firestore/src/lite-api/vector_value.ts index a09f2799fb3..9ac9753fef5 100644 --- a/packages/firestore/src/lite-api/vector_value.ts +++ b/packages/firestore/src/lite-api/vector_value.ts @@ -19,7 +19,7 @@ import { isPrimitiveArrayEqual } from '../util/array'; /** * Represents a vector type in Firestore documents. - * Create an instance with {@link FieldValue.vector}. + * Create an instance with {@link vector}. * * @class VectorValue */ @@ -43,7 +43,7 @@ export class VectorValue { } /** - * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise. + * Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise. */ isEqual(other: VectorValue): boolean { return isPrimitiveArrayEqual(this._values, other._values); From c3266f8d750ebb87b9c567c11a7bb58781613601 Mon Sep 17 00:00:00 2001 From: "Nhien (Ricky) Lam" <62775270+NhienLam@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:46:45 -0800 Subject: [PATCH 115/295] Re-enable auth redirect tests (#8803) * Re-enable redirect tests * Fix lint --- .../auth/test/integration/webdriver/redirect.test.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/auth/test/integration/webdriver/redirect.test.ts b/packages/auth/test/integration/webdriver/redirect.test.ts index 3c3616dc796..250dd0ba4af 100644 --- a/packages/auth/test/integration/webdriver/redirect.test.ts +++ b/packages/auth/test/integration/webdriver/redirect.test.ts @@ -332,11 +332,7 @@ browserDescribe('WebDriver redirect IdP test', driver => { expect(user.email).to.eq(user1.email); }); - it('reauthenticate throws for wrong user', async function () { - // Test is ignored for now as it fails on Chrome version 111+. - // TODO(b/297245662): Investigate and unskip the test. - this.skip(); - + it('reauthenticate throws for wrong user', async () => { // Sign in using pre-populated user await driver.callNoWait(RedirectFunction.IDP_REDIRECT); @@ -359,11 +355,7 @@ browserDescribe('WebDriver redirect IdP test', driver => { ); }); - it('handles aborted sign ins', async function () { - // Test is ignored for now as it fails on Chrome version 111+. - // TODO(b/297245662): Investigate and unskip the test. - this.skip(); - + it('handles aborted sign ins', async () => { await driver.callNoWait(RedirectFunction.IDP_REDIRECT); const widget = new IdPPage(driver.webDriver); From ce2c77511210df109fdf381c7c02175173a6f7a2 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 20 Feb 2025 19:14:02 -0500 Subject: [PATCH 116/295] Add Image Generation support using Imagen (#8683) * WIP * Introduce VertexAIModel base class, add documentation, and respond to other comments * Generate devsite docs * revert dataconnect change * formatting * WIP * Introduce VertexAIModel base class, add documentation, and respond to other comments * Generate devsite docs * revert dataconnect change * formatting * Fix ImagenRequestConfig comment * Improve tests * Formatting * Add ImagenGenerationResponse * Formatting * Update to match API changes * fixes * format * Update API reports * add changeset * update * format * Update API reports * remove public docs * Nest imageFormat in outputOptions * remove unecessary console.log * Log warning if compressionQuality outside of range * format * Imagen Documentation (#8776) * Revert "remove public docs" This reverts commit f0955630d319b05fd85af39bb8d149caf11481d5. * update docs * update docs * format * minor fixes * format * mark all APIs beta instead of public * review fixes * format * Replace (BETA) with (Public Preview) in docs * fix links * another pass * format * review fixes * Cleanup * update changeset --------- Co-authored-by: dlarocque --- .changeset/violet-planets-impress.md | 6 + common/api-review/vertexai.api.md | 101 ++++++++- docs-devsite/_toc.yaml | 18 ++ docs-devsite/vertexai.generativemodel.md | 12 +- docs-devsite/vertexai.imagengcsimage.md | 54 +++++ .../vertexai.imagengenerationconfig.md | 111 +++++++++ .../vertexai.imagengenerationresponse.md | 61 +++++ docs-devsite/vertexai.imagenimageformat.md | 119 ++++++++++ docs-devsite/vertexai.imageninlineimage.md | 57 +++++ docs-devsite/vertexai.imagenmodel.md | 157 +++++++++++++ docs-devsite/vertexai.imagenmodelparams.md | 73 ++++++ docs-devsite/vertexai.imagensafetysettings.md | 57 +++++ docs-devsite/vertexai.md | 118 ++++++++++ docs-devsite/vertexai.vertexaimodel.md | 66 ++++++ packages/vertexai/src/api.test.ts | 54 ++++- packages/vertexai/src/api.ts | 42 +++- .../src/models/generative-model.test.ts | 22 -- .../vertexai/src/models/generative-model.ts | 60 +---- .../vertexai/src/models/imagen-model.test.ts | 160 +++++++++++++ packages/vertexai/src/models/imagen-model.ts | 160 +++++++++++++ packages/vertexai/src/models/index.ts | 20 ++ .../src/models/vertexai-model.test.ts | 103 +++++++++ .../vertexai/src/models/vertexai-model.ts | 121 ++++++++++ .../src/requests/imagen-image-format.ts | 81 +++++++ .../src/requests/request-helpers.test.ts | 76 ++++++- .../vertexai/src/requests/request-helpers.ts | 42 ++++ packages/vertexai/src/requests/request.ts | 3 +- .../src/requests/response-helpers.test.ts | 78 ++++++- .../vertexai/src/requests/response-helpers.ts | 52 +++++ packages/vertexai/src/types/imagen/index.ts | 19 ++ .../vertexai/src/types/imagen/internal.ts | 129 +++++++++++ .../vertexai/src/types/imagen/requests.ts | 212 ++++++++++++++++++ .../vertexai/src/types/imagen/responses.ts | 83 +++++++ packages/vertexai/src/types/index.ts | 1 + packages/vertexai/src/types/internal.ts | 2 + 35 files changed, 2427 insertions(+), 103 deletions(-) create mode 100644 .changeset/violet-planets-impress.md create mode 100644 docs-devsite/vertexai.imagengcsimage.md create mode 100644 docs-devsite/vertexai.imagengenerationconfig.md create mode 100644 docs-devsite/vertexai.imagengenerationresponse.md create mode 100644 docs-devsite/vertexai.imagenimageformat.md create mode 100644 docs-devsite/vertexai.imageninlineimage.md create mode 100644 docs-devsite/vertexai.imagenmodel.md create mode 100644 docs-devsite/vertexai.imagenmodelparams.md create mode 100644 docs-devsite/vertexai.imagensafetysettings.md create mode 100644 docs-devsite/vertexai.vertexaimodel.md create mode 100644 packages/vertexai/src/models/imagen-model.test.ts create mode 100644 packages/vertexai/src/models/imagen-model.ts create mode 100644 packages/vertexai/src/models/index.ts create mode 100644 packages/vertexai/src/models/vertexai-model.test.ts create mode 100644 packages/vertexai/src/models/vertexai-model.ts create mode 100644 packages/vertexai/src/requests/imagen-image-format.ts create mode 100644 packages/vertexai/src/types/imagen/index.ts create mode 100644 packages/vertexai/src/types/imagen/internal.ts create mode 100644 packages/vertexai/src/types/imagen/requests.ts create mode 100644 packages/vertexai/src/types/imagen/responses.ts diff --git a/.changeset/violet-planets-impress.md b/.changeset/violet-planets-impress.md new file mode 100644 index 00000000000..62427699f26 --- /dev/null +++ b/.changeset/violet-planets-impress.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/vertexai': minor +--- + +**Public Preview** Added support for generating images using the Imagen 3 model. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 041bc62451f..4521aaf2b70 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -323,7 +323,7 @@ export interface GenerativeContentBlob { } // @public -export class GenerativeModel { +export class GenerativeModel extends VertexAIModel { constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); countTokens(request: CountTokensRequest | string | Array): Promise; generateContent(request: GenerateContentRequest | string | Array): Promise; @@ -331,8 +331,6 @@ export class GenerativeModel { // (undocumented) generationConfig: GenerationConfig; // (undocumented) - model: string; - // (undocumented) requestOptions?: RequestOptions; // (undocumented) safetySettings: SafetySetting[]; @@ -348,6 +346,9 @@ export class GenerativeModel { // @public export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +// @beta +export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; + // @public export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; @@ -429,6 +430,90 @@ export enum HarmSeverity { HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE" } +// @beta +export enum ImagenAspectRatio { + LANDSCAPE_16x9 = "16:9", + LANDSCAPE_3x4 = "3:4", + PORTRAIT_4x3 = "4:3", + PORTRAIT_9x16 = "9:16", + SQUARE = "1:1" +} + +// @public +export interface ImagenGCSImage { + gcsURI: string; + mimeType: string; +} + +// @beta +export interface ImagenGenerationConfig { + addWatermark?: boolean; + aspectRatio?: ImagenAspectRatio; + imageFormat?: ImagenImageFormat; + negativePrompt?: string; + numberOfImages?: number; +} + +// @beta +export interface ImagenGenerationResponse { + filteredReason?: string; + images: T[]; +} + +// @beta +export class ImagenImageFormat { + compressionQuality?: number; + static jpeg(compressionQuality?: number): ImagenImageFormat; + mimeType: string; + static png(): ImagenImageFormat; +} + +// @beta +export interface ImagenInlineImage { + bytesBase64Encoded: string; + mimeType: string; +} + +// @beta +export class ImagenModel extends VertexAIModel { + constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); + generateImages(prompt: string): Promise>; + // @internal + generateImagesGCS(prompt: string, gcsURI: string): Promise>; + generationConfig?: ImagenGenerationConfig; + // (undocumented) + requestOptions?: RequestOptions | undefined; + safetySettings?: ImagenSafetySettings; +} + +// @beta +export interface ImagenModelParams { + generationConfig?: ImagenGenerationConfig; + model: string; + safetySettings?: ImagenSafetySettings; +} + +// @beta +export enum ImagenPersonFilterLevel { + ALLOW_ADULT = "allow_adult", + ALLOW_ALL = "allow_all", + BLOCK_ALL = "dont_allow" +} + +// @beta +export enum ImagenSafetyFilterLevel { + BLOCK_LOW_AND_ABOVE = "block_low_and_above", + BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above", + BLOCK_NONE = "block_none", + BLOCK_ONLY_HIGH = "block_only_high" +} + +// @beta +export interface ImagenSafetySettings { + personFilterLevel?: ImagenPersonFilterLevel; + safetyFilterLevel?: ImagenSafetyFilterLevel; +} + // @public export interface InlineDataPart { // (undocumented) @@ -718,6 +803,16 @@ export const enum VertexAIErrorCode { RESPONSE_ERROR = "response-error" } +// @public +export abstract class VertexAIModel { + // @internal + protected constructor(vertexAI: VertexAI, modelName: string); + // @internal (undocumented) + protected _apiSettings: ApiSettings; + readonly model: string; + static normalizeModelName(modelName: string): string; +} + // @public export interface VertexAIOptions { // (undocumented) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index bf0318389ba..d97377e3d3d 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -536,6 +536,22 @@ toc: path: /docs/reference/js/vertexai.groundingattribution.md - title: GroundingMetadata path: /docs/reference/js/vertexai.groundingmetadata.md + - title: ImagenGCSImage + path: /docs/reference/js/vertexai.imagengcsimage.md + - title: ImagenGenerationConfig + path: /docs/reference/js/vertexai.imagengenerationconfig.md + - title: ImagenGenerationResponse + path: /docs/reference/js/vertexai.imagengenerationresponse.md + - title: ImagenImageFormat + path: /docs/reference/js/vertexai.imagenimageformat.md + - title: ImagenInlineImage + path: /docs/reference/js/vertexai.imageninlineimage.md + - title: ImagenModel + path: /docs/reference/js/vertexai.imagenmodel.md + - title: ImagenModelParams + path: /docs/reference/js/vertexai.imagenmodelparams.md + - title: ImagenSafetySettings + path: /docs/reference/js/vertexai.imagensafetysettings.md - title: InlineDataPart path: /docs/reference/js/vertexai.inlinedatapart.md - title: IntegerSchema @@ -584,6 +600,8 @@ toc: path: /docs/reference/js/vertexai.vertexai.md - title: VertexAIError path: /docs/reference/js/vertexai.vertexaierror.md + - title: VertexAIModel + path: /docs/reference/js/vertexai.vertexaimodel.md - title: VertexAIOptions path: /docs/reference/js/vertexai.vertexaioptions.md - title: VideoMetadata diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md index 7105f9c100b..b734e241e78 100644 --- a/docs-devsite/vertexai.generativemodel.md +++ b/docs-devsite/vertexai.generativemodel.md @@ -15,8 +15,9 @@ Class for generative model APIs. Signature: ```typescript -export declare class GenerativeModel +export declare class GenerativeModel extends VertexAIModel ``` +Extends: [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) ## Constructors @@ -29,7 +30,6 @@ export declare class GenerativeModel | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | -| [model](./vertexai.generativemodel.md#generativemodelmodel) | | string | | | [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | | [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | | [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | @@ -71,14 +71,6 @@ constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: Reque generationConfig: GenerationConfig; ``` -## GenerativeModel.model - -Signature: - -```typescript -model: string; -``` - ## GenerativeModel.requestOptions Signature: diff --git a/docs-devsite/vertexai.imagengcsimage.md b/docs-devsite/vertexai.imagengcsimage.md new file mode 100644 index 00000000000..b094e63c1d8 --- /dev/null +++ b/docs-devsite/vertexai.imagengcsimage.md @@ -0,0 +1,54 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenGCSImage interface +An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. + +This feature is not available yet. + +Signature: + +```typescript +export interface ImagenGCSImage +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | +| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | + +## ImagenGCSImage.gcsURI + +The URI of the file stored in a Cloud Storage for Firebase bucket. + +Signature: + +```typescript +gcsURI: string; +``` + +### Example + +`"gs://bucket-name/path/sample_0.jpg"`. + +## ImagenGCSImage.mimeType + +The MIME type of the image; either `"image/png"` or `"image/jpeg"`. + +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). + +Signature: + +```typescript +mimeType: string; +``` diff --git a/docs-devsite/vertexai.imagengenerationconfig.md b/docs-devsite/vertexai.imagengenerationconfig.md new file mode 100644 index 00000000000..cee7734f789 --- /dev/null +++ b/docs-devsite/vertexai.imagengenerationconfig.md @@ -0,0 +1,111 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenGenerationConfig interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration options for generating images with Imagen. + +See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. + +Signature: + +```typescript +export interface ImagenGenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details. | +| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. | +| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. | +| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. | +| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | + +## ImagenGenerationConfig.addWatermark + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Whether to add an invisible watermark to generated images. + +If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to `false`, watermarking will be disabled. + +For Imagen 3 models, the default value is `true`; see the addWatermark documentation for more details. + +Signature: + +```typescript +addWatermark?: boolean; +``` + +## ImagenGenerationConfig.aspectRatio + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. + +Signature: + +```typescript +aspectRatio?: ImagenAspectRatio; +``` + +## ImagenGenerationConfig.imageFormat + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The image format of the generated images. The default is PNG. + +See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. + +Signature: + +```typescript +imageFormat?: ImagenImageFormat; +``` + +## ImagenGenerationConfig.negativePrompt + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A description of what should be omitted from the generated images. + +Support for negative prompts depends on the Imagen model. + +See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. + +Signature: + +```typescript +negativePrompt?: string; +``` + +## ImagenGenerationConfig.numberOfImages + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The number of images to generate. The default value is 1. + +The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. + +Signature: + +```typescript +numberOfImages?: number; +``` diff --git a/docs-devsite/vertexai.imagengenerationresponse.md b/docs-devsite/vertexai.imagengenerationresponse.md new file mode 100644 index 00000000000..32ed69718f9 --- /dev/null +++ b/docs-devsite/vertexai.imagengenerationresponse.md @@ -0,0 +1,61 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenGenerationResponse interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The response from a request to generate images with Imagen. + +Signature: + +```typescript +export interface ImagenGenerationResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [filteredReason](./vertexai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | (Public Preview) The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | +| [images](./vertexai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | + +## ImagenGenerationResponse.filteredReason + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The reason that images were filtered out. This property will only be defined if one or more images were filtered. + +Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface). + +See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. + +Signature: + +```typescript +filteredReason?: string; +``` + +## ImagenGenerationResponse.images + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The images generated by Imagen. + +The number of images generated may be fewer than the number requested if one or more were filtered out; see `filteredReason`. + +Signature: + +```typescript +images: T[]; +``` diff --git a/docs-devsite/vertexai.imagenimageformat.md b/docs-devsite/vertexai.imagenimageformat.md new file mode 100644 index 00000000000..785c7c726fc --- /dev/null +++ b/docs-devsite/vertexai.imagenimageformat.md @@ -0,0 +1,119 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenImageFormat class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Defines the image format for images generated by Imagen. + +Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). + +Signature: + +```typescript +export declare class ImagenImageFormat +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [compressionQuality](./vertexai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). | +| [mimeType](./vertexai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | +| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | + +## ImagenImageFormat.compressionQuality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The level of compression (a number between 0 and 100). + +Signature: + +```typescript +compressionQuality?: number; +``` + +## ImagenImageFormat.mimeType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The MIME type. + +Signature: + +```typescript +mimeType: string; +``` + +## ImagenImageFormat.jpeg() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. + +Signature: + +```typescript +static jpeg(compressionQuality?: number): ImagenImageFormat; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| compressionQuality | number | The level of compression (a number between 0 and 100). | + +Returns: + +[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) + +An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a JPEG image. + +## ImagenImageFormat.png() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. + +Signature: + +```typescript +static png(): ImagenImageFormat; +``` +Returns: + +[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) + +An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a PNG image. + +### Example + + +```javascript +const imagenModelParams = { + // ... other ImagenModelParams + imageFormat: ImagenImageFormat.jpeg(75) // JPEG with a compression level of 75. +} + +``` + diff --git a/docs-devsite/vertexai.imageninlineimage.md b/docs-devsite/vertexai.imageninlineimage.md new file mode 100644 index 00000000000..19fe8a67764 --- /dev/null +++ b/docs-devsite/vertexai.imageninlineimage.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenInlineImage interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An image generated by Imagen, represented as inline data. + +Signature: + +```typescript +export interface ImagenInlineImage +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [bytesBase64Encoded](./vertexai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | +| [mimeType](./vertexai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | + +## ImagenInlineImage.bytesBase64Encoded + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The base64-encoded image data. + +Signature: + +```typescript +bytesBase64Encoded: string; +``` + +## ImagenInlineImage.mimeType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The MIME type of the image; either `"image/png"` or `"image/jpeg"`. + +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). + +Signature: + +```typescript +mimeType: string; +``` diff --git a/docs-devsite/vertexai.imagenmodel.md b/docs-devsite/vertexai.imagenmodel.md new file mode 100644 index 00000000000..63e15ff133a --- /dev/null +++ b/docs-devsite/vertexai.imagenmodel.md @@ -0,0 +1,157 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenModel class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Class for Imagen model APIs. + +This class provides methods for generating images using the Imagen model. + +Signature: + +```typescript +export declare class ImagenModel extends VertexAIModel +``` +Extends: [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./vertexai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. | +| [requestOptions](./vertexai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) | +| [safetySettings](./vertexai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [generateImages(prompt)](./vertexai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. | + +## ImagenModel.(constructor) + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. + +Signature: + +```typescript +constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making requests to Imagen. | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | Additional options to use when making requests. | + +#### Exceptions + +If the `apiKey` or `projectId` fields are missing in your Firebase config. + +## ImagenModel.generationConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The Imagen generation configuration. + +Signature: + +```typescript +generationConfig?: ImagenGenerationConfig; +``` + +## ImagenModel.requestOptions + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +requestOptions?: RequestOptions | undefined; +``` + +## ImagenModel.safetySettings + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Safety settings for filtering inappropriate content. + +Signature: + +```typescript +safetySettings?: ImagenSafetySettings; +``` + +## ImagenModel.generateImages() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generates images using the Imagen model and returns them as base64-encoded strings. + +If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty. + +Signature: + +```typescript +generateImages(prompt: string): Promise>; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prompt | string | A text prompt describing the image(s) to generate. | + +Returns: + +Promise<[ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface)<[ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface)>> + +A promise that resolves to an [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) object containing the generated images. + +#### Exceptions + +If the request to generate images fails. This happens if the prompt is blocked. + +### Example + + +```javascript +const imagen = new ImagenModel( + vertexAI, + { + model: 'imagen-3.0-generate-002' + } +); + +const response = await imagen.generateImages('A photo of a cat'); +if (response.images.length > 0) { + console.log(response.images[0].bytesBase64Encoded); +} + +``` + diff --git a/docs-devsite/vertexai.imagenmodelparams.md b/docs-devsite/vertexai.imagenmodelparams.md new file mode 100644 index 00000000000..66c4bb0bfe6 --- /dev/null +++ b/docs-devsite/vertexai.imagenmodelparams.md @@ -0,0 +1,73 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenModelParams interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). + +Signature: + +```typescript +export interface ImagenModelParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [generationConfig](./vertexai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. | +| [model](./vertexai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | +| [safetySettings](./vertexai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. | + +## ImagenModelParams.generationConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration options for generating images with Imagen. + +Signature: + +```typescript +generationConfig?: ImagenGenerationConfig; +``` + +## ImagenModelParams.model + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The Imagen model to use for generating images. For example: `imagen-3.0-generate-002`. + +Only Imagen 3 models (named `imagen-3.0-*`) are supported. + +See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. + +Signature: + +```typescript +model: string; +``` + +## ImagenModelParams.safetySettings + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Safety settings for filtering potentially inappropriate content. + +Signature: + +```typescript +safetySettings?: ImagenSafetySettings; +``` diff --git a/docs-devsite/vertexai.imagensafetysettings.md b/docs-devsite/vertexai.imagensafetysettings.md new file mode 100644 index 00000000000..3cf7931a959 --- /dev/null +++ b/docs-devsite/vertexai.imagensafetysettings.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ImagenSafetySettings interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Settings for controlling the aggressiveness of filtering out sensitive content. + +See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. + +Signature: + +```typescript +export interface ImagenSafetySettings +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [personFilterLevel](./vertexai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. | +| [safetyFilterLevel](./vertexai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. | + +## ImagenSafetySettings.personFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling whether generation of images containing people or faces is allowed. + +Signature: + +```typescript +personFilterLevel?: ImagenPersonFilterLevel; +``` + +## ImagenSafetySettings.safetyFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling how aggressive to filter out sensitive content from generated images. + +Signature: + +```typescript +safetyFilterLevel?: ImagenSafetyFilterLevel; +``` diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index d9e26eabc5d..1d284345c39 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -20,6 +20,7 @@ The Vertex AI in Firebase Web SDK. | [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | | function(vertexAI, ...) | | [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | +| [getImagenModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getimagenmodel_812c375) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | ## Classes @@ -29,12 +30,15 @@ The Vertex AI in Firebase Web SDK. | [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | | [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | | [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). | +| [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | | [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | | [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | | [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | | [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | | [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | +| [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) | Base class for Vertex AI in Firebase model APIs. | ## Enumerations @@ -48,6 +52,9 @@ The Vertex AI in Firebase Web SDK. | [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | +| [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | @@ -83,6 +90,12 @@ The Vertex AI in Firebase Web SDK. | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [ImagenGCSImage](./vertexai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | +| [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | +| [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | +| [ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | +| [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). | +| [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | @@ -167,6 +180,37 @@ export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: Mode [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) +### getImagenModel(vertexAI, modelParams, requestOptions) {:#getimagenmodel_812c375} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. + +Only Imagen 3 models (named `imagen-3.0-*`) are supported. + +Signature: + +```typescript +export declare function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. | + +Returns: + +[ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) + +#### Exceptions + +If the `apiKey` or `projectId` fields are missing in your Firebase config. + ## POSSIBLE\_ROLES Possible roles. @@ -363,6 +407,80 @@ export declare enum HarmSeverity | HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | | HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | +## ImagenAspectRatio + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Aspect ratios for Imagen images. + +To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). + +See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. + +Signature: + +```typescript +export declare enum ImagenAspectRatio +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| LANDSCAPE\_16x9 | "16:9" | (Public Preview) Landscape (16:9) aspect ratio. | +| LANDSCAPE\_3x4 | "3:4" | (Public Preview) Landscape (3:4) aspect ratio. | +| PORTRAIT\_4x3 | "4:3" | (Public Preview) Portrait (4:3) aspect ratio. | +| PORTRAIT\_9x16 | "9:16" | (Public Preview) Portrait (9:16) aspect ratio. | +| SQUARE | "1:1" | (Public Preview) Square (1:1) aspect ratio. | + +## ImagenPersonFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling whether generation of images containing people or faces is allowed. + +See the personGeneration documentation for more details. + +Signature: + +```typescript +export declare enum ImagenPersonFilterLevel +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ALLOW\_ADULT | "allow_adult" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | +| ALLOW\_ALL | "allow_all" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | +| BLOCK\_ALL | "dont_allow" | (Public Preview) Disallow generation of images containing people or faces; images of people are filtered out. | + +## ImagenSafetyFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling how aggressively to filter sensitive content. + +Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. + +Signature: + +```typescript +export declare enum ImagenSafetyFilterLevel +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "block_low_and_above" | (Public Preview) The most aggressive filtering level; most strict blocking. | +| BLOCK\_MEDIUM\_AND\_ABOVE | "block_medium_and_above" | (Public Preview) Blocks some sensitive prompts and responses. | +| BLOCK\_NONE | "block_none" | (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. | +| BLOCK\_ONLY\_HIGH | "block_only_high" | (Public Preview) Blocks few sensitive prompts and responses. | + ## SchemaType Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) diff --git a/docs-devsite/vertexai.vertexaimodel.md b/docs-devsite/vertexai.vertexaimodel.md new file mode 100644 index 00000000000..5c3244fe1e5 --- /dev/null +++ b/docs-devsite/vertexai.vertexaimodel.md @@ -0,0 +1,66 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# VertexAIModel class +Base class for Vertex AI in Firebase model APIs. + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `VertexAIModel` class. + +Signature: + +```typescript +export declare abstract class VertexAIModel +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai.vertexaimodel.md#vertexaimodelmodel) | | string | The fully qualified model resource name to use for generating images (for example, publishers/google/models/imagen-3.0-generate-002). | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [normalizeModelName(modelName)](./vertexai.vertexaimodel.md#vertexaimodelnormalizemodelname) | static | Normalizes the given model name to a fully qualified model resource name. | + +## VertexAIModel.model + +The fully qualified model resource name to use for generating images (for example, `publishers/google/models/imagen-3.0-generate-002`). + +Signature: + +```typescript +readonly model: string; +``` + +## VertexAIModel.normalizeModelName() + +Normalizes the given model name to a fully qualified model resource name. + +Signature: + +```typescript +static normalizeModelName(modelName: string): string; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| modelName | string | The model name to normalize. | + +Returns: + +string + +The fully qualified model resource name. + diff --git a/packages/vertexai/src/api.test.ts b/packages/vertexai/src/api.test.ts index b6c96923856..c1b2635ce70 100644 --- a/packages/vertexai/src/api.test.ts +++ b/packages/vertexai/src/api.test.ts @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ModelParams, VertexAIErrorCode } from './types'; +import { ImagenModelParams, ModelParams, VertexAIErrorCode } from './types'; import { VertexAIError } from './errors'; -import { getGenerativeModel } from './api'; +import { ImagenModel, getGenerativeModel, getImagenModel } from './api'; import { expect } from 'chai'; import { VertexAI } from './public-types'; import { GenerativeModel } from './models/generative-model'; @@ -84,4 +84,54 @@ describe('Top level API', () => { expect(genModel).to.be.an.instanceOf(GenerativeModel); expect(genModel.model).to.equal('publishers/google/models/my-model'); }); + it('getImagenModel throws if no model is provided', () => { + try { + getImagenModel(fakeVertexAI, {} as ImagenModelParams); + } catch (e) { + expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_MODEL); + expect((e as VertexAIError).message).includes( + `VertexAI: Must provide a model name. Example: ` + + `getImagenModel({ model: 'my-model-name' }) (vertexAI/${VertexAIErrorCode.NO_MODEL})` + ); + } + }); + it('getImagenModel throws if no apiKey is provided', () => { + const fakeVertexNoApiKey = { + ...fakeVertexAI, + app: { options: { projectId: 'my-project' } } + } as VertexAI; + try { + getImagenModel(fakeVertexNoApiKey, { model: 'my-model' }); + } catch (e) { + expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_API_KEY); + expect((e as VertexAIError).message).equals( + `VertexAI: The "apiKey" field is empty in the local ` + + `Firebase config. Firebase VertexAI requires this field to` + + ` contain a valid API key. (vertexAI/${VertexAIErrorCode.NO_API_KEY})` + ); + } + }); + it('getImagenModel throws if no projectId is provided', () => { + const fakeVertexNoProject = { + ...fakeVertexAI, + app: { options: { apiKey: 'my-key' } } + } as VertexAI; + try { + getImagenModel(fakeVertexNoProject, { model: 'my-model' }); + } catch (e) { + expect((e as VertexAIError).code).includes( + VertexAIErrorCode.NO_PROJECT_ID + ); + expect((e as VertexAIError).message).equals( + `VertexAI: The "projectId" field is empty in the local` + + ` Firebase config. Firebase VertexAI requires this field ` + + `to contain a valid project ID. (vertexAI/${VertexAIErrorCode.NO_PROJECT_ID})` + ); + } + }); + it('getImagenModel gets an ImagenModel', () => { + const genModel = getImagenModel(fakeVertexAI, { model: 'my-model' }); + expect(genModel).to.be.an.instanceOf(ImagenModel); + expect(genModel.model).to.equal('publishers/google/models/my-model'); + }); }); diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 42f33ed2a85..752e75c7e23 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -21,15 +21,19 @@ import { getModularInstance } from '@firebase/util'; import { DEFAULT_LOCATION, VERTEX_TYPE } from './constants'; import { VertexAIService } from './service'; import { VertexAI, VertexAIOptions } from './public-types'; -import { ModelParams, RequestOptions, VertexAIErrorCode } from './types'; +import { + ImagenModelParams, + ModelParams, + RequestOptions, + VertexAIErrorCode +} from './types'; import { VertexAIError } from './errors'; -import { GenerativeModel } from './models/generative-model'; +import { VertexAIModel, GenerativeModel, ImagenModel } from './models'; export { ChatSession } from './methods/chat-session'; export * from './requests/schema-builder'; - -export { GenerativeModel }; - +export { ImagenImageFormat } from './requests/imagen-image-format'; +export { VertexAIModel, GenerativeModel, ImagenModel }; export { VertexAIError }; declare module '@firebase/component' { @@ -77,3 +81,31 @@ export function getGenerativeModel( } return new GenerativeModel(vertexAI, modelParams, requestOptions); } + +/** + * Returns an {@link ImagenModel} class with methods for using Imagen. + * + * Only Imagen 3 models (named `imagen-3.0-*`) are supported. + * + * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param modelParams - Parameters to use when making Imagen requests. + * @param requestOptions - Additional options to use when making requests. + * + * @throws If the `apiKey` or `projectId` fields are missing in your + * Firebase config. + * + * @beta + */ +export function getImagenModel( + vertexAI: VertexAI, + modelParams: ImagenModelParams, + requestOptions?: RequestOptions +): ImagenModel { + if (!modelParams.model) { + throw new VertexAIError( + VertexAIErrorCode.NO_MODEL, + `Must provide a model name. Example: getImagenModel({ model: 'my-model-name' })` + ); + } + return new ImagenModel(vertexAI, modelParams, requestOptions); +} diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index e03f39e8a83..c2dbdfac75c 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -37,28 +37,6 @@ const fakeVertexAI: VertexAI = { }; describe('GenerativeModel', () => { - it('handles plain model name', () => { - const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model' }); - expect(genModel.model).to.equal('publishers/google/models/my-model'); - }); - it('handles models/ prefixed model name', () => { - const genModel = new GenerativeModel(fakeVertexAI, { - model: 'models/my-model' - }); - expect(genModel.model).to.equal('publishers/google/models/my-model'); - }); - it('handles full model name', () => { - const genModel = new GenerativeModel(fakeVertexAI, { - model: 'publishers/google/models/my-model' - }); - expect(genModel.model).to.equal('publishers/google/models/my-model'); - }); - it('handles prefixed tuned model name', () => { - const genModel = new GenerativeModel(fakeVertexAI, { - model: 'tunedModels/my-model' - }); - expect(genModel.model).to.equal('tunedModels/my-model'); - }); it('passes params through to generateContent', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model', diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index b44dc1131a3..b4cf464f025 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -33,10 +33,8 @@ import { SafetySetting, StartChatParams, Tool, - ToolConfig, - VertexAIErrorCode + ToolConfig } from '../types'; -import { VertexAIError } from '../errors'; import { ChatSession } from '../methods/chat-session'; import { countTokens } from '../methods/count-tokens'; import { @@ -44,17 +42,13 @@ import { formatSystemInstruction } from '../requests/request-helpers'; import { VertexAI } from '../public-types'; -import { ApiSettings } from '../types/internal'; -import { VertexAIService } from '../service'; -import { _isFirebaseServerApp } from '@firebase/app'; +import { VertexAIModel } from './vertexai-model'; /** * Class for generative model APIs. * @public */ -export class GenerativeModel { - private _apiSettings: ApiSettings; - model: string; +export class GenerativeModel extends VertexAIModel { generationConfig: GenerationConfig; safetySettings: SafetySetting[]; requestOptions?: RequestOptions; @@ -67,53 +61,7 @@ export class GenerativeModel { modelParams: ModelParams, requestOptions?: RequestOptions ) { - if (!vertexAI.app?.options?.apiKey) { - throw new VertexAIError( - VertexAIErrorCode.NO_API_KEY, - `The "apiKey" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid API key.` - ); - } else if (!vertexAI.app?.options?.projectId) { - throw new VertexAIError( - VertexAIErrorCode.NO_PROJECT_ID, - `The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` - ); - } else { - this._apiSettings = { - apiKey: vertexAI.app.options.apiKey, - project: vertexAI.app.options.projectId, - location: vertexAI.location - }; - - if ( - _isFirebaseServerApp(vertexAI.app) && - vertexAI.app.settings.appCheckToken - ) { - const token = vertexAI.app.settings.appCheckToken; - this._apiSettings.getAppCheckToken = () => { - return Promise.resolve({ token }); - }; - } else if ((vertexAI as VertexAIService).appCheck) { - this._apiSettings.getAppCheckToken = () => - (vertexAI as VertexAIService).appCheck!.getToken(); - } - - if ((vertexAI as VertexAIService).auth) { - this._apiSettings.getAuthToken = () => - (vertexAI as VertexAIService).auth!.getToken(); - } - } - if (modelParams.model.includes('/')) { - if (modelParams.model.startsWith('models/')) { - // Add "publishers/google" if the user is only passing in 'models/model-name'. - this.model = `publishers/google/${modelParams.model}`; - } else { - // Any other custom format (e.g. tuned models) must be passed in correctly. - this.model = modelParams.model; - } - } else { - // If path is not included, assume it's a non-tuned model. - this.model = `publishers/google/models/${modelParams.model}`; - } + super(vertexAI, modelParams.model); this.generationConfig = modelParams.generationConfig || {}; this.safetySettings = modelParams.safetySettings || []; this.tools = modelParams.tools; diff --git a/packages/vertexai/src/models/imagen-model.test.ts b/packages/vertexai/src/models/imagen-model.test.ts new file mode 100644 index 00000000000..000b2f07f90 --- /dev/null +++ b/packages/vertexai/src/models/imagen-model.test.ts @@ -0,0 +1,160 @@ +/** + * @license + * Copyright 2025 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 { use, expect } from 'chai'; +import { ImagenModel } from './imagen-model'; +import { + ImagenAspectRatio, + ImagenPersonFilterLevel, + ImagenSafetyFilterLevel, + VertexAI, + VertexAIErrorCode +} from '../public-types'; +import * as request from '../requests/request'; +import sinonChai from 'sinon-chai'; +import { VertexAIError } from '../errors'; +import { getMockResponse } from '../../test-utils/mock-response'; +import { match, restore, stub } from 'sinon'; + +use(sinonChai); + +const fakeVertexAI: VertexAI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key', + projectId: 'my-project' + } + }, + location: 'us-central1' +}; + +describe('ImagenModel', () => { + it('generateImages makes a request to predict with default parameters', async () => { + const mockResponse = getMockResponse( + 'unary-success-generate-images-base64.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + + const imagenModel = new ImagenModel(fakeVertexAI, { + model: 'my-model' + }); + const prompt = 'A photorealistic image of a toy boat at sea.'; + await imagenModel.generateImages(prompt); + expect(makeRequestStub).to.be.calledWith( + 'publishers/google/models/my-model', + request.Task.PREDICT, + match.any, + false, + match((value: string) => { + return ( + value.includes(`"prompt":"${prompt}"`) && + value.includes(`"sampleCount":1`) + ); + }), + undefined + ); + restore(); + }); + it('generateImages makes a request to predict with generation config and safety settings', async () => { + const imagenModel = new ImagenModel(fakeVertexAI, { + model: 'my-model', + generationConfig: { + negativePrompt: 'do not hallucinate', + numberOfImages: 4, + aspectRatio: ImagenAspectRatio.LANDSCAPE_16x9, + imageFormat: { mimeType: 'image/jpeg', compressionQuality: 75 }, + addWatermark: true + }, + safetySettings: { + safetyFilterLevel: ImagenSafetyFilterLevel.BLOCK_ONLY_HIGH, + personFilterLevel: ImagenPersonFilterLevel.ALLOW_ADULT + } + }); + + const mockResponse = getMockResponse( + 'unary-success-generate-images-base64.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + const prompt = 'A photorealistic image of a toy boat at sea.'; + await imagenModel.generateImages(prompt); + expect(makeRequestStub).to.be.calledWith( + 'publishers/google/models/my-model', + request.Task.PREDICT, + match.any, + false, + match((value: string) => { + return ( + value.includes( + `"negativePrompt":"${imagenModel.generationConfig?.negativePrompt}"` + ) && + value.includes( + `"sampleCount":${imagenModel.generationConfig?.numberOfImages}` + ) && + value.includes( + `"aspectRatio":"${imagenModel.generationConfig?.aspectRatio}"` + ) && + value.includes( + JSON.stringify(imagenModel.generationConfig?.imageFormat?.mimeType) + ) && + value.includes( + JSON.stringify(imagenModel.generationConfig?.addWatermark) + ) && + value.includes( + JSON.stringify(imagenModel.safetySettings?.safetyFilterLevel) + ) && + value.includes( + JSON.stringify(imagenModel.safetySettings?.personFilterLevel) + ) + ); + }), + undefined + ); + restore(); + }); + it('throws if prompt blocked', async () => { + const mockResponse = getMockResponse( + 'unary-failure-generate-images-prompt-blocked.json' + ); + + stub(globalThis, 'fetch').resolves({ + ok: false, + status: 400, + statusText: 'Bad Request', + json: mockResponse.json + } as Response); + + const imagenModel = new ImagenModel(fakeVertexAI, { + model: 'my-model' + }); + try { + await imagenModel.generateImages('some inappropriate prompt.'); + } catch (e) { + expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.FETCH_ERROR); + expect((e as VertexAIError).message).to.include('400'); + expect((e as VertexAIError).message).to.include( + "Image generation failed with the following error: The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices. Try rephrasing the prompt. If you think this was an error, send feedback." + ); + } finally { + restore(); + } + }); +}); diff --git a/packages/vertexai/src/models/imagen-model.ts b/packages/vertexai/src/models/imagen-model.ts new file mode 100644 index 00000000000..89c740852a3 --- /dev/null +++ b/packages/vertexai/src/models/imagen-model.ts @@ -0,0 +1,160 @@ +/** + * @license + * Copyright 2025 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 { VertexAI } from '../public-types'; +import { Task, makeRequest } from '../requests/request'; +import { createPredictRequestBody } from '../requests/request-helpers'; +import { handlePredictResponse } from '../requests/response-helpers'; +import { + ImagenGCSImage, + ImagenGenerationConfig, + ImagenInlineImage, + RequestOptions, + ImagenModelParams, + ImagenGenerationResponse, + ImagenSafetySettings +} from '../types'; +import { VertexAIModel } from './vertexai-model'; + +/** + * Class for Imagen model APIs. + * + * This class provides methods for generating images using the Imagen model. + * + * @example + * ```javascript + * const imagen = new ImagenModel( + * vertexAI, + * { + * model: 'imagen-3.0-generate-002' + * } + * ); + * + * const response = await imagen.generateImages('A photo of a cat'); + * if (response.images.length > 0) { + * console.log(response.images[0].bytesBase64Encoded); + * } + * ``` + * + * @beta + */ +export class ImagenModel extends VertexAIModel { + /** + * The Imagen generation configuration. + */ + generationConfig?: ImagenGenerationConfig; + /** + * Safety settings for filtering inappropriate content. + */ + safetySettings?: ImagenSafetySettings; + + /** + * Constructs a new instance of the {@link ImagenModel} class. + * + * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param modelParams - Parameters to use when making requests to Imagen. + * @param requestOptions - Additional options to use when making requests. + * + * @throws If the `apiKey` or `projectId` fields are missing in your + * Firebase config. + */ + constructor( + vertexAI: VertexAI, + modelParams: ImagenModelParams, + public requestOptions?: RequestOptions + ) { + const { model, generationConfig, safetySettings } = modelParams; + super(vertexAI, model); + this.generationConfig = generationConfig; + this.safetySettings = safetySettings; + } + + /** + * Generates images using the Imagen model and returns them as + * base64-encoded strings. + * + * @param prompt - A text prompt describing the image(s) to generate. + * @returns A promise that resolves to an {@link ImagenGenerationResponse} + * object containing the generated images. + * + * @throws If the request to generate images fails. This happens if the + * prompt is blocked. + * + * @remarks + * If the prompt was not blocked, but one or more of the generated images were filtered, the + * returned object will have a `filteredReason` property. + * If all images are filtered, the `images` array will be empty. + * + * @beta + */ + async generateImages( + prompt: string + ): Promise> { + const body = createPredictRequestBody(prompt, { + ...this.generationConfig, + ...this.safetySettings + }); + const response = await makeRequest( + this.model, + Task.PREDICT, + this._apiSettings, + /* stream */ false, + JSON.stringify(body), + this.requestOptions + ); + return handlePredictResponse(response); + } + + /** + * Generates images to Cloud Storage for Firebase using the Imagen model. + * + * @internal This method is temporarily internal. + * + * @param prompt - A text prompt describing the image(s) to generate. + * @param gcsURI - The URI of file stored in a Cloud Storage for Firebase bucket. + * This should be a directory. For example, `gs://my-bucket/my-directory/`. + * @returns A promise that resolves to an {@link ImagenGenerationResponse} + * object containing the URLs of the generated images. + * + * @throws If the request fails to generate images fails. This happens if + * the prompt is blocked. + * + * @remarks + * If the prompt was not blocked, but one or more of the generated images were filtered, the + * returned object will have a `filteredReason` property. + * If all images are filtered, the `images` array will be empty. + */ + async generateImagesGCS( + prompt: string, + gcsURI: string + ): Promise> { + const body = createPredictRequestBody(prompt, { + gcsURI, + ...this.generationConfig, + ...this.safetySettings + }); + const response = await makeRequest( + this.model, + Task.PREDICT, + this._apiSettings, + /* stream */ false, + JSON.stringify(body), + this.requestOptions + ); + return handlePredictResponse(response); + } +} diff --git a/packages/vertexai/src/models/index.ts b/packages/vertexai/src/models/index.ts new file mode 100644 index 00000000000..aec06be26fd --- /dev/null +++ b/packages/vertexai/src/models/index.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2025 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. + */ + +export * from './vertexai-model'; +export * from './generative-model'; +export * from './imagen-model'; diff --git a/packages/vertexai/src/models/vertexai-model.test.ts b/packages/vertexai/src/models/vertexai-model.test.ts new file mode 100644 index 00000000000..2aa36d56f0d --- /dev/null +++ b/packages/vertexai/src/models/vertexai-model.test.ts @@ -0,0 +1,103 @@ +/** + * @license + * Copyright 2025 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 { use, expect } from 'chai'; +import { VertexAI, VertexAIErrorCode } from '../public-types'; +import sinonChai from 'sinon-chai'; +import { VertexAIModel } from './vertexai-model'; +import { VertexAIError } from '../errors'; + +use(sinonChai); + +/** + * A class that extends VertexAIModel that allows us to test the protected constructor. + */ +class TestModel extends VertexAIModel { + /* eslint-disable @typescript-eslint/no-useless-constructor */ + constructor(vertexAI: VertexAI, modelName: string) { + super(vertexAI, modelName); + } +} + +const fakeVertexAI: VertexAI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key', + projectId: 'my-project' + } + }, + location: 'us-central1' +}; + +describe('VertexAIModel', () => { + it('handles plain model name', () => { + const testModel = new TestModel(fakeVertexAI, 'my-model'); + expect(testModel.model).to.equal('publishers/google/models/my-model'); + }); + it('handles models/ prefixed model name', () => { + const testModel = new TestModel(fakeVertexAI, 'models/my-model'); + expect(testModel.model).to.equal('publishers/google/models/my-model'); + }); + it('handles full model name', () => { + const testModel = new TestModel( + fakeVertexAI, + 'publishers/google/models/my-model' + ); + expect(testModel.model).to.equal('publishers/google/models/my-model'); + }); + it('handles prefixed tuned model name', () => { + const testModel = new TestModel(fakeVertexAI, 'tunedModels/my-model'); + expect(testModel.model).to.equal('tunedModels/my-model'); + }); + it('throws if not passed an api key', () => { + const fakeVertexAI: VertexAI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + projectId: 'my-project' + } + }, + location: 'us-central1' + }; + try { + new TestModel(fakeVertexAI, 'my-model'); + } catch (e) { + expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.NO_API_KEY); + } + }); + it('throws if not passed a project ID', () => { + const fakeVertexAI: VertexAI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key' + } + }, + location: 'us-central1' + }; + try { + new TestModel(fakeVertexAI, 'my-model'); + } catch (e) { + expect((e as VertexAIError).code).to.equal( + VertexAIErrorCode.NO_PROJECT_ID + ); + } + }); +}); diff --git a/packages/vertexai/src/models/vertexai-model.ts b/packages/vertexai/src/models/vertexai-model.ts new file mode 100644 index 00000000000..4e211c0cf94 --- /dev/null +++ b/packages/vertexai/src/models/vertexai-model.ts @@ -0,0 +1,121 @@ +/** + * @license + * Copyright 2025 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 { VertexAIError } from '../errors'; +import { VertexAI, VertexAIErrorCode } from '../public-types'; +import { VertexAIService } from '../service'; +import { ApiSettings } from '../types/internal'; +import { _isFirebaseServerApp } from '@firebase/app'; + +/** + * Base class for Vertex AI in Firebase model APIs. + * + * @public + */ +export abstract class VertexAIModel { + /** + * The fully qualified model resource name to use for generating images + * (for example, `publishers/google/models/imagen-3.0-generate-002`). + */ + readonly model: string; + + /** + * @internal + */ + protected _apiSettings: ApiSettings; + + /** + * Constructs a new instance of the {@link VertexAIModel} class. + * + * This constructor should only be called from subclasses that provide + * a model API. + * + * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param modelName - The name of the model being used. It can be in one of the following formats: + * - `my-model` (short name, will resolve to `publishers/google/models/my-model`) + * - `models/my-model` (will resolve to `publishers/google/models/my-model`) + * - `publishers/my-publisher/models/my-model` (fully qualified model name) + * + * @throws If the `apiKey` or `projectId` fields are missing in your + * Firebase config. + * + * @internal + */ + protected constructor(vertexAI: VertexAI, modelName: string) { + this.model = VertexAIModel.normalizeModelName(modelName); + + if (!vertexAI.app?.options?.apiKey) { + throw new VertexAIError( + VertexAIErrorCode.NO_API_KEY, + `The "apiKey" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid API key.` + ); + } else if (!vertexAI.app?.options?.projectId) { + throw new VertexAIError( + VertexAIErrorCode.NO_PROJECT_ID, + `The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` + ); + } else { + this._apiSettings = { + apiKey: vertexAI.app.options.apiKey, + project: vertexAI.app.options.projectId, + location: vertexAI.location + }; + + if ( + _isFirebaseServerApp(vertexAI.app) && + vertexAI.app.settings.appCheckToken + ) { + const token = vertexAI.app.settings.appCheckToken; + this._apiSettings.getAppCheckToken = () => { + return Promise.resolve({ token }); + }; + } else if ((vertexAI as VertexAIService).appCheck) { + this._apiSettings.getAppCheckToken = () => + (vertexAI as VertexAIService).appCheck!.getToken(); + } + + if ((vertexAI as VertexAIService).auth) { + this._apiSettings.getAuthToken = () => + (vertexAI as VertexAIService).auth!.getToken(); + } + } + } + + /** + * Normalizes the given model name to a fully qualified model resource name. + * + * @param modelName - The model name to normalize. + * @returns The fully qualified model resource name. + */ + static normalizeModelName(modelName: string): string { + let model: string; + if (modelName.includes('/')) { + if (modelName.startsWith('models/')) { + // Add 'publishers/google' if the user is only passing in 'models/model-name'. + model = `publishers/google/${modelName}`; + } else { + // Any other custom format (e.g. tuned models) must be passed in correctly. + model = modelName; + } + } else { + // If path is not included, assume it's a non-tuned model. + model = `publishers/google/models/${modelName}`; + } + + return model; + } +} diff --git a/packages/vertexai/src/requests/imagen-image-format.ts b/packages/vertexai/src/requests/imagen-image-format.ts new file mode 100644 index 00000000000..283dc80bfaf --- /dev/null +++ b/packages/vertexai/src/requests/imagen-image-format.ts @@ -0,0 +1,81 @@ +/** + * @license + * Copyright 2025 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 { logger } from '../logger'; + +/** + * Defines the image format for images generated by Imagen. + * + * Use this class to specify the desired format (JPEG or PNG) and compression quality + * for images generated by Imagen. This is typically included as part of + * {@link ImagenModelParams}. + * + * @example + * ```javascript + * const imagenModelParams = { + * // ... other ImagenModelParams + * imageFormat: ImagenImageFormat.jpeg(75) // JPEG with a compression level of 75. + * } + * ``` + * + * @beta + */ +export class ImagenImageFormat { + /** + * The MIME type. + */ + mimeType: string; + /** + * The level of compression (a number between 0 and 100). + */ + compressionQuality?: number; + + private constructor() { + this.mimeType = 'image/png'; + } + + /** + * Creates an {@link ImagenImageFormat} for a JPEG image. + * + * @param compressionQuality - The level of compression (a number between 0 and 100). + * @returns An {@link ImagenImageFormat} object for a JPEG image. + * + * @beta + */ + static jpeg(compressionQuality?: number): ImagenImageFormat { + if ( + compressionQuality && + (compressionQuality < 0 || compressionQuality > 100) + ) { + logger.warn( + `Invalid JPEG compression quality of ${compressionQuality} specified; the supported range is [0, 100].` + ); + } + return { mimeType: 'image/jpeg', compressionQuality }; + } + + /** + * Creates an {@link ImagenImageFormat} for a PNG image. + * + * @returns An {@link ImagenImageFormat} object for a PNG image. + * + * @beta + */ + static png(): ImagenImageFormat { + return { mimeType: 'image/png' }; + } +} diff --git a/packages/vertexai/src/requests/request-helpers.test.ts b/packages/vertexai/src/requests/request-helpers.test.ts index 76b2f0ca1bf..d8337850925 100644 --- a/packages/vertexai/src/requests/request-helpers.test.ts +++ b/packages/vertexai/src/requests/request-helpers.test.ts @@ -17,8 +17,16 @@ import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; -import { Content } from '../types'; -import { formatGenerateContentInput } from './request-helpers'; +import { + Content, + ImagenAspectRatio, + ImagenPersonFilterLevel, + ImagenSafetyFilterLevel +} from '../types'; +import { + createPredictRequestBody, + formatGenerateContentInput +} from './request-helpers'; use(sinonChai); @@ -199,4 +207,68 @@ describe('request formatting methods', () => { }); }); }); + describe('createPredictRequestBody', () => { + it('creates body with default request parameters', () => { + const prompt = 'A photorealistic image of a toy boat at sea.'; + const body = createPredictRequestBody(prompt, {}); + expect(body.instances[0].prompt).to.equal(prompt); + expect(body.parameters.sampleCount).to.equal(1); + expect(body.parameters.includeRaiReason).to.be.true; + + // Parameters without default values should be undefined + expect(body.parameters.storageUri).to.be.undefined; + expect(body.parameters.storageUri).to.be.undefined; + expect(body.parameters.outputOptions).to.be.undefined; + expect(body.parameters.negativePrompt).to.be.undefined; + expect(body.parameters.aspectRatio).to.be.undefined; + expect(body.parameters.addWatermark).to.be.undefined; + expect(body.parameters.safetyFilterLevel).to.be.undefined; + expect(body.parameters.personGeneration).to.be.undefined; + }); + }); + it('creates body with non-default request paramaters', () => { + const prompt = 'A photorealistic image of a toy boat at sea.'; + const imageFormat = { mimeType: 'image/jpeg', compressionQuality: 75 }; + const safetySettings = { + safetyFilterLevel: ImagenSafetyFilterLevel.BLOCK_LOW_AND_ABOVE, + personFilterLevel: ImagenPersonFilterLevel.ALLOW_ADULT + }; + const addWatermark = true; + const numberOfImages = 4; + const negativePrompt = 'do not hallucinate'; + const aspectRatio = ImagenAspectRatio.LANDSCAPE_16x9; + const body = createPredictRequestBody(prompt, { + numberOfImages, + imageFormat, + addWatermark, + negativePrompt, + aspectRatio, + ...safetySettings + }); + expect(body.instances[0].prompt).to.equal(prompt); + expect(body.parameters).deep.equal({ + sampleCount: numberOfImages, + outputOptions: { + mimeType: imageFormat.mimeType, + compressionQuality: imageFormat.compressionQuality + }, + addWatermark, + negativePrompt, + safetyFilterLevel: safetySettings.safetyFilterLevel, + personGeneration: safetySettings.personFilterLevel, + aspectRatio, + includeRaiReason: true, + storageUri: undefined + }); + }); + it('creates body with GCS URI', () => { + const prompt = 'A photorealistic image of a toy boat at sea.'; + const gcsURI = 'gcs-uri'; + const body = createPredictRequestBody(prompt, { + gcsURI + }); + + expect(body.instances[0].prompt).to.equal(prompt); + expect(body.parameters.storageUri).to.equal(gcsURI); + }); }); diff --git a/packages/vertexai/src/requests/request-helpers.ts b/packages/vertexai/src/requests/request-helpers.ts index 9e525b2a875..f69c88fca92 100644 --- a/packages/vertexai/src/requests/request-helpers.ts +++ b/packages/vertexai/src/requests/request-helpers.ts @@ -22,6 +22,7 @@ import { VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; +import { ImagenGenerationParams, PredictRequestBody } from '../types/internal'; export function formatSystemInstruction( input?: string | Part | Content @@ -124,3 +125,44 @@ export function formatGenerateContentInput( } return formattedRequest; } + +/** + * Convert the user-defined parameters in {@link ImagenGenerationParams} to the format + * that is expected from the REST API. + * + * @internal + */ +export function createPredictRequestBody( + prompt: string, + { + gcsURI, + imageFormat, + addWatermark, + numberOfImages = 1, + negativePrompt, + aspectRatio, + safetyFilterLevel, + personFilterLevel + }: ImagenGenerationParams +): PredictRequestBody { + // Properties that are undefined will be omitted from the JSON string that is sent in the request. + const body: PredictRequestBody = { + instances: [ + { + prompt + } + ], + parameters: { + storageUri: gcsURI, + negativePrompt, + sampleCount: numberOfImages, + aspectRatio, + outputOptions: imageFormat, + addWatermark, + safetyFilterLevel, + personGeneration: personFilterLevel, + includeRaiReason: true + } + }; + return body; +} diff --git a/packages/vertexai/src/requests/request.ts b/packages/vertexai/src/requests/request.ts index f81b40635e3..9b9465db776 100644 --- a/packages/vertexai/src/requests/request.ts +++ b/packages/vertexai/src/requests/request.ts @@ -30,7 +30,8 @@ import { logger } from '../logger'; export enum Task { GENERATE_CONTENT = 'generateContent', STREAM_GENERATE_CONTENT = 'streamGenerateContent', - COUNT_TOKENS = 'countTokens' + COUNT_TOKENS = 'countTokens', + PREDICT = 'predict' } export class RequestUrl { diff --git a/packages/vertexai/src/requests/response-helpers.test.ts b/packages/vertexai/src/requests/response-helpers.test.ts index 91a60d2cfce..4cab8cde047 100644 --- a/packages/vertexai/src/requests/response-helpers.test.ts +++ b/packages/vertexai/src/requests/response-helpers.test.ts @@ -15,7 +15,11 @@ * limitations under the License. */ -import { addHelpers, formatBlockErrorMessage } from './response-helpers'; +import { + addHelpers, + formatBlockErrorMessage, + handlePredictResponse +} from './response-helpers'; import { expect, use } from 'chai'; import { restore } from 'sinon'; import sinonChai from 'sinon-chai'; @@ -23,8 +27,11 @@ import { BlockReason, Content, FinishReason, - GenerateContentResponse + GenerateContentResponse, + ImagenGCSImage, + ImagenInlineImage } from '../types'; +import { getMockResponse } from '../../test-utils/mock-response'; use(sinonChai); @@ -246,4 +253,71 @@ describe('response-helpers methods', () => { ); }); }); + + describe('handlePredictResponse', () => { + it('returns base64 images', async () => { + const mockResponse = getMockResponse( + 'unary-success-generate-images-base64.json' + ) as Response; + const res = await handlePredictResponse(mockResponse); + expect(res.filteredReason).to.be.undefined; + expect(res.images.length).to.equal(4); + res.images.forEach(image => { + expect(image.mimeType).to.equal('image/png'); + expect(image.bytesBase64Encoded.length).to.be.greaterThan(0); + }); + }); + }); + it('returns GCS images', async () => { + const mockResponse = getMockResponse( + 'unary-success-generate-images-gcs.json' + ) as Response; + const res = await handlePredictResponse(mockResponse); + expect(res.filteredReason).to.be.undefined; + expect(res.images.length).to.equal(4); + res.images.forEach((image, i) => { + expect(image.mimeType).to.equal('image/jpeg'); + expect(image.gcsURI).to.equal( + `gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_${i}.jpg` + ); + }); + }); + it('has filtered reason and no images if all images were filtered', async () => { + const mockResponse = getMockResponse( + 'unary-failure-generate-images-all-filtered.json' + ) as Response; + const res = await handlePredictResponse(mockResponse); + expect(res.filteredReason).to.equal( + "Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback. Support codes: 39322892, 29310472" + ); + expect(res.images.length).to.equal(0); + }); + it('has filtered reason and no images if all base64 images were filtered', async () => { + const mockResponse = getMockResponse( + 'unary-failure-generate-images-base64-some-filtered.json' + ) as Response; + const res = await handlePredictResponse(mockResponse); + expect(res.filteredReason).to.equal( + 'Your current safety filter threshold filtered out 2 generated images. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback.' + ); + expect(res.images.length).to.equal(2); + res.images.forEach(image => { + expect(image.mimeType).to.equal('image/png'); + expect(image.bytesBase64Encoded).to.have.length.greaterThan(0); + }); + }); + it('has filtered reason and no images if all GCS images were filtered', async () => { + const mockResponse = getMockResponse( + 'unary-failure-generate-images-gcs-some-filtered.json' + ) as Response; + const res = await handlePredictResponse(mockResponse); + expect(res.filteredReason).to.equal( + 'Your current safety filter threshold filtered out 2 generated images. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback.' + ); + expect(res.images.length).to.equal(2); + res.images.forEach(image => { + expect(image.mimeType).to.equal('image/jpeg'); + expect(image.gcsURI).to.have.length.greaterThan(0); + }); + }); }); diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index 27347d10f0d..1ba0986f3f9 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -21,10 +21,13 @@ import { FunctionCall, GenerateContentCandidate, GenerateContentResponse, + ImagenGCSImage, + ImagenInlineImage, VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; import { logger } from '../logger'; +import { ImagenResponseInternal } from '../types/internal'; /** * Creates an EnhancedGenerateContentResponse object that has helper functions and @@ -196,3 +199,52 @@ export function formatBlockErrorMessage( } return message; } + +/** + * Convert a generic successful fetch response body to an Imagen response object + * that can be returned to the user. This converts the REST APIs response format to our + * APIs representation of a response. + * + * @internal + */ +export async function handlePredictResponse< + T extends ImagenInlineImage | ImagenGCSImage +>(response: Response): Promise<{ images: T[]; filteredReason?: string }> { + const responseJson: ImagenResponseInternal = await response.json(); + + const images: T[] = []; + let filteredReason: string | undefined = undefined; + + // The backend should always send a non-empty array of predictions if the response was successful. + if (!responseJson.predictions || responseJson.predictions?.length === 0) { + throw new VertexAIError( + VertexAIErrorCode.RESPONSE_ERROR, + 'No predictions or filtered reason received from Vertex AI. Please report this issue with the full error details at https://github.com/firebase/firebase-js-sdk/issues.' + ); + } + + for (const prediction of responseJson.predictions) { + if (prediction.raiFilteredReason) { + filteredReason = prediction.raiFilteredReason; + } else if (prediction.mimeType && prediction.bytesBase64Encoded) { + images.push({ + mimeType: prediction.mimeType, + bytesBase64Encoded: prediction.bytesBase64Encoded + } as T); + } else if (prediction.mimeType && prediction.gcsUri) { + images.push({ + mimeType: prediction.mimeType, + gcsURI: prediction.gcsUri + } as T); + } else { + throw new VertexAIError( + VertexAIErrorCode.RESPONSE_ERROR, + `Predictions array in response has missing properties. Response: ${JSON.stringify( + responseJson + )}` + ); + } + } + + return { images, filteredReason }; +} diff --git a/packages/vertexai/src/types/imagen/index.ts b/packages/vertexai/src/types/imagen/index.ts new file mode 100644 index 00000000000..546c64f13b1 --- /dev/null +++ b/packages/vertexai/src/types/imagen/index.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2025 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. + */ + +export * from './requests'; +export * from './responses'; diff --git a/packages/vertexai/src/types/imagen/internal.ts b/packages/vertexai/src/types/imagen/internal.ts new file mode 100644 index 00000000000..02a8a55e01c --- /dev/null +++ b/packages/vertexai/src/types/imagen/internal.ts @@ -0,0 +1,129 @@ +/** + * @license + * Copyright 2025 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 { ImagenGenerationConfig, ImagenSafetySettings } from './requests'; + +/** + * A response from the REST API is expected to look like this in the success case: + * { + * "predictions": [ + * { + * "mimeType": "image/png", + * "bytesBase64Encoded": "iVBORw0KG..." + * }, + * { + * "mimeType": "image/png", + * "bytesBase64Encoded": "i4BOtw0KG..." + * } + * ] + * } + * + * And like this in the failure case: + * { + * "predictions": [ + * { + * "raiFilteredReason": "..." + * } + * ] + * } + * + * @internal + */ +export interface ImagenResponseInternal { + predictions?: Array<{ + /** + * The MIME type of the generated image. + */ + mimeType?: string; + /** + * The image data encoded as a base64 string. + */ + bytesBase64Encoded?: string; + /** + * The GCS URI where the image was stored. + */ + gcsUri?: string; + /** + * The reason why the image was filtered. + */ + raiFilteredReason?: string; + }>; +} + +/** + * The parameters to be sent in the request body of the HTTP call + * to the Vertex AI backend. + * + * We need a seperate internal-only interface for this because the REST + * API expects different parameter names than what we show to our users. + * + * Sample request body JSON: + * { + * "instances": [ + * { + * "prompt": "Portrait of a golden retriever on a beach." + * } + * ], + * "parameters": { + * "mimeType": "image/png", + * "safetyFilterLevel": "block_low_and_above", + * "personGeneration": "allow_all", + * "sampleCount": 2, + * "includeRaiReason": true, + * "aspectRatio": "9:16" + * } + * } + * + * See the Google Cloud docs: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api#-drest + * + * @internal + */ +export interface PredictRequestBody { + instances: [ + { + prompt: string; + } + ]; + parameters: { + sampleCount: number; // Maps to numberOfImages + aspectRatio?: string; + outputOptions?: { + mimeType: string; + compressionQuality?: number; + }; + negativePrompt?: string; + storageUri?: string; // Maps to gcsURI + addWatermark?: boolean; + safetyFilterLevel?: string; + personGeneration?: string; // Maps to personFilterLevel + includeRaiReason: boolean; + }; +} + +/** + * Contains all possible REST API paramaters that are provided by the caller. + * + * @internal + */ +export type ImagenGenerationParams = { + /** + * The Cloud Storage for Firebase bucket URI where the images should be stored + * (for GCS requests only). + */ + gcsURI?: string; +} & ImagenGenerationConfig & + ImagenSafetySettings; diff --git a/packages/vertexai/src/types/imagen/requests.ts b/packages/vertexai/src/types/imagen/requests.ts new file mode 100644 index 00000000000..ac37488dfb5 --- /dev/null +++ b/packages/vertexai/src/types/imagen/requests.ts @@ -0,0 +1,212 @@ +/** + * @license + * Copyright 2025 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 { ImagenImageFormat } from '../../requests/imagen-image-format'; + +/** + * Parameters for configuring an {@link ImagenModel}. + * + * @beta + */ +export interface ImagenModelParams { + /** + * The Imagen model to use for generating images. + * For example: `imagen-3.0-generate-002`. + * + * Only Imagen 3 models (named `imagen-3.0-*`) are supported. + * + * See {@link https://firebase.google.com/docs/vertex-ai/models | model versions} + * for a full list of supported Imagen 3 models. + */ + model: string; + /** + * Configuration options for generating images with Imagen. + */ + generationConfig?: ImagenGenerationConfig; + /** + * Safety settings for filtering potentially inappropriate content. + */ + safetySettings?: ImagenSafetySettings; +} + +/** + * Configuration options for generating images with Imagen. + * + * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images-imagen | documentation} for + * more details. + * + * @beta + */ +export interface ImagenGenerationConfig { + /** + * A description of what should be omitted from the generated images. + * + * Support for negative prompts depends on the Imagen model. + * + * See the {@link http://firebase.google.com/docs/vertex-ai/model-parameters#imagen | documentation} for more details. + */ + negativePrompt?: string; + /** + * The number of images to generate. The default value is 1. + * + * The number of sample images that may be generated in each request depends on the model + * (typically up to 4); see the sampleCount + * documentation for more details. + */ + numberOfImages?: number; + /** + * The aspect ratio of the generated images. The default value is square 1:1. + * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio} + * for more details. + */ + aspectRatio?: ImagenAspectRatio; + /** + * The image format of the generated images. The default is PNG. + * + * See {@link ImagenImageFormat} for more details. + */ + imageFormat?: ImagenImageFormat; + /** + * Whether to add an invisible watermark to generated images. + * + * If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate + * that they are AI generated. If set to `false`, watermarking will be disabled. + * + * For Imagen 3 models, the default value is `true`; see the addWatermark + * documentation for more details. + */ + addWatermark?: boolean; +} + +/** + * A filter level controlling how aggressively to filter sensitive content. + * + * Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI + * are assessed against a list of safety filters, which include 'harmful categories' (for example, + * `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to + * filter out potentially harmful content from responses. See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} + * for more details. + * + * @beta + */ +export enum ImagenSafetyFilterLevel { + /** + * The most aggressive filtering level; most strict blocking. + */ + BLOCK_LOW_AND_ABOVE = 'block_low_and_above', + /** + * Blocks some sensitive prompts and responses. + */ + BLOCK_MEDIUM_AND_ABOVE = 'block_medium_and_above', + /** + * Blocks few sensitive prompts and responses. + */ + BLOCK_ONLY_HIGH = 'block_only_high', + /** + * The least aggressive filtering level; blocks very few sensitive prompts and responses. + * + * Access to this feature is restricted and may require your case to be reviewed and approved by + * Cloud support. + */ + BLOCK_NONE = 'block_none' +} + +/** + * A filter level controlling whether generation of images containing people or faces is allowed. + * + * See the personGeneration + * documentation for more details. + * + * @beta + */ +export enum ImagenPersonFilterLevel { + /** + * Disallow generation of images containing people or faces; images of people are filtered out. + */ + BLOCK_ALL = 'dont_allow', + /** + * Allow generation of images containing adults only; images of children are filtered out. + * + * Generation of images containing people or faces may require your use case to be + * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines} + * for more details. + */ + ALLOW_ADULT = 'allow_adult', + /** + * Allow generation of images containing adults only; images of children are filtered out. + * + * Generation of images containing people or faces may require your use case to be + * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines} + * for more details. + */ + ALLOW_ALL = 'allow_all' +} + +/** + * Settings for controlling the aggressiveness of filtering out sensitive content. + * + * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * for more details. + * + * @beta + */ +export interface ImagenSafetySettings { + /** + * A filter level controlling how aggressive to filter out sensitive content from generated + * images. + */ + safetyFilterLevel?: ImagenSafetyFilterLevel; + /** + * A filter level controlling whether generation of images containing people or faces is allowed. + */ + personFilterLevel?: ImagenPersonFilterLevel; +} + +/** + * Aspect ratios for Imagen images. + * + * To specify an aspect ratio for generated images, set the `aspectRatio` property in your + * {@link ImagenGenerationConfig}. + * + * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * for more details and examples of the supported aspect ratios. + * + * @beta + */ +export enum ImagenAspectRatio { + /** + * Square (1:1) aspect ratio. + */ + SQUARE = '1:1', + /** + * Landscape (3:4) aspect ratio. + */ + LANDSCAPE_3x4 = '3:4', + /** + * Portrait (4:3) aspect ratio. + */ + PORTRAIT_4x3 = '4:3', + /** + * Landscape (16:9) aspect ratio. + */ + LANDSCAPE_16x9 = '16:9', + /** + * Portrait (9:16) aspect ratio. + */ + PORTRAIT_9x16 = '9:16' +} diff --git a/packages/vertexai/src/types/imagen/responses.ts b/packages/vertexai/src/types/imagen/responses.ts new file mode 100644 index 00000000000..c5cf5dd9057 --- /dev/null +++ b/packages/vertexai/src/types/imagen/responses.ts @@ -0,0 +1,83 @@ +/** + * @license + * Copyright 2025 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. + */ + +/** + * An image generated by Imagen, represented as inline data. + * + * @beta + */ +export interface ImagenInlineImage { + /** + * The MIME type of the image; either `"image/png"` or `"image/jpeg"`. + * + * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. + */ + mimeType: string; + /** + * The base64-encoded image data. + */ + bytesBase64Encoded: string; +} + +/** + * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. + * + * This feature is not available yet. + */ +export interface ImagenGCSImage { + /** + * The MIME type of the image; either `"image/png"` or `"image/jpeg"`. + * + * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. + */ + mimeType: string; + /** + * The URI of the file stored in a Cloud Storage for Firebase bucket. + * + * @example `"gs://bucket-name/path/sample_0.jpg"`. + */ + gcsURI: string; +} + +/** + * The response from a request to generate images with Imagen. + * + * @beta + */ +export interface ImagenGenerationResponse< + T extends ImagenInlineImage | ImagenGCSImage +> { + /** + * The images generated by Imagen. + * + * The number of images generated may be fewer than the number requested if one or more were + * filtered out; see `filteredReason`. + */ + images: T[]; + /** + * The reason that images were filtered out. This property will only be defined if one + * or more images were filtered. + * + * Images may be filtered out due to the {@link ImagenSafetyFilterLevel}, + * {@link ImagenPersonFilterLevel}, or filtering included in the model. + * The filter levels may be adjusted in your {@link ImagenSafetySettings}. + * + * See the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen | Responsible AI and usage guidelines for Imagen} + * for more details. + */ + filteredReason?: string; +} diff --git a/packages/vertexai/src/types/index.ts b/packages/vertexai/src/types/index.ts index 85133aa07c5..f575c5ba8e9 100644 --- a/packages/vertexai/src/types/index.ts +++ b/packages/vertexai/src/types/index.ts @@ -21,3 +21,4 @@ export * from './requests'; export * from './responses'; export * from './error'; export * from './schema'; +export * from './imagen'; diff --git a/packages/vertexai/src/types/internal.ts b/packages/vertexai/src/types/internal.ts index 8271175feff..87c28a02ab2 100644 --- a/packages/vertexai/src/types/internal.ts +++ b/packages/vertexai/src/types/internal.ts @@ -18,6 +18,8 @@ import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; +export * from './imagen/internal'; + export interface ApiSettings { apiKey: string; project: string; From 9d826659334e1a43acd1126fab6e09a305e04936 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Date: Mon, 24 Feb 2025 12:30:39 -0500 Subject: [PATCH 117/295] Add support for token-based usage metrics. (#8757) * Add support for token-based usage metrics. Token measurement is broken down by modaliy, with separate counters for image, audio, etc. Tests are in version 6.*, so this change also includes bumping update_responses.sh * Use right name for unspecified enum * Update API reports * Make promptTokensDetails an array * Update API reports * Add missing documentation * Add changeset entry * Fix formatting errors * Update API reports * Add missing refdoc * Update API reports * Use correct formatting for Modality documentation. * Update API reports * Update docs * Update packages/vertexai/src/types/enums.ts Co-authored-by: rachelsaunders <52258509+rachelsaunders@users.noreply.github.com> * Update md files * Revert changes to api-extractor.json --------- Co-authored-by: rachelsaunders <52258509+rachelsaunders@users.noreply.github.com> --- .changeset/chilled-tips-judge.md | 6 +++ common/api-review/vertexai.api.md | 21 +++++++++ docs-devsite/_toc.yaml | 2 + docs-devsite/vertexai.counttokensresponse.md | 11 +++++ docs-devsite/vertexai.md | 23 ++++++++++ docs-devsite/vertexai.modalitytokencount.md | 46 +++++++++++++++++++ docs-devsite/vertexai.usagemetadata.md | 18 ++++++++ .../vertexai/src/methods/count-tokens.test.ts | 27 +++++++++++ .../src/methods/generate-content.test.ts | 34 ++++++++++++++ packages/vertexai/src/types/enums.ts | 31 +++++++++++++ packages/vertexai/src/types/responses.ts | 21 ++++++++- 11 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-tips-judge.md create mode 100644 docs-devsite/vertexai.modalitytokencount.md diff --git a/.changeset/chilled-tips-judge.md b/.changeset/chilled-tips-judge.md new file mode 100644 index 00000000000..15d58806a9e --- /dev/null +++ b/.changeset/chilled-tips-judge.md @@ -0,0 +1,6 @@ +--- +'@firebase/vertexai': minor +'firebase': minor +--- + +Added support for modality-based token count. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 4521aaf2b70..8b1dd83f51a 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -92,6 +92,7 @@ export interface CountTokensRequest { // @public export interface CountTokensResponse { + promptTokensDetails?: ModalityTokenCount[]; totalBillableCharacters?: number; totalTokens: number; } @@ -532,6 +533,22 @@ export class IntegerSchema extends Schema { constructor(schemaParams?: SchemaParams); } +// @public +export enum Modality { + AUDIO = "AUDIO", + DOCUMENT = "DOCUMENT", + IMAGE = "IMAGE", + MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED", + TEXT = "TEXT", + VIDEO = "VIDEO" +} + +// @public +export interface ModalityTokenCount { + modality: Modality; + tokenCount: number; +} + // @public export interface ModelParams extends BaseParams { // (undocumented) @@ -767,8 +784,12 @@ export interface UsageMetadata { // (undocumented) candidatesTokenCount: number; // (undocumented) + candidatesTokensDetails?: ModalityTokenCount[]; + // (undocumented) promptTokenCount: number; // (undocumented) + promptTokensDetails?: ModalityTokenCount[]; + // (undocumented) totalTokenCount: number; } diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index d97377e3d3d..665222edb9d 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -556,6 +556,8 @@ toc: path: /docs/reference/js/vertexai.inlinedatapart.md - title: IntegerSchema path: /docs/reference/js/vertexai.integerschema.md + - title: ModalityTokenCount + path: /docs/reference/js/vertexai.modalitytokencount.md - title: ModelParams path: /docs/reference/js/vertexai.modelparams.md - title: NumberSchema diff --git a/docs-devsite/vertexai.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md index 2978f9a45bb..d67cc99fab2 100644 --- a/docs-devsite/vertexai.counttokensresponse.md +++ b/docs-devsite/vertexai.counttokensresponse.md @@ -22,9 +22,20 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | +| [promptTokensDetails](./vertexai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. | | [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | | [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | +## CountTokensResponse.promptTokensDetails + +The breakdown, by modality, of how many tokens are consumed by the prompt. + +Signature: + +```typescript +promptTokensDetails?: ModalityTokenCount[]; +``` + ## CountTokensResponse.totalBillableCharacters The total number of billable characters counted across all instances from the request. diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index 1d284345c39..d174bef7bcf 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -55,6 +55,7 @@ The Vertex AI in Firebase Web SDK. | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [Modality](./vertexai.md#modality) | Content part modality. | | [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | @@ -97,6 +98,7 @@ The Vertex AI in Firebase Web SDK. | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). | | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | @@ -481,6 +483,27 @@ export declare enum ImagenSafetyFilterLevel | BLOCK\_NONE | "block_none" | (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. | | BLOCK\_ONLY\_HIGH | "block_only_high" | (Public Preview) Blocks few sensitive prompts and responses. | +## Modality + +Content part modality. + +Signature: + +```typescript +export declare enum Modality +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| AUDIO | "AUDIO" | Audio. | +| DOCUMENT | "DOCUMENT" | Document (for example, PDF). | +| IMAGE | "IMAGE" | Image. | +| MODALITY\_UNSPECIFIED | "MODALITY_UNSPECIFIED" | Unspecified modality. | +| TEXT | "TEXT" | Plain text. | +| VIDEO | "VIDEO" | Video. | + ## SchemaType Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) diff --git a/docs-devsite/vertexai.modalitytokencount.md b/docs-devsite/vertexai.modalitytokencount.md new file mode 100644 index 00000000000..d710b51fba6 --- /dev/null +++ b/docs-devsite/vertexai.modalitytokencount.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ModalityTokenCount interface +Represents token counting info for a single modality. + +Signature: + +```typescript +export interface ModalityTokenCount +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [modality](./vertexai.modalitytokencount.md#modalitytokencountmodality) | [Modality](./vertexai.md#modality) | The modality associated with this token count. | +| [tokenCount](./vertexai.modalitytokencount.md#modalitytokencounttokencount) | number | The number of tokens counted. | + +## ModalityTokenCount.modality + +The modality associated with this token count. + +Signature: + +```typescript +modality: Modality; +``` + +## ModalityTokenCount.tokenCount + +The number of tokens counted. + +Signature: + +```typescript +tokenCount: number; +``` diff --git a/docs-devsite/vertexai.usagemetadata.md b/docs-devsite/vertexai.usagemetadata.md index d254f34335f..5f886dd29f2 100644 --- a/docs-devsite/vertexai.usagemetadata.md +++ b/docs-devsite/vertexai.usagemetadata.md @@ -23,7 +23,9 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | | [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [candidatesTokensDetails](./vertexai.usagemetadata.md#usagemetadatacandidatestokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | | | [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [promptTokensDetails](./vertexai.usagemetadata.md#usagemetadataprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | | | [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount @@ -34,6 +36,14 @@ export interface UsageMetadata candidatesTokenCount: number; ``` +## UsageMetadata.candidatesTokensDetails + +Signature: + +```typescript +candidatesTokensDetails?: ModalityTokenCount[]; +``` + ## UsageMetadata.promptTokenCount Signature: @@ -42,6 +52,14 @@ candidatesTokenCount: number; promptTokenCount: number; ``` +## UsageMetadata.promptTokensDetails + +Signature: + +```typescript +promptTokensDetails?: ModalityTokenCount[]; +``` + ## UsageMetadata.totalTokenCount Signature: diff --git a/packages/vertexai/src/methods/count-tokens.test.ts b/packages/vertexai/src/methods/count-tokens.test.ts index fd4b99e1e00..2032e884fb4 100644 --- a/packages/vertexai/src/methods/count-tokens.test.ts +++ b/packages/vertexai/src/methods/count-tokens.test.ts @@ -66,6 +66,33 @@ describe('countTokens()', () => { undefined ); }); + it('total tokens with modality details', async () => { + const mockResponse = getMockResponse( + 'unary-success-detailed-token-response.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + const result = await countTokens( + fakeApiSettings, + 'model', + fakeRequestParams + ); + expect(result.totalTokens).to.equal(1837); + expect(result.totalBillableCharacters).to.equal(117); + expect(result.promptTokensDetails?.[0].modality).to.equal('IMAGE'); + expect(result.promptTokensDetails?.[0].tokenCount).to.equal(1806); + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.COUNT_TOKENS, + fakeApiSettings, + false, + match((value: string) => { + return value.includes('contents'); + }), + undefined + ); + }); it('total tokens no billable characters', async () => { const mockResponse = getMockResponse( 'unary-success-no-billable-characters.json' diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/vertexai/src/methods/generate-content.test.ts index c5a1d9e1e91..001fe12c9c8 100644 --- a/packages/vertexai/src/methods/generate-content.test.ts +++ b/packages/vertexai/src/methods/generate-content.test.ts @@ -102,6 +102,40 @@ describe('generateContent()', () => { match.any ); }); + it('long response with token details', async () => { + const mockResponse = getMockResponse( + 'unary-success-basic-response-long-usage-metadata.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams + ); + expect(result.response.usageMetadata?.totalTokenCount).to.equal(1913); + expect(result.response.usageMetadata?.candidatesTokenCount).to.equal(76); + expect( + result.response.usageMetadata?.promptTokensDetails?.[0].modality + ).to.equal('IMAGE'); + expect( + result.response.usageMetadata?.promptTokensDetails?.[0].tokenCount + ).to.equal(1806); + expect( + result.response.usageMetadata?.candidatesTokensDetails?.[0].modality + ).to.equal('TEXT'); + expect( + result.response.usageMetadata?.candidatesTokensDetails?.[0].tokenCount + ).to.equal(76); + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.GENERATE_CONTENT, + fakeApiSettings, + false, + match.any + ); + }); it('citations', async () => { const mockResponse = getMockResponse('unary-success-citations.json'); const makeRequestStub = stub(request, 'makeRequest').resolves( diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index 3e66bacc612..4a7d95c660c 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -137,3 +137,34 @@ export enum FunctionCallingMode { // not passing any function declarations. NONE = 'NONE' } + +/** + * Content part modality. + * @public + */ +export enum Modality { + /** + * Unspecified modality. + */ + MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED', + /** + * Plain text. + */ + TEXT = 'TEXT', + /** + * Image. + */ + IMAGE = 'IMAGE', + /** + * Video. + */ + VIDEO = 'VIDEO', + /** + * Audio. + */ + AUDIO = 'AUDIO', + /** + * Document (for example, PDF). + */ + DOCUMENT = 'DOCUMENT' +} diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 83cd4366f12..5685ed68ad6 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -21,7 +21,8 @@ import { FinishReason, HarmCategory, HarmProbability, - HarmSeverity + HarmSeverity, + Modality } from './enums'; /** @@ -83,6 +84,20 @@ export interface UsageMetadata { promptTokenCount: number; candidatesTokenCount: number; totalTokenCount: number; + promptTokensDetails?: ModalityTokenCount[]; + candidatesTokensDetails?: ModalityTokenCount[]; +} + +/** + * Represents token counting info for a single modality. + * + * @public + */ +export interface ModalityTokenCount { + /** The modality associated with this token count. */ + modality: Modality; + /** The number of tokens counted. */ + tokenCount: number; } /** @@ -213,4 +228,8 @@ export interface CountTokensResponse { * from the request. */ totalBillableCharacters?: number; + /** + * The breakdown, by modality, of how many tokens are consumed by the prompt. + */ + promptTokensDetails?: ModalityTokenCount[]; } From 1daf8b47ba681db12174bc67f9de9dacf68cc60f Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 24 Feb 2025 09:58:42 -0800 Subject: [PATCH 118/295] Add Vertex and DataConnect E2E smoke tests (#8805) --- e2e/sample-apps/modular.js | 33 ++++++++++++++++++++++++++++++++- e2e/tests/modular.test.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/e2e/sample-apps/modular.js b/e2e/sample-apps/modular.js index cf08ca53d9d..9e943e04494 100644 --- a/e2e/sample-apps/modular.js +++ b/e2e/sample-apps/modular.js @@ -58,6 +58,9 @@ import { onValue, off } from 'firebase/database'; +import { getGenerativeModel, getVertexAI, VertexAI } from 'firebase/vertexai'; +import { getDataConnect, DataConnect } from 'firebase/data-connect'; + /** * The config file should look like: * @@ -287,7 +290,7 @@ function callAppCheck(app) { } /** - * Analytics smoke test. + * Performance smoke test. * Just make sure some functions can be called without obvious errors. */ function callPerformance(app) { @@ -303,6 +306,32 @@ function callPerformance(app) { ); } +/** + * VertexAI smoke test. + * Just make sure some functions can be called without obvious errors. + */ +async function callVertexAI(app) { + console.log('[VERTEXAI] start'); + const vertexAI = getVertexAI(app); + const model = getGenerativeModel(vertexAI, { model: 'gemini-1.5-flash' }); + const result = await model.countTokens('abcdefg'); + console.log(`[VERTEXAI] counted tokens: ${result.totalTokens}`); +} + +/** + * DataConnect smoke test. + * Just make sure some functions can be called without obvious errors. + */ +function callDataConnect(app) { + console.log('[DATACONNECT] start'); + getDataConnect(app, { + location: 'a-location', + connector: 'a-connector', + service: 'service' + }); + console.log('[DATACONNECT] initialized'); +} + /** * Run smoke tests for all products. * Comment out any products you want to ignore. @@ -321,6 +350,8 @@ async function main() { callAnalytics(app); callPerformance(app); await callFunctions(app); + await callVertexAI(app); + callDataConnect(app); await authLogout(app); console.log('DONE'); } diff --git a/e2e/tests/modular.test.ts b/e2e/tests/modular.test.ts index 24432604119..005fadef19a 100644 --- a/e2e/tests/modular.test.ts +++ b/e2e/tests/modular.test.ts @@ -86,6 +86,8 @@ import { StorageReference, deleteObject } from 'firebase/storage'; +import { getGenerativeModel, getVertexAI, VertexAI } from 'firebase/vertexai'; +import { getDataConnect, DataConnect } from 'firebase/data-connect'; import { config, testAccount } from '../firebase-config'; import 'jest'; @@ -304,4 +306,31 @@ describe('MODULAR', () => { expect(trace.getAttribute('testattr')).toBe('perftestvalue'); }); }); + + describe('VERTEXAI', () => { + let vertexAI: VertexAI; + it('getVertexAI()', () => { + vertexAI = getVertexAI(app); + }); + it('getGenerativeModel() and countTokens()', async () => { + const model = getGenerativeModel(vertexAI, { model: 'gemini-1.5-flash' }); + expect(model.model).toMatch(/gemini-1.5-flash$/); + const result = await model.countTokens('abcdefg'); + expect(result.totalTokens).toBeTruthy; + }); + }); + + describe('DATA CONNECT', () => { + let dataConnect: DataConnect; + it('getDataConnect()', () => { + dataConnect = getDataConnect(app, { + location: 'a-location', + connector: 'a-connector', + service: 'service' + }); + }); + it('dataConnect.getSettings()', () => { + expect(dataConnect.getSettings().location).toBe('a-location'); + }); + }); }); From dcfb3da2e65b25d12e1d53efb257440c9f026072 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:08:10 -0500 Subject: [PATCH 119/295] Update dev script dependency @changesets/types to v6 (#8806) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- repo-scripts/changelog-generator/package.json | 2 +- yarn.lock | 39 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index f03669596bc..42d3eb2a8df 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -17,7 +17,7 @@ "test": "tsc -p . --noEmit" }, "dependencies": { - "@changesets/types": "3.3.0", + "@changesets/types": "6.1.0", "@changesets/get-github-info": "0.6.0", "@types/node": "18.19.75" }, diff --git a/yarn.lock b/yarn.lock index 5a27a2b310e..28171de3f6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1211,10 +1211,10 @@ "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" -"@changesets/types@3.3.0": - version "3.3.0" - resolved "https://registry.npmjs.org/@changesets/types/-/types-3.3.0.tgz#04cd8184b2d2da760667bd89bf9b930938dbd96e" - integrity sha512-rJamRo+OD/MQekImfIk07JZwYSB18iU6fYL8xOg0gfAiTh1a1+OlR1fPIxm55I7RsWw812is2YcPPwXdIewrhA== +"@changesets/types@6.1.0": + version "6.1.0" + resolved "https://registry.npmjs.org/@changesets/types/-/types-6.1.0.tgz#12a4c8490827d26bc6fbf97a151499be2fb6d2f5" + integrity sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA== "@changesets/types@^4.0.1": version "4.1.0" @@ -15459,7 +15459,7 @@ string-argv@~0.3.1: resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15477,6 +15477,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -15540,7 +15549,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15561,6 +15570,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -17203,7 +17219,7 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17237,6 +17253,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 117279e2759cde3e1ac028794fabf948d304d795 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 08:31:02 -0500 Subject: [PATCH 120/295] Bump cross-spawn from 7.0.3 to 7.0.6 in /e2e (#8645) Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- e2e/yarn.lock | 335 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 234 insertions(+), 101 deletions(-) diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 53db962e2f9..92db1a5db00 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -10,7 +10,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": version "7.26.2" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== @@ -28,12 +28,39 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/core@7.26.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": +"@babel/compat-data@^7.26.5", "@babel/compat-data@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" + integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== + +"@babel/core@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz#7742f11c75acea6b08a8e24c5c0c8c89e89bf53e" + integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.8" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.7" + "@babel/parser" "^7.26.8" + "@babel/template" "^7.26.8" + "@babel/traverse" "^7.26.8" + "@babel/types" "^7.26.8" + "@types/gensync" "^1.0.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -65,6 +92,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.26.8", "@babel/generator@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz#75a9482ad3d0cc7188a537aa4910bc59db67cbca" + integrity sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg== + dependencies: + "@babel/parser" "^7.26.9" + "@babel/types" "^7.26.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/generator@^7.7.2": version "7.26.3" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" @@ -83,14 +121,6 @@ dependencies: "@babel/types" "^7.25.9" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz#f41752fe772a578e67286e6779a68a5a92de1ee9" - integrity sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" @@ -102,6 +132,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" + integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== + dependencies: + "@babel/compat-data" "^7.26.5" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" @@ -135,6 +176,17 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" +"@babel/helper-define-polyfill-provider@^0.6.3": + version "0.6.3" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== + dependencies: + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + "@babel/helper-member-expression-to-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" @@ -172,6 +224,11 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== +"@babel/helper-plugin-utils@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" + integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== + "@babel/helper-remap-async-to-generator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" @@ -238,6 +295,14 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" +"@babel/helpers@^7.26.7": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz#28f3fb45252fc88ef2dc547c8a911c255fc9fef6" + integrity sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA== + dependencies: + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.9" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" @@ -252,6 +317,13 @@ dependencies: "@babel/types" "^7.26.0" +"@babel/parser@^7.26.8", "@babel/parser@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz#d9e78bee6dc80f9efd8f2349dcfbbcdace280fd5" + integrity sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A== + dependencies: + "@babel/types" "^7.26.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" @@ -437,14 +509,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" - integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== +"@babel/plugin-transform-async-generator-functions@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz#5e3991135e3b9c6eaaf5eff56d1ae5a11df45ff8" + integrity sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/traverse" "^7.26.8" "@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" @@ -455,12 +527,12 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" - integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== +"@babel/plugin-transform-block-scoped-functions@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" + integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-block-scoping@^7.25.9": version "7.25.9" @@ -542,12 +614,11 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz#ece47b70d236c1d99c263a1e22b62dc20a4c8b0f" - integrity sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA== +"@babel/plugin-transform-exponentiation-operator@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-export-namespace-from@^7.25.9": @@ -619,6 +690,14 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-simple-access" "^7.25.9" +"@babel/plugin-transform-modules-commonjs@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== + dependencies: + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-modules-systemjs@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" @@ -652,12 +731,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" - integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== +"@babel/plugin-transform-nullish-coalescing-operator@^7.26.6": + version "7.26.6" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" + integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-numeric-separator@^7.25.9": version "7.25.9" @@ -774,19 +853,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" - integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== +"@babel/plugin-transform-template-literals@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz#966b15d153a991172a540a69ad5e1845ced990b5" + integrity sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-transform-typeof-symbol@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" - integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== +"@babel/plugin-transform-typeof-symbol@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz#d0e33acd9223744c1e857dbd6fa17bd0a3786937" + integrity sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typescript@^7.25.9": version "7.26.3" @@ -830,14 +909,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" - integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== +"@babel/preset-env@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz#7af0090829b606d2046db99679004731e1dc364d" + integrity sha512-um7Sy+2THd697S4zJEfv/U5MHGJzkN2xhtsR3T/SWRbVSic62nbISh51VVfU9JiO/L/Z97QczHTaFVkOU8IzNg== dependencies: - "@babel/compat-data" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/compat-data" "^7.26.8" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-validator-option" "^7.25.9" "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" @@ -849,9 +928,9 @@ "@babel/plugin-syntax-import-attributes" "^7.26.0" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.26.8" "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.26.5" "@babel/plugin-transform-block-scoping" "^7.25.9" "@babel/plugin-transform-class-properties" "^7.25.9" "@babel/plugin-transform-class-static-block" "^7.26.0" @@ -862,7 +941,7 @@ "@babel/plugin-transform-duplicate-keys" "^7.25.9" "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.26.3" "@babel/plugin-transform-export-namespace-from" "^7.25.9" "@babel/plugin-transform-for-of" "^7.25.9" "@babel/plugin-transform-function-name" "^7.25.9" @@ -871,12 +950,12 @@ "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" "@babel/plugin-transform-member-expression-literals" "^7.25.9" "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.26.3" "@babel/plugin-transform-modules-systemjs" "^7.25.9" "@babel/plugin-transform-modules-umd" "^7.25.9" "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.26.6" "@babel/plugin-transform-numeric-separator" "^7.25.9" "@babel/plugin-transform-object-rest-spread" "^7.25.9" "@babel/plugin-transform-object-super" "^7.25.9" @@ -892,17 +971,17 @@ "@babel/plugin-transform-shorthand-properties" "^7.25.9" "@babel/plugin-transform-spread" "^7.25.9" "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.25.9" - "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.26.8" + "@babel/plugin-transform-typeof-symbol" "^7.26.7" "@babel/plugin-transform-unicode-escapes" "^7.25.9" "@babel/plugin-transform-unicode-property-regex" "^7.25.9" "@babel/plugin-transform-unicode-regex" "^7.25.9" "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" "@babel/preset-modules" "0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-corejs3 "^0.11.0" babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.38.1" + core-js-compat "^3.40.0" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -941,6 +1020,15 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" +"@babel/template@^7.26.8", "@babel/template@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz#4577ad3ddf43d194528cff4e1fa6b232fa609bb2" + integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/parser" "^7.26.9" + "@babel/types" "^7.26.9" + "@babel/traverse@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" @@ -954,6 +1042,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.26.8": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" + integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.9" + "@babel/parser" "^7.26.9" + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.9" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" @@ -970,6 +1071,14 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.26.8", "@babel/types@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz#08b43dec79ee8e682c2ac631c010bdcac54a21ce" + integrity sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1903,6 +2012,11 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/gensync@^1.0.0": + version "1.0.4" + resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz#7122d8f0cd3bf437f9725cc95b180197190cf50b" + integrity sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA== + "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -2364,13 +2478,13 @@ babel-jest@29.7.0, babel-jest@^29.7.0: graceful-fs "^4.2.9" slash "^3.0.0" -babel-loader@8.3.0: - version "8.3.0" - resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" - integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== +babel-loader@8.4.1: + version "8.4.1" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" + integrity sha512-nXzRChX+Z1GoE6yWavBQg6jDslyFF3SDjl2paADuoQtQW10JqShJt62R6eJQ5m/pjJFDT8xgKIWSP85OY8eXeA== dependencies: find-cache-dir "^3.3.1" - loader-utils "^2.0.0" + loader-utils "^2.0.4" make-dir "^3.1.0" schema-utils "^2.6.5" @@ -2404,13 +2518,13 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.2" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.6: - version "0.10.6" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" - integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== +babel-plugin-polyfill-corejs3@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz#4e4e182f1bb37c7ba62e2af81d8dd09df31344f6" + integrity sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" - core-js-compat "^3.38.0" + "@babel/helper-define-polyfill-provider" "^0.6.3" + core-js-compat "^3.40.0" babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.2" @@ -2509,7 +2623,7 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: +browserslist@^4.14.5, browserslist@^4.24.0: version "4.24.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -2519,6 +2633,16 @@ browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: node-releases "^2.0.18" update-browserslist-db "^1.1.1" +browserslist@^4.24.3: + version "4.24.4" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== + dependencies: + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" + bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -2579,6 +2703,11 @@ caniuse-lite@^1.0.30001669: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== +caniuse-lite@^1.0.30001688: + version "1.0.30001700" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz#26cd429cf09b4fd4e745daf4916039c794d720f6" + integrity sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ== + chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -2746,12 +2875,12 @@ cookie@0.7.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -core-js-compat@^3.38.0, core-js-compat@^3.38.1: - version "3.38.1" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz#2bc7a298746ca5a7bcb9c164bcb120f2ebc09a09" - integrity sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw== +core-js-compat@^3.40.0: + version "3.40.0" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" + integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== dependencies: - browserslist "^4.23.3" + browserslist "^4.24.3" core-util-is@~1.0.0: version "1.0.3" @@ -2777,9 +2906,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -2931,6 +3060,11 @@ electron-to-chromium@^1.5.41: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== +electron-to-chromium@^1.5.73: + version "1.5.104" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.104.tgz#e92a1ec54f279d8fc60eb7e8cf6add9631631f38" + integrity sha512-Us9M2L4cO/zMBqVkJtnj353nQhMju9slHm62NprKTmdF3HH8wYOtNvDFq/JB2+ZRoGLzdvYDiATlMHs98XBM1g== + emittery@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" @@ -3105,10 +3239,10 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -express@^4.19.2: - version "4.21.1" - resolved "https://registry.npmjs.org/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" - integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== +express@^4.21.2: + version "4.21.2" + resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== dependencies: accepts "~1.3.8" array-flatten "1.1.1" @@ -3129,7 +3263,7 @@ express@^4.19.2: methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.10" + path-to-regexp "0.1.12" proxy-addr "~2.0.7" qs "6.13.0" range-parser "~1.2.1" @@ -3414,11 +3548,6 @@ html-encoding-sniffer@^3.0.0: dependencies: whatwg-encoding "^2.0.0" -html-entities@^2.4.0: - version "2.5.2" - resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" - integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -3464,7 +3593,7 @@ http-proxy-agent@^5.0.0: agent-base "6" debug "4" -http-proxy-middleware@^2.0.3: +http-proxy-middleware@^2.0.7: version "2.0.7" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== @@ -4211,7 +4340,7 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^2.0.0: +loader-utils@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== @@ -4400,6 +4529,11 @@ node-releases@^2.0.18: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -4540,10 +4674,10 @@ path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@0.1.10: - version "0.1.10" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" - integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" @@ -5447,10 +5581,10 @@ webpack-dev-middleware@^7.4.2: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz#8f44147402b4d8ab99bfeb9b6880daa1411064e5" - integrity sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ== +webpack-dev-server@5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz#68043886edaa3fd875ad20e01589990a79612f9c" + integrity sha512-90SqqYXA2SK36KcT6o1bvwvZfJFcmoamqeJY7+boioffX9g9C0wjjJRGUrQIuh43pb0ttX7+ssavmj/WN2RHtA== dependencies: "@types/bonjour" "^3.5.13" "@types/connect-history-api-fallback" "^1.5.4" @@ -5465,10 +5599,9 @@ webpack-dev-server@5.1.0: colorette "^2.0.10" compression "^1.7.4" connect-history-api-fallback "^2.0.0" - express "^4.19.2" + express "^4.21.2" graceful-fs "^4.2.6" - html-entities "^2.4.0" - http-proxy-middleware "^2.0.3" + http-proxy-middleware "^2.0.7" ipaddr.js "^2.1.0" launch-editor "^2.6.1" open "^10.0.3" From 2d74e5bfb75b5ecf87a9b1b496c9358446c0cb81 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Wed, 26 Feb 2025 10:25:31 -0500 Subject: [PATCH 121/295] Revert "Bump cross-spawn from 7.0.3 to 7.0.6 in /e2e (#8645)" (#8811) This reverts commit 117279e2759cde3e1ac028794fabf948d304d795. --- e2e/yarn.lock | 335 +++++++++++++++----------------------------------- 1 file changed, 101 insertions(+), 234 deletions(-) diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 92db1a5db00..53db962e2f9 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -10,7 +10,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": version "7.26.2" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== @@ -28,39 +28,12 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9": +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/compat-data@^7.26.5", "@babel/compat-data@^7.26.8": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" - integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== - -"@babel/core@7.26.8": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz#7742f11c75acea6b08a8e24c5c0c8c89e89bf53e" - integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.8" - "@babel/helper-compilation-targets" "^7.26.5" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.7" - "@babel/parser" "^7.26.8" - "@babel/template" "^7.26.8" - "@babel/traverse" "^7.26.8" - "@babel/types" "^7.26.8" - "@types/gensync" "^1.0.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": +"@babel/core@7.26.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -92,17 +65,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" -"@babel/generator@^7.26.8", "@babel/generator@^7.26.9": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz#75a9482ad3d0cc7188a537aa4910bc59db67cbca" - integrity sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg== - dependencies: - "@babel/parser" "^7.26.9" - "@babel/types" "^7.26.9" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - "@babel/generator@^7.7.2": version "7.26.3" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" @@ -121,6 +83,14 @@ dependencies: "@babel/types" "^7.25.9" +"@babel/helper-builder-binary-assignment-operator-visitor@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz#f41752fe772a578e67286e6779a68a5a92de1ee9" + integrity sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" @@ -132,17 +102,6 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-compilation-targets@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" - integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== - dependencies: - "@babel/compat-data" "^7.26.5" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - "@babel/helper-create-class-features-plugin@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" @@ -176,17 +135,6 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" -"@babel/helper-define-polyfill-provider@^0.6.3": - version "0.6.3" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" - integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - "@babel/helper-member-expression-to-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" @@ -224,11 +172,6 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== -"@babel/helper-plugin-utils@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" - integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== - "@babel/helper-remap-async-to-generator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" @@ -295,14 +238,6 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" -"@babel/helpers@^7.26.7": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz#28f3fb45252fc88ef2dc547c8a911c255fc9fef6" - integrity sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA== - dependencies: - "@babel/template" "^7.26.9" - "@babel/types" "^7.26.9" - "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" @@ -317,13 +252,6 @@ dependencies: "@babel/types" "^7.26.0" -"@babel/parser@^7.26.8", "@babel/parser@^7.26.9": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz#d9e78bee6dc80f9efd8f2349dcfbbcdace280fd5" - integrity sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A== - dependencies: - "@babel/types" "^7.26.9" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" @@ -509,14 +437,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.26.8": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz#5e3991135e3b9c6eaaf5eff56d1ae5a11df45ff8" - integrity sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg== +"@babel/plugin-transform-async-generator-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" + integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== dependencies: - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.26.8" + "@babel/traverse" "^7.25.9" "@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" @@ -527,12 +455,12 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" - integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== +"@babel/plugin-transform-block-scoped-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" + integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== dependencies: - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-block-scoping@^7.25.9": version "7.25.9" @@ -614,11 +542,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.26.3": - version "7.26.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" - integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== +"@babel/plugin-transform-exponentiation-operator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz#ece47b70d236c1d99c263a1e22b62dc20a4c8b0f" + integrity sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA== dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-export-namespace-from@^7.25.9": @@ -690,14 +619,6 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-simple-access" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@^7.26.3": - version "7.26.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" - integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== - dependencies: - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-transform-modules-systemjs@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" @@ -731,12 +652,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.26.6": - version "7.26.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" - integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== +"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" + integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== dependencies: - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-numeric-separator@^7.25.9": version "7.25.9" @@ -853,19 +774,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.26.8": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz#966b15d153a991172a540a69ad5e1845ced990b5" - integrity sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q== +"@babel/plugin-transform-template-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" + integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== dependencies: - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.26.7": - version "7.26.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz#d0e33acd9223744c1e857dbd6fa17bd0a3786937" - integrity sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw== +"@babel/plugin-transform-typeof-symbol@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" + integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== dependencies: - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-typescript@^7.25.9": version "7.26.3" @@ -909,14 +830,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.26.8": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz#7af0090829b606d2046db99679004731e1dc364d" - integrity sha512-um7Sy+2THd697S4zJEfv/U5MHGJzkN2xhtsR3T/SWRbVSic62nbISh51VVfU9JiO/L/Z97QczHTaFVkOU8IzNg== +"@babel/preset-env@7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" + integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== dependencies: - "@babel/compat-data" "^7.26.8" - "@babel/helper-compilation-targets" "^7.26.5" - "@babel/helper-plugin-utils" "^7.26.5" + "@babel/compat-data" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-validator-option" "^7.25.9" "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" @@ -928,9 +849,9 @@ "@babel/plugin-syntax-import-attributes" "^7.26.0" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.26.8" + "@babel/plugin-transform-async-generator-functions" "^7.25.9" "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.26.5" + "@babel/plugin-transform-block-scoped-functions" "^7.25.9" "@babel/plugin-transform-block-scoping" "^7.25.9" "@babel/plugin-transform-class-properties" "^7.25.9" "@babel/plugin-transform-class-static-block" "^7.26.0" @@ -941,7 +862,7 @@ "@babel/plugin-transform-duplicate-keys" "^7.25.9" "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.26.3" + "@babel/plugin-transform-exponentiation-operator" "^7.25.9" "@babel/plugin-transform-export-namespace-from" "^7.25.9" "@babel/plugin-transform-for-of" "^7.25.9" "@babel/plugin-transform-function-name" "^7.25.9" @@ -950,12 +871,12 @@ "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" "@babel/plugin-transform-member-expression-literals" "^7.25.9" "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.26.3" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" "@babel/plugin-transform-modules-systemjs" "^7.25.9" "@babel/plugin-transform-modules-umd" "^7.25.9" "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.26.6" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" "@babel/plugin-transform-numeric-separator" "^7.25.9" "@babel/plugin-transform-object-rest-spread" "^7.25.9" "@babel/plugin-transform-object-super" "^7.25.9" @@ -971,17 +892,17 @@ "@babel/plugin-transform-shorthand-properties" "^7.25.9" "@babel/plugin-transform-spread" "^7.25.9" "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.26.8" - "@babel/plugin-transform-typeof-symbol" "^7.26.7" + "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.25.9" "@babel/plugin-transform-unicode-escapes" "^7.25.9" "@babel/plugin-transform-unicode-property-regex" "^7.25.9" "@babel/plugin-transform-unicode-regex" "^7.25.9" "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" "@babel/preset-modules" "0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.11.0" + babel-plugin-polyfill-corejs3 "^0.10.6" babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.40.0" + core-js-compat "^3.38.1" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -1020,15 +941,6 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/template@^7.26.8", "@babel/template@^7.26.9": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz#4577ad3ddf43d194528cff4e1fa6b232fa609bb2" - integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/parser" "^7.26.9" - "@babel/types" "^7.26.9" - "@babel/traverse@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" @@ -1042,19 +954,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.26.8": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" - integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.9" - "@babel/parser" "^7.26.9" - "@babel/template" "^7.26.9" - "@babel/types" "^7.26.9" - debug "^4.3.1" - globals "^11.1.0" - "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" @@ -1071,14 +970,6 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@babel/types@^7.26.8", "@babel/types@^7.26.9": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz#08b43dec79ee8e682c2ac631c010bdcac54a21ce" - integrity sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -2012,11 +1903,6 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/gensync@^1.0.0": - version "1.0.4" - resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz#7122d8f0cd3bf437f9725cc95b180197190cf50b" - integrity sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA== - "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -2478,13 +2364,13 @@ babel-jest@29.7.0, babel-jest@^29.7.0: graceful-fs "^4.2.9" slash "^3.0.0" -babel-loader@8.4.1: - version "8.4.1" - resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" - integrity sha512-nXzRChX+Z1GoE6yWavBQg6jDslyFF3SDjl2paADuoQtQW10JqShJt62R6eJQ5m/pjJFDT8xgKIWSP85OY8eXeA== +babel-loader@8.3.0: + version "8.3.0" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" + integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== dependencies: find-cache-dir "^3.3.1" - loader-utils "^2.0.4" + loader-utils "^2.0.0" make-dir "^3.1.0" schema-utils "^2.6.5" @@ -2518,13 +2404,13 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.2" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.11.0: - version "0.11.1" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz#4e4e182f1bb37c7ba62e2af81d8dd09df31344f6" - integrity sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ== +babel-plugin-polyfill-corejs3@^0.10.6: + version "0.10.6" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" + integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.3" - core-js-compat "^3.40.0" + "@babel/helper-define-polyfill-provider" "^0.6.2" + core-js-compat "^3.38.0" babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.2" @@ -2623,7 +2509,7 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.14.5, browserslist@^4.24.0: +browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: version "4.24.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -2633,16 +2519,6 @@ browserslist@^4.14.5, browserslist@^4.24.0: node-releases "^2.0.18" update-browserslist-db "^1.1.1" -browserslist@^4.24.3: - version "4.24.4" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" - integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== - dependencies: - caniuse-lite "^1.0.30001688" - electron-to-chromium "^1.5.73" - node-releases "^2.0.19" - update-browserslist-db "^1.1.1" - bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -2703,11 +2579,6 @@ caniuse-lite@^1.0.30001669: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== -caniuse-lite@^1.0.30001688: - version "1.0.30001700" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz#26cd429cf09b4fd4e745daf4916039c794d720f6" - integrity sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ== - chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -2875,12 +2746,12 @@ cookie@0.7.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -core-js-compat@^3.40.0: - version "3.40.0" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" - integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== +core-js-compat@^3.38.0, core-js-compat@^3.38.1: + version "3.38.1" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz#2bc7a298746ca5a7bcb9c164bcb120f2ebc09a09" + integrity sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw== dependencies: - browserslist "^4.24.3" + browserslist "^4.23.3" core-util-is@~1.0.0: version "1.0.3" @@ -2906,9 +2777,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.3: - version "7.0.6" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -3060,11 +2931,6 @@ electron-to-chromium@^1.5.41: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== -electron-to-chromium@^1.5.73: - version "1.5.104" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.104.tgz#e92a1ec54f279d8fc60eb7e8cf6add9631631f38" - integrity sha512-Us9M2L4cO/zMBqVkJtnj353nQhMju9slHm62NprKTmdF3HH8wYOtNvDFq/JB2+ZRoGLzdvYDiATlMHs98XBM1g== - emittery@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" @@ -3239,10 +3105,10 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -express@^4.21.2: - version "4.21.2" - resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" - integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== +express@^4.19.2: + version "4.21.1" + resolved "https://registry.npmjs.org/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" + integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" @@ -3263,7 +3129,7 @@ express@^4.21.2: methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.12" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" qs "6.13.0" range-parser "~1.2.1" @@ -3548,6 +3414,11 @@ html-encoding-sniffer@^3.0.0: dependencies: whatwg-encoding "^2.0.0" +html-entities@^2.4.0: + version "2.5.2" + resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" + integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -3593,7 +3464,7 @@ http-proxy-agent@^5.0.0: agent-base "6" debug "4" -http-proxy-middleware@^2.0.7: +http-proxy-middleware@^2.0.3: version "2.0.7" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== @@ -4340,7 +4211,7 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^2.0.4: +loader-utils@^2.0.0: version "2.0.4" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== @@ -4529,11 +4400,6 @@ node-releases@^2.0.18: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== -node-releases@^2.0.19: - version "2.0.19" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" - integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -4674,10 +4540,10 @@ path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@0.1.12: - version "0.1.12" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" - integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" @@ -5581,10 +5447,10 @@ webpack-dev-middleware@^7.4.2: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz#68043886edaa3fd875ad20e01589990a79612f9c" - integrity sha512-90SqqYXA2SK36KcT6o1bvwvZfJFcmoamqeJY7+boioffX9g9C0wjjJRGUrQIuh43pb0ttX7+ssavmj/WN2RHtA== +webpack-dev-server@5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz#8f44147402b4d8ab99bfeb9b6880daa1411064e5" + integrity sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ== dependencies: "@types/bonjour" "^3.5.13" "@types/connect-history-api-fallback" "^1.5.4" @@ -5599,9 +5465,10 @@ webpack-dev-server@5.2.0: colorette "^2.0.10" compression "^1.7.4" connect-history-api-fallback "^2.0.0" - express "^4.21.2" + express "^4.19.2" graceful-fs "^4.2.6" - http-proxy-middleware "^2.0.7" + html-entities "^2.4.0" + http-proxy-middleware "^2.0.3" ipaddr.js "^2.1.0" launch-editor "^2.6.1" open "^10.0.3" From 777f465ff37495ff933a29583769ce8a6a2b59b5 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 26 Feb 2025 10:51:42 -0500 Subject: [PATCH 122/295] App Hosting JS SDK autoinit (#8483) Adds a `postinstall` step to `@firebase/util` which hardcodes autoinit defaults into `@firebase/util/dist/postinstall.(m)js` for both CJS and ESM variants [go/firestack-autoinit](http://goto.google.com/firestack-autoinit). Hardcoding is important since environment variable substitution doesn't dive into a developer's `node_modules` folder. This gives us a framework agnostic way to inject configuration and is a more robust solution than the _experimental_ autoinit methods provided by Web Frameworks [go/firebase-api-client-autoinit](https://goto.google.com/firebase-api-client-autoinit). Once this lands, we'll backport to Hosting and Functions and aim to deprecate the other autoinit methods. --- .changeset/tame-parrots-tie.md | 6 ++ packages/util/package.json | 7 +- packages/util/postinstall.js | 153 +++++++++++++++++++++++++++++++ packages/util/rollup.config.js | 49 ++++++++-- packages/util/src/defaults.ts | 2 + packages/util/src/postinstall.ts | 23 +++++ yarn.lock | 10 +- 7 files changed, 239 insertions(+), 11 deletions(-) create mode 100644 .changeset/tame-parrots-tie.md create mode 100644 packages/util/postinstall.js create mode 100644 packages/util/src/postinstall.ts diff --git a/.changeset/tame-parrots-tie.md b/.changeset/tame-parrots-tie.md new file mode 100644 index 00000000000..a6b60f83952 --- /dev/null +++ b/.changeset/tame-parrots-tie.md @@ -0,0 +1,6 @@ +--- +'@firebase/util': minor +'firebase': minor +--- + +Add support for the `FIREBASE_WEBAPP_CONFIG` environment variable at install time. diff --git a/packages/util/package.json b/packages/util/package.json index c7b182a84ec..c2852958d80 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -22,7 +22,8 @@ "./package.json": "./package.json" }, "files": [ - "dist" + "dist", + "postinstall.js" ], "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", @@ -38,13 +39,15 @@ "test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report": "api-extractor run --local --verbose", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/util-public.d.ts" + "typings:public": "node ../../scripts/build/use_typings.js ./dist/util-public.d.ts", + "postinstall": "node ./postinstall.js" }, "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" }, "devDependencies": { + "@rollup/plugin-replace": "6.0.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/postinstall.js b/packages/util/postinstall.js new file mode 100644 index 00000000000..6987d1316da --- /dev/null +++ b/packages/util/postinstall.js @@ -0,0 +1,153 @@ +/** + * @license + * Copyright 2025 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. + */ + +const { writeFile, readFile } = require('node:fs/promises'); +const { pathToFileURL } = require('node:url'); +const { isAbsolute, join } = require('node:path'); + +const ENV_VARIABLE = 'FIREBASE_WEBAPP_CONFIG'; + +async function getPartialConfig() { + const envVariable = process.env[ENV_VARIABLE]?.trim(); + + if (!envVariable) { + return undefined; + } + + // Like FIREBASE_CONFIG (admin autoinit) FIREBASE_WEBAPP_CONFIG can be + // either a JSON representation of FirebaseOptions or the path to a filename + if (envVariable.startsWith('{"')) { + try { + return JSON.parse(envVariable); + } catch (e) { + console.warn( + `JSON payload in \$${ENV_VARIABLE} could not be parsed, ignoring.\n`, + e + ); + return undefined; + } + } + + const fileURL = pathToFileURL( + isAbsolute(envVariable) ? envVariable : join(process.cwd(), envVariable) + ); + + try { + const fileContents = await readFile(fileURL, 'utf-8'); + return JSON.parse(fileContents); + } catch (e) { + console.warn( + `Contents of "${envVariable}" could not be parsed, ignoring \$${ENV_VARIABLE}.\n`, + e + ); + return undefined; + } +} + +async function getFinalConfig(partialConfig) { + if (!partialConfig) { + return undefined; + } + // In Firebase App Hosting the config provided to the environment variable is up-to-date and + // "complete" we should not reach out to the webConfig endpoint to freshen it + if (process.env.X_GOOGLE_TARGET_PLATFORM === 'fah') { + return partialConfig; + } + const projectId = partialConfig.projectId || '-'; + // If the projectId starts with demo- this is an demo project from the firebase emulators + // treat the config as whole + if (projectId.startsWith('demo-')) { + return partialConfig; + } + const appId = partialConfig.appId; + const apiKey = partialConfig.apiKey; + if (!appId || !apiKey) { + console.warn( + `Unable to fetch Firebase config, appId and apiKey are required, ignoring \$${ENV_VARIABLE}.` + ); + return undefined; + } + + const url = `https://firebase.googleapis.com/v1alpha/projects/${projectId}/apps/${appId}/webConfig`; + + try { + const response = await fetch(url, { + headers: { 'x-goog-api-key': apiKey } + }); + if (!response.ok) { + console.warn( + `Unable to fetch Firebase config, ignoring \$${ENV_VARIABLE}.` + ); + console.warn( + `${url} returned ${response.statusText} (${response.status})` + ); + try { + console.warn((await response.json()).error.message); + } catch (e) {} + return undefined; + } + const json = await response.json(); + return { ...json, apiKey }; + } catch (e) { + console.warn( + `Unable to fetch Firebase config, ignoring \$${ENV_VARIABLE}.\n`, + e + ); + return undefined; + } +} + +function handleUnexpectedError(e) { + console.warn( + `Unexpected error encountered in @firebase/util postinstall script, ignoring \$${ENV_VARIABLE}.` + ); + console.warn(e); + process.exit(0); +} + +getPartialConfig() + .catch(handleUnexpectedError) + .then(getFinalConfig) + .catch(handleUnexpectedError) + .then(async finalConfig => { + const defaults = finalConfig && { + config: finalConfig, + emulatorHosts: { + firestore: process.env.FIRESTORE_EMULATOR_HOST, + database: process.env.FIREBASE_DATABASE_EMULATOR_HOST, + storage: process.env.FIREBASE_STORAGE_EMULATOR_HOST, + auth: process.env.FIREBASE_AUTH_EMULATOR_HOST + } + }; + + await Promise.all([ + writeFile( + join(__dirname, 'dist', 'postinstall.js'), + `'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getDefaultsFromPostinstall = () => (${JSON.stringify(defaults)});` + ), + writeFile( + join(__dirname, 'dist', 'postinstall.mjs'), + `const getDefaultsFromPostinstall = () => (${JSON.stringify(defaults)}); +export { getDefaultsFromPostinstall };` + ) + ]); + + process.exit(0); + }) + .catch(handleUnexpectedError); diff --git a/packages/util/rollup.config.js b/packages/util/rollup.config.js index d428092d8ee..57750f3d518 100644 --- a/packages/util/rollup.config.js +++ b/packages/util/rollup.config.js @@ -16,16 +16,26 @@ */ import typescriptPlugin from 'rollup-plugin-typescript2'; +import replacePlugin from '@rollup/plugin-replace'; import typescript from 'typescript'; import pkg from './package.json'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; -const deps = Object.keys( - Object.assign({}, pkg.peerDependencies, pkg.dependencies) -); +const deps = [ + ...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies)), + './postinstall' +]; const buildPlugins = [typescriptPlugin({ typescript })]; +function replaceSrcPostinstallWith(path) { + return replacePlugin({ + './src/postinstall': `'${path}'`, + delimiters: ["'", "'"], + preventAssignment: true + }); +} + const browserBuilds = [ { input: 'index.ts', @@ -34,7 +44,7 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: buildPlugins, + plugins: [...buildPlugins, replaceSrcPostinstallWith('./postinstall.mjs')], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -44,7 +54,7 @@ const browserBuilds = [ format: 'cjs', sourcemap: true }, - plugins: buildPlugins, + plugins: [...buildPlugins, replaceSrcPostinstallWith('./postinstall.js')], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -57,7 +67,7 @@ const nodeBuilds = [ format: 'cjs', sourcemap: true }, - plugins: buildPlugins, + plugins: [...buildPlugins, replaceSrcPostinstallWith('./postinstall.js')], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -67,9 +77,32 @@ const nodeBuilds = [ format: 'es', sourcemap: true }, - plugins: [...buildPlugins, emitModulePackageFile()], + plugins: [ + ...buildPlugins, + emitModulePackageFile(), + replaceSrcPostinstallWith('../postinstall.mjs') + ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; -export default [...browserBuilds, ...nodeBuilds]; +const autoinitBuild = [ + { + input: './src/postinstall.ts', + output: { + file: './dist/postinstall.js', + format: 'cjs' + }, + plugins: buildPlugins + }, + { + input: './src/postinstall.ts', + output: { + file: './dist/postinstall.mjs', + format: 'es' + }, + plugins: buildPlugins + } +]; + +export default [...browserBuilds, ...nodeBuilds, ...autoinitBuild]; diff --git a/packages/util/src/defaults.ts b/packages/util/src/defaults.ts index 2c972604663..d7882e152dd 100644 --- a/packages/util/src/defaults.ts +++ b/packages/util/src/defaults.ts @@ -17,6 +17,7 @@ import { base64Decode } from './crypt'; import { getGlobal } from './global'; +import { getDefaultsFromPostinstall } from './postinstall'; /** * Keys for experimental properties on the `FirebaseDefaults` object. @@ -100,6 +101,7 @@ const getDefaultsFromCookie = (): FirebaseDefaults | undefined => { export const getDefaults = (): FirebaseDefaults | undefined => { try { return ( + getDefaultsFromPostinstall() || getDefaultsFromGlobal() || getDefaultsFromEnvVariable() || getDefaultsFromCookie() diff --git a/packages/util/src/postinstall.ts b/packages/util/src/postinstall.ts new file mode 100644 index 00000000000..f16f60d5b49 --- /dev/null +++ b/packages/util/src/postinstall.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2025 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 type { FirebaseDefaults } from './defaults'; + +// This value is retrieved and hardcoded by the NPM postinstall script +export const getDefaultsFromPostinstall: () => + | FirebaseDefaults + | undefined = () => undefined; diff --git a/yarn.lock b/yarn.lock index 28171de3f6d..bffdd9c7a25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2633,6 +2633,14 @@ is-module "^1.0.0" resolve "^1.22.1" +"@rollup/plugin-replace@6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.2.tgz#2f565d312d681e4570ff376c55c5c08eb6f1908d" + integrity sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ== + dependencies: + "@rollup/pluginutils" "^5.0.1" + magic-string "^0.30.3" + "@rollup/plugin-strip@2.1.0": version "2.1.0" resolved "https://registry.npmjs.org/@rollup/plugin-strip/-/plugin-strip-2.1.0.tgz#04c2d2ccfb2c6b192bb70447fbf26e336379a333" @@ -11233,7 +11241,7 @@ magic-string@^0.25.2, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.8" -magic-string@^0.30.2, magic-string@~0.30.0: +magic-string@^0.30.2, magic-string@^0.30.3, magic-string@~0.30.0: version "0.30.17" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453" integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA== From 113c965a34d9d7219d236f1b2cb62029e0f80fda Mon Sep 17 00:00:00 2001 From: Rich Hodgkins Date: Thu, 27 Feb 2025 18:12:07 +0000 Subject: [PATCH 123/295] Added non-null properties to database.ThenableReference (#8800) --- .changeset/silver-jeans-sell.md | 7 +++++++ common/api-review/database.api.md | 4 ++++ docs-devsite/database.thenablereference.md | 22 +++++++++++++++++++++ packages/database-types/index.d.ts | 5 ++++- packages/database/src/api/Reference.ts | 5 ++++- packages/database/src/api/Reference_impl.ts | 5 ++++- packages/firebase/compat/index.d.ts | 5 ++++- 7 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .changeset/silver-jeans-sell.md diff --git a/.changeset/silver-jeans-sell.md b/.changeset/silver-jeans-sell.md new file mode 100644 index 00000000000..bf479c302ec --- /dev/null +++ b/.changeset/silver-jeans-sell.md @@ -0,0 +1,7 @@ +--- +'@firebase/database-compat': patch +'@firebase/database-types': patch +'@firebase/database': patch +--- + +Added non-null parent properties to ThenableReference diff --git a/common/api-review/database.api.md b/common/api-review/database.api.md index 4a98aea3d4e..0b7b36869d6 100644 --- a/common/api-review/database.api.md +++ b/common/api-review/database.api.md @@ -228,6 +228,10 @@ export function startAt(value?: number | string | boolean | null, key?: string): // @public export interface ThenableReference extends DatabaseReference, Pick, 'then' | 'catch'> { + // (undocumented) + key: string; + // (undocumented) + parent: DatabaseReference; } // @public diff --git a/docs-devsite/database.thenablereference.md b/docs-devsite/database.thenablereference.md index 69ad3c6ed55..f66394d36f8 100644 --- a/docs-devsite/database.thenablereference.md +++ b/docs-devsite/database.thenablereference.md @@ -19,3 +19,25 @@ export declare interface ThenableReference extends DatabaseReference, PickExtends: [DatabaseReference](./database.databasereference.md#databasereference_interface), Pick<Promise<[DatabaseReference](./database.databasereference.md#databasereference_interface)>, 'then' \| 'catch'> +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [key](./database.thenablereference.md#thenablereferencekey) | string | | +| [parent](./database.thenablereference.md#thenablereferenceparent) | [DatabaseReference](./database.databasereference.md#databasereference_interface) | | + +## ThenableReference.key + +Signature: + +```typescript +key: string; +``` + +## ThenableReference.parent + +Signature: + +```typescript +parent: DatabaseReference; +``` diff --git a/packages/database-types/index.d.ts b/packages/database-types/index.d.ts index f304a4ed5b3..43557ebe1ac 100644 --- a/packages/database-types/index.d.ts +++ b/packages/database-types/index.d.ts @@ -164,7 +164,10 @@ export interface TransactionResult { export interface ThenableReference extends Reference, - Pick, 'then' | 'catch'> {} + Pick, 'then' | 'catch'> { + key: string; + parent: Reference; +} export function enableLogging( logger?: boolean | ((a: string) => any), diff --git a/packages/database/src/api/Reference.ts b/packages/database/src/api/Reference.ts index c2e97aa229e..6c3da5ac489 100644 --- a/packages/database/src/api/Reference.ts +++ b/packages/database/src/api/Reference.ts @@ -119,7 +119,10 @@ export interface DatabaseReference extends Query { */ export interface ThenableReference extends DatabaseReference, - Pick, 'then' | 'catch'> {} + Pick, 'then' | 'catch'> { + key: string; + parent: DatabaseReference; +} /** A callback that can invoked to remove a listener. */ export type Unsubscribe = () => void; diff --git a/packages/database/src/api/Reference_impl.ts b/packages/database/src/api/Reference_impl.ts index 2b606bb83ca..e3ccf3584bc 100644 --- a/packages/database/src/api/Reference_impl.ts +++ b/packages/database/src/api/Reference_impl.ts @@ -568,7 +568,10 @@ export function onDisconnect(ref: DatabaseReference): OnDisconnect { export interface ThenableReferenceImpl extends ReferenceImpl, - Pick, 'then' | 'catch'> {} + Pick, 'then' | 'catch'> { + key: string; + parent: ReferenceImpl; +} /** * Generates a new child location using a unique key and returns its diff --git a/packages/firebase/compat/index.d.ts b/packages/firebase/compat/index.d.ts index 92c7bd2c278..fc2bb09567d 100644 --- a/packages/firebase/compat/index.d.ts +++ b/packages/firebase/compat/index.d.ts @@ -7370,7 +7370,10 @@ declare namespace firebase.database { interface ThenableReference extends firebase.database.Reference, - Pick, 'then' | 'catch'> {} + Pick, 'then' | 'catch'> { + key: string; + parent: Reference; + } /** * Logs debugging information to the console. From 2eee61ae5f1e20c0b35328dc0cc197f568820523 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 27 Feb 2025 12:31:42 -0800 Subject: [PATCH 124/295] Version Packages (#8794) Co-authored-by: github-actions[bot] --- .changeset/chilled-tips-judge.md | 6 --- .changeset/flat-plums-hope.md | 6 --- .changeset/forty-bags-arrive.md | 8 ---- .changeset/lemon-candles-vanish.md | 8 ---- .changeset/seven-oranges-care.md | 5 -- .changeset/stale-llamas-hide.md | 5 -- .changeset/tame-parrots-tie.md | 6 --- .changeset/tough-kiwis-smile.md | 5 -- .changeset/violet-planets-impress.md | 6 --- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 10 ++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 9 ++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 10 ++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 10 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 8 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 12 +++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 10 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 48 +++++++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 8 ++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 8 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 13 +++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 8 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 18 +++++++ packages/vertexai/package.json | 8 ++-- repo-scripts/size-analysis/package.json | 4 +- 74 files changed, 493 insertions(+), 231 deletions(-) delete mode 100644 .changeset/chilled-tips-judge.md delete mode 100644 .changeset/flat-plums-hope.md delete mode 100644 .changeset/forty-bags-arrive.md delete mode 100644 .changeset/lemon-candles-vanish.md delete mode 100644 .changeset/seven-oranges-care.md delete mode 100644 .changeset/stale-llamas-hide.md delete mode 100644 .changeset/tame-parrots-tie.md delete mode 100644 .changeset/tough-kiwis-smile.md delete mode 100644 .changeset/violet-planets-impress.md diff --git a/.changeset/chilled-tips-judge.md b/.changeset/chilled-tips-judge.md deleted file mode 100644 index 15d58806a9e..00000000000 --- a/.changeset/chilled-tips-judge.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/vertexai': minor -'firebase': minor ---- - -Added support for modality-based token count. diff --git a/.changeset/flat-plums-hope.md b/.changeset/flat-plums-hope.md deleted file mode 100644 index ac71c7269aa..00000000000 --- a/.changeset/flat-plums-hope.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/remote-config': minor -'firebase': minor ---- - -Adds support for initial state hydration (from SSR contexts) diff --git a/.changeset/forty-bags-arrive.md b/.changeset/forty-bags-arrive.md deleted file mode 100644 index ee68fa5accc..00000000000 --- a/.changeset/forty-bags-arrive.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@firebase/database-compat': patch -'@firebase/database': patch -'firebase': patch ---- - -Fixed: invoking `connectDatabaseEmulator` multiple times with the same parameters will no longer -cause an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). \ No newline at end of file diff --git a/.changeset/lemon-candles-vanish.md b/.changeset/lemon-candles-vanish.md deleted file mode 100644 index 715db44d0d7..00000000000 --- a/.changeset/lemon-candles-vanish.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@firebase/auth': patch -'firebase': patch ---- - -Fixed: invoking `connectAuthEmulator` multiple times with the same parameters will no longer cause -an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). - diff --git a/.changeset/seven-oranges-care.md b/.changeset/seven-oranges-care.md deleted file mode 100644 index 41b59355bc7..00000000000 --- a/.changeset/seven-oranges-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Filter out empty text parts from streaming responses. diff --git a/.changeset/stale-llamas-hide.md b/.changeset/stale-llamas-hide.md deleted file mode 100644 index b46bcfb9885..00000000000 --- a/.changeset/stale-llamas-hide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Create Node CJS and ESM bundles. diff --git a/.changeset/tame-parrots-tie.md b/.changeset/tame-parrots-tie.md deleted file mode 100644 index a6b60f83952..00000000000 --- a/.changeset/tame-parrots-tie.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/util': minor -'firebase': minor ---- - -Add support for the `FIREBASE_WEBAPP_CONFIG` environment variable at install time. diff --git a/.changeset/tough-kiwis-smile.md b/.changeset/tough-kiwis-smile.md deleted file mode 100644 index 47e6d4caff8..00000000000 --- a/.changeset/tough-kiwis-smile.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/app-check': patch ---- - -Fixed a bug that caused an error to be thrown when the debug exchange failed. diff --git a/.changeset/violet-planets-impress.md b/.changeset/violet-planets-impress.md deleted file mode 100644 index 62427699f26..00000000000 --- a/.changeset/violet-planets-impress.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/vertexai': minor ---- - -**Public Preview** Added support for generating images using the Imagen 3 model. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index ee1775829b2..45a2eac48e0 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.1", - "@firebase/app-compat": "0.2.50", - "@firebase/analytics": "0.10.11", - "@firebase/analytics-compat": "0.2.17", - "@firebase/auth": "1.9.0", - "@firebase/auth-compat": "0.5.18", - "@firebase/functions": "0.12.2", - "@firebase/functions-compat": "0.3.19", - "@firebase/messaging": "0.12.16", - "@firebase/messaging-compat": "0.2.16", - "@firebase/performance": "0.7.0", - "@firebase/performance-compat": "0.2.13", - "@firebase/remote-config": "0.5.0", - "@firebase/remote-config-compat": "0.2.12" + "@firebase/app": "0.11.2", + "@firebase/app-compat": "0.2.51", + "@firebase/analytics": "0.10.12", + "@firebase/analytics-compat": "0.2.18", + "@firebase/auth": "1.9.1", + "@firebase/auth-compat": "0.5.19", + "@firebase/functions": "0.12.3", + "@firebase/functions-compat": "0.3.20", + "@firebase/messaging": "0.12.17", + "@firebase/messaging-compat": "0.2.17", + "@firebase/performance": "0.7.1", + "@firebase/performance-compat": "0.2.14", + "@firebase/remote-config": "0.6.0", + "@firebase/remote-config-compat": "0.2.13" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index dddfd6734ec..0260c334f8e 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.1", - "@firebase/firestore": "4.7.8" + "@firebase/app": "0.11.2", + "@firebase/firestore": "4.7.9" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 8766ad2b0f8..50ce3f35990 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.3.1", + "firebase": "11.4.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 518e6d170f1..8afe6a643d0 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.18 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/analytics@0.10.12 + - @firebase/component@0.6.13 + ## 0.2.17 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 75886a3684e..f4343e8ac01 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.17", + "version": "0.2.18", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.12", - "@firebase/analytics": "0.10.11", + "@firebase/component": "0.6.13", + "@firebase/analytics": "0.10.12", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index df22d343ec0..6b7df8ce4e9 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.12 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/installations@0.6.13 + - @firebase/component@0.6.13 + ## 0.10.11 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 354cd980ced..f1f051addc9 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.11", + "version": "0.10.12", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.12", + "@firebase/installations": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index b0e2a63572f..5616d3aa783 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.19 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5), [`f681482`](https://github.com/firebase/firebase-js-sdk/commit/f68148253349b8e80fc649386fede51339266a3c)]: + - @firebase/util@1.11.0 + - @firebase/app-check@0.8.12 + - @firebase/component@0.6.13 + ## 0.3.18 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 00d83fac992..56c75410973 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.18", + "version": "0.3.19", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.11", + "@firebase/app-check": "0.8.12", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 4534121a89f..0f0d2e1a770 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/app-check +## 0.8.12 + +### Patch Changes + +- [`f681482`](https://github.com/firebase/firebase-js-sdk/commit/f68148253349b8e80fc649386fede51339266a3c) [#8792](https://github.com/firebase/firebase-js-sdk/pull/8792) - Fixed a bug that caused an error to be thrown when the debug exchange failed. + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.8.11 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index ae51041b3f6..0d4fbc7fb23 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.8.11", + "version": "0.8.12", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index fd037d0feca..b54dbee267d 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.2.51 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/app@0.11.2 + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.2.50 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 3f7a7209627..12ca0859fd9 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.50", + "version": "0.2.51", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.1", - "@firebase/util": "1.10.3", + "@firebase/app": "0.11.2", + "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index fc7cef4888f..43d61c6ab40 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/app +## 0.11.2 + +### Patch Changes + +- Update SDK_VERSION. + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.11.1 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index dee646f25ba..e1b166b852a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.1", + "version": "0.11.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index f09d93284f0..e34369a8be1 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.19 + +### Patch Changes + +- Updated dependencies [[`c791ecf`](https://github.com/firebase/firebase-js-sdk/commit/c791ecf3a03a0e4f56fcdc49b703578135bf8ce6), [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/auth@1.9.1 + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.5.18 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 77f0e2c737c..38f41ac4a19 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.18", + "version": "0.5.19", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.9.0", + "@firebase/auth": "1.9.1", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.12", - "@firebase/util": "1.10.3", + "@firebase/component": "0.6.13", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 4787c31e154..609cc928744 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/auth +## 1.9.1 + +### Patch Changes + +- [`c791ecf`](https://github.com/firebase/firebase-js-sdk/commit/c791ecf3a03a0e4f56fcdc49b703578135bf8ce6) [#8750](https://github.com/firebase/firebase-js-sdk/pull/8750) - Fixed: invoking `connectAuthEmulator` multiple times with the same parameters will no longer cause + an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 1.9.0 ### Minor Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 6adf2a24075..d7a21c7124d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.9.0", + "version": "1.9.1", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 7e085ea5d4f..df1e6c026ca 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.13 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + ## 0.6.12 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index a139c563255..3e2e6d11838 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.12", + "version": "0.6.13", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 8f0751043f0..74d3dae80d6 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 0.3.1 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.3.0 ### Minor Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index d301fcbdc30..df823a05e96 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.0", + "version": "0.3.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 1e95bf2748a..2b316da4186 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/database-compat +## 2.0.4 + +### Patch Changes + +- [`b3e68ca`](https://github.com/firebase/firebase-js-sdk/commit/b3e68ca410d9b984736780098330bd6b8ee2e997) [#8769](https://github.com/firebase/firebase-js-sdk/pull/8769) - Fixed: invoking `connectDatabaseEmulator` multiple times with the same parameters will no longer + cause an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). +- Updated dependencies [[`b3e68ca`](https://github.com/firebase/firebase-js-sdk/commit/b3e68ca410d9b984736780098330bd6b8ee2e997), [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/database@1.0.13 + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + - @firebase/database-types@1.0.9 + ## 2.0.3 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 92373d15e66..358dcca1fc1 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.3", + "version": "2.0.4", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.12", - "@firebase/database-types": "1.0.8", + "@firebase/database": "1.0.13", + "@firebase/database-types": "1.0.9", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 92aa4d66b44..f2b13db80d4 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.9 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + ## 1.0.8 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 1b56609eb04..15bb0d98f89 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.8", + "version": "1.0.9", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.10.3" + "@firebase/util": "1.11.0" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 87c8c487326..7d85cec55b0 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,15 @@ # Unreleased +## 1.0.13 + +### Patch Changes + +- [`b3e68ca`](https://github.com/firebase/firebase-js-sdk/commit/b3e68ca410d9b984736780098330bd6b8ee2e997) [#8769](https://github.com/firebase/firebase-js-sdk/pull/8769) - Fixed: invoking `connectDatabaseEmulator` multiple times with the same parameters will no longer + cause an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 1.0.12 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 7d16cae41d9..5f727d7376f 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.12", + "version": "1.0.13", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 3cb4fefbc47..4e3d4760021 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,53 @@ # firebase +## 11.4.0 + +### Minor Changes + +- [`9d82665`](https://github.com/firebase/firebase-js-sdk/commit/9d826659334e1a43acd1126fab6e09a305e04936) [#8757](https://github.com/firebase/firebase-js-sdk/pull/8757) - Added support for modality-based token count. + +- [`70e08cf`](https://github.com/firebase/firebase-js-sdk/commit/70e08cf95b5c43d3b98382a6f68fbd3c3555e31f) [#8699](https://github.com/firebase/firebase-js-sdk/pull/8699) - Adds support for initial state hydration (from SSR contexts) + +- [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5) [#8483](https://github.com/firebase/firebase-js-sdk/pull/8483) - Add support for the `FIREBASE_WEBAPP_CONFIG` environment variable at install time. + +- [`ce2c775`](https://github.com/firebase/firebase-js-sdk/commit/ce2c77511210df109fdf381c7c02175173a6f7a2) [#8683](https://github.com/firebase/firebase-js-sdk/pull/8683) - **Public Preview** Added support for generating images using the Imagen 3 model. + +### Patch Changes + +- [`b3e68ca`](https://github.com/firebase/firebase-js-sdk/commit/b3e68ca410d9b984736780098330bd6b8ee2e997) [#8769](https://github.com/firebase/firebase-js-sdk/pull/8769) - Fixed: invoking `connectDatabaseEmulator` multiple times with the same parameters will no longer + cause an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). + +- [`c791ecf`](https://github.com/firebase/firebase-js-sdk/commit/c791ecf3a03a0e4f56fcdc49b703578135bf8ce6) [#8750](https://github.com/firebase/firebase-js-sdk/pull/8750) - Fixed: invoking `connectAuthEmulator` multiple times with the same parameters will no longer cause + an error. Fixes [GitHub Issue #6824](https://github.com/firebase/firebase-js-sdk/issues/6824). +- Updated dependencies [[`9d82665`](https://github.com/firebase/firebase-js-sdk/commit/9d826659334e1a43acd1126fab6e09a305e04936), [`70e08cf`](https://github.com/firebase/firebase-js-sdk/commit/70e08cf95b5c43d3b98382a6f68fbd3c3555e31f), [`b3e68ca`](https://github.com/firebase/firebase-js-sdk/commit/b3e68ca410d9b984736780098330bd6b8ee2e997), [`c791ecf`](https://github.com/firebase/firebase-js-sdk/commit/c791ecf3a03a0e4f56fcdc49b703578135bf8ce6), [`554c7bd`](https://github.com/firebase/firebase-js-sdk/commit/554c7bdc12cfde834ce5c4fa729a6cb790e1e5c2), [`884cbd7`](https://github.com/firebase/firebase-js-sdk/commit/884cbd7d89d4dd9162858f108c39e75896c2db5a), [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5), [`f681482`](https://github.com/firebase/firebase-js-sdk/commit/f68148253349b8e80fc649386fede51339266a3c), [`ce2c775`](https://github.com/firebase/firebase-js-sdk/commit/ce2c77511210df109fdf381c7c02175173a6f7a2)]: + - @firebase/app@0.11.2 + - @firebase/vertexai@1.1.0 + - @firebase/remote-config@0.6.0 + - @firebase/database-compat@2.0.4 + - @firebase/database@1.0.13 + - @firebase/auth@1.9.1 + - @firebase/util@1.11.0 + - @firebase/app-check@0.8.12 + - @firebase/analytics@0.10.12 + - @firebase/app-compat@0.2.51 + - @firebase/data-connect@0.3.1 + - @firebase/firestore@4.7.9 + - @firebase/functions@0.12.3 + - @firebase/installations@0.6.13 + - @firebase/messaging@0.12.17 + - @firebase/performance@0.7.1 + - @firebase/storage@0.13.7 + - @firebase/remote-config-compat@0.2.13 + - @firebase/auth-compat@0.5.19 + - @firebase/analytics-compat@0.2.18 + - @firebase/app-check-compat@0.3.19 + - @firebase/firestore-compat@0.3.44 + - @firebase/functions-compat@0.3.20 + - @firebase/installations-compat@0.2.13 + - @firebase/messaging-compat@0.2.17 + - @firebase/performance-compat@0.2.14 + - @firebase/storage-compat@0.3.17 + ## 11.3.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index d2d4bb468b3..a5926569e42 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.3.1", + "version": "11.4.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.1", - "@firebase/app-compat": "0.2.50", + "@firebase/app": "0.11.2", + "@firebase/app-compat": "0.2.51", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.9.0", - "@firebase/auth-compat": "0.5.18", - "@firebase/data-connect": "0.3.0", - "@firebase/database": "1.0.12", - "@firebase/database-compat": "2.0.3", - "@firebase/firestore": "4.7.8", - "@firebase/firestore-compat": "0.3.43", - "@firebase/functions": "0.12.2", - "@firebase/functions-compat": "0.3.19", - "@firebase/installations": "0.6.12", - "@firebase/installations-compat": "0.2.12", - "@firebase/messaging": "0.12.16", - "@firebase/messaging-compat": "0.2.16", - "@firebase/storage": "0.13.6", - "@firebase/storage-compat": "0.3.16", - "@firebase/performance": "0.7.0", - "@firebase/performance-compat": "0.2.13", - "@firebase/remote-config": "0.5.0", - "@firebase/remote-config-compat": "0.2.12", - "@firebase/analytics": "0.10.11", - "@firebase/analytics-compat": "0.2.17", - "@firebase/app-check": "0.8.11", - "@firebase/app-check-compat": "0.3.18", - "@firebase/util": "1.10.3", - "@firebase/vertexai": "1.0.4" + "@firebase/auth": "1.9.1", + "@firebase/auth-compat": "0.5.19", + "@firebase/data-connect": "0.3.1", + "@firebase/database": "1.0.13", + "@firebase/database-compat": "2.0.4", + "@firebase/firestore": "4.7.9", + "@firebase/firestore-compat": "0.3.44", + "@firebase/functions": "0.12.3", + "@firebase/functions-compat": "0.3.20", + "@firebase/installations": "0.6.13", + "@firebase/installations-compat": "0.2.13", + "@firebase/messaging": "0.12.17", + "@firebase/messaging-compat": "0.2.17", + "@firebase/storage": "0.13.7", + "@firebase/storage-compat": "0.3.17", + "@firebase/performance": "0.7.1", + "@firebase/performance-compat": "0.2.14", + "@firebase/remote-config": "0.6.0", + "@firebase/remote-config-compat": "0.2.13", + "@firebase/analytics": "0.10.12", + "@firebase/analytics-compat": "0.2.18", + "@firebase/app-check": "0.8.12", + "@firebase/app-check-compat": "0.3.19", + "@firebase/util": "1.11.0", + "@firebase/vertexai": "1.1.0" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 384afbe0995..f1d401e6230 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.44 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/firestore@4.7.9 + - @firebase/component@0.6.13 + ## 0.3.43 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index c82328ab764..f612b43452e 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.43", + "version": "0.3.44", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.12", - "@firebase/firestore": "4.7.8", - "@firebase/util": "1.10.3", + "@firebase/component": "0.6.13", + "@firebase/firestore": "4.7.9", + "@firebase/util": "1.11.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 7c894f1e6db..000946bb749 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/firestore +## 4.7.9 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 4.7.8 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 0cf22e035ad..b16c447f957 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.8", + "version": "4.7.9", "engines": { "node": ">=18.0.0" }, @@ -94,9 +94,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -106,9 +106,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.1", - "@firebase/app-compat": "0.2.50", - "@firebase/auth": "1.9.0", + "@firebase/app": "0.11.2", + "@firebase/app-compat": "0.2.51", + "@firebase/auth": "1.9.1", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 3dbd97e785b..6187c248d91 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.20 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/functions@0.12.3 + - @firebase/component@0.6.13 + ## 0.3.19 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index fc333293348..313afd2ab3c 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.19", + "version": "0.3.20", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.12", - "@firebase/functions": "0.12.2", + "@firebase/component": "0.6.13", + "@firebase/functions": "0.12.3", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index ab5e9bcf3ad..c9657c72276 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.3 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.12.2 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 7bc4e00dd09..29478f4fdeb 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.2", + "version": "0.12.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 402e6832fb3..c3283b451a4 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.13 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/installations@0.6.13 + - @firebase/component@0.6.13 + ## 0.2.12 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 4f0fc2c80c9..17f5e46a9f2 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.12", + "version": "0.2.13", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.12", + "@firebase/installations": "0.6.13", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 7db5ae52a74..da975f33726 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.13 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.6.12 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index 2ad5c99d852..94481a2ccb6 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.12", + "version": "0.6.13", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index e2afb3a29b6..b99cdf6a91d 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.17 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/messaging@0.12.17 + - @firebase/component@0.6.13 + ## 0.2.16 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index b88085f143f..a6b3ed9b648 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.16", + "version": "0.2.17", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.16", - "@firebase/component": "0.6.12", - "@firebase/util": "1.10.3", + "@firebase/messaging": "0.12.17", + "@firebase/component": "0.6.13", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", + "@firebase/app-compat": "0.2.51", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 04217d909a8..87191b38a3b 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.17 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/installations@0.6.13 + - @firebase/component@0.6.13 + ## 0.12.16 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 23842f922b5..804d791df90 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.16", + "version": "0.12.17", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.12", + "@firebase/installations": "0.6.13", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index a7719dad258..37dd9587a59 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.14 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/performance@0.7.1 + - @firebase/component@0.6.13 + ## 0.2.13 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 1ed2af57ecf..2d3c37f514e 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.13", + "version": "0.2.14", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.0", + "@firebase/performance": "0.7.1", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.50" + "@firebase/app-compat": "0.2.51" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index f64bfa0d33a..58eeb4b7be1 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.1 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/installations@0.6.13 + - @firebase/component@0.6.13 + ## 0.7.0 ### Minor Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 3e2e418f9d7..7a78ada7f3c 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.0", + "version": "0.7.1", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.12", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/installations": "0.6.13", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 61136c94d7a..abd4ab9ae01 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.13 + +### Patch Changes + +- Updated dependencies [[`70e08cf`](https://github.com/firebase/firebase-js-sdk/commit/70e08cf95b5c43d3b98382a6f68fbd3c3555e31f), [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/remote-config@0.6.0 + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.2.12 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index d7e78661bde..b5059aeef9c 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.12", + "version": "0.2.13", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.5.0", + "@firebase/remote-config": "0.6.0", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.50" + "@firebase/app-compat": "0.2.51" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index a31b328e7f9..055cdae474f 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/remote-config +## 0.6.0 + +### Minor Changes + +- [`70e08cf`](https://github.com/firebase/firebase-js-sdk/commit/70e08cf95b5c43d3b98382a6f68fbd3c3555e31f) [#8699](https://github.com/firebase/firebase-js-sdk/pull/8699) - Adds support for initial state hydration (from SSR contexts) + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/installations@0.6.13 + - @firebase/component@0.6.13 + ## 0.5.0 ### Minor Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 8d4ceed3502..0e4d865fd15 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.5.0", + "version": "0.6.0", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.12", + "@firebase/installations": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index a0337721289..1ddc092ba0b 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.17 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/storage@0.13.7 + - @firebase/component@0.6.13 + ## 0.3.16 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index a6005e16f50..c8eafff2c22 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.16", + "version": "0.3.17", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.6", + "@firebase/storage": "0.13.7", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.50", - "@firebase/auth-compat": "0.5.18", + "@firebase/app-compat": "0.2.51", + "@firebase/auth-compat": "0.5.19", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 4c63f910777..4bfd1ded8da 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.7 + +### Patch Changes + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 0.13.6 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 87f2d60a632..fe63e5f53c3 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.6", + "version": "0.13.7", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.10.3", - "@firebase/component": "0.6.12", + "@firebase/util": "1.11.0", + "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.1", - "@firebase/auth": "1.9.0", + "@firebase/app": "0.11.2", + "@firebase/auth": "1.9.1", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index e1b98f64feb..e13c528956d 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 1468fcb96de..e42a02b2220 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.11.0 + +### Minor Changes + +- [`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5) [#8483](https://github.com/firebase/firebase-js-sdk/pull/8483) - Add support for the `FIREBASE_WEBAPP_CONFIG` environment variable at install time. + ## 1.10.3 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index c2852958d80..3200d18c487 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.10.3", + "version": "1.11.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index b495fcd8c02..9b92ce97b54 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,23 @@ # @firebase/vertexai +## 1.1.0 + +### Minor Changes + +- [`9d82665`](https://github.com/firebase/firebase-js-sdk/commit/9d826659334e1a43acd1126fab6e09a305e04936) [#8757](https://github.com/firebase/firebase-js-sdk/pull/8757) - Added support for modality-based token count. + +- [`ce2c775`](https://github.com/firebase/firebase-js-sdk/commit/ce2c77511210df109fdf381c7c02175173a6f7a2) [#8683](https://github.com/firebase/firebase-js-sdk/pull/8683) - **Public Preview** Added support for generating images using the Imagen 3 model. + +### Patch Changes + +- [`554c7bd`](https://github.com/firebase/firebase-js-sdk/commit/554c7bdc12cfde834ce5c4fa729a6cb790e1e5c2) [#8736](https://github.com/firebase/firebase-js-sdk/pull/8736) (fixes [#8714](https://github.com/firebase/firebase-js-sdk/issues/8714)) - Filter out empty text parts from streaming responses. + +- [`884cbd7`](https://github.com/firebase/firebase-js-sdk/commit/884cbd7d89d4dd9162858f108c39e75896c2db5a) [#8728](https://github.com/firebase/firebase-js-sdk/pull/8728) - Create Node CJS and ESM bundles. + +- Updated dependencies [[`777f465`](https://github.com/firebase/firebase-js-sdk/commit/777f465ff37495ff933a29583769ce8a6a2b59b5)]: + - @firebase/util@1.11.0 + - @firebase/component@0.6.13 + ## 1.0.4 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 867623fd1b1..f26aa2ec2a7 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.0.4", + "version": "1.1.0", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.12", + "@firebase/component": "0.6.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 4fe40ddad83..c332723f484 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.1", + "@firebase/app": "0.11.2", "@firebase/logger": "0.4.4", - "@firebase/util": "1.10.3", + "@firebase/util": "1.11.0", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 43d6b6735f8b1d20dbe33793b57adb221efde95d Mon Sep 17 00:00:00 2001 From: Stephen Rosa <84193009+stephenarosaj@users.noreply.github.com> Date: Mon, 3 Mar 2025 11:18:24 -0800 Subject: [PATCH 125/295] DataConnect: Update requests to point to v1 backend endpoints instead of v1beta (#8820) * update API requests to point to v1 instead of v1beta * update changelog --- .changeset/tricky-actors-exercise.md | 5 +++++ packages/data-connect/src/util/url.ts | 2 +- packages/data-connect/test/dataconnect/dataconnect.yaml | 2 +- packages/data-connect/test/unit/gmpid.test.ts | 4 ++-- packages/data-connect/test/unit/userAgent.test.ts | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/tricky-actors-exercise.md diff --git a/.changeset/tricky-actors-exercise.md b/.changeset/tricky-actors-exercise.md new file mode 100644 index 00000000000..10529ac4268 --- /dev/null +++ b/.changeset/tricky-actors-exercise.md @@ -0,0 +1,5 @@ +--- +'@firebase/data-connect': patch +--- + +Update requests to point to v1 backend endpoints instead of v1beta diff --git a/packages/data-connect/src/util/url.ts b/packages/data-connect/src/util/url.ts index b979ec19eb5..50630582761 100644 --- a/packages/data-connect/src/util/url.ts +++ b/packages/data-connect/src/util/url.ts @@ -37,7 +37,7 @@ export function urlBuilder( 'Incorrect type for port passed in!' ); } - return `${baseUrl}/v1beta/projects/${project}/locations/${location}/services/${service}/connectors/${connector}`; + return `${baseUrl}/v1/projects/${project}/locations/${location}/services/${service}/connectors/${connector}`; } export function addToken(url: string, apiKey?: string): string { if (!apiKey) { diff --git a/packages/data-connect/test/dataconnect/dataconnect.yaml b/packages/data-connect/test/dataconnect/dataconnect.yaml index 06e5380c534..9a4d40af8e8 100644 --- a/packages/data-connect/test/dataconnect/dataconnect.yaml +++ b/packages/data-connect/test/dataconnect/dataconnect.yaml @@ -1,4 +1,4 @@ -specVersion: "v1beta" +specVersion: "v1" serviceId: "fdc-service" location: "us-west2" schema: diff --git a/packages/data-connect/test/unit/gmpid.test.ts b/packages/data-connect/test/unit/gmpid.test.ts index 77b9f8bcac4..fa0e1486d85 100644 --- a/packages/data-connect/test/unit/gmpid.test.ts +++ b/packages/data-connect/test/unit/gmpid.test.ts @@ -53,7 +53,7 @@ describe('GMPID Tests', () => { // @ts-ignore await executeQuery(queryRef(dc, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['x-firebase-gmpid']: APPID @@ -71,7 +71,7 @@ describe('GMPID Tests', () => { // @ts-ignore await executeQuery(queryRef(dc2, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['x-firebase-gmpid']: APPID diff --git a/packages/data-connect/test/unit/userAgent.test.ts b/packages/data-connect/test/unit/userAgent.test.ts index 9e9637a7ea6..2b399672768 100644 --- a/packages/data-connect/test/unit/userAgent.test.ts +++ b/packages/data-connect/test/unit/userAgent.test.ts @@ -54,7 +54,7 @@ describe('User Agent Tests', () => { // @ts-ignore await executeQuery(queryRef(dc, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION + ' js/gen' @@ -66,7 +66,7 @@ describe('User Agent Tests', () => { // @ts-ignore await executeQuery(queryRef(dc, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION From 7ae48246b9992ae17e9d0ab92114d426b4dd2973 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 3 Mar 2025 15:23:03 -0800 Subject: [PATCH 126/295] Remove auto-commit API report workflow (#8808) --- .github/workflows/check-docs.yml | 54 ++++++++++++++---------- .github/workflows/update-api-reports.yml | 48 --------------------- 2 files changed, 31 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/update-api-reports.yml diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index de182b3eeb0..4afd97a131f 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -22,26 +22,34 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - # get all history for the diff - fetch-depth: 0 - - name: Set up Node (20) - uses: actions/setup-node@v4 - with: - node-version: 22.10.0 - - name: Yarn install - run: yarn - - name: Run doc generation - run: yarn docgen:all - - name: Check for changes in docs-devsite dir (fail if so) - run: | - if [[ -n "$(git status docs-devsite --porcelain)" ]]; then - echo "Unstaged changes detected:" - git status -s - exit 1 - fi - - name: Reference documentation needs to be updated. See message below. - if: ${{ failure() }} - run: echo "Changes in this PR affect the reference docs. Run \`yarn docgen:all\` locally to regenerate docs and add them to this PR." \ No newline at end of file + - name: Checkout Repo + uses: actions/checkout@v4 + with: + # get all history for the diff + fetch-depth: 0 + - name: Set up Node (20) + uses: actions/setup-node@v4 + with: + node-version: 22.10.0 + - name: Yarn install + run: yarn + - name: Run doc generation + run: yarn docgen:all + # Fail first if there are docs-devsite changes since running yarn docgen:all + # will also regenerate any API report changes. + - name: Check for changes in docs-devsite dir (fail if so) + run: | + if [[ -n "$(git status docs-devsite --porcelain)" ]]; then + echo "Unstaged changes detected in docs-devsite/:" + git status -s + echo "Changes in this PR affect the reference docs or API reports. Run \`yarn docgen:all\` locally to regenerate the changed files and add them to this PR." + exit 1 + fi + - name: Check for changes in common/api-review dir (fail if so) + run: | + if [[ -n "$(git status common/api-review --porcelain)" ]]; then + echo "Unstaged changes detected in api-report(s):" + git status -s + echo "Changes in this PR affect the API reports. Run \`yarn build\` locally to regenerate the API reports and add them to this PR." + exit 1 + fi diff --git a/.github/workflows/update-api-reports.yml b/.github/workflows/update-api-reports.yml deleted file mode 100644 index c961889de98..00000000000 --- a/.github/workflows/update-api-reports.yml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2023 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. - -name: Update API reports - -on: pull_request - -jobs: - update_api_reports: - name: Update API reports - runs-on: ubuntu-latest - - permissions: - contents: write - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - # checkout HEAD commit instead of merge commit - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ github.token }} - - name: Set up node (20) - uses: actions/setup-node@v4 - with: - node-version: 22.10.0 - - name: Yarn install - run: yarn - - name: Update API reports - # API reports are generated as part of the build - run: yarn build - id: update-api-reports - - name: Commit & Push changes - uses: EndBug/add-and-commit@v9 - with: - add: 'common/api-review/*' - message: 'Update API reports' - default_author: github_actor \ No newline at end of file From 058afa280c8e9a72e27f3b1fbdb2921012dc65d3 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 4 Mar 2025 11:28:22 -0500 Subject: [PATCH 127/295] Add missing `BlockReason` and `FinishReason` enum values (#8741) --- .changeset/stupid-apples-shave.md | 6 ++++++ common/api-review/vertexai.api.md | 6 ++++++ docs-devsite/vertexai.md | 6 ++++++ packages/vertexai/src/types/enums.ts | 28 ++++++++++++++++++++++++++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .changeset/stupid-apples-shave.md diff --git a/.changeset/stupid-apples-shave.md b/.changeset/stupid-apples-shave.md new file mode 100644 index 00000000000..a76a3808056 --- /dev/null +++ b/.changeset/stupid-apples-shave.md @@ -0,0 +1,6 @@ +--- +'@firebase/vertexai': minor +'firebase': minor +--- + +Added missing `BlockReason` and `FinishReason` enum values. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 8b1dd83f51a..14c58e803e5 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -28,8 +28,10 @@ export interface BaseParams { // @public export enum BlockReason { + BLOCKLIST = "BLOCKLIST", // (undocumented) OTHER = "OTHER", + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", // (undocumented) SAFETY = "SAFETY" } @@ -158,14 +160,18 @@ export interface FileDataPart { // @public export enum FinishReason { + BLOCKLIST = "BLOCKLIST", + MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", // (undocumented) MAX_TOKENS = "MAX_TOKENS", // (undocumented) OTHER = "OTHER", + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", // (undocumented) RECITATION = "RECITATION", // (undocumented) SAFETY = "SAFETY", + SPII = "SPII", // (undocumented) STOP = "STOP" } diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index d174bef7bcf..c0e744fb8e9 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -277,7 +277,9 @@ export declare enum BlockReason | Member | Value | Description | | --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | | OTHER | "OTHER" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | | SAFETY | "SAFETY" | | ## FinishReason @@ -294,10 +296,14 @@ export declare enum FinishReason | Member | Value | Description | | --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | +| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | | MAX\_TOKENS | "MAX_TOKENS" | | | OTHER | "OTHER" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | | RECITATION | "RECITATION" | | | SAFETY | "SAFETY" | | +| SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | | STOP | "STOP" | | ## FunctionCallingMode diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index 4a7d95c660c..78cbdb09bd7 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -101,7 +101,15 @@ export enum BlockReason { // Content was blocked by safety settings. SAFETY = 'SAFETY', // Content was blocked, but the reason is uncategorized. - OTHER = 'OTHER' + OTHER = 'OTHER', + /** + * Content was blocked because it contained terms from the terminology blocklist. + */ + BLOCKLIST = 'BLOCKLIST', + /** + * Content was blocked due to prohibited content. + */ + PROHIBITED_CONTENT = 'PROHIBITED_CONTENT' } /** @@ -118,7 +126,23 @@ export enum FinishReason { // The candidate content was flagged for recitation reasons. RECITATION = 'RECITATION', // Unknown reason. - OTHER = 'OTHER' + OTHER = 'OTHER', + /** + * The candidate content contained forbidden terms. + */ + BLOCKLIST = 'BLOCKLIST', + /** + * The candidate content potentially contained prohibited content. + */ + PROHIBITED_CONTENT = 'PROHIBITED_CONTENT', + /** + * The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). + */ + SPII = 'SPII', + /** + * The function call generated by the model was invalid. + */ + MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL' } /** From 42cea4810bb6d845d4330589381bcd91ea95aee3 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 5 Mar 2025 10:57:05 -0500 Subject: [PATCH 128/295] Convert enum comments to JSDoc comments (#8742) --- common/api-review/vertexai.api.md | 24 ------ docs-devsite/vertexai.md | 48 ++++++------ packages/vertexai/src/types/enums.ts | 106 +++++++++++++++++++-------- 3 files changed, 101 insertions(+), 77 deletions(-) diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 14c58e803e5..c0b28466bd7 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -29,10 +29,8 @@ export interface BaseParams { // @public export enum BlockReason { BLOCKLIST = "BLOCKLIST", - // (undocumented) OTHER = "OTHER", PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - // (undocumented) SAFETY = "SAFETY" } @@ -162,17 +160,12 @@ export interface FileDataPart { export enum FinishReason { BLOCKLIST = "BLOCKLIST", MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", - // (undocumented) MAX_TOKENS = "MAX_TOKENS", - // (undocumented) OTHER = "OTHER", PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - // (undocumented) RECITATION = "RECITATION", - // (undocumented) SAFETY = "SAFETY", SPII = "SPII", - // (undocumented) STOP = "STOP" } @@ -194,11 +187,8 @@ export interface FunctionCallingConfig { // @public (undocumented) export enum FunctionCallingMode { - // (undocumented) ANY = "ANY", - // (undocumented) AUTO = "AUTO", - // (undocumented) NONE = "NONE" } @@ -383,21 +373,15 @@ export interface GroundingMetadata { // @public (undocumented) export enum HarmBlockMethod { - // (undocumented) PROBABILITY = "PROBABILITY", - // (undocumented) SEVERITY = "SEVERITY" } // @public export enum HarmBlockThreshold { - // (undocumented) BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", - // (undocumented) BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", - // (undocumented) BLOCK_NONE = "BLOCK_NONE", - // (undocumented) BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" } @@ -415,25 +399,17 @@ export enum HarmCategory { // @public export enum HarmProbability { - // (undocumented) HIGH = "HIGH", - // (undocumented) LOW = "LOW", - // (undocumented) MEDIUM = "MEDIUM", - // (undocumented) NEGLIGIBLE = "NEGLIGIBLE" } // @public export enum HarmSeverity { - // (undocumented) HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", - // (undocumented) HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", - // (undocumented) HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", - // (undocumented) HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE" } diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index c0e744fb8e9..eb805c7710f 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -278,9 +278,9 @@ export declare enum BlockReason | Member | Value | Description | | --- | --- | --- | | BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | -| OTHER | "OTHER" | | +| OTHER | "OTHER" | Content was blocked, but the reason is uncategorized. | | PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | -| SAFETY | "SAFETY" | | +| SAFETY | "SAFETY" | Content was blocked by safety settings. | ## FinishReason @@ -298,13 +298,13 @@ export declare enum FinishReason | --- | --- | --- | | BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | | MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | -| MAX\_TOKENS | "MAX_TOKENS" | | -| OTHER | "OTHER" | | +| MAX\_TOKENS | "MAX_TOKENS" | The maximum number of tokens as specified in the request was reached. | +| OTHER | "OTHER" | Unknown reason. | | PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | -| RECITATION | "RECITATION" | | -| SAFETY | "SAFETY" | | +| RECITATION | "RECITATION" | The candidate content was flagged for recitation reasons. | +| SAFETY | "SAFETY" | The candidate content was flagged for safety reasons. | | SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | -| STOP | "STOP" | | +| STOP | "STOP" | Natural stop point of the model or provided stop sequence. | ## FunctionCallingMode @@ -319,9 +319,9 @@ export declare enum FunctionCallingMode | Member | Value | Description | | --- | --- | --- | -| ANY | "ANY" | | -| AUTO | "AUTO" | | -| NONE | "NONE" | | +| ANY | "ANY" | Model is constrained to always predicting a function call only. If allowed_function_names is set, the predicted function call will be limited to any one of allowed_function_names, else the predicted function call will be any one of the provided function_declarations. | +| AUTO | "AUTO" | Default model behavior; model decides to predict either a function call or a natural language response. | +| NONE | "NONE" | Model will not predict any function call. Model behavior is same as when not passing any function declarations. | ## HarmBlockMethod @@ -336,8 +336,8 @@ export declare enum HarmBlockMethod | Member | Value | Description | | --- | --- | --- | -| PROBABILITY | "PROBABILITY" | | -| SEVERITY | "SEVERITY" | | +| PROBABILITY | "PROBABILITY" | The harm block method uses the probability score. | +| SEVERITY | "SEVERITY" | The harm block method uses both probability and severity scores. | ## HarmBlockThreshold @@ -353,10 +353,10 @@ export declare enum HarmBlockThreshold | Member | Value | Description | | --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | -| BLOCK\_NONE | "BLOCK_NONE" | | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | Content with NEGLIGIBLE will be allowed. | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | +| BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | ## HarmCategory @@ -391,10 +391,10 @@ export declare enum HarmProbability | Member | Value | Description | | --- | --- | --- | -| HIGH | "HIGH" | | -| LOW | "LOW" | | -| MEDIUM | "MEDIUM" | | -| NEGLIGIBLE | "NEGLIGIBLE" | | +| HIGH | "HIGH" | Content has a high chance of being unsafe. | +| LOW | "LOW" | Content has a low chance of being unsafe. | +| MEDIUM | "MEDIUM" | Content has a medium chance of being unsafe. | +| NEGLIGIBLE | "NEGLIGIBLE" | Content has a negligible chance of being unsafe. | ## HarmSeverity @@ -410,10 +410,10 @@ export declare enum HarmSeverity | Member | Value | Description | | --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | High level of harm severity. | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | Low level of harm severity. | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | Medium level of harm severity. | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | Negligible level of harm severity. | ## ImagenAspectRatio diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index 78cbdb09bd7..a9481d40f5f 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -43,13 +43,21 @@ export enum HarmCategory { * @public */ export enum HarmBlockThreshold { - // Content with NEGLIGIBLE will be allowed. + /** + * Content with `NEGLIGIBLE` will be allowed. + */ BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE', - // Content with NEGLIGIBLE and LOW will be allowed. + /** + * Content with `NEGLIGIBLE` and `LOW` will be allowed. + */ BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE', - // Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. + /** + * Content with `NEGLIGIBLE`, `LOW`, and `MEDIUM` will be allowed. + */ BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH', - // All content will be allowed. + /** + * All content will be allowed. + */ BLOCK_NONE = 'BLOCK_NONE' } @@ -57,9 +65,13 @@ export enum HarmBlockThreshold { * @public */ export enum HarmBlockMethod { - // The harm block method uses both probability and severity scores. + /** + * The harm block method uses both probability and severity scores. + */ SEVERITY = 'SEVERITY', - // The harm block method uses the probability score. + /** + * The harm block method uses the probability score. + */ PROBABILITY = 'PROBABILITY' } @@ -68,13 +80,21 @@ export enum HarmBlockMethod { * @public */ export enum HarmProbability { - // Content has a negligible chance of being unsafe. + /** + * Content has a negligible chance of being unsafe. + */ NEGLIGIBLE = 'NEGLIGIBLE', - // Content has a low chance of being unsafe. + /** + * Content has a low chance of being unsafe. + */ LOW = 'LOW', - // Content has a medium chance of being unsafe. + /** + * Content has a medium chance of being unsafe. + */ MEDIUM = 'MEDIUM', - // Content has a high chance of being unsafe. + /** + * Content has a high chance of being unsafe. + */ HIGH = 'HIGH' } @@ -83,13 +103,21 @@ export enum HarmProbability { * @public */ export enum HarmSeverity { - // Negligible level of harm severity. + /** + * Negligible level of harm severity. + */ HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE', - // Low level of harm severity. + /** + * Low level of harm severity. + */ HARM_SEVERITY_LOW = 'HARM_SEVERITY_LOW', - // Medium level of harm severity. + /** + * Medium level of harm severity. + */ HARM_SEVERITY_MEDIUM = 'HARM_SEVERITY_MEDIUM', - // High level of harm severity. + /** + * High level of harm severity. + */ HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH' } @@ -98,9 +126,13 @@ export enum HarmSeverity { * @public */ export enum BlockReason { - // Content was blocked by safety settings. + /** + * Content was blocked by safety settings. + */ SAFETY = 'SAFETY', - // Content was blocked, but the reason is uncategorized. + /** + * Content was blocked, but the reason is uncategorized. + */ OTHER = 'OTHER', /** * Content was blocked because it contained terms from the terminology blocklist. @@ -117,15 +149,25 @@ export enum BlockReason { * @public */ export enum FinishReason { - // Natural stop point of the model or provided stop sequence. + /** + * Natural stop point of the model or provided stop sequence. + */ STOP = 'STOP', - // The maximum number of tokens as specified in the request was reached. + /** + * The maximum number of tokens as specified in the request was reached. + */ MAX_TOKENS = 'MAX_TOKENS', - // The candidate content was flagged for safety reasons. + /** + * The candidate content was flagged for safety reasons. + */ SAFETY = 'SAFETY', - // The candidate content was flagged for recitation reasons. + /** + * The candidate content was flagged for recitation reasons. + */ RECITATION = 'RECITATION', - // Unknown reason. + /** + * Unknown reason. + */ OTHER = 'OTHER', /** * The candidate content contained forbidden terms. @@ -149,16 +191,22 @@ export enum FinishReason { * @public */ export enum FunctionCallingMode { - // Default model behavior, model decides to predict either a function call - // or a natural language response. + /** + * Default model behavior; model decides to predict either a function call + * or a natural language response. + */ AUTO = 'AUTO', - // Model is constrained to always predicting a function call only. - // If "allowed_function_names" is set, the predicted function call will be - // limited to any one of "allowed_function_names", else the predicted - // function call will be any one of the provided "function_declarations". + /** + * Model is constrained to always predicting a function call only. + * If `allowed_function_names` is set, the predicted function call will be + * limited to any one of `allowed_function_names`, else the predicted + * function call will be any one of the provided `function_declarations`. + */ ANY = 'ANY', - // Model will not predict any function call. Model behavior is same as when - // not passing any function declarations. + /** + * Model will not predict any function call. Model behavior is same as when + * not passing any function declarations. + */ NONE = 'NONE' } From 25985ac3c3a797160e2dc3a2a28aba9f63fe6dfd Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 6 Mar 2025 10:06:38 -0500 Subject: [PATCH 129/295] Add `systemInstruction`, `tools`, and `generationConfig` to `CountTokensRequest` (#8827) --- .changeset/chilly-parrots-remember.md | 5 ++++ common/api-review/vertexai.api.md | 3 ++ docs-devsite/vertexai.counttokensrequest.md | 33 +++++++++++++++++++++ packages/vertexai/src/types/requests.ts | 12 ++++++++ 4 files changed, 53 insertions(+) create mode 100644 .changeset/chilly-parrots-remember.md diff --git a/.changeset/chilly-parrots-remember.md b/.changeset/chilly-parrots-remember.md new file mode 100644 index 00000000000..aaf0d766b44 --- /dev/null +++ b/.changeset/chilly-parrots-remember.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': minor +--- + +Add `systemInstruction`, `tools`, and `generationConfig` to `CountTokensRequest`. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index c0b28466bd7..cfe2bcc4c66 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -88,6 +88,9 @@ export interface Content { export interface CountTokensRequest { // (undocumented) contents: Content[]; + generationConfig?: GenerationConfig; + systemInstruction?: string | Part | Content; + tools?: Tool[]; } // @public diff --git a/docs-devsite/vertexai.counttokensrequest.md b/docs-devsite/vertexai.counttokensrequest.md index db519b7eb11..f5875564588 100644 --- a/docs-devsite/vertexai.counttokensrequest.md +++ b/docs-devsite/vertexai.counttokensrequest.md @@ -23,6 +23,9 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | | [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [generationConfig](./vertexai.counttokensrequest.md#counttokensrequestgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Configuration options that control how the model generates a response. | +| [systemInstruction](./vertexai.counttokensrequest.md#counttokensrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | Instructions that direct the model to behave a certain way. | +| [tools](./vertexai.counttokensrequest.md#counttokensrequesttools) | [Tool](./vertexai.md#tool)\[\] | [Tool](./vertexai.md#tool) configuration. | ## CountTokensRequest.contents @@ -31,3 +34,33 @@ export interface CountTokensRequest ```typescript contents: Content[]; ``` + +## CountTokensRequest.generationConfig + +Configuration options that control how the model generates a response. + +Signature: + +```typescript +generationConfig?: GenerationConfig; +``` + +## CountTokensRequest.systemInstruction + +Instructions that direct the model to behave a certain way. + +Signature: + +```typescript +systemInstruction?: string | Part | Content; +``` + +## CountTokensRequest.tools + +[Tool](./vertexai.md#tool) configuration. + +Signature: + +```typescript +tools?: Tool[]; +``` diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index dc7576f232d..5058b457365 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -114,6 +114,18 @@ export interface StartChatParams extends BaseParams { */ export interface CountTokensRequest { contents: Content[]; + /** + * Instructions that direct the model to behave a certain way. + */ + systemInstruction?: string | Part | Content; + /** + * {@link Tool} configuration. + */ + tools?: Tool[]; + /** + * Configuration options that control how the model generates a response. + */ + generationConfig?: GenerationConfig; } /** From 33acc6e3c87ab4f22af2441483a50d2be2e891a6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 6 Mar 2025 10:06:49 -0500 Subject: [PATCH 130/295] Update yarn.lock in e2e (#8831) --- e2e/yarn.lock | 329 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 231 insertions(+), 98 deletions(-) diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 53db962e2f9..2cd76586ebe 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -10,7 +10,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": version "7.26.2" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== @@ -28,12 +28,39 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/core@7.26.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": +"@babel/compat-data@^7.26.5", "@babel/compat-data@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" + integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== + +"@babel/core@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz#7742f11c75acea6b08a8e24c5c0c8c89e89bf53e" + integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.8" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.7" + "@babel/parser" "^7.26.8" + "@babel/template" "^7.26.8" + "@babel/traverse" "^7.26.8" + "@babel/types" "^7.26.8" + "@types/gensync" "^1.0.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -65,6 +92,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.26.8", "@babel/generator@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz#75a9482ad3d0cc7188a537aa4910bc59db67cbca" + integrity sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg== + dependencies: + "@babel/parser" "^7.26.9" + "@babel/types" "^7.26.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/generator@^7.7.2": version "7.26.3" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" @@ -83,14 +121,6 @@ dependencies: "@babel/types" "^7.25.9" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz#f41752fe772a578e67286e6779a68a5a92de1ee9" - integrity sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" @@ -102,6 +132,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" + integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== + dependencies: + "@babel/compat-data" "^7.26.5" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" @@ -135,6 +176,17 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" +"@babel/helper-define-polyfill-provider@^0.6.3": + version "0.6.3" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== + dependencies: + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + "@babel/helper-member-expression-to-functions@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" @@ -172,6 +224,11 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== +"@babel/helper-plugin-utils@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" + integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== + "@babel/helper-remap-async-to-generator@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" @@ -238,6 +295,14 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" +"@babel/helpers@^7.26.7": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz#28f3fb45252fc88ef2dc547c8a911c255fc9fef6" + integrity sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA== + dependencies: + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.9" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" @@ -252,6 +317,13 @@ dependencies: "@babel/types" "^7.26.0" +"@babel/parser@^7.26.8", "@babel/parser@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz#d9e78bee6dc80f9efd8f2349dcfbbcdace280fd5" + integrity sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A== + dependencies: + "@babel/types" "^7.26.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" @@ -437,14 +509,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" - integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== +"@babel/plugin-transform-async-generator-functions@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz#5e3991135e3b9c6eaaf5eff56d1ae5a11df45ff8" + integrity sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/traverse" "^7.26.8" "@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" @@ -455,12 +527,12 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" - integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== +"@babel/plugin-transform-block-scoped-functions@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" + integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-block-scoping@^7.25.9": version "7.25.9" @@ -542,12 +614,11 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-exponentiation-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz#ece47b70d236c1d99c263a1e22b62dc20a4c8b0f" - integrity sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA== +"@babel/plugin-transform-exponentiation-operator@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-export-namespace-from@^7.25.9": @@ -619,6 +690,14 @@ "@babel/helper-plugin-utils" "^7.25.9" "@babel/helper-simple-access" "^7.25.9" +"@babel/plugin-transform-modules-commonjs@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== + dependencies: + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-modules-systemjs@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" @@ -652,12 +731,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" - integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== +"@babel/plugin-transform-nullish-coalescing-operator@^7.26.6": + version "7.26.6" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" + integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-numeric-separator@^7.25.9": version "7.25.9" @@ -774,19 +853,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" - integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== +"@babel/plugin-transform-template-literals@^7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz#966b15d153a991172a540a69ad5e1845ced990b5" + integrity sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" -"@babel/plugin-transform-typeof-symbol@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" - integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== +"@babel/plugin-transform-typeof-symbol@^7.26.7": + version "7.26.7" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz#d0e33acd9223744c1e857dbd6fa17bd0a3786937" + integrity sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typescript@^7.25.9": version "7.26.3" @@ -830,14 +909,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.25.9" "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" - integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== +"@babel/preset-env@7.26.8": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz#7af0090829b606d2046db99679004731e1dc364d" + integrity sha512-um7Sy+2THd697S4zJEfv/U5MHGJzkN2xhtsR3T/SWRbVSic62nbISh51VVfU9JiO/L/Z97QczHTaFVkOU8IzNg== dependencies: - "@babel/compat-data" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/compat-data" "^7.26.8" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-plugin-utils" "^7.26.5" "@babel/helper-validator-option" "^7.25.9" "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" @@ -849,9 +928,9 @@ "@babel/plugin-syntax-import-attributes" "^7.26.0" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.26.8" "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.26.5" "@babel/plugin-transform-block-scoping" "^7.25.9" "@babel/plugin-transform-class-properties" "^7.25.9" "@babel/plugin-transform-class-static-block" "^7.26.0" @@ -862,7 +941,7 @@ "@babel/plugin-transform-duplicate-keys" "^7.25.9" "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.26.3" "@babel/plugin-transform-export-namespace-from" "^7.25.9" "@babel/plugin-transform-for-of" "^7.25.9" "@babel/plugin-transform-function-name" "^7.25.9" @@ -871,12 +950,12 @@ "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" "@babel/plugin-transform-member-expression-literals" "^7.25.9" "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.26.3" "@babel/plugin-transform-modules-systemjs" "^7.25.9" "@babel/plugin-transform-modules-umd" "^7.25.9" "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.26.6" "@babel/plugin-transform-numeric-separator" "^7.25.9" "@babel/plugin-transform-object-rest-spread" "^7.25.9" "@babel/plugin-transform-object-super" "^7.25.9" @@ -892,17 +971,17 @@ "@babel/plugin-transform-shorthand-properties" "^7.25.9" "@babel/plugin-transform-spread" "^7.25.9" "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.25.9" - "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.26.8" + "@babel/plugin-transform-typeof-symbol" "^7.26.7" "@babel/plugin-transform-unicode-escapes" "^7.25.9" "@babel/plugin-transform-unicode-property-regex" "^7.25.9" "@babel/plugin-transform-unicode-regex" "^7.25.9" "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" "@babel/preset-modules" "0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-corejs3 "^0.11.0" babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.38.1" + core-js-compat "^3.40.0" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -941,6 +1020,15 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" +"@babel/template@^7.26.8", "@babel/template@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz#4577ad3ddf43d194528cff4e1fa6b232fa609bb2" + integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/parser" "^7.26.9" + "@babel/types" "^7.26.9" + "@babel/traverse@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" @@ -954,6 +1042,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.26.8": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" + integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.9" + "@babel/parser" "^7.26.9" + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.9" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" @@ -970,6 +1071,14 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.26.8", "@babel/types@^7.26.9": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz#08b43dec79ee8e682c2ac631c010bdcac54a21ce" + integrity sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1903,6 +2012,11 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/gensync@^1.0.0": + version "1.0.4" + resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz#7122d8f0cd3bf437f9725cc95b180197190cf50b" + integrity sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA== + "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -2364,13 +2478,13 @@ babel-jest@29.7.0, babel-jest@^29.7.0: graceful-fs "^4.2.9" slash "^3.0.0" -babel-loader@8.3.0: - version "8.3.0" - resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" - integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== +babel-loader@8.4.1: + version "8.4.1" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" + integrity sha512-nXzRChX+Z1GoE6yWavBQg6jDslyFF3SDjl2paADuoQtQW10JqShJt62R6eJQ5m/pjJFDT8xgKIWSP85OY8eXeA== dependencies: find-cache-dir "^3.3.1" - loader-utils "^2.0.0" + loader-utils "^2.0.4" make-dir "^3.1.0" schema-utils "^2.6.5" @@ -2404,13 +2518,13 @@ babel-plugin-polyfill-corejs2@^0.4.10: "@babel/helper-define-polyfill-provider" "^0.6.2" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.6: - version "0.10.6" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" - integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== +babel-plugin-polyfill-corejs3@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz#4e4e182f1bb37c7ba62e2af81d8dd09df31344f6" + integrity sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" - core-js-compat "^3.38.0" + "@babel/helper-define-polyfill-provider" "^0.6.3" + core-js-compat "^3.40.0" babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.2" @@ -2509,7 +2623,7 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: +browserslist@^4.14.5, browserslist@^4.24.0: version "4.24.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -2519,6 +2633,16 @@ browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: node-releases "^2.0.18" update-browserslist-db "^1.1.1" +browserslist@^4.24.4: + version "4.24.4" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== + dependencies: + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" + bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -2579,6 +2703,11 @@ caniuse-lite@^1.0.30001669: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== +caniuse-lite@^1.0.30001688: + version "1.0.30001702" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz#cde16fa8adaa066c04aec2967b6cde46354644c4" + integrity sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA== + chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -2746,12 +2875,12 @@ cookie@0.7.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -core-js-compat@^3.38.0, core-js-compat@^3.38.1: - version "3.38.1" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz#2bc7a298746ca5a7bcb9c164bcb120f2ebc09a09" - integrity sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw== +core-js-compat@^3.40.0: + version "3.41.0" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.41.0.tgz#4cdfce95f39a8f27759b667cf693d96e5dda3d17" + integrity sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A== dependencies: - browserslist "^4.23.3" + browserslist "^4.24.4" core-util-is@~1.0.0: version "1.0.3" @@ -2931,6 +3060,11 @@ electron-to-chromium@^1.5.41: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== +electron-to-chromium@^1.5.73: + version "1.5.112" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz#8d3d95d4d5653836327890282c8eda5c6f26626d" + integrity sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA== + emittery@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" @@ -3105,10 +3239,10 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -express@^4.19.2: - version "4.21.1" - resolved "https://registry.npmjs.org/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" - integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== +express@^4.21.2: + version "4.21.2" + resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== dependencies: accepts "~1.3.8" array-flatten "1.1.1" @@ -3129,7 +3263,7 @@ express@^4.19.2: methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.10" + path-to-regexp "0.1.12" proxy-addr "~2.0.7" qs "6.13.0" range-parser "~1.2.1" @@ -3414,11 +3548,6 @@ html-encoding-sniffer@^3.0.0: dependencies: whatwg-encoding "^2.0.0" -html-entities@^2.4.0: - version "2.5.2" - resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" - integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -3464,7 +3593,7 @@ http-proxy-agent@^5.0.0: agent-base "6" debug "4" -http-proxy-middleware@^2.0.3: +http-proxy-middleware@^2.0.7: version "2.0.7" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== @@ -4211,7 +4340,7 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^2.0.0: +loader-utils@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== @@ -4400,6 +4529,11 @@ node-releases@^2.0.18: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -4540,10 +4674,10 @@ path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@0.1.10: - version "0.1.10" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" - integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" @@ -5447,10 +5581,10 @@ webpack-dev-middleware@^7.4.2: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz#8f44147402b4d8ab99bfeb9b6880daa1411064e5" - integrity sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ== +webpack-dev-server@5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz#68043886edaa3fd875ad20e01589990a79612f9c" + integrity sha512-90SqqYXA2SK36KcT6o1bvwvZfJFcmoamqeJY7+boioffX9g9C0wjjJRGUrQIuh43pb0ttX7+ssavmj/WN2RHtA== dependencies: "@types/bonjour" "^3.5.13" "@types/connect-history-api-fallback" "^1.5.4" @@ -5465,10 +5599,9 @@ webpack-dev-server@5.1.0: colorette "^2.0.10" compression "^1.7.4" connect-history-api-fallback "^2.0.0" - express "^4.19.2" + express "^4.21.2" graceful-fs "^4.2.6" - html-entities "^2.4.0" - http-proxy-middleware "^2.0.3" + http-proxy-middleware "^2.0.7" ipaddr.js "^2.1.0" launch-editor "^2.6.1" open "^10.0.3" From 5611175975deb8d39eb1387a7ef083120f12c8b5 Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 7 Mar 2025 02:03:07 +0700 Subject: [PATCH 131/295] Fix transport service retry logic condition (Fixes #8813) (#8814) Modify the retry mechanism to stop when remaining tries is less than or equal to zero, improving the robustness of the retry handling. Fixes #8813 --- .changeset/floppy-schools-battle.md | 6 ++++++ packages/performance/src/services/transport_service.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/floppy-schools-battle.md diff --git a/.changeset/floppy-schools-battle.md b/.changeset/floppy-schools-battle.md new file mode 100644 index 00000000000..499b04a6672 --- /dev/null +++ b/.changeset/floppy-schools-battle.md @@ -0,0 +1,6 @@ +--- +'@firebase/performance': patch +'firebase': patch +--- + +Modify the retry mechanism to stop when remaining tries is less than or equal to zero, improving the robustness of the retry handling. diff --git a/packages/performance/src/services/transport_service.ts b/packages/performance/src/services/transport_service.ts index cf5e3972972..8577fd3a128 100644 --- a/packages/performance/src/services/transport_service.ts +++ b/packages/performance/src/services/transport_service.ts @@ -73,7 +73,7 @@ export function resetTransportService(): void { function processQueue(timeOffset: number): void { setTimeout(() => { // If there is no remainingTries left, stop retrying. - if (remainingTries === 0) { + if (remainingTries <= 0) { return; } From 51465ce876c38a842222467b446c10672e3b4169 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 6 Mar 2025 15:16:11 -0500 Subject: [PATCH 132/295] Give `check-changeset` job pull request write permissions (#8833) --- .github/workflows/check-changeset.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index 3514f409c81..f38d3b2b69e 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -28,6 +28,9 @@ jobs: name: Check changeset vs changed files runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -89,4 +92,4 @@ jobs: # Don't want it to throw before editing the comment. - name: Fail if checker script logged a blocking failure if: ${{steps.check-changeset.outputs.BLOCKING_FAILURE == 'true'}} - run: exit 1 \ No newline at end of file + run: exit 1 From feb2c9dfa29c9dff01c1272e56f6258176dc6b3a Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Mon, 10 Mar 2025 13:40:15 -0400 Subject: [PATCH 133/295] Fix: sort strings in UTF-8 encoded byte order with lazy encoding (#8787) --- .changeset/large-pants-hide.md | 6 + .../local/indexeddb_remote_document_cache.ts | 4 + packages/firestore/src/model/path.ts | 11 +- packages/firestore/src/model/values.ts | 10 +- packages/firestore/src/util/misc.ts | 62 +++++ .../test/integration/api/database.test.ts | 239 ++++++++++++++++++ .../firestore/test/unit/util/misc.test.ts | 226 ++++++++++++++++- 7 files changed, 546 insertions(+), 12 deletions(-) create mode 100644 .changeset/large-pants-hide.md diff --git a/.changeset/large-pants-hide.md b/.changeset/large-pants-hide.md new file mode 100644 index 00000000000..fbaf7bd6008 --- /dev/null +++ b/.changeset/large-pants-hide.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Use lazy encoding in UTF-8 encoded byte comparison for strings. diff --git a/packages/firestore/src/local/indexeddb_remote_document_cache.ts b/packages/firestore/src/local/indexeddb_remote_document_cache.ts index b3d4658d53d..9b23c64fcf5 100644 --- a/packages/firestore/src/local/indexeddb_remote_document_cache.ts +++ b/packages/firestore/src/local/indexeddb_remote_document_cache.ts @@ -655,5 +655,9 @@ export function dbKeyComparator(l: DocumentKey, r: DocumentKey): number { return cmp; } + // TODO(b/329441702): Document IDs should be sorted by UTF-8 encoded byte + // order, but IndexedDB sorts strings lexicographically. Document ID + // comparison here still relies on primitive comparison to avoid mismatches + // observed in snapshot listeners with Unicode characters in documentIds return primitiveComparator(left[left.length - 1], right[right.length - 1]); } diff --git a/packages/firestore/src/model/path.ts b/packages/firestore/src/model/path.ts index 64cb0376a0e..c375b4c56d2 100644 --- a/packages/firestore/src/model/path.ts +++ b/packages/firestore/src/model/path.ts @@ -19,6 +19,7 @@ import { Integer } from '@firebase/webchannel-wrapper/bloom-blob'; import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; +import { compareUtf8Strings, primitiveComparator } from '../util/misc'; export const DOCUMENT_KEY_NAME = '__name__'; @@ -181,7 +182,7 @@ abstract class BasePath> { return comparison; } } - return Math.sign(p1.length - p2.length); + return primitiveComparator(p1.length, p2.length); } private static compareSegments(lhs: string, rhs: string): number { @@ -201,13 +202,7 @@ abstract class BasePath> { ); } else { // both non-numeric - if (lhs < rhs) { - return -1; - } - if (lhs > rhs) { - return 1; - } - return 0; + return compareUtf8Strings(lhs, rhs); } } diff --git a/packages/firestore/src/model/values.ts b/packages/firestore/src/model/values.ts index 1977767515e..30d8688b776 100644 --- a/packages/firestore/src/model/values.ts +++ b/packages/firestore/src/model/values.ts @@ -25,7 +25,11 @@ import { Value } from '../protos/firestore_proto_api'; import { fail } from '../util/assert'; -import { arrayEquals, primitiveComparator } from '../util/misc'; +import { + arrayEquals, + compareUtf8Strings, + primitiveComparator +} from '../util/misc'; import { forEach, objectSize } from '../util/obj'; import { isNegativeZero } from '../util/types'; @@ -251,7 +255,7 @@ export function valueCompare(left: Value, right: Value): number { getLocalWriteTime(right) ); case TypeOrder.StringValue: - return primitiveComparator(left.stringValue!, right.stringValue!); + return compareUtf8Strings(left.stringValue!, right.stringValue!); case TypeOrder.BlobValue: return compareBlobs(left.bytesValue!, right.bytesValue!); case TypeOrder.RefValue: @@ -400,7 +404,7 @@ function compareMaps(left: MapValue, right: MapValue): number { rightKeys.sort(); for (let i = 0; i < leftKeys.length && i < rightKeys.length; ++i) { - const keyCompare = primitiveComparator(leftKeys[i], rightKeys[i]); + const keyCompare = compareUtf8Strings(leftKeys[i], rightKeys[i]); if (keyCompare !== 0) { return keyCompare; } diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index acaff77abb6..42fa568835b 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -16,6 +16,7 @@ */ import { randomBytes } from '../platform/random_bytes'; +import { newTextEncoder } from '../platform/text_serializer'; import { debugAssert } from './assert'; @@ -74,6 +75,67 @@ export interface Equatable { isEqual(other: T): boolean; } +/** Compare strings in UTF-8 encoded byte order */ +export function compareUtf8Strings(left: string, right: string): number { + let i = 0; + while (i < left.length && i < right.length) { + const leftCodePoint = left.codePointAt(i)!; + const rightCodePoint = right.codePointAt(i)!; + + if (leftCodePoint !== rightCodePoint) { + if (leftCodePoint < 128 && rightCodePoint < 128) { + // ASCII comparison + return primitiveComparator(leftCodePoint, rightCodePoint); + } else { + // Lazy instantiate TextEncoder + const encoder = newTextEncoder(); + + // UTF-8 encode the character at index i for byte comparison. + const leftBytes = encoder.encode(getUtf8SafeSubstring(left, i)); + const rightBytes = encoder.encode(getUtf8SafeSubstring(right, i)); + + const comp = compareByteArrays(leftBytes, rightBytes); + if (comp !== 0) { + return comp; + } else { + // EXTREMELY RARE CASE: Code points differ, but their UTF-8 byte + // representations are identical. This can happen with malformed input + // (invalid surrogate pairs). The backend also actively prevents invalid + // surrogates as INVALID_ARGUMENT errors, so we almost never receive + // invalid strings from backend. + // Fallback to code point comparison for graceful handling. + return primitiveComparator(leftCodePoint, rightCodePoint); + } + } + } + // Increment by 2 for surrogate pairs, 1 otherwise + i += leftCodePoint > 0xffff ? 2 : 1; + } + + // Compare lengths if all characters are equal + return primitiveComparator(left.length, right.length); +} + +function getUtf8SafeSubstring(str: string, index: number): string { + const firstCodePoint = str.codePointAt(index)!; + if (firstCodePoint > 0xffff) { + // It's a surrogate pair, return the whole pair + return str.substring(index, index + 2); + } else { + // It's a single code point, return it + return str.substring(index, index + 1); + } +} + +function compareByteArrays(left: Uint8Array, right: Uint8Array): number { + for (let i = 0; i < left.length && i < right.length; ++i) { + if (left[i] !== right[i]) { + return primitiveComparator(left[i], right[i]); + } + } + return primitiveComparator(left.length, right.length); +} + export interface Iterable { forEach: (cb: (v: V) => void) => void; } diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 1cda49d9229..8cbe99b3cd9 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -2424,4 +2424,243 @@ apiDescribe('Database', persistence => { }); }); }); + + describe('Sort unicode strings', () => { + const expectedDocs = [ + 'b', + 'a', + 'h', + 'i', + 'c', + 'f', + 'e', + 'd', + 'g', + 'k', + 'j' + ]; + it('snapshot listener sorts unicode strings the same as server', async () => { + const testDocs = { + 'a': { value: 'Łukasiewicz' }, + 'b': { value: 'Sierpiński' }, + 'c': { value: '岩澤' }, + 'd': { value: '🄟' }, + 'e': { value: 'P' }, + 'f': { value: '︒' }, + 'g': { value: '🐵' }, + 'h': { value: '你好' }, + 'i': { value: '你顥' }, + 'j': { value: '😁' }, + 'k': { value: '😀' } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in array the same as server', async () => { + const testDocs = { + 'a': { value: ['Łukasiewicz'] }, + 'b': { value: ['Sierpiński'] }, + 'c': { value: ['岩澤'] }, + 'd': { value: ['🄟'] }, + 'e': { value: ['P'] }, + 'f': { value: ['︒'] }, + 'g': { value: ['🐵'] }, + 'h': { value: ['你好'] }, + 'i': { value: ['你顥'] }, + 'j': { value: ['😁'] }, + 'k': { value: ['😀'] } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in map the same as server', async () => { + const testDocs = { + 'a': { value: { foo: 'Łukasiewicz' } }, + 'b': { value: { foo: 'Sierpiński' } }, + 'c': { value: { foo: '岩澤' } }, + 'd': { value: { foo: '🄟' } }, + 'e': { value: { foo: 'P' } }, + 'f': { value: { foo: '︒' } }, + 'g': { value: { foo: '🐵' } }, + 'h': { value: { foo: '你好' } }, + 'i': { value: { foo: '你顥' } }, + 'j': { value: { foo: '😁' } }, + 'k': { value: { foo: '😀' } } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in map key the same as server', async () => { + const testDocs = { + 'a': { value: { 'Łukasiewicz': true } }, + 'b': { value: { 'Sierpiński': true } }, + 'c': { value: { '岩澤': true } }, + 'd': { value: { '🄟': true } }, + 'e': { value: { 'P': true } }, + 'f': { value: { '︒': true } }, + 'g': { value: { '🐵': true } }, + 'h': { value: { '你好': true } }, + 'i': { value: { '你顥': true } }, + 'j': { value: { '😁': true } }, + 'k': { value: { '😀': true } } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + it('snapshot listener sorts unicode strings in document key the same as server', async () => { + const testDocs = { + 'Łukasiewicz': { value: true }, + 'Sierpiński': { value: true }, + '岩澤': { value: true }, + '🄟': { value: true }, + 'P': { value: true }, + '︒': { value: true }, + '🐵': { value: true }, + '你好': { value: true }, + '你顥': { value: true }, + '😁': { value: true }, + '😀': { value: true } + }; + + return withTestCollection(persistence, testDocs, async collectionRef => { + const orderedQuery = query(collectionRef, orderBy(documentId())); + + const getSnapshot = await getDocsFromServer(orderedQuery); + const expectedDocs = [ + 'Sierpiński', + 'Łukasiewicz', + '你好', + '你顥', + '岩澤', + '︒', + 'P', + '🄟', + '🐵', + '😀', + '😁' + ]; + expect(toIds(getSnapshot)).to.deep.equal(expectedDocs); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + + await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + }); + }); + + // eslint-disable-next-line no-restricted-properties + (persistence.storage === 'indexeddb' ? it.skip : it)( + 'snapshot listener sorts unicode strings in document key the same as server with persistence', + async () => { + const testDocs = { + 'Łukasiewicz': { value: true }, + 'Sierpiński': { value: true }, + '岩澤': { value: true }, + '🄟': { value: true }, + 'P': { value: true }, + '︒': { value: true }, + '🐵': { value: true }, + '你好': { value: true }, + '你顥': { value: true }, + '😁': { value: true }, + '😀': { value: true } + }; + + return withTestCollection( + persistence, + testDocs, + async collectionRef => { + const orderedQuery = query(collectionRef, orderBy('value')); + + const getSnapshot = await getDocsFromServer(orderedQuery); + expect(toIds(getSnapshot)).to.deep.equal([ + 'Sierpiński', + 'Łukasiewicz', + '你好', + '你顥', + '岩澤', + '︒', + 'P', + '🄟', + '🐵', + '😀', + '😁' + ]); + + const storeEvent = new EventsAccumulator(); + const unsubscribe = onSnapshot(orderedQuery, storeEvent.storeEvent); + const watchSnapshot = await storeEvent.awaitEvent(); + // TODO: IndexedDB sorts string lexicographically, and misses the document with ID '🄟','🐵' + expect(toIds(watchSnapshot)).to.deep.equal(toIds(getSnapshot)); + + unsubscribe(); + } + ); + } + ); + }); }); diff --git a/packages/firestore/test/unit/util/misc.test.ts b/packages/firestore/test/unit/util/misc.test.ts index cc75419c026..0829259a8e8 100644 --- a/packages/firestore/test/unit/util/misc.test.ts +++ b/packages/firestore/test/unit/util/misc.test.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import { debugCast } from '../../../src/util/assert'; -import { immediateSuccessor } from '../../../src/util/misc'; +import { compareUtf8Strings, immediateSuccessor } from '../../../src/util/misc'; import { mask } from '../../util/helpers'; describe('immediateSuccessor', () => { @@ -53,3 +53,227 @@ describe('FieldMask', () => { ); }); }); + +describe('CompareUtf8Strings', () => { + it('compareUtf8Strings should return correct results', () => { + const errors = []; + const seed = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); + let passCount = 0; + const stringGenerator = new StringGenerator(new Random(seed), 0.33, 20); + const stringPairGenerator = new StringPairGenerator(stringGenerator); + + for (let i = 0; i < 1000000 && errors.length < 10; i++) { + const { s1, s2 } = stringPairGenerator.next(); + + const actual = compareUtf8Strings(s1, s2); + const expected = Buffer.from(s1, 'utf8').compare(Buffer.from(s2, 'utf8')); + + if (actual === expected) { + passCount++; + } else { + errors.push( + `compareUtf8Strings(s1="${s1}", s2="${s2}") returned ${actual}, ` + + `but expected ${expected} (i=${i}, s1.length=${s1.length}, s2.length=${s2.length})` + ); + } + } + + if (errors.length > 0) { + console.error( + `${errors.length} test cases failed, ${passCount} test cases passed, seed=${seed};` + ); + errors.forEach((error, index) => + console.error(`errors[${index}]: ${error}`) + ); + throw new Error('Test failed'); + } + }).timeout(20000); + + class StringPair { + constructor(readonly s1: string, readonly s2: string) {} + } + + class StringPairGenerator { + constructor(private stringGenerator: StringGenerator) {} + + next(): StringPair { + const prefix = this.stringGenerator.next(); + const s1 = prefix + this.stringGenerator.next(); + const s2 = prefix + this.stringGenerator.next(); + return new StringPair(s1, s2); + } + } + + class StringGenerator { + private static readonly DEFAULT_SURROGATE_PAIR_PROBABILITY = 0.33; + private static readonly DEFAULT_MAX_LENGTH = 20; + + // Pseudo-random number generator. Seed can be set for repeatable tests. + private readonly rnd: Random; + private readonly surrogatePairProbability: number; + private readonly maxLength: number; + + constructor(seed: number); + constructor( + rnd: Random, + surrogatePairProbability: number, + maxLength: number + ); + constructor( + seedOrRnd: number | Random, + surrogatePairProbability?: number, + maxLength?: number + ) { + if (typeof seedOrRnd === 'number') { + this.rnd = new Random(seedOrRnd); + this.surrogatePairProbability = + StringGenerator.DEFAULT_SURROGATE_PAIR_PROBABILITY; + this.maxLength = StringGenerator.DEFAULT_MAX_LENGTH; + } else { + this.rnd = seedOrRnd; + this.surrogatePairProbability = StringGenerator.validateProbability( + surrogatePairProbability! + ); + this.maxLength = StringGenerator.validateLength(maxLength!); + } + } + + private static validateProbability(probability: number): number { + if (!Number.isFinite(probability)) { + throw new Error( + `invalid surrogate pair probability: ${probability} (must be between 0.0 and 1.0, inclusive)` + ); + } else if (probability < 0.0) { + throw new Error( + `invalid surrogate pair probability: ${probability} (must be greater than or equal to zero)` + ); + } else if (probability > 1.0) { + throw new Error( + `invalid surrogate pair probability: ${probability} (must be less than or equal to 1)` + ); + } + return probability; + } + + private static validateLength(length: number): number { + if (length < 0) { + throw new Error( + `invalid maximum string length: ${length} (must be greater than or equal to zero)` + ); + } + return length; + } + + next(): string { + const length = this.rnd.nextInt(this.maxLength + 1); + const sb = new StringBuilder(); + while (sb.length() < length) { + const codePoint = this.nextCodePoint(); + sb.appendCodePoint(codePoint); + } + return sb.toString(); + } + + private isNextSurrogatePair(): boolean { + return StringGenerator.nextBoolean( + this.rnd, + this.surrogatePairProbability + ); + } + + private static nextBoolean(rnd: Random, probability: number): boolean { + if (probability === 0.0) { + return false; + } else if (probability === 1.0) { + return true; + } else { + return rnd.nextFloat() < probability; + } + } + + private nextCodePoint(): number { + if (this.isNextSurrogatePair()) { + return this.nextSurrogateCodePoint(); + } else { + return this.nextNonSurrogateCodePoint(); + } + } + + private nextSurrogateCodePoint(): number { + const highSurrogateMin = 0xd800; + const highSurrogateMax = 0xdbff; + const lowSurrogateMin = 0xdc00; + const lowSurrogateMax = 0xdfff; + + const highSurrogate = this.nextCodePointRange( + highSurrogateMin, + highSurrogateMax + ); + const lowSurrogate = this.nextCodePointRange( + lowSurrogateMin, + lowSurrogateMax + ); + + return ( + (highSurrogate - 0xd800) * 0x400 + (lowSurrogate - 0xdc00) + 0x10000 + ); + } + + private nextNonSurrogateCodePoint(): number { + let codePoint; + do { + codePoint = this.nextCodePointRange(0, 0xffff); // BMP range + } while (codePoint >= 0xd800 && codePoint <= 0xdfff); // Exclude surrogate range + + return codePoint; + } + + private nextCodePointRange(min: number, max: number): number { + const rangeSize = max - min + 1; + const offset = this.rnd.nextInt(rangeSize); + return min + offset; + } + } + + class Random { + private seed: number; + + constructor(seed: number) { + this.seed = seed; + } + + nextInt(max: number): number { + // Update the seed with pseudo-randomized numbers using a Linear Congruential Generator (LCG). + this.seed = (this.seed * 9301 + 49297) % 233280; + const rnd = this.seed / 233280; + return Math.floor(rnd * max); + } + + nextFloat(): number { + this.seed = (this.seed * 9301 + 49297) % 233280; + return this.seed / 233280; + } + } + + class StringBuilder { + private buffer: string[] = []; + + append(str: string): StringBuilder { + this.buffer.push(str); + return this; + } + + appendCodePoint(codePoint: number): StringBuilder { + this.buffer.push(String.fromCodePoint(codePoint)); + return this; + } + + toString(): string { + return this.buffer.join(''); + } + + length(): number { + return this.buffer.join('').length; + } + } +}); From a512bc655463cf7aaa99b454aca97ecf157b83c0 Mon Sep 17 00:00:00 2001 From: David Motsonashvili Date: Mon, 17 Mar 2025 20:53:27 +0000 Subject: [PATCH 134/295] fix golden files test (#8843) * fix golden files test * update responses version --------- Co-authored-by: David Motsonashvili --- packages/vertexai/test-utils/convert-mocks.ts | 2 +- scripts/update_vertexai_responses.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vertexai/test-utils/convert-mocks.ts b/packages/vertexai/test-utils/convert-mocks.ts index a6790b98fbc..c306bec312f 100644 --- a/packages/vertexai/test-utils/convert-mocks.ts +++ b/packages/vertexai/test-utils/convert-mocks.ts @@ -27,7 +27,7 @@ const { join } = require('path'); const mockResponseDir = join( __dirname, - 'vertexai-sdk-test-data/mock-responses' + 'vertexai-sdk-test-data/mock-responses/vertexai' ); async function main(): Promise { diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index 20b9082861e..0d1f1a2c6f6 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v6.*' # The major version of mock responses to use +RESPONSES_VERSION='v7.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From 95b4fc69d8e85991e6da20e4bf68d54d4e6741d6 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 17 Mar 2025 16:05:00 -0700 Subject: [PATCH 135/295] Surface all App Check errors in public getToken() method (#8842) --- .changeset/fluffy-otters-whisper.md | 5 +++++ packages/app-check/src/api.ts | 3 +++ packages/app-check/src/errors.ts | 5 ++++- packages/app-check/src/internal-api.test.ts | 8 +++----- packages/app-check/src/internal-api.ts | 20 +++++++++++++------- packages/app-check/src/providers.ts | 4 ++-- 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 .changeset/fluffy-otters-whisper.md diff --git a/.changeset/fluffy-otters-whisper.md b/.changeset/fluffy-otters-whisper.md new file mode 100644 index 00000000000..863b608875b --- /dev/null +++ b/.changeset/fluffy-otters-whisper.md @@ -0,0 +1,5 @@ +--- +'@firebase/app-check': patch +--- + +Improve error handling in AppCheck. The publicly-exported `getToken()` will now throw `internalError` strings it was previously ignoring. diff --git a/packages/app-check/src/api.ts b/packages/app-check/src/api.ts index e6897320be1..a4dd87a4e77 100644 --- a/packages/app-check/src/api.ts +++ b/packages/app-check/src/api.ts @@ -209,6 +209,9 @@ export async function getToken( if (result.error) { throw result.error; } + if (result.internalError) { + throw result.internalError; + } return { token: result.token }; } diff --git a/packages/app-check/src/errors.ts b/packages/app-check/src/errors.ts index c6f088b371b..ca5a60aed6b 100644 --- a/packages/app-check/src/errors.ts +++ b/packages/app-check/src/errors.ts @@ -27,6 +27,7 @@ export const enum AppCheckError { STORAGE_GET = 'storage-get', STORAGE_WRITE = 'storage-set', RECAPTCHA_ERROR = 'recaptcha-error', + INITIAL_THROTTLE = 'initial-throttle', THROTTLED = 'throttled' } @@ -54,7 +55,8 @@ const ERRORS: ErrorMap = { [AppCheckError.STORAGE_WRITE]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.', [AppCheckError.RECAPTCHA_ERROR]: 'ReCAPTCHA error.', - [AppCheckError.THROTTLED]: `Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}` + [AppCheckError.INITIAL_THROTTLE]: `{$httpStatus} error. Attempts allowed again after {$time}`, + [AppCheckError.THROTTLED]: `Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}` }; interface ErrorParams { @@ -66,6 +68,7 @@ interface ErrorParams { [AppCheckError.STORAGE_OPEN]: { originalErrorMessage?: string }; [AppCheckError.STORAGE_GET]: { originalErrorMessage?: string }; [AppCheckError.STORAGE_WRITE]: { originalErrorMessage?: string }; + [AppCheckError.INITIAL_THROTTLE]: { time: string; httpStatus: number }; [AppCheckError.THROTTLED]: { time: string; httpStatus: number }; } diff --git a/packages/app-check/src/internal-api.test.ts b/packages/app-check/src/internal-api.test.ts index 1e43a5e7e21..5d6b88f1c32 100644 --- a/packages/app-check/src/internal-api.test.ts +++ b/packages/app-check/src/internal-api.test.ts @@ -163,7 +163,7 @@ describe('internal api', () => { const error = new Error('oops, something went wrong'); stub(client, 'exchangeToken').returns(Promise.reject(error)); - const token = await getToken(appCheck as AppCheckService); + const token = await getToken(appCheck as AppCheckService, false, true); expect(reCAPTCHASpy).to.be.called; expect(token).to.deep.equal({ @@ -186,7 +186,7 @@ describe('internal api', () => { const error = new Error('oops, something went wrong'); stub(client, 'exchangeToken').returns(Promise.reject(error)); - const token = await getToken(appCheck as AppCheckService); + const token = await getToken(appCheck as AppCheckService, false, true); expect(token).to.deep.equal({ token: formatDummyToken(defaultTokenErrorData), @@ -208,7 +208,7 @@ describe('internal api', () => { const reCAPTCHASpy = stubGetRecaptchaToken('', false); const exchangeTokenStub = stub(client, 'exchangeToken'); - const token = await getToken(appCheck as AppCheckService); + const token = await getToken(appCheck as AppCheckService, false, true); expect(reCAPTCHASpy).to.be.called; expect(exchangeTokenStub).to.not.be.called; @@ -290,7 +290,6 @@ describe('internal api', () => { }); it('calls 3P error handler if there is an error getting a token', async () => { - stub(console, 'error'); const appCheck = initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), isTokenAutoRefreshEnabled: true @@ -314,7 +313,6 @@ describe('internal api', () => { }); it('ignores listeners that throw', async () => { - stub(console, 'error'); const appCheck = initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), isTokenAutoRefreshEnabled: true diff --git a/packages/app-check/src/internal-api.ts b/packages/app-check/src/internal-api.ts index 4eb3953614a..eddf043c843 100644 --- a/packages/app-check/src/internal-api.ts +++ b/packages/app-check/src/internal-api.ts @@ -60,7 +60,8 @@ export function formatDummyToken( */ export async function getToken( appCheck: AppCheckService, - forceRefresh = false + forceRefresh = false, + shouldLogErrors = false ): Promise { const app = appCheck.app; ensureActivated(app); @@ -136,11 +137,14 @@ export async function getToken( state.token = tokenFromDebugExchange; return { token: tokenFromDebugExchange.token }; } catch (e) { - if ((e as FirebaseError).code === `appCheck/${AppCheckError.THROTTLED}`) { + if ( + (e as FirebaseError).code === `appCheck/${AppCheckError.THROTTLED}` || + (e as FirebaseError).code === + `appCheck/${AppCheckError.INITIAL_THROTTLE}` + ) { // Warn if throttled, but do not treat it as an error. logger.warn((e as FirebaseError).message); - } else { - // `getToken()` should never throw, but logging error text to console will aid debugging. + } else if (shouldLogErrors) { logger.error(e); } // Return dummy token and error @@ -167,11 +171,13 @@ export async function getToken( } token = await getStateReference(app).exchangeTokenPromise; } catch (e) { - if ((e as FirebaseError).code === `appCheck/${AppCheckError.THROTTLED}`) { + if ( + (e as FirebaseError).code === `appCheck/${AppCheckError.THROTTLED}` || + (e as FirebaseError).code === `appCheck/${AppCheckError.INITIAL_THROTTLE}` + ) { // Warn if throttled, but do not treat it as an error. logger.warn((e as FirebaseError).message); - } else { - // `getToken()` should never throw, but logging error text to console will aid debugging. + } else if (shouldLogErrors) { logger.error(e); } // Always save error to be added to dummy token. diff --git a/packages/app-check/src/providers.ts b/packages/app-check/src/providers.ts index 55ab598b5e9..e8d2eb5af5f 100644 --- a/packages/app-check/src/providers.ts +++ b/packages/app-check/src/providers.ts @@ -92,7 +92,7 @@ export class ReCaptchaV3Provider implements AppCheckProvider { Number((e as FirebaseError).customData?.httpStatus), this._throttleData ); - throw ERROR_FACTORY.create(AppCheckError.THROTTLED, { + throw ERROR_FACTORY.create(AppCheckError.INITIAL_THROTTLE, { time: getDurationString( this._throttleData.allowRequestsAfter - Date.now() ), @@ -185,7 +185,7 @@ export class ReCaptchaEnterpriseProvider implements AppCheckProvider { Number((e as FirebaseError).customData?.httpStatus), this._throttleData ); - throw ERROR_FACTORY.create(AppCheckError.THROTTLED, { + throw ERROR_FACTORY.create(AppCheckError.INITIAL_THROTTLE, { time: getDurationString( this._throttleData.allowRequestsAfter - Date.now() ), From cf3c8fb2affffc8f055eed9265b3d5ba4df86185 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 18 Mar 2025 10:33:34 -0400 Subject: [PATCH 136/295] Grant Create PR workflow pull-request write perms. (#8846) Our staging release workflow failed to create a Version Packages PR. Grant the PR creation workflow `pull-request` `write` permissions. --- .github/workflows/release-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index ddfff2ed8eb..e75ff890f42 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -24,6 +24,8 @@ jobs: release: name: Create Release PR runs-on: ubuntu-latest + permissions: + pull-requests: write if: ${{ !startsWith(github.event.head_commit.message, 'Version Packages (#') }} steps: - name: Checkout Repo From e8865f241e25e6c561f5d956a42a8748fc6e32b4 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 18 Mar 2025 11:08:52 -0400 Subject: [PATCH 137/295] Grant Create PR content write permissions. (#8848) Our staging release workflow failed to merge branch. Grant the PR creation workflow `content` `write` permissions to fix this. --- .github/workflows/release-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index e75ff890f42..a999258a882 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -26,6 +26,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + contents: write if: ${{ !startsWith(github.event.head_commit.message, 'Version Packages (#') }} steps: - name: Checkout Repo From 202c7328f606aaace254804b361d8c4e0187db3d Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 20 Mar 2025 07:00:49 -0700 Subject: [PATCH 138/295] Version Packages (#8849) - v11.5.0 Release version 11.5.0. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/chilly-parrots-remember.md | 5 ----- .changeset/floppy-schools-battle.md | 6 ----- .changeset/fluffy-otters-whisper.md | 5 ----- .changeset/large-pants-hide.md | 6 ----- .changeset/silver-jeans-sell.md | 7 ------ .changeset/stupid-apples-shave.md | 6 ----- .changeset/tricky-actors-exercise.md | 5 ----- integration/compat-interop/package.json | 8 +++---- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/CHANGELOG.md | 7 ++++++ packages/app-check-compat/package.json | 6 ++--- packages/app-check/CHANGELOG.md | 6 +++++ packages/app-check/package.json | 4 ++-- packages/app-compat/CHANGELOG.md | 7 ++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 +++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/CHANGELOG.md | 6 +++++ packages/data-connect/package.json | 4 ++-- packages/database-compat/CHANGELOG.md | 10 +++++++++ packages/database-compat/package.json | 8 +++---- packages/database-types/CHANGELOG.md | 6 +++++ packages/database-types/package.json | 2 +- packages/database/CHANGELOG.md | 6 +++++ packages/database/package.json | 4 ++-- packages/firebase/CHANGELOG.md | 26 ++++++++++++++++++++++ packages/firebase/package.json | 26 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 7 ++++++ packages/firestore-compat/package.json | 6 ++--- packages/firestore/CHANGELOG.md | 6 +++++ packages/firestore/package.json | 6 ++--- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/CHANGELOG.md | 7 ++++++ packages/performance-compat/package.json | 6 ++--- packages/performance/CHANGELOG.md | 6 +++++ packages/performance/package.json | 4 ++-- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 +++++++ packages/vertexai/package.json | 4 ++-- repo-scripts/size-analysis/package.json | 2 +- 54 files changed, 180 insertions(+), 106 deletions(-) delete mode 100644 .changeset/chilly-parrots-remember.md delete mode 100644 .changeset/floppy-schools-battle.md delete mode 100644 .changeset/fluffy-otters-whisper.md delete mode 100644 .changeset/large-pants-hide.md delete mode 100644 .changeset/silver-jeans-sell.md delete mode 100644 .changeset/stupid-apples-shave.md delete mode 100644 .changeset/tricky-actors-exercise.md diff --git a/.changeset/chilly-parrots-remember.md b/.changeset/chilly-parrots-remember.md deleted file mode 100644 index aaf0d766b44..00000000000 --- a/.changeset/chilly-parrots-remember.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': minor ---- - -Add `systemInstruction`, `tools`, and `generationConfig` to `CountTokensRequest`. diff --git a/.changeset/floppy-schools-battle.md b/.changeset/floppy-schools-battle.md deleted file mode 100644 index 499b04a6672..00000000000 --- a/.changeset/floppy-schools-battle.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/performance': patch -'firebase': patch ---- - -Modify the retry mechanism to stop when remaining tries is less than or equal to zero, improving the robustness of the retry handling. diff --git a/.changeset/fluffy-otters-whisper.md b/.changeset/fluffy-otters-whisper.md deleted file mode 100644 index 863b608875b..00000000000 --- a/.changeset/fluffy-otters-whisper.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/app-check': patch ---- - -Improve error handling in AppCheck. The publicly-exported `getToken()` will now throw `internalError` strings it was previously ignoring. diff --git a/.changeset/large-pants-hide.md b/.changeset/large-pants-hide.md deleted file mode 100644 index fbaf7bd6008..00000000000 --- a/.changeset/large-pants-hide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Use lazy encoding in UTF-8 encoded byte comparison for strings. diff --git a/.changeset/silver-jeans-sell.md b/.changeset/silver-jeans-sell.md deleted file mode 100644 index bf479c302ec..00000000000 --- a/.changeset/silver-jeans-sell.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@firebase/database-compat': patch -'@firebase/database-types': patch -'@firebase/database': patch ---- - -Added non-null parent properties to ThenableReference diff --git a/.changeset/stupid-apples-shave.md b/.changeset/stupid-apples-shave.md deleted file mode 100644 index a76a3808056..00000000000 --- a/.changeset/stupid-apples-shave.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/vertexai': minor -'firebase': minor ---- - -Added missing `BlockReason` and `FinishReason` enum values. diff --git a/.changeset/tricky-actors-exercise.md b/.changeset/tricky-actors-exercise.md deleted file mode 100644 index 10529ac4268..00000000000 --- a/.changeset/tricky-actors-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/data-connect': patch ---- - -Update requests to point to v1 backend endpoints instead of v1beta diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 45a2eac48e0..db385ad752e 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.2", - "@firebase/app-compat": "0.2.51", + "@firebase/app": "0.11.3", + "@firebase/app-compat": "0.2.52", "@firebase/analytics": "0.10.12", "@firebase/analytics-compat": "0.2.18", "@firebase/auth": "1.9.1", @@ -18,8 +18,8 @@ "@firebase/functions-compat": "0.3.20", "@firebase/messaging": "0.12.17", "@firebase/messaging-compat": "0.2.17", - "@firebase/performance": "0.7.1", - "@firebase/performance-compat": "0.2.14", + "@firebase/performance": "0.7.2", + "@firebase/performance-compat": "0.2.15", "@firebase/remote-config": "0.6.0", "@firebase/remote-config-compat": "0.2.13" }, diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 0260c334f8e..d8f81836d4a 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.2", - "@firebase/firestore": "4.7.9" + "@firebase/app": "0.11.3", + "@firebase/firestore": "4.7.10" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 50ce3f35990..ef2ab5fd5ed 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.4.0", + "firebase": "11.5.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index f4343e8ac01..ca8656040b5 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index f1f051addc9..09cce6f33fe 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 5616d3aa783..a5ca70adbc6 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-check-compat +## 0.3.20 + +### Patch Changes + +- Updated dependencies [[`95b4fc6`](https://github.com/firebase/firebase-js-sdk/commit/95b4fc69d8e85991e6da20e4bf68d54d4e6741d6)]: + - @firebase/app-check@0.8.13 + ## 0.3.19 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 56c75410973..a7c2c9346a1 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.19", + "version": "0.3.20", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,7 +34,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.12", + "@firebase/app-check": "0.8.13", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.0", @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 0f0d2e1a770..a2afaa1b23a 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app-check +## 0.8.13 + +### Patch Changes + +- [`95b4fc6`](https://github.com/firebase/firebase-js-sdk/commit/95b4fc69d8e85991e6da20e4bf68d54d4e6741d6) [#8842](https://github.com/firebase/firebase-js-sdk/pull/8842) (fixes [#8822](https://github.com/firebase/firebase-js-sdk/issues/8822)) - Improve error handling in AppCheck. The publicly-exported `getToken()` will now throw `internalError` strings it was previously ignoring. + ## 0.8.12 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 0d4fbc7fb23..8e93dcb6903 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.8.12", + "version": "0.8.13", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index b54dbee267d..bb9c154cc68 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.52 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.11.3 + ## 0.2.51 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 12ca0859fd9..5a425bdcc99 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.51", + "version": "0.2.52", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.13", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 43d61c6ab40..229f3693259 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.11.3 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.11.2 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index e1b166b852a..25931fc07ff 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.2", + "version": "0.11.3", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 38f41ac4a19..af1a6f3016c 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index d7a21c7124d..cfa5c0d5f4d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 74d3dae80d6..83b4b1c9e19 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +## 0.3.2 + +### Patch Changes + +- [`43d6b67`](https://github.com/firebase/firebase-js-sdk/commit/43d6b6735f8b1d20dbe33793b57adb221efde95d) [#8820](https://github.com/firebase/firebase-js-sdk/pull/8820) - Update requests to point to v1 backend endpoints instead of v1beta + ## 0.3.1 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index df823a05e96..5001a68abd4 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.1", + "version": "0.3.2", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 2b316da4186..8cd7d96b5a4 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.5 + +### Patch Changes + +- [`113c965`](https://github.com/firebase/firebase-js-sdk/commit/113c965a34d9d7219d236f1b2cb62029e0f80fda) [#8800](https://github.com/firebase/firebase-js-sdk/pull/8800) - Added non-null parent properties to ThenableReference + +- Updated dependencies [[`113c965`](https://github.com/firebase/firebase-js-sdk/commit/113c965a34d9d7219d236f1b2cb62029e0f80fda)]: + - @firebase/database-types@1.0.10 + - @firebase/database@1.0.14 + ## 2.0.4 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 358dcca1fc1..faf6cc727ac 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.4", + "version": "2.0.5", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.13", - "@firebase/database-types": "1.0.9", + "@firebase/database": "1.0.14", + "@firebase/database-types": "1.0.10", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.0", "@firebase/component": "0.6.13", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index f2b13db80d4..6292941e87e 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/database-types +## 1.0.10 + +### Patch Changes + +- [`113c965`](https://github.com/firebase/firebase-js-sdk/commit/113c965a34d9d7219d236f1b2cb62029e0f80fda) [#8800](https://github.com/firebase/firebase-js-sdk/pull/8800) - Added non-null parent properties to ThenableReference + ## 1.0.9 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 15bb0d98f89..4a4995377fe 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.9", + "version": "1.0.10", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 7d85cec55b0..451201ee462 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,11 @@ # Unreleased +## 1.0.14 + +### Patch Changes + +- [`113c965`](https://github.com/firebase/firebase-js-sdk/commit/113c965a34d9d7219d236f1b2cb62029e0f80fda) [#8800](https://github.com/firebase/firebase-js-sdk/pull/8800) - Added non-null parent properties to ThenableReference + ## 1.0.13 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 5f727d7376f..6c7fcecec8a 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.13", + "version": "1.0.14", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 4e3d4760021..8cf632f0592 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,31 @@ # firebase +## 11.5.0 + +### Minor Changes + +- [`058afa2`](https://github.com/firebase/firebase-js-sdk/commit/058afa280c8e9a72e27f3b1fbdb2921012dc65d3) [#8741](https://github.com/firebase/firebase-js-sdk/pull/8741) - Added missing `BlockReason` and `FinishReason` enum values. + +### Patch Changes + +- [`5611175`](https://github.com/firebase/firebase-js-sdk/commit/5611175975deb8d39eb1387a7ef083120f12c8b5) [#8814](https://github.com/firebase/firebase-js-sdk/pull/8814) (fixes [#8813](https://github.com/firebase/firebase-js-sdk/issues/8813)) - Modify the retry mechanism to stop when remaining tries is less than or equal to zero, improving the robustness of the retry handling. + +- [`feb2c9d`](https://github.com/firebase/firebase-js-sdk/commit/feb2c9dfa29c9dff01c1272e56f6258176dc6b3a) [#8787](https://github.com/firebase/firebase-js-sdk/pull/8787) - Use lazy encoding in UTF-8 encoded byte comparison for strings. + +- Updated dependencies [[`25985ac`](https://github.com/firebase/firebase-js-sdk/commit/25985ac3c3a797160e2dc3a2a28aba9f63fe6dfd), [`5611175`](https://github.com/firebase/firebase-js-sdk/commit/5611175975deb8d39eb1387a7ef083120f12c8b5), [`95b4fc6`](https://github.com/firebase/firebase-js-sdk/commit/95b4fc69d8e85991e6da20e4bf68d54d4e6741d6), [`feb2c9d`](https://github.com/firebase/firebase-js-sdk/commit/feb2c9dfa29c9dff01c1272e56f6258176dc6b3a), [`113c965`](https://github.com/firebase/firebase-js-sdk/commit/113c965a34d9d7219d236f1b2cb62029e0f80fda), [`058afa2`](https://github.com/firebase/firebase-js-sdk/commit/058afa280c8e9a72e27f3b1fbdb2921012dc65d3), [`43d6b67`](https://github.com/firebase/firebase-js-sdk/commit/43d6b6735f8b1d20dbe33793b57adb221efde95d)]: + - @firebase/app@0.11.3 + - @firebase/vertexai@1.2.0 + - @firebase/performance@0.7.2 + - @firebase/app-check@0.8.13 + - @firebase/firestore@4.7.10 + - @firebase/database-compat@2.0.5 + - @firebase/database@1.0.14 + - @firebase/data-connect@0.3.2 + - @firebase/app-compat@0.2.52 + - @firebase/performance-compat@0.2.15 + - @firebase/app-check-compat@0.3.20 + - @firebase/firestore-compat@0.3.45 + ## 11.4.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index a5926569e42..34a28a22ff2 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.4.0", + "version": "11.5.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,16 +399,16 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.2", - "@firebase/app-compat": "0.2.51", + "@firebase/app": "0.11.3", + "@firebase/app-compat": "0.2.52", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.9.1", "@firebase/auth-compat": "0.5.19", - "@firebase/data-connect": "0.3.1", - "@firebase/database": "1.0.13", - "@firebase/database-compat": "2.0.4", - "@firebase/firestore": "4.7.9", - "@firebase/firestore-compat": "0.3.44", + "@firebase/data-connect": "0.3.2", + "@firebase/database": "1.0.14", + "@firebase/database-compat": "2.0.5", + "@firebase/firestore": "4.7.10", + "@firebase/firestore-compat": "0.3.45", "@firebase/functions": "0.12.3", "@firebase/functions-compat": "0.3.20", "@firebase/installations": "0.6.13", @@ -417,16 +417,16 @@ "@firebase/messaging-compat": "0.2.17", "@firebase/storage": "0.13.7", "@firebase/storage-compat": "0.3.17", - "@firebase/performance": "0.7.1", - "@firebase/performance-compat": "0.2.14", + "@firebase/performance": "0.7.2", + "@firebase/performance-compat": "0.2.15", "@firebase/remote-config": "0.6.0", "@firebase/remote-config-compat": "0.2.13", "@firebase/analytics": "0.10.12", "@firebase/analytics-compat": "0.2.18", - "@firebase/app-check": "0.8.12", - "@firebase/app-check-compat": "0.3.19", + "@firebase/app-check": "0.8.13", + "@firebase/app-check-compat": "0.3.20", "@firebase/util": "1.11.0", - "@firebase/vertexai": "1.1.0" + "@firebase/vertexai": "1.2.0" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index f1d401e6230..87b800344b4 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.45 + +### Patch Changes + +- Updated dependencies [[`feb2c9d`](https://github.com/firebase/firebase-js-sdk/commit/feb2c9dfa29c9dff01c1272e56f6258176dc6b3a)]: + - @firebase/firestore@4.7.10 + ## 0.3.44 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index f612b43452e..dfc7f2eec67 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.44", + "version": "0.3.45", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.6.13", - "@firebase/firestore": "4.7.9", + "@firebase/firestore": "4.7.10", "@firebase/util": "1.11.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 000946bb749..26128e8d56a 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/firestore +## 4.7.10 + +### Patch Changes + +- [`feb2c9d`](https://github.com/firebase/firebase-js-sdk/commit/feb2c9dfa29c9dff01c1272e56f6258176dc6b3a) [#8787](https://github.com/firebase/firebase-js-sdk/pull/8787) - Use lazy encoding in UTF-8 encoded byte comparison for strings. + ## 4.7.9 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index b16c447f957..64c2ea05f05 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.9", + "version": "4.7.10", "engines": { "node": ">=18.0.0" }, @@ -106,8 +106,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.2", - "@firebase/app-compat": "0.2.51", + "@firebase/app": "0.11.3", + "@firebase/app-compat": "0.2.52", "@firebase/auth": "1.9.1", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 313afd2ab3c..42586d56262 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 29478f4fdeb..9ff38c070c8 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 17f5e46a9f2..d6cc85dcd22 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index 94481a2ccb6..a6d0f1ca70b 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index a6b3ed9b648..d0dd25e9533 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 804d791df90..a2b61d6897e 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 37dd9587a59..0091e5fbb04 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/performance-compat +## 0.2.15 + +### Patch Changes + +- Updated dependencies [[`5611175`](https://github.com/firebase/firebase-js-sdk/commit/5611175975deb8d39eb1387a7ef083120f12c8b5)]: + - @firebase/performance@0.7.2 + ## 0.2.14 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 2d3c37f514e..9b26ccb1bcd 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.14", + "version": "0.2.15", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,7 +38,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.1", + "@firebase/performance": "0.7.2", "@firebase/performance-types": "0.2.3", "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.51" + "@firebase/app-compat": "0.2.52" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index 58eeb4b7be1..d58028ad104 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/performance +## 0.7.2 + +### Patch Changes + +- [`5611175`](https://github.com/firebase/firebase-js-sdk/commit/5611175975deb8d39eb1387a7ef083120f12c8b5) [#8814](https://github.com/firebase/firebase-js-sdk/pull/8814) (fixes [#8813](https://github.com/firebase/firebase-js-sdk/issues/8813)) - Modify the retry mechanism to stop when remaining tries is less than or equal to zero, improving the robustness of the retry handling. + ## 0.7.1 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 7a78ada7f3c..d74ca5e99a0 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.1", + "version": "0.7.2", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index b5059aeef9c..bcc00d572ea 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.51" + "@firebase/app-compat": "0.2.52" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 0e4d865fd15..e5abdc9b902 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index c8eafff2c22..d73fbe4c7e8 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.51", + "@firebase/app-compat": "0.2.52", "@firebase/auth-compat": "0.5.19", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index fe63e5f53c3..5fc360641bb 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "@firebase/auth": "1.9.1", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index e13c528956d..bffd2b64e97 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 9b92ce97b54..07d13335303 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.2.0 + +### Minor Changes + +- [`25985ac`](https://github.com/firebase/firebase-js-sdk/commit/25985ac3c3a797160e2dc3a2a28aba9f63fe6dfd) [#8827](https://github.com/firebase/firebase-js-sdk/pull/8827) - Add `systemInstruction`, `tools`, and `generationConfig` to `CountTokensRequest`. + +- [`058afa2`](https://github.com/firebase/firebase-js-sdk/commit/058afa280c8e9a72e27f3b1fbdb2921012dc65d3) [#8741](https://github.com/firebase/firebase-js-sdk/pull/8741) - Added missing `BlockReason` and `FinishReason` enum values. + ## 1.1.0 ### Minor Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index f26aa2ec2a7..20c21a2bfea 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.1.0", + "version": "1.2.0", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index c332723f484..ac88adff656 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.2", + "@firebase/app": "0.11.3", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.0", "@rollup/plugin-commonjs": "21.1.0", From faaeb48e0c9dfddd014e5fb52088d39c895e9874 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 20 Mar 2025 15:12:13 -0400 Subject: [PATCH 139/295] Deprecate `GroundingAttribution` (#8832) --- .changeset/tricky-geese-shout.md | 5 +++++ common/api-review/vertexai.api.md | 4 ++-- docs-devsite/vertexai.groundingattribution.md | 3 +++ docs-devsite/vertexai.groundingmetadata.md | 4 ++++ packages/vertexai/src/types/responses.ts | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .changeset/tricky-geese-shout.md diff --git a/.changeset/tricky-geese-shout.md b/.changeset/tricky-geese-shout.md new file mode 100644 index 00000000000..a0b70b4405c --- /dev/null +++ b/.changeset/tricky-geese-shout.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Label `GroundingAttribution` as deprecated. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index cfe2bcc4c66..f5aca03c1bd 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -352,7 +352,7 @@ export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParam // @public export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -// @public (undocumented) +// @public @deprecated (undocumented) export interface GroundingAttribution { // (undocumented) confidenceScore?: number; @@ -366,7 +366,7 @@ export interface GroundingAttribution { // @public export interface GroundingMetadata { - // (undocumented) + // @deprecated (undocumented) groundingAttributions: GroundingAttribution[]; // (undocumented) retrievalQueries?: string[]; diff --git a/docs-devsite/vertexai.groundingattribution.md b/docs-devsite/vertexai.groundingattribution.md index b72d8150635..b3a3b6257c3 100644 --- a/docs-devsite/vertexai.groundingattribution.md +++ b/docs-devsite/vertexai.groundingattribution.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GroundingAttribution interface +> Warning: This API is now obsolete. +> +> Signature: diff --git a/docs-devsite/vertexai.groundingmetadata.md b/docs-devsite/vertexai.groundingmetadata.md index 186f00d29a7..24686da39ba 100644 --- a/docs-devsite/vertexai.groundingmetadata.md +++ b/docs-devsite/vertexai.groundingmetadata.md @@ -28,6 +28,10 @@ export interface GroundingMetadata ## GroundingMetadata.groundingAttributions +> Warning: This API is now obsolete. +> +> + Signature: ```typescript diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 5685ed68ad6..437d33e9a47 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -153,10 +153,14 @@ export interface Citation { export interface GroundingMetadata { webSearchQueries?: string[]; retrievalQueries?: string[]; + /** + * @deprecated + */ groundingAttributions: GroundingAttribution[]; } /** + * @deprecated * @public */ export interface GroundingAttribution { From 14d97210c5d596a1785ab3dd93e32b0ddfbf79c0 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 20 Mar 2025 14:56:50 -0700 Subject: [PATCH 140/295] Stream full logs of test-all firestore job (#8851) --- .github/workflows/test-all.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index dabab3befda..dd74d2437e4 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -178,8 +178,7 @@ jobs: run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV - name: Run unit tests run: | - xvfb-run yarn lerna run test:ci --scope '@firebase/firestore*' - node scripts/print_test_logs.js + yarn lerna run test:all:ci --scope '@firebase/firestore*' --stream --concurrency 1 env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} EXPERIMENTAL_MODE: true From 571883817e8b771fa506f59587c4ee31b8ddd41c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 20 Mar 2025 15:13:54 -0700 Subject: [PATCH 141/295] Set github actions to use commit hashes (#8852) --- .github/workflows/check-changeset.yml | 12 ++-- .../workflows/check-vertexai-responses.yml | 6 +- .../workflows/health-metrics-pull-request.yml | 12 ++-- .github/workflows/health-metrics-release.yml | 9 ++- .github/workflows/merge-release-branch.yml | 50 ----------------- .github/workflows/release-tweet.yml | 55 ------------------- .../test-changed-firestore-integration.yml | 6 +- 7 files changed, 30 insertions(+), 120 deletions(-) delete mode 100644 .github/workflows/merge-release-branch.yml delete mode 100644 .github/workflows/release-tweet.yml diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index f38d3b2b69e..b3df2555c76 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -57,14 +57,16 @@ jobs: - name: Print blocking failure status run: echo "${{steps.check-changeset.outputs.BLOCKING_FAILURE}}" - name: Find Comment - uses: peter-evans/find-comment@v3 + # This commit represents v3.1.0 + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e id: fc with: issue-number: ${{github.event.number}} body-includes: Changeset File Check - name: Create comment (missing packages) if: ${{!steps.fc.outputs.comment-id && steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - uses: peter-evans/create-or-update-comment@v4 + # This commit represents v4.0.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: issue-number: ${{github.event.number}} body: | @@ -72,7 +74,8 @@ jobs: ${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - name: Update comment (missing packages) if: ${{steps.fc.outputs.comment-id && steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - uses: peter-evans/create-or-update-comment@v4 + # This commit represents v4.0.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: comment-id: ${{steps.fc.outputs.comment-id}} edit-mode: replace @@ -81,7 +84,8 @@ jobs: ${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - name: Update comment (no missing packages) if: ${{steps.fc.outputs.comment-id && !steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - uses: peter-evans/create-or-update-comment@v4 + # This commit represents v4.0.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: comment-id: ${{steps.fc.outputs.comment-id}} edit-mode: replace diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 0ce811a6cc0..5014ad44266 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -35,14 +35,16 @@ jobs: echo "latest_tag=$LATEST" >> $GITHUB_ENV working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data - name: Find comment from previous run if exists - uses: peter-evans/find-comment@v3 + # This commit represents v3.1.0 + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e id: fc with: issue-number: ${{github.event.number}} body-includes: Vertex AI Mock Responses Check - name: Comment on PR if newer version is available if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} - uses: peter-evans/create-or-update-comment@v4 + # This commit represents v4.0.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: issue-number: ${{github.event.number}} body: > diff --git a/.github/workflows/health-metrics-pull-request.yml b/.github/workflows/health-metrics-pull-request.yml index ff7bd7286c1..bc28a0841c6 100644 --- a/.github/workflows/health-metrics-pull-request.yml +++ b/.github/workflows/health-metrics-pull-request.yml @@ -42,10 +42,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22.10.0 - - uses: 'google-github-actions/auth@v0' + # This commit represents v0.8.3 + - uses: 'google-github-actions/auth@c4799db9111fba4461e9f9da8732e5057b394f72' with: credentials_json: '${{ secrets.GCP_SA_KEY }}' - - uses: google-github-actions/setup-gcloud@v2 + # This commit represents v2.1.4 + - uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a - run: yarn install - run: yarn build - name: Run health-metrics/binary-size test @@ -59,10 +61,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22.10.0 - - uses: 'google-github-actions/auth@v0' + # This commit represents v0.8.3 + - uses: 'google-github-actions/auth@c4799db9111fba4461e9f9da8732e5057b394f72' with: credentials_json: '${{ secrets.GCP_SA_KEY }}' - - uses: google-github-actions/setup-gcloud@v2 + # This commit represents v2.1.4 + - uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a - run: yarn install - run: yarn build - name: Run health-metrics/modular-exports-binary-size test diff --git a/.github/workflows/health-metrics-release.yml b/.github/workflows/health-metrics-release.yml index 686c9f51496..79aef4b3dad 100644 --- a/.github/workflows/health-metrics-release.yml +++ b/.github/workflows/health-metrics-release.yml @@ -23,11 +23,14 @@ jobs: name: Release Diffing runs-on: ubuntu-latest steps: - - uses: 'google-github-actions/auth@v0' + # This commit represents v0.8.3 + - uses: 'google-github-actions/auth@c4799db9111fba4461e9f9da8732e5057b394f72' with: credentials_json: '${{ secrets.GCP_SA_KEY }}' - - uses: google-github-actions/setup-gcloud@v2 - - uses: FirebaseExtended/github-actions/health-metrics/release-diffing@master + # This commit represents v2.1.4 + - uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a + # This commit represents v1.4 + - uses: FirebaseExtended/github-actions/health-metrics/release-diffing@41c787c37157e4c5932b951e531c041efa5bb7a4 with: repo: ${{ github.repository }} ref: ${{ github.ref }} diff --git a/.github/workflows/merge-release-branch.yml b/.github/workflows/merge-release-branch.yml deleted file mode 100644 index 7142908b78a..00000000000 --- a/.github/workflows/merge-release-branch.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2023 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. - -name: Merge Release Into Main - -on: workflow_dispatch - -jobs: - merge_to_main: - runs-on: ubuntu-latest - # Allow GITHUB_TOKEN to have write permissions - permissions: - contents: write - steps: - - name: Checkout Release Branch - uses: actions/checkout@v4 - with: - ref: release - - name: Get release version - id: get-version - run: | - export VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);" - export VERSION=`node -e "${VERSION_SCRIPT}"` - echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT - - name: Echo version in shell - run: | - echo "Merging release ${{ steps.get-version.outputs.RELEASE_VERSION }}" - - name: Merge to main - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.repos.merge({ - owner: context.repo.owner, - repo: context.repo.repo, - base: 'main', - head: 'release', - commit_message: 'Release ${{ steps.get-version.outputs.RELEASE_VERSION }}' - }) diff --git a/.github/workflows/release-tweet.yml b/.github/workflows/release-tweet.yml deleted file mode 100644 index ac446bed7ff..00000000000 --- a/.github/workflows/release-tweet.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2023 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. - -name: Send Release Tweet - -on: - workflow_dispatch: - inputs: - version: - description: 'Version number' - type: string - required: true - force: - description: 'Force publish' - type: boolean - default: false - required: true - -jobs: - tweet: - name: Send Release Tweet - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Setup Node.js 20.x - uses: actions/setup-node@master - with: - node-version: 22.10.0 - - name: Poll release notes page on devsite - run: node scripts/ci/poll_release_notes.js - env: - VERSION: ${{ github.event.inputs.version }} - FORCE_PUBLISH: ${{ github.event.inputs.force }} - - name: Post to Twitter - uses: firebase/firebase-admin-node/.github/actions/send-tweet@master - with: - status: > - v${{github.event.inputs.version}} of @Firebase JavaScript client for Web / Node.js is available. - Release notes: https://firebase.google.com/support/release-notes/js#${{github.event.inputs.version}} - consumer-key: ${{ secrets.TWITTER_CONSUMER_KEY }} - consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} - access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} \ No newline at end of file diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index d9269a6d1ac..6841bdd47d6 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -33,7 +33,8 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - uses: 'google-github-actions/auth@v0' + # This commit represents v0.8.3 + - uses: 'google-github-actions/auth@c4799db9111fba4461e9f9da8732e5057b394f72' if: ${{ fromJSON(env.run_terraform_steps) }} with: credentials_json: '${{ secrets.JSSDK_ACTIONS_SA_KEY }}' @@ -41,7 +42,8 @@ jobs: # create composite indexes with Terraform - name: Setup Terraform if: ${{ fromJSON(env.run_terraform_steps) }} - uses: hashicorp/setup-terraform@v2 + # This commit represents v3.1.2 + uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd - name: Terraform Init if: ${{ fromJSON(env.run_terraform_steps) }} run: | From d18310a853419755fd2f2a53bea86c766b3024c3 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:03:19 -0600 Subject: [PATCH 142/295] Markduckworth/ppl mep (#8801) * Multiple entry points for main package. * MEP for firestore lite building * Fix issue with external exports * Refactor to support multiple entry points for the lite SDK. Fixes import issues and makes code organization across /pipelines and /lite/pipeliens * Type and comment cleanup * Make PipelineSource generic and remove useFluentPipelines * Remove converter and placeholders for converter. * cleanup: remove documentReferenceFactory * Linting and formatting * Update the typings export for pipelines and lite pipelines so that it auguments the Firestore and Query classes. * Add missing Expr export * Lint fixes * TODO cleanup * update api review * Query to Proto with integration tests * API tweaks from review. Selectable, FilterCondition, and Accumulator are abstract classes not interfaces. Removed extraneous Pipeline.sort overload * Remove console.log statements from prune-dts.ts * code cleanup in prune-dts * Add missing imports to pipelines.ts * If argument to FunctionExpr is a plain object or array, convert these to expression using map(...) or array(...) * Add tests for evaluating expressions in arrays and maps * implement new FunctionExpressions as standalone functions * Fix typo and formatting in pipeline.test.ts * Implement support for genericStage and genericFunction * Implement new function expressions as methods on the Expr class. * Pipeline test reorganization * Implementing new stages Sample, Union, Unnest, Replace * Rename FilterCondition to BooleanExpr * Update functions with variadic params to match signatures of the backend * Fix and implementation. * Refactor AggregateFunction out of Expr * Add ScalarExpr class and make Expr a base class of AggregateFunction * fixing missing imports and renames * Remove classes for individual function types * Separate scalar expressions and aggregate functions into different class hierarchies * Remove deleted Expr classes from the pipelines exports * Replace not(fn()) with notFn() in the query to pipeline conversion * Fix circular dependency between user_data_reader and expressions * removing modular pipeline creation and removing fluent pipline execution. This was a decision from API review * Change return type of execute from PipelineResult[] to PipelineSnapshot * Renames for API review: FunctionExpr, BooleanExpr, params * missing readonly * Build and test fixes * Replace Field.of() with field() * Add missing export PipelineSnaphsot * Replace Constant.of() with constant() * Removed constant(...) overloads to create a map or array. Use the array or map function instead. * Implemented and documented ascending|descending(fieldName) as a convenient way to create orderings for a specific field * fix tests creating a constant map and array * Remove genericFunction, genericAggregateFunction, and genericBooleanExpr. Replace usage with constructor * Pipeline result timestamp testing * Testing timestamp edge cases * Query to pipeline conversion is performed from the PipelineSource class rather than the Query class * Timestamp tests and fix pipeline tests for change in pipeline creation from a classic query * test fix * Refactor and rename all functions to match API proposal changes after API review. * Fix build issues * New integration util pipeline_export file to support the pipelines subpackage * Rename several FunctionExpr standalone exports from Function to . Meets API design * Removing the all-packages api report script because it is no longer needed * Remove any from the public api surface * lint fix * Code cleanup * FindNearest integration tests * Filling in gaps in test coverage * Implement Pipeline tests for the lite SDK * Fixed a build issue with the lite SDK * Improved error message context when invalid user data is passed to a pipeline without being wrapped in a call to constant(...) * Fix typo in old error message * Fix lite pipeline exports * api-review files * Fixing tests and improving test coverage * PR feedback * Updating replaceWith to take an Expr * yarn format --- .../firestore-lite-pipelines.api.md | 2147 ++---- common/api-review/firestore-pipelines.api.md | 1435 ++-- common/api-review/firestore.api.md | 1343 +--- .../firestore/lite/pipelines/package.json | 2 +- .../firestore/lite/pipelines/pipelines.d.ts | 2 +- .../firestore/lite/pipelines/pipelines.ts | 108 +- packages/firestore/package.json | 5 +- packages/firestore/pipelines/pipelines.d.ts | 7 +- packages/firestore/src/api.ts | 3 +- packages/firestore/src/api/parse_context.ts | 45 + packages/firestore/src/api/pipeline.ts | 66 +- packages/firestore/src/api/pipeline_impl.ts | 111 +- packages/firestore/src/api_pipelines.ts | 116 +- packages/firestore/src/core/pipeline-util.ts | 184 +- .../firestore/src/lite-api/expressions.ts | 6051 +++++++++-------- .../firestore/src/lite-api/pipeline-result.ts | 71 +- .../firestore/src/lite-api/pipeline-source.ts | 84 +- packages/firestore/src/lite-api/pipeline.ts | 738 +- .../firestore/src/lite-api/pipeline_impl.ts | 126 +- packages/firestore/src/lite-api/reference.ts | 2 +- packages/firestore/src/lite-api/snapshot.ts | 5 +- packages/firestore/src/lite-api/stage.ts | 147 +- .../src/lite-api/user_data_reader.ts | 53 +- packages/firestore/src/remote/datastore.ts | 10 +- packages/firestore/src/remote/serializer.ts | 26 +- packages/firestore/src/util/types.ts | 4 + .../test/integration/api/pipeline.test.ts | 4207 ++++++++---- .../integration/api/query_to_pipeline.test.ts | 827 +++ .../test/integration/util/firebase_export.ts | 1 - .../test/integration/util/helpers.ts | 7 + .../integration/util/pipeline_export.ts} | 16 +- packages/firestore/test/lite/pipeline.test.ts | 2919 ++++++++ 32 files changed, 12181 insertions(+), 8687 deletions(-) create mode 100644 packages/firestore/test/integration/api/query_to_pipeline.test.ts rename packages/firestore/{src/all_packages.ts => test/integration/util/pipeline_export.ts} (61%) create mode 100644 packages/firestore/test/lite/pipeline.test.ts diff --git a/common/api-review/firestore-lite-pipelines.api.md b/common/api-review/firestore-lite-pipelines.api.md index d1536c8a626..28746295ae5 100644 --- a/common/api-review/firestore-lite-pipelines.api.md +++ b/common/api-review/firestore-lite-pipelines.api.md @@ -7,276 +7,204 @@ import { FirebaseApp } from '@firebase/app'; // @beta -export interface Accumulator { - // (undocumented) - accumulator: true; - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; +export function add(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; + +// @beta +export function add(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; + +// @beta (undocumented) +export class AddFields implements Stage { + constructor(fields: Map); // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; + name: string; +} + +// @beta (undocumented) +export class Aggregate implements Stage { + constructor(accumulators: Map, groups: Map); // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; + name: string; +} + +// @beta +export class AggregateFunction { + constructor(name: string, params: Expr[]); + as(name: string): AggregateWithAlias; // (undocumented) exprType: ExprType; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; + } + +// @beta +export class AggregateWithAlias { + constructor(aggregate: AggregateFunction, alias: string); // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; + readonly aggregate: AggregateFunction; // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; + readonly alias: string; } // @beta -export type AccumulatorTarget = ExprWithAlias; +export function and(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; -// @beta (undocumented) -export class Add extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +// @beta +export function array(elements: unknown[]): FunctionExpr; // @beta -export function add(left: Accumulator, right: Accumulator): Add; +export function arrayConcat(firstArray: Expr, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; // @beta -export function add(left: Accumulator, right: any): Add; +export function arrayConcat(firstArrayField: string, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; // @beta -export function add(left: string, right: Accumulator): Add; +export function arrayContains(array: Expr, element: Expr): FunctionExpr; // @beta -export function add(left: string, right: any): Add; +export function arrayContains(array: Expr, element: unknown): FunctionExpr; -// @beta (undocumented) -export class AddFields implements Stage { - constructor(fields: Map); - // (undocumented) - name: string; -} +// @beta +export function arrayContains(fieldName: string, element: Expr): FunctionExpr; -// @beta (undocumented) -export class Aggregate implements Stage { - constructor(accumulators: Map, groups: Map); - // (undocumented) - name: string; -} +// @beta +export function arrayContains(fieldName: string, element: unknown): BooleanExpr; -// @beta (undocumented) -export class And extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); - // (undocumented) - filterable: true; -} +// @beta +export function arrayContainsAll(array: Expr, values: Array): BooleanExpr; -// @beta (undocumented) -export class ArrayConcat extends FirestoreFunction { - constructor(array: Accumulator, elements: Accumulator[]); - } +// @beta +export function arrayContainsAll(fieldName: string, values: Array): BooleanExpr; // @beta -export function arrayConcat(array: Accumulator, elements: Accumulator[]): ArrayConcat; +export function arrayContainsAll(array: Expr, arrayExpression: Expr): BooleanExpr; // @beta -export function arrayConcat(array: Accumulator, elements: any[]): ArrayConcat; +export function arrayContainsAll(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta -export function arrayConcat(array: string, elements: Accumulator[]): ArrayConcat; +export function arrayContainsAny(array: Expr, values: Array): BooleanExpr; // @beta -export function arrayConcat(array: string, elements: any[]): ArrayConcat; +export function arrayContainsAny(fieldName: string, values: Array): BooleanExpr; -// @beta (undocumented) -export class ArrayContains extends FirestoreFunction implements FilterCondition { - constructor(array: Accumulator, element: Accumulator); - // (undocumented) - filterable: true; -} +// @beta +export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; // @beta -export function arrayContains(array: Accumulator, element: Accumulator): ArrayContains; +export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; // @beta -export function arrayContains(array: Accumulator, element: any): ArrayContains; +export function arrayLength(array: Expr): FunctionExpr; // @beta -export function arrayContains(array: string, element: Accumulator): ArrayContains; +export function arrayOffset(arrayField: string, offset: number): FunctionExpr; // @beta -export function arrayContains(array: string, element: any): ArrayContains; +export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; -// @beta (undocumented) -export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { - constructor(array: Accumulator, values: Accumulator[]); - // (undocumented) - filterable: true; - } +// @beta +export function arrayOffset(arrayExpression: Expr, offset: number): FunctionExpr; // @beta -export function arrayContainsAll(array: Accumulator, values: Accumulator[]): ArrayContainsAll; +export function arrayOffset(arrayExpression: Expr, offsetExpr: Expr): FunctionExpr; // @beta -export function arrayContainsAll(array: Accumulator, values: any[]): ArrayContainsAll; +export function ascending(expr: Expr): Ordering; // @beta -export function arrayContainsAll(array: string, values: Accumulator[]): ArrayContainsAll; +export function ascending(fieldName: string): Ordering; // @beta -export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; +export function avg(expression: Expr): AggregateFunction; -// @beta (undocumented) -export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { - constructor(array: Accumulator, values: Accumulator[]); - // (undocumented) - filterable: true; - } +// @beta +export function avg(fieldName: string): AggregateFunction; +// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts +// // @beta -export function arrayContainsAny(array: Accumulator, values: Accumulator[]): ArrayContainsAny; +export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; // @beta -export function arrayContainsAny(array: Accumulator, values: any[]): ArrayContainsAny; +export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; // @beta -export function arrayContainsAny(array: string, values: Accumulator[]): ArrayContainsAny; +export function bitAnd(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; // @beta -export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; +export function bitAnd(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class ArrayElement extends FirestoreFunction { - constructor(); -} +// @beta +export function bitLeftShift(field: string, y: number): FunctionExpr; -// @beta (undocumented) -export class ArrayLength extends FirestoreFunction { - constructor(array: Accumulator); - } +// @beta +export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; // @beta -export function arrayLength(array: Accumulator): ArrayLength; +export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; -// @beta (undocumented) -export class ArrayReverse extends FirestoreFunction { - constructor(array: Accumulator); - } +// @beta +export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; // @beta -export function ascending(expr: Accumulator): Ordering; +export function bitNot(field: string): FunctionExpr; -// @beta (undocumented) -export class Avg extends FirestoreFunction implements Accumulator { - constructor(value: Accumulator, distinct: boolean); - // (undocumented) - accumulator: true; - } +// @beta +export function bitNot(bitsValueExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class ByteLength extends FirestoreFunction { - constructor(value: Accumulator); - } +// @beta +export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; // @beta -export function byteLength(expr: Accumulator): ByteLength; +export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; // @beta -export function byteLength(field: string): ByteLength; +export function bitOr(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; -// @beta (undocumented) -export class CharLength extends FirestoreFunction { - constructor(value: Accumulator); - } +// @beta +export function bitOr(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; + +// @beta +export function bitRightShift(field: string, y: number): FunctionExpr; + +// @beta +export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; + +// @beta +export function bitRightShift(xValue: Expr, y: number): FunctionExpr; + +// @beta +export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; + +// @beta +export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; // @beta -export function charLength(field: string): CharLength; +export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; // @beta -export function charLength(expr: Accumulator): CharLength; +export function bitXor(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; + +// @beta +export function bitXor(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; + +// @beta +export class BooleanExpr extends FunctionExpr { + countIf(): AggregateFunction; + // (undocumented) + filterable: true; + not(): BooleanExpr; +} + +// @beta +export function byteLength(expr: Expr): FunctionExpr; + +// @beta +export function byteLength(fieldName: string): FunctionExpr; + +// @beta +export function charLength(fieldName: string): FunctionExpr; + +// @beta +export function charLength(stringExpression: Expr): FunctionExpr; // @beta (undocumented) export class CollectionGroupSource implements Stage { @@ -292,169 +220,102 @@ export class CollectionSource implements Stage { name: string; } -// @beta (undocumented) -export class Cond extends FirestoreFunction { - constructor(condition: FilterCondition, thenExpr: Accumulator, elseExpr: Accumulator); - // (undocumented) - filterable: true; - } - // @beta -export function cond(condition: FilterCondition, thenExpr: Accumulator, elseExpr: Accumulator): Cond; +export function cond(condition: BooleanExpr, thenExpr: Expr, elseExpr: Expr): FunctionExpr; // @beta -export class Constant { - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; +export class Constant extends Expr { // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - exprType: ExprType; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - static of(value: number): Constant; - static of(value: string): Constant; - static of(value: boolean): Constant; - static of(value: null): Constant; - static of(value: undefined): Constant; - // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts - static of(value: GeoPoint): Constant; - // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts - static of(value: Timestamp): Constant; - static of(value: Date): Constant; - static of(value: Uint8Array): Constant; - // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts - static of(value: DocumentReference): Constant; - static of(value: any[]): Constant; - static of(value: Map): Constant; - static of(value: VectorValue): Constant; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - static vector(value: number[] | VectorValue): Constant; - vectorLength(): VectorLength; -} - -// @beta (undocumented) -export class CosineDistance extends FirestoreFunction { - constructor(vector1: Accumulator, vector2: Accumulator); + readonly exprType: ExprType; } +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: number): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: string): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: boolean): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: null): Constant; + +// Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: GeoPoint): Constant; + +// Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Timestamp): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Date): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Bytes): Constant; + +// Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: DocumentReference): Constant; + +// Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: VectorValue): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constantVector" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constantVector(value: number[] | VectorValue): Constant; + // @beta -export function cosineDistance(expr: string, other: number[]): CosineDistance; +export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function cosineDistance(expr: string, other: VectorValue): CosineDistance; +export function cosineDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function cosineDistance(expr: string, other: Accumulator): CosineDistance; +export function cosineDistance(vectorExpression: Expr, vector: number[] | Expr): FunctionExpr; // @beta -export function cosineDistance(expr: Accumulator, other: number[]): CosineDistance; +export function cosineDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function cosineDistance(expr: Accumulator, other: VectorValue): CosineDistance; +export function count(expression: Expr): AggregateFunction; + +// Warning: (ae-incompatible-release-tags) The symbol "count" is marked as @public, but its signature references "AggregateFunction" which is marked as @beta +// +// @public +export function count(fieldName: string): AggregateFunction; // @beta -export function cosineDistance(expr: Accumulator, other: Accumulator): CosineDistance; +export function countAll(): AggregateFunction; -// @beta (undocumented) -export class Count extends FirestoreFunction implements Accumulator { - constructor(value: Accumulator | undefined, distinct: boolean); - // (undocumented) - accumulator: true; - } +// @beta +export function countIf(booleanExpr: BooleanExpr): AggregateFunction; // @beta -export function countAll(): Count; +export function currentContext(): FunctionExpr; // @beta (undocumented) export class DatabaseSource implements Stage { @@ -463,31 +324,35 @@ export class DatabaseSource implements Stage { } // @beta -export function descending(expr: Accumulator): Ordering; +export function descending(expr: Expr): Ordering; + +// @beta +export function descending(fieldName: string): Ordering; // @beta (undocumented) export class Distinct implements Stage { - constructor(groups: Map); + constructor(groups: Map); // (undocumented) name: string; } -// @beta (undocumented) -export class Divide extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +// @beta +export function divide(left: Expr, right: Expr): FunctionExpr; + +// @beta +export function divide(expression: Expr, value: unknown): FunctionExpr; // @beta -export function divide(left: Accumulator, right: Accumulator): Divide; +export function divide(fieldName: string, expressions: Expr): FunctionExpr; // @beta -export function divide(left: Accumulator, right: any): Divide; +export function divide(fieldName: string, value: unknown): FunctionExpr; // @beta -export function divide(left: string, right: Accumulator): Divide; +export function documentId(documentPath: string | DocumentReference): FunctionExpr; // @beta -export function divide(left: string, right: any): Divide; +export function documentId(documentPathExpr: Expr): FunctionExpr; // @beta (undocumented) export class DocumentsSource implements Stage { @@ -495,574 +360,350 @@ export class DocumentsSource implements Stage { // (undocumented) name: string; // (undocumented) - static of(refs: DocumentReference[]): DocumentsSource; + static of(refs: Array): DocumentsSource; } -// @beta (undocumented) -export class DotProduct extends FirestoreFunction { - constructor(vector1: Accumulator, vector2: Accumulator); - } - // @beta -export function dotProduct(expr: string, other: number[]): DotProduct; +export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function dotProduct(expr: string, other: VectorValue): DotProduct; +export function dotProduct(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function dotProduct(expr: string, other: Accumulator): DotProduct; +export function dotProduct(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function dotProduct(expr: Accumulator, other: number[]): DotProduct; +export function dotProduct(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function dotProduct(expr: Accumulator, other: VectorValue): DotProduct; +export function endsWith(fieldName: string, suffix: string): BooleanExpr; // @beta -export function dotProduct(expr: Accumulator, other: Accumulator): DotProduct; - -// @beta (undocumented) -export class EndsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, suffix: Accumulator); - // (undocumented) - filterable: true; - } +export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; // @beta -export function endsWith(expr: string, suffix: string): EndsWith; +export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; // @beta -export function endsWith(expr: string, suffix: Accumulator): EndsWith; +export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; // @beta -export function endsWith(expr: Accumulator, suffix: string): EndsWith; +export function eq(left: Expr, right: Expr): BooleanExpr; // @beta -export function endsWith(expr: Accumulator, suffix: Accumulator): EndsWith; - -// @beta (undocumented) -export class Eq extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; - } - -// @beta -export function eq(left: Accumulator, right: Accumulator): Eq; - -// @beta -export function eq(left: Accumulator, right: any): Eq; - -// @beta -export function eq(left: string, right: Accumulator): Eq; - -// @beta -export function eq(left: string, right: any): Eq; - -// @beta (undocumented) -export class EqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, others: Accumulator[]); - // (undocumented) - filterable: true; - } - -// @beta -export function eqAny(element: Accumulator, others: Accumulator[]): EqAny; +export function eq(expression: Expr, value: unknown): BooleanExpr; // @beta -export function eqAny(element: Accumulator, others: any[]): EqAny; +export function eq(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function eqAny(element: string, others: Accumulator[]): EqAny; +export function eq(fieldName: string, value: unknown): BooleanExpr; // @beta -export function eqAny(element: string, others: any[]): EqAny; - -// @beta (undocumented) -export class EuclideanDistance extends FirestoreFunction { - constructor(vector1: Accumulator, vector2: Accumulator); - } +export function eqAny(expression: Expr, values: Array): BooleanExpr; // @beta -export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; +export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; // @beta -export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; +export function eqAny(fieldName: string, values: Array): BooleanExpr; // @beta -export function euclideanDistance(expr: string, other: Accumulator): EuclideanDistance; +export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta -export function euclideanDistance(expr: Accumulator, other: number[]): EuclideanDistance; +export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function euclideanDistance(expr: Accumulator, other: VectorValue): EuclideanDistance; +export function euclideanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function euclideanDistance(expr: Accumulator, other: Accumulator): EuclideanDistance; +export function euclideanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function execute(pipeline: Pipeline): Promise; +export function euclideanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class Exists extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator); - // (undocumented) - filterable: true; +// @public +export function execute(pipeline: Pipeline): Promise; + +// @beta +export function exists(value: Expr): BooleanExpr; + +// @beta +export function exists(fieldName: string): BooleanExpr; + +// @beta +export abstract class Expr { + add(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayConcat(secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayContains(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContains(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAll(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAll(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayOffset(offset: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayOffset(offsetExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + as(name: string): ExprWithAlias; + /* Excluded from this release type: _readUserData */ + ascending(): Ordering; + /* Excluded from this release type: _readUserData */ + avg(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + bitAnd(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitAnd(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitLeftShift(y: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitLeftShift(numberExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitNot(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitOr(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitOr(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitRightShift(y: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitRightShift(numberExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitXor(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitXor(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + byteLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + charLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + cosineDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + cosineDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + count(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + descending(): Ordering; + /* Excluded from this release type: _readUserData */ + divide(other: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + divide(other: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + documentId(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + dotProduct(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + dotProduct(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + endsWith(suffix: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + endsWith(suffix: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eq(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eq(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eqAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eqAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + euclideanDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + euclideanDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + exists(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + // (undocumented) + abstract readonly exprType: ExprType; + /* Excluded from this release type: _readUserData */ + gt(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gt(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gte(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gte(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + ifError(catchExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + ifError(catchValue: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + isAbsent(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isError(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNan(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNotNan(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNotNull(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNull(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + like(pattern: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + like(pattern: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + logicalMaximum(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + logicalMinimum(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + lt(experession: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lt(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lte(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lte(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + manhattanDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + manhattanDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapGet(subfield: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapMerge(secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapRemove(key: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapRemove(keyExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + maximum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + minimum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + mod(expression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mod(value: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + multiply(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + neq(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + neq(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + notEqAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + notEqAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexContains(pattern: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexContains(pattern: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexMatch(pattern: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexMatch(pattern: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + replaceAll(find: string, replace: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceAll(find: Expr, replace: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceFirst(find: string, replace: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceFirst(find: Expr, replace: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + reverse(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + startsWith(prefix: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + startsWith(prefix: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + strConcat(secondString: Expr | string, ...otherStrings: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + strContains(substring: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + strContains(expr: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + substr(position: number, length?: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + substr(position: Expr, length?: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + subtract(other: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + subtract(other: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + sum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + timestampAdd(unit: Expr, amount: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampSub(unit: Expr, amount: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixMicros(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixMillis(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixSeconds(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + toLower(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + toUpper(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + trim(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixMicrosToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixMillisToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixSecondsToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + vectorLength(): FunctionExpr; } // @beta -export function exists(value: Accumulator): Exists; - -// @beta -export function exists(field: string): Exists; - -// @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; +export type ExprType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExprs' | 'ExprWithAlias'; // @beta (undocumented) -export class ExprWithAlias implements Selectable { - constructor(expr: T, alias: string); - add(other: Accumulator): Add; - add(other: any): Add; +export class ExprWithAlias implements Selectable { + constructor(expr: Expr, alias: string); // (undocumented) readonly alias: string; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; // (undocumented) - readonly expr: T; + readonly expr: Expr; // (undocumented) exprType: ExprType; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; // (undocumented) selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; } // @beta -export class Field implements Selectable { - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; +export class Field extends Expr implements Selectable { // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; + get alias(): string; // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; + get expr(): Expr; // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - exprType: ExprType; + readonly exprType: ExprType; // (undocumented) fieldName(): string; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - static of(name: string): Field; - // Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts - // - // (undocumented) - static of(path: FieldPath): Field; - // (undocumented) - static of(pipeline: Pipeline, name: string): Field; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; // (undocumented) selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; } -// @beta (undocumented) -export class Fields implements Selectable { - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - exprType: ExprType; - // (undocumented) - fieldList(): Field[]; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - // (undocumented) - static of(name: string, ...others: string[]): Fields; - // (undocumented) - static ofAll(): Fields; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; - // (undocumented) - selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; -} +// Warning: (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// +// @public +export function field(name: string): Field; -// @beta -export interface FilterCondition { - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - exprType: ExprType; - // (undocumented) - filterable: true; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; -} +// Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// +// @public (undocumented) +export function field(path: FieldPath): Field; // @beta (undocumented) export class FindNearest implements Stage { @@ -1077,7 +718,7 @@ export interface FindNearestOptions { // (undocumented) distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; // (undocumented) - field: Field; + field: Field | string; // (undocumented) limit?: number; // (undocumented) @@ -1085,189 +726,92 @@ export interface FindNearestOptions { } // @beta -export class FirestoreFunction { - constructor(name: string, params: Accumulator[]); - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; - // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; +export class FunctionExpr extends Expr { + constructor(name: string, params: Expr[]); // (undocumented) - exprType: ExprType; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; - // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; -} - -// @beta -export function genericFunction(name: string, params: Accumulator[]): FirestoreFunction; + readonly exprType: ExprType; + } // @beta (undocumented) export class GenericStage implements Stage { - constructor(name: string, params: unknown[]); // (undocumented) name: string; -} - -// @beta (undocumented) -export class Gt extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; } // @beta -export function gt(left: Accumulator, right: Accumulator): Gt; +export function gt(left: Expr, right: Expr): BooleanExpr; // @beta -export function gt(left: Accumulator, right: any): Gt; +export function gt(expression: Expr, value: unknown): BooleanExpr; // @beta -export function gt(left: string, right: Accumulator): Gt; +export function gt(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function gt(left: string, right: any): Gt; +export function gt(fieldName: string, value: unknown): BooleanExpr; -// @beta (undocumented) -export class Gte extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; - } +// @beta +export function gte(left: Expr, right: Expr): BooleanExpr; // @beta -export function gte(left: Accumulator, right: Accumulator): Gte; +export function gte(expression: Expr, value: unknown): BooleanExpr; // @beta -export function gte(left: Accumulator, right: any): Gte; +export function gte(fieldName: string, value: Expr): BooleanExpr; // @beta -export function gte(left: string, right: Accumulator): Gte; +export function gte(fieldName: string, value: unknown): BooleanExpr; // @beta -export function gte(left: string, right: any): Gte; +export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; -// @beta (undocumented) -export class IsNan extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator); - // (undocumented) - filterable: true; -} +// @beta +export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; // @beta -export function isNan(value: Accumulator): IsNan; +export function isAbsent(value: Expr): BooleanExpr; // @beta -export function isNan(value: string): IsNan; +export function isAbsent(field: string): BooleanExpr; -// @beta (undocumented) -export class Like extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, pattern: Accumulator); - // (undocumented) - filterable: true; - } +// @beta +export function isError(value: Expr): BooleanExpr; + +// @beta +export function isNan(value: Expr): BooleanExpr; + +// @beta +export function isNan(fieldName: string): BooleanExpr; + +// @beta +export function isNotNan(value: Expr): BooleanExpr; + +// @beta +export function isNotNan(value: string): BooleanExpr; + +// @beta +export function isNotNull(value: Expr): BooleanExpr; // @beta -export function like(left: string, pattern: string): Like; +export function isNotNull(value: string): BooleanExpr; // @beta -export function like(left: string, pattern: Accumulator): Like; +export function isNull(value: Expr): BooleanExpr; // @beta -export function like(left: Accumulator, pattern: string): Like; +export function isNull(value: string): BooleanExpr; // @beta -export function like(left: Accumulator, pattern: Accumulator): Like; +export function like(fieldName: string, pattern: string): BooleanExpr; + +// @beta +export function like(fieldName: string, pattern: Expr): BooleanExpr; + +// @beta +export function like(stringExpression: Expr, pattern: string): BooleanExpr; + +// @beta +export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta (undocumented) export class Limit implements Stage { @@ -1280,192 +824,140 @@ export class Limit implements Stage { name: string; } -// @beta (undocumented) -export class LogicalMaximum extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +// @beta +export function logicalMaximum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: Accumulator, right: Accumulator): LogicalMaximum; +export function logicalMaximum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: Accumulator, right: any): LogicalMaximum; +export function logicalMinimum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: string, right: Accumulator): LogicalMaximum; +export function logicalMinimum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: string, right: any): LogicalMaximum; +export function lt(left: Expr, right: Expr): BooleanExpr; -// @beta (undocumented) -export class LogicalMinimum extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +// @beta +export function lt(expression: Expr, value: unknown): BooleanExpr; // @beta -export function logicalMinimum(left: Accumulator, right: Accumulator): LogicalMinimum; +export function lt(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function logicalMinimum(left: Accumulator, right: any): LogicalMinimum; +export function lt(fieldName: string, value: unknown): BooleanExpr; // @beta -export function logicalMinimum(left: string, right: Accumulator): LogicalMinimum; +export function lte(left: Expr, right: Expr): BooleanExpr; // @beta -export function logicalMinimum(left: string, right: any): LogicalMinimum; +export function lte(expression: Expr, value: unknown): BooleanExpr; -// @beta (undocumented) -export class Lt extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; - } +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta +// +// @public +export function lte(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function lt(left: Accumulator, right: Accumulator): Lt; +export function lte(fieldName: string, value: unknown): BooleanExpr; // @beta -export function lt(left: Accumulator, right: any): Lt; +export function manhattanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function lt(left: string, right: Accumulator): Lt; +export function manhattanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function lt(left: string, right: any): Lt; - -// @beta (undocumented) -export class Lte extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; - } +export function manhattanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function lte(left: Accumulator, right: Accumulator): Lte; +export function manhattanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function lte(left: Accumulator, right: any): Lte; - -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Accumulator" which is marked as @beta -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta -// -// @public -export function lte(left: string, right: Accumulator): Lte; +export function map(elements: Record): FunctionExpr; // @beta -export function lte(left: string, right: any): Lte; - -// @beta (undocumented) -export class MapGet extends FirestoreFunction { - constructor(map: Accumulator, name: string); -} +export function mapGet(fieldName: string, subField: string): FunctionExpr; // @beta -export function mapGet(mapField: string, subField: string): MapGet; +export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; // @beta -export function mapGet(mapExpr: Accumulator, subField: string): MapGet; - -// @beta (undocumented) -export class Maximum extends FirestoreFunction implements Accumulator { - constructor(value: Accumulator, distinct: boolean); - // (undocumented) - accumulator: true; - } +export function mapMerge(mapField: string, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; // @beta -export function maximum(value: Accumulator): Maximum; +export function mapMerge(firstMap: Record | Expr, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; // @beta -export function maximum(value: string): Maximum; - -// @beta (undocumented) -export class Minimum extends FirestoreFunction implements Accumulator { - constructor(value: Accumulator, distinct: boolean); - // (undocumented) - accumulator: true; - } +export function mapRemove(mapField: string, key: string): FunctionExpr; // @beta -export function minimum(value: Accumulator): Minimum; +export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; // @beta -export function minimum(value: string): Minimum; - -// @beta (undocumented) -export class Mod extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; // @beta -export function mod(left: Accumulator, right: Accumulator): Mod; +export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; // @beta -export function mod(left: Accumulator, right: any): Mod; +export function maximum(expression: Expr): AggregateFunction; // @beta -export function mod(left: string, right: Accumulator): Mod; +export function maximum(fieldName: string): AggregateFunction; // @beta -export function mod(left: string, right: any): Mod; +export function minimum(expression: Expr): AggregateFunction; -// @beta (undocumented) -export class Multiply extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +// @beta +export function minimum(fieldName: string): AggregateFunction; // @beta -export function multiply(left: Accumulator, right: Accumulator): Multiply; +export function mod(left: Expr, right: Expr): FunctionExpr; // @beta -export function multiply(left: Accumulator, right: any): Multiply; +export function mod(expression: Expr, value: unknown): FunctionExpr; // @beta -export function multiply(left: string, right: Accumulator): Multiply; +export function mod(fieldName: string, expression: Expr): FunctionExpr; // @beta -export function multiply(left: string, right: any): Multiply; +export function mod(fieldName: string, value: unknown): FunctionExpr; -// @beta (undocumented) -export class Neq extends FirestoreFunction implements FilterCondition { - constructor(left: Accumulator, right: Accumulator); - // (undocumented) - filterable: true; - } +// @beta +export function multiply(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function neq(left: Accumulator, right: Accumulator): Neq; +export function multiply(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function neq(left: Accumulator, right: any): Neq; +export function neq(left: Expr, right: Expr): BooleanExpr; // @beta -export function neq(left: string, right: Accumulator): Neq; +export function neq(expression: Expr, value: unknown): BooleanExpr; // @beta -export function neq(left: string, right: any): Neq; +export function neq(fieldName: string, expression: Expr): BooleanExpr; -// @beta (undocumented) -export class Not extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator); - // (undocumented) - filterable: true; -} +// @beta +export function neq(fieldName: string, value: unknown): BooleanExpr; // @beta -export function not(filter: FilterCondition): Not; +export function not(booleanExpr: BooleanExpr): BooleanExpr; // @beta -export function notEqAny(element: Accumulator, others: Accumulator[]): FirestoreFunction; +export function notEqAny(element: Expr, values: Array): BooleanExpr; // @beta -export function notEqAny(element: Accumulator, others: any[]): FirestoreFunction; +export function notEqAny(fieldName: string, values: Array): BooleanExpr; // @beta -export function notEqAny(element: string, others: Accumulator[]): FirestoreFunction; +export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; // @beta -export function notEqAny(element: string, others: any[]): FirestoreFunction; +export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta (undocumented) export class Offset implements Stage { @@ -1474,79 +966,75 @@ export class Offset implements Stage { name: string; } -// @beta (undocumented) -export class Or extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); - // (undocumented) - filterable: true; -} +// @beta +export function or(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; // @beta export class Ordering { - constructor(expr: Accumulator, direction: 'ascending' | 'descending'); + constructor(expr: Expr, direction: 'ascending' | 'descending'); // (undocumented) readonly direction: 'ascending' | 'descending'; // (undocumented) - readonly expr: Accumulator; + readonly expr: Expr; } // @public export class Pipeline { /* Excluded from this release type: _db */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta - addFields(...fields: Selectable[]): Pipeline; + addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta + aggregate(accumulator: AggregateWithAlias, ...additionalAccumulators: AggregateWithAlias[]): Pipeline; /* Excluded from this release type: _userDataWriter */ aggregate(options: { - accumulators: AccumulatorTarget[]; + accumulators: AggregateWithAlias[]; groups?: Array; }): Pipeline; /* Excluded from this release type: _userDataWriter */ // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta - distinct(...groups: Array): Pipeline; - /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta - execute(): Promise; + distinct(group: string | Selectable, ...additionalGroups: Array): Pipeline; /* Excluded from this release type: _userDataWriter */ // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ - genericStage(name: string, params: any[]): Pipeline; + genericStage(name: string, params: unknown[]): Pipeline; /* Excluded from this release type: _userDataWriter */ limit(limit: number): Pipeline; /* Excluded from this release type: _userDataWriter */ offset(offset: number): Pipeline; /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "removeFields" is marked as @public, but its signature references "Field" which is marked as @beta + removeFields(fieldValue: Field | string, ...additionalFields: Array): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "replaceWith" is marked as @public, but its signature references "Field" which is marked as @beta + replaceWith(fieldValue: Field | string): Pipeline; + /* Excluded from this release type: _userDataWriter */ + sample(documents: number): Pipeline; + /* Excluded from this release type: _userDataWriter */ + sample(options: { + percentage: number; + } | { + documents: number; + }): Pipeline; + /* Excluded from this release type: _userDataWriter */ // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta - select(...selections: Array): Pipeline; + select(selection: Selectable | string, ...additionalSelections: Array): Pipeline; /* Excluded from this release type: _userDataWriter */ // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta - sort(...orderings: Ordering[]): Pipeline; + sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; /* Excluded from this release type: _userDataWriter */ - // (undocumented) - sort(options: { - orderings: Ordering[]; - }): Pipeline; + union(other: Pipeline): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta - where(condition: FilterCondition): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "unnest" is marked as @public, but its signature references "Selectable" which is marked as @beta + unnest(selectable: Selectable, indexField?: string): Pipeline; + /* Excluded from this release type: _userDataWriter */ + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta + where(condition: BooleanExpr): Pipeline; } -// Warning: (ae-forgotten-export) The symbol "Firestore" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta -// -// @public -export function pipeline(firestore: Firestore): PipelineSource; - -// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts -// -// @public -export function pipeline(query: Query): Pipeline; - // Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts // // @beta @@ -1556,215 +1044,109 @@ export class PipelineResult { /* Excluded from this release type: __constructor */ get createTime(): Timestamp | undefined; data(): AppModelType | undefined; - get executionTime(): Timestamp; - get(fieldPath: string | FieldPath): any; + get(fieldPath: string | FieldPath | Field): any; get id(): string | undefined; get ref(): DocumentReference | undefined; get updateTime(): Timestamp | undefined; } +// @public (undocumented) +export class PipelineSnapshot { + // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp); + get executionTime(): Timestamp; + get pipeline(): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "results" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + get results(): PipelineResult[]; +} + // @beta export class PipelineSource { + collection(collectionPath: string): PipelineType; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + // Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts + collection(collectionReference: Query): PipelineType; /* Excluded from this release type: _createPipeline */ /* Excluded from this release type: __constructor */ - // (undocumented) - collection(collectionPath: string): PipelineType; - // (undocumented) collectionGroup(collectionId: string): PipelineType; - // (undocumented) + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + createFrom(query: Query): Pipeline; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ database(): PipelineType; - // (undocumented) - documents(docs: DocumentReference[]): PipelineType; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + documents(docs: Array): PipelineType; } -// @beta (undocumented) -export class RegexContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, pattern: Accumulator); - // (undocumented) - filterable: true; - } - // @beta -export function regexContains(left: string, pattern: string): RegexContains; +export function rand(): FunctionExpr; // @beta -export function regexContains(left: string, pattern: Accumulator): RegexContains; +export function regexContains(fieldName: string, pattern: string): BooleanExpr; // @beta -export function regexContains(left: Accumulator, pattern: string): RegexContains; +export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; // @beta -export function regexContains(left: Accumulator, pattern: Accumulator): RegexContains; - -// @beta (undocumented) -export class RegexMatch extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, pattern: Accumulator); - // (undocumented) - filterable: true; - } +export function regexContains(stringExpression: Expr, pattern: string): BooleanExpr; // @beta -export function regexMatch(left: string, pattern: string): RegexMatch; +export function regexContains(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta -export function regexMatch(left: string, pattern: Accumulator): RegexMatch; +export function regexMatch(fieldName: string, pattern: string): BooleanExpr; // @beta -export function regexMatch(left: Accumulator, pattern: string): RegexMatch; +export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; // @beta -export function regexMatch(left: Accumulator, pattern: Accumulator): RegexMatch; - -// @beta (undocumented) -export class ReplaceAll extends FirestoreFunction { - constructor(value: Accumulator, find: Accumulator, replace: Accumulator); - } +export function regexMatch(stringExpression: Expr, pattern: string): BooleanExpr; // @beta -export function replaceAll(value: Accumulator, find: string, replace: string): ReplaceAll; +export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta -export function replaceAll(value: Accumulator, find: Accumulator, replace: Accumulator): ReplaceAll; +export function replaceAll(value: Expr, find: string, replace: string): FunctionExpr; // @beta -export function replaceAll(field: string, find: string, replace: string): ReplaceAll; - -// @beta (undocumented) -export class ReplaceFirst extends FirestoreFunction { - constructor(value: Accumulator, find: Accumulator, replace: Accumulator); - } +export function replaceAll(value: Expr, find: Expr, replace: Expr): FunctionExpr; // @beta -export function replaceFirst(value: Accumulator, find: string, replace: string): ReplaceFirst; +export function replaceAll(fieldName: string, find: string, replace: string): FunctionExpr; // @beta -export function replaceFirst(value: Accumulator, find: Accumulator, replace: Accumulator): ReplaceFirst; +export function replaceFirst(value: Expr, find: string, replace: string): FunctionExpr; // @beta -export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; +export function replaceFirst(value: Expr, find: Expr, replace: Expr): FunctionExpr; -// @beta (undocumented) -export class Reverse extends FirestoreFunction { - constructor(value: Accumulator); - } +// @beta +export function replaceFirst(fieldName: string, find: string, replace: string): FunctionExpr; // @beta -export function reverse(expr: Accumulator): Reverse; +export function reverse(stringExpression: Expr): FunctionExpr; // @beta -export function reverse(field: string): Reverse; +export function reverse(field: string): FunctionExpr; // @beta (undocumented) export class Select implements Stage { - constructor(projections: Map); + constructor(projections: Map); // (undocumented) name: string; } // @beta export interface Selectable { - add(other: Accumulator): Add; - add(other: any): Add; - arrayConcat(...arrays: Accumulator[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Accumulator): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Accumulator[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Accumulator[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Accumulator): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Accumulator): Divide; - divide(other: any): Divide; - dotProduct(other: Accumulator): DotProduct; - dotProduct(other: VectorValue): DotProduct; - // (undocumented) - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Accumulator): EndsWith; - eq(other: Accumulator): Eq; - eq(other: any): Eq; - eqAny(...others: Accumulator[]): EqAny; // (undocumented) - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Accumulator): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - // (undocumented) - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - exprType: ExprType; - gt(other: Accumulator): Gt; - gt(other: any): Gt; - gte(other: Accumulator): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - // (undocumented) - like(pattern: Accumulator): Like; - logicalMaximum(other: Accumulator): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Accumulator): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Accumulator): Lt; - lt(other: any): Lt; - lte(other: Accumulator): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Accumulator): Mod; - mod(other: any): Mod; - multiply(other: Accumulator): Multiply; - multiply(other: any): Multiply; - neq(other: Accumulator): Neq; - neq(other: any): Neq; - notEqAny(...others: Accumulator[]): FirestoreFunction; + readonly alias: string; // (undocumented) - notEqAny(...others: any[]): FirestoreFunction; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Accumulator): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Accumulator): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Accumulator, replace: Accumulator): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Accumulator, replace: Accumulator): ReplaceFirst; - reverse(): Reverse; + readonly expr: Expr; // (undocumented) selectable: true; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Accumulator): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Accumulator): StrContains; - subtract(other: Accumulator): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Accumulator, amount: Accumulator): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Accumulator, amount: Accumulator): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; } // @beta (undocumented) @@ -1780,240 +1162,153 @@ export interface Stage { name: string; } -// @beta (undocumented) -export class StartsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, prefix: Accumulator); - // (undocumented) - filterable: true; - } - // @beta -export function startsWith(expr: string, prefix: string): StartsWith; +export function startsWith(fieldName: string, prefix: string): BooleanExpr; // @beta -export function startsWith(expr: string, prefix: Accumulator): StartsWith; +export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; // @beta -export function startsWith(expr: Accumulator, prefix: string): StartsWith; +export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; // @beta -export function startsWith(expr: Accumulator, prefix: Accumulator): StartsWith; - -// @beta (undocumented) -export class StrConcat extends FirestoreFunction { - constructor(first: Accumulator, rest: Accumulator[]); - } +export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; // @beta -export function strConcat(first: string, ...elements: Array): StrConcat; +export function strConcat(fieldName: string, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; // @beta -export function strConcat(first: Accumulator, ...elements: Array): StrConcat; - -// @beta (undocumented) -export class StrContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Accumulator, substring: Accumulator); - // (undocumented) - filterable: true; - } +export function strConcat(firstString: Expr, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; // @beta -export function strContains(left: string, substring: string): StrContains; +export function strContains(fieldName: string, substring: string): BooleanExpr; // @beta -export function strContains(left: string, substring: Accumulator): StrContains; +export function strContains(fieldName: string, substring: Expr): BooleanExpr; // @beta -export function strContains(left: Accumulator, substring: string): StrContains; +export function strContains(stringExpression: Expr, substring: string): BooleanExpr; // @beta -export function strContains(left: Accumulator, substring: Accumulator): StrContains; - -// @beta (undocumented) -export class Subtract extends FirestoreFunction { - constructor(left: Accumulator, right: Accumulator); - } +export function strContains(stringExpression: Expr, substring: Expr): BooleanExpr; // @beta -export function subtract(left: Accumulator, right: Accumulator): Subtract; +export function substr(field: string, position: number, length?: number): FunctionExpr; // @beta -export function subtract(left: Accumulator, right: any): Subtract; +export function substr(input: Expr, position: number, length?: number): FunctionExpr; // @beta -export function subtract(left: string, right: Accumulator): Subtract; +export function substr(field: string, position: Expr, length?: Expr): FunctionExpr; // @beta -export function subtract(left: string, right: any): Subtract; - -// @beta (undocumented) -export class Sum extends FirestoreFunction implements Accumulator { - constructor(value: Accumulator, distinct: boolean); - // (undocumented) - accumulator: true; - } - -// @beta (undocumented) -export class TimestampAdd extends FirestoreFunction { - constructor(timestamp: Accumulator, unit: Accumulator, amount: Accumulator); - } +export function substr(input: Expr, position: Expr, length?: Expr): FunctionExpr; // @beta -export function timestampAdd(timestamp: Accumulator, unit: Accumulator, amount: Accumulator): TimestampAdd; +export function subtract(left: Expr, right: Expr): FunctionExpr; // @beta -export function timestampAdd(timestamp: Accumulator, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +export function subtract(expression: Expr, value: unknown): FunctionExpr; // @beta -export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - -// @beta (undocumented) -export class TimestampSub extends FirestoreFunction { - constructor(timestamp: Accumulator, unit: Accumulator, amount: Accumulator); - } +export function subtract(fieldName: string, expression: Expr): FunctionExpr; // @beta -export function timestampSub(timestamp: Accumulator, unit: Accumulator, amount: Accumulator): TimestampSub; +export function subtract(fieldName: string, value: unknown): FunctionExpr; // @beta -export function timestampSub(timestamp: Accumulator, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; // @beta -export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - -// @beta (undocumented) -export class TimestampToUnixMicros extends FirestoreFunction { - constructor(input: Accumulator); - } +export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMicros(expr: Accumulator): TimestampToUnixMicros; +export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMicros(field: string): TimestampToUnixMicros; - -// @beta (undocumented) -export class TimestampToUnixMillis extends FirestoreFunction { - constructor(input: Accumulator); - } +export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; // @beta -export function timestampToUnixMillis(expr: Accumulator): TimestampToUnixMillis; +export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMillis(field: string): TimestampToUnixMillis; - -// @beta (undocumented) -export class TimestampToUnixSeconds extends FirestoreFunction { - constructor(input: Accumulator); - } +export function timestampSub(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixSeconds(expr: Accumulator): TimestampToUnixSeconds; +export function timestampToUnixMicros(expr: Expr): FunctionExpr; // @beta -export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; - -// @beta (undocumented) -export class ToLower extends FirestoreFunction { - constructor(expr: Accumulator); - } +export function timestampToUnixMicros(fieldName: string): FunctionExpr; // @beta -export function toLower(expr: string): ToLower; +export function timestampToUnixMillis(expr: Expr): FunctionExpr; // @beta -export function toLower(expr: Accumulator): ToLower; - -// @beta (undocumented) -export class ToUpper extends FirestoreFunction { - constructor(expr: Accumulator); - } +export function timestampToUnixMillis(fieldName: string): FunctionExpr; // @beta -export function toUpper(expr: string): ToUpper; +export function timestampToUnixSeconds(expr: Expr): FunctionExpr; // @beta -export function toUpper(expr: Accumulator): ToUpper; - -// @beta (undocumented) -export class Trim extends FirestoreFunction { - constructor(expr: Accumulator); - } +export function timestampToUnixSeconds(fieldName: string): FunctionExpr; // @beta -export function trim(expr: string): Trim; +export function toLower(fieldName: string): FunctionExpr; // @beta -export function trim(expr: Accumulator): Trim; +export function toLower(stringExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class UnixMicrosToTimestamp extends FirestoreFunction { - constructor(input: Accumulator); - } +// @beta +export function toUpper(fieldName: string): FunctionExpr; // @beta -export function unixMicrosToTimestamp(expr: Accumulator): UnixMicrosToTimestamp; +export function toUpper(stringExpression: Expr): FunctionExpr; // @beta -export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; +export function trim(fieldName: string): FunctionExpr; -// @beta (undocumented) -export class UnixMillisToTimestamp extends FirestoreFunction { - constructor(input: Accumulator); - } +// @beta +export function trim(stringExpression: Expr): FunctionExpr; // @beta -export function unixMillisToTimestamp(expr: Accumulator): UnixMillisToTimestamp; +export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; // @beta -export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; +export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; -// @beta (undocumented) -export class UnixSecondsToTimestamp extends FirestoreFunction { - constructor(input: Accumulator); - } +// @beta +export function unixMillisToTimestamp(expr: Expr): FunctionExpr; // @beta -export function unixSecondsToTimestamp(expr: Accumulator): UnixSecondsToTimestamp; +export function unixMillisToTimestamp(fieldName: string): FunctionExpr; // @beta -export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; +export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; -// @beta (undocumented) -export class VectorLength extends FirestoreFunction { - constructor(value: Accumulator); - } +// @beta +export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; // @beta -export function vectorLength(expr: Accumulator): VectorLength; +export function vectorLength(vectorExpression: Expr): FunctionExpr; // @beta -export function vectorLength(field: string): VectorLength; +export function vectorLength(fieldName: string): FunctionExpr; // @beta (undocumented) export class Where implements Stage { - constructor(condition: FilterCondition); + constructor(condition: BooleanExpr); // (undocumented) name: string; } -// @beta (undocumented) -export class Xor extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); - // (undocumented) - filterable: true; -} - // @beta -export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor; +export function xor(first: BooleanExpr, second: BooleanExpr, ...additionalConditions: BooleanExpr[]): BooleanExpr; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10253:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10254:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:10283:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:4613:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:4614:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta // (No @packageDocumentation comment for this package) diff --git a/common/api-review/firestore-pipelines.api.md b/common/api-review/firestore-pipelines.api.md index 375f5dfd976..baedbf6b08a 100644 --- a/common/api-review/firestore-pipelines.api.md +++ b/common/api-review/firestore-pipelines.api.md @@ -7,30 +7,10 @@ import { FirebaseApp } from '@firebase/app'; // @beta -export interface Accumulator extends Expr { - // (undocumented) - accumulator: true; -} - -// @beta -export type AccumulatorTarget = ExprWithAlias; - -// @beta (undocumented) -export class Add extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +export function add(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function add(left: Expr, right: Expr): Add; - -// @beta -export function add(left: Expr, right: any): Add; - -// @beta -export function add(left: string, right: Expr): Add; - -// @beta -export function add(left: string, right: any): Add; +export function add(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta (undocumented) export class AddFields implements Stage { @@ -41,150 +21,190 @@ export class AddFields implements Stage { // @beta (undocumented) export class Aggregate implements Stage { - constructor(accumulators: Map, groups: Map); + constructor(accumulators: Map, groups: Map); // (undocumented) name: string; } -// @beta (undocumented) -export class And extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); +// @beta +export class AggregateFunction { + constructor(name: string, params: Expr[]); + as(name: string): AggregateWithAlias; // (undocumented) - filterable: true; + exprType: ExprType; + } + +// @beta +export class AggregateWithAlias { + constructor(aggregate: AggregateFunction, alias: string); + // (undocumented) + readonly aggregate: AggregateFunction; + // (undocumented) + readonly alias: string; } // @beta -export function andFunction(left: FilterCondition, ...right: FilterCondition[]): And; +export function and(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; -// @beta (undocumented) -export class ArrayConcat extends FirestoreFunction { - constructor(array: Expr, elements: Expr[]); - } +// @beta +export function array(elements: unknown[]): FunctionExpr; // @beta -export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; +export function arrayConcat(firstArray: Expr, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; // @beta -export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; +export function arrayConcat(firstArrayField: string, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; // @beta -export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; +export function arrayContains(array: Expr, element: Expr): FunctionExpr; // @beta -export function arrayConcat(array: string, elements: any[]): ArrayConcat; +export function arrayContains(array: Expr, element: unknown): FunctionExpr; -// @beta (undocumented) -export class ArrayContains extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, element: Expr); - // (undocumented) - filterable: true; -} +// @beta +export function arrayContains(fieldName: string, element: Expr): FunctionExpr; // @beta -export function arrayContains(array: Expr, element: Expr): ArrayContains; +export function arrayContains(fieldName: string, element: unknown): BooleanExpr; // @beta -export function arrayContains(array: Expr, element: any): ArrayContains; +export function arrayContainsAll(array: Expr, values: Array): BooleanExpr; // @beta -export function arrayContains(array: string, element: Expr): ArrayContains; +export function arrayContainsAll(fieldName: string, values: Array): BooleanExpr; // @beta -export function arrayContains(array: string, element: any): ArrayContains; +export function arrayContainsAll(array: Expr, arrayExpression: Expr): BooleanExpr; -// @beta (undocumented) -export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, values: Expr[]); - // (undocumented) - filterable: true; - } +// @beta +export function arrayContainsAll(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta -export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; +export function arrayContainsAny(array: Expr, values: Array): BooleanExpr; // @beta -export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; +export function arrayContainsAny(fieldName: string, values: Array): BooleanExpr; // @beta -export function arrayContainsAll(array: string, values: Expr[]): ArrayContainsAll; +export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; // @beta -export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; +export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; -// @beta (undocumented) -export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, values: Expr[]); - // (undocumented) - filterable: true; - } +// @beta +export function arrayLength(array: Expr): FunctionExpr; // @beta -export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; +export function arrayOffset(arrayField: string, offset: number): FunctionExpr; // @beta -export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; +export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; // @beta -export function arrayContainsAny(array: string, values: Expr[]): ArrayContainsAny; +export function arrayOffset(arrayExpression: Expr, offset: number): FunctionExpr; // @beta -export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; +export function arrayOffset(arrayExpression: Expr, offsetExpr: Expr): FunctionExpr; -// @beta (undocumented) -export class ArrayElement extends FirestoreFunction { - constructor(); -} +// @beta +export function ascending(expr: Expr): Ordering; -// @beta (undocumented) -export class ArrayLength extends FirestoreFunction { - constructor(array: Expr); - } +// @beta +export function ascending(fieldName: string): Ordering; // @beta -export function arrayLength(array: Expr): ArrayLength; +export function avg(expression: Expr): AggregateFunction; -// @beta (undocumented) -export class ArrayReverse extends FirestoreFunction { - constructor(array: Expr); - } +// @beta +export function avg(fieldName: string): AggregateFunction; +// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts +// // @beta -export function ascending(expr: Expr): Ordering; +export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; -// @beta (undocumented) -export class Avg extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } +// @beta +export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; // @beta -export function avgFunction(value: Expr): Avg; +export function bitAnd(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; // @beta -export function avgFunction(value: string): Avg; +export function bitAnd(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class ByteLength extends FirestoreFunction { - constructor(value: Expr); - } +// @beta +export function bitLeftShift(field: string, y: number): FunctionExpr; // @beta -export function byteLength(expr: Expr): ByteLength; +export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; // @beta -export function byteLength(field: string): ByteLength; +export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; -// @beta (undocumented) -export class CharLength extends FirestoreFunction { - constructor(value: Expr); - } +// @beta +export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; + +// @beta +export function bitNot(field: string): FunctionExpr; + +// @beta +export function bitNot(bitsValueExpression: Expr): FunctionExpr; // @beta -export function charLength(field: string): CharLength; +export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; // @beta -export function charLength(expr: Expr): CharLength; +export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; + +// @beta +export function bitOr(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; + +// @beta +export function bitOr(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; + +// @beta +export function bitRightShift(field: string, y: number): FunctionExpr; + +// @beta +export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; + +// @beta +export function bitRightShift(xValue: Expr, y: number): FunctionExpr; + +// @beta +export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; + +// @beta +export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; + +// @beta +export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; + +// @beta +export function bitXor(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; + +// @beta +export function bitXor(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; + +// @beta +export class BooleanExpr extends FunctionExpr { + countIf(): AggregateFunction; + // (undocumented) + filterable: true; + not(): BooleanExpr; +} + +// @beta +export function byteLength(expr: Expr): FunctionExpr; + +// @beta +export function byteLength(fieldName: string): FunctionExpr; + +// @beta +export function charLength(fieldName: string): FunctionExpr; + +// @beta +export function charLength(stringExpression: Expr): FunctionExpr; // @beta (undocumented) export class CollectionGroupSource implements Stage { @@ -200,80 +220,97 @@ export class CollectionSource implements Stage { name: string; } -// @beta (undocumented) -export class Cond extends FirestoreFunction { - constructor(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr); - // (undocumented) - filterable: true; - } - // @beta -export function cond(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr): Cond; +export function cond(condition: BooleanExpr, thenExpr: Expr, elseExpr: Expr): FunctionExpr; // @beta export class Constant extends Expr { // (undocumented) - exprType: ExprType; - static of(value: number): Constant; - static of(value: string): Constant; - static of(value: boolean): Constant; - static of(value: null): Constant; - static of(value: undefined): Constant; - // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts - static of(value: GeoPoint): Constant; - // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts - static of(value: Timestamp): Constant; - static of(value: Date): Constant; - static of(value: Uint8Array): Constant; - // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts - static of(value: DocumentReference): Constant; - static of(value: any[]): Constant; - static of(value: Map): Constant; - // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts - static of(value: VectorValue): Constant; - static vector(value: number[] | VectorValue): Constant; -} - -// @beta (undocumented) -export class CosineDistance extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); + readonly exprType: ExprType; } -// @beta -export function cosineDistance(expr: string, other: number[]): CosineDistance; +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: number): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: string): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: boolean): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: null): Constant; + +// Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: GeoPoint): Constant; + +// Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Timestamp): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Date): Constant; + +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: Bytes): Constant; + +// Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: DocumentReference): Constant; + +// Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// +// @public +export function constant(value: VectorValue): Constant; // @beta -export function cosineDistance(expr: string, other: VectorValue): CosineDistance; +export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function cosineDistance(expr: string, other: Expr): CosineDistance; +export function cosineDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function cosineDistance(expr: Expr, other: number[]): CosineDistance; +export function cosineDistance(vectorExpression: Expr, vector: number[] | Expr): FunctionExpr; // @beta -export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; +export function cosineDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function cosineDistance(expr: Expr, other: Expr): CosineDistance; +export function count(expression: Expr): AggregateFunction; -// @beta (undocumented) -export class Count extends FirestoreFunction implements Accumulator { - constructor(value: Expr | undefined, distinct: boolean); - // (undocumented) - accumulator: true; - } +// Warning: (ae-incompatible-release-tags) The symbol "count" is marked as @public, but its signature references "AggregateFunction" which is marked as @beta +// +// @public +export function count(fieldName: string): AggregateFunction; // @beta -export function countAll(): Count; +export function countAll(): AggregateFunction; // @beta -export function countFunction(value: Expr): Count; +export function countIf(booleanExpr: BooleanExpr): AggregateFunction; -// Warning: (ae-incompatible-release-tags) The symbol "countFunction" is marked as @public, but its signature references "Count" which is marked as @beta -// -// @public -export function countFunction(value: string): Count; +// @beta +export function currentContext(): FunctionExpr; // @beta (undocumented) export class DatabaseSource implements Stage { @@ -284,6 +321,9 @@ export class DatabaseSource implements Stage { // @beta export function descending(expr: Expr): Ordering; +// @beta +export function descending(fieldName: string): Ordering; + // @beta (undocumented) export class Distinct implements Stage { constructor(groups: Map); @@ -291,22 +331,23 @@ export class Distinct implements Stage { name: string; } -// @beta (undocumented) -export class Divide extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +// @beta +export function divide(left: Expr, right: Expr): FunctionExpr; // @beta -export function divide(left: Expr, right: Expr): Divide; +export function divide(expression: Expr, value: unknown): FunctionExpr; // @beta -export function divide(left: Expr, right: any): Divide; +export function divide(fieldName: string, expressions: Expr): FunctionExpr; // @beta -export function divide(left: string, right: Expr): Divide; +export function divide(fieldName: string, value: unknown): FunctionExpr; // @beta -export function divide(left: string, right: any): Divide; +export function documentId(documentPath: string | DocumentReference): FunctionExpr; + +// @beta +export function documentId(documentPathExpr: Expr): FunctionExpr; // @beta (undocumented) export class DocumentsSource implements Stage { @@ -314,239 +355,320 @@ export class DocumentsSource implements Stage { // (undocumented) name: string; // (undocumented) - static of(refs: DocumentReference[]): DocumentsSource; + static of(refs: Array): DocumentsSource; } -// @beta (undocumented) -export class DotProduct extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); - } - -// @beta -export function dotProduct(expr: string, other: number[]): DotProduct; - // @beta -export function dotProduct(expr: string, other: VectorValue): DotProduct; +export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function dotProduct(expr: string, other: Expr): DotProduct; +export function dotProduct(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function dotProduct(expr: Expr, other: number[]): DotProduct; +export function dotProduct(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function dotProduct(expr: Expr, other: VectorValue): DotProduct; +export function dotProduct(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function dotProduct(expr: Expr, other: Expr): DotProduct; - -// @beta (undocumented) -export class EndsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, suffix: Expr); - // (undocumented) - filterable: true; - } +export function endsWith(fieldName: string, suffix: string): BooleanExpr; // @beta -export function endsWith(expr: string, suffix: string): EndsWith; +export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; // @beta -export function endsWith(expr: string, suffix: Expr): EndsWith; +export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; // @beta -export function endsWith(expr: Expr, suffix: string): EndsWith; +export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; // @beta -export function endsWith(expr: Expr, suffix: Expr): EndsWith; - -// @beta (undocumented) -export class Eq extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } +export function eq(left: Expr, right: Expr): BooleanExpr; // @beta -export function eq(left: Expr, right: Expr): Eq; +export function eq(expression: Expr, value: unknown): BooleanExpr; // @beta -export function eq(left: Expr, right: any): Eq; +export function eq(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function eq(left: string, right: Expr): Eq; +export function eq(fieldName: string, value: unknown): BooleanExpr; // @beta -export function eq(left: string, right: any): Eq; - -// @beta (undocumented) -export class EqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, others: Expr[]); - // (undocumented) - filterable: true; - } +export function eqAny(expression: Expr, values: Array): BooleanExpr; // @beta -export function eqAny(element: Expr, others: Expr[]): EqAny; +export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; // @beta -export function eqAny(element: Expr, others: any[]): EqAny; +export function eqAny(fieldName: string, values: Array): BooleanExpr; // @beta -export function eqAny(element: string, others: Expr[]): EqAny; +export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta -export function eqAny(element: string, others: any[]): EqAny; - -// @beta (undocumented) -export class EuclideanDistance extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); - } +export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; +export function euclideanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; +export function euclideanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: number[]): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: VectorValue): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; - -// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta -// -// @public (undocumented) -export function execute(pipeline: Pipeline): Promise; +export function euclideanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class Exists extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} +// @public +export function execute(pipeline: Pipeline): Promise; // @beta -export function exists(value: Expr): Exists; +export function exists(value: Expr): BooleanExpr; // @beta -export function exists(field: string): Exists; +export function exists(fieldName: string): BooleanExpr; // @beta export abstract class Expr { - add(other: Expr): Add; - add(other: any): Add; - arrayConcat(...arrays: Expr[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Expr): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Expr[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Expr[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; + add(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayConcat(secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayContains(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContains(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAll(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAll(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayContainsAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + arrayLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayOffset(offset: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + arrayOffset(offsetExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + as(name: string): ExprWithAlias; + /* Excluded from this release type: _readUserData */ ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Expr): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; + /* Excluded from this release type: _readUserData */ + avg(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + bitAnd(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitAnd(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitLeftShift(y: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitLeftShift(numberExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitNot(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitOr(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitOr(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitRightShift(y: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitRightShift(numberExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitXor(otherBits: number | Bytes): FunctionExpr; + /* Excluded from this release type: _readUserData */ + bitXor(bitsExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + byteLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + charLength(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + cosineDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + cosineDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + count(): AggregateFunction; + /* Excluded from this release type: _readUserData */ descending(): Ordering; - divide(other: Expr): Divide; - divide(other: any): Divide; - dotProduct(other: Expr): DotProduct; - dotProduct(other: VectorValue): DotProduct; - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Expr): EndsWith; - eq(other: Expr): Eq; - eq(other: any): Eq; - eqAny(...others: Expr[]): EqAny; - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Expr): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - abstract exprType: ExprType; - gt(other: Expr): Gt; - gt(other: any): Gt; - gte(other: Expr): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - like(pattern: Expr): Like; - logicalMaximum(other: Expr): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Expr): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Expr): Lt; - lt(other: any): Lt; - lte(other: Expr): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Expr): Mod; - mod(other: any): Mod; - multiply(other: Expr): Multiply; - multiply(other: any): Multiply; - neq(other: Expr): Neq; - neq(other: any): Neq; - notEqAny(...others: Expr[]): NotEqAny; - notEqAny(...others: any[]): NotEqAny; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Expr): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Expr): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Expr, replace: Expr): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Expr, replace: Expr): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Expr): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Expr): StrContains; - subtract(other: Expr): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Expr, amount: Expr): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Expr, amount: Expr): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; + /* Excluded from this release type: _readUserData */ + divide(other: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + divide(other: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + documentId(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + dotProduct(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + dotProduct(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + endsWith(suffix: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + endsWith(suffix: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eq(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eq(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eqAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + eqAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + euclideanDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + euclideanDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + exists(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + // (undocumented) + abstract readonly exprType: ExprType; + /* Excluded from this release type: _readUserData */ + gt(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gt(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gte(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + gte(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + ifError(catchExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + ifError(catchValue: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + isAbsent(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isError(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNan(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNotNan(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNotNull(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + isNull(): BooleanExpr; + /* Excluded from this release type: _readUserData */ + like(pattern: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + like(pattern: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + logicalMaximum(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + logicalMinimum(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + lt(experession: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lt(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lte(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + lte(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + manhattanDistance(vector: VectorValue | number[]): FunctionExpr; + /* Excluded from this release type: _readUserData */ + manhattanDistance(vectorExpression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapGet(subfield: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapMerge(secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapRemove(key: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mapRemove(keyExpr: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + maximum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + minimum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + mod(expression: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + mod(value: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + multiply(second: Expr | unknown, ...others: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + neq(expression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + neq(value: unknown): BooleanExpr; + /* Excluded from this release type: _readUserData */ + notEqAny(values: Array): BooleanExpr; + /* Excluded from this release type: _readUserData */ + notEqAny(arrayExpression: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexContains(pattern: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexContains(pattern: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexMatch(pattern: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + regexMatch(pattern: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + replaceAll(find: string, replace: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceAll(find: Expr, replace: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceFirst(find: string, replace: string): FunctionExpr; + /* Excluded from this release type: _readUserData */ + replaceFirst(find: Expr, replace: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + reverse(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + startsWith(prefix: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + startsWith(prefix: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + strConcat(secondString: Expr | string, ...otherStrings: Array): FunctionExpr; + /* Excluded from this release type: _readUserData */ + strContains(substring: string): BooleanExpr; + /* Excluded from this release type: _readUserData */ + strContains(expr: Expr): BooleanExpr; + /* Excluded from this release type: _readUserData */ + substr(position: number, length?: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + substr(position: Expr, length?: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + subtract(other: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + subtract(other: unknown): FunctionExpr; + /* Excluded from this release type: _readUserData */ + sum(): AggregateFunction; + /* Excluded from this release type: _readUserData */ + timestampAdd(unit: Expr, amount: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampSub(unit: Expr, amount: Expr): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixMicros(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixMillis(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + timestampToUnixSeconds(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + toLower(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + toUpper(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + trim(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixMicrosToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixMillisToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + unixSecondsToTimestamp(): FunctionExpr; + /* Excluded from this release type: _readUserData */ + vectorLength(): FunctionExpr; } // @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; +export type ExprType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExprs' | 'ExprWithAlias'; // @beta (undocumented) -export class ExprWithAlias extends Expr implements Selectable { - constructor(expr: T, alias: string); +export class ExprWithAlias implements Selectable { + constructor(expr: Expr, alias: string); // (undocumented) readonly alias: string; // (undocumented) - readonly expr: T; + readonly expr: Expr; // (undocumented) exprType: ExprType; // (undocumented) @@ -556,39 +678,27 @@ export class ExprWithAlias extends Expr implements Selectable { // @beta export class Field extends Expr implements Selectable { // (undocumented) - exprType: ExprType; + get alias(): string; // (undocumented) - fieldName(): string; - static of(name: string): Field; - // Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts - // + get expr(): Expr; // (undocumented) - static of(path: FieldPath): Field; + readonly exprType: ExprType; // (undocumented) - static of(pipeline: Pipeline, name: string): Field; + fieldName(): string; // (undocumented) selectable: true; } -// @beta (undocumented) -export class Fields extends Expr implements Selectable { - // (undocumented) - exprType: ExprType; - // (undocumented) - fieldList(): Field[]; - // (undocumented) - static of(name: string, ...others: string[]): Fields; - // (undocumented) - static ofAll(): Fields; - // (undocumented) - selectable: true; -} +// Warning: (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// +// @public +export function field(name: string): Field; -// @beta -export interface FilterCondition extends Expr { - // (undocumented) - filterable: true; -} +// Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// +// @public (undocumented) +export function field(path: FieldPath): Field; // @beta (undocumented) export class FindNearest implements Stage { @@ -603,7 +713,7 @@ export interface FindNearestOptions { // (undocumented) distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; // (undocumented) - field: Field; + field: Field | string; // (undocumented) limit?: number; // (undocumented) @@ -611,91 +721,92 @@ export interface FindNearestOptions { } // @beta -export class FirestoreFunction extends Expr { +export class FunctionExpr extends Expr { constructor(name: string, params: Expr[]); // (undocumented) - exprType: ExprType; + readonly exprType: ExprType; } -// @beta -export function genericFunction(name: string, params: Expr[]): FirestoreFunction; - // @beta (undocumented) export class GenericStage implements Stage { - constructor(name: string, params: unknown[]); // (undocumented) name: string; -} - -// @beta (undocumented) -export class Gt extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; } // @beta -export function gt(left: Expr, right: Expr): Gt; +export function gt(left: Expr, right: Expr): BooleanExpr; // @beta -export function gt(left: Expr, right: any): Gt; +export function gt(expression: Expr, value: unknown): BooleanExpr; // @beta -export function gt(left: string, right: Expr): Gt; +export function gt(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function gt(left: string, right: any): Gt; +export function gt(fieldName: string, value: unknown): BooleanExpr; -// @beta (undocumented) -export class Gte extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } +// @beta +export function gte(left: Expr, right: Expr): BooleanExpr; // @beta -export function gte(left: Expr, right: Expr): Gte; +export function gte(expression: Expr, value: unknown): BooleanExpr; // @beta -export function gte(left: Expr, right: any): Gte; +export function gte(fieldName: string, value: Expr): BooleanExpr; // @beta -export function gte(left: string, right: Expr): Gte; +export function gte(fieldName: string, value: unknown): BooleanExpr; // @beta -export function gte(left: string, right: any): Gte; +export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; -// @beta (undocumented) -export class IsNan extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} +// @beta +export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; // @beta -export function isNan(value: Expr): IsNan; +export function isAbsent(value: Expr): BooleanExpr; // @beta -export function isNan(value: string): IsNan; +export function isAbsent(field: string): BooleanExpr; -// @beta (undocumented) -export class Like extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } +// @beta +export function isError(value: Expr): BooleanExpr; + +// @beta +export function isNan(value: Expr): BooleanExpr; // @beta -export function like(left: string, pattern: string): Like; +export function isNan(fieldName: string): BooleanExpr; // @beta -export function like(left: string, pattern: Expr): Like; +export function isNotNan(value: Expr): BooleanExpr; // @beta -export function like(left: Expr, pattern: string): Like; +export function isNotNan(value: string): BooleanExpr; // @beta -export function like(left: Expr, pattern: Expr): Like; +export function isNotNull(value: Expr): BooleanExpr; + +// @beta +export function isNotNull(value: string): BooleanExpr; + +// @beta +export function isNull(value: Expr): BooleanExpr; + +// @beta +export function isNull(value: string): BooleanExpr; + +// @beta +export function like(fieldName: string, pattern: string): BooleanExpr; + +// @beta +export function like(fieldName: string, pattern: Expr): BooleanExpr; + +// @beta +export function like(stringExpression: Expr, pattern: string): BooleanExpr; + +// @beta +export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta (undocumented) export class Limit implements Stage { @@ -708,199 +819,140 @@ export class Limit implements Stage { name: string; } -// @beta (undocumented) -export class LogicalMaximum extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +// @beta +export function logicalMaximum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; +export function logicalMaximum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: Expr, right: any): LogicalMaximum; +export function logicalMinimum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: string, right: Expr): LogicalMaximum; +export function logicalMinimum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function logicalMaximum(left: string, right: any): LogicalMaximum; +export function lt(left: Expr, right: Expr): BooleanExpr; -// @beta (undocumented) -export class LogicalMinimum extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +// @beta +export function lt(expression: Expr, value: unknown): BooleanExpr; // @beta -export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; +export function lt(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function logicalMinimum(left: Expr, right: any): LogicalMinimum; +export function lt(fieldName: string, value: unknown): BooleanExpr; // @beta -export function logicalMinimum(left: string, right: Expr): LogicalMinimum; +export function lte(left: Expr, right: Expr): BooleanExpr; // @beta -export function logicalMinimum(left: string, right: any): LogicalMinimum; +export function lte(expression: Expr, value: unknown): BooleanExpr; -// @beta (undocumented) -export class Lt extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta +// +// @public +export function lte(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function lt(left: Expr, right: Expr): Lt; +export function lte(fieldName: string, value: unknown): BooleanExpr; // @beta -export function lt(left: Expr, right: any): Lt; +export function manhattanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; // @beta -export function lt(left: string, right: Expr): Lt; +export function manhattanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; // @beta -export function lt(left: string, right: any): Lt; - -// @beta (undocumented) -export class Lte extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } +export function manhattanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; // @beta -export function lte(left: Expr, right: Expr): Lte; +export function manhattanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; // @beta -export function lte(left: Expr, right: any): Lte; - -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta -// -// @public -export function lte(left: string, right: Expr): Lte; +export function map(elements: Record): FunctionExpr; // @beta -export function lte(left: string, right: any): Lte; - -// @beta (undocumented) -export class MapGet extends FirestoreFunction { - constructor(map: Expr, name: string); -} +export function mapGet(fieldName: string, subField: string): FunctionExpr; // @beta -export function mapGet(mapField: string, subField: string): MapGet; +export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; // @beta -export function mapGet(mapExpr: Expr, subField: string): MapGet; - -// @beta (undocumented) -export class Maximum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } +export function mapMerge(mapField: string, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; // @beta -export function maximum(value: Expr): Maximum; +export function mapMerge(firstMap: Record | Expr, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; // @beta -export function maximum(value: string): Maximum; - -// @beta (undocumented) -export class Minimum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } +export function mapRemove(mapField: string, key: string): FunctionExpr; // @beta -export function minimum(value: Expr): Minimum; +export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; // @beta -export function minimum(value: string): Minimum; - -// @beta (undocumented) -export class Mod extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; // @beta -export function mod(left: Expr, right: Expr): Mod; +export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; // @beta -export function mod(left: Expr, right: any): Mod; +export function maximum(expression: Expr): AggregateFunction; // @beta -export function mod(left: string, right: Expr): Mod; +export function maximum(fieldName: string): AggregateFunction; // @beta -export function mod(left: string, right: any): Mod; - -// @beta (undocumented) -export class Multiply extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +export function minimum(expression: Expr): AggregateFunction; // @beta -export function multiply(left: Expr, right: Expr): Multiply; +export function minimum(fieldName: string): AggregateFunction; // @beta -export function multiply(left: Expr, right: any): Multiply; +export function mod(left: Expr, right: Expr): FunctionExpr; // @beta -export function multiply(left: string, right: Expr): Multiply; +export function mod(expression: Expr, value: unknown): FunctionExpr; // @beta -export function multiply(left: string, right: any): Multiply; +export function mod(fieldName: string, expression: Expr): FunctionExpr; -// @beta (undocumented) -export class Neq extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } +// @beta +export function mod(fieldName: string, value: unknown): FunctionExpr; // @beta -export function neq(left: Expr, right: Expr): Neq; +export function multiply(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function neq(left: Expr, right: any): Neq; +export function multiply(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; // @beta -export function neq(left: string, right: Expr): Neq; +export function neq(left: Expr, right: Expr): BooleanExpr; // @beta -export function neq(left: string, right: any): Neq; +export function neq(expression: Expr, value: unknown): BooleanExpr; -// @beta (undocumented) -export class Not extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} +// @beta +export function neq(fieldName: string, expression: Expr): BooleanExpr; // @beta -export function not(filter: FilterCondition): Not; +export function neq(fieldName: string, value: unknown): BooleanExpr; -// @beta (undocumented) -export class NotEqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, others: Expr[]); - // (undocumented) - filterable: true; - } +// @beta +export function not(booleanExpr: BooleanExpr): BooleanExpr; // @beta -export function notEqAny(element: Expr, others: Expr[]): NotEqAny; +export function notEqAny(element: Expr, values: Array): BooleanExpr; // @beta -export function notEqAny(element: Expr, others: any[]): NotEqAny; +export function notEqAny(fieldName: string, values: Array): BooleanExpr; // @beta -export function notEqAny(element: string, others: Expr[]): NotEqAny; +export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; // @beta -export function notEqAny(element: string, others: any[]): NotEqAny; +export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; // @beta (undocumented) export class Offset implements Stage { @@ -909,12 +961,8 @@ export class Offset implements Stage { name: string; } -// @beta (undocumented) -export class Or extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); - // (undocumented) - filterable: true; -} +// @beta +export function or(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; // @beta export class Ordering { @@ -925,56 +973,46 @@ export class Ordering { readonly expr: Expr; } -// @beta -export function orFunction(left: FilterCondition, ...right: FilterCondition[]): Or; - // @public (undocumented) export class Pipeline { - /* Excluded from this release type: newPipeline */ // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta - addFields(...fields: Selectable[]): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; - aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; + addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta + aggregate(accumulator: AggregateWithAlias, ...additionalAccumulators: AggregateWithAlias[]): Pipeline; + aggregate(options: { accumulators: AggregateWithAlias[]; groups?: Array; }): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta - distinct(...groups: Array): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta - execute(): Promise; + distinct(group: string | Selectable, ...additionalGroups: Array): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta // // (undocumented) findNearest(options: FindNearestOptions): Pipeline; - genericStage(name: string, params: any[]): Pipeline; + genericStage(name: string, params: unknown[]): Pipeline; limit(limit: number): Pipeline; offset(offset: number): Pipeline; readUserData: any; + // Warning: (ae-incompatible-release-tags) The symbol "removeFields" is marked as @public, but its signature references "Field" which is marked as @beta + removeFields(fieldValue: Field | string, ...additionalFields: Array): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "replaceWith" is marked as @public, but its signature references "Field" which is marked as @beta + replaceWith(fieldValue: Field | string): Pipeline; + sample(documents: number): Pipeline; + sample(options: { percentage: number; } | { documents: number; }): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta - select(...selections: Array): Pipeline; + select(selection: Selectable | string, ...additionalSelections: Array): Pipeline; // (undocumented) selectablesToMap: any; // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta - sort(...orderings: Ordering[]): Pipeline; - // (undocumented) - sort(options: { orderings: Ordering[]; }): Pipeline; + sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; // (undocumented) stages: any; + union(other: Pipeline): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "unnest" is marked as @public, but its signature references "Selectable" which is marked as @beta + unnest(selectable: Selectable, indexField?: string): Pipeline; // (undocumented) userDataReader: any; - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta - where(condition: FilterCondition): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta + where(condition: BooleanExpr): Pipeline; } -// Warning: (ae-forgotten-export) The symbol "Firestore" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta -// -// @public -export function pipeline(firestore: Firestore): PipelineSource; - -// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts -// -// @public -export function pipeline(query: Query): Pipeline; - // Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts // // @beta @@ -984,103 +1022,93 @@ export class PipelineResult { /* Excluded from this release type: __constructor */ get createTime(): Timestamp | undefined; data(): AppModelType | undefined; - get executionTime(): Timestamp; - get(fieldPath: string | FieldPath): any; + get(fieldPath: string | FieldPath | Field): any; get id(): string | undefined; get ref(): DocumentReference | undefined; get updateTime(): Timestamp | undefined; } +// @public (undocumented) +export class PipelineSnapshot { + // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp); + get executionTime(): Timestamp; + get pipeline(): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "results" is marked as @public, but its signature references "PipelineResult" which is marked as @beta + get results(): PipelineResult[]; +} + // @beta export class PipelineSource { + collection(collectionPath: string): PipelineType; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + // Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts + collection(collectionReference: Query): PipelineType; /* Excluded from this release type: _createPipeline */ /* Excluded from this release type: __constructor */ - // (undocumented) - collection(collectionPath: string): PipelineType; - // (undocumented) collectionGroup(collectionId: string): PipelineType; - // (undocumented) + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + createFrom(query: Query): Pipeline; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ database(): PipelineType; - // (undocumented) - documents(docs: DocumentReference[]): PipelineType; + /* Excluded from this release type: _createPipeline */ + /* Excluded from this release type: __constructor */ + documents(docs: Array): PipelineType; } -// @beta (undocumented) -export class RegexContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } - // @beta -export function regexContains(left: string, pattern: string): RegexContains; +export function rand(): FunctionExpr; // @beta -export function regexContains(left: string, pattern: Expr): RegexContains; +export function regexContains(fieldName: string, pattern: string): BooleanExpr; // @beta -export function regexContains(left: Expr, pattern: string): RegexContains; +export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; // @beta -export function regexContains(left: Expr, pattern: Expr): RegexContains; - -// @beta (undocumented) -export class RegexMatch extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } +export function regexContains(stringExpression: Expr, pattern: string): BooleanExpr; // @beta -export function regexMatch(left: string, pattern: string): RegexMatch; +export function regexContains(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta -export function regexMatch(left: string, pattern: Expr): RegexMatch; +export function regexMatch(fieldName: string, pattern: string): BooleanExpr; // @beta -export function regexMatch(left: Expr, pattern: string): RegexMatch; +export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; // @beta -export function regexMatch(left: Expr, pattern: Expr): RegexMatch; - -// @beta (undocumented) -export class ReplaceAll extends FirestoreFunction { - constructor(value: Expr, find: Expr, replace: Expr); - } +export function regexMatch(stringExpression: Expr, pattern: string): BooleanExpr; // @beta -export function replaceAll(value: Expr, find: string, replace: string): ReplaceAll; +export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; // @beta -export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; +export function replaceAll(value: Expr, find: string, replace: string): FunctionExpr; // @beta -export function replaceAll(field: string, find: string, replace: string): ReplaceAll; - -// @beta (undocumented) -export class ReplaceFirst extends FirestoreFunction { - constructor(value: Expr, find: Expr, replace: Expr); - } +export function replaceAll(value: Expr, find: Expr, replace: Expr): FunctionExpr; // @beta -export function replaceFirst(value: Expr, find: string, replace: string): ReplaceFirst; +export function replaceAll(fieldName: string, find: string, replace: string): FunctionExpr; // @beta -export function replaceFirst(value: Expr, find: Expr, replace: Expr): ReplaceFirst; +export function replaceFirst(value: Expr, find: string, replace: string): FunctionExpr; // @beta -export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; +export function replaceFirst(value: Expr, find: Expr, replace: Expr): FunctionExpr; -// @beta (undocumented) -export class Reverse extends FirestoreFunction { - constructor(value: Expr); - } +// @beta +export function replaceFirst(fieldName: string, find: string, replace: string): FunctionExpr; // @beta -export function reverse(expr: Expr): Reverse; +export function reverse(stringExpression: Expr): FunctionExpr; // @beta -export function reverse(field: string): Reverse; +export function reverse(field: string): FunctionExpr; // @beta (undocumented) export class Select implements Stage { @@ -1090,7 +1118,11 @@ export class Select implements Stage { } // @beta -export interface Selectable extends Expr { +export interface Selectable { + // (undocumented) + readonly alias: string; + // (undocumented) + readonly expr: Expr; // (undocumented) selectable: true; } @@ -1108,246 +1140,159 @@ export interface Stage { name: string; } -// @beta (undocumented) -export class StartsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, prefix: Expr); - // (undocumented) - filterable: true; - } - // @beta -export function startsWith(expr: string, prefix: string): StartsWith; +export function startsWith(fieldName: string, prefix: string): BooleanExpr; // @beta -export function startsWith(expr: string, prefix: Expr): StartsWith; +export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; // @beta -export function startsWith(expr: Expr, prefix: string): StartsWith; +export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; // @beta -export function startsWith(expr: Expr, prefix: Expr): StartsWith; - -// @beta (undocumented) -export class StrConcat extends FirestoreFunction { - constructor(first: Expr, rest: Expr[]); - } +export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; // @beta -export function strConcat(first: string, ...elements: Array): StrConcat; +export function strConcat(fieldName: string, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; // @beta -export function strConcat(first: Expr, ...elements: Array): StrConcat; - -// @beta (undocumented) -export class StrContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, substring: Expr); - // (undocumented) - filterable: true; - } +export function strConcat(firstString: Expr, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; // @beta -export function strContains(left: string, substring: string): StrContains; +export function strContains(fieldName: string, substring: string): BooleanExpr; // @beta -export function strContains(left: string, substring: Expr): StrContains; +export function strContains(fieldName: string, substring: Expr): BooleanExpr; // @beta -export function strContains(left: Expr, substring: string): StrContains; +export function strContains(stringExpression: Expr, substring: string): BooleanExpr; // @beta -export function strContains(left: Expr, substring: Expr): StrContains; - -// @beta (undocumented) -export class Subtract extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } +export function strContains(stringExpression: Expr, substring: Expr): BooleanExpr; // @beta -export function subtract(left: Expr, right: Expr): Subtract; +export function substr(field: string, position: number, length?: number): FunctionExpr; // @beta -export function subtract(left: Expr, right: any): Subtract; +export function substr(input: Expr, position: number, length?: number): FunctionExpr; // @beta -export function subtract(left: string, right: Expr): Subtract; +export function substr(field: string, position: Expr, length?: Expr): FunctionExpr; // @beta -export function subtract(left: string, right: any): Subtract; - -// @beta (undocumented) -export class Sum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } +export function substr(input: Expr, position: Expr, length?: Expr): FunctionExpr; // @beta -export function sumFunction(value: Expr): Sum; +export function subtract(left: Expr, right: Expr): FunctionExpr; // @beta -export function sumFunction(value: string): Sum; - -// @beta (undocumented) -export class TimestampAdd extends FirestoreFunction { - constructor(timestamp: Expr, unit: Expr, amount: Expr); - } +export function subtract(expression: Expr, value: unknown): FunctionExpr; // @beta -export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): TimestampAdd; +export function subtract(fieldName: string, expression: Expr): FunctionExpr; // @beta -export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; +export function subtract(fieldName: string, value: unknown): FunctionExpr; // @beta -export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - -// @beta (undocumented) -export class TimestampSub extends FirestoreFunction { - constructor(timestamp: Expr, unit: Expr, amount: Expr); - } +export function sum(expression: Expr): AggregateFunction; // @beta -export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): TimestampSub; +export function sum(fieldName: string): AggregateFunction; // @beta -export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; +export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; // @beta -export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - -// @beta (undocumented) -export class TimestampToUnixMicros extends FirestoreFunction { - constructor(input: Expr); - } +export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; +export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMicros(field: string): TimestampToUnixMicros; - -// @beta (undocumented) -export class TimestampToUnixMillis extends FirestoreFunction { - constructor(input: Expr); - } +export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; // @beta -export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; +export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixMillis(field: string): TimestampToUnixMillis; - -// @beta (undocumented) -export class TimestampToUnixSeconds extends FirestoreFunction { - constructor(input: Expr); - } +export function timestampSub(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; // @beta -export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; +export function timestampToUnixMicros(expr: Expr): FunctionExpr; // @beta -export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; - -// @beta (undocumented) -export class ToLower extends FirestoreFunction { - constructor(expr: Expr); - } +export function timestampToUnixMicros(fieldName: string): FunctionExpr; // @beta -export function toLower(expr: string): ToLower; +export function timestampToUnixMillis(expr: Expr): FunctionExpr; // @beta -export function toLower(expr: Expr): ToLower; - -// @beta (undocumented) -export class ToUpper extends FirestoreFunction { - constructor(expr: Expr); - } +export function timestampToUnixMillis(fieldName: string): FunctionExpr; // @beta -export function toUpper(expr: string): ToUpper; +export function timestampToUnixSeconds(expr: Expr): FunctionExpr; // @beta -export function toUpper(expr: Expr): ToUpper; - -// @beta (undocumented) -export class Trim extends FirestoreFunction { - constructor(expr: Expr); - } +export function timestampToUnixSeconds(fieldName: string): FunctionExpr; // @beta -export function trim(expr: string): Trim; +export function toLower(fieldName: string): FunctionExpr; // @beta -export function trim(expr: Expr): Trim; +export function toLower(stringExpression: Expr): FunctionExpr; -// @beta (undocumented) -export class UnixMicrosToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } +// @beta +export function toUpper(fieldName: string): FunctionExpr; // @beta -export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; +export function toUpper(stringExpression: Expr): FunctionExpr; // @beta -export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; +export function trim(fieldName: string): FunctionExpr; -// @beta (undocumented) -export class UnixMillisToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } +// @beta +export function trim(stringExpression: Expr): FunctionExpr; // @beta -export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; +export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; // @beta -export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; +export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; -// @beta (undocumented) -export class UnixSecondsToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } +// @beta +export function unixMillisToTimestamp(expr: Expr): FunctionExpr; // @beta -export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; +export function unixMillisToTimestamp(fieldName: string): FunctionExpr; // @beta -export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; +export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; -// @beta (undocumented) -export class VectorLength extends FirestoreFunction { - constructor(value: Expr); - } +// @beta +export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; // @beta -export function vectorLength(expr: Expr): VectorLength; +export function vectorLength(vectorExpression: Expr): FunctionExpr; // @beta -export function vectorLength(field: string): VectorLength; +export function vectorLength(fieldName: string): FunctionExpr; // @beta (undocumented) export class Where implements Stage { - constructor(condition: FilterCondition); + constructor(condition: BooleanExpr); // (undocumented) name: string; } -// @beta (undocumented) -export class Xor extends FirestoreFunction implements FilterCondition { - constructor(conditions: FilterCondition[]); - // (undocumented) - filterable: true; -} - // @beta -export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor; +export function xor(first: BooleanExpr, second: BooleanExpr, ...additionalConditions: BooleanExpr[]): BooleanExpr; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:3983:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:3983:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4010:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4552:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4552:62 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta // (No @packageDocumentation comment for this package) diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 6f0e14206c2..34b56b97f21 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -9,54 +9,14 @@ import { FirebaseApp } from '@firebase/app'; import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; -// @beta -export interface Accumulator extends Expr { - // (undocumented) - accumulator: true; -} - -// @beta -export type AccumulatorTarget = ExprWithAlias; - -// @beta (undocumented) -export class Add extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function add(left: Expr, right: Expr): Add; - -// @beta -export function add(left: Expr, right: any): Add; - -// @beta -export function add(left: string, right: Expr): Add; - -// @beta -export function add(left: string, right: any): Add; - // @public export function addDoc(reference: CollectionReference, data: WithFieldValue): Promise>; -// @beta (undocumented) -export class AddFields implements Stage { - constructor(fields: Map); - // (undocumented) - name: string; -} - // @public export type AddPrefixToKeys> = { [K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K]; }; -// @beta (undocumented) -export class Aggregate implements Stage { - constructor(accumulators: Map, groups: Map); - // (undocumented) - name: string; -} - // @public export class AggregateField { readonly aggregateType: AggregateType; @@ -93,147 +53,18 @@ export type AggregateSpecData = { // @public export type AggregateType = 'count' | 'avg' | 'sum'; -// @beta (undocumented) -export class And extends FirestoreFunction implements FilterCondition { - constructor(conditions: (FilterCondition)[]); - // (undocumented) - filterable: true; -} - // @public export function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; -// @beta -export function andFunction(left: FilterCondition, ...right: (FilterCondition)[]): And; - -// @beta (undocumented) -export class ArrayConcat extends FirestoreFunction { - constructor(array: Expr, elements: Expr[]); - } - -// @beta -export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; - -// @beta -export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; - -// @beta -export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; - -// @beta -export function arrayConcat(array: string, elements: any[]): ArrayConcat; - -// @beta (undocumented) -export class ArrayContains extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, element: Expr); - // (undocumented) - filterable: true; -} - -// @beta -export function arrayContains(array: Expr, element: Expr): ArrayContains; - -// @beta -export function arrayContains(array: Expr, element: any): ArrayContains; - -// @beta -export function arrayContains(array: string, element: Expr): ArrayContains; - -// @beta -export function arrayContains(array: string, element: any): ArrayContains; - -// @beta (undocumented) -export class ArrayContainsAll extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, values: Expr[]); - // (undocumented) - filterable: true; - } - -// @beta -export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; - -// @beta -export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; - -// @beta -export function arrayContainsAll(array: string, values: Expr[]): ArrayContainsAll; - -// @beta -export function arrayContainsAll(array: string, values: any[]): ArrayContainsAll; - -// @beta (undocumented) -export class ArrayContainsAny extends FirestoreFunction implements FilterCondition { - constructor(array: Expr, values: Expr[]); - // (undocumented) - filterable: true; - } - -// @beta -export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; - -// @beta -export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; - -// @beta -export function arrayContainsAny(array: string, values: Expr[]): ArrayContainsAny; - -// @beta -export function arrayContainsAny(array: string, values: any[]): ArrayContainsAny; - -// @beta (undocumented) -export class ArrayElement extends FirestoreFunction { - constructor(); -} - -// @beta (undocumented) -export class ArrayLength extends FirestoreFunction { - constructor(array: Expr); - } - -// @beta -export function arrayLength(array: Expr): ArrayLength; - // @public export function arrayRemove(...elements: unknown[]): FieldValue; -// @beta (undocumented) -export class ArrayReverse extends FirestoreFunction { - constructor(array: Expr); - } - // @public export function arrayUnion(...elements: unknown[]): FieldValue; -// @beta -export function ascending(expr: Expr): Ordering; - // @public export function average(field: string | FieldPath): AggregateField; -// @beta (undocumented) -export class Avg extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } - -// @beta -export function avgFunction(value: Expr): Avg; - -// @beta -export function avgFunction(value: string): Avg; - -// @beta (undocumented) -export class ByteLength extends FirestoreFunction { - constructor(value: Expr); - } - -// @beta -export function byteLength(expr: Expr): ByteLength; - -// @beta -export function byteLength(field: string): ByteLength; - // @public export class Bytes { static fromBase64String(base64: string): Bytes; @@ -247,17 +78,6 @@ export class Bytes { // @public export const CACHE_SIZE_UNLIMITED = -1; -// @beta (undocumented) -export class CharLength extends FirestoreFunction { - constructor(value: Expr); - } - -// @beta -export function charLength(field: string): CharLength; - -// @beta -export function charLength(expr: Expr): CharLength; - // @public export type ChildUpdateFields = V extends Record ? AddPrefixToKeys> : never; @@ -276,13 +96,6 @@ export function collection(refer // @public export function collectionGroup(firestore: Firestore, collectionId: string): Query; -// @beta (undocumented) -export class CollectionGroupSource implements Stage { - constructor(collectionId: string); - // (undocumented) - name: string; -} - // @public export class CollectionReference extends Query { get id(): string; @@ -293,98 +106,14 @@ export class CollectionReference; } -// @beta (undocumented) -export class CollectionSource implements Stage { - constructor(collectionPath: string); - // (undocumented) - name: string; -} - -// @beta (undocumented) -export class Cond extends FirestoreFunction { - constructor(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function cond(condition: FilterCondition, thenExpr: Expr, elseExpr: Expr): Cond; - // @public export function connectFirestoreEmulator(firestore: Firestore, host: string, port: number, options?: { mockUserToken?: EmulatorMockTokenOptions | string; }): void; -// @beta -export class Constant extends Expr { - // (undocumented) - exprType: ExprType; - static of(value: number): Constant; - static of(value: string): Constant; - static of(value: boolean): Constant; - static of(value: null): Constant; - static of(value: undefined): Constant; - static of(value: GeoPoint): Constant; - static of(value: Timestamp): Constant; - static of(value: Date): Constant; - static of(value: Uint8Array): Constant; - static of(value: DocumentReference): Constant; - static of(value: any[]): Constant; - static of(value: Map): Constant; - static of(value: VectorValue): Constant; - static vector(value: number[] | VectorValue): Constant; -} - -// @beta (undocumented) -export class CosineDistance extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); - } - -// @beta -export function cosineDistance(expr: string, other: number[]): CosineDistance; - -// @beta -export function cosineDistance(expr: string, other: VectorValue): CosineDistance; - -// @beta -export function cosineDistance(expr: string, other: Expr): CosineDistance; - -// @beta -export function cosineDistance(expr: Expr, other: number[]): CosineDistance; - -// @beta -export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; - -// @beta -export function cosineDistance(expr: Expr, other: Expr): CosineDistance; - -// @beta (undocumented) -export class Count extends FirestoreFunction implements Accumulator { - constructor(value: Expr | undefined, distinct: boolean); - // (undocumented) - accumulator: true; - } - // @public export function count(): AggregateField; -// @beta -export function countAll(): Count; - -// @beta -export function countFunction(value: Expr): Count; - -// Warning: (ae-incompatible-release-tags) The symbol "countFunction" is marked as @public, but its signature references "Count" which is marked as @beta -// -// @public -export function countFunction(value: string): Count; - -// @beta (undocumented) -export class DatabaseSource implements Stage { - // (undocumented) - name: string; -} - // @public export function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void; @@ -394,39 +123,12 @@ export function deleteDoc(refere // @public export function deleteField(): FieldValue; -// @beta -export function descending(expr: Expr): Ordering; - // @public export function disableNetwork(firestore: Firestore): Promise; // @public export function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void; -// @beta (undocumented) -export class Distinct implements Stage { - constructor(groups: Map); - // (undocumented) - name: string; -} - -// @beta (undocumented) -export class Divide extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function divide(left: Expr, right: Expr): Divide; - -// @beta -export function divide(left: Expr, right: any): Divide; - -// @beta -export function divide(left: string, right: Expr): Divide; - -// @beta -export function divide(left: string, right: any): Divide; - // @public export function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference; @@ -478,38 +180,6 @@ export class DocumentSnapshot; } -// @beta (undocumented) -export class DocumentsSource implements Stage { - constructor(docPaths: string[]); - // (undocumented) - name: string; - // (undocumented) - static of(refs: DocumentReference[]): DocumentsSource; -} - -// @beta (undocumented) -export class DotProduct extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); - } - -// @beta -export function dotProduct(expr: string, other: number[]): DotProduct; - -// @beta -export function dotProduct(expr: string, other: VectorValue): DotProduct; - -// @beta -export function dotProduct(expr: string, other: Expr): DotProduct; - -// @beta -export function dotProduct(expr: Expr, other: number[]): DotProduct; - -// @beta -export function dotProduct(expr: Expr, other: VectorValue): DotProduct; - -// @beta -export function dotProduct(expr: Expr, other: Expr): DotProduct; - export { EmulatorMockTokenOptions } // @public @deprecated @@ -536,290 +206,22 @@ export function endBefore(snapsh // @public export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint; -// @beta (undocumented) -export class EndsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, suffix: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function endsWith(expr: string, suffix: string): EndsWith; - -// @beta -export function endsWith(expr: string, suffix: Expr): EndsWith; - -// @beta -export function endsWith(expr: Expr, suffix: string): EndsWith; - -// @beta -export function endsWith(expr: Expr, suffix: Expr): EndsWith; - -// @beta (undocumented) -export class Eq extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function eq(left: Expr, right: Expr): Eq; - -// @beta -export function eq(left: Expr, right: any): Eq; - -// @beta -export function eq(left: string, right: Expr): Eq; - -// @beta -export function eq(left: string, right: any): Eq; - -// @beta (undocumented) -export class EqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, others: Expr[]); - // (undocumented) - filterable: true; - } - -// @beta -export function eqAny(element: Expr, others: Expr[]): EqAny; - -// @beta -export function eqAny(element: Expr, others: any[]): EqAny; - -// @beta -export function eqAny(element: string, others: Expr[]): EqAny; - -// @beta -export function eqAny(element: string, others: any[]): EqAny; - -// @beta (undocumented) -export class EuclideanDistance extends FirestoreFunction { - constructor(vector1: Expr, vector2: Expr); - } - -// @beta -export function euclideanDistance(expr: string, other: number[]): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: string, other: VectorValue): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: number[]): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: VectorValue): EuclideanDistance; - -// @beta -export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; - -// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta -// -// @public (undocumented) -export function execute(pipeline: Pipeline): Promise; - -// @beta (undocumented) -export class Exists extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} - -// @beta -export function exists(value: Expr): Exists; - -// @beta -export function exists(field: string): Exists; - // @public export interface ExperimentalLongPollingOptions { timeoutSeconds?: number; } -// @beta -export abstract class Expr { - add(other: Expr): Add; - add(other: any): Add; - arrayConcat(...arrays: Expr[]): ArrayConcat; - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayContains(element: Expr): ArrayContains; - arrayContains(element: any): ArrayContains; - arrayContainsAll(...values: Expr[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAny(...values: Expr[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayLength(): ArrayLength; - as(name: string): ExprWithAlias; - ascending(): Ordering; - avg(): Avg; - byteLength(): ByteLength; - charLength(): CharLength; - cosineDistance(other: Expr): CosineDistance; - cosineDistance(other: VectorValue): CosineDistance; - cosineDistance(other: number[]): CosineDistance; - count(): Count; - descending(): Ordering; - divide(other: Expr): Divide; - divide(other: any): Divide; - dotProduct(other: Expr): DotProduct; - dotProduct(other: VectorValue): DotProduct; - dotProduct(other: number[]): DotProduct; - endsWith(suffix: string): EndsWith; - endsWith(suffix: Expr): EndsWith; - eq(other: Expr): Eq; - eq(other: any): Eq; - eqAny(...others: Expr[]): EqAny; - eqAny(...others: any[]): EqAny; - euclideanDistance(other: Expr): EuclideanDistance; - euclideanDistance(other: VectorValue): EuclideanDistance; - euclideanDistance(other: number[]): EuclideanDistance; - exists(): Exists; - // (undocumented) - abstract exprType: ExprType; - gt(other: Expr): Gt; - gt(other: any): Gt; - gte(other: Expr): Gte; - gte(other: any): Gte; - isNaN(): IsNan; - like(pattern: string): Like; - like(pattern: Expr): Like; - logicalMaximum(other: Expr): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum; - logicalMinimum(other: Expr): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum; - lt(other: Expr): Lt; - lt(other: any): Lt; - lte(other: Expr): Lte; - lte(other: any): Lte; - mapGet(subfield: string): MapGet; - maximum(): Maximum; - minimum(): Minimum; - mod(other: Expr): Mod; - mod(other: any): Mod; - multiply(other: Expr): Multiply; - multiply(other: any): Multiply; - neq(other: Expr): Neq; - neq(other: any): Neq; - notEqAny(...others: Expr[]): NotEqAny; - notEqAny(...others: any[]): NotEqAny; - regexContains(pattern: string): RegexContains; - regexContains(pattern: Expr): RegexContains; - regexMatch(pattern: string): RegexMatch; - regexMatch(pattern: Expr): RegexMatch; - replaceAll(find: string, replace: string): ReplaceAll; - replaceAll(find: Expr, replace: Expr): ReplaceAll; - replaceFirst(find: string, replace: string): ReplaceFirst; - replaceFirst(find: Expr, replace: Expr): ReplaceFirst; - reverse(): Reverse; - startsWith(prefix: string): StartsWith; - startsWith(prefix: Expr): StartsWith; - strConcat(...elements: Array): StrConcat; - strContains(substring: string): StrContains; - strContains(expr: Expr): StrContains; - subtract(other: Expr): Subtract; - subtract(other: any): Subtract; - sum(): Sum; - timestampAdd(unit: Expr, amount: Expr): TimestampAdd; - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - timestampSub(unit: Expr, amount: Expr): TimestampSub; - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - timestampToUnixMicros(): TimestampToUnixMicros; - timestampToUnixMillis(): TimestampToUnixMillis; - timestampToUnixSeconds(): TimestampToUnixSeconds; - toLower(): ToLower; - toUpper(): ToUpper; - trim(): Trim; - unixMicrosToTimestamp(): UnixMicrosToTimestamp; - unixMillisToTimestamp(): UnixMillisToTimestamp; - unixSecondsToTimestamp(): UnixSecondsToTimestamp; - vectorLength(): VectorLength; -} - -// @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'ListOfExprs' | 'ExprWithAlias'; - -// @beta (undocumented) -export class ExprWithAlias extends Expr implements Selectable { - constructor(expr: T, alias: string); - // (undocumented) - readonly alias: string; - // (undocumented) - readonly expr: T; - // (undocumented) - exprType: ExprType; - // (undocumented) - selectable: true; -} - -// @beta -export class Field extends Expr implements Selectable { - // (undocumented) - exprType: ExprType; - // (undocumented) - fieldName(): string; - static of(name: string): Field; - // (undocumented) - static of(path: FieldPath): Field; - // (undocumented) - static of(pipeline: Pipeline, name: string): Field; - // (undocumented) - selectable: true; -} - // @public export class FieldPath { constructor(...fieldNames: string[]); isEqual(other: FieldPath): boolean; } -// @beta (undocumented) -export class Fields extends Expr implements Selectable { - // (undocumented) - exprType: ExprType; - // (undocumented) - fieldList(): Field[]; - // (undocumented) - static of(name: string, ...others: string[]): Fields; - // (undocumented) - static ofAll(): Fields; - // (undocumented) - selectable: true; -} - // @public export abstract class FieldValue { abstract isEqual(other: FieldValue): boolean; } -// @beta -export interface FilterCondition extends Expr { - // (undocumented) - filterable: true; -} - -// @beta (undocumented) -export class FindNearest implements Stage { - // (undocumented) - name: string; -} - -// @beta (undocumented) -export interface FindNearestOptions { - // (undocumented) - distanceField?: string; - // (undocumented) - distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; - // (undocumented) - field: Field; - // (undocumented) - limit?: number; - // (undocumented) - vectorValue: VectorValue | number[]; -} - // @public export class Firestore { get app(): FirebaseApp; @@ -844,13 +246,6 @@ export class FirestoreError extends FirebaseError { // @public export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; -// @beta -export class FirestoreFunction extends Expr { - constructor(name: string, params: Expr[]); - // (undocumented) - exprType: ExprType; - } - // @public export type FirestoreLocalCache = MemoryLocalCache | PersistentLocalCache; @@ -866,16 +261,6 @@ export interface FirestoreSettings { ssl?: boolean; } -// @beta -export function genericFunction(name: string, params: Expr[]): FirestoreFunction; - -// @beta (undocumented) -export class GenericStage implements Stage { - constructor(name: string, params: unknown[]); - // (undocumented) - name: string; -} - // @public export class GeoPoint { constructor(latitude: number, longitude: number); @@ -929,44 +314,6 @@ export function getFirestore(app: FirebaseApp, databaseId: string): Firestore; // @public export function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null; -// @beta (undocumented) -export class Gt extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function gt(left: Expr, right: Expr): Gt; - -// @beta -export function gt(left: Expr, right: any): Gt; - -// @beta -export function gt(left: string, right: Expr): Gt; - -// @beta -export function gt(left: string, right: any): Gt; - -// @beta (undocumented) -export class Gte extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function gte(left: Expr, right: Expr): Gte; - -// @beta -export function gte(left: Expr, right: any): Gte; - -// @beta -export function gte(left: string, right: Expr): Gte; - -// @beta -export function gte(left: string, right: any): Gte; - // @public export function increment(n: number): FieldValue; @@ -997,45 +344,6 @@ export interface IndexField { // @public export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore; -// @beta (undocumented) -export class IsNan extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} - -// @beta -export function isNan(value: Expr): IsNan; - -// @beta -export function isNan(value: string): IsNan; - -// @beta (undocumented) -export class Like extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function like(left: string, pattern: string): Like; - -// @beta -export function like(left: string, pattern: Expr): Like; - -// @beta -export function like(left: Expr, pattern: string): Like; - -// @beta -export function like(left: Expr, pattern: Expr): Like; - -// @beta (undocumented) -export class Limit implements Stage { - constructor(limit: number); - // (undocumented) - name: string; -} - // @public export function limit(limit: number): QueryLimitConstraint; @@ -1056,114 +364,15 @@ export class LoadBundleTask implements PromiseLike { } // @public -export interface LoadBundleTaskProgress { - bytesLoaded: number; - documentsLoaded: number; - taskState: TaskState; - totalBytes: number; - totalDocuments: number; -} - -// @beta (undocumented) -export class LogicalMaximum extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; - -// @beta -export function logicalMaximum(left: Expr, right: any): LogicalMaximum; - -// @beta -export function logicalMaximum(left: string, right: Expr): LogicalMaximum; - -// @beta -export function logicalMaximum(left: string, right: any): LogicalMaximum; - -// @beta (undocumented) -export class LogicalMinimum extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; - -// @beta -export function logicalMinimum(left: Expr, right: any): LogicalMinimum; - -// @beta -export function logicalMinimum(left: string, right: Expr): LogicalMinimum; - -// @beta -export function logicalMinimum(left: string, right: any): LogicalMinimum; - -export { LogLevel } - -// @beta (undocumented) -export class Lt extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function lt(left: Expr, right: Expr): Lt; - -// @beta -export function lt(left: Expr, right: any): Lt; - -// @beta -export function lt(left: string, right: Expr): Lt; - -// @beta -export function lt(left: string, right: any): Lt; - -// @beta (undocumented) -export class Lte extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function lte(left: Expr, right: Expr): Lte; - -// @beta -export function lte(left: Expr, right: any): Lte; - -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Lte" which is marked as @beta -// -// @public -export function lte(left: string, right: Expr): Lte; - -// @beta -export function lte(left: string, right: any): Lte; - -// @beta (undocumented) -export class MapGet extends FirestoreFunction { - constructor(map: Expr, name: string); -} - -// @beta -export function mapGet(mapField: string, subField: string): MapGet; - -// @beta -export function mapGet(mapExpr: Expr, subField: string): MapGet; - -// @beta (undocumented) -export class Maximum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } - -// @beta -export function maximum(value: Expr): Maximum; +export interface LoadBundleTaskProgress { + bytesLoaded: number; + documentsLoaded: number; + taskState: TaskState; + totalBytes: number; + totalDocuments: number; +} -// @beta -export function maximum(value: string): Maximum; +export { LogLevel } // @public export interface MemoryCacheSettings { @@ -1202,116 +411,14 @@ export function memoryLruGarbageCollector(settings?: { cacheSizeBytes?: number; }): MemoryLruGarbageCollector; -// @beta (undocumented) -export class Minimum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } - -// @beta -export function minimum(value: Expr): Minimum; - -// @beta -export function minimum(value: string): Minimum; - -// @beta (undocumented) -export class Mod extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function mod(left: Expr, right: Expr): Mod; - -// @beta -export function mod(left: Expr, right: any): Mod; - -// @beta -export function mod(left: string, right: Expr): Mod; - -// @beta -export function mod(left: string, right: any): Mod; - -// @beta (undocumented) -export class Multiply extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function multiply(left: Expr, right: Expr): Multiply; - -// @beta -export function multiply(left: Expr, right: any): Multiply; - -// @beta -export function multiply(left: string, right: Expr): Multiply; - -// @beta -export function multiply(left: string, right: any): Multiply; - // @public export function namedQuery(firestore: Firestore, name: string): Promise; -// @beta (undocumented) -export class Neq extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, right: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function neq(left: Expr, right: Expr): Neq; - -// @beta -export function neq(left: Expr, right: any): Neq; - -// @beta -export function neq(left: string, right: Expr): Neq; - -// @beta -export function neq(left: string, right: any): Neq; - // @public export type NestedUpdateFields> = UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields; }[keyof T & string]>; -// @beta (undocumented) -export class Not extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr); - // (undocumented) - filterable: true; -} - -// @beta -export function not(filter: FilterCondition): Not; - -// @beta (undocumented) -export class NotEqAny extends FirestoreFunction implements FilterCondition { - constructor(left: Expr, others: Expr[]); - // (undocumented) - filterable: true; - } - -// @beta -export function notEqAny(element: Expr, others: Expr[]): NotEqAny; - -// @beta -export function notEqAny(element: Expr, others: any[]): NotEqAny; - -// @beta -export function notEqAny(element: string, others: Expr[]): NotEqAny; - -// @beta -export function notEqAny(element: string, others: any[]): NotEqAny; - -// @beta (undocumented) -export class Offset implements Stage { - constructor(offset: number); - // (undocumented) - name: string; - } - // @public export function onSnapshot(reference: DocumentReference, observer: { next?: (snapshot: DocumentSnapshot) => void; @@ -1362,13 +469,6 @@ export function onSnapshotsInSync(firestore: Firestore, observer: { // @public export function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; -// @beta (undocumented) -export class Or extends FirestoreFunction implements FilterCondition { - constructor(conditions: (FilterCondition)[]); - // (undocumented) - filterable: true; -} - // @public export function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint; @@ -1378,18 +478,6 @@ export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDir // @public export type OrderByDirection = 'desc' | 'asc'; -// @beta -export class Ordering { - constructor(expr: Expr, direction: 'ascending' | 'descending'); - // (undocumented) - readonly direction: 'ascending' | 'descending'; - // (undocumented) - readonly expr: Expr; -} - -// @beta -export function orFunction(left: FilterCondition, ...right: (FilterCondition)[]): Or; - // @public export type PartialWithFieldValue = Partial | (T extends Primitive ? T : T extends {} ? { [K in keyof T]?: PartialWithFieldValue | FieldValue; @@ -1446,78 +534,6 @@ export interface PersistentSingleTabManagerSettings { // @public export type PersistentTabManager = PersistentSingleTabManager | PersistentMultipleTabManager; -// @public (undocumented) -export class Pipeline { - /* Excluded from this release type: newPipeline */ - // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta - addFields(...fields: Selectable[]): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; - aggregate(options: { accumulators: AccumulatorTarget[]; groups?: Array; }): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta - distinct(...groups: Array): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta - execute(): Promise; - // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta - // - // (undocumented) - findNearest(options: FindNearestOptions): Pipeline; - genericStage(name: string, params: any[]): Pipeline; - limit(limit: number): Pipeline; - offset(offset: number): Pipeline; - readUserData: any; - // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta - select(...selections: Array): Pipeline; - // (undocumented) - selectablesToMap: any; - // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta - sort(...orderings: Ordering[]): Pipeline; - // (undocumented) - sort(options: { orderings: Ordering[]; }): Pipeline; - // (undocumented) - stages: any; - // (undocumented) - userDataReader: any; - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta - where(condition: FilterCondition): Pipeline; -} - -// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta -// -// @public -export function pipeline(firestore: Firestore): PipelineSource; - -// @public -export function pipeline(query: Query): Pipeline; - -// @beta -export class PipelineResult { - /* Excluded from this release type: _ref */ - /* Excluded from this release type: _fields */ - /* Excluded from this release type: __constructor */ - get createTime(): Timestamp | undefined; - data(): AppModelType | undefined; - get executionTime(): Timestamp; - get(fieldPath: string | FieldPath): any; - get id(): string | undefined; - get ref(): DocumentReference | undefined; - get updateTime(): Timestamp | undefined; -} - -// @beta -export class PipelineSource { - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ - // (undocumented) - collection(collectionPath: string): PipelineType; - // (undocumented) - collectionGroup(collectionId: string): PipelineType; - // (undocumented) - database(): PipelineType; - // (undocumented) - documents(docs: DocumentReference[]): PipelineType; -} - // @public export type Primitive = string | number | boolean | undefined | null; @@ -1604,99 +620,9 @@ export class QueryStartAtConstraint extends QueryConstraint { // @public export function refEqual(left: DocumentReference | CollectionReference, right: DocumentReference | CollectionReference): boolean; -// @beta (undocumented) -export class RegexContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function regexContains(left: string, pattern: string): RegexContains; - -// @beta -export function regexContains(left: string, pattern: Expr): RegexContains; - -// @beta -export function regexContains(left: Expr, pattern: string): RegexContains; - -// @beta -export function regexContains(left: Expr, pattern: Expr): RegexContains; - -// @beta (undocumented) -export class RegexMatch extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, pattern: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function regexMatch(left: string, pattern: string): RegexMatch; - -// @beta -export function regexMatch(left: string, pattern: Expr): RegexMatch; - -// @beta -export function regexMatch(left: Expr, pattern: string): RegexMatch; - -// @beta -export function regexMatch(left: Expr, pattern: Expr): RegexMatch; - -// @beta (undocumented) -export class ReplaceAll extends FirestoreFunction { - constructor(value: Expr, find: Expr, replace: Expr); - } - -// @beta -export function replaceAll(value: Expr, find: string, replace: string): ReplaceAll; - -// @beta -export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; - -// @beta -export function replaceAll(field: string, find: string, replace: string): ReplaceAll; - -// @beta (undocumented) -export class ReplaceFirst extends FirestoreFunction { - constructor(value: Expr, find: Expr, replace: Expr); - } - -// @beta -export function replaceFirst(value: Expr, find: string, replace: string): ReplaceFirst; - -// @beta -export function replaceFirst(value: Expr, find: Expr, replace: Expr): ReplaceFirst; - -// @beta -export function replaceFirst(field: string, find: string, replace: string): ReplaceFirst; - -// @beta (undocumented) -export class Reverse extends FirestoreFunction { - constructor(value: Expr); - } - -// @beta -export function reverse(expr: Expr): Reverse; - -// @beta -export function reverse(field: string): Reverse; - // @public export function runTransaction(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise, options?: TransactionOptions): Promise; -// @beta (undocumented) -export class Select implements Stage { - constructor(projections: Map); - // (undocumented) - name: string; - } - -// @beta -export interface Selectable extends Expr { - // (undocumented) - selectable: true; -} - // @public export function serverTimestamp(): FieldValue; @@ -1743,19 +669,6 @@ export interface SnapshotOptions { readonly serverTimestamps?: 'estimate' | 'previous' | 'none'; } -// @beta (undocumented) -export class Sort implements Stage { - constructor(orders: Ordering[]); - // (undocumented) - name: string; - } - -// @beta (undocumented) -export interface Stage { - // (undocumented) - name: string; -} - // @public export function startAfter(snapshot: DocumentSnapshot): QueryStartAtConstraint; @@ -1768,88 +681,9 @@ export function startAt(snapshot // @public export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint; -// @beta (undocumented) -export class StartsWith extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, prefix: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function startsWith(expr: string, prefix: string): StartsWith; - -// @beta -export function startsWith(expr: string, prefix: Expr): StartsWith; - -// @beta -export function startsWith(expr: Expr, prefix: string): StartsWith; - -// @beta -export function startsWith(expr: Expr, prefix: Expr): StartsWith; - -// @beta (undocumented) -export class StrConcat extends FirestoreFunction { - constructor(first: Expr, rest: Expr[]); - } - -// @beta -export function strConcat(first: string, ...elements: Array): StrConcat; - -// @beta -export function strConcat(first: Expr, ...elements: Array): StrConcat; - -// @beta (undocumented) -export class StrContains extends FirestoreFunction implements FilterCondition { - constructor(expr: Expr, substring: Expr); - // (undocumented) - filterable: true; - } - -// @beta -export function strContains(left: string, substring: string): StrContains; - -// @beta -export function strContains(left: string, substring: Expr): StrContains; - -// @beta -export function strContains(left: Expr, substring: string): StrContains; - -// @beta -export function strContains(left: Expr, substring: Expr): StrContains; - -// @beta (undocumented) -export class Subtract extends FirestoreFunction { - constructor(left: Expr, right: Expr); - } - -// @beta -export function subtract(left: Expr, right: Expr): Subtract; - -// @beta -export function subtract(left: Expr, right: any): Subtract; - -// @beta -export function subtract(left: string, right: Expr): Subtract; - -// @beta -export function subtract(left: string, right: any): Subtract; - -// @beta (undocumented) -export class Sum extends FirestoreFunction implements Accumulator { - constructor(value: Expr, distinct: boolean); - // (undocumented) - accumulator: true; - } - // @public export function sum(field: string | FieldPath): AggregateField; -// @beta -export function sumFunction(value: Expr): Sum; - -// @beta -export function sumFunction(value: string): Sum; - // @public export type TaskState = 'Error' | 'Running' | 'Success'; @@ -1877,89 +711,6 @@ export class Timestamp { valueOf(): string; } -// @beta (undocumented) -export class TimestampAdd extends FirestoreFunction { - constructor(timestamp: Expr, unit: Expr, amount: Expr); - } - -// @beta -export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): TimestampAdd; - -// @beta -export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - -// @beta -export function timestampAdd(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampAdd; - -// @beta (undocumented) -export class TimestampSub extends FirestoreFunction { - constructor(timestamp: Expr, unit: Expr, amount: Expr); - } - -// @beta -export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): TimestampSub; - -// @beta -export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - -// @beta -export function timestampSub(field: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): TimestampSub; - -// @beta (undocumented) -export class TimestampToUnixMicros extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; - -// @beta -export function timestampToUnixMicros(field: string): TimestampToUnixMicros; - -// @beta (undocumented) -export class TimestampToUnixMillis extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; - -// @beta -export function timestampToUnixMillis(field: string): TimestampToUnixMillis; - -// @beta (undocumented) -export class TimestampToUnixSeconds extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; - -// @beta -export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; - -// @beta (undocumented) -export class ToLower extends FirestoreFunction { - constructor(expr: Expr); - } - -// @beta -export function toLower(expr: string): ToLower; - -// @beta -export function toLower(expr: Expr): ToLower; - -// @beta (undocumented) -export class ToUpper extends FirestoreFunction { - constructor(expr: Expr); - } - -// @beta -export function toUpper(expr: string): ToUpper; - -// @beta -export function toUpper(expr: Expr): ToUpper; - // @public export class Transaction { delete(documentRef: DocumentReference): this; @@ -1975,53 +726,9 @@ export interface TransactionOptions { readonly maxAttempts?: number; } -// @beta (undocumented) -export class Trim extends FirestoreFunction { - constructor(expr: Expr); - } - -// @beta -export function trim(expr: string): Trim; - -// @beta -export function trim(expr: Expr): Trim; - // @public export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; -// @beta (undocumented) -export class UnixMicrosToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; - -// @beta -export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; - -// @beta (undocumented) -export class UnixMillisToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; - -// @beta -export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; - -// @beta (undocumented) -export class UnixSecondsToTimestamp extends FirestoreFunction { - constructor(input: Expr); - } - -// @beta -export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; - -// @beta -export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; - // @public export interface Unsubscribe { (): void; @@ -2041,17 +748,6 @@ export function updateDoc(refere // @public export function vector(values?: number[]): VectorValue; -// @beta (undocumented) -export class VectorLength extends FirestoreFunction { - constructor(value: Expr); - } - -// @beta -export function vectorLength(expr: Expr): VectorLength; - -// @beta -export function vectorLength(field: string): VectorLength; - // @public export class VectorValue { /* Excluded from this release type: __constructor */ @@ -2062,13 +758,6 @@ export class VectorValue { // @public export function waitForPendingWrites(firestore: Firestore): Promise; -// @beta (undocumented) -export class Where implements Stage { - constructor(condition: FilterCondition); - // (undocumented) - name: string; -} - // @public export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint; @@ -2093,21 +782,5 @@ export class WriteBatch { // @public export function writeBatch(firestore: Firestore): WriteBatch; -// @beta (undocumented) -export class Xor extends FirestoreFunction implements FilterCondition { - constructor(conditions: (FilterCondition)[]); - // (undocumented) - filterable: true; -} - -// @beta -export function xor(left: FilterCondition, ...right: (FilterCondition)[]): Xor; - - -// Warnings were encountered during analysis: -// -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5962:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5962:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/all_packages.d.ts:5989:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta ``` diff --git a/packages/firestore/lite/pipelines/package.json b/packages/firestore/lite/pipelines/package.json index 349e25e3ac3..e7989c2ea97 100644 --- a/packages/firestore/lite/pipelines/package.json +++ b/packages/firestore/lite/pipelines/package.json @@ -6,7 +6,7 @@ "module": "../../dist/lite/pipelines.browser.esm2017.js", "browser": "../../dist/lite/pipelines.browser.esm2017.js", "react-native": "../../dist/lite/pipelines.rn.esm2017.js", - "typings": "../../dist/lite/pipelines.d.ts", + "typings": "./pipelines.d.ts", "private": true, "engines": { "node": ">=18.0.0" diff --git a/packages/firestore/lite/pipelines/pipelines.d.ts b/packages/firestore/lite/pipelines/pipelines.d.ts index e1243ebe907..81336456656 100644 --- a/packages/firestore/lite/pipelines/pipelines.d.ts +++ b/packages/firestore/lite/pipelines/pipelines.d.ts @@ -19,7 +19,7 @@ import { PipelineSource, Pipeline } from '../../dist/lite/pipelines'; // Augument the Firestore class with the pipeline() method. // This is stripped from dist/lite/pipelines.d.ts during the build // so it needs to be re-added here. -declare module '@firebase/firestore' { +declare module '@firebase/firestore/lite' { interface Firestore { pipeline(): PipelineSource; } diff --git a/packages/firestore/lite/pipelines/pipelines.ts b/packages/firestore/lite/pipelines/pipelines.ts index d3e31f5e52b..e03e5f4883b 100644 --- a/packages/firestore/lite/pipelines/pipelines.ts +++ b/packages/firestore/lite/pipelines/pipelines.ts @@ -50,11 +50,14 @@ export type { export { PipelineSource } from '../../src/lite-api/pipeline-source'; -export { PipelineResult } from '../../src/lite-api/pipeline-result'; +export { + PipelineResult, + PipelineSnapshot +} from '../../src/lite-api/pipeline-result'; export { Pipeline } from '../../src/lite-api/pipeline'; -export { pipeline, execute } from '../../src/lite-api/pipeline_impl'; +export { execute } from '../../src/lite-api/pipeline_impl'; export { Stage, @@ -76,14 +79,44 @@ export { } from '../../src/lite-api/stage'; export { + Expr, + field, + and, + array, + arrayOffset, + constant, add, subtract, multiply, + avg, + bitAnd, + substr, + constantVector, + bitLeftShift, + bitNot, + count, + mapMerge, + mapRemove, + bitOr, + ifError, + isAbsent, + isError, + or, + rand, + bitRightShift, + bitXor, divide, + isNotNan, + map, + isNotNull, + isNull, mod, + documentId, eq, neq, lt, + countIf, + currentContext, lte, gt, gte, @@ -132,79 +165,16 @@ export { timestampToUnixSeconds, timestampAdd, timestampSub, - genericFunction, ascending, descending, ExprWithAlias, Field, - Fields, Constant, - FirestoreFunction, - Add, - Subtract, - Multiply, - Divide, - Mod, - Eq, - Neq, - Lt, - Lte, - Gt, - Gte, - ArrayConcat, - ArrayReverse, - ArrayContains, - ArrayContainsAll, - ArrayContainsAny, - ArrayLength, - ArrayElement, - EqAny, - IsNan, - Exists, - Not, - And, - Or, - Xor, - Cond, - LogicalMaximum, - LogicalMinimum, - Reverse, - ReplaceFirst, - ReplaceAll, - CharLength, - ByteLength, - Like, - RegexContains, - RegexMatch, - StrContains, - StartsWith, - EndsWith, - ToLower, - ToUpper, - Trim, - StrConcat, - MapGet, - Count, - Sum, - Avg, - Minimum, - Maximum, - CosineDistance, - DotProduct, - EuclideanDistance, - VectorLength, - UnixMicrosToTimestamp, - TimestampToUnixMicros, - UnixMillisToTimestamp, - TimestampToUnixMillis, - UnixSecondsToTimestamp, - TimestampToUnixSeconds, - TimestampAdd, - TimestampSub, + FunctionExpr, Ordering, ExprType, - AccumulatorTarget, + AggregateWithAlias, Selectable, - FilterCondition, - Accumulator + BooleanExpr, + AggregateFunction } from '../../src/lite-api/expressions'; diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 8dc84db4315..c11536d3c1b 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -48,12 +48,11 @@ "test:minified": "(cd ../../integration/firestore ; yarn test)", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report:main": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/index.d.ts", - "api-report:all-packages": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/all_packages.d.ts --rollupDts ./dist/private.all_packages.d.ts --untrimmedRollupDts ./dist/internal.all_packages.d.ts --publicDts ./dist/all_packages.d.ts", "api-report:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-pipelines --packageRoot . --typescriptDts ./dist/firestore/pipelines/pipelines.d.ts --rollupDts ./dist/private.pipelines.d.ts --untrimmedRollupDts ./dist/internal.pipelines.d.ts --publicDts ./dist/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/index.d.ts", "api-report:lite": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite --packageRoot . --typescriptDts ./dist/firestore/lite/index.d.ts --rollupDts ./dist/lite/private.d.ts --untrimmedRollupDts ./dist/lite/internal.d.ts --publicDts ./dist/lite/index.d.ts", - "api-report:lite:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite-pipelines --packageRoot . --typescriptDts ./dist/firestore/lite/pipelines/pipelines.d.ts --rollupDts ./dist/lite/private.pipelines.d.ts --untrimmedRollupDts ./dist/lite/internal.pipelines.d.ts --publicDts ./dist/lite/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/index.d.ts", + "api-report:lite:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite-pipelines --packageRoot . --typescriptDts ./dist/firestore/lite/pipelines/pipelines.d.ts --rollupDts ./dist/lite/private.pipelines.d.ts --untrimmedRollupDts ./dist/lite/internal.pipelines.d.ts --publicDts ./dist/lite/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/lite/index.d.ts", "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", - "api-report": "run-s --npm-path npm api-report:main api-report:pipelines api-report:all-packages api-report:lite api-report:lite:pipelines && yarn api-report:api-json", + "api-report": "run-s --npm-path npm api-report:main api-report:pipelines api-report:lite api-report:lite:pipelines && yarn api-report:api-json", "doc": "api-documenter markdown --input temp --output docs", "typings:public": "node ../../scripts/build/use_typings.js ./dist/all-packages.d.ts" }, diff --git a/packages/firestore/pipelines/pipelines.d.ts b/packages/firestore/pipelines/pipelines.d.ts index 5e7944e5731..e7edb233991 100644 --- a/packages/firestore/pipelines/pipelines.d.ts +++ b/packages/firestore/pipelines/pipelines.d.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {PipelineSource, Pipeline} from "../dist/pipelines"; +import { PipelineSource, Pipeline } from '../dist/pipelines'; // Augument the Firestore and Query classes with the pipeline() method. // This is stripped from dist/lite/pipelines.d.ts during the build @@ -23,9 +23,6 @@ declare module '@firebase/firestore' { interface Firestore { pipeline(): PipelineSource; } - interface Query { - pipeline(): Pipeline; - } } -export * from "../dist/pipelines"; +export * from '../dist/pipelines'; diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index 14390d57b49..ea969c6b94c 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -224,8 +224,7 @@ export { isBase64Available as _isBase64Available } from './platform/base64'; export { DatabaseId as _DatabaseId } from './core/database_info'; export { _internalQueryToProtoQueryTarget, - _internalAggregationQueryToProtoRunAggregationQueryRequest, - _internalPipelineToExecutePipelineRequestProto + _internalAggregationQueryToProtoRunAggregationQueryRequest } from './remote/internal_serializer'; export { cast as _cast, diff --git a/packages/firestore/src/api/parse_context.ts b/packages/firestore/src/api/parse_context.ts index ce3c221f66e..2381bcff4cd 100644 --- a/packages/firestore/src/api/parse_context.ts +++ b/packages/firestore/src/api/parse_context.ts @@ -16,8 +16,53 @@ */ import { DatabaseId } from '../core/database_info'; +import { UserDataSource } from '../lite-api/user_data_reader'; +import { DocumentKey } from '../model/document_key'; +import { FieldTransform } from '../model/mutation'; +import { FieldPath as InternalFieldPath } from '../model/path'; +import { JsonProtoSerializer } from '../remote/serializer'; +import { FirestoreError } from '../util/error'; + +/** Contains the settings that are mutated as we parse user data. */ +export interface ContextSettings { + /** Indicates what kind of API method this data came from. */ + readonly dataSource: UserDataSource; + /** The name of the method the user called to create the ParseContext. */ + readonly methodName: string; + /** The document the user is attempting to modify, if that applies. */ + readonly targetDoc?: DocumentKey; + /** + * A path within the object being parsed. This could be an empty path (in + * which case the context represents the root of the data being parsed), or a + * nonempty path (indicating the context represents a nested location within + * the data). + */ + readonly path?: InternalFieldPath; + /** + * Whether or not this context corresponds to an element of an array. + * If not set, elements are treated as if they were outside of arrays. + */ + readonly arrayElement?: boolean; + /** + * Whether or not a converter was specified in this context. If true, error + * messages will reference the converter when invalid data is provided. + */ + readonly hasConverter?: boolean; +} export interface ParseContext { + readonly settings: ContextSettings; readonly databaseId: DatabaseId; + readonly serializer: JsonProtoSerializer; readonly ignoreUndefinedProperties: boolean; + fieldTransforms: FieldTransform[]; + fieldMask: InternalFieldPath[]; + get path(): InternalFieldPath | undefined; + get dataSource(): UserDataSource; + contextWith(configuration: Partial): ParseContext; + childContextForField(field: string): ParseContext; + childContextForFieldPath(field: InternalFieldPath): ParseContext; + childContextForArray(index: number): ParseContext; + createError(reason: string): FirestoreError; + contains(fieldPath: InternalFieldPath): boolean; } diff --git a/packages/firestore/src/api/pipeline.ts b/packages/firestore/src/api/pipeline.ts index aaddf00274b..e7cd6e875eb 100644 --- a/packages/firestore/src/api/pipeline.ts +++ b/packages/firestore/src/api/pipeline.ts @@ -15,16 +15,12 @@ * limitations under the License. */ -import { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; -import { PipelineResult } from '../lite-api/pipeline-result'; -import { DocumentReference } from '../lite-api/reference'; import { Stage } from '../lite-api/stage'; import { UserDataReader } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; -import { cast } from '../util/input_validation'; -import { ensureFirestoreConfigured, Firestore } from './database'; +import { Firestore } from './database'; export class Pipeline extends LitePipeline { /** @@ -41,66 +37,8 @@ export class Pipeline extends LitePipeline { db: Firestore, userDataReader: UserDataReader, userDataWriter: AbstractUserDataWriter, - stages: Stage[], - converter: unknown = {} + stages: Stage[] ): Pipeline { return new Pipeline(db, userDataReader, userDataWriter, stages); } - - /** - * Executes this pipeline and returns a Promise to represent the asynchronous operation. - * - *

The returned Promise can be used to track the progress of the pipeline execution - * and retrieve the results (or handle any errors) asynchronously. - * - *

The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link - * PipelineResult} typically represents a single key/value map that has passed through all the - * stages of the pipeline, however this might differ depending on the stages involved in the - * pipeline. For example: - * - *

    - *
  • If there are no stages or only transformation stages, each {@link PipelineResult} - * represents a single document.
  • - *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, - * representing the aggregated results over the entire dataset .
  • - *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a - * distinct group and its associated aggregated values.
  • - *
- * - *

Example: - * - * ```typescript - * const futureResults = await firestore.pipeline().collection("books") - * .where(gt(Field.of("rating"), 4.5)) - * .select("title", "author", "rating") - * .execute(); - * ``` - * - * @return A Promise representing the asynchronous pipeline execution. - */ - execute(): Promise { - const firestore = cast(this._db, Firestore); - const client = ensureFirestoreConfigured(firestore); - return firestoreClientExecutePipeline(client, this).then(result => { - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - this._userDataWriter, - element.key?.path - ? new DocumentReference(firestore, null, element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - ) - ); - - return docs; - }); - } } diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts index 9e7c25e69ab..ba6e08105bb 100644 --- a/packages/firestore/src/api/pipeline_impl.ts +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -16,16 +16,16 @@ */ import { Pipeline } from '../api/pipeline'; -import { toPipeline } from '../core/pipeline-util'; +import { firestoreClientExecutePipeline } from '../core/firestore_client'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; -import { PipelineResult } from '../lite-api/pipeline-result'; +import { PipelineResult, PipelineSnapshot } from '../lite-api/pipeline-result'; import { PipelineSource } from '../lite-api/pipeline-source'; import { Stage } from '../lite-api/stage'; import { newUserDataReader } from '../lite-api/user_data_reader'; import { cast } from '../util/input_validation'; -import { Firestore } from './database'; -import { Query } from './reference'; +import { ensureFirestoreConfigured, Firestore } from './database'; +import { DocumentReference } from './reference'; import { ExpUserDataWriter } from './user_data_writer'; declare module './database' { @@ -35,49 +35,78 @@ declare module './database' { } /** - * Experimental Modular API for console testing. - * @param firestore - */ -export function pipeline(firestore: Firestore): PipelineSource; - -/** - * Experimental Modular API for console testing. - * @param query + * Executes this pipeline and returns a Promise to represent the asynchronous operation. + * + * The returned Promise can be used to track the progress of the pipeline execution + * and retrieve the results (or handle any errors) asynchronously. + * + * The pipeline results are returned as a {@link PipelineSnapshot} that contains + * a list of {@link PipelineResult} objects. Each {@link PipelineResult} typically + * represents a single key/value map that has passed through all the + * stages of the pipeline, however this might differ depending on the stages involved in the + * pipeline. For example: + * + *

    + *
  • If there are no stages or only transformation stages, each {@link PipelineResult} + * represents a single document.
  • + *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, + * representing the aggregated results over the entire dataset .
  • + *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a + * distinct group and its associated aggregated values.
  • + *
+ * + *

Example: + * + * ```typescript + * const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books") + * .where(gt(field("rating"), 4.5)) + * .select("title", "author", "rating")); + * + * const results: PipelineResults = snapshot.results; + * ``` + * + * @param pipeline The pipeline to execute. + * @return A Promise representing the asynchronous pipeline execution. */ -export function pipeline(query: Query): Pipeline; +export function execute(pipeline: LitePipeline): Promise { + const firestore = cast(pipeline._db, Firestore); + const client = ensureFirestoreConfigured(firestore); + return firestoreClientExecutePipeline(client, pipeline).then(result => { + // Get the execution time from the first result. + // firestoreClientExecutePipeline returns at least one PipelineStreamElement + // even if the returned document set is empty. + const executionTime = + result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined; -export function pipeline( - firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { - if (firestoreOrQuery instanceof Firestore) { - const firestore = firestoreOrQuery; - return new PipelineSource((stages: Stage[]) => { - return new Pipeline( - firestore, - newUserDataReader(firestore), - new ExpUserDataWriter(firestore), - stages + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + pipeline._userDataWriter, + element.key?.path + ? new DocumentReference(firestore, null, element.key) + : undefined, + element.fields, + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + ) ); - }); - } else { - const query = firestoreOrQuery; - const db = cast(query.firestore, Firestore); - const litePipeline: LitePipeline = toPipeline(query._query, db); - return cast(litePipeline, Pipeline); - } -} - -export function execute(pipeline: LitePipeline): Promise { - return pipeline.execute(); + return new PipelineSnapshot(pipeline, docs, executionTime); + }); } // Augment the Firestore class with the pipeline() factory method Firestore.prototype.pipeline = function (): PipelineSource { - return pipeline(this); -}; - -// Augment the Query class with the pipeline() factory method -Query.prototype.pipeline = function (): Pipeline { - return pipeline(this); + return new PipelineSource(this._databaseId, (stages: Stage[]) => { + return new Pipeline( + this, + newUserDataReader(this), + new ExpUserDataWriter(this), + stages + ); + }); }; diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts index 90fe836932f..ad7815af3e4 100644 --- a/packages/firestore/src/api_pipelines.ts +++ b/packages/firestore/src/api_pipelines.ts @@ -17,11 +17,15 @@ export { PipelineSource } from './lite-api/pipeline-source'; -export { PipelineResult } from './lite-api/pipeline-result'; +export { + PipelineResult, + PipelineSnapshot, + pipelineResultEqual +} from './lite-api/pipeline-result'; export { Pipeline } from './api/pipeline'; -export { pipeline, execute } from './api/pipeline_impl'; +export { execute } from './api/pipeline_impl'; export { Stage, @@ -43,6 +47,8 @@ export { } from './lite-api/stage'; export { + field, + constant, add, subtract, multiply, @@ -85,11 +91,11 @@ export { strConcat, mapGet, countAll, - countFunction, - sumFunction, - avgFunction, - andFunction, - orFunction, + count, + sum, + avg, + and, + or, minimum, maximum, cosineDistance, @@ -104,84 +110,44 @@ export { timestampToUnixSeconds, timestampAdd, timestampSub, - genericFunction, ascending, descending, + countIf, + bitAnd, + bitOr, + bitXor, + bitNot, + bitLeftShift, + bitRightShift, + rand, + array, + arrayOffset, + currentContext, + isError, + ifError, + isAbsent, + isNull, + isNotNull, + isNotNan, + map, + mapRemove, + mapMerge, + documentId, + substr, Expr, ExprWithAlias, Field, - Fields, Constant, - FirestoreFunction, - Add, - Subtract, - Multiply, - Divide, - Mod, - Eq, - Neq, - Lt, - Lte, - Gt, - Gte, - ArrayConcat, - ArrayReverse, - ArrayContains, - ArrayContainsAll, - ArrayContainsAny, - ArrayLength, - ArrayElement, - EqAny, - NotEqAny, - IsNan, - Exists, - Not, - And, - Or, - Xor, - Cond, - LogicalMaximum, - LogicalMinimum, - Reverse, - ReplaceFirst, - ReplaceAll, - CharLength, - ByteLength, - Like, - RegexContains, - RegexMatch, - StrContains, - StartsWith, - EndsWith, - ToLower, - ToUpper, - Trim, - StrConcat, - MapGet, - Count, - Sum, - Avg, - Minimum, - Maximum, - CosineDistance, - DotProduct, - EuclideanDistance, - VectorLength, - UnixMicrosToTimestamp, - TimestampToUnixMicros, - UnixMillisToTimestamp, - TimestampToUnixMillis, - UnixSecondsToTimestamp, - TimestampToUnixSeconds, - TimestampAdd, - TimestampSub, + FunctionExpr, Ordering } from './lite-api/expressions'; export type { ExprType, - AccumulatorTarget, + AggregateWithAlias, Selectable, - FilterCondition, - Accumulator + BooleanExpr, + AggregateFunction } from './lite-api/expressions'; + +export { _internalPipelineToExecutePipelineRequestProto } from './remote/internal_serializer'; diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 0800eba85ea..4409daffc2e 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -15,22 +15,20 @@ * limitations under the License. */ -import { Firestore } from '../api/database'; +import { Firestore } from '../lite-api/database'; import { Constant, Field, - FilterCondition, - not, - andFunction, - orFunction, + BooleanExpr, + and, + or, Ordering, - And, lt, gt, lte, gte, eq, - Or + field } from '../lite-api/expressions'; import { Pipeline } from '../lite-api/pipeline'; import { doc } from '../lite-api/reference'; @@ -56,56 +54,89 @@ import { /* eslint @typescript-eslint/no-explicit-any: 0 */ -export function toPipelineFilterCondition(f: FilterInternal): FilterCondition { +export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr { if (f instanceof FieldFilterInternal) { - const field = Field.of(f.field.toString()); + const fieldValue = field(f.field.toString()); if (isNanValue(f.value)) { if (f.op === Operator.EQUAL) { - return andFunction(field.exists(), field.isNaN()); + return and(fieldValue.exists(), fieldValue.isNan()); } else { - return andFunction(field.exists(), not(field.isNaN())); + return and(fieldValue.exists(), fieldValue.isNotNan()); } } else if (isNullValue(f.value)) { if (f.op === Operator.EQUAL) { - return andFunction(field.exists(), field.eq(null)); + return and(fieldValue.exists(), fieldValue.isNull()); } else { - return andFunction(field.exists(), not(field.eq(null))); + return and(fieldValue.exists(), fieldValue.isNotNull()); } } else { // Comparison filters const value = f.value; switch (f.op) { case Operator.LESS_THAN: - return andFunction(field.exists(), field.lt(value)); + return and( + fieldValue.exists(), + fieldValue.lt(Constant._fromProto(value)) + ); case Operator.LESS_THAN_OR_EQUAL: - return andFunction(field.exists(), field.lte(value)); + return and( + fieldValue.exists(), + fieldValue.lte(Constant._fromProto(value)) + ); case Operator.GREATER_THAN: - return andFunction(field.exists(), field.gt(value)); + return and( + fieldValue.exists(), + fieldValue.gt(Constant._fromProto(value)) + ); case Operator.GREATER_THAN_OR_EQUAL: - return andFunction(field.exists(), field.gte(value)); + return and( + fieldValue.exists(), + fieldValue.gte(Constant._fromProto(value)) + ); case Operator.EQUAL: - return andFunction(field.exists(), field.eq(value)); + return and( + fieldValue.exists(), + fieldValue.eq(Constant._fromProto(value)) + ); case Operator.NOT_EQUAL: - return andFunction(field.exists(), field.neq(value)); + return and( + fieldValue.exists(), + fieldValue.neq(Constant._fromProto(value)) + ); case Operator.ARRAY_CONTAINS: - return andFunction(field.exists(), field.arrayContains(value)); + return and( + fieldValue.exists(), + fieldValue.arrayContains(Constant._fromProto(value)) + ); case Operator.IN: { const values = value?.arrayValue?.values?.map((val: any) => - Constant.of(val) + Constant._fromProto(val) ); - return andFunction(field.exists(), field.eqAny(...values!)); + if (!values) { + return and(fieldValue.exists(), fieldValue.eqAny([])); + } else if (values.length === 1) { + return and(fieldValue.exists(), fieldValue.eq(values[0])); + } else { + return and(fieldValue.exists(), fieldValue.eqAny(values)); + } } case Operator.ARRAY_CONTAINS_ANY: { const values = value?.arrayValue?.values?.map((val: any) => - Constant.of(val) + Constant._fromProto(val) ); - return andFunction(field.exists(), field.arrayContainsAny(values!)); + return and(fieldValue.exists(), fieldValue.arrayContainsAny(values!)); } case Operator.NOT_IN: { const values = value?.arrayValue?.values?.map((val: any) => - Constant.of(val) + Constant._fromProto(val) ); - return andFunction(field.exists(), not(field.eqAny(...values!))); + if (!values) { + return and(fieldValue.exists(), fieldValue.notEqAny([])); + } else if (values.length === 1) { + return and(fieldValue.exists(), fieldValue.neq(values[0])); + } else { + return and(fieldValue.exists(), fieldValue.notEqAny(values)); + } } default: fail('Unexpected operator'); @@ -114,16 +145,12 @@ export function toPipelineFilterCondition(f: FilterInternal): FilterCondition { } else if (f instanceof CompositeFilterInternal) { switch (f.op) { case CompositeOperator.AND: { - const conditions = f - .getFilters() - .map(f => toPipelineFilterCondition(f)); - return andFunction(conditions[0], ...conditions.slice(1)); + const conditions = f.getFilters().map(f => toPipelineBooleanExpr(f)); + return and(conditions[0], conditions[1], ...conditions.slice(2)); } case CompositeOperator.OR: { - const conditions = f - .getFilters() - .map(f => toPipelineFilterCondition(f)); - return orFunction(conditions[0], ...conditions.slice(1)); + const conditions = f.getFilters().map(f => toPipelineBooleanExpr(f)); + return or(conditions[0], conditions[1], ...conditions.slice(2)); } default: fail('Unexpected operator'); @@ -155,17 +182,21 @@ export function toPipeline(query: Query, db: Firestore): Pipeline { // filters for (const filter of query.filters) { - pipeline = pipeline.where(toPipelineFilterCondition(filter)); + pipeline = pipeline.where(toPipelineBooleanExpr(filter)); } // orders const orders = queryNormalizedOrderBy(query); const existsConditions = orders.map(order => - Field.of(order.field.canonicalString()).exists() + field(order.field.canonicalString()).exists() ); if (existsConditions.length > 1) { pipeline = pipeline.where( - andFunction(existsConditions[0], ...existsConditions.slice(1)) + and( + existsConditions[0], + existsConditions[1], + ...existsConditions.slice(2) + ) ); } else { pipeline = pipeline.where(existsConditions[0]); @@ -173,42 +204,45 @@ export function toPipeline(query: Query, db: Firestore): Pipeline { const orderings = orders.map(order => order.dir === Direction.ASCENDING - ? Field.of(order.field.canonicalString()).ascending() - : Field.of(order.field.canonicalString()).descending() + ? field(order.field.canonicalString()).ascending() + : field(order.field.canonicalString()).descending() ); - if (query.limitType === LimitType.Last) { - pipeline = pipeline.sort(...reverseOrderings(orderings)); - // cursors - if (query.startAt !== null) { - pipeline = pipeline.where( - whereConditionsFromCursor(query.startAt, orderings, 'before') - ); - } + if (orderings.length > 0) { + if (query.limitType === LimitType.Last) { + const actualOrderings = reverseOrderings(orderings); + pipeline = pipeline.sort(actualOrderings[0], ...actualOrderings.slice(1)); + // cursors + if (query.startAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.startAt, orderings, 'after') + ); + } - if (query.endAt !== null) { - pipeline = pipeline.where( - whereConditionsFromCursor(query.endAt, orderings, 'after') - ); - } + if (query.endAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.endAt, orderings, 'before') + ); + } - pipeline = pipeline._limit(query.limit!, true); - pipeline = pipeline.sort(...orderings); - } else { - pipeline = pipeline.sort(...orderings); - if (query.startAt !== null) { - pipeline = pipeline.where( - whereConditionsFromCursor(query.startAt, orderings, 'after') - ); - } - if (query.endAt !== null) { - pipeline = pipeline.where( - whereConditionsFromCursor(query.endAt, orderings, 'before') - ); - } + pipeline = pipeline._limit(query.limit!, true); + pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); + } else { + pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); + if (query.startAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.startAt, orderings, 'after') + ); + } + if (query.endAt !== null) { + pipeline = pipeline.where( + whereConditionsFromCursor(query.endAt, orderings, 'before') + ); + } - if (query.limit !== null) { - pipeline = pipeline.limit(query.limit); + if (query.limit !== null) { + pipeline = pipeline.limit(query.limit); + } } } @@ -219,19 +253,19 @@ function whereConditionsFromCursor( bound: Bound, orderings: Ordering[], position: 'before' | 'after' -): FilterCondition { +): BooleanExpr { const cursors = bound.position.map(value => Constant._fromProto(value)); const filterFunc = position === 'before' ? lt : gt; const filterInclusiveFunc = position === 'before' ? lte : gte; - const orConditions = []; + const orConditions: BooleanExpr[] = []; for (let i = 1; i <= orderings.length; i++) { const cursorSubset = cursors.slice(0, i); - const conditions = cursorSubset.map((cursor, index) => { + const conditions: BooleanExpr[] = cursorSubset.map((cursor, index) => { if (index < cursorSubset.length - 1) { return eq(orderings[index].expr as Field, cursor); - } else if (!!bound.inclusive && i === orderings.length) { + } else if (bound.inclusive && i === orderings.length - 1) { return filterInclusiveFunc(orderings[index].expr as Field, cursor); } else { return filterFunc(orderings[index].expr as Field, cursor); @@ -241,13 +275,15 @@ function whereConditionsFromCursor( if (conditions.length === 1) { orConditions.push(conditions[0]); } else { - orConditions.push(new And(conditions)); + orConditions.push( + and(conditions[0], conditions[1], ...conditions.slice(2)) + ); } } if (orConditions.length === 1) { return orConditions[0]; } else { - return new Or(orConditions); + return or(orConditions[0], orConditions[1], ...orConditions.slice(2)); } } diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 03e5c5e747e..6eaebf2c4f0 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -15,8 +15,7 @@ * limitations under the License. */ -/* eslint @typescript-eslint/no-explicit-any: 0 */ - +import { ParseContext } from '../api/parse_context'; import { DOCUMENT_KEY_NAME, FieldPath as InternalFieldPath @@ -24,17 +23,19 @@ import { import { Value as ProtoValue } from '../protos/firestore_proto_api'; import { JsonProtoSerializer, - ProtoSerializable, + ProtoValueSerializable, + toMapValue, toStringValue, UserData } from '../remote/serializer'; import { hardAssert } from '../util/assert'; +import { isPlainObject } from '../util/input_validation'; import { isFirestoreValue } from '../util/proto'; +import { isString } from '../util/types'; import { Bytes } from './bytes'; -import { documentId, FieldPath } from './field_path'; +import { documentId as documentIdFieldPath, FieldPath } from './field_path'; import { GeoPoint } from './geo_point'; -import { Pipeline } from './pipeline'; import { DocumentReference } from './reference'; import { Timestamp } from './timestamp'; import { @@ -54,9 +55,72 @@ export type ExprType = | 'Field' | 'Constant' | 'Function' + | 'AggregateFunction' | 'ListOfExprs' | 'ExprWithAlias'; +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * + * @private + * @internal + * @param value + */ +function valueToDefaultExpr(value: unknown): Expr { + let result: Expr | undefined; + if (value instanceof Expr) { + return value; + } else if (isPlainObject(value)) { + result = map(value as Record); + } else if (value instanceof Array) { + result = array(value); + } else { + result = new Constant(value); + } + + result._createdFromLiteral = true; + return result; +} + +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * + * @private + * @internal + * @param value + */ +function vectorToExpr(value: VectorValue | number[] | Expr): Expr { + if (value instanceof Expr) { + return value; + } else { + const result = constantVector(value); + result._createdFromLiteral = true; + return result; + } +} + +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * If the input is a string, it is assumed to be a field name, and a + * field(value) is returned. + * + * @private + * @internal + * @param value + */ +function fieldOrExpression(value: unknown): Expr { + if (isString(value)) { + const result = field(value); + result._createdFromLiteral = true; + return result; + } else { + return valueToDefaultExpr(value); + } +} + /** * @beta * @@ -69,44 +133,55 @@ export type ExprType = * - **Field references:** Access values from document fields. * - **Literals:** Represent constant values (strings, numbers, booleans). * - **Function calls:** Apply functions to one or more expressions. - * - **Aggregations:** Calculate aggregate values (e.g., sum, average) over a set of documents. * * The `Expr` class provides a fluent API for building expressions. You can chain together * method calls to create complex expressions. */ -export abstract class Expr implements ProtoSerializable, UserData { - abstract exprType: ExprType; +export abstract class Expr implements ProtoValueSerializable, UserData { + abstract readonly exprType: ExprType; /** - * Creates an expression that adds this expression to another expression. - * - * ```typescript - * // Add the value of the 'quantity' field and the 'reserve' field. - * Field.of("quantity").add(Field.of("reserve")); - * ``` - * - * @param other The expression to add to this expression. - * @return A new `Expr` representing the addition operation. + * @internal + * @private + * Indicates if this expression was created from a literal value passed + * by the caller. + */ + _createdFromLiteral: boolean = false; + + /** + * @private + * @internal + */ + abstract _toProto(serializer: JsonProtoSerializer): ProtoValue; + _protoValueType = 'ProtoValue' as const; + + /** + * @private + * @internal */ - add(other: Expr): Add; + abstract _readUserData( + dataReader: UserDataReader, + context?: ParseContext + ): void; /** - * Creates an expression that adds this expression to a constant value. + * Creates an expression that adds this expression to another expression. * * ```typescript - * // Add 5 to the value of the 'age' field - * Field.of("age").add(5); + * // Add the value of the 'quantity' field and the 'reserve' field. + * field("quantity").add(field("reserve")); * ``` * - * @param other The constant value to add. + * @param second The expression or literal to add to this expression. + * @param others Optional additional expressions or literals to add to this expression. * @return A new `Expr` representing the addition operation. */ - add(other: any): Add; - add(other: any): Add { - if (other instanceof Expr) { - return new Add(this, other); - } - return new Add(this, Constant.of(other)); + add(second: Expr | unknown, ...others: Array): FunctionExpr { + const values = [second, ...others]; + return new FunctionExpr('add', [ + this, + ...values.map(value => valueToDefaultExpr(value)) + ]); } /** @@ -114,31 +189,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Subtract the 'discount' field from the 'price' field - * Field.of("price").subtract(Field.of("discount")); + * field("price").subtract(field("discount")); * ``` * * @param other The expression to subtract from this expression. * @return A new `Expr` representing the subtraction operation. */ - subtract(other: Expr): Subtract; + subtract(other: Expr): FunctionExpr; /** * Creates an expression that subtracts a constant value from this expression. * * ```typescript * // Subtract 20 from the value of the 'total' field - * Field.of("total").subtract(20); + * field("total").subtract(20); * ``` * * @param other The constant value to subtract. * @return A new `Expr` representing the subtraction operation. */ - subtract(other: any): Subtract; - subtract(other: any): Subtract { - if (other instanceof Expr) { - return new Subtract(this, other); - } - return new Subtract(this, Constant.of(other)); + subtract(other: number): FunctionExpr; + subtract(other: number | Expr): FunctionExpr { + return new FunctionExpr('subtract', [this, valueToDefaultExpr(other)]); } /** @@ -146,31 +218,22 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Multiply the 'quantity' field by the 'price' field - * Field.of("quantity").multiply(Field.of("price")); - * ``` - * - * @param other The expression to multiply by. - * @return A new `Expr` representing the multiplication operation. - */ - multiply(other: Expr): Multiply; - - /** - * Creates an expression that multiplies this expression by a constant value. - * - * ```typescript - * // Multiply the 'value' field by 2 - * Field.of("value").multiply(2); + * field("quantity").multiply(field("price")); * ``` * - * @param other The constant value to multiply by. + * @param second The second expression or literal to multiply by. + * @param others Optional additional expressions or literals to multiply by. * @return A new `Expr` representing the multiplication operation. */ - multiply(other: any): Multiply; - multiply(other: any): Multiply { - if (other instanceof Expr) { - return new Multiply(this, other); - } - return new Multiply(this, Constant.of(other)); + multiply( + second: Expr | number, + ...others: Array + ): FunctionExpr { + return new FunctionExpr('multiply', [ + this, + valueToDefaultExpr(second), + ...others.map(value => valueToDefaultExpr(value)) + ]); } /** @@ -178,31 +241,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Divide the 'total' field by the 'count' field - * Field.of("total").divide(Field.of("count")); + * field("total").divide(field("count")); * ``` * * @param other The expression to divide by. * @return A new `Expr` representing the division operation. */ - divide(other: Expr): Divide; + divide(other: Expr): FunctionExpr; /** * Creates an expression that divides this expression by a constant value. * * ```typescript * // Divide the 'value' field by 10 - * Field.of("value").divide(10); + * field("value").divide(10); * ``` * * @param other The constant value to divide by. * @return A new `Expr` representing the division operation. */ - divide(other: any): Divide; - divide(other: any): Divide { - if (other instanceof Expr) { - return new Divide(this, other); - } - return new Divide(this, Constant.of(other)); + divide(other: number): FunctionExpr; + divide(other: number | Expr): FunctionExpr { + return new FunctionExpr('divide', [this, valueToDefaultExpr(other)]); } /** @@ -210,237 +270,57 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the remainder of dividing the 'value' field by the 'divisor' field - * Field.of("value").mod(Field.of("divisor")); + * field("value").mod(field("divisor")); * ``` * - * @param other The expression to divide by. + * @param expression The expression to divide by. * @return A new `Expr` representing the modulo operation. */ - mod(other: Expr): Mod; + mod(expression: Expr): FunctionExpr; /** * Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. * * ```typescript * // Calculate the remainder of dividing the 'value' field by 10 - * Field.of("value").mod(10); + * field("value").mod(10); * ``` * - * @param other The constant value to divide by. + * @param value The constant value to divide by. * @return A new `Expr` representing the modulo operation. */ - mod(other: any): Mod; - mod(other: any): Mod { - if (other instanceof Expr) { - return new Mod(this, other); - } - return new Mod(this, Constant.of(other)); + mod(value: number): FunctionExpr; + mod(other: number | Expr): FunctionExpr { + return new FunctionExpr('mod', [this, valueToDefaultExpr(other)]); } - // /** - // * Creates an expression that applies a bitwise AND operation between this expression and another expression. - // * - // * ```typescript - // * // Calculate the bitwise AND of 'field1' and 'field2'. - // * Field.of("field1").bitAnd(Field.of("field2")); - // * ``` - // * - // * @param other The right operand expression. - // * @return A new {@code Expr} representing the bitwise AND operation. - // */ - // bitAnd(other: Expr): BitAnd; - // - // /** - // * Creates an expression that applies a bitwise AND operation between this expression and a constant value. - // * - // * ```typescript - // * // Calculate the bitwise AND of 'field1' and 0xFF. - // * Field.of("field1").bitAnd(0xFF); - // * ``` - // * - // * @param other The right operand constant. - // * @return A new {@code Expr} representing the bitwise AND operation. - // */ - // bitAnd(other: any): BitAnd; - // bitAnd(other: any): BitAnd { - // if (other instanceof Expr) { - // return new BitAnd(this, other); - // } - // return new BitAnd(this, Constant.of(other)); - // } - // - // /** - // * Creates an expression that applies a bitwise OR operation between this expression and another expression. - // * - // * ```typescript - // * // Calculate the bitwise OR of 'field1' and 'field2'. - // * Field.of("field1").bitOr(Field.of("field2")); - // * ``` - // * - // * @param other The right operand expression. - // * @return A new {@code Expr} representing the bitwise OR operation. - // */ - // bitOr(other: Expr): BitOr; - // - // /** - // * Creates an expression that applies a bitwise OR operation between this expression and a constant value. - // * - // * ```typescript - // * // Calculate the bitwise OR of 'field1' and 0xFF. - // * Field.of("field1").bitOr(0xFF); - // * ``` - // * - // * @param other The right operand constant. - // * @return A new {@code Expr} representing the bitwise OR operation. - // */ - // bitOr(other: any): BitOr; - // bitOr(other: any): BitOr { - // if (other instanceof Expr) { - // return new BitOr(this, other); - // } - // return new BitOr(this, Constant.of(other)); - // } - // - // /** - // * Creates an expression that applies a bitwise XOR operation between this expression and another expression. - // * - // * ```typescript - // * // Calculate the bitwise XOR of 'field1' and 'field2'. - // * Field.of("field1").bitXor(Field.of("field2")); - // * ``` - // * - // * @param other The right operand expression. - // * @return A new {@code Expr} representing the bitwise XOR operation. - // */ - // bitXor(other: Expr): BitXor; - // - // /** - // * Creates an expression that applies a bitwise XOR operation between this expression and a constant value. - // * - // * ```typescript - // * // Calculate the bitwise XOR of 'field1' and 0xFF. - // * Field.of("field1").bitXor(0xFF); - // * ``` - // * - // * @param other The right operand constant. - // * @return A new {@code Expr} representing the bitwise XOR operation. - // */ - // bitXor(other: any): BitXor; - // bitXor(other: any): BitXor { - // if (other instanceof Expr) { - // return new BitXor(this, other); - // } - // return new BitXor(this, Constant.of(other)); - // } - // - // /** - // * Creates an expression that applies a bitwise NOT operation to this expression. - // * - // * ```typescript - // * // Calculate the bitwise NOT of 'field1'. - // * Field.of("field1").bitNot(); - // * ``` - // * - // * @return A new {@code Expr} representing the bitwise NOT operation. - // */ - // bitNot(): BitNot { - // return new BitNot(this); - // } - // - // /** - // * Creates an expression that applies a bitwise left shift operation between this expression and another expression. - // * - // * ```typescript - // * // Calculate the bitwise left shift of 'field1' by 'field2' bits. - // * Field.of("field1").bitLeftShift(Field.of("field2")); - // * ``` - // * - // * @param other The right operand expression representing the number of bits to shift. - // * @return A new {@code Expr} representing the bitwise left shift operation. - // */ - // bitLeftShift(other: Expr): BitLeftShift; - // - // /** - // * Creates an expression that applies a bitwise left shift operation between this expression and a constant value. - // * - // * ```typescript - // * // Calculate the bitwise left shift of 'field1' by 2 bits. - // * Field.of("field1").bitLeftShift(2); - // * ``` - // * - // * @param other The right operand constant representing the number of bits to shift. - // * @return A new {@code Expr} representing the bitwise left shift operation. - // */ - // bitLeftShift(other: number): BitLeftShift; - // bitLeftShift(other: Expr | number): BitLeftShift { - // if (typeof other === 'number') { - // return new BitLeftShift(this, Constant.of(other)); - // } - // return new BitLeftShift(this, other as Expr); - // } - // - // /** - // * Creates an expression that applies a bitwise right shift operation between this expression and another expression. - // * - // * ```typescript - // * // Calculate the bitwise right shift of 'field1' by 'field2' bits. - // * Field.of("field1").bitRightShift(Field.of("field2")); - // * ``` - // * - // * @param other The right operand expression representing the number of bits to shift. - // * @return A new {@code Expr} representing the bitwise right shift operation. - // */ - // bitRightShift(other: Expr): BitRightShift; - // - // /** - // * Creates an expression that applies a bitwise right shift operation between this expression and a constant value. - // * - // * ```typescript - // * // Calculate the bitwise right shift of 'field1' by 2 bits. - // * Field.of("field1").bitRightShift(2); - // * ``` - // * - // * @param other The right operand constant representing the number of bits to shift. - // * @return A new {@code Expr} representing the bitwise right shift operation. - // */ - // bitRightShift(other: number): BitRightShift; - // bitRightShift(other: Expr | number): BitRightShift { - // if (typeof other === 'number') { - // return new BitRightShift(this, Constant.of(other)); - // } - // return new BitRightShift(this, other as Expr); - // } - /** * Creates an expression that checks if this expression is equal to another expression. * * ```typescript * // Check if the 'age' field is equal to 21 - * Field.of("age").eq(21); + * field("age").eq(21); * ``` * - * @param other The expression to compare for equality. + * @param expression The expression to compare for equality. * @return A new `Expr` representing the equality comparison. */ - eq(other: Expr): Eq; + eq(expression: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is equal to a constant value. * * ```typescript * // Check if the 'city' field is equal to "London" - * Field.of("city").eq("London"); + * field("city").eq("London"); * ``` * - * @param other The constant value to compare for equality. + * @param value The constant value to compare for equality. * @return A new `Expr` representing the equality comparison. */ - eq(other: any): Eq; - eq(other: any): Eq { - if (other instanceof Expr) { - return new Eq(this, other); - } - return new Eq(this, Constant.of(other)); + eq(value: unknown): BooleanExpr; + eq(other: unknown): BooleanExpr { + return new BooleanExpr('eq', [this, valueToDefaultExpr(other)]); } /** @@ -448,31 +328,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'status' field is not equal to "completed" - * Field.of("status").neq("completed"); + * field("status").neq("completed"); * ``` * - * @param other The expression to compare for inequality. + * @param expression The expression to compare for inequality. * @return A new `Expr` representing the inequality comparison. */ - neq(other: Expr): Neq; + neq(expression: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is not equal to a constant value. * * ```typescript * // Check if the 'country' field is not equal to "USA" - * Field.of("country").neq("USA"); + * field("country").neq("USA"); * ``` * - * @param other The constant value to compare for inequality. + * @param value The constant value to compare for inequality. * @return A new `Expr` representing the inequality comparison. */ - neq(other: any): Neq; - neq(other: any): Neq { - if (other instanceof Expr) { - return new Neq(this, other); - } - return new Neq(this, Constant.of(other)); + neq(value: unknown): BooleanExpr; + neq(other: unknown): BooleanExpr { + return new BooleanExpr('neq', [this, valueToDefaultExpr(other)]); } /** @@ -480,31 +357,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'age' field is less than 'limit' - * Field.of("age").lt(Field.of('limit')); + * field("age").lt(field('limit')); * ``` * - * @param other The expression to compare for less than. + * @param experession The expression to compare for less than. * @return A new `Expr` representing the less than comparison. */ - lt(other: Expr): Lt; + lt(experession: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is less than a constant value. * * ```typescript * // Check if the 'price' field is less than 50 - * Field.of("price").lt(50); + * field("price").lt(50); * ``` * - * @param other The constant value to compare for less than. + * @param value The constant value to compare for less than. * @return A new `Expr` representing the less than comparison. */ - lt(other: any): Lt; - lt(other: any): Lt { - if (other instanceof Expr) { - return new Lt(this, other); - } - return new Lt(this, Constant.of(other)); + lt(value: unknown): BooleanExpr; + lt(other: unknown): BooleanExpr { + return new BooleanExpr('lt', [this, valueToDefaultExpr(other)]); } /** @@ -513,31 +387,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * Field.of("quantity").lte(Constant.of(20)); + * field("quantity").lte(constant(20)); * ``` * - * @param other The expression to compare for less than or equal to. + * @param expression The expression to compare for less than or equal to. * @return A new `Expr` representing the less than or equal to comparison. */ - lte(other: Expr): Lte; + lte(expression: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is less than or equal to a constant value. * * ```typescript * // Check if the 'score' field is less than or equal to 70 - * Field.of("score").lte(70); + * field("score").lte(70); * ``` * - * @param other The constant value to compare for less than or equal to. + * @param value The constant value to compare for less than or equal to. * @return A new `Expr` representing the less than or equal to comparison. */ - lte(other: any): Lte; - lte(other: any): Lte { - if (other instanceof Expr) { - return new Lte(this, other); - } - return new Lte(this, Constant.of(other)); + lte(value: unknown): BooleanExpr; + lte(other: unknown): BooleanExpr { + return new BooleanExpr('lte', [this, valueToDefaultExpr(other)]); } /** @@ -545,31 +416,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'age' field is greater than the 'limit' field - * Field.of("age").gt(Field.of("limit")); + * field("age").gt(field("limit")); * ``` * - * @param other The expression to compare for greater than. + * @param expression The expression to compare for greater than. * @return A new `Expr` representing the greater than comparison. */ - gt(other: Expr): Gt; + gt(expression: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is greater than a constant value. * * ```typescript * // Check if the 'price' field is greater than 100 - * Field.of("price").gt(100); + * field("price").gt(100); * ``` * - * @param other The constant value to compare for greater than. + * @param value The constant value to compare for greater than. * @return A new `Expr` representing the greater than comparison. */ - gt(other: any): Gt; - gt(other: any): Gt { - if (other instanceof Expr) { - return new Gt(this, other); - } - return new Gt(this, Constant.of(other)); + gt(value: unknown): BooleanExpr; + gt(other: unknown): BooleanExpr { + return new BooleanExpr('gt', [this, valueToDefaultExpr(other)]); } /** @@ -578,13 +446,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 - * Field.of("quantity").gte(Field.of('requirement').add(1)); + * field("quantity").gte(field('requirement').add(1)); * ``` * - * @param other The expression to compare for greater than or equal to. + * @param expression The expression to compare for greater than or equal to. * @return A new `Expr` representing the greater than or equal to comparison. */ - gte(other: Expr): Gte; + gte(expression: Expr): BooleanExpr; /** * Creates an expression that checks if this expression is greater than or equal to a constant @@ -592,18 +460,15 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'score' field is greater than or equal to 80 - * Field.of("score").gte(80); + * field("score").gte(80); * ``` * - * @param other The constant value to compare for greater than or equal to. + * @param value The constant value to compare for greater than or equal to. * @return A new `Expr` representing the greater than or equal to comparison. */ - gte(other: any): Gte; - gte(other: any): Gte { - if (other instanceof Expr) { - return new Gte(this, other); - } - return new Gte(this, Constant.of(other)); + gte(value: unknown): BooleanExpr; + gte(other: unknown): BooleanExpr { + return new BooleanExpr('gte', [this, valueToDefaultExpr(other)]); } /** @@ -611,31 +476,19 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Combine the 'items' array with another array field. - * Field.of("items").arrayConcat(Field.of("otherItems")); + * field("items").arrayConcat(field("otherItems")); * ``` - * - * @param arrays The array expressions to concatenate. + * @param secondArray Second array expression or array literal to concatenate. + * @param otherArrays Optional additional array expressions or array literals to concatenate. * @return A new `Expr` representing the concatenated array. */ - arrayConcat(...arrays: Expr[]): ArrayConcat; - - /** - * Creates an expression that concatenates an array with one or more other arrays. - * - * ```typescript - * // Combine the 'tags' array with a new array and an array field - * Field.of("tags").arrayConcat(Arrays.asList("newTag1", "newTag2"), Field.of("otherTag")); - * ``` - * - * @param arrays The arrays to concatenate. - * @return A new `Expr` representing the concatenated arrays. - */ - arrayConcat(...arrays: any[][]): ArrayConcat; - arrayConcat(...arrays: any[]): ArrayConcat { - const exprValues = arrays.map(value => - value instanceof Expr ? value : Constant.of(value) - ); - return new ArrayConcat(this, exprValues); + arrayConcat( + secondArray: Expr | unknown[], + ...otherArrays: Array + ): FunctionExpr { + const elements = [secondArray, ...otherArrays]; + const exprValues = elements.map(value => valueToDefaultExpr(value)); + return new FunctionExpr('array_concat', [this, ...exprValues]); } /** @@ -643,63 +496,63 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'sizes' array contains the value from the 'selectedSize' field - * Field.of("sizes").arrayContains(Field.of("selectedSize")); + * field("sizes").arrayContains(field("selectedSize")); * ``` * - * @param element The element to search for in the array. + * @param expression The element to search for in the array. * @return A new `Expr` representing the 'array_contains' comparison. */ - arrayContains(element: Expr): ArrayContains; + arrayContains(expression: Expr): BooleanExpr; /** * Creates an expression that checks if an array contains a specific value. * * ```typescript * // Check if the 'colors' array contains "red" - * Field.of("colors").arrayContains("red"); + * field("colors").arrayContains("red"); * ``` * - * @param element The element to search for in the array. + * @param value The element to search for in the array. * @return A new `Expr` representing the 'array_contains' comparison. */ - arrayContains(element: any): ArrayContains; - arrayContains(element: any): ArrayContains { - if (element instanceof Expr) { - return new ArrayContains(this, element); - } - return new ArrayContains(this, Constant.of(element)); + arrayContains(value: unknown): BooleanExpr; + arrayContains(element: unknown): BooleanExpr { + return new BooleanExpr('array_contains', [ + this, + valueToDefaultExpr(element) + ]); } /** * Creates an expression that checks if an array contains all the specified elements. * * ```typescript - * // Check if the 'tags' array contains both "news" and "sports" - * Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + * // Check if the 'tags' array contains both the value in field "tag1" and the literal value "tag2" + * field("tags").arrayContainsAll([field("tag1"), "tag2"]); * ``` * * @param values The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_all' comparison. */ - arrayContainsAll(...values: Expr[]): ArrayContainsAll; + arrayContainsAll(values: Array): BooleanExpr; /** * Creates an expression that checks if an array contains all the specified elements. * * ```typescript - * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" - * Field.of("tags").arrayContainsAll(Field.of("tag1"), Field.of("tag2")); + * // Check if the 'tags' array contains both of the values from field "tag1" and the literal value "tag2" + * field("tags").arrayContainsAll(array([field("tag1"), "tag2"])); * ``` * - * @param values The elements to check for in the array. + * @param arrayExpression The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_all' comparison. */ - arrayContainsAll(...values: any[]): ArrayContainsAll; - arrayContainsAll(...values: any[]): ArrayContainsAll { - const exprValues = values.map(value => - value instanceof Expr ? value : Constant.of(value) - ); - return new ArrayContainsAll(this, exprValues); + arrayContainsAll(arrayExpression: Expr): BooleanExpr; + arrayContainsAll(values: unknown[] | Expr): BooleanExpr { + const normalizedExpr = Array.isArray(values) + ? new ListOfExprs(values.map(valueToDefaultExpr)) + : values; + return new BooleanExpr('array_contains_all', [this, normalizedExpr]); } /** @@ -707,13 +560,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'categories' array contains either values from field "cate1" or "cate2" - * Field.of("categories").arrayContainsAny(Field.of("cate1"), Field.of("cate2")); + * field("categories").arrayContainsAny([field("cate1"), field("cate2")]); * ``` * * @param values The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_any' comparison. */ - arrayContainsAny(...values: Expr[]): ArrayContainsAny; + arrayContainsAny(values: Array): BooleanExpr; /** * Creates an expression that checks if an array contains any of the specified elements. @@ -721,18 +574,18 @@ export abstract class Expr implements ProtoSerializable, UserData { * ```typescript * // Check if the 'groups' array contains either the value from the 'userGroup' field * // or the value "guest" - * Field.of("groups").arrayContainsAny(Field.of("userGroup"), "guest"); + * field("groups").arrayContainsAny(array([field("userGroup"), "guest"])); * ``` * - * @param values The elements to check for in the array. + * @param arrayExpression The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_any' comparison. */ - arrayContainsAny(...values: any[]): ArrayContainsAny; - arrayContainsAny(...values: any[]): ArrayContainsAny { - const exprValues = values.map(value => - value instanceof Expr ? value : Constant.of(value) - ); - return new ArrayContainsAny(this, exprValues); + arrayContainsAny(arrayExpression: Expr): BooleanExpr; + arrayContainsAny(values: Array | Expr): BooleanExpr { + const normalizedExpr = Array.isArray(values) + ? new ListOfExprs(values.map(valueToDefaultExpr)) + : values; + return new BooleanExpr('array_contains_any', [this, normalizedExpr]); } /** @@ -740,13 +593,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Get the number of items in the 'cart' array - * Field.of("cart").arrayLength(); + * field("cart").arrayLength(); * ``` * * @return A new `Expr` representing the length of the array. */ - arrayLength(): ArrayLength { - return new ArrayLength(this); + arrayLength(): FunctionExpr { + return new FunctionExpr('array_length', [this]); } /** @@ -755,13 +608,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * Field.of("category").eqAny("Electronics", Field.of("primaryType")); + * field("category").eqAny("Electronics", field("primaryType")); * ``` * - * @param others The values or expressions to check against. + * @param values The values or expressions to check against. * @return A new `Expr` representing the 'IN' comparison. */ - eqAny(...others: Expr[]): EqAny; + eqAny(values: Array): BooleanExpr; /** * Creates an expression that checks if this expression is equal to any of the provided values or @@ -769,18 +622,18 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * Field.of("category").eqAny("Electronics", Field.of("primaryType")); + * field("category").eqAny(array(["Electronics", field("primaryType")])); * ``` * - * @param others The values or expressions to check against. + * @param arrayExpression An expression that evaluates to an array of values to check against. * @return A new `Expr` representing the 'IN' comparison. */ - eqAny(...others: any[]): EqAny; - eqAny(...others: any[]): EqAny { - const exprOthers = others.map(other => - other instanceof Expr ? other : Constant.of(other) - ); - return new EqAny(this, exprOthers); + eqAny(arrayExpression: Expr): BooleanExpr; + eqAny(others: unknown[] | Expr): BooleanExpr { + const exprOthers = Array.isArray(others) + ? new ListOfExprs(others.map(valueToDefaultExpr)) + : others; + return new BooleanExpr('eq_any', [this, exprOthers]); } /** @@ -789,32 +642,31 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * Field.of("status").notEqAny("pending", Field.of("rejectedStatus")); + * field("status").notEqAny(["pending", field("rejectedStatus")]); * ``` * - * @param others The values or expressions to check against. + * @param values The values or expressions to check against. * @return A new `Expr` representing the 'NotEqAny' comparison. */ - notEqAny(...others: Expr[]): NotEqAny; + notEqAny(values: Array): BooleanExpr; /** - * Creates an expression that checks if this expression is not equal to any of the provided values or - * expressions. + * Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression. * * ```typescript - * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * Field.of("status").notEqAny("pending", Field.of("rejectedStatus")); + * // Check if the 'status' field is not equal to any value in the field 'rejectedStatuses' + * field("status").notEqAny(field('rejectedStatuses')); * ``` * - * @param others The values or expressions to check against. + * @param arrayExpression The values or expressions to check against. * @return A new `Expr` representing the 'NotEqAny' comparison. */ - notEqAny(...others: any[]): NotEqAny; - notEqAny(...others: any[]): NotEqAny { - const exprOthers = others.map(other => - other instanceof Expr ? other : Constant.of(other) - ); - return new NotEqAny(this, exprOthers); + notEqAny(arrayExpression: Expr): BooleanExpr; + notEqAny(others: unknown[] | Expr): BooleanExpr { + const exprOthers = Array.isArray(others) + ? new ListOfExprs(others.map(valueToDefaultExpr)) + : others; + return new BooleanExpr('not_eq_any', [this, exprOthers]); } /** @@ -822,13 +674,27 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the result of a calculation is NaN - * Field.of("value").divide(0).isNaN(); + * field("value").divide(0).isNaN(); * ``` * * @return A new `Expr` representing the 'isNaN' check. */ - isNaN(): IsNan { - return new IsNan(this); + isNan(): BooleanExpr { + return new BooleanExpr('is_nan', [this]); + } + + /** + * Creates an expression that checks if this expression evaluates to 'Null'. + * + * ```typescript + * // Check if the result of a calculation is NaN + * field("value").isNull(); + * ``` + * + * @return A new `Expr` representing the 'isNull' check. + */ + isNull(): BooleanExpr { + return new BooleanExpr('is_null', [this]); } /** @@ -836,13 +702,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the document has a field named "phoneNumber" - * Field.of("phoneNumber").exists(); + * field("phoneNumber").exists(); * ``` * * @return A new `Expr` representing the 'exists' check. */ - exists(): Exists { - return new Exists(this); + exists(): BooleanExpr { + return new BooleanExpr('exists', [this]); } /** @@ -850,13 +716,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Get the character length of the 'name' field in its UTF-8 form. - * Field.of("name").charLength(); + * field("name").charLength(); * ``` * * @return A new `Expr` representing the length of the string. */ - charLength(): CharLength { - return new CharLength(this); + charLength(): FunctionExpr { + return new FunctionExpr('char_length', [this]); } /** @@ -864,31 +730,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'title' field contains the word "guide" (case-sensitive) - * Field.of("title").like("%guide%"); + * field("title").like("%guide%"); * ``` * * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new `Expr` representing the 'like' comparison. */ - like(pattern: string): Like; + like(pattern: string): FunctionExpr; /** * Creates an expression that performs a case-sensitive string comparison. * * ```typescript * // Check if the 'title' field contains the word "guide" (case-sensitive) - * Field.of("title").like("%guide%"); + * field("title").like("%guide%"); * ``` * * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new `Expr` representing the 'like' comparison. */ - like(pattern: Expr): Like; - like(stringOrExpr: string | Expr): Like { - if (typeof stringOrExpr === 'string') { - return new Like(this, Constant.of(stringOrExpr)); - } - return new Like(this, stringOrExpr as Expr); + like(pattern: Expr): FunctionExpr; + like(stringOrExpr: string | Expr): FunctionExpr { + return new FunctionExpr('like', [this, valueToDefaultExpr(stringOrExpr)]); } /** @@ -897,13 +760,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'description' field contains "example" (case-insensitive) - * Field.of("description").regexContains("(?i)example"); + * field("description").regexContains("(?i)example"); * ``` * * @param pattern The regular expression to use for the search. * @return A new `Expr` representing the 'contains' comparison. */ - regexContains(pattern: string): RegexContains; + regexContains(pattern: string): BooleanExpr; /** * Creates an expression that checks if a string contains a specified regular expression as a @@ -911,18 +774,18 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'description' field contains the regular expression stored in field 'regex' - * Field.of("description").regexContains(Field.of("regex")); + * field("description").regexContains(field("regex")); * ``` * * @param pattern The regular expression to use for the search. * @return A new `Expr` representing the 'contains' comparison. */ - regexContains(pattern: Expr): RegexContains; - regexContains(stringOrExpr: string | Expr): RegexContains { - if (typeof stringOrExpr === 'string') { - return new RegexContains(this, Constant.of(stringOrExpr)); - } - return new RegexContains(this, stringOrExpr as Expr); + regexContains(pattern: Expr): BooleanExpr; + regexContains(stringOrExpr: string | Expr): BooleanExpr { + return new BooleanExpr('regex_contains', [ + this, + valueToDefaultExpr(stringOrExpr) + ]); } /** @@ -930,31 +793,31 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'email' field matches a valid email pattern - * Field.of("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + * field("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); * ``` * * @param pattern The regular expression to use for the match. * @return A new `Expr` representing the regular expression match. */ - regexMatch(pattern: string): RegexMatch; + regexMatch(pattern: string): BooleanExpr; /** * Creates an expression that checks if a string matches a specified regular expression. * * ```typescript * // Check if the 'email' field matches a regular expression stored in field 'regex' - * Field.of("email").regexMatch(Field.of("regex")); + * field("email").regexMatch(field("regex")); * ``` * * @param pattern The regular expression to use for the match. * @return A new `Expr` representing the regular expression match. */ - regexMatch(pattern: Expr): RegexMatch; - regexMatch(stringOrExpr: string | Expr): RegexMatch { - if (typeof stringOrExpr === 'string') { - return new RegexMatch(this, Constant.of(stringOrExpr)); - } - return new RegexMatch(this, stringOrExpr as Expr); + regexMatch(pattern: Expr): BooleanExpr; + regexMatch(stringOrExpr: string | Expr): BooleanExpr { + return new BooleanExpr('regex_match', [ + this, + valueToDefaultExpr(stringOrExpr) + ]); } /** @@ -962,31 +825,31 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'description' field contains "example". - * Field.of("description").strContains("example"); + * field("description").strContains("example"); * ``` * * @param substring The substring to search for. * @return A new `Expr` representing the 'contains' comparison. */ - strContains(substring: string): StrContains; + strContains(substring: string): BooleanExpr; /** * Creates an expression that checks if a string contains the string represented by another expression. * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * Field.of("description").strContains(Field.of("keyword")); + * field("description").strContains(field("keyword")); * ``` * * @param expr The expression representing the substring to search for. * @return A new `Expr` representing the 'contains' comparison. */ - strContains(expr: Expr): StrContains; - strContains(stringOrExpr: string | Expr): StrContains { - if (typeof stringOrExpr === 'string') { - return new StrContains(this, Constant.of(stringOrExpr)); - } - return new StrContains(this, stringOrExpr as Expr); + strContains(expr: Expr): BooleanExpr; + strContains(stringOrExpr: string | Expr): BooleanExpr { + return new BooleanExpr('str_contains', [ + this, + valueToDefaultExpr(stringOrExpr) + ]); } /** @@ -994,13 +857,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'name' field starts with "Mr." - * Field.of("name").startsWith("Mr."); + * field("name").startsWith("Mr."); * ``` * * @param prefix The prefix to check for. * @return A new `Expr` representing the 'starts with' comparison. */ - startsWith(prefix: string): StartsWith; + startsWith(prefix: string): BooleanExpr; /** * Creates an expression that checks if a string starts with a given prefix (represented as an @@ -1008,18 +871,18 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'fullName' field starts with the value of the 'firstName' field - * Field.of("fullName").startsWith(Field.of("firstName")); + * field("fullName").startsWith(field("firstName")); * ``` * * @param prefix The prefix expression to check for. * @return A new `Expr` representing the 'starts with' comparison. */ - startsWith(prefix: Expr): StartsWith; - startsWith(stringOrExpr: string | Expr): StartsWith { - if (typeof stringOrExpr === 'string') { - return new StartsWith(this, Constant.of(stringOrExpr)); - } - return new StartsWith(this, stringOrExpr as Expr); + startsWith(prefix: Expr): BooleanExpr; + startsWith(stringOrExpr: string | Expr): BooleanExpr { + return new BooleanExpr('starts_with', [ + this, + valueToDefaultExpr(stringOrExpr) + ]); } /** @@ -1027,13 +890,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'filename' field ends with ".txt" - * Field.of("filename").endsWith(".txt"); + * field("filename").endsWith(".txt"); * ``` * * @param suffix The postfix to check for. * @return A new `Expr` representing the 'ends with' comparison. */ - endsWith(suffix: string): EndsWith; + endsWith(suffix: string): BooleanExpr; /** * Creates an expression that checks if a string ends with a given postfix (represented as an @@ -1041,18 +904,18 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Check if the 'url' field ends with the value of the 'extension' field - * Field.of("url").endsWith(Field.of("extension")); + * field("url").endsWith(field("extension")); * ``` * * @param suffix The postfix expression to check for. * @return A new `Expr` representing the 'ends with' comparison. */ - endsWith(suffix: Expr): EndsWith; - endsWith(stringOrExpr: string | Expr): EndsWith { - if (typeof stringOrExpr === 'string') { - return new EndsWith(this, Constant.of(stringOrExpr)); - } - return new EndsWith(this, stringOrExpr as Expr); + endsWith(suffix: Expr): BooleanExpr; + endsWith(stringOrExpr: string | Expr): BooleanExpr { + return new BooleanExpr('ends_with', [ + this, + valueToDefaultExpr(stringOrExpr) + ]); } /** @@ -1060,13 +923,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Convert the 'name' field to lowercase - * Field.of("name").toLower(); + * field("name").toLower(); * ``` * * @return A new `Expr` representing the lowercase string. */ - toLower(): ToLower { - return new ToLower(this); + toLower(): FunctionExpr { + return new FunctionExpr('to_lower', [this]); } /** @@ -1074,13 +937,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Convert the 'title' field to uppercase - * Field.of("title").toUpper(); + * field("title").toUpper(); * ``` * * @return A new `Expr` representing the uppercase string. */ - toUpper(): ToUpper { - return new ToUpper(this); + toUpper(): FunctionExpr { + return new FunctionExpr('to_upper', [this]); } /** @@ -1088,13 +951,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Trim whitespace from the 'userInput' field - * Field.of("userInput").trim(); + * field("userInput").trim(); * ``` * * @return A new `Expr` representing the trimmed string. */ - trim(): Trim { - return new Trim(this); + trim(): FunctionExpr { + return new FunctionExpr('trim', [this]); } /** @@ -1102,17 +965,20 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * Field.of("firstName").strConcat(Constant.of(" "), Field.of("lastName")); + * field("firstName").strConcat(constant(" "), field("lastName")); * ``` * - * @param elements The expressions (typically strings) to concatenate. + * @param secondString The additional expression or string literal to concatenate. + * @param otherStrings Optional additional expressions or string literals to concatenate. * @return A new `Expr` representing the concatenated string. */ - strConcat(...elements: Array): StrConcat { - const exprs = elements.map(e => - typeof e === 'string' ? Constant.of(e) : (e as Expr) - ); - return new StrConcat(this, exprs); + strConcat( + secondString: Expr | string, + ...otherStrings: Array + ): FunctionExpr { + const elements = [secondString, ...otherStrings]; + const exprs = elements.map(valueToDefaultExpr); + return new FunctionExpr('str_concat', [this, ...exprs]); } /** @@ -1120,13 +986,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Reverse the value of the 'myString' field. - * Field.of("myString").reverse(); + * field("myString").reverse(); * ``` * * @return A new {@code Expr} representing the reversed string. */ - reverse(): Reverse { - return new Reverse(this); + reverse(): FunctionExpr { + return new FunctionExpr('reverse', [this]); } /** @@ -1134,14 +1000,14 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Replace the first occurrence of "hello" with "hi" in the 'message' field - * Field.of("message").replaceFirst("hello", "hi"); + * field("message").replaceFirst("hello", "hi"); * ``` * * @param find The substring to search for. * @param replace The substring to replace the first occurrence of 'find' with. * @return A new {@code Expr} representing the string with the first occurrence replaced. */ - replaceFirst(find: string, replace: string): ReplaceFirst; + replaceFirst(find: string, replace: string): FunctionExpr; /** * Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, @@ -1149,23 +1015,20 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field - * Field.of("message").replaceFirst(Field.of("findField"), Field.of("replaceField")); + * field("message").replaceFirst(field("findField"), field("replaceField")); * ``` * * @param find The expression representing the substring to search for. * @param replace The expression representing the substring to replace the first occurrence of 'find' with. * @return A new {@code Expr} representing the string with the first occurrence replaced. */ - replaceFirst(find: Expr, replace: Expr): ReplaceFirst; - replaceFirst(find: Expr | string, replace: Expr | string): ReplaceFirst { - const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; - const normalizedReplace = - typeof replace === 'string' ? Constant.of(replace) : replace; - return new ReplaceFirst( + replaceFirst(find: Expr, replace: Expr): FunctionExpr; + replaceFirst(find: Expr | string, replace: Expr | string): FunctionExpr { + return new FunctionExpr('replace_first', [ this, - normalizedFind as Expr, - normalizedReplace as Expr - ); + valueToDefaultExpr(find), + valueToDefaultExpr(replace) + ]); } /** @@ -1173,14 +1036,14 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Replace all occurrences of "hello" with "hi" in the 'message' field - * Field.of("message").replaceAll("hello", "hi"); + * field("message").replaceAll("hello", "hi"); * ``` * * @param find The substring to search for. * @param replace The substring to replace all occurrences of 'find' with. * @return A new {@code Expr} representing the string with all occurrences replaced. */ - replaceAll(find: string, replace: string): ReplaceAll; + replaceAll(find: string, replace: string): FunctionExpr; /** * Creates an expression that replaces all occurrences of a substring within this string expression with another substring, @@ -1188,23 +1051,20 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field - * Field.of("message").replaceAll(Field.of("findField"), Field.of("replaceField")); + * field("message").replaceAll(field("findField"), field("replaceField")); * ``` * * @param find The expression representing the substring to search for. * @param replace The expression representing the substring to replace all occurrences of 'find' with. * @return A new {@code Expr} representing the string with all occurrences replaced. */ - replaceAll(find: Expr, replace: Expr): ReplaceAll; - replaceAll(find: Expr | string, replace: Expr | string): ReplaceAll { - const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; - const normalizedReplace = - typeof replace === 'string' ? Constant.of(replace) : replace; - return new ReplaceAll( + replaceAll(find: Expr, replace: Expr): FunctionExpr; + replaceAll(find: Expr | string, replace: Expr | string): FunctionExpr { + return new FunctionExpr('replace_all', [ this, - normalizedFind as Expr, - normalizedReplace as Expr - ); + valueToDefaultExpr(find), + valueToDefaultExpr(replace) + ]); } /** @@ -1212,13 +1072,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the length of the 'myString' field in bytes. - * Field.of("myString").byteLength(); + * field("myString").byteLength(); * ``` * * @return A new {@code Expr} representing the length of the string in bytes. */ - byteLength(): ByteLength { - return new ByteLength(this); + byteLength(): FunctionExpr { + return new FunctionExpr('byte_length', [this]); } /** @@ -1226,14 +1086,14 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Get the 'city' value from the 'address' map field - * Field.of("address").mapGet("city"); + * field("address").mapGet("city"); * ``` * * @param subfield The key to access in the map. * @return A new `Expr` representing the value associated with the given key in the map. */ - mapGet(subfield: string): MapGet { - return new MapGet(this, subfield); + mapGet(subfield: string): FunctionExpr { + return new FunctionExpr('map_get', [this, constant(subfield)]); } /** @@ -1242,13 +1102,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Count the total number of products - * Field.of("productId").count().as("totalProducts"); + * field("productId").count().as("totalProducts"); * ``` * - * @return A new `Accumulator` representing the 'count' aggregation. + * @return A new `AggregateFunction` representing the 'count' aggregation. */ - count(): Count { - return new Count(this, false); + count(): AggregateFunction { + return new AggregateFunction('count', [this]); } /** @@ -1256,13 +1116,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the total revenue from a set of orders - * Field.of("orderAmount").sum().as("totalRevenue"); + * field("orderAmount").sum().as("totalRevenue"); * ``` * - * @return A new `Accumulator` representing the 'sum' aggregation. + * @return A new `AggregateFunction` representing the 'sum' aggregation. */ - sum(): Sum { - return new Sum(this, false); + sum(): AggregateFunction { + return new AggregateFunction('sum', [this]); } /** @@ -1271,13 +1131,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the average age of users - * Field.of("age").avg().as("averageAge"); + * field("age").avg().as("averageAge"); * ``` * - * @return A new `Accumulator` representing the 'avg' aggregation. + * @return A new `AggregateFunction` representing the 'avg' aggregation. */ - avg(): Avg { - return new Avg(this, false); + avg(): AggregateFunction { + return new AggregateFunction('avg', [this]); } /** @@ -1285,13 +1145,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Find the lowest price of all products - * Field.of("price").minimum().as("lowestPrice"); + * field("price").minimum().as("lowestPrice"); * ``` * - * @return A new `Accumulator` representing the 'min' aggregation. + * @return A new `AggregateFunction` representing the 'min' aggregation. */ - minimum(): Minimum { - return new Minimum(this, false); + minimum(): AggregateFunction { + return new AggregateFunction('minimum', [this]); } /** @@ -1299,13 +1159,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Find the highest score in a leaderboard - * Field.of("score").maximum().as("highestScore"); + * field("score").maximum().as("highestScore"); * ``` * - * @return A new `Accumulator` representing the 'max' aggregation. + * @return A new `AggregateFunction` representing the 'max' aggregation. */ - maximum(): Maximum { - return new Maximum(this, false); + maximum(): AggregateFunction { + return new AggregateFunction('maximum', [this]); } /** @@ -1313,31 +1173,22 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Returns the larger value between the 'timestamp' field and the current timestamp. - * Field.of("timestamp").logicalMaximum(Function.currentTimestamp()); - * ``` - * - * @param other The expression to compare with. - * @return A new {@code Expr} representing the logical max operation. - */ - logicalMaximum(other: Expr): LogicalMaximum; - - /** - * Creates an expression that returns the larger value between this expression and a constant value, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the larger value between the 'value' field and 10. - * Field.of("value").logicalMaximum(10); + * field("timestamp").logicalMaximum(Function.currentTimestamp()); * ``` * - * @param other The constant value to compare with. + * @param second The second expression or literal to compare with. + * @param others Optional additional expressions or literals to compare with. * @return A new {@code Expr} representing the logical max operation. */ - logicalMaximum(other: any): LogicalMaximum; - logicalMaximum(other: any): LogicalMaximum { - if (other instanceof Expr) { - return new LogicalMaximum(this, other as Expr); - } - return new LogicalMaximum(this, Constant.of(other)); + logicalMaximum( + second: Expr | unknown, + ...others: Array + ): FunctionExpr { + const values = [second, ...others]; + return new FunctionExpr('logical_maximum', [ + this, + ...values.map(valueToDefaultExpr) + ]); } /** @@ -1345,31 +1196,22 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Returns the smaller value between the 'timestamp' field and the current timestamp. - * Field.of("timestamp").logicalMinimum(Function.currentTimestamp()); - * ``` - * - * @param other The expression to compare with. - * @return A new {@code Expr} representing the logical min operation. - */ - logicalMinimum(other: Expr): LogicalMinimum; - - /** - * Creates an expression that returns the smaller value between this expression and a constant value, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the smaller value between the 'value' field and 10. - * Field.of("value").logicalMinimum(10); + * field("timestamp").logicalMinimum(Function.currentTimestamp()); * ``` * - * @param other The constant value to compare with. + * @param second The second expression or literal to compare with. + * @param others Optional additional expressions or literals to compare with. * @return A new {@code Expr} representing the logical min operation. */ - logicalMinimum(other: any): LogicalMinimum; - logicalMinimum(other: any): LogicalMinimum { - if (other instanceof Expr) { - return new LogicalMinimum(this, other as Expr); - } - return new LogicalMinimum(this, Constant.of(other)); + logicalMinimum( + second: Expr | unknown, + ...others: Array + ): FunctionExpr { + const values = [second, ...others]; + return new FunctionExpr('logical_minimum', [ + this, + ...values.map(valueToDefaultExpr) + ]); } /** @@ -1377,13 +1219,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Get the vector length (dimension) of the field 'embedding'. - * Field.of("embedding").vectorLength(); + * field("embedding").vectorLength(); * ``` * * @return A new {@code Expr} representing the length of the vector. */ - vectorLength(): VectorLength { - return new VectorLength(this); + vectorLength(): FunctionExpr { + return new FunctionExpr('vector_length', [this]); } /** @@ -1391,46 +1233,27 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field - * Field.of("userVector").cosineDistance(Field.of("itemVector")); + * field("userVector").cosineDistance(field("itemVector")); * ``` * - * @param other The other vector (represented as an Expr) to compare against. + * @param vectorExpression The other vector (represented as an Expr) to compare against. * @return A new `Expr` representing the cosine distance between the two vectors. */ - cosineDistance(other: Expr): CosineDistance; + cosineDistance(vectorExpression: Expr): FunctionExpr; /** * Calculates the Cosine distance between two vectors. * * ```typescript * // Calculate the Cosine distance between the 'location' field and a target location - * Field.of("location").cosineDistance(new VectorValue([37.7749, -122.4194])); + * field("location").cosineDistance(new VectorValue([37.7749, -122.4194])); * ``` * - * @param other The other vector (as a VectorValue) to compare against. + * @param vector The other vector (as a VectorValue) to compare against. * @return A new `Expr` representing the Cosine* distance between the two vectors. */ - cosineDistance(other: VectorValue): CosineDistance; - /** - * Calculates the Cosine distance between two vectors. - * - * ```typescript - * // Calculate the Cosine distance between the 'location' field and a target location - * Field.of("location").cosineDistance([37.7749, -122.4194]); - * ``` - * - * @param other The other vector (as an array of numbers) to compare against. - * @return A new `Expr` representing the Cosine distance between the two vectors. - */ - cosineDistance(other: number[]): CosineDistance; - cosineDistance(other: Expr | VectorValue | number[]): CosineDistance { - if (other instanceof Expr) { - return new CosineDistance(this, other as Expr); - } else { - return new CosineDistance( - this, - Constant.vector(other as VectorValue | number[]) - ); - } + cosineDistance(vector: VectorValue | number[]): FunctionExpr; + cosineDistance(other: Expr | VectorValue | number[]): FunctionExpr { + return new FunctionExpr('cosine_distance', [this, vectorToExpr(other)]); } /** @@ -1438,48 +1261,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the dot product between a feature vector and a target vector - * Field.of("features").dotProduct([0.5, 0.8, 0.2]); + * field("features").dotProduct([0.5, 0.8, 0.2]); * ``` * - * @param other The other vector (as an array of numbers) to calculate with. + * @param vectorExpression The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the dot product between the two vectors. */ - dotProduct(other: Expr): DotProduct; + dotProduct(vectorExpression: Expr): FunctionExpr; /** * Calculates the dot product between two vectors. * * ```typescript * // Calculate the dot product between a feature vector and a target vector - * Field.of("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); + * field("features").dotProduct(new VectorValue([0.5, 0.8, 0.2])); * ``` * - * @param other The other vector (as an array of numbers) to calculate with. + * @param vector The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the dot product between the two vectors. */ - dotProduct(other: VectorValue): DotProduct; - - /** - * Calculates the dot product between two vectors. - * - * ```typescript - * // Calculate the dot product between a feature vector and a target vector - * Field.of("features").dotProduct([0.5, 0.8, 0.2]); - * ``` - * - * @param other The other vector (as an array of numbers) to calculate with. - * @return A new `Expr` representing the dot product between the two vectors. - */ - dotProduct(other: number[]): DotProduct; - dotProduct(other: Expr | VectorValue | number[]): DotProduct { - if (other instanceof Expr) { - return new DotProduct(this, other as Expr); - } else { - return new DotProduct( - this, - Constant.vector(other as VectorValue | number[]) - ); - } + dotProduct(vector: VectorValue | number[]): FunctionExpr; + dotProduct(other: Expr | VectorValue | number[]): FunctionExpr { + return new FunctionExpr('dot_product', [this, vectorToExpr(other)]); } /** @@ -1487,48 +1290,28 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Calculate the Euclidean distance between the 'location' field and a target location - * Field.of("location").euclideanDistance([37.7749, -122.4194]); - * ``` - * - * @param other The other vector (as an array of numbers) to calculate with. - * @return A new `Expr` representing the Euclidean distance between the two vectors. - */ - euclideanDistance(other: Expr): EuclideanDistance; - - /** - * Calculates the Euclidean distance between two vectors. - * - * ```typescript - * // Calculate the Euclidean distance between the 'location' field and a target location - * Field.of("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); + * field("location").euclideanDistance([37.7749, -122.4194]); * ``` * - * @param other The other vector (as a VectorValue) to compare against. + * @param vectorExpression The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the Euclidean distance between the two vectors. */ - euclideanDistance(other: VectorValue): EuclideanDistance; + euclideanDistance(vectorExpression: Expr): FunctionExpr; /** * Calculates the Euclidean distance between two vectors. * * ```typescript * // Calculate the Euclidean distance between the 'location' field and a target location - * Field.of("location").euclideanDistance([37.7749, -122.4194]); + * field("location").euclideanDistance(new VectorValue([37.7749, -122.4194])); * ``` * - * @param other The other vector (as an array of numbers) to compare against. + * @param vector The other vector (as a VectorValue) to compare against. * @return A new `Expr` representing the Euclidean distance between the two vectors. */ - euclideanDistance(other: number[]): EuclideanDistance; - euclideanDistance(other: Expr | VectorValue | number[]): EuclideanDistance { - if (other instanceof Expr) { - return new EuclideanDistance(this, other as Expr); - } else { - return new EuclideanDistance( - this, - Constant.vector(other as VectorValue | number[]) - ); - } + euclideanDistance(vector: VectorValue | number[]): FunctionExpr; + euclideanDistance(other: Expr | VectorValue | number[]): FunctionExpr { + return new FunctionExpr('euclidean_distance', [this, vectorToExpr(other)]); } /** @@ -1537,13 +1320,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Interpret the 'microseconds' field as microseconds since epoch. - * Field.of("microseconds").unixMicrosToTimestamp(); + * field("microseconds").unixMicrosToTimestamp(); * ``` * * @return A new {@code Expr} representing the timestamp. */ - unixMicrosToTimestamp(): UnixMicrosToTimestamp { - return new UnixMicrosToTimestamp(this); + unixMicrosToTimestamp(): FunctionExpr { + return new FunctionExpr('unix_micros_to_timestamp', [this]); } /** @@ -1551,13 +1334,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Convert the 'timestamp' field to microseconds since epoch. - * Field.of("timestamp").timestampToUnixMicros(); + * field("timestamp").timestampToUnixMicros(); * ``` * * @return A new {@code Expr} representing the number of microseconds since epoch. */ - timestampToUnixMicros(): TimestampToUnixMicros { - return new TimestampToUnixMicros(this); + timestampToUnixMicros(): FunctionExpr { + return new FunctionExpr('timestamp_to_unix_micros', [this]); } /** @@ -1566,13 +1349,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Interpret the 'milliseconds' field as milliseconds since epoch. - * Field.of("milliseconds").unixMillisToTimestamp(); + * field("milliseconds").unixMillisToTimestamp(); * ``` * * @return A new {@code Expr} representing the timestamp. */ - unixMillisToTimestamp(): UnixMillisToTimestamp { - return new UnixMillisToTimestamp(this); + unixMillisToTimestamp(): FunctionExpr { + return new FunctionExpr('unix_millis_to_timestamp', [this]); } /** @@ -1580,13 +1363,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Convert the 'timestamp' field to milliseconds since epoch. - * Field.of("timestamp").timestampToUnixMillis(); + * field("timestamp").timestampToUnixMillis(); * ``` * * @return A new {@code Expr} representing the number of milliseconds since epoch. */ - timestampToUnixMillis(): TimestampToUnixMillis { - return new TimestampToUnixMillis(this); + timestampToUnixMillis(): FunctionExpr { + return new FunctionExpr('timestamp_to_unix_millis', [this]); } /** @@ -1595,13 +1378,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Interpret the 'seconds' field as seconds since epoch. - * Field.of("seconds").unixSecondsToTimestamp(); + * field("seconds").unixSecondsToTimestamp(); * ``` * * @return A new {@code Expr} representing the timestamp. */ - unixSecondsToTimestamp(): UnixSecondsToTimestamp { - return new UnixSecondsToTimestamp(this); + unixSecondsToTimestamp(): FunctionExpr { + return new FunctionExpr('unix_seconds_to_timestamp', [this]); } /** @@ -1609,13 +1392,13 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Convert the 'timestamp' field to seconds since epoch. - * Field.of("timestamp").timestampToUnixSeconds(); + * field("timestamp").timestampToUnixSeconds(); * ``` * * @return A new {@code Expr} representing the number of seconds since epoch. */ - timestampToUnixSeconds(): TimestampToUnixSeconds { - return new TimestampToUnixSeconds(this); + timestampToUnixSeconds(): FunctionExpr { + return new FunctionExpr('timestamp_to_unix_seconds', [this]); } /** @@ -1623,21 +1406,21 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. - * Field.of("timestamp").timestampAdd(Field.of("unit"), Field.of("amount")); + * field("timestamp").timestampAdd(field("unit"), field("amount")); * ``` * * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. * @param amount The expression evaluates to amount of the unit. * @return A new {@code Expr} representing the resulting timestamp. */ - timestampAdd(unit: Expr, amount: Expr): TimestampAdd; + timestampAdd(unit: Expr, amount: Expr): FunctionExpr; /** * Creates an expression that adds a specified amount of time to this timestamp expression. * * ```typescript * // Add 1 day to the 'timestamp' field. - * Field.of("timestamp").timestampAdd("day", 1); + * field("timestamp").timestampAdd("day", 1); * ``` * * @param unit The unit of time to add (e.g., "day", "hour"). @@ -1647,7 +1430,7 @@ export abstract class Expr implements ProtoSerializable, UserData { timestampAdd( unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number - ): TimestampAdd; + ): FunctionExpr; timestampAdd( unit: | Expr @@ -1658,15 +1441,12 @@ export abstract class Expr implements ProtoSerializable, UserData { | 'hour' | 'day', amount: Expr | number - ): TimestampAdd { - const normalizedUnit = typeof unit === 'string' ? Constant.of(unit) : unit; - const normalizedAmount = - typeof amount === 'number' ? Constant.of(amount) : amount; - return new TimestampAdd( + ): FunctionExpr { + return new FunctionExpr('timestamp_add', [ this, - normalizedUnit as Expr, - normalizedAmount as Expr - ); + valueToDefaultExpr(unit), + valueToDefaultExpr(amount) + ]); } /** @@ -1674,21 +1454,21 @@ export abstract class Expr implements ProtoSerializable, UserData { * * ```typescript * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. - * Field.of("timestamp").timestampSub(Field.of("unit"), Field.of("amount")); + * field("timestamp").timestampSub(field("unit"), field("amount")); * ``` * * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. * @param amount The expression evaluates to amount of the unit. * @return A new {@code Expr} representing the resulting timestamp. */ - timestampSub(unit: Expr, amount: Expr): TimestampSub; + timestampSub(unit: Expr, amount: Expr): FunctionExpr; /** * Creates an expression that subtracts a specified amount of time from this timestamp expression. * * ```typescript * // Subtract 1 day from the 'timestamp' field. - * Field.of("timestamp").timestampSub("day", 1); + * field("timestamp").timestampSub("day", 1); * ``` * * @param unit The unit of time to subtract (e.g., "day", "hour"). @@ -1698,7 +1478,7 @@ export abstract class Expr implements ProtoSerializable, UserData { timestampSub( unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number - ): TimestampSub; + ): FunctionExpr; timestampSub( unit: | Expr @@ -1709,129 +1489,557 @@ export abstract class Expr implements ProtoSerializable, UserData { | 'hour' | 'day', amount: Expr | number - ): TimestampSub { - const normalizedUnit = typeof unit === 'string' ? Constant.of(unit) : unit; - const normalizedAmount = - typeof amount === 'number' ? Constant.of(amount) : amount; - return new TimestampSub( + ): FunctionExpr { + return new FunctionExpr('timestamp_sub', [ this, - normalizedUnit as Expr, - normalizedAmount as Expr - ); + valueToDefaultExpr(unit), + valueToDefaultExpr(amount) + ]); } /** - * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * @beta + * + * Creates an expression that applies a bitwise AND operation between this expression and a constant. * * ```typescript - * // Sort documents by the 'name' field in ascending order - * pipeline().collection("users") - * .sort(Field.of("name").ascending()); + * // Calculate the bitwise AND of 'field1' and 0xFF. + * field("field1").bitAnd(0xFF); * ``` * - * @return A new `Ordering` for ascending sorting. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise AND operation. */ - ascending(): Ordering { - return ascending(this); - } - + bitAnd(otherBits: number | Bytes): FunctionExpr; /** - * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * @beta + * + * Creates an expression that applies a bitwise AND operation between two expressions. * * ```typescript - * // Sort documents by the 'createdAt' field in descending order - * firestore.pipeline().collection("users") - * .sort(Field.of("createdAt").descending()); + * // Calculate the bitwise AND of 'field1' and 'field2'. + * field("field1").bitAnd(field("field2")); * ``` * - * @return A new `Ordering` for descending sorting. + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise AND operation. */ - descending(): Ordering { - return descending(this); + bitAnd(bitsExpression: Expr): FunctionExpr; + bitAnd(bitsOrExpression: number | Expr | Bytes): FunctionExpr { + return new FunctionExpr('bit_and', [ + this, + valueToDefaultExpr(bitsOrExpression) + ]); } /** - * Assigns an alias to this expression. + * @beta * - * Aliases are useful for renaming fields in the output of a stage or for giving meaningful - * names to calculated values. + * Creates an expression that applies a bitwise OR operation between this expression and a constant. * * ```typescript - * // Calculate the total price and assign it the alias "totalPrice" and add it to the output. - * firestore.pipeline().collection("items") - * .addFields(Field.of("price").multiply(Field.of("quantity")).as("totalPrice")); + * // Calculate the bitwise OR of 'field1' and 0xFF. + * field("field1").bitOr(0xFF); * ``` * - * @param name The alias to assign to this expression. - * @return A new {@link ExprWithAlias} that wraps this - * expression and associates it with the provided alias. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise OR operation. */ - as(name: string): ExprWithAlias { - return new ExprWithAlias(this, name); + bitOr(otherBits: number | Bytes): FunctionExpr; + /** + * @beta + * + * Creates an expression that applies a bitwise OR operation between two expressions. + * + * ```typescript + * // Calculate the bitwise OR of 'field1' and 'field2'. + * field("field1").bitOr(field("field2")); + * ``` + * + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise OR operation. + */ + bitOr(bitsExpression: Expr): FunctionExpr; + bitOr(bitsOrExpression: number | Expr | Bytes): FunctionExpr { + return new FunctionExpr('bit_or', [ + this, + valueToDefaultExpr(bitsOrExpression) + ]); } /** - * @private - * @internal + * @beta + * + * Creates an expression that applies a bitwise XOR operation between this expression and a constant. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 0xFF. + * field("field1").bitXor(0xFF); + * ``` + * + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise XOR operation. */ - abstract _toProto(serializer: JsonProtoSerializer): ProtoValue; - + bitXor(otherBits: number | Bytes): FunctionExpr; /** - * @private - * @internal + * @beta + * + * Creates an expression that applies a bitwise XOR operation between two expressions. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 'field2'. + * field("field1").bitXor(field("field2")); + * ``` + * + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise XOR operation. */ - abstract _readUserData(dataReader: UserDataReader): void; -} - -/** - * @beta - * - * An interface that represents a selectable expression. - */ -export abstract class Selectable extends Expr { - selectable: true = true; -} - -/** - * @beta - * - * An interface that represents a filter condition. - */ -export abstract class FilterCondition extends Expr { - filterable: true = true; -} - -/** - * @beta - * - * An interface that represents an accumulator. - */ -export abstract class Accumulator extends Expr { - accumulator: true = true; + bitXor(bitsExpression: Expr): FunctionExpr; + bitXor(bitsOrExpression: number | Expr | Bytes): FunctionExpr { + return new FunctionExpr('bit_xor', [ + this, + valueToDefaultExpr(bitsOrExpression) + ]); + } /** - * @private - * @internal + * @beta + * + * Creates an expression that applies a bitwise NOT operation to this expression. + * + * ```typescript + * // Calculate the bitwise NOT of 'field1'. + * field("field1").bitNot(); + * ``` + * + * @return A new {@code Expr} representing the bitwise NOT operation. */ - abstract _toProto(serializer: JsonProtoSerializer): ProtoValue; -} + bitNot(): FunctionExpr { + return new FunctionExpr('bit_not', [this]); + } -/** + /** + * @beta + * + * Creates an expression that applies a bitwise left shift operation to this expression. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 2 bits. + * field("field1").bitLeftShift(2); + * ``` + * + * @param y The operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. + */ + bitLeftShift(y: number): FunctionExpr; + /** + * @beta + * + * Creates an expression that applies a bitwise left shift operation to this expression. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 'field2' bits. + * field("field1").bitLeftShift(field("field2")); + * ``` + * + * @param numberExpr The operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. + */ + bitLeftShift(numberExpr: Expr): FunctionExpr; + bitLeftShift(numberExpr: number | Expr): FunctionExpr { + return new FunctionExpr('bit_left_shift', [ + this, + valueToDefaultExpr(numberExpr) + ]); + } + + /** + * @beta + * + * Creates an expression that applies a bitwise right shift operation to this expression. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 2 bits. + * field("field1").bitRightShift(2); + * ``` + * + * @param right The operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. + */ + bitRightShift(y: number): FunctionExpr; + /** + * @beta + * + * Creates an expression that applies a bitwise right shift operation to this expression. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 'field2' bits. + * field("field1").bitRightShift(field("field2")); + * ``` + * + * @param numberExpr The operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. + */ + bitRightShift(numberExpr: Expr): FunctionExpr; + bitRightShift(numberExpr: number | Expr): FunctionExpr { + return new FunctionExpr('bit_right_shift', [ + this, + valueToDefaultExpr(numberExpr) + ]); + } + + /** + * @beta + * + * Creates an expression that returns the document ID from a path. + * + * ```typescript + * // Get the document ID from a path. + * field("__path__").documentId(); + * ``` + * + * @return A new {@code Expr} representing the documentId operation. + */ + documentId(): FunctionExpr { + return new FunctionExpr('document_id', [this]); + } + + /** + * @beta + * + * Creates an expression that returns a substring of the results of this expression. + * + * @param position Index of the first character of the substring. + * @param length Length of the substring. If not provided, the substring will + * end at the end of the input. + */ + substr(position: number, length?: number): FunctionExpr; + + /** + * @beta + * + * Creates an expression that returns a substring of the results of this expression. + * + * @param position An expression returning the index of the first character of the substring. + * @param length An expression returning the length of the substring. If not provided the + * substring will end at the end of the input. + */ + substr(position: Expr, length?: Expr): FunctionExpr; + substr(position: Expr | number, length?: Expr | number): FunctionExpr { + const positionExpr = valueToDefaultExpr(position); + if (length === undefined) { + return new FunctionExpr('substr', [this, positionExpr]); + } else { + return new FunctionExpr('substr', [ + this, + positionExpr, + valueToDefaultExpr(length) + ]); + } + } + + /** + * @beta + * Creates an expression that indexes into an array from the beginning or end + * and returns the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the 'tags' field array at index `1`. + * field('tags').arrayOffset(1); + * ``` + * + * @param offset The index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. + */ + arrayOffset(offset: number): FunctionExpr; + + /** + * @beta + * Creates an expression that indexes into an array from the beginning or end + * and returns the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the tags field array at index specified by field + * // 'favoriteTag'. + * field('tags').arrayOffset(field('favoriteTag')); + * ``` + * + * @param offsetExpr An Expr evaluating to the index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. + */ + arrayOffset(offsetExpr: Expr): FunctionExpr; + arrayOffset(offset: Expr | number): FunctionExpr { + return new FunctionExpr('array_offset', [this, valueToDefaultExpr(offset)]); + } + + /** + * @beta + * + * Creates an expression that checks if a given expression produces an error. + * + * ```typescript + * // Check if the result of a calculation is an error + * field("title").arrayContains(1).isError(); + * ``` + * + * @return A new {@code BooleanExpr} representing the 'isError' check. + */ + isError(): BooleanExpr { + return new BooleanExpr('is_error', [this]); + } + + /** + * @beta + * + * Creates an expression that returns the result of the `catchExpr` argument + * if there is an error, else return the result of this expression. + * + * ```typescript + * // Returns the first item in the title field arrays, or returns + * // the entire title field if the array is empty or the field is another type. + * field("title").arrayOffset(0).ifError(field("title")); + * ``` + * + * @param catchExpr The catch expression that will be evaluated and + * returned if this expression produces an error. + * @return A new {@code Expr} representing the 'ifError' operation. + */ + ifError(catchExpr: Expr): FunctionExpr; + + /** + * @beta + * + * Creates an expression that returns the `catch` argument if there is an + * error, else return the result of this expression. + * + * ```typescript + * // Returns the first item in the title field arrays, or returns + * // "Default Title" + * field("title").arrayOffset(0).ifError("Default Title"); + * ``` + * + * @param catchValue The value that will be returned if this expression + * produces an error. + * @return A new {@code Expr} representing the 'ifError' operation. + */ + ifError(catchValue: unknown): FunctionExpr; + ifError(catchValue: unknown): FunctionExpr { + return new FunctionExpr('if_error', [this, valueToDefaultExpr(catchValue)]); + } + + /** + * @beta + * + * Creates an expression that returns `true` if the result of this expression + * is absent. Otherwise, returns `false` even if the value is `null`. + * + * ```typescript + * // Check if the field `value` is absent. + * field("value").isAbsent(); + * ``` + * + * @return A new {@code BooleanExpr} representing the 'isAbsent' check. + */ + isAbsent(): BooleanExpr { + return new BooleanExpr('is_absent', [this]); + } + + /** + * @beta + * + * Creates an expression that checks if tbe result of an expression is not null. + * + * ```typescript + * // Check if the value of the 'name' field is not null + * field("name").isNotNull(); + * ``` + * + * @return A new {@code BooleanExpr} representing the 'isNotNull' check. + */ + isNotNull(): BooleanExpr { + return new BooleanExpr('is_not_null', [this]); + } + + /** + * @beta + * + * Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NOT NaN + * field("value").divide(0).isNotNan(); + * ``` + * + * @return A new {@code Expr} representing the 'isNaN' check. + */ + isNotNan(): BooleanExpr { + return new BooleanExpr('is_not_nan', [this]); + } + + /** + * @beta + * + * Creates an expression that removes a key from the map produced by evaluating this expression. + * + * ``` + * // Removes the key 'baz' from the input map. + * map({foo: 'bar', baz: true}).mapRemove('baz'); + * ``` + * + * @param key The name of the key to remove from the input map. + * @returns A new {@code FirestoreFunction} representing the 'mapRemove' operation. + */ + mapRemove(key: string): FunctionExpr; + /** + * @beta + * + * Creates an expression that removes a key from the map produced by evaluating this expression. + * + * ``` + * // Removes the key 'baz' from the input map. + * map({foo: 'bar', baz: true}).mapRemove(constant('baz')); + * ``` + * + * @param keyExpr An expression that produces the name of the key to remove from the input map. + * @returns A new {@code FirestoreFunction} representing the 'mapRemove' operation. + */ + mapRemove(keyExpr: Expr): FunctionExpr; + mapRemove(stringExpr: Expr | string): FunctionExpr { + return new FunctionExpr('map_remove', [ + this, + valueToDefaultExpr(stringExpr) + ]); + } + + /** + * @beta + * + * Creates an expression that merges multiple map values. + * + * ``` + * // Merges the map in the settings field with, a map literal, and a map in + * // that is conditionally returned by another expression + * field('settings').mapMerge({ enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * ``` + * + * @param secondMap A required second map to merge. Represented as a literal or + * an expression that returns a map. + * @param otherMaps Optional additional maps to merge. Each map is represented + * as a literal or an expression that returns a map. + * + * @returns A new {@code FirestoreFunction} representing the 'mapMerge' operation. + */ + mapMerge( + secondMap: Record | Expr, + ...otherMaps: Array | Expr> + ): FunctionExpr { + const secondMapExpr = valueToDefaultExpr(secondMap); + const otherMapExprs = otherMaps.map(valueToDefaultExpr); + return new FunctionExpr('map_merge', [ + this, + secondMapExpr, + ...otherMapExprs + ]); + } + + /** + * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * + * ```typescript + * // Sort documents by the 'name' field in ascending order + * pipeline().collection("users") + * .sort(field("name").ascending()); + * ``` + * + * @return A new `Ordering` for ascending sorting. + */ + ascending(): Ordering { + return ascending(this); + } + + /** + * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * + * ```typescript + * // Sort documents by the 'createdAt' field in descending order + * firestore.pipeline().collection("users") + * .sort(field("createdAt").descending()); + * ``` + * + * @return A new `Ordering` for descending sorting. + */ + descending(): Ordering { + return descending(this); + } + + /** + * Assigns an alias to this expression. + * + * Aliases are useful for renaming fields in the output of a stage or for giving meaningful + * names to calculated values. + * + * ```typescript + * // Calculate the total price and assign it the alias "totalPrice" and add it to the output. + * firestore.pipeline().collection("items") + * .addFields(field("price").multiply(field("quantity")).as("totalPrice")); + * ``` + * + * @param name The alias to assign to this expression. + * @return A new {@link ExprWithAlias} that wraps this + * expression and associates it with the provided alias. + */ + as(name: string): ExprWithAlias { + return new ExprWithAlias(this, name); + } +} + +/** * @beta * - * An accumulator target, which is an expression with an alias that also implements the Accumulator interface. + * An interface that represents a selectable expression. */ -export type AccumulatorTarget = ExprWithAlias; +export interface Selectable { + selectable: true; + readonly alias: string; + readonly expr: Expr; +} /** * @beta + * + * A class that represents an aggregate function. */ -export class ExprWithAlias extends Selectable { - exprType: ExprType = 'ExprWithAlias'; - selectable = true as const; +export class AggregateFunction implements ProtoValueSerializable, UserData { + exprType: ExprType = 'AggregateFunction'; - constructor(readonly expr: T, readonly alias: string) { - super(); + /** + * @internal + * @private + * Indicates if this expression was created from a literal value passed + * by the caller. + */ + _createdFromLiteral: boolean = false; + + constructor(private name: string, private params: Expr[]) {} + + /** + * Assigns an alias to this AggregateFunction. The alias specifies the name that + * the aggregated value will have in the output document. + * + * ```typescript + * // Calculate the average price of all items and assign it the alias "averagePrice". + * firestore.pipeline().collection("items") + * .aggregate(field("price").avg().as("averagePrice")); + * ``` + * + * @param name The alias to assign to this AggregateFunction. + * @return A new {@link AggregateWithAlias} that wraps this + * AggregateFunction and associates it with the provided alias. + */ + as(name: string): AggregateWithAlias { + return new AggregateWithAlias(this, name); } /** @@ -1839,15 +2047,87 @@ export class ExprWithAlias extends Selectable { * @internal */ _toProto(serializer: JsonProtoSerializer): ProtoValue { - throw new Error('ExprWithAlias should not be serialized directly.'); + return { + functionValue: { + name: this.name, + args: this.params.map(p => p._toProto(serializer)) + } + }; } + _protoValueType = 'ProtoValue' as const; + /** * @private * @internal */ - _readUserData(dataReader: UserDataReader): void { - this.expr._readUserData(dataReader); + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, this.name); + this.params.forEach(expr => { + return expr._readUserData(dataReader, context); + }); + } +} + +/** + * @beta + * + * An AggregateFunction with alias. + */ +export class AggregateWithAlias implements UserData { + constructor(readonly aggregate: AggregateFunction, readonly alias: string) {} + + /** + * @internal + * @private + * Indicates if this expression was created from a literal value passed + * by the caller. + */ + _createdFromLiteral: boolean = false; + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, 'as'); + this.aggregate._readUserData(dataReader, context); + } +} + +/** + * @beta + */ +export class ExprWithAlias implements Selectable, UserData { + exprType: ExprType = 'ExprWithAlias'; + selectable = true as const; + + /** + * @internal + * @private + * Indicates if this expression was created from a literal value passed + * by the caller. + */ + _createdFromLiteral: boolean = false; + + constructor(readonly expr: Expr, readonly alias: string) {} + + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, 'as'); + this.expr._readUserData(dataReader, context); } } @@ -1856,6 +2136,7 @@ export class ExprWithAlias extends Selectable { */ class ListOfExprs extends Expr { exprType: ExprType = 'ListOfExprs'; + constructor(private exprs: Expr[]) { super(); } @@ -1893,106 +2174,36 @@ class ListOfExprs extends Expr { * * ```typescript * // Create a Field instance for the 'name' field - * const nameField = Field.of("name"); + * const nameField = field("name"); * * // Create a Field instance for a nested field 'address.city' - * const cityField = Field.of("address.city"); + * const cityField = field("address.city"); * ``` */ -export class Field extends Selectable { - exprType: ExprType = 'Field'; +export class Field extends Expr implements Selectable { + readonly exprType: ExprType = 'Field'; selectable = true as const; - private constructor( - private fieldPath: InternalFieldPath, - private pipeline: Pipeline | null = null - ) { - super(); - } - - /** - * Creates a {@code Field} instance representing the field at the given path. - * - * The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field - * (e.g., "address.city"). - * - * ```typescript - * // Create a Field instance for the 'title' field - * const titleField = Field.of("title"); - * - * // Create a Field instance for a nested field 'author.firstName' - * const authorFirstNameField = Field.of("author.firstName"); - * ``` - * - * @param name The path to the field. - * @return A new {@code Field} instance representing the specified field. - */ - static of(name: string): Field; - static of(path: FieldPath): Field; - static of( - pipelineOrName: Pipeline | string | FieldPath, - name?: string - ): Field { - if (typeof pipelineOrName === 'string') { - if (DOCUMENT_KEY_NAME === pipelineOrName) { - return new Field(documentId()._internalPath); - } - return new Field(fieldPathFromArgument('of', pipelineOrName)); - } else if (pipelineOrName instanceof FieldPath) { - if (documentId().isEqual(pipelineOrName)) { - return new Field(documentId()._internalPath); - } - return new Field(pipelineOrName._internalPath); - } else { - return new Field( - fieldPathFromArgument('of', name!), - pipelineOrName as Pipeline - ); - } - } - - fieldName(): string { - return this.fieldPath.canonicalString(); - } - /** - * @private * @internal - */ - _toProto(serializer: JsonProtoSerializer): ProtoValue { - return { - fieldReferenceValue: this.fieldPath.canonicalString() - }; - } - - /** * @private - * @internal + * @hideconstructor + * @param fieldPath */ - _readUserData(dataReader: UserDataReader): void {} -} - -/** - * @beta - */ -export class Fields extends Selectable { - exprType: ExprType = 'Field'; - selectable = true as const; - - private constructor(private fields: Field[]) { + constructor(private fieldPath: InternalFieldPath) { super(); } - static of(name: string, ...others: string[]): Fields { - return new Fields([Field.of(name), ...others.map(Field.of)]); + fieldName(): string { + return this.fieldPath.canonicalString(); } - static ofAll(): Fields { - return new Fields([]); + get alias(): string { + return this.fieldName(); } - fieldList(): Field[] { - return this.fields.map(f => f); + get expr(): Expr { + return this; } /** @@ -2001,9 +2212,7 @@ export class Fields extends Selectable { */ _toProto(serializer: JsonProtoSerializer): ProtoValue { return { - arrayValue: { - values: this.fields.map(f => f._toProto(serializer)) - } + fieldReferenceValue: this.fieldPath.canonicalString() }; } @@ -2011,8 +2220,36 @@ export class Fields extends Selectable { * @private * @internal */ - _readUserData(dataReader: UserDataReader): void { - this.fields.forEach(expr => expr._readUserData(dataReader)); + _readUserData(dataReader: UserDataReader): void {} +} + +/** + * Creates a {@code Field} instance representing the field at the given path. + * + * The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field + * (e.g., "address.city"). + * + * ```typescript + * // Create a Field instance for the 'title' field + * const titleField = field("title"); + * + * // Create a Field instance for a nested field 'author.firstName' + * const authorFirstNameField = field("author.firstName"); + * ``` + * + * @param name The path to the field. + * @return A new {@code Field} instance representing the specified field. + */ +export function field(name: string): Field; +export function field(path: FieldPath): Field; +export function field(nameOrPath: string | FieldPath): Field { + if (typeof nameOrPath === 'string') { + if (DOCUMENT_KEY_NAME === nameOrPath) { + return new Field(documentIdFieldPath()._internalPath); + } + return new Field(fieldPathFromArgument('of', nameOrPath)); + } else { + return new Field(nameOrPath._internalPath); } } @@ -2025,158 +2262,25 @@ export class Fields extends Selectable { * * ```typescript * // Create a Constant instance for the number 10 - * const ten = Constant.of(10); + * const ten = constant(10); * * // Create a Constant instance for the string "hello" - * const hello = Constant.of("hello"); + * const hello = constant("hello"); * ``` */ export class Constant extends Expr { - exprType: ExprType = 'Constant'; + readonly exprType: ExprType = 'Constant'; private _protoValue?: ProtoValue; - private constructor(private value: any) { - super(); - } - /** - * Creates a `Constant` instance for a number value. - * - * @param value The number value. - * @return A new `Constant` instance. - */ - static of(value: number): Constant; - - /** - * Creates a `Constant` instance for a string value. - * - * @param value The string value. - * @return A new `Constant` instance. - */ - static of(value: string): Constant; - - /** - * Creates a `Constant` instance for a boolean value. - * - * @param value The boolean value. - * @return A new `Constant` instance. - */ - static of(value: boolean): Constant; - - /** - * Creates a `Constant` instance for a null value. - * - * @param value The null value. - * @return A new `Constant` instance. - */ - static of(value: null): Constant; - - /** - * Creates a `Constant` instance for an undefined value. * @private * @internal - * - * @param value The undefined value. - * @return A new `Constant` instance. + * @hideconstructor + * @param value The value of the constant. */ - static of(value: undefined): Constant; - - /** - * Creates a `Constant` instance for a GeoPoint value. - * - * @param value The GeoPoint value. - * @return A new `Constant` instance. - */ - static of(value: GeoPoint): Constant; - - /** - * Creates a `Constant` instance for a Timestamp value. - * - * @param value The Timestamp value. - * @return A new `Constant` instance. - */ - static of(value: Timestamp): Constant; - - /** - * Creates a `Constant` instance for a Date value. - * - * @param value The Date value. - * @return A new `Constant` instance. - */ - static of(value: Date): Constant; - - /** - * Creates a `Constant` instance for a Bytes value. - * - * @param value The Bytes value. - * @return A new `Constant` instance. - */ - static of(value: Bytes): Constant; - - /** - * Creates a `Constant` instance for a DocumentReference value. - * - * @param value The DocumentReference value. - * @return A new `Constant` instance. - */ - static of(value: DocumentReference): Constant; - - /** - * Creates a `Constant` instance for a Firestore proto value. - * For internal use only. - * @private - * @internal - * @param value The Firestore proto value. - * @return A new `Constant` instance. - */ - static of(value: ProtoValue): Constant; - - /** - * Creates a `Constant` instance for an array value. - * - * @param value The array value. - * @return A new `Constant` instance. - */ - static of(value: any[]): Constant; - - /** - * Creates a `Constant` instance for a map value. - * - * @param value The map value. - * @return A new `Constant` instance. - */ - static of(value: Record): Constant; - - /** - * Creates a `Constant` instance for a VectorValue value. - * - * @param value The VectorValue value. - * @return A new `Constant` instance. - */ - static of(value: VectorValue): Constant; - - static of(value: any): Constant { - return new Constant(value); - } - - /** - * Creates a `Constant` instance for a VectorValue value. - * - * ```typescript - * // Create a Constant instance for a vector value - * const vectorConstant = Constant.ofVector([1, 2, 3]); - * ``` - * - * @param value The VectorValue value. - * @return A new `Constant` instance. - */ - static vector(value: number[] | VectorValue): Constant { - if (value instanceof VectorValue) { - return new Constant(value); - } else { - return new Constant(new VectorValue(value as number[])); - } + constructor(private value: unknown) { + super(); } /** @@ -2205,19 +2309,14 @@ export class Constant extends Expr { * @private * @internal */ - _readUserData(dataReader: UserDataReader): void { - const context = dataReader.createContext( - UserDataSource.Argument, - 'Constant.of' - ); - - if (isFirestoreValue(this.value)) { - // Special case where value is a proto value. - // This can occur when converting a Query to Pipeline. - this._protoValue = this.value; - } else if (this.value === undefined) { - // TODO(pipeline) how should we treat the value of `undefined`? - this._protoValue = parseData(null, context)!; + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, 'constant'); + + if (isFirestoreValue(this._protoValue)) { + return; } else { this._protoValue = parseData(this.value, context)!; } @@ -2225,790 +2324,1208 @@ export class Constant extends Expr { } /** - * @beta + * Creates a `Constant` instance for a number value. * - * This class defines the base class for Firestore {@link Pipeline} functions, which can be evaluated within pipeline - * execution. + * @param value The number value. + * @return A new `Constant` instance. + */ +export function constant(value: number): Constant; + +/** + * Creates a `Constant` instance for a string value. * - * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link eq}, - * or the methods on {@link Expr} ({@link Expr#eq}, {@link Expr#lt}, etc) to construct new Function instances. + * @param value The string value. + * @return A new `Constant` instance. */ -export class FirestoreFunction extends Expr { - exprType: ExprType = 'Function'; - constructor(private name: string, private params: Expr[]) { - super(); - } +export function constant(value: string): Constant; - /** - * @private - * @internal - */ - _toProto(serializer: JsonProtoSerializer): ProtoValue { - return { - functionValue: { - name: this.name, - args: this.params.map(p => p._toProto(serializer)) - } - }; - } +/** + * Creates a `Constant` instance for a boolean value. + * + * @param value The boolean value. + * @return A new `Constant` instance. + */ +export function constant(value: boolean): Constant; - /** - * @private - * @internal - */ - _readUserData(dataReader: UserDataReader): void { - this.params.forEach(expr => expr._readUserData(dataReader)); - } -} +/** + * Creates a `Constant` instance for a null value. + * + * @param value The null value. + * @return A new `Constant` instance. + */ +export function constant(value: null): Constant; /** - * @beta + * Creates a `Constant` instance for a GeoPoint value. + * + * @param value The GeoPoint value. + * @return A new `Constant` instance. */ -export class Add extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('add', [left, right]); - } -} +export function constant(value: GeoPoint): Constant; /** - * @beta + * Creates a `Constant` instance for a Timestamp value. + * + * @param value The Timestamp value. + * @return A new `Constant` instance. */ -export class Subtract extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('subtract', [left, right]); - } -} +export function constant(value: Timestamp): Constant; /** - * @beta + * Creates a `Constant` instance for a Date value. + * + * @param value The Date value. + * @return A new `Constant` instance. */ -export class Multiply extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('multiply', [left, right]); - } +export function constant(value: Date): Constant; + +/** + * Creates a `Constant` instance for a Bytes value. + * + * @param value The Bytes value. + * @return A new `Constant` instance. + */ +export function constant(value: Bytes): Constant; + +/** + * Creates a `Constant` instance for a DocumentReference value. + * + * @param value The DocumentReference value. + * @return A new `Constant` instance. + */ +export function constant(value: DocumentReference): Constant; + +/** + * Creates a `Constant` instance for a Firestore proto value. + * For internal use only. + * @private + * @internal + * @param value The Firestore proto value. + * @return A new `Constant` instance. + */ +export function constant(value: ProtoValue): Constant; + +/** + * Creates a `Constant` instance for a VectorValue value. + * + * @param value The VectorValue value. + * @return A new `Constant` instance. + */ +export function constant(value: VectorValue): Constant; + +export function constant(value: unknown): Constant { + return new Constant(value); } /** - * @beta + * Creates a `Constant` instance for a VectorValue value. + * + * ```typescript + * // Create a Constant instance for a vector value + * const vectorConstant = constantVector([1, 2, 3]); + * ``` + * + * @param value The VectorValue value. + * @return A new `Constant` instance. */ -export class Divide extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('divide', [left, right]); +export function constantVector(value: number[] | VectorValue): Constant { + if (value instanceof VectorValue) { + return new Constant(value); + } else { + return new Constant(new VectorValue(value as number[])); } } /** - * @beta + * Internal only + * @internal + * @private */ -export class Mod extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('mod', [left, right]); +export class MapValue extends Expr { + constructor(private plainObject: Map) { + super(); } -} -// /** -// * @beta -// */ -// export class BitAnd extends FirestoreFunction { -// constructor( -// private left: Expr, -// private right: Expr -// ) { -// super('bit_and', [left, right]); -// } -// } -// -// /** -// * @beta -// */ -// export class BitOr extends FirestoreFunction { -// constructor( -// private left: Expr, -// private right: Expr -// ) { -// super('bit_or', [left, right]); -// } -// } -// -// /** -// * @beta -// */ -// export class BitXor extends FirestoreFunction { -// constructor( -// private left: Expr, -// private right: Expr -// ) { -// super('bit_xor', [left, right]); -// } -// } -// -// /** -// * @beta -// */ -// export class BitNot extends FirestoreFunction { -// constructor(private operand: Expr) { -// super('bit_not', [operand]); -// } -// } -// -// /** -// * @beta -// */ -// export class BitLeftShift extends FirestoreFunction { -// constructor( -// private left: Expr, -// private right: Expr -// ) { -// super('bit_left_shift', [left, right]); -// } -// } -// -// /** -// * @beta -// */ -// export class BitRightShift extends FirestoreFunction { -// constructor( -// private left: Expr, -// private right: Expr -// ) { -// super('bit_right_shift', [left, right]); -// } -// } - -/** - * @beta - */ -export class Eq extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('eq', [left, right]); + exprType: ExprType = 'Constant'; + + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, '_map'); + + this.plainObject.forEach(expr => { + expr._readUserData(dataReader, context); + }); + } + + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return toMapValue(serializer, this.plainObject); } - filterable = true as const; } /** * @beta + * + * This class defines the base class for Firestore {@link Pipeline} functions, which can be evaluated within pipeline + * execution. + * + * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link eq}, + * or the methods on {@link Expr} ({@link Expr#eq}, {@link Expr#lt}, etc.) to construct new Function instances. */ -export class Neq extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('neq', [left, right]); +export class FunctionExpr extends Expr { + readonly exprType: ExprType = 'Function'; + + constructor(private name: string, private params: Expr[]) { + super(); } - filterable = true as const; -} -/** - * @beta - */ -export class Lt extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('lt', [left, right]); + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return { + functionValue: { + name: this.name, + args: this.params.map(p => p._toProto(serializer)) + } + }; } - filterable = true as const; -} -/** - * @beta - */ -export class Lte extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('lte', [left, right]); + /** + * @private + * @internal + */ + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, this.name); + this.params.forEach(expr => { + return expr._readUserData(dataReader, context); + }); } - filterable = true as const; } /** * @beta + * + * An interface that represents a filter condition. */ -export class Gt extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('gt', [left, right]); +export class BooleanExpr extends FunctionExpr { + filterable: true = true; + + /** + * Creates an aggregation that finds the count of input documents satisfying + * this boolean expression. + * + * ```typescript + * // Find the count of documents with a score greater than 90 + * field("score").gt(90).countIf().as("highestScore"); + * ``` + * + * @return A new `AggregateFunction` representing the 'countIf' aggregation. + */ + countIf(): AggregateFunction { + return new AggregateFunction('count_if', [this]); } - filterable = true as const; -} -/** - * @beta - */ -export class Gte extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private right: Expr) { - super('gte', [left, right]); + /** + * Creates an expression that negates this boolean expression. + * + * ```typescript + * // Find documents where the 'tags' field does not contain 'completed' + * field("tags").arrayContains("completed").not(); + * ``` + * + * @return A new {@code Expr} representing the negated filter condition. + */ + not(): BooleanExpr { + return new BooleanExpr('not', [this]); } - filterable = true as const; } /** * @beta + * Creates an aggregation that counts the number of stage inputs where the provided + * boolean expression evaluates to true. + * + * ```typescript + * // Count the number of documents where 'is_active' field equals true + * countIf(field("is_active").eq(true)).as("numActiveDocuments"); + * ``` + * + * @param booleanExpr - The boolean expression to evaluate on each input. + * @returns A new `AggregateFunction` representing the 'countIf' aggregation. */ -export class ArrayConcat extends FirestoreFunction { - constructor(private array: Expr, private elements: Expr[]) { - super('array_concat', [array, ...elements]); - } +export function countIf(booleanExpr: BooleanExpr): AggregateFunction { + return booleanExpr.countIf(); } /** * @beta + * Creates an expression that return a pseudo-random value of type double in the + * range of [0, 1), inclusive of 0 and exclusive of 1. + * + * @returns A new `Expr` representing the 'rand' function. */ -export class ArrayReverse extends FirestoreFunction { - constructor(private array: Expr) { - super('array_reverse', [array]); - } +export function rand(): FunctionExpr { + return new FunctionExpr('rand', []); } /** * @beta + * + * Creates an expression that applies a bitwise AND operation between a field and a constant. + * + * ```typescript + * // Calculate the bitwise AND of 'field1' and 0xFF. + * bitAnd("field1", 0xFF); + * ``` + * + * @param field The left operand field name. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise AND operation. */ -export class ArrayContains - extends FirestoreFunction - implements FilterCondition -{ - constructor(private array: Expr, private element: Expr) { - super('array_contains', [array, element]); - } - filterable = true as const; -} - +export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise AND operation between a field and an expression. + * + * ```typescript + * // Calculate the bitwise AND of 'field1' and 'field2'. + * bitAnd("field1", field("field2")); + * ``` + * + * @param field The left operand field name. + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise AND operation. */ -export class ArrayContainsAll - extends FirestoreFunction - implements FilterCondition -{ - constructor(private array: Expr, private values: Expr[]) { - super('array_contains_all', [array, new ListOfExprs(values)]); - } - filterable = true as const; -} - +export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise AND operation between an expression and a constant. + * + * ```typescript + * // Calculate the bitwise AND of 'field1' and 0xFF. + * bitAnd(field("field1"), 0xFF); + * ``` + * + * @param bitsExpression An expression returning bits. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise AND operation. */ -export class ArrayContainsAny - extends FirestoreFunction - implements FilterCondition -{ - constructor(private array: Expr, private values: Expr[]) { - super('array_contains_any', [array, new ListOfExprs(values)]); - } - filterable = true as const; -} - +export function bitAnd( + bitsExpression: Expr, + otherBits: number | Bytes +): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise AND operation between two expressions. + * + * ```typescript + * // Calculate the bitwise AND of 'field1' and 'field2'. + * bitAnd(field("field1"), field("field2")); + * ``` + * + * @param bitsExpression An expression that returns bits when evaluated. + * @param otherBitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise AND operation. */ -export class ArrayLength extends FirestoreFunction { - constructor(private array: Expr) { - super('array_length', [array]); - } +export function bitAnd( + bitsExpression: Expr, + otherBitsExpression: Expr +): FunctionExpr; +export function bitAnd( + bits: string | Expr, + bitsOrExpression: number | Expr | Bytes +): FunctionExpr { + return fieldOrExpression(bits).bitAnd(valueToDefaultExpr(bitsOrExpression)); } /** * @beta + * + * Creates an expression that applies a bitwise OR operation between a field and a constant. + * + * ```typescript + * // Calculate the bitwise OR of 'field1' and 0xFF. + * bitOr("field1", 0xFF); + * ``` + * + * @param field The left operand field name. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise OR operation. */ -export class ArrayElement extends FirestoreFunction { - constructor() { - super('array_element', []); - } -} - +export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise OR operation between a field and an expression. + * + * ```typescript + * // Calculate the bitwise OR of 'field1' and 'field2'. + * bitOr("field1", field("field2")); + * ``` + * + * @param field The left operand field name. + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise OR operation. */ -export class EqAny extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private others: Expr[]) { - super('eq_any', [left, new ListOfExprs(others)]); - } - filterable = true as const; -} - +export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise OR operation between an expression and a constant. + * + * ```typescript + * // Calculate the bitwise OR of 'field1' and 0xFF. + * bitOr(field("field1"), 0xFF); + * ``` + * + * @param bitsExpression An expression returning bits. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise OR operation. */ -export class NotEqAny extends FirestoreFunction implements FilterCondition { - constructor(private left: Expr, private others: Expr[]) { - super('not_eq_any', [left, new ListOfExprs(others)]); - } - filterable = true as const; -} - +export function bitOr( + bitsExpression: Expr, + otherBits: number | Bytes +): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise OR operation between two expressions. + * + * ```typescript + * // Calculate the bitwise OR of 'field1' and 'field2'. + * bitOr(field("field1"), field("field2")); + * ``` + * + * @param bitsExpression An expression that returns bits when evaluated. + * @param otherBitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise OR operation. */ -export class IsNan extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr) { - super('is_nan', [expr]); - } - filterable = true as const; +export function bitOr( + bitsExpression: Expr, + otherBitsExpression: Expr +): FunctionExpr; +export function bitOr( + bits: string | Expr, + bitsOrExpression: number | Expr | Bytes +): FunctionExpr { + return fieldOrExpression(bits).bitOr(valueToDefaultExpr(bitsOrExpression)); } /** * @beta + * + * Creates an expression that applies a bitwise XOR operation between a field and a constant. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 0xFF. + * bitXor("field1", 0xFF); + * ``` + * + * @param field The left operand field name. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise XOR operation. */ -export class Exists extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr) { - super('exists', [expr]); - } - filterable = true as const; -} - +export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise XOR operation between a field and an expression. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 'field2'. + * bitXor("field1", field("field2")); + * ``` + * + * @param field The left operand field name. + * @param bitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise XOR operation. */ -export class Not extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr) { - super('not', [expr]); - } - filterable = true as const; -} - +export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise XOR operation between an expression and a constant. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 0xFF. + * bitXor(field("field1"), 0xFF); + * ``` + * + * @param bitsExpression An expression returning bits. + * @param otherBits A constant representing bits. + * @return A new {@code Expr} representing the bitwise XOR operation. */ -export class And extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterCondition[]) { - super('and', conditions); - } - - filterable = true as const; -} - +export function bitXor( + bitsExpression: Expr, + otherBits: number | Bytes +): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise XOR operation between two expressions. + * + * ```typescript + * // Calculate the bitwise XOR of 'field1' and 'field2'. + * bitXor(field("field1"), field("field2")); + * ``` + * + * @param bitsExpression An expression that returns bits when evaluated. + * @param otherBitsExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise XOR operation. */ -export class Or extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterCondition[]) { - super('or', conditions); - } - filterable = true as const; +export function bitXor( + bitsExpression: Expr, + otherBitsExpression: Expr +): FunctionExpr; +export function bitXor( + bits: string | Expr, + bitsOrExpression: number | Expr | Bytes +): FunctionExpr { + return fieldOrExpression(bits).bitXor(valueToDefaultExpr(bitsOrExpression)); } /** * @beta + * + * Creates an expression that applies a bitwise NOT operation to a field. + * + * ```typescript + * // Calculate the bitwise NOT of 'field1'. + * bitNot("field1"); + * ``` + * + * @param field The operand field name. + * @return A new {@code Expr} representing the bitwise NOT operation. */ -export class Xor extends FirestoreFunction implements FilterCondition { - constructor(private conditions: FilterCondition[]) { - super('xor', conditions); - } - filterable = true as const; -} - +export function bitNot(field: string): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise NOT operation to an expression. + * + * ```typescript + * // Calculate the bitwise NOT of 'field1'. + * bitNot(field("field1")); + * ``` + * + * @param bitsValueExpression An expression that returns bits when evaluated. + * @return A new {@code Expr} representing the bitwise NOT operation. */ -export class Cond extends FirestoreFunction { - constructor( - private condition: FilterCondition, - private thenExpr: Expr, - private elseExpr: Expr - ) { - super('cond', [condition, thenExpr, elseExpr]); - } - filterable = true as const; +export function bitNot(bitsValueExpression: Expr): FunctionExpr; +export function bitNot(bits: string | Expr): FunctionExpr { + return fieldOrExpression(bits).bitNot(); } /** * @beta + * + * Creates an expression that applies a bitwise left shift operation between a field and a constant. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 2 bits. + * bitLeftShift("field1", 2); + * ``` + * + * @param field The left operand field name. + * @param y The right operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. */ -export class LogicalMaximum extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('logical_maximum', [left, right]); - } -} - +export function bitLeftShift(field: string, y: number): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise left shift operation between a field and an expression. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 'field2' bits. + * bitLeftShift("field1", field("field2")); + * ``` + * + * @param field The left operand field name. + * @param numberExpr The right operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. */ -export class LogicalMinimum extends FirestoreFunction { - constructor(private left: Expr, private right: Expr) { - super('logical_minimum', [left, right]); - } -} - +export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise left shift operation between an expression and a constant. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 2 bits. + * bitLeftShift(field("field1"), 2); + * ``` + * + * @param xValue An expression returning bits. + * @param y The right operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. */ -export class Reverse extends FirestoreFunction { - constructor(private value: Expr) { - super('reverse', [value]); - } -} - +export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise left shift operation between two expressions. + * + * ```typescript + * // Calculate the bitwise left shift of 'field1' by 'field2' bits. + * bitLeftShift(field("field1"), field("field2")); + * ``` + * + * @param xValue An expression returning bits. + * @param numberExpr The right operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise left shift operation. */ -export class ReplaceFirst extends FirestoreFunction { - constructor(private value: Expr, private find: Expr, private replace: Expr) { - super('replace_first', [value, find, replace]); - } +export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; +export function bitLeftShift( + xValue: string | Expr, + numberExpr: number | Expr +): FunctionExpr { + return fieldOrExpression(xValue).bitLeftShift(valueToDefaultExpr(numberExpr)); } /** * @beta + * + * Creates an expression that applies a bitwise right shift operation between a field and a constant. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 2 bits. + * bitRightShift("field1", 2); + * ``` + * + * @param field The left operand field name. + * @param y The right operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. */ -export class ReplaceAll extends FirestoreFunction { - constructor(private value: Expr, private find: Expr, private replace: Expr) { - super('replace_all', [value, find, replace]); - } -} - +export function bitRightShift(field: string, y: number): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise right shift operation between a field and an expression. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 'field2' bits. + * bitRightShift("field1", field("field2")); + * ``` + * + * @param field The left operand field name. + * @param numberExpr The right operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. */ -export class CharLength extends FirestoreFunction { - constructor(private value: Expr) { - super('char_length', [value]); - } -} - +export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise right shift operation between an expression and a constant. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 2 bits. + * bitRightShift(field("field1"), 2); + * ``` + * + * @param xValue An expression returning bits. + * @param y The right operand constant representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. */ -export class ByteLength extends FirestoreFunction { - constructor(private value: Expr) { - super('byte_length', [value]); - } -} - +export function bitRightShift(xValue: Expr, y: number): FunctionExpr; /** * @beta + * + * Creates an expression that applies a bitwise right shift operation between two expressions. + * + * ```typescript + * // Calculate the bitwise right shift of 'field1' by 'field2' bits. + * bitRightShift(field("field1"), field("field2")); + * ``` + * + * @param xValue An expression returning bits. + * @param right The right operand expression representing the number of bits to shift. + * @return A new {@code Expr} representing the bitwise right shift operation. */ -export class Like extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr, private pattern: Expr) { - super('like', [expr, pattern]); - } - filterable = true as const; +export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; +export function bitRightShift( + xValue: string | Expr, + numberExpr: number | Expr +): FunctionExpr { + return fieldOrExpression(xValue).bitRightShift( + valueToDefaultExpr(numberExpr) + ); } /** * @beta + * Creates an expression that indexes into an array from the beginning or end + * and return the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the tags field array at index 1. + * arrayOffset('tags', 1); + * ``` + * + * @param arrayField The name of the array field. + * @param offset The index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. */ -export class RegexContains - extends FirestoreFunction - implements FilterCondition -{ - constructor(private expr: Expr, private pattern: Expr) { - super('regex_contains', [expr, pattern]); - } - filterable = true as const; -} +export function arrayOffset(arrayField: string, offset: number): FunctionExpr; /** * @beta + * Creates an expression that indexes into an array from the beginning or end + * and return the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the tags field array at index specified by field + * // 'favoriteTag'. + * arrayOffset('tags', field('favoriteTag')); + * ``` + * + * @param arrayField The name of the array field. + * @param offsetExpr An Expr evaluating to the index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. */ -export class RegexMatch extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr, private pattern: Expr) { - super('regex_match', [expr, pattern]); - } - filterable = true as const; -} +export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; /** * @beta + * Creates an expression that indexes into an array from the beginning or end + * and return the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the tags field array at index 1. + * arrayOffset(field('tags'), 1); + * ``` + * + * @param arrayExpression An Expr evaluating to an array. + * @param offset The index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. */ -export class StrContains extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr, private substring: Expr) { - super('str_contains', [expr, substring]); - } - filterable = true as const; -} +export function arrayOffset( + arrayExpression: Expr, + offset: number +): FunctionExpr; /** * @beta + * Creates an expression that indexes into an array from the beginning or end + * and return the element. If the offset exceeds the array length, an error is + * returned. A negative offset, starts from the end. + * + * ```typescript + * // Return the value in the tags field array at index specified by field + * // 'favoriteTag'. + * arrayOffset(field('tags'), field('favoriteTag')); + * ``` + * + * @param arrayExpression An Expr evaluating to an array. + * @param offsetExpr An Expr evaluating to the index of the element to return. + * @return A new Expr representing the 'arrayOffset' operation. */ -export class StartsWith extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr, private prefix: Expr) { - super('starts_with', [expr, prefix]); - } - filterable = true as const; +export function arrayOffset( + arrayExpression: Expr, + offsetExpr: Expr +): FunctionExpr; +export function arrayOffset( + array: Expr | string, + offset: Expr | number +): FunctionExpr { + return fieldOrExpression(array).arrayOffset(valueToDefaultExpr(offset)); } /** * @beta + * Creates an Expr that returns a map of all values in the current expression context. + * + * @return A new {@code Expr} representing the 'current_context' function. */ -export class EndsWith extends FirestoreFunction implements FilterCondition { - constructor(private expr: Expr, private suffix: Expr) { - super('ends_with', [expr, suffix]); - } - filterable = true as const; +export function currentContext(): FunctionExpr { + return new FunctionExpr('current_context', []); } /** * @beta + * + * Creates an expression that checks if a given expression produces an error. + * + * ```typescript + * // Check if the result of a calculation is an error + * isError(field("title").arrayContains(1)); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isError' check. */ -export class ToLower extends FirestoreFunction { - constructor(private expr: Expr) { - super('to_lower', [expr]); - } +export function isError(value: Expr): BooleanExpr { + return value.isError(); } /** * @beta + * + * Creates an expression that returns the `catch` argument if there is an + * error, else return the result of the `try` argument evaluation. + * + * ```typescript + * // Returns the first item in the title field arrays, or returns + * // the entire title field if the array is empty or the field is another type. + * ifError(field("title").arrayOffset(0), field("title")); + * ``` + * + * @param tryExpr The try expression. + * @param catchExpr The catch expression that will be evaluated and + * returned if the tryExpr produces an error. + * @return A new {@code Expr} representing the 'ifError' operation. */ -export class ToUpper extends FirestoreFunction { - constructor(private expr: Expr) { - super('to_upper', [expr]); - } -} +export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that returns the `catch` argument if there is an + * error, else return the result of the `try` argument evaluation. + * + * ```typescript + * // Returns the first item in the title field arrays, or returns + * // "Default Title" + * ifError(field("title").arrayOffset(0), "Default Title"); + * ``` + * + * @param tryExpr The try expression. + * @param catchValue The value that will be returned if the tryExpr produces an + * error. + * @return A new {@code Expr} representing the 'ifError' operation. */ -export class Trim extends FirestoreFunction { - constructor(private expr: Expr) { - super('trim', [expr]); - } +export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; +export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr { + return tryExpr.ifError(valueToDefaultExpr(catchValue)); } /** * @beta + * + * Creates an expression that returns `true` if a value is absent. Otherwise, + * returns `false` even if the value is `null`. + * + * ```typescript + * // Check if the field `value` is absent. + * isAbsent(field("value")); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isAbsent' check. */ -export class StrConcat extends FirestoreFunction { - constructor(private first: Expr, private rest: Expr[]) { - super('str_concat', [first, ...rest]); - } -} +export function isAbsent(value: Expr): BooleanExpr; /** * @beta + * + * Creates an expression that returns `true` if a field is absent. Otherwise, + * returns `false` even if the field value is `null`. + * + * ```typescript + * // Check if the field `value` is absent. + * isAbsent("value"); + * ``` + * + * @param field The field to check. + * @return A new {@code Expr} representing the 'isAbsent' check. */ -export class MapGet extends FirestoreFunction { - constructor(map: Expr, name: string) { - super('map_get', [map, Constant.of(name)]); - } +export function isAbsent(field: string): BooleanExpr; +export function isAbsent(value: Expr | string): BooleanExpr { + return fieldOrExpression(value).isAbsent(); } /** * @beta + * + * Creates an expression that checks if an expression evaluates to 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NaN + * isNaN(field("value").divide(0)); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isNaN' check. */ -export class Count extends FirestoreFunction implements Accumulator { - accumulator = true as const; - constructor(private value: Expr | undefined, private distinct: boolean) { - super('count', value === undefined ? [] : [value]); - } -} +export function isNull(value: Expr): BooleanExpr; /** * @beta + * + * Creates an expression that checks if a field's value evaluates to 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NaN + * isNaN("value"); + * ``` + * + * @param value The name of the field to check. + * @return A new {@code Expr} representing the 'isNaN' check. */ -export class Sum extends FirestoreFunction implements Accumulator { - accumulator = true as const; - constructor(private value: Expr, private distinct: boolean) { - super('sum', [value]); - } +export function isNull(value: string): BooleanExpr; +export function isNull(value: Expr | string): BooleanExpr { + return fieldOrExpression(value).isNull(); } /** * @beta + * + * Creates an expression that checks if tbe result of an expression is not null. + * + * ```typescript + * // Check if the value of the 'name' field is not null + * isNotNull(field("name")); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isNaN' check. */ -export class Avg extends FirestoreFunction implements Accumulator { - accumulator = true as const; - constructor(private value: Expr, private distinct: boolean) { - super('avg', [value]); - } -} +export function isNotNull(value: Expr): BooleanExpr; /** * @beta + * + * Creates an expression that checks if tbe value of a field is not null. + * + * ```typescript + * // Check if the value of the 'name' field is not null + * isNotNull("name"); + * ``` + * + * @param value The name of the field to check. + * @return A new {@code Expr} representing the 'isNaN' check. */ -export class Minimum extends FirestoreFunction implements Accumulator { - accumulator = true as const; - constructor(private value: Expr, private distinct: boolean) { - super('minimum', [value]); - } +export function isNotNull(value: string): BooleanExpr; +export function isNotNull(value: Expr | string): BooleanExpr { + return fieldOrExpression(value).isNotNull(); } /** * @beta + * + * Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number). + * + * ```typescript + * // Check if the result of a calculation is NOT NaN + * isNotNaN(field("value").divide(0)); + * ``` + * + * @param value The expression to check. + * @return A new {@code Expr} representing the 'isNotNaN' check. */ -export class Maximum extends FirestoreFunction implements Accumulator { - accumulator = true as const; - constructor(private value: Expr, private distinct: boolean) { - super('maximum', [value]); - } -} +export function isNotNan(value: Expr): BooleanExpr; /** * @beta + * + * Creates an expression that checks if the results of this expression is NOT 'NaN' (Not a Number). + * + * ```typescript + * // Check if the value of a field is NOT NaN + * isNotNaN("value"); + * ``` + * + * @param value The name of the field to check. + * @return A new {@code Expr} representing the 'isNotNaN' check. */ -export class CosineDistance extends FirestoreFunction { - constructor(private vector1: Expr, private vector2: Expr) { - super('cosine_distance', [vector1, vector2]); - } +export function isNotNan(value: string): BooleanExpr; +export function isNotNan(value: Expr | string): BooleanExpr { + return fieldOrExpression(value).isNotNan(); } /** * @beta + * + * Creates an expression that removes a key from the map at the specified field name. + * + * ``` + * // Removes the key 'city' field from the map in the address field of the input document. + * mapRemove('address', 'city'); + * ``` + * + * @param mapField The name of a field containing a map value. + * @param key The name of the key to remove from the input map. */ -export class DotProduct extends FirestoreFunction { - constructor(private vector1: Expr, private vector2: Expr) { - super('dot_product', [vector1, vector2]); - } -} - +export function mapRemove(mapField: string, key: string): FunctionExpr; /** * @beta + * + * Creates an expression that removes a key from the map produced by evaluating an expression. + * + * ``` + * // Removes the key 'baz' from the input map. + * mapRemove(map({foo: 'bar', baz: true}), 'baz'); + * ``` + * + * @param mapExpr An expression return a map value. + * @param key The name of the key to remove from the input map. */ -export class EuclideanDistance extends FirestoreFunction { - constructor(private vector1: Expr, private vector2: Expr) { - super('euclidean_distance', [vector1, vector2]); - } -} - +export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; /** * @beta + * + * Creates an expression that removes a key from the map at the specified field name. + * + * ``` + * // Removes the key 'city' field from the map in the address field of the input document. + * mapRemove('address', constant('city')); + * ``` + * + * @param mapField The name of a field containing a map value. + * @param keyExpr An expression that produces the name of the key to remove from the input map. */ -export class VectorLength extends FirestoreFunction { - constructor(private value: Expr) { - super('vector_length', [value]); - } -} - +export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; /** * @beta + * + * Creates an expression that removes a key from the map produced by evaluating an expression. + * + * ``` + * // Removes the key 'baz' from the input map. + * mapRemove(map({foo: 'bar', baz: true}), constant('baz')); + * ``` + * + * @param mapExpr An expression return a map value. + * @param keyExpr An expression that produces the name of the key to remove from the input map. */ -export class UnixMicrosToTimestamp extends FirestoreFunction { - constructor(private input: Expr) { - super('unix_micros_to_timestamp', [input]); - } -} +export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; -/** - * @beta - */ -export class TimestampToUnixMicros extends FirestoreFunction { - constructor(private input: Expr) { - super('timestamp_to_unix_micros', [input]); - } +export function mapRemove( + mapExpr: Expr | string, + stringExpr: Expr | string +): FunctionExpr { + return fieldOrExpression(mapExpr).mapRemove(valueToDefaultExpr(stringExpr)); } /** * @beta + * + * Creates an expression that merges multiple map values. + * + * ``` + * // Merges the map in the settings field with, a map literal, and a map in + * // that is conditionally returned by another expression + * mapMerge('settings', { enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * ``` + * + * @param mapField Name of a field containing a map value that will be merged. + * @param secondMap A required second map to merge. Represented as a literal or + * an expression that returns a map. + * @param otherMaps Optional additional maps to merge. Each map is represented + * as a literal or an expression that returns a map. */ -export class UnixMillisToTimestamp extends FirestoreFunction { - constructor(private input: Expr) { - super('unix_millis_to_timestamp', [input]); - } -} +export function mapMerge( + mapField: string, + secondMap: Record | Expr, + ...otherMaps: Array | Expr> +): FunctionExpr; /** * @beta + * + * Creates an expression that merges multiple map values. + * + * ``` + * // Merges the map in the settings field with, a map literal, and a map in + * // that is conditionally returned by another expression + * mapMerge(field('settings'), { enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * ``` + * + * @param firstMap An expression or literal map value that will be merged. + * @param secondMap A required second map to merge. Represented as a literal or + * an expression that returns a map. + * @param otherMaps Optional additional maps to merge. Each map is represented + * as a literal or an expression that returns a map. */ -export class TimestampToUnixMillis extends FirestoreFunction { - constructor(private input: Expr) { - super('timestamp_to_unix_millis', [input]); - } +export function mapMerge( + firstMap: Record | Expr, + secondMap: Record | Expr, + ...otherMaps: Array | Expr> +): FunctionExpr; + +export function mapMerge( + firstMap: string | Record | Expr, + secondMap: Record | Expr, + ...otherMaps: Array | Expr> +): FunctionExpr { + const secondMapExpr = valueToDefaultExpr(secondMap); + const otherMapExprs = otherMaps.map(valueToDefaultExpr); + return fieldOrExpression(firstMap).mapMerge(secondMapExpr, ...otherMapExprs); } /** * @beta + * + * Creates an expression that returns the document ID from a path. + * + * ```typescript + * // Get the document ID from a path. + * documentId(myDocumentReference); + * ``` + * + * @return A new {@code Expr} representing the documentId operation. */ -export class UnixSecondsToTimestamp extends FirestoreFunction { - constructor(private input: Expr) { - super('unix_seconds_to_timestamp', [input]); - } -} +export function documentId( + documentPath: string | DocumentReference +): FunctionExpr; /** * @beta + * + * Creates an expression that returns the document ID from a path. + * + * ```typescript + * // Get the document ID from a path. + * documentId(field("__path__")); + * ``` + * + * @return A new {@code Expr} representing the documentId operation. */ -export class TimestampToUnixSeconds extends FirestoreFunction { - constructor(private input: Expr) { - super('timestamp_to_unix_seconds', [input]); - } +export function documentId(documentPathExpr: Expr): FunctionExpr; + +export function documentId( + documentPath: Expr | string | DocumentReference +): FunctionExpr { + // @ts-ignore + const documentPathExpr = valueToDefaultExpr(documentPath); + return documentPathExpr.documentId(); } /** * @beta + * + * Creates an expression that returns a substring of a string or byte array. + * + * @param field The name of a field containing a string or byte array to compute the substring from. + * @param position Index of the first character of the substring. + * @param length Length of the substring. */ -export class TimestampAdd extends FirestoreFunction { - constructor( - private timestamp: Expr, - private unit: Expr, - private amount: Expr - ) { - super('timestamp_add', [timestamp, unit, amount]); - } -} +export function substr( + field: string, + position: number, + length?: number +): FunctionExpr; /** * @beta + * + * Creates an expression that returns a substring of a string or byte array. + * + * @param input An expression returning a string or byte array to compute the substring from. + * @param position Index of the first character of the substring. + * @param length Length of the substring. */ -export class TimestampSub extends FirestoreFunction { - constructor( - private timestamp: Expr, - private unit: Expr, - private amount: Expr - ) { - super('timestamp_sub', [timestamp, unit, amount]); - } -} +export function substr( + input: Expr, + position: number, + length?: number +): FunctionExpr; /** * @beta * - * Creates an expression that adds two expressions together. - * - * ```typescript - * // Add the value of the 'quantity' field and the 'reserve' field. - * add(Field.of("quantity"), Field.of("reserve")); - * ``` + * Creates an expression that returns a substring of a string or byte array. * - * @param left The first expression to add. - * @param right The second expression to add. - * @return A new {@code Expr} representing the addition operation. + * @param field The name of a field containing a string or byte array to compute the substring from. + * @param position An expression that returns the index of the first character of the substring. + * @param length An expression that returns the length of the substring. */ -export function add(left: Expr, right: Expr): Add; +export function substr( + field: string, + position: Expr, + length?: Expr +): FunctionExpr; /** * @beta * - * Creates an expression that adds an expression to a constant value. + * Creates an expression that returns a substring of a string or byte array. * - * ```typescript - * // Add 5 to the value of the 'age' field - * add(Field.of("age"), 5); - * ``` - * - * @param left The expression to add to. - * @param right The constant value to add. - * @return A new {@code Expr} representing the addition operation. + * @param input An expression returning a string or byte array to compute the substring from. + * @param position An expression that returns the index of the first character of the substring. + * @param length An expression that returns the length of the substring. */ -export function add(left: Expr, right: any): Add; +export function substr( + input: Expr, + position: Expr, + length?: Expr +): FunctionExpr; + +export function substr( + field: Expr | string, + position: Expr | number, + length?: Expr | number +): FunctionExpr { + const fieldExpr = fieldOrExpression(field); + const positionExpr = valueToDefaultExpr(position); + const lengthExpr = + length === undefined ? undefined : valueToDefaultExpr(length); + return fieldExpr.substr(positionExpr, lengthExpr); +} /** * @beta * - * Creates an expression that adds a field's value to an expression. + * Creates an expression that adds two expressions together. * * ```typescript * // Add the value of the 'quantity' field and the 'reserve' field. - * add("quantity", Field.of("reserve")); + * add(field("quantity"), field("reserve")); * ``` * - * @param left The field name to add to. - * @param right The expression to add. + * @param first The first expression to add. + * @param second The second expression or literal to add. + * @param others Optional other expressions or literals to add. * @return A new {@code Expr} representing the addition operation. */ -export function add(left: string, right: Expr): Add; +export function add( + first: Expr, + second: Expr | unknown, + ...others: Array +): FunctionExpr; /** * @beta * - * Creates an expression that adds a field's value to a constant value. + * Creates an expression that adds a field's value to an expression. * * ```typescript - * // Add 5 to the value of the 'age' field - * add("age", 5); + * // Add the value of the 'quantity' field and the 'reserve' field. + * add("quantity", field("reserve")); * ``` * - * @param left The field name to add to. - * @param right The constant value to add. + * @param fieldName The name of the field containing the value to add. + * @param second The second expression or literal to add. + * @param others Optional other expressions or literals to add. * @return A new {@code Expr} representing the addition operation. */ -export function add(left: string, right: any): Add; -export function add(left: Expr | string, right: Expr | any): Add { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new Add(normalizedLeft, normalizedRight); +export function add( + fieldName: string, + second: Expr | unknown, + ...others: Array +): FunctionExpr; + +export function add( + first: Expr | string, + second: Expr | unknown, + ...others: Array +): FunctionExpr { + return fieldOrExpression(first).add( + valueToDefaultExpr(second), + ...others.map(value => valueToDefaultExpr(value)) + ); } /** @@ -3018,14 +3535,14 @@ export function add(left: Expr | string, right: Expr | any): Add { * * ```typescript * // Subtract the 'discount' field from the 'price' field - * subtract(Field.of("price"), Field.of("discount")); + * subtract(field("price"), field("discount")); * ``` * * @param left The expression to subtract from. * @param right The expression to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(left: Expr, right: Expr): Subtract; +export function subtract(left: Expr, right: Expr): FunctionExpr; /** * @beta @@ -3034,14 +3551,14 @@ export function subtract(left: Expr, right: Expr): Subtract; * * ```typescript * // Subtract the constant value 2 from the 'value' field - * subtract(Field.of("value"), 2); + * subtract(field("value"), 2); * ``` * - * @param left The expression to subtract from. - * @param right The constant value to subtract. + * @param expression The expression to subtract from. + * @param value The constant value to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(left: Expr, right: any): Subtract; +export function subtract(expression: Expr, value: unknown): FunctionExpr; /** * @beta @@ -3050,14 +3567,14 @@ export function subtract(left: Expr, right: any): Subtract; * * ```typescript * // Subtract the 'discount' field from the 'price' field - * subtract("price", Field.of("discount")); + * subtract("price", field("discount")); * ``` * - * @param left The field name to subtract from. - * @param right The expression to subtract. + * @param fieldName The field name to subtract from. + * @param expression The expression to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(left: string, right: Expr): Subtract; +export function subtract(fieldName: string, expression: Expr): FunctionExpr; /** * @beta @@ -3069,15 +3586,18 @@ export function subtract(left: string, right: Expr): Subtract; * subtract("total", 20); * ``` * - * @param left The field name to subtract from. - * @param right The constant value to subtract. + * @param fieldName The field name to subtract from. + * @param value The constant value to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(left: string, right: any): Subtract; -export function subtract(left: Expr | string, right: Expr | any): Subtract { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new Subtract(normalizedLeft, normalizedRight); +export function subtract(fieldName: string, value: unknown): FunctionExpr; +export function subtract( + left: Expr | string, + right: Expr | unknown +): FunctionExpr { + const normalizedLeft = typeof left === 'string' ? field(left) : left; + const normalizedRight = valueToDefaultExpr(right); + return normalizedLeft.subtract(normalizedRight); } /** @@ -3087,30 +3607,19 @@ export function subtract(left: Expr | string, right: Expr | any): Subtract { * * ```typescript * // Multiply the 'quantity' field by the 'price' field - * multiply(Field.of("quantity"), Field.of("price")); - * ``` - * - * @param left The first expression to multiply. - * @param right The second expression to multiply. - * @return A new {@code Expr} representing the multiplication operation. - */ -export function multiply(left: Expr, right: Expr): Multiply; - -/** - * @beta - * - * Creates an expression that multiplies an expression by a constant value. - * - * ```typescript - * // Multiply the value of the 'price' field by 2 - * multiply(Field.of("price"), 2); + * multiply(field("quantity"), field("price")); * ``` * - * @param left The expression to multiply. - * @param right The constant value to multiply by. + * @param first The first expression to multiply. + * @param second The second expression or literal to multiply. + * @param others Optional additional expressions or literals to multiply. * @return A new {@code Expr} representing the multiplication operation. */ -export function multiply(left: Expr, right: any): Multiply; +export function multiply( + first: Expr, + second: Expr | unknown, + ...others: Array +): FunctionExpr; /** * @beta @@ -3119,34 +3628,29 @@ export function multiply(left: Expr, right: any): Multiply; * * ```typescript * // Multiply the 'quantity' field by the 'price' field - * multiply("quantity", Field.of("price")); - * ``` - * - * @param left The field name to multiply. - * @param right The expression to multiply by. - * @return A new {@code Expr} representing the multiplication operation. - */ -export function multiply(left: string, right: Expr): Multiply; - -/** - * @beta - * - * Creates an expression that multiplies a field's value by a constant value. - * - * ```typescript - * // Multiply the 'value' field by 2 - * multiply("value", 2); + * multiply("quantity", field("price")); * ``` * - * @param left The field name to multiply. - * @param right The constant value to multiply by. + * @param fieldName The name of the field containing the value to add. + * @param second The second expression or literal to add. + * @param others Optional other expressions or literals to add. * @return A new {@code Expr} representing the multiplication operation. */ -export function multiply(left: string, right: any): Multiply; -export function multiply(left: Expr | string, right: Expr | any): Multiply { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new Multiply(normalizedLeft, normalizedRight); +export function multiply( + fieldName: string, + second: Expr | unknown, + ...others: Array +): FunctionExpr; + +export function multiply( + first: Expr | string, + second: Expr | unknown, + ...others: Array +): FunctionExpr { + return fieldOrExpression(first).multiply( + valueToDefaultExpr(second), + ...others.map(valueToDefaultExpr) + ); } /** @@ -3156,14 +3660,14 @@ export function multiply(left: Expr | string, right: Expr | any): Multiply { * * ```typescript * // Divide the 'total' field by the 'count' field - * divide(Field.of("total"), Field.of("count")); + * divide(field("total"), field("count")); * ``` * * @param left The expression to be divided. * @param right The expression to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(left: Expr, right: Expr): Divide; +export function divide(left: Expr, right: Expr): FunctionExpr; /** * @beta @@ -3172,14 +3676,14 @@ export function divide(left: Expr, right: Expr): Divide; * * ```typescript * // Divide the 'value' field by 10 - * divide(Field.of("value"), 10); + * divide(field("value"), 10); * ``` * - * @param left The expression to be divided. - * @param right The constant value to divide by. + * @param expression The expression to be divided. + * @param value The constant value to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(left: Expr, right: any): Divide; +export function divide(expression: Expr, value: unknown): FunctionExpr; /** * @beta @@ -3188,14 +3692,14 @@ export function divide(left: Expr, right: any): Divide; * * ```typescript * // Divide the 'total' field by the 'count' field - * divide("total", Field.of("count")); + * divide("total", field("count")); * ``` * - * @param left The field name to be divided. - * @param right The expression to divide by. + * @param fieldName The field name to be divided. + * @param expressions The expression to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(left: string, right: Expr): Divide; +export function divide(fieldName: string, expressions: Expr): FunctionExpr; /** * @beta @@ -3207,15 +3711,18 @@ export function divide(left: string, right: Expr): Divide; * divide("value", 10); * ``` * - * @param left The field name to be divided. - * @param right The constant value to divide by. + * @param fieldName The field name to be divided. + * @param value The constant value to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(left: string, right: any): Divide; -export function divide(left: Expr | string, right: Expr | any): Divide { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new Divide(normalizedLeft, normalizedRight); +export function divide(fieldName: string, value: unknown): FunctionExpr; +export function divide( + left: Expr | string, + right: Expr | unknown +): FunctionExpr { + const normalizedLeft = typeof left === 'string' ? field(left) : left; + const normalizedRight = valueToDefaultExpr(right); + return normalizedLeft.divide(normalizedRight); } /** @@ -3225,14 +3732,14 @@ export function divide(left: Expr | string, right: Expr | any): Divide { * * ```typescript * // Calculate the remainder of dividing 'field1' by 'field2'. - * mod(Field.of("field1"), Field.of("field2")); + * mod(field("field1"), field("field2")); * ``` * * @param left The dividend expression. * @param right The divisor expression. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(left: Expr, right: Expr): Mod; +export function mod(left: Expr, right: Expr): FunctionExpr; /** * @beta @@ -3241,14 +3748,14 @@ export function mod(left: Expr, right: Expr): Mod; * * ```typescript * // Calculate the remainder of dividing 'field1' by 5. - * mod(Field.of("field1"), 5); + * mod(field("field1"), 5); * ``` * - * @param left The dividend expression. - * @param right The divisor constant. + * @param expression The dividend expression. + * @param value The divisor constant. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(left: Expr, right: any): Mod; +export function mod(expression: Expr, value: unknown): FunctionExpr; /** * @beta @@ -3257,14 +3764,14 @@ export function mod(left: Expr, right: any): Mod; * * ```typescript * // Calculate the remainder of dividing 'field1' by 'field2'. - * mod("field1", Field.of("field2")); + * mod("field1", field("field2")); * ``` * - * @param left The dividend field name. - * @param right The divisor expression. + * @param fieldName The dividend field name. + * @param expression The divisor expression. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(left: string, right: Expr): Mod; +export function mod(fieldName: string, expression: Expr): FunctionExpr; /** * @beta @@ -3276,402 +3783,83 @@ export function mod(left: string, right: Expr): Mod; * mod("field1", 5); * ``` * - * @param left The dividend field name. - * @param right The divisor constant. + * @param fieldName The dividend field name. + * @param value The divisor constant. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(left: string, right: any): Mod; -export function mod(left: Expr | string, right: Expr | any): Mod { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new Mod(normalizedLeft, normalizedRight); +export function mod(fieldName: string, value: unknown): FunctionExpr; +export function mod(left: Expr | string, right: Expr | unknown): FunctionExpr { + const normalizedLeft = typeof left === 'string' ? field(left) : left; + const normalizedRight = valueToDefaultExpr(right); + return normalizedLeft.mod(normalizedRight); +} + +/** + * @beta + * + * Creates an expression that creates a Firestore map value from an input object. + * + * ```typescript + * // Create a map from the input object and reference the 'baz' field value from the input document. + * map({foo: 'bar', baz: Field.of('baz')}).as('data'); + * ``` + * + * @param elements The input map to evaluate in the expression. + * @return A new {@code Expr} representing the map function. + */ +export function map(elements: Record): FunctionExpr { + const result: Expr[] = []; + for (const key in elements) { + if (Object.prototype.hasOwnProperty.call(elements, key)) { + const value = elements[key]; + result.push(constant(key)); + result.push(valueToDefaultExpr(value)); + } + } + return new FunctionExpr('map', result); +} + +/** + * Internal use only + * Converts a plainObject to a mapValue in the proto representation, + * rather than a functionValue+map that is the result of the map(...) function. + * This behaves different from constant(plainObject) because it + * traverses the input object, converts values in the object to expressions, + * and calls _readUserData on each of these expressions. + * @private + * @internal + * @param plainObject + */ +export function _mapValue(plainObject: Record): MapValue { + const result: Map = new Map(); + for (const key in plainObject) { + if (Object.prototype.hasOwnProperty.call(plainObject, key)) { + const value = plainObject[key]; + result.set(key, valueToDefaultExpr(value)); + } + } + return new MapValue(result); } -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise AND operation between two expressions. -// * -// * ```typescript -// * // Calculate the bitwise AND of 'field1' and 'field2'. -// * bitAnd(Field.of("field1"), Field.of("field2")); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise AND operation. -// */ -// export function bitAnd(left: Expr, right: Expr): BitAnd; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise AND operation between an expression and a constant. -// * -// * ```typescript -// * // Calculate the bitwise AND of 'field1' and 0xFF. -// * bitAnd(Field.of("field1"), 0xFF); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise AND operation. -// */ -// export function bitAnd(left: Expr, right: any): BitAnd; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise AND operation between a field and an expression. -// * -// * ```typescript -// * // Calculate the bitwise AND of 'field1' and 'field2'. -// * bitAnd("field1", Field.of("field2")); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise AND operation. -// */ -// export function bitAnd(left: string, right: Expr): BitAnd; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise AND operation between a field and a constant. -// * -// * ```typescript -// * // Calculate the bitwise AND of 'field1' and 0xFF. -// * bitAnd("field1", 0xFF); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise AND operation. -// */ -// export function bitAnd(left: string, right: any): BitAnd; -// export function bitAnd(left: Expr | string, right: Expr | any): BitAnd { -// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; -// const normalizedRight = right instanceof Expr ? right : Constant.of(right); -// return new BitAnd(normalizedLeft, normalizedRight); -// } -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise OR operation between two expressions. -// * -// * ```typescript -// * // Calculate the bitwise OR of 'field1' and 'field2'. -// * bitOr(Field.of("field1"), Field.of("field2")); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise OR operation. -// */ -// export function bitOr(left: Expr, right: Expr): BitOr; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise OR operation between an expression and a constant. -// * -// * ```typescript -// * // Calculate the bitwise OR of 'field1' and 0xFF. -// * bitOr(Field.of("field1"), 0xFF); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise OR operation. -// */ -// export function bitOr(left: Expr, right: any): BitOr; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise OR operation between a field and an expression. -// * -// * ```typescript -// * // Calculate the bitwise OR of 'field1' and 'field2'. -// * bitOr("field1", Field.of("field2")); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise OR operation. -// */ -// export function bitOr(left: string, right: Expr): BitOr; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise OR operation between a field and a constant. -// * -// * ```typescript -// * // Calculate the bitwise OR of 'field1' and 0xFF. -// * bitOr("field1", 0xFF); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise OR operation. -// */ -// export function bitOr(left: string, right: any): BitOr; -// export function bitOr(left: Expr | string, right: Expr | any): BitOr { -// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; -// const normalizedRight = right instanceof Expr ? right : Constant.of(right); -// return new BitOr(normalizedLeft, normalizedRight); -// } -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise XOR operation between two expressions. -// * -// * ```typescript -// * // Calculate the bitwise XOR of 'field1' and 'field2'. -// * bitXor(Field.of("field1"), Field.of("field2")); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise XOR operation. -// */ -// export function bitXor(left: Expr, right: Expr): BitXor; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise XOR operation between an expression and a constant. -// * -// * ```typescript -// * // Calculate the bitwise XOR of 'field1' and 0xFF. -// * bitXor(Field.of("field1"), 0xFF); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise XOR operation. -// */ -// export function bitXor(left: Expr, right: any): BitXor; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise XOR operation between a field and an expression. -// * -// * ```typescript -// * // Calculate the bitwise XOR of 'field1' and 'field2'. -// * bitXor("field1", Field.of("field2")); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand expression. -// * @return A new {@code Expr} representing the bitwise XOR operation. -// */ -// export function bitXor(left: string, right: Expr): BitXor; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise XOR operation between a field and a constant. -// * -// * ```typescript -// * // Calculate the bitwise XOR of 'field1' and 0xFF. -// * bitXor("field1", 0xFF); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand constant. -// * @return A new {@code Expr} representing the bitwise XOR operation. -// */ -// export function bitXor(left: string, right: any): BitXor; -// export function bitXor(left: Expr | string, right: Expr | any): BitXor { -// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; -// const normalizedRight = right instanceof Expr ? right : Constant.of(right); -// return new BitXor(normalizedLeft, normalizedRight); -// } -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise NOT operation to an expression. -// * -// * ```typescript -// * // Calculate the bitwise NOT of 'field1'. -// * bitNot(Field.of("field1")); -// * ``` -// * -// * @param operand The operand expression. -// * @return A new {@code Expr} representing the bitwise NOT operation. -// */ -// export function bitNot(operand: Expr): BitNot; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise NOT operation to a field. -// * -// * ```typescript -// * // Calculate the bitwise NOT of 'field1'. -// * bitNot("field1"); -// * ``` -// * -// * @param operand The operand field name. -// * @return A new {@code Expr} representing the bitwise NOT operation. -// */ -// export function bitNot(operand: string): BitNot; -// export function bitNot(operand: Expr | string): BitNot { -// const normalizedOperand = -// typeof operand === 'string' ? Field.of(operand) : operand; -// return new BitNot(normalizedOperand); -// } -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise left shift operation between two expressions. -// * -// * ```typescript -// * // Calculate the bitwise left shift of 'field1' by 'field2' bits. -// * bitLeftShift(Field.of("field1"), Field.of("field2")); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand expression representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise left shift operation. -// */ -// export function bitLeftShift(left: Expr, right: Expr): BitLeftShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise left shift operation between an expression and a constant. -// * -// * ```typescript -// * // Calculate the bitwise left shift of 'field1' by 2 bits. -// * bitLeftShift(Field.of("field1"), 2); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand constant representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise left shift operation. -// */ -// export function bitLeftShift(left: Expr, right: any): BitLeftShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise left shift operation between a field and an expression. -// * -// * ```typescript -// * // Calculate the bitwise left shift of 'field1' by 'field2' bits. -// * bitLeftShift("field1", Field.of("field2")); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand expression representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise left shift operation. -// */ -// export function bitLeftShift(left: string, right: Expr): BitLeftShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise left shift operation between a field and a constant. -// * -// * ```typescript -// * // Calculate the bitwise left shift of 'field1' by 2 bits. -// * bitLeftShift("field1", 2); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand constant representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise left shift operation. -// */ -// export function bitLeftShift(left: string, right: any): BitLeftShift; -// export function bitLeftShift( -// left: Expr | string, -// right: Expr | any -// ): BitLeftShift { -// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; -// const normalizedRight = right instanceof Expr ? right : Constant.of(right); -// return new BitLeftShift(normalizedLeft, normalizedRight); -// } -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise right shift operation between two expressions. -// * -// * ```typescript -// * // Calculate the bitwise right shift of 'field1' by 'field2' bits. -// * bitRightShift(Field.of("field1"), Field.of("field2")); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand expression representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise right shift operation. -// */ -// export function bitRightShift(left: Expr, right: Expr): BitRightShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise right shift operation between an expression and a constant. -// * -// * ```typescript -// * // Calculate the bitwise right shift of 'field1' by 2 bits. -// * bitRightShift(Field.of("field1"), 2); -// * ``` -// * -// * @param left The left operand expression. -// * @param right The right operand constant representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise right shift operation. -// */ -// export function bitRightShift(left: Expr, right: any): BitRightShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise right shift operation between a field and an expression. -// * -// * ```typescript -// * // Calculate the bitwise right shift of 'field1' by 'field2' bits. -// * bitRightShift("field1", Field.of("field2")); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand expression representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise right shift operation. -// */ -// export function bitRightShift(left: string, right: Expr): BitRightShift; -// -// /** -// * @beta -// * -// * Creates an expression that applies a bitwise right shift operation between a field and a constant. -// * -// * ```typescript -// * // Calculate the bitwise right shift of 'field1' by 2 bits. -// * bitRightShift("field1", 2); -// * ``` -// * -// * @param left The left operand field name. -// * @param right The right operand constant representing the number of bits to shift. -// * @return A new {@code Expr} representing the bitwise right shift operation. -// */ -// export function bitRightShift(left: string, right: any): BitRightShift; -// export function bitRightShift( -// left: Expr | string, -// right: Expr | any -// ): BitRightShift { -// const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; -// const normalizedRight = right instanceof Expr ? right : Constant.of(right); -// return new BitRightShift(normalizedLeft, normalizedRight); -// } +/** + * @beta + * + * Creates an expression that creates a Firestore array value from an input array. + * + * ```typescript + * // Create an array value from the input array and reference the 'baz' field value from the input document. + * array(['bar', Field.of('baz')]).as('foo'); + * ``` + * + * @param elements The input array to evaluate in the expression. + * @return A new {@code Expr} representing the array function. + */ +export function array(elements: unknown[]): FunctionExpr { + return new FunctionExpr( + 'array', + elements.map(element => valueToDefaultExpr(element)) + ); +} /** * @beta @@ -3680,14 +3868,14 @@ export function mod(left: Expr | string, right: Expr | any): Mod { * * ```typescript * // Check if the 'age' field is equal to an expression - * eq(Field.of("age"), Field.of("minAge").add(10)); + * eq(field("age"), field("minAge").add(10)); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the equality comparison. */ -export function eq(left: Expr, right: Expr): Eq; +export function eq(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -3696,14 +3884,14 @@ export function eq(left: Expr, right: Expr): Eq; * * ```typescript * // Check if the 'age' field is equal to 21 - * eq(Field.of("age"), 21); + * eq(field("age"), 21); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(left: Expr, right: any): Eq; +export function eq(expression: Expr, value: unknown): BooleanExpr; /** * @beta @@ -3712,14 +3900,14 @@ export function eq(left: Expr, right: any): Eq; * * ```typescript * // Check if the 'age' field is equal to the 'limit' field - * eq("age", Field.of("limit")); + * eq("age", field("limit")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param expression The expression to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(left: string, right: Expr): Eq; +export function eq(fieldName: string, expression: Expr): BooleanExpr; /** * @beta @@ -3731,15 +3919,15 @@ export function eq(left: string, right: Expr): Eq; * eq("city", "London"); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(left: string, right: any): Eq; -export function eq(left: Expr | string, right: any): Eq { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Eq(leftExpr, rightExpr); +export function eq(fieldName: string, value: unknown): BooleanExpr; +export function eq(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.eq(rightExpr); } /** @@ -3749,14 +3937,14 @@ export function eq(left: Expr | string, right: any): Eq { * * ```typescript * // Check if the 'status' field is not equal to field 'finalState' - * neq(Field.of("status"), Field.of("finalState")); + * neq(field("status"), field("finalState")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the inequality comparison. */ -export function neq(left: Expr, right: Expr): Neq; +export function neq(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -3765,14 +3953,14 @@ export function neq(left: Expr, right: Expr): Neq; * * ```typescript * // Check if the 'status' field is not equal to "completed" - * neq(Field.of("status"), "completed"); + * neq(field("status"), "completed"); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(left: Expr, right: any): Neq; +export function neq(expression: Expr, value: unknown): BooleanExpr; /** * @beta @@ -3781,14 +3969,14 @@ export function neq(left: Expr, right: any): Neq; * * ```typescript * // Check if the 'status' field is not equal to the value of 'expectedStatus' - * neq("status", Field.of("expectedStatus")); + * neq("status", field("expectedStatus")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param expression The expression to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(left: string, right: Expr): Neq; +export function neq(fieldName: string, expression: Expr): BooleanExpr; /** * @beta @@ -3800,15 +3988,15 @@ export function neq(left: string, right: Expr): Neq; * neq("country", "USA"); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(left: string, right: any): Neq; -export function neq(left: Expr | string, right: any): Neq { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Neq(leftExpr, rightExpr); +export function neq(fieldName: string, value: unknown): BooleanExpr; +export function neq(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.neq(rightExpr); } /** @@ -3818,14 +4006,14 @@ export function neq(left: Expr | string, right: any): Neq { * * ```typescript * // Check if the 'age' field is less than 30 - * lt(Field.of("age"), Field.of("limit")); + * lt(field("age"), field("limit")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the less than comparison. */ -export function lt(left: Expr, right: Expr): Lt; +export function lt(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -3834,14 +4022,14 @@ export function lt(left: Expr, right: Expr): Lt; * * ```typescript * // Check if the 'age' field is less than 30 - * lt(Field.of("age"), 30); + * lt(field("age"), 30); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(left: Expr, right: any): Lt; +export function lt(expression: Expr, value: unknown): BooleanExpr; /** * @beta @@ -3850,14 +4038,14 @@ export function lt(left: Expr, right: any): Lt; * * ```typescript * // Check if the 'age' field is less than the 'limit' field - * lt("age", Field.of("limit")); + * lt("age", field("limit")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param expression The expression to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(left: string, right: Expr): Lt; +export function lt(fieldName: string, expression: Expr): BooleanExpr; /** * @beta @@ -3869,15 +4057,15 @@ export function lt(left: string, right: Expr): Lt; * lt("price", 50); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(left: string, right: any): Lt; -export function lt(left: Expr | string, right: any): Lt { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Lt(leftExpr, rightExpr); +export function lt(fieldName: string, value: unknown): BooleanExpr; +export function lt(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.lt(rightExpr); } /** @@ -3888,14 +4076,14 @@ export function lt(left: Expr | string, right: any): Lt { * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * lte(Field.of("quantity"), Field.of("limit")); + * lte(field("quantity"), field("limit")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(left: Expr, right: Expr): Lte; +export function lte(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -3904,28 +4092,28 @@ export function lte(left: Expr, right: Expr): Lte; * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * lte(Field.of("quantity"), 20); + * lte(field("quantity"), 20); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(left: Expr, right: any): Lte; +export function lte(expression: Expr, value: unknown): BooleanExpr; /** * Creates an expression that checks if a field's value is less than or equal to an expression. * * ```typescript * // Check if the 'quantity' field is less than or equal to the 'limit' field - * lte("quantity", Field.of("limit")); + * lte("quantity", field("limit")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param expression The expression to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(left: string, right: Expr): Lte; +export function lte(fieldName: string, expression: Expr): BooleanExpr; /** * @beta @@ -3937,15 +4125,15 @@ export function lte(left: string, right: Expr): Lte; * lte("score", 70); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(left: string, right: any): Lte; -export function lte(left: Expr | string, right: any): Lte { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Lte(leftExpr, rightExpr); +export function lte(fieldName: string, value: unknown): BooleanExpr; +export function lte(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.lte(rightExpr); } /** @@ -3956,14 +4144,14 @@ export function lte(left: Expr | string, right: any): Lte { * * ```typescript * // Check if the 'age' field is greater than 18 - * gt(Field.of("age"), Constant(9).add(9)); + * gt(field("age"), Constant(9).add(9)); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the greater than comparison. */ -export function gt(left: Expr, right: Expr): Gt; +export function gt(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -3972,14 +4160,14 @@ export function gt(left: Expr, right: Expr): Gt; * * ```typescript * // Check if the 'age' field is greater than 18 - * gt(Field.of("age"), 18); + * gt(field("age"), 18); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(left: Expr, right: any): Gt; +export function gt(expression: Expr, value: unknown): BooleanExpr; /** * @beta @@ -3988,14 +4176,14 @@ export function gt(left: Expr, right: any): Gt; * * ```typescript * // Check if the value of field 'age' is greater than the value of field 'limit' - * gt("age", Field.of("limit")); + * gt("age", field("limit")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param expression The expression to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(left: string, right: Expr): Gt; +export function gt(fieldName: string, expression: Expr): BooleanExpr; /** * @beta @@ -4007,15 +4195,15 @@ export function gt(left: string, right: Expr): Gt; * gt("price", 100); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(left: string, right: any): Gt; -export function gt(left: Expr | string, right: any): Gt { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Gt(leftExpr, rightExpr); +export function gt(fieldName: string, value: unknown): BooleanExpr; +export function gt(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.gt(rightExpr); } /** @@ -4026,14 +4214,14 @@ export function gt(left: Expr | string, right: any): Gt { * * ```typescript * // Check if the 'quantity' field is greater than or equal to the field "threshold" - * gte(Field.of("quantity"), Field.of("threshold")); + * gte(field("quantity"), field("threshold")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(left: Expr, right: Expr): Gte; +export function gte(left: Expr, right: Expr): BooleanExpr; /** * @beta @@ -4043,14 +4231,14 @@ export function gte(left: Expr, right: Expr): Gte; * * ```typescript * // Check if the 'quantity' field is greater than or equal to 10 - * gte(Field.of("quantity"), 10); + * gte(field("quantity"), 10); * ``` * - * @param left The expression to compare. - * @param right The constant value to compare to. + * @param expression The expression to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(left: Expr, right: any): Gte; +export function gte(expression: Expr, value: unknown): BooleanExpr; /** * @beta @@ -4059,14 +4247,14 @@ export function gte(left: Expr, right: any): Gte; * * ```typescript * // Check if the value of field 'age' is greater than or equal to the value of field 'limit' - * gte("age", Field.of("limit")); + * gte("age", field("limit")); * ``` * - * @param left The field name to compare. - * @param right The expression to compare to. + * @param fieldName The field name to compare. + * @param value The expression to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(left: string, right: Expr): Gte; +export function gte(fieldName: string, value: Expr): BooleanExpr; /** * @beta @@ -4079,15 +4267,15 @@ export function gte(left: string, right: Expr): Gte; * gte("score", 80); * ``` * - * @param left The field name to compare. - * @param right The constant value to compare to. + * @param fieldName The field name to compare. + * @param value The constant value to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(left: string, right: any): Gte; -export function gte(left: Expr | string, right: any): Gte { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const rightExpr = right instanceof Expr ? right : Constant.of(right); - return new Gte(leftExpr, rightExpr); +export function gte(fieldName: string, value: unknown): BooleanExpr; +export function gte(left: Expr | string, right: unknown): BooleanExpr { + const leftExpr = left instanceof Expr ? left : field(left); + const rightExpr = valueToDefaultExpr(right); + return leftExpr.gte(rightExpr); } /** @@ -4097,71 +4285,51 @@ export function gte(left: Expr | string, right: any): Gte { * * ```typescript * // Combine the 'items' array with two new item arrays - * arrayConcat(Field.of("items"), [Field.of("newItems"), Field.of("otherItems")]); - * ``` - * - * @param array The array expression to concatenate to. - * @param elements The array expressions to concatenate. - * @return A new {@code Expr} representing the concatenated array. - */ -export function arrayConcat(array: Expr, elements: Expr[]): ArrayConcat; - -/** - * @beta - * - * Creates an expression that concatenates an array expression with other arrays and/or values. - * - * ```typescript - * // Combine the 'tags' array with a new array - * arrayConcat(Field.of("tags"), ["newTag1", "newTag2"]); - * ``` - * - * @param array The array expression to concatenate to. - * @param elements The array expressions or single values to concatenate. - * @return A new {@code Expr} representing the concatenated array. - */ -export function arrayConcat(array: Expr, elements: any[]): ArrayConcat; - -/** - * @beta - * - * Creates an expression that concatenates a field's array value with other arrays. - * - * ```typescript - * // Combine the 'items' array with two new item arrays - * arrayConcat("items", [Field.of("newItems"), Field.of("otherItems")]); + * arrayConcat(field("items"), [field("newItems"), field("otherItems")]); * ``` * - * @param array The field name containing array values. - * @param elements The array expressions to concatenate. + * @param firstArray The first array expression to concatenate to. + * @param secondArray The second array expression or array literal to concatenate to. + * @param otherArrays Optional additional array expressions or array literals to concatenate. * @return A new {@code Expr} representing the concatenated array. */ -export function arrayConcat(array: string, elements: Expr[]): ArrayConcat; +export function arrayConcat( + firstArray: Expr, + secondArray: Expr | unknown[], + ...otherArrays: Array +): FunctionExpr; /** * @beta * - * Creates an expression that concatenates a field's array value with other arrays and/or values. + * Creates an expression that concatenates a field's array value with other arrays. * * ```typescript - * // Combine the 'tags' array with a new array - * arrayConcat("tags", ["newTag1", "newTag2"]); + * // Combine the 'items' array with two new item arrays + * arrayConcat("items", [field("newItems"), field("otherItems")]); * ``` * - * @param array The field name containing array values. - * @param elements The array expressions or single values to concatenate. + * @param firstArrayField The first array to concatenate to. + * @param secondArray The second array expression or array literal to concatenate to. + * @param otherArrays Optional additional array expressions or array literals to concatenate. * @return A new {@code Expr} representing the concatenated array. */ -export function arrayConcat(array: string, elements: any[]): ArrayConcat; export function arrayConcat( - array: Expr | string, - elements: any[] -): ArrayConcat { - const arrayExpr = array instanceof Expr ? array : Field.of(array); - const exprValues = elements.map(element => - element instanceof Expr ? element : Constant.of(element) + firstArrayField: string, + secondArray: Expr | unknown[], + ...otherArrays: Array +): FunctionExpr; + +export function arrayConcat( + firstArray: Expr | string, + secondArray: Expr | unknown[], + ...otherArrays: Array +): FunctionExpr { + const exprValues = otherArrays.map(element => valueToDefaultExpr(element)); + return fieldOrExpression(firstArray).arrayConcat( + fieldOrExpression(secondArray), + ...exprValues ); - return new ArrayConcat(arrayExpr, exprValues); } /** @@ -4171,14 +4339,14 @@ export function arrayConcat( * * ```typescript * // Check if the 'colors' array contains the value of field 'selectedColor' - * arrayContains(Field.of("colors"), Field.of("selectedColor")); + * arrayContains(field("colors"), field("selectedColor")); * ``` * * @param array The array expression to check. * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: Expr, element: Expr): ArrayContains; +export function arrayContains(array: Expr, element: Expr): FunctionExpr; /** * @beta @@ -4187,14 +4355,14 @@ export function arrayContains(array: Expr, element: Expr): ArrayContains; * * ```typescript * // Check if the 'colors' array contains "red" - * arrayContains(Field.of("colors"), "red"); + * arrayContains(field("colors"), "red"); * ``` * * @param array The array expression to check. * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: Expr, element: any): ArrayContains; +export function arrayContains(array: Expr, element: unknown): FunctionExpr; /** * @beta @@ -4203,14 +4371,14 @@ export function arrayContains(array: Expr, element: any): ArrayContains; * * ```typescript * // Check if the 'colors' array contains the value of field 'selectedColor' - * arrayContains("colors", Field.of("selectedColor")); + * arrayContains("colors", field("selectedColor")); * ``` * - * @param array The field name to check. + * @param fieldName The field name to check. * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: string, element: Expr): ArrayContains; +export function arrayContains(fieldName: string, element: Expr): FunctionExpr; /** * @beta @@ -4222,18 +4390,18 @@ export function arrayContains(array: string, element: Expr): ArrayContains; * arrayContains("colors", "red"); * ``` * - * @param array The field name to check. + * @param fieldName The field name to check. * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: string, element: any): ArrayContains; +export function arrayContains(fieldName: string, element: unknown): BooleanExpr; export function arrayContains( array: Expr | string, - element: any -): ArrayContains { - const arrayExpr = array instanceof Expr ? array : Field.of(array); - const elementExpr = element instanceof Expr ? element : Constant.of(element); - return new ArrayContains(arrayExpr, elementExpr); + element: unknown +): BooleanExpr { + const arrayExpr = fieldOrExpression(array); + const elementExpr = valueToDefaultExpr(element); + return arrayExpr.arrayContains(elementExpr); } /** @@ -4244,52 +4412,55 @@ export function arrayContains( * * ```typescript * // Check if the 'categories' array contains either values from field "cate1" or "Science" - * arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + * arrayContainsAny(field("categories"), [field("cate1"), "Science"]); * ``` * * @param array The array expression to check. * @param values The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny(array: Expr, values: Expr[]): ArrayContainsAny; +export function arrayContainsAny( + array: Expr, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if an array expression contains any of the specified + * Creates an expression that checks if a field's array value contains any of the specified * elements. * * ```typescript - * // Check if the 'categories' array contains either values from field "cate1" or "Science" - * arrayContainsAny(Field.of("categories"), [Field.of("cate1"), "Science"]); + * // Check if the 'groups' array contains either the value from the 'userGroup' field + * // or the value "guest" + * arrayContainsAny("categories", [field("cate1"), "Science"]); * ``` * - * @param array The array expression to check. + * @param fieldName The field name to check. * @param values The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny(array: Expr, values: any[]): ArrayContainsAny; +export function arrayContainsAny( + fieldName: string, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if a field's array value contains any of the specified + * Creates an expression that checks if an array expression contains any of the specified * elements. * * ```typescript - * // Check if the 'groups' array contains either the value from the 'userGroup' field - * // or the value "guest" - * arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + * // Check if the 'categories' array contains either values from field "cate1" or "Science" + * arrayContainsAny(field("categories"), array([field("cate1"), "Science"])); * ``` * - * @param array The field name to check. - * @param values The elements to check for in the array. + * @param array The array expression to check. + * @param values An expression that evaluates to an array, whose elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny( - array: string, - values: Expr[] -): ArrayContainsAny; +export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; /** * @beta @@ -4300,26 +4471,20 @@ export function arrayContainsAny( * ```typescript * // Check if the 'groups' array contains either the value from the 'userGroup' field * // or the value "guest" - * arrayContainsAny("categories", [Field.of("cate1"), "Science"]); + * arrayContainsAny("categories", array([field("cate1"), "Science"])); * ``` * - * @param array The field name to check. - * @param values The elements to check for in the array. + * @param fieldName The field name to check. + * @param values An expression that evaluates to an array, whose elements to check for in the array field. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny( - array: string, - values: any[] -): ArrayContainsAny; +export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; export function arrayContainsAny( array: Expr | string, - values: any[] -): ArrayContainsAny { - const arrayExpr = array instanceof Expr ? array : Field.of(array); - const exprValues = values.map(value => - value instanceof Expr ? value : Constant.of(value) - ); - return new ArrayContainsAny(arrayExpr, exprValues); + values: unknown[] | Expr +): BooleanExpr { + // @ts-ignore implementation accepts both types + return fieldOrExpression(array).arrayContainsAny(values); } /** @@ -4329,50 +4494,56 @@ export function arrayContainsAny( * * ```typescript * // Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1" - * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), Constant.of("SciFi"), Constant.of("Adventure")]); + * arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]); * ``` * * @param array The array expression to check. * @param values The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ -export function arrayContainsAll(array: Expr, values: Expr[]): ArrayContainsAll; +export function arrayContainsAll( + array: Expr, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if an array expression contains all the specified elements. + * Creates an expression that checks if a field's array value contains all the specified values or + * expressions. * * ```typescript - * // Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1" - * arrayContainsAll(Field.of("tags"), [Field.of("tag1"), "SciFi", "Adventure"]); + * // Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure" + * arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]); * ``` * - * @param array The array expression to check. + * @param fieldName The field name to check. * @param values The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ -export function arrayContainsAll(array: Expr, values: any[]): ArrayContainsAll; +export function arrayContainsAll( + fieldName: string, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if a field's array value contains all the specified values or - * expressions. + * Creates an expression that checks if an array expression contains all the specified elements. * * ```typescript - * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" - * arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + * // Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1" + * arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]); * ``` * - * @param array The field name to check. - * @param values The elements to check for in the array. + * @param array The array expression to check. + * @param arrayExpression The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ export function arrayContainsAll( - array: string, - values: Expr[] -): ArrayContainsAll; + array: Expr, + arrayExpression: Expr +): BooleanExpr; /** * @beta @@ -4381,29 +4552,41 @@ export function arrayContainsAll( * expressions. * * ```typescript - * // Check if the 'tags' array contains both of the values from field 'tag1' and "tag2" - * arrayContainsAll("tags", [Field.of("tag1"), "SciFi", "Adventure"]); + * // Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure" + * arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]); * ``` * - * @param array The field name to check. - * @param values The elements to check for in the array. + * @param fieldName The field name to check. + * @param arrayExpression The elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ export function arrayContainsAll( - array: string, - values: any[] -): ArrayContainsAll; + fieldName: string, + arrayExpression: Expr +): BooleanExpr; export function arrayContainsAll( array: Expr | string, - values: any[] -): ArrayContainsAll { - const arrayExpr = array instanceof Expr ? array : Field.of(array); - const exprValues = values.map(value => - value instanceof Expr ? value : Constant.of(value) - ); - return new ArrayContainsAll(arrayExpr, exprValues); + values: unknown[] | Expr +): BooleanExpr { + // @ts-ignore implementation accepts both types + return fieldOrExpression(array).arrayContainsAll(values); } +/** + * @beta + * + * Creates an expression that calculates the length of an array in a specified field. + * + * ```typescript + * // Get the number of items in field 'cart' + * arrayLength('cart'); + * ``` + * + * @param fieldName The name of the field containing an array to calculate the length of. + * @return A new {@code Expr} representing the length of the array. + */ +export function arrayLength(fieldName: string): FunctionExpr; + /** * @beta * @@ -4411,49 +4594,52 @@ export function arrayContainsAll( * * ```typescript * // Get the number of items in the 'cart' array - * arrayLength(Field.of("cart")); + * arrayLength(field("cart")); * ``` * * @param array The array expression to calculate the length of. * @return A new {@code Expr} representing the length of the array. */ -export function arrayLength(array: Expr): ArrayLength { - return new ArrayLength(array); +export function arrayLength(array: Expr): FunctionExpr; +export function arrayLength(array: Expr | string): FunctionExpr { + return fieldOrExpression(array).arrayLength(); } /** * @beta * - * Creates an expression that checks if an expression is equal to any of the provided values or + * Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or * expressions. * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny(Field.of("category"), [Constant.of("Electronics"), Field.of("primaryType")]); + * eqAny(field("category"), [constant("Electronics"), field("primaryType")]); * ``` * - * @param element The expression to compare. - * @param others The values to check against. + * @param expression The expression whose results to compare. + * @param values The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(element: Expr, others: Expr[]): EqAny; +export function eqAny( + expression: Expr, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if an expression is equal to any of the provided values or - * expressions. + * Creates an expression that checks if an expression is equal to any of the provided values. * * ```typescript - * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny(Field.of("category"), ["Electronics", Field.of("primaryType")]); + * // Check if the 'category' field is set to a value in the disabledCategories field + * eqAny(field("category"), field('disabledCategories')); * ``` * - * @param element The expression to compare. - * @param others The values to check against. + * @param expression The expression whose results to compare. + * @param arrayExpression An expression that evaluates to an array, whose elements to check for equality to the input. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(element: Expr, others: any[]): EqAny; +export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; /** * @beta @@ -4463,14 +4649,17 @@ export function eqAny(element: Expr, others: any[]): EqAny; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny("category", [Constant.of("Electronics"), Field.of("primaryType")]); + * eqAny("category", [constant("Electronics"), field("primaryType")]); * ``` * - * @param element The field to compare. - * @param others The values to check against. + * @param fieldName The field to compare. + * @param values The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(element: string, others: Expr[]): EqAny; +export function eqAny( + fieldName: string, + values: Array +): BooleanExpr; /** * @beta @@ -4480,20 +4669,20 @@ export function eqAny(element: string, others: Expr[]): EqAny; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny("category", ["Electronics", Field.of("primaryType")]); + * eqAny("category", ["Electronics", field("primaryType")]); * ``` * - * @param element The field to compare. - * @param others The values to check against. + * @param fieldName The field to compare. + * @param arrayExpression An expression that evaluates to an array, whose elements to check for equality to the input field. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(element: string, others: any[]): EqAny; -export function eqAny(element: Expr | string, others: any[]): EqAny { - const elementExpr = element instanceof Expr ? element : Field.of(element); - const exprOthers = others.map(other => - other instanceof Expr ? other : Constant.of(other) - ); - return new EqAny(elementExpr, exprOthers); +export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function eqAny( + element: Expr | string, + values: unknown[] | Expr +): BooleanExpr { + // @ts-ignore implementation accepts both types + return fieldOrExpression(element).eqAny(values); } /** @@ -4504,78 +4693,83 @@ export function eqAny(element: Expr | string, others: any[]): EqAny { * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny(Field.of("status"), [Constant.of("pending"), Field.of("rejectedStatus")]); + * notEqAny(field("status"), ["pending", field("rejectedStatus")]); * ``` * * @param element The expression to compare. - * @param others The values to check against. + * @param values The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(element: Expr, others: Expr[]): NotEqAny; +export function notEqAny( + element: Expr, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if an expression is not equal to any of the provided values + * Creates an expression that checks if a field's value is not equal to any of the provided values * or expressions. * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny(Field.of("status"), ["pending", Field.of("rejectedStatus")]); + * notEqAny("status", [constant("pending"), field("rejectedStatus")]); * ``` * - * @param element The expression to compare. - * @param others The values to check against. + * @param fieldName The field name to compare. + * @param values The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(element: Expr, others: any[]): NotEqAny; +export function notEqAny( + fieldName: string, + values: Array +): BooleanExpr; /** * @beta * - * Creates an expression that checks if a field's value is not equal to any of the provided values + * Creates an expression that checks if an expression is not equal to any of the provided values * or expressions. * * ```typescript - * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny("status", [Constant.of("pending"), Field.of("rejectedStatus")]); + * // Check if the 'status' field is neither "pending" nor the value of the field 'rejectedStatus' + * notEqAny(field("status"), ["pending", field("rejectedStatus")]); * ``` * - * @param element The field name to compare. - * @param others The values to check against. + * @param element The expression to compare. + * @param arrayExpression The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(element: string, others: Expr[]): NotEqAny; +export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; /** * @beta * - * Creates an expression that checks if a field's value is not equal to any of the provided values - * or expressions. + * Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression. * * ```typescript - * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny("status", ["pending", Field.of("rejectedStatus")]); + * // Check if the 'status' field is not equal to any value in the field 'rejectedStatuses' + * notEqAny("status", field("rejectedStatuses")); * ``` * - * @param element The field name to compare. - * @param others The values to check against. + * @param fieldName The field name to compare. + * @param arrayExpression The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(element: string, others: any[]): NotEqAny; -export function notEqAny(element: Expr | string, others: any[]): NotEqAny { - const elementExpr = element instanceof Expr ? element : Field.of(element); - const exprOthers = others.map(other => - other instanceof Expr ? other : Constant.of(other) - ); - return new NotEqAny(elementExpr, exprOthers); +export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; + +export function notEqAny( + element: Expr | string, + values: unknown[] | Expr +): BooleanExpr { + // @ts-ignore implementation accepts both types + return fieldOrExpression(element).notEqAny(values); } /** * @beta * - * Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple filter - * conditions. + * Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions. * * ```typescript * // Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", @@ -4586,12 +4780,17 @@ export function notEqAny(element: Expr | string, others: any[]): NotEqAny { * eq("status", "active")); * ``` * - * @param left The first filter condition. - * @param right Additional filter conditions to 'XOR' together. + * @param first The first condition. + * @param second The second condition. + * @param additionalConditions Additional conditions to 'XOR' together. * @return A new {@code Expr} representing the logical 'XOR' operation. */ -export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor { - return new Xor([left, ...right]); +export function xor( + first: BooleanExpr, + second: BooleanExpr, + ...additionalConditions: BooleanExpr[] +): BooleanExpr { + return new BooleanExpr('xor', [first, second, ...additionalConditions]); } /** @@ -4603,7 +4802,7 @@ export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor { * ```typescript * // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". * cond( - * gt("age", 18), Constant.of("Adult"), Constant.of("Minor")); + * gt("age", 18), constant("Adult"), constant("Minor")); * ``` * * @param condition The condition to evaluate. @@ -4612,11 +4811,11 @@ export function xor(left: FilterCondition, ...right: FilterCondition[]): Xor { * @return A new {@code Expr} representing the conditional expression. */ export function cond( - condition: FilterCondition, + condition: BooleanExpr, thenExpr: Expr, elseExpr: Expr -): Cond { - return new Cond(condition, thenExpr, elseExpr); +): FunctionExpr { + return new FunctionExpr('cond', [condition, thenExpr, elseExpr]); } /** @@ -4629,155 +4828,126 @@ export function cond( * not(eq("completed", true)); * ``` * - * @param filter The filter condition to negate. + * @param booleanExpr The filter condition to negate. * @return A new {@code Expr} representing the negated filter condition. */ -export function not(filter: FilterCondition): Not { - return new Not(filter); +export function not(booleanExpr: BooleanExpr): BooleanExpr { + return booleanExpr.not(); } /** * @beta * - * Creates an expression that returns the larger value between two expressions, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the larger value between the 'field1' field and the 'field2' field. - * logicalMaximum(Field.of("field1"), Field.of("field2")); - * ``` - * - * @param left The left operand expression. - * @param right The right operand expression. - * @return A new {@code Expr} representing the logical max operation. - */ -export function logicalMaximum(left: Expr, right: Expr): LogicalMaximum; - -/** - * @beta - * - * Creates an expression that returns the larger value between an expression and a constant value, based on Firestore's value type ordering. + * Creates an expression that returns the largest value between multiple input + * expressions or literal values. Based on Firestore's value type ordering. * * ```typescript - * // Returns the larger value between the 'value' field and 10. - * logicalMaximum(Field.of("value"), 10); + * // Returns the largest value between the 'field1' field, the 'field2' field, + * // and 1000 + * logicalMaximum(field("field1"), field("field2"), 1000); * ``` * - * @param left The left operand expression. - * @param right The right operand constant. + * @param first The first operand expression. + * @param second The second expression or literal. + * @param others Optional additional expressions or literals. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMaximum(left: Expr, right: any): LogicalMaximum; +export function logicalMaximum( + first: Expr, + second: Expr | unknown, + ...others: Array +): FunctionExpr; /** * @beta * - * Creates an expression that returns the larger value between a field and an expression, based on Firestore's value type ordering. + * Creates an expression that returns the largest value between multiple input + * expressions or literal values. Based on Firestore's value type ordering. * * ```typescript - * // Returns the larger value between the 'field1' field and the 'field2' field. - * logicalMaximum("field1", Field.of('field2')); + * // Returns the largest value between the 'field1' field, the 'field2' field, + * // and 1000. + * logicalMaximum("field1", field("field2"), 1000); * ``` * - * @param left The left operand field name. - * @param right The right operand expression. + * @param fieldName The first operand field name. + * @param second The second expression or literal. + * @param others Optional additional expressions or literals. * @return A new {@code Expr} representing the logical max operation. */ -export function logicalMaximum(left: string, right: Expr): LogicalMaximum; +export function logicalMaximum( + fieldName: string, + second: Expr | unknown, + ...others: Array +): FunctionExpr; -/** - * @beta - * - * Creates an expression that returns the larger value between a field and a constant value, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the larger value between the 'value' field and 10. - * logicalMaximum("value", 10); - * ``` - * - * @param left The left operand field name. - * @param right The right operand constant. - * @return A new {@code Expr} representing the logical max operation. - */ -export function logicalMaximum(left: string, right: any): LogicalMaximum; export function logicalMaximum( - left: Expr | string, - right: Expr | any -): LogicalMaximum { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new LogicalMaximum(normalizedLeft, normalizedRight); + first: Expr | string, + second: Expr | unknown, + ...others: Array +): FunctionExpr { + return fieldOrExpression(first).logicalMaximum( + valueToDefaultExpr(second), + ...others.map(value => valueToDefaultExpr(value)) + ); } /** * @beta * - * Creates an expression that returns the smaller value between two expressions, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the smaller value between the 'field1' field and the 'field2' field. - * logicalMinimum(Field.of("field1"), Field.of("field2")); - * ``` - * - * @param left The left operand expression. - * @param right The right operand expression. - * @return A new {@code Expr} representing the logical min operation. - */ -export function logicalMinimum(left: Expr, right: Expr): LogicalMinimum; - -/** - * @beta - * - * Creates an expression that returns the smaller value between an expression and a constant value, based on Firestore's value type ordering. + * Creates an expression that returns the smallest value between multiple input + * expressions and literal values. Based on Firestore's value type ordering. * * ```typescript - * // Returns the smaller value between the 'value' field and 10. - * logicalMinimum(Field.of("value"), 10); + * // Returns the smallest value between the 'field1' field, the 'field2' field, + * // and 1000. + * logicalMinimum(field("field1"), field("field2"), 1000); * ``` * - * @param left The left operand expression. - * @param right The right operand constant. + * @param first The first operand expression. + * @param second The second expression or literal. + * @param others Optional additional expressions or literals. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMinimum(left: Expr, right: any): LogicalMinimum; +export function logicalMinimum( + first: Expr, + second: Expr | unknown, + ...others: Array +): FunctionExpr; /** * @beta * - * Creates an expression that returns the smaller value between a field and an expression, based on Firestore's value type ordering. + * Creates an expression that returns the smallest value between a field's value + * and other input expressions or literal values. + * Based on Firestore's value type ordering. * * ```typescript - * // Returns the smaller value between the 'field1' field and the 'field2' field. - * logicalMinimum("field1", Field.of("field2")); + * // Returns the smallest value between the 'field1' field, the 'field2' field, + * // and 1000. + * logicalMinimum("field1", field("field2"), 1000); * ``` * - * @param left The left operand field name. - * @param right The right operand expression. + * @param fieldName The first operand field name. + * @param second The second expression or literal. + * @param others Optional additional expressions or literals. * @return A new {@code Expr} representing the logical min operation. */ -export function logicalMinimum(left: string, right: Expr): LogicalMinimum; +export function logicalMinimum( + fieldName: string, + second: Expr | unknown, + ...others: Array +): FunctionExpr; -/** - * @beta - * - * Creates an expression that returns the smaller value between a field and a constant value, based on Firestore's value type ordering. - * - * ```typescript - * // Returns the smaller value between the 'value' field and 10. - * logicalMinimum("value", 10); - * ``` - * - * @param left The left operand field name. - * @param right The right operand constant. - * @return A new {@code Expr} representing the logical min operation. - */ -export function logicalMinimum(left: string, right: any): LogicalMinimum; export function logicalMinimum( - left: Expr | string, - right: Expr | any -): LogicalMinimum { - const normalizedLeft = typeof left === 'string' ? Field.of(left) : left; - const normalizedRight = right instanceof Expr ? right : Constant.of(right); - return new LogicalMinimum(normalizedLeft, normalizedRight); + first: Expr | string, + second: Expr | unknown, + ...others: Array +): FunctionExpr { + return fieldOrExpression(first).logicalMinimum( + valueToDefaultExpr(second), + ...others.map(value => valueToDefaultExpr(value)) + ); } /** @@ -4787,13 +4957,13 @@ export function logicalMinimum( * * ```typescript * // Check if the document has a field named "phoneNumber" - * exists(Field.of("phoneNumber")); + * exists(field("phoneNumber")); * ``` * * @param value An expression evaluates to the name of the field to check. * @return A new {@code Expr} representing the 'exists' check. */ -export function exists(value: Expr): Exists; +export function exists(value: Expr): BooleanExpr; /** * @beta @@ -4805,14 +4975,12 @@ export function exists(value: Expr): Exists; * exists("phoneNumber"); * ``` * - * @param field The field name to check. + * @param fieldName The field name to check. * @return A new {@code Expr} representing the 'exists' check. */ -export function exists(field: string): Exists; -export function exists(valueOrField: Expr | string): Exists { - const valueExpr = - valueOrField instanceof Expr ? valueOrField : Field.of(valueOrField); - return new Exists(valueExpr); +export function exists(fieldName: string): BooleanExpr; +export function exists(valueOrField: Expr | string): BooleanExpr { + return fieldOrExpression(valueOrField).exists(); } /** @@ -4822,13 +4990,13 @@ export function exists(valueOrField: Expr | string): Exists { * * ```typescript * // Check if the result of a calculation is NaN - * isNaN(Field.of("value").divide(0)); + * isNaN(field("value").divide(0)); * ``` * * @param value The expression to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNan(value: Expr): IsNan; +export function isNan(value: Expr): BooleanExpr; /** * @beta @@ -4840,13 +5008,12 @@ export function isNan(value: Expr): IsNan; * isNaN("value"); * ``` * - * @param value The name of the field to check. + * @param fieldName The name of the field to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNan(value: string): IsNan; -export function isNan(value: Expr | string): IsNan { - const valueExpr = value instanceof Expr ? value : Field.of(value); - return new IsNan(valueExpr); +export function isNan(fieldName: string): BooleanExpr; +export function isNan(value: Expr | string): BooleanExpr { + return fieldOrExpression(value).isNan(); } /** @@ -4856,18 +5023,18 @@ export function isNan(value: Expr | string): IsNan { * * ```typescript * // Reverse the value of the 'myString' field. - * reverse(Field.of("myString")); + * reverse(field("myString")); * ``` * - * @param expr The expression representing the string to reverse. + * @param stringExpression An expression evaluating to a string value, which will be reversed. * @return A new {@code Expr} representing the reversed string. */ -export function reverse(expr: Expr): Reverse; +export function reverse(stringExpression: Expr): FunctionExpr; /** * @beta * - * Creates an expression that reverses a string represented by a field. + * Creates an expression that reverses a string value in the specified field. * * ```typescript * // Reverse the value of the 'myString' field. @@ -4877,10 +5044,9 @@ export function reverse(expr: Expr): Reverse; * @param field The name of the field representing the string to reverse. * @return A new {@code Expr} representing the reversed string. */ -export function reverse(field: string): Reverse; -export function reverse(expr: Expr | string): Reverse { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new Reverse(normalizedExpr); +export function reverse(field: string): FunctionExpr; +export function reverse(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).reverse(); } /** @@ -4890,7 +5056,7 @@ export function reverse(expr: Expr | string): Reverse { * * ```typescript * // Replace the first occurrence of "hello" with "hi" in the 'message' field. - * replaceFirst(Field.of("message"), "hello", "hi"); + * replaceFirst(field("message"), "hello", "hi"); * ``` * * @param value The expression representing the string to perform the replacement on. @@ -4902,7 +5068,7 @@ export function replaceFirst( value: Expr, find: string, replace: string -): ReplaceFirst; +): FunctionExpr; /** * @beta @@ -4912,7 +5078,7 @@ export function replaceFirst( * * ```typescript * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. - * replaceFirst(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + * replaceFirst(field("message"), field("findField"), field("replaceField")); * ``` * * @param value The expression representing the string to perform the replacement on. @@ -4924,7 +5090,7 @@ export function replaceFirst( value: Expr, find: Expr, replace: Expr -): ReplaceFirst; +): FunctionExpr; /** * @beta @@ -4936,26 +5102,25 @@ export function replaceFirst( * replaceFirst("message", "hello", "hi"); * ``` * - * @param field The name of the field representing the string to perform the replacement on. + * @param fieldName The name of the field representing the string to perform the replacement on. * @param find The substring to search for. * @param replace The substring to replace the first occurrence of 'find' with. * @return A new {@code Expr} representing the string with the first occurrence replaced. */ export function replaceFirst( - field: string, + fieldName: string, find: string, replace: string -): ReplaceFirst; +): FunctionExpr; export function replaceFirst( value: Expr | string, find: Expr | string, replace: Expr | string -): ReplaceFirst { - const normalizedValue = typeof value === 'string' ? Field.of(value) : value; - const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; - const normalizedReplace = - typeof replace === 'string' ? Constant.of(replace) : replace; - return new ReplaceFirst(normalizedValue, normalizedFind, normalizedReplace); +): FunctionExpr { + const normalizedValue = fieldOrExpression(value); + const normalizedFind = valueToDefaultExpr(find); + const normalizedReplace = valueToDefaultExpr(replace); + return normalizedValue.replaceFirst(normalizedFind, normalizedReplace); } /** @@ -4965,7 +5130,7 @@ export function replaceFirst( * * ```typescript * // Replace all occurrences of "hello" with "hi" in the 'message' field. - * replaceAll(Field.of("message"), "hello", "hi"); + * replaceAll(field("message"), "hello", "hi"); * ``` * * @param value The expression representing the string to perform the replacement on. @@ -4977,7 +5142,7 @@ export function replaceAll( value: Expr, find: string, replace: string -): ReplaceAll; +): FunctionExpr; /** * @beta @@ -4987,7 +5152,7 @@ export function replaceAll( * * ```typescript * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. - * replaceAll(Field.of("message"), Field.of("findField"), Field.of("replaceField")); + * replaceAll(field("message"), field("findField"), field("replaceField")); * ``` * * @param value The expression representing the string to perform the replacement on. @@ -4995,7 +5160,11 @@ export function replaceAll( * @param replace The expression representing the substring to replace all occurrences of 'find' with. * @return A new {@code Expr} representing the string with all occurrences replaced. */ -export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; +export function replaceAll( + value: Expr, + find: Expr, + replace: Expr +): FunctionExpr; /** * @beta @@ -5007,26 +5176,25 @@ export function replaceAll(value: Expr, find: Expr, replace: Expr): ReplaceAll; * replaceAll("message", "hello", "hi"); * ``` * - * @param field The name of the field representing the string to perform the replacement on. + * @param fieldName The name of the field representing the string to perform the replacement on. * @param find The substring to search for. * @param replace The substring to replace all occurrences of 'find' with. * @return A new {@code Expr} representing the string with all occurrences replaced. */ export function replaceAll( - field: string, + fieldName: string, find: string, replace: string -): ReplaceAll; +): FunctionExpr; export function replaceAll( value: Expr | string, find: Expr | string, replace: Expr | string -): ReplaceAll { - const normalizedValue = typeof value === 'string' ? Field.of(value) : value; - const normalizedFind = typeof find === 'string' ? Constant.of(find) : find; - const normalizedReplace = - typeof replace === 'string' ? Constant.of(replace) : replace; - return new ReplaceAll(normalizedValue, normalizedFind, normalizedReplace); +): FunctionExpr { + const normalizedValue = fieldOrExpression(value); + const normalizedFind = valueToDefaultExpr(find); + const normalizedReplace = valueToDefaultExpr(replace); + return normalizedValue.replaceAll(normalizedFind, normalizedReplace); } /** @@ -5036,13 +5204,13 @@ export function replaceAll( * * ```typescript * // Calculate the length of the 'myString' field in bytes. - * byteLength(Field.of("myString")); + * byteLength(field("myString")); * ``` * * @param expr The expression representing the string. * @return A new {@code Expr} representing the length of the string in bytes. */ -export function byteLength(expr: Expr): ByteLength; +export function byteLength(expr: Expr): FunctionExpr; /** * @beta @@ -5054,13 +5222,13 @@ export function byteLength(expr: Expr): ByteLength; * byteLength("myString"); * ``` * - * @param field The name of the field representing the string. + * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the length of the string in bytes. */ -export function byteLength(field: string): ByteLength; -export function byteLength(expr: Expr | string): ByteLength { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new ByteLength(normalizedExpr); +export function byteLength(fieldName: string): FunctionExpr; +export function byteLength(expr: Expr | string): FunctionExpr { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.byteLength(); } /** @@ -5073,10 +5241,10 @@ export function byteLength(expr: Expr | string): ByteLength { * strLength("name"); * ``` * - * @param field The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the length of the string. */ -export function charLength(field: string): CharLength; +export function charLength(fieldName: string): FunctionExpr; /** * @beta @@ -5085,16 +5253,16 @@ export function charLength(field: string): CharLength; * * ```typescript * // Get the character length of the 'name' field in UTF-8. - * strLength(Field.of("name")); + * strLength(field("name")); * ``` * - * @param expr The expression representing the string to calculate the length of. + * @param stringExpression The expression representing the string to calculate the length of. * @return A new {@code Expr} representing the length of the string. */ -export function charLength(expr: Expr): CharLength; -export function charLength(value: Expr | string): CharLength { - const valueExpr = value instanceof Expr ? value : Field.of(value); - return new CharLength(valueExpr); +export function charLength(stringExpression: Expr): FunctionExpr; +export function charLength(value: Expr | string): FunctionExpr { + const valueExpr = fieldOrExpression(value); + return valueExpr.charLength(); } /** @@ -5108,11 +5276,11 @@ export function charLength(value: Expr | string): CharLength { * like("title", "%guide%"); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(left: string, pattern: string): Like; +export function like(fieldName: string, pattern: string): BooleanExpr; /** * @beta @@ -5122,14 +5290,14 @@ export function like(left: string, pattern: string): Like; * * ```typescript * // Check if the 'title' field contains the string "guide" - * like("title", Field.of("pattern")); + * like("title", field("pattern")); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(left: string, pattern: Expr): Like; +export function like(fieldName: string, pattern: Expr): BooleanExpr; /** * @beta @@ -5138,14 +5306,14 @@ export function like(left: string, pattern: Expr): Like; * * ```typescript * // Check if the 'title' field contains the string "guide" - * like(Field.of("title"), "%guide%"); + * like(field("title"), "%guide%"); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(left: Expr, pattern: string): Like; +export function like(stringExpression: Expr, pattern: string): BooleanExpr; /** * @beta @@ -5154,18 +5322,21 @@ export function like(left: Expr, pattern: string): Like; * * ```typescript * // Check if the 'title' field contains the string "guide" - * like(Field.of("title"), Field.of("pattern")); + * like(field("title"), field("pattern")); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(left: Expr, pattern: Expr): Like; -export function like(left: Expr | string, pattern: Expr | string): Like { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); - return new Like(leftExpr, patternExpr); +export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; +export function like( + left: Expr | string, + pattern: Expr | string +): FunctionExpr { + const leftExpr = fieldOrExpression(left); + const patternExpr = valueToDefaultExpr(pattern); + return leftExpr.like(patternExpr); } /** @@ -5179,11 +5350,11 @@ export function like(left: Expr | string, pattern: Expr | string): Like { * regexContains("description", "(?i)example"); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(left: string, pattern: string): RegexContains; +export function regexContains(fieldName: string, pattern: string): BooleanExpr; /** * @beta @@ -5193,14 +5364,14 @@ export function regexContains(left: string, pattern: string): RegexContains; * * ```typescript * // Check if the 'description' field contains "example" (case-insensitive) - * regexContains("description", Field.of("pattern")); + * regexContains("description", field("pattern")); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(left: string, pattern: Expr): RegexContains; +export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; /** * @beta @@ -5210,14 +5381,17 @@ export function regexContains(left: string, pattern: Expr): RegexContains; * * ```typescript * // Check if the 'description' field contains "example" (case-insensitive) - * regexContains(Field.of("description"), "(?i)example"); + * regexContains(field("description"), "(?i)example"); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(left: Expr, pattern: string): RegexContains; +export function regexContains( + stringExpression: Expr, + pattern: string +): BooleanExpr; /** * @beta @@ -5227,21 +5401,24 @@ export function regexContains(left: Expr, pattern: string): RegexContains; * * ```typescript * // Check if the 'description' field contains "example" (case-insensitive) - * regexContains(Field.of("description"), Field.of("pattern")); + * regexContains(field("description"), field("pattern")); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(left: Expr, pattern: Expr): RegexContains; +export function regexContains( + stringExpression: Expr, + pattern: Expr +): BooleanExpr; export function regexContains( left: Expr | string, pattern: Expr | string -): RegexContains { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); - return new RegexContains(leftExpr, patternExpr); +): BooleanExpr { + const leftExpr = fieldOrExpression(left); + const patternExpr = valueToDefaultExpr(pattern); + return leftExpr.regexContains(patternExpr); } /** @@ -5254,11 +5431,11 @@ export function regexContains( * regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(left: string, pattern: string): RegexMatch; +export function regexMatch(fieldName: string, pattern: string): BooleanExpr; /** * @beta @@ -5267,14 +5444,14 @@ export function regexMatch(left: string, pattern: string): RegexMatch; * * ```typescript * // Check if the 'email' field matches a valid email pattern - * regexMatch("email", Field.of("pattern")); + * regexMatch("email", field("pattern")); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(left: string, pattern: Expr): RegexMatch; +export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; /** * @beta @@ -5284,14 +5461,17 @@ export function regexMatch(left: string, pattern: Expr): RegexMatch; * * ```typescript * // Check if the 'email' field matches a valid email pattern - * regexMatch(Field.of("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); + * regexMatch(field("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); * ``` * - * @param left The expression representing the string to match against. + * @param stringExpression The expression representing the string to match against. * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(left: Expr, pattern: string): RegexMatch; +export function regexMatch( + stringExpression: Expr, + pattern: string +): BooleanExpr; /** * @beta @@ -5301,21 +5481,21 @@ export function regexMatch(left: Expr, pattern: string): RegexMatch; * * ```typescript * // Check if the 'email' field matches a valid email pattern - * regexMatch(Field.of("email"), Field.of("pattern")); + * regexMatch(field("email"), field("pattern")); * ``` * - * @param left The expression representing the string to match against. + * @param stringExpression The expression representing the string to match against. * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(left: Expr, pattern: Expr): RegexMatch; +export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; export function regexMatch( left: Expr | string, pattern: Expr | string -): RegexMatch { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const patternExpr = pattern instanceof Expr ? pattern : Constant.of(pattern); - return new RegexMatch(leftExpr, patternExpr); +): BooleanExpr { + const leftExpr = fieldOrExpression(left); + const patternExpr = valueToDefaultExpr(pattern); + return leftExpr.regexMatch(patternExpr); } /** @@ -5328,11 +5508,11 @@ export function regexMatch( * strContains("description", "example"); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param substring The substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(left: string, substring: string): StrContains; +export function strContains(fieldName: string, substring: string): BooleanExpr; /** * @beta @@ -5341,14 +5521,14 @@ export function strContains(left: string, substring: string): StrContains; * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * strContains("description", Field.of("keyword")); + * strContains("description", field("keyword")); * ``` * - * @param left The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @param substring The expression representing the substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(left: string, substring: Expr): StrContains; +export function strContains(fieldName: string, substring: Expr): BooleanExpr; /** * @beta @@ -5357,14 +5537,17 @@ export function strContains(left: string, substring: Expr): StrContains; * * ```typescript * // Check if the 'description' field contains "example". - * strContains(Field.of("description"), "example"); + * strContains(field("description"), "example"); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param substring The substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(left: Expr, substring: string): StrContains; +export function strContains( + stringExpression: Expr, + substring: string +): BooleanExpr; /** * @beta @@ -5373,22 +5556,24 @@ export function strContains(left: Expr, substring: string): StrContains; * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * strContains(Field.of("description"), Field.of("keyword")); + * strContains(field("description"), field("keyword")); * ``` * - * @param left The expression representing the string to perform the comparison on. + * @param stringExpression The expression representing the string to perform the comparison on. * @param substring The expression representing the substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(left: Expr, substring: Expr): StrContains; +export function strContains( + stringExpression: Expr, + substring: Expr +): BooleanExpr; export function strContains( left: Expr | string, substring: Expr | string -): StrContains { - const leftExpr = left instanceof Expr ? left : Field.of(left); - const substringExpr = - substring instanceof Expr ? substring : Constant.of(substring); - return new StrContains(leftExpr, substringExpr); +): BooleanExpr { + const leftExpr = fieldOrExpression(left); + const substringExpr = valueToDefaultExpr(substring); + return leftExpr.strContains(substringExpr); } /** @@ -5401,11 +5586,11 @@ export function strContains( * startsWith("name", "Mr."); * ``` * - * @param expr The field name to check. + * @param fieldName The field name to check. * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(expr: string, prefix: string): StartsWith; +export function startsWith(fieldName: string, prefix: string): BooleanExpr; /** * @beta @@ -5414,14 +5599,14 @@ export function startsWith(expr: string, prefix: string): StartsWith; * * ```typescript * // Check if the 'fullName' field starts with the value of the 'firstName' field - * startsWith("fullName", Field.of("firstName")); + * startsWith("fullName", field("firstName")); * ``` * - * @param expr The field name to check. + * @param fieldName The field name to check. * @param prefix The expression representing the prefix. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(expr: string, prefix: Expr): StartsWith; +export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; /** * @beta @@ -5430,14 +5615,14 @@ export function startsWith(expr: string, prefix: Expr): StartsWith; * * ```typescript * // Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." - * startsWith(Field.of("fullName"), "Mr."); + * startsWith(field("fullName"), "Mr."); * ``` * - * @param expr The expression to check. + * @param stringExpression The expression to check. * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(expr: Expr, prefix: string): StartsWith; +export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; /** * @beta @@ -5446,21 +5631,19 @@ export function startsWith(expr: Expr, prefix: string): StartsWith; * * ```typescript * // Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr." - * startsWith(Field.of("fullName"), Field.of("prefix")); + * startsWith(field("fullName"), field("prefix")); * ``` * - * @param expr The expression to check. + * @param stringExpression The expression to check. * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(expr: Expr, prefix: Expr): StartsWith; +export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; export function startsWith( expr: Expr | string, prefix: Expr | string -): StartsWith { - const exprLeft = expr instanceof Expr ? expr : Field.of(expr); - const prefixExpr = prefix instanceof Expr ? prefix : Constant.of(prefix); - return new StartsWith(exprLeft, prefixExpr); +): BooleanExpr { + return fieldOrExpression(expr).startsWith(valueToDefaultExpr(prefix)); } /** @@ -5473,11 +5656,11 @@ export function startsWith( * endsWith("filename", ".txt"); * ``` * - * @param expr The field name to check. + * @param fieldName The field name to check. * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(expr: string, suffix: string): EndsWith; +export function endsWith(fieldName: string, suffix: string): BooleanExpr; /** * @beta @@ -5486,14 +5669,14 @@ export function endsWith(expr: string, suffix: string): EndsWith; * * ```typescript * // Check if the 'url' field ends with the value of the 'extension' field - * endsWith("url", Field.of("extension")); + * endsWith("url", field("extension")); * ``` * - * @param expr The field name to check. + * @param fieldName The field name to check. * @param suffix The expression representing the postfix. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(expr: string, suffix: Expr): EndsWith; +export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; /** * @beta @@ -5502,14 +5685,14 @@ export function endsWith(expr: string, suffix: Expr): EndsWith; * * ```typescript * // Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." - * endsWith(Field.of("fullName"), "Jr."); + * endsWith(field("fullName"), "Jr."); * ``` * - * @param expr The expression to check. + * @param stringExpression The expression to check. * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(expr: Expr, suffix: string): EndsWith; +export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; /** * @beta @@ -5518,18 +5701,19 @@ export function endsWith(expr: Expr, suffix: string): EndsWith; * * ```typescript * // Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr." - * endsWith(Field.of("fullName"), Constant.of("Jr.")); + * endsWith(field("fullName"), constant("Jr.")); * ``` * - * @param expr The expression to check. + * @param stringExpression The expression to check. * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(expr: Expr, suffix: Expr): EndsWith; -export function endsWith(expr: Expr | string, suffix: Expr | string): EndsWith { - const exprLeft = expr instanceof Expr ? expr : Field.of(expr); - const suffixExpr = suffix instanceof Expr ? suffix : Constant.of(suffix); - return new EndsWith(exprLeft, suffixExpr); +export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; +export function endsWith( + expr: Expr | string, + suffix: Expr | string +): BooleanExpr { + return fieldOrExpression(expr).endsWith(valueToDefaultExpr(suffix)); } /** @@ -5542,10 +5726,10 @@ export function endsWith(expr: Expr | string, suffix: Expr | string): EndsWith { * toLower("name"); * ``` * - * @param expr The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the lowercase string. */ -export function toLower(expr: string): ToLower; +export function toLower(fieldName: string): FunctionExpr; /** * @beta @@ -5554,15 +5738,15 @@ export function toLower(expr: string): ToLower; * * ```typescript * // Convert the 'name' field to lowercase - * toLower(Field.of("name")); + * toLower(field("name")); * ``` * - * @param expr The expression representing the string to convert to lowercase. + * @param stringExpression The expression representing the string to convert to lowercase. * @return A new {@code Expr} representing the lowercase string. */ -export function toLower(expr: Expr): ToLower; -export function toLower(expr: Expr | string): ToLower { - return new ToLower(expr instanceof Expr ? expr : Field.of(expr)); +export function toLower(stringExpression: Expr): FunctionExpr; +export function toLower(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).toLower(); } /** @@ -5575,10 +5759,10 @@ export function toLower(expr: Expr | string): ToLower { * toUpper("title"); * ``` * - * @param expr The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the uppercase string. */ -export function toUpper(expr: string): ToUpper; +export function toUpper(fieldName: string): FunctionExpr; /** * @beta @@ -5587,15 +5771,15 @@ export function toUpper(expr: string): ToUpper; * * ```typescript * // Convert the 'title' field to uppercase - * toUppercase(Field.of("title")); + * toUppercase(field("title")); * ``` * - * @param expr The expression representing the string to convert to uppercase. + * @param stringExpression The expression representing the string to convert to uppercase. * @return A new {@code Expr} representing the uppercase string. */ -export function toUpper(expr: Expr): ToUpper; -export function toUpper(expr: Expr | string): ToUpper { - return new ToUpper(expr instanceof Expr ? expr : Field.of(expr)); +export function toUpper(stringExpression: Expr): FunctionExpr; +export function toUpper(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).toUpper(); } /** @@ -5608,10 +5792,10 @@ export function toUpper(expr: Expr | string): ToUpper { * trim("userInput"); * ``` * - * @param expr The name of the field containing the string. + * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the trimmed string. */ -export function trim(expr: string): Trim; +export function trim(fieldName: string): FunctionExpr; /** * @beta @@ -5620,15 +5804,15 @@ export function trim(expr: string): Trim; * * ```typescript * // Trim whitespace from the 'userInput' field - * trim(Field.of("userInput")); + * trim(field("userInput")); * ``` * - * @param expr The expression representing the string to trim. + * @param stringExpression The expression representing the string to trim. * @return A new {@code Expr} representing the trimmed string. */ -export function trim(expr: Expr): Trim; -export function trim(expr: Expr | string): Trim { - return new Trim(expr instanceof Expr ? expr : Field.of(expr)); +export function trim(stringExpression: Expr): FunctionExpr; +export function trim(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).trim(); } /** @@ -5638,17 +5822,19 @@ export function trim(expr: Expr | string): Trim { * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * strConcat("firstName", " ", Field.of("lastName")); + * strConcat("firstName", " ", field("lastName")); * ``` * - * @param first The field name containing the initial string value. - * @param elements The expressions (typically strings) to concatenate. + * @param fieldName The field name containing the initial string value. + * @param secondString An expression or string literal to concatenate. + * @param otherStrings Optional additional expressions or literals (typically strings) to concatenate. * @return A new {@code Expr} representing the concatenated string. */ export function strConcat( - first: string, - ...elements: Array -): StrConcat; + fieldName: string, + secondString: Expr | string, + ...otherStrings: Array +): FunctionExpr; /** * @beta @@ -5656,23 +5842,28 @@ export function strConcat( * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * strConcat(Field.of("firstName"), " ", Field.of("lastName")); + * strConcat(field("firstName"), " ", field("lastName")); * ``` * - * @param first The initial string expression to concatenate to. - * @param elements The expressions (typically strings) to concatenate. + * @param firstString The initial string expression to concatenate to. + * @param secondString An expression or string literal to concatenate. + * @param otherStrings Optional additional expressions or literals (typically strings) to concatenate. * @return A new {@code Expr} representing the concatenated string. */ export function strConcat( - first: Expr, - ...elements: Array -): StrConcat; + firstString: Expr, + secondString: Expr | string, + ...otherStrings: Array +): FunctionExpr; export function strConcat( first: string | Expr, + second: string | Expr, ...elements: Array -): StrConcat { - const exprs = elements.map(e => (e instanceof Expr ? e : Constant.of(e))); - return new StrConcat(first instanceof Expr ? first : Field.of(first), exprs); +): FunctionExpr { + return fieldOrExpression(first).strConcat( + valueToDefaultExpr(second), + ...elements.map(valueToDefaultExpr) + ); } /** @@ -5685,11 +5876,11 @@ export function strConcat( * mapGet("address", "city"); * ``` * - * @param mapField The field name of the map field. + * @param fieldName The field name of the map field. * @param subField The key to access in the map. * @return A new {@code Expr} representing the value associated with the given key in the map. */ -export function mapGet(mapField: string, subField: string): MapGet; +export function mapGet(fieldName: string, subField: string): FunctionExpr; /** * @beta @@ -5698,19 +5889,19 @@ export function mapGet(mapField: string, subField: string): MapGet; * * ```typescript * // Get the 'city' value from the 'address' map field - * mapGet(Field.of("address"), "city"); + * mapGet(field("address"), "city"); * ``` * - * @param mapExpr The expression representing the map. + * @param mapExpression The expression representing the map. * @param subField The key to access in the map. * @return A new {@code Expr} representing the value associated with the given key in the map. */ -export function mapGet(mapExpr: Expr, subField: string): MapGet; -export function mapGet(fieldOrExpr: string | Expr, subField: string): MapGet { - return new MapGet( - typeof fieldOrExpr === 'string' ? Field.of(fieldOrExpr) : fieldOrExpr, - subField - ); +export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; +export function mapGet( + fieldOrExpr: string | Expr, + subField: string +): FunctionExpr { + return fieldOrExpression(fieldOrExpr).mapGet(subField); } /** @@ -5719,14 +5910,14 @@ export function mapGet(fieldOrExpr: string | Expr, subField: string): MapGet { * Creates an aggregation that counts the total number of stage inputs. * * ```typescript - * // Count the total number of users - * countAll().as("totalUsers"); + * // Count the total number of input documents + * countAll().as("totalDocument"); * ``` * - * @return A new {@code Accumulator} representing the 'countAll' aggregation. + * @return A new {@code AggregateFunction} representing the 'countAll' aggregation. */ -export function countAll(): Count { - return new Count(undefined, false); +export function countAll(): AggregateFunction { + return new AggregateFunction('count', []); } /** @@ -5737,30 +5928,28 @@ export function countAll(): Count { * * ```typescript * // Count the number of items where the price is greater than 10 - * count(Field.of("price").gt(10)).as("expensiveItemCount"); + * count(field("price").gt(10)).as("expensiveItemCount"); * ``` * - * @param value The expression to count. - * @return A new {@code Accumulator} representing the 'count' aggregation. + * @param expression The expression to count. + * @return A new {@code AggregateFunction} representing the 'count' aggregation. */ -export function countFunction(value: Expr): Count; +export function count(expression: Expr): AggregateFunction; /** - * Creates an aggregation that counts the number of stage inputs with valid evaluations of the - * provided field. + * Creates an aggregation that counts the number of stage inputs where the input field exists. * * ```typescript * // Count the total number of products * count("productId").as("totalProducts"); * ``` * - * @param value The name of the field to count. - * @return A new {@code Accumulator} representing the 'count' aggregation. + * @param fieldName The name of the field to count. + * @return A new {@code AggregateFunction} representing the 'count' aggregation. */ -export function countFunction(value: string): Count; -export function countFunction(value: Expr | string): Count { - const exprValue = value instanceof Expr ? value : Field.of(value); - return new Count(exprValue, false); +export function count(fieldName: string): AggregateFunction; +export function count(value: Expr | string): AggregateFunction { + return fieldOrExpression(value).count(); } /** @@ -5771,13 +5960,13 @@ export function countFunction(value: Expr | string): Count { * * ```typescript * // Calculate the total revenue from a set of orders - * sum(Field.of("orderAmount")).as("totalRevenue"); + * sum(field("orderAmount")).as("totalRevenue"); * ``` * - * @param value The expression to sum up. - * @return A new {@code Accumulator} representing the 'sum' aggregation. + * @param expression The expression to sum up. + * @return A new {@code AggregateFunction} representing the 'sum' aggregation. */ -export function sumFunction(value: Expr): Sum; +export function sum(expression: Expr): AggregateFunction; /** * @beta @@ -5790,13 +5979,12 @@ export function sumFunction(value: Expr): Sum; * sum("orderAmount").as("totalRevenue"); * ``` * - * @param value The name of the field containing numeric values to sum up. - * @return A new {@code Accumulator} representing the 'sum' aggregation. + * @param fieldName The name of the field containing numeric values to sum up. + * @return A new {@code AggregateFunction} representing the 'sum' aggregation. */ -export function sumFunction(value: string): Sum; -export function sumFunction(value: Expr | string): Sum { - const exprValue = value instanceof Expr ? value : Field.of(value); - return new Sum(exprValue, false); +export function sum(fieldName: string): AggregateFunction; +export function sum(value: Expr | string): AggregateFunction { + return fieldOrExpression(value).sum(); } /** @@ -5807,13 +5995,13 @@ export function sumFunction(value: Expr | string): Sum { * * ```typescript * // Calculate the average age of users - * avg(Field.of("age")).as("averageAge"); + * avg(field("age")).as("averageAge"); * ``` * - * @param value The expression representing the values to average. - * @return A new {@code Accumulator} representing the 'avg' aggregation. + * @param expression The expression representing the values to average. + * @return A new {@code AggregateFunction} representing the 'avg' aggregation. */ -export function avgFunction(value: Expr): Avg; +export function avg(expression: Expr): AggregateFunction; /** * @beta @@ -5826,13 +6014,12 @@ export function avgFunction(value: Expr): Avg; * avg("age").as("averageAge"); * ``` * - * @param value The name of the field containing numeric values to average. - * @return A new {@code Accumulator} representing the 'avg' aggregation. + * @param fieldName The name of the field containing numeric values to average. + * @return A new {@code AggregateFunction} representing the 'avg' aggregation. */ -export function avgFunction(value: string): Avg; -export function avgFunction(value: Expr | string): Avg { - const exprValue = value instanceof Expr ? value : Field.of(value); - return new Avg(exprValue, false); +export function avg(fieldName: string): AggregateFunction; +export function avg(value: Expr | string): AggregateFunction { + return fieldOrExpression(value).avg(); } /** @@ -5843,13 +6030,13 @@ export function avgFunction(value: Expr | string): Avg { * * ```typescript * // Find the lowest price of all products - * minimum(Field.of("price")).as("lowestPrice"); + * minimum(field("price")).as("lowestPrice"); * ``` * - * @param value The expression to find the minimum value of. - * @return A new {@code Accumulator} representing the 'min' aggregation. + * @param expression The expression to find the minimum value of. + * @return A new {@code AggregateFunction} representing the 'min' aggregation. */ -export function minimum(value: Expr): Minimum; +export function minimum(expression: Expr): AggregateFunction; /** * @beta @@ -5861,13 +6048,12 @@ export function minimum(value: Expr): Minimum; * minimum("price").as("lowestPrice"); * ``` * - * @param value The name of the field to find the minimum value of. - * @return A new {@code Accumulator} representing the 'min' aggregation. + * @param fieldName The name of the field to find the minimum value of. + * @return A new {@code AggregateFunction} representing the 'min' aggregation. */ -export function minimum(value: string): Minimum; -export function minimum(value: Expr | string): Minimum { - const exprValue = value instanceof Expr ? value : Field.of(value); - return new Minimum(exprValue, false); +export function minimum(fieldName: string): AggregateFunction; +export function minimum(value: Expr | string): AggregateFunction { + return fieldOrExpression(value).minimum(); } /** @@ -5878,13 +6064,13 @@ export function minimum(value: Expr | string): Minimum { * * ```typescript * // Find the highest score in a leaderboard - * maximum(Field.of("score")).as("highestScore"); + * maximum(field("score")).as("highestScore"); * ``` * - * @param value The expression to find the maximum value of. - * @return A new {@code Accumulator} representing the 'max' aggregation. + * @param expression The expression to find the maximum value of. + * @return A new {@code AggregateFunction} representing the 'max' aggregation. */ -export function maximum(value: Expr): Maximum; +export function maximum(expression: Expr): AggregateFunction; /** * @beta @@ -5896,49 +6082,32 @@ export function maximum(value: Expr): Maximum; * maximum("score").as("highestScore"); * ``` * - * @param value The name of the field to find the maximum value of. - * @return A new {@code Accumulator} representing the 'max' aggregation. + * @param fieldName The name of the field to find the maximum value of. + * @return A new {@code AggregateFunction} representing the 'max' aggregation. */ -export function maximum(value: string): Maximum; -export function maximum(value: Expr | string): Maximum { - const exprValue = value instanceof Expr ? value : Field.of(value); - return new Maximum(exprValue, false); +export function maximum(fieldName: string): AggregateFunction; +export function maximum(value: Expr | string): AggregateFunction { + return fieldOrExpression(value).maximum(); } /** * @beta * - * Calculates the Cosine distance between a field's vector value and a double array. + * Calculates the Cosine distance between a field's vector value and a literal vector value. * * ```typescript * // Calculate the Cosine distance between the 'location' field and a target location * cosineDistance("location", [37.7749, -122.4194]); * ``` * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as an array of doubles) to compare against. - * @return A new {@code Expr} representing the Cosine distance between the two vectors. - */ -export function cosineDistance(expr: string, other: number[]): CosineDistance; - -/** - * @beta - * - * Calculates the Cosine distance between a field's vector value and a VectorValue. - * - * ```typescript - * // Calculate the Cosine distance between the 'location' field and a target location - * cosineDistance("location", new VectorValue([37.7749, -122.4194])); - * ``` - * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as a VectorValue) to compare against. + * @param fieldName The name of the field containing the first vector. + * @param vector The other vector (as an array of doubles) or {@link VectorValue} to compare against. * @return A new {@code Expr} representing the Cosine distance between the two vectors. */ export function cosineDistance( - expr: string, - other: VectorValue -): CosineDistance; + fieldName: string, + vector: number[] | VectorValue +): FunctionExpr; /** * @beta @@ -5947,46 +6116,36 @@ export function cosineDistance( * * ```typescript * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field - * cosineDistance("userVector", Field.of("itemVector")); - * ``` - * - * @param expr The name of the field containing the first vector. - * @param other The other vector (represented as an Expr) to compare against. - * @return A new {@code Expr} representing the cosine distance between the two vectors. - */ -export function cosineDistance(expr: string, other: Expr): CosineDistance; - -/** - * @beta - * - * Calculates the Cosine distance between a vector expression and a double array. - * - * ```typescript - * // Calculate the cosine distance between the 'location' field and a target location - * cosineDistance(Field.of("location"), [37.7749, -122.4194]); + * cosineDistance("userVector", field("itemVector")); * ``` * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (as an array of doubles) to compare against. + * @param fieldName The name of the field containing the first vector. + * @param vectorExpression The other vector (represented as an Expr) to compare against. * @return A new {@code Expr} representing the cosine distance between the two vectors. */ -export function cosineDistance(expr: Expr, other: number[]): CosineDistance; +export function cosineDistance( + fieldName: string, + vectorExpression: Expr +): FunctionExpr; /** * @beta * - * Calculates the Cosine distance between a vector expression and a VectorValue. + * Calculates the Cosine distance between a vector expression and a vector literal. * * ```typescript * // Calculate the cosine distance between the 'location' field and a target location - * cosineDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + * cosineDistance(field("location"), [37.7749, -122.4194]); * ``` * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (as a VectorValue) to compare against. + * @param vectorExpression The first vector (represented as an Expr) to compare against. + * @param vector The other vector (as an array of doubles or VectorValue) to compare against. * @return A new {@code Expr} representing the cosine distance between the two vectors. */ -export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; +export function cosineDistance( + vectorExpression: Expr, + vector: number[] | Expr +): FunctionExpr; /** * @beta @@ -5995,21 +6154,24 @@ export function cosineDistance(expr: Expr, other: VectorValue): CosineDistance; * * ```typescript * // Calculate the cosine distance between the 'userVector' field and the 'itemVector' field - * cosineDistance(Field.of("userVector"), Field.of("itemVector")); + * cosineDistance(field("userVector"), field("itemVector")); * ``` * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (represented as an Expr) to compare against. + * @param vectorExpression The first vector (represented as an Expr) to compare against. + * @param otherVectorExpression The other vector (represented as an Expr) to compare against. * @return A new {@code Expr} representing the cosine distance between the two vectors. */ -export function cosineDistance(expr: Expr, other: Expr): CosineDistance; +export function cosineDistance( + vectorExpression: Expr, + otherVectorExpression: Expr +): FunctionExpr; export function cosineDistance( expr: Expr | string, other: Expr | number[] | VectorValue -): CosineDistance { - const expr1 = expr instanceof Expr ? expr : Field.of(expr); - const expr2 = other instanceof Expr ? other : Constant.vector(other); - return new CosineDistance(expr1, expr2); +): FunctionExpr { + const expr1 = fieldOrExpression(expr); + const expr2 = vectorToExpr(other); + return expr1.cosineDistance(expr2); } /** @@ -6022,27 +6184,14 @@ export function cosineDistance( * dotProduct("features", [0.5, 0.8, 0.2]); * ``` * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as an array of doubles) to calculate with. - * @return A new {@code Expr} representing the dot product between the two vectors. - */ -export function dotProduct(expr: string, other: number[]): DotProduct; - -/** - * @beta - * - * Calculates the dot product between a field's vector value and a VectorValue. - * - * ```typescript - * // Calculate the dot product distance between a feature vector and a target vector - * dotProduct("features", new VectorValue([0.5, 0.8, 0.2])); - * ``` - * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as a VectorValue) to calculate with. + * @param fieldName The name of the field containing the first vector. + * @param vector The other vector (as an array of doubles or VectorValue) to calculate with. * @return A new {@code Expr} representing the dot product between the two vectors. */ -export function dotProduct(expr: string, other: VectorValue): DotProduct; +export function dotProduct( + fieldName: string, + vector: number[] | VectorValue +): FunctionExpr; /** * @beta @@ -6051,14 +6200,17 @@ export function dotProduct(expr: string, other: VectorValue): DotProduct; * * ```typescript * // Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2' - * dotProduct("docVector1", Field.of("docVector2")); + * dotProduct("docVector1", field("docVector2")); * ``` * - * @param expr The name of the field containing the first vector. - * @param other The other vector (represented as an Expr) to calculate with. + * @param fieldName The name of the field containing the first vector. + * @param vectorExpression The other vector (represented as an Expr) to calculate with. * @return A new {@code Expr} representing the dot product between the two vectors. */ -export function dotProduct(expr: string, other: Expr): DotProduct; +export function dotProduct( + fieldName: string, + vectorExpression: Expr +): FunctionExpr; /** * @beta @@ -6067,30 +6219,17 @@ export function dotProduct(expr: string, other: Expr): DotProduct; * * ```typescript * // Calculate the dot product between a feature vector and a target vector - * dotProduct(Field.of("features"), [0.5, 0.8, 0.2]); - * ``` - * - * @param expr The first vector (represented as an Expr) to calculate with. - * @param other The other vector (as an array of doubles) to calculate with. - * @return A new {@code Expr} representing the dot product between the two vectors. - */ -export function dotProduct(expr: Expr, other: number[]): DotProduct; - -/** - * @beta - * - * Calculates the dot product between a vector expression and a VectorValue. - * - * ```typescript - * // Calculate the dot product between a feature vector and a target vector - * dotProduct(Field.of("features"), new VectorValue([0.5, 0.8, 0.2])); + * dotProduct(field("features"), [0.5, 0.8, 0.2]); * ``` * - * @param expr The first vector (represented as an Expr) to calculate with. - * @param other The other vector (as a VectorValue) to calculate with. + * @param vectorExpression The first vector (represented as an Expr) to calculate with. + * @param vector The other vector (as an array of doubles or VectorValue) to calculate with. * @return A new {@code Expr} representing the dot product between the two vectors. */ -export function dotProduct(expr: Expr, other: VectorValue): DotProduct; +export function dotProduct( + vectorExpression: Expr, + vector: number[] | VectorValue +): FunctionExpr; /** * @beta @@ -6099,21 +6238,24 @@ export function dotProduct(expr: Expr, other: VectorValue): DotProduct; * * ```typescript * // Calculate the dot product between two document vectors: 'docVector1' and 'docVector2' - * dotProduct(Field.of("docVector1"), Field.of("docVector2")); + * dotProduct(field("docVector1"), field("docVector2")); * ``` * - * @param expr The first vector (represented as an Expr) to calculate with. - * @param other The other vector (represented as an Expr) to calculate with. + * @param vectorExpression The first vector (represented as an Expr) to calculate with. + * @param otherVectorExpression The other vector (represented as an Expr) to calculate with. * @return A new {@code Expr} representing the dot product between the two vectors. */ -export function dotProduct(expr: Expr, other: Expr): DotProduct; +export function dotProduct( + vectorExpression: Expr, + otherVectorExpression: Expr +): FunctionExpr; export function dotProduct( expr: Expr | string, other: Expr | number[] | VectorValue -): DotProduct { - const expr1 = expr instanceof Expr ? expr : Field.of(expr); - const expr2 = other instanceof Expr ? other : Constant.vector(other); - return new DotProduct(expr1, expr2); +): FunctionExpr { + const expr1 = fieldOrExpression(expr); + const expr2 = vectorToExpr(other); + return expr1.dotProduct(expr2); } /** @@ -6126,33 +6268,14 @@ export function dotProduct( * euclideanDistance("location", [37.7749, -122.4194]); * ``` * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as an array of doubles) to compare against. - * @return A new {@code Expr} representing the Euclidean distance between the two vectors. - */ -export function euclideanDistance( - expr: string, - other: number[] -): EuclideanDistance; - -/** - * @beta - * - * Calculates the Euclidean distance between a field's vector value and a VectorValue. - * - * ```typescript - * // Calculate the Euclidean distance between the 'location' field and a target location - * euclideanDistance("location", new VectorValue([37.7749, -122.4194])); - * ``` - * - * @param expr The name of the field containing the first vector. - * @param other The other vector (as a VectorValue) to compare against. + * @param fieldName The name of the field containing the first vector. + * @param vector The other vector (as an array of doubles or VectorValue) to compare against. * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ export function euclideanDistance( - expr: string, - other: VectorValue -): EuclideanDistance; + fieldName: string, + vector: number[] | VectorValue +): FunctionExpr; /** * @beta @@ -6161,14 +6284,17 @@ export function euclideanDistance( * * ```typescript * // Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' - * euclideanDistance("pointA", Field.of("pointB")); + * euclideanDistance("pointA", field("pointB")); * ``` * - * @param expr The name of the field containing the first vector. - * @param other The other vector (represented as an Expr) to compare against. + * @param fieldName The name of the field containing the first vector. + * @param vectorExpression The other vector (represented as an Expr) to compare against. * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ -export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; +export function euclideanDistance( + fieldName: string, + vectorExpression: Expr +): FunctionExpr; /** * @beta @@ -6178,36 +6304,17 @@ export function euclideanDistance(expr: string, other: Expr): EuclideanDistance; * ```typescript * // Calculate the Euclidean distance between the 'location' field and a target location * - * euclideanDistance(Field.of("location"), [37.7749, -122.4194]); - * ``` - * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (as an array of doubles) to compare against. - * @return A new {@code Expr} representing the Euclidean distance between the two vectors. - */ -export function euclideanDistance( - expr: Expr, - other: number[] -): EuclideanDistance; - -/** - * @beta - * - * Calculates the Euclidean distance between a vector expression and a VectorValue. - * - * ```typescript - * // Calculate the Euclidean distance between the 'location' field and a target location - * euclideanDistance(Field.of("location"), new VectorValue([37.7749, -122.4194])); + * euclideanDistance(field("location"), [37.7749, -122.4194]); * ``` * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (as a VectorValue) to compare against. + * @param vectorExpression The first vector (represented as an Expr) to compare against. + * @param vector The other vector (as an array of doubles or VectorValue) to compare against. * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ export function euclideanDistance( - expr: Expr, - other: VectorValue -): EuclideanDistance; + vectorExpression: Expr, + vector: number[] | VectorValue +): FunctionExpr; /** * @beta @@ -6216,21 +6323,24 @@ export function euclideanDistance( * * ```typescript * // Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB' - * euclideanDistance(Field.of("pointA"), Field.of("pointB")); + * euclideanDistance(field("pointA"), field("pointB")); * ``` * - * @param expr The first vector (represented as an Expr) to compare against. - * @param other The other vector (represented as an Expr) to compare against. + * @param vectorExpression The first vector (represented as an Expr) to compare against. + * @param otherVectorExpression The other vector (represented as an Expr) to compare against. * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ -export function euclideanDistance(expr: Expr, other: Expr): EuclideanDistance; +export function euclideanDistance( + vectorExpression: Expr, + otherVectorExpression: Expr +): FunctionExpr; export function euclideanDistance( expr: Expr | string, other: Expr | number[] | VectorValue -): EuclideanDistance { - const expr1 = expr instanceof Expr ? expr : Field.of(expr); - const expr2 = other instanceof Expr ? other : Constant.vector(other); - return new EuclideanDistance(expr1, expr2); +): FunctionExpr { + const expr1 = fieldOrExpression(expr); + const expr2 = vectorToExpr(other); + return expr1.euclideanDistance(expr2); } /** @@ -6240,13 +6350,13 @@ export function euclideanDistance( * * ```typescript * // Get the vector length (dimension) of the field 'embedding'. - * vectorLength(Field.of("embedding")); + * vectorLength(field("embedding")); * ``` * - * @param expr The expression representing the Firestore Vector. + * @param vectorExpression The expression representing the Firestore Vector. * @return A new {@code Expr} representing the length of the array. */ -export function vectorLength(expr: Expr): VectorLength; +export function vectorLength(vectorExpression: Expr): FunctionExpr; /** * @beta @@ -6258,13 +6368,12 @@ export function vectorLength(expr: Expr): VectorLength; * vectorLength("embedding"); * ``` * - * @param field The name of the field representing the Firestore Vector. + * @param fieldName The name of the field representing the Firestore Vector. * @return A new {@code Expr} representing the length of the array. */ -export function vectorLength(field: string): VectorLength; -export function vectorLength(expr: Expr | string): VectorLength { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new VectorLength(normalizedExpr); +export function vectorLength(fieldName: string): FunctionExpr; +export function vectorLength(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).vectorLength(); } /** @@ -6275,13 +6384,13 @@ export function vectorLength(expr: Expr | string): VectorLength { * * ```typescript * // Interpret the 'microseconds' field as microseconds since epoch. - * unixMicrosToTimestamp(Field.of("microseconds")); + * unixMicrosToTimestamp(field("microseconds")); * ``` * * @param expr The expression representing the number of microseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; +export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; /** * @beta @@ -6294,15 +6403,12 @@ export function unixMicrosToTimestamp(expr: Expr): UnixMicrosToTimestamp; * unixMicrosToTimestamp("microseconds"); * ``` * - * @param field The name of the field representing the number of microseconds since epoch. + * @param fieldName The name of the field representing the number of microseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMicrosToTimestamp(field: string): UnixMicrosToTimestamp; -export function unixMicrosToTimestamp( - expr: Expr | string -): UnixMicrosToTimestamp { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new UnixMicrosToTimestamp(normalizedExpr); +export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; +export function unixMicrosToTimestamp(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).unixMicrosToTimestamp(); } /** @@ -6312,13 +6418,13 @@ export function unixMicrosToTimestamp( * * ```typescript * // Convert the 'timestamp' field to microseconds since epoch. - * timestampToUnixMicros(Field.of("timestamp")); + * timestampToUnixMicros(field("timestamp")); * ``` * * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of microseconds since epoch. */ -export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; +export function timestampToUnixMicros(expr: Expr): FunctionExpr; /** * @beta @@ -6330,15 +6436,12 @@ export function timestampToUnixMicros(expr: Expr): TimestampToUnixMicros; * timestampToUnixMicros("timestamp"); * ``` * - * @param field The name of the field representing the timestamp. + * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of microseconds since epoch. */ -export function timestampToUnixMicros(field: string): TimestampToUnixMicros; -export function timestampToUnixMicros( - expr: Expr | string -): TimestampToUnixMicros { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new TimestampToUnixMicros(normalizedExpr); +export function timestampToUnixMicros(fieldName: string): FunctionExpr; +export function timestampToUnixMicros(expr: Expr | string): FunctionExpr { + return fieldOrExpression(expr).timestampToUnixMicros(); } /** @@ -6349,13 +6452,13 @@ export function timestampToUnixMicros( * * ```typescript * // Interpret the 'milliseconds' field as milliseconds since epoch. - * unixMillisToTimestamp(Field.of("milliseconds")); + * unixMillisToTimestamp(field("milliseconds")); * ``` * * @param expr The expression representing the number of milliseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; +export function unixMillisToTimestamp(expr: Expr): FunctionExpr; /** * @beta @@ -6368,15 +6471,13 @@ export function unixMillisToTimestamp(expr: Expr): UnixMillisToTimestamp; * unixMillisToTimestamp("milliseconds"); * ``` * - * @param field The name of the field representing the number of milliseconds since epoch. + * @param fieldName The name of the field representing the number of milliseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMillisToTimestamp(field: string): UnixMillisToTimestamp; -export function unixMillisToTimestamp( - expr: Expr | string -): UnixMillisToTimestamp { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new UnixMillisToTimestamp(normalizedExpr); +export function unixMillisToTimestamp(fieldName: string): FunctionExpr; +export function unixMillisToTimestamp(expr: Expr | string): FunctionExpr { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.unixMillisToTimestamp(); } /** @@ -6386,13 +6487,13 @@ export function unixMillisToTimestamp( * * ```typescript * // Convert the 'timestamp' field to milliseconds since epoch. - * timestampToUnixMillis(Field.of("timestamp")); + * timestampToUnixMillis(field("timestamp")); * ``` * * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of milliseconds since epoch. */ -export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; +export function timestampToUnixMillis(expr: Expr): FunctionExpr; /** * @beta @@ -6404,15 +6505,13 @@ export function timestampToUnixMillis(expr: Expr): TimestampToUnixMillis; * timestampToUnixMillis("timestamp"); * ``` * - * @param field The name of the field representing the timestamp. + * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of milliseconds since epoch. */ -export function timestampToUnixMillis(field: string): TimestampToUnixMillis; -export function timestampToUnixMillis( - expr: Expr | string -): TimestampToUnixMillis { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new TimestampToUnixMillis(normalizedExpr); +export function timestampToUnixMillis(fieldName: string): FunctionExpr; +export function timestampToUnixMillis(expr: Expr | string): FunctionExpr { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.timestampToUnixMillis(); } /** @@ -6423,13 +6522,13 @@ export function timestampToUnixMillis( * * ```typescript * // Interpret the 'seconds' field as seconds since epoch. - * unixSecondsToTimestamp(Field.of("seconds")); + * unixSecondsToTimestamp(field("seconds")); * ``` * * @param expr The expression representing the number of seconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; +export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; /** * @beta @@ -6442,15 +6541,13 @@ export function unixSecondsToTimestamp(expr: Expr): UnixSecondsToTimestamp; * unixSecondsToTimestamp("seconds"); * ``` * - * @param field The name of the field representing the number of seconds since epoch. + * @param fieldName The name of the field representing the number of seconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixSecondsToTimestamp(field: string): UnixSecondsToTimestamp; -export function unixSecondsToTimestamp( - expr: Expr | string -): UnixSecondsToTimestamp { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new UnixSecondsToTimestamp(normalizedExpr); +export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; +export function unixSecondsToTimestamp(expr: Expr | string): FunctionExpr { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.unixSecondsToTimestamp(); } /** @@ -6460,13 +6557,13 @@ export function unixSecondsToTimestamp( * * ```typescript * // Convert the 'timestamp' field to seconds since epoch. - * timestampToUnixSeconds(Field.of("timestamp")); + * timestampToUnixSeconds(field("timestamp")); * ``` * * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of seconds since epoch. */ -export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; +export function timestampToUnixSeconds(expr: Expr): FunctionExpr; /** * @beta @@ -6478,15 +6575,13 @@ export function timestampToUnixSeconds(expr: Expr): TimestampToUnixSeconds; * timestampToUnixSeconds("timestamp"); * ``` * - * @param field The name of the field representing the timestamp. + * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of seconds since epoch. */ -export function timestampToUnixSeconds(field: string): TimestampToUnixSeconds; -export function timestampToUnixSeconds( - expr: Expr | string -): TimestampToUnixSeconds { - const normalizedExpr = typeof expr === 'string' ? Field.of(expr) : expr; - return new TimestampToUnixSeconds(normalizedExpr); +export function timestampToUnixSeconds(fieldName: string): FunctionExpr; +export function timestampToUnixSeconds(expr: Expr | string): FunctionExpr { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.timestampToUnixSeconds(); } /** @@ -6496,7 +6591,7 @@ export function timestampToUnixSeconds( * * ```typescript * // Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field. - * timestampAdd(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + * timestampAdd(field("timestamp"), field("unit"), field("amount")); * ``` * * @param timestamp The expression representing the timestamp. @@ -6508,7 +6603,7 @@ export function timestampAdd( timestamp: Expr, unit: Expr, amount: Expr -): TimestampAdd; +): FunctionExpr; /** * @beta @@ -6517,7 +6612,7 @@ export function timestampAdd( * * ```typescript * // Add 1 day to the 'timestamp' field. - * timestampAdd(Field.of("timestamp"), "day", 1); + * timestampAdd(field("timestamp"), "day", 1); * ``` * * @param timestamp The expression representing the timestamp. @@ -6529,7 +6624,7 @@ export function timestampAdd( timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): TimestampAdd; +): FunctionExpr; /** * @beta @@ -6541,16 +6636,16 @@ export function timestampAdd( * timestampAdd("timestamp", "day", 1); * ``` * - * @param field The name of the field representing the timestamp. + * @param fieldName The name of the field representing the timestamp. * @param unit The unit of time to add (e.g., "day", "hour"). * @param amount The amount of time to add. * @return A new {@code Expr} representing the resulting timestamp. */ export function timestampAdd( - field: string, + fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): TimestampAdd; +): FunctionExpr; export function timestampAdd( timestamp: Expr | string, unit: @@ -6562,17 +6657,11 @@ export function timestampAdd( | 'hour' | 'day', amount: Expr | number -): TimestampAdd { - const normalizedTimestamp = - typeof timestamp === 'string' ? Field.of(timestamp) : timestamp; - const normalizedUnit = unit instanceof Expr ? unit : Constant.of(unit); - const normalizedAmount = - typeof amount === 'number' ? Constant.of(amount) : amount; - return new TimestampAdd( - normalizedTimestamp, - normalizedUnit, - normalizedAmount - ); +): FunctionExpr { + const normalizedTimestamp = fieldOrExpression(timestamp); + const normalizedUnit = valueToDefaultExpr(unit); + const normalizedAmount = valueToDefaultExpr(amount); + return normalizedTimestamp.timestampAdd(normalizedUnit, normalizedAmount); } /** @@ -6582,7 +6671,7 @@ export function timestampAdd( * * ```typescript * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. - * timestampSub(Field.of("timestamp"), Field.of("unit"), Field.of("amount")); + * timestampSub(field("timestamp"), field("unit"), field("amount")); * ``` * * @param timestamp The expression representing the timestamp. @@ -6594,7 +6683,7 @@ export function timestampSub( timestamp: Expr, unit: Expr, amount: Expr -): TimestampSub; +): FunctionExpr; /** * @beta @@ -6603,7 +6692,7 @@ export function timestampSub( * * ```typescript * // Subtract 1 day from the 'timestamp' field. - * timestampSub(Field.of("timestamp"), "day", 1); + * timestampSub(field("timestamp"), "day", 1); * ``` * * @param timestamp The expression representing the timestamp. @@ -6615,7 +6704,7 @@ export function timestampSub( timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): TimestampSub; +): FunctionExpr; /** * @beta @@ -6627,16 +6716,16 @@ export function timestampSub( * timestampSub("timestamp", "day", 1); * ``` * - * @param field The name of the field representing the timestamp. + * @param fieldName The name of the field representing the timestamp. * @param unit The unit of time to subtract (e.g., "day", "hour"). * @param amount The amount of time to subtract. * @return A new {@code Expr} representing the resulting timestamp. */ export function timestampSub( - field: string, + fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): TimestampSub; +): FunctionExpr; export function timestampSub( timestamp: Expr | string, unit: @@ -6648,39 +6737,11 @@ export function timestampSub( | 'hour' | 'day', amount: Expr | number -): TimestampSub { - const normalizedTimestamp = - typeof timestamp === 'string' ? Field.of(timestamp) : timestamp; - const normalizedUnit = unit instanceof Expr ? unit : Constant.of(unit); - const normalizedAmount = - typeof amount === 'number' ? Constant.of(amount) : amount; - return new TimestampSub( - normalizedTimestamp, - normalizedUnit, - normalizedAmount - ); -} - -/** - * @beta - * - * Creates functions that work on the backend but do not exist in the SDK yet. - * - * ```typescript - * // Call a user defined function named "myFunc" with the arguments 10 and 20 - * // This is the same of the 'sum(Field.of("price"))', if it did not exist - * genericFunction("sum", [Field.of("price")]); - * ``` - * - * @param name The name of the user defined function. - * @param params The arguments to pass to the function. - * @return A new {@code Function} representing the function call. - */ -export function genericFunction( - name: string, - params: Expr[] -): FirestoreFunction { - return new FirestoreFunction(name, params); +): FunctionExpr { + const normalizedTimestamp = fieldOrExpression(timestamp); + const normalizedUnit = valueToDefaultExpr(unit); + const normalizedAmount = valueToDefaultExpr(amount); + return normalizedTimestamp.timestampSub(normalizedUnit, normalizedAmount); } /** @@ -6694,15 +6755,17 @@ export function genericFunction( * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); * ``` * - * @param left The first filter condition. - * @param right Additional filter conditions to 'AND' together. + * @param first The first filter condition. + * @param second The second filter condition. + * @param more Additional filter conditions to 'AND' together. * @return A new {@code Expr} representing the logical 'AND' operation. */ -export function andFunction( - left: FilterCondition, - ...right: FilterCondition[] -): And { - return new And([left, ...right]); +export function and( + first: BooleanExpr, + second: BooleanExpr, + ...more: BooleanExpr[] +): BooleanExpr { + return new BooleanExpr('and', [first, second, ...more]); } /** @@ -6716,51 +6779,87 @@ export function andFunction( * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); * ``` * - * @param left The first filter condition. - * @param right Additional filter conditions to 'OR' together. + * @param first The first filter condition. + * @param second The second filter condition. + * @param more Additional filter conditions to 'OR' together. * @return A new {@code Expr} representing the logical 'OR' operation. */ -export function orFunction( - left: FilterCondition, - ...right: FilterCondition[] -): Or { - return new Or([left, ...right]); +export function or( + first: BooleanExpr, + second: BooleanExpr, + ...more: BooleanExpr[] +): BooleanExpr { + return new BooleanExpr('or', [first, second, ...more]); } /** * @beta * - * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * Creates an {@link Ordering} that sorts documents in ascending order based on an expression. * * ```typescript - * // Sort documents by the 'name' field in ascending order + * // Sort documents by the 'name' field in lowercase in ascending order * firestore.pipeline().collection("users") - * .sort(ascending(Field.of("name"))); + * .sort(ascending(field("name").toLower())); * ``` * * @param expr The expression to create an ascending ordering for. * @return A new `Ordering` for ascending sorting. */ -export function ascending(expr: Expr): Ordering { - return new Ordering(expr, 'ascending'); +export function ascending(expr: Expr): Ordering; + +/** + * @beta + * + * Creates an {@link Ordering} that sorts documents in ascending order based on a field. + * + * ```typescript + * // Sort documents by the 'name' field in ascending order + * firestore.pipeline().collection("users") + * .sort(ascending("name")); + * ``` + * + * @param fieldName The field to create an ascending ordering for. + * @return A new `Ordering` for ascending sorting. + */ +export function ascending(fieldName: string): Ordering; +export function ascending(field: Expr | string): Ordering { + return new Ordering(fieldOrExpression(field), 'ascending'); } /** * @beta * - * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * Creates an {@link Ordering} that sorts documents in descending order based on an expression. * * ```typescript - * // Sort documents by the 'createdAt' field in descending order + * // Sort documents by the 'name' field in lowercase in descending order * firestore.pipeline().collection("users") - * .sort(descending(Field.of("createdAt"))); + * .sort(descending(field("name").toLower())); * ``` * * @param expr The expression to create a descending ordering for. * @return A new `Ordering` for descending sorting. */ -export function descending(expr: Expr): Ordering { - return new Ordering(expr, 'descending'); +export function descending(expr: Expr): Ordering; + +/** + * @beta + * + * Creates an {@link Ordering} that sorts documents in descending order based on a field. + * + * ```typescript + * // Sort documents by the 'name' field in descending order + * firestore.pipeline().collection("users") + * .sort(descending("name")); + * ``` + * + * @param fieldName The field to create a descending ordering for. + * @return A new `Ordering` for descending sorting. + */ +export function descending(fieldName: string): Ordering; +export function descending(field: Expr | string): Ordering { + return new Ordering(fieldOrExpression(field), 'descending'); } /** @@ -6770,12 +6869,20 @@ export function descending(expr: Expr): Ordering { * * You create `Ordering` instances using the `ascending` and `descending` helper functions. */ -export class Ordering { +export class Ordering implements ProtoValueSerializable, UserData { constructor( readonly expr: Expr, readonly direction: 'ascending' | 'descending' ) {} + /** + * @internal + * @private + * Indicates if this expression was created from a literal value passed + * by the caller. + */ + _createdFromLiteral: boolean = false; + /** * @private * @internal @@ -6795,7 +6902,13 @@ export class Ordering { * @private * @internal */ - _readUserData(dataReader: UserDataReader): void { + _readUserData(dataReader: UserDataReader, context?: ParseContext): void { + context = + this._createdFromLiteral && context + ? context + : dataReader.createContext(UserDataSource.Argument, 'constant'); this.expr._readUserData(dataReader); } + + _protoValueType: 'ProtoValue' = 'ProtoValue'; } diff --git a/packages/firestore/src/lite-api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts index dc0a6412481..635636ac46b 100644 --- a/packages/firestore/src/lite-api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -18,12 +18,58 @@ import { ObjectValue } from '../model/object_value'; import { isOptionalEqual } from '../util/misc'; +import { Field } from './expressions'; import { FieldPath } from './field_path'; +import { Pipeline } from './pipeline'; import { DocumentData, DocumentReference, refEqual } from './reference'; import { fieldPathFromArgument } from './snapshot'; import { Timestamp } from './timestamp'; import { AbstractUserDataWriter } from './user_data_writer'; +export class PipelineSnapshot { + private readonly _pipeline: Pipeline; + private readonly _executionTime: Timestamp | undefined; + private readonly _results: PipelineResult[]; + constructor( + pipeline: Pipeline, + results: PipelineResult[], + executionTime?: Timestamp + ) { + this._pipeline = pipeline; + this._executionTime = executionTime; + this._results = results; + } + + /** + * The Pipeline on which you called `execute()` in order to get this + * `PipelineSnapshot`. + */ + get pipeline(): Pipeline { + return this._pipeline; + } + + /** An array of all the results in the `PipelineSnapshot`. */ + get results(): PipelineResult[] { + return this._results; + } + + /** + * The time at which the pipeline producing this result is executed. + * + * @type {Timestamp} + * @readonly + * + */ + get executionTime(): Timestamp { + if (this._executionTime === undefined) { + throw new Error( + "'executionTime' is expected to exist, but it is undefined" + ); + } + return this._executionTime; + } +} + /** * @beta * @@ -36,7 +82,6 @@ import { AbstractUserDataWriter } from './user_data_writer'; export class PipelineResult { private readonly _userDataWriter: AbstractUserDataWriter; - private readonly _executionTime: Timestamp | undefined; private readonly _createTime: Timestamp | undefined; private readonly _updateTime: Timestamp | undefined; @@ -58,7 +103,7 @@ export class PipelineResult { * * @param userDataWriter The serializer used to encode/decode protobuf. * @param ref The reference to the document. - * @param _fieldsProto The fields of the Firestore `Document` Protobuf backing + * @param fields The fields of the Firestore `Document` Protobuf backing * this document (or undefined if the document does not exist). * @param readTime The time when this result was read (or undefined if * the document exists only locally). @@ -69,13 +114,11 @@ export class PipelineResult { userDataWriter: AbstractUserDataWriter, ref?: DocumentReference, fields?: ObjectValue, - executionTime?: Timestamp, createTime?: Timestamp, updateTime?: Timestamp ) { this._ref = ref; this._userDataWriter = userDataWriter; - this._executionTime = executionTime; this._createTime = createTime; this._updateTime = updateTime; this._fields = fields; @@ -120,22 +163,6 @@ export class PipelineResult { return this._updateTime; } - /** - * The time at which the pipeline producing this result is executed. - * - * @type {Timestamp} - * @readonly - * - */ - get executionTime(): Timestamp { - if (this._executionTime === undefined) { - throw new Error( - "'executionTime' is expected to exist, but it is undefined" - ); - } - return this._executionTime; - } - /** * Retrieves all fields in the result as an object. Returns 'undefined' if * the document doesn't exist. @@ -166,7 +193,7 @@ export class PipelineResult { /** * Retrieves the field specified by `field`. * - * @param {string|FieldPath} field The field path + * @param {string|FieldPath|Field} field The field path * (e.g. 'foo' or 'foo.bar') to a specific field. * @returns {*} The data at the specified field location or undefined if no * such field exists. @@ -184,7 +211,7 @@ export class PipelineResult { // We deliberately use `any` in the external API to not impose type-checking // on end users. // eslint-disable-next-line @typescript-eslint/no-explicit-any - get(fieldPath: string | FieldPath): any { + get(fieldPath: string | FieldPath | Field): any { if (this._fields === undefined) { return undefined; } diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index 856096037f8..421fc759bfb 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { DocumentReference } from './reference'; +import { DatabaseId } from '../core/database_info'; +import { toPipeline } from '../core/pipeline-util'; +import { FirestoreError, Code } from '../util/error'; + +import { Pipeline } from './pipeline'; +import { CollectionReference, DocumentReference, Query } from './reference'; import { CollectionGroupSource, CollectionSource, @@ -35,6 +40,7 @@ export class PipelineSource { * @param _createPipeline */ constructor( + private databaseId: DatabaseId, /** * @internal * @private @@ -42,19 +48,89 @@ export class PipelineSource { public _createPipeline: (stages: Stage[]) => PipelineType ) {} - collection(collectionPath: string): PipelineType { - return this._createPipeline([new CollectionSource(collectionPath)]); + /** + * Set the pipeline's source to the collection specified by the given path. + * + * @param collectionPath A path to a collection that will be the source of this pipeline. + */ + collection(collectionPath: string): PipelineType; + + /** + * Set the pipeline's source to the collection specified by the given CollectionReference. + * + * @param collectionReference A CollectionReference for a collection that will be the source of this pipeline. + * The converter for this CollectionReference will be ignored and not have an effect on this pipeline. + * + * @throws {@FirestoreError} Thrown if the provided CollectionReference targets a different project or database than the pipeline. + */ + collection(collectionReference: CollectionReference): PipelineType; + collection(collection: CollectionReference | string): PipelineType { + if (collection instanceof CollectionReference) { + this._validateReference(collection); + return this._createPipeline([new CollectionSource(collection.path)]); + } else { + return this._createPipeline([new CollectionSource(collection)]); + } } + /** + * Set the pipeline's source to the collection group with the given id. + * + * @param collectionid The id of a collection group that will be the source of this pipeline. + */ collectionGroup(collectionId: string): PipelineType { return this._createPipeline([new CollectionGroupSource(collectionId)]); } + /** + * Set the pipeline's source to be all documents in this database. + */ database(): PipelineType { return this._createPipeline([new DatabaseSource()]); } - documents(docs: DocumentReference[]): PipelineType { + /** + * Set the pipeline's source to the documents specified by the given paths and DocumentReferences. + * + * @param docs An array of paths and DocumentReferences specifying the individual documents that will be the source of this pipeline. + * The converters for these DocumentReferences will be ignored and not have an effect on this pipeline. + * + * @throws {@FirestoreError} Thrown if any of the provided DocumentReferences target a different project or database than the pipeline. + */ + documents(docs: Array): PipelineType { + docs.forEach(doc => { + if (doc instanceof DocumentReference) { + this._validateReference(doc); + } + }); + return this._createPipeline([DocumentsSource.of(docs)]); } + + /** + * Convert the given Query into an equivalent Pipeline. + * + * @param query A Query to be converted into a Pipeline. + * + * @throws {@FirestoreError} Thrown if any of the provided DocumentReferences target a different project or database than the pipeline. + */ + createFrom(query: Query): Pipeline { + return toPipeline(query._query, query.firestore); + } + + _validateReference(reference: CollectionReference | DocumentReference): void { + const refDbId = reference.firestore._databaseId; + if (!refDbId.isEqual(this.databaseId)) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + `Invalid ${ + reference instanceof CollectionReference + ? 'CollectionReference' + : 'DocumentReference' + }. ` + + `The project ID ("${refDbId.projectId}") or the database ("${refDbId.database}") does not match ` + + `the project ID ("${this.databaseId.projectId}") and database ("${this.databaseId.database}") of the target database of this Pipeline.` + ); + } + } } diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 2145952c004..e07c7a37b9f 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -15,36 +15,28 @@ * limitations under the License. */ -/* eslint @typescript-eslint/no-explicit-any: 0 */ - import { ObjectValue } from '../model/object_value'; import { - ExecutePipelineRequest, - StructuredPipeline, + Pipeline as ProtoPipeline, Stage as ProtoStage } from '../protos/firestore_proto_api'; -import { invokeExecutePipeline } from '../remote/datastore'; -import { - getEncodedDatabaseId, - JsonProtoSerializer, - ProtoSerializable -} from '../remote/serializer'; +import { JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; +import { isPlainObject } from '../util/input_validation'; -import { getDatastore } from './components'; import { Firestore } from './database'; import { - Accumulator, - AccumulatorTarget, + _mapValue, + AggregateFunction, + AggregateWithAlias, Expr, ExprWithAlias, Field, - Fields, - FilterCondition, + BooleanExpr, Ordering, - Selectable + Selectable, + field, + Constant } from './expressions'; -import { PipelineResult } from './pipeline-result'; -import { DocumentReference } from './reference'; import { AddFields, Aggregate, @@ -54,8 +46,13 @@ import { GenericStage, Limit, Offset, + RemoveFields, + Replace, Select, Sort, + Sample, + Union, + Unnest, Stage, Where } from './stage'; @@ -70,7 +67,7 @@ interface ReadableUserData { _readUserData(dataReader: UserDataReader): void; } -function isReadableUserData(value: any): value is ReadableUserData { +function isReadableUserData(value: unknown): value is ReadableUserData { return typeof (value as ReadableUserData)._readUserData === 'function'; } @@ -97,30 +94,27 @@ function isReadableUserData(value: any): value is ReadableUserData { * const db: Firestore; // Assumes a valid firestore instance. * * // Example 1: Select specific fields and rename 'rating' to 'bookRating' - * const results1 = await db.pipeline() + * const results1 = await execute(db.pipeline() * .collection("books") - * .select("title", "author", Field.of("rating").as("bookRating")) - * .execute(); + * .select("title", "author", field("rating").as("bookRating"))); * * // Example 2: Filter documents where 'genre' is "Science Fiction" and 'published' is after 1950 - * const results2 = await db.pipeline() + * const results2 = await execute(db.pipeline() * .collection("books") - * .where(and(Field.of("genre").eq("Science Fiction"), Field.of("published").gt(1950))) - * .execute(); + * .where(and(field("genre").eq("Science Fiction"), field("published").gt(1950)))); * * // Example 3: Calculate the average rating of books published after 1980 - * const results3 = await db.pipeline() + * const results3 = await execute(db.pipeline() * .collection("books") - * .where(Field.of("published").gt(1980)) - * .aggregate(avg(Field.of("rating")).as("averageRating")) - * .execute(); + * .where(field("published").gt(1980)) + * .aggregate(avg(field("rating")).as("averageRating"))); * ``` */ /** * Base-class implementation */ -export class Pipeline implements ProtoSerializable { +export class Pipeline implements ProtoSerializable { /** * @internal * @private @@ -162,27 +156,53 @@ export class Pipeline implements ProtoSerializable { * ```typescript * firestore.pipeline().collection("books") * .addFields( - * Field.of("rating").as("bookRating"), // Rename 'rating' to 'bookRating' - * add(5, Field.of("quantity")).as("totalCost") // Calculate 'totalCost' + * field("rating").as("bookRating"), // Rename 'rating' to 'bookRating' + * add(5, field("quantity")).as("totalCost") // Calculate 'totalCost' * ); * ``` * - * @param fields The fields to add to the documents, specified as {@link Selectable}s. + * @param field The first field to add to the documents, specified as a {@link Selectable}. + * @param additionalFields Optional additional fields to add to the documents, specified as {@link Selectable}s. * @return A new Pipeline object with this stage appended to the stage list. */ - addFields(...fields: Selectable[]): Pipeline { - const copy = this.stages.map(s => s); - copy.push( + addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline { + return this._addStage( new AddFields( - this.readUserData('addFields', this.selectablesToMap(fields)) + this.readUserData( + 'addFields', + this.selectablesToMap([field, ...additionalFields]) + ) ) ); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy + } + + /** + * Remove fields from outputs of previous stages. + * + * Example: + * + * ```typescript + * firestore.pipeline().collection('books') + * // removes field 'rating' and 'cost' from the previous stage outputs. + * .removeFields( + * field('rating'), + * 'cost' + * ); + * ``` + * + * @param fieldValue The first field to remove. + * @param additionalFields Optional additional fields to remove. + * @return A new Pipeline object with this stage appended to the stage list. + */ + removeFields( + fieldValue: Field | string, + ...additionalFields: Array + ): Pipeline { + const fieldExpressions = [fieldValue, ...additionalFields].map(f => + typeof f === 'string' ? field(f) : (f as Field) ); + this.readUserData('removeFields', fieldExpressions); + return this._addStage(new RemoveFields(fieldExpressions)); } /** @@ -198,7 +218,7 @@ export class Pipeline implements ProtoSerializable { * * *

If no selections are provided, the output of this stage is empty. Use {@link - * com.google.cloud.firestore.Pipeline#addFields} instead if only additions are + * Pipeline#addFields} instead if only additions are * desired. * *

Example: @@ -207,101 +227,36 @@ export class Pipeline implements ProtoSerializable { * firestore.pipeline().collection("books") * .select( * "firstName", - * Field.of("lastName"), - * Field.of("address").toUppercase().as("upperAddress"), + * field("lastName"), + * field("address").toUppercase().as("upperAddress"), * ); * ``` * - * @param selections The fields to include in the output documents, specified as {@link + * @param selection The first field to include in the output documents, specified as {@link + * Selectable} expression or string value representing the field name. + * @param additionalSelections Optional additional fields to include in the output documents, specified as {@link * Selectable} expressions or {@code string} values representing field names. * @return A new Pipeline object with this stage appended to the stage list. */ - select(...selections: Array): Pipeline { - const copy = this.stages.map(s => s); - let projections: Map = this.selectablesToMap(selections); - projections = this.readUserData('select', projections); - copy.push(new Select(projections)); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); - } - - private selectablesToMap( - selectables: Array - ): Map { - const result = new Map(); - for (const selectable of selectables) { - if (typeof selectable === 'string') { - result.set(selectable as string, Field.of(selectable)); - } else if (selectable instanceof Field) { - result.set((selectable as Field).fieldName(), selectable); - } else if (selectable instanceof Fields) { - const fields = selectable as Fields; - for (const field of fields.fieldList()) { - result.set(field.fieldName(), field); - } - } else if (selectable instanceof ExprWithAlias) { - const expr = selectable as ExprWithAlias; - result.set(expr.alias, expr.expr); - } - } - return result; - } - - /** - * Reads user data for each expression in the expressionMap. - * @param name Name of the calling function. Used for error messages when invalid user data is encountered. - * @param expressionMap - * @return the expressionMap argument. - * @private - */ - private readUserData< - T extends - | Map - | ReadableUserData[] - | ReadableUserData - >(name: string, expressionMap: T): T { - if (isReadableUserData(expressionMap)) { - expressionMap._readUserData(this.userDataReader); - } else if (Array.isArray(expressionMap)) { - expressionMap.forEach(readableData => - readableData._readUserData(this.userDataReader) - ); - } else { - expressionMap.forEach(expr => expr._readUserData(this.userDataReader)); - } - return expressionMap; - } - - /** - * @internal - * @private - * @param db - * @param userDataReader - * @param userDataWriter - * @param stages - * @protected - */ - protected newPipeline( - db: Firestore, - userDataReader: UserDataReader, - userDataWriter: AbstractUserDataWriter, - stages: Stage[], - converter: unknown = {} + select( + selection: Selectable | string, + ...additionalSelections: Array ): Pipeline { - return new Pipeline(db, userDataReader, userDataWriter, stages); + let projections: Map = this.selectablesToMap([ + selection, + ...additionalSelections + ]); + projections = this.readUserData('select', projections); + return this._addStage(new Select(projections)); } /** * Filters the documents from previous stages to only include those matching the specified {@link - * FilterCondition}. + * BooleanExpr}. * *

This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. * You can filter documents based on their field values, using implementations of {@link - * FilterCondition}, typically including but not limited to: + * BooleanExpr}, typically including but not limited to: * *

    *
  • field comparators: {@link Function#eq}, {@link Function#lt} (less than), {@link @@ -317,25 +272,18 @@ export class Pipeline implements ProtoSerializable { * firestore.pipeline().collection("books") * .where( * and( - * gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0 - * Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") + * gt(field("rating"), 4.0), // Filter for ratings greater than 4.0 + * field("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") * ) * ); * ``` * - * @param condition The {@link FilterCondition} to apply. + * @param condition The {@link BooleanExpr} to apply. * @return A new Pipeline object with this stage appended to the stage list. */ - where(condition: FilterCondition): Pipeline { - const copy = this.stages.map(s => s); + where(condition: BooleanExpr): Pipeline { this.readUserData('where', condition); - copy.push(new Where(condition)); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); + return this._addStage(new Where(condition)); } /** @@ -350,7 +298,7 @@ export class Pipeline implements ProtoSerializable { * ```typescript * // Retrieve the second page of 20 results * firestore.pipeline().collection("books") - * .sort(Field.of("published").descending()) + * .sort(field("published").descending()) * .offset(20) // Skip the first 20 results * .limit(20); // Take the next 20 results * ``` @@ -359,14 +307,7 @@ export class Pipeline implements ProtoSerializable { * @return A new Pipeline object with this stage appended to the stage list. */ offset(offset: number): Pipeline { - const copy = this.stages.map(s => s); - copy.push(new Offset(offset)); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); + return this._addStage(new Offset(offset)); } /** @@ -387,7 +328,7 @@ export class Pipeline implements ProtoSerializable { * ```typescript * // Limit the results to the top 10 highest-rated books * firestore.pipeline().collection("books") - * .sort(Field.of("rating").descending()) + * .sort(field("rating").descending()) * .limit(10); * ``` * @@ -395,32 +336,28 @@ export class Pipeline implements ProtoSerializable { * @return A new Pipeline object with this stage appended to the stage list. */ limit(limit: number): Pipeline { - const copy = this.stages.map(s => s); - copy.push(new Limit(limit)); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); + return this._addStage(new Limit(limit)); } - _limit(limit: number, convertedFromLimitTolast: boolean): Pipeline { - const copy = this.stages.map(s => s); - copy.push(new Limit(limit, convertedFromLimitTolast)); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); + /** + * Internal use only. + * Helper to add a limit stage when converting from a Query. + * + * @internal + * @private + * + * @param limit + * @param convertedFromLimitToLast + */ + _limit(limit: number, convertedFromLimitToLast: boolean): Pipeline { + return this._addStage(new Limit(limit, convertedFromLimitToLast)); } /** * Returns a set of distinct {@link Expr} values from the inputs to this stage. * *

    This stage run through the results from previous stages to include only results with unique - * combinations of {@link Expr} values ({@link Field}, {@link Function}, etc). + * combinations of {@link Expr} values ({@link Field}, {@link Function}, etc.). * *

    The parameters to this stage are defined using {@link Selectable} expressions or {@code string}s: * @@ -436,35 +373,36 @@ export class Pipeline implements ProtoSerializable { * ```typescript * // Get a list of unique author names in uppercase and genre combinations. * firestore.pipeline().collection("books") - * .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt") + * .distinct(toUppercase(field("author")).as("authorName"), field("genre"), "publishedAt") * .select("authorName"); * ``` * - * @param selectables The {@link Selectable} expressions to consider when determining distinct - * value combinations or {@code string}s representing field names. + * @param group The first {@link Selectable} expression to consider when determining distinct + * value combinations or strings representing field names. + * @param additionalGroups Optional additional {@link Selectable} expressions to consider when determining distinct + * value combinations or strings representing field names. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - distinct(...groups: Array): Pipeline { - const copy = this.stages.map(s => s); - copy.push( + distinct( + group: string | Selectable, + ...additionalGroups: Array + ): Pipeline { + return this._addStage( new Distinct( - this.readUserData('distinct', this.selectablesToMap(groups || [])) + this.readUserData( + 'distinct', + this.selectablesToMap([group, ...additionalGroups]) + ) ) ); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); } /** * Performs aggregation operations on the documents from previous stages. * *

    This stage allows you to calculate aggregate values over a set of documents. You define the - * aggregations to perform using {@link AccumulatorTarget} expressions which are typically results of - * calling {@link Expr#as} on {@link Accumulator} instances. + * aggregations to perform using {@link AggregateWithAlias} expressions which are typically results of + * calling {@link Expr#as} on {@link AggregateFunction} instances. * *

    Example: * @@ -472,16 +410,21 @@ export class Pipeline implements ProtoSerializable { * // Calculate the average rating and the total number of books * firestore.pipeline().collection("books") * .aggregate( - * Field.of("rating").avg().as("averageRating"), + * field("rating").avg().as("averageRating"), * countAll().as("totalBooks") * ); * ``` * - * @param accumulators The {@link AccumulatorTarget} expressions, each wrapping an {@link Accumulator} + * @param accumulator The first {@link AggregateWithAlias}, wrapping an {@link AggregateFunction} + * and provide a name for the accumulated results. + * @param additionalAccumulators Optional additional {@link AggregateWithAlias}, each wrapping an {@link AggregateFunction} * and provide a name for the accumulated results. * @return A new Pipeline object with this stage appended to the stage list. */ - aggregate(...accumulators: AccumulatorTarget[]): Pipeline; + aggregate( + accumulator: AggregateWithAlias, + ...additionalAccumulators: AggregateWithAlias[] + ): Pipeline; /** * Performs optionally grouped aggregation operations on the documents from previous stages. * @@ -494,8 +437,8 @@ export class Pipeline implements ProtoSerializable { * If no grouping fields are provided, a single group containing all documents is used. Not * specifying groups is the same as putting the entire inputs into one group.

  • *
  • **Accumulators:** One or more accumulation operations to perform within each group. These - * are defined using {@link AccumulatorTarget} expressions, which are typically created by - * calling {@link Expr#as} on {@link Accumulator} instances. Each aggregation + * are defined using {@link AggregateWithAlias} expressions, which are typically created by + * calling {@link Expr#as} on {@link AggregateFunction} instances. Each aggregation * calculates a value (e.g., sum, average, count) based on the documents within its group.
  • *
* @@ -505,40 +448,43 @@ export class Pipeline implements ProtoSerializable { * // Calculate the average rating for each genre. * firestore.pipeline().collection("books") * .aggregate({ - * accumulators: [avg(Field.of("rating")).as("avg_rating")] + * accumulators: [avg(field("rating")).as("avg_rating")] * groups: ["genre"] * }); * ``` * - * @param aggregate An {@link Aggregate} object that specifies the grouping fields (if any) and - * the aggregation operations to perform. - * @return A new {@code Pipeline} object with this stage appended to the stage list. + * @param options An object that specifies the accumulators + * and optional grouping fields to perform. + * @return A new {@code Pipeline} object with this stage appended to the stage + * list. */ aggregate(options: { - accumulators: AccumulatorTarget[]; + accumulators: AggregateWithAlias[]; groups?: Array; }): Pipeline; aggregate( optionsOrTarget: - | AccumulatorTarget + | AggregateWithAlias | { - accumulators: AccumulatorTarget[]; + accumulators: AggregateWithAlias[]; groups?: Array; }, - ...rest: AccumulatorTarget[] + ...rest: AggregateWithAlias[] ): Pipeline { - const copy = this.stages.map(s => s); if ('accumulators' in optionsOrTarget) { - copy.push( + return this._addStage( new Aggregate( - new Map( - optionsOrTarget.accumulators.map((target: AccumulatorTarget) => [ - (target as unknown as AccumulatorTarget).alias, + new Map( + optionsOrTarget.accumulators.map((target: AggregateWithAlias) => { this.readUserData( 'aggregate', - (target as unknown as AccumulatorTarget).expr - ) - ]) + target as unknown as AggregateWithAlias + ); + return [ + (target as unknown as AggregateWithAlias).alias, + (target as unknown as AggregateWithAlias).aggregate + ]; + }) ), this.readUserData( 'aggregate', @@ -547,14 +493,14 @@ export class Pipeline implements ProtoSerializable { ) ); } else { - copy.push( + return this._addStage( new Aggregate( - new Map( + new Map( [optionsOrTarget, ...rest].map(target => [ - (target as unknown as AccumulatorTarget).alias, + (target as unknown as AggregateWithAlias).alias, this.readUserData( 'aggregate', - (target as unknown as AccumulatorTarget).expr + (target as unknown as AggregateWithAlias).aggregate ) ]) ), @@ -562,37 +508,24 @@ export class Pipeline implements ProtoSerializable { ) ); } - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); } findNearest(options: FindNearestOptions): Pipeline { - const copy = this.stages.map(s => s); const parseContext = this.userDataReader.createContext( UserDataSource.Argument, 'findNearest' ); const value = parseVectorValue(options.vectorValue, parseContext); const vectorObjectValue = new ObjectValue(value); - copy.push( + return this._addStage( new FindNearest( - options.field, + options.field instanceof Field ? options.field : field(options.field), vectorObjectValue, options.distanceMeasure, options.limit, options.distanceField ) ); - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); } /** @@ -611,15 +544,16 @@ export class Pipeline implements ProtoSerializable { * // with the same rating * firestore.pipeline().collection("books") * .sort( - * Ordering.of(Field.of("rating")).descending(), - * Ordering.of(Field.of("title")) // Ascending order is the default + * Ordering.of(field("rating")).descending(), + * Ordering.of(field("title")) // Ascending order is the default * ); * ``` * - * @param orders One or more {@link Ordering} instances specifying the sorting criteria. + * @param ordering The first {@link Ordering} instance specifying the sorting criteria. + * @param additionalOrderings Optional additional {@link Ordering} instances specifying the additional sorting criteria. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - sort(...orderings: Ordering[]): Pipeline; + sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; sort( optionsOrOrderings: | Ordering @@ -628,10 +562,9 @@ export class Pipeline implements ProtoSerializable { }, ...rest: Ordering[] ): Pipeline { - const copy = this.stages.map(s => s); // Option object - if ('orderings' in optionsOrOrderings) { - copy.push( + if (optionsOrOrderings && 'orderings' in optionsOrOrderings) { + return this._addStage( new Sort( this.readUserData( 'sort', @@ -641,17 +574,205 @@ export class Pipeline implements ProtoSerializable { ); } else { // Ordering object - copy.push( + return this._addStage( new Sort(this.readUserData('sort', [optionsOrOrderings, ...rest])) ); } + } - return this.newPipeline( - this._db, - this.userDataReader, - this._userDataWriter, - copy - ); + /** + * Fully overwrites all fields in a document with those coming from a nested map. + * + *

This stage allows you to emit a map value as a document. Each key of the map becomes a field + * on the document that contains the corresponding value. + * + *

Example: + * + * ```typescript + * // Input. + * // { + * // 'name': 'John Doe Jr.', + * // 'parents': { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * // } + * + * // Emit parents as document. + * firestore.pipeline().collection('people').replaceWith('parents'); + * + * // Output + * // { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * ``` + * + * @param fieldName The {@link Field} field containing the nested map. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + replaceWith(fieldName: string): Pipeline; + + /** + * Fully overwrites all fields in a document with those coming from a map. + * + *

This stage allows you to emit a map value as a document. Each key of the map becomes a field + * on the document that contains the corresponding value. + * + *

Example: + * + * ```typescript + * // Input. + * // { + * // 'name': 'John Doe Jr.', + * // 'parents': { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * // } + * + * // Emit parents as document. + * firestore.pipeline().collection('people').replaceWith(map({ + * foo: 'bar', + * info: { + * name: field('name') + * } + * })); + * + * // Output + * // { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * ``` + * + * @param expr An {@link Expr} that when returned evaluates to a map. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + replaceWith(expr: Expr): Pipeline; + replaceWith(value: Expr | string): Pipeline { + const fieldExpr = typeof value === 'string' ? field(value) : value; + this.readUserData('replaceWith', fieldExpr); + return this._addStage(new Replace(fieldExpr, 'full_replace')); + } + + /** + * Performs a pseudo-random sampling of the documents from the previous stage. + * + *

This stage will filter documents pseudo-randomly. The parameter specifies how number of + * documents to be returned. + * + *

Examples: + * + * ```typescript + * // Sample 25 books, if available. + * firestore.pipeline().collection('books') + * .sample(25); + * ``` + * + * @param documents The number of documents to sample. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + sample(documents: number): Pipeline; + + /** + * Performs a pseudo-random sampling of the documents from the previous stage. + * + *

This stage will filter documents pseudo-randomly. The 'options' parameter specifies how + * sampling will be performed. See {@code SampleOptions} for more information. + * + *

Examples: + * + * // Sample 10 books, if available. + * firestore.pipeline().collection("books") + * .sample({ documents: 10 }); + * + * // Sample 50% of books. + * firestore.pipeline().collection("books") + * .sample({ percentage: 0.5 }); + * + * @param options The {@code SampleOptions} specifies how sampling is performed. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + sample(options: { percentage: number } | { documents: number }): Pipeline; + sample( + documentsOrOptions: number | { percentage: number } | { documents: number } + ): Pipeline { + if (typeof documentsOrOptions === 'number') { + return this._addStage(new Sample(documentsOrOptions, 'documents')); + } else if ('percentage' in documentsOrOptions) { + return this._addStage( + new Sample(documentsOrOptions.percentage, 'percent') + ); + } else { + return this._addStage( + new Sample(documentsOrOptions.documents, 'documents') + ); + } + } + + /** + * Performs union of all documents from two pipelines, including duplicates. + * + *

This stage will pass through documents from previous stage, and also pass through documents + * from previous stage of the `other` {@code Pipeline} given in parameter. The order of documents + * emitted from this stage is undefined. + * + *

Example: + * + * ```typescript + * // Emit documents from books collection and magazines collection. + * firestore.pipeline().collection('books') + * .union(firestore.pipeline().collection('magazines')); + * ``` + * + * @param other The other {@code Pipeline} that is part of union. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + union(other: Pipeline): Pipeline { + return this._addStage(new Union(other)); + } + + /** + * Produces a document for each element in array found in previous stage document. + * + * For each previous stage document, this stage will emit zero or more augmented documents. The + * input array found in the previous stage document field specified by the `selectable` parameter, + * will emit an augmented document for each input array element. The input array element will + * augment the previous stage document by setting the `alias` field with the array element value. + * + * When `selectable` evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for + * the current input document, returning it as is with the `alias` field absent. + * + * No documents are emitted when `selectable` evaluates to an empty array. + * + * Example: + * + * ```typescript + * // Input: + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tags": [ "comedy", "space", "adventure" ], ... } + * + * // Emit a book document for each tag of the book. + * firestore.pipeline().collection("books") + * .unnest(field("tags").as('tag'), 'tagIndex'); + * + * // Output: + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "comedy", "tagIndex": 0, ... } + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "space", "tagIndex": 1, ... } + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "adventure", "tagIndex": 2, ... } + * ``` + * + * @param selectable A selectable expression defining the field to unnest and the alias to use for each un-nested element in the output documents. + * @param indexField An optional string value specifying the field path to write the offset (starting at zero) into the array the un-nested element is from + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + unnest(selectable: Selectable, indexField?: string): Pipeline { + this.readUserData('unnest', selectable.expr); + + const alias = field(selectable.alias); + this.readUserData('unnest', alias); + + return this._addStage(new Unnest(selectable.expr, alias, indexField)); } /** @@ -666,7 +787,7 @@ export class Pipeline implements ProtoSerializable { * ```typescript * // Assume we don't have a built-in "where" stage * firestore.pipeline().collection("books") - * .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage + * .genericStage("where", [field("published").lt(1900)]) // Custom "where" stage * .select("title", "author"); * ``` * @@ -674,14 +795,45 @@ export class Pipeline implements ProtoSerializable { * @param params A list of parameters to configure the generic stage's behavior. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - genericStage(name: string, params: any[]): Pipeline { - const copy = this.stages.map(s => s); - params.forEach(param => { + genericStage(name: string, params: unknown[]): Pipeline { + // Convert input values to Expressions. + // We treat objects as mapValues and arrays as arrayValues, + // this is unlike the default conversion for objects and arrays + // passed to an expression. + const expressionParams = params.map((value: unknown) => { + if (value instanceof Expr) { + return value; + } else if (value instanceof AggregateFunction) { + return value; + } else if (isPlainObject(value)) { + return _mapValue(value as Record); + } else { + return new Constant(value); + } + }); + + expressionParams.forEach(param => { if (isReadableUserData(param)) { param._readUserData(this.userDataReader); } }); - copy.push(new GenericStage(name, params)); + return this._addStage(new GenericStage(name, expressionParams)); + } + + /** + * @internal + * @private + */ + _toProto(jsonProtoSerializer: JsonProtoSerializer): ProtoPipeline { + const stages: ProtoStage[] = this.stages.map(stage => + stage._toProto(jsonProtoSerializer) + ); + return { stages }; + } + + private _addStage(stage: Stage): Pipeline { + const copy = this.stages.map(s => s); + copy.push(stage); return this.newPipeline( this._db, this.userDataReader, @@ -690,74 +842,62 @@ export class Pipeline implements ProtoSerializable { ); } + private selectablesToMap( + selectables: Array + ): Map { + const result = new Map(); + for (const selectable of selectables) { + if (typeof selectable === 'string') { + result.set(selectable as string, field(selectable)); + } else if (selectable instanceof Field) { + result.set(selectable.alias, selectable.expr); + } else if (selectable instanceof ExprWithAlias) { + result.set(selectable.alias, selectable.expr); + } + } + return result; + } + /** - * Executes this pipeline and returns a Promise to represent the asynchronous operation. - * - *

The returned Promise can be used to track the progress of the pipeline execution - * and retrieve the results (or handle any errors) asynchronously. - * - *

The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link - * PipelineResult} typically represents a single key/value map that has passed through all the - * stages of the pipeline, however this might differ depending on the stages involved in the - * pipeline. For example: - * - *

    - *
  • If there are no stages or only transformation stages, each {@link PipelineResult} - * represents a single document.
  • - *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, - * representing the aggregated results over the entire dataset .
  • - *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a - * distinct group and its associated aggregated values.
  • - *
- * - *

Example: - * - * ```typescript - * const futureResults = await firestore.pipeline().collection("books") - * .where(gt(Field.of("rating"), 4.5)) - * .select("title", "author", "rating") - * .execute(); - * ``` - * - * @return A Promise representing the asynchronous pipeline execution. + * Reads user data for each expression in the expressionMap. + * @param name Name of the calling function. Used for error messages when invalid user data is encountered. + * @param expressionMap + * @return the expressionMap argument. + * @private */ - execute(): Promise { - const datastore = getDatastore(this._db); - return invokeExecutePipeline(datastore, this).then(result => { - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - this._userDataWriter, - element.key?.path - ? new DocumentReference(this._db, null, element.key) - : undefined, - element.fields, - element.executionTime?.toTimestamp(), - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - ) - ); - - return docs; - }); + private readUserData< + T extends + | Map + | ReadableUserData[] + | ReadableUserData + >(name: string, expressionMap: T): T { + if (isReadableUserData(expressionMap)) { + expressionMap._readUserData(this.userDataReader); + } else if (Array.isArray(expressionMap)) { + expressionMap.forEach(readableData => + readableData._readUserData(this.userDataReader) + ); + } else { + expressionMap.forEach(expr => expr._readUserData(this.userDataReader)); + } + return expressionMap; } /** * @internal * @private + * @param db + * @param userDataReader + * @param userDataWriter + * @param stages + * @protected */ - _toProto(jsonProtoSerializer: JsonProtoSerializer): ExecutePipelineRequest { - const stages: ProtoStage[] = this.stages.map(stage => - stage._toProto(jsonProtoSerializer) - ); - const structuredPipeline: StructuredPipeline = { pipeline: { stages } }; - return { - database: getEncodedDatabaseId(jsonProtoSerializer), - structuredPipeline - }; + protected newPipeline( + db: Firestore, + userDataReader: UserDataReader, + userDataWriter: AbstractUserDataWriter, + stages: Stage[] + ): Pipeline { + return new Pipeline(db, userDataReader, userDataWriter, stages); } } diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index 98b121ad485..c1ca940a56b 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -15,11 +15,14 @@ * limitations under the License. */ +import { invokeExecutePipeline } from '../remote/datastore'; + +import { getDatastore } from './components'; import { Firestore } from './database'; import { Pipeline } from './pipeline'; -import { PipelineResult } from './pipeline-result'; +import { PipelineResult, PipelineSnapshot } from './pipeline-result'; import { PipelineSource } from './pipeline-source'; -import { Query } from './reference'; +import { DocumentReference } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { Stage } from './stage'; import { newUserDataReader } from './user_data_reader'; @@ -30,67 +33,74 @@ declare module './database' { } } -declare module './reference' { - interface Query { - pipeline(): Pipeline; - } -} - -/** - * Modular API for console experimentation. - * @param pipeline Execute this pipeline. - * @beta - */ -export function execute(pipeline: Pipeline): Promise { - return pipeline.execute(); -} - -/** - * Experimental Modular API for console testing. - * @param firestore - */ -export function pipeline(firestore: Firestore): PipelineSource; - /** - * Experimental Modular API for console testing. - * @param query + * Executes this pipeline and returns a Promise to represent the asynchronous operation. + * + * The returned Promise can be used to track the progress of the pipeline execution + * and retrieve the results (or handle any errors) asynchronously. + * + * The pipeline results are returned as a {@link PipelineSnapshot} that contains + * a list of {@link PipelineResult} objects. Each {@link PipelineResult} typically + * represents a single key/value map that has passed through all the + * stages of the pipeline, however this might differ depending on the stages involved in the + * pipeline. For example: + * + *

    + *
  • If there are no stages or only transformation stages, each {@link PipelineResult} + * represents a single document.
  • + *
  • If there is an aggregation, only a single {@link PipelineResult} is returned, + * representing the aggregated results over the entire dataset .
  • + *
  • If there is an aggregation stage with grouping, each {@link PipelineResult} represents a + * distinct group and its associated aggregated values.
  • + *
+ * + *

Example: + * + * ```typescript + * const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books") + * .where(gt(field("rating"), 4.5)) + * .select("title", "author", "rating")); + * + * const results: PipelineResults = snapshot.results; + * ``` + * + * @param pipeline The pipeline to execute. + * @return A Promise representing the asynchronous pipeline execution. */ -export function pipeline(query: Query): Pipeline; - -export function pipeline( - firestoreOrQuery: Firestore | Query -): PipelineSource | Pipeline { - if (firestoreOrQuery instanceof Firestore) { - const db = firestoreOrQuery; - const userDataWriter = new LiteUserDataWriter(db); - const userDataReader = newUserDataReader(db); - return new PipelineSource((stages: Stage[]) => { - return new Pipeline(db, userDataReader, userDataWriter, stages); - }); - } else { - let pipeline; - const query = firestoreOrQuery; - if (query._query.collectionGroup) { - pipeline = query.firestore - .pipeline() - .collectionGroup(query._query.collectionGroup); - } else { - pipeline = query.firestore - .pipeline() - .collection(query._query.path.canonicalString()); - } +export function execute(pipeline: Pipeline): Promise { + const datastore = getDatastore(pipeline._db); + return invokeExecutePipeline(datastore, pipeline).then(result => { + // Get the execution time from the first result. + // firestoreClientExecutePipeline returns at least one PipelineStreamElement + // even if the returned document set is empty. + const executionTime = + result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined; - // TODO(pipeline) convert existing query filters, limits, etc into - // pipeline stages + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + pipeline._userDataWriter, + element.key?.path + ? new DocumentReference(pipeline._db, null, element.key) + : undefined, + element.fields, + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + ) + ); - return pipeline; - } + return new PipelineSnapshot(pipeline, docs, executionTime); + }); } Firestore.prototype.pipeline = function (): PipelineSource { - return pipeline(this); -}; - -Query.prototype.pipeline = function (): Pipeline { - return pipeline(this); + const userDataWriter = new LiteUserDataWriter(this); + const userDataReader = newUserDataReader(this); + return new PipelineSource(this._databaseId, (stages: Stage[]) => { + return new Pipeline(this, userDataReader, userDataWriter, stages); + }); }; diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 26ae2fbd433..e9f5685e2b1 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -581,7 +581,7 @@ export function doc( ) { throw new FirestoreError( Code.INVALID_ARGUMENT, - 'Expected first argument to collection() to be a CollectionReference, ' + + 'Expected first argument to doc() to be a CollectionReference, ' + 'a DocumentReference or FirebaseFirestore' ); } diff --git a/packages/firestore/src/lite-api/snapshot.ts b/packages/firestore/src/lite-api/snapshot.ts index 3024e2e9db0..66c3a1422e9 100644 --- a/packages/firestore/src/lite-api/snapshot.ts +++ b/packages/firestore/src/lite-api/snapshot.ts @@ -23,6 +23,7 @@ import { FieldPath as InternalFieldPath } from '../model/path'; import { arrayEquals } from '../util/misc'; import { Firestore } from './database'; +import { Field } from './expressions'; import { FieldPath } from './field_path'; import { DocumentData, @@ -515,12 +516,14 @@ export function snapshotEqual( */ export function fieldPathFromArgument( methodName: string, - arg: string | FieldPath | Compat + arg: string | FieldPath | Compat | Field ): InternalFieldPath { if (typeof arg === 'string') { return fieldPathFromDotSeparatedString(methodName, arg); } else if (arg instanceof FieldPath) { return arg._internalPath; + } else if (arg instanceof Field) { + return fieldPathFromDotSeparatedString(methodName, arg.fieldName()); } else { return arg._delegate._internalPath; } diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 46f8fe60654..1d8ae06eaf6 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -25,17 +25,20 @@ import { JsonProtoSerializer, ProtoSerializable, toMapValue, + toPipelineValue, toStringValue } from '../remote/serializer'; import { hardAssert } from '../util/assert'; import { - Accumulator, + AggregateFunction, Expr, Field, - FilterCondition, - Ordering + BooleanExpr, + Ordering, + field } from './expressions'; +import { Pipeline } from './pipeline'; import { DocumentReference } from './reference'; import { VectorValue } from './vector_value'; @@ -66,6 +69,26 @@ export class AddFields implements Stage { } } +/** + * @beta + */ +export class RemoveFields implements Stage { + name = 'remove_fields'; + + constructor(private fields: Field[]) {} + + /** + * @internal + * @private + */ + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: this.fields.map(f => f._toProto(serializer)) + }; + } +} + /** * @beta */ @@ -73,7 +96,7 @@ export class Aggregate implements Stage { name = 'aggregate'; constructor( - private accumulators: Map, + private accumulators: Map, private groups: Map ) {} @@ -181,8 +204,16 @@ export class DocumentsSource implements Stage { constructor(private docPaths: string[]) {} - static of(refs: DocumentReference[]): DocumentsSource { - return new DocumentsSource(refs.map(ref => '/' + ref.path)); + static of(refs: Array): DocumentsSource { + return new DocumentsSource( + refs.map(ref => + ref instanceof DocumentReference + ? '/' + ref.path + : ref.startsWith('/') + ? ref + : '/' + ref + ) + ); } /** @@ -205,7 +236,7 @@ export class DocumentsSource implements Stage { export class Where implements Stage { name = 'where'; - constructor(private condition: FilterCondition) {} + constructor(private condition: BooleanExpr) {} /** * @internal @@ -223,7 +254,7 @@ export class Where implements Stage { * @beta */ export interface FindNearestOptions { - field: Field; + field: Field | string; vectorValue: VectorValue | number[]; distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; limit?: number; @@ -267,9 +298,7 @@ export class FindNearest implements Stage { if (this._distanceField) { // eslint-disable-next-line camelcase - options.distance_field = Field.of(this._distanceField)._toProto( - serializer - ); + options.distance_field = field(this._distanceField)._toProto(serializer); } return { @@ -372,18 +401,108 @@ export class Sort implements Stage { } } +/** + * @beta + */ +export class Sample implements Stage { + name = 'sample'; + + constructor(private limit: number, private mode: string) {} + + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toNumber(serializer, this.limit)!, toStringValue(this.mode)!] + }; + } +} + +/** + * @beta + */ +export class Union implements Stage { + name = 'union'; + + constructor(private _other: Pipeline) {} + + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [toPipelineValue(this._other._toProto(serializer))] + }; + } +} + +/** + * @beta + */ +export class Unnest implements Stage { + name = 'unnest'; + constructor( + private expr: Expr, + private alias: Field, + private indexField?: string + ) {} + + _toProto(serializer: JsonProtoSerializer): ProtoStage { + const stageProto: ProtoStage = { + name: this.name, + args: [this.expr._toProto(serializer), this.alias._toProto(serializer)] + }; + + if (this.indexField) { + stageProto.options = { + indexField: toStringValue(this.indexField) + }; + } + + return stageProto; + } +} + +/** + * @beta + */ +export class Replace implements Stage { + name = 'replace_with'; + + constructor( + private field: Expr, + private mode: + | 'full_replace' + | 'merge_prefer_nest' + | 'merge_prefer_parent' = 'full_replace' + ) {} + + _toProto(serializer: JsonProtoSerializer): ProtoStage { + return { + name: this.name, + args: [this.field._toProto(serializer), toStringValue(this.mode)] + }; + } +} + /** * @beta */ export class GenericStage implements Stage { - constructor(public name: string, params: unknown[]) {} + /** + * @private + * @internal + */ + constructor( + public name: string, + private params: Array + ) {} /** * @internal * @private */ _toProto(serializer: JsonProtoSerializer): ProtoStage { - // TODO support generic stage - return {}; + return { + name: this.name, + args: this.params.map(o => o._toProto(serializer)) + }; } } diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index 42f905d5cab..e3e0deaa479 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -22,7 +22,7 @@ import { } from '@firebase/firestore-types'; import { Compat, deepEqual, getModularInstance } from '@firebase/util'; -import { ParseContext } from '../api/parse_context'; +import { ContextSettings, ParseContext } from '../api/parse_context'; import { DatabaseId } from '../core/database_info'; import { DocumentKey } from '../model/document_key'; import { FieldMask } from '../model/field_mask'; @@ -56,7 +56,8 @@ import { JsonProtoSerializer, toBytes, toResourceName, - toTimestamp + toTimestamp, + isProtoValueSerializable } from '../remote/serializer'; import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; @@ -179,33 +180,6 @@ function isWrite(dataSource: UserDataSource): boolean { } } -/** Contains the settings that are mutated as we parse user data. */ -interface ContextSettings { - /** Indicates what kind of API method this data came from. */ - readonly dataSource: UserDataSource; - /** The name of the method the user called to create the ParseContext. */ - readonly methodName: string; - /** The document the user is attempting to modify, if that applies. */ - readonly targetDoc?: DocumentKey; - /** - * A path within the object being parsed. This could be an empty path (in - * which case the context represents the root of the data being parsed), or a - * nonempty path (indicating the context represents a nested location within - * the data). - */ - readonly path?: InternalFieldPath; - /** - * Whether or not this context corresponds to an element of an array. - * If not set, elements are treated as if they were outside of arrays. - */ - readonly arrayElement?: boolean; - /** - * Whether or not a converter was specified in this context. If true, error - * messages will reference the converter when invalid data is provided. - */ - readonly hasConverter?: boolean; -} - /** A "context" object passed around while parsing user data. */ class ParseContextImpl implements ParseContext { readonly fieldTransforms: FieldTransform[]; @@ -729,7 +703,7 @@ export function parseQueryValue( */ export function parseData( input: unknown, - context: ParseContextImpl + context: ParseContext ): ProtoValue | null { // Unwrap the API type from the Compat SDK. This will return the API type // from firestore-exp. @@ -780,7 +754,7 @@ export function parseData( function parseObject( obj: Dict, - context: ParseContextImpl + context: ParseContext ): { mapValue: ProtoMapValue } { const fields: Dict = {}; @@ -802,7 +776,7 @@ function parseObject( return { mapValue: { fields } }; } -function parseArray(array: unknown[], context: ParseContextImpl): ProtoValue { +function parseArray(array: unknown[], context: ParseContext): ProtoValue { const values: ProtoValue[] = []; let entryIndex = 0; for (const entry of array) { @@ -827,7 +801,7 @@ function parseArray(array: unknown[], context: ParseContextImpl): ProtoValue { */ function parseSentinelFieldValue( value: FieldValue, - context: ParseContextImpl + context: ParseContext ): void { // Sentinels are only supported with writes, and not within arrays. if (!isWrite(context.dataSource)) { @@ -854,7 +828,7 @@ function parseSentinelFieldValue( */ export function parseScalarValue( value: unknown, - context: ParseContextImpl + context: ParseContext ): ProtoValue | null { value = getModularInstance(value); @@ -909,6 +883,8 @@ export function parseScalarValue( }; } else if (value instanceof VectorValue) { return parseVectorValue(value, context); + } else if (isProtoValueSerializable(value)) { + return value._toProto(context.serializer); } else { throw context.createError( `Unsupported field value: ${valueDescription(value)}` @@ -921,7 +897,7 @@ export function parseScalarValue( */ export function parseVectorValue( value: VectorValue | number[], - context: ParseContextImpl + context: ParseContext ): { mapValue: ProtoMapValue } { const values = value instanceof VectorValue ? value.toArray() : value; const mapValue: ProtoMapValue = { @@ -955,7 +931,7 @@ export function parseVectorValue( * GeoPoints, etc. are not considered to look like JSON objects since they map * to specific FieldValue types other than ObjectValue. */ -function looksLikeJsonObject(input: unknown): boolean { +export function looksLikeJsonObject(input: unknown): boolean { return ( typeof input === 'object' && input !== null && @@ -966,13 +942,14 @@ function looksLikeJsonObject(input: unknown): boolean { !(input instanceof Bytes) && !(input instanceof DocumentReference) && !(input instanceof FieldValue) && - !(input instanceof VectorValue) + !(input instanceof VectorValue) && + !isProtoValueSerializable(input) ); } function validatePlainObject( message: string, - context: ParseContextImpl, + context: ParseContext, input: unknown ): asserts input is Dict { if (!looksLikeJsonObject(input) || !isPlainObject(input)) { diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index 00c1e7fca9e..32666feeea1 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -59,7 +59,8 @@ import { toQueryTarget, toResourcePath, toRunAggregationQueryRequest, - fromPipelineResponse + fromPipelineResponse, + getEncodedDatabaseId } from './serializer'; /** @@ -244,7 +245,12 @@ export async function invokeExecutePipeline( pipeline: Pipeline ): Promise { const datastoreImpl = debugCast(datastore, DatastoreImpl); - const executePipelineRequest = pipeline._toProto(datastoreImpl.serializer); + const executePipelineRequest: ProtoExecutePipelineRequest = { + database: getEncodedDatabaseId(datastoreImpl.serializer), + structuredPipeline: { + pipeline: pipeline._toProto(datastoreImpl.serializer) + } + }; const response = await datastoreImpl.invokeStreamingRPC< ProtoExecutePipelineRequest, diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index 4759571b4a5..1ed2c7cd381 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { ParseContext } from '../api/parse_context'; import { Aggregate } from '../core/aggregate'; import { Bound } from '../core/bound'; import { DatabaseId } from '../core/database_info'; @@ -94,7 +95,8 @@ import { WriteResult as ProtoWriteResult, Value as ProtoValue, MapValue as ProtoMapValue, - ExecutePipelineResponse as ProtoExecutePipelineResponse + ExecutePipelineResponse as ProtoExecutePipelineResponse, + Pipeline } from '../protos/firestore_proto_api'; import { debugAssert, fail, hardAssert } from '../util/assert'; import { ByteString } from '../util/byte_string'; @@ -1433,8 +1435,24 @@ export interface ProtoSerializable { _toProto(serializer: JsonProtoSerializer): ProtoType; } +export interface ProtoValueSerializable extends ProtoSerializable { + // Supports runtime identification of the ProtoSerializable type. + _protoValueType: 'ProtoValue'; +} + +export function isProtoValueSerializable( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any +): value is ProtoValueSerializable { + return ( + !!value && + typeof value._toProto === 'function' && + value._protoValueType === 'ProtoValue' + ); +} + export interface UserData { - _readUserData(dataReader: UserDataReader): void; + _readUserData(dataReader: UserDataReader, context?: ParseContext): void; } export function toMapValue( @@ -1466,6 +1484,10 @@ export function toStringValue(value: string): ProtoValue { return { stringValue: value }; } +export function toPipelineValue(value: Pipeline): ProtoValue { + return { pipelineValue: value }; +} + export function dateToTimestampValue( serializer: JsonProtoSerializer, value: Date diff --git a/packages/firestore/src/util/types.ts b/packages/firestore/src/util/types.ts index c298bfe2131..361ebda1935 100644 --- a/packages/firestore/src/util/types.ts +++ b/packages/firestore/src/util/types.ts @@ -51,6 +51,10 @@ export function isSafeInteger(value: unknown): boolean { ); } +export function isString(value: unknown): value is string { + return typeof value === 'string'; +} + /** The subset of the browser's Window interface used by the SDK. */ export interface WindowLike { readonly localStorage: Storage; diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 48441c26065..7fc26ce58cd 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -18,312 +18,914 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { Bytes, vector } from '../../../src/api'; -import { GeoPoint } from '../../../src/lite-api/geo_point'; -import { Timestamp } from '../../../src/lite-api/timestamp'; +import { + AggregateFunction, + ascending, + BooleanExpr, + byteLength, + constantVector, + FunctionExpr, + timestampAdd, + timestampToUnixMicros, + timestampToUnixMillis, + timestampToUnixSeconds, + toLower, + unixMicrosToTimestamp, + unixMillisToTimestamp, + vectorLength +} from '../../../src/lite-api/expressions'; +import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { - pipeline, + GeoPoint, + Timestamp, + Bytes, + getFirestore, + terminate, + vector, + CollectionReference, + doc, + DocumentData, + Firestore, + setDoc, + setLogLevel, + collection, + documentId as documentIdFieldPath, + writeBatch, + addDoc +} from '../util/firebase_export'; +import { apiDescribe, withTestCollection, itIf } from '../util/helpers'; +import { + array, + mod, + pipelineResultEqual, + sum, + replaceFirst, + replaceAll, + descending, + isNan, + map, execute, - _internalPipelineToExecutePipelineRequestProto, add, - andFunction, + arrayContainsAll, + unixSecondsToTimestamp, + and, arrayContains, arrayContainsAny, - avgFunction, - CollectionReference, - Constant, + count, + avg, cosineDistance, + not, countAll, - doc, - DocumentData, dotProduct, endsWith, eq, + reverse, + toUpper, euclideanDistance, - Field, - Firestore, gt, like, lt, + strContains, + divide, lte, + arrayLength, + arrayConcat, mapGet, neq, - not, - orFunction, - PipelineResult, + or, regexContains, regexMatch, - setDoc, startsWith, + strConcat, subtract, - setLogLevel, cond, eqAny, logicalMaximum, - logicalMinimum, notEqAny, - query, - where, - FieldPath, - orderBy, - limit, - limitToLast, - startAt, - startAfter, - endAt, - endBefore, - collectionGroup, - collection, - and, + multiply, + countIf, + bitAnd, + bitOr, + bitXor, + bitNot, + exists, + bitLeftShift, + charLength, + bitRightShift, + rand, + arrayOffset, + minimum, + maximum, + currentContext, + isError, + ifError, + trim, + isAbsent, + isNull, + isNotNull, + isNotNan, + timestampSub, + mapRemove, + mapMerge, documentId, - addDoc, - getDoc -} from '../util/firebase_export'; -import { - apiDescribe, - PERSISTENCE_MODE_UNSPECIFIED, - withTestCollection -} from '../util/helpers'; + substr, + logicalMinimum, + xor, + field, + constant, + _internalPipelineToExecutePipelineRequestProto, + FindNearestOptions +} from '../util/pipeline_export'; use(chaiAsPromised); setLogLevel('debug'); +const testUnsupportedFeatures = false; + apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); - describe('books tests', () => { - let firestore: Firestore; - let randomCol: CollectionReference; - - async function testCollectionWithDocs(docs: { - [id: string]: DocumentData; - }): Promise> { - for (const id in docs) { - if (docs.hasOwnProperty(id)) { - const ref = doc(randomCol, id); - await setDoc(ref, docs[id]); - } + let firestore: Firestore; + let randomCol: CollectionReference; + let beginDocCreation: number = 0; + let endDocCreation: number = 0; + + const timestampDeltaMS = 1000; + + async function testCollectionWithDocs(docs: { + [id: string]: DocumentData; + }): Promise> { + beginDocCreation = new Date().valueOf(); + for (const id in docs) { + if (docs.hasOwnProperty(id)) { + const ref = doc(randomCol, id); + await setDoc(ref, docs[id]); } - return randomCol; } - - function expectResults( - result: Array>, - ...docs: string[] - ): void; - function expectResults( - result: Array>, - ...data: DocumentData[] - ): void; - - function expectResults( - result: Array>, - ...data: DocumentData[] | string[] - ): void { - expect(result.length).to.equal(data.length); - - if (data.length > 0) { - if (typeof data[0] === 'string') { - const actualIds = result.map(result => result.ref?.id); - expect(actualIds).to.deep.equal(data); - } else { - result.forEach(r => { - expect(r.data()).to.deep.equal(data.shift()); - }); - } + endDocCreation = new Date().valueOf(); + return randomCol; + } + + function expectResults(snapshot: PipelineSnapshot, ...docs: string[]): void; + function expectResults( + snapshot: PipelineSnapshot, + ...data: DocumentData[] + ): void; + + function expectResults( + snapshot: PipelineSnapshot, + ...data: DocumentData[] | string[] + ): void { + const docs = snapshot.results; + + expect(docs.length).to.equal(data.length); + + if (data.length > 0) { + if (typeof data[0] === 'string') { + const actualIds = docs.map(doc => doc.id); + expect(actualIds).to.deep.equal(data); + } else { + docs.forEach(r => { + expect(r.data()).to.deep.equal(data.shift()); + }); } } - - async function setupBookDocs(): Promise> { - const bookDocs: { [id: string]: DocumentData } = { - book1: { - title: "The Hitchhiker's Guide to the Galaxy", - author: 'Douglas Adams', - genre: 'Science Fiction', - published: 1979, - rating: 4.2, - tags: ['comedy', 'space', 'adventure'], - awards: { - hugo: true, - nebula: false, - others: { unknown: { year: 1980 } } - }, - nestedField: { 'level.1': { 'level.2': true } } - }, - book2: { - title: 'Pride and Prejudice', - author: 'Jane Austen', - genre: 'Romance', - published: 1813, - rating: 4.5, - tags: ['classic', 'social commentary', 'love'], - awards: { none: true } - }, - book3: { - title: 'One Hundred Years of Solitude', - author: 'Gabriel García Márquez', - genre: 'Magical Realism', - published: 1967, - rating: 4.3, - tags: ['family', 'history', 'fantasy'], - awards: { nobel: true, nebula: false } - }, - book4: { - title: 'The Lord of the Rings', - author: 'J.R.R. Tolkien', - genre: 'Fantasy', - published: 1954, - rating: 4.7, - tags: ['adventure', 'magic', 'epic'], - awards: { hugo: false, nebula: false } - }, - book5: { - title: "The Handmaid's Tale", - author: 'Margaret Atwood', - genre: 'Dystopian', - published: 1985, - rating: 4.1, - tags: ['feminism', 'totalitarianism', 'resistance'], - awards: { 'arthur c. clarke': true, 'booker prize': false } - }, - book6: { - title: 'Crime and Punishment', - author: 'Fyodor Dostoevsky', - genre: 'Psychological Thriller', - published: 1866, - rating: 4.3, - tags: ['philosophy', 'crime', 'redemption'], - awards: { none: true } - }, - book7: { - title: 'To Kill a Mockingbird', - author: 'Harper Lee', - genre: 'Southern Gothic', - published: 1960, - rating: 4.2, - tags: ['racism', 'injustice', 'coming-of-age'], - awards: { pulitzer: true } - }, - book8: { - title: '1984', - author: 'George Orwell', - genre: 'Dystopian', - published: 1949, - rating: 4.2, - tags: ['surveillance', 'totalitarianism', 'propaganda'], - awards: { prometheus: true } - }, - book9: { - title: 'The Great Gatsby', - author: 'F. Scott Fitzgerald', - genre: 'Modernist', - published: 1925, - rating: 4.0, - tags: ['wealth', 'american dream', 'love'], - awards: { none: true } + } + + async function setupBookDocs(): Promise> { + const bookDocs: { [id: string]: DocumentData } = { + book1: { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } }, - book10: { - title: 'Dune', - author: 'Frank Herbert', - genre: 'Science Fiction', - published: 1965, - rating: 4.6, - tags: ['politics', 'desert', 'ecology'], - awards: { hugo: true, nebula: true } - } - }; - return testCollectionWithDocs(bookDocs); - } + nestedField: { 'level.1': { 'level.2': true } }, + embedding: vector([10, 1, 1, 1, 1, 1, 1, 1, 1, 1]) + }, + book2: { + title: 'Pride and Prejudice', + author: 'Jane Austen', + genre: 'Romance', + published: 1813, + rating: 4.5, + tags: ['classic', 'social commentary', 'love'], + awards: { none: true }, + embedding: vector([1, 10, 1, 1, 1, 1, 1, 1, 1, 1]) + }, + book3: { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + genre: 'Magical Realism', + published: 1967, + rating: 4.3, + tags: ['family', 'history', 'fantasy'], + awards: { nobel: true, nebula: false }, + embedding: vector([1, 1, 10, 1, 1, 1, 1, 1, 1, 1]) + }, + book4: { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false }, + remarks: null, + cost: NaN, + embedding: vector([1, 1, 1, 10, 1, 1, 1, 1, 1, 1]) + }, + book5: { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + genre: 'Dystopian', + published: 1985, + rating: 4.1, + tags: ['feminism', 'totalitarianism', 'resistance'], + awards: { 'arthur c. clarke': true, 'booker prize': false }, + embedding: vector([1, 1, 1, 1, 10, 1, 1, 1, 1, 1]) + }, + book6: { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + genre: 'Psychological Thriller', + published: 1866, + rating: 4.3, + tags: ['philosophy', 'crime', 'redemption'], + awards: { none: true }, + embedding: vector([1, 1, 1, 1, 1, 10, 1, 1, 1, 1]) + }, + book7: { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + genre: 'Southern Gothic', + published: 1960, + rating: 4.2, + tags: ['racism', 'injustice', 'coming-of-age'], + awards: { pulitzer: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 10, 1, 1, 1]) + }, + book8: { + title: '1984', + author: 'George Orwell', + genre: 'Dystopian', + published: 1949, + rating: 4.2, + tags: ['surveillance', 'totalitarianism', 'propaganda'], + awards: { prometheus: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 10, 1, 1]) + }, + book9: { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + genre: 'Modernist', + published: 1925, + rating: 4.0, + tags: ['wealth', 'american dream', 'love'], + awards: { none: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 1, 10, 1]) + }, + book10: { + title: 'Dune', + author: 'Frank Herbert', + genre: 'Science Fiction', + published: 1965, + rating: 4.6, + tags: ['politics', 'desert', 'ecology'], + awards: { hugo: true, nebula: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 1, 1, 10]) + } + }; + return testCollectionWithDocs(bookDocs); + } + + let testDeferred: Deferred | undefined; + let withTestCollectionPromise: Promise | undefined; + + beforeEach(async () => { + const setupDeferred = new Deferred(); + testDeferred = new Deferred(); + withTestCollectionPromise = withTestCollection( + persistence, + {}, + async (collectionRef, firestoreInstance) => { + randomCol = collectionRef; + firestore = firestoreInstance; + await setupBookDocs(); + setupDeferred.resolve(); + + return testDeferred?.promise; + } + ); - let testDeferred: Deferred | undefined; - let withTestCollectionPromise: Promise | undefined; - - beforeEach(async () => { - const setupDeferred = new Deferred(); - testDeferred = new Deferred(); - withTestCollectionPromise = withTestCollection( - persistence, - {}, - async (collectionRef, firestoreInstance) => { - randomCol = collectionRef; - firestore = firestoreInstance; - await setupBookDocs(); - setupDeferred.resolve(); - - return testDeferred?.promise; - } + await setupDeferred.promise; + }); + + afterEach(async () => { + testDeferred?.resolve(); + await withTestCollectionPromise; + }); + + describe('pipeline results', () => { + it('empty snapshot as expected', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol.path).limit(0) + ); + expect(snapshot.results.length).to.equal(0); + }); + + // Skipping because __name__ is not currently working in DBE + itIf(testUnsupportedFeatures)('full snapshot as expected', async () => { + const ppl = firestore + .pipeline() + .collection(randomCol.path) + .sort(ascending('__name__')); + const snapshot = await execute(ppl); + expect(snapshot.results.length).to.equal(10); + expect(snapshot.pipeline).to.equal(ppl); + expectResults( + snapshot, + 'book1', + 'book10', + 'book2', + 'book3', + 'book4', + 'book5', + 'book6', + 'book7', + 'book8', + 'book9' + ); + }); + + it('result equals works', async () => { + const ppl = firestore + .pipeline() + .collection(randomCol.path) + .sort(ascending('title')) + .limit(1); + const snapshot1 = await execute(ppl); + const snapshot2 = await execute(ppl); + expect(snapshot1.results.length).to.equal(1); + expect(snapshot2.results.length).to.equal(1); + expect(pipelineResultEqual(snapshot1.results[0], snapshot2.results[0])).to + .be.true; + }); + + it('returns execution time', async () => { + const start = new Date().valueOf(); + const pipeline = firestore.pipeline().collection(randomCol.path); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + timestampDeltaMS + ); + }); + + it('returns execution time for an empty query', async () => { + const start = new Date().valueOf(); + const pipeline = firestore.pipeline().collection(randomCol.path).limit(0); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.results.length).to.equal(0); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + timestampDeltaMS + ); + }); + + it('returns create and update time for each document', async () => { + const pipeline = firestore.pipeline().collection(randomCol.path); + + let snapshot = await execute(pipeline); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(doc => { + expect(doc.createTime).to.not.be.null; + expect(doc.updateTime).to.not.be.null; + + expect(doc.createTime!.toDate().valueOf()).to.approximately( + (beginDocCreation + endDocCreation) / 2, + timestampDeltaMS + ); + expect(doc.updateTime!.toDate().valueOf()).to.approximately( + (beginDocCreation + endDocCreation) / 2, + timestampDeltaMS + ); + expect(doc.createTime?.valueOf()).to.equal(doc.updateTime?.valueOf()); + }); + + const wb = writeBatch(firestore); + snapshot.results.forEach(doc => { + wb.update(doc.ref!, { newField: 'value' }); + }); + await wb.commit(); + + snapshot = await execute(pipeline); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(doc => { + expect(doc.createTime).to.not.be.null; + expect(doc.updateTime).to.not.be.null; + expect(doc.createTime!.toDate().valueOf()).to.be.lessThan( + doc.updateTime!.toDate().valueOf() + ); + }); + }); + + it('returns execution time for an aggregate query', async () => { + const start = new Date().valueOf(); + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .aggregate(avg('rating').as('avgRating')); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.results.length).to.equal(1); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + timestampDeltaMS ); + }); + + it('returns undefined create and update time for each result in an aggregate query', async () => { + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }); + + const snapshot = await execute(pipeline); - await setupDeferred.promise; + expect(snapshot.results.length).to.equal(8); + + snapshot.results.forEach(doc => { + expect(doc.updateTime).to.be.undefined; + expect(doc.createTime).to.be.undefined; + }); }); + }); - afterEach(async () => { - testDeferred?.resolve(); - await withTestCollectionPromise; + describe('pipeline sources', () => { + it('supports CollectionReference as source', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol) + ); + expect(snapshot.results.length).to.equal(10); }); - describe('fluent API', () => { - it('empty results as expected', async () => { - const result = await firestore + it('supports list of documents as source', async () => { + const collName = randomCol.id; + + const snapshot = await execute( + firestore .pipeline() - .collection(randomCol.path) - .limit(0) - .execute(); - expect(result.length).to.equal(0); + .documents([ + `${collName}/book1`, + doc(randomCol, 'book2'), + doc(randomCol, 'book3').path + ]) + ); + expect(snapshot.results.length).to.equal(3); + }); + + it('reject CollectionReference for another DB', async () => { + const db2 = getFirestore(firestore.app, 'notDefault'); + + expect(() => { + firestore.pipeline().collection(collection(db2, 'foo')); + }).to.throw(/Invalid CollectionReference/); + + await terminate(db2); + }); + + it('reject DocumentReference for another DB', async () => { + const db2 = getFirestore(firestore.app, 'notDefault'); + + expect(() => { + firestore.pipeline().documents([doc(db2, 'foo/bar')]); + }).to.throw(/Invalid DocumentReference/); + + await terminate(db2); + }); + + // Subcollections not currently supported in DBE + itIf(testUnsupportedFeatures)( + 'supports collection group as source', + async () => { + const randomSubCollectionId = Math.random().toString(16).slice(2); + const doc1 = await addDoc( + collection(randomCol, 'book1', randomSubCollectionId), + { order: 1 } + ); + const doc2 = await addDoc( + collection(randomCol, 'book2', randomSubCollectionId), + { order: 2 } + ); + const snapshot = await execute( + firestore + .pipeline() + .collectionGroup(randomSubCollectionId) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + } + ); + + // subcollections not currently supported in dbe + itIf(testUnsupportedFeatures)('supports database as source', async () => { + const randomId = Math.random().toString(16).slice(2); + const doc1 = await addDoc(collection(randomCol, 'book1', 'sub'), { + order: 1, + randomId }); + const doc2 = await addDoc(collection(randomCol, 'book2', 'sub'), { + order: 2, + randomId + }); + const snapshot = await execute( + firestore + .pipeline() + .database() + .where(eq('randomId', randomId)) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + }); + }); + + describe('supported data types', () => { + it('accepts and returns all data types', async () => { + const refDate = new Date(); + const refTimestamp = Timestamp.now(); + const constants = [ + constant(1).as('number'), + constant('a string').as('string'), + constant(true).as('boolean'), + constant(null).as('null'), + constant(new GeoPoint(0.1, 0.2)).as('geoPoint'), + constant(refTimestamp).as('timestamp'), + constant(refDate).as('date'), + constant( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes'), + constant(doc(firestore, 'foo', 'bar')).as('documentReference'), + constantVector(vector([1, 2, 3])).as('vectorValue'), + constantVector([1, 2, 3]).as('vectorValue2'), + map({ + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': refDate, + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }).as('map'), + array([ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + refDate, + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ]).as('array') + ]; - it('full results as expected', async () => { - const result = await firestore + const snapshots = await execute( + firestore .pipeline() .collection(randomCol.path) - .execute(); - expect(result.length).to.equal(10); + .limit(1) + .select(constants[0], ...constants.slice(1)) + ); + + expectResults(snapshots, { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'bytes': Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'vectorValue2': vector([1, 2, 3]), + 'map': { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }, + 'array': [ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + Timestamp.fromDate(refDate), + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ] }); + }); + + it('throws on undefined in a map', async () => { + expect(() => { + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + map({ + 'number': 1, + undefined + }).as('foo') + ); + }).to.throw( + 'Function map() called with invalid data. Unsupported field value: undefined' + ); + }); - it('returns aggregate results as expected', async () => { - let result = await firestore + it('throws on undefined in an array', async () => { + expect(() => { + firestore .pipeline() .collection(randomCol.path) - .aggregate(countAll().as('count')) - .execute(); - expectResults(result, { count: 10 }); + .limit(1) + .select(array([1, undefined]).as('foo')); + }).to.throw( + 'Function array() called with invalid data. Unsupported field value: undefined' + ); + }); - result = await randomCol + it('converts arrays and plain objects to functionValues if the customer intent is unspecified', async () => { + const snapshot = await execute( + firestore .pipeline() - .where(eq('genre', 'Science Fiction')) - .aggregate( - countAll().as('count'), - avgFunction('rating').as('avgRating'), - Field.of('rating').maximum().as('maxRating') + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + 'title', + 'author', + 'genre', + 'rating', + 'published', + 'tags', + 'awards' + ) + .addFields( + array([ + 1, + 2, + field('genre'), + multiply('rating', 10), + [field('title')], + { + published: field('published') + } + ]).as('metadataArray'), + map({ + genre: field('genre'), + rating: multiply('rating', 10), + nestedArray: [field('title')], + nestedMap: { + published: field('published') + } + }).as('metadata') ) - .execute(); - expectResults(result, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + .where( + and( + eq('metadataArray', [ + 1, + 2, + field('genre'), + multiply('rating', 10), + [field('title')], + { + published: field('published') + } + ]), + eq('metadata', { + genre: field('genre'), + rating: multiply('rating', 10), + nestedArray: [field('title')], + nestedMap: { + published: field('published') + } + }) + ) + ) + ); + + expect(snapshot.results.length).to.equal(1); + + expectResults(snapshot, { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false }, + metadataArray: [ + 1, + 2, + 'Fantasy', + 47, + ['The Lord of the Rings'], + { + published: 1954 + } + ], + metadata: { + genre: 'Fantasy', + rating: 47, + nestedArray: ['The Lord of the Rings'], + nestedMap: { + published: 1954 + } + } + }); + }); + }); + + describe('stages', () => { + describe('aggregate stage', () => { + it('supports aggregate', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countAll().as('count')) + ); + expectResults(snapshot, { count: 10 }); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + avg('rating').as('avgRating'), + maximum('rating').as('maxRating'), + sum('rating').as('sumRating') + ) + ); + expectResults(snapshot, { + count: 2, + avgRating: 4.4, + maxRating: 4.6, + sumRating: 8.8 + }); }); it('rejects groups without accumulators', async () => { await expect( - randomCol + execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(lt('published', 1900)) + .aggregate({ + accumulators: [], + groups: ['genre'] + }) + ) + ).to.be.rejected; + }); + + it('returns group and accumulate results', async () => { + const snapshot = await execute( + firestore .pipeline() - .where(lt('published', 1900)) + .collection(randomCol.path) + .where(lt(field('published'), 1984)) .aggregate({ - accumulators: [], + accumulators: [avg('rating').as('avgRating')], groups: ['genre'] }) - .execute() - ).to.be.rejected; + .where(gt('avgRating', 4.3)) + .sort(field('avgRating').descending()) + ); + expectResults( + snapshot, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + + it('returns min, max, count, and countAll accumulations', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate( + count('cost').as('booksWithCost'), + countAll().as('count'), + maximum('rating').as('maxRating'), + minimum('published').as('minPublished') + ) + ); + expectResults(snapshot, { + booksWithCost: 1, + count: 10, + maxRating: 4.7, + minPublished: 1813 + }); + }); + + it('returns countif accumulation', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countIf(field('rating').gt(4.3)).as('count')) + ); + const expectedResults = { + count: 3 + }; + expectResults(snapshot, expectedResults); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(field('rating').gt(4.3).countIf().as('count')) + ); + expectResults(snapshot, expectedResults); }); + }); + describe('distinct stage', () => { it('returns distinct values as expected', async () => { - const results = await randomCol - .pipeline() - .distinct('genre', 'author') - .sort(Field.of('genre').ascending(), Field.of('author').ascending()) - .execute(); + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .distinct('genre', 'author') + .sort(field('genre').ascending(), field('author').ascending()) + ); expectResults( - results, + snapshot, { genre: 'Dystopian', author: 'George Orwell' }, { genre: 'Dystopian', author: 'Margaret Atwood' }, { genre: 'Fantasy', author: 'J.R.R. Tolkien' }, @@ -336,51 +938,19 @@ apiDescribe.only('Pipelines', persistence => { { genre: 'Southern Gothic', author: 'Harper Lee' } ); }); + }); - it('returns group and accumulate results', async () => { - const results = await randomCol - .pipeline() - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()) - .execute(); - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } - ); - }); - - it('returns min and max accumulations', async () => { - const results = await randomCol - .pipeline() - .aggregate( - countAll().as('count'), - Field.of('rating').maximum().as('maxRating'), - Field.of('published').minimum().as('minPublished') - ) - .execute(); - expectResults(results, { - count: 10, - maxRating: 4.7, - minPublished: 1813 - }); - }); - + describe('select stage', () => { it('can select fields', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'author') - .sort(Field.of('author').ascending()) - .execute(); + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(field('author').ascending()) + ); expectResults( - results, + snapshot, { title: "The Hitchhiker's Guide to the Galaxy", author: 'Douglas Adams' @@ -399,1331 +969,2116 @@ apiDescribe.only('Pipelines', persistence => { { title: "The Handmaid's Tale", author: 'Margaret Atwood' } ); }); + }); - it('where with and', async () => { - const results = await randomCol - .pipeline() - .where(andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction'))) - .execute(); - expectResults(results, 'book10'); - }); - - it('where with or', async () => { - const results = await randomCol - .pipeline() - .where(orFunction(eq('genre', 'Romance'), eq('genre', 'Dystopian'))) - .select('title') - .execute(); + describe('addField stage', () => { + it('can add fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .addFields(constant('bar').as('foo')) + .sort(field('author').ascending()) + ); expectResults( - results, - { title: 'Pride and Prejudice' }, - { title: "The Handmaid's Tale" }, - { title: '1984' } + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + foo: 'bar' + }, + { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + foo: 'bar' + }, + { title: 'Dune', author: 'Frank Herbert', foo: 'bar' }, + { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + foo: 'bar' + }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + foo: 'bar' + }, + { title: '1984', author: 'George Orwell', foo: 'bar' }, + { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + foo: 'bar' + }, + { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + foo: 'bar' + }, + { title: 'Pride and Prejudice', author: 'Jane Austen', foo: 'bar' }, + { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + foo: 'bar' + } ); }); + }); - it('offset and limits', async () => { - const results = await firestore - .pipeline() - .collection(randomCol.path) - .sort(Field.of('author').ascending()) - .offset(5) - .limit(3) - .select('title', 'author') - .execute(); + describe('removeFields stage', () => { + it('can remove fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(field('author').ascending()) + .removeFields(field('author')) + .sort(field('author').ascending()) + ); expectResults( - results, - { title: '1984', author: 'George Orwell' }, - { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, - { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'The Great Gatsby' + }, + { title: 'Dune' }, + { + title: 'Crime and Punishment' + }, + { + title: 'One Hundred Years of Solitude' + }, + { title: '1984' }, + { + title: 'To Kill a Mockingbird' + }, + { + title: 'The Lord of the Rings' + }, + { title: 'Pride and Prejudice' }, + { + title: "The Handmaid's Tale" + } ); }); + }); - it('logical min works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - logicalMinimum(Constant.of(1960), Field.of('published')).as( - 'published-safe' + describe('where stage', () => { + it('where with and (2 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.5), + eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) + ) ) - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); - expectResults( - results, - { title: '1984', 'published-safe': 1949 }, - { title: 'Crime and Punishment', 'published-safe': 1866 }, - { title: 'Dune', 'published-safe': 1960 } ); + expectResults(snapshot, 'book10', 'book4'); }); - - it('logical max works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - logicalMaximum(Constant.of(1960), Field.of('published')).as( - 'published-safe' + it('where with and (3 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.5), + eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), + lt('published', 1965) + ) ) - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); - expectResults( - results, - { title: '1984', 'published-safe': 1960 }, - { title: 'Crime and Punishment', 'published-safe': 1960 }, - { title: 'Dune', 'published-safe': 1965 } - ); - }); - - it('accepts and returns all data types', async () => { - const refDate = new Date(); - const refTimestamp = Timestamp.now(); - const constants = [ - Constant.of(1).as('number'), - Constant.of('a string').as('string'), - Constant.of(true).as('boolean'), - Constant.of(null).as('null'), - Constant.of(new GeoPoint(0.1, 0.2)).as('geoPoint'), - Constant.of(refTimestamp).as('timestamp'), - Constant.of(refDate).as('date'), - Constant.of( - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) - ).as('bytes'), - Constant.of(doc(firestore, 'foo', 'bar')).as('documentReference'), - Constant.of(vector([1, 2, 3])).as('vectorValue'), - Constant.of({ - 'number': 1, - 'string': 'a string', - 'boolean': true, - 'null': null, - 'geoPoint': new GeoPoint(0.1, 0.2), - 'timestamp': refTimestamp, - 'date': refDate, - 'uint8Array': Bytes.fromUint8Array( - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) - ), - 'documentReference': doc(firestore, 'foo', 'bar'), - 'vectorValue': vector([1, 2, 3]), - 'map': { - 'number': 2, - 'string': 'b string' - }, - 'array': [1, 'c string'] - }).as('map'), - Constant.of([ - 1, - 'a string', - true, - null, - new GeoPoint(0.1, 0.2), - refTimestamp, - refDate, - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), - doc(firestore, 'foo', 'bar'), - vector([1, 2, 3]), - { - 'number': 2, - 'string': 'b string' - } - ]).as('array') - ]; - - const results = await randomCol - .pipeline() - .limit(1) - .select(...constants) - .execute(); - - expectResults(results, { - 'number': 1, - 'string': 'a string', - 'boolean': true, - 'null': null, - 'geoPoint': new GeoPoint(0.1, 0.2), - 'timestamp': refTimestamp, - 'date': Timestamp.fromDate(refDate), - 'bytes': Bytes.fromUint8Array( - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) - ), - 'documentReference': doc(firestore, 'foo', 'bar'), - 'vectorValue': vector([1, 2, 3]), - 'map': { - 'number': 1, - 'string': 'a string', - 'boolean': true, - 'null': null, - 'geoPoint': new GeoPoint(0.1, 0.2), - 'timestamp': refTimestamp, - 'date': Timestamp.fromDate(refDate), - 'uint8Array': Bytes.fromUint8Array( - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) - ), - 'documentReference': doc(firestore, 'foo', 'bar'), - 'vectorValue': vector([1, 2, 3]), - 'map': { - 'number': 2, - 'string': 'b string' - }, - 'array': [1, 'c string'] - }, - 'array': [ - 1, - 'a string', - true, - null, - new GeoPoint(0.1, 0.2), - refTimestamp, - Timestamp.fromDate(refDate), - Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), - doc(firestore, 'foo', 'bar'), - vector([1, 2, 3]), - { - 'number': 2, - 'string': 'b string' - } - ] - }); + ); + expectResults(snapshot, 'book4'); }); - - it('cond works', async () => { - const results = await randomCol - .pipeline() - .select( - 'title', - cond( - lt(Field.of('published'), 1960), - Constant.of(1960), - Field.of('published') - ).as('published-safe') - ) - .sort(Field.of('title').ascending()) - .limit(3) - .execute(); + it('where with or', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + or( + eq('genre', 'Romance'), + eq('genre', 'Dystopian'), + eq('genre', 'Fantasy') + ) + ) + .sort(ascending('title')) + .select('title') + ); expectResults( - results, - { title: '1984', 'published-safe': 1960 }, - { title: 'Crime and Punishment', 'published-safe': 1960 }, - { title: 'Dune', 'published-safe': 1965 } + snapshot, + { title: '1984' }, + { title: 'Pride and Prejudice' }, + { title: "The Handmaid's Tale" }, + { title: 'The Lord of the Rings' } ); }); - it('eqAny works', async () => { - const results = await randomCol - .pipeline() - .where(eqAny('published', [1979, 1999, 1967])) - .select('title') - .execute(); + it('where with xor', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + xor( + eq('genre', 'Romance'), + eq('genre', 'Dystopian'), + eq('genre', 'Fantasy'), + eq('published', 1949) + ) + ) + .select('title') + ); expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'One Hundred Years of Solitude' } + snapshot, + { title: 'Pride and Prejudice' }, + { title: 'The Lord of the Rings' }, + { title: "The Handmaid's Tale" } ); }); + }); - it('notEqAny works', async () => { - const results = await randomCol - .pipeline() - .where( - notEqAny( - 'published', - [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] - ) - ) - .select('title') - .execute(); - expectResults(results, { title: 'Pride and Prejudice' }); + describe('sort, offset, and limit stages', () => { + it('supports sort, offset, and limits', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('author').ascending()) + .offset(5) + .limit(3) + .select('title', 'author') + ); + expectResults( + snapshot, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); }); + }); - it('arrayContains works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContains('tags', 'comedy')) - .select('title') - .execute(); - expectResults(results, { - title: "The Hitchhiker's Guide to the Galaxy" + describe('generic stage', () => { + it('can select fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .genericStage('select', [ + { + title: field('title'), + metadata: { + 'author': field('author') + } + } + ]) + .sort(field('author').ascending()) + .limit(1) + ); + expectResults(snapshot, { + metadata: { + author: 'Frank Herbert' + }, + title: 'Dune' }); }); - it('arrayContainsAny works', async () => { - const results = await randomCol - .pipeline() - .where(arrayContainsAny('tags', ['comedy', 'classic'])) - .select('title') - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'Pride and Prejudice' } + it('can add fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('author').ascending()) + .limit(1) + .select('title', 'author') + .genericStage('add_fields', [ + { + display: strConcat('title', ' - ', field('author')) + } + ]) ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + display: "The Hitchhiker's Guide to the Galaxy - Douglas Adams" + }); }); - it('arrayContainsAll works', async () => { - const results = await randomCol - .pipeline() - .where(Field.of('tags').arrayContainsAll('adventure', 'magic')) - .select('title') - .execute(); - expectResults(results, { title: 'The Lord of the Rings' }); - }); - - it('arrayLength works', async () => { - const results = await randomCol - .pipeline() - .select(Field.of('tags').arrayLength().as('tagsCount')) - .where(eq('tagsCount', 3)) - .execute(); - expect(results.length).to.equal(10); - }); - - // skip: arrayConcat not supported - // it.skip('arrayConcat works', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2'] - // }); - // }); - - it('testStrConcat', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('author') - .strConcat(' - ', Field.of('title')) - .as('bookInfo') - ) - .limit(1) - .execute(); - expectResults(results, { - bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + it('can filter with where', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .genericStage('where', [field('author').eq('Douglas Adams')]) + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' }); }); - it('testStartsWith', async () => { - const results = await randomCol - .pipeline() - .where(startsWith('title', 'The')) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { title: 'The Great Gatsby' }, - { title: "The Handmaid's Tale" }, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Lord of the Rings' } + it('can limit, offset, and sort', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .genericStage('sort', [ + { + direction: 'ascending', + expression: field('author') + } + ]) + .genericStage('offset', [3]) + .genericStage('limit', [1]) ); + expectResults(snapshot, { + author: 'Fyodor Dostoevsky', + title: 'Crime and Punishment' + }); }); - it('testEndsWith', async () => { - const results = await randomCol - .pipeline() - .where(endsWith('title', 'y')) - .select('title') - .sort(Field.of('title').descending()) - .execute(); - expectResults( - results, - { title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Great Gatsby' } + it('can perform aggregate query', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author', 'rating') + .genericStage('aggregate', [ + { averageRating: field('rating').avg() }, + {} + ]) ); + expectResults(snapshot, { + averageRating: 4.3100000000000005 + }); }); - it('testLength', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('title').charLength().as('titleLength'), - Field.of('title') - ) - .where(gt('titleLength', 20)) - .sort(Field.of('title').ascending()) - .execute(); - + it('can perform distinct query', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author', 'rating') + .genericStage('distinct', [{ rating: field('rating') }]) + .sort(field('rating').descending()) + ); expectResults( - results, - + snapshot, { - titleLength: 29, - title: 'One Hundred Years of Solitude' + rating: 4.7 }, { - titleLength: 36, - title: "The Hitchhiker's Guide to the Galaxy" + rating: 4.6 }, { - titleLength: 21, - title: 'The Lord of the Rings' + rating: 4.5 }, { - titleLength: 21, - title: 'To Kill a Mockingbird' + rating: 4.3 + }, + { + rating: 4.2 + }, + { + rating: 4.1 + }, + { + rating: 4.0 } ); }); + }); - // skip: toLower not supported - // it.skip('testToLowercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('title').toLower().as('lowercaseTitle')) - // .limit(1) - // .execute(); - // expectResults(results, { - // lowercaseTitle: "the hitchhiker's guide to the galaxy" - // }); - // }); - - // skip: toUpper not supported - // it.skip('testToUppercase', async () => { - // const results = await randomCol - // .pipeline() - // .select(Field.of('author').toUpper().as('uppercaseAuthor')) - // .limit(1) - // .execute(); - // expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' }); - // }); - - // skip: trim not supported - // it.skip('testTrim', async () => { - // const results = await randomCol - // .pipeline() - // .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle')) - // .select( - // Field.of('spacedTitle').trim().as('trimmedTitle'), - // Field.of('spacedTitle') - // ) - // .limit(1) - // .execute(); - // expectResults(results, { - // spacedTitle: " The Hitchhiker's Guide to the Galaxy ", - // trimmedTitle: "The Hitchhiker's Guide to the Galaxy" - // }); - // }); - - it('testLike', async () => { - const results = await randomCol - .pipeline() - .where(like('title', '%Guide%')) - .select('title') - .execute(); - expectResults(results, { - title: "The Hitchhiker's Guide to the Galaxy" + describe('replaceWith stage', () => { + it('run pipeline with replaceWith field name', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .replaceWith('awards') + ); + expectResults(snapshot, { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } }); }); - it('testRegexContains', async () => { - const results = await randomCol - .pipeline() - .where(regexContains('title', '(?i)(the|of)')) - .execute(); - expect(results.length).to.equal(5); + it('run pipeline with replaceWith Expr result', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .replaceWith( + map({ + foo: 'bar', + baz: { + title: field('title') + } + }) + ) + ); + expectResults(snapshot, { + foo: 'bar', + baz: { title: "The Hitchhiker's Guide to the Galaxy" } + }); }); + }); - it('testRegexMatches', async () => { - const results = await randomCol - .pipeline() - .where(regexMatch('title', '.*(?i)(the|of).*')) - .execute(); - expect(results.length).to.equal(5); + describe('sample stage', () => { + it('run pipeline with sample limit of 3', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol.path).sample(3) + ); + expect(snapshot.results.length).to.equal(3); }); - it('testArithmeticOperations', async () => { - const results = await randomCol - .pipeline() - .select( - add(Field.of('rating'), 1).as('ratingPlusOne'), - subtract(Field.of('published'), 1900).as('yearsSince1900'), - Field.of('rating').multiply(10).as('ratingTimesTen'), - Field.of('rating').divide(2).as('ratingDividedByTwo') - ) - .limit(1) - .execute(); - expectResults(results, { - ratingPlusOne: 5.2, - yearsSince1900: 79, - ratingTimesTen: 42, - ratingDividedByTwo: 2.1 - }); + it('run pipeline with sample limit of {documents: 3}', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sample({ documents: 3 }) + ); + expect(snapshot.results.length).to.equal(3); }); - it('testComparisonOperators', async () => { - const results = await randomCol - .pipeline() - .where( - andFunction( - gt('rating', 4.2), - lte(Field.of('rating'), 4.5), - neq('genre', 'Science Fiction') - ) - ) - .select('rating', 'title') - .sort(Field.of('title').ascending()) - .execute(); - expectResults( - results, - { rating: 4.3, title: 'Crime and Punishment' }, - { - rating: 4.3, - title: 'One Hundred Years of Solitude' - }, - { rating: 4.5, title: 'Pride and Prejudice' } - ); + it('run pipeline with sample limit of {percentage: 0.6}', async () => { + let avgSize = 0; + const numIterations = 20; + for (let i = 0; i < numIterations; i++) { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sample({ percentage: 0.6 }) + ); + + avgSize += snapshot.results.length; + } + avgSize /= numIterations; + expect(avgSize).to.be.closeTo(6, 1); }); + }); - it('testLogicalOperators', async () => { - const results = await randomCol - .pipeline() - .where( - orFunction( - andFunction(gt('rating', 4.5), eq('genre', 'Science Fiction')), - lt('published', 1900) - ) - ) - .select('title') - .sort(Field.of('title').ascending()) - .execute(); + describe('union stage', () => { + // __name__ not currently supported by dbe + itIf(testUnsupportedFeatures)('run pipeline with union', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .union(firestore.pipeline().collection(randomCol.path)) + .sort(field(documentIdFieldPath()).ascending()) + ); expectResults( - results, - { title: 'Crime and Punishment' }, - { title: 'Dune' }, - { title: 'Pride and Prejudice' } + snapshot, + 'book1', + 'book1', + 'book10', + 'book10', + 'book2', + 'book2', + 'book3', + 'book3', + 'book4', + 'book4', + 'book5', + 'book5', + 'book6', + 'book6', + 'book7', + 'book7', + 'book8', + 'book8', + 'book9', + 'book9' ); }); + }); - it('testChecks', async () => { - const results = await randomCol - .pipeline() - .where(not(Field.of('rating').isNaN())) - .select( - Field.of('rating').eq(null).as('ratingIsNull'), - not(Field.of('rating').isNaN()).as('ratingIsNotNaN') - ) - .limit(1) - .execute(); - expectResults(results, { ratingIsNull: false, ratingIsNotNaN: true }); - }); - - it('testMapGet', async () => { - const results = await randomCol - .pipeline() - .select( - Field.of('awards').mapGet('hugo').as('hugoAward'), - Field.of('awards').mapGet('others').as('others'), - Field.of('title') - ) - .where(eq('hugoAward', true)) - .execute(); + describe('unnest stage', () => { + it('run pipeline with unnest', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(field('tags').as('tag')) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'tag', + 'awards', + 'nestedField' + ) + ); expectResults( - results, + snapshot, { - hugoAward: true, title: "The Hitchhiker's Guide to the Galaxy", - others: { unknown: { year: 1980 } } + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'comedy', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } }, - { hugoAward: true, title: 'Dune', others: null } - ); - }); - - // it('testParent', async () => { - // const results = await randomCol - // .pipeline() - // .select( - // parent(randomCol.doc('chile').collection('subCollection').path).as( - // 'parent' - // ) - // ) - // .limit(1) - // .execute(); - // expect(results[0].data().parent.endsWith('/books')).to.be.true; - // }); - // - // it('testCollectionId', async () => { - // const results = await randomCol - // .pipeline() - // .select(collectionId(randomCol.doc('chile')).as('collectionId')) - // .limit(1) - // .execute(); - // expectResults(results, {collectionId: 'books'}); - // }); - - it('testDistanceFunctions', async () => { - const sourceVector = [0.1, 0.1]; - const targetVector = [0.5, 0.8]; - const results = await randomCol - .pipeline() - .select( - cosineDistance(Constant.vector(sourceVector), targetVector).as( - 'cosineDistance' - ), - dotProduct(Constant.vector(sourceVector), targetVector).as( - 'dotProductDistance' - ), - euclideanDistance(Constant.vector(sourceVector), targetVector).as( - 'euclideanDistance' - ) - ) - .limit(1) - .execute(); - - expectResults(results, { - cosineDistance: 0.02560880430538015, - dotProductDistance: 0.13, - euclideanDistance: 0.806225774829855 - }); - }); - - it('testNestedFields', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select('title', 'awards.hugo') - .execute(); - expectResults( - results, { title: "The Hitchhiker's Guide to the Galaxy", - 'awards.hugo': true + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'space', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } }, - { title: 'Dune', 'awards.hugo': true } + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'adventure', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + } ); }); - - it('test mapGet with field name including . notation', async () => { - const results = await randomCol - .pipeline() - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') - ) - .execute(); + it('unnest an expr', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(array([1, 2, 3]).as('copy')) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'copy', + 'awards', + 'nestedField' + ) + ); expectResults( - results, + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 1, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, { title: "The Hitchhiker's Guide to the Galaxy", - 'nestedField.level.`1`': null, - nested: true + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 2, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } }, - { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 3, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + } ); }); + }); - it('supports internal serialization to proto', async () => { - const pipeline = firestore - .pipeline() - .collection('books') - .where(eq('awards.hugo', true)) - .select( - 'title', - Field.of('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') - ); - - const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); - expect(proto).not.to.be.null; - }); - - describe('pagination', () => { - async function addBooks( - collection: CollectionReference - ): Promise { - await setDoc(doc(randomCol, 'book11'), { - title: 'Jonathan Strange & Mr Norrell', - author: 'Susanna Clarke', - genre: 'Fantasy', - published: 2004, - rating: 4.6, - tags: [ - 'historical fantasy', - 'magic', - 'alternate history', - 'england' - ], - awards: { hugo: false, nebula: false } - }); - await setDoc(doc(randomCol, 'book12'), { - title: 'The Master and Margarita', - author: 'Mikhail Bulgakov', - genre: 'Satire', - published: 1967, // Though written much earlier - rating: 4.6, - tags: [ - 'russian literature', - 'supernatural', - 'philosophy', - 'dark comedy' - ], - awards: {} - }); - await setDoc(doc(randomCol, 'book13'), { - title: 'A Long Way to a Small, Angry Planet', - author: 'Becky Chambers', - genre: 'Science Fiction', - published: 2014, - rating: 4.6, - tags: [ - 'space opera', - 'found family', - 'character-driven', - 'optimistic' - ], - awards: { hugo: false, nebula: false, kitschies: true } - }); - } - - it('supports pagination with filters', async () => { - await addBooks(randomCol); - const pageSize = 2; - const pipeline = randomCol - .pipeline() - .select('title', 'rating', '__name__') - .sort( - Field.of('rating').descending(), - Field.of('__name__').ascending() - ); - - let results = await pipeline.limit(pageSize).execute(); - expectResults( - results, - { title: 'The Lord of the Rings', rating: 4.7 }, - { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } - ); - - const lastDoc = results[results.length - 1]; - - results = await pipeline - .where( - orFunction( - andFunction( - Field.of('rating').eq(lastDoc.get('rating')), - Field.of('__path__').gt(lastDoc.ref?.path) - ), - Field.of('rating').lt(lastDoc.get('rating')) - ) - ) - .limit(pageSize) - .execute(); - expectResults( - results, - { title: 'Pride and Prejudice', rating: 4.5 }, - { title: 'Crime and Punishment', rating: 4.3 } - ); - }); - - it('supports pagination with offsets', async () => { - await addBooks(randomCol); - - const secondFilterField = '__path__'; - - const pipeline = randomCol - .pipeline() - .select('title', 'rating', secondFilterField) - .sort( - Field.of('rating').descending(), - Field.of(secondFilterField).ascending() - ); - - const pageSize = 2; - let currPage = 0; - - let results = await pipeline - .offset(currPage++ * pageSize) - .limit(pageSize) - .execute(); - - expectResults( - results, - { - title: 'The Lord of the Rings', - rating: 4.7 - }, - { title: 'Dune', rating: 4.6 } + describe('findNearest stage', () => { + it('run pipeline with findNearest', async () => { + const measures: Array = [ + 'euclidean', + 'dot_product', + 'cosine' + ]; + for (const measure of measures) { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .findNearest({ + field: 'embedding', + vectorValue: vector([10, 1, 3, 1, 2, 1, 1, 1, 1, 1]), + limit: 3, + distanceMeasure: measure + }) + .select('title') ); - - results = await pipeline - .offset(currPage++ * pageSize) - .limit(pageSize) - .execute(); expectResults( - results, + snapshot, { - title: 'Jonathan Strange & Mr Norrell', - rating: 4.6 + title: "The Hitchhiker's Guide to the Galaxy" }, - { title: 'The Master and Margarita', rating: 4.6 } - ); - - results = await pipeline - .offset(currPage++ * pageSize) - .limit(pageSize) - .execute(); - expectResults( - results, { - title: 'A Long Way to a Small, Angry Planet', - rating: 4.6 + title: 'One Hundred Years of Solitude' }, { - title: 'Pride and Prejudice', - rating: 4.5 + title: "The Handmaid's Tale" } ); - }); + } }); - }); - describe('modular API', () => { - it('works when creating a pipeline from a Firestore instance', async () => { - const myPipeline = pipeline(firestore) - .collection(randomCol.path) - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()); - - const results = await execute(myPipeline); - - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } + it('optionally returns the computed distance', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .findNearest({ + field: 'embedding', + vectorValue: vector([10, 1, 2, 1, 1, 1, 1, 1, 1, 1]), + limit: 2, + distanceMeasure: 'euclidean', + distanceField: 'computedDistance' + }) + .select('title', 'computedDistance') ); - }); - - it('works when creating a pipeline from a collection', async () => { - const myPipeline = pipeline(randomCol) - .where(lt(Field.of('published'), 1984)) - .aggregate({ - accumulators: [avgFunction('rating').as('avgRating')], - groups: ['genre'] - }) - .where(gt('avgRating', 4.3)) - .sort(Field.of('avgRating').descending()); - - const results = await execute(myPipeline); - expectResults( - results, - { avgRating: 4.7, genre: 'Fantasy' }, - { avgRating: 4.5, genre: 'Romance' }, - { avgRating: 4.4, genre: 'Science Fiction' } + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + computedDistance: 1 + }, + { + title: 'One Hundred Years of Solitude', + computedDistance: 12.041594578792296 + } ); }); }); }); - // This is the Query integration tests from the lite API (no cache support) - // with some additional test cases added for more complete coverage. - describe('Query to Pipeline', () => { - function verifyResults( - actual: Array>, - ...expected: DocumentData[] - ): void { - expect(actual.length).to.equal(expected.length); - - for (let i = 0; i < expected.length; ++i) { - expect(actual[i].data()).to.deep.equal(expected[i]); - } - } - - it('supports default query', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { 1: { foo: 1 } }, - async collRef => { - const result = await collRef.pipeline().execute(); - verifyResults(result, { foo: 1 }); - } + describe('function expressions', () => { + it('logical max works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + logicalMaximum(constant(1960), field('published'), 1961).as( + 'published-safe' + ) + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1961 }, + { title: 'Crime and Punishment', 'published-safe': 1961 }, + { title: 'Dune', 'published-safe': 1965 } ); }); - it('supports filtered query', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, where('foo', '==', 1)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }); - } + it('logical min works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + logicalMinimum(constant(1960), field('published'), 1961).as( + 'published-safe' + ) + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1949 }, + { title: 'Crime and Punishment', 'published-safe': 1866 }, + { title: 'Dune', 'published-safe': 1960 } ); }); - it('supports filtered query (with FieldPath)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, where(new FieldPath('foo'), '==', 1)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }); - } + it('cond works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + cond( + lt(field('published'), 1960), + constant(1960), + field('published') + ).as('published-safe') + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } ); }); - it('supports ordered query (with default order)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo')); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }, { foo: 2 }); - } + it('eqAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eqAny('published', [1979, 1999, 1967])) + .sort(descending('title')) + .select('title') + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'One Hundred Years of Solitude' } ); }); - it('supports ordered query (with asc)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo', 'asc')); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }, { foo: 2 }); - } + it('notEqAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + notEqAny( + 'published', + [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] + ) + ) + .select('title') ); + expectResults(snapshot, { title: 'Pride and Prejudice' }); }); - it('supports ordered query (with desc)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo', 'desc')); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }, { foo: 1 }); - } + it('arrayContains works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(arrayContains('tags', 'comedy')) + .select('title') ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy" + }); }); - it('supports limit query', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), limit(1)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }); - } + it('arrayContainsAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .sort(descending('title')) + .select('title') + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'Pride and Prejudice' } ); }); - it('supports limitToLast query', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 }, - 3: { foo: 3 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), limitToLast(2)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }, { foo: 3 }); - } + it('arrayContainsAll works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(arrayContainsAll('tags', ['adventure', 'magic'])) + .select('title') ); + expectResults(snapshot, { title: 'The Lord of the Rings' }); }); - it('supports startAt', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), startAt(2)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }); - } + it('arrayLength works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(arrayLength('tags').as('tagsCount')) + .where(eq('tagsCount', 3)) ); + expect(snapshot.results.length).to.equal(10); }); - it('supports startAfter (with DocumentReference)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { id: 1, foo: 1, bar: 1, baz: 1 }, - 2: { id: 2, foo: 1, bar: 1, baz: 2 }, - 3: { id: 3, foo: 1, bar: 1, baz: 2 }, - 4: { id: 4, foo: 1, bar: 2, baz: 1 }, - 5: { id: 5, foo: 1, bar: 2, baz: 2 }, - 6: { id: 6, foo: 1, bar: 2, baz: 2 }, - 7: { id: 7, foo: 2, bar: 1, baz: 1 }, - 8: { id: 8, foo: 2, bar: 1, baz: 2 }, - 9: { id: 9, foo: 2, bar: 1, baz: 2 }, - 10: { id: 10, foo: 2, bar: 2, baz: 1 }, - 11: { id: 11, foo: 2, bar: 2, baz: 2 }, - 12: { id: 12, foo: 2, bar: 2, baz: 2 } - }, - async collRef => { - let docRef = await getDoc(doc(collRef, '2')); - let query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAfter(docRef) - ); - let result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - - docRef = await getDoc(doc(collRef, '3')); - query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAfter(docRef) - ); - result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - } + it('testStrConcat', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(ascending('author')) + .select( + field('author').strConcat(' - ', field('title')).as('bookInfo') + ) + .limit(1) ); + expectResults(snapshot, { + bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + }); }); - it('supports startAt (with DocumentReference)', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { id: 1, foo: 1, bar: 1, baz: 1 }, - 2: { id: 2, foo: 1, bar: 1, baz: 2 }, - 3: { id: 3, foo: 1, bar: 1, baz: 2 }, - 4: { id: 4, foo: 1, bar: 2, baz: 1 }, - 5: { id: 5, foo: 1, bar: 2, baz: 2 }, - 6: { id: 6, foo: 1, bar: 2, baz: 2 }, - 7: { id: 7, foo: 2, bar: 1, baz: 1 }, - 8: { id: 8, foo: 2, bar: 1, baz: 2 }, - 9: { id: 9, foo: 2, bar: 1, baz: 2 }, - 10: { id: 10, foo: 2, bar: 2, baz: 1 }, - 11: { id: 11, foo: 2, bar: 2, baz: 2 }, - 12: { id: 12, foo: 2, bar: 2, baz: 2 } - }, - async collRef => { - let docRef = await getDoc(doc(collRef, '2')); - let query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAt(docRef) - ); - let result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 2, foo: 1, bar: 1, baz: 2 }, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - - docRef = await getDoc(doc(collRef, '3')); - query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAt(docRef) - ); - result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - } + it('testStartsWith', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(startsWith('title', 'The')) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: 'The Great Gatsby' }, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Lord of the Rings' } ); }); - it('supports startAfter', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), startAfter(1)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }); - } + it('testEndsWith', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(endsWith('title', 'y')) + .select('title') + .sort(field('title').descending()) + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Great Gatsby' } ); }); - it('supports endAt', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), endAt(1)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }); - } + it('testStrContains', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(strContains('title', "'s")) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" } ); }); - it('supports endBefore', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, + it('testLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(charLength('title').as('titleLength'), field('title')) + .where(gt('titleLength', 20)) + .sort(field('title').ascending()) + ); + + expectResults( + snapshot, + + { + titleLength: 29, + title: 'One Hundred Years of Solitude' + }, + { + titleLength: 36, + title: "The Hitchhiker's Guide to the Galaxy" + }, { - 1: { foo: 1 }, - 2: { foo: 2 } + titleLength: 21, + title: 'The Lord of the Rings' }, - async collRef => { - const query1 = query(collRef, orderBy('foo'), endBefore(2)); - const result = await query1.pipeline().execute(); - verifyResults(result, { foo: 1 }); + { + titleLength: 21, + title: 'To Kill a Mockingbird' } ); }); - it('supports pagination', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { foo: 1 }, - 2: { foo: 2 } - }, - async collRef => { - let query1 = query(collRef, orderBy('foo'), limit(1)); - const pipeline1 = query1.pipeline(); - let result = await pipeline1.execute(); - verifyResults(result, { foo: 1 }); - - // Pass the document snapshot from the previous result - query1 = query(query1, startAfter(result[0].get('foo'))); - result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }); - } + it('testLike', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(like('title', '%Guide%')) + .select('title') + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testRegexContains', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(regexContains('title', '(?i)(the|of)')) + ); + expect(snapshot.results.length).to.equal(5); + }); + + it('testRegexMatches', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(regexMatch('title', '.*(?i)(the|of).*')) + ); + expect(snapshot.results.length).to.equal(5); + }); + + it('testArithmeticOperations', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', 'To Kill a Mockingbird')) + .select( + add(field('rating'), 1).as('ratingPlusOne'), + subtract(field('published'), 1900).as('yearsSince1900'), + field('rating').multiply(10).as('ratingTimesTen'), + divide('rating', 2).as('ratingDividedByTwo'), + multiply('rating', 10, 2).as('ratingTimes20'), + add('rating', 1, 2).as('ratingPlus3'), + mod('rating', 2).as('ratingMod2') + ) + .limit(1) ); + expectResults(snapshot, { + ratingPlusOne: 5.2, + yearsSince1900: 60, + ratingTimesTen: 42, + ratingDividedByTwo: 2.1, + ratingTimes20: 84, + ratingPlus3: 7.2, + ratingMod2: 0.20000000000000018 + }); }); - it('supports pagination on DocumentIds', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, + it('testComparisonOperators', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.2), + lte(field('rating'), 4.5), + neq('genre', 'Science Fiction') + ) + ) + .select('rating', 'title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { rating: 4.3, title: 'Crime and Punishment' }, { - 1: { foo: 1 }, - 2: { foo: 2 } + rating: 4.3, + title: 'One Hundred Years of Solitude' }, - async collRef => { - let query1 = query( - collRef, - orderBy('foo'), - orderBy(documentId(), 'asc'), - limit(1) - ); - const pipeline1 = query1.pipeline(); - let result = await pipeline1.execute(); - verifyResults(result, { foo: 1 }); - - // Pass the document snapshot from the previous result - query1 = query( - query1, - startAfter(result[0].get('foo'), result[0].ref?.id) - ); - result = await query1.pipeline().execute(); - verifyResults(result, { foo: 2 }); - } + { rating: 4.5, title: 'Pride and Prejudice' } ); }); - it('supports collection groups', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - {}, - async collRef => { - const collectionGroupId = `${collRef.id}group`; + it('testLogicalOperators', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + or( + and(gt('rating', 4.5), eq('genre', 'Science Fiction')), + lt('published', 1900) + ) + ) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: 'Crime and Punishment' }, + { title: 'Dune' }, + { title: 'Pride and Prejudice' } + ); + }); - const fooDoc = doc( - collRef.firestore, - `${collRef.id}/foo/${collectionGroupId}/doc1` - ); - const barDoc = doc( - collRef.firestore, - `${collRef.id}/bar/baz/boo/${collectionGroupId}/doc2` - ); - await setDoc(fooDoc, { foo: 1 }); - await setDoc(barDoc, { bar: 1 }); + it('testChecks', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + isNull('rating').as('ratingIsNull'), + isNan('rating').as('ratingIsNaN'), + isError(arrayOffset('title', 0)).as('isError'), + ifError(arrayOffset('title', 0), constant('was error')).as( + 'ifError' + ), + isAbsent('foo').as('isAbsent'), + isNotNull('title').as('titleIsNotNull'), + isNotNan('cost').as('costIsNotNan'), + exists('fooBarBaz').as('fooBarBazExists'), + field('title').exists().as('titleExists') + ) + ); + expectResults(snapshot, { + ratingIsNull: false, + ratingIsNaN: false, + isError: true, + ifError: 'was error', + isAbsent: true, + titleIsNotNull: true, + costIsNotNan: false, + fooBarBazExists: false, + titleExists: true + }); - const query1 = collectionGroup(collRef.firestore, collectionGroupId); - const result = await query1.pipeline().execute(); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + field('rating').isNull().as('ratingIsNull'), + field('rating').isNan().as('ratingIsNaN'), + arrayOffset('title', 0).isError().as('isError'), + arrayOffset('title', 0) + .ifError(constant('was error')) + .as('ifError'), + field('foo').isAbsent().as('isAbsent'), + field('title').isNotNull().as('titleIsNotNull'), + field('cost').isNotNan().as('costIsNotNan') + ) + ); + expectResults(snapshot, { + ratingIsNull: false, + ratingIsNaN: false, + isError: true, + ifError: 'was error', + isAbsent: true, + titleIsNotNull: true, + costIsNotNan: false + }); + }); - verifyResults(result, { bar: 1 }, { foo: 1 }); - } + it('testMapGet', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('published').descending()) + .select( + field('awards').mapGet('hugo').as('hugoAward'), + field('awards').mapGet('others').as('others'), + field('title') + ) + .where(eq('hugoAward', true)) + ); + expectResults( + snapshot, + { + hugoAward: true, + title: "The Hitchhiker's Guide to the Galaxy", + others: { unknown: { year: 1980 } } + }, + { hugoAward: true, title: 'Dune', others: null } ); }); - it('supports query over collection path with special characters', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - {}, - async collRef => { - const docWithSpecials = doc(collRef, 'so!@#$%^&*()_+special'); + it('testDistanceFunctions', async () => { + const sourceVector = [0.1, 0.1]; + const targetVector = [0.5, 0.8]; + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + cosineDistance(constantVector(sourceVector), targetVector).as( + 'cosineDistance' + ), + dotProduct(constantVector(sourceVector), targetVector).as( + 'dotProductDistance' + ), + euclideanDistance(constantVector(sourceVector), targetVector).as( + 'euclideanDistance' + ) + ) + .limit(1) + ); - const collectionWithSpecials = collection( - docWithSpecials, - 'so!@#$%^&*()_+special' - ); - await addDoc(collectionWithSpecials, { foo: 1 }); - await addDoc(collectionWithSpecials, { foo: 2 }); + expectResults(snapshot, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); - const result = await query( - collectionWithSpecials, - orderBy('foo', 'asc') + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + constantVector(sourceVector) + .cosineDistance(targetVector) + .as('cosineDistance'), + constantVector(sourceVector) + .dotProduct(targetVector) + .as('dotProductDistance'), + constantVector(sourceVector) + .euclideanDistance(targetVector) + .as('euclideanDistance') ) - .pipeline() - .execute(); + .limit(1) + ); - verifyResults(result, { foo: 1 }, { foo: 2 }); - } + expectResults(snapshot, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + }); + + it('testVectorLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(vectorLength(constantVector([1, 2, 3])).as('vectorLength')) + ); + expectResults(snapshot, { + vectorLength: 3 + }); + }); + + it('testNestedFields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('awards.hugo', true)) + .sort(descending('title')) + .select('title', 'awards.hugo') + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'awards.hugo': true + }, + { title: 'Dune', 'awards.hugo': true } ); }); - it('supports multiple inequality on same field', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, + it('test mapGet with field name including . notation', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('awards.hugo', true)) + .select( + 'title', + field('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ) + .sort(descending('title')) + ); + expectResults( + snapshot, { - '01': { id: 1, foo: 1, bar: 1, baz: 1 }, - '02': { id: 2, foo: 1, bar: 1, baz: 2 }, - '03': { id: 3, foo: 1, bar: 1, baz: 2 }, - '04': { id: 4, foo: 1, bar: 2, baz: 1 }, - '05': { id: 5, foo: 1, bar: 2, baz: 2 }, - '06': { id: 6, foo: 1, bar: 2, baz: 2 }, - '07': { id: 7, foo: 2, bar: 1, baz: 1 }, - '08': { id: 8, foo: 2, bar: 1, baz: 2 }, - '09': { id: 9, foo: 2, bar: 1, baz: 2 }, - '10': { id: 10, foo: 2, bar: 2, baz: 1 }, - '11': { id: 11, foo: 2, bar: 2, baz: 2 }, - '12': { id: 12, foo: 2, bar: 2, baz: 2 } + title: "The Hitchhiker's Guide to the Galaxy", + 'nestedField.level.`1`': null, + nested: true }, - async collRef => { - const query1 = query( - collRef, - and(where('id', '>', 2), where('id', '<=', 10)) - ); - const result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 } - ); - } + { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + ); + }); + + describe('genericFunction', () => { + it('add selectable', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(descending('rating')) + .limit(1) + .select( + new FunctionExpr('add', [field('rating'), constant(1)]).as( + 'rating' + ) + ) + ); + expectResults(snapshot, { + rating: 5.7 + }); + }); + + it('and (variadic) selectable', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + new BooleanExpr('and', [ + field('rating').gt(0), + field('title').charLength().lt(5), + field('tags').arrayContains('propaganda') + ]) + ) + .select('title') + ); + expectResults(snapshot, { + title: '1984' + }); + }); + + it('array contains any', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + new BooleanExpr('array_contains_any', [ + field('tags'), + array(['politics']) + ]) + ) + .select('title') + ); + expectResults(snapshot, { + title: 'Dune' + }); + }); + + it('countif aggregate', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate( + new AggregateFunction('count_if', [field('rating').gte(4.5)]).as( + 'countOfBest' + ) + ) + ); + expectResults(snapshot, { + countOfBest: 3 + }); + }); + + it('sort by char_len', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort( + new FunctionExpr('char_length', [field('title')]).ascending(), + descending('__name__') + ) + .limit(3) + .select('title') + ); + expectResults( + snapshot, + { + title: '1984' + }, + { + title: 'Dune' + }, + { + title: 'The Great Gatsby' + } + ); + }); + }); + + itIf(testUnsupportedFeatures)('testReplaceFirst', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', 'The Lord of the Rings')) + .limit(1) + .select(replaceFirst('title', 'o', '0').as('newName')) + ); + expectResults(snapshot, { newName: 'The L0rd of the Rings' }); + }); + + itIf(testUnsupportedFeatures)('testReplaceAll', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', 'The Lord of the Rings')) + .limit(1) + .select(replaceAll('title', 'o', '0').as('newName')) + ); + expectResults(snapshot, { newName: 'The L0rd 0f the Rings' }); + }); + + it('supports Rand', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(10) + .select(rand().as('result')) + ); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(d => { + expect(d.get('result')).to.be.lt(1); + expect(d.get('result')).to.be.gte(0); + }); + }); + + it('supports array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(array([1, 2, 3, 4]).as('metadata')) + ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 3, 4] + }); + }); + + it('evaluates expression in array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + array([1, 2, field('genre'), multiply('rating', 10)]).as('metadata') + ) ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 'Fantasy', 47] + }); }); - it('supports multiple inequality on different fields', () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, + it('supports arrayOffset', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(arrayOffset('tags', 0).as('firstTag')) + ); + const expectedResults = [ { - '01': { id: 1, foo: 1, bar: 1, baz: 1 }, - '02': { id: 2, foo: 1, bar: 1, baz: 2 }, - '03': { id: 3, foo: 1, bar: 1, baz: 2 }, - '04': { id: 4, foo: 1, bar: 2, baz: 1 }, - '05': { id: 5, foo: 1, bar: 2, baz: 2 }, - '06': { id: 6, foo: 1, bar: 2, baz: 2 }, - '07': { id: 7, foo: 2, bar: 1, baz: 1 }, - '08': { id: 8, foo: 2, bar: 1, baz: 2 }, - '09': { id: 9, foo: 2, bar: 1, baz: 2 }, - '10': { id: 10, foo: 2, bar: 2, baz: 1 }, - '11': { id: 11, foo: 2, bar: 2, baz: 2 }, - '12': { id: 12, foo: 2, bar: 2, baz: 2 } + firstTag: 'adventure' }, - async collRef => { - const query1 = query( - collRef, - and(where('id', '>=', 2), where('baz', '<', 2)) - ); - const result = await query1.pipeline().execute(); - verifyResults( - result, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 10, foo: 2, bar: 2, baz: 1 } - ); + { + firstTag: 'politics' + }, + { + firstTag: 'classic' } + ]; + expectResults(snapshot, ...expectedResults); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(field('tags').arrayOffset(0).as('firstTag')) + ); + expectResults(snapshot, ...expectedResults); + }); + + // TODO: current_context tests with are failing because of b/395937453 + itIf(testUnsupportedFeatures)('supports currentContext', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(currentContext().as('currentContext')) + ); + expectResults(snapshot, { + currentContext: 'TODO' + }); + }); + + it('supports map', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + map({ + foo: 'bar' + }).as('metadata') + ) ); + + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: { + foo: 'bar' + } + }); + }); + + it('evaluates expression in map', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + map({ + genre: field('genre'), + rating: field('rating').multiply(10) + }).as('metadata') + ) + ); + + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: { + genre: 'Fantasy', + rating: 47 + } + }); + }); + + it('supports mapRemove', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(mapRemove('awards', 'hugo').as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false } + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('awards').mapRemove('hugo').as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false } + }); + }); + + it('supports mapMerge', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(mapMerge('awards', { fakeAward: true }).as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false, hugo: false, fakeAward: true } + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('awards').mapMerge({ fakeAward: true }).as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false, hugo: false, fakeAward: true } + }); + }); + + it('supports timestamp conversions', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + unixSecondsToTimestamp(constant(1741380235)).as( + 'unixSecondsToTimestamp' + ), + unixMillisToTimestamp(constant(1741380235123)).as( + 'unixMillisToTimestamp' + ), + unixMicrosToTimestamp(constant(1741380235123456)).as( + 'unixMicrosToTimestamp' + ), + timestampToUnixSeconds( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixSeconds'), + timestampToUnixMicros( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixMicros'), + timestampToUnixMillis( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixMillis') + ) + ); + expectResults(snapshot, { + unixMicrosToTimestamp: new Timestamp(1741380235, 123456000), + unixMillisToTimestamp: new Timestamp(1741380235, 123000000), + unixSecondsToTimestamp: new Timestamp(1741380235, 0), + timestampToUnixSeconds: 1741380235, + timestampToUnixMicros: 1741380235123456, + timestampToUnixMillis: 1741380235123 + }); + }); + + it('supports timestamp math', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(new Timestamp(1741380235, 0)).as('timestamp')) + .select( + timestampAdd('timestamp', 'day', 10).as('plus10days'), + timestampAdd('timestamp', 'hour', 10).as('plus10hours'), + timestampAdd('timestamp', 'minute', 10).as('plus10minutes'), + timestampAdd('timestamp', 'second', 10).as('plus10seconds'), + timestampAdd('timestamp', 'microsecond', 10).as('plus10micros'), + timestampAdd('timestamp', 'millisecond', 10).as('plus10millis'), + timestampSub('timestamp', 'day', 10).as('minus10days'), + timestampSub('timestamp', 'hour', 10).as('minus10hours'), + timestampSub('timestamp', 'minute', 10).as('minus10minutes'), + timestampSub('timestamp', 'second', 10).as('minus10seconds'), + timestampSub('timestamp', 'microsecond', 10).as('minus10micros'), + timestampSub('timestamp', 'millisecond', 10).as('minus10millis') + ) + ); + expectResults(snapshot, { + plus10days: new Timestamp(1742244235, 0), + plus10hours: new Timestamp(1741416235, 0), + plus10minutes: new Timestamp(1741380835, 0), + plus10seconds: new Timestamp(1741380245, 0), + plus10micros: new Timestamp(1741380235, 10000), + plus10millis: new Timestamp(1741380235, 10000000), + minus10days: new Timestamp(1740516235, 0), + minus10hours: new Timestamp(1741344235, 0), + minus10minutes: new Timestamp(1741379635, 0), + minus10seconds: new Timestamp(1741380225, 0), + minus10micros: new Timestamp(1741380234, 999990000), + minus10millis: new Timestamp(1741380234, 990000000) + }); + }); + + it('supports byteLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .limit(1) + .select( + constant( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes') + ) + .select(byteLength('bytes').as('byteLength')) + ); + + expectResults(snapshot, { + byteLength: 8 + }); + }); + + it('supports not', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .limit(1) + .select(constant(true).as('trueField')) + .select('trueField', not(eq('trueField', true)).as('falseField')) + ); + + expectResults(snapshot, { + trueField: true, + falseField: false + }); + }); + }); + + describe('not yet implemented in backend', () => { + itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitAnd(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 4 + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitAnd(12).as('result')) + ); + expectResults(snapshot, { + result: 4 + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_or', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitOr(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitOr(12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_xor', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitXor(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitXor(12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_not', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( + 'result' + ) + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) + .bitNot() + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_left_shift', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitLeftShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitLeftShift(2) + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_right_shift', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitRightShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitRightShift(2) + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + }); + + itIf(testUnsupportedFeatures)('supports Document_id', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(documentId(field('__path__')).as('docId')) + ); + expectResults(snapshot, { + docId: 'book4' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('__path__').documentId().as('docId')) + ); + expectResults(snapshot, { + docId: 'book4' + }); + }); + + itIf(testUnsupportedFeatures)('supports Substr', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9, 2).as('of')) + ); + expectResults(snapshot, { + of: 'of' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9, 2).as('of')) + ); + expectResults(snapshot, { + of: 'of' + }); + }); + + itIf(testUnsupportedFeatures)( + 'supports Substr without length', + async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + } + ); + + itIf(testUnsupportedFeatures)('arrayConcat works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + arrayConcat('tags', ['newTag1', 'newTag2'], field('tags'), [ + null + ]).as('modifiedTags') + ) + .limit(1) + ); + expectResults(snapshot, { + modifiedTags: [ + 'comedy', + 'space', + 'adventure', + 'newTag1', + 'newTag2', + 'comedy', + 'space', + 'adventure', + null + ] + }); + }); + + itIf(testUnsupportedFeatures)('testToLowercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(toLower('title').as('lowercaseTitle')) + .limit(1) + ); + expectResults(snapshot, { + lowercaseTitle: "the hitchhiker's guide to the galaxy" + }); + }); + + itIf(testUnsupportedFeatures)('testToUppercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(toUpper('author').as('uppercaseAuthor')) + .limit(1) + ); + expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + }); + + itIf(testUnsupportedFeatures)('testTrim', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .addFields( + constant(" The Hitchhiker's Guide to the Galaxy ").as('spacedTitle') + ) + .select(trim('spacedTitle').as('trimmedTitle'), field('spacedTitle')) + .limit(1) + ); + expectResults(snapshot, { + spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + itIf(testUnsupportedFeatures)('test reverse', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', '1984')) + .limit(1) + .select(reverse('title').as('reverseTitle')) + ); + expectResults(snapshot, { title: '4891' }); + }); + }); + + describe('pagination', () => { + /** + * Adds several books to the test collection. These + * additional books support pagination test scenarios + * that would otherwise not be possible with the original + * set of books. + * @param collectionReference + */ + async function addBooks( + collectionReference: CollectionReference + ): Promise { + await setDoc(doc(collectionReference, 'book11'), { + title: 'Jonathan Strange & Mr Norrell', + author: 'Susanna Clarke', + genre: 'Fantasy', + published: 2004, + rating: 4.6, + tags: ['historical fantasy', 'magic', 'alternate history', 'england'], + awards: { hugo: false, nebula: false } + }); + await setDoc(doc(collectionReference, 'book12'), { + title: 'The Master and Margarita', + author: 'Mikhail Bulgakov', + genre: 'Satire', + published: 1967, // Though written much earlier + rating: 4.6, + tags: [ + 'russian literature', + 'supernatural', + 'philosophy', + 'dark comedy' + ], + awards: {} + }); + await setDoc(doc(collectionReference, 'book13'), { + title: 'A Long Way to a Small, Angry Planet', + author: 'Becky Chambers', + genre: 'Science Fiction', + published: 2014, + rating: 4.6, + tags: ['space opera', 'found family', 'character-driven', 'optimistic'], + awards: { hugo: false, nebula: false, kitschies: true } + }); + } + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports pagination with filters', + async () => { + await addBooks(randomCol); + const pageSize = 2; + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', '__name__') + .sort(field('rating').descending(), field('__name__').ascending()); + + let snapshot = await execute(pipeline.limit(pageSize)); + expectResults( + snapshot, + { title: 'The Lord of the Rings', rating: 4.7 }, + { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } + ); + + const lastDoc = snapshot.results[snapshot.results.length - 1]; + + snapshot = await execute( + pipeline + .where( + or( + and( + field('rating').eq(lastDoc.get('rating')), + field('__path__').gt(lastDoc.ref?.id) + ), + field('rating').lt(lastDoc.get('rating')) + ) + ) + .limit(pageSize) + ); + expectResults( + snapshot, + { title: 'Pride and Prejudice', rating: 4.5 }, + { title: 'Crime and Punishment', rating: 4.3 } + ); + } + ); + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports pagination with offsets', + async () => { + await addBooks(randomCol); + + const secondFilterField = '__path__'; + + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', secondFilterField) + .sort( + field('rating').descending(), + field(secondFilterField).ascending() + ); + + const pageSize = 2; + let currPage = 0; + + let snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + + expectResults( + snapshot, + { + title: 'The Lord of the Rings', + rating: 4.7 + }, + { title: 'Dune', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'Jonathan Strange & Mr Norrell', + rating: 4.6 + }, + { title: 'The Master and Margarita', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'A Long Way to a Small, Angry Planet', + rating: 4.6 + }, + { + title: 'Pride and Prejudice', + rating: 4.5 + } + ); + } + ); + }); + + describe('console support', () => { + it('supports internal serialization to proto', async () => { + const pipeline = firestore + .pipeline() + .collection('books') + .where(eq('awards.hugo', true)) + .select( + 'title', + field('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ); + + const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); + expect(proto).not.to.be.null; }); }); }); diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts new file mode 100644 index 00000000000..8eac50a5afa --- /dev/null +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -0,0 +1,827 @@ +/** + * @license + * Copyright 2024 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 { expect, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result'; +import { addEqualityMatcher } from '../../util/equality_matcher'; +import { + doc, + DocumentData, + setDoc, + setLogLevel, + query, + where, + FieldPath, + orderBy, + limit, + limitToLast, + startAt, + startAfter, + endAt, + endBefore, + collectionGroup, + collection, + and, + documentId, + addDoc, + getDoc, + or +} from '../util/firebase_export'; +import { + apiDescribe, + PERSISTENCE_MODE_UNSPECIFIED, + withTestCollection, + itIf +} from '../util/helpers'; +import { execute } from '../util/pipeline_export'; + +use(chaiAsPromised); + +setLogLevel('debug'); + +const testUnsupportedFeatures = false; + +// This is the Query integration tests from the lite API (no cache support) +// with some additional test cases added for more complete coverage. +apiDescribe.only('Query to Pipeline', persistence => { + addEqualityMatcher(); + + function verifyResults( + actual: PipelineSnapshot, + ...expected: DocumentData[] + ): void { + const results = actual.results; + expect(results.length).to.equal(expected.length); + + for (let i = 0; i < expected.length; ++i) { + expect(results[i].data()).to.deep.equal(expected[i]); + } + } + + it('supports default query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { 1: { foo: 1 } }, + async (collRef, db) => { + const snapshot = await execute(db.pipeline().createFrom(collRef)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports filtered query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('foo', '==', 1)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports filtered query (with FieldPath)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, where(new FieldPath('foo'), '==', 1)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports ordered query (with default order)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo')); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }, { foo: 2 }); + } + ); + }); + + it('supports ordered query (with asc)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo', 'asc')); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }, { foo: 2 }); + } + ); + }); + + it('supports ordered query (with desc)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo', 'desc')); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }, { foo: 1 }); + } + ); + }); + + it('supports limit query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), limit(1)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports limitToLast query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 }, + 3: { foo: 3 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), limitToLast(2)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }, { foo: 3 }); + } + ); + }); + + it('supports startAt', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), startAt(2)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }); + } + ); + }); + + it('supports startAt with limitToLast', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 }, + 3: { foo: 3 }, + 4: { foo: 4 }, + 5: { foo: 5 } + }, + async (collRef, db) => { + const query1 = query( + collRef, + orderBy('foo'), + startAt(3), + limitToLast(4) + ); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 3 }, { foo: 4 }, { foo: 5 }); + } + ); + }); + + it('supports endAt with limitToLast', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 }, + 3: { foo: 3 }, + 4: { foo: 4 }, + 5: { foo: 5 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), endAt(3), limitToLast(2)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }, { foo: 3 }); + } + ); + }); + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports startAfter (with DocumentSnapshot)', + () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + let snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } + ); + } + ); + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports startAt (with DocumentSnapshot)', + () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + let snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 2, foo: 1, bar: 1, baz: 2 }, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } + ); + } + ); + + it('supports startAfter', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), startAfter(1)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }); + } + ); + }); + + it('supports endAt', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), endAt(1)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports endBefore', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + const query1 = query(collRef, orderBy('foo'), endBefore(2)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports pagination', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + let query1 = query(collRef, orderBy('foo'), limit(1)); + const pipeline1 = db.pipeline().createFrom(query1); + let snapshot = await execute(pipeline1); + verifyResults(snapshot, { foo: 1 }); + + // Pass the document snapshot from the previous snapshot + query1 = query(query1, startAfter(snapshot.results[0].get('foo'))); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }); + } + ); + }); + + it('supports pagination on DocumentIds', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1 }, + 2: { foo: 2 } + }, + async (collRef, db) => { + let query1 = query( + collRef, + orderBy('foo'), + orderBy(documentId(), 'asc'), + limit(1) + ); + const pipeline1 = db.pipeline().createFrom(query1); + let snapshot = await execute(pipeline1); + verifyResults(snapshot, { foo: 1 }); + + // Pass the document snapshot from the previous snapshot + query1 = query( + query1, + startAfter( + snapshot.results[0].get('foo'), + snapshot.results[0].ref?.id + ) + ); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2 }); + } + ); + }); + + // needs subcollection support + itIf(testUnsupportedFeatures)('supports collection groups', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + {}, + async (collRef, db) => { + const collectionGroupId = `${collRef.id}group`; + + const fooDoc = doc( + collRef.firestore, + `${collRef.id}/foo/${collectionGroupId}/doc1` + ); + const barDoc = doc( + collRef.firestore, + `${collRef.id}/bar/baz/boo/${collectionGroupId}/doc2` + ); + await setDoc(fooDoc, { foo: 1 }); + await setDoc(barDoc, { bar: 1 }); + + const query1 = collectionGroup(collRef.firestore, collectionGroupId); + const snapshot = await execute(db.pipeline().createFrom(query1)); + + verifyResults(snapshot, { bar: 1 }, { foo: 1 }); + } + ); + }); + + // needs subcollection support + itIf(testUnsupportedFeatures)( + 'supports query over collection path with special characters', + () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + {}, + async (collRef, db) => { + const docWithSpecials = doc(collRef, 'so!@#$%^&*()_+special'); + + const collectionWithSpecials = collection( + docWithSpecials, + 'so!@#$%^&*()_+special' + ); + await addDoc(collectionWithSpecials, { foo: 1 }); + await addDoc(collectionWithSpecials, { foo: 2 }); + + const snapshot = await execute( + db + .pipeline() + .createFrom(query(collectionWithSpecials, orderBy('foo', 'asc'))) + ); + + verifyResults(snapshot, { foo: 1 }, { foo: 2 }); + } + ); + } + ); + + it('supports multiple inequality on same field', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + '01': { id: 1, foo: 1, bar: 1, baz: 1 }, + '02': { id: 2, foo: 1, bar: 1, baz: 2 }, + '03': { id: 3, foo: 1, bar: 1, baz: 2 }, + '04': { id: 4, foo: 1, bar: 2, baz: 1 }, + '05': { id: 5, foo: 1, bar: 2, baz: 2 }, + '06': { id: 6, foo: 1, bar: 2, baz: 2 }, + '07': { id: 7, foo: 2, bar: 1, baz: 1 }, + '08': { id: 8, foo: 2, bar: 1, baz: 2 }, + '09': { id: 9, foo: 2, bar: 1, baz: 2 }, + '10': { id: 10, foo: 2, bar: 2, baz: 1 }, + '11': { id: 11, foo: 2, bar: 2, baz: 2 }, + '12': { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + const query1 = query( + collRef, + and(where('id', '>', 2), where('id', '<=', 10)) + ); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 } + ); + } + ); + }); + + it('supports multiple inequality on different fields', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + '01': { id: 1, foo: 1, bar: 1, baz: 1 }, + '02': { id: 2, foo: 1, bar: 1, baz: 2 }, + '03': { id: 3, foo: 1, bar: 1, baz: 2 }, + '04': { id: 4, foo: 1, bar: 2, baz: 1 }, + '05': { id: 5, foo: 1, bar: 2, baz: 2 }, + '06': { id: 6, foo: 1, bar: 2, baz: 2 }, + '07': { id: 7, foo: 2, bar: 1, baz: 1 }, + '08': { id: 8, foo: 2, bar: 1, baz: 2 }, + '09': { id: 9, foo: 2, bar: 1, baz: 2 }, + '10': { id: 10, foo: 2, bar: 2, baz: 1 }, + '11': { id: 11, foo: 2, bar: 2, baz: 2 }, + '12': { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + const query1 = query( + collRef, + and(where('id', '>=', 2), where('baz', '<', 2)) + ); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 10, foo: 2, bar: 2, baz: 1 } + ); + } + ); + }); + + it('supports collectionGroup query', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { 1: { foo: 1 } }, + async (collRef, db) => { + const snapshot = await execute( + db.pipeline().createFrom(collectionGroup(db, collRef.id)) + ); + verifyResults(snapshot, { foo: 1 }); + } + ); + }); + + it('supports eq nan', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: NaN }, + 2: { foo: 2, bar: 1 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', '==', NaN)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: NaN }); + } + ); + }); + + it('supports neq nan', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: NaN }, + 2: { foo: 2, bar: 1 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', '!=', NaN)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2, bar: 1 }); + } + ); + }); + + it('supports eq null', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: null }, + 2: { foo: 2, bar: 1 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', '==', null)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: null }); + } + ); + }); + + it('supports neq null', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: null }, + 2: { foo: 2, bar: 1 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', '!=', null)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2, bar: 1 }); + } + ); + }); + + it('supports neq', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 0 }, + 2: { foo: 2, bar: 1 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', '!=', 0)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 2, bar: 1 }); + } + ); + }); + + it('supports array contains', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: [0, 2, 4, 6] }, + 2: { foo: 2, bar: [1, 3, 5, 7] } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', 'array-contains', 4)); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: [0, 2, 4, 6] }); + } + ); + }); + + // sorting on name required + itIf(testUnsupportedFeatures)('supports array contains any', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: [0, 2, 4, 6] }, + 2: { foo: 2, bar: [1, 3, 5, 7] }, + 3: { foo: 3, bar: [10, 20, 30, 40] } + }, + async (collRef, db) => { + const query1 = query( + collRef, + where('bar', 'array-contains-any', [4, 5]) + ); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { foo: 1, bar: [0, 2, 4, 6] }, + { foo: 2, bar: [1, 3, 5, 7] } + ); + } + ); + }); + + it('supports in', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 2 }, + 2: { foo: 2 }, + 3: { foo: 3, bar: 10 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', 'in', [0, 10, 20])); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 3, bar: 10 }); + } + ); + }); + + it('supports in with 1', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 2 }, + 2: { foo: 2 }, + 3: { foo: 3, bar: 10 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', 'in', [2])); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: 2 }); + } + ); + }); + + itIf(testUnsupportedFeatures)('supports not in', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 2 }, + 2: { foo: 2, bar: 1 }, + 3: { foo: 3, bar: 10 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', 'not-in', [0, 10, 20])); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: 2 }, { foo: 2, bar: 1 }); + } + ); + }); + + it('supports not in with 1', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 2 }, + 2: { foo: 2 }, + 3: { foo: 3, bar: 10 } + }, + async (collRef, db) => { + const query1 = query(collRef, where('bar', 'not-in', [2])); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 3, bar: 10 }); + } + ); + }); + + it('supports or operator', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { foo: 1, bar: 2 }, + 2: { foo: 2, bar: 0 }, + 3: { foo: 3, bar: 10 } + }, + async (collRef, db) => { + const query1 = query( + collRef, + or(where('bar', '==', 2), where('foo', '==', 3)), + orderBy('foo') + ); + const snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults(snapshot, { foo: 1, bar: 2 }, { foo: 3, bar: 10 }); + } + ); + }); +}); diff --git a/packages/firestore/test/integration/util/firebase_export.ts b/packages/firestore/test/integration/util/firebase_export.ts index a6739dfe72f..f58b3ce045b 100644 --- a/packages/firestore/test/integration/util/firebase_export.ts +++ b/packages/firestore/test/integration/util/firebase_export.ts @@ -51,5 +51,4 @@ export function newTestFirestore( } export * from '../../../src'; -export * from '../../../pipelines/pipelines'; export { PrivateSettings }; diff --git a/packages/firestore/test/integration/util/helpers.ts b/packages/firestore/test/integration/util/helpers.ts index 465bc8edd61..81d97867d09 100644 --- a/packages/firestore/test/integration/util/helpers.ts +++ b/packages/firestore/test/integration/util/helpers.ts @@ -557,3 +557,10 @@ export async function checkOnlineAndOfflineResultsMatch( const docsFromCache = await getDocsFromCache(query); expect(toIds(docsFromServer)).to.deep.equal(toIds(docsFromCache)); } + +export function itIf( + condition: boolean | 'only' +): Mocha.TestFunction | Mocha.PendingTestFunction { + // eslint-disable-next-line no-restricted-properties + return condition === 'only' ? it.only : condition ? it : it.skip; +} diff --git a/packages/firestore/src/all_packages.ts b/packages/firestore/test/integration/util/pipeline_export.ts similarity index 61% rename from packages/firestore/src/all_packages.ts rename to packages/firestore/test/integration/util/pipeline_export.ts index 82babeea706..d2495d772a5 100644 --- a/packages/firestore/src/all_packages.ts +++ b/packages/firestore/test/integration/util/pipeline_export.ts @@ -1,12 +1,6 @@ -/** - * Cloud Firestore - * - * @packageDocumentation - */ - /** * @license - * Copyright 2024 Google LLC + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,5 +15,9 @@ * limitations under the License. */ -export * from './api'; -export * from './api_pipelines'; +// Imports firebase via the raw sources and re-exports it. The +// "/integration/firestore" test suite replaces this file with a +// reference to the minified sources. If you change any exports in this file, +// you need to also adjust "integration/firestore/pipeline_export.ts". + +export * from '../../../pipelines/pipelines'; diff --git a/packages/firestore/test/lite/pipeline.test.ts b/packages/firestore/test/lite/pipeline.test.ts new file mode 100644 index 00000000000..e3e5083a811 --- /dev/null +++ b/packages/firestore/test/lite/pipeline.test.ts @@ -0,0 +1,2919 @@ +/** + * @license + * Copyright 2024 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. + */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { expect, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import { Bytes } from '../../src/lite-api/bytes'; +import { + Firestore, + getFirestore, + terminate +} from '../../src/lite-api/database'; +import { + field, + and, + array, + arrayOffset, + constant, + add, + subtract, + multiply, + avg, + bitAnd, + substr, + constantVector, + bitLeftShift, + bitNot, + count, + mapMerge, + mapRemove, + bitOr, + ifError, + isAbsent, + isError, + or, + rand, + bitRightShift, + bitXor, + isNotNan, + map, + isNotNull, + isNull, + mod, + documentId, + eq, + neq, + lt, + countIf, + currentContext, + lte, + gt, + arrayConcat, + arrayContains, + arrayContainsAny, + eqAny, + notEqAny, + xor, + cond, + logicalMaximum, + logicalMinimum, + exists, + isNan, + reverse, + like, + regexContains, + regexMatch, + strContains, + startsWith, + endsWith, + mapGet, + countAll, + minimum, + maximum, + cosineDistance, + dotProduct, + euclideanDistance, + vectorLength, + unixMicrosToTimestamp, + timestampToUnixMicros, + unixMillisToTimestamp, + timestampToUnixMillis, + unixSecondsToTimestamp, + timestampToUnixSeconds, + timestampAdd, + timestampSub, + ascending, + descending, + FunctionExpr, + BooleanExpr, + AggregateFunction +} from '../../src/lite-api/expressions'; +import { documentId as documentIdFieldPath } from '../../src/lite-api/field_path'; +import { vector } from '../../src/lite-api/field_value_impl'; +import { GeoPoint } from '../../src/lite-api/geo_point'; +import { PipelineSnapshot } from '../../src/lite-api/pipeline-result'; +import { execute } from '../../src/lite-api/pipeline_impl'; +import { + DocumentData, + CollectionReference, + collection, + doc +} from '../../src/lite-api/reference'; +import { addDoc, setDoc } from '../../src/lite-api/reference_impl'; +import { FindNearestOptions } from '../../src/lite-api/stage'; +import { Timestamp } from '../../src/lite-api/timestamp'; +import { writeBatch } from '../../src/lite-api/write_batch'; +import { addEqualityMatcher } from '../util/equality_matcher'; +import { Deferred } from '../util/promise'; + +import { withTestCollection } from './helpers'; + +use(chaiAsPromised); + +describe('Firestore Pipelines', () => { + addEqualityMatcher(); + + let firestore: Firestore; + let randomCol: CollectionReference; + let beginDocCreation: number = 0; + let endDocCreation: number = 0; + + async function testCollectionWithDocs(docs: { + [id: string]: DocumentData; + }): Promise> { + beginDocCreation = new Date().valueOf(); + for (const id in docs) { + if (docs.hasOwnProperty(id)) { + const ref = doc(randomCol, id); + await setDoc(ref, docs[id]); + } + } + endDocCreation = new Date().valueOf(); + return randomCol; + } + + function expectResults(snapshot: PipelineSnapshot, ...docs: string[]): void; + function expectResults( + snapshot: PipelineSnapshot, + ...data: DocumentData[] + ): void; + + function expectResults( + snapshot: PipelineSnapshot, + ...data: DocumentData[] | string[] + ): void { + const docs = snapshot.results; + + expect(docs.length).to.equal(data.length); + + if (data.length > 0) { + if (typeof data[0] === 'string') { + const actualIds = docs.map(doc => doc.id); + expect(actualIds).to.deep.equal(data); + } else { + docs.forEach(r => { + expect(r.data()).to.deep.equal(data.shift()); + }); + } + } + } + + async function setupBookDocs(): Promise> { + const bookDocs: { [id: string]: DocumentData } = { + book1: { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } }, + embedding: vector([10, 1, 1, 1, 1, 1, 1, 1, 1, 1]) + }, + book2: { + title: 'Pride and Prejudice', + author: 'Jane Austen', + genre: 'Romance', + published: 1813, + rating: 4.5, + tags: ['classic', 'social commentary', 'love'], + awards: { none: true }, + embedding: vector([1, 10, 1, 1, 1, 1, 1, 1, 1, 1]) + }, + book3: { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + genre: 'Magical Realism', + published: 1967, + rating: 4.3, + tags: ['family', 'history', 'fantasy'], + awards: { nobel: true, nebula: false }, + embedding: vector([1, 1, 10, 1, 1, 1, 1, 1, 1, 1]) + }, + book4: { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false }, + remarks: null, + cost: NaN, + embedding: vector([1, 1, 1, 10, 1, 1, 1, 1, 1, 1]) + }, + book5: { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + genre: 'Dystopian', + published: 1985, + rating: 4.1, + tags: ['feminism', 'totalitarianism', 'resistance'], + awards: { 'arthur c. clarke': true, 'booker prize': false }, + embedding: vector([1, 1, 1, 1, 10, 1, 1, 1, 1, 1]) + }, + book6: { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + genre: 'Psychological Thriller', + published: 1866, + rating: 4.3, + tags: ['philosophy', 'crime', 'redemption'], + awards: { none: true }, + embedding: vector([1, 1, 1, 1, 1, 10, 1, 1, 1, 1]) + }, + book7: { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + genre: 'Southern Gothic', + published: 1960, + rating: 4.2, + tags: ['racism', 'injustice', 'coming-of-age'], + awards: { pulitzer: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 10, 1, 1, 1]) + }, + book8: { + title: '1984', + author: 'George Orwell', + genre: 'Dystopian', + published: 1949, + rating: 4.2, + tags: ['surveillance', 'totalitarianism', 'propaganda'], + awards: { prometheus: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 10, 1, 1]) + }, + book9: { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + genre: 'Modernist', + published: 1925, + rating: 4.0, + tags: ['wealth', 'american dream', 'love'], + awards: { none: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 1, 10, 1]) + }, + book10: { + title: 'Dune', + author: 'Frank Herbert', + genre: 'Science Fiction', + published: 1965, + rating: 4.6, + tags: ['politics', 'desert', 'ecology'], + awards: { hugo: true, nebula: true }, + embedding: vector([1, 1, 1, 1, 1, 1, 1, 1, 1, 10]) + } + }; + return testCollectionWithDocs(bookDocs); + } + + let testDeferred: Deferred | undefined; + let withTestCollectionPromise: Promise | undefined; + + beforeEach(async () => { + const setupDeferred = new Deferred(); + testDeferred = new Deferred(); + withTestCollectionPromise = withTestCollection(async collectionRef => { + randomCol = collectionRef; + firestore = collectionRef.firestore; + await setupBookDocs(); + setupDeferred.resolve(); + + return testDeferred?.promise; + }); + + await setupDeferred.promise; + }); + + afterEach(async () => { + testDeferred?.resolve(); + await withTestCollectionPromise; + }); + + describe('pipeline results', () => { + it('empty snapshot as expected', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol.path).limit(0) + ); + expect(snapshot.results.length).to.equal(0); + }); + + it('full snapshot as expected', async () => { + const ppl = firestore.pipeline().collection(randomCol.path); + const snapshot = await execute(ppl); + expect(snapshot.results.length).to.equal(10); + expect(snapshot.pipeline).to.equal(ppl); + expectResults( + snapshot, + 'book1', + 'book10', + 'book2', + 'book3', + 'book4', + 'book5', + 'book6', + 'book7', + 'book8', + 'book9' + ); + }); + + it('returns execution time', async () => { + const start = new Date().valueOf(); + const pipeline = firestore.pipeline().collection(randomCol.path); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + end - start + ); + }); + + it('returns execution time for an empty query', async () => { + const start = new Date().valueOf(); + const pipeline = firestore.pipeline().collection(randomCol.path).limit(0); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.results.length).to.equal(0); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + end - start + ); + }); + + it('returns create and update time for each document', async () => { + const pipeline = firestore.pipeline().collection(randomCol.path); + + let snapshot = await execute(pipeline); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(doc => { + expect(doc.createTime).to.not.be.null; + expect(doc.updateTime).to.not.be.null; + + expect(doc.createTime!.toDate().valueOf()).to.approximately( + (beginDocCreation + endDocCreation) / 2, + endDocCreation - beginDocCreation + ); + expect(doc.updateTime!.toDate().valueOf()).to.approximately( + (beginDocCreation + endDocCreation) / 2, + endDocCreation - beginDocCreation + ); + expect(doc.createTime?.valueOf()).to.equal(doc.updateTime?.valueOf()); + }); + + const wb = writeBatch(firestore); + snapshot.results.forEach(doc => { + wb.update(doc.ref!, { newField: 'value' }); + }); + await wb.commit(); + + snapshot = await execute(pipeline); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(doc => { + expect(doc.createTime).to.not.be.null; + expect(doc.updateTime).to.not.be.null; + expect(doc.createTime!.toDate().valueOf()).to.be.lessThan( + doc.updateTime!.toDate().valueOf() + ); + }); + }); + + it('returns execution time for an aggregate query', async () => { + const start = new Date().valueOf(); + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .aggregate(avg('rating').as('avgRating')); + + const snapshot = await execute(pipeline); + const end = new Date().valueOf(); + + expect(snapshot.results.length).to.equal(1); + + expect(snapshot.executionTime.toDate().valueOf()).to.approximately( + (start + end) / 2, + end - start + ); + }); + + it('returns undefined create and update time for each result in an aggregate query', async () => { + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }); + + const snapshot = await execute(pipeline); + + expect(snapshot.results.length).to.equal(8); + + snapshot.results.forEach(doc => { + expect(doc.updateTime).to.be.undefined; + expect(doc.createTime).to.be.undefined; + }); + }); + }); + + describe('pipeline sources', () => { + it('supports CollectionReference as source', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol) + ); + expect(snapshot.results.length).to.equal(10); + }); + + it('supports list of documents as source', async () => { + const collName = randomCol.id; + + const snapshot = await execute( + firestore + .pipeline() + .documents([ + `${collName}/book1`, + doc(randomCol, 'book2'), + doc(randomCol, 'book3').path + ]) + ); + expect(snapshot.results.length).to.equal(3); + }); + + it('reject CollectionReference for another DB', async () => { + const db2 = getFirestore(firestore.app, 'notDefault'); + + expect(() => { + firestore.pipeline().collection(collection(db2, 'foo')); + }).to.throw(/Invalid CollectionReference/); + + await terminate(db2); + }); + + it('reject DocumentReference for another DB', async () => { + const db2 = getFirestore(firestore.app, 'notDefault'); + + expect(() => { + firestore.pipeline().documents([doc(db2, 'foo/bar')]); + }).to.throw(/Invalid DocumentReference/); + + await terminate(db2); + }); + + it('supports collection group as source', async () => { + const randomSubCollectionId = Math.random().toString(16).slice(2); + const doc1 = await addDoc( + collection(randomCol, 'book1', randomSubCollectionId), + { order: 1 } + ); + const doc2 = await addDoc( + collection(randomCol, 'book2', randomSubCollectionId), + { order: 2 } + ); + const snapshot = await execute( + firestore + .pipeline() + .collectionGroup(randomSubCollectionId) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + }); + + it('supports database as source', async () => { + const randomId = Math.random().toString(16).slice(2); + const doc1 = await addDoc(collection(randomCol, 'book1', 'sub'), { + order: 1, + randomId + }); + const doc2 = await addDoc(collection(randomCol, 'book2', 'sub'), { + order: 2, + randomId + }); + const snapshot = await execute( + firestore + .pipeline() + .database() + .where(eq('randomId', randomId)) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + }); + }); + + describe('supported data types', () => { + it('accepts and returns all data types', async () => { + const refDate = new Date(); + const refTimestamp = Timestamp.now(); + const constants = [ + constant(1).as('number'), + constant('a string').as('string'), + constant(true).as('boolean'), + constant(null).as('null'), + constant(new GeoPoint(0.1, 0.2)).as('geoPoint'), + constant(refTimestamp).as('timestamp'), + constant(refDate).as('date'), + constant( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes'), + constant(doc(firestore, 'foo', 'bar')).as('documentReference'), + constantVector(vector([1, 2, 3])).as('vectorValue'), + constantVector([1, 2, 3]).as('vectorValue2'), + map({ + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': refDate, + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }).as('map'), + array([ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + refDate, + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ]).as('array') + ]; + + const snapshots = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constants[0], ...constants.slice(1)) + ); + + expectResults(snapshots, { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'bytes': Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'vectorValue2': vector([1, 2, 3]), + 'map': { + 'number': 1, + 'string': 'a string', + 'boolean': true, + 'null': null, + 'geoPoint': new GeoPoint(0.1, 0.2), + 'timestamp': refTimestamp, + 'date': Timestamp.fromDate(refDate), + 'uint8Array': Bytes.fromUint8Array( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0]) + ), + 'documentReference': doc(firestore, 'foo', 'bar'), + 'vectorValue': vector([1, 2, 3]), + 'map': { + 'number': 2, + 'string': 'b string' + }, + 'array': [1, 'c string'] + }, + 'array': [ + 1, + 'a string', + true, + null, + new GeoPoint(0.1, 0.2), + refTimestamp, + Timestamp.fromDate(refDate), + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), + doc(firestore, 'foo', 'bar'), + vector([1, 2, 3]), + { + 'number': 2, + 'string': 'b string' + } + ] + }); + }); + + it('throws on undefined in a map', async () => { + expect(() => { + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + map({ + 'number': 1, + 'undefined': array([undefined]) + }).as('foo') + ); + }).to.throw( + 'Function constant() called with invalid data. Unsupported field value: undefined' + ); + }); + + it('throws on undefined in an array', async () => { + expect(() => { + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(array([1, undefined]).as('foo')); + }).to.throw( + 'Function constant() called with invalid data. Unsupported field value: undefined' + ); + }); + + it('converts arrays and plain objects to functionValues if the customer intent is unspecified', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + 'title', + 'author', + 'genre', + 'rating', + 'published', + 'tags', + 'awards' + ) + .addFields( + array([ + 1, + 2, + field('genre'), + multiply('rating', 10), + [field('title')], + { + published: field('published') + } + ]).as('metadataArray'), + map({ + genre: field('genre'), + rating: multiply('rating', 10), + nestedArray: [field('title')], + nestedMap: { + published: field('published') + } + }).as('metadata') + ) + .where( + and( + eq('metadataArray', [ + 1, + 2, + field('genre'), + multiply('rating', 10), + [field('title')], + { + published: field('published') + } + ]), + eq('metadata', { + genre: field('genre'), + rating: multiply('rating', 10), + nestedArray: [field('title')], + nestedMap: { + published: field('published') + } + }) + ) + ) + ); + + expect(snapshot.results.length).to.equal(1); + + expectResults(snapshot, { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + genre: 'Fantasy', + published: 1954, + rating: 4.7, + tags: ['adventure', 'magic', 'epic'], + awards: { hugo: false, nebula: false }, + metadataArray: [ + 1, + 2, + 'Fantasy', + 47, + ['The Lord of the Rings'], + { + published: 1954 + } + ], + metadata: { + genre: 'Fantasy', + rating: 47, + nestedArray: ['The Lord of the Rings'], + nestedMap: { + published: 1954 + } + } + }); + }); + }); + + describe('stages', () => { + describe('aggregate stage', () => { + it('supports aggregate', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countAll().as('count')) + ); + expectResults(snapshot, { count: 10 }); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + avg('rating').as('avgRating'), + field('rating').maximum().as('maxRating') + ) + ); + expectResults(snapshot, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + }); + + it('rejects groups without accumulators', async () => { + await expect( + execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(lt('published', 1900)) + .aggregate({ + accumulators: [], + groups: ['genre'] + }) + ) + ).to.be.rejected; + }); + + it('returns group and accumulate results', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(lt(field('published'), 1984)) + .aggregate({ + accumulators: [avg('rating').as('avgRating')], + groups: ['genre'] + }) + .where(gt('avgRating', 4.3)) + .sort(field('avgRating').descending()) + ); + expectResults( + snapshot, + { avgRating: 4.7, genre: 'Fantasy' }, + { avgRating: 4.5, genre: 'Romance' }, + { avgRating: 4.4, genre: 'Science Fiction' } + ); + }); + + it('returns min, max, count, and countAll accumulations', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate( + count('cost').as('booksWithCost'), + countAll().as('count'), + maximum('rating').as('maxRating'), + minimum('published').as('minPublished') + ) + ); + expectResults(snapshot, { + booksWithCost: 1, + count: 10, + maxRating: 4.7, + minPublished: 1813 + }); + }); + + it('returns countif accumulation', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countIf(field('rating').gt(4.3)).as('count')) + ); + const expectedResults = { + count: 3 + }; + expectResults(snapshot, expectedResults); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(field('rating').gt(4.3).countIf().as('count')) + ); + expectResults(snapshot, expectedResults); + }); + }); + + describe('distinct stage', () => { + it('returns distinct values as expected', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .distinct('genre', 'author') + .sort(field('genre').ascending(), field('author').ascending()) + ); + expectResults( + snapshot, + { genre: 'Dystopian', author: 'George Orwell' }, + { genre: 'Dystopian', author: 'Margaret Atwood' }, + { genre: 'Fantasy', author: 'J.R.R. Tolkien' }, + { genre: 'Magical Realism', author: 'Gabriel García Márquez' }, + { genre: 'Modernist', author: 'F. Scott Fitzgerald' }, + { genre: 'Psychological Thriller', author: 'Fyodor Dostoevsky' }, + { genre: 'Romance', author: 'Jane Austen' }, + { genre: 'Science Fiction', author: 'Douglas Adams' }, + { genre: 'Science Fiction', author: 'Frank Herbert' }, + { genre: 'Southern Gothic', author: 'Harper Lee' } + ); + }); + }); + + describe('select stage', () => { + it('can select fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' + }, + { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' }, + { title: 'Dune', author: 'Frank Herbert' }, + { title: 'Crime and Punishment', author: 'Fyodor Dostoevsky' }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez' + }, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' }, + { title: 'Pride and Prejudice', author: 'Jane Austen' }, + { title: "The Handmaid's Tale", author: 'Margaret Atwood' } + ); + }); + }); + + describe('addField stage', () => { + it('can add fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .addFields(constant('bar').as('foo')) + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + foo: 'bar' + }, + { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + foo: 'bar' + }, + { title: 'Dune', author: 'Frank Herbert', foo: 'bar' }, + { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + foo: 'bar' + }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + foo: 'bar' + }, + { title: '1984', author: 'George Orwell', foo: 'bar' }, + { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + foo: 'bar' + }, + { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + foo: 'bar' + }, + { title: 'Pride and Prejudice', author: 'Jane Austen', foo: 'bar' }, + { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + foo: 'bar' + } + ); + }); + }); + + describe('removeFields stage', () => { + it('can remove fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .sort(field('author').ascending()) + .removeFields(field('author')) + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'The Great Gatsby' + }, + { title: 'Dune' }, + { + title: 'Crime and Punishment' + }, + { + title: 'One Hundred Years of Solitude' + }, + { title: '1984' }, + { + title: 'To Kill a Mockingbird' + }, + { + title: 'The Lord of the Rings' + }, + { title: 'Pride and Prejudice' }, + { + title: "The Handmaid's Tale" + } + ); + }); + }); + + describe('where stage', () => { + it('where with and (2 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.5), + eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) + ) + ) + ); + expectResults(snapshot, 'book10', 'book4'); + }); + it('where with and (3 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.5), + eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), + lt('published', 1965) + ) + ) + ); + expectResults(snapshot, 'book4'); + }); + it('where with or', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + or( + eq('genre', 'Romance'), + eq('genre', 'Dystopian'), + eq('genre', 'Fantasy') + ) + ) + .select('title') + ); + expectResults( + snapshot, + { title: 'Pride and Prejudice' }, + { title: 'The Lord of the Rings' }, + { title: "The Handmaid's Tale" }, + { title: '1984' } + ); + }); + + it('where with xor', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + xor( + eq('genre', 'Romance'), + eq('genre', 'Dystopian'), + eq('genre', 'Fantasy'), + eq('published', 1949) + ) + ) + .select('title') + ); + expectResults( + snapshot, + { title: 'Pride and Prejudice' }, + { title: 'The Lord of the Rings' }, + { title: "The Handmaid's Tale" } + ); + }); + }); + + describe('sort, offset, and limit stages', () => { + it('supports sort, offset, and limits', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('author').ascending()) + .offset(5) + .limit(3) + .select('title', 'author') + ); + expectResults( + snapshot, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); + }); + }); + + describe('generic stage', () => { + it('can select fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .genericStage('select', [ + { + title: field('title'), + metadata: { + 'author': field('author') + } + } + ]) + .sort(field('author').ascending()) + .limit(1) + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy", + metadata: { + author: 'Douglas Adams' + } + }); + }); + + it('can add fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('author').ascending()) + .limit(1) + .select('title', 'author') + .genericStage('add_fields', [ + { + display: field('title').strConcat(' - ', field('author')) + } + ]) + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + display: "The Hitchhiker's Guide to the Galaxy - Douglas Adams" + }); + }); + + it('can filter with where', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .genericStage('where', [field('author').eq('Douglas Adams')]) + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams' + }); + }); + + it('can limit, offset, and sort', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .genericStage('sort', [ + { + direction: 'ascending', + expression: field('author') + } + ]) + .genericStage('offset', [3]) + .genericStage('limit', [1]) + ); + expectResults(snapshot, { + author: 'Fyodor Dostoevsky', + title: 'Crime and Punishment' + }); + }); + + it('can perform aggregate query', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author', 'rating') + .genericStage('aggregate', [ + { averageRating: field('rating').avg() }, + {} + ]) + ); + expectResults(snapshot, { + averageRating: 4.3100000000000005 + }); + }); + + it('can perform distinct query', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author', 'rating') + .genericStage('distinct', [{ rating: field('rating') }]) + .sort(field('rating').descending()) + ); + expectResults( + snapshot, + { + rating: 4.7 + }, + { + rating: 4.6 + }, + { + rating: 4.5 + }, + { + rating: 4.3 + }, + { + rating: 4.2 + }, + { + rating: 4.1 + }, + { + rating: 4.0 + } + ); + }); + }); + + describe('replace stage', () => { + it('run pipleine with replace', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .replaceWith('awards') + ); + expectResults(snapshot, { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }); + }); + }); + + describe('sample stage', () => { + it('run pipeline with sample limit of 3', async () => { + const snapshot = await execute( + firestore.pipeline().collection(randomCol.path).sample(3) + ); + expect(snapshot.results.length).to.equal(3); + }); + + it('run pipeline with sample limit of {documents: 3}', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sample({ documents: 3 }) + ); + expect(snapshot.results.length).to.equal(3); + }); + + it('run pipeline with sample limit of {percentage: 0.6}', async () => { + let avgSize = 0; + const numIterations = 20; + for (let i = 0; i < numIterations; i++) { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sample({ percentage: 0.6 }) + ); + + avgSize += snapshot.results.length; + } + avgSize /= numIterations; + expect(avgSize).to.be.closeTo(6, 1); + }); + }); + + describe('union stage', () => { + it('run pipeline with union', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .union(firestore.pipeline().collection(randomCol.path)) + .sort(field(documentIdFieldPath()).ascending()) + ); + expectResults( + snapshot, + 'book1', + 'book1', + 'book10', + 'book10', + 'book2', + 'book2', + 'book3', + 'book3', + 'book4', + 'book4', + 'book5', + 'book5', + 'book6', + 'book6', + 'book7', + 'book7', + 'book8', + 'book8', + 'book9', + 'book9' + ); + }); + }); + + describe('unnest stage', () => { + it('run pipeline with unnest', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(field('tags').as('tag')) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'tag', + 'awards', + 'nestedField' + ) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'comedy', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'space', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'adventure', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + } + ); + }); + it('unnest an expr', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(array([1, 2, 3]).as('copy')) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'copy', + 'awards', + 'nestedField' + ) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 1, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 2, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 3, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + } + ); + }); + }); + + describe('findNearest stage', () => { + it('run pipeline with findNearest', async () => { + const measures: Array = [ + 'euclidean', + 'dot_product', + 'cosine' + ]; + for (const measure of measures) { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .findNearest({ + field: 'embedding', + vectorValue: vector([10, 1, 3, 1, 2, 1, 1, 1, 1, 1]), + limit: 3, + distanceMeasure: measure + }) + .select('title') + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'One Hundred Years of Solitude' + }, + { + title: "The Handmaid's Tale" + } + ); + } + }); + + it('optionally returns the computed distance', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .findNearest({ + field: 'embedding', + vectorValue: vector([10, 1, 2, 1, 1, 1, 1, 1, 1, 1]), + limit: 2, + distanceMeasure: 'euclidean', + distanceField: 'computedDistance' + }) + .select('title', 'computedDistance') + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + computedDistance: 1 + }, + { + title: 'One Hundred Years of Solitude', + computedDistance: 12.041594578792296 + } + ); + }); + }); + }); + + describe('function expressions', () => { + it('logical max works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + logicalMaximum(constant(1960), field('published'), 1961).as( + 'published-safe' + ) + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1961 }, + { title: 'Crime and Punishment', 'published-safe': 1961 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); + + it('logical min works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + logicalMinimum(constant(1960), field('published'), 1961).as( + 'published-safe' + ) + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1949 }, + { title: 'Crime and Punishment', 'published-safe': 1866 }, + { title: 'Dune', 'published-safe': 1960 } + ); + }); + + it('cond works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + 'title', + cond( + lt(field('published'), 1960), + constant(1960), + field('published') + ).as('published-safe') + ) + .sort(field('title').ascending()) + .limit(3) + ); + expectResults( + snapshot, + { title: '1984', 'published-safe': 1960 }, + { title: 'Crime and Punishment', 'published-safe': 1960 }, + { title: 'Dune', 'published-safe': 1965 } + ); + }); + + it('eqAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eqAny('published', [1979, 1999, 1967])) + .select('title') + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'One Hundred Years of Solitude' } + ); + }); + + it('notEqAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + notEqAny( + 'published', + [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] + ) + ) + .select('title') + ); + expectResults(snapshot, { title: 'Pride and Prejudice' }); + }); + + it('arrayContains works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(arrayContains('tags', 'comedy')) + .select('title') + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('arrayContainsAny works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .select('title') + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'Pride and Prejudice' } + ); + }); + + it('arrayContainsAll works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('tags').arrayContainsAll(['adventure', 'magic'])) + .select('title') + ); + expectResults(snapshot, { title: 'The Lord of the Rings' }); + }); + + it('arrayLength works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(field('tags').arrayLength().as('tagsCount')) + .where(eq('tagsCount', 3)) + ); + expect(snapshot.results.length).to.equal(10); + }); + + it('testStrConcat', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + field('author').strConcat(' - ', field('title')).as('bookInfo') + ) + .limit(1) + ); + expectResults(snapshot, { + bookInfo: "Douglas Adams - The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testStartsWith', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(startsWith('title', 'The')) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: 'The Great Gatsby' }, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Lord of the Rings' } + ); + }); + + it('testEndsWith', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(endsWith('title', 'y')) + .select('title') + .sort(field('title').descending()) + ); + expectResults( + snapshot, + { title: "The Hitchhiker's Guide to the Galaxy" }, + { title: 'The Great Gatsby' } + ); + }); + + it('testStrContains', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(strContains('title', "'s")) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: "The Handmaid's Tale" }, + { title: "The Hitchhiker's Guide to the Galaxy" } + ); + }); + + it('testLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(field('title').charLength().as('titleLength'), field('title')) + .where(gt('titleLength', 20)) + .sort(field('title').ascending()) + ); + + expectResults( + snapshot, + + { + titleLength: 29, + title: 'One Hundred Years of Solitude' + }, + { + titleLength: 36, + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + titleLength: 21, + title: 'The Lord of the Rings' + }, + { + titleLength: 21, + title: 'To Kill a Mockingbird' + } + ); + }); + + it('testLike', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(like('title', '%Guide%')) + .select('title') + ); + expectResults(snapshot, { + title: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('testRegexContains', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(regexContains('title', '(?i)(the|of)')) + ); + expect(snapshot.results.length).to.equal(5); + }); + + it('testRegexMatches', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(regexMatch('title', '.*(?i)(the|of).*')) + ); + expect(snapshot.results.length).to.equal(5); + }); + + it('testArithmeticOperations', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + add(field('rating'), 1).as('ratingPlusOne'), + subtract(field('published'), 1900).as('yearsSince1900'), + field('rating').multiply(10).as('ratingTimesTen'), + field('rating').divide(2).as('ratingDividedByTwo'), + multiply('rating', 10, 2).as('ratingTimes20'), + add('rating', 1, 2).as('ratingPlus3'), + mod('rating', 2).as('ratingMod2') + ) + .limit(1) + ); + expectResults(snapshot, { + ratingPlusOne: 5.2, + yearsSince1900: 79, + ratingTimesTen: 42, + ratingDividedByTwo: 2.1, + ratingTimes20: 84, + ratingPlus3: 7.2, + ratingMod2: 0.2 + }); + }); + + it('testComparisonOperators', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + gt('rating', 4.2), + lte(field('rating'), 4.5), + neq('genre', 'Science Fiction') + ) + ) + .select('rating', 'title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { rating: 4.3, title: 'Crime and Punishment' }, + { + rating: 4.3, + title: 'One Hundred Years of Solitude' + }, + { rating: 4.5, title: 'Pride and Prejudice' } + ); + }); + + it('testLogicalOperators', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + or( + and(gt('rating', 4.5), eq('genre', 'Science Fiction')), + lt('published', 1900) + ) + ) + .select('title') + .sort(field('title').ascending()) + ); + expectResults( + snapshot, + { title: 'Crime and Punishment' }, + { title: 'Dune' }, + { title: 'Pride and Prejudice' } + ); + }); + + it('testChecks', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + isNull('rating').as('ratingIsNull'), + isNan('rating').as('ratingIsNaN'), + isError(arrayOffset('title', 0)).as('isError'), + ifError(arrayOffset('title', 0), constant('was error')).as( + 'ifError' + ), + isAbsent('foo').as('isAbsent'), + isNotNull('title').as('titleIsNotNull'), + isNotNan('cost').as('costIsNotNan'), + exists('fooBarBaz').as('fooBarBazExists'), + field('title').as('titleExists') + ) + ); + expectResults(snapshot, { + ratingIsNull: false, + ratingIsNaN: false, + isError: true, + ifError: 'was error', + isAbsent: true, + titleIsNotNull: true, + costIsNotNan: false, + fooBarBazExists: false, + titleExists: true + }); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + field('rating').isNull().as('ratingIsNull'), + field('rating').isNan().as('ratingIsNaN'), + arrayOffset('title', 0).isError().as('isError'), + arrayOffset('title', 0) + .ifError(constant('was error')) + .as('ifError'), + field('foo').isAbsent().as('isAbsent'), + field('title').isNotNull().as('titleIsNotNull'), + field('cost').isNotNan().as('costIsNotNan') + ) + ); + expectResults(snapshot, { + ratingIsNull: false, + ratingIsNaN: false, + isError: true, + ifError: 'was error', + isAbsent: true, + titleIsNotNull: true, + costIsNotNan: false + }); + }); + + it('testMapGet', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('published').descending()) + .select( + field('awards').mapGet('hugo').as('hugoAward'), + field('awards').mapGet('others').as('others'), + field('title') + ) + .where(eq('hugoAward', true)) + ); + expectResults( + snapshot, + { + hugoAward: true, + title: "The Hitchhiker's Guide to the Galaxy", + others: { unknown: { year: 1980 } } + }, + { hugoAward: true, title: 'Dune', others: null } + ); + }); + + it('testDistanceFunctions', async () => { + const sourceVector = [0.1, 0.1]; + const targetVector = [0.5, 0.8]; + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + cosineDistance(constantVector(sourceVector), targetVector).as( + 'cosineDistance' + ), + dotProduct(constantVector(sourceVector), targetVector).as( + 'dotProductDistance' + ), + euclideanDistance(constantVector(sourceVector), targetVector).as( + 'euclideanDistance' + ) + ) + .limit(1) + ); + + expectResults(snapshot, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + constantVector(sourceVector) + .cosineDistance(targetVector) + .as('cosineDistance'), + constantVector(sourceVector) + .dotProduct(targetVector) + .as('dotProductDistance'), + constantVector(sourceVector) + .euclideanDistance(targetVector) + .as('euclideanDistance') + ) + .limit(1) + ); + + expectResults(snapshot, { + cosineDistance: 0.02560880430538015, + dotProductDistance: 0.13, + euclideanDistance: 0.806225774829855 + }); + }); + + it('testVectorLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(vectorLength(constantVector([1, 2, 3])).as('vectorLength')) + ); + expectResults(snapshot, { + vectorLength: 3 + }); + }); + + it('testNestedFields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('awards.hugo', true)) + .select('title', 'awards.hugo') + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'awards.hugo': true + }, + { title: 'Dune', 'awards.hugo': true } + ); + }); + + it('test mapGet with field name including . notation', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('awards.hugo', true)) + .select( + 'title', + field('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + 'nestedField.level.`1`': null, + nested: true + }, + { title: 'Dune', 'nestedField.level.`1`': null, nested: null } + ); + }); + + describe('genericFunction', () => { + it('add selectable', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(descending('rating')) + .limit(1) + .select( + new FunctionExpr('add', [field('rating'), constant(1)]).as( + 'rating' + ) + ) + ); + expectResults(snapshot, { + rating: 5.7 + }); + }); + + it('and (variadic) selectable', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + new BooleanExpr('and', [ + field('rating').gt(0), + field('title').charLength().lt(5), + field('tags').arrayContains('propaganda') + ]) + ) + .select('title') + ); + expectResults(snapshot, { + title: '1984' + }); + }); + + it('array contains any', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + new BooleanExpr('array_contains_any', [ + field('tags'), + array(['politics']) + ]) + ) + .select('title') + ); + expectResults(snapshot, { + title: 'Dune' + }); + }); + + it('countif aggregate', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate( + new AggregateFunction('count_if', [field('rating').gte(4.5)]).as( + 'countOfBest' + ) + ) + ); + expectResults(snapshot, { + countOfBest: 3 + }); + }); + + it('sort by char_len', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort( + new FunctionExpr('char_length', [field('title')]).ascending(), + descending('__name__') + ) + .limit(3) + .select('title') + ); + expectResults( + snapshot, + { + title: '1984' + }, + { + title: 'Dune' + }, + { + title: 'The Great Gatsby' + } + ); + }); + }); + + describe('not implemented in backend', () => { + it('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitAnd(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 4 + }); + }); + + it('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitAnd(12).as('result')) + ); + expectResults(snapshot, { + result: 4 + }); + }); + + it('supports Bit_or', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitOr(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitOr(12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + }); + + it('supports Bit_xor', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitXor(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitXor(12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + }); + + it('supports Bit_not', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( + 'result' + ) + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) + .bitNot() + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + }); + + it('supports Bit_left_shift', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitLeftShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitLeftShift(2) + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + }); + + it('supports Bit_right_shift', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitRightShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitRightShift(2) + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + }); + + it('supports Document_id', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(documentId(field('__path__')).as('docId')) + ); + expectResults(snapshot, { + docId: 'book4' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('__path__').documentId().as('docId')) + ); + expectResults(snapshot, { + docId: 'book4' + }); + }); + + it('supports Substr', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9, 2).as('of')) + ); + expectResults(snapshot, { + of: 'of' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9, 2).as('of')) + ); + expectResults(snapshot, { + of: 'of' + }); + }); + + it('supports Substr without length', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + }); + + it('arrayConcat works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + arrayConcat('tags', ['newTag1', 'newTag2'], field('tags'), [ + null + ]).as('modifiedTags') + ) + .limit(1) + ); + expectResults(snapshot, { + modifiedTags: [ + 'comedy', + 'space', + 'adventure', + 'newTag1', + 'newTag2', + 'comedy', + 'space', + 'adventure', + null + ] + }); + }); + + it('testToLowercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(field('title').toLower().as('lowercaseTitle')) + .limit(1) + ); + expectResults(snapshot, { + lowercaseTitle: "the hitchhiker's guide to the galaxy" + }); + }); + + it('testToUppercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(field('author').toUpper().as('uppercaseAuthor')) + .limit(1) + ); + expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + }); + + it('testTrim', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .addFields( + constant(" The Hitchhiker's Guide to the Galaxy ").as( + 'spacedTitle' + ) + ) + .select( + field('spacedTitle').trim().as('trimmedTitle'), + field('spacedTitle') + ) + .limit(1) + ); + expectResults(snapshot, { + spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('test reverse', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', '1984')) + .limit(1) + .select(reverse('title').as('reverseTitle')) + ); + expectResults(snapshot, { title: '4891' }); + }); + }); + + it('supports Rand', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(10) + .select(rand().as('result')) + ); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(d => { + expect(d.get('result')).to.be.lt(1); + expect(d.get('result')).to.be.gte(0); + }); + }); + + it('supports array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(array([1, 2, 3, 4]).as('metadata')) + ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 3, 4] + }); + }); + + it('evaluates expression in array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + array([1, 2, field('genre'), multiply('rating', 10)]).as('metadata') + ) + ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 'Fantasy', 47] + }); + }); + + it('supports arrayOffset', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(arrayOffset('tags', 0).as('firstTag')) + ); + const expectedResults = [ + { + firstTag: 'adventure' + }, + { + firstTag: 'politics' + }, + { + firstTag: 'classic' + } + ]; + expectResults(snapshot, ...expectedResults); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(field('tags').arrayOffset(0).as('firstTag')) + ); + expectResults(snapshot, ...expectedResults); + }); + + // TODO: current_context tests with are failing because of b/395937453 + it('supports currentContext', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(currentContext().as('currentContext')) + ); + expectResults(snapshot, { + currentContext: 'TODO' + }); + }); + + it('supports map', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + map({ + foo: 'bar' + }).as('metadata') + ) + ); + + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: { + foo: 'bar' + } + }); + }); + + it('evaluates expression in map', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + map({ + genre: field('genre'), + rating: field('rating').multiply(10) + }).as('metadata') + ) + ); + + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: { + genre: 'Fantasy', + rating: 47 + } + }); + }); + + it('supports mapRemove', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(mapRemove('awards', 'hugo').as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false } + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('awards').mapRemove('hugo').as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false } + }); + }); + + it('supports mapMerge', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(mapMerge('awards', { fakeAward: true }).as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false, hugo: false, fakeAward: true } + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('awards').mapMerge({ fakeAward: true }).as('awards')) + ); + expectResults(snapshot, { + awards: { nebula: false, hugo: false, fakeAward: true } + }); + }); + + it('supports timestamp conversions', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + unixSecondsToTimestamp(constant(1741380235)).as( + 'unixSecondsToTimestamp' + ), + unixMillisToTimestamp(constant(1741380235123)).as( + 'unixMillisToTimestamp' + ), + unixMicrosToTimestamp(constant(1741380235123456)).as( + 'unixMicrosToTimestamp' + ), + timestampToUnixSeconds( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixSeconds'), + timestampToUnixMicros( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixMicros'), + timestampToUnixMillis( + constant(new Timestamp(1741380235, 123456789)) + ).as('timestampToUnixMillis') + ) + ); + expectResults(snapshot, { + unixMicrosToTimestamp: new Timestamp(1741380235, 123456000), + unixMillisToTimestamp: new Timestamp(1741380235, 123000000), + unixSecondsToTimestamp: new Timestamp(1741380235, 0), + timestampToUnixSeconds: 1741380235, + timestampToUnixMicros: 1741380235123456, + timestampToUnixMillis: 1741380235123 + }); + }); + + it('supports timestamp math', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(new Timestamp(1741380235, 0)).as('timestamp')) + .select( + timestampAdd('timestamp', 'day', 10).as('plus10days'), + timestampAdd('timestamp', 'hour', 10).as('plus10hours'), + timestampAdd('timestamp', 'minute', 10).as('plus10minutes'), + timestampAdd('timestamp', 'second', 10).as('plus10seconds'), + timestampAdd('timestamp', 'microsecond', 10).as('plus10micros'), + timestampAdd('timestamp', 'millisecond', 10).as('plus10millis'), + timestampSub('timestamp', 'day', 10).as('minus10days'), + timestampSub('timestamp', 'hour', 10).as('minus10hours'), + timestampSub('timestamp', 'minute', 10).as('minus10minutes'), + timestampSub('timestamp', 'second', 10).as('minus10seconds'), + timestampSub('timestamp', 'microsecond', 10).as('minus10micros'), + timestampSub('timestamp', 'millisecond', 10).as('minus10millis') + ) + ); + expectResults(snapshot, { + plus10days: new Timestamp(1742244235, 0), + plus10hours: new Timestamp(1741416235, 0), + plus10minutes: new Timestamp(1741380835, 0), + plus10seconds: new Timestamp(1741380245, 0), + plus10micros: new Timestamp(1741380235, 10000), + plus10millis: new Timestamp(1741380235, 10000000), + minus10days: new Timestamp(1740516235, 0), + minus10hours: new Timestamp(1741344235, 0), + minus10minutes: new Timestamp(1741379635, 0), + minus10seconds: new Timestamp(1741380225, 0), + minus10micros: new Timestamp(1741380234, 999990000), + minus10millis: new Timestamp(1741380234, 990000000) + }); + }); + }); + + describe('pagination', () => { + /** + * Adds several books to the test collection. These + * additional books support pagination test scenarios + * that would otherwise not be possible with the original + * set of books. + * @param collectionReference + */ + async function addBooks( + collectionReference: CollectionReference + ): Promise { + await setDoc(doc(collectionReference, 'book11'), { + title: 'Jonathan Strange & Mr Norrell', + author: 'Susanna Clarke', + genre: 'Fantasy', + published: 2004, + rating: 4.6, + tags: ['historical fantasy', 'magic', 'alternate history', 'england'], + awards: { hugo: false, nebula: false } + }); + await setDoc(doc(collectionReference, 'book12'), { + title: 'The Master and Margarita', + author: 'Mikhail Bulgakov', + genre: 'Satire', + published: 1967, // Though written much earlier + rating: 4.6, + tags: [ + 'russian literature', + 'supernatural', + 'philosophy', + 'dark comedy' + ], + awards: {} + }); + await setDoc(doc(collectionReference, 'book13'), { + title: 'A Long Way to a Small, Angry Planet', + author: 'Becky Chambers', + genre: 'Science Fiction', + published: 2014, + rating: 4.6, + tags: ['space opera', 'found family', 'character-driven', 'optimistic'], + awards: { hugo: false, nebula: false, kitschies: true } + }); + } + + it('supports pagination with filters', async () => { + await addBooks(randomCol); + const pageSize = 2; + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', '__name__') + .sort(field('rating').descending(), field('__name__').ascending()); + + let snapshot = await execute(pipeline.limit(pageSize)); + expectResults( + snapshot, + { title: 'The Lord of the Rings', rating: 4.7 }, + { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } + ); + + const lastDoc = snapshot.results[snapshot.results.length - 1]; + + snapshot = await execute( + pipeline + .where( + or( + and( + field('rating').eq(lastDoc.get('rating')), + field('__path__').gt(lastDoc.ref?.id) + ), + field('rating').lt(lastDoc.get('rating')) + ) + ) + .limit(pageSize) + ); + expectResults( + snapshot, + { title: 'Pride and Prejudice', rating: 4.5 }, + { title: 'Crime and Punishment', rating: 4.3 } + ); + }); + + it('supports pagination with offsets', async () => { + await addBooks(randomCol); + + const secondFilterField = '__name__'; + + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', secondFilterField) + .sort( + field('rating').descending(), + field(secondFilterField).ascending() + ); + + const pageSize = 2; + let currPage = 0; + + let snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + + expectResults( + snapshot, + { + title: 'The Lord of the Rings', + rating: 4.7 + }, + { title: 'Dune', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'Jonathan Strange & Mr Norrell', + rating: 4.6 + }, + { title: 'The Master and Margarita', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'A Long Way to a Small, Angry Planet', + rating: 4.6 + }, + { + title: 'Pride and Prejudice', + rating: 4.5 + } + ); + }); + }); +}); From edb40010bb480806b26f48601b65f4257ffed2df Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Fri, 21 Mar 2025 15:04:23 -0700 Subject: [PATCH 143/295] Implement Partial Errors for FDC (#8821) --- .changeset/sharp-nails-glow.md | 5 ++ common/api-review/data-connect.api.md | 33 ++++++++- packages/data-connect/src/api/index.ts | 7 ++ packages/data-connect/src/core/error.ts | 69 ++++++++++++++----- packages/data-connect/src/network/fetch.ts | 17 ++++- .../test/dataconnect/connector/connector.yaml | 6 +- packages/data-connect/test/emulatorSeeder.ts | 68 ------------------ packages/data-connect/test/mutations.gql | 6 -- packages/data-connect/test/unit/fetch.test.ts | 34 +++++++++ .../emulators/dataconnect-emulator.ts | 2 +- .../emulator-testing/emulators/emulator.ts | 4 ++ 11 files changed, 152 insertions(+), 99 deletions(-) create mode 100644 .changeset/sharp-nails-glow.md delete mode 100644 packages/data-connect/test/emulatorSeeder.ts delete mode 100644 packages/data-connect/test/mutations.gql diff --git a/.changeset/sharp-nails-glow.md b/.changeset/sharp-nails-glow.md new file mode 100644 index 00000000000..68c5e68c39d --- /dev/null +++ b/.changeset/sharp-nails-glow.md @@ -0,0 +1,5 @@ +--- +"@firebase/data-connect": patch +--- + +Expose partial errors to the user. diff --git a/common/api-review/data-connect.api.md b/common/api-review/data-connect.api.md index 1a698c229b4..786714361af 100644 --- a/common/api-review/data-connect.api.md +++ b/common/api-review/data-connect.api.md @@ -52,6 +52,35 @@ export class DataConnect { setInitialized(): void; } +// @public +export class DataConnectError extends FirebaseError { + } + +// @public (undocumented) +export type DataConnectErrorCode = 'other' | 'already-initialized' | 'not-initialized' | 'not-supported' | 'invalid-argument' | 'partial-error' | 'unauthorized'; + +// @public +export class DataConnectOperationError extends DataConnectError { + /* Excluded from this release type: name */ + readonly response: DataConnectOperationFailureResponse; +} + +// @public (undocumented) +export interface DataConnectOperationFailureResponse { + // (undocumented) + readonly data?: Record | null; + // (undocumented) + readonly errors: DataConnectOperationFailureResponseErrorInfo[]; +} + +// @public (undocumented) +export interface DataConnectOperationFailureResponseErrorInfo { + // (undocumented) + readonly message: string; + // (undocumented) + readonly path: Array; +} + // @public export interface DataConnectOptions extends ConnectorConfig { // (undocumented) @@ -67,7 +96,7 @@ export interface DataConnectResult extends OpResult { // @public export interface DataConnectSubscription { // (undocumented) - errCallback?: (e?: FirebaseError) => void; + errCallback?: (e?: DataConnectError) => void; // (undocumented) unsubscribe: () => void; // (undocumented) @@ -118,7 +147,7 @@ export interface MutationResult extends DataConnectResult void; // @public -export type OnErrorSubscription = (err?: FirebaseError) => void; +export type OnErrorSubscription = (err?: DataConnectError) => void; // @public export type OnResultSubscription = (res: QueryResult) => void; diff --git a/packages/data-connect/src/api/index.ts b/packages/data-connect/src/api/index.ts index 885dac5a923..dcd48485571 100644 --- a/packages/data-connect/src/api/index.ts +++ b/packages/data-connect/src/api/index.ts @@ -22,3 +22,10 @@ export * from './Mutation'; export * from './query'; export { setLogLevel } from '../logger'; export { validateArgs } from '../util/validateArgs'; +export { + DataConnectErrorCode, + DataConnectError, + DataConnectOperationError, + DataConnectOperationFailureResponse, + DataConnectOperationFailureResponseErrorInfo +} from '../core/error'; diff --git a/packages/data-connect/src/core/error.ts b/packages/data-connect/src/core/error.ts index f0beb128afa..b1246969e48 100644 --- a/packages/data-connect/src/core/error.ts +++ b/packages/data-connect/src/core/error.ts @@ -40,25 +40,62 @@ export const Code = { /** An error returned by a DataConnect operation. */ export class DataConnectError extends FirebaseError { - /** The stack of the error. */ - readonly stack?: string; + /** @internal */ + readonly name: string = 'DataConnectError'; /** @hideconstructor */ - constructor( - /** - * The backend error code associated with this error. - */ - readonly code: DataConnectErrorCode, - /** - * A custom error description. - */ - readonly message: string - ) { + constructor(code: Code, message: string) { super(code, message); - // HACK: We write a toString property directly because Error is not a real - // class and so inheritance does not work correctly. We could alternatively - // do the same "back-door inheritance" trick that FirebaseError does. - this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`; + // Ensure the instanceof operator works as expected on subclasses of Error. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_types + // and https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget + Object.setPrototypeOf(this, DataConnectError.prototype); } + + /** @internal */ + toString(): string { + return `${this.name}[code=${this.code}]: ${this.message}`; + } +} + +/** An error returned by a DataConnect operation. */ +export class DataConnectOperationError extends DataConnectError { + /** @internal */ + readonly name: string = 'DataConnectOperationError'; + + /** The response received from the backend. */ + readonly response: DataConnectOperationFailureResponse; + + /** @hideconstructor */ + constructor(message: string, response: DataConnectOperationFailureResponse) { + super(Code.PARTIAL_ERROR, message); + this.response = response; + } +} + +export interface DataConnectOperationFailureResponse { + // The "data" provided by the backend in the response message. + // + // Will be `undefined` if no "data" was provided in the response message. + // Otherwise, will be `null` if `null` was explicitly specified as the "data" + // in the response message. Otherwise, will be the value of the "data" + // specified as the "data" in the response message + readonly data?: Record | null; + + // The list of errors provided by the backend in the response message. + readonly errors: DataConnectOperationFailureResponseErrorInfo[]; +} + +// Information about the error, as provided in the response from the backend. +// See https://spec.graphql.org/draft/#sec-Errors +export interface DataConnectOperationFailureResponseErrorInfo { + // The error message. + readonly message: string; + + // The path of the field in the response data to which this error relates. + // String values in this array refer to field names. Numeric values in this + // array always satisfy `Number.isInteger()` and refer to the index in an + // array. + readonly path: Array; } diff --git a/packages/data-connect/src/network/fetch.ts b/packages/data-connect/src/network/fetch.ts index 166422ca14c..8353c6b99ab 100644 --- a/packages/data-connect/src/network/fetch.ts +++ b/packages/data-connect/src/network/fetch.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { Code, DataConnectError } from '../core/error'; +import { + Code, + DataConnectError, + DataConnectOperationError, + DataConnectOperationFailureResponse +} from '../core/error'; import { SDK_VERSION } from '../core/version'; import { logDebug, logError } from '../logger'; @@ -108,8 +113,14 @@ export function dcFetch( .then(res => { if (res.errors && res.errors.length) { const stringified = JSON.stringify(res.errors); - logError('DataConnect error while performing request: ' + stringified); - throw new DataConnectError(Code.OTHER, stringified); + const response: DataConnectOperationFailureResponse = { + errors: res.errors, + data: res.data + }; + throw new DataConnectOperationError( + 'DataConnect error while performing request: ' + stringified, + response + ); } return res; }); diff --git a/packages/data-connect/test/dataconnect/connector/connector.yaml b/packages/data-connect/test/dataconnect/connector/connector.yaml index e945b44b00c..e4cde271588 100644 --- a/packages/data-connect/test/dataconnect/connector/connector.yaml +++ b/packages/data-connect/test/dataconnect/connector/connector.yaml @@ -1,6 +1,6 @@ connectorId: "tests" authMode: "PUBLIC" generate: - javascriptSdk: - outputDir: "./gen/web" - package: "@test-app/tests" + javascriptSdk: + outputDir: "./gen/web" + package: "@test-app/tests" diff --git a/packages/data-connect/test/emulatorSeeder.ts b/packages/data-connect/test/emulatorSeeder.ts deleted file mode 100644 index 1517deb90f8..00000000000 --- a/packages/data-connect/test/emulatorSeeder.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @license - * Copyright 2024 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 fs from 'fs'; -import * as path from 'path'; - -import { ReferenceType } from '../src'; - -import { EMULATOR_PORT } from './util'; - -export interface SeedInfo { - type: ReferenceType; - name: string; -} -export async function setupQueries( - schema: string, - seedInfoArray: SeedInfo[] -): Promise { - const schemaPath = path.resolve(__dirname, schema); - const schemaFileContents = fs.readFileSync(schemaPath).toString(); - const toWrite = { - 'service_id': 'l', - 'schema': { - 'files': [ - { - 'path': `schema/${schema}`, - 'content': schemaFileContents - } - ] - }, - 'connectors': { - 'c': { - 'files': seedInfoArray.map(seedInfo => { - const fileName = seedInfo.name + '.gql'; - const operationFilePath = path.resolve(__dirname, fileName); - const operationFileContents = fs - .readFileSync(operationFilePath) - .toString(); - return { - path: `operations/${seedInfo.name}.gql`, - content: operationFileContents - }; - }) - } - }, - // eslint-disable-next-line camelcase - connection_string: - 'postgresql://postgres:secretpassword@localhost:5432/postgres?sslmode=disable' - }; - return fetch(`http://localhost:${EMULATOR_PORT}/setupSchema`, { - method: 'POST', - body: JSON.stringify(toWrite) - }); -} diff --git a/packages/data-connect/test/mutations.gql b/packages/data-connect/test/mutations.gql deleted file mode 100644 index a826a39529a..00000000000 --- a/packages/data-connect/test/mutations.gql +++ /dev/null @@ -1,6 +0,0 @@ -mutation seedDatabase($id: UUID!, $content: String!) @auth(level: PUBLIC) { - post: post_insert(data: {id: $id, content: $content}) -} -mutation removePost($id: UUID!) @auth(level: PUBLIC) { - post: post_delete(id: $id) -} \ No newline at end of file diff --git a/packages/data-connect/test/unit/fetch.test.ts b/packages/data-connect/test/unit/fetch.test.ts index 599260f8b10..6cf2750d50d 100644 --- a/packages/data-connect/test/unit/fetch.test.ts +++ b/packages/data-connect/test/unit/fetch.test.ts @@ -85,6 +85,40 @@ describe('fetch', () => { ) ).to.eventually.be.rejectedWith(JSON.stringify(json)); }); + it('should throw a stringified message when the server responds with an error without a message property in the body', async () => { + const json = { + 'data': { 'abc': 'def' }, + 'errors': [ + { + 'message': + 'SQL query error: pq: duplicate key value violates unique constraint movie_pkey', + 'locations': [], + 'path': ['the_matrix'], + 'extensions': null + } + ] + }; + mockFetch(json, false); + await expect( + dcFetch( + 'http://localhost', + { + name: 'n', + operationName: 'n', + variables: {} + }, + {} as AbortController, + null, + null, + null, + false, + CallerSdkTypeEnum.Base + ) + ).to.eventually.be.rejected.then(error => { + expect(error.response.data).to.eq(json.data); + expect(error.response.errors).to.eq(json.errors); + }); + }); it('should assign different values to custom headers based on the _callerSdkType argument (_isUsingGen is false)', async () => { const json = { code: 200, diff --git a/scripts/emulator-testing/emulators/dataconnect-emulator.ts b/scripts/emulator-testing/emulators/dataconnect-emulator.ts index 5cea83b073b..9dc6add5df1 100644 --- a/scripts/emulator-testing/emulators/dataconnect-emulator.ts +++ b/scripts/emulator-testing/emulators/dataconnect-emulator.ts @@ -18,7 +18,7 @@ import { platform } from 'os'; import { Emulator } from './emulator'; -const DATACONNECT_EMULATOR_VERSION = '1.7.5'; +const DATACONNECT_EMULATOR_VERSION = '1.9.2'; export class DataConnectEmulator extends Emulator { constructor(port = 9399) { diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index 0eeb1ca88bd..01fbe66fa13 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -146,6 +146,7 @@ export abstract class Emulator { if (this.isDataConnect) { const dataConnectConfigDir = this.findDataConnectConfigDir(); promise = spawn(this.binaryPath, [ + '--logtostderr', '--v=2', 'dev', `--listen=127.0.0.1:${this.port},[::1]:${this.port}`, @@ -155,6 +156,9 @@ export abstract class Emulator { promise.childProcess.stderr?.on('data', res => console.log(res.toString()) ); + promise.childProcess.stderr?.on('error', res => + console.log(res.toString()) + ); } else { promise = spawn( 'java', From 648de84b05c827d33d6b22aceb6eff01208ebdf0 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 25 Mar 2025 10:45:29 -0400 Subject: [PATCH 144/295] Add `X-Firebase-AppId` header to VertexAI requests (#8809) --- .changeset/red-hornets-peel.md | 5 ++ common/api-review/vertexai.api.md | 1 + docs-devsite/vertexai.md | 1 + packages/vertexai/src/api.test.ts | 43 ++++++++++++++-- .../vertexai/src/methods/chat-session.test.ts | 1 + .../vertexai/src/methods/count-tokens.test.ts | 1 + .../src/methods/generate-content.test.ts | 1 + .../src/models/generative-model.test.ts | 3 +- .../vertexai/src/models/imagen-model.test.ts | 3 +- .../src/models/vertexai-model.test.ts | 21 +++++++- .../vertexai/src/models/vertexai-model.ts | 8 +++ .../vertexai/src/requests/request.test.ts | 49 +++++++++++++++++++ packages/vertexai/src/requests/request.ts | 3 ++ packages/vertexai/src/types/error.ts | 3 ++ packages/vertexai/src/types/internal.ts | 2 + 15 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 .changeset/red-hornets-peel.md diff --git a/.changeset/red-hornets-peel.md b/.changeset/red-hornets-peel.md new file mode 100644 index 00000000000..1c6eb50df13 --- /dev/null +++ b/.changeset/red-hornets-peel.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Throw an error when initializing models if `appId` is not defined in the given `VertexAI` instance. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index f5aca03c1bd..e7f00c2f4e0 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -802,6 +802,7 @@ export const enum VertexAIErrorCode { INVALID_CONTENT = "invalid-content", INVALID_SCHEMA = "invalid-schema", NO_API_KEY = "no-api-key", + NO_APP_ID = "no-app-id", NO_MODEL = "no-model", NO_PROJECT_ID = "no-project-id", PARSE_FAILED = "parse-failed", diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index eb805c7710f..fca51b42f4f 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -551,6 +551,7 @@ export declare const enum VertexAIErrorCode | INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | | INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | | NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | | NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | | NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | | PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | diff --git a/packages/vertexai/src/api.test.ts b/packages/vertexai/src/api.test.ts index c1b2635ce70..4a0b978d858 100644 --- a/packages/vertexai/src/api.test.ts +++ b/packages/vertexai/src/api.test.ts @@ -27,7 +27,8 @@ const fakeVertexAI: VertexAI = { automaticDataCollectionEnabled: true, options: { apiKey: 'key', - projectId: 'my-project' + projectId: 'my-project', + appId: 'my-appid' } }, location: 'us-central1' @@ -48,7 +49,7 @@ describe('Top level API', () => { it('getGenerativeModel throws if no apiKey is provided', () => { const fakeVertexNoApiKey = { ...fakeVertexAI, - app: { options: { projectId: 'my-project' } } + app: { options: { projectId: 'my-project', appId: 'my-appid' } } } as VertexAI; try { getGenerativeModel(fakeVertexNoApiKey, { model: 'my-model' }); @@ -64,7 +65,7 @@ describe('Top level API', () => { it('getGenerativeModel throws if no projectId is provided', () => { const fakeVertexNoProject = { ...fakeVertexAI, - app: { options: { apiKey: 'my-key' } } + app: { options: { apiKey: 'my-key', appId: 'my-appid' } } } as VertexAI; try { getGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); @@ -79,6 +80,22 @@ describe('Top level API', () => { ); } }); + it('getGenerativeModel throws if no appId is provided', () => { + const fakeVertexNoProject = { + ...fakeVertexAI, + app: { options: { apiKey: 'my-key', projectId: 'my-projectid' } } + } as VertexAI; + try { + getGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); + } catch (e) { + expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_APP_ID); + expect((e as VertexAIError).message).equals( + `VertexAI: The "appId" field is empty in the local` + + ` Firebase config. Firebase VertexAI requires this field ` + + `to contain a valid app ID. (vertexAI/${VertexAIErrorCode.NO_APP_ID})` + ); + } + }); it('getGenerativeModel gets a GenerativeModel', () => { const genModel = getGenerativeModel(fakeVertexAI, { model: 'my-model' }); expect(genModel).to.be.an.instanceOf(GenerativeModel); @@ -98,7 +115,7 @@ describe('Top level API', () => { it('getImagenModel throws if no apiKey is provided', () => { const fakeVertexNoApiKey = { ...fakeVertexAI, - app: { options: { projectId: 'my-project' } } + app: { options: { projectId: 'my-project', appId: 'my-appid' } } } as VertexAI; try { getImagenModel(fakeVertexNoApiKey, { model: 'my-model' }); @@ -114,7 +131,7 @@ describe('Top level API', () => { it('getImagenModel throws if no projectId is provided', () => { const fakeVertexNoProject = { ...fakeVertexAI, - app: { options: { apiKey: 'my-key' } } + app: { options: { apiKey: 'my-key', appId: 'my-appid' } } } as VertexAI; try { getImagenModel(fakeVertexNoProject, { model: 'my-model' }); @@ -129,6 +146,22 @@ describe('Top level API', () => { ); } }); + it('getImagenModel throws if no appId is provided', () => { + const fakeVertexNoProject = { + ...fakeVertexAI, + app: { options: { apiKey: 'my-key', projectId: 'my-project' } } + } as VertexAI; + try { + getImagenModel(fakeVertexNoProject, { model: 'my-model' }); + } catch (e) { + expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_APP_ID); + expect((e as VertexAIError).message).equals( + `VertexAI: The "appId" field is empty in the local` + + ` Firebase config. Firebase VertexAI requires this field ` + + `to contain a valid app ID. (vertexAI/${VertexAIErrorCode.NO_APP_ID})` + ); + } + }); it('getImagenModel gets an ImagenModel', () => { const genModel = getImagenModel(fakeVertexAI, { model: 'my-model' }); expect(genModel).to.be.an.instanceOf(ImagenModel); diff --git a/packages/vertexai/src/methods/chat-session.test.ts b/packages/vertexai/src/methods/chat-session.test.ts index 7741c33ea0b..bd389a3d778 100644 --- a/packages/vertexai/src/methods/chat-session.test.ts +++ b/packages/vertexai/src/methods/chat-session.test.ts @@ -30,6 +30,7 @@ use(chaiAsPromised); const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', + appId: 'my-appid', location: 'us-central1' }; diff --git a/packages/vertexai/src/methods/count-tokens.test.ts b/packages/vertexai/src/methods/count-tokens.test.ts index 2032e884fb4..a3d7c99b4ba 100644 --- a/packages/vertexai/src/methods/count-tokens.test.ts +++ b/packages/vertexai/src/methods/count-tokens.test.ts @@ -32,6 +32,7 @@ use(chaiAsPromised); const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', + appId: 'my-appid', location: 'us-central1' }; diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/vertexai/src/methods/generate-content.test.ts index 001fe12c9c8..426bd5176db 100644 --- a/packages/vertexai/src/methods/generate-content.test.ts +++ b/packages/vertexai/src/methods/generate-content.test.ts @@ -37,6 +37,7 @@ use(chaiAsPromised); const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', + appId: 'my-appid', location: 'us-central1' }; diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index c2dbdfac75c..26dff4e04c6 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -30,7 +30,8 @@ const fakeVertexAI: VertexAI = { automaticDataCollectionEnabled: true, options: { apiKey: 'key', - projectId: 'my-project' + projectId: 'my-project', + appId: 'my-appid' } }, location: 'us-central1' diff --git a/packages/vertexai/src/models/imagen-model.test.ts b/packages/vertexai/src/models/imagen-model.test.ts index 000b2f07f90..c566a88e5b0 100644 --- a/packages/vertexai/src/models/imagen-model.test.ts +++ b/packages/vertexai/src/models/imagen-model.test.ts @@ -37,7 +37,8 @@ const fakeVertexAI: VertexAI = { automaticDataCollectionEnabled: true, options: { apiKey: 'key', - projectId: 'my-project' + projectId: 'my-project', + appId: 'my-appid' } }, location: 'us-central1' diff --git a/packages/vertexai/src/models/vertexai-model.test.ts b/packages/vertexai/src/models/vertexai-model.test.ts index 2aa36d56f0d..7aa7f806e7f 100644 --- a/packages/vertexai/src/models/vertexai-model.test.ts +++ b/packages/vertexai/src/models/vertexai-model.test.ts @@ -38,7 +38,8 @@ const fakeVertexAI: VertexAI = { automaticDataCollectionEnabled: true, options: { apiKey: 'key', - projectId: 'my-project' + projectId: 'my-project', + appId: 'my-appid' } }, location: 'us-central1' @@ -100,4 +101,22 @@ describe('VertexAIModel', () => { ); } }); + it('throws if not passed an app ID', () => { + const fakeVertexAI: VertexAI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key', + projectId: 'my-project' + } + }, + location: 'us-central1' + }; + try { + new TestModel(fakeVertexAI, 'my-model'); + } catch (e) { + expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.NO_APP_ID); + } + }); }); diff --git a/packages/vertexai/src/models/vertexai-model.ts b/packages/vertexai/src/models/vertexai-model.ts index 4e211c0cf94..cac14845961 100644 --- a/packages/vertexai/src/models/vertexai-model.ts +++ b/packages/vertexai/src/models/vertexai-model.ts @@ -68,10 +68,18 @@ export abstract class VertexAIModel { VertexAIErrorCode.NO_PROJECT_ID, `The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` ); + } else if (!vertexAI.app?.options?.appId) { + throw new VertexAIError( + VertexAIErrorCode.NO_APP_ID, + `The "appId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid app ID.` + ); } else { this._apiSettings = { apiKey: vertexAI.app.options.apiKey, project: vertexAI.app.options.projectId, + appId: vertexAI.app.options.appId, + automaticDataCollectionEnabled: + vertexAI.app.automaticDataCollectionEnabled, location: vertexAI.location }; diff --git a/packages/vertexai/src/requests/request.test.ts b/packages/vertexai/src/requests/request.test.ts index b6d0ecb9b71..499f06c848b 100644 --- a/packages/vertexai/src/requests/request.test.ts +++ b/packages/vertexai/src/requests/request.test.ts @@ -32,6 +32,7 @@ use(chaiAsPromised); const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', + appId: 'my-appid', location: 'us-central1' }; @@ -103,6 +104,7 @@ describe('request methods', () => { const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'myproject', + appId: 'my-appid', location: 'moon', getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) @@ -124,6 +126,50 @@ describe('request methods', () => { const headers = await getHeaders(fakeUrl); expect(headers.get('x-goog-api-key')).to.equal('key'); }); + it('adds app id if automatedDataCollectionEnabled is true', async () => { + const fakeApiSettings: ApiSettings = { + apiKey: 'key', + project: 'myproject', + appId: 'my-appid', + location: 'moon', + automaticDataCollectionEnabled: true, + getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), + getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) + }; + const fakeUrl = new RequestUrl( + 'models/model-name', + Task.GENERATE_CONTENT, + fakeApiSettings, + true, + {} + ); + const headers = await getHeaders(fakeUrl); + expect(headers.get('X-Firebase-Appid')).to.equal('my-appid'); + }); + it('does not add app id if automatedDataCollectionEnabled is undefined', async () => { + const headers = await getHeaders(fakeUrl); + expect(headers.get('X-Firebase-Appid')).to.be.null; + }); + it('does not add app id if automatedDataCollectionEnabled is false', async () => { + const fakeApiSettings: ApiSettings = { + apiKey: 'key', + project: 'myproject', + appId: 'my-appid', + location: 'moon', + automaticDataCollectionEnabled: false, + getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), + getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) + }; + const fakeUrl = new RequestUrl( + 'models/model-name', + Task.GENERATE_CONTENT, + fakeApiSettings, + true, + {} + ); + const headers = await getHeaders(fakeUrl); + expect(headers.get('X-Firebase-Appid')).to.be.null; + }); it('adds app check token if it exists', async () => { const headers = await getHeaders(fakeUrl); expect(headers.get('X-Firebase-AppCheck')).to.equal('appchecktoken'); @@ -135,6 +181,7 @@ describe('request methods', () => { { apiKey: 'key', project: 'myproject', + appId: 'my-appid', location: 'moon' }, true, @@ -167,6 +214,7 @@ describe('request methods', () => { { apiKey: 'key', project: 'myproject', + appId: 'my-appid', location: 'moon', getAppCheckToken: () => Promise.resolve({ token: 'dummytoken', error: Error('oops') }) @@ -193,6 +241,7 @@ describe('request methods', () => { { apiKey: 'key', project: 'myproject', + appId: 'my-appid', location: 'moon' }, true, diff --git a/packages/vertexai/src/requests/request.ts b/packages/vertexai/src/requests/request.ts index 9b9465db776..47e4c6ab446 100644 --- a/packages/vertexai/src/requests/request.ts +++ b/packages/vertexai/src/requests/request.ts @@ -84,6 +84,9 @@ export async function getHeaders(url: RequestUrl): Promise { headers.append('Content-Type', 'application/json'); headers.append('x-goog-api-client', getClientHeaders()); headers.append('x-goog-api-key', url.apiSettings.apiKey); + if (url.apiSettings.automaticDataCollectionEnabled) { + headers.append('X-Firebase-Appid', url.apiSettings.appId); + } if (url.apiSettings.getAppCheckToken) { const appCheckToken = await url.apiSettings.getAppCheckToken(); if (appCheckToken) { diff --git a/packages/vertexai/src/types/error.ts b/packages/vertexai/src/types/error.ts index 8d83a52a0aa..c249320a39e 100644 --- a/packages/vertexai/src/types/error.ts +++ b/packages/vertexai/src/types/error.ts @@ -87,6 +87,9 @@ export const enum VertexAIErrorCode { /** An error occurred due to a missing Firebase API key. */ NO_API_KEY = 'no-api-key', + /** An error occured due to a missing Firebase app ID. */ + NO_APP_ID = 'no-app-id', + /** An error occurred due to a model name not being specified during initialization. */ NO_MODEL = 'no-model', diff --git a/packages/vertexai/src/types/internal.ts b/packages/vertexai/src/types/internal.ts index 87c28a02ab2..a3476afd028 100644 --- a/packages/vertexai/src/types/internal.ts +++ b/packages/vertexai/src/types/internal.ts @@ -23,7 +23,9 @@ export * from './imagen/internal'; export interface ApiSettings { apiKey: string; project: string; + appId: string; location: string; + automaticDataCollectionEnabled?: boolean; getAuthToken?: () => Promise; getAppCheckToken?: () => Promise; } From ab8eb26ce077014219543645b7f3ba47e8995260 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:56:28 -0700 Subject: [PATCH 145/295] Update dependency webpack to v5.94.0 [SECURITY] (#8734) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- e2e/package.json | 2 +- e2e/yarn.lock | 352 +++++++++++++++++++++++------------------------ 2 files changed, 171 insertions(+), 183 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 1def58d80b3..07d6a6d3b00 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -30,7 +30,7 @@ "jest-environment-jsdom": "29.7.0", "ts-node": "10.9.2", "typescript": "5.5.4", - "webpack": "5.76.0", + "webpack": "5.94.0", "webpack-cli": "5.1.4", "webpack-dev-server": "5.2.0" }, diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 2cd76586ebe..08a958955b7 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -1753,7 +1753,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -1946,32 +1946,11 @@ dependencies: "@types/node" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.7" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" - integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "9.6.1" - resolved "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" - integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*": +"@types/estree@^1.0.5": version "1.0.6" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== -"@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== - "@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0": version "5.0.1" resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz#3c9997ae9d00bc236e45c6374e84f2596458d9db" @@ -2072,7 +2051,7 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -2171,125 +2150,125 @@ dependencies: "@types/yargs-parser" "*" -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.12.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" "@webpack-cli/configtest@^2.1.1": @@ -2338,10 +2317,10 @@ acorn-globals@^7.0.0: acorn "^8.1.0" acorn-walk "^8.0.2" -acorn-import-assertions@^1.7.6: - version "1.9.0" - resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" - integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== acorn-walk@^8.0.2, acorn-walk@^8.1.1: version "8.3.4" @@ -2623,17 +2602,7 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.14.5, browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== - dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" - update-browserslist-db "^1.1.1" - -browserslist@^4.24.4: +browserslist@^4.21.10, browserslist@^4.24.4: version "4.24.4" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== @@ -2643,6 +2612,16 @@ browserslist@^4.24.4: node-releases "^2.0.19" update-browserslist-db "^1.1.1" +browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + dependencies: + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" + bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -3090,10 +3069,10 @@ encodeurl@~2.0.0: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== -enhanced-resolve@^5.10.0: - version "5.17.1" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" - integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== +enhanced-resolve@^5.17.1: + version "5.18.1" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -3127,10 +3106,10 @@ es-errors@^1.3.0: resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.6.0" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" @@ -3492,7 +3471,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -4971,7 +4950,7 @@ schema-utils@^2.6.5: ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.1.0, schema-utils@^3.1.1: +schema-utils@^3.2.0: version "3.3.0" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== @@ -4990,6 +4969,16 @@ schema-utils@^4.0.0, schema-utils@^4.2.0: ajv-formats "^2.1.1" ajv-keywords "^5.1.0" +schema-utils@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" + select-hose@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" @@ -5032,7 +5021,7 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@^6.0.1: +serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== @@ -5290,21 +5279,21 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -terser-webpack-plugin@^5.1.3: - version "5.3.10" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" - integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== +terser-webpack-plugin@^5.3.10: + version "5.3.14" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" + integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== dependencies: - "@jridgewell/trace-mapping" "^0.3.20" + "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.1" - terser "^5.26.0" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" -terser@^5.26.0: - version "5.36.0" - resolved "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz#8b0dbed459ac40ff7b4c9fd5a3a2029de105180e" - integrity sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w== +terser@^5.31.1: + version "5.39.0" + resolved "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz#0e82033ed57b3ddf1f96708d123cca717d86ca3a" + integrity sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -5525,7 +5514,7 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.4.0: +watchpack@^2.4.1: version "2.4.2" resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== @@ -5628,34 +5617,33 @@ webpack-sources@^3.2.3: resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@5.76.0: - version "5.76.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz#f9fb9fb8c4a7dbdcd0d56a98e56b8a942ee2692c" - integrity sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA== +webpack@5.94.0: + version "5.94.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" + integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" + "@types/estree" "^1.0.5" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" + acorn-import-attributes "^1.9.5" + browserslist "^4.21.10" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.17.1" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^3.2.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" webpack-sources "^3.2.3" websocket-driver@>=0.5.1, websocket-driver@^0.7.4: From dcc62c031a8040a2c5acc58c3595bb8949bdca77 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:05:47 -0700 Subject: [PATCH 146/295] Update dependency express to v4.20.0 [SECURITY] (#8759) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- integration/messaging/package.json | 2 +- yarn.lock | 61 ++++++++++-------------------- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/integration/messaging/package.json b/integration/messaging/package.json index ef2ab5fd5ed..cba9b7ff303 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -12,7 +12,7 @@ "firebase": "11.5.0", "chai": "4.4.1", "chromedriver": "119.0.1", - "express": "4.19.2", + "express": "4.20.0", "geckodriver": "2.0.4", "mocha": "9.2.2", "selenium-assistant": "6.1.1" diff --git a/yarn.lock b/yarn.lock index bffdd9c7a25..5e5947884f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4726,24 +4726,6 @@ bn.js@^5.2.1: resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.2: - version "1.20.2" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" - integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== - dependencies: - bytes "3.1.2" - content-type "~1.0.5" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.2" - type-is "~1.6.18" - unpipe "1.0.0" - body-parser@1.20.3, body-parser@^1.18.3, body-parser@^1.19.0: version "1.20.3" resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" @@ -7324,37 +7306,37 @@ exponential-backoff@^3.1.1: resolved "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== -express@4.19.2: - version "4.19.2" - resolved "https://registry.npmjs.org/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" - integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== +express@4.20.0: + version "4.20.0" + resolved "https://registry.npmjs.org/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48" + integrity sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.2" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" finalhandler "1.2.0" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.0" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -11475,11 +11457,6 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== - merge-descriptors@1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" @@ -13107,16 +13084,16 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== + path-to-regexp@0.1.12: version "0.1.12" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== - path-to-regexp@^1.7.0, path-to-regexp@^1.8.0: version "1.9.0" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz#5dc0753acbf8521ca2e0f137b4578b917b10cf24" @@ -14744,10 +14721,10 @@ serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: dependencies: randombytes "^2.1.0" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.0: + version "1.16.0" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz#2bf4ed49f8af311b519c46f272bf6ac3baf38a92" + integrity sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" From b1808981a74c5858edeb25ea948868649784d1df Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:33:03 -0600 Subject: [PATCH 147/295] Port improved whereConditionsFromCursor from Android --- packages/firestore/src/core/pipeline-util.ts | 55 +++++++++----------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 4409daffc2e..10f0cb47da6 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -18,16 +18,12 @@ import { Firestore } from '../lite-api/database'; import { Constant, - Field, BooleanExpr, and, or, Ordering, lt, gt, - lte, - gte, - eq, field } from '../lite-api/expressions'; import { Pipeline } from '../lite-api/pipeline'; @@ -254,36 +250,35 @@ function whereConditionsFromCursor( orderings: Ordering[], position: 'before' | 'after' ): BooleanExpr { - const cursors = bound.position.map(value => Constant._fromProto(value)); + // The filterFunc is either greater than or less than const filterFunc = position === 'before' ? lt : gt; - const filterInclusiveFunc = position === 'before' ? lte : gte; - - const orConditions: BooleanExpr[] = []; - for (let i = 1; i <= orderings.length; i++) { - const cursorSubset = cursors.slice(0, i); + const cursors = bound.position.map(value => Constant._fromProto(value)); + const size = cursors.length; - const conditions: BooleanExpr[] = cursorSubset.map((cursor, index) => { - if (index < cursorSubset.length - 1) { - return eq(orderings[index].expr as Field, cursor); - } else if (bound.inclusive && i === orderings.length - 1) { - return filterInclusiveFunc(orderings[index].expr as Field, cursor); - } else { - return filterFunc(orderings[index].expr as Field, cursor); - } - }); + let field = orderings[size-1].expr; + let value = cursors[size-1]; - if (conditions.length === 1) { - orConditions.push(conditions[0]); - } else { - orConditions.push( - and(conditions[0], conditions[1], ...conditions.slice(2)) - ); - } + // Add condition for last bound + let condition: BooleanExpr = filterFunc(field, value); + if (bound.inclusive) { + // When the cursor bound is inclusive, then the last bound + // can be equal to the value, otherwise it's not equal + condition = or(condition, field.eq(value)); } - if (orConditions.length === 1) { - return orConditions[0]; - } else { - return or(orConditions[0], orConditions[1], ...orConditions.slice(2)); + // Iterate backwards over the remaining bounds, adding + // a condition for each one + for (let i = size - 2; i >= 0; i--) { + field = orderings[i].expr; + value = cursors[i]; + + // For each field in the orderings, the condition is either + // a) lt|gt the cursor value, + // b) or equal the cursor value and lt|gt the cursor values for other fields + condition = or( + filterFunc(field, value), + and(field.eq(value), condition)); } + + return condition; } From 6cc2ee6a8069ddb859ff7b1a42d36ccb3cb3a5ce Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 26 Mar 2025 10:03:49 -0600 Subject: [PATCH 148/295] Port improved whereConditionsFromCursor from Android (#8867) --- packages/firestore/src/core/pipeline-util.ts | 55 +++++++++----------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 4409daffc2e..10f0cb47da6 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -18,16 +18,12 @@ import { Firestore } from '../lite-api/database'; import { Constant, - Field, BooleanExpr, and, or, Ordering, lt, gt, - lte, - gte, - eq, field } from '../lite-api/expressions'; import { Pipeline } from '../lite-api/pipeline'; @@ -254,36 +250,35 @@ function whereConditionsFromCursor( orderings: Ordering[], position: 'before' | 'after' ): BooleanExpr { - const cursors = bound.position.map(value => Constant._fromProto(value)); + // The filterFunc is either greater than or less than const filterFunc = position === 'before' ? lt : gt; - const filterInclusiveFunc = position === 'before' ? lte : gte; - - const orConditions: BooleanExpr[] = []; - for (let i = 1; i <= orderings.length; i++) { - const cursorSubset = cursors.slice(0, i); + const cursors = bound.position.map(value => Constant._fromProto(value)); + const size = cursors.length; - const conditions: BooleanExpr[] = cursorSubset.map((cursor, index) => { - if (index < cursorSubset.length - 1) { - return eq(orderings[index].expr as Field, cursor); - } else if (bound.inclusive && i === orderings.length - 1) { - return filterInclusiveFunc(orderings[index].expr as Field, cursor); - } else { - return filterFunc(orderings[index].expr as Field, cursor); - } - }); + let field = orderings[size-1].expr; + let value = cursors[size-1]; - if (conditions.length === 1) { - orConditions.push(conditions[0]); - } else { - orConditions.push( - and(conditions[0], conditions[1], ...conditions.slice(2)) - ); - } + // Add condition for last bound + let condition: BooleanExpr = filterFunc(field, value); + if (bound.inclusive) { + // When the cursor bound is inclusive, then the last bound + // can be equal to the value, otherwise it's not equal + condition = or(condition, field.eq(value)); } - if (orConditions.length === 1) { - return orConditions[0]; - } else { - return or(orConditions[0], orConditions[1], ...orConditions.slice(2)); + // Iterate backwards over the remaining bounds, adding + // a condition for each one + for (let i = size - 2; i >= 0; i--) { + field = orderings[i].expr; + value = cursors[i]; + + // For each field in the orderings, the condition is either + // a) lt|gt the cursor value, + // b) or equal the cursor value and lt|gt the cursor values for other fields + condition = or( + filterFunc(field, value), + and(field.eq(value), condition)); } + + return condition; } From 670eba6075e777f1a0010a1f6f9d30bf59b7e56b Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Thu, 27 Mar 2025 20:21:42 +0000 Subject: [PATCH 149/295] karma.base.js: replace "BROWSER" with "BROWSERS" in log messages, to reflect the actual name of the environment variable (see #8491) (#8875) --- config/karma.base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/karma.base.js b/config/karma.base.js index fe53d3ac744..c49b1246ed6 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -31,7 +31,7 @@ function determineBrowsers() { ); if (validBrowsers.length === 0) { console.error( - `The \'BROWSER\' environment variable was set, but no supported browsers were listed. The supported browsers are ${JSON.stringify( + `The \'BROWSERS\' environment variable was set, but no supported browsers were listed. The supported browsers are ${JSON.stringify( supportedBrowsers )}.` ); @@ -41,7 +41,7 @@ function determineBrowsers() { } } else { console.log( - "The 'BROWSER' environment variable is undefined. Defaulting to 'ChromeHeadless'." + "The 'BROWSERS' environment variable is undefined. Defaulting to 'ChromeHeadless'." ); return ['ChromeHeadless']; } From fb5d4227571e06df128048abf87cbb1da2ace1bc Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 27 Mar 2025 17:53:59 -0400 Subject: [PATCH 150/295] Auth cookie persistence (#8839) Adding `Persistence.COOKIE` a new persistence method backed by cookies. The `browserCookiePersistence` implementation is designed to be used in conjunction with middleware that ensures both your front and backend authentication state remains synchronized. --- .changeset/orange-turtles-taste.md | 8 + common/api-review/auth.api.md | 5 +- docs-devsite/auth.md | 16 ++ docs-devsite/auth.persistence.md | 6 +- packages/auth-compat/src/auth.test.ts | 4 +- packages/auth-compat/src/persistence.ts | 2 +- packages/auth/index.ts | 2 + packages/auth/package.json | 1 + packages/auth/src/api/authentication/token.ts | 2 +- packages/auth/src/api/index.test.ts | 8 +- packages/auth/src/api/index.ts | 38 +++- packages/auth/src/core/auth/auth_impl.ts | 16 +- .../auth/src/core/auth/initialize.test.ts | 6 +- packages/auth/src/core/persistence/index.ts | 3 +- .../persistence/persistence_user_manager.ts | 38 +++- packages/auth/src/model/auth.ts | 5 +- packages/auth/src/model/public_types.ts | 3 +- .../persistence/cookie_storage.ts | 166 ++++++++++++++++++ packages/auth/src/platform_node/index.ts | 1 + yarn.lock | 5 + 20 files changed, 306 insertions(+), 29 deletions(-) create mode 100644 .changeset/orange-turtles-taste.md create mode 100644 packages/auth/src/platform_browser/persistence/cookie_storage.ts diff --git a/.changeset/orange-turtles-taste.md b/.changeset/orange-turtles-taste.md new file mode 100644 index 00000000000..2787a280312 --- /dev/null +++ b/.changeset/orange-turtles-taste.md @@ -0,0 +1,8 @@ +--- +'firebase': minor +'@firebase/auth': minor +--- + +Adding `Persistence.COOKIE` a new persistence method backed by cookies. The +`browserCookiePersistence` implementation is designed to be used in conjunction with middleware that +ensures both your front and backend authentication state remains synchronized. diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index 7ec0db38bdc..0c9625a90e9 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -258,6 +258,9 @@ export interface AuthSettings { // @public export function beforeAuthStateChanged(auth: Auth, callback: (user: User | null) => void | Promise, onAbort?: () => void): Unsubscribe; +// @beta +export const browserCookiePersistence: Persistence; + // @public export const browserLocalPersistence: Persistence; @@ -596,7 +599,7 @@ export interface PasswordValidationStatus { // @public export interface Persistence { - readonly type: 'SESSION' | 'LOCAL' | 'NONE'; + readonly type: 'SESSION' | 'LOCAL' | 'NONE' | 'COOKIE'; } // @public diff --git a/docs-devsite/auth.md b/docs-devsite/auth.md index 82f8a3dc196..1b3938ef4eb 100644 --- a/docs-devsite/auth.md +++ b/docs-devsite/auth.md @@ -150,6 +150,7 @@ Firebase Authentication | --- | --- | | [ActionCodeOperation](./auth.md#actioncodeoperation) | An enumeration of the possible email action types. | | [AuthErrorCodes](./auth.md#autherrorcodes) | A map of potential Auth error codes, for easier comparison with errors thrown by the SDK. | +| [browserCookiePersistence](./auth.md#browsercookiepersistence) | (Public Preview) An implementation of [Persistence](./auth.persistence.md#persistence_interface) of type COOKIE, for use on the client side in applications leveraging hybrid rendering and middleware. | | [browserLocalPersistence](./auth.md#browserlocalpersistence) | An implementation of [Persistence](./auth.persistence.md#persistence_interface) of type LOCAL using localStorage for the underlying storage. | | [browserPopupRedirectResolver](./auth.md#browserpopupredirectresolver) | An implementation of [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) suitable for browser based applications. | | [browserSessionPersistence](./auth.md#browsersessionpersistence) | An implementation of [Persistence](./auth.persistence.md#persistence_interface) of SESSION using sessionStorage for the underlying storage. | @@ -1960,6 +1961,21 @@ AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY: { } ``` +## browserCookiePersistence + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An implementation of [Persistence](./auth.persistence.md#persistence_interface) of type `COOKIE`, for use on the client side in applications leveraging hybrid rendering and middleware. + +This persistence method requires companion middleware to function, such as that provided by [ReactFire](https://firebaseopensource.com/projects/firebaseextended/reactfire/) for NextJS. + +Signature: + +```typescript +browserCookiePersistence: Persistence +``` + ## browserLocalPersistence An implementation of [Persistence](./auth.persistence.md#persistence_interface) of type `LOCAL` using `localStorage` for the underlying storage. diff --git a/docs-devsite/auth.persistence.md b/docs-devsite/auth.persistence.md index b3f9ecb11e1..8e0a5c35230 100644 --- a/docs-devsite/auth.persistence.md +++ b/docs-devsite/auth.persistence.md @@ -22,14 +22,14 @@ export interface Persistence | Property | Type | Description | | --- | --- | --- | -| [type](./auth.persistence.md#persistencetype) | 'SESSION' \| 'LOCAL' \| 'NONE' | Type of Persistence. - 'SESSION' is used for temporary persistence such as sessionStorage. - 'LOCAL' is used for long term persistence such as localStorage or IndexedDB. - 'NONE' is used for in-memory, or no persistence. | +| [type](./auth.persistence.md#persistencetype) | 'SESSION' \| 'LOCAL' \| 'NONE' \| 'COOKIE' | Type of Persistence. - 'SESSION' is used for temporary persistence such as sessionStorage. - 'LOCAL' is used for long term persistence such as localStorage or IndexedDB. - 'NONE' is used for in-memory, or no persistence. - 'COOKIE' is used for cookie persistence, useful for server-side rendering. | ## Persistence.type -Type of Persistence. - 'SESSION' is used for temporary persistence such as `sessionStorage`. - 'LOCAL' is used for long term persistence such as `localStorage` or `IndexedDB`. - 'NONE' is used for in-memory, or no persistence. +Type of Persistence. - 'SESSION' is used for temporary persistence such as `sessionStorage`. - 'LOCAL' is used for long term persistence such as `localStorage` or `IndexedDB`. - 'NONE' is used for in-memory, or no persistence. - 'COOKIE' is used for cookie persistence, useful for server-side rendering. Signature: ```typescript -readonly type: 'SESSION' | 'LOCAL' | 'NONE'; +readonly type: 'SESSION' | 'LOCAL' | 'NONE' | 'COOKIE'; ``` diff --git a/packages/auth-compat/src/auth.test.ts b/packages/auth-compat/src/auth.test.ts index 4dee1e4f29f..c2e73ea5df9 100644 --- a/packages/auth-compat/src/auth.test.ts +++ b/packages/auth-compat/src/auth.test.ts @@ -65,7 +65,7 @@ describe('auth compat', () => { it('saves the persistence into session storage if available', async () => { if (typeof self !== 'undefined') { underlyingAuth._initializationPromise = Promise.resolve(); - sinon.stub(underlyingAuth, '_getPersistence').returns('TEST'); + sinon.stub(underlyingAuth, '_getPersistenceType').returns('TEST'); sinon .stub(underlyingAuth, '_initializationPromise') .value(Promise.resolve()); @@ -97,7 +97,7 @@ describe('auth compat', () => { } } as unknown as Window); const setItemSpy = sinon.spy(sessionStorage, 'setItem'); - sinon.stub(underlyingAuth, '_getPersistence').returns('TEST'); + sinon.stub(underlyingAuth, '_getPersistenceType').returns('TEST'); sinon .stub(underlyingAuth, '_initializationPromise') .value(Promise.resolve()); diff --git a/packages/auth-compat/src/persistence.ts b/packages/auth-compat/src/persistence.ts index c3f046828d7..3c839823a7c 100644 --- a/packages/auth-compat/src/persistence.ts +++ b/packages/auth-compat/src/persistence.ts @@ -91,7 +91,7 @@ export async function _savePersistenceForRedirect( auth.name ); if (session) { - session.setItem(key, auth._getPersistence()); + session.setItem(key, auth._getPersistenceType()); } } diff --git a/packages/auth/index.ts b/packages/auth/index.ts index df67fd1616b..95e2f453f16 100644 --- a/packages/auth/index.ts +++ b/packages/auth/index.ts @@ -43,6 +43,7 @@ export * from './src'; // persistence import { browserLocalPersistence } from './src/platform_browser/persistence/local_storage'; +import { browserCookiePersistence } from './src/platform_browser/persistence/cookie_storage'; import { browserSessionPersistence } from './src/platform_browser/persistence/session_storage'; import { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db'; @@ -83,6 +84,7 @@ import { getAuth } from './src/platform_browser'; export { browserLocalPersistence, + browserCookiePersistence, browserSessionPersistence, indexedDBLocalPersistence, PhoneAuthProvider, diff --git a/packages/auth/package.json b/packages/auth/package.json index cfa5c0d5f4d..a593797386b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -136,6 +136,7 @@ "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", "chromedriver": "119.0.1", + "cookie-store": "4.0.0-next.4", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/auth/src/api/authentication/token.ts b/packages/auth/src/api/authentication/token.ts index 06342c4c633..6646321fbe0 100644 --- a/packages/auth/src/api/authentication/token.ts +++ b/packages/auth/src/api/authentication/token.ts @@ -74,7 +74,7 @@ export async function requestStsToken( 'refresh_token': refreshToken }).slice(1); const { tokenApiHost, apiKey } = auth.config; - const url = _getFinalTarget( + const url = await _getFinalTarget( auth, tokenApiHost, Endpoint.TOKEN, diff --git a/packages/auth/src/api/index.test.ts b/packages/auth/src/api/index.test.ts index 11070509d73..ea11af59d01 100644 --- a/packages/auth/src/api/index.test.ts +++ b/packages/auth/src/api/index.test.ts @@ -509,17 +509,17 @@ describe('api/_performApiRequest', () => { }); context('_getFinalTarget', () => { - it('works properly with a non-emulated environment', () => { - expect(_getFinalTarget(auth, 'host', '/path', 'query=test')).to.eq( + it('works properly with a non-emulated environment', async () => { + expect(await _getFinalTarget(auth, 'host', '/path', 'query=test')).to.eq( 'mock://host/path?query=test' ); }); - it('works properly with an emulated environment', () => { + it('works properly with an emulated environment', async () => { (auth.config as ConfigInternal).emulator = { url: 'http://localhost:5000/' }; - expect(_getFinalTarget(auth, 'host', '/path', 'query=test')).to.eq( + expect(await _getFinalTarget(auth, 'host', '/path', 'query=test')).to.eq( 'http://localhost:5000/host/path?query=test' ); }); diff --git a/packages/auth/src/api/index.ts b/packages/auth/src/api/index.ts index 4813ace9507..769a1b6accc 100644 --- a/packages/auth/src/api/index.ts +++ b/packages/auth/src/api/index.ts @@ -31,6 +31,8 @@ import { AuthInternal, ConfigInternal } from '../model/auth'; import { IdTokenResponse, TaggedWithTokenResponse } from '../model/id_token'; import { IdTokenMfaResponse } from './authentication/mfa'; import { SERVER_ERROR_MAP, ServerError, ServerErrorMap } from './errors'; +import { PersistenceType } from '../core/persistence'; +import { CookiePersistence } from '../platform_browser/persistence/cookie_storage'; export const enum HttpMethod { POST = 'POST', @@ -73,6 +75,15 @@ export const enum Endpoint { REVOKE_TOKEN = '/v2/accounts:revokeToken' } +const CookieAuthProxiedEndpoints: string[] = [ + Endpoint.SIGN_IN_WITH_CUSTOM_TOKEN, + Endpoint.SIGN_IN_WITH_EMAIL_LINK, + Endpoint.SIGN_IN_WITH_IDP, + Endpoint.SIGN_IN_WITH_PASSWORD, + Endpoint.SIGN_IN_WITH_PHONE_NUMBER, + Endpoint.TOKEN +]; + export const enum RecaptchaClientType { WEB = 'CLIENT_TYPE_WEB', ANDROID = 'CLIENT_TYPE_ANDROID', @@ -167,7 +178,7 @@ export async function _performApiRequest( } return FetchProvider.fetch()( - _getFinalTarget(auth, auth.config.apiHost, path, query), + await _getFinalTarget(auth, auth.config.apiHost, path, query), fetchArgs ); }); @@ -257,19 +268,34 @@ export async function _performSignInRequest( return serverResponse as V; } -export function _getFinalTarget( +export async function _getFinalTarget( auth: Auth, host: string, path: string, query: string -): string { +): Promise { const base = `${host}${path}?${query}`; - if (!(auth as AuthInternal).config.emulator) { - return `${auth.config.apiScheme}://${base}`; + const authInternal = auth as AuthInternal; + const finalTarget = authInternal.config.emulator + ? _emulatorUrl(auth.config as ConfigInternal, base) + : `${auth.config.apiScheme}://${base}`; + + // Cookie auth works by MiTMing the signIn and token endpoints from the developer's backend, + // saving the idToken and refreshToken into cookies, and then redacting the refreshToken + // from the response + if (CookieAuthProxiedEndpoints.includes(path)) { + // Persistence manager is async, we need to await it. We can't just wait for auth initialized + // here since auth initialization calls this function. + await authInternal._persistenceManagerAvailable; + if (authInternal._getPersistenceType() === PersistenceType.COOKIE) { + const cookiePersistence = + authInternal._getPersistence() as CookiePersistence; + return cookiePersistence._getFinalTarget(finalTarget).toString(); + } } - return _emulatorUrl(auth.config as ConfigInternal, base); + return finalTarget; } export function _parseEnforcementState( diff --git a/packages/auth/src/core/auth/auth_impl.ts b/packages/auth/src/core/auth/auth_impl.ts index 45a2c99ea0b..4a718702110 100644 --- a/packages/auth/src/core/auth/auth_impl.ts +++ b/packages/auth/src/core/auth/auth_impl.ts @@ -120,6 +120,10 @@ export class AuthImpl implements AuthInternal, _FirebaseService { _tenantRecaptchaConfigs: Record = {}; _projectPasswordPolicy: PasswordPolicyInternal | null = null; _tenantPasswordPolicies: Record = {}; + _resolvePersistenceManagerAvailable: + | ((value: void | PromiseLike) => void) + | undefined = undefined; + _persistenceManagerAvailable: Promise; readonly name: string; // Tracks the last notified UID for state change listeners to prevent @@ -139,6 +143,11 @@ export class AuthImpl implements AuthInternal, _FirebaseService { ) { this.name = app.name; this.clientVersion = config.sdkClientVersion; + // TODO(jamesdaniels) explore less hacky way to do this, cookie authentication needs + // persistenceMananger to be available. see _getFinalTarget for more context + this._persistenceManagerAvailable = new Promise( + resolve => (this._resolvePersistenceManagerAvailable = resolve) + ); } _initializeWithPersistence( @@ -160,6 +169,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService { this, persistenceHierarchy ); + this._resolvePersistenceManagerAvailable?.(); if (this._deleted) { return; @@ -524,10 +534,14 @@ export class AuthImpl implements AuthInternal, _FirebaseService { } } - _getPersistence(): string { + _getPersistenceType(): string { return this.assertedPersistence.persistence.type; } + _getPersistence(): PersistenceInternal { + return this.assertedPersistence.persistence; + } + _updateErrorMap(errorMap: AuthErrorMap): void { this._errorFactory = new ErrorFactory( 'auth', diff --git a/packages/auth/src/core/auth/initialize.test.ts b/packages/auth/src/core/auth/initialize.test.ts index 5ca5fa6eb52..f2d4d24c887 100644 --- a/packages/auth/src/core/auth/initialize.test.ts +++ b/packages/auth/src/core/auth/initialize.test.ts @@ -170,7 +170,7 @@ describe('core/auth/initialize', () => { sdkClientVersion: expectedSdkClientVersion, tokenApiHost: 'securetoken.googleapis.com' }); - expect(auth._getPersistence()).to.eq('NONE'); + expect(auth._getPersistenceType()).to.eq('NONE'); }); it('should set persistence', async () => { @@ -179,7 +179,7 @@ describe('core/auth/initialize', () => { }) as AuthInternal; await auth._initializationPromise; - expect(auth._getPersistence()).to.eq('SESSION'); + expect(auth._getPersistenceType()).to.eq('SESSION'); }); it('should set persistence with fallback', async () => { @@ -188,7 +188,7 @@ describe('core/auth/initialize', () => { }) as AuthInternal; await auth._initializationPromise; - expect(auth._getPersistence()).to.eq('SESSION'); + expect(auth._getPersistenceType()).to.eq('SESSION'); }); it('should set resolver', async () => { diff --git a/packages/auth/src/core/persistence/index.ts b/packages/auth/src/core/persistence/index.ts index 5f3db8f705e..5d665844226 100644 --- a/packages/auth/src/core/persistence/index.ts +++ b/packages/auth/src/core/persistence/index.ts @@ -19,7 +19,8 @@ import { Persistence } from '../../model/public_types'; export const enum PersistenceType { SESSION = 'SESSION', LOCAL = 'LOCAL', - NONE = 'NONE' + NONE = 'NONE', + COOKIE = 'COOKIE' } export type PersistedBlob = Record; diff --git a/packages/auth/src/core/persistence/persistence_user_manager.ts b/packages/auth/src/core/persistence/persistence_user_manager.ts index 7aa651c5110..580aaad3b25 100644 --- a/packages/auth/src/core/persistence/persistence_user_manager.ts +++ b/packages/auth/src/core/persistence/persistence_user_manager.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { getAccountInfo } from '../../api/account_management/account'; import { ApiKey, AppName, AuthInternal } from '../../model/auth'; import { UserInternal } from '../../model/user'; import { PersistedBlob, PersistenceInternal } from '../persistence'; @@ -66,8 +67,22 @@ export class PersistenceUserManager { } async getCurrentUser(): Promise { - const blob = await this.persistence._get(this.fullUserKey); - return blob ? UserImpl._fromJSON(this.auth, blob) : null; + const blob = await this.persistence._get( + this.fullUserKey + ); + if (!blob) { + return null; + } + if (typeof blob === 'string') { + const response = await getAccountInfo(this.auth, { idToken: blob }).catch( + () => undefined + ); + if (!response) { + return null; + } + return UserImpl._fromGetAccountInfoResponse(this.auth, response, blob); + } + return UserImpl._fromJSON(this.auth, blob); } removeCurrentUser(): Promise { @@ -140,9 +155,24 @@ export class PersistenceUserManager { // persistence, we will (but only if that persistence supports migration). for (const persistence of persistenceHierarchy) { try { - const blob = await persistence._get(key); + const blob = await persistence._get(key); if (blob) { - const user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format) + let user: UserInternal; + if (typeof blob === 'string') { + const response = await getAccountInfo(auth, { + idToken: blob + }).catch(() => undefined); + if (!response) { + break; + } + user = await UserImpl._fromGetAccountInfoResponse( + auth, + response, + blob + ); + } else { + user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format) + } if (persistence !== selectedPersistence) { userToMigrate = user; } diff --git a/packages/auth/src/model/auth.ts b/packages/auth/src/model/auth.ts index a456b255788..a88430fd5df 100644 --- a/packages/auth/src/model/auth.ts +++ b/packages/auth/src/model/auth.ts @@ -33,6 +33,7 @@ import { UserInternal } from './user'; import { ClientPlatform } from '../core/util/version'; import { RecaptchaConfig } from '../platform_browser/recaptcha/recaptcha'; import { PasswordPolicyInternal } from './password_policy'; +import { PersistenceInternal } from '../core/persistence'; export type AppName = string; export type ApiKey = string; @@ -71,6 +72,7 @@ export interface AuthInternal extends Auth { _canInitEmulator: boolean; _isInitialized: boolean; _initializationPromise: Promise | null; + _persistenceManagerAvailable: Promise; _updateCurrentUser(user: UserInternal | null): Promise; _onStorageEvent(): void; @@ -86,7 +88,8 @@ export interface AuthInternal extends Auth { _key(): string; _startProactiveRefresh(): void; _stopProactiveRefresh(): void; - _getPersistence(): string; + _getPersistenceType(): string; + _getPersistence(): PersistenceInternal; _getRecaptchaConfig(): RecaptchaConfig | null; _getPasswordPolicyInternal(): PasswordPolicyInternal | null; _updatePasswordPolicy(): Promise; diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index ac1face6b6a..43942b93d92 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -341,8 +341,9 @@ export interface Persistence { * - 'SESSION' is used for temporary persistence such as `sessionStorage`. * - 'LOCAL' is used for long term persistence such as `localStorage` or `IndexedDB`. * - 'NONE' is used for in-memory, or no persistence. + * - 'COOKIE' is used for cookie persistence, useful for server-side rendering. */ - readonly type: 'SESSION' | 'LOCAL' | 'NONE'; + readonly type: 'SESSION' | 'LOCAL' | 'NONE' | 'COOKIE'; } /** diff --git a/packages/auth/src/platform_browser/persistence/cookie_storage.ts b/packages/auth/src/platform_browser/persistence/cookie_storage.ts new file mode 100644 index 00000000000..9b4570c8251 --- /dev/null +++ b/packages/auth/src/platform_browser/persistence/cookie_storage.ts @@ -0,0 +1,166 @@ +/** + * @license + * Copyright 2025 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 { Persistence } from '../../model/public_types'; +import type { CookieChangeEvent } from 'cookie-store'; + +const POLLING_INTERVAL_MS = 1_000; + +import { + PersistenceInternal, + PersistenceType, + PersistenceValue, + StorageEventListener +} from '../../core/persistence'; + +// Pull a cookie value from document.cookie +function getDocumentCookie(name: string): string | null { + const escapedName = name.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'); + const matcher = RegExp(`${escapedName}=([^;]+)`); + return document.cookie.match(matcher)?.[1] ?? null; +} + +// Produce a sanitized cookie name from the persistence key +function getCookieName(key: string): string { + // __HOST- doesn't work in localhost https://issues.chromium.org/issues/40196122 but it has + // desirable security properties, so lets use a different cookie name while in dev-mode. + // Already checked isSecureContext in _isAvailable, so if it's http we're hitting local. + const isDevMode = window.location.protocol === 'http:'; + return `${isDevMode ? '__dev_' : '__HOST-'}FIREBASE_${key.split(':')[3]}`; +} + +export class CookiePersistence implements PersistenceInternal { + static type: 'COOKIE' = 'COOKIE'; + readonly type = PersistenceType.COOKIE; + listenerUnsubscribes: Map void> = new Map(); + + // used to get the URL to the backend to proxy to + _getFinalTarget(originalUrl: string): URL | string { + if (typeof window === undefined) { + return originalUrl; + } + const url = new URL(`${window.location.origin}/__cookies__`); + url.searchParams.set('finalTarget', originalUrl); + return url; + } + + // To be a usable persistence method in a chain browserCookiePersistence ensures that + // prerequisites have been met, namely that we're in a secureContext, navigator and document are + // available and cookies are enabled. Not all UAs support these method, so fallback accordingly. + async _isAvailable(): Promise { + if (typeof isSecureContext === 'boolean' && !isSecureContext) { + return false; + } + if (typeof navigator === 'undefined' || typeof document === 'undefined') { + return false; + } + return navigator.cookieEnabled ?? true; + } + + // Set should be a noop as we expect middleware to handle this + async _set(_key: string, _value: PersistenceValue): Promise { + return; + } + + // Attempt to get the cookie from cookieStore, fallback to document.cookie + async _get(key: string): Promise { + if (!this._isAvailable()) { + return null; + } + const name = getCookieName(key); + if (window.cookieStore) { + const cookie = await window.cookieStore.get(name); + return cookie?.value as T; + } + return getDocumentCookie(name) as T; + } + + // Log out by overriding the idToken with a sentinel value of "" + async _remove(key: string): Promise { + if (!this._isAvailable()) { + return; + } + // To make sure we don't hit signout over and over again, only do this operation if we need to + // with the logout sentinel value of "" this can cause race conditions. Unnecessary set-cookie + // headers will reduce CDN hit rates too. + const existingValue = await this._get(key); + if (!existingValue) { + return; + } + const name = getCookieName(key); + document.cookie = `${name}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`; + await fetch(`/__cookies__`, { method: 'DELETE' }).catch(() => undefined); + } + + // Listen for cookie changes, both cookieStore and fallback to polling document.cookie + _addListener(key: string, listener: StorageEventListener): void { + if (!this._isAvailable()) { + return; + } + const name = getCookieName(key); + if (window.cookieStore) { + const cb = ((event: CookieChangeEvent): void => { + const changedCookie = event.changed.find( + change => change.name === name + ); + if (changedCookie) { + listener(changedCookie.value as PersistenceValue); + } + const deletedCookie = event.deleted.find( + change => change.name === name + ); + if (deletedCookie) { + listener(null); + } + }) as EventListener; + const unsubscribe = (): void => + window.cookieStore.removeEventListener('change', cb); + this.listenerUnsubscribes.set(listener, unsubscribe); + return window.cookieStore.addEventListener('change', cb as EventListener); + } + let lastValue = getDocumentCookie(name); + const interval = setInterval(() => { + const currentValue = getDocumentCookie(name); + if (currentValue !== lastValue) { + listener(currentValue as PersistenceValue | null); + lastValue = currentValue; + } + }, POLLING_INTERVAL_MS); + const unsubscribe = (): void => clearInterval(interval); + this.listenerUnsubscribes.set(listener, unsubscribe); + } + + _removeListener(_key: string, listener: StorageEventListener): void { + const unsubscribe = this.listenerUnsubscribes.get(listener); + if (!unsubscribe) { + return; + } + unsubscribe(); + this.listenerUnsubscribes.delete(listener); + } +} + +/** + * An implementation of {@link Persistence} of type `COOKIE`, for use on the client side in + * applications leveraging hybrid rendering and middleware. + * + * @remarks This persistence method requires companion middleware to function, such as that provided + * by {@link https://firebaseopensource.com/projects/firebaseextended/reactfire/ | ReactFire} for + * NextJS. + * @beta + */ +export const browserCookiePersistence: Persistence = CookiePersistence; diff --git a/packages/auth/src/platform_node/index.ts b/packages/auth/src/platform_node/index.ts index 67618b5b773..00d3f67b75b 100644 --- a/packages/auth/src/platform_node/index.ts +++ b/packages/auth/src/platform_node/index.ts @@ -81,6 +81,7 @@ class FailClass { export const browserLocalPersistence = inMemoryPersistence; export const browserSessionPersistence = inMemoryPersistence; +export const browserCookiePersistence = inMemoryPersistence; export const indexedDBLocalPersistence = inMemoryPersistence; export const browserPopupRedirectResolver = NOT_AVAILABLE_ERROR; export const PhoneAuthProvider = FailClass; diff --git a/yarn.lock b/yarn.lock index 5e5947884f9..758bf3f5058 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5875,6 +5875,11 @@ cookie-signature@1.0.6: resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== +cookie-store@4.0.0-next.4: + version "4.0.0-next.4" + resolved "https://registry.npmjs.org/cookie-store/-/cookie-store-4.0.0-next.4.tgz#8b13981bfd93e10e30694e9816928f8c478a326b" + integrity sha512-RVcIK13cCiAa+rsxAbFhrIThn1eBcgt9WTyLq539zMafDnhdGb6u/O5JdMTC3/pcJVqqHJmctiWxAYPpwT/fxw== + cookie@0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" From 195d943103795a50bb3fc5c56ef2bb64610006a1 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 28 Mar 2025 14:47:17 +0000 Subject: [PATCH 151/295] firestore: fix `undefined` document snapshot data after "clear site data" (#8871) --- .changeset/slow-students-fry.md | 6 +++++ packages/firestore/src/local/simple_db.ts | 29 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .changeset/slow-students-fry.md diff --git a/.changeset/slow-students-fry.md b/.changeset/slow-students-fry.md new file mode 100644 index 00000000000..45f3cf7e576 --- /dev/null +++ b/.changeset/slow-students-fry.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Fix issue where Firestore would produce `undefined` for document snapshot data if using IndexedDB persistence and "clear site data" (or equivalent) button was pressed in the web browser. diff --git a/packages/firestore/src/local/simple_db.ts b/packages/firestore/src/local/simple_db.ts index 8665136a9f5..3327f66acb7 100644 --- a/packages/firestore/src/local/simple_db.ts +++ b/packages/firestore/src/local/simple_db.ts @@ -158,6 +158,7 @@ export class SimpleDbTransaction { */ export class SimpleDb { private db?: IDBDatabase; + private lastClosedDbVersion: number | null = null; private versionchangelistener?: (event: IDBVersionChangeEvent) => void; /** Deletes the specified database. */ @@ -344,6 +345,24 @@ export class SimpleDb { event.oldVersion ); const db = (event.target as IDBOpenDBRequest).result; + if ( + this.lastClosedDbVersion !== null && + this.lastClosedDbVersion !== event.oldVersion + ) { + // This thrown error will get passed to the `onerror` callback + // registered above, and will then be propagated correctly. + throw new Error( + `refusing to open IndexedDB database due to potential ` + + `corruption of the IndexedDB database data; this corruption ` + + `could be caused by clicking the "clear site data" button in ` + + `a web browser; try reloading the web page to re-initialize ` + + `the IndexedDB database: ` + + `lastClosedDbVersion=${this.lastClosedDbVersion}, ` + + `event.oldVersion=${event.oldVersion}, ` + + `event.newVersion=${event.newVersion}, ` + + `db.version=${db.version}` + ); + } this.schemaConverter .createOrUpgrade( db, @@ -359,11 +378,21 @@ export class SimpleDb { }); }; }); + + this.db.addEventListener( + 'close', + event => { + const db = event.target as IDBDatabase; + this.lastClosedDbVersion = db.version; + }, + { passive: true } + ); } if (this.versionchangelistener) { this.db.onversionchange = event => this.versionchangelistener!(event); } + return this.db; } From 61f0102ac85e4fd6c54506df93b1f1899e3ef110 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Fri, 28 Mar 2025 12:24:22 -0400 Subject: [PATCH 152/295] Use base browsers variable in Firestore karma config (#8876) --- packages/firestore/karma.conf.js | 9 --------- .../firestore/test/unit/util/bundle.test.ts | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/firestore/karma.conf.js b/packages/firestore/karma.conf.js index 70c5ffef546..51a158b8c3a 100644 --- a/packages/firestore/karma.conf.js +++ b/packages/firestore/karma.conf.js @@ -21,7 +21,6 @@ const { argv } = require('yargs'); module.exports = function (config) { const karmaConfig = { ...karmaBase, - browsers: getTestBrowsers(argv), // files to load into karma files: getTestFiles(argv), @@ -76,12 +75,4 @@ function getTestFiles(argv) { } } -function getTestBrowsers(argv) { - let browsers = ['ChromeHeadless']; - if (process.env?.BROWSERS && argv.unit) { - browsers = process.env?.BROWSERS?.split(','); - } - return browsers; -} - module.exports.files = getTestFiles(argv); diff --git a/packages/firestore/test/unit/util/bundle.test.ts b/packages/firestore/test/unit/util/bundle.test.ts index 13647efa470..1cc4c05772e 100644 --- a/packages/firestore/test/unit/util/bundle.test.ts +++ b/packages/firestore/test/unit/util/bundle.test.ts @@ -239,9 +239,21 @@ function genericBundleReadingTests(bytesPerRead: number): void { 'Reached the end of bundle when a length string is expected.' ); - await expect( - generateBundleAndParse('{metadata: "no length prefix"}', bytesPerRead) - ).to.be.rejectedWith(/(Unexpected end of )(?=.*JSON\b).*/gi); + // The multiple "rejectedWith" checks below are an attempt to make the + // test robust in the presence of various permutations of the error + // message, which is produced by the JavaScript runtime. + // Chrome produces: Unexpected end of JSON input + // Webkit produces: JSON Parse error: Unexpected EOF + const noLengthPrefixPromise = generateBundleAndParse( + '{metadata: "no length prefix"}', + bytesPerRead + ); + await expect(noLengthPrefixPromise).to.be.rejectedWith( + /(\b|^)unexpected ((end of)|(eof))(\b|$)/gi + ); + await expect(noLengthPrefixPromise).to.be.rejectedWith( + /(\b|^)JSON(\b|$)/g + ); await expect( generateBundleAndParse( From c8cbfff1667c7c1f447262ef3e31e55c6e321d4d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 28 Mar 2025 17:43:22 -0700 Subject: [PATCH 153/295] [chore] Update some dependencies (#8868) --- e2e/package.json | 2 +- integration/messaging/package.json | 4 +- package.json | 6 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/firestore/package.json | 1 - repo-scripts/changelog-generator/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- yarn.lock | 196 ++++++------------ 9 files changed, 76 insertions(+), 141 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 07d6a6d3b00..189479017e4 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -30,7 +30,7 @@ "jest-environment-jsdom": "29.7.0", "ts-node": "10.9.2", "typescript": "5.5.4", - "webpack": "5.94.0", + "webpack": "5.98.0", "webpack-cli": "5.1.4", "webpack-dev-server": "5.2.0" }, diff --git a/integration/messaging/package.json b/integration/messaging/package.json index cba9b7ff303..dc37b8919b7 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -10,9 +10,9 @@ }, "devDependencies": { "firebase": "11.5.0", - "chai": "4.4.1", + "chai": "4.5.0", "chromedriver": "119.0.1", - "express": "4.20.0", + "express": "4.21.2", "geckodriver": "2.0.4", "mocha": "9.2.2", "selenium-assistant": "6.1.1" diff --git a/package.json b/package.json index bff8b2c715e..30b6b09a003 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "@types/long": "4.0.2", "@types/mocha": "9.1.1", "@types/mz": "2.7.8", - "@types/node": "18.19.75", + "@types/node": "18.19.83", "@types/request": "2.48.12", "@types/sinon": "9.0.11", "@types/sinon-chai": "3.2.12", @@ -139,7 +139,7 @@ "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", - "playwright": "1.50.1", + "playwright": "1.51.1", "postinstall-postinstall": "2.1.0", "prettier": "2.8.8", "protractor": "5.4.2", @@ -158,7 +158,7 @@ "typedoc": "0.16.11", "typescript": "5.5.4", "watch": "1.0.2", - "webpack": "5.97.1", + "webpack": "5.98.0", "yargs": "17.7.2" } } diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index af1a6f3016c..f9c3b4de919 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -62,7 +62,7 @@ "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", - "selenium-webdriver": "4.28.1", + "selenium-webdriver": "4.30.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/auth/package.json b/packages/auth/package.json index a593797386b..d9a45319151 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -140,7 +140,7 @@ "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-typescript2": "0.36.0", - "selenium-webdriver": "4.28.1", + "selenium-webdriver": "4.30.0", "totp-generator": "0.0.14", "typescript": "5.5.4" }, diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 64c2ea05f05..86d0d9121f2 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -112,7 +112,6 @@ "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", - "@types/json-stable-stringify": "1.1.0", "chai-exclude": "2.1.1", "json-stable-stringify": "1.2.1", "protobufjs": "7.4.0", diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 42d3eb2a8df..961620142a0 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -19,7 +19,7 @@ "dependencies": { "@changesets/types": "6.1.0", "@changesets/get-github-info": "0.6.0", - "@types/node": "18.19.75" + "@types/node": "18.19.83" }, "license": "Apache-2.0", "devDependencies": { diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index ac88adff656..bbea143fed6 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -38,7 +38,7 @@ "terser": "5.37.0", "tmp": "0.2.3", "typescript": "5.5.4", - "webpack": "5.97.1", + "webpack": "5.98.0", "webpack-virtual-modules": "0.6.2", "yargs": "17.7.2" }, diff --git a/yarn.lock b/yarn.lock index 758bf3f5058..51ede769d03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3082,11 +3082,6 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== -"@types/json-stable-stringify@1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#41393e6b7a9a67221607346af4a79783aeb28aea" - integrity sha512-ESTsHWB72QQq+pjUFIbEz9uSCZppD31YrVkbt2rnUciTYEvcwN6uZIhX5JZeBHqRlFJ41x/7MewCs7E2Qux6Cg== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -3161,10 +3156,10 @@ resolved "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@18.19.75": - version "18.19.75" - resolved "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz#be932799d1ab40779ffd16392a2b2300f81b565d" - integrity sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw== +"@types/node@18.19.83": + version "18.19.83" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.83.tgz#44d302cd09364640bdd45d001bc75e596f7da920" + integrity sha512-D69JeR5SfFS5H6FLbUaS0vE4r1dGhmMBbG4Ed6BNS4wkDK8GZjsdCShT5LCN59vOHEUHnFCY9J4aclXlIphMkA== dependencies: undici-types "~5.26.4" @@ -5138,19 +5133,6 @@ chai-exclude@2.1.1: dependencies: fclone "^1.0.11" -chai@4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" - integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.3" - deep-eql "^4.1.3" - get-func-name "^2.0.2" - loupe "^2.3.6" - pathval "^1.1.1" - type-detect "^4.0.8" - chai@4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz#707e49923afdd9b13a8b0b47d33d732d13812fd8" @@ -5880,11 +5862,6 @@ cookie-store@4.0.0-next.4: resolved "https://registry.npmjs.org/cookie-store/-/cookie-store-4.0.0-next.4.tgz#8b13981bfd93e10e30694e9816928f8c478a326b" integrity sha512-RVcIK13cCiAa+rsxAbFhrIThn1eBcgt9WTyLq539zMafDnhdGb6u/O5JdMTC3/pcJVqqHJmctiWxAYPpwT/fxw== -cookie@0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" - integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== - cookie@0.7.1: version "0.7.1" resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" @@ -7311,43 +7288,6 @@ exponential-backoff@^3.1.1: resolved "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== -express@4.20.0: - version "4.20.0" - resolved "https://registry.npmjs.org/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48" - integrity sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.3" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.6.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~2.0.0" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.3" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.10" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.19.0" - serve-static "1.16.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - express@4.21.2, express@^4.16.4: version "4.21.2" resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" @@ -7646,19 +7586,6 @@ finalhandler@1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - finalhandler@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" @@ -13089,11 +13016,6 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.10: - version "0.1.10" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" - integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== - path-to-regexp@0.1.12: version "0.1.12" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" @@ -13290,17 +13212,17 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -playwright-core@1.50.1: - version "1.50.1" - resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz#6a0484f1f1c939168f40f0ab3828c4a1592c4504" - integrity sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ== +playwright-core@1.51.1: + version "1.51.1" + resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.51.1.tgz#d57f0393e02416f32a47cf82b27533656a8acce1" + integrity sha512-/crRMj8+j/Nq5s8QcvegseuyeZPxpQCZb6HNk3Sos3BlZyAknRjoyJPFWkpNn8v0+P3WiwqFF8P+zQo4eqiNuw== -playwright@1.50.1: - version "1.50.1" - resolved "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz#2f93216511d65404f676395bfb97b41aa052b180" - integrity sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw== +playwright@1.51.1: + version "1.51.1" + resolved "https://registry.npmjs.org/playwright/-/playwright-1.51.1.tgz#ae1467ee318083968ad28d6990db59f47a55390f" + integrity sha512-kkx+MB2KQRkyxjYPc3a0wLZZoDczmppyGJIvQ43l+aZihkaVvmu/21kiyaHeHjiFxjxNNFnUncKmcGIyOojsaw== dependencies: - playwright-core "1.50.1" + playwright-core "1.51.1" optionalDependencies: fsevents "2.3.2" @@ -13641,13 +13563,6 @@ qjobs@^1.2.0: resolved "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qs@6.11.0: - version "6.11.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - qs@6.13.0: version "6.13.0" resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" @@ -14611,7 +14526,17 @@ selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: tmp "0.0.30" xml2js "^0.4.17" -selenium-webdriver@4.28.1, selenium-webdriver@^4.0.0-alpha.7: +selenium-webdriver@4.30.0: + version "4.30.0" + resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.30.0.tgz#f7409ad363d64051a13159226f552af0f5a8d9ba" + integrity sha512-3DGtQI/xyAg05SrqzzpFaXRWYL+Kku3fsikCoBaxApKzhBMUX5UiHdPb2je2qKMf2PjJiEFaj0L5xELHYRbYMA== + dependencies: + "@bazel/runfiles" "^6.3.1" + jszip "^3.10.1" + tmp "^0.2.3" + ws "^8.18.0" + +selenium-webdriver@^4.0.0-alpha.7: version "4.28.1" resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.28.1.tgz#0f6cc4fbc83cee3fdf8b116257656892957b72da" integrity sha512-TwbTpu/NUQkorBODGAkGowJ8sar63bvqi66/tjqhS05rBl34HkVp8DoRg1cOv2iSnNonVSbkxazS3wjbc+NRtg== @@ -14669,25 +14594,6 @@ semver@~7.5.4: dependencies: lru-cache "^6.0.0" -send@0.18.0: - version "0.18.0" - resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - send@0.19.0: version "0.19.0" resolved "https://registry.npmjs.org/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" @@ -14726,16 +14632,6 @@ serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: dependencies: randombytes "^2.1.0" -serve-static@1.16.0: - version "1.16.0" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz#2bf4ed49f8af311b519c46f272bf6ac3baf38a92" - integrity sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - serve-static@1.16.2: version "1.16.2" resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" @@ -14872,7 +14768,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: +side-channel@^1.0.6, side-channel@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -15844,6 +15740,17 @@ terser-webpack-plugin@^5.3.10: serialize-javascript "^6.0.2" terser "^5.31.1" +terser-webpack-plugin@^5.3.11: + version "5.3.14" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" + integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.25" + jest-worker "^27.4.5" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" + terser@5.37.0, terser@^5.17.4, terser@^5.31.1: version "5.37.0" resolved "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" @@ -16963,7 +16870,36 @@ webpack-virtual-modules@0.6.2: resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz#057faa9065c8acf48f24cb57ac0e77739ab9a7e8" integrity sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ== -webpack@5.97.1, webpack@^5: +webpack@5.98.0: + version "5.98.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz#44ae19a8f2ba97537978246072fb89d10d1fbd17" + integrity sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.17.1" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.11" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^4.3.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.11" + watchpack "^2.4.1" + webpack-sources "^3.2.3" + +webpack@^5: version "5.97.1" resolved "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz#972a8320a438b56ff0f1d94ade9e82eac155fa58" integrity sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg== From 4b3498373e007fed8e51400cfd7d4609d298da58 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Mon, 31 Mar 2025 11:31:03 -0700 Subject: [PATCH 154/295] Version Packages (#8878) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/orange-turtles-taste.md | 8 -------- .changeset/red-hornets-peel.md | 5 ----- .changeset/sharp-nails-glow.md | 5 ----- .changeset/tricky-geese-shout.md | 5 ----- integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/CHANGELOG.md | 7 +++++++ packages/auth-compat/package.json | 6 +++--- packages/auth/CHANGELOG.md | 8 ++++++++ packages/auth/package.json | 4 ++-- packages/data-connect/CHANGELOG.md | 6 ++++++ packages/data-connect/package.json | 4 ++-- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 18 ++++++++++++++++++ packages/firebase/package.json | 14 +++++++------- packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 6 +++--- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 4 ++-- packages/storage/package.json | 4 ++-- packages/template/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 ++++++++ packages/vertexai/package.json | 4 ++-- repo-scripts/size-analysis/package.json | 2 +- 43 files changed, 111 insertions(+), 74 deletions(-) delete mode 100644 .changeset/orange-turtles-taste.md delete mode 100644 .changeset/red-hornets-peel.md delete mode 100644 .changeset/sharp-nails-glow.md delete mode 100644 .changeset/tricky-geese-shout.md diff --git a/.changeset/orange-turtles-taste.md b/.changeset/orange-turtles-taste.md deleted file mode 100644 index 2787a280312..00000000000 --- a/.changeset/orange-turtles-taste.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'firebase': minor -'@firebase/auth': minor ---- - -Adding `Persistence.COOKIE` a new persistence method backed by cookies. The -`browserCookiePersistence` implementation is designed to be used in conjunction with middleware that -ensures both your front and backend authentication state remains synchronized. diff --git a/.changeset/red-hornets-peel.md b/.changeset/red-hornets-peel.md deleted file mode 100644 index 1c6eb50df13..00000000000 --- a/.changeset/red-hornets-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Throw an error when initializing models if `appId` is not defined in the given `VertexAI` instance. diff --git a/.changeset/sharp-nails-glow.md b/.changeset/sharp-nails-glow.md deleted file mode 100644 index 68c5e68c39d..00000000000 --- a/.changeset/sharp-nails-glow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/data-connect": patch ---- - -Expose partial errors to the user. diff --git a/.changeset/tricky-geese-shout.md b/.changeset/tricky-geese-shout.md deleted file mode 100644 index a0b70b4405c..00000000000 --- a/.changeset/tricky-geese-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/vertexai': patch ---- - -Label `GroundingAttribution` as deprecated. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index db385ad752e..547862a7b99 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,12 +8,12 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.3", - "@firebase/app-compat": "0.2.52", + "@firebase/app": "0.11.4", + "@firebase/app-compat": "0.2.53", "@firebase/analytics": "0.10.12", "@firebase/analytics-compat": "0.2.18", - "@firebase/auth": "1.9.1", - "@firebase/auth-compat": "0.5.19", + "@firebase/auth": "1.10.0", + "@firebase/auth-compat": "0.5.20", "@firebase/functions": "0.12.3", "@firebase/functions-compat": "0.3.20", "@firebase/messaging": "0.12.17", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index d8f81836d4a..6f0829cc16e 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,7 +14,7 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "@firebase/firestore": "4.7.10" }, "devDependencies": { diff --git a/integration/messaging/package.json b/integration/messaging/package.json index cba9b7ff303..e8dafa3b573 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.5.0", + "firebase": "11.6.0", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.20.0", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ca8656040b5..0dfbb6e431b 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 09cce6f33fe..6b73106cd07 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index a7c2c9346a1..e0c922a311c 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 8e93dcb6903..31d2c734de1 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index bb9c154cc68..35e8bd7fd36 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.53 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.11.4 + ## 0.2.52 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 5a425bdcc99..6437d895d4f 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.52", + "version": "0.2.53", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.13", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 229f3693259..8e1b0766095 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.11.4 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.11.3 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 25931fc07ff..dce420d3b30 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.3", + "version": "0.11.4", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index e34369a8be1..81cb295aabc 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/auth-compat +## 0.5.20 + +### Patch Changes + +- Updated dependencies [[`fb5d422`](https://github.com/firebase/firebase-js-sdk/commit/fb5d4227571e06df128048abf87cbb1da2ace1bc)]: + - @firebase/auth@1.10.0 + ## 0.5.19 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index af1a6f3016c..3810dc5e22f 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.19", + "version": "0.5.20", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.9.1", + "@firebase/auth": "1.10.0", "@firebase/auth-types": "0.13.0", "@firebase/component": "0.6.13", "@firebase/util": "1.11.0", @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 609cc928744..3eb66ffa508 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.10.0 + +### Minor Changes + +- [`fb5d422`](https://github.com/firebase/firebase-js-sdk/commit/fb5d4227571e06df128048abf87cbb1da2ace1bc) [#8839](https://github.com/firebase/firebase-js-sdk/pull/8839) - Adding `Persistence.COOKIE` a new persistence method backed by cookies. The + `browserCookiePersistence` implementation is designed to be used in conjunction with middleware that + ensures both your front and backend authentication state remains synchronized. + ## 1.9.1 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index a593797386b..ec8b8964a9c 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.9.1", + "version": "1.10.0", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 83b4b1c9e19..da401509f5d 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +## 0.3.3 + +### Patch Changes + +- [`edb4001`](https://github.com/firebase/firebase-js-sdk/commit/edb40010bb480806b26f48601b65f4257ffed2df) [#8821](https://github.com/firebase/firebase-js-sdk/pull/8821) - Expose partial errors to the user. + ## 0.3.2 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 5001a68abd4..5b792b1bfe1 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.2", + "version": "0.3.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index faf6cc727ac..4233e735858 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 6c7fcecec8a..2c86f94adbd 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 8cf632f0592..ca4de9bb639 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,23 @@ # firebase +## 11.6.0 + +### Minor Changes + +- [`fb5d422`](https://github.com/firebase/firebase-js-sdk/commit/fb5d4227571e06df128048abf87cbb1da2ace1bc) [#8839](https://github.com/firebase/firebase-js-sdk/pull/8839) - Adding `Persistence.COOKIE` a new persistence method backed by cookies. The + `browserCookiePersistence` implementation is designed to be used in conjunction with middleware that + ensures both your front and backend authentication state remains synchronized. + +### Patch Changes + +- Updated dependencies [[`fb5d422`](https://github.com/firebase/firebase-js-sdk/commit/fb5d4227571e06df128048abf87cbb1da2ace1bc), [`648de84`](https://github.com/firebase/firebase-js-sdk/commit/648de84b05c827d33d6b22aceb6eff01208ebdf0), [`edb4001`](https://github.com/firebase/firebase-js-sdk/commit/edb40010bb480806b26f48601b65f4257ffed2df), [`faaeb48`](https://github.com/firebase/firebase-js-sdk/commit/faaeb48e0c9dfddd014e5fb52088d39c895e9874)]: + - @firebase/app@0.11.4 + - @firebase/auth@1.10.0 + - @firebase/vertexai@1.2.1 + - @firebase/data-connect@0.3.3 + - @firebase/app-compat@0.2.53 + - @firebase/auth-compat@0.5.20 + ## 11.5.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 34a28a22ff2..0a108875770 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.5.0", + "version": "11.6.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,12 +399,12 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.3", - "@firebase/app-compat": "0.2.52", + "@firebase/app": "0.11.4", + "@firebase/app-compat": "0.2.53", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.9.1", - "@firebase/auth-compat": "0.5.19", - "@firebase/data-connect": "0.3.2", + "@firebase/auth": "1.10.0", + "@firebase/auth-compat": "0.5.20", + "@firebase/data-connect": "0.3.3", "@firebase/database": "1.0.14", "@firebase/database-compat": "2.0.5", "@firebase/firestore": "4.7.10", @@ -426,7 +426,7 @@ "@firebase/app-check": "0.8.13", "@firebase/app-check-compat": "0.3.20", "@firebase/util": "1.11.0", - "@firebase/vertexai": "1.2.0" + "@firebase/vertexai": "1.2.1" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index dfc7f2eec67..35415667824 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -53,7 +53,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 64c2ea05f05..9c60d5d0d9f 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -106,9 +106,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.3", - "@firebase/app-compat": "0.2.52", - "@firebase/auth": "1.9.1", + "@firebase/app": "0.11.4", + "@firebase/app-compat": "0.2.53", + "@firebase/auth": "1.10.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 42586d56262..5fe4e7e85ce 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 9ff38c070c8..477fd599ac0 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index d6cc85dcd22..1814656c070 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index a6d0f1ca70b..cf367ff7954 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index d0dd25e9533..5e02d85a7d4 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", + "@firebase/app-compat": "0.2.53", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index a2b61d6897e..93300081e57 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 9b26ccb1bcd..ea04ce4dda3 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.52" + "@firebase/app-compat": "0.2.53" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index d74ca5e99a0..0fca12f70f9 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index bcc00d572ea..2e840c85238 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.52" + "@firebase/app-compat": "0.2.53" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index e5abdc9b902..e0252a59bca 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index d73fbe4c7e8..1380b70185b 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,8 +44,8 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.52", - "@firebase/auth-compat": "0.5.19", + "@firebase/app-compat": "0.2.53", + "@firebase/auth-compat": "0.5.20", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 5fc360641bb..57b58d0dda3 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,8 +54,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.3", - "@firebase/auth": "1.9.1", + "@firebase/app": "0.11.4", + "@firebase/auth": "1.10.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index bffd2b64e97..e9f19f330e2 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 07d13335303..3e1a1f3c326 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.2.1 + +### Patch Changes + +- [`648de84`](https://github.com/firebase/firebase-js-sdk/commit/648de84b05c827d33d6b22aceb6eff01208ebdf0) [#8809](https://github.com/firebase/firebase-js-sdk/pull/8809) - Throw an error when initializing models if `appId` is not defined in the given `VertexAI` instance. + +- [`faaeb48`](https://github.com/firebase/firebase-js-sdk/commit/faaeb48e0c9dfddd014e5fb52088d39c895e9874) [#8832](https://github.com/firebase/firebase-js-sdk/pull/8832) - Label `GroundingAttribution` as deprecated. + ## 1.2.0 ### Minor Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 20c21a2bfea..9faf562a535 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.2.0", + "version": "1.2.1", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index ac88adff656..46e555990fa 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.3", + "@firebase/app": "0.11.4", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.0", "@rollup/plugin-commonjs": "21.1.0", From 88a8055808bdbd1c75011a94d11062460027d931 Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Tue, 1 Apr 2025 16:07:46 -0400 Subject: [PATCH 155/295] Fix 'window is not defined' error when calling clearIndexedDbPersistence --- .changeset/gentle-rocks-repeat.md | 6 ++++++ packages/firestore/externs.json | 1 + packages/firestore/src/local/simple_db.ts | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/gentle-rocks-repeat.md diff --git a/.changeset/gentle-rocks-repeat.md b/.changeset/gentle-rocks-repeat.md new file mode 100644 index 00000000000..462e36659b8 --- /dev/null +++ b/.changeset/gentle-rocks-repeat.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Fix 'window is not defined' error when calling `clearIndexedDbPersistence` from a service worker diff --git a/packages/firestore/externs.json b/packages/firestore/externs.json index f7fbbabeb14..03d19ee8e83 100644 --- a/packages/firestore/externs.json +++ b/packages/firestore/externs.json @@ -31,6 +31,7 @@ "packages/util/dist/src/emulator.d.ts", "packages/util/dist/src/environment.d.ts", "packages/util/dist/src/compat.d.ts", + "packages/util/dist/src/global.d.ts", "packages/util/dist/src/obj.d.ts", "packages/firestore/src/protos/firestore_bundle_proto.ts", "packages/firestore/src/protos/firestore_proto_api.ts", diff --git a/packages/firestore/src/local/simple_db.ts b/packages/firestore/src/local/simple_db.ts index 3327f66acb7..6d27702e725 100644 --- a/packages/firestore/src/local/simple_db.ts +++ b/packages/firestore/src/local/simple_db.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { getUA, isIndexedDBAvailable } from '@firebase/util'; +import { getGlobal, getUA, isIndexedDBAvailable } from '@firebase/util'; import { debugAssert } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; @@ -24,7 +24,7 @@ import { Deferred } from '../util/promise'; import { PersistencePromise } from './persistence_promise'; -// References to `window` are guarded by SimpleDb.isAvailable() +// References to `indexedDB` are guarded by SimpleDb.isAvailable() and getGlobal() /* eslint-disable no-restricted-globals */ const LOG_TAG = 'SimpleDb'; @@ -164,7 +164,10 @@ export class SimpleDb { /** Deletes the specified database. */ static delete(name: string): Promise { logDebug(LOG_TAG, 'Removing database:', name); - return wrapRequest(window.indexedDB.deleteDatabase(name)).toPromise(); + const globals = getGlobal(); + return wrapRequest( + globals.indexedDB.deleteDatabase(name) + ).toPromise(); } /** Returns true if IndexedDB is available in the current environment. */ From 1df3d26fbfb4db24b74d5d779825017e9ec40eaa Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Fri, 4 Apr 2025 11:55:48 -0700 Subject: [PATCH 156/295] Fix Data Connect Types (#8898) --- .changeset/hungry-snails-drive.md | 5 +++++ common/api-review/data-connect.api.md | 18 +++++++++++++++++- packages/data-connect/src/api/index.ts | 1 + packages/data-connect/src/core/error.ts | 1 - 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .changeset/hungry-snails-drive.md diff --git a/.changeset/hungry-snails-drive.md b/.changeset/hungry-snails-drive.md new file mode 100644 index 00000000000..1a29782a04d --- /dev/null +++ b/.changeset/hungry-snails-drive.md @@ -0,0 +1,5 @@ +--- +"@firebase/data-connect": patch +--- + +Fix DataConnectOperationError. diff --git a/common/api-review/data-connect.api.md b/common/api-review/data-connect.api.md index 786714361af..9e3d2424876 100644 --- a/common/api-review/data-connect.api.md +++ b/common/api-review/data-connect.api.md @@ -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; @@ -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'; diff --git a/packages/data-connect/src/api/index.ts b/packages/data-connect/src/api/index.ts index dcd48485571..72ee8b313e5 100644 --- a/packages/data-connect/src/api/index.ts +++ b/packages/data-connect/src/api/index.ts @@ -24,6 +24,7 @@ export { setLogLevel } from '../logger'; export { validateArgs } from '../util/validateArgs'; export { DataConnectErrorCode, + Code, DataConnectError, DataConnectOperationError, DataConnectOperationFailureResponse, diff --git a/packages/data-connect/src/core/error.ts b/packages/data-connect/src/core/error.ts index b1246969e48..bbf1e299e0d 100644 --- a/packages/data-connect/src/core/error.ts +++ b/packages/data-connect/src/core/error.ts @@ -43,7 +43,6 @@ export class DataConnectError extends FirebaseError { /** @internal */ readonly name: string = 'DataConnectError'; - /** @hideconstructor */ constructor(code: Code, message: string) { super(code, message); From 609d0828ad5372253e976f0149a08f6ddfed9e7a Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:03:53 -0600 Subject: [PATCH 157/295] Pipeline and test cleanup --- packages/firestore/src/core/pipeline-util.ts | 8 +- .../firestore/src/lite-api/expressions.ts | 2 +- .../test/integration/api/pipeline.test.ts | 10 +- .../integration/api/query_to_pipeline.test.ts | 8 +- packages/firestore/test/lite/pipeline.test.ts | 1277 +++++++++-------- 5 files changed, 724 insertions(+), 581 deletions(-) diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 10f0cb47da6..ec25e258834 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -255,8 +255,8 @@ function whereConditionsFromCursor( const cursors = bound.position.map(value => Constant._fromProto(value)); const size = cursors.length; - let field = orderings[size-1].expr; - let value = cursors[size-1]; + let field = orderings[size - 1].expr; + let value = cursors[size - 1]; // Add condition for last bound let condition: BooleanExpr = filterFunc(field, value); @@ -275,9 +275,7 @@ function whereConditionsFromCursor( // For each field in the orderings, the condition is either // a) lt|gt the cursor value, // b) or equal the cursor value and lt|gt the cursor values for other fields - condition = or( - filterFunc(field, value), - and(field.eq(value), condition)); + condition = or(filterFunc(field, value), and(field.eq(value), condition)); } return condition; diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 6eaebf2c4f0..43e44b7577d 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -2247,7 +2247,7 @@ export function field(nameOrPath: string | FieldPath): Field { if (DOCUMENT_KEY_NAME === nameOrPath) { return new Field(documentIdFieldPath()._internalPath); } - return new Field(fieldPathFromArgument('of', nameOrPath)); + return new Field(fieldPathFromArgument('field', nameOrPath)); } else { return new Field(nameOrPath._internalPath); } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 7fc26ce58cd..f8a5cc28bce 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -53,7 +53,8 @@ import { collection, documentId as documentIdFieldPath, writeBatch, - addDoc + addDoc, + increment } from '../util/firebase_export'; import { apiDescribe, withTestCollection, itIf } from '../util/helpers'; import { @@ -144,8 +145,9 @@ use(chaiAsPromised); setLogLevel('debug'); const testUnsupportedFeatures = false; +const timestampDeltaMS = 1000; -apiDescribe.only('Pipelines', persistence => { +apiDescribe('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; @@ -153,8 +155,6 @@ apiDescribe.only('Pipelines', persistence => { let beginDocCreation: number = 0; let endDocCreation: number = 0; - const timestampDeltaMS = 1000; - async function testCollectionWithDocs(docs: { [id: string]: DocumentData; }): Promise> { @@ -2388,7 +2388,7 @@ apiDescribe.only('Pipelines', persistence => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select( + .addFields( map({ foo: 'bar' }).as('metadata') diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index 8eac50a5afa..a0ad0e93bc9 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -59,7 +59,7 @@ const testUnsupportedFeatures = false; // This is the Query integration tests from the lite API (no cache support) // with some additional test cases added for more complete coverage. -apiDescribe.only('Query to Pipeline', persistence => { +apiDescribe('Query to Pipeline', persistence => { addEqualityMatcher(); function verifyResults( @@ -632,7 +632,8 @@ apiDescribe.only('Query to Pipeline', persistence => { PERSISTENCE_MODE_UNSPECIFIED, { 1: { foo: 1, bar: NaN }, - 2: { foo: 2, bar: 1 } + 2: { foo: 2, bar: 1 }, + 3: { foo: 3, bar: 'bar' } }, async (collRef, db) => { const query1 = query(collRef, where('bar', '==', NaN)); @@ -647,7 +648,8 @@ apiDescribe.only('Query to Pipeline', persistence => { PERSISTENCE_MODE_UNSPECIFIED, { 1: { foo: 1, bar: NaN }, - 2: { foo: 2, bar: 1 } + 2: { foo: 2, bar: 1 }, + 3: { foo: 3, bar: 'bar' } }, async (collRef, db) => { const query1 = query(collRef, where('bar', '!=', NaN)); diff --git a/packages/firestore/test/lite/pipeline.test.ts b/packages/firestore/test/lite/pipeline.test.ts index e3e5083a811..cedc6b4dcf9 100644 --- a/packages/firestore/test/lite/pipeline.test.ts +++ b/packages/firestore/test/lite/pipeline.test.ts @@ -102,12 +102,28 @@ import { descending, FunctionExpr, BooleanExpr, - AggregateFunction + AggregateFunction, + sum, + strConcat, + arrayContainsAll, + arrayLength, + charLength, + divide, + replaceFirst, + replaceAll, + byteLength, + not, + toLower, + toUpper, + trim } from '../../src/lite-api/expressions'; import { documentId as documentIdFieldPath } from '../../src/lite-api/field_path'; import { vector } from '../../src/lite-api/field_value_impl'; import { GeoPoint } from '../../src/lite-api/geo_point'; -import { PipelineSnapshot } from '../../src/lite-api/pipeline-result'; +import { + pipelineResultEqual, + PipelineSnapshot +} from '../../src/lite-api/pipeline-result'; import { execute } from '../../src/lite-api/pipeline_impl'; import { DocumentData, @@ -119,6 +135,7 @@ import { addDoc, setDoc } from '../../src/lite-api/reference_impl'; import { FindNearestOptions } from '../../src/lite-api/stage'; import { Timestamp } from '../../src/lite-api/timestamp'; import { writeBatch } from '../../src/lite-api/write_batch'; +import { itIf } from '../integration/util/helpers'; import { addEqualityMatcher } from '../util/equality_matcher'; import { Deferred } from '../util/promise'; @@ -126,6 +143,9 @@ import { withTestCollection } from './helpers'; use(chaiAsPromised); +const testUnsupportedFeatures = false; +const timestampDeltaMS = 1000; + describe('Firestore Pipelines', () => { addEqualityMatcher(); @@ -318,8 +338,12 @@ describe('Firestore Pipelines', () => { expect(snapshot.results.length).to.equal(0); }); - it('full snapshot as expected', async () => { - const ppl = firestore.pipeline().collection(randomCol.path); + // Skipping because __name__ is not currently working in DBE + itIf(testUnsupportedFeatures)('full snapshot as expected', async () => { + const ppl = firestore + .pipeline() + .collection(randomCol.path) + .sort(ascending('__name__')); const snapshot = await execute(ppl); expect(snapshot.results.length).to.equal(10); expect(snapshot.pipeline).to.equal(ppl); @@ -338,6 +362,20 @@ describe('Firestore Pipelines', () => { ); }); + it('result equals works', async () => { + const ppl = firestore + .pipeline() + .collection(randomCol.path) + .sort(ascending('title')) + .limit(1); + const snapshot1 = await execute(ppl); + const snapshot2 = await execute(ppl); + expect(snapshot1.results.length).to.equal(1); + expect(snapshot2.results.length).to.equal(1); + expect(pipelineResultEqual(snapshot1.results[0], snapshot2.results[0])).to + .be.true; + }); + it('returns execution time', async () => { const start = new Date().valueOf(); const pipeline = firestore.pipeline().collection(randomCol.path); @@ -347,11 +385,11 @@ describe('Firestore Pipelines', () => { expect(snapshot.executionTime.toDate().valueOf()).to.approximately( (start + end) / 2, - end - start + timestampDeltaMS ); }); - it('returns execution time for an empty query', async () => { + it.only('returns execution time for an empty query', async () => { const start = new Date().valueOf(); const pipeline = firestore.pipeline().collection(randomCol.path).limit(0); @@ -362,7 +400,7 @@ describe('Firestore Pipelines', () => { expect(snapshot.executionTime.toDate().valueOf()).to.approximately( (start + end) / 2, - end - start + timestampDeltaMS ); }); @@ -377,11 +415,11 @@ describe('Firestore Pipelines', () => { expect(doc.createTime!.toDate().valueOf()).to.approximately( (beginDocCreation + endDocCreation) / 2, - endDocCreation - beginDocCreation + timestampDeltaMS ); expect(doc.updateTime!.toDate().valueOf()).to.approximately( (beginDocCreation + endDocCreation) / 2, - endDocCreation - beginDocCreation + timestampDeltaMS ); expect(doc.createTime?.valueOf()).to.equal(doc.updateTime?.valueOf()); }); @@ -417,7 +455,7 @@ describe('Firestore Pipelines', () => { expect(snapshot.executionTime.toDate().valueOf()).to.approximately( (start + end) / 2, - end - start + timestampDeltaMS ); }); @@ -484,26 +522,31 @@ describe('Firestore Pipelines', () => { await terminate(db2); }); - it('supports collection group as source', async () => { - const randomSubCollectionId = Math.random().toString(16).slice(2); - const doc1 = await addDoc( - collection(randomCol, 'book1', randomSubCollectionId), - { order: 1 } - ); - const doc2 = await addDoc( - collection(randomCol, 'book2', randomSubCollectionId), - { order: 2 } - ); - const snapshot = await execute( - firestore - .pipeline() - .collectionGroup(randomSubCollectionId) - .sort(ascending('order')) - ); - expectResults(snapshot, doc1.id, doc2.id); - }); + // Subcollections not currently supported in DBE + itIf(testUnsupportedFeatures)( + 'supports collection group as source', + async () => { + const randomSubCollectionId = Math.random().toString(16).slice(2); + const doc1 = await addDoc( + collection(randomCol, 'book1', randomSubCollectionId), + { order: 1 } + ); + const doc2 = await addDoc( + collection(randomCol, 'book2', randomSubCollectionId), + { order: 2 } + ); + const snapshot = await execute( + firestore + .pipeline() + .collectionGroup(randomSubCollectionId) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + } + ); - it('supports database as source', async () => { + // subcollections not currently supported in dbe + itIf(testUnsupportedFeatures)('supports database as source', async () => { const randomId = Math.random().toString(16).slice(2); const doc1 = await addDoc(collection(randomCol, 'book1', 'sub'), { order: 1, @@ -646,11 +689,11 @@ describe('Firestore Pipelines', () => { .select( map({ 'number': 1, - 'undefined': array([undefined]) + undefined }).as('foo') ); }).to.throw( - 'Function constant() called with invalid data. Unsupported field value: undefined' + 'Function map() called with invalid data. Unsupported field value: undefined' ); }); @@ -662,7 +705,7 @@ describe('Firestore Pipelines', () => { .limit(1) .select(array([1, undefined]).as('foo')); }).to.throw( - 'Function constant() called with invalid data. Unsupported field value: undefined' + 'Function array() called with invalid data. Unsupported field value: undefined' ); }); @@ -777,10 +820,16 @@ describe('Firestore Pipelines', () => { .aggregate( countAll().as('count'), avg('rating').as('avgRating'), - field('rating').maximum().as('maxRating') + maximum('rating').as('maxRating'), + sum('rating').as('sumRating') ) ); - expectResults(snapshot, { count: 2, avgRating: 4.4, maxRating: 4.6 }); + expectResults(snapshot, { + count: 2, + avgRating: 4.4, + maxRating: 4.6, + sumRating: 8.8 + }); }); it('rejects groups without accumulators', async () => { @@ -1054,14 +1103,15 @@ describe('Firestore Pipelines', () => { eq('genre', 'Fantasy') ) ) + .sort(ascending('title')) .select('title') ); expectResults( snapshot, + { title: '1984' }, { title: 'Pride and Prejudice' }, - { title: 'The Lord of the Rings' }, { title: "The Handmaid's Tale" }, - { title: '1984' } + { title: 'The Lord of the Rings' } ); }); @@ -1127,10 +1177,10 @@ describe('Firestore Pipelines', () => { .limit(1) ); expectResults(snapshot, { - title: "The Hitchhiker's Guide to the Galaxy", metadata: { - author: 'Douglas Adams' - } + author: 'Frank Herbert' + }, + title: 'Dune' }); }); @@ -1144,7 +1194,7 @@ describe('Firestore Pipelines', () => { .select('title', 'author') .genericStage('add_fields', [ { - display: field('title').strConcat(' - ', field('author')) + display: strConcat('title', ' - ', field('author')) } ]) ); @@ -1242,8 +1292,8 @@ describe('Firestore Pipelines', () => { }); }); - describe('replace stage', () => { - it('run pipleine with replace', async () => { + describe('replaceWith stage', () => { + it('run pipeline with replaceWith field name', async () => { const snapshot = await execute( firestore .pipeline() @@ -1257,6 +1307,27 @@ describe('Firestore Pipelines', () => { others: { unknown: { year: 1980 } } }); }); + + it('run pipeline with replaceWith Expr result', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .replaceWith( + map({ + foo: 'bar', + baz: { + title: field('title') + } + }) + ) + ); + expectResults(snapshot, { + foo: 'bar', + baz: { title: "The Hitchhiker's Guide to the Galaxy" } + }); + }); }); describe('sample stage', () => { @@ -1296,7 +1367,8 @@ describe('Firestore Pipelines', () => { }); describe('union stage', () => { - it('run pipeline with union', async () => { + // __name__ not currently supported by dbe + itIf(testUnsupportedFeatures)('run pipeline with union', async () => { const snapshot = await execute( firestore .pipeline() @@ -1608,6 +1680,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where(eqAny('published', [1979, 1999, 1967])) + .sort(descending('title')) .select('title') ); expectResults( @@ -1652,6 +1725,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where(arrayContainsAny('tags', ['comedy', 'classic'])) + .sort(descending('title')) .select('title') ); expectResults( @@ -1666,7 +1740,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(field('tags').arrayContainsAll(['adventure', 'magic'])) + .where(arrayContainsAll('tags', ['adventure', 'magic'])) .select('title') ); expectResults(snapshot, { title: 'The Lord of the Rings' }); @@ -1677,7 +1751,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .select(field('tags').arrayLength().as('tagsCount')) + .select(arrayLength('tags').as('tagsCount')) .where(eq('tagsCount', 3)) ); expect(snapshot.results.length).to.equal(10); @@ -1688,6 +1762,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) + .sort(ascending('author')) .select( field('author').strConcat(' - ', field('title')).as('bookInfo') ) @@ -1753,7 +1828,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .select(field('title').charLength().as('titleLength'), field('title')) + .select(charLength('title').as('titleLength'), field('title')) .where(gt('titleLength', 20)) .sort(field('title').ascending()) ); @@ -1818,11 +1893,12 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) + .where(eq('title', 'To Kill a Mockingbird')) .select( add(field('rating'), 1).as('ratingPlusOne'), subtract(field('published'), 1900).as('yearsSince1900'), field('rating').multiply(10).as('ratingTimesTen'), - field('rating').divide(2).as('ratingDividedByTwo'), + divide('rating', 2).as('ratingDividedByTwo'), multiply('rating', 10, 2).as('ratingTimes20'), add('rating', 1, 2).as('ratingPlus3'), mod('rating', 2).as('ratingMod2') @@ -1831,12 +1907,12 @@ describe('Firestore Pipelines', () => { ); expectResults(snapshot, { ratingPlusOne: 5.2, - yearsSince1900: 79, + yearsSince1900: 60, ratingTimesTen: 42, ratingDividedByTwo: 2.1, ratingTimes20: 84, ratingPlus3: 7.2, - ratingMod2: 0.2 + ratingMod2: 0.20000000000000018 }); }); @@ -1888,7 +1964,7 @@ describe('Firestore Pipelines', () => { ); }); - it('testChecks', async () => { + it.only('testChecks', async () => { let snapshot = await execute( firestore .pipeline() @@ -1906,7 +1982,7 @@ describe('Firestore Pipelines', () => { isNotNull('title').as('titleIsNotNull'), isNotNan('cost').as('costIsNotNan'), exists('fooBarBaz').as('fooBarBazExists'), - field('title').as('titleExists') + field('title').exists().as('titleExists') ) ); expectResults(snapshot, { @@ -2045,6 +2121,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where(eq('awards.hugo', true)) + .sort(descending('title')) .select('title', 'awards.hugo') ); expectResults( @@ -2068,6 +2145,7 @@ describe('Firestore Pipelines', () => { field('nestedField.level.1'), mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') ) + .sort(descending('title')) ); expectResults( snapshot, @@ -2179,417 +2257,112 @@ describe('Firestore Pipelines', () => { }); }); - describe('not implemented in backend', () => { - it('supports Bit_and', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitAnd(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 4 - }); - }); + itIf(testUnsupportedFeatures)('testReplaceFirst', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', 'The Lord of the Rings')) + .limit(1) + .select(replaceFirst('title', 'o', '0').as('newName')) + ); + expectResults(snapshot, { newName: 'The L0rd of the Rings' }); + }); - it('supports Bit_and', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitAnd(12).as('result')) - ); - expectResults(snapshot, { - result: 4 - }); - }); + itIf(testUnsupportedFeatures)('testReplaceAll', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', 'The Lord of the Rings')) + .limit(1) + .select(replaceAll('title', 'o', '0').as('newName')) + ); + expectResults(snapshot, { newName: 'The L0rd 0f the Rings' }); + }); - it('supports Bit_or', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitOr(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 13 - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitOr(12).as('result')) - ); - expectResults(snapshot, { - result: 13 - }); + it('supports Rand', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(10) + .select(rand().as('result')) + ); + expect(snapshot.results.length).to.equal(10); + snapshot.results.forEach(d => { + expect(d.get('result')).to.be.lt(1); + expect(d.get('result')).to.be.gte(0); }); + }); - it('supports Bit_xor', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitXor(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 9 - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitXor(12).as('result')) - ); - expectResults(snapshot, { - result: 9 - }); + it('supports array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(array([1, 2, 3, 4]).as('metadata')) + ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 3, 4] }); + }); - it('supports Bit_not', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( - 'result' - ) - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) - .bitNot() - .as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) - }); + it('evaluates expression in array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select( + array([1, 2, field('genre'), multiply('rating', 10)]).as('metadata') + ) + ); + expect(snapshot.results.length).to.equal(1); + expectResults(snapshot, { + metadata: [1, 2, 'Fantasy', 47] }); + }); - it('supports Bit_left_shift', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - bitLeftShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitLeftShift(2) - .as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); - }); + it('supports arrayOffset', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(arrayOffset('tags', 0).as('firstTag')) + ); + const expectedResults = [ + { + firstTag: 'adventure' + }, + { + firstTag: 'politics' + }, + { + firstTag: 'classic' + } + ]; + expectResults(snapshot, ...expectedResults); - it('supports Bit_right_shift', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - bitRightShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitRightShift(2) - .as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) - }); - }); - - it('supports Document_id', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(documentId(field('__path__')).as('docId')) - ); - expectResults(snapshot, { - docId: 'book4' - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(field('__path__').documentId().as('docId')) - ); - expectResults(snapshot, { - docId: 'book4' - }); - }); - - it('supports Substr', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(substr('title', 9, 2).as('of')) - ); - expectResults(snapshot, { - of: 'of' - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(field('title').substr(9, 2).as('of')) - ); - expectResults(snapshot, { - of: 'of' - }); - }); - - it('supports Substr without length', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(substr('title', 9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(field('title').substr(9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - }); - - it('arrayConcat works', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .select( - arrayConcat('tags', ['newTag1', 'newTag2'], field('tags'), [ - null - ]).as('modifiedTags') - ) - .limit(1) - ); - expectResults(snapshot, { - modifiedTags: [ - 'comedy', - 'space', - 'adventure', - 'newTag1', - 'newTag2', - 'comedy', - 'space', - 'adventure', - null - ] - }); - }); - - it('testToLowercase', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .select(field('title').toLower().as('lowercaseTitle')) - .limit(1) - ); - expectResults(snapshot, { - lowercaseTitle: "the hitchhiker's guide to the galaxy" - }); - }); - - it('testToUppercase', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .select(field('author').toUpper().as('uppercaseAuthor')) - .limit(1) - ); - expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); - }); - - it('testTrim', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .addFields( - constant(" The Hitchhiker's Guide to the Galaxy ").as( - 'spacedTitle' - ) - ) - .select( - field('spacedTitle').trim().as('trimmedTitle'), - field('spacedTitle') - ) - .limit(1) - ); - expectResults(snapshot, { - spacedTitle: " The Hitchhiker's Guide to the Galaxy ", - trimmedTitle: "The Hitchhiker's Guide to the Galaxy" - }); - }); - - it('test reverse', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(eq('title', '1984')) - .limit(1) - .select(reverse('title').as('reverseTitle')) - ); - expectResults(snapshot, { title: '4891' }); - }); - }); - - it('supports Rand', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(10) - .select(rand().as('result')) - ); - expect(snapshot.results.length).to.equal(10); - snapshot.results.forEach(d => { - expect(d.get('result')).to.be.lt(1); - expect(d.get('result')).to.be.gte(0); - }); - }); - - it('supports array', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(array([1, 2, 3, 4]).as('metadata')) - ); - expect(snapshot.results.length).to.equal(1); - expectResults(snapshot, { - metadata: [1, 2, 3, 4] - }); - }); - - it('evaluates expression in array', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select( - array([1, 2, field('genre'), multiply('rating', 10)]).as('metadata') - ) - ); - expect(snapshot.results.length).to.equal(1); - expectResults(snapshot, { - metadata: [1, 2, 'Fantasy', 47] - }); - }); - - it('supports arrayOffset', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(3) - .select(arrayOffset('tags', 0).as('firstTag')) - ); - const expectedResults = [ - { - firstTag: 'adventure' - }, - { - firstTag: 'politics' - }, - { - firstTag: 'classic' - } - ]; - expectResults(snapshot, ...expectedResults); - - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(3) - .select(field('tags').arrayOffset(0).as('firstTag')) - ); - expectResults(snapshot, ...expectedResults); - }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(3) + .select(field('tags').arrayOffset(0).as('firstTag')) + ); + expectResults(snapshot, ...expectedResults); + }); // TODO: current_context tests with are failing because of b/395937453 - it('supports currentContext', async () => { + itIf(testUnsupportedFeatures)('supports currentContext', async () => { const snapshot = await execute( firestore .pipeline() @@ -2773,147 +2546,517 @@ describe('Firestore Pipelines', () => { minus10millis: new Timestamp(1741380234, 990000000) }); }); - }); - describe('pagination', () => { - /** - * Adds several books to the test collection. These - * additional books support pagination test scenarios - * that would otherwise not be possible with the original - * set of books. - * @param collectionReference - */ - async function addBooks( - collectionReference: CollectionReference - ): Promise { - await setDoc(doc(collectionReference, 'book11'), { - title: 'Jonathan Strange & Mr Norrell', - author: 'Susanna Clarke', - genre: 'Fantasy', - published: 2004, - rating: 4.6, - tags: ['historical fantasy', 'magic', 'alternate history', 'england'], - awards: { hugo: false, nebula: false } - }); - await setDoc(doc(collectionReference, 'book12'), { - title: 'The Master and Margarita', - author: 'Mikhail Bulgakov', - genre: 'Satire', - published: 1967, // Though written much earlier - rating: 4.6, - tags: [ - 'russian literature', - 'supernatural', - 'philosophy', - 'dark comedy' - ], - awards: {} - }); - await setDoc(doc(collectionReference, 'book13'), { - title: 'A Long Way to a Small, Angry Planet', - author: 'Becky Chambers', - genre: 'Science Fiction', - published: 2014, - rating: 4.6, - tags: ['space opera', 'found family', 'character-driven', 'optimistic'], - awards: { hugo: false, nebula: false, kitschies: true } - }); - } + it('supports byteLength', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .limit(1) + .select( + constant( + Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) + ).as('bytes') + ) + .select(byteLength('bytes').as('byteLength')) + ); - it('supports pagination with filters', async () => { - await addBooks(randomCol); - const pageSize = 2; - const pipeline = firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'rating', '__name__') - .sort(field('rating').descending(), field('__name__').ascending()); + expectResults(snapshot, { + byteLength: 8 + }); + }); - let snapshot = await execute(pipeline.limit(pageSize)); - expectResults( - snapshot, - { title: 'The Lord of the Rings', rating: 4.7 }, - { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } + it('supports not', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .limit(1) + .select(constant(true).as('trueField')) + .select('trueField', not(eq('trueField', true)).as('falseField')) ); - const lastDoc = snapshot.results[snapshot.results.length - 1]; + expectResults(snapshot, { + trueField: true, + falseField: false + }); + }); + }); - snapshot = await execute( - pipeline - .where( - or( - and( - field('rating').eq(lastDoc.get('rating')), - field('__path__').gt(lastDoc.ref?.id) - ), - field('rating').lt(lastDoc.get('rating')) - ) - ) - .limit(pageSize) + describe('not yet implemented in backend', () => { + itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitAnd(constant(5), 12).as('result')) ); - expectResults( - snapshot, - { title: 'Pride and Prejudice', rating: 4.5 }, - { title: 'Crime and Punishment', rating: 4.3 } + expectResults(snapshot, { + result: 4 + }); + }); + + itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitAnd(12).as('result')) ); + expectResults(snapshot, { + result: 4 + }); }); - it('supports pagination with offsets', async () => { - await addBooks(randomCol); + itIf(testUnsupportedFeatures)('supports Bit_or', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitOr(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitOr(12).as('result')) + ); + expectResults(snapshot, { + result: 13 + }); + }); - const secondFilterField = '__name__'; + itIf(testUnsupportedFeatures)('supports Bit_xor', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(bitXor(constant(5), 12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(constant(5).bitXor(12).as('result')) + ); + expectResults(snapshot, { + result: 9 + }); + }); - const pipeline = firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'rating', secondFilterField) - .sort( - field('rating').descending(), - field(secondFilterField).ascending() - ); + itIf(testUnsupportedFeatures)('supports Bit_not', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( + 'result' + ) + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) + .bitNot() + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + }); + }); - const pageSize = 2; - let currPage = 0; + itIf(testUnsupportedFeatures)('supports Bit_left_shift', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitLeftShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitLeftShift(2) + .as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x04)) + }); + }); + itIf(testUnsupportedFeatures)('supports Bit_right_shift', async () => { let snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + bitRightShift( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), + 2 + ).as('result') + ) + ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) + .bitRightShift(2) + .as('result') + ) ); + expectResults(snapshot, { + result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + }); + }); - expectResults( - snapshot, - { - title: 'The Lord of the Rings', - rating: 4.7 - }, - { title: 'Dune', rating: 4.6 } + itIf(testUnsupportedFeatures)('supports Document_id', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(documentId(field('__path__')).as('docId')) + ); + expectResults(snapshot, { + docId: 'book4' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('__path__').documentId().as('docId')) ); + expectResults(snapshot, { + docId: 'book4' + }); + }); + itIf(testUnsupportedFeatures)('supports Substr', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9, 2).as('of')) + ); + expectResults(snapshot, { + of: 'of' + }); snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9, 2).as('of')) ); - expectResults( - snapshot, - { - title: 'Jonathan Strange & Mr Norrell', - rating: 4.6 - }, - { title: 'The Master and Margarita', rating: 4.6 } + expectResults(snapshot, { + of: 'of' + }); + }); + + itIf(testUnsupportedFeatures)( + 'supports Substr without length', + async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(substr('title', 9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substr(9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' + }); + } + ); + + itIf(testUnsupportedFeatures)('arrayConcat works', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select( + arrayConcat('tags', ['newTag1', 'newTag2'], field('tags'), [ + null + ]).as('modifiedTags') + ) + .limit(1) ); + expectResults(snapshot, { + modifiedTags: [ + 'comedy', + 'space', + 'adventure', + 'newTag1', + 'newTag2', + 'comedy', + 'space', + 'adventure', + null + ] + }); + }); - snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) + itIf(testUnsupportedFeatures)('testToLowercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(toLower('title').as('lowercaseTitle')) + .limit(1) ); - expectResults( - snapshot, - { - title: 'A Long Way to a Small, Angry Planet', - rating: 4.6 - }, - { - title: 'Pride and Prejudice', - rating: 4.5 - } + expectResults(snapshot, { + lowercaseTitle: "the hitchhiker's guide to the galaxy" + }); + }); + + itIf(testUnsupportedFeatures)('testToUppercase', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(toUpper('author').as('uppercaseAuthor')) + .limit(1) + ); + expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + }); + + itIf(testUnsupportedFeatures)('testTrim', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .addFields( + constant(" The Hitchhiker's Guide to the Galaxy ").as('spacedTitle') + ) + .select(trim('spacedTitle').as('trimmedTitle'), field('spacedTitle')) + .limit(1) ); + expectResults(snapshot, { + spacedTitle: " The Hitchhiker's Guide to the Galaxy ", + trimmedTitle: "The Hitchhiker's Guide to the Galaxy" + }); }); + + itIf(testUnsupportedFeatures)('test reverse', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(eq('title', '1984')) + .limit(1) + .select(reverse('title').as('reverseTitle')) + ); + expectResults(snapshot, { title: '4891' }); + }); + }); + + describe('pagination', () => { + /** + * Adds several books to the test collection. These + * additional books support pagination test scenarios + * that would otherwise not be possible with the original + * set of books. + * @param collectionReference + */ + async function addBooks( + collectionReference: CollectionReference + ): Promise { + await setDoc(doc(collectionReference, 'book11'), { + title: 'Jonathan Strange & Mr Norrell', + author: 'Susanna Clarke', + genre: 'Fantasy', + published: 2004, + rating: 4.6, + tags: ['historical fantasy', 'magic', 'alternate history', 'england'], + awards: { hugo: false, nebula: false } + }); + await setDoc(doc(collectionReference, 'book12'), { + title: 'The Master and Margarita', + author: 'Mikhail Bulgakov', + genre: 'Satire', + published: 1967, // Though written much earlier + rating: 4.6, + tags: [ + 'russian literature', + 'supernatural', + 'philosophy', + 'dark comedy' + ], + awards: {} + }); + await setDoc(doc(collectionReference, 'book13'), { + title: 'A Long Way to a Small, Angry Planet', + author: 'Becky Chambers', + genre: 'Science Fiction', + published: 2014, + rating: 4.6, + tags: ['space opera', 'found family', 'character-driven', 'optimistic'], + awards: { hugo: false, nebula: false, kitschies: true } + }); + } + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports pagination with filters', + async () => { + await addBooks(randomCol); + const pageSize = 2; + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', '__name__') + .sort(field('rating').descending(), field('__name__').ascending()); + + let snapshot = await execute(pipeline.limit(pageSize)); + expectResults( + snapshot, + { title: 'The Lord of the Rings', rating: 4.7 }, + { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } + ); + + const lastDoc = snapshot.results[snapshot.results.length - 1]; + + snapshot = await execute( + pipeline + .where( + or( + and( + field('rating').eq(lastDoc.get('rating')), + field('__path__').gt(lastDoc.ref?.id) + ), + field('rating').lt(lastDoc.get('rating')) + ) + ) + .limit(pageSize) + ); + expectResults( + snapshot, + { title: 'Pride and Prejudice', rating: 4.5 }, + { title: 'Crime and Punishment', rating: 4.3 } + ); + } + ); + + // sort on __name__ is not working + itIf(testUnsupportedFeatures)( + 'supports pagination with offsets', + async () => { + await addBooks(randomCol); + + const secondFilterField = '__path__'; + + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', secondFilterField) + .sort( + field('rating').descending(), + field(secondFilterField).ascending() + ); + + const pageSize = 2; + let currPage = 0; + + let snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + + expectResults( + snapshot, + { + title: 'The Lord of the Rings', + rating: 4.7 + }, + { title: 'Dune', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'Jonathan Strange & Mr Norrell', + rating: 4.6 + }, + { title: 'The Master and Margarita', rating: 4.6 } + ); + + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'A Long Way to a Small, Angry Planet', + rating: 4.6 + }, + { + title: 'Pride and Prejudice', + rating: 4.5 + } + ); + } + ); }); }); From 66a09f247603519768c6b6a3e1c13732a48781f8 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 8 Apr 2025 13:17:02 -0400 Subject: [PATCH 158/295] test(vertexai): update mock responses to v8 (#8904) --- scripts/update_vertexai_responses.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index 0d1f1a2c6f6..de55ac176ce 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v7.*' # The major version of mock responses to use +RESPONSES_VERSION='v8.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From 3d6bbf36fa0045d7a19d74eea7282717c39dabfb Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:46:31 -0600 Subject: [PATCH 159/295] Test fixes and re-enabling tests for features that were added on backend --- .../firestore/src/lite-api/expressions.ts | 10 -------- .../test/integration/api/pipeline.test.ts | 23 +++---------------- .../integration/api/query_to_pipeline.test.ts | 13 ++++------- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 43e44b7577d..03182ae3227 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -3043,16 +3043,6 @@ export function arrayOffset( return fieldOrExpression(array).arrayOffset(valueToDefaultExpr(offset)); } -/** - * @beta - * Creates an Expr that returns a map of all values in the current expression context. - * - * @return A new {@code Expr} representing the 'current_context' function. - */ -export function currentContext(): FunctionExpr { - return new FunctionExpr('current_context', []); -} - /** * @beta * diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index f8a5cc28bce..61d223fcf13 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -144,7 +144,7 @@ use(chaiAsPromised); setLogLevel('debug'); -const testUnsupportedFeatures = false; +const testUnsupportedFeatures: boolean | 'only' = false; const timestampDeltaMS = 1000; apiDescribe('Pipelines', persistence => { @@ -343,8 +343,7 @@ apiDescribe('Pipelines', persistence => { expect(snapshot.results.length).to.equal(0); }); - // Skipping because __name__ is not currently working in DBE - itIf(testUnsupportedFeatures)('full snapshot as expected', async () => { + it('full snapshot as expected', async () => { const ppl = firestore .pipeline() .collection(randomCol.path) @@ -1372,8 +1371,7 @@ apiDescribe('Pipelines', persistence => { }); describe('union stage', () => { - // __name__ not currently supported by dbe - itIf(testUnsupportedFeatures)('run pipeline with union', async () => { + it('run pipeline with union', async () => { const snapshot = await execute( firestore .pipeline() @@ -2366,21 +2364,6 @@ apiDescribe('Pipelines', persistence => { expectResults(snapshot, ...expectedResults); }); - // TODO: current_context tests with are failing because of b/395937453 - itIf(testUnsupportedFeatures)('supports currentContext', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(currentContext().as('currentContext')) - ); - expectResults(snapshot, { - currentContext: 'TODO' - }); - }); - it('supports map', async () => { const snapshot = await execute( firestore diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index a0ad0e93bc9..7660699b70f 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -55,7 +55,7 @@ use(chaiAsPromised); setLogLevel('debug'); -const testUnsupportedFeatures = false; +const testUnsupportedFeatures: boolean | 'only' = false; // This is the Query integration tests from the lite API (no cache support) // with some additional test cases added for more complete coverage. @@ -247,9 +247,7 @@ apiDescribe('Query to Pipeline', persistence => { ); }); - // sort on __name__ is not working - itIf(testUnsupportedFeatures)( - 'supports startAfter (with DocumentSnapshot)', + it('supports startAfter (with DocumentSnapshot)', () => { return withTestCollection( PERSISTENCE_MODE_UNSPECIFIED, @@ -317,9 +315,7 @@ apiDescribe('Query to Pipeline', persistence => { } ); - // sort on __name__ is not working - itIf(testUnsupportedFeatures)( - 'supports startAt (with DocumentSnapshot)', + it('supports startAt (with DocumentSnapshot)', () => { return withTestCollection( PERSISTENCE_MODE_UNSPECIFIED, @@ -719,8 +715,7 @@ apiDescribe('Query to Pipeline', persistence => { ); }); - // sorting on name required - itIf(testUnsupportedFeatures)('supports array contains any', () => { + it('supports array contains any', () => { return withTestCollection( PERSISTENCE_MODE_UNSPECIFIED, { From 32ee33145ab7100724ea665e5fd223bea7c46b68 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:55:18 -0600 Subject: [PATCH 160/295] Additional test cleanup --- .../test/integration/api/pipeline.test.ts | 4 +- .../integration/api/query_to_pipeline.test.ts | 264 +++++++++--------- 2 files changed, 132 insertions(+), 136 deletions(-) diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 61d223fcf13..47f9d2bbb1f 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -2943,7 +2943,7 @@ apiDescribe('Pipelines', persistence => { }); } - // sort on __name__ is not working + // sort on __name__ is not working, see b/409358591 itIf(testUnsupportedFeatures)( 'supports pagination with filters', async () => { @@ -2985,7 +2985,7 @@ apiDescribe('Pipelines', persistence => { } ); - // sort on __name__ is not working + // sort on __name__ is not working, see b/409358591 itIf(testUnsupportedFeatures)( 'supports pagination with offsets', async () => { diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index 7660699b70f..ac1d2e79007 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -247,143 +247,139 @@ apiDescribe('Query to Pipeline', persistence => { ); }); - it('supports startAfter (with DocumentSnapshot)', - () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { id: 1, foo: 1, bar: 1, baz: 1 }, - 2: { id: 2, foo: 1, bar: 1, baz: 2 }, - 3: { id: 3, foo: 1, bar: 1, baz: 2 }, - 4: { id: 4, foo: 1, bar: 2, baz: 1 }, - 5: { id: 5, foo: 1, bar: 2, baz: 2 }, - 6: { id: 6, foo: 1, bar: 2, baz: 2 }, - 7: { id: 7, foo: 2, bar: 1, baz: 1 }, - 8: { id: 8, foo: 2, bar: 1, baz: 2 }, - 9: { id: 9, foo: 2, bar: 1, baz: 2 }, - 10: { id: 10, foo: 2, bar: 2, baz: 1 }, - 11: { id: 11, foo: 2, bar: 2, baz: 2 }, - 12: { id: 12, foo: 2, bar: 2, baz: 2 } - }, - async (collRef, db) => { - let docRef = await getDoc(doc(collRef, '2')); - let query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAfter(docRef) - ); - let snapshot = await execute(db.pipeline().createFrom(query1)); - verifyResults( - snapshot, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); + it('supports startAfter (with DocumentSnapshot)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + let snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); - docRef = await getDoc(doc(collRef, '3')); - query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAfter(docRef) - ); - snapshot = await execute(db.pipeline().createFrom(query1)); - verifyResults( - snapshot, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - } - ); - } - ); + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAfter(docRef) + ); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } + ); + }); - it('supports startAt (with DocumentSnapshot)', - () => { - return withTestCollection( - PERSISTENCE_MODE_UNSPECIFIED, - { - 1: { id: 1, foo: 1, bar: 1, baz: 1 }, - 2: { id: 2, foo: 1, bar: 1, baz: 2 }, - 3: { id: 3, foo: 1, bar: 1, baz: 2 }, - 4: { id: 4, foo: 1, bar: 2, baz: 1 }, - 5: { id: 5, foo: 1, bar: 2, baz: 2 }, - 6: { id: 6, foo: 1, bar: 2, baz: 2 }, - 7: { id: 7, foo: 2, bar: 1, baz: 1 }, - 8: { id: 8, foo: 2, bar: 1, baz: 2 }, - 9: { id: 9, foo: 2, bar: 1, baz: 2 }, - 10: { id: 10, foo: 2, bar: 2, baz: 1 }, - 11: { id: 11, foo: 2, bar: 2, baz: 2 }, - 12: { id: 12, foo: 2, bar: 2, baz: 2 } - }, - async (collRef, db) => { - let docRef = await getDoc(doc(collRef, '2')); - let query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAt(docRef) - ); - let snapshot = await execute(db.pipeline().createFrom(query1)); - verifyResults( - snapshot, - { id: 2, foo: 1, bar: 1, baz: 2 }, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); + it('supports startAt (with DocumentSnapshot)', () => { + return withTestCollection( + PERSISTENCE_MODE_UNSPECIFIED, + { + 1: { id: 1, foo: 1, bar: 1, baz: 1 }, + 2: { id: 2, foo: 1, bar: 1, baz: 2 }, + 3: { id: 3, foo: 1, bar: 1, baz: 2 }, + 4: { id: 4, foo: 1, bar: 2, baz: 1 }, + 5: { id: 5, foo: 1, bar: 2, baz: 2 }, + 6: { id: 6, foo: 1, bar: 2, baz: 2 }, + 7: { id: 7, foo: 2, bar: 1, baz: 1 }, + 8: { id: 8, foo: 2, bar: 1, baz: 2 }, + 9: { id: 9, foo: 2, bar: 1, baz: 2 }, + 10: { id: 10, foo: 2, bar: 2, baz: 1 }, + 11: { id: 11, foo: 2, bar: 2, baz: 2 }, + 12: { id: 12, foo: 2, bar: 2, baz: 2 } + }, + async (collRef, db) => { + let docRef = await getDoc(doc(collRef, '2')); + let query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + let snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 2, foo: 1, bar: 1, baz: 2 }, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); - docRef = await getDoc(doc(collRef, '3')); - query1 = query( - collRef, - orderBy('foo'), - orderBy('bar'), - orderBy('baz'), - startAt(docRef) - ); - snapshot = await execute(db.pipeline().createFrom(query1)); - verifyResults( - snapshot, - { id: 3, foo: 1, bar: 1, baz: 2 }, - { id: 4, foo: 1, bar: 2, baz: 1 }, - { id: 5, foo: 1, bar: 2, baz: 2 }, - { id: 6, foo: 1, bar: 2, baz: 2 }, - { id: 7, foo: 2, bar: 1, baz: 1 }, - { id: 8, foo: 2, bar: 1, baz: 2 }, - { id: 9, foo: 2, bar: 1, baz: 2 }, - { id: 10, foo: 2, bar: 2, baz: 1 }, - { id: 11, foo: 2, bar: 2, baz: 2 }, - { id: 12, foo: 2, bar: 2, baz: 2 } - ); - } - ); - } - ); + docRef = await getDoc(doc(collRef, '3')); + query1 = query( + collRef, + orderBy('foo'), + orderBy('bar'), + orderBy('baz'), + startAt(docRef) + ); + snapshot = await execute(db.pipeline().createFrom(query1)); + verifyResults( + snapshot, + { id: 3, foo: 1, bar: 1, baz: 2 }, + { id: 4, foo: 1, bar: 2, baz: 1 }, + { id: 5, foo: 1, bar: 2, baz: 2 }, + { id: 6, foo: 1, bar: 2, baz: 2 }, + { id: 7, foo: 2, bar: 1, baz: 1 }, + { id: 8, foo: 2, bar: 1, baz: 2 }, + { id: 9, foo: 2, bar: 1, baz: 2 }, + { id: 10, foo: 2, bar: 2, baz: 1 }, + { id: 11, foo: 2, bar: 2, baz: 2 }, + { id: 12, foo: 2, bar: 2, baz: 2 } + ); + } + ); + }); it('supports startAfter', () => { return withTestCollection( From bb8fc2747113c9e45bd24b1287cbc84fb5a21527 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 8 Apr 2025 14:28:45 -0600 Subject: [PATCH 161/295] fix tests and enable only pipeline tests --- packages/firestore/test/integration/api/pipeline.test.ts | 4 ++-- .../firestore/test/integration/api/query_to_pipeline.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 47f9d2bbb1f..aef74026054 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -147,7 +147,7 @@ setLogLevel('debug'); const testUnsupportedFeatures: boolean | 'only' = false; const timestampDeltaMS = 1000; -apiDescribe('Pipelines', persistence => { +apiDescribe.only('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; @@ -2371,7 +2371,7 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .addFields( + .select( map({ foo: 'bar' }).as('metadata') diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index ac1d2e79007..87e1a22cb4e 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -59,7 +59,7 @@ const testUnsupportedFeatures: boolean | 'only' = false; // This is the Query integration tests from the lite API (no cache support) // with some additional test cases added for more complete coverage. -apiDescribe('Query to Pipeline', persistence => { +apiDescribe.only('Query to Pipeline', persistence => { addEqualityMatcher(); function verifyResults( From b3328250d516142c8bec4f5c9bfe8663523ffcb4 Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:26:26 -0400 Subject: [PATCH 162/295] Fix: display WebChannel error message (#8907) --- .../firestore/src/platform/browser/webchannel_connection.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/firestore/src/platform/browser/webchannel_connection.ts b/packages/firestore/src/platform/browser/webchannel_connection.ts index 6813b88f65a..206e5829c41 100644 --- a/packages/firestore/src/platform/browser/webchannel_connection.ts +++ b/packages/firestore/src/platform/browser/webchannel_connection.ts @@ -326,8 +326,10 @@ export class WebChannelConnection extends RestConnection { closed = true; logWarn( LOG_TAG, - `RPC '${rpcName}' stream ${streamId} transport errored:`, - err + `RPC '${rpcName}' stream ${streamId} transport errored. Name:`, + err.name, + 'Message:', + err.message ); streamBridge.callOnClose( new FirestoreError( From 4e0f630e714cd63e1e39ffb0b56918a88951fe8e Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 9 Apr 2025 14:19:49 -0400 Subject: [PATCH 163/295] test(vertexai): add `backendName` param to mock response getters (#8906) `backendName` can be either `googleAI` or `vertexAI`. This can be passed to `getMockResponse` or `getMockResponseStreaming` to specify whether the mock response lookup should be done in the set of vertexAI or googleAI mock files. Modified the `convert-mocks.ts` script to read mock responses from the 'developerapi' directory, and add an export to the generated file for the new lookup object with those mock responses. --- .../vertexai/src/methods/count-tokens.test.ts | 12 +- .../src/methods/generate-content.test.ts | 26 +++- .../src/models/generative-model.test.ts | 11 +- .../vertexai/src/models/imagen-model.test.ts | 3 + .../vertexai/src/requests/request.test.ts | 1 + .../src/requests/response-helpers.test.ts | 5 + .../src/requests/stream-reader.test.ts | 16 ++- packages/vertexai/test-utils/convert-mocks.ts | 131 +++++++++++++----- packages/vertexai/test-utils/mock-response.ts | 27 +++- 9 files changed, 186 insertions(+), 46 deletions(-) diff --git a/packages/vertexai/src/methods/count-tokens.test.ts b/packages/vertexai/src/methods/count-tokens.test.ts index a3d7c99b4ba..9eccbf702fe 100644 --- a/packages/vertexai/src/methods/count-tokens.test.ts +++ b/packages/vertexai/src/methods/count-tokens.test.ts @@ -45,7 +45,10 @@ describe('countTokens()', () => { restore(); }); it('total tokens', async () => { - const mockResponse = getMockResponse('unary-success-total-tokens.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-total-tokens.json' + ); const makeRequestStub = stub(request, 'makeRequest').resolves( mockResponse as Response ); @@ -69,6 +72,7 @@ describe('countTokens()', () => { }); it('total tokens with modality details', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-detailed-token-response.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -96,6 +100,7 @@ describe('countTokens()', () => { }); it('total tokens no billable characters', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-no-billable-characters.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -120,7 +125,10 @@ describe('countTokens()', () => { ); }); it('model not found', async () => { - const mockResponse = getMockResponse('unary-failure-model-not-found.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-failure-model-not-found.json' + ); const mockFetch = stub(globalThis, 'fetch').resolves({ ok: false, status: 404, diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/vertexai/src/methods/generate-content.test.ts index 426bd5176db..1d15632f828 100644 --- a/packages/vertexai/src/methods/generate-content.test.ts +++ b/packages/vertexai/src/methods/generate-content.test.ts @@ -61,6 +61,7 @@ describe('generateContent()', () => { }); it('short response', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -84,7 +85,10 @@ describe('generateContent()', () => { ); }); it('long response', async () => { - const mockResponse = getMockResponse('unary-success-basic-reply-long.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-basic-reply-long.json' + ); const makeRequestStub = stub(request, 'makeRequest').resolves( mockResponse as Response ); @@ -105,6 +109,7 @@ describe('generateContent()', () => { }); it('long response with token details', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-response-long-usage-metadata.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -138,7 +143,10 @@ describe('generateContent()', () => { ); }); it('citations', async () => { - const mockResponse = getMockResponse('unary-success-citations.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-citations.json' + ); const makeRequestStub = stub(request, 'makeRequest').resolves( mockResponse as Response ); @@ -163,6 +171,7 @@ describe('generateContent()', () => { }); it('blocked prompt', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-prompt-blocked-safety.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -184,6 +193,7 @@ describe('generateContent()', () => { }); it('finishReason safety', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-finish-reason-safety.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -204,7 +214,10 @@ describe('generateContent()', () => { ); }); it('empty content', async () => { - const mockResponse = getMockResponse('unary-failure-empty-content.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-failure-empty-content.json' + ); const makeRequestStub = stub(request, 'makeRequest').resolves( mockResponse as Response ); @@ -224,6 +237,7 @@ describe('generateContent()', () => { }); it('unknown enum - should ignore', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-unknown-enum-safety-ratings.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -244,7 +258,10 @@ describe('generateContent()', () => { ); }); it('image rejected (400)', async () => { - const mockResponse = getMockResponse('unary-failure-image-rejected.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-failure-image-rejected.json' + ); const mockFetch = stub(globalThis, 'fetch').resolves({ ok: false, status: 400, @@ -257,6 +274,7 @@ describe('generateContent()', () => { }); it('api not enabled (403)', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-firebasevertexai-api-not-enabled.json' ); const mockFetch = stub(globalThis, 'fetch').resolves({ diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index 26dff4e04c6..987f9b115e2 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -60,6 +60,7 @@ describe('GenerativeModel', () => { ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -89,6 +90,7 @@ describe('GenerativeModel', () => { }); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -129,6 +131,7 @@ describe('GenerativeModel', () => { ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -177,6 +180,7 @@ describe('GenerativeModel', () => { ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -206,6 +210,7 @@ describe('GenerativeModel', () => { }); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -239,6 +244,7 @@ describe('GenerativeModel', () => { ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-basic-reply-short.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -277,7 +283,10 @@ describe('GenerativeModel', () => { }); it('calls countTokens', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model' }); - const mockResponse = getMockResponse('unary-success-total-tokens.json'); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-total-tokens.json' + ); const makeRequestStub = stub(request, 'makeRequest').resolves( mockResponse as Response ); diff --git a/packages/vertexai/src/models/imagen-model.test.ts b/packages/vertexai/src/models/imagen-model.test.ts index c566a88e5b0..9e534f2195a 100644 --- a/packages/vertexai/src/models/imagen-model.test.ts +++ b/packages/vertexai/src/models/imagen-model.test.ts @@ -47,6 +47,7 @@ const fakeVertexAI: VertexAI = { describe('ImagenModel', () => { it('generateImages makes a request to predict with default parameters', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-generate-images-base64.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -90,6 +91,7 @@ describe('ImagenModel', () => { }); const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-generate-images-base64.json' ); const makeRequestStub = stub(request, 'makeRequest').resolves( @@ -133,6 +135,7 @@ describe('ImagenModel', () => { }); it('throws if prompt blocked', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-generate-images-prompt-blocked.json' ); diff --git a/packages/vertexai/src/requests/request.test.ts b/packages/vertexai/src/requests/request.test.ts index 499f06c848b..cd39a0f8ae5 100644 --- a/packages/vertexai/src/requests/request.test.ts +++ b/packages/vertexai/src/requests/request.test.ts @@ -414,6 +414,7 @@ describe('request methods', () => { }); it('Network error, API not enabled', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-firebasevertexai-api-not-enabled.json' ); const fetchStub = stub(globalThis, 'fetch').resolves( diff --git a/packages/vertexai/src/requests/response-helpers.test.ts b/packages/vertexai/src/requests/response-helpers.test.ts index 4cab8cde047..5371d040253 100644 --- a/packages/vertexai/src/requests/response-helpers.test.ts +++ b/packages/vertexai/src/requests/response-helpers.test.ts @@ -257,6 +257,7 @@ describe('response-helpers methods', () => { describe('handlePredictResponse', () => { it('returns base64 images', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-generate-images-base64.json' ) as Response; const res = await handlePredictResponse(mockResponse); @@ -270,6 +271,7 @@ describe('response-helpers methods', () => { }); it('returns GCS images', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-success-generate-images-gcs.json' ) as Response; const res = await handlePredictResponse(mockResponse); @@ -284,6 +286,7 @@ describe('response-helpers methods', () => { }); it('has filtered reason and no images if all images were filtered', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-generate-images-all-filtered.json' ) as Response; const res = await handlePredictResponse(mockResponse); @@ -294,6 +297,7 @@ describe('response-helpers methods', () => { }); it('has filtered reason and no images if all base64 images were filtered', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-generate-images-base64-some-filtered.json' ) as Response; const res = await handlePredictResponse(mockResponse); @@ -308,6 +312,7 @@ describe('response-helpers methods', () => { }); it('has filtered reason and no images if all GCS images were filtered', async () => { const mockResponse = getMockResponse( + 'vertexAI', 'unary-failure-generate-images-gcs-some-filtered.json' ) as Response; const res = await handlePredictResponse(mockResponse); diff --git a/packages/vertexai/src/requests/stream-reader.test.ts b/packages/vertexai/src/requests/stream-reader.test.ts index b68c2423066..bf959276a93 100644 --- a/packages/vertexai/src/requests/stream-reader.test.ts +++ b/packages/vertexai/src/requests/stream-reader.test.ts @@ -72,6 +72,7 @@ describe('processStream', () => { }); it('streaming response - short', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-basic-reply-short.txt' ); const result = processStream(fakeResponse as Response); @@ -83,6 +84,7 @@ describe('processStream', () => { }); it('streaming response - long', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-basic-reply-long.txt' ); const result = processStream(fakeResponse as Response); @@ -95,6 +97,7 @@ describe('processStream', () => { }); it('streaming response - long - big chunk', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-basic-reply-long.txt', 1e6 ); @@ -107,7 +110,10 @@ describe('processStream', () => { expect(aggregatedResponse.text()).to.include('to their owners.'); }); it('streaming response - utf8', async () => { - const fakeResponse = getMockResponseStreaming('streaming-success-utf8.txt'); + const fakeResponse = getMockResponseStreaming( + 'vertexAI', + 'streaming-success-utf8.txt' + ); const result = processStream(fakeResponse as Response); for await (const response of result.stream) { expect(response.text()).to.not.be.empty; @@ -118,6 +124,7 @@ describe('processStream', () => { }); it('streaming response - functioncall', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-function-call-short.txt' ); const result = processStream(fakeResponse as Response); @@ -141,6 +148,7 @@ describe('processStream', () => { }); it('candidate had finishReason', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-failure-finish-reason-safety.txt' ); const result = processStream(fakeResponse as Response); @@ -153,6 +161,7 @@ describe('processStream', () => { }); it('prompt was blocked', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-failure-prompt-blocked-safety.txt' ); const result = processStream(fakeResponse as Response); @@ -165,6 +174,7 @@ describe('processStream', () => { }); it('empty content', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-failure-empty-content.txt' ); const result = processStream(fakeResponse as Response); @@ -176,6 +186,7 @@ describe('processStream', () => { }); it('unknown enum - should ignore', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-unknown-safety-enum.txt' ); const result = processStream(fakeResponse as Response); @@ -187,6 +198,7 @@ describe('processStream', () => { }); it('recitation ending with a missing content field', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-failure-recitation-no-content.txt' ); const result = processStream(fakeResponse as Response); @@ -205,6 +217,7 @@ describe('processStream', () => { }); it('handles citations', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-citations.txt' ); const result = processStream(fakeResponse as Response); @@ -224,6 +237,7 @@ describe('processStream', () => { }); it('removes empty text parts', async () => { const fakeResponse = getMockResponseStreaming( + 'vertexAI', 'streaming-success-empty-text-part.txt' ); const result = processStream(fakeResponse as Response); diff --git a/packages/vertexai/test-utils/convert-mocks.ts b/packages/vertexai/test-utils/convert-mocks.ts index c306bec312f..851d6017b6d 100644 --- a/packages/vertexai/test-utils/convert-mocks.ts +++ b/packages/vertexai/test-utils/convert-mocks.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2024 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,42 +15,111 @@ * limitations under the License. */ +/* eslint-disable @typescript-eslint/no-require-imports */ +const { readdirSync, readFileSync, writeFileSync } = require('node:fs'); +const { join } = require('node:path'); + +const MOCK_RESPONSES_DIR_PATH = join( + __dirname, + 'vertexai-sdk-test-data', + 'mock-responses' +); +const MOCK_LOOKUP_OUTPUT_PATH = join(__dirname, 'mocks-lookup.ts'); + +type BackendName = 'vertexAI' | 'googleAI'; + +const mockDirs: Record = { + vertexAI: join(MOCK_RESPONSES_DIR_PATH, 'vertexai'), + // Note: the dirname is developerapi is legacy. It should be updated to googleai. + googleAI: join(MOCK_RESPONSES_DIR_PATH, 'developerapi') +}; + /** - * Converts mock text files into a js file that karma can read without - * using fs. + * Generates a JS file that exports maps from filenames to JSON mock responses (as strings) + * for each backend. + * + * This allows tests that run in a browser to access the mock responses without having to + * read from local disk and requiring 'fs'. */ +function generateMockLookupFile(): void { + console.log('Generating mock lookup file...'); + const vertexAIMockLookupText = generateMockLookup('vertexAI'); + const googleAIMockLookupText = generateMockLookup('googleAI'); -// eslint-disable-next-line @typescript-eslint/no-require-imports -const fs = require('fs'); -// eslint-disable-next-line @typescript-eslint/no-require-imports -const { join } = require('path'); + const fileText = ` +/** + * DO NOT EDIT - This file was generated by the packages/vertexai/test-utils/convert-mocks.ts script. + * + * These objects map mock response filenames to their JSON contents. + * + * Mock response files are pulled from https://github.com/FirebaseExtended/vertexai-sdk-test-data. + */ -const mockResponseDir = join( - __dirname, - 'vertexai-sdk-test-data/mock-responses/vertexai' -); +// Automatically generated at: ${new Date().toISOString()} + +${vertexAIMockLookupText} -async function main(): Promise { - const list = fs.readdirSync(mockResponseDir); +${googleAIMockLookupText} +`; + try { + writeFileSync(MOCK_LOOKUP_OUTPUT_PATH, fileText, 'utf-8'); + console.log( + `Successfully generated mock lookup file at: ${MOCK_LOOKUP_OUTPUT_PATH}` + ); + } catch (err) { + console.error( + `Error writing mock lookup file to ${MOCK_LOOKUP_OUTPUT_PATH}:`, + err + ); + process.exit(1); + } +} + +/** + * Given a directory that contains mock response files, reads through all the files, + * maps file names to file contents, and returns a string of typescript code + * that exports that map as an object. + */ +function generateMockLookup(backendName: BackendName): string { const lookup: Record = {}; - // eslint-disable-next-line guard-for-in - for (const fileName of list) { - const fullText = fs.readFileSync(join(mockResponseDir, fileName), 'utf-8'); - lookup[fileName] = fullText; + const mockDir = mockDirs[backendName]; + let mockFilenames: string[]; + + console.log( + `Processing mocks for "${backendName}" from directory: ${mockDir}` + ); + + try { + mockFilenames = readdirSync(mockDir); + } catch (err) { + console.error( + `Error reading directory ${mockDir} for ${backendName}:`, + err + ); + return `export const ${backendName}MocksLookup: Record = {};`; } - let fileText = `// Generated from mocks text files.`; - - fileText += '\n\n'; - fileText += `export const mocksLookup: Record = ${JSON.stringify( - lookup, - null, - 2 - )}`; - fileText += ';\n'; - fs.writeFileSync(join(__dirname, 'mocks-lookup.ts'), fileText, 'utf-8'); + + if (mockFilenames.length === 0) { + console.warn(`No .json files found in ${mockDir} for ${backendName}.`); + } + + for (const mockFilename of mockFilenames) { + const mockFilepath = `${mockDir}/${mockFilename}`; + try { + const fullText = readFileSync(mockFilepath, 'utf-8'); + lookup[mockFilename] = fullText; + } catch (err) { + console.error( + `Error reading mock file ${mockFilepath} for ${backendName}:`, + err + ); + } + } + + // Use JSON.stringify with indentation for readable output in the generated file + const lookupJsonString = JSON.stringify(lookup, null, 2); + + return `export const ${backendName}MocksLookup: Record = ${lookupJsonString};`; } -main().catch(e => { - console.error(e); - process.exit(1); -}); +generateMockLookupFile(); diff --git a/packages/vertexai/test-utils/mock-response.ts b/packages/vertexai/test-utils/mock-response.ts index 9b42c93427b..5128ddabe74 100644 --- a/packages/vertexai/test-utils/mock-response.ts +++ b/packages/vertexai/test-utils/mock-response.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2024 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,12 @@ * limitations under the License. */ -import { mocksLookup } from './mocks-lookup'; +import { vertexAIMocksLookup, googleAIMocksLookup } from './mocks-lookup'; + +const mockSetMaps: Record> = { + 'vertexAI': vertexAIMocksLookup, + 'googleAI': googleAIMocksLookup +}; /** * Mock native Response.body @@ -45,25 +50,33 @@ export function getChunkedStream( return stream; } + export function getMockResponseStreaming( + backendName: BackendName, filename: string, chunkLength: number = 20 ): Partial { - if (!(filename in mocksLookup)) { - throw Error(`Mock response file '${filename}' not found.`); + const mocksMap = mockSetMaps[backendName]; + if (!(filename in mocksMap)) { + throw Error(`${backendName} mock response file '${filename}' not found.`); } - const fullText = mocksLookup[filename]; + const fullText = mocksMap[filename]; return { body: getChunkedStream(fullText, chunkLength) }; } -export function getMockResponse(filename: string): Partial { +export function getMockResponse( + backendName: BackendName, + filename: string +): Partial { + const mocksLookup = mockSetMaps[backendName]; if (!(filename in mocksLookup)) { - throw Error(`Mock response file '${filename}' not found.`); + throw Error(`${backendName} mock response file '${filename}' not found.`); } const fullText = mocksLookup[filename]; + return { ok: true, json: () => Promise.resolve(JSON.parse(fullText)) From ed0803a29791cc0cecd0153f95e814ddcee7efd8 Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Fri, 11 Apr 2025 11:16:52 -0400 Subject: [PATCH 164/295] fix: remove `null` value inclusion from `!=` and `not-in` filter results (#8915) --- .changeset/cyan-frogs-relate.md | 6 ++ packages/firestore/src/core/filter.ts | 7 +- .../test/integration/api/query.test.ts | 94 +++++++++++++++++++ .../firestore/test/unit/core/query.test.ts | 4 +- 4 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 .changeset/cyan-frogs-relate.md diff --git a/.changeset/cyan-frogs-relate.md b/.changeset/cyan-frogs-relate.md new file mode 100644 index 00000000000..08af27593a9 --- /dev/null +++ b/.changeset/cyan-frogs-relate.md @@ -0,0 +1,6 @@ +--- +'@firebase/firestore': patch +'firebase': patch +--- + +Fixed the `null` value handling in `!=` and `not-in` filters. diff --git a/packages/firestore/src/core/filter.ts b/packages/firestore/src/core/filter.ts index 06e2740c315..12b57729f81 100644 --- a/packages/firestore/src/core/filter.ts +++ b/packages/firestore/src/core/filter.ts @@ -141,6 +141,7 @@ export class FieldFilter extends Filter { if (this.op === Operator.NOT_EQUAL) { return ( other !== null && + other.nullValue === undefined && this.matchesComparison(valueCompare(other!, this.value)) ); } @@ -495,7 +496,11 @@ export class NotInFilter extends FieldFilter { return false; } const other = doc.data.field(this.field); - return other !== null && !arrayValueContains(this.value.arrayValue!, other); + return ( + other !== null && + other.nullValue === undefined && + !arrayValueContains(this.value.arrayValue!, other) + ); } } diff --git a/packages/firestore/test/integration/api/query.test.ts b/packages/firestore/test/integration/api/query.test.ts index 01fd0e47e35..5871607eb03 100644 --- a/packages/firestore/test/integration/api/query.test.ts +++ b/packages/firestore/test/integration/api/query.test.ts @@ -1751,6 +1751,100 @@ apiDescribe('Queries', persistence => { ); }); }); + + it('sdk uses != filter same as backend', async () => { + const testDocs = { + a: { zip: Number.NaN }, + b: { zip: 91102 }, + c: { zip: 98101 }, + d: { zip: '98101' }, + e: { zip: [98101] }, + f: { zip: [98101, 98102] }, + g: { zip: ['98101', { zip: 98101 }] }, + h: { zip: { code: 500 } }, + i: { zip: null }, + j: { code: 500 } + }; + + await withTestCollection(persistence, testDocs, async coll => { + // populate cache with all documents first to ensure getDocsFromCache() scans all docs + await getDocs(coll); + + let testQuery = query(coll, where('zip', '!=', 98101)); + await checkOnlineAndOfflineResultsMatch( + testQuery, + 'a', + 'b', + 'd', + 'e', + 'f', + 'g', + 'h' + ); + + testQuery = query(coll, where('zip', '!=', Number.NaN)); + await checkOnlineAndOfflineResultsMatch( + testQuery, + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h' + ); + + testQuery = query(coll, where('zip', '!=', null)); + await checkOnlineAndOfflineResultsMatch( + testQuery, + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h' + ); + }); + }); + + it('sdk uses not-in filter same as backend', async () => { + const testDocs = { + a: { zip: Number.NaN }, + b: { zip: 91102 }, + c: { zip: 98101 }, + d: { zip: '98101' }, + e: { zip: [98101] }, + f: { zip: [98101, 98102] }, + g: { zip: ['98101', { zip: 98101 }] }, + h: { zip: { code: 500 } }, + i: { zip: null }, + j: { code: 500 } + }; + + await withTestCollection(persistence, testDocs, async coll => { + // populate cache with all documents first to ensure getDocsFromCache() scans all docs + await getDocs(coll); + + let testQuery = query( + coll, + where('zip', 'not-in', [98101, 98103, [98101, 98102]]) + ); + await checkOnlineAndOfflineResultsMatch( + testQuery, + 'a', + 'b', + 'd', + 'e', + 'g', + 'h' + ); + + testQuery = query(coll, where('zip', 'not-in', [null])); + await checkOnlineAndOfflineResultsMatch(testQuery); + }); + }); }); // Reproduces https://github.com/firebase/firebase-js-sdk/issues/5873 diff --git a/packages/firestore/test/unit/core/query.test.ts b/packages/firestore/test/unit/core/query.test.ts index fd0e6884c66..e589e7bf027 100644 --- a/packages/firestore/test/unit/core/query.test.ts +++ b/packages/firestore/test/unit/core/query.test.ts @@ -256,7 +256,7 @@ describe('Query', () => { document = doc('collection/1', 0, { zip: null }); - expect(queryMatches(query1, document)).to.be.true; + expect(queryMatches(query1, document)).to.be.false; // NaN match. document = doc('collection/1', 0, { @@ -354,7 +354,7 @@ describe('Query', () => { expect(queryMatches(query2, doc3)).to.equal(true); expect(queryMatches(query2, doc4)).to.equal(true); expect(queryMatches(query2, doc5)).to.equal(true); - expect(queryMatches(query2, doc6)).to.equal(true); + expect(queryMatches(query2, doc6)).to.equal(false); }); it('matches null for filters', () => { From 03eb22e4d5bc44ec3ee997f3fc755e5340342dfc Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 11 Apr 2025 13:03:26 -0600 Subject: [PATCH 165/295] Comment cleanup --- packages/firestore/src/lite-api/pipeline.ts | 38 +++++++++---------- .../test/integration/api/pipeline.test.ts | 4 +- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index e07c7a37b9f..17ad5464725 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -148,8 +148,8 @@ export class Pipeline implements ProtoSerializable { * The added fields are defined using {@link Selectable}s, which can be: * * - {@link Field}: References an existing document field. - * - {@link Function}: Performs a calculation using functions like `add`, `multiply` with - * assigned aliases using {@link Expr#as}. + * - {@link Expr}: Either a literal value (see {@link Constant}) or a computed value + * (see {@FunctionExpr}) with an assigned alias using {@link Expr#as}. * * Example: * @@ -353,22 +353,21 @@ export class Pipeline implements ProtoSerializable { return this._addStage(new Limit(limit, convertedFromLimitToLast)); } + /** - * Returns a set of distinct {@link Expr} values from the inputs to this stage. + * Returns a set of distinct values from the inputs to this stage. * - *

This stage run through the results from previous stages to include only results with unique - * combinations of {@link Expr} values ({@link Field}, {@link Function}, etc.). + * This stage runs through the results from previous stages to include only results with + * unique combinations of {@link Expr} values ({@link Field}, {@link Function}, etc). * - *

The parameters to this stage are defined using {@link Selectable} expressions or {@code string}s: + * The parameters to this stage are defined using {@link Selectable} expressions or strings: * - *

    - *
  • {@code string}: Name of an existing field
  • - *
  • {@link Field}: References an existing document field.
  • - *
  • {@link Function}: Represents the result of a function with an assigned alias name using - * {@link Expr#as}
  • - *
+ * - {@code string}: Name of an existing field + * - {@link Field}: References an existing document field. + * - {@link ExprWithAlias}: Represents the result of a function with an assigned alias name + * using {@link Expr#as}. * - *

Example: + * Example: * * ```typescript * // Get a list of unique author names in uppercase and genre combinations. @@ -377,8 +376,8 @@ export class Pipeline implements ProtoSerializable { * .select("authorName"); * ``` * - * @param group The first {@link Selectable} expression to consider when determining distinct - * value combinations or strings representing field names. + * @param group The {@link Selectable} expression or field name to consider when determining + * distinct value combinations. * @param additionalGroups Optional additional {@link Selectable} expressions to consider when determining distinct * value combinations or strings representing field names. * @return A new {@code Pipeline} object with this stage appended to the stage list. @@ -416,9 +415,9 @@ export class Pipeline implements ProtoSerializable { * ``` * * @param accumulator The first {@link AggregateWithAlias}, wrapping an {@link AggregateFunction} - * and provide a name for the accumulated results. + * and providing a name for the accumulated results. * @param additionalAccumulators Optional additional {@link AggregateWithAlias}, each wrapping an {@link AggregateFunction} - * and provide a name for the accumulated results. + * and providing a name for the accumulated results. * @return A new Pipeline object with this stage appended to the stage list. */ aggregate( @@ -734,11 +733,10 @@ export class Pipeline implements ProtoSerializable { } /** - * Produces a document for each element in array found in previous stage document. + * Produces a document for each element in an input array. * * For each previous stage document, this stage will emit zero or more augmented documents. The - * input array found in the previous stage document field specified by the `selectable` parameter, - * will emit an augmented document for each input array element. The input array element will + * input array specified by the `selectable` parameter, will emit an augmented document for each input array element. The input array element will * augment the previous stage document by setting the `alias` field with the array element value. * * When `selectable` evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index aef74026054..1ef61bf0304 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -53,8 +53,7 @@ import { collection, documentId as documentIdFieldPath, writeBatch, - addDoc, - increment + addDoc } from '../util/firebase_export'; import { apiDescribe, withTestCollection, itIf } from '../util/helpers'; import { @@ -119,7 +118,6 @@ import { arrayOffset, minimum, maximum, - currentContext, isError, ifError, trim, From e055e9057caab4d9f73734307fe4e0be2098249b Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:52:23 -0600 Subject: [PATCH 166/295] Add assertion IDs that will be included in production log statements for fail and hardAsserts (#8313) --- .changeset/odd-wolves-sit.md | 5 + packages/firestore/package.json | 10 +- .../firestore/scripts/assertion-id-tool.js | 17 + .../firestore/scripts/assertion-id-tool.ts | 381 ++++++++++++++++++ packages/firestore/scripts/build-bundle.js | 2 +- packages/firestore/scripts/build-bundle.ts | 26 +- packages/firestore/scripts/extract-api.js | 2 +- packages/firestore/scripts/remove-asserts.js | 2 +- packages/firestore/scripts/remove-asserts.ts | 4 +- .../firestore/scripts/rename-internals.js | 2 +- packages/firestore/scripts/run-tests.js | 17 + packages/firestore/scripts/run-tests.ts | 42 +- packages/firestore/src/api/credentials.ts | 22 +- packages/firestore/src/api/snapshot.ts | 2 +- .../firestore/src/core/component_provider.ts | 1 + packages/firestore/src/core/filter.ts | 6 +- packages/firestore/src/core/query.ts | 2 +- .../firestore/src/core/sync_engine_impl.ts | 9 +- packages/firestore/src/core/transaction.ts | 4 +- packages/firestore/src/core/view.ts | 2 +- packages/firestore/src/core/view_snapshot.ts | 10 +- .../src/index/firestore_index_value_writer.ts | 2 +- .../firestore/src/lite-api/reference_impl.ts | 6 +- .../firestore/src/lite-api/transaction.ts | 8 +- .../src/lite-api/user_data_reader.ts | 4 +- .../src/lite-api/user_data_writer.ts | 8 +- .../src/local/encoded_resource_path.ts | 10 +- .../src/local/indexeddb_index_manager.ts | 3 +- .../local/indexeddb_mutation_batch_impl.ts | 7 +- .../src/local/indexeddb_mutation_queue.ts | 49 ++- .../local/indexeddb_remote_document_cache.ts | 2 +- .../src/local/indexeddb_schema_converter.ts | 6 +- .../src/local/indexeddb_sentinels.ts | 2 +- .../src/local/indexeddb_target_cache.ts | 3 +- .../firestore/src/local/local_serializer.ts | 4 +- .../firestore/src/local/local_store_impl.ts | 7 +- .../src/local/memory_mutation_queue.ts | 1 + .../firestore/src/local/memory_persistence.ts | 5 +- .../src/local/memory_remote_document_cache.ts | 2 +- .../src/local/persistence_promise.ts | 2 +- .../src/local/shared_client_state.ts | 4 +- packages/firestore/src/model/document.ts | 5 +- packages/firestore/src/model/mutation.ts | 8 +- .../firestore/src/model/mutation_batch.ts | 10 +- packages/firestore/src/model/normalize.ts | 6 +- packages/firestore/src/model/path.ts | 10 +- .../src/model/target_index_matcher.ts | 1 + packages/firestore/src/model/values.ts | 14 +- .../platform/browser/webchannel_connection.ts | 20 +- .../src/platform/node/grpc_connection.ts | 1 + packages/firestore/src/remote/datastore.ts | 5 +- .../firestore/src/remote/persistent_stream.ts | 3 + packages/firestore/src/remote/rpc_error.ts | 8 +- packages/firestore/src/remote/serializer.ts | 63 ++- packages/firestore/src/remote/watch_change.ts | 17 +- packages/firestore/src/util/assert.ts | 95 ++++- .../firestore/src/util/async_queue_impl.ts | 4 +- .../firestore/src/util/input_validation.ts | 2 +- packages/firestore/src/util/logic_utils.ts | 10 + packages/firestore/src/util/sorted_map.ts | 22 +- .../unit/index/ordered_code_writer.test.ts | 9 +- .../unit/local/indexeddb_persistence.test.ts | 2 +- .../test/unit/local/simple_db.test.ts | 2 +- .../firestore/test/unit/specs/spec_builder.ts | 14 +- .../test/unit/specs/spec_test_components.ts | 2 +- .../test/unit/specs/spec_test_runner.ts | 4 +- .../firestore/test/unit/util/assert.test.ts | 88 ++++ .../test/unit/util/async_queue.test.ts | 4 +- packages/firestore/test/util/helpers.ts | 2 + .../firestore/test/util/spec_test_helpers.ts | 7 +- packages/firestore/test/util/test_platform.ts | 2 +- 71 files changed, 955 insertions(+), 188 deletions(-) create mode 100644 .changeset/odd-wolves-sit.md create mode 100644 packages/firestore/scripts/assertion-id-tool.js create mode 100644 packages/firestore/scripts/assertion-id-tool.ts create mode 100644 packages/firestore/scripts/run-tests.js create mode 100644 packages/firestore/test/unit/util/assert.test.ts diff --git a/.changeset/odd-wolves-sit.md b/.changeset/odd-wolves-sit.md new file mode 100644 index 00000000000..fc63acc005e --- /dev/null +++ b/.changeset/odd-wolves-sit.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Add unique IDs and state information into fatal error messages instead of the generic "unexpected state" message. diff --git a/packages/firestore/package.json b/packages/firestore/package.json index d9cb6c263b5..0c9ddeee843 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -20,14 +20,14 @@ "dev": "rollup -c -w", "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "prettier": "prettier --write '*.js' '@(lite|src|test)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'", + "prettier": "prettier --write '*.js' '@(lite|src|test|scripts)/**/*.ts' 'test/unit/remote/bloom_filter_golden_test_data/*.json'", "test:lite": "ts-node ./scripts/run-tests.ts --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'", "test:lite:prod": "ts-node ./scripts/run-tests.ts --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'", "test:lite:prod:nameddb": "ts-node ./scripts/run-tests.ts --platform node_lite --databaseId=test-db --main=lite/index.ts 'test/lite/**/*.test.ts'", "test:lite:browser": "karma start --lite", "test:lite:browser:nameddb": "karma start --lite --databaseId=test-db", "test:lite:browser:debug": "karma start --browsers=Chrome --lite --auto-watch", - "test": "run-s --npm-path npm lint test:all", + "test": "run-s --npm-path npm lint assertion-id:check test:all", "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all:ci", "test:all:ci": "run-s --npm-path npm test:browser test:travis test:lite:browser test:browser:prod:nameddb test:lite:browser:nameddb", "test:all": "run-p --npm-path npm test:browser test:lite:browser test:travis test:minified test:browser:prod:nameddb test:lite:browser:nameddb", @@ -52,7 +52,11 @@ "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", "api-report": "run-s --npm-path npm api-report:main api-report:lite && yarn api-report:api-json", "doc": "api-documenter markdown --input temp --output docs", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts" + "typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts", + "assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check", + "assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new", + "assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list", + "assertion-id:find": "ts-node scripts/assertion-id-tool.ts --dir=src --find" }, "exports": { ".": { diff --git a/packages/firestore/scripts/assertion-id-tool.js b/packages/firestore/scripts/assertion-id-tool.js new file mode 100644 index 00000000000..f29d88a1bf2 --- /dev/null +++ b/packages/firestore/scripts/assertion-id-tool.js @@ -0,0 +1,17 @@ +"use strict"; +/** + * @license + * Copyright 2025 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. + */var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0){node.arguments.forEach((function(arg){argsText_1.push(arg.getText(sourceFile_1));if(ts.isStringLiteral(arg)){errorMessage_1=arg.getText(sourceFile_1)}else if(ts.isNumericLiteral(arg)){assertionId_1=parseInt(arg.getText(sourceFile_1),10)}}))}foundCalls.push({fileName:filePath,functionName:functionName,line:line+1,character:character+1,argumentsText:argsText_1,errorMessage:errorMessage_1,assertionId:assertionId_1!==null&&assertionId_1!==void 0?assertionId_1:-1})}}ts.forEachChild(node,visit_1)};visit_1(sourceFile_1)}catch(error){console.error("Error processing file ".concat(filePath,": ").concat(error.message))}};for(var _i=0,filePaths_1=filePaths;_i1){duplicatesFound=true;console.error('\nDuplicate assertion id "'.concat(code,'" found at ').concat(locations.length," locations:"));locations.forEach((function(loc){var relativePath=path.relative(process.cwd(),loc.fileName);console.error("- ".concat(relativePath,":").concat(loc.line,":").concat(loc.character))}))}}));if(!duplicatesFound){log("No duplicate assertion ids found.")}else{process.exit(1)}}function handleNew(occurrences){var maxCode=0;occurrences.forEach((function(occ){if(occ.assertionId>maxCode){maxCode=occ.assertionId}}));if(occurrences.length===0){log("0");return}var newCode=maxCode+1;console.log(newCode)}function main(){return __awaiter(this,void 0,void 0,(function(){var argv,targetDirectory,stats,filesToScan,allOccurrences;return __generator(this,(function(_a){argv=(0,yargs_1.default)((0,helpers_1.hideBin)(process.argv)).usage("Usage: $0 [options]").option("dir",{alias:"D",describe:"Directory to scan recursively for TS files",type:"string",demandOption:true}).option("verbose",{alias:"V",describe:"verbose",type:"boolean"}).option("find",{alias:"F",describe:"Find locations of a specific {assertionId}",type:"string",nargs:1}).option("list",{alias:"L",describe:"List all unique assertion ids found (default action)",type:"boolean"}).option("new",{alias:"N",describe:"Suggest a new assertion id based on existing ones",type:"boolean"}).option("check",{alias:"C",describe:"Check for duplicate usage of assertion ids",type:"boolean"}).check((function(argv){var options=[argv.F,argv.L,argv.N,argv.C].filter(Boolean).length;if(options>1){throw new Error("Options -F, -L, -N, -C are mutually exclusive.")}return true})).help().alias("help","h").strict().parse();targetDirectory=path.resolve(argv["dir"]);isVerbose=!!argv["verbose"];try{stats=fs.statSync(targetDirectory);if(!stats.isDirectory()){console.error("Error: Provided path is not a directory: ".concat(targetDirectory));process.exit(1)}}catch(error){console.error("Error accessing directory ".concat(targetDirectory,": ").concat(error.message));process.exit(1)}log("Scanning directory: ".concat(targetDirectory));filesToScan=getTsFilesRecursive(targetDirectory);if(filesToScan.length===0){log("No relevant .ts or .tsx files found.");process.exit(0)}log("Found ".concat(filesToScan.length," files. Analyzing for assertion ids..."));allOccurrences=findFunctionCalls(filesToScan);log("Scan complete. Found ".concat(allOccurrences.length," potential assertion id occurrences."));if(argv["find"]){handleFind(allOccurrences,argv["find"])}else if(argv["new"]){handleNew(allOccurrences)}else if(argv["check"]){handleCheck(allOccurrences)}else{handleList(allOccurrences)}return[2]}))}))}main().catch((function(error){console.error("\nAn unexpected error occurred:");console.error(error);process.exit(1)})); \ No newline at end of file diff --git a/packages/firestore/scripts/assertion-id-tool.ts b/packages/firestore/scripts/assertion-id-tool.ts new file mode 100644 index 00000000000..8bde791cc6d --- /dev/null +++ b/packages/firestore/scripts/assertion-id-tool.ts @@ -0,0 +1,381 @@ +/** + * @license + * Copyright 2025 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. + */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-console */ + +import * as fs from 'fs'; +import { getRandomValues } from 'node:crypto'; +import * as path from 'path'; + +import * as ts from 'typescript'; +import yargs from 'yargs'; +import { hideBin } from 'yargs/helpers'; + +let isVerbose: boolean = false; + +function log(message: any): void { + if (isVerbose) { + console.log(message); + } +} + +// Define the names of the functions we are looking for +const targetFunctionNames: Set = new Set(['fail', 'hardAssert']); + +// Interface to store information about found call sites +interface CallSiteInfo { + fileName: string; + functionName: string; + line: number; + character: number; + argumentsText: string[]; // Added to store argument text + errorMessage: string | undefined; + assertionId: string; +} + +/** + * Recursively finds all files with .ts extensions in a directory. + * @param dirPath The absolute path to the directory to scan. + * @returns An array of absolute paths to the found TypeScript files. + */ +function getTsFilesRecursive(dirPath: string): string[] { + let tsFiles: string[] = []; + try { + const entries = fs.readdirSync(dirPath, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dirPath, entry.name); + + if (entry.isDirectory()) { + // Ignore node_modules for performance and relevance + if (entry.name === 'node_modules') { + continue; + } + // Recursively scan subdirectories + tsFiles = tsFiles.concat(getTsFilesRecursive(fullPath)); + } else if (entry.isFile() && entry.name.endsWith('.ts')) { + // Exclude declaration files (.d.ts) as they usually don't contain implementation + if (!entry.name.endsWith('.d.ts')) { + tsFiles.push(fullPath); + } + } + } + } catch (error: any) { + console.error(`Error reading directory ${dirPath}: ${error.message}`); + throw error; + } + return tsFiles; +} + +/** + * Analyzes TypeScript source files to find calls to specific functions. + * @param filePaths An array of absolute paths to the TypeScript files to scan. + * @returns An array of objects detailing the found call sites. + */ +function findFunctionCalls(filePaths: string[]): CallSiteInfo[] { + const foundCalls: CallSiteInfo[] = []; + + for (const filePath of filePaths) { + // Read the file content + const sourceText = fs.readFileSync(filePath, 'utf8'); + + // Create the SourceFile AST node + const sourceFile = ts.createSourceFile( + path.basename(filePath), // Use basename for AST node name + sourceText, + ts.ScriptTarget.ESNext, + true, // Set parent pointers + ts.ScriptKind.Unknown // Detect TS vs TSX automatically + ); + + // Define the visitor function + const visit = (node: ts.Node): void => { + // Check if the node is a CallExpression (e.g., myFunction(...)) + if (ts.isCallExpression(node)) { + let functionName: string | null = null; + const expression = node.expression; + + // Check if the call is directly to an identifier (e.g., fail()) + if (ts.isIdentifier(expression)) { + functionName = expression.text; + } + + // If we found a function name, and it's one we're looking for + if (functionName && targetFunctionNames.has(functionName)) { + // Get line and character number + const { line, character } = ts.getLineAndCharacterOfPosition( + sourceFile, + node.getStart() // Get start position of the call expression + ); + + // --- Extract Arguments --- + const argsText: string[] = []; + let errorMessage: string | undefined; + let assertionId: string | undefined; + if (node.arguments && node.arguments.length > 0) { + node.arguments.forEach((arg: ts.Expression) => { + // Get the source text of the argument node + argsText.push(arg.getText(sourceFile)); + + if (ts.isStringLiteral(arg)) { + errorMessage = arg.getText(sourceFile); + } else if (ts.isNumericLiteral(arg)) { + assertionId = arg.getText(sourceFile); + } + }); + } + + // Store the information (add 1 to line/char for 1-based indexing) + foundCalls.push({ + fileName: filePath, // Store the full path + functionName, + line: line + 1, + character: character + 1, + argumentsText: argsText, // Store the extracted arguments, + errorMessage, + assertionId: assertionId ?? 'INVALID' + }); + } + } + + // Continue traversing down the AST + ts.forEachChild(node, visit); + }; + + // Start traversal from the root SourceFile node + visit(sourceFile); + } // End loop through filePaths + + return foundCalls; +} + +// --- Action Handlers --- + +function handleList(occurrences: CallSiteInfo[]): void { + if (occurrences.length === 0) { + log('No assertion ids found.'); + return; + } + + occurrences + .sort((a, b) => a.assertionId.localeCompare(b.assertionId)) + .forEach(call => { + console.log( + `ID: ${call.assertionId}; MESSAGE: ${call.errorMessage}; SOURCE: '${ + call.functionName + }' call at ${path.relative(process.cwd(), call.fileName)}:${ + call.line + }:${call.character}` + ); + }); +} + +function find( + occurrences: CallSiteInfo[], + targetId: string | number +): CallSiteInfo[] { + const target = + typeof targetId === 'number' ? targetId.toString(16) : targetId; + return occurrences.filter(o => String(o.assertionId) === String(target)); +} + +function handleFind( + occurrences: CallSiteInfo[], + targetId: string | number +): void { + const foundLocations = find(occurrences, targetId); + + if (foundLocations.length === 0) { + log(`Assertion id "${targetId}" not found.`); + process.exit(1); + } + + handleList(foundLocations); +} + +function handleCheck(occurrences: CallSiteInfo[]): void { + if (occurrences.length === 0) { + log('No assertion ids found to check for duplicates.'); + return; + } + const idCounts: { [id: string]: CallSiteInfo[] } = {}; + + occurrences.forEach(occ => { + // Count ID occurrences + const codeStr = String(occ.assertionId); // Use string representation as key + if (!idCounts[codeStr]) { + idCounts[codeStr] = []; + } + idCounts[codeStr].push(occ); + + // validate formats + if (!/^0x[0-9a-f]{4}$/.test(occ.assertionId)) { + console.error( + `Invalid assertion ID '${occ.assertionId}'. Must match /^0x[0-9a-f]{4}$/` + ); + + const relativePath = path.relative(process.cwd(), occ.fileName); + console.error(`- at '${relativePath}:${occ.line}:${occ.character}`); + } + }); + + let duplicatesFound = false; + log('Checking for duplicate assertion id usage:'); + Object.entries(idCounts).forEach(([code, locations]) => { + if (locations.length > 1) { + duplicatesFound = true; + console.error( + `\nDuplicate assertion id "${code}" found at ${locations.length} locations:` + ); + locations.forEach(loc => { + const relativePath = path.relative(process.cwd(), loc.fileName); + console.error(`- ${relativePath}:${loc.line}:${loc.character}`); + }); + } + }); + + if (!duplicatesFound) { + log('No duplicate assertion ids found.'); + } else { + process.exit(1); + } +} + +function randomId(): string { + const randomBytes = new Uint8Array(2); + getRandomValues(randomBytes); + + return ( + '0x' + + Array.from(randomBytes) + .map(byte => byte.toString(16).padStart(2, '0')) + .join('') + ); +} + +function handleNew(occurrences: CallSiteInfo[]): void { + let newCode: string = randomId(); + + // If we find this code already is used, regenerate it. + while (find(occurrences, newCode).length > 0) { + newCode = randomId(); + } + + console.log(newCode); +} + +// --- Main Execution --- +async function main(): Promise { + const argv = yargs(hideBin(process.argv)) + .usage('Usage: $0 [options]') + .option('dir', { + alias: 'D', + describe: 'Directory to scan recursively for TS files', + type: 'string', + demandOption: true + }) + .option('verbose', { + alias: 'V', + describe: 'verbose', + type: 'boolean' + }) + .option('find', { + alias: 'F', + describe: 'Find locations of a specific {assertionId}', + type: 'string', + nargs: 1 + }) + .option('list', { + alias: 'L', + describe: 'List all unique assertion ids found (default action)', + type: 'boolean' + }) + .option('new', { + alias: 'N', + describe: 'Suggest a new assertion id based on existing ones', + type: 'boolean' + }) + .option('check', { + alias: 'C', + describe: 'Check for duplicate usage of assertion ids', + type: 'boolean' + }) + .check(argv => { + // Enforce mutual exclusivity among options *within* the scan command + const options = [argv.F, argv.L, argv.N, argv.C].filter(Boolean).length; + if (options > 1) { + throw new Error('Options -F, -L, -N, -C are mutually exclusive.'); + } + return true; + }) + .help() + .alias('help', 'h') + .strict() + .parse(); // Execute parsing + + // Extract directory path (safe due to demandOption) + const targetDirectory = path.resolve(argv['dir'] as string); + + // set verbosity + isVerbose = !!argv['verbose']; + + // Validate directory + try { + const stats = fs.statSync(targetDirectory); + if (!stats.isDirectory()) { + console.error( + `Error: Provided path is not a directory: ${targetDirectory}` + ); + process.exit(1); + } + } catch (error: any) { + console.error( + `Error accessing directory ${targetDirectory}: ${error.message}` + ); + process.exit(1); + } + + log(`Scanning directory: ${targetDirectory}`); + const filesToScan = getTsFilesRecursive(targetDirectory); + + if (filesToScan.length === 0) { + log('No relevant .ts or .tsx files found.'); + process.exit(0); + } + log(`Found ${filesToScan.length} files. Analyzing for assertion ids...`); + + const allOccurrences = findFunctionCalls(filesToScan); + log( + `Scan complete. Found ${allOccurrences.length} potential assertion id occurrences.` + ); + + // Determine action based on flags + if (argv['find']) { + handleFind(allOccurrences, argv['find']); + } else if (argv['new']) { + handleNew(allOccurrences); + } else if (argv['check']) { + handleCheck(allOccurrences); + } else { + // Default action is List (-L or no flag) + handleList(allOccurrences); + } +} + +// Run the main function +void main(); diff --git a/packages/firestore/scripts/build-bundle.js b/packages/firestore/scripts/build-bundle.js index b44311571e3..f8ba283a5a8 100644 --- a/packages/firestore/scripts/build-bundle.js +++ b/packages/firestore/scripts/build-bundle.js @@ -14,4 +14,4 @@ * 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. - */var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0){var method=declaration.name.text;if(method==="debugAssert"){updatedNode=ts.factory.createOmittedExpression()}else if(method==="hardAssert"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,[node.arguments[0]])}else if(method==="fail"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,[])}}}}if(updatedNode){ts.setSourceMapRange(updatedNode,ts.getSourceMapRange(node));return updatedNode}else{return node}};return RemoveAsserts}(); \ No newline at end of file + */Object.defineProperty(exports,"__esModule",{value:true});exports.removeAsserts=removeAsserts;var ts=require("typescript");var ASSERT_LOCATION="packages/firestore/src/util/assert.ts";function removeAsserts(program){var removeAsserts=new RemoveAsserts(program.getTypeChecker());return function(context){return function(file){return removeAsserts.visitNodeAndChildren(file,context)}}}var RemoveAsserts=function(){function RemoveAsserts(typeChecker){this.typeChecker=typeChecker}RemoveAsserts.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RemoveAsserts.prototype.visitNode=function(node){var updatedNode=null;if(ts.isCallExpression(node)){var signature=this.typeChecker.getResolvedSignature(node);if(signature&&signature.declaration&&signature.declaration.kind===ts.SyntaxKind.FunctionDeclaration){var declaration=signature.declaration;if(declaration&&declaration.getSourceFile().fileName.indexOf(ASSERT_LOCATION)>=0){var method=declaration.name.text;if(method==="debugAssert"){updatedNode=ts.factory.createOmittedExpression()}else if(method==="hardAssert"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,node.arguments.filter((function(value){return!ts.isStringLiteral(value)})))}else if(method==="fail"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,node.arguments.filter((function(value){return!ts.isStringLiteral(value)})))}}}}if(updatedNode){ts.setSourceMapRange(updatedNode,ts.getSourceMapRange(node));return updatedNode}else{return node}};return RemoveAsserts}(); \ No newline at end of file diff --git a/packages/firestore/scripts/remove-asserts.ts b/packages/firestore/scripts/remove-asserts.ts index fb3e2af6a34..f55907ec152 100644 --- a/packages/firestore/scripts/remove-asserts.ts +++ b/packages/firestore/scripts/remove-asserts.ts @@ -70,14 +70,14 @@ class RemoveAsserts { updatedNode = ts.factory.createCallExpression( declaration.name!, /*typeArgs*/ undefined, - [node.arguments[0]] + node.arguments.filter(value => !ts.isStringLiteral(value)) ); } else if (method === 'fail') { // Remove the log message updatedNode = ts.factory.createCallExpression( declaration.name!, /*typeArgs*/ undefined, - [] + node.arguments.filter(value => !ts.isStringLiteral(value)) ); } } diff --git a/packages/firestore/scripts/rename-internals.js b/packages/firestore/scripts/rename-internals.js index fa8394a2261..4d5ebf1a838 100644 --- a/packages/firestore/scripts/rename-internals.js +++ b/packages/firestore/scripts/rename-internals.js @@ -14,4 +14,4 @@ * 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. - */exports.__esModule=true;exports.renameInternals=void 0;var ts=require("typescript");var ignoredIdentifiers=["undefined"];var RenameInternals=function(){function RenameInternals(publicApi,prefix){this.publicApi=publicApi;this.prefix=prefix}RenameInternals.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RenameInternals.prototype.visitNode=function(node){if(ts.isIdentifier(node)){var name_1=node.escapedText.toString();if(!this.publicApi.has(name_1)&&ignoredIdentifiers.indexOf(node.escapedText.toString())===-1){var newIdentifier=ts.factory.createIdentifier(this.prefix+name_1);ts.setSourceMapRange(newIdentifier,ts.getSourceMapRange(node));return newIdentifier}}return node};return RenameInternals}();var DEFAULT_PREFIX="_";function renameInternals(program,config){var _a;var prefix=(_a=config.prefix)!==null&&_a!==void 0?_a:DEFAULT_PREFIX;var renamer=new RenameInternals(config.publicIdentifiers,prefix);return function(context){return function(file){return renamer.visitNodeAndChildren(file,context)}}}exports.renameInternals=renameInternals; \ No newline at end of file + */Object.defineProperty(exports,"__esModule",{value:true});exports.renameInternals=renameInternals;var ts=require("typescript");var ignoredIdentifiers=["undefined"];var RenameInternals=function(){function RenameInternals(publicApi,prefix){this.publicApi=publicApi;this.prefix=prefix}RenameInternals.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RenameInternals.prototype.visitNode=function(node){if(ts.isIdentifier(node)){var name_1=node.escapedText.toString();if(!this.publicApi.has(name_1)&&ignoredIdentifiers.indexOf(node.escapedText.toString())===-1){var newIdentifier=ts.factory.createIdentifier(this.prefix+name_1);ts.setSourceMapRange(newIdentifier,ts.getSourceMapRange(node));return newIdentifier}}return node};return RenameInternals}();var DEFAULT_PREFIX="_";function renameInternals(program,config){var _a;var prefix=(_a=config.prefix)!==null&&_a!==void 0?_a:DEFAULT_PREFIX;var renamer=new RenameInternals(config.publicIdentifiers,prefix);return function(context){return function(file){return renamer.visitNodeAndChildren(file,context)}}} \ No newline at end of file diff --git a/packages/firestore/scripts/run-tests.js b/packages/firestore/scripts/run-tests.js new file mode 100644 index 00000000000..3a2e171b649 --- /dev/null +++ b/packages/firestore/scripts/run-tests.js @@ -0,0 +1,17 @@ +"use strict"; +/** + * @license + * Copyright 2020 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. + */Object.defineProperty(exports,"__esModule",{value:true});var path_1=require("path");var child_process_promise_1=require("child-process-promise");var yargs=require("yargs");var argv=yargs.options({main:{type:"string",demandOption:true},platform:{type:"string",default:"node"},emulator:{type:"boolean"},persistence:{type:"boolean"},databaseId:{type:"string"}}).parseSync();var nyc=(0,path_1.resolve)(__dirname,"../../../node_modules/.bin/nyc");var mocha=(0,path_1.resolve)(__dirname,"../../../node_modules/.bin/mocha");var babel=(0,path_1.resolve)(__dirname,"../babel-register.js");process.env.NO_TS_NODE="true";process.env.TEST_PLATFORM=argv.platform;var args=["--reporter","lcovonly",mocha,"--require",babel,"--require",argv.main,"--config","../../config/mocharc.node.js"];if(argv.emulator){process.env.FIRESTORE_TARGET_BACKEND="emulator"}if(argv.persistence){process.env.USE_MOCK_PERSISTENCE="YES";args.push("--require","test/util/node_persistence.ts")}if(argv.databaseId){process.env.FIRESTORE_TARGET_DB_ID=argv.databaseId}args=args.concat(argv._);var childProcess=(0,child_process_promise_1.spawn)(nyc,args,{stdio:"inherit",cwd:process.cwd()}).childProcess;process.once("exit",(function(){return childProcess.kill()}));process.once("SIGINT",(function(){return childProcess.kill("SIGINT")}));process.once("SIGTERM",(function(){return childProcess.kill("SIGTERM")})); \ No newline at end of file diff --git a/packages/firestore/scripts/run-tests.ts b/packages/firestore/scripts/run-tests.ts index 7e5cdf8fc80..bd721944647 100644 --- a/packages/firestore/scripts/run-tests.ts +++ b/packages/firestore/scripts/run-tests.ts @@ -20,32 +20,34 @@ import { resolve } from 'path'; import { spawn } from 'child-process-promise'; import * as yargs from 'yargs'; -const argv = yargs.options({ - main: { - type: 'string', - demandOption: true - }, - platform: { - type: 'string', - default: 'node' - }, - emulator: { - type: 'boolean' - }, - persistence: { - type: 'boolean' - }, - databaseId: { - type: 'string' - } -}).parseSync(); +const argv = yargs + .options({ + main: { + type: 'string', + demandOption: true + }, + platform: { + type: 'string', + default: 'node' + }, + emulator: { + type: 'boolean' + }, + persistence: { + type: 'boolean' + }, + databaseId: { + type: 'string' + } + }) + .parseSync(); const nyc = resolve(__dirname, '../../../node_modules/.bin/nyc'); const mocha = resolve(__dirname, '../../../node_modules/.bin/mocha'); const babel = resolve(__dirname, '../babel-register.js'); // used in '../../config/mocharc.node.js' to disable ts-node -process.env.NO_TS_NODE = "true"; +process.env.NO_TS_NODE = 'true'; process.env.TEST_PLATFORM = argv.platform; let args = [ diff --git a/packages/firestore/src/api/credentials.ts b/packages/firestore/src/api/credentials.ts index b542ec80b91..c1b10d61057 100644 --- a/packages/firestore/src/api/credentials.ts +++ b/packages/firestore/src/api/credentials.ts @@ -207,7 +207,9 @@ export class LiteAuthCredentialsProvider implements CredentialsProvider { if (tokenData) { hardAssert( typeof tokenData.accessToken === 'string', - 'Invalid tokenData returned from getToken():' + tokenData + 0xa539, + 'Invalid tokenData returned from getToken()', + { tokenData } ); return new OAuthToken( tokenData.accessToken, @@ -259,6 +261,7 @@ export class FirebaseAuthCredentialsProvider ): void { hardAssert( this.tokenListener === undefined, + 0xa540, 'Token listener already added' ); let lastTokenId = this.tokenCounter; @@ -357,7 +360,9 @@ export class FirebaseAuthCredentialsProvider if (tokenData) { hardAssert( typeof tokenData.accessToken === 'string', - 'Invalid tokenData returned from getToken():' + tokenData + 0x7c5d, + 'Invalid tokenData returned from getToken()', + { tokenData } ); return new OAuthToken(tokenData.accessToken, this.currentUser); } else { @@ -386,7 +391,9 @@ export class FirebaseAuthCredentialsProvider const currentUid = this.auth && this.auth.getUid(); hardAssert( currentUid === null || typeof currentUid === 'string', - 'Received invalid UID: ' + currentUid + 0x0807, + 'Received invalid UID', + { currentUid } ); return new User(currentUid); } @@ -513,6 +520,7 @@ export class FirebaseAppCheckTokenProvider ): void { hardAssert( this.tokenListener === undefined, + 0x0db8, 'Token listener already added' ); @@ -588,7 +596,9 @@ export class FirebaseAppCheckTokenProvider if (tokenResult) { hardAssert( typeof tokenResult.token === 'string', - 'Invalid tokenResult returned from getToken():' + tokenResult + 0xae0e, + 'Invalid tokenResult returned from getToken()', + { tokenResult } ); this.latestAppCheckToken = tokenResult.token; return new AppCheckToken(tokenResult.token); @@ -659,7 +669,9 @@ export class LiteAppCheckTokenProvider implements CredentialsProvider { if (tokenResult) { hardAssert( typeof tokenResult.token === 'string', - 'Invalid tokenResult returned from getToken():' + tokenResult + 0x0d8e, + 'Invalid tokenResult returned from getToken()', + { tokenResult } ); return new AppCheckToken(tokenResult.token); } else { diff --git a/packages/firestore/src/api/snapshot.ts b/packages/firestore/src/api/snapshot.ts index 29e1616b61c..669ac26cafe 100644 --- a/packages/firestore/src/api/snapshot.ts +++ b/packages/firestore/src/api/snapshot.ts @@ -749,7 +749,7 @@ export function resultChangeType(type: ChangeType): DocumentChangeType { case ChangeType.Removed: return 'removed'; default: - return fail('Unknown change type: ' + type); + return fail(0xf03d, 'Unknown change type', { type }); } } diff --git a/packages/firestore/src/core/component_provider.ts b/packages/firestore/src/core/component_provider.ts index 8a63509232c..183a1046cc9 100644 --- a/packages/firestore/src/core/component_provider.ts +++ b/packages/firestore/src/core/component_provider.ts @@ -197,6 +197,7 @@ export class LruGcMemoryOfflineComponentProvider extends MemoryOfflineComponentP ): Scheduler | null { hardAssert( this.persistence.referenceDelegate instanceof MemoryLruDelegate, + 0xb743, 'referenceDelegate is expected to be an instance of MemoryLruDelegate.' ); diff --git a/packages/firestore/src/core/filter.ts b/packages/firestore/src/core/filter.ts index 12b57729f81..b3ae3d0619b 100644 --- a/packages/firestore/src/core/filter.ts +++ b/packages/firestore/src/core/filter.ts @@ -169,7 +169,9 @@ export class FieldFilter extends Filter { case Operator.GREATER_THAN_OR_EQUAL: return comparison >= 0; default: - return fail('Unknown FieldFilter operator: ' + this.op); + return fail(0xb8a2, 'Unknown FieldFilter operator', { + operator: this.op + }); } } @@ -316,7 +318,7 @@ export function filterEquals(f1: Filter, f2: Filter): boolean { } else if (f1 instanceof CompositeFilter) { return compositeFilterEquals(f1, f2); } else { - fail('Only FieldFilters and CompositeFilters can be compared'); + fail(0x4bef, 'Only FieldFilters and CompositeFilters can be compared'); } } diff --git a/packages/firestore/src/core/query.ts b/packages/firestore/src/core/query.ts index b13296ad7ee..ca875bbb14d 100644 --- a/packages/firestore/src/core/query.ts +++ b/packages/firestore/src/core/query.ts @@ -578,6 +578,6 @@ export function compareDocs( case Direction.DESCENDING: return -1 * comparison; default: - return fail('Unknown direction: ' + orderBy.dir); + return fail(0x4d4e, 'Unknown direction', { direction: orderBy.dir }); } } diff --git a/packages/firestore/src/core/sync_engine_impl.ts b/packages/firestore/src/core/sync_engine_impl.ts index f96cbea0f00..404d4663a47 100644 --- a/packages/firestore/src/core/sync_engine_impl.ts +++ b/packages/firestore/src/core/sync_engine_impl.ts @@ -579,6 +579,7 @@ export async function syncEngineApplyRemoteEvent( targetChange.modifiedDocuments.size + targetChange.removedDocuments.size <= 1, + 0x5858, 'Limbo resolution for single document contains multiple changes.' ); if (targetChange.addedDocuments.size > 0) { @@ -586,11 +587,13 @@ export async function syncEngineApplyRemoteEvent( } else if (targetChange.modifiedDocuments.size > 0) { hardAssert( limboResolution.receivedDocument, + 0x390f, 'Received change for limbo target document without add.' ); } else if (targetChange.removedDocuments.size > 0) { hardAssert( limboResolution.receivedDocument, + 0xa4f3, 'Received remove for limbo target document without add.' ); limboResolution.receivedDocument = false; @@ -994,7 +997,7 @@ function updateTrackedLimbos( removeLimboTarget(syncEngineImpl, limboChange.key); } } else { - fail('Unknown limbo change: ' + JSON.stringify(limboChange)); + fail(0x4d4f, 'Unknown limbo change', { limboChange }); } } } @@ -1317,7 +1320,7 @@ export async function syncEngineApplyBatchState( batchId ); } else { - fail(`Unknown batchState: ${batchState}`); + fail(0x1a40, `Unknown batchState`, { batchState }); } await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, documents); @@ -1560,7 +1563,7 @@ export async function syncEngineApplyTargetState( break; } default: - fail('Unexpected target state: ' + state); + fail(0xfa9b, 'Unexpected target state', state); } } } diff --git a/packages/firestore/src/core/transaction.ts b/packages/firestore/src/core/transaction.ts index 471c64e13bd..d3dc6ee8a89 100644 --- a/packages/firestore/src/core/transaction.ts +++ b/packages/firestore/src/core/transaction.ts @@ -124,7 +124,9 @@ export class Transaction { // Represent a deleted doc using SnapshotVersion.min(). docVersion = SnapshotVersion.min(); } else { - throw fail('Document in a transaction was a ' + doc.constructor.name); + throw fail(0xc542, 'Document in a transaction was a ', { + documentName: doc.constructor.name + }); } const existingVersion = this.readVersions.get(doc.key.toString()); diff --git a/packages/firestore/src/core/view.ts b/packages/firestore/src/core/view.ts index b0a07bd783c..e0909de938f 100644 --- a/packages/firestore/src/core/view.ts +++ b/packages/firestore/src/core/view.ts @@ -505,7 +505,7 @@ function compareChangeType(c1: ChangeType, c2: ChangeType): number { case ChangeType.Removed: return 0; default: - return fail('Unknown ChangeType: ' + change); + return fail(0x4f35, 'Unknown ChangeType', { change }); } }; diff --git a/packages/firestore/src/core/view_snapshot.ts b/packages/firestore/src/core/view_snapshot.ts index f15c5ccb409..3bb6e8ae134 100644 --- a/packages/firestore/src/core/view_snapshot.ts +++ b/packages/firestore/src/core/view_snapshot.ts @@ -118,10 +118,12 @@ export class DocumentChangeSet { // Metadata->Added // Removed->Metadata fail( - 'unsupported combination of changes: ' + - JSON.stringify(change) + - ' after ' + - JSON.stringify(oldChange) + 0xf76d, + 'unsupported combination of changes: `change` after `oldChange`', + { + change, + oldChange + } ); } } diff --git a/packages/firestore/src/index/firestore_index_value_writer.ts b/packages/firestore/src/index/firestore_index_value_writer.ts index dfdb3836578..b76ca7a930a 100644 --- a/packages/firestore/src/index/firestore_index_value_writer.ts +++ b/packages/firestore/src/index/firestore_index_value_writer.ts @@ -136,7 +136,7 @@ export class FirestoreIndexValueWriter { this.writeIndexArray(indexValue.arrayValue!, encoder); this.writeTruncationMarker(encoder); } else { - fail('unknown index value type ' + indexValue); + fail(0x4a4e, 'unknown index value type', { indexValue }); } } diff --git a/packages/firestore/src/lite-api/reference_impl.ts b/packages/firestore/src/lite-api/reference_impl.ts index 6876ed0a877..6d92ccab479 100644 --- a/packages/firestore/src/lite-api/reference_impl.ts +++ b/packages/firestore/src/lite-api/reference_impl.ts @@ -133,7 +133,11 @@ export function getDoc( return invokeBatchGetDocumentsRpc(datastore, [reference._key]).then( result => { - hardAssert(result.length === 1, 'Expected a single document result'); + hardAssert( + result.length === 1, + 0x3d02, + 'Expected a single document result' + ); const document = result[0]; return new DocumentSnapshot( reference.firestore, diff --git a/packages/firestore/src/lite-api/transaction.ts b/packages/firestore/src/lite-api/transaction.ts index 10a07ef252c..9a405feebea 100644 --- a/packages/firestore/src/lite-api/transaction.ts +++ b/packages/firestore/src/lite-api/transaction.ts @@ -94,7 +94,7 @@ export class Transaction { const userDataWriter = new LiteUserDataWriter(this._firestore); return this._transaction.lookup([ref._key]).then(docs => { if (!docs || docs.length !== 1) { - return fail('Mismatch in docs returned from document lookup.'); + return fail(0x5de9, 'Mismatch in docs returned from document lookup.'); } const doc = docs[0]; if (doc.isFoundDocument()) { @@ -115,7 +115,11 @@ export class Transaction { ); } else { throw fail( - `BatchGetDocumentsRequest returned unexpected document: ${doc}` + 0x4801, + 'BatchGetDocumentsRequest returned unexpected document', + { + doc + } ); } }); diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index ebd4b49085f..aa5f9eeb5bf 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -175,7 +175,9 @@ function isWrite(dataSource: UserDataSource): boolean { case UserDataSource.ArrayArgument: return false; default: - throw fail(`Unexpected case for UserDataSource: ${dataSource}`); + throw fail(0x9c4b, 'Unexpected case for UserDataSource', { + dataSource + }); } } diff --git a/packages/firestore/src/lite-api/user_data_writer.ts b/packages/firestore/src/lite-api/user_data_writer.ts index e903991cb58..070c71c7832 100644 --- a/packages/firestore/src/lite-api/user_data_writer.ts +++ b/packages/firestore/src/lite-api/user_data_writer.ts @@ -89,7 +89,9 @@ export abstract class AbstractUserDataWriter { case TypeOrder.VectorValue: return this.convertVectorValue(value.mapValue!); default: - throw fail('Invalid value type: ' + JSON.stringify(value)); + throw fail(0xf2a2, 'Invalid value type', { + value + }); } } @@ -173,7 +175,9 @@ export abstract class AbstractUserDataWriter { const resourcePath = ResourcePath.fromString(name); hardAssert( isValidResourceName(resourcePath), - 'ReferenceValue is not valid ' + name + 0x25d8, + 'ReferenceValue is not valid', + { name } ); const databaseId = new DatabaseId(resourcePath.get(1), resourcePath.get(3)); const key = new DocumentKey(resourcePath.popFirst(5)); diff --git a/packages/firestore/src/local/encoded_resource_path.ts b/packages/firestore/src/local/encoded_resource_path.ts index b52b8bd6805..497a65fdf8c 100644 --- a/packages/firestore/src/local/encoded_resource_path.ts +++ b/packages/firestore/src/local/encoded_resource_path.ts @@ -118,11 +118,13 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath { // Event the empty path must encode as a path of at least length 2. A path // with exactly 2 must be the empty path. const length = path.length; - hardAssert(length >= 2, 'Invalid path ' + path); + hardAssert(length >= 2, 0xfb98, 'Invalid path', { path }); if (length === 2) { hardAssert( path.charAt(0) === escapeChar && path.charAt(1) === encodedSeparatorChar, - 'Non-empty path ' + path + ' had length 2' + 0xdb51, + 'Non-empty path had length 2', + { path } ); return ResourcePath.emptyPath(); } @@ -139,7 +141,7 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath { // there must be an end to this segment. const end = path.indexOf(escapeChar, start); if (end < 0 || end > lastReasonableEscapeIndex) { - fail('Invalid encoded resource path: "' + path + '"'); + fail(0xc553, 'Invalid encoded resource path', { path }); } const next = path.charAt(end + 1); @@ -167,7 +169,7 @@ export function decodeResourcePath(path: EncodedResourcePath): ResourcePath { segmentBuilder += path.substring(start, end + 1); break; default: - fail('Invalid encoded resource path: "' + path + '"'); + fail(0xeeef, 'Invalid encoded resource path', { path }); } start = end + 2; diff --git a/packages/firestore/src/local/indexeddb_index_manager.ts b/packages/firestore/src/local/indexeddb_index_manager.ts index 04a380601b3..d2b8bc47163 100644 --- a/packages/firestore/src/local/indexeddb_index_manager.ts +++ b/packages/firestore/src/local/indexeddb_index_manager.ts @@ -1066,7 +1066,7 @@ export class IndexedDbIndexManager implements IndexManager { this.getSubTargets(target), (subTarget: Target) => this.getFieldIndex(transaction, subTarget).next(index => - index ? index : fail('Target cannot be served from index') + index ? index : fail(0xad8a, 'Target cannot be served from index') ) ).next(getMinOffsetFromFieldIndexes); } @@ -1118,6 +1118,7 @@ function indexStateStore( function getMinOffsetFromFieldIndexes(fieldIndexes: FieldIndex[]): IndexOffset { hardAssert( fieldIndexes.length !== 0, + 0x7099, 'Found empty index group when looking for least recent index offset.' ); diff --git a/packages/firestore/src/local/indexeddb_mutation_batch_impl.ts b/packages/firestore/src/local/indexeddb_mutation_batch_impl.ts index 16b157accb2..64b6df20b7e 100644 --- a/packages/firestore/src/local/indexeddb_mutation_batch_impl.ts +++ b/packages/firestore/src/local/indexeddb_mutation_batch_impl.ts @@ -64,8 +64,9 @@ export function removeMutationBatch( removePromise.next(() => { hardAssert( numDeleted === 1, - 'Dangling document-mutation reference found: Missing batch ' + - batch.batchId + 0xb7de, + 'Dangling document-mutation reference found: Missing batch', + { batchId: batch.batchId } ); }) ); @@ -100,7 +101,7 @@ export function dbDocumentSize( } else if (doc.noDocument) { value = doc.noDocument; } else { - throw fail('Unknown remote document type'); + throw fail(0x398b, 'Unknown remote document type'); } return JSON.stringify(value).length; } diff --git a/packages/firestore/src/local/indexeddb_mutation_queue.ts b/packages/firestore/src/local/indexeddb_mutation_queue.ts index 0aedf650769..bcdafa6aa36 100644 --- a/packages/firestore/src/local/indexeddb_mutation_queue.ts +++ b/packages/firestore/src/local/indexeddb_mutation_queue.ts @@ -105,7 +105,7 @@ export class IndexedDbMutationQueue implements MutationQueue { // In particular, are there any reserved characters? are empty ids allowed? // For the moment store these together in the same mutations table assuming // that empty userIDs aren't allowed. - hardAssert(user.uid !== '', 'UserID must not be an empty string.'); + hardAssert(user.uid !== '', 0xfb83, 'UserID must not be an empty string.'); const userId = user.isAuthenticated() ? user.uid! : ''; return new IndexedDbMutationQueue( userId, @@ -154,6 +154,7 @@ export class IndexedDbMutationQueue implements MutationQueue { return mutationStore.add({} as any).next(batchId => { hardAssert( typeof batchId === 'number', + 0xbf7b, 'Auto-generated key is not a number' ); @@ -206,7 +207,12 @@ export class IndexedDbMutationQueue implements MutationQueue { if (dbBatch) { hardAssert( dbBatch.userId === this.userId, - `Unexpected user '${dbBatch.userId}' for mutation batch ${batchId}` + 0x0030, + `Unexpected user for mutation batch`, + { + userId: dbBatch.userId, + batchId + } ); return fromDbMutationBatch(this.serializer, dbBatch); } @@ -257,7 +263,9 @@ export class IndexedDbMutationQueue implements MutationQueue { if (dbBatch.userId === this.userId) { hardAssert( dbBatch.batchId >= nextBatchId, - 'Should have found mutation after ' + nextBatchId + 0xb9a4, + 'Should have found mutation after `nextBatchId`', + { nextBatchId } ); foundBatch = fromDbMutationBatch(this.serializer, dbBatch); } @@ -336,15 +344,22 @@ export class IndexedDbMutationQueue implements MutationQueue { .next(mutation => { if (!mutation) { throw fail( - 'Dangling document-mutation reference found: ' + - indexKey + - ' which points to ' + + 0xf028, + 'Dangling document-mutation reference found: `indexKey` which points to `batchId`', + { + indexKey, batchId + } ); } hardAssert( mutation.userId === this.userId, - `Unexpected user '${mutation.userId}' for mutation batch ${batchId}` + 0x2907, + `Unexpected user for mutation batch`, + { + userId: mutation.userId, + batchId + } ); results.push(fromDbMutationBatch(this.serializer, mutation)); }); @@ -468,14 +483,18 @@ export class IndexedDbMutationQueue implements MutationQueue { .next(mutation => { if (mutation === null) { throw fail( - 'Dangling document-mutation reference found, ' + - 'which points to ' + + 0x89ca, + 'Dangling document-mutation reference found, which points to `batchId`', + { batchId + } ); } hardAssert( mutation.userId === this.userId, - `Unexpected user '${mutation.userId}' for mutation batch ${batchId}` + 0x2614, + `Unexpected user for mutation batch`, + { userId: mutation.userId, batchId } ); results.push(fromDbMutationBatch(this.serializer, mutation)); }) @@ -549,9 +568,13 @@ export class IndexedDbMutationQueue implements MutationQueue { .next(() => { hardAssert( danglingMutationReferences.length === 0, - 'Document leak -- detected dangling mutation references when queue is empty. ' + - 'Dangling keys: ' + - danglingMutationReferences.map(p => p.canonicalString()) + 0xdd90, + 'Document leak -- detected dangling mutation references when queue is empty.', + { + danglingKeys: danglingMutationReferences.map(p => + p.canonicalString() + ) + } ); }); }); diff --git a/packages/firestore/src/local/indexeddb_remote_document_cache.ts b/packages/firestore/src/local/indexeddb_remote_document_cache.ts index 9b23c64fcf5..fffe935c4f9 100644 --- a/packages/firestore/src/local/indexeddb_remote_document_cache.ts +++ b/packages/firestore/src/local/indexeddb_remote_document_cache.ts @@ -381,7 +381,7 @@ class IndexedDbRemoteDocumentCacheImpl implements IndexedDbRemoteDocumentCache { return documentGlobalStore(txn) .get(DbRemoteDocumentGlobalKey) .next(metadata => { - hardAssert(!!metadata, 'Missing document cache metadata'); + hardAssert(!!metadata, 0x4e35, 'Missing document cache metadata'); return metadata!; }); } diff --git a/packages/firestore/src/local/indexeddb_schema_converter.ts b/packages/firestore/src/local/indexeddb_schema_converter.ts index 9d7485f4a92..7446ae7ae20 100644 --- a/packages/firestore/src/local/indexeddb_schema_converter.ts +++ b/packages/firestore/src/local/indexeddb_schema_converter.ts @@ -326,7 +326,9 @@ export class SchemaConverter implements SimpleDbSchemaConverter { (dbBatch: DbMutationBatch) => { hardAssert( dbBatch.userId === queue.userId, - `Cannot process batch ${dbBatch.batchId} from unexpected user` + 0x48da, + `Cannot process batch from unexpected user`, + { batchId: dbBatch.batchId } ); const batch = fromDbMutationBatch(this.serializer, dbBatch); @@ -772,6 +774,6 @@ function extractKey(remoteDoc: DbRemoteDocumentLegacy): DocumentKey { } else if (remoteDoc.unknownDocument) { return DocumentKey.fromSegments(remoteDoc.unknownDocument.path); } else { - return fail('Unexpected DbRemoteDocument'); + return fail(0x8faf, 'Unexpected DbRemoteDocument'); } } diff --git a/packages/firestore/src/local/indexeddb_sentinels.ts b/packages/firestore/src/local/indexeddb_sentinels.ts index e1e3ead3aa2..cb6ebcb664a 100644 --- a/packages/firestore/src/local/indexeddb_sentinels.ts +++ b/packages/firestore/src/local/indexeddb_sentinels.ts @@ -450,6 +450,6 @@ export function getObjectStores(schemaVersion: number): string[] { } else if (schemaVersion === 11) { return V11_STORES; } else { - fail('Only schema version 11 and 12 and 13 are supported'); + fail(0xeb55, 'Only schema version 11 and 12 and 13 are supported'); } } diff --git a/packages/firestore/src/local/indexeddb_target_cache.ts b/packages/firestore/src/local/indexeddb_target_cache.ts index 9e93cc68838..1d5ed8f0c8b 100644 --- a/packages/firestore/src/local/indexeddb_target_cache.ts +++ b/packages/firestore/src/local/indexeddb_target_cache.ts @@ -144,6 +144,7 @@ export class IndexedDbTargetCache implements TargetCache { .next(metadata => { hardAssert( metadata.targetCount > 0, + 0x1f81, 'Removing from an empty target cache' ); metadata.targetCount -= 1; @@ -197,7 +198,7 @@ export class IndexedDbTargetCache implements TargetCache { return globalTargetStore(transaction) .get(DbTargetGlobalKey) .next(metadata => { - hardAssert(metadata !== null, 'Missing metadata row.'); + hardAssert(metadata !== null, 0x0b48, 'Missing metadata row.'); return metadata; }); } diff --git a/packages/firestore/src/local/local_serializer.ts b/packages/firestore/src/local/local_serializer.ts index b8916608711..bb1658caa52 100644 --- a/packages/firestore/src/local/local_serializer.ts +++ b/packages/firestore/src/local/local_serializer.ts @@ -101,7 +101,7 @@ export function fromDbRemoteDocument( const version = fromDbTimestamp(remoteDoc.unknownDocument.version); doc = MutableDocument.newUnknownDocument(key, version); } else { - return fail('Unexpected DbRemoteDocument'); + return fail(0xdd85, 'Unexpected DbRemoteDocument'); } if (remoteDoc.readTime) { @@ -138,7 +138,7 @@ export function toDbRemoteDocument( version: toDbTimestamp(document.version) }; } else { - return fail('Unexpected Document ' + document); + return fail(0xe230, 'Unexpected Document', { document }); } return remoteDoc; } diff --git a/packages/firestore/src/local/local_store_impl.ts b/packages/firestore/src/local/local_store_impl.ts index 56f2b96f8d1..31d2a46c326 100644 --- a/packages/firestore/src/local/local_store_impl.ts +++ b/packages/firestore/src/local/local_store_impl.ts @@ -494,7 +494,11 @@ export function localStoreRejectBatch( return localStoreImpl.mutationQueue .lookupMutationBatch(txn, batchId) .next((batch: MutationBatch | null) => { - hardAssert(batch !== null, 'Attempt to reject nonexistent batch!'); + hardAssert( + batch !== null, + 0x90f9, + 'Attempt to reject nonexistent batch!' + ); affectedKeys = batch.keys(); return localStoreImpl.mutationQueue.removeMutationBatch(txn, batch); }) @@ -1137,6 +1141,7 @@ function applyWriteToRemoteDocuments( const ackVersion = batchResult.docVersions.get(docKey); hardAssert( ackVersion !== null, + 0xbd9d, 'ackVersions should contain every doc in the write.' ); if (doc.version.compareTo(ackVersion!) < 0) { diff --git a/packages/firestore/src/local/memory_mutation_queue.ts b/packages/firestore/src/local/memory_mutation_queue.ts index e3902cc96fc..f136fb7ad15 100644 --- a/packages/firestore/src/local/memory_mutation_queue.ts +++ b/packages/firestore/src/local/memory_mutation_queue.ts @@ -246,6 +246,7 @@ export class MemoryMutationQueue implements MutationQueue { const batchIndex = this.indexOfExistingBatchId(batch.batchId, 'removed'); hardAssert( batchIndex === 0, + 0xd6db, 'Can only remove the first entry of the mutation queue' ); this.mutationQueue.shift(); diff --git a/packages/firestore/src/local/memory_persistence.ts b/packages/firestore/src/local/memory_persistence.ts index 30d4f2bd19a..fcb6db42059 100644 --- a/packages/firestore/src/local/memory_persistence.ts +++ b/packages/firestore/src/local/memory_persistence.ts @@ -235,7 +235,10 @@ export class MemoryEagerDelegate implements MemoryReferenceDelegate { private get orphanedDocuments(): Set { if (!this._orphanedDocuments) { - throw fail('orphanedDocuments is only valid during a transaction.'); + throw fail( + 0xee44, + 'orphanedDocuments is only valid during a transaction.' + ); } else { return this._orphanedDocuments; } diff --git a/packages/firestore/src/local/memory_remote_document_cache.ts b/packages/firestore/src/local/memory_remote_document_cache.ts index 42a0010d4ac..0daf80b6a19 100644 --- a/packages/firestore/src/local/memory_remote_document_cache.ts +++ b/packages/firestore/src/local/memory_remote_document_cache.ts @@ -219,7 +219,7 @@ class MemoryRemoteDocumentCacheImpl implements MemoryRemoteDocumentCache { ): PersistencePromise { // This method should only be called from the IndexBackfiller if persistence // is enabled. - fail('getAllFromCollectionGroup() is not supported.'); + fail(0x251c, 'getAllFromCollectionGroup() is not supported.'); } forEachDocumentKey( diff --git a/packages/firestore/src/local/persistence_promise.ts b/packages/firestore/src/local/persistence_promise.ts index 4678650fa84..812cc0fca85 100644 --- a/packages/firestore/src/local/persistence_promise.ts +++ b/packages/firestore/src/local/persistence_promise.ts @@ -86,7 +86,7 @@ export class PersistencePromise { catchFn?: RejectedHandler ): PersistencePromise { if (this.callbackAttached) { - fail('Called next() or catch() twice for PersistencePromise'); + fail(0xe830, 'Called next() or catch() twice for PersistencePromise'); } this.callbackAttached = true; if (this.isDone) { diff --git a/packages/firestore/src/local/shared_client_state.ts b/packages/firestore/src/local/shared_client_state.ts index 7c033cedb41..1000e63a0f6 100644 --- a/packages/firestore/src/local/shared_client_state.ts +++ b/packages/firestore/src/local/shared_client_state.ts @@ -1085,7 +1085,9 @@ function fromWebStorageSequenceNumber( const parsed = JSON.parse(seqString); hardAssert( typeof parsed === 'number', - 'Found non-numeric sequence number' + 0x77ac, + 'Found non-numeric sequence number', + { seqString } ); sequenceNumber = parsed; } catch (e) { diff --git a/packages/firestore/src/model/document.ts b/packages/firestore/src/model/document.ts index 830983aec43..ac454704776 100644 --- a/packages/firestore/src/model/document.ts +++ b/packages/firestore/src/model/document.ts @@ -397,6 +397,9 @@ export function compareDocumentsByField( if (v1 !== null && v2 !== null) { return valueCompare(v1, v2); } else { - return fail("Trying to compare documents on fields that don't exist"); + return fail( + 0xa786, + "Trying to compare documents on fields that don't exist" + ); } } diff --git a/packages/firestore/src/model/mutation.ts b/packages/firestore/src/model/mutation.ts index 119e9b9731b..0bcd1345b01 100644 --- a/packages/firestore/src/model/mutation.ts +++ b/packages/firestore/src/model/mutation.ts @@ -623,8 +623,12 @@ function serverTransformResults( const transformResults = new Map(); hardAssert( fieldTransforms.length === serverTransformResults.length, - `server transform result count (${serverTransformResults.length}) ` + - `should match field transform count (${fieldTransforms.length})` + 0x7f90, + 'server transform result count should match field transform count', + { + serverTransformResultCount: serverTransformResults.length, + fieldTransformCount: fieldTransforms.length + } ); for (let i = 0; i < serverTransformResults.length; i++) { diff --git a/packages/firestore/src/model/mutation_batch.ts b/packages/firestore/src/model/mutation_batch.ts index 56d5f4d2cd3..703623da01a 100644 --- a/packages/firestore/src/model/mutation_batch.ts +++ b/packages/firestore/src/model/mutation_batch.ts @@ -219,10 +219,12 @@ export class MutationBatchResult { ): MutationBatchResult { hardAssert( batch.mutations.length === results.length, - 'Mutations sent ' + - batch.mutations.length + - ' must equal results received ' + - results.length + 0xe5da, + 'Mutations sent must equal results received', + { + mutationsSent: batch.mutations.length, + resultsReceived: results.length + } ); let versionMap = documentVersionMap(); diff --git a/packages/firestore/src/model/normalize.ts b/packages/firestore/src/model/normalize.ts index 2061601d23e..986eeed1e48 100644 --- a/packages/firestore/src/model/normalize.ts +++ b/packages/firestore/src/model/normalize.ts @@ -32,7 +32,7 @@ export function normalizeTimestamp(date: Timestamp): { seconds: number; nanos: number; } { - hardAssert(!!date, 'Cannot normalize null or undefined timestamp.'); + hardAssert(!!date, 0x986a, 'Cannot normalize null or undefined timestamp.'); // The json interface (for the browser) will return an iso timestamp string, // while the proto js library (for node) will return a @@ -44,7 +44,9 @@ export function normalizeTimestamp(date: Timestamp): { // Parse the nanos right out of the string. let nanos = 0; const fraction = ISO_TIMESTAMP_REG_EXP.exec(date); - hardAssert(!!fraction, 'invalid timestamp: ' + date); + hardAssert(!!fraction, 0xb5de, 'invalid timestamp', { + timestamp: date + }); if (fraction[1]) { // Pad the fraction out to 9 digits (nanos). let nanoStr = fraction[1]; diff --git a/packages/firestore/src/model/path.ts b/packages/firestore/src/model/path.ts index c375b4c56d2..0f4581da8d8 100644 --- a/packages/firestore/src/model/path.ts +++ b/packages/firestore/src/model/path.ts @@ -35,13 +35,19 @@ abstract class BasePath> { if (offset === undefined) { offset = 0; } else if (offset > segments.length) { - fail('offset ' + offset + ' out of range ' + segments.length); + fail(0x027d, 'offset out of range', { + offset, + range: segments.length + }); } if (length === undefined) { length = segments.length - offset; } else if (length > segments.length - offset) { - fail('length ' + length + ' out of range ' + (segments.length - offset)); + fail(0x06d2, 'length out of range', { + length, + range: segments.length - offset + }); } this.segments = segments; this.offset = offset; diff --git a/packages/firestore/src/model/target_index_matcher.ts b/packages/firestore/src/model/target_index_matcher.ts index df80ffa419a..407eae337c7 100644 --- a/packages/firestore/src/model/target_index_matcher.ts +++ b/packages/firestore/src/model/target_index_matcher.ts @@ -111,6 +111,7 @@ export class TargetIndexMatcher { servedByIndex(index: FieldIndex): boolean { hardAssert( index.collectionGroup === this.collectionId, + 0xc07f, 'Collection IDs do not match' ); diff --git a/packages/firestore/src/model/values.ts b/packages/firestore/src/model/values.ts index 30d8688b776..1ef54a98ad6 100644 --- a/packages/firestore/src/model/values.ts +++ b/packages/firestore/src/model/values.ts @@ -93,7 +93,7 @@ export function typeOrder(value: Value): TypeOrder { } return TypeOrder.ObjectValue; } else { - return fail('Invalid value type: ' + JSON.stringify(value)); + return fail(0x6e87, 'Invalid value type', { value }); } } @@ -140,7 +140,7 @@ export function valueEquals(left: Value, right: Value): boolean { case TypeOrder.MaxValue: return true; default: - return fail('Unexpected value type: ' + JSON.stringify(left)); + return fail(0xcbf8, 'Unexpected value type', { left }); } } @@ -269,7 +269,7 @@ export function valueCompare(left: Value, right: Value): number { case TypeOrder.ObjectValue: return compareMaps(left.mapValue!, right.mapValue!); default: - throw fail('Invalid value type: ' + leftType); + throw fail(0x5ae0, 'Invalid value type', { leftType }); } } @@ -449,7 +449,7 @@ function canonifyValue(value: Value): string { } else if ('mapValue' in value) { return canonifyMap(value.mapValue!); } else { - return fail('Invalid value type: ' + JSON.stringify(value)); + return fail(0xee4d, 'Invalid value type', { value }); } } @@ -541,7 +541,7 @@ export function estimateByteSize(value: Value): number { case TypeOrder.ObjectValue: return estimateMapByteSize(value.mapValue!); default: - throw fail('Invalid value type: ' + JSON.stringify(value)); + throw fail(0x34ae, 'Invalid value type', { value }); } } @@ -701,7 +701,7 @@ export function valuesGetLowerBound(value: Value): Value { } return { mapValue: {} }; } else { - return fail('Invalid value type: ' + JSON.stringify(value)); + return fail(0x8c66, 'Invalid value type', { value }); } } @@ -731,7 +731,7 @@ export function valuesGetUpperBound(value: Value): Value { } return MAX_VALUE; } else { - return fail('Invalid value type: ' + JSON.stringify(value)); + return fail(0xf207, 'Invalid value type', { value }); } } diff --git a/packages/firestore/src/platform/browser/webchannel_connection.ts b/packages/firestore/src/platform/browser/webchannel_connection.ts index 206e5829c41..5223285c5a4 100644 --- a/packages/firestore/src/platform/browser/webchannel_connection.ts +++ b/packages/firestore/src/platform/browser/webchannel_connection.ts @@ -142,12 +142,14 @@ export class WebChannelConnection extends RestConnection { break; default: fail( - `RPC '${rpcName}' ${streamId} ` + - 'failed with unanticipated webchannel error: ' + - xhr.getLastErrorCode() + - ': ' + - xhr.getLastError() + - ', giving up.' + 0x235f, + 'RPC failed with unanticipated webchannel error. Giving up.', + { + rpcName, + streamId, + lastErrorCode: xhr.getLastErrorCode(), + lastError: xhr.getLastError() + } ); } } finally { @@ -353,7 +355,11 @@ export class WebChannelConnection extends RestConnection { msg => { if (!closed) { const msgData = msg.data[0]; - hardAssert(!!msgData, 'Got a webchannel message without data.'); + hardAssert( + !!msgData, + 0x3fdd, + 'Got a webchannel message without data.' + ); // TODO(b/35143891): There is a bug in One Platform that caused errors // (and only errors) to be wrapped in an extra array. To be forward // compatible with the bug we need to check either condition. The latter diff --git a/packages/firestore/src/platform/node/grpc_connection.ts b/packages/firestore/src/platform/node/grpc_connection.ts index dec3137af76..d50a3149416 100644 --- a/packages/firestore/src/platform/node/grpc_connection.ts +++ b/packages/firestore/src/platform/node/grpc_connection.ts @@ -48,6 +48,7 @@ function createMetadata( ): grpc.Metadata { hardAssert( authToken === null || authToken.type === 'OAuth', + 0x9048, 'If provided, token must be OAuth' ); const metadata = new grpc.Metadata(); diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index ac47f0cb931..f790ede0d5c 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -228,7 +228,9 @@ export async function invokeBatchGetDocumentsRpc( const result: Document[] = []; keys.forEach(key => { const doc = docs.get(key.toString()); - hardAssert(!!doc, 'Missing entity in write response for ' + key); + hardAssert(!!doc, 0xd7c2, 'Missing entity in write response for `key`', { + key + }); result.push(doc); }); return result; @@ -290,6 +292,7 @@ export async function invokeRunAggregationQueryRpc( hardAssert( filteredResult.length === 1, + 0xfcd7, 'Aggregation fields are missing from result.' ); debugAssert( diff --git a/packages/firestore/src/remote/persistent_stream.ts b/packages/firestore/src/remote/persistent_stream.ts index f9f64bec7f6..4f3b91652ad 100644 --- a/packages/firestore/src/remote/persistent_stream.ts +++ b/packages/firestore/src/remote/persistent_stream.ts @@ -809,6 +809,7 @@ export class PersistentWriteStream extends PersistentStream< // Always capture the last stream token. hardAssert( !!responseProto.streamToken, + 0x7a5a, 'Got a write handshake response without a stream token' ); this.lastStreamToken = responseProto.streamToken; @@ -816,6 +817,7 @@ export class PersistentWriteStream extends PersistentStream< // The first response is always the handshake response hardAssert( !responseProto.writeResults || responseProto.writeResults.length === 0, + 0xda08, 'Got mutation results for handshake' ); return this.listener!.onHandshakeComplete(); @@ -825,6 +827,7 @@ export class PersistentWriteStream extends PersistentStream< // Always capture the last stream token. hardAssert( !!responseProto.streamToken, + 0x3186, 'Got a write response without a stream token' ); this.lastStreamToken = responseProto.streamToken; diff --git a/packages/firestore/src/remote/rpc_error.ts b/packages/firestore/src/remote/rpc_error.ts index 479ceea36c9..2efee40f223 100644 --- a/packages/firestore/src/remote/rpc_error.ts +++ b/packages/firestore/src/remote/rpc_error.ts @@ -58,7 +58,7 @@ enum RpcCode { export function isPermanentError(code: Code): boolean { switch (code) { case Code.OK: - return fail('Treated status OK as error'); + return fail(0xfdaa, 'Treated status OK as error'); case Code.CANCELLED: case Code.UNKNOWN: case Code.DEADLINE_EXCEEDED: @@ -83,7 +83,7 @@ export function isPermanentError(code: Code): boolean { case Code.DATA_LOSS: return true; default: - return fail('Unknown status code: ' + code); + return fail(0x3c6b, 'Unknown status code', { code }); } } @@ -171,7 +171,7 @@ export function mapCodeFromRpcCode(code: number | undefined): Code { case RpcCode.DATA_LOSS: return Code.DATA_LOSS; default: - return fail('Unknown status code: ' + code); + return fail(0x999b, 'Unknown status code', { code }); } } @@ -220,7 +220,7 @@ export function mapRpcCodeFromCode(code: Code | undefined): number { case Code.DATA_LOSS: return RpcCode.DATA_LOSS; default: - return fail('Unknown status code: ' + code); + return fail(0x3019, 'Unknown status code', { code }); } } diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index 811c2ac4df6..aabdb263c1a 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -257,6 +257,7 @@ export function fromBytes( if (serializer.useProto3Json) { hardAssert( value === undefined || typeof value === 'string', + 0xe30b, 'value must be undefined or a string when using proto3 Json' ); return ByteString.fromBase64String(value ? value : ''); @@ -269,6 +270,7 @@ export function fromBytes( // does not indicate that it extends Uint8Array. value instanceof Buffer || value instanceof Uint8Array, + 0x3f41, 'value must be undefined, Buffer, or Uint8Array' ); return ByteString.fromUint8Array(value ? value : new Uint8Array()); @@ -283,7 +285,7 @@ export function toVersion( } export function fromVersion(version: ProtoTimestamp): SnapshotVersion { - hardAssert(!!version, "Trying to deserialize version that isn't set"); + hardAssert(!!version, 0xc050, "Trying to deserialize version that isn't set"); return SnapshotVersion.fromTimestamp(fromTimestamp(version)); } @@ -306,7 +308,9 @@ function fromResourceName(name: string): ResourcePath { const resource = ResourcePath.fromString(name); hardAssert( isValidResourceName(resource), - 'Tried to deserialize invalid key ' + resource.toString() + 0x27ce, + 'Tried to deserialize invalid key', + { key: resource.toString() } ); return resource; } @@ -389,7 +393,9 @@ function extractLocalPathFromResourceName( ): ResourcePath { hardAssert( resourceName.length > 4 && resourceName.get(4) === 'documents', - 'tried to deserialize invalid key ' + resourceName.toString() + 0x71a3, + 'tried to deserialize invalid key', + { key: resourceName.toString() } ); return resourceName.popFirst(5); } @@ -454,6 +460,7 @@ function fromFound( ): MutableDocument { hardAssert( !!doc.found, + 0xaa33, 'Tried to deserialize a found document from a missing document.' ); assertPresent(doc.found.name, 'doc.found.name'); @@ -473,10 +480,12 @@ function fromMissing( ): MutableDocument { hardAssert( !!result.missing, + 0x0f36, 'Tried to deserialize a missing document from a found document.' ); hardAssert( !!result.readTime, + 0x5995, 'Tried to deserialize a missing document without a read time.' ); const key = fromName(serializer, result.missing); @@ -493,7 +502,7 @@ export function fromBatchGetDocumentsResponse( } else if ('missing' in result) { return fromMissing(serializer, result); } - return fail('invalid batch get response: ' + JSON.stringify(result)); + return fail(0x1c42, 'invalid batch get response', { result }); } export function fromWatchChange( @@ -578,7 +587,7 @@ export function fromWatchChange( const targetId = filter.targetId; watchChange = new ExistenceFilterChange(targetId, existenceFilter); } else { - return fail('Unknown change type ' + JSON.stringify(change)); + return fail(0x2d51, 'Unknown change type', { change }); } return watchChange; } @@ -597,7 +606,7 @@ function fromWatchTargetChangeState( } else if (state === 'RESET') { return WatchTargetChangeState.Reset; } else { - return fail('Got unexpected TargetChange.state: ' + state); + return fail(0x9991, 'Got unexpected TargetChange.state', { state }); } } @@ -641,7 +650,9 @@ export function toMutation( verify: toName(serializer, mutation.key) }; } else { - return fail('Unknown mutation type ' + mutation.type); + return fail(0x40d7, 'Unknown mutation type', { + mutationType: mutation.type + }); } if (mutation.fieldTransforms.length > 0) { @@ -697,7 +708,7 @@ export function fromMutation( const key = fromName(serializer, proto.verify); return new VerifyMutation(key, precondition); } else { - return fail('unknown mutation proto: ' + JSON.stringify(proto)); + return fail(0x05b7, 'unknown mutation proto', { proto }); } } @@ -713,7 +724,7 @@ function toPrecondition( } else if (precondition.exists !== undefined) { return { exists: precondition.exists }; } else { - return fail('Unknown precondition'); + return fail(0x6b69, 'Unknown precondition'); } } @@ -755,6 +766,7 @@ export function fromWriteResults( if (protos && protos.length > 0) { hardAssert( commitTime !== undefined, + 0x3811, 'Received a write result without a commit time' ); return protos.map(proto => fromWriteResult(proto, commitTime)); @@ -793,7 +805,9 @@ function toFieldTransform( increment: transform.operand }; } else { - throw fail('Unknown transform: ' + fieldTransform.transform); + throw fail(0x51c2, 'Unknown transform', { + transform: fieldTransform.transform + }); } } @@ -805,7 +819,9 @@ function fromFieldTransform( if ('setToServerValue' in proto) { hardAssert( proto.setToServerValue === 'REQUEST_TIME', - 'Unknown server value transform proto: ' + JSON.stringify(proto) + 0x40f6, + 'Unknown server value transform proto', + { proto } ); transform = new ServerTimestampTransform(); } else if ('appendMissingElements' in proto) { @@ -820,7 +836,7 @@ function fromFieldTransform( proto.increment! ); } else { - fail('Unknown transform proto: ' + JSON.stringify(proto)); + fail(0x40c8, 'Unknown transform proto', { proto }); } const fieldPath = FieldPath.fromServerFormat(proto.fieldPath!); return new FieldTransform(fieldPath, transform!); @@ -839,7 +855,11 @@ export function fromDocumentsTarget( const count = documentsTarget.documents!.length; hardAssert( count === 1, - 'DocumentsTarget contained other than 1 document: ' + count + 0x07ae, + 'DocumentsTarget contained other than 1 document', + { + count + } ); const name = documentsTarget.documents![0]; return queryToTarget(newQueryForPath(fromQueryPath(name))); @@ -969,6 +989,7 @@ export function convertQueryTargetToQuery(target: ProtoQueryTarget): Query { if (fromCount > 0) { hardAssert( fromCount === 1, + 0xfe26, 'StructuredQuery.from with more than one collection is not supported.' ); const from = query.from![0]; @@ -1045,7 +1066,7 @@ export function toLabel(purpose: TargetPurpose): string | null { case TargetPurpose.LimboResolution: return 'limbo-document'; default: - return fail('Unrecognized query purpose: ' + purpose); + return fail(0x713b, 'Unrecognized query purpose', { purpose }); } } @@ -1116,7 +1137,7 @@ function fromFilter(filter: ProtoFilter): Filter { } else if (filter.compositeFilter !== undefined) { return fromCompositeFilter(filter); } else { - return fail('Unknown filter: ' + JSON.stringify(filter)); + return fail(0x7591, 'Unknown filter', { filter }); } } @@ -1210,9 +1231,9 @@ export function fromOperatorName(op: ProtoFieldFilterOp): Operator { case 'ARRAY_CONTAINS_ANY': return Operator.ARRAY_CONTAINS_ANY; case 'OPERATOR_UNSPECIFIED': - return fail('Unspecified operator'); + return fail(0xe2fe, 'Unspecified operator'); default: - return fail('Unknown operator'); + return fail(0xc54a, 'Unknown operator'); } } @@ -1225,7 +1246,7 @@ export function fromCompositeOperatorName( case 'OR': return CompositeOperator.OR; default: - return fail('Unknown operator'); + return fail(0x0402, 'Unknown operator'); } } @@ -1261,7 +1282,7 @@ export function toFilter(filter: Filter): ProtoFilter { } else if (filter instanceof CompositeFilter) { return toCompositeFilter(filter); } else { - return fail('Unrecognized filter type ' + JSON.stringify(filter)); + return fail(0xd65d, 'Unrecognized filter type', { filter }); } } @@ -1346,9 +1367,9 @@ export function fromUnaryFilter(filter: ProtoFilter): Filter { nullValue: 'NULL_VALUE' }); case 'OPERATOR_UNSPECIFIED': - return fail('Unspecified filter'); + return fail(0xef81, 'Unspecified filter'); default: - return fail('Unknown filter'); + return fail(0xed36, 'Unknown filter'); } } diff --git a/packages/firestore/src/remote/watch_change.ts b/packages/firestore/src/remote/watch_change.ts index 0c69163095f..a656d8fdf6e 100644 --- a/packages/firestore/src/remote/watch_change.ts +++ b/packages/firestore/src/remote/watch_change.ts @@ -203,7 +203,7 @@ class TargetState { removedDocuments = removedDocuments.add(key); break; default: - fail('Encountered invalid change type: ' + changeType); + fail(0x9481, 'Encountered invalid change type', { changeType }); } }); @@ -242,10 +242,9 @@ class TargetState { this.pendingResponses -= 1; hardAssert( this.pendingResponses >= 0, - '`pendingResponses` is less than 0. Actual value: ' + - this.pendingResponses + - '. This indicates that the SDK received more target acks from the ' + - 'server than expected. The SDK should not continue to operate.' + 0x0ca9, + '`pendingResponses` is less than 0. This indicates that the SDK received more target acks from the server than expected. The SDK should not continue to operate.', + { pendingResponses: this.pendingResponses } ); } @@ -378,7 +377,9 @@ export class WatchChangeAggregator { } break; default: - fail('Unknown target watch change state: ' + targetChange.state); + fail(0xddd6, 'Unknown target watch change state', { + state: targetChange.state + }); } }); } @@ -432,7 +433,9 @@ export class WatchChangeAggregator { } else { hardAssert( expectedCount === 1, - 'Single document existence filter with count: ' + expectedCount + 0x4e2d, + 'Single document existence filter with count', + { expectedCount } ); } } else { diff --git a/packages/firestore/src/util/assert.ts b/packages/firestore/src/util/assert.ts index 6d65e6cd19b..07ebe775e9c 100644 --- a/packages/firestore/src/util/assert.ts +++ b/packages/firestore/src/util/assert.ts @@ -26,12 +26,61 @@ import { logError } from './log'; * Returns `never` and can be used in expressions: * @example * let futureVar = fail('not implemented yet'); + * + * @param code generate a new unique value with `yarn assertion-id:generate` + * Search for an existing value using `yarn assertion-id:find X` + */ +export function fail( + code: number, + message: string, + context?: Record +): never; + +/** + * Unconditionally fails, throwing an Error with the given message. + * Messages are stripped in production builds. + * + * Returns `never` and can be used in expressions: + * @example + * let futureVar = fail('not implemented yet'); + * + * @param id generate a new unique value with `yarn assertion-id:generate` + * Search for an existing value using `yarn assertion-id:find X` */ -export function fail(failure: string = 'Unexpected state'): never { +export function fail(id: number, context?: Record): never; + +export function fail( + id: number, + messageOrContext?: string | Record, + context?: Record +): never { + let message = 'Unexpected state'; + if (typeof messageOrContext === 'string') { + message = messageOrContext; + } else { + context = messageOrContext; + } + _fail(id, message, context); +} + +function _fail( + id: number, + failure: string, + context?: Record +): never { // Log the failure in addition to throw an exception, just in case the // exception is swallowed. - const message = - `FIRESTORE (${SDK_VERSION}) INTERNAL ASSERTION FAILED: ` + failure; + let message = `FIRESTORE (${SDK_VERSION}) INTERNAL ASSERTION FAILED: ${failure} (ID: ${id.toString( + 16 + )})`; + if (context !== undefined) { + try { + const stringContext = JSON.stringify(context); + message += ' CONTEXT: ' + stringContext; + } catch (e) { + message += ' CONTEXT: ' + context; + } + } logError(message); // NOTE: We don't use FirestoreError here because these are internal failures @@ -45,13 +94,47 @@ export function fail(failure: string = 'Unexpected state'): never { * given message if it did. * * Messages are stripped in production builds. + * + * @param id generate a new unique value with `yarn assertion-idgenerate`. + * Search for an existing value using `yarn assertion-id:find X` + */ +export function hardAssert( + assertion: boolean, + id: number, + message: string, + context?: Record +): asserts assertion; + +/** + * Fails if the given assertion condition is false, throwing an Error with the + * given message if it did. + * + * Messages are stripped in production builds. + * + * @param id generate a new unique value with `yarn assertion-id:generate`. + * Search for an existing value using `yarn assertion-id:find X` */ export function hardAssert( assertion: boolean, - message?: string + id: number, + context?: Record +): asserts assertion; + +export function hardAssert( + assertion: boolean, + id: number, + messageOrContext?: string | Record, + context?: Record ): asserts assertion { + let message = 'Unexpected state'; + if (typeof messageOrContext === 'string') { + message = messageOrContext; + } else { + context = messageOrContext; + } + if (!assertion) { - fail(message); + _fail(id, message, context); } } @@ -70,7 +153,7 @@ export function debugAssert( message: string ): asserts assertion { if (!assertion) { - fail(message); + fail(0xdeb6, message); } } diff --git a/packages/firestore/src/util/async_queue_impl.ts b/packages/firestore/src/util/async_queue_impl.ts index 79eb6c23850..f8c7a995761 100644 --- a/packages/firestore/src/util/async_queue_impl.ts +++ b/packages/firestore/src/util/async_queue_impl.ts @@ -236,7 +236,9 @@ export class AsyncQueueImpl implements AsyncQueue { private verifyNotFailed(): void { if (this.failure) { - fail('AsyncQueue is already failed: ' + getMessageOrStack(this.failure)); + fail(0xb815, 'AsyncQueue is already failed', { + messageOrStack: getMessageOrStack(this.failure) + }); } } diff --git a/packages/firestore/src/util/input_validation.ts b/packages/firestore/src/util/input_validation.ts index 37e349ce910..7fd9967b5a0 100644 --- a/packages/firestore/src/util/input_validation.ts +++ b/packages/firestore/src/util/input_validation.ts @@ -128,7 +128,7 @@ export function valueDescription(input: unknown): string { } else if (typeof input === 'function') { return 'a function'; } else { - return fail('Unknown wrong type: ' + typeof input); + return fail(0x3029, 'Unknown wrong type', { type: typeof input }); } } diff --git a/packages/firestore/src/util/logic_utils.ts b/packages/firestore/src/util/logic_utils.ts index 3c3a6b19fd8..b2167c385e9 100644 --- a/packages/firestore/src/util/logic_utils.ts +++ b/packages/firestore/src/util/logic_utils.ts @@ -44,6 +44,7 @@ import { hardAssert } from './assert'; export function computeInExpansion(filter: Filter): Filter { hardAssert( filter instanceof FieldFilter || filter instanceof CompositeFilter, + 0x4e2c, 'Only field filters and composite filters are accepted.' ); @@ -90,6 +91,7 @@ export function getDnfTerms(filter: CompositeFilter): Filter[] { hardAssert( isDisjunctiveNormalForm(result), + 0x1cdf, 'computeDistributedNormalForm did not result in disjunctive normal form' ); @@ -157,6 +159,7 @@ function isDisjunctionOfFieldFiltersAndFlatConjunctions( export function computeDistributedNormalForm(filter: Filter): Filter { hardAssert( filter instanceof FieldFilter || filter instanceof CompositeFilter, + 0x84e2, 'Only field filters and composite filters are accepted.' ); @@ -182,14 +185,17 @@ export function computeDistributedNormalForm(filter: Filter): Filter { hardAssert( newFilter instanceof CompositeFilter, + 0xfbf2, 'field filters are already in DNF form' ); hardAssert( compositeFilterIsConjunction(newFilter), + 0x9d3b, 'Disjunction of filters all of which are already in DNF form is itself in DNF form.' ); hardAssert( newFilter.filters.length > 1, + 0xe247, 'Single-filter composite filters are already in DNF form.' ); @@ -201,10 +207,12 @@ export function computeDistributedNormalForm(filter: Filter): Filter { export function applyDistribution(lhs: Filter, rhs: Filter): Filter { hardAssert( lhs instanceof FieldFilter || lhs instanceof CompositeFilter, + 0x95f4, 'Only field filters and composite filters are accepted.' ); hardAssert( rhs instanceof FieldFilter || rhs instanceof CompositeFilter, + 0x6381, 'Only field filters and composite filters are accepted.' ); @@ -245,6 +253,7 @@ function applyDistributionCompositeFilters( ): Filter { hardAssert( lhs.filters.length > 0 && rhs.filters.length > 0, + 0xbb85, 'Found an empty composite filter' ); @@ -306,6 +315,7 @@ function applyDistributionFieldAndCompositeFilters( export function applyAssociation(filter: Filter): Filter { hardAssert( filter instanceof FieldFilter || filter instanceof CompositeFilter, + 0x2e4a, 'Only field filters and composite filters are accepted.' ); diff --git a/packages/firestore/src/util/sorted_map.ts b/packages/firestore/src/util/sorted_map.ts index a24cf8802ca..023354173d3 100644 --- a/packages/firestore/src/util/sorted_map.ts +++ b/packages/firestore/src/util/sorted_map.ts @@ -511,14 +511,20 @@ export class LLRBNode { // leaves is equal on both sides. This function verifies that or asserts. protected check(): number { if (this.isRed() && this.left.isRed()) { - throw fail('Red node has red child(' + this.key + ',' + this.value + ')'); + throw fail(0xaad2, 'Red node has red child', { + key: this.key, + value: this.value + }); } if (this.right.isRed()) { - throw fail('Right child of (' + this.key + ',' + this.value + ') is red'); + throw fail(0x3721, 'Right child of (`key`, `value`) is red', { + key: this.key, + value: this.value + }); } const blackDepth = (this.left as LLRBNode).check(); if (blackDepth !== (this.right as LLRBNode).check()) { - throw fail('Black depths differ'); + throw fail(0x6d2d, 'Black depths differ'); } else { return blackDepth + (this.isRed() ? 0 : 1); } @@ -528,19 +534,19 @@ export class LLRBNode { // Represents an empty node (a leaf node in the Red-Black Tree). export class LLRBEmptyNode { get key(): never { - throw fail('LLRBEmptyNode has no key.'); + throw fail(0xe1a6, 'LLRBEmptyNode has no key.'); } get value(): never { - throw fail('LLRBEmptyNode has no value.'); + throw fail(0x3f0d, 'LLRBEmptyNode has no value.'); } get color(): never { - throw fail('LLRBEmptyNode has no color.'); + throw fail(0x4157, 'LLRBEmptyNode has no color.'); } get left(): never { - throw fail('LLRBEmptyNode has no left child.'); + throw fail(0x741e, 'LLRBEmptyNode has no left child.'); } get right(): never { - throw fail('LLRBEmptyNode has no right child.'); + throw fail(0x901e, 'LLRBEmptyNode has no right child.'); } size = 0; diff --git a/packages/firestore/test/unit/index/ordered_code_writer.test.ts b/packages/firestore/test/unit/index/ordered_code_writer.test.ts index 6d87ddb4849..27956c730ee 100644 --- a/packages/firestore/test/unit/index/ordered_code_writer.test.ts +++ b/packages/firestore/test/unit/index/ordered_code_writer.test.ts @@ -248,7 +248,14 @@ function getBytes(val: unknown): { asc: Uint8Array; desc: Uint8Array } { ascWriter.writeUtf8Ascending(val); descWriter.writeUtf8Descending(val); } else { - hardAssert(val instanceof Uint8Array); + hardAssert( + val instanceof Uint8Array, + 0xa10f, + 'val is not instance of Uint8Array', + { + val + } + ); ascWriter.writeBytesAscending(ByteString.fromUint8Array(val)); descWriter.writeBytesDescending(ByteString.fromUint8Array(val)); } diff --git a/packages/firestore/test/unit/local/indexeddb_persistence.test.ts b/packages/firestore/test/unit/local/indexeddb_persistence.test.ts index e44bb73e47b..1240c977cee 100644 --- a/packages/firestore/test/unit/local/indexeddb_persistence.test.ts +++ b/packages/firestore/test/unit/local/indexeddb_persistence.test.ts @@ -1609,6 +1609,6 @@ function toLegacyDbRemoteDocument( parentPath }; } else { - return fail('Unexpected Document ' + document); + return fail(0x6bb7, 'Unexpected Document ', { document }); } } diff --git a/packages/firestore/test/unit/local/simple_db.test.ts b/packages/firestore/test/unit/local/simple_db.test.ts index b2b7ed3f95a..207e454fb5b 100644 --- a/packages/firestore/test/unit/local/simple_db.test.ts +++ b/packages/firestore/test/unit/local/simple_db.test.ts @@ -363,7 +363,7 @@ describe('SimpleDb', () => { iterated.push(value); return PersistencePromise.reject(new Error('Expected error')); }) - .next(() => fail('Promise not rejected')) + .next(() => fail(0xb9b3, 'Promise not rejected')) .catch(err => { expect(err.message).to.eq('Expected error'); expect(iterated).to.deep.equal([testData[0]]); diff --git a/packages/firestore/test/unit/specs/spec_builder.ts b/packages/firestore/test/unit/specs/spec_builder.ts index 80dcd6519de..3e52c5873b9 100644 --- a/packages/firestore/test/unit/specs/spec_builder.ts +++ b/packages/firestore/test/unit/specs/spec_builder.ts @@ -674,7 +674,7 @@ export class SpecBuilder { } else if (doc.isNoDocument()) { // Don't send any updates } else { - fail('Unknown parameter: ' + doc); + fail(0xd71c, 'Unknown parameter', { doc }); } this.watchCurrents(query, 'resume-token-' + version); this.watchSnapshots(version); @@ -1149,7 +1149,7 @@ export class SpecBuilder { userDataWriter.convertValue(filter.value) ] as SpecQueryFilter; } else { - return fail('Unknown filter: ' + filter); + return fail(0x0e51, 'Unknown filter', { filter }); } }); } @@ -1210,7 +1210,10 @@ export class SpecBuilder { targetPurpose?: TargetPurpose ): void { if (!(resume?.resumeToken || resume?.readTime) && resume?.expectedCount) { - fail('Expected count is present without a resume token or read time.'); + fail( + 0xc9a1, + 'Expected count is present without a resume token or read time.' + ); } if (this.activeTargets[targetId]) { @@ -1273,7 +1276,10 @@ export class SpecBuilder { if (queryTargetId && limboTargetId) { // TODO(dimond): add support for query for doc and limbo doc at the same // time? - fail('Found both query and limbo doc with target ID, not supported yet'); + fail( + 0x6e17, + 'Found both query and limbo doc with target ID, not supported yet' + ); } const targetId = queryTargetId || limboTargetId; debugAssert( diff --git a/packages/firestore/test/unit/specs/spec_test_components.ts b/packages/firestore/test/unit/specs/spec_test_components.ts index 2a2e480de63..017afe1d924 100644 --- a/packages/firestore/test/unit/specs/spec_test_components.ts +++ b/packages/firestore/test/unit/specs/spec_test_components.ts @@ -415,7 +415,7 @@ export class MockConnection implements Connection { } else if (request.removeTarget) { delete this.activeTargets[request.removeTarget]; } else { - fail('Invalid listen request'); + fail(0x782d, 'Invalid listen request'); } }, closeFn: () => { diff --git a/packages/firestore/test/unit/specs/spec_test_runner.ts b/packages/firestore/test/unit/specs/spec_test_runner.ts index b34421d9e0a..ee0af0b8bf8 100644 --- a/packages/firestore/test/unit/specs/spec_test_runner.ts +++ b/packages/firestore/test/unit/specs/spec_test_runner.ts @@ -477,7 +477,7 @@ abstract class TestRunner { ? this.doFailDatabase(step.failDatabase!) : this.doRecoverDatabase(); } else { - return fail('Unknown step: ' + JSON.stringify(step)); + return fail(0x6bb3, 'Unknown step: ' + JSON.stringify(step)); } } @@ -724,7 +724,7 @@ abstract class TestRunner { ); return this.doWatchEvent(change); } else { - return fail('Either doc or docs must be set'); + return fail(0xdcc3, 'Either doc or docs must be set'); } } diff --git a/packages/firestore/test/unit/util/assert.test.ts b/packages/firestore/test/unit/util/assert.test.ts new file mode 100644 index 00000000000..e865337a3a3 --- /dev/null +++ b/packages/firestore/test/unit/util/assert.test.ts @@ -0,0 +1,88 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; + +import { fail, hardAssert } from '../../../src/util/assert'; + +describe('hardAssert', () => { + it('includes the error code as hex', () => { + expect(() => hardAssert(false, 0x1234, 'a message here')).to.throw('1234'); + }); + + it('includes the context', () => { + expect(() => + hardAssert(false, 0x1234, 'a message here', { foo: 'bar baz' }) + ).to.throw('bar baz'); + }); + + it('includes the message', () => { + expect(() => + hardAssert(false, 0x1234, 'a message here', { foo: 'bar baz' }) + ).to.throw('a message here'); + }); + + describe('without message', () => { + it('includes the error code as hex', () => { + expect(() => hardAssert(false, 0x1234)).to.throw('1234'); + }); + + it('includes the context', () => { + expect(() => hardAssert(false, 0x1234, { foo: 'bar baz' })).to.throw( + 'bar baz' + ); + }); + it('includes a default message', () => { + expect(() => hardAssert(false, 0x1234, { foo: 'bar baz' })).to.throw( + 'Unexpected state' + ); + }); + }); +}); + +describe('fail', () => { + it('includes the error code as hex', () => { + expect(() => fail(0x1234, 'a message here')).to.throw('1234'); + }); + + it('includes the context', () => { + expect(() => fail(0x1234, 'a message here', { foo: 'bar baz' })).to.throw( + 'bar baz' + ); + }); + + it('includes the message', () => { + expect(() => fail(0x1234, 'a message here', { foo: 'bar baz' })).to.throw( + 'a message here' + ); + }); + + describe('without message', () => { + it('includes the error code as hex', () => { + expect(() => fail(0x1234)).to.throw('1234'); + }); + + it('includes the context', () => { + expect(() => fail(0x1234, { foo: 'bar baz' })).to.throw('bar baz'); + }); + it('includes a default message', () => { + expect(() => fail(0x1234, { foo: 'bar baz' })).to.throw( + 'Unexpected state' + ); + }); + }); +}); diff --git a/packages/firestore/test/unit/util/async_queue.test.ts b/packages/firestore/test/unit/util/async_queue.test.ts index cc55879c88b..48aa02fe298 100644 --- a/packages/firestore/test/unit/util/async_queue.test.ts +++ b/packages/firestore/test/unit/util/async_queue.test.ts @@ -139,7 +139,7 @@ describe('AsyncQueue', () => { Promise.reject('dummyOp should not be run'); expect(() => { queue.enqueueAndForget(dummyOp); - }).to.throw(/already failed:.*Simulated Error/); + }).to.throw(/already failed.*Simulated Error/); // Finally, restore log level. setLogLevel(oldLogLevel as unknown as LogLevelString); @@ -247,7 +247,7 @@ describe('AsyncQueue', () => { const deferred = new Deferred(); queue.enqueueRetryable(async () => { deferred.resolve(); - throw fail('Simulated test failure'); + throw fail(0x1576, 'Simulated test failure'); }); await deferred.promise; await expect( diff --git a/packages/firestore/test/util/helpers.ts b/packages/firestore/test/util/helpers.ts index c5865c3e0f7..1ddaf174b19 100644 --- a/packages/firestore/test/util/helpers.ts +++ b/packages/firestore/test/util/helpers.ts @@ -867,11 +867,13 @@ export function expectEqual(left: any, right: any, message?: string): void { message = message || ''; if (typeof left.isEqual !== 'function') { return fail( + 0x8004, JSON.stringify(left) + ' does not support isEqual (left) ' + message ); } if (typeof right.isEqual !== 'function') { return fail( + 0xebc9, JSON.stringify(right) + ' does not support isEqual (right) ' + message ); } diff --git a/packages/firestore/test/util/spec_test_helpers.ts b/packages/firestore/test/util/spec_test_helpers.ts index 7e2f77da438..73378a361a3 100644 --- a/packages/firestore/test/util/spec_test_helpers.ts +++ b/packages/firestore/test/util/spec_test_helpers.ts @@ -100,7 +100,10 @@ export function encodeWatchChange( } }; } - return fail('Unrecognized watch change: ' + JSON.stringify(watchChange)); + return fail( + 0xf8e5, + 'Unrecognized watch change: ' + JSON.stringify(watchChange) + ); } function encodeTargetChangeTargetChangeType( @@ -118,6 +121,6 @@ function encodeTargetChangeTargetChangeType( case WatchTargetChangeState.Reset: return 'RESET'; default: - return fail('Unknown WatchTargetChangeState: ' + state); + return fail(0x368b, 'Unknown WatchTargetChangeState: ' + state); } } diff --git a/packages/firestore/test/util/test_platform.ts b/packages/firestore/test/util/test_platform.ts index 7803a2fb3c6..a0eac93cbc9 100644 --- a/packages/firestore/test/util/test_platform.ts +++ b/packages/firestore/test/util/test_platform.ts @@ -64,7 +64,7 @@ export class FakeWindow implements WindowLike { // listeners. break; default: - fail(`MockWindow doesn't support events of type '${type}'`); + fail(0xe53d, `MockWindow doesn't support events of type '${type}'`); } } From 8bb66c28b3b1a2486ae2574250e6f738bec671d1 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Apr 2025 12:11:50 -0400 Subject: [PATCH 167/295] docs(vertexai): remove HTML `` tags (#8900) We wrap links that reference public APIs with `` tags so that they can be rendered as code in devsite. Unfortunately, VSCode's hover feature can not render these links at all. Since there are no other alternatives for creating code-formatted links, we should remove the problematic HTML `` tags. --- docs-devsite/vertexai.chatsession.md | 8 +-- docs-devsite/vertexai.citationmetadata.md | 2 +- docs-devsite/vertexai.counttokensrequest.md | 4 +- docs-devsite/vertexai.customerrordata.md | 4 +- docs-devsite/vertexai.filedatapart.md | 2 +- docs-devsite/vertexai.functioncall.md | 2 +- docs-devsite/vertexai.functioncallpart.md | 2 +- .../vertexai.functiondeclarationstool.md | 4 +- docs-devsite/vertexai.functionresponse.md | 2 +- docs-devsite/vertexai.functionresponsepart.md | 2 +- .../vertexai.generatecontentcandidate.md | 2 +- docs-devsite/vertexai.generationconfig.md | 4 +- docs-devsite/vertexai.generativemodel.md | 8 +-- docs-devsite/vertexai.imagengcsimage.md | 4 +- .../vertexai.imagengenerationconfig.md | 16 ++--- .../vertexai.imagengenerationresponse.md | 4 +- docs-devsite/vertexai.imagenimageformat.md | 14 ++--- docs-devsite/vertexai.imageninlineimage.md | 4 +- docs-devsite/vertexai.imagenmodel.md | 6 +- docs-devsite/vertexai.imagenmodelparams.md | 2 +- docs-devsite/vertexai.md | 60 +++++++++---------- docs-devsite/vertexai.modelparams.md | 2 +- .../vertexai.objectschemainterface.md | 2 +- docs-devsite/vertexai.requestoptions.md | 2 +- docs-devsite/vertexai.safetyrating.md | 2 +- docs-devsite/vertexai.schemainterface.md | 2 +- docs-devsite/vertexai.schemaparams.md | 2 +- docs-devsite/vertexai.schemarequest.md | 2 +- docs-devsite/vertexai.schemashared.md | 2 +- docs-devsite/vertexai.usagemetadata.md | 2 +- docs-devsite/vertexai.vertexai.md | 4 +- docs-devsite/vertexai.vertexaierror.md | 2 +- packages/vertexai/src/api.ts | 6 +- packages/vertexai/src/errors.ts | 2 +- packages/vertexai/src/methods/chat-session.ts | 4 +- .../vertexai/src/models/generative-model.ts | 4 +- packages/vertexai/src/models/imagen-model.ts | 6 +- packages/vertexai/src/public-types.ts | 2 +- .../src/requests/imagen-image-format.ts | 10 ++-- .../vertexai/src/requests/request-helpers.ts | 2 +- .../vertexai/src/requests/response-helpers.ts | 2 +- packages/vertexai/src/types/content.ts | 12 ++-- packages/vertexai/src/types/error.ts | 4 +- .../vertexai/src/types/imagen/requests.ts | 14 ++--- .../vertexai/src/types/imagen/responses.ts | 10 ++-- packages/vertexai/src/types/requests.ts | 14 ++--- packages/vertexai/src/types/responses.ts | 8 +-- packages/vertexai/src/types/schema.ts | 12 ++-- 48 files changed, 146 insertions(+), 146 deletions(-) diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/vertexai.chatsession.md index cc5a75ace16..ed359f7e08c 100644 --- a/docs-devsite/vertexai.chatsession.md +++ b/docs-devsite/vertexai.chatsession.md @@ -37,8 +37,8 @@ export declare class ChatSession | Method | Modifiers | Description | | --- | --- | --- | | [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | +| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | ## ChatSession.(constructor) @@ -98,7 +98,7 @@ Promise<[Content](./vertexai.content.md#content_interface)\[\]> ## ChatSession.sendMessage() -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) +Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) Signature: @@ -118,7 +118,7 @@ Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatec ## ChatSession.sendMessageStream() -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. +Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. Signature: diff --git a/docs-devsite/vertexai.citationmetadata.md b/docs-devsite/vertexai.citationmetadata.md index e3d41a37d98..c317160e64f 100644 --- a/docs-devsite/vertexai.citationmetadata.md +++ b/docs-devsite/vertexai.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: diff --git a/docs-devsite/vertexai.counttokensrequest.md b/docs-devsite/vertexai.counttokensrequest.md index f5875564588..740ae5feed4 100644 --- a/docs-devsite/vertexai.counttokensrequest.md +++ b/docs-devsite/vertexai.counttokensrequest.md @@ -25,7 +25,7 @@ export interface CountTokensRequest | [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | | [generationConfig](./vertexai.counttokensrequest.md#counttokensrequestgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Configuration options that control how the model generates a response. | | [systemInstruction](./vertexai.counttokensrequest.md#counttokensrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | Instructions that direct the model to behave a certain way. | -| [tools](./vertexai.counttokensrequest.md#counttokensrequesttools) | [Tool](./vertexai.md#tool)\[\] | [Tool](./vertexai.md#tool) configuration. | +| [tools](./vertexai.counttokensrequest.md#counttokensrequesttools) | [Tool](./vertexai.md#tool)\[\] | [Tool](./vertexai.md#tool) configuration. | ## CountTokensRequest.contents @@ -57,7 +57,7 @@ systemInstruction?: string | Part | Content; ## CountTokensRequest.tools -[Tool](./vertexai.md#tool) configuration. +[Tool](./vertexai.md#tool) configuration. Signature: diff --git a/docs-devsite/vertexai.customerrordata.md b/docs-devsite/vertexai.customerrordata.md index 701b1b84c49..100f4a85fd9 100644 --- a/docs-devsite/vertexai.customerrordata.md +++ b/docs-devsite/vertexai.customerrordata.md @@ -23,7 +23,7 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | | [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | +| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | | [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | | [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai.filedatapart.md b/docs-devsite/vertexai.filedatapart.md index 74512fa6d29..76162227526 100644 --- a/docs-devsite/vertexai.filedatapart.md +++ b/docs-devsite/vertexai.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) Signature: diff --git a/docs-devsite/vertexai.functioncall.md b/docs-devsite/vertexai.functioncall.md index ca7bc015438..299fb7130f4 100644 --- a/docs-devsite/vertexai.functioncall.md +++ b/docs-devsite/vertexai.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: diff --git a/docs-devsite/vertexai.functioncallpart.md b/docs-devsite/vertexai.functioncallpart.md index af8ccf1109a..58fe0f5fa97 100644 --- a/docs-devsite/vertexai.functioncallpart.md +++ b/docs-devsite/vertexai.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). Signature: diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md index 5e728046639..2eff3138d8d 100644 --- a/docs-devsite/vertexai.functiondeclarationstool.md +++ b/docs-devsite/vertexai.functiondeclarationstool.md @@ -22,11 +22,11 @@ export declare interface FunctionDeclarationsTool | Property | Type | Description | | --- | --- | --- | -| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | +| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | ## FunctionDeclarationsTool.functionDeclarations -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. Signature: diff --git a/docs-devsite/vertexai.functionresponse.md b/docs-devsite/vertexai.functionresponse.md index 0ca553e0e6b..072a08b3486 100644 --- a/docs-devsite/vertexai.functionresponse.md +++ b/docs-devsite/vertexai.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. Signature: diff --git a/docs-devsite/vertexai.functionresponsepart.md b/docs-devsite/vertexai.functionresponsepart.md index 1905c98cdc7..ffbf2ad0517 100644 --- a/docs-devsite/vertexai.functionresponsepart.md +++ b/docs-devsite/vertexai.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). Signature: diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/vertexai.generatecontentcandidate.md index a30eef55485..e5fd9eacbbe 100644 --- a/docs-devsite/vertexai.generatecontentcandidate.md +++ b/docs-devsite/vertexai.generatecontentcandidate.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md index 3c3d0a14ffa..d3e9879f937 100644 --- a/docs-devsite/vertexai.generationconfig.md +++ b/docs-devsite/vertexai.generationconfig.md @@ -27,7 +27,7 @@ export interface GenerationConfig | [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | | [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | | [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | -| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | | [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | | [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | | [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | @@ -77,7 +77,7 @@ responseMimeType?: string; ## GenerationConfig.responseSchema -Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. Signature: diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md index b734e241e78..e4a238b0af5 100644 --- a/docs-devsite/vertexai.generativemodel.md +++ b/docs-devsite/vertexai.generativemodel.md @@ -41,9 +41,9 @@ export declare class GenerativeModel extends VertexAIModel | Method | Modifiers | Description | | --- | --- | --- | | [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | | [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | +| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | ## GenerativeModel.(constructor) @@ -133,7 +133,7 @@ Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensre ## GenerativeModel.generateContent() -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -173,7 +173,7 @@ Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult. ## GenerativeModel.startChat() -Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. +Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. Signature: diff --git a/docs-devsite/vertexai.imagengcsimage.md b/docs-devsite/vertexai.imagengcsimage.md index b094e63c1d8..23770192b3b 100644 --- a/docs-devsite/vertexai.imagengcsimage.md +++ b/docs-devsite/vertexai.imagengcsimage.md @@ -25,7 +25,7 @@ export interface ImagenGCSImage | Property | Type | Description | | --- | --- | --- | | [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | -| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenGCSImage.gcsURI @@ -45,7 +45,7 @@ gcsURI: string; The MIME type of the image; either `"image/png"` or `"image/jpeg"`. -To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). Signature: diff --git a/docs-devsite/vertexai.imagengenerationconfig.md b/docs-devsite/vertexai.imagengenerationconfig.md index cee7734f789..b6785b9b2bb 100644 --- a/docs-devsite/vertexai.imagengenerationconfig.md +++ b/docs-devsite/vertexai.imagengenerationconfig.md @@ -27,11 +27,11 @@ export interface ImagenGenerationConfig | Property | Type | Description | | --- | --- | --- | -| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details. | -| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. | -| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. | +| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details. | +| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. | +| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. | | [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. | -| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | +| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | ## ImagenGenerationConfig.addWatermark @@ -42,7 +42,7 @@ Whether to add an invisible watermark to generated images. If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to `false`, watermarking will be disabled. -For Imagen 3 models, the default value is `true`; see the addWatermark documentation for more details. +For Imagen 3 models, the default value is `true`; see the addWatermark documentation for more details. Signature: @@ -55,7 +55,7 @@ addWatermark?: boolean; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. +The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. Signature: @@ -70,7 +70,7 @@ aspectRatio?: ImagenAspectRatio; The image format of the generated images. The default is PNG. -See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. +See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. Signature: @@ -102,7 +102,7 @@ negativePrompt?: string; The number of images to generate. The default value is 1. -The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. +The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. Signature: diff --git a/docs-devsite/vertexai.imagengenerationresponse.md b/docs-devsite/vertexai.imagengenerationresponse.md index 32ed69718f9..d8de93df3ec 100644 --- a/docs-devsite/vertexai.imagengenerationresponse.md +++ b/docs-devsite/vertexai.imagengenerationresponse.md @@ -25,7 +25,7 @@ export interface ImagenGenerationResponse(Public Preview)
The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | +| [filteredReason](./vertexai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | (Public Preview) The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | | [images](./vertexai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | ## ImagenGenerationResponse.filteredReason @@ -35,7 +35,7 @@ export interface ImagenGenerationResponse[ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface). +Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface). See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. diff --git a/docs-devsite/vertexai.imagenimageformat.md b/docs-devsite/vertexai.imagenimageformat.md index 785c7c726fc..68db8bbdae0 100644 --- a/docs-devsite/vertexai.imagenimageformat.md +++ b/docs-devsite/vertexai.imagenimageformat.md @@ -15,7 +15,7 @@ https://github.com/firebase/firebase-js-sdk Defines the image format for images generated by Imagen. -Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). +Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). Signature: @@ -34,8 +34,8 @@ export declare class ImagenImageFormat | Method | Modifiers | Description | | --- | --- | --- | -| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | -| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | +| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | +| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | ## ImagenImageFormat.compressionQuality @@ -68,7 +68,7 @@ mimeType: string; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. +Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. Signature: @@ -86,14 +86,14 @@ static jpeg(compressionQuality?: number): ImagenImageFormat; [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) -An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a JPEG image. +An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a JPEG image. ## ImagenImageFormat.png() > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. +Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. Signature: @@ -104,7 +104,7 @@ static png(): ImagenImageFormat; [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) -An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a PNG image. +An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a PNG image. ### Example diff --git a/docs-devsite/vertexai.imageninlineimage.md b/docs-devsite/vertexai.imageninlineimage.md index 19fe8a67764..a72937b5e5d 100644 --- a/docs-devsite/vertexai.imageninlineimage.md +++ b/docs-devsite/vertexai.imageninlineimage.md @@ -26,7 +26,7 @@ export interface ImagenInlineImage | Property | Type | Description | | --- | --- | --- | | [bytesBase64Encoded](./vertexai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | -| [mimeType](./vertexai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [mimeType](./vertexai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenInlineImage.bytesBase64Encoded @@ -48,7 +48,7 @@ bytesBase64Encoded: string; The MIME type of the image; either `"image/png"` or `"image/jpeg"`. -To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). Signature: diff --git a/docs-devsite/vertexai.imagenmodel.md b/docs-devsite/vertexai.imagenmodel.md index 63e15ff133a..ed40dc8f578 100644 --- a/docs-devsite/vertexai.imagenmodel.md +++ b/docs-devsite/vertexai.imagenmodel.md @@ -28,7 +28,7 @@ export declare class ImagenModel extends VertexAIModel | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | ## Properties @@ -49,7 +49,7 @@ export declare class ImagenModel extends VertexAIModel > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. +Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. Signature: @@ -131,7 +131,7 @@ generateImages(prompt: string): Promise<[ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface)>> -A promise that resolves to an [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) object containing the generated images. +A promise that resolves to an [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) object containing the generated images. #### Exceptions diff --git a/docs-devsite/vertexai.imagenmodelparams.md b/docs-devsite/vertexai.imagenmodelparams.md index 66c4bb0bfe6..5396a36e4d1 100644 --- a/docs-devsite/vertexai.imagenmodelparams.md +++ b/docs-devsite/vertexai.imagenmodelparams.md @@ -13,7 +13,7 @@ https://github.com/firebase/firebase-js-sdk > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). +Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). Signature: diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index fca51b42f4f..f67254eef20 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -17,10 +17,10 @@ The Vertex AI in Firebase Web SDK. | Function | Description | | --- | --- | | function(app, ...) | -| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | +| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | | function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | -| [getImagenModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getimagenmodel_812c375) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | +| [getImagenModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getimagenmodel_812c375) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | ## Classes @@ -30,7 +30,7 @@ The Vertex AI in Firebase Web SDK. | [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | | [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | | [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). | +| [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). | | [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | | [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | @@ -52,12 +52,12 @@ The Vertex AI in Firebase Web SDK. | [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [Modality](./vertexai.md#modality) | Content part modality. | | [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | -| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | +| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | ## Interfaces @@ -65,7 +65,7 @@ The Vertex AI in Firebase Web SDK. | --- | --- | | [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | | [Citation](./vertexai.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | | [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | | [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | @@ -74,15 +74,15 @@ The Vertex AI in Firebase Web SDK. | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | | [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | +| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | +| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | | [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | | [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | @@ -95,26 +95,26 @@ The Vertex AI in Firebase Web SDK. | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | | [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | | [ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | -| [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). | +| [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). | | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | -| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | -| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | +| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | -| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | -| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | -| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | +| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | +| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | +| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | +| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | | [Segment](./vertexai.segment.md#segment_interface) | | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | | [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | @@ -139,7 +139,7 @@ The Vertex AI in Firebase Web SDK. ### getVertexAI(app, options) {:#getvertexai_04094cf} -Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. +Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. Signature: @@ -162,7 +162,7 @@ export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions ### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} -Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. +Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. Signature: @@ -187,7 +187,7 @@ export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: Mode > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. +Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. Only Imagen 3 models (named `imagen-3.0-*`) are supported. @@ -422,7 +422,7 @@ export declare enum HarmSeverity Aspect ratios for Imagen images. -To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). +To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. @@ -449,7 +449,7 @@ export declare enum ImagenAspectRatio A filter level controlling whether generation of images containing people or faces is allowed. -See the personGeneration documentation for more details. +See the personGeneration documentation for more details. Signature: @@ -533,7 +533,7 @@ export declare enum SchemaType ## VertexAIErrorCode -Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. +Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. Signature: diff --git a/docs-devsite/vertexai.modelparams.md b/docs-devsite/vertexai.modelparams.md index 590bc14e435..d3963d240eb 100644 --- a/docs-devsite/vertexai.modelparams.md +++ b/docs-devsite/vertexai.modelparams.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/vertexai.objectschemainterface.md index 6a4e052d183..4eb7a5d80e7 100644 --- a/docs-devsite/vertexai.objectschemainterface.md +++ b/docs-devsite/vertexai.objectschemainterface.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ObjectSchemaInterface interface -Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. +Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. Signature: diff --git a/docs-devsite/vertexai.requestoptions.md b/docs-devsite/vertexai.requestoptions.md index 6d074775520..dcd0c552ecb 100644 --- a/docs-devsite/vertexai.requestoptions.md +++ b/docs-devsite/vertexai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: diff --git a/docs-devsite/vertexai.safetyrating.md b/docs-devsite/vertexai.safetyrating.md index b5f204bef2c..28493bafef0 100644 --- a/docs-devsite/vertexai.safetyrating.md +++ b/docs-devsite/vertexai.safetyrating.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) +A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) Signature: diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/vertexai.schemainterface.md index 3992c9e5116..c14b561193b 100644 --- a/docs-devsite/vertexai.schemainterface.md +++ b/docs-devsite/vertexai.schemainterface.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaInterface interface -Interface for [Schema](./vertexai.schema.md#schema_class) class. +Interface for [Schema](./vertexai.schema.md#schema_class) class. Signature: diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/vertexai.schemaparams.md index 3c6d9f385fd..8e4a41f6bdc 100644 --- a/docs-devsite/vertexai.schemaparams.md +++ b/docs-devsite/vertexai.schemaparams.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaParams interface -Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. +Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. Signature: diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/vertexai.schemarequest.md index f12259b1608..c382c2a6297 100644 --- a/docs-devsite/vertexai.schemarequest.md +++ b/docs-devsite/vertexai.schemarequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaRequest interface -Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. +Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. Signature: diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md index 50cc6464ecf..0764a53bdc0 100644 --- a/docs-devsite/vertexai.schemashared.md +++ b/docs-devsite/vertexai.schemashared.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaShared interface -Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. +Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. Signature: diff --git a/docs-devsite/vertexai.usagemetadata.md b/docs-devsite/vertexai.usagemetadata.md index 5f886dd29f2..176878235d5 100644 --- a/docs-devsite/vertexai.usagemetadata.md +++ b/docs-devsite/vertexai.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: diff --git a/docs-devsite/vertexai.vertexai.md b/docs-devsite/vertexai.vertexai.md index 4797bf8bada..d30d0f7113e 100644 --- a/docs-devsite/vertexai.vertexai.md +++ b/docs-devsite/vertexai.vertexai.md @@ -22,12 +22,12 @@ export interface VertexAI | Property | Type | Description | | --- | --- | --- | -| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | +| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | | [location](./vertexai.vertexai.md#vertexailocation) | string | | ## VertexAI.app -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. Signature: diff --git a/docs-devsite/vertexai.vertexaierror.md b/docs-devsite/vertexai.vertexaierror.md index 86532ac6018..31f527e59b3 100644 --- a/docs-devsite/vertexai.vertexaierror.md +++ b/docs-devsite/vertexai.vertexaierror.md @@ -46,7 +46,7 @@ constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomEr | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | +| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | | message | string | A human-readable message describing the error. | | customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 752e75c7e23..7843a5bdeee 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -43,7 +43,7 @@ declare module '@firebase/component' { } /** - * Returns a {@link VertexAI} instance for the given app. + * Returns a {@link VertexAI} instance for the given app. * * @public * @@ -63,7 +63,7 @@ export function getVertexAI( } /** - * Returns a {@link GenerativeModel} class with methods for inference + * Returns a {@link GenerativeModel} class with methods for inference * and other functionality. * * @public @@ -83,7 +83,7 @@ export function getGenerativeModel( } /** - * Returns an {@link ImagenModel} class with methods for using Imagen. + * Returns an {@link ImagenModel} class with methods for using Imagen. * * Only Imagen 3 models (named `imagen-3.0-*`) are supported. * diff --git a/packages/vertexai/src/errors.ts b/packages/vertexai/src/errors.ts index b643a5f552d..ad3f9b72f5a 100644 --- a/packages/vertexai/src/errors.ts +++ b/packages/vertexai/src/errors.ts @@ -28,7 +28,7 @@ export class VertexAIError extends FirebaseError { /** * Constructs a new instance of the `VertexAIError` class. * - * @param code - The error code from {@link VertexAIErrorCode}. + * @param code - The error code from {@link VertexAIErrorCode}. * @param message - A human-readable message describing the error. * @param customErrorData - Optional error data. */ diff --git a/packages/vertexai/src/methods/chat-session.ts b/packages/vertexai/src/methods/chat-session.ts index dd22b29a7c8..60794001e37 100644 --- a/packages/vertexai/src/methods/chat-session.ts +++ b/packages/vertexai/src/methods/chat-session.ts @@ -72,7 +72,7 @@ export class ChatSession { /** * Sends a chat message and receives a non-streaming - * {@link GenerateContentResult} + * {@link GenerateContentResult} */ async sendMessage( request: string | Array @@ -126,7 +126,7 @@ export class ChatSession { /** * Sends a chat message and receives the response as a - * {@link GenerateContentStreamResult} containing an iterable stream + * {@link GenerateContentStreamResult} containing an iterable stream * and a response promise. */ async sendMessageStream( diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index b4cf464f025..983118bf6ff 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -74,7 +74,7 @@ export class GenerativeModel extends VertexAIModel { /** * Makes a single non-streaming call to the model - * and returns an object containing a single {@link GenerateContentResponse}. + * and returns an object containing a single {@link GenerateContentResponse}. */ async generateContent( request: GenerateContentRequest | string | Array @@ -121,7 +121,7 @@ export class GenerativeModel extends VertexAIModel { } /** - * Gets a new {@link ChatSession} instance which can be used for + * Gets a new {@link ChatSession} instance which can be used for * multi-turn chats. */ startChat(startChatParams?: StartChatParams): ChatSession { diff --git a/packages/vertexai/src/models/imagen-model.ts b/packages/vertexai/src/models/imagen-model.ts index 89c740852a3..04514ef6ffd 100644 --- a/packages/vertexai/src/models/imagen-model.ts +++ b/packages/vertexai/src/models/imagen-model.ts @@ -63,7 +63,7 @@ export class ImagenModel extends VertexAIModel { safetySettings?: ImagenSafetySettings; /** - * Constructs a new instance of the {@link ImagenModel} class. + * Constructs a new instance of the {@link ImagenModel} class. * * @param vertexAI - An instance of the Vertex AI in Firebase SDK. * @param modelParams - Parameters to use when making requests to Imagen. @@ -88,7 +88,7 @@ export class ImagenModel extends VertexAIModel { * base64-encoded strings. * * @param prompt - A text prompt describing the image(s) to generate. - * @returns A promise that resolves to an {@link ImagenGenerationResponse} + * @returns A promise that resolves to an {@link ImagenGenerationResponse} * object containing the generated images. * * @throws If the request to generate images fails. This happens if the @@ -127,7 +127,7 @@ export class ImagenModel extends VertexAIModel { * @param prompt - A text prompt describing the image(s) to generate. * @param gcsURI - The URI of file stored in a Cloud Storage for Firebase bucket. * This should be a directory. For example, `gs://my-bucket/my-directory/`. - * @returns A promise that resolves to an {@link ImagenGenerationResponse} + * @returns A promise that resolves to an {@link ImagenGenerationResponse} * object containing the URLs of the generated images. * * @throws If the request fails to generate images fails. This happens if diff --git a/packages/vertexai/src/public-types.ts b/packages/vertexai/src/public-types.ts index 280fee9d1cd..fbc5d51084d 100644 --- a/packages/vertexai/src/public-types.ts +++ b/packages/vertexai/src/public-types.ts @@ -25,7 +25,7 @@ export * from './types'; */ export interface VertexAI { /** - * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. + * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. */ app: FirebaseApp; location: string; diff --git a/packages/vertexai/src/requests/imagen-image-format.ts b/packages/vertexai/src/requests/imagen-image-format.ts index 283dc80bfaf..b9690a7d39b 100644 --- a/packages/vertexai/src/requests/imagen-image-format.ts +++ b/packages/vertexai/src/requests/imagen-image-format.ts @@ -22,7 +22,7 @@ import { logger } from '../logger'; * * Use this class to specify the desired format (JPEG or PNG) and compression quality * for images generated by Imagen. This is typically included as part of - * {@link ImagenModelParams}. + * {@link ImagenModelParams}. * * @example * ```javascript @@ -49,10 +49,10 @@ export class ImagenImageFormat { } /** - * Creates an {@link ImagenImageFormat} for a JPEG image. + * Creates an {@link ImagenImageFormat} for a JPEG image. * * @param compressionQuality - The level of compression (a number between 0 and 100). - * @returns An {@link ImagenImageFormat} object for a JPEG image. + * @returns An {@link ImagenImageFormat} object for a JPEG image. * * @beta */ @@ -69,9 +69,9 @@ export class ImagenImageFormat { } /** - * Creates an {@link ImagenImageFormat} for a PNG image. + * Creates an {@link ImagenImageFormat} for a PNG image. * - * @returns An {@link ImagenImageFormat} object for a PNG image. + * @returns An {@link ImagenImageFormat} object for a PNG image. * * @beta */ diff --git a/packages/vertexai/src/requests/request-helpers.ts b/packages/vertexai/src/requests/request-helpers.ts index f69c88fca92..fd2cd04e0fd 100644 --- a/packages/vertexai/src/requests/request-helpers.ts +++ b/packages/vertexai/src/requests/request-helpers.ts @@ -127,7 +127,7 @@ export function formatGenerateContentInput( } /** - * Convert the user-defined parameters in {@link ImagenGenerationParams} to the format + * Convert the user-defined parameters in {@link ImagenGenerationParams} to the format * that is expected from the REST API. * * @internal diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index 1ba0986f3f9..6d0e3bf2a0a 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -144,7 +144,7 @@ export function getText(response: GenerateContentResponse): string { } /** - * Returns {@link FunctionCall}s associated with first candidate. + * Returns {@link FunctionCall}s associated with first candidate. */ export function getFunctionCalls( response: GenerateContentResponse diff --git a/packages/vertexai/src/types/content.ts b/packages/vertexai/src/types/content.ts index abf5d29222a..ad2906671e4 100644 --- a/packages/vertexai/src/types/content.ts +++ b/packages/vertexai/src/types/content.ts @@ -82,7 +82,7 @@ export interface VideoMetadata { } /** - * Content part interface if the part represents a {@link FunctionCall}. + * Content part interface if the part represents a {@link FunctionCall}. * @public */ export interface FunctionCallPart { @@ -93,7 +93,7 @@ export interface FunctionCallPart { } /** - * Content part interface if the part represents {@link FunctionResponse}. + * Content part interface if the part represents {@link FunctionResponse}. * @public */ export interface FunctionResponsePart { @@ -104,7 +104,7 @@ export interface FunctionResponsePart { } /** - * Content part interface if the part represents {@link FileData} + * Content part interface if the part represents {@link FileData} * @public */ export interface FileDataPart { @@ -116,7 +116,7 @@ export interface FileDataPart { } /** - * A predicted {@link FunctionCall} returned from the model + * A predicted {@link FunctionCall} returned from the model * that contains a string representing the {@link FunctionDeclaration.name} * and a structured JSON object containing the parameters and their values. * @public @@ -127,11 +127,11 @@ export interface FunctionCall { } /** - * The result output from a {@link FunctionCall} that contains a string + * The result output from a {@link FunctionCall} that contains a string * representing the {@link FunctionDeclaration.name} * and a structured JSON object containing any output * from the function is used as context to the model. - * This should contain the result of a {@link FunctionCall} + * This should contain the result of a {@link FunctionCall} * made based on model prediction. * @public */ diff --git a/packages/vertexai/src/types/error.ts b/packages/vertexai/src/types/error.ts index c249320a39e..b1f075101a6 100644 --- a/packages/vertexai/src/types/error.ts +++ b/packages/vertexai/src/types/error.ts @@ -50,7 +50,7 @@ export interface CustomErrorData { /** HTTP status text of the error response. */ statusText?: string; - /** Response from a {@link GenerateContentRequest} */ + /** Response from a {@link GenerateContentRequest} */ response?: GenerateContentResponse; /** Optional additional details about the error. */ @@ -58,7 +58,7 @@ export interface CustomErrorData { } /** - * Standardized error codes that {@link VertexAIError} can have. + * Standardized error codes that {@link VertexAIError} can have. * * @public */ diff --git a/packages/vertexai/src/types/imagen/requests.ts b/packages/vertexai/src/types/imagen/requests.ts index ac37488dfb5..70ae182238e 100644 --- a/packages/vertexai/src/types/imagen/requests.ts +++ b/packages/vertexai/src/types/imagen/requests.ts @@ -18,7 +18,7 @@ import { ImagenImageFormat } from '../../requests/imagen-image-format'; /** - * Parameters for configuring an {@link ImagenModel}. + * Parameters for configuring an {@link ImagenModel}. * * @beta */ @@ -64,20 +64,20 @@ export interface ImagenGenerationConfig { * The number of images to generate. The default value is 1. * * The number of sample images that may be generated in each request depends on the model - * (typically up to 4); see the sampleCount + * (typically up to 4); see the sampleCount * documentation for more details. */ numberOfImages?: number; /** * The aspect ratio of the generated images. The default value is square 1:1. - * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio} + * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio} * for more details. */ aspectRatio?: ImagenAspectRatio; /** * The image format of the generated images. The default is PNG. * - * See {@link ImagenImageFormat} for more details. + * See {@link ImagenImageFormat} for more details. */ imageFormat?: ImagenImageFormat; /** @@ -86,7 +86,7 @@ export interface ImagenGenerationConfig { * If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate * that they are AI generated. If set to `false`, watermarking will be disabled. * - * For Imagen 3 models, the default value is `true`; see the addWatermark + * For Imagen 3 models, the default value is `true`; see the addWatermark * documentation for more details. */ addWatermark?: boolean; @@ -129,7 +129,7 @@ export enum ImagenSafetyFilterLevel { /** * A filter level controlling whether generation of images containing people or faces is allowed. * - * See the personGeneration + * See the personGeneration * documentation for more details. * * @beta @@ -181,7 +181,7 @@ export interface ImagenSafetySettings { * Aspect ratios for Imagen images. * * To specify an aspect ratio for generated images, set the `aspectRatio` property in your - * {@link ImagenGenerationConfig}. + * {@link ImagenGenerationConfig}. * * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. diff --git a/packages/vertexai/src/types/imagen/responses.ts b/packages/vertexai/src/types/imagen/responses.ts index c5cf5dd9057..4b093fd550f 100644 --- a/packages/vertexai/src/types/imagen/responses.ts +++ b/packages/vertexai/src/types/imagen/responses.ts @@ -24,7 +24,7 @@ export interface ImagenInlineImage { /** * The MIME type of the image; either `"image/png"` or `"image/jpeg"`. * - * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. + * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. */ mimeType: string; /** @@ -42,7 +42,7 @@ export interface ImagenGCSImage { /** * The MIME type of the image; either `"image/png"` or `"image/jpeg"`. * - * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. + * To request a different format, set the `imageFormat` property in your {@link ImagenGenerationConfig}. */ mimeType: string; /** @@ -72,9 +72,9 @@ export interface ImagenGenerationResponse< * The reason that images were filtered out. This property will only be defined if one * or more images were filtered. * - * Images may be filtered out due to the {@link ImagenSafetyFilterLevel}, - * {@link ImagenPersonFilterLevel}, or filtering included in the model. - * The filter levels may be adjusted in your {@link ImagenSafetySettings}. + * Images may be filtered out due to the {@link ImagenSafetyFilterLevel}, + * {@link ImagenPersonFilterLevel}, or filtering included in the model. + * The filter levels may be adjusted in your {@link ImagenSafetySettings}. * * See the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen | Responsible AI and usage guidelines for Imagen} * for more details. diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index 5058b457365..c15258b06d0 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -35,7 +35,7 @@ export interface BaseParams { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface ModelParams extends BaseParams { @@ -88,9 +88,9 @@ export interface GenerationConfig { responseMimeType?: string; /** * Output response schema of the generated candidate text. This - * value can be a class generated with a {@link Schema} static method + * value can be a class generated with a {@link Schema} static method * like `Schema.string()` or `Schema.object()` or it can be a plain - * JS object matching the {@link SchemaRequest} interface. + * JS object matching the {@link SchemaRequest} interface. *
Note: This only applies when the specified `responseMIMEType` supports a schema; currently * this is limited to `application/json` and `text/x.enum`. */ @@ -119,7 +119,7 @@ export interface CountTokensRequest { */ systemInstruction?: string | Part | Content; /** - * {@link Tool} configuration. + * {@link Tool} configuration. */ tools?: Tool[]; /** @@ -129,7 +129,7 @@ export interface CountTokensRequest { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface RequestOptions { @@ -189,8 +189,8 @@ export declare interface FunctionDeclarationsTool { * Optional. One or more function declarations * to be passed to the model along with the current user query. Model may * decide to call a subset of these functions by populating - * {@link FunctionCall} in the response. User should - * provide a {@link FunctionResponse} for each + * {@link FunctionCall} in the response. User should + * provide a {@link FunctionResponse} for each * function call in the next turn. Based on the function responses, the model will * generate the final response back to the user. Maximum 64 function * declarations can be provided. diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 437d33e9a47..7f68df1e679 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -76,7 +76,7 @@ export interface GenerateContentResponse { } /** - * Usage metadata about a {@link GenerateContentResponse}. + * Usage metadata about a {@link GenerateContentResponse}. * * @public */ @@ -112,7 +112,7 @@ export interface PromptFeedback { } /** - * A candidate returned as part of a {@link GenerateContentResponse}. + * A candidate returned as part of a {@link GenerateContentResponse}. * @public */ export interface GenerateContentCandidate { @@ -126,7 +126,7 @@ export interface GenerateContentCandidate { } /** - * Citation metadata that may be found on a {@link GenerateContentCandidate}. + * Citation metadata that may be found on a {@link GenerateContentCandidate}. * @public */ export interface CitationMetadata { @@ -206,7 +206,7 @@ export interface Date { } /** - * A safety rating associated with a {@link GenerateContentCandidate} + * A safety rating associated with a {@link GenerateContentCandidate} * @public */ export interface SafetyRating { diff --git a/packages/vertexai/src/types/schema.ts b/packages/vertexai/src/types/schema.ts index fca213431ad..5c23655be0e 100644 --- a/packages/vertexai/src/types/schema.ts +++ b/packages/vertexai/src/types/schema.ts @@ -37,7 +37,7 @@ export enum SchemaType { } /** - * Basic {@link Schema} properties shared across several Schema-related + * Basic {@link Schema} properties shared across several Schema-related * types. * @public */ @@ -62,14 +62,14 @@ export interface SchemaShared { } /** - * Params passed to {@link Schema} static methods to create specific - * {@link Schema} classes. + * Params passed to {@link Schema} static methods to create specific + * {@link Schema} classes. * @public */ export interface SchemaParams extends SchemaShared {} /** - * Final format for {@link Schema} params passed to backend requests. + * Final format for {@link Schema} params passed to backend requests. * @public */ export interface SchemaRequest extends SchemaShared { @@ -83,7 +83,7 @@ export interface SchemaRequest extends SchemaShared { } /** - * Interface for {@link Schema} class. + * Interface for {@link Schema} class. * @public */ export interface SchemaInterface extends SchemaShared { @@ -95,7 +95,7 @@ export interface SchemaInterface extends SchemaShared { } /** - * Interface for {@link ObjectSchema} class. + * Interface for {@link ObjectSchema} class. * @public */ export interface ObjectSchemaInterface extends SchemaInterface { From 0cbff6bc7a62f77346ce76c9602b3d572a9af6c0 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Apr 2025 12:12:12 -0400 Subject: [PATCH 168/295] test(vertexai): update developerapi mock response dir to googleai (#8921) --- packages/vertexai/test-utils/convert-mocks.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/vertexai/test-utils/convert-mocks.ts b/packages/vertexai/test-utils/convert-mocks.ts index 851d6017b6d..8690af4ac72 100644 --- a/packages/vertexai/test-utils/convert-mocks.ts +++ b/packages/vertexai/test-utils/convert-mocks.ts @@ -30,8 +30,7 @@ type BackendName = 'vertexAI' | 'googleAI'; const mockDirs: Record = { vertexAI: join(MOCK_RESPONSES_DIR_PATH, 'vertexai'), - // Note: the dirname is developerapi is legacy. It should be updated to googleai. - googleAI: join(MOCK_RESPONSES_DIR_PATH, 'developerapi') + googleAI: join(MOCK_RESPONSES_DIR_PATH, 'googleai') }; /** From 1363ecc533de0ba5bfcae206a831acc33f9020a6 Mon Sep 17 00:00:00 2001 From: Pavan Shankar Date: Wed, 16 Apr 2025 10:06:31 +0530 Subject: [PATCH 169/295] Fix languageCode parameter in action_code_url (#8912) * Fix languageCode parameter in action_code_url * Add changeset --- .changeset/great-cheetahs-invite.md | 5 +++++ packages/auth/src/core/action_code_url.test.ts | 14 +++++++------- packages/auth/src/core/action_code_url.ts | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/great-cheetahs-invite.md diff --git a/.changeset/great-cheetahs-invite.md b/.changeset/great-cheetahs-invite.md new file mode 100644 index 00000000000..f6c8dbd182e --- /dev/null +++ b/.changeset/great-cheetahs-invite.md @@ -0,0 +1,5 @@ +--- +'@firebase/auth': patch +--- + +Fixed: `ActionCodeURL` not populating `languageCode` from the url. diff --git a/packages/auth/src/core/action_code_url.test.ts b/packages/auth/src/core/action_code_url.test.ts index 1f85fd94cc4..1432361e221 100644 --- a/packages/auth/src/core/action_code_url.test.ts +++ b/packages/auth/src/core/action_code_url.test.ts @@ -30,7 +30,7 @@ describe('core/action_code_url', () => { 'oobCode=CODE&mode=signIn&apiKey=API_KEY&' + 'continueUrl=' + encodeURIComponent(continueUrl) + - '&languageCode=en&tenantId=TENANT_ID&state=bla'; + '&lang=en&tenantId=TENANT_ID&state=bla'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq(ActionCodeOperation.EMAIL_SIGNIN); expect(actionCodeUrl!.code).to.eq('CODE'); @@ -46,7 +46,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=signIn&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.EMAIL_SIGNIN @@ -57,7 +57,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=verifyAndChangeEmail&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL @@ -68,7 +68,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=verifyEmail&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.VERIFY_EMAIL @@ -79,7 +79,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=recoverEmail&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.RECOVER_EMAIL @@ -90,7 +90,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=resetPassword&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.PASSWORD_RESET @@ -101,7 +101,7 @@ describe('core/action_code_url', () => { const actionLink = 'https://www.example.com/finishSignIn?' + 'oobCode=CODE&mode=revertSecondFactorAddition&apiKey=API_KEY&' + - 'languageCode=en'; + 'lang=en'; const actionCodeUrl = ActionCodeURL.parseLink(actionLink); expect(actionCodeUrl!.operation).to.eq( ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION diff --git a/packages/auth/src/core/action_code_url.ts b/packages/auth/src/core/action_code_url.ts index f3d5c69bc1f..b7778766a9e 100644 --- a/packages/auth/src/core/action_code_url.ts +++ b/packages/auth/src/core/action_code_url.ts @@ -29,7 +29,7 @@ const enum QueryField { API_KEY = 'apiKey', CODE = 'oobCode', CONTINUE_URL = 'continueUrl', - LANGUAGE_CODE = 'languageCode', + LANGUAGE_CODE = 'lang', MODE = 'mode', TENANT_ID = 'tenantId' } From 20b45d3ab12bfae3ac8761fdf32cb613cc2f3641 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 23 Apr 2025 14:02:07 -0400 Subject: [PATCH 170/295] test(vertexai): update mock responses to v10 (#8959) --- scripts/update_vertexai_responses.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index de55ac176ce..bf55a645a66 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v8.*' # The major version of mock responses to use +RESPONSES_VERSION='v10.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From b204e7126bf09cdc551993be6427e2e5dd478fc9 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 24 Apr 2025 08:32:02 -0700 Subject: [PATCH 171/295] Version Packages (#8956) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/cyan-frogs-relate.md | 6 ------ .changeset/gentle-rocks-repeat.md | 6 ------ .changeset/great-cheetahs-invite.md | 5 ----- .changeset/hungry-snails-drive.md | 5 ----- .changeset/odd-wolves-sit.md | 5 ----- .changeset/slow-students-fry.md | 6 ------ integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/CHANGELOG.md | 7 +++++++ packages/auth-compat/package.json | 6 +++--- packages/auth/CHANGELOG.md | 6 ++++++ packages/auth/package.json | 4 ++-- packages/data-connect/CHANGELOG.md | 6 ++++++ packages/data-connect/package.json | 4 ++-- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 19 +++++++++++++++++++ packages/firebase/package.json | 16 ++++++++-------- packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 6 +++--- packages/firestore/CHANGELOG.md | 12 ++++++++++++ packages/firestore/package.json | 8 ++++---- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 4 ++-- packages/storage/package.json | 4 ++-- packages/template/package.json | 2 +- packages/vertexai/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 46 files changed, 125 insertions(+), 88 deletions(-) delete mode 100644 .changeset/cyan-frogs-relate.md delete mode 100644 .changeset/gentle-rocks-repeat.md delete mode 100644 .changeset/great-cheetahs-invite.md delete mode 100644 .changeset/hungry-snails-drive.md delete mode 100644 .changeset/odd-wolves-sit.md delete mode 100644 .changeset/slow-students-fry.md diff --git a/.changeset/cyan-frogs-relate.md b/.changeset/cyan-frogs-relate.md deleted file mode 100644 index 08af27593a9..00000000000 --- a/.changeset/cyan-frogs-relate.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Fixed the `null` value handling in `!=` and `not-in` filters. diff --git a/.changeset/gentle-rocks-repeat.md b/.changeset/gentle-rocks-repeat.md deleted file mode 100644 index 462e36659b8..00000000000 --- a/.changeset/gentle-rocks-repeat.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Fix 'window is not defined' error when calling `clearIndexedDbPersistence` from a service worker diff --git a/.changeset/great-cheetahs-invite.md b/.changeset/great-cheetahs-invite.md deleted file mode 100644 index f6c8dbd182e..00000000000 --- a/.changeset/great-cheetahs-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/auth': patch ---- - -Fixed: `ActionCodeURL` not populating `languageCode` from the url. diff --git a/.changeset/hungry-snails-drive.md b/.changeset/hungry-snails-drive.md deleted file mode 100644 index 1a29782a04d..00000000000 --- a/.changeset/hungry-snails-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/data-connect": patch ---- - -Fix DataConnectOperationError. diff --git a/.changeset/odd-wolves-sit.md b/.changeset/odd-wolves-sit.md deleted file mode 100644 index fc63acc005e..00000000000 --- a/.changeset/odd-wolves-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/firestore": patch ---- - -Add unique IDs and state information into fatal error messages instead of the generic "unexpected state" message. diff --git a/.changeset/slow-students-fry.md b/.changeset/slow-students-fry.md deleted file mode 100644 index 45f3cf7e576..00000000000 --- a/.changeset/slow-students-fry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/firestore': patch -'firebase': patch ---- - -Fix issue where Firestore would produce `undefined` for document snapshot data if using IndexedDB persistence and "clear site data" (or equivalent) button was pressed in the web browser. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 547862a7b99..4cd59d2626d 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,12 +8,12 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.4", - "@firebase/app-compat": "0.2.53", + "@firebase/app": "0.11.5", + "@firebase/app-compat": "0.2.54", "@firebase/analytics": "0.10.12", "@firebase/analytics-compat": "0.2.18", - "@firebase/auth": "1.10.0", - "@firebase/auth-compat": "0.5.20", + "@firebase/auth": "1.10.1", + "@firebase/auth-compat": "0.5.21", "@firebase/functions": "0.12.3", "@firebase/functions-compat": "0.3.20", "@firebase/messaging": "0.12.17", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 6f0829cc16e..9ca8917ab4c 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.4", - "@firebase/firestore": "4.7.10" + "@firebase/app": "0.11.5", + "@firebase/firestore": "4.7.11" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 4ba2bef35b8..a86c4b1f7b5 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.6.0", + "firebase": "11.6.1", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 0dfbb6e431b..1064125d5f6 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 6b73106cd07..d56f6f7c61e 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index e0c922a311c..630e7a8d234 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 31d2c734de1..ae6555da970 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 35e8bd7fd36..d505c7b6240 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.2.54 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.11.5 + ## 0.2.53 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 6437d895d4f..e113c708c74 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.53", + "version": "0.2.54", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "@firebase/util": "1.11.0", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.13", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 8e1b0766095..3528eee556d 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.11.5 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.11.4 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index dce420d3b30..848919067bd 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.4", + "version": "0.11.5", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 81cb295aabc..66b1e0d6e28 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/auth-compat +## 0.5.21 + +### Patch Changes + +- Updated dependencies [[`1363ecc`](https://github.com/firebase/firebase-js-sdk/commit/1363ecc533de0ba5bfcae206a831acc33f9020a6)]: + - @firebase/auth@1.10.1 + ## 0.5.20 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index a10dc65173b..fa69e3f3679 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.20", + "version": "0.5.21", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.0", + "@firebase/auth": "1.10.1", "@firebase/auth-types": "0.13.0", "@firebase/component": "0.6.13", "@firebase/util": "1.11.0", @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 3eb66ffa508..5a52929a128 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/auth +## 1.10.1 + +### Patch Changes + +- [`1363ecc`](https://github.com/firebase/firebase-js-sdk/commit/1363ecc533de0ba5bfcae206a831acc33f9020a6) [#8912](https://github.com/firebase/firebase-js-sdk/pull/8912) - Fixed: `ActionCodeURL` not populating `languageCode` from the url. + ## 1.10.0 ### Minor Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index dde545bb198..6a704a4d4b6 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.0", + "version": "1.10.1", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index da401509f5d..03e17644a77 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +## 0.3.4 + +### Patch Changes + +- [`1df3d26`](https://github.com/firebase/firebase-js-sdk/commit/1df3d26fbfb4db24b74d5d779825017e9ec40eaa) [#8898](https://github.com/firebase/firebase-js-sdk/pull/8898) - Fix DataConnectOperationError. + ## 0.3.3 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 5b792b1bfe1..00f9bb492cc 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.3", + "version": "0.3.4", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 4233e735858..65deedb34e2 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 2c86f94adbd..d6f5ddc1707 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index ca4de9bb639..e71a10d560f 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,24 @@ # firebase +## 11.6.1 + +### Patch Changes + +- [`ed0803a`](https://github.com/firebase/firebase-js-sdk/commit/ed0803a29791cc0cecd0153f95e814ddcee7efd8) [#8915](https://github.com/firebase/firebase-js-sdk/pull/8915) - Fixed the `null` value handling in `!=` and `not-in` filters. + +- [`88a8055`](https://github.com/firebase/firebase-js-sdk/commit/88a8055808bdbd1c75011a94d11062460027d931) [#8888](https://github.com/firebase/firebase-js-sdk/pull/8888) (fixes [#6465](https://github.com/firebase/firebase-js-sdk/issues/6465)) - Fix 'window is not defined' error when calling `clearIndexedDbPersistence` from a service worker + +- [`195d943`](https://github.com/firebase/firebase-js-sdk/commit/195d943103795a50bb3fc5c56ef2bb64610006a1) [#8871](https://github.com/firebase/firebase-js-sdk/pull/8871) (fixes [#8593](https://github.com/firebase/firebase-js-sdk/issues/8593)) - Fix issue where Firestore would produce `undefined` for document snapshot data if using IndexedDB persistence and "clear site data" (or equivalent) button was pressed in the web browser. + +- Updated dependencies [[`ed0803a`](https://github.com/firebase/firebase-js-sdk/commit/ed0803a29791cc0cecd0153f95e814ddcee7efd8), [`88a8055`](https://github.com/firebase/firebase-js-sdk/commit/88a8055808bdbd1c75011a94d11062460027d931), [`1363ecc`](https://github.com/firebase/firebase-js-sdk/commit/1363ecc533de0ba5bfcae206a831acc33f9020a6), [`1df3d26`](https://github.com/firebase/firebase-js-sdk/commit/1df3d26fbfb4db24b74d5d779825017e9ec40eaa), [`e055e90`](https://github.com/firebase/firebase-js-sdk/commit/e055e9057caab4d9f73734307fe4e0be2098249b), [`195d943`](https://github.com/firebase/firebase-js-sdk/commit/195d943103795a50bb3fc5c56ef2bb64610006a1)]: + - @firebase/app@0.11.5 + - @firebase/firestore@4.7.11 + - @firebase/auth@1.10.1 + - @firebase/data-connect@0.3.4 + - @firebase/app-compat@0.2.54 + - @firebase/firestore-compat@0.3.46 + - @firebase/auth-compat@0.5.21 + ## 11.6.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 0a108875770..3a4bec301e3 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.6.0", + "version": "11.6.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,16 +399,16 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.4", - "@firebase/app-compat": "0.2.53", + "@firebase/app": "0.11.5", + "@firebase/app-compat": "0.2.54", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.0", - "@firebase/auth-compat": "0.5.20", - "@firebase/data-connect": "0.3.3", + "@firebase/auth": "1.10.1", + "@firebase/auth-compat": "0.5.21", + "@firebase/data-connect": "0.3.4", "@firebase/database": "1.0.14", "@firebase/database-compat": "2.0.5", - "@firebase/firestore": "4.7.10", - "@firebase/firestore-compat": "0.3.45", + "@firebase/firestore": "4.7.11", + "@firebase/firestore-compat": "0.3.46", "@firebase/functions": "0.12.3", "@firebase/functions-compat": "0.3.20", "@firebase/installations": "0.6.13", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 87b800344b4..aadd8c532b3 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.46 + +### Patch Changes + +- Updated dependencies [[`ed0803a`](https://github.com/firebase/firebase-js-sdk/commit/ed0803a29791cc0cecd0153f95e814ddcee7efd8), [`88a8055`](https://github.com/firebase/firebase-js-sdk/commit/88a8055808bdbd1c75011a94d11062460027d931), [`e055e90`](https://github.com/firebase/firebase-js-sdk/commit/e055e9057caab4d9f73734307fe4e0be2098249b), [`195d943`](https://github.com/firebase/firebase-js-sdk/commit/195d943103795a50bb3fc5c56ef2bb64610006a1)]: + - @firebase/firestore@4.7.11 + ## 0.3.45 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 35415667824..58210252655 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.45", + "version": "0.3.46", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.6.13", - "@firebase/firestore": "4.7.10", + "@firebase/firestore": "4.7.11", "@firebase/util": "1.11.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 26128e8d56a..421f33ed1d5 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/firestore +## 4.7.11 + +### Patch Changes + +- [`ed0803a`](https://github.com/firebase/firebase-js-sdk/commit/ed0803a29791cc0cecd0153f95e814ddcee7efd8) [#8915](https://github.com/firebase/firebase-js-sdk/pull/8915) - Fixed the `null` value handling in `!=` and `not-in` filters. + +- [`88a8055`](https://github.com/firebase/firebase-js-sdk/commit/88a8055808bdbd1c75011a94d11062460027d931) [#8888](https://github.com/firebase/firebase-js-sdk/pull/8888) (fixes [#6465](https://github.com/firebase/firebase-js-sdk/issues/6465)) - Fix 'window is not defined' error when calling `clearIndexedDbPersistence` from a service worker + +- [`e055e90`](https://github.com/firebase/firebase-js-sdk/commit/e055e9057caab4d9f73734307fe4e0be2098249b) [#8313](https://github.com/firebase/firebase-js-sdk/pull/8313) - Add unique IDs and state information into fatal error messages instead of the generic "unexpected state" message. + +- [`195d943`](https://github.com/firebase/firebase-js-sdk/commit/195d943103795a50bb3fc5c56ef2bb64610006a1) [#8871](https://github.com/firebase/firebase-js-sdk/pull/8871) (fixes [#8593](https://github.com/firebase/firebase-js-sdk/issues/8593)) - Fix issue where Firestore would produce `undefined` for document snapshot data if using IndexedDB persistence and "clear site data" (or equivalent) button was pressed in the web browser. + ## 4.7.10 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 0c9ddeee843..8cc7e5e18f5 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.10", + "version": "4.7.11", "engines": { "node": ">=18.0.0" }, @@ -110,9 +110,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.4", - "@firebase/app-compat": "0.2.53", - "@firebase/auth": "1.10.0", + "@firebase/app": "0.11.5", + "@firebase/app-compat": "0.2.54", + "@firebase/auth": "1.10.1", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 5fe4e7e85ce..c2757fcf130 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 477fd599ac0..4ddf15ac556 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 1814656c070..0f5203dd5d1 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index cf367ff7954..83db977a6b6 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 5e02d85a7d4..388670eb5ab 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", + "@firebase/app-compat": "0.2.54", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 93300081e57..5e25b2b1ca0 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index ea04ce4dda3..69c24f13465 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.53" + "@firebase/app-compat": "0.2.54" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index 0fca12f70f9..07e8e60d054 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 2e840c85238..1055c892435 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.53" + "@firebase/app-compat": "0.2.54" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index e0252a59bca..4262488b0fb 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 1380b70185b..d829a79cbc5 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,8 +44,8 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.53", - "@firebase/auth-compat": "0.5.20", + "@firebase/app-compat": "0.2.54", + "@firebase/auth-compat": "0.5.21", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 57b58d0dda3..0a7a8af9b93 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,8 +54,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.4", - "@firebase/auth": "1.10.0", + "@firebase/app": "0.11.5", + "@firebase/auth": "1.10.1", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index e9f19f330e2..80500aa1392 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 9faf562a535..e3472e733f8 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 44a870c3905..f2a4a35bd53 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.4", + "@firebase/app": "0.11.5", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.0", "@rollup/plugin-commonjs": "21.1.0", From 0e2558a96b1408fa7047b63f3d506939ff1f28ff Mon Sep 17 00:00:00 2001 From: Ehsan Date: Mon, 28 Apr 2025 13:13:42 -0700 Subject: [PATCH 172/295] Improve the integration test coverage for online vs offline comparisons. (#8975) * Improve the integration test coverage for online vs offline comparisons. * prettier. * Add missing cases. --- .../api/composite_index_query.test.ts | 12 ++++++ .../test/integration/api/database.test.ts | 40 ++++++++++++++++--- .../test/integration/api/query.test.ts | 38 +++++++++++++++++- .../util/composite_index_test_helper.ts | 2 + .../test/integration/util/helpers.ts | 29 ++++++++++++-- 5 files changed, 111 insertions(+), 10 deletions(-) diff --git a/packages/firestore/test/integration/api/composite_index_query.test.ts b/packages/firestore/test/integration/api/composite_index_query.test.ts index 04cdafe7169..d08cc77bde9 100644 --- a/packages/firestore/test/integration/api/composite_index_query.test.ts +++ b/packages/firestore/test/integration/api/composite_index_query.test.ts @@ -73,6 +73,7 @@ apiDescribe('Composite Index Queries', persistence => { return testHelper.withTestDocs(persistence, testDocs, async coll => { // a == 1, limit 2, b - desc await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.query( coll, where('a', '==', 1), @@ -97,6 +98,7 @@ apiDescribe('Composite Index Queries', persistence => { return testHelper.withTestDocs(persistence, testDocs, async coll => { // with one inequality: a>2 || b==1. await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '>', 2), where('b', '==', 1)) @@ -108,6 +110,7 @@ apiDescribe('Composite Index Queries', persistence => { // Test with limits (implicit order by ASC): (a==1) || (b > 0) LIMIT 2 await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '==', 1), where('b', '>', 0)), @@ -120,6 +123,7 @@ apiDescribe('Composite Index Queries', persistence => { // Test with limits (explicit order by): (a==1) || (b > 0) LIMIT_TO_LAST 2 // Note: The public query API does not allow implicit ordering when limitToLast is used. await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '==', 1), where('b', '>', 0)), @@ -132,6 +136,7 @@ apiDescribe('Composite Index Queries', persistence => { // Test with limits (explicit order by ASC): (a==2) || (b == 1) ORDER BY a LIMIT 1 await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '==', 2), where('b', '==', 1)), @@ -143,6 +148,7 @@ apiDescribe('Composite Index Queries', persistence => { // Test with limits (explicit order by DESC): (a==2) || (b == 1) ORDER BY a LIMIT_TO_LAST 1 await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '==', 2), where('b', '==', 1)), @@ -857,12 +863,14 @@ apiDescribe('Composite Index Queries', persistence => { return testHelper.withTestDocs(persistence, testDocs, async coll => { // implicit AND: a != 1 && b < 2 await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.query(coll, where('a', '!=', 1), where('b', '<', 2)), 'doc2' ); // explicit AND: a != 1 && b < 2 await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, and(where('a', '!=', 1), where('b', '<', 2)) @@ -873,6 +881,7 @@ apiDescribe('Composite Index Queries', persistence => { // explicit AND: a < 3 && b not-in [2, 3] // Implicitly ordered by: a asc, b asc, __name__ asc await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, and(where('a', '<', 3), where('b', 'not-in', [2, 3])) @@ -884,6 +893,7 @@ apiDescribe('Composite Index Queries', persistence => { // a <3 && b != 0, implicitly ordered by: a asc, b asc, __name__ asc await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.query( coll, where('b', '!=', 0), @@ -896,6 +906,7 @@ apiDescribe('Composite Index Queries', persistence => { // a <3 && b != 0, ordered by: b desc, a desc, __name__ desc await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.query( coll, where('a', '<', 3), @@ -909,6 +920,7 @@ apiDescribe('Composite Index Queries', persistence => { // explicit OR: multiple inequality: a>2 || b<1. await testHelper.assertOnlineAndOfflineResultsMatch( + coll, testHelper.compositeQuery( coll, or(where('a', '>', 2), where('b', '<', 1)) diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 8cbe99b3cd9..9675e02efeb 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -780,7 +780,11 @@ apiDescribe('Database', persistence => { return withTestCollection(persistence, docs, async randomCol => { const orderedQuery = query(randomCol, orderBy('embedding')); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...documentIds); + await checkOnlineAndOfflineResultsMatch( + randomCol, + orderedQuery, + ...documentIds + ); const orderedQueryLessThan = query( randomCol, @@ -788,6 +792,7 @@ apiDescribe('Database', persistence => { where('embedding', '<', vector([1, 2, 100, 4, 4])) ); await checkOnlineAndOfflineResultsMatch( + randomCol, orderedQueryLessThan, ...documentIds.slice(2, 11) ); @@ -798,6 +803,7 @@ apiDescribe('Database', persistence => { where('embedding', '>', vector([1, 2, 100, 4, 4])) ); await checkOnlineAndOfflineResultsMatch( + randomCol, orderedQueryGreaterThan, ...documentIds.slice(12, 13) ); @@ -2396,6 +2402,7 @@ apiDescribe('Database', persistence => { 'a' ]; await checkOnlineAndOfflineResultsMatch( + collectionRef, orderedQuery, ...expectedDocs ); @@ -2416,6 +2423,7 @@ apiDescribe('Database', persistence => { 'Aa' ]; await checkOnlineAndOfflineResultsMatch( + collectionRef, filteredQuery, ...expectedDocs ); @@ -2467,7 +2475,11 @@ apiDescribe('Database', persistence => { unsubscribe(); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + await checkOnlineAndOfflineResultsMatch( + collectionRef, + orderedQuery, + ...expectedDocs + ); }); }); @@ -2499,7 +2511,11 @@ apiDescribe('Database', persistence => { unsubscribe(); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + await checkOnlineAndOfflineResultsMatch( + collectionRef, + orderedQuery, + ...expectedDocs + ); }); }); @@ -2531,7 +2547,11 @@ apiDescribe('Database', persistence => { unsubscribe(); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + await checkOnlineAndOfflineResultsMatch( + collectionRef, + orderedQuery, + ...expectedDocs + ); }); }); @@ -2563,7 +2583,11 @@ apiDescribe('Database', persistence => { unsubscribe(); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + await checkOnlineAndOfflineResultsMatch( + collectionRef, + orderedQuery, + ...expectedDocs + ); }); }); @@ -2608,7 +2632,11 @@ apiDescribe('Database', persistence => { unsubscribe(); - await checkOnlineAndOfflineResultsMatch(orderedQuery, ...expectedDocs); + await checkOnlineAndOfflineResultsMatch( + collectionRef, + orderedQuery, + ...expectedDocs + ); }); }); diff --git a/packages/firestore/test/integration/api/query.test.ts b/packages/firestore/test/integration/api/query.test.ts index 5871607eb03..0f3c1c82a2d 100644 --- a/packages/firestore/test/integration/api/query.test.ts +++ b/packages/firestore/test/integration/api/query.test.ts @@ -1357,6 +1357,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { // a == 1 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, where('a', '==', 1)), 'doc1', 'doc4', @@ -1365,18 +1366,21 @@ apiDescribe('Queries', persistence => { // Implicit AND: a == 1 && b == 3 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, where('a', '==', 1), where('b', '==', 3)), 'doc4' ); // explicit AND: a == 1 && b == 3 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, and(where('a', '==', 1), where('b', '==', 3))), 'doc4' ); // a == 1, limit 2 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, where('a', '==', 1), limit(2)), 'doc1', 'doc4' @@ -1384,6 +1388,7 @@ apiDescribe('Queries', persistence => { // explicit OR: a == 1 || b == 1 with limit 2 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', '==', 1), where('b', '==', 1)), limit(2)), 'doc1', 'doc2' @@ -1391,6 +1396,7 @@ apiDescribe('Queries', persistence => { // only limit 2 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, limit(2)), 'doc1', 'doc2' @@ -1398,6 +1404,7 @@ apiDescribe('Queries', persistence => { // limit 2 and order by b desc await checkOnlineAndOfflineResultsMatch( + coll, query(coll, limit(2), orderBy('b', 'desc')), 'doc4', 'doc3' @@ -1417,6 +1424,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { // Two equalities: a==1 || b==1. await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', '==', 1), where('b', '==', 1))), 'doc1', 'doc2', @@ -1426,6 +1434,7 @@ apiDescribe('Queries', persistence => { // (a==1 && b==0) || (a==3 && b==2) await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or( @@ -1439,6 +1448,7 @@ apiDescribe('Queries', persistence => { // a==1 && (b==0 || b==3). await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1452,6 +1462,7 @@ apiDescribe('Queries', persistence => { // (a==2 || b==2) && (a==3 || b==3) await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1464,6 +1475,7 @@ apiDescribe('Queries', persistence => { // Test with limits without orderBy (the __name__ ordering is the tie breaker). await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', '==', 2), where('b', '==', 1)), limit(1)), 'doc2' ); @@ -1483,6 +1495,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { // a==2 || b in [2,3] await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', '==', 2), where('b', 'in', [2, 3]))), 'doc3', 'doc4', @@ -1504,6 +1517,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { // a==2 || b array-contains 7 await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', '==', 2), where('b', 'array-contains', 7))), 'doc3', 'doc4', @@ -1512,6 +1526,7 @@ apiDescribe('Queries', persistence => { // a==2 || b array-contains-any [0, 3] await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or(where('a', '==', 2), where('b', 'array-contains-any', [0, 3])) @@ -1535,6 +1550,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or( @@ -1549,6 +1565,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1560,6 +1577,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or( @@ -1573,6 +1591,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1598,6 +1617,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or(where('a', 'in', [2, 3]), where('b', 'array-contains', 3)) @@ -1608,6 +1628,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and(where('a', 'in', [2, 3]), where('b', 'array-contains', 7)) @@ -1616,6 +1637,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, or( @@ -1629,6 +1651,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1653,6 +1676,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { await checkOnlineAndOfflineResultsMatch( + coll, query(coll, where('a', '==', 1), orderBy('a')), 'doc1', 'doc4', @@ -1660,6 +1684,7 @@ apiDescribe('Queries', persistence => { ); await checkOnlineAndOfflineResultsMatch( + coll, query(coll, where('a', 'in', [2, 3]), orderBy('a')), 'doc6', 'doc3' @@ -1680,6 +1705,7 @@ apiDescribe('Queries', persistence => { return withTestCollection(persistence, testDocs, async coll => { // Two IN operations on different fields with disjunction. await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', 'in', [2, 3]), where('b', 'in', [0, 2]))), 'doc1', 'doc3', @@ -1688,6 +1714,7 @@ apiDescribe('Queries', persistence => { // Two IN operations on different fields with conjunction. await checkOnlineAndOfflineResultsMatch( + coll, query(coll, and(where('a', 'in', [2, 3]), where('b', 'in', [0, 2]))), 'doc3' ); @@ -1695,6 +1722,7 @@ apiDescribe('Queries', persistence => { // Two IN operations on the same field. // a IN [1,2,3] && a IN [0,1,4] should result in "a==1". await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and(where('a', 'in', [1, 2, 3]), where('a', 'in', [0, 1, 4])) @@ -1707,6 +1735,7 @@ apiDescribe('Queries', persistence => { // a IN [2,3] && a IN [0,1,4] is never true and so the result should be an // empty set. await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and(where('a', 'in', [2, 3]), where('a', 'in', [0, 1, 4])) @@ -1715,6 +1744,7 @@ apiDescribe('Queries', persistence => { // a IN [0,3] || a IN [0,2] should union them (similar to: a IN [0,2,3]). await checkOnlineAndOfflineResultsMatch( + coll, query(coll, or(where('a', 'in', [0, 3]), where('a', 'in', [0, 2]))), 'doc3', 'doc6' @@ -1722,6 +1752,7 @@ apiDescribe('Queries', persistence => { // Nested composite filter on the same field. await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1737,6 +1768,7 @@ apiDescribe('Queries', persistence => { // Nested composite filter on the different fields. await checkOnlineAndOfflineResultsMatch( + coll, query( coll, and( @@ -1772,6 +1804,7 @@ apiDescribe('Queries', persistence => { let testQuery = query(coll, where('zip', '!=', 98101)); await checkOnlineAndOfflineResultsMatch( + coll, testQuery, 'a', 'b', @@ -1784,6 +1817,7 @@ apiDescribe('Queries', persistence => { testQuery = query(coll, where('zip', '!=', Number.NaN)); await checkOnlineAndOfflineResultsMatch( + coll, testQuery, 'b', 'c', @@ -1796,6 +1830,7 @@ apiDescribe('Queries', persistence => { testQuery = query(coll, where('zip', '!=', null)); await checkOnlineAndOfflineResultsMatch( + coll, testQuery, 'a', 'b', @@ -1832,6 +1867,7 @@ apiDescribe('Queries', persistence => { where('zip', 'not-in', [98101, 98103, [98101, 98102]]) ); await checkOnlineAndOfflineResultsMatch( + coll, testQuery, 'a', 'b', @@ -1842,7 +1878,7 @@ apiDescribe('Queries', persistence => { ); testQuery = query(coll, where('zip', 'not-in', [null])); - await checkOnlineAndOfflineResultsMatch(testQuery); + await checkOnlineAndOfflineResultsMatch(coll, testQuery); }); }); }); diff --git a/packages/firestore/test/integration/util/composite_index_test_helper.ts b/packages/firestore/test/integration/util/composite_index_test_helper.ts index 5199539768b..a908ed13455 100644 --- a/packages/firestore/test/integration/util/composite_index_test_helper.ts +++ b/packages/firestore/test/integration/util/composite_index_test_helper.ts @@ -162,10 +162,12 @@ export class CompositeIndexTestHelper { // the same as running it while offline. The expected document Ids are hashed to match the // actual document IDs created by the test helper. async assertOnlineAndOfflineResultsMatch( + collection: CollectionReference, query: Query, ...expectedDocs: string[] ): Promise { return checkOnlineAndOfflineResultsMatch( + this.query(collection), query, ...this.toHashedIds(expectedDocs) ); diff --git a/packages/firestore/test/integration/util/helpers.ts b/packages/firestore/test/integration/util/helpers.ts index 465bc8edd61..b36ed980295 100644 --- a/packages/firestore/test/integration/util/helpers.ts +++ b/packages/firestore/test/integration/util/helpers.ts @@ -541,19 +541,42 @@ export function partitionedTestDocs(partitions: { * documents as running the query while offline. If `expectedDocs` is provided, it also checks * that both online and offline query result is equal to the expected documents. * + * This function first performs a "get" for the entire COLLECTION from the server. + * It then performs the QUERY from CACHE which, results in `executeFullCollectionScan()` + * It then performs the QUERY from SERVER. + * It then performs the QUERY from CACHE again, which results in `performQueryUsingRemoteKeys()`. + * It then ensure that all the above QUERY results are the same. + * + * @param collection The collection on which the query is performed. * @param query The query to check * @param expectedDocs Ordered list of document keys that are expected to match the query */ export async function checkOnlineAndOfflineResultsMatch( + collection: Query, query: Query, ...expectedDocs: string[] ): Promise { + // Note: Order matters. The following has to be done in the specific order: + + // 1- Pre-populate the cache with the entire collection. + await getDocsFromServer(collection); + + // 2- This performs the query against the cache using full collection scan. + const docsFromCacheFullCollectionScan = await getDocsFromCache(query); + + // 3- This goes to the server (backend/emulator). const docsFromServer = await getDocsFromServer(query); + // 4- This performs the query against the cache using remote keys. + const docsFromCacheUsingRemoteKeys = await getDocsFromCache(query); + + expect(toIds(docsFromServer)).to.deep.equal( + toIds(docsFromCacheFullCollectionScan) + ); + expect(toIds(docsFromServer)).to.deep.equal( + toIds(docsFromCacheUsingRemoteKeys) + ); if (expectedDocs.length !== 0) { expect(expectedDocs).to.deep.equal(toIds(docsFromServer)); } - - const docsFromCache = await getDocsFromCache(query); - expect(toIds(docsFromServer)).to.deep.equal(toIds(docsFromCache)); } From dd6a8f076cb06920a2cff3b9adb78a85624ad64d Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 29 Apr 2025 09:31:41 -0400 Subject: [PATCH 173/295] fix(vertexai): add missing quote to chat role error message (#8979) --- packages/vertexai/src/methods/chat-session-helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vertexai/src/methods/chat-session-helpers.ts b/packages/vertexai/src/methods/chat-session-helpers.ts index 899db4f626a..2106a40b90b 100644 --- a/packages/vertexai/src/methods/chat-session-helpers.ts +++ b/packages/vertexai/src/methods/chat-session-helpers.ts @@ -111,7 +111,7 @@ export function validateChatHistory(history: Content[]): void { if (!validPreviousContentRoles.includes(prevContent.role)) { throw new VertexAIError( VertexAIErrorCode.INVALID_CONTENT, - `Content with role '${role} can't follow '${ + `Content with role '${role}' can't follow '${ prevContent.role }'. Valid previous roles: ${JSON.stringify( VALID_PREVIOUS_CONTENT_ROLES From ea1f9139e6baec0269fbb91233fd3f7f4b0d5875 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 29 Apr 2025 11:24:16 -0700 Subject: [PATCH 174/295] Auto Enable SSL for Firebase Studio (#8980) --- .changeset/nice-plants-thank.md | 10 ++++++++ common/api-review/util.api.md | 3 +++ .../database-compat/test/database.test.ts | 11 +++++++++ packages/database/src/api/Database.ts | 9 +++++-- packages/firestore/externs.json | 1 + packages/firestore/src/lite-api/database.ts | 6 +++-- .../firestore/test/unit/api/database.test.ts | 14 +++++++++++ packages/functions/src/service.test.ts | 9 +++++++ packages/functions/src/service.ts | 6 ++++- packages/storage/src/service.ts | 9 +++++-- packages/storage/test/unit/service.test.ts | 22 +++++++++++++++++ packages/util/index.node.ts | 1 + packages/util/index.ts | 1 + packages/util/src/url.ts | 24 +++++++++++++++++++ 14 files changed, 119 insertions(+), 7 deletions(-) create mode 100644 .changeset/nice-plants-thank.md create mode 100644 packages/util/src/url.ts diff --git a/.changeset/nice-plants-thank.md b/.changeset/nice-plants-thank.md new file mode 100644 index 00000000000..05fb520760f --- /dev/null +++ b/.changeset/nice-plants-thank.md @@ -0,0 +1,10 @@ +--- +"@firebase/database-compat": patch +"@firebase/database": patch +"@firebase/firestore": patch +"@firebase/functions": patch +"@firebase/storage": patch +"@firebase/util": patch +--- + +Auto Enable SSL for Firebase Studio diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 8c62ff229ac..28cc9a160d4 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -269,6 +269,9 @@ export function isBrowserExtension(): boolean; // @public export function isCloudflareWorker(): boolean; +// @public +export function isCloudWorkstation(host: string): boolean; + // Warning: (ae-missing-release-tag) "isElectron" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/database-compat/test/database.test.ts b/packages/database-compat/test/database.test.ts index fa21058591f..19e02943c9c 100644 --- a/packages/database-compat/test/database.test.ts +++ b/packages/database-compat/test/database.test.ts @@ -292,6 +292,17 @@ describe('Database Tests', () => { expect((db as any)._delegate._repo.repoInfo_.isUsingEmulator).to.be.false; }); + it('uses ssl when useEmulator is called with ssl specified', () => { + const db = firebase.database(); + const cloudWorkstation = 'abc.cloudworkstations.dev'; + db.useEmulator(cloudWorkstation, 80); + expect((db as any)._delegate._repo.repoInfo_.isUsingEmulator).to.be.true; + expect((db as any)._delegate._repo.repoInfo_.host).to.equal( + `${cloudWorkstation}:80` + ); + expect((db as any)._delegate._repo.repoInfo_.secure).to.be.true; + }); + it('cannot call useEmulator after use', () => { const db = (firebase as any).database(); diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 32fd4674a44..f247fc6288c 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -29,7 +29,8 @@ import { createMockUserToken, deepEqual, EmulatorMockTokenOptions, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + isCloudWorkstation } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -89,9 +90,12 @@ function repoManagerApplyEmulatorSettings( emulatorOptions: RepoInfoEmulatorOptions, tokenProvider?: AuthTokenProvider ): void { + const portIndex = hostAndPort.lastIndexOf(':'); + const host = hostAndPort.substring(0, portIndex); + const useSsl = isCloudWorkstation(host); repo.repoInfo_ = new RepoInfo( hostAndPort, - /* secure= */ false, + /* secure= */ useSsl, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, @@ -352,6 +356,7 @@ export function connectDatabaseEmulator( ): void { db = getModularInstance(db); db._checkNotDeleted('useEmulator'); + const hostAndPort = `${host}:${port}`; const repo = db._repoInternal; if (db._instanceStarted) { diff --git a/packages/firestore/externs.json b/packages/firestore/externs.json index 03d19ee8e83..d730cfeac0a 100644 --- a/packages/firestore/externs.json +++ b/packages/firestore/externs.json @@ -33,6 +33,7 @@ "packages/util/dist/src/compat.d.ts", "packages/util/dist/src/global.d.ts", "packages/util/dist/src/obj.d.ts", + "packages/util/dist/src/url.d.ts", "packages/firestore/src/protos/firestore_bundle_proto.ts", "packages/firestore/src/protos/firestore_proto_api.ts", "packages/firestore/src/util/error.ts", diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 9a68e2a86d6..294206e54c2 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -26,7 +26,8 @@ import { createMockUserToken, deepEqual, EmulatorMockTokenOptions, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + isCloudWorkstation } from '@firebase/util'; import { @@ -325,6 +326,7 @@ export function connectFirestoreEmulator( } = {} ): void { firestore = cast(firestore, Firestore); + const useSsl = isCloudWorkstation(host); const settings = firestore._getSettings(); const existingConfig = { ...settings, @@ -340,7 +342,7 @@ export function connectFirestoreEmulator( const newConfig = { ...settings, host: newHostSetting, - ssl: false, + ssl: useSsl, emulatorOptions: options }; // No-op if the new configuration matches the current configuration. This supports SSR diff --git a/packages/firestore/test/unit/api/database.test.ts b/packages/firestore/test/unit/api/database.test.ts index 1cc1df51063..46e4c65f180 100644 --- a/packages/firestore/test/unit/api/database.test.ts +++ b/packages/firestore/test/unit/api/database.test.ts @@ -564,6 +564,20 @@ describe('Settings', () => { expect(db._getEmulatorOptions()).to.equal(emulatorOptions); }); + it('sets ssl to true if cloud workstation host', () => { + // Use a new instance of Firestore in order to configure settings. + const db = newTestFirestore(); + const emulatorOptions = { mockUserToken: 'test' }; + const workstationHost = 'abc.cloudworkstations.dev'; + connectFirestoreEmulator(db, workstationHost, 9000, emulatorOptions); + + expect(db._getSettings().host).to.exist.and.to.equal( + `${workstationHost}:9000` + ); + expect(db._getSettings().ssl).to.exist.and.to.be.true; + expect(db._getEmulatorOptions()).to.equal(emulatorOptions); + }); + it('prefers host from useEmulator to host from settings', () => { // Use a new instance of Firestore in order to configure settings. const db = newTestFirestore(); diff --git a/packages/functions/src/service.test.ts b/packages/functions/src/service.test.ts index bb29f9025fe..8119fda39d5 100644 --- a/packages/functions/src/service.test.ts +++ b/packages/functions/src/service.test.ts @@ -47,6 +47,15 @@ describe('Firebase Functions > Service', () => { 'http://localhost:5005/my-project/us-central1/foo' ); }); + it('can use emulator with SSL', () => { + service = createTestService(app); + const workstationHost = 'abc.cloudworkstations.dev'; + connectFunctionsEmulator(service, workstationHost, 5005); + assert.equal( + service._url('foo'), + `https://${workstationHost}:5005/my-project/us-central1/foo` + ); + }); it('correctly sets region', () => { service = createTestService(app, 'my-region'); diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index 34cb732bf71..dce52e1f19d 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,6 +30,7 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { isCloudWorkstation } from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -174,7 +175,10 @@ export function connectFunctionsEmulator( host: string, port: number ): void { - functionsInstance.emulatorOrigin = `http://${host}:${port}`; + const useSsl = isCloudWorkstation(host); + functionsInstance.emulatorOrigin = `http${ + useSsl ? 's' : '' + }://${host}:${port}`; } /** diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 422e3e1a188..8a942aac62a 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -42,7 +42,11 @@ import { } from './implementation/error'; import { validateNumber } from './implementation/type'; import { FirebaseStorage } from './public-types'; -import { createMockUserToken, EmulatorMockTokenOptions } from '@firebase/util'; +import { + createMockUserToken, + EmulatorMockTokenOptions, + isCloudWorkstation +} from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; export function isUrl(path?: string): boolean { @@ -141,7 +145,8 @@ export function connectStorageEmulator( } = {} ): void { storage.host = `${host}:${port}`; - storage._protocol = 'http'; + const useSsl = isCloudWorkstation(host); + storage._protocol = useSsl ? 'https' : 'http'; const { mockUserToken } = options; if (mockUserToken) { storage._overrideAuthToken = diff --git a/packages/storage/test/unit/service.test.ts b/packages/storage/test/unit/service.test.ts index be42bb8dd6e..bc443c60a03 100644 --- a/packages/storage/test/unit/service.test.ts +++ b/packages/storage/test/unit/service.test.ts @@ -248,6 +248,28 @@ GOOG4-RSA-SHA256` expect(service._protocol).to.equal('http'); void getDownloadURL(ref(service, 'test.png')); }); + it('sets emulator host correctly with ssl', done => { + function newSend(connection: TestingConnection, url: string): void { + // Expect emulator host to be in url of storage operations requests, + // in this case getDownloadURL. + expect(url).to.match(/^https:\/\/test\.cloudworkstations\.dev:1234.+/); + connection.abort(); + injectTestConnection(null); + done(); + } + + injectTestConnection(() => newTestConnection(newSend)); + const service = new FirebaseStorageImpl( + testShared.fakeApp, + testShared.fakeAuthProvider, + testShared.fakeAppCheckTokenProvider + ); + const workstationHost = 'test.cloudworkstations.dev'; + connectStorageEmulator(service, workstationHost, 1234); + expect(service.host).to.equal(`${workstationHost}:1234`); + expect(service._protocol).to.equal('https'); + void getDownloadURL(ref(service, 'test.png')); + }); it('sets mock user token string if specified', done => { const mockUserToken = 'my-mock-user-token'; function newSend( diff --git a/packages/util/index.node.ts b/packages/util/index.node.ts index d839460713c..12fcf8a6de5 100644 --- a/packages/util/index.node.ts +++ b/packages/util/index.node.ts @@ -42,3 +42,4 @@ export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; export * from './src/global'; +export * from './src/url'; diff --git a/packages/util/index.ts b/packages/util/index.ts index 51c27c31099..1829c32a420 100644 --- a/packages/util/index.ts +++ b/packages/util/index.ts @@ -37,3 +37,4 @@ export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; export * from './src/global'; +export * from './src/url'; diff --git a/packages/util/src/url.ts b/packages/util/src/url.ts new file mode 100644 index 00000000000..33cec43bea9 --- /dev/null +++ b/packages/util/src/url.ts @@ -0,0 +1,24 @@ +/** + * @license + * Copyright 2025 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. + */ + +/** + * Checks whether host is a cloud workstation or not. + * @public + */ +export function isCloudWorkstation(host: string): boolean { + return host.endsWith('.cloudworkstations.dev'); +} From 1645cd644a0523a82a6afe976c4e48e9190a927b Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:44:20 -0600 Subject: [PATCH 175/295] Cleanup --- packages/firestore/src/api_pipelines.ts | 1 - packages/firestore/src/core/pipeline-util.ts | 2 +- .../firestore/src/lite-api/expressions.ts | 4 +- packages/firestore/src/lite-api/pipeline.ts | 45 +++---------------- packages/firestore/src/lite-api/stage.ts | 5 +-- .../test/integration/api/pipeline.test.ts | 12 +++++ .../test/integration/api/transactions.test.ts | 2 +- 7 files changed, 22 insertions(+), 49 deletions(-) diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts index ad7815af3e4..b632025f374 100644 --- a/packages/firestore/src/api_pipelines.ts +++ b/packages/firestore/src/api_pipelines.ts @@ -122,7 +122,6 @@ export { rand, array, arrayOffset, - currentContext, isError, ifError, isAbsent, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index ec25e258834..5f9b7d31844 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -221,7 +221,7 @@ export function toPipeline(query: Query, db: Firestore): Pipeline { ); } - pipeline = pipeline._limit(query.limit!, true); + pipeline = pipeline.limit(query.limit!, true); pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); } else { pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 03182ae3227..8120567c561 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -2134,7 +2134,7 @@ export class ExprWithAlias implements Selectable, UserData { /** * @internal */ -class ListOfExprs extends Expr { +class ListOfExprs extends Expr implements UserData { exprType: ExprType = 'ListOfExprs'; constructor(private exprs: Expr[]) { @@ -2345,7 +2345,7 @@ export function constant(value: string): Constant; * @param value The boolean value. * @return A new `Constant` instance. */ -export function constant(value: boolean): Constant; +export function constant(value: boolean): BooleanExpr; /** * Creates a `Constant` instance for a null value. diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 17ad5464725..d93a8fd6df0 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -339,21 +339,6 @@ export class Pipeline implements ProtoSerializable { return this._addStage(new Limit(limit)); } - /** - * Internal use only. - * Helper to add a limit stage when converting from a Query. - * - * @internal - * @private - * - * @param limit - * @param convertedFromLimitToLast - */ - _limit(limit: number, convertedFromLimitToLast: boolean): Pipeline { - return this._addStage(new Limit(limit, convertedFromLimitToLast)); - } - - /** * Returns a set of distinct values from the inputs to this stage. * @@ -552,31 +537,11 @@ export class Pipeline implements ProtoSerializable { * @param additionalOrderings Optional additional {@link Ordering} instances specifying the additional sorting criteria. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; - sort( - optionsOrOrderings: - | Ordering - | { - orderings: Ordering[]; - }, - ...rest: Ordering[] - ): Pipeline { - // Option object - if (optionsOrOrderings && 'orderings' in optionsOrOrderings) { - return this._addStage( - new Sort( - this.readUserData( - 'sort', - this.readUserData('sort', optionsOrOrderings.orderings) - ) - ) - ); - } else { - // Ordering object - return this._addStage( - new Sort(this.readUserData('sort', [optionsOrOrderings, ...rest])) - ); - } + sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline { + // Ordering object + return this._addStage( + new Sort(this.readUserData('sort', [ordering, ...additionalOrderings])) + ); } /** diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 1d8ae06eaf6..2cb95053825 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -319,10 +319,7 @@ export class FindNearest implements Stage { export class Limit implements Stage { name = 'limit'; - constructor( - readonly limit: number, - readonly convertedFromLimitTolast: boolean = false - ) { + constructor(readonly limit: number) { hardAssert( !isNaN(limit) && limit !== Infinity && limit !== -Infinity, 'Invalid limit value' diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 1ef61bf0304..7e7d4e6b82b 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -1139,6 +1139,18 @@ apiDescribe.only('Pipelines', persistence => { { title: "The Handmaid's Tale" } ); }); + + it('where with boolean constant', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(constant(true)) + .sort(ascending('__name__')) + .limit(2) + ); + expectResults(snapshot, 'book1', 'book10'); + }); }); describe('sort, offset, and limit stages', () => { diff --git a/packages/firestore/test/integration/api/transactions.test.ts b/packages/firestore/test/integration/api/transactions.test.ts index a4d30677a92..48590463857 100644 --- a/packages/firestore/test/integration/api/transactions.test.ts +++ b/packages/firestore/test/integration/api/transactions.test.ts @@ -33,7 +33,7 @@ import { runTransaction, setDoc } from '../util/firebase_export'; -import { apiDescribe, withTestDb } from '../util/helpers'; +import { apiDescribe, withTestCollection, withTestDb } from '../util/helpers'; apiDescribe('Database transactions', persistence => { type TransactionStage = ( From 0e127664946ba324c6566a02b393dafd23fc1ddb Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 30 Apr 2025 12:19:20 -0700 Subject: [PATCH 176/295] Add support for running the emulators in Cloud Workstation (#8968) --- .changeset/nine-pugs-crash.md | 11 ++++ common/api-review/storage.api.md | 4 +- packages/auth/src/api/index.test.ts | 24 +++++++ packages/auth/src/api/index.ts | 11 +++- packages/auth/test/helpers/mock_fetch.ts | 4 +- packages/data-connect/src/network/fetch.ts | 18 ++++-- .../src/network/transport/rest.ts | 8 ++- packages/data-connect/test/unit/fetch.test.ts | 43 +++++++++++-- packages/firestore/externs.json | 1 + packages/firestore/src/core/database_info.ts | 3 +- packages/firestore/src/lite-api/components.ts | 3 +- packages/firestore/src/lite-api/settings.ts | 3 + .../platform/browser/webchannel_connection.ts | 3 +- .../platform/browser_lite/fetch_connection.ts | 11 +++- .../firestore/src/remote/rest_connection.ts | 15 ++++- .../test/integration/util/internal_helpers.ts | 3 +- .../test/unit/remote/fetch_connection.test.ts | 64 +++++++++++++++++++ .../test/unit/remote/rest_connection.test.ts | 3 +- .../test/unit/specs/spec_test_runner.ts | 3 +- .../storage/src/implementation/connection.ts | 1 + .../storage/src/implementation/request.ts | 17 +++-- .../src/platform/browser/connection.ts | 5 ++ .../storage/src/platform/node/connection.ts | 41 +++++++++--- packages/storage/src/service.ts | 7 +- .../storage/test/browser/connection.test.ts | 18 +++++- packages/storage/test/node/connection.test.ts | 21 +++++- packages/storage/test/unit/connection.ts | 1 + packages/storage/test/unit/service.test.ts | 12 +++- 28 files changed, 314 insertions(+), 44 deletions(-) create mode 100644 .changeset/nine-pugs-crash.md create mode 100644 packages/firestore/test/unit/remote/fetch_connection.test.ts diff --git a/.changeset/nine-pugs-crash.md b/.changeset/nine-pugs-crash.md new file mode 100644 index 00000000000..b4a654a484f --- /dev/null +++ b/.changeset/nine-pugs-crash.md @@ -0,0 +1,11 @@ +--- +"@firebase/auth": patch +"@firebase/data-connect": patch +"@firebase/database-compat": patch +"@firebase/database": patch +"@firebase/firestore": patch +"@firebase/storage": patch +"@firebase/util": patch +--- + +Fix Auth Redirects on Firebase Studio diff --git a/common/api-review/storage.api.md b/common/api-review/storage.api.md index 4964aa40af7..f5302d2d5c5 100644 --- a/common/api-review/storage.api.md +++ b/common/api-review/storage.api.md @@ -58,7 +58,7 @@ export class _FirebaseStorageImpl implements FirebaseStorage { constructor( app: FirebaseApp, _authProvider: Provider, _appCheckProvider: Provider, - _url?: string | undefined, _firebaseVersion?: string | undefined); + _url?: string | undefined, _firebaseVersion?: string | undefined, _isUsingEmulator?: boolean); readonly app: FirebaseApp; // (undocumented) readonly _appCheckProvider: Provider; @@ -77,6 +77,8 @@ export class _FirebaseStorageImpl implements FirebaseStorage { _getAuthToken(): Promise; get host(): string; set host(host: string); + // (undocumented) + _isUsingEmulator: boolean; // Warning: (ae-forgotten-export) The symbol "ConnectionType" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RequestInfo" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "Connection" needs to be exported by the entry point index.d.ts diff --git a/packages/auth/src/api/index.test.ts b/packages/auth/src/api/index.test.ts index ea11af59d01..02042fce429 100644 --- a/packages/auth/src/api/index.test.ts +++ b/packages/auth/src/api/index.test.ts @@ -60,6 +60,10 @@ describe('api/_performApiRequest', () => { auth = await testAuth(); }); + afterEach(() => { + sinon.restore(); + }); + context('with regular requests', () => { beforeEach(mockFetch.setUp); afterEach(mockFetch.tearDown); @@ -80,6 +84,26 @@ describe('api/_performApiRequest', () => { expect(mock.calls[0].headers!.get(HttpHeader.X_CLIENT_VERSION)).to.eq( 'testSDK/0.0.0' ); + expect(mock.calls[0].fullRequest?.credentials).to.be.undefined; + }); + + it('should set credentials to "include" when using IDX and emulator', async () => { + const mock = mockEndpoint(Endpoint.SIGN_UP, serverResponse); + auth.emulatorConfig = { + host: 'https://something.cloudworkstations.dev', + protocol: '', + port: 8, + options: { + disableWarnings: false + } + }; + await _performApiRequest( + auth, + HttpMethod.POST, + Endpoint.SIGN_UP, + request + ); + expect(mock.calls[0].fullRequest?.credentials).to.eq('include'); }); it('should set the device language if available', async () => { diff --git a/packages/auth/src/api/index.ts b/packages/auth/src/api/index.ts index 769a1b6accc..af9b3c63bf1 100644 --- a/packages/auth/src/api/index.ts +++ b/packages/auth/src/api/index.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { FirebaseError, isCloudflareWorker, querystring } from '@firebase/util'; +import { + FirebaseError, + isCloudflareWorker, + isCloudWorkstation, + querystring +} from '@firebase/util'; import { AuthErrorCode, NamedErrorParams } from '../core/errors'; import { @@ -177,6 +182,10 @@ export async function _performApiRequest( fetchArgs.referrerPolicy = 'no-referrer'; } + if (auth.emulatorConfig && isCloudWorkstation(auth.emulatorConfig.host)) { + fetchArgs.credentials = 'include'; + } + return FetchProvider.fetch()( await _getFinalTarget(auth, auth.config.apiHost, path, query), fetchArgs diff --git a/packages/auth/test/helpers/mock_fetch.ts b/packages/auth/test/helpers/mock_fetch.ts index 2d5794b7327..49fa79966f9 100644 --- a/packages/auth/test/helpers/mock_fetch.ts +++ b/packages/auth/test/helpers/mock_fetch.ts @@ -22,6 +22,7 @@ export interface Call { request?: object | string; method?: string; headers: Headers; + fullRequest?: RequestInit; } export interface Route { @@ -59,7 +60,8 @@ const fakeFetch: typeof fetch = ( calls.push({ request: requestBody, method: request?.method, - headers + headers, + fullRequest: request }); return Promise.resolve( diff --git a/packages/data-connect/src/network/fetch.ts b/packages/data-connect/src/network/fetch.ts index 8353c6b99ab..3e8e2cab476 100644 --- a/packages/data-connect/src/network/fetch.ts +++ b/packages/data-connect/src/network/fetch.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { isCloudWorkstation } from '@firebase/util'; + import { Code, DataConnectError, @@ -22,7 +24,7 @@ import { DataConnectOperationFailureResponse } from '../core/error'; import { SDK_VERSION } from '../core/version'; -import { logDebug, logError } from '../logger'; +import { logError } from '../logger'; import { CallerSdkType, CallerSdkTypeEnum } from './transport'; @@ -58,7 +60,8 @@ export function dcFetch( accessToken: string | null, appCheckToken: string | null, _isUsingGen: boolean, - _callerSdkType: CallerSdkType + _callerSdkType: CallerSdkType, + _isUsingEmulator: boolean ): Promise<{ data: T; errors: Error[] }> { if (!connectFetch) { throw new DataConnectError(Code.OTHER, 'No Fetch Implementation detected!'); @@ -77,14 +80,17 @@ export function dcFetch( headers['X-Firebase-AppCheck'] = appCheckToken; } const bodyStr = JSON.stringify(body); - logDebug(`Making request out to ${url} with body: ${bodyStr}`); - - return connectFetch(url, { + const fetchOptions: RequestInit = { body: bodyStr, method: 'POST', headers, signal - }) + }; + if (isCloudWorkstation(url) && _isUsingEmulator) { + fetchOptions.credentials = 'include'; + } + + return connectFetch(url, fetchOptions) .catch(err => { throw new DataConnectError( Code.OTHER, diff --git a/packages/data-connect/src/network/transport/rest.ts b/packages/data-connect/src/network/transport/rest.ts index 0663bc026db..f16154dcb2a 100644 --- a/packages/data-connect/src/network/transport/rest.ts +++ b/packages/data-connect/src/network/transport/rest.ts @@ -36,6 +36,7 @@ export class RESTTransport implements DataConnectTransport { private _accessToken: string | null = null; private _appCheckToken: string | null = null; private _lastToken: string | null = null; + private _isUsingEmulator = false; constructor( options: DataConnectOptions, private apiKey?: string | undefined, @@ -93,6 +94,7 @@ export class RESTTransport implements DataConnectTransport { } useEmulator(host: string, port?: number, isSecure?: boolean): void { this._host = host; + this._isUsingEmulator = true; if (typeof port === 'number') { this._port = port; } @@ -182,7 +184,8 @@ export class RESTTransport implements DataConnectTransport { this._accessToken, this._appCheckToken, this._isUsingGen, - this._callerSdkType + this._callerSdkType, + this._isUsingEmulator ) ); return withAuth; @@ -208,7 +211,8 @@ export class RESTTransport implements DataConnectTransport { this._accessToken, this._appCheckToken, this._isUsingGen, - this._callerSdkType + this._callerSdkType, + this._isUsingEmulator ); }); return taskResult; diff --git a/packages/data-connect/test/unit/fetch.test.ts b/packages/data-connect/test/unit/fetch.test.ts index 6cf2750d50d..be45695190f 100644 --- a/packages/data-connect/test/unit/fetch.test.ts +++ b/packages/data-connect/test/unit/fetch.test.ts @@ -18,10 +18,12 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import * as sinon from 'sinon'; +import sinonChai from 'sinon-chai'; import { dcFetch, initializeFetch } from '../../src/network/fetch'; import { CallerSdkType, CallerSdkTypeEnum } from '../../src/network/transport'; use(chaiAsPromised); +use(sinonChai); function mockFetch(json: object, reject: boolean): sinon.SinonStub { const fakeFetchImpl = sinon.stub().returns( Promise.resolve({ @@ -57,7 +59,8 @@ describe('fetch', () => { null, null, false, - CallerSdkTypeEnum.Base + CallerSdkTypeEnum.Base, + false ) ).to.eventually.be.rejectedWith(message); }); @@ -81,7 +84,8 @@ describe('fetch', () => { null, null, false, - CallerSdkTypeEnum.Base + CallerSdkTypeEnum.Base, + false ) ).to.eventually.be.rejectedWith(JSON.stringify(json)); }); @@ -112,7 +116,8 @@ describe('fetch', () => { null, null, false, - CallerSdkTypeEnum.Base + CallerSdkTypeEnum.Base, + false ) ).to.eventually.be.rejected.then(error => { expect(error.response.data).to.eq(json.data); @@ -143,7 +148,8 @@ describe('fetch', () => { null, null, false, // _isUsingGen is false - callerSdkType as CallerSdkType + callerSdkType as CallerSdkType, + false ); let expectedHeaderRegex: RegExp; @@ -191,7 +197,8 @@ describe('fetch', () => { null, null, true, // _isUsingGen is true - callerSdkType as CallerSdkType + callerSdkType as CallerSdkType, + false ); let expectedHeaderRegex: RegExp; @@ -215,4 +222,30 @@ describe('fetch', () => { } } }); + it('should call credentials include if using emulator on cloud workstation', async () => { + const json = { + code: 200, + message1: 'success' + }; + const fakeFetchImpl = mockFetch(json, false); + await dcFetch( + 'https://abc.cloudworkstations.dev', + { + name: 'n', + operationName: 'n', + variables: {} + }, + {} as AbortController, + null, + null, + null, + true, // _isUsingGen is true + CallerSdkTypeEnum.Base, + true + ); + expect(fakeFetchImpl).to.have.been.calledWithMatch( + 'https://abc.cloudworkstations.dev', + { credentials: 'include' } + ); + }); }); diff --git a/packages/firestore/externs.json b/packages/firestore/externs.json index d730cfeac0a..c56b078dddf 100644 --- a/packages/firestore/externs.json +++ b/packages/firestore/externs.json @@ -30,6 +30,7 @@ "packages/util/dist/src/defaults.d.ts", "packages/util/dist/src/emulator.d.ts", "packages/util/dist/src/environment.d.ts", + "packages/util/dist/src/url.d.ts", "packages/util/dist/src/compat.d.ts", "packages/util/dist/src/global.d.ts", "packages/util/dist/src/obj.d.ts", diff --git a/packages/firestore/src/core/database_info.ts b/packages/firestore/src/core/database_info.ts index 0325f8166b6..a057516763f 100644 --- a/packages/firestore/src/core/database_info.ts +++ b/packages/firestore/src/core/database_info.ts @@ -48,7 +48,8 @@ export class DatabaseInfo { readonly forceLongPolling: boolean, readonly autoDetectLongPolling: boolean, readonly longPollingOptions: ExperimentalLongPollingOptions, - readonly useFetchStreams: boolean + readonly useFetchStreams: boolean, + readonly isUsingEmulator: boolean ) {} } diff --git a/packages/firestore/src/lite-api/components.ts b/packages/firestore/src/lite-api/components.ts index 436d2b5d4d8..52c3b3729ee 100644 --- a/packages/firestore/src/lite-api/components.ts +++ b/packages/firestore/src/lite-api/components.ts @@ -119,6 +119,7 @@ export function makeDatabaseInfo( settings.experimentalForceLongPolling, settings.experimentalAutoDetectLongPolling, cloneLongPollingOptions(settings.experimentalLongPollingOptions), - settings.useFetchStreams + settings.useFetchStreams, + settings.isUsingEmulator ); } diff --git a/packages/firestore/src/lite-api/settings.ts b/packages/firestore/src/lite-api/settings.ts index a1bba373d13..56c99e7ccea 100644 --- a/packages/firestore/src/lite-api/settings.ts +++ b/packages/firestore/src/lite-api/settings.ts @@ -112,6 +112,8 @@ export class FirestoreSettingsImpl { readonly useFetchStreams: boolean; readonly localCache?: FirestoreLocalCache; + readonly isUsingEmulator: boolean; + // Can be a google-auth-library or gapi client. // eslint-disable-next-line @typescript-eslint/no-explicit-any credentials?: any; @@ -130,6 +132,7 @@ export class FirestoreSettingsImpl { this.host = settings.host; this.ssl = settings.ssl ?? DEFAULT_SSL; } + this.isUsingEmulator = settings.emulatorOptions !== undefined; this.credentials = settings.credentials; this.ignoreUndefinedProperties = !!settings.ignoreUndefinedProperties; diff --git a/packages/firestore/src/platform/browser/webchannel_connection.ts b/packages/firestore/src/platform/browser/webchannel_connection.ts index 5223285c5a4..9a69164457e 100644 --- a/packages/firestore/src/platform/browser/webchannel_connection.ts +++ b/packages/firestore/src/platform/browser/webchannel_connection.ts @@ -71,7 +71,8 @@ export class WebChannelConnection extends RestConnection { rpcName: string, url: string, headers: StringMap, - body: Req + body: Req, + _forwardCredentials: boolean ): Promise { const streamId = generateUniqueDebugId(); return new Promise((resolve: Resolver, reject: Rejecter) => { diff --git a/packages/firestore/src/platform/browser_lite/fetch_connection.ts b/packages/firestore/src/platform/browser_lite/fetch_connection.ts index d11247c8019..227322153e9 100644 --- a/packages/firestore/src/platform/browser_lite/fetch_connection.ts +++ b/packages/firestore/src/platform/browser_lite/fetch_connection.ts @@ -38,17 +38,22 @@ export class FetchConnection extends RestConnection { rpcName: string, url: string, headers: StringMap, - body: Req + body: Req, + forwardCredentials: boolean ): Promise { const requestJson = JSON.stringify(body); let response: Response; try { - response = await fetch(url, { + const fetchArgs: RequestInit = { method: 'POST', headers, body: requestJson - }); + }; + if (forwardCredentials) { + fetchArgs.credentials = 'include'; + } + response = await fetch(url, fetchArgs); } catch (e) { const err = e as { status: number | undefined; statusText: string }; throw new FirestoreError( diff --git a/packages/firestore/src/remote/rest_connection.ts b/packages/firestore/src/remote/rest_connection.ts index 470cb332ce2..2d6889dac3b 100644 --- a/packages/firestore/src/remote/rest_connection.ts +++ b/packages/firestore/src/remote/rest_connection.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { isCloudWorkstation } from '@firebase/util'; + import { SDK_VERSION } from '../../src/core/version'; import { Token } from '../api/credentials'; import { @@ -98,7 +100,15 @@ export abstract class RestConnection implements Connection { }; this.modifyHeadersForRequest(headers, authToken, appCheckToken); - return this.performRPCRequest(rpcName, url, headers, req).then( + const { host } = new URL(url); + const forwardCredentials = isCloudWorkstation(host); + return this.performRPCRequest( + rpcName, + url, + headers, + req, + forwardCredentials + ).then( response => { logDebug(LOG_TAG, `Received RPC '${rpcName}' ${streamId}: `, response); return response; @@ -179,7 +189,8 @@ export abstract class RestConnection implements Connection { rpcName: string, url: string, headers: StringMap, - body: Req + body: Req, + _forwardCredentials: boolean ): Promise; private makeUrl(rpcName: string, path: string): string { diff --git a/packages/firestore/test/integration/util/internal_helpers.ts b/packages/firestore/test/integration/util/internal_helpers.ts index 86ded6af3c1..e5e64b5fbf4 100644 --- a/packages/firestore/test/integration/util/internal_helpers.ts +++ b/packages/firestore/test/integration/util/internal_helpers.ts @@ -61,7 +61,8 @@ export function getDefaultDatabaseInfo(): DatabaseInfo { cloneLongPollingOptions( DEFAULT_SETTINGS.experimentalLongPollingOptions ?? {} ), - /*use FetchStreams= */ false + /*use FetchStreams= */ false, + /*isUsingEmulator=*/ false ); } diff --git a/packages/firestore/test/unit/remote/fetch_connection.test.ts b/packages/firestore/test/unit/remote/fetch_connection.test.ts new file mode 100644 index 00000000000..5a9aa67436f --- /dev/null +++ b/packages/firestore/test/unit/remote/fetch_connection.test.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import * as sinon from 'sinon'; +import sinonChai from 'sinon-chai'; + +import { DatabaseId } from '../../../src/core/database_info'; +import { makeDatabaseInfo } from '../../../src/lite-api/components'; +import { FirestoreSettingsImpl } from '../../../src/lite-api/settings'; +import { ResourcePath } from '../../../src/model/path'; +import { FetchConnection } from '../../../src/platform/browser_lite/fetch_connection'; + +use(sinonChai); +use(chaiAsPromised); + +describe('Fetch Connection', () => { + it('should pass in credentials if using emulator and cloud workstation', async () => { + const stub = sinon.stub(globalThis, 'fetch'); + stub.resolves({ + ok: true, + json() { + return Promise.resolve(); + } + } as Response); + const fetchConnection = new FetchConnection( + makeDatabaseInfo( + DatabaseId.empty(), + '', + '', + new FirestoreSettingsImpl({ + host: 'abc.cloudworkstations.dev' + }) + ) + ); + await fetchConnection.invokeRPC( + 'Commit', + new ResourcePath([]), + {}, + null, + null + ); + expect(stub).to.have.been.calledWithMatch( + 'https://abc.cloudworkstations.dev/v1/:commit', + { credentials: 'include' } + ); + stub.restore(); + }); +}); diff --git a/packages/firestore/test/unit/remote/rest_connection.test.ts b/packages/firestore/test/unit/remote/rest_connection.test.ts index d45a75ce67b..100b8b8368e 100644 --- a/packages/firestore/test/unit/remote/rest_connection.test.ts +++ b/packages/firestore/test/unit/remote/rest_connection.test.ts @@ -67,7 +67,8 @@ describe('RestConnection', () => { /*forceLongPolling=*/ false, /*autoDetectLongPolling=*/ false, /*longPollingOptions=*/ {}, - /*useFetchStreams=*/ false + /*useFetchStreams=*/ false, + /*isUsingEmulator=*/ false ); const connection = new TestRestConnection(testDatabaseInfo); diff --git a/packages/firestore/test/unit/specs/spec_test_runner.ts b/packages/firestore/test/unit/specs/spec_test_runner.ts index ee0af0b8bf8..51d2229b8a1 100644 --- a/packages/firestore/test/unit/specs/spec_test_runner.ts +++ b/packages/firestore/test/unit/specs/spec_test_runner.ts @@ -282,7 +282,8 @@ abstract class TestRunner { /*forceLongPolling=*/ false, /*autoDetectLongPolling=*/ false, /*longPollingOptions=*/ {}, - /*useFetchStreams=*/ false + /*useFetchStreams=*/ false, + /*isUsingEmulator=*/ false ); // TODO(mrschmidt): During client startup in `firestore_client`, we block diff --git a/packages/storage/src/implementation/connection.ts b/packages/storage/src/implementation/connection.ts index 80e29c9cd2f..f7630e59708 100644 --- a/packages/storage/src/implementation/connection.ts +++ b/packages/storage/src/implementation/connection.ts @@ -42,6 +42,7 @@ export interface Connection { send( url: string, method: string, + isUsingEmulator: boolean, body?: ArrayBufferView | Blob | string | null, headers?: Headers ): Promise; diff --git a/packages/storage/src/implementation/request.ts b/packages/storage/src/implementation/request.ts index fae46d7a5ab..adfda6e4460 100644 --- a/packages/storage/src/implementation/request.ts +++ b/packages/storage/src/implementation/request.ts @@ -71,7 +71,8 @@ class NetworkRequest implements Request { private timeout_: number, private progressCallback_: ((p1: number, p2: number) => void) | null, private connectionFactory_: () => Connection, - private retry = true + private retry = true, + private isUsingEmulator = false ) { this.promise_ = new Promise((resolve, reject) => { this.resolve_ = resolve as (value?: O | PromiseLike) => void; @@ -111,7 +112,13 @@ class NetworkRequest implements Request { // connection.send() never rejects, so we don't need to have a error handler or use catch on the returned promise. // eslint-disable-next-line @typescript-eslint/no-floating-promises connection - .send(this.url_, this.method_, this.body_, this.headers_) + .send( + this.url_, + this.method_, + this.isUsingEmulator, + this.body_, + this.headers_ + ) .then(() => { if (this.progressCallback_ !== null) { connection.removeUploadProgressListener(progressListener); @@ -261,7 +268,8 @@ export function makeRequest( appCheckToken: string | null, requestFactory: () => Connection, firebaseVersion?: string, - retry = true + retry = true, + isUsingEmulator = false ): Request { const queryPart = makeQueryString(requestInfo.urlParams); const url = requestInfo.url + queryPart; @@ -282,6 +290,7 @@ export function makeRequest( requestInfo.timeout, requestInfo.progressCallback, requestFactory, - retry + retry, + isUsingEmulator ); } diff --git a/packages/storage/src/platform/browser/connection.ts b/packages/storage/src/platform/browser/connection.ts index fdd9b496242..77a2e42809b 100644 --- a/packages/storage/src/platform/browser/connection.ts +++ b/packages/storage/src/platform/browser/connection.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { isCloudWorkstation } from '@firebase/util'; import { Connection, ConnectionType, @@ -62,12 +63,16 @@ abstract class XhrConnection send( url: string, method: string, + isUsingEmulator: boolean, body?: ArrayBufferView | Blob | string, headers?: Headers ): Promise { if (this.sent_) { throw internalError('cannot .send() more than once'); } + if (isCloudWorkstation(url) && isUsingEmulator) { + this.xhr_.withCredentials = true; + } this.sent_ = true; this.xhr_.open(method, url, true); if (headers !== undefined) { diff --git a/packages/storage/src/platform/node/connection.ts b/packages/storage/src/platform/node/connection.ts index c90f664c3b2..2dd869eb2f0 100644 --- a/packages/storage/src/platform/node/connection.ts +++ b/packages/storage/src/platform/node/connection.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { isCloudWorkstation } from '@firebase/util'; import { Connection, ConnectionType, @@ -48,6 +49,7 @@ abstract class FetchConnection async send( url: string, method: string, + isUsingEmulator: boolean, body?: NodeJS.ArrayBufferView | Blob | string, headers?: Record ): Promise { @@ -57,11 +59,13 @@ abstract class FetchConnection this.sent_ = true; try { - const response = await fetch(url, { + const response = await newFetch( + url, method, - headers: headers || {}, - body: body as NodeJS.ArrayBufferView | string - }); + isUsingEmulator, + headers, + body + ); this.headers_ = response.headers; this.statusCode_ = response.status; this.errorCode_ = ErrorCode.NO_ERROR; @@ -152,6 +156,7 @@ export class FetchStreamConnection extends FetchConnection< async send( url: string, method: string, + isUsingEmulator: boolean, body?: NodeJS.ArrayBufferView | Blob | string, headers?: Record ): Promise { @@ -161,11 +166,13 @@ export class FetchStreamConnection extends FetchConnection< this.sent_ = true; try { - const response = await fetch(url, { + const response = await newFetch( + url, method, - headers: headers || {}, - body: body as NodeJS.ArrayBufferView | string - }); + isUsingEmulator, + headers, + body + ); this.headers_ = response.headers; this.statusCode_ = response.status; this.errorCode_ = ErrorCode.NO_ERROR; @@ -186,6 +193,24 @@ export class FetchStreamConnection extends FetchConnection< } } +function newFetch( + url: string, + method: string, + isUsingEmulator: boolean, + headers?: Record, + body?: NodeJS.ArrayBufferView | Blob | string +): Promise { + const fetchArgs: RequestInit = { + method, + headers: headers || {}, + body: body as NodeJS.ArrayBufferView | string + }; + if (isCloudWorkstation(url) && isUsingEmulator) { + fetchArgs.credentials = 'include'; + } + return fetch(url, fetchArgs); +} + export function newStreamConnection(): Connection> { return new FetchStreamConnection(); } diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 8a942aac62a..8ad31ecb13c 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -146,6 +146,7 @@ export function connectStorageEmulator( ): void { storage.host = `${host}:${port}`; const useSsl = isCloudWorkstation(host); + storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; const { mockUserToken } = options; if (mockUserToken) { @@ -192,7 +193,8 @@ export class FirebaseStorageImpl implements FirebaseStorage { * @internal */ readonly _url?: string, - readonly _firebaseVersion?: string + readonly _firebaseVersion?: string, + public _isUsingEmulator = false ) { this._maxOperationRetryTime = DEFAULT_MAX_OPERATION_RETRY_TIME; this._maxUploadRetryTime = DEFAULT_MAX_UPLOAD_RETRY_TIME; @@ -325,7 +327,8 @@ export class FirebaseStorageImpl implements FirebaseStorage { appCheckToken, requestFactory, this._firebaseVersion, - retry + retry, + this._isUsingEmulator ); this._requests.add(request); // Request removes itself from set when complete. diff --git a/packages/storage/test/browser/connection.test.ts b/packages/storage/test/browser/connection.test.ts index b869c9ee31b..2a0320d0c02 100644 --- a/packages/storage/test/browser/connection.test.ts +++ b/packages/storage/test/browser/connection.test.ts @@ -24,11 +24,27 @@ describe('Connections', () => { it('XhrConnection.send() should not reject on network errors', async () => { const fakeXHR = useFakeXMLHttpRequest(); const connection = new XhrBytesConnection(); - const sendPromise = connection.send('testurl', 'GET'); + const sendPromise = connection.send('testurl', 'GET', false); // simulate a network error ((connection as any).xhr_ as SinonFakeXMLHttpRequest).error(); await sendPromise; expect(connection.getErrorCode()).to.equal(ErrorCode.NETWORK_ERROR); fakeXHR.restore(); }); + it('XhrConnection.send() should send credentials when using cloud workstation', async () => { + const fakeXHR = useFakeXMLHttpRequest(); + const connection = new XhrBytesConnection(); + const sendPromise = connection.send( + 'https://abc.cloudworkstations.dev', + 'GET', + true + ); + // simulate a network error + ((connection as any).xhr_ as SinonFakeXMLHttpRequest).error(); + await sendPromise; + expect( + ((connection as any).xhr_ as SinonFakeXMLHttpRequest).withCredentials + ).to.be.true; + fakeXHR.restore(); + }); }); diff --git a/packages/storage/test/node/connection.test.ts b/packages/storage/test/node/connection.test.ts index 925d1f8f7dc..5c9f2efe41d 100644 --- a/packages/storage/test/node/connection.test.ts +++ b/packages/storage/test/node/connection.test.ts @@ -25,8 +25,27 @@ describe('Connections', () => { const connection = new FetchBytesConnection(); const fetchStub = stub(globalThis, 'fetch').rejects(); - await connection.send('testurl', 'GET'); + await connection.send('testurl', 'GET', false); expect(connection.getErrorCode()).to.equal(ErrorCode.NETWORK_ERROR); + + fetchStub.restore(); + }); + it('FetchConnection.send() should send credentials on cloud workstations', async () => { + const connection = new FetchBytesConnection(); + + const fetchStub = stub(globalThis, 'fetch').rejects(); + await connection.send( + 'http://something.cloudworkstations.dev', + 'GET', + true + ); + expect(connection.getErrorCode()).to.equal(ErrorCode.NETWORK_ERROR); + expect(fetchStub).to.have.been.calledWithMatch( + 'http://something.cloudworkstations.dev', + { + credentials: 'include' + } + ); fetchStub.restore(); }); }); diff --git a/packages/storage/test/unit/connection.ts b/packages/storage/test/unit/connection.ts index 6b800a17f91..a2f0ca58750 100644 --- a/packages/storage/test/unit/connection.ts +++ b/packages/storage/test/unit/connection.ts @@ -60,6 +60,7 @@ export class TestingConnection implements Connection { send( url: string, method: string, + _isUsingEmulator: boolean, body?: ArrayBufferView | Blob | string | null, headers?: Headers ): Promise { diff --git a/packages/storage/test/unit/service.test.ts b/packages/storage/test/unit/service.test.ts index bc443c60a03..b37e624e3d1 100644 --- a/packages/storage/test/unit/service.test.ts +++ b/packages/storage/test/unit/service.test.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { expect } from 'chai'; +import { expect, use } from 'chai'; +import * as sinon from 'sinon'; import { TaskEvent } from '../../src/implementation/taskenums'; import { Headers } from '../../src/implementation/connection'; import { @@ -34,11 +35,13 @@ import { import { Location } from '../../src/implementation/location'; import { newTestConnection, TestingConnection } from './connection'; import { injectTestConnection } from '../../src/platform/connection'; +import sinonChai from 'sinon-chai'; const fakeAppGs = testShared.makeFakeApp('gs://mybucket'); const fakeAppGsEndingSlash = testShared.makeFakeApp('gs://mybucket/'); const fakeAppInvalidGs = testShared.makeFakeApp('gs://mybucket/hello'); const testLocation = new Location('bucket', 'object'); +use(sinonChai); function makeGsUrl(child: string = ''): string { return 'gs://' + testShared.bucket + '/' + child; @@ -227,6 +230,13 @@ GOOG4-RSA-SHA256` }); }); describe('connectStorageEmulator(service, host, port, options)', () => { + let sandbox: sinon.SinonSandbox; + beforeEach(() => { + sandbox = sinon.createSandbox(); + }); + afterEach(() => { + sandbox.restore(); + }); it('sets emulator host correctly', done => { function newSend(connection: TestingConnection, url: string): void { // Expect emulator host to be in url of storage operations requests, From 080a90dccbb5a9cc402a3fc8feca4c81fc7e1305 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 30 Apr 2025 18:49:33 -0700 Subject: [PATCH 177/295] Add Cookie Support For Firebase Studio (#8986) --- common/api-review/util.api.md | 3 +++ packages/auth/src/core/auth/emulator.ts | 7 ++++++- packages/data-connect/src/api/DataConnect.ts | 5 +++++ packages/database/src/api/Database.ts | 8 +++++++- packages/firestore/src/api/database.ts | 12 +++++++++++- packages/firestore/src/lite-api/database.ts | 6 +++++- packages/functions/src/service.ts | 6 +++++- packages/storage/src/service.ts | 7 ++++++- packages/util/src/url.ts | 12 ++++++++++++ 9 files changed, 60 insertions(+), 6 deletions(-) diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 28cc9a160d4..0f8fc13cd3a 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -398,6 +398,9 @@ export function ordinal(i: number): string; // @public (undocumented) export type PartialObserver = Partial>; +// @public +export function pingServer(endpoint: string): Promise; + // Warning: (ae-internal-missing-underscore) The name "promiseWithTimeout" should be prefixed with an underscore because the declaration is marked as @internal // // @internal diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 60cc9403d3d..05f2e5e4bd5 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,7 +18,7 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { deepEqual } from '@firebase/util'; +import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -100,6 +100,11 @@ export function connectAuthEmulator( if (!disableWarnings) { emitEmulatorWarning(); } + + // Workaround to get cookies in Firebase Studio + if (isCloudWorkstation(host)) { + void pingServer(`${protocol}//${host}:${port}`); + } } function extractProtocol(url: string): string { diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index dc170809143..c25a09039ac 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -24,6 +24,7 @@ import { import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { Provider } from '@firebase/component'; +import { isCloudWorkstation, pingServer } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; import { Code, DataConnectError } from '../core/error'; @@ -237,6 +238,10 @@ export function connectDataConnectEmulator( port?: number, sslEnabled = false ): void { + // Workaround to get cookies in Firebase Studio + if (isCloudWorkstation(host)) { + void pingServer(`https://${host}${port ? `:${port}` : ''}`); + } dc.enableEmulator({ host, port, sslEnabled }); } diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index f247fc6288c..515e278b5c5 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -30,7 +30,8 @@ import { deepEqual, EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, - isCloudWorkstation + isCloudWorkstation, + pingServer } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -389,6 +390,11 @@ export function connectDatabaseEmulator( tokenProvider = new EmulatorTokenProvider(token); } + // Workaround to get cookies in Firebase Studio + if (isCloudWorkstation(host)) { + void pingServer(host); + } + // Modify the repo to apply emulator settings repoManagerApplyEmulatorSettings(repo, hostAndPort, options, tokenProvider); } diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index 0757378a74c..a2feb19507f 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -21,7 +21,12 @@ import { FirebaseApp, getApp } from '@firebase/app'; -import { deepEqual, getDefaultEmulatorHostnameAndPort } from '@firebase/util'; +import { + deepEqual, + getDefaultEmulatorHostnameAndPort, + isCloudWorkstation, + pingServer +} from '@firebase/util'; import { User } from '../auth/user'; import { @@ -194,6 +199,11 @@ export function initializeFirestore( ); } + // Workaround to get cookies in Firebase Studio + if (settings.host && isCloudWorkstation(settings.host)) { + void pingServer(settings.host); + } + return provider.initialize({ options: settings, instanceIdentifier: databaseId diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 294206e54c2..8e7fdb27e90 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -27,7 +27,8 @@ import { deepEqual, EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, - isCloudWorkstation + isCloudWorkstation, + pingServer } from '@firebase/util'; import { @@ -333,6 +334,9 @@ export function connectFirestoreEmulator( emulatorOptions: firestore._getEmulatorOptions() }; const newHostSetting = `${host}:${port}`; + if (useSsl) { + void pingServer(`https://${newHostSetting}`); + } if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index dce52e1f19d..af9d8898d2e 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,7 +30,7 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { isCloudWorkstation } from '@firebase/util'; +import { isCloudWorkstation, pingServer } from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -179,6 +179,10 @@ export function connectFunctionsEmulator( functionsInstance.emulatorOrigin = `http${ useSsl ? 's' : '' }://${host}:${port}`; + // Workaround to get cookies in Firebase Studio + if (useSsl) { + void pingServer(functionsInstance.emulatorOrigin); + } } /** diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 8ad31ecb13c..741dd6eaa1a 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -45,7 +45,8 @@ import { FirebaseStorage } from './public-types'; import { createMockUserToken, EmulatorMockTokenOptions, - isCloudWorkstation + isCloudWorkstation, + pingServer } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -146,6 +147,10 @@ export function connectStorageEmulator( ): void { storage.host = `${host}:${port}`; const useSsl = isCloudWorkstation(host); + // Workaround to get cookies in Firebase Studio + if (useSsl) { + void pingServer(`https://${storage.host}`); + } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; const { mockUserToken } = options; diff --git a/packages/util/src/url.ts b/packages/util/src/url.ts index 33cec43bea9..e41d26594c2 100644 --- a/packages/util/src/url.ts +++ b/packages/util/src/url.ts @@ -22,3 +22,15 @@ export function isCloudWorkstation(host: string): boolean { return host.endsWith('.cloudworkstations.dev'); } + +/** + * Makes a fetch request to the given server. + * Mostly used for forwarding cookies in Firebase Studio. + * @public + */ +export async function pingServer(endpoint: string): Promise { + const result = await fetch(endpoint, { + credentials: 'include' + }); + return result.ok; +} From 6a02778e3d12af683e710b53dc6dfb64329e8229 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 May 2025 13:09:02 -0700 Subject: [PATCH 178/295] Fix Auth Port for Firebase Studio (#8998) --- .changeset/lemon-tomatoes-breathe.md | 5 +++++ packages/auth/src/core/auth/emulator.test.ts | 16 ++++++++++++++++ packages/auth/src/core/auth/emulator.ts | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .changeset/lemon-tomatoes-breathe.md diff --git a/.changeset/lemon-tomatoes-breathe.md b/.changeset/lemon-tomatoes-breathe.md new file mode 100644 index 00000000000..0df04153d61 --- /dev/null +++ b/.changeset/lemon-tomatoes-breathe.md @@ -0,0 +1,5 @@ +--- +"@firebase/auth": patch +--- + +Fix issue where auth port wasn't properly set when setting up cookies in Firebase Studio. diff --git a/packages/auth/src/core/auth/emulator.test.ts b/packages/auth/src/core/auth/emulator.test.ts index 47c5d927c44..5b3ba360c11 100644 --- a/packages/auth/src/core/auth/emulator.test.ts +++ b/packages/auth/src/core/auth/emulator.test.ts @@ -29,6 +29,7 @@ import { Endpoint } from '../../api'; import { UserInternal } from '../../model/user'; import { _castAuth } from './auth_impl'; import { connectAuthEmulator } from './emulator'; +import * as Util from '@firebase/util'; use(sinonChai); use(chaiAsPromised); @@ -38,8 +39,10 @@ describe('core/auth/emulator', () => { let user: UserInternal; let normalEndpoint: fetch.Route; let emulatorEndpoint: fetch.Route; + let utilStub: sinon.SinonStub; beforeEach(async () => { + utilStub = sinon.stub(Util, 'pingServer'); auth = await testAuth(); user = testUser(_castAuth(auth), 'uid', 'email', true); fetch.setUp(); @@ -154,6 +157,19 @@ describe('core/auth/emulator', () => { ); } }); + it('calls pingServer with port if specified', () => { + connectAuthEmulator(auth, 'https://abc.cloudworkstations.dev:2020'); + expect(utilStub).to.have.been.calledWith( + 'https://abc.cloudworkstations.dev:2020' + ); + }); + + it('calls pingServer with no port if none specified', () => { + connectAuthEmulator(auth, 'https://abc.cloudworkstations.dev'); + expect(utilStub).to.have.been.calledWith( + 'https://abc.cloudworkstations.dev' + ); + }); it('logs out a warning to the console', () => { sinon.stub(console, 'info'); diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 05f2e5e4bd5..8547f7bad6c 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -103,7 +103,7 @@ export function connectAuthEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { - void pingServer(`${protocol}//${host}:${port}`); + void pingServer(`${protocol}//${host}${portStr}`); } } From 3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 7 May 2025 07:57:52 -0700 Subject: [PATCH 179/295] Change automaticDataCollectionEnabled to default to true. (#8999) --- .changeset/afraid-baboons-develop.md | 8 ++ docs-devsite/app.firebaseappsettings.md | 4 +- packages/app-check/src/api.test.ts | 73 ++++++++++++++++++- packages/app-check/src/api.ts | 20 +++-- .../app-compat/test/firebaseAppCompat.test.ts | 8 +- packages/app/src/api.test.ts | 19 +++-- packages/app/src/api.ts | 4 +- packages/app/src/firebaseApp.test.ts | 4 +- packages/app/src/firebaseServerApp.ts | 2 +- packages/app/src/public-types.ts | 2 +- 10 files changed, 116 insertions(+), 28 deletions(-) create mode 100644 .changeset/afraid-baboons-develop.md diff --git a/.changeset/afraid-baboons-develop.md b/.changeset/afraid-baboons-develop.md new file mode 100644 index 00000000000..84e4e923f43 --- /dev/null +++ b/.changeset/afraid-baboons-develop.md @@ -0,0 +1,8 @@ +--- +'@firebase/app-check': minor +'@firebase/app': minor +'@firebase/app-compat': minor +'firebase': minor +--- + +Default automaticDataCollectionEnabled to true without changing App Check's default behavior. diff --git a/docs-devsite/app.firebaseappsettings.md b/docs-devsite/app.firebaseappsettings.md index 1515e21ac93..e7838ab4185 100644 --- a/docs-devsite/app.firebaseappsettings.md +++ b/docs-devsite/app.firebaseappsettings.md @@ -22,12 +22,12 @@ export interface FirebaseAppSettings | Property | Type | Description | | --- | --- | --- | -| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out | +| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out. Defaults to true. | | [name](./app.firebaseappsettings.md#firebaseappsettingsname) | string | custom name for the Firebase App. The default value is "[DEFAULT]". | ## FirebaseAppSettings.automaticDataCollectionEnabled -The settable config flag for GDPR opt-in/opt-out +The settable config flag for GDPR opt-in/opt-out. Defaults to true. Signature: diff --git a/packages/app-check/src/api.test.ts b/packages/app-check/src/api.test.ts index a6805d1b0b3..b71971e9d70 100644 --- a/packages/app-check/src/api.test.ts +++ b/packages/app-check/src/api.test.ts @@ -239,7 +239,7 @@ describe('api', () => { expect(getStateReference(app).activated).to.equal(true); }); - it('isTokenAutoRefreshEnabled value defaults to global setting', () => { + it('global false + local unset = false', () => { app.automaticDataCollectionEnabled = false; initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) @@ -247,8 +247,77 @@ describe('api', () => { expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); }); - it('sets isTokenAutoRefreshEnabled correctly, overriding global setting', () => { + it('global false + local true = false', () => { app.automaticDataCollectionEnabled = false; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global false + local false = false', () => { + app.automaticDataCollectionEnabled = false; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local unset = false', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local false = false', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local true = true', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); + }); + + it('global true + local unset = false', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global true + local false = false', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global true + local true = true', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); + }); + + it('sets isTokenAutoRefreshEnabled correctly, overriding global setting', () => { initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), isTokenAutoRefreshEnabled: true diff --git a/packages/app-check/src/api.ts b/packages/app-check/src/api.ts index a4dd87a4e77..e7c9f8cfcf9 100644 --- a/packages/app-check/src/api.ts +++ b/packages/app-check/src/api.ts @@ -43,6 +43,7 @@ import { } from './internal-api'; import { readTokenFromStorage } from './storage'; import { getDebugToken, initializeDebugMode, isDebugMode } from './debug'; +import { logger } from './logger'; declare module '@firebase/component' { interface NameServiceMapping { @@ -132,7 +133,7 @@ export function initializeAppCheck( function _activate( app: FirebaseApp, provider: AppCheckProvider, - isTokenAutoRefreshEnabled?: boolean + isTokenAutoRefreshEnabled: boolean = false ): void { // Create an entry in the APP_CHECK_STATES map. Further changes should // directly mutate this object. @@ -149,13 +150,18 @@ function _activate( return cachedToken; }); - // Use value of global `automaticDataCollectionEnabled` (which - // itself defaults to false if not specified in config) if - // `isTokenAutoRefreshEnabled` param was not provided by user. + // Global `automaticDataCollectionEnabled` (defaults to true) and + // `isTokenAutoRefreshEnabled` must both be true. state.isTokenAutoRefreshEnabled = - isTokenAutoRefreshEnabled === undefined - ? app.automaticDataCollectionEnabled - : isTokenAutoRefreshEnabled; + isTokenAutoRefreshEnabled && app.automaticDataCollectionEnabled; + + if (!app.automaticDataCollectionEnabled && isTokenAutoRefreshEnabled) { + logger.warn( + '`isTokenAutoRefreshEnabled` is true but ' + + '`automaticDataCollectionEnabled` was set to false during' + + ' `initializeApp()`. This blocks automatic token refresh.' + ); + } state.provider.initialize(app); } diff --git a/packages/app-compat/test/firebaseAppCompat.test.ts b/packages/app-compat/test/firebaseAppCompat.test.ts index f12a73e61a8..61bbed848d8 100644 --- a/packages/app-compat/test/firebaseAppCompat.test.ts +++ b/packages/app-compat/test/firebaseAppCompat.test.ts @@ -403,17 +403,17 @@ function firebaseAppTests( ).throws(/'abc'.*exists/i); }); - it('automaticDataCollectionEnabled is `false` by default', () => { + it('automaticDataCollectionEnabled is `true` by default', () => { const app = firebase.initializeApp({}, 'my-app'); - expect(app.automaticDataCollectionEnabled).to.eq(false); + expect(app.automaticDataCollectionEnabled).to.eq(true); }); it('automaticDataCollectionEnabled can be set via the config object', () => { const app = firebase.initializeApp( {}, - { automaticDataCollectionEnabled: true } + { automaticDataCollectionEnabled: false } ); - expect(app.automaticDataCollectionEnabled).to.eq(true); + expect(app.automaticDataCollectionEnabled).to.eq(false); }); it('Modifying options object does not change options.', () => { diff --git a/packages/app/src/api.test.ts b/packages/app/src/api.test.ts index f6cf922ba05..4e79ad58d82 100644 --- a/packages/app/src/api.test.ts +++ b/packages/app/src/api.test.ts @@ -128,14 +128,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { automaticDataCollectionEnabled: true } + { automaticDataCollectionEnabled: false } ); expect(() => initializeApp( { apiKey: 'test1' }, - { automaticDataCollectionEnabled: false } + { automaticDataCollectionEnabled: true } ) ).throws(/\[DEFAULT\].*exists/i); }); @@ -146,14 +146,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: true } + { name: appName, automaticDataCollectionEnabled: false } ); expect(() => initializeApp( { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: false } + { name: appName, automaticDataCollectionEnabled: true } ) ).throws(/'MyApp'.*exists/i); }); @@ -164,11 +164,16 @@ describe('API tests', () => { expect(app.name).to.equal(appName); }); - it('sets automaticDataCollectionEnabled', () => { - const app = initializeApp({}, { automaticDataCollectionEnabled: true }); + it('sets automaticDataCollectionEnabled to true by default', () => { + const app = initializeApp({}); expect(app.automaticDataCollectionEnabled).to.be.true; }); + it('sets a new automaticDataCollectionEnabled value if provided', () => { + const app = initializeApp({}, { automaticDataCollectionEnabled: false }); + expect(app.automaticDataCollectionEnabled).to.be.false; + }); + it('adds registered components to App', () => { _clearComponents(); const comp1 = createTestComponent('test1'); @@ -211,7 +216,7 @@ describe('API tests', () => { const app = initializeServerApp(options, serverAppSettings); expect(app).to.not.equal(null); - expect(app.automaticDataCollectionEnabled).to.be.false; + expect(app.automaticDataCollectionEnabled).to.be.true; await deleteApp(app); expect((app as FirebaseServerAppImpl).isDeleted).to.be.true; }); diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index b8ec25fc509..9cba8ec6f50 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -143,7 +143,7 @@ export function initializeApp( const config: Required = { name: DEFAULT_ENTRY_NAME, - automaticDataCollectionEnabled: false, + automaticDataCollectionEnabled: true, ...rawConfig }; const name = config.name; @@ -241,7 +241,7 @@ export function initializeServerApp( } if (_serverAppConfig.automaticDataCollectionEnabled === undefined) { - _serverAppConfig.automaticDataCollectionEnabled = false; + _serverAppConfig.automaticDataCollectionEnabled = true; } let appOptions: FirebaseOptions; diff --git a/packages/app/src/firebaseApp.test.ts b/packages/app/src/firebaseApp.test.ts index 419eeef4f1f..3acbb4a2869 100644 --- a/packages/app/src/firebaseApp.test.ts +++ b/packages/app/src/firebaseApp.test.ts @@ -27,11 +27,11 @@ describe('FirebaseAppNext', () => { }; const app = new FirebaseAppImpl( options, - { name: 'test', automaticDataCollectionEnabled: false }, + { name: 'test', automaticDataCollectionEnabled: true }, new ComponentContainer('test') ); - expect(app.automaticDataCollectionEnabled).to.be.false; + expect(app.automaticDataCollectionEnabled).to.be.true; expect(app.name).to.equal('test'); expect(app.options).to.deep.equal(options); }); diff --git a/packages/app/src/firebaseServerApp.ts b/packages/app/src/firebaseServerApp.ts index 21232869c3c..2bb8efc7a63 100644 --- a/packages/app/src/firebaseServerApp.ts +++ b/packages/app/src/firebaseServerApp.ts @@ -74,7 +74,7 @@ export class FirebaseServerAppImpl const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined ? serverConfig.automaticDataCollectionEnabled - : false; + : true; // Create the FirebaseAppSettings object for the FirebaseAppImp constructor. const config: Required = { diff --git a/packages/app/src/public-types.ts b/packages/app/src/public-types.ts index ea68579a7e9..4f8373f2250 100644 --- a/packages/app/src/public-types.ts +++ b/packages/app/src/public-types.ts @@ -165,7 +165,7 @@ export interface FirebaseAppSettings { */ name?: string; /** - * The settable config flag for GDPR opt-in/opt-out + * The settable config flag for GDPR opt-in/opt-out. Defaults to true. */ automaticDataCollectionEnabled?: boolean; } From d5428f3d23e8e483feb42d98bbcf6fa7f3e6df8f Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Wed, 7 May 2025 10:32:54 -0700 Subject: [PATCH 180/295] Version Packages (#8997) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/afraid-baboons-develop.md | 8 ---- .changeset/lemon-tomatoes-breathe.md | 5 -- .changeset/nice-plants-thank.md | 10 ---- .changeset/nine-pugs-crash.md | 11 ----- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 12 +++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 13 +++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 12 +++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 12 +++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 10 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 14 ++++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 12 +++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 37 ++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 12 +++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 10 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 9 ++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 12 +++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 8 ++++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 ++++ packages/vertexai/package.json | 8 ++-- repo-scripts/size-analysis/package.json | 4 +- 69 files changed, 496 insertions(+), 210 deletions(-) delete mode 100644 .changeset/afraid-baboons-develop.md delete mode 100644 .changeset/lemon-tomatoes-breathe.md delete mode 100644 .changeset/nice-plants-thank.md delete mode 100644 .changeset/nine-pugs-crash.md diff --git a/.changeset/afraid-baboons-develop.md b/.changeset/afraid-baboons-develop.md deleted file mode 100644 index 84e4e923f43..00000000000 --- a/.changeset/afraid-baboons-develop.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@firebase/app-check': minor -'@firebase/app': minor -'@firebase/app-compat': minor -'firebase': minor ---- - -Default automaticDataCollectionEnabled to true without changing App Check's default behavior. diff --git a/.changeset/lemon-tomatoes-breathe.md b/.changeset/lemon-tomatoes-breathe.md deleted file mode 100644 index 0df04153d61..00000000000 --- a/.changeset/lemon-tomatoes-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/auth": patch ---- - -Fix issue where auth port wasn't properly set when setting up cookies in Firebase Studio. diff --git a/.changeset/nice-plants-thank.md b/.changeset/nice-plants-thank.md deleted file mode 100644 index 05fb520760f..00000000000 --- a/.changeset/nice-plants-thank.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@firebase/database-compat": patch -"@firebase/database": patch -"@firebase/firestore": patch -"@firebase/functions": patch -"@firebase/storage": patch -"@firebase/util": patch ---- - -Auto Enable SSL for Firebase Studio diff --git a/.changeset/nine-pugs-crash.md b/.changeset/nine-pugs-crash.md deleted file mode 100644 index b4a654a484f..00000000000 --- a/.changeset/nine-pugs-crash.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@firebase/auth": patch -"@firebase/data-connect": patch -"@firebase/database-compat": patch -"@firebase/database": patch -"@firebase/firestore": patch -"@firebase/storage": patch -"@firebase/util": patch ---- - -Fix Auth Redirects on Firebase Studio diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 4cd59d2626d..dce91e6ce6f 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.11.5", - "@firebase/app-compat": "0.2.54", - "@firebase/analytics": "0.10.12", - "@firebase/analytics-compat": "0.2.18", - "@firebase/auth": "1.10.1", - "@firebase/auth-compat": "0.5.21", - "@firebase/functions": "0.12.3", - "@firebase/functions-compat": "0.3.20", - "@firebase/messaging": "0.12.17", - "@firebase/messaging-compat": "0.2.17", - "@firebase/performance": "0.7.2", - "@firebase/performance-compat": "0.2.15", - "@firebase/remote-config": "0.6.0", - "@firebase/remote-config-compat": "0.2.13" + "@firebase/app": "0.12.0", + "@firebase/app-compat": "0.3.0", + "@firebase/analytics": "0.10.13", + "@firebase/analytics-compat": "0.2.19", + "@firebase/auth": "1.10.2", + "@firebase/auth-compat": "0.5.22", + "@firebase/functions": "0.12.4", + "@firebase/functions-compat": "0.3.21", + "@firebase/messaging": "0.12.18", + "@firebase/messaging-compat": "0.2.18", + "@firebase/performance": "0.7.3", + "@firebase/performance-compat": "0.2.16", + "@firebase/remote-config": "0.6.1", + "@firebase/remote-config-compat": "0.2.14" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 9ca8917ab4c..5d4aa90895e 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.11.5", - "@firebase/firestore": "4.7.11" + "@firebase/app": "0.12.0", + "@firebase/firestore": "4.7.12" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index a86c4b1f7b5..1f27302d673 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.6.1", + "firebase": "11.7.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 8afe6a643d0..0a349c8d806 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.19 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/analytics@0.10.13 + - @firebase/component@0.6.14 + ## 0.2.18 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 1064125d5f6..b3b633a1572 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.18", + "version": "0.2.19", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.13", - "@firebase/analytics": "0.10.12", + "@firebase/component": "0.6.14", + "@firebase/analytics": "0.10.13", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 6b7df8ce4e9..964d404dc9c 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.13 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/installations@0.6.14 + - @firebase/component@0.6.14 + ## 0.10.12 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index d56f6f7c61e..76765839c2f 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.12", + "version": "0.10.13", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.13", + "@firebase/installations": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index a5ca70adbc6..3cec9412293 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.21 + +### Patch Changes + +- Updated dependencies [[`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb), [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/app-check@0.9.0 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.3.20 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 630e7a8d234..44eb56be76a 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.20", + "version": "0.3.21", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.13", + "@firebase/app-check": "0.9.0", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index a2afaa1b23a..539e9541659 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app-check +## 0.9.0 + +### Minor Changes + +- [`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb) [#8999](https://github.com/firebase/firebase-js-sdk/pull/8999) - Default automaticDataCollectionEnabled to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.8.13 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index ae6555da970..22df124e1c9 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.8.13", + "version": "0.9.0", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index d505c7b6240..64790ad39d5 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/app-compat +## 0.3.0 + +### Minor Changes + +- [`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb) [#8999](https://github.com/firebase/firebase-js-sdk/pull/8999) - Default automaticDataCollectionEnabled to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb), [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/app@0.12.0 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.2.54 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index e113c708c74..fbb28d22510 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.2.54", + "version": "0.3.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.11.5", - "@firebase/util": "1.11.0", + "@firebase/app": "0.12.0", + "@firebase/util": "1.11.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 3528eee556d..24b71ffa7ba 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app +## 0.12.0 + +### Minor Changes + +- [`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb) [#8999](https://github.com/firebase/firebase-js-sdk/pull/8999) - Default automaticDataCollectionEnabled to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.11.5 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 848919067bd..0995e0223f7 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.11.5", + "version": "0.12.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 66b1e0d6e28..c3d3e3e3983 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.22 + +### Patch Changes + +- Updated dependencies [[`6a02778`](https://github.com/firebase/firebase-js-sdk/commit/6a02778e3d12af683e710b53dc6dfb64329e8229), [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/auth@1.10.2 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.5.21 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index fa69e3f3679..ab1d2548cc0 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.21", + "version": "0.5.22", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.1", + "@firebase/auth": "1.10.2", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.13", - "@firebase/util": "1.11.0", + "@firebase/component": "0.6.14", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 5a52929a128..74d290fead1 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/auth +## 1.10.2 + +### Patch Changes + +- [`6a02778`](https://github.com/firebase/firebase-js-sdk/commit/6a02778e3d12af683e710b53dc6dfb64329e8229) [#8998](https://github.com/firebase/firebase-js-sdk/pull/8998) - Fix issue where auth port wasn't properly set when setting up cookies in Firebase Studio. + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 1.10.1 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 6a704a4d4b6..6acc99393c8 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.1", + "version": "1.10.2", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index df1e6c026ca..6213c4204ae 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.14 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + ## 0.6.13 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index 3e2e6d11838..f3338c83fdc 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.13", + "version": "0.6.14", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 03e17644a77..c222e97117a 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,15 @@ ## Unreleased +## 0.3.5 + +### Patch Changes + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.3.4 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 00f9bb492cc..3a180cabcbc 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.4", + "version": "0.3.5", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 8cd7d96b5a4..9fde0eac95c 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,19 @@ # @firebase/database-compat +## 2.0.6 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/database@1.0.15 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + - @firebase/database-types@1.0.11 + ## 2.0.5 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 65deedb34e2..d85ba6991b2 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.5", + "version": "2.0.6", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.14", - "@firebase/database-types": "1.0.10", + "@firebase/database": "1.0.15", + "@firebase/database-types": "1.0.11", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 6292941e87e..e24ab9364a6 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.11 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + ## 1.0.10 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 4a4995377fe..20565d5c28a 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.10", + "version": "1.0.11", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.11.0" + "@firebase/util": "1.11.1" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 451201ee462..1cfa56fd78e 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,17 @@ # Unreleased +## 1.0.15 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 1.0.14 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index d6f5ddc1707..aef6416d018 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.14", + "version": "1.0.15", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index e71a10d560f..8e2d196db27 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,42 @@ # firebase +## 11.7.0 + +### Minor Changes + +- [`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb) [#8999](https://github.com/firebase/firebase-js-sdk/pull/8999) - Default automaticDataCollectionEnabled to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`3789b5a`](https://github.com/firebase/firebase-js-sdk/commit/3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb), [`6a02778`](https://github.com/firebase/firebase-js-sdk/commit/6a02778e3d12af683e710b53dc6dfb64329e8229), [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/app-check@0.9.0 + - @firebase/app@0.12.0 + - @firebase/app-compat@0.3.0 + - @firebase/auth@1.10.2 + - @firebase/database-compat@2.0.6 + - @firebase/database@1.0.15 + - @firebase/firestore@4.7.12 + - @firebase/functions@0.12.4 + - @firebase/storage@0.13.8 + - @firebase/util@1.11.1 + - @firebase/data-connect@0.3.5 + - @firebase/app-check-compat@0.3.21 + - @firebase/analytics@0.10.13 + - @firebase/installations@0.6.14 + - @firebase/messaging@0.12.18 + - @firebase/performance@0.7.3 + - @firebase/remote-config@0.6.1 + - @firebase/vertexai@1.2.2 + - @firebase/analytics-compat@0.2.19 + - @firebase/auth-compat@0.5.22 + - @firebase/firestore-compat@0.3.47 + - @firebase/functions-compat@0.3.21 + - @firebase/installations-compat@0.2.14 + - @firebase/messaging-compat@0.2.18 + - @firebase/performance-compat@0.2.16 + - @firebase/remote-config-compat@0.2.14 + - @firebase/storage-compat@0.3.18 + ## 11.6.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 3a4bec301e3..2335648ddc7 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.6.1", + "version": "11.7.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.11.5", - "@firebase/app-compat": "0.2.54", + "@firebase/app": "0.12.0", + "@firebase/app-compat": "0.3.0", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.1", - "@firebase/auth-compat": "0.5.21", - "@firebase/data-connect": "0.3.4", - "@firebase/database": "1.0.14", - "@firebase/database-compat": "2.0.5", - "@firebase/firestore": "4.7.11", - "@firebase/firestore-compat": "0.3.46", - "@firebase/functions": "0.12.3", - "@firebase/functions-compat": "0.3.20", - "@firebase/installations": "0.6.13", - "@firebase/installations-compat": "0.2.13", - "@firebase/messaging": "0.12.17", - "@firebase/messaging-compat": "0.2.17", - "@firebase/storage": "0.13.7", - "@firebase/storage-compat": "0.3.17", - "@firebase/performance": "0.7.2", - "@firebase/performance-compat": "0.2.15", - "@firebase/remote-config": "0.6.0", - "@firebase/remote-config-compat": "0.2.13", - "@firebase/analytics": "0.10.12", - "@firebase/analytics-compat": "0.2.18", - "@firebase/app-check": "0.8.13", - "@firebase/app-check-compat": "0.3.20", - "@firebase/util": "1.11.0", - "@firebase/vertexai": "1.2.1" + "@firebase/auth": "1.10.2", + "@firebase/auth-compat": "0.5.22", + "@firebase/data-connect": "0.3.5", + "@firebase/database": "1.0.15", + "@firebase/database-compat": "2.0.6", + "@firebase/firestore": "4.7.12", + "@firebase/firestore-compat": "0.3.47", + "@firebase/functions": "0.12.4", + "@firebase/functions-compat": "0.3.21", + "@firebase/installations": "0.6.14", + "@firebase/installations-compat": "0.2.14", + "@firebase/messaging": "0.12.18", + "@firebase/messaging-compat": "0.2.18", + "@firebase/storage": "0.13.8", + "@firebase/storage-compat": "0.3.18", + "@firebase/performance": "0.7.3", + "@firebase/performance-compat": "0.2.16", + "@firebase/remote-config": "0.6.1", + "@firebase/remote-config-compat": "0.2.14", + "@firebase/analytics": "0.10.13", + "@firebase/analytics-compat": "0.2.19", + "@firebase/app-check": "0.9.0", + "@firebase/app-check-compat": "0.3.21", + "@firebase/util": "1.11.1", + "@firebase/vertexai": "1.2.2" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index aadd8c532b3..c721b0b7b20 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.47 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/firestore@4.7.12 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.3.46 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 58210252655..bfc0f71c03a 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.46", + "version": "0.3.47", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.13", - "@firebase/firestore": "4.7.11", - "@firebase/util": "1.11.0", + "@firebase/component": "0.6.14", + "@firebase/firestore": "4.7.12", + "@firebase/util": "1.11.1", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 421f33ed1d5..0fd288b01c8 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/firestore +## 4.7.12 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 4.7.11 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 8cc7e5e18f5..c6075767a85 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.11", + "version": "4.7.12", "engines": { "node": ">=18.0.0" }, @@ -98,9 +98,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -110,9 +110,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.5", - "@firebase/app-compat": "0.2.54", - "@firebase/auth": "1.10.1", + "@firebase/app": "0.12.0", + "@firebase/app-compat": "0.3.0", + "@firebase/auth": "1.10.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 6187c248d91..28a5efc295d 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.21 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/functions@0.12.4 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.3.20 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index c2757fcf130..72f3643a99b 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.20", + "version": "0.3.21", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.13", - "@firebase/functions": "0.12.3", + "@firebase/component": "0.6.14", + "@firebase/functions": "0.12.4", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index c9657c72276..c0a54ac71b0 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/functions +## 0.12.4 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.12.3 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 4ddf15ac556..8ec8ee12ed3 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.3", + "version": "0.12.4", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index c3283b451a4..e34cf0add2a 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.14 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/installations@0.6.14 + - @firebase/component@0.6.14 + ## 0.2.13 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 0f5203dd5d1..28f0827fdff 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.13", + "version": "0.2.14", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.13", + "@firebase/installations": "0.6.14", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index da975f33726..71a9e9757cd 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.14 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.6.13 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index 83db977a6b6..08c7803e9b1 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.13", + "version": "0.6.14", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index b99cdf6a91d..61da0c87ed3 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.18 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/messaging@0.12.18 + - @firebase/component@0.6.14 + ## 0.2.17 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 388670eb5ab..23de8651813 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.17", + "version": "0.2.18", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.17", - "@firebase/component": "0.6.13", - "@firebase/util": "1.11.0", + "@firebase/messaging": "0.12.18", + "@firebase/component": "0.6.14", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", + "@firebase/app-compat": "0.3.0", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 87191b38a3b..d0a684dcb8e 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.18 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/installations@0.6.14 + - @firebase/component@0.6.14 + ## 0.12.17 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 5e25b2b1ca0..d18343d169f 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.17", + "version": "0.12.18", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.13", + "@firebase/installations": "0.6.14", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 0091e5fbb04..56d5b805eef 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.16 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/performance@0.7.3 + - @firebase/component@0.6.14 + ## 0.2.15 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 69c24f13465..4034920cb27 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.15", + "version": "0.2.16", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.2", + "@firebase/performance": "0.7.3", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.54" + "@firebase/app-compat": "0.3.0" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index d58028ad104..b03ece7ed0c 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.3 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/installations@0.6.14 + - @firebase/component@0.6.14 + ## 0.7.2 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 07e8e60d054..ed9f28e04b9 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.2", + "version": "0.7.3", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.13", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/installations": "0.6.14", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index abd4ab9ae01..01ed6bc0cef 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.14 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/remote-config@0.6.1 + - @firebase/component@0.6.14 + ## 0.2.13 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 1055c892435..0bbeb8c33e5 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.13", + "version": "0.2.14", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.0", + "@firebase/remote-config": "0.6.1", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.2.54" + "@firebase/app-compat": "0.3.0" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 055cdae474f..4a209ee5e38 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config +## 0.6.1 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/installations@0.6.14 + - @firebase/component@0.6.14 + ## 0.6.0 ### Minor Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 4262488b0fb..666f5d4b141 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.0", + "version": "0.6.1", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.13", + "@firebase/installations": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 1ddc092ba0b..309cd864964 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.18 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/storage@0.13.8 + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.3.17 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index d829a79cbc5..8b7fca14dff 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.17", + "version": "0.3.18", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.7", + "@firebase/storage": "0.13.8", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.54", - "@firebase/auth-compat": "0.5.21", + "@firebase/app-compat": "0.3.0", + "@firebase/auth-compat": "0.5.22", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 4bfd1ded8da..7636c13260d 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,17 @@ #Unreleased +## 0.13.8 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 0.13.7 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 0a7a8af9b93..b7cf6228960 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.7", + "version": "0.13.8", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.11.0", - "@firebase/component": "0.6.13", + "@firebase/util": "1.11.1", + "@firebase/component": "0.6.14", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.11.5", - "@firebase/auth": "1.10.1", + "@firebase/app": "0.12.0", + "@firebase/auth": "1.10.2", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 80500aa1392..a67a5813982 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index e42a02b2220..5a33cbad42b 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/util +## 1.11.1 + +### Patch Changes + +- [`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875) [#8980](https://github.com/firebase/firebase-js-sdk/pull/8980) - Auto Enable SSL for Firebase Studio + +- [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb) [#8968](https://github.com/firebase/firebase-js-sdk/pull/8968) - Fix Auth Redirects on Firebase Studio + ## 1.11.0 ### Minor Changes diff --git a/packages/util/package.json b/packages/util/package.json index 3200d18c487..8d8c85b3f2e 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.11.0", + "version": "1.11.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 3e1a1f3c326..8fa9e9d4b4a 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.2.2 + +### Patch Changes + +- Updated dependencies [[`ea1f913`](https://github.com/firebase/firebase-js-sdk/commit/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875), [`0e12766`](https://github.com/firebase/firebase-js-sdk/commit/0e127664946ba324c6566a02b393dafd23fc1ddb)]: + - @firebase/util@1.11.1 + - @firebase/component@0.6.14 + ## 1.2.1 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index e3472e733f8..9d71ac73b91 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.2.1", + "version": "1.2.2", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.13", + "@firebase/component": "0.6.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index f2a4a35bd53..a723d4a52df 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.11.5", + "@firebase/app": "0.12.0", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.0", + "@firebase/util": "1.11.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 51e7b489d8aadd531453f882421903da8727b19d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 7 May 2025 15:51:17 -0700 Subject: [PATCH 181/295] Roll back #8999 (#9007) * Revert "Change automaticDataCollectionEnabled to default to true. (#8999)" This reverts commit 3789b5ad16ffd462fce1d0b9c2e9ffae373bc6eb. * Revert #8999 - backend is not ready --- .changeset/blue-spies-visit.md | 7 ++ docs-devsite/app.firebaseappsettings.md | 4 +- packages/app-check/src/api.test.ts | 73 +------------------ packages/app-check/src/api.ts | 20 ++--- .../app-compat/test/firebaseAppCompat.test.ts | 8 +- packages/app/src/api.test.ts | 19 ++--- packages/app/src/api.ts | 4 +- packages/app/src/firebaseApp.test.ts | 4 +- packages/app/src/firebaseServerApp.ts | 2 +- packages/app/src/public-types.ts | 2 +- 10 files changed, 35 insertions(+), 108 deletions(-) create mode 100644 .changeset/blue-spies-visit.md diff --git a/.changeset/blue-spies-visit.md b/.changeset/blue-spies-visit.md new file mode 100644 index 00000000000..2f1ebf01827 --- /dev/null +++ b/.changeset/blue-spies-visit.md @@ -0,0 +1,7 @@ +--- +'@firebase/app-compat': patch +'@firebase/app-check': patch +'@firebase/app': patch +--- + +Revert https://github.com/firebase/firebase-js-sdk/pull/8999 diff --git a/docs-devsite/app.firebaseappsettings.md b/docs-devsite/app.firebaseappsettings.md index e7838ab4185..1515e21ac93 100644 --- a/docs-devsite/app.firebaseappsettings.md +++ b/docs-devsite/app.firebaseappsettings.md @@ -22,12 +22,12 @@ export interface FirebaseAppSettings | Property | Type | Description | | --- | --- | --- | -| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out. Defaults to true. | +| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out | | [name](./app.firebaseappsettings.md#firebaseappsettingsname) | string | custom name for the Firebase App. The default value is "[DEFAULT]". | ## FirebaseAppSettings.automaticDataCollectionEnabled -The settable config flag for GDPR opt-in/opt-out. Defaults to true. +The settable config flag for GDPR opt-in/opt-out Signature: diff --git a/packages/app-check/src/api.test.ts b/packages/app-check/src/api.test.ts index b71971e9d70..a6805d1b0b3 100644 --- a/packages/app-check/src/api.test.ts +++ b/packages/app-check/src/api.test.ts @@ -239,7 +239,7 @@ describe('api', () => { expect(getStateReference(app).activated).to.equal(true); }); - it('global false + local unset = false', () => { + it('isTokenAutoRefreshEnabled value defaults to global setting', () => { app.automaticDataCollectionEnabled = false; initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) @@ -247,77 +247,8 @@ describe('api', () => { expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); }); - it('global false + local true = false', () => { - app.automaticDataCollectionEnabled = false; - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: true - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global false + local false = false', () => { - app.automaticDataCollectionEnabled = false; - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: false - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global unset + local unset = false', () => { - // Global unset should default to true. - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global unset + local false = false', () => { - // Global unset should default to true. - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: false - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global unset + local true = true', () => { - // Global unset should default to true. - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: true - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); - }); - - it('global true + local unset = false', () => { - app.automaticDataCollectionEnabled = true; - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global true + local false = false', () => { - app.automaticDataCollectionEnabled = true; - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: false - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); - }); - - it('global true + local true = true', () => { - app.automaticDataCollectionEnabled = true; - initializeAppCheck(app, { - provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), - isTokenAutoRefreshEnabled: true - }); - expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); - }); - it('sets isTokenAutoRefreshEnabled correctly, overriding global setting', () => { + app.automaticDataCollectionEnabled = false; initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), isTokenAutoRefreshEnabled: true diff --git a/packages/app-check/src/api.ts b/packages/app-check/src/api.ts index e7c9f8cfcf9..a4dd87a4e77 100644 --- a/packages/app-check/src/api.ts +++ b/packages/app-check/src/api.ts @@ -43,7 +43,6 @@ import { } from './internal-api'; import { readTokenFromStorage } from './storage'; import { getDebugToken, initializeDebugMode, isDebugMode } from './debug'; -import { logger } from './logger'; declare module '@firebase/component' { interface NameServiceMapping { @@ -133,7 +132,7 @@ export function initializeAppCheck( function _activate( app: FirebaseApp, provider: AppCheckProvider, - isTokenAutoRefreshEnabled: boolean = false + isTokenAutoRefreshEnabled?: boolean ): void { // Create an entry in the APP_CHECK_STATES map. Further changes should // directly mutate this object. @@ -150,18 +149,13 @@ function _activate( return cachedToken; }); - // Global `automaticDataCollectionEnabled` (defaults to true) and - // `isTokenAutoRefreshEnabled` must both be true. + // Use value of global `automaticDataCollectionEnabled` (which + // itself defaults to false if not specified in config) if + // `isTokenAutoRefreshEnabled` param was not provided by user. state.isTokenAutoRefreshEnabled = - isTokenAutoRefreshEnabled && app.automaticDataCollectionEnabled; - - if (!app.automaticDataCollectionEnabled && isTokenAutoRefreshEnabled) { - logger.warn( - '`isTokenAutoRefreshEnabled` is true but ' + - '`automaticDataCollectionEnabled` was set to false during' + - ' `initializeApp()`. This blocks automatic token refresh.' - ); - } + isTokenAutoRefreshEnabled === undefined + ? app.automaticDataCollectionEnabled + : isTokenAutoRefreshEnabled; state.provider.initialize(app); } diff --git a/packages/app-compat/test/firebaseAppCompat.test.ts b/packages/app-compat/test/firebaseAppCompat.test.ts index 61bbed848d8..f12a73e61a8 100644 --- a/packages/app-compat/test/firebaseAppCompat.test.ts +++ b/packages/app-compat/test/firebaseAppCompat.test.ts @@ -403,17 +403,17 @@ function firebaseAppTests( ).throws(/'abc'.*exists/i); }); - it('automaticDataCollectionEnabled is `true` by default', () => { + it('automaticDataCollectionEnabled is `false` by default', () => { const app = firebase.initializeApp({}, 'my-app'); - expect(app.automaticDataCollectionEnabled).to.eq(true); + expect(app.automaticDataCollectionEnabled).to.eq(false); }); it('automaticDataCollectionEnabled can be set via the config object', () => { const app = firebase.initializeApp( {}, - { automaticDataCollectionEnabled: false } + { automaticDataCollectionEnabled: true } ); - expect(app.automaticDataCollectionEnabled).to.eq(false); + expect(app.automaticDataCollectionEnabled).to.eq(true); }); it('Modifying options object does not change options.', () => { diff --git a/packages/app/src/api.test.ts b/packages/app/src/api.test.ts index 4e79ad58d82..f6cf922ba05 100644 --- a/packages/app/src/api.test.ts +++ b/packages/app/src/api.test.ts @@ -128,14 +128,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { automaticDataCollectionEnabled: false } + { automaticDataCollectionEnabled: true } ); expect(() => initializeApp( { apiKey: 'test1' }, - { automaticDataCollectionEnabled: true } + { automaticDataCollectionEnabled: false } ) ).throws(/\[DEFAULT\].*exists/i); }); @@ -146,14 +146,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: false } + { name: appName, automaticDataCollectionEnabled: true } ); expect(() => initializeApp( { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: true } + { name: appName, automaticDataCollectionEnabled: false } ) ).throws(/'MyApp'.*exists/i); }); @@ -164,16 +164,11 @@ describe('API tests', () => { expect(app.name).to.equal(appName); }); - it('sets automaticDataCollectionEnabled to true by default', () => { - const app = initializeApp({}); + it('sets automaticDataCollectionEnabled', () => { + const app = initializeApp({}, { automaticDataCollectionEnabled: true }); expect(app.automaticDataCollectionEnabled).to.be.true; }); - it('sets a new automaticDataCollectionEnabled value if provided', () => { - const app = initializeApp({}, { automaticDataCollectionEnabled: false }); - expect(app.automaticDataCollectionEnabled).to.be.false; - }); - it('adds registered components to App', () => { _clearComponents(); const comp1 = createTestComponent('test1'); @@ -216,7 +211,7 @@ describe('API tests', () => { const app = initializeServerApp(options, serverAppSettings); expect(app).to.not.equal(null); - expect(app.automaticDataCollectionEnabled).to.be.true; + expect(app.automaticDataCollectionEnabled).to.be.false; await deleteApp(app); expect((app as FirebaseServerAppImpl).isDeleted).to.be.true; }); diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index 9cba8ec6f50..b8ec25fc509 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -143,7 +143,7 @@ export function initializeApp( const config: Required = { name: DEFAULT_ENTRY_NAME, - automaticDataCollectionEnabled: true, + automaticDataCollectionEnabled: false, ...rawConfig }; const name = config.name; @@ -241,7 +241,7 @@ export function initializeServerApp( } if (_serverAppConfig.automaticDataCollectionEnabled === undefined) { - _serverAppConfig.automaticDataCollectionEnabled = true; + _serverAppConfig.automaticDataCollectionEnabled = false; } let appOptions: FirebaseOptions; diff --git a/packages/app/src/firebaseApp.test.ts b/packages/app/src/firebaseApp.test.ts index 3acbb4a2869..419eeef4f1f 100644 --- a/packages/app/src/firebaseApp.test.ts +++ b/packages/app/src/firebaseApp.test.ts @@ -27,11 +27,11 @@ describe('FirebaseAppNext', () => { }; const app = new FirebaseAppImpl( options, - { name: 'test', automaticDataCollectionEnabled: true }, + { name: 'test', automaticDataCollectionEnabled: false }, new ComponentContainer('test') ); - expect(app.automaticDataCollectionEnabled).to.be.true; + expect(app.automaticDataCollectionEnabled).to.be.false; expect(app.name).to.equal('test'); expect(app.options).to.deep.equal(options); }); diff --git a/packages/app/src/firebaseServerApp.ts b/packages/app/src/firebaseServerApp.ts index 2bb8efc7a63..21232869c3c 100644 --- a/packages/app/src/firebaseServerApp.ts +++ b/packages/app/src/firebaseServerApp.ts @@ -74,7 +74,7 @@ export class FirebaseServerAppImpl const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined ? serverConfig.automaticDataCollectionEnabled - : true; + : false; // Create the FirebaseAppSettings object for the FirebaseAppImp constructor. const config: Required = { diff --git a/packages/app/src/public-types.ts b/packages/app/src/public-types.ts index 4f8373f2250..ea68579a7e9 100644 --- a/packages/app/src/public-types.ts +++ b/packages/app/src/public-types.ts @@ -165,7 +165,7 @@ export interface FirebaseAppSettings { */ name?: string; /** - * The settable config flag for GDPR opt-in/opt-out. Defaults to true. + * The settable config flag for GDPR opt-in/opt-out */ automaticDataCollectionEnabled?: boolean; } From f8334eade721db4ee3b60f748a5c9ff338bf1168 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Wed, 7 May 2025 16:11:55 -0700 Subject: [PATCH 182/295] Version Packages (#9008) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/blue-spies-visit.md | 7 ------- integration/compat-interop/package.json | 4 ++-- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/CHANGELOG.md | 7 +++++++ packages/app-check-compat/package.json | 6 +++--- packages/app-check/CHANGELOG.md | 6 ++++++ packages/app-check/package.json | 4 ++-- packages/app-compat/CHANGELOG.md | 9 +++++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 10 ++++++++++ packages/firebase/package.json | 10 +++++----- packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 4 ++-- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- packages/vertexai/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 38 files changed, 80 insertions(+), 49 deletions(-) delete mode 100644 .changeset/blue-spies-visit.md diff --git a/.changeset/blue-spies-visit.md b/.changeset/blue-spies-visit.md deleted file mode 100644 index 2f1ebf01827..00000000000 --- a/.changeset/blue-spies-visit.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@firebase/app-compat': patch -'@firebase/app-check': patch -'@firebase/app': patch ---- - -Revert https://github.com/firebase/firebase-js-sdk/pull/8999 diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index dce91e6ce6f..c28006dd7d3 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.12.0", - "@firebase/app-compat": "0.3.0", + "@firebase/app": "0.12.1", + "@firebase/app-compat": "0.3.1", "@firebase/analytics": "0.10.13", "@firebase/analytics-compat": "0.2.19", "@firebase/auth": "1.10.2", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 5d4aa90895e..ee49ae9734f 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,7 +14,7 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@firebase/firestore": "4.7.12" }, "devDependencies": { diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 1f27302d673..a8f0fd1cf7a 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.7.0", + "firebase": "11.7.1", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index b3b633a1572..dc614771cda 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 76765839c2f..3878c34658e 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 3cec9412293..db793dea557 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-check-compat +## 0.3.22 + +### Patch Changes + +- Updated dependencies [[`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d)]: + - @firebase/app-check@0.9.1 + ## 0.3.21 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 44eb56be76a..05be510bdf8 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.21", + "version": "0.3.22", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,7 +34,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.9.0", + "@firebase/app-check": "0.9.1", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.1", @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 539e9541659..a3afb0864cb 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app-check +## 0.9.1 + +### Patch Changes + +- [`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d) [#9007](https://github.com/firebase/firebase-js-sdk/pull/9007) - Revert https://github.com/firebase/firebase-js-sdk/pull/8999 + ## 0.9.0 ### Minor Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 22df124e1c9..7dc2a2bb139 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.9.0", + "version": "0.9.1", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 64790ad39d5..be47b8e2e3b 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.3.1 + +### Patch Changes + +- [`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d) [#9007](https://github.com/firebase/firebase-js-sdk/pull/9007) - Revert https://github.com/firebase/firebase-js-sdk/pull/8999 + +- Updated dependencies [[`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d)]: + - @firebase/app@0.12.1 + ## 0.3.0 ### Minor Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index fbb28d22510..725c2fa99b1 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.3.0", + "version": "0.3.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@firebase/util": "1.11.1", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.14", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 24b71ffa7ba..c8950255f24 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.12.1 + +### Patch Changes + +- [`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d) [#9007](https://github.com/firebase/firebase-js-sdk/pull/9007) - Revert https://github.com/firebase/firebase-js-sdk/pull/8999 + ## 0.12.0 ### Minor Changes diff --git a/packages/app/package.json b/packages/app/package.json index 0995e0223f7..24d32c0a686 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.12.0", + "version": "0.12.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index ab1d2548cc0..d061a5f17a0 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 6acc99393c8..a58608538db 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 3a180cabcbc..2c0c454ff55 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index d85ba6991b2..ec0e6994468 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index aef6416d018..e68132857d4 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 8e2d196db27..3ecab3e54f6 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,15 @@ # firebase +## 11.7.1 + +### Patch Changes + +- Updated dependencies [[`51e7b48`](https://github.com/firebase/firebase-js-sdk/commit/51e7b489d8aadd531453f882421903da8727b19d)]: + - @firebase/app-compat@0.3.1 + - @firebase/app-check@0.9.1 + - @firebase/app@0.12.1 + - @firebase/app-check-compat@0.3.22 + ## 11.7.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 2335648ddc7..f4fe3bb2d50 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.7.0", + "version": "11.7.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,8 +399,8 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.12.0", - "@firebase/app-compat": "0.3.0", + "@firebase/app": "0.12.1", + "@firebase/app-compat": "0.3.1", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.10.2", "@firebase/auth-compat": "0.5.22", @@ -423,8 +423,8 @@ "@firebase/remote-config-compat": "0.2.14", "@firebase/analytics": "0.10.13", "@firebase/analytics-compat": "0.2.19", - "@firebase/app-check": "0.9.0", - "@firebase/app-check-compat": "0.3.21", + "@firebase/app-check": "0.9.1", + "@firebase/app-check-compat": "0.3.22", "@firebase/util": "1.11.1", "@firebase/vertexai": "1.2.2" }, diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index bfc0f71c03a..648cf8ee019 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -53,7 +53,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index c6075767a85..38eea5b1505 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -110,8 +110,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.0", - "@firebase/app-compat": "0.3.0", + "@firebase/app": "0.12.1", + "@firebase/app-compat": "0.3.1", "@firebase/auth": "1.10.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 72f3643a99b..02725731af4 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 8ec8ee12ed3..e2e6d9f99fc 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 28f0827fdff..ce75757d337 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index 08c7803e9b1..32285b7fb1c 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 23de8651813..1021d98c515 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index d18343d169f..3d2e70ebfb4 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 4034920cb27..37b49ad2455 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.0" + "@firebase/app-compat": "0.3.1" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index ed9f28e04b9..a6256c12f39 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 0bbeb8c33e5..9839182086c 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.0" + "@firebase/app-compat": "0.3.1" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 666f5d4b141..1b068256178 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 8b7fca14dff..fe7b9772ec0 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.0", + "@firebase/app-compat": "0.3.1", "@firebase/auth-compat": "0.5.22", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index b7cf6228960..963ad3e86d6 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@firebase/auth": "1.10.2", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index a67a5813982..7f5bf9cb1bd 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 9d71ac73b91..0c6b24fc495 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index a723d4a52df..85590c3c77d 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.0", + "@firebase/app": "0.12.1", "@firebase/logger": "0.4.4", "@firebase/util": "1.11.1", "@rollup/plugin-commonjs": "21.1.0", From 050c1b6a099b87be1488b9207e4fad4da9f8f64b Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 8 May 2025 13:15:03 -0400 Subject: [PATCH 183/295] fix(vertexai): pass `GenerativeModel`'s `BaseParams` to `ChatSession` (#8972) startChat wasn't passing GenerativeModel's BaseParams to ChatSession. So, if a model had a generationConfig, it would never be passed to ChatSession. --- .changeset/fast-mangos-chew.md | 5 +++++ .../src/models/generative-model.test.ts | 22 ++++++++++++++----- .../vertexai/src/models/generative-model.ts | 7 ++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .changeset/fast-mangos-chew.md diff --git a/.changeset/fast-mangos-chew.md b/.changeset/fast-mangos-chew.md new file mode 100644 index 00000000000..c5d2e4b4d1f --- /dev/null +++ b/.changeset/fast-mangos-chew.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Pass `GenerativeModel`'s `BaseParams` to created chat sessions. This fixes an issue where `GenerationConfig` would not be inherited from `ChatSession`. diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index 987f9b115e2..51ea8aafead 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -172,7 +172,10 @@ describe('GenerativeModel', () => { { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, + generationConfig: { + topK: 1 + } }); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( @@ -196,7 +199,8 @@ describe('GenerativeModel', () => { return ( value.includes('myfunc') && value.includes(FunctionCallingMode.NONE) && - value.includes('be friendly') + value.includes('be friendly') && + value.includes('topK') ); }), {} @@ -236,7 +240,10 @@ describe('GenerativeModel', () => { { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, + generationConfig: { + responseMimeType: 'image/jpeg' + } }); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( @@ -262,7 +269,10 @@ describe('GenerativeModel', () => { toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } }, - systemInstruction: { role: 'system', parts: [{ text: 'be formal' }] } + systemInstruction: { role: 'system', parts: [{ text: 'be formal' }] }, + generationConfig: { + responseMimeType: 'image/png' + } }) .sendMessage('hello'); expect(makeRequestStub).to.be.calledWith( @@ -274,7 +284,9 @@ describe('GenerativeModel', () => { return ( value.includes('otherfunc') && value.includes(FunctionCallingMode.AUTO) && - value.includes('be formal') + value.includes('be formal') && + value.includes('image/png') && + !value.includes('image/jpeg') ); }), {} diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index 983118bf6ff..1af1ee700d5 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -132,6 +132,13 @@ export class GenerativeModel extends VertexAIModel { tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, + generationConfig: this.generationConfig, + safetySettings: this.safetySettings, + /** + * Overrides params inherited from GenerativeModel with those explicitly set in the + * StartChatParams. For example, if startChatParams.generationConfig is set, it'll override + * this.generationConfig. + */ ...startChatParams }, this.requestOptions From e99683b17cf75c581bd362a1d7cb85f0b9c110ba Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 8 May 2025 13:39:24 -0400 Subject: [PATCH 184/295] feat(vertexai): Gemini multimodal output (#8922) Adds new ResponseModality enum that allows users to specify which modalities should be included in a response. Since we provide a text() accessor, a similar inlineDataParts() accessor was added to return all InlineDataPart[] in the first candidate. --- .changeset/perfect-camels-try.md | 6 ++ common/api-review/vertexai.api.md | 12 ++++ ...ertexai.enhancedgeneratecontentresponse.md | 11 ++++ docs-devsite/vertexai.generationconfig.md | 16 +++++ docs-devsite/vertexai.md | 31 +++++++++ .../src/requests/response-helpers.test.ts | 64 +++++++++++++++++++ .../vertexai/src/requests/response-helpers.ts | 60 +++++++++++++++++ packages/vertexai/src/types/enums.ts | 26 ++++++++ packages/vertexai/src/types/requests.ts | 13 +++- packages/vertexai/src/types/responses.ts | 11 +++- 10 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 .changeset/perfect-camels-try.md diff --git a/.changeset/perfect-camels-try.md b/.changeset/perfect-camels-try.md new file mode 100644 index 00000000000..409a598531d --- /dev/null +++ b/.changeset/perfect-camels-try.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/vertexai': minor +--- + +Add support for Gemini multimodal output diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index e7f00c2f4e0..f9cf3dac5bd 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -124,6 +124,7 @@ export { Date_2 as Date } export interface EnhancedGenerateContentResponse extends GenerateContentResponse { // (undocumented) functionCalls: () => FunctionCall[] | undefined; + inlineDataParts: () => InlineDataPart[] | undefined; text: () => string; } @@ -304,6 +305,8 @@ export interface GenerationConfig { // (undocumented) presencePenalty?: number; responseMimeType?: string; + // @beta + responseModalities?: ResponseModality[]; responseSchema?: TypedSchema | SchemaRequest; // (undocumented) stopSequences?: string[]; @@ -596,6 +599,15 @@ export interface RequestOptions { timeout?: number; } +// @beta +export const ResponseModality: { + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; +}; + +// @beta +export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; + // @public (undocumented) export interface RetrievedContextAttribution { // (undocumented) diff --git a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md index 535fb9def8f..b557219bf84 100644 --- a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md +++ b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md @@ -24,6 +24,7 @@ export interface EnhancedGenerateContentResponse extends GenerateContentResponse | Property | Type | Description | | --- | --- | --- | | [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [inlineDataParts](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () => [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)\[\] \| undefined | Aggregates and returns all [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. | | [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | ## EnhancedGenerateContentResponse.functionCalls @@ -34,6 +35,16 @@ export interface EnhancedGenerateContentResponse extends GenerateContentResponse functionCalls: () => FunctionCall[] | undefined; ``` +## EnhancedGenerateContentResponse.inlineDataParts + +Aggregates and returns all [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. + +Signature: + +```typescript +inlineDataParts: () => InlineDataPart[] | undefined; +``` + ## EnhancedGenerateContentResponse.text Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md index d3e9879f937..360ef709419 100644 --- a/docs-devsite/vertexai.generationconfig.md +++ b/docs-devsite/vertexai.generationconfig.md @@ -27,6 +27,7 @@ export interface GenerationConfig | [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | | [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | | [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | +| [responseModalities](./vertexai.generationconfig.md#generationconfigresponsemodalities) | [ResponseModality](./vertexai.md#responsemodality)\[\] | (Public Preview) Generation modalities to be returned in generation responses. | | [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | | [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | | [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | @@ -75,6 +76,21 @@ Output response MIME type of the generated candidate text. Supported MIME types responseMimeType?: string; ``` +## GenerationConfig.responseModalities + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +- Multimodal response generation is only supported by some Gemini models and versions; see [model versions](https://firebase.google.com/docs/vertex-ai/models). - Only image generation (`ResponseModality.IMAGE`) is supported. + +Signature: + +```typescript +responseModalities?: ResponseModality[]; +``` + ## GenerationConfig.responseSchema Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index f67254eef20..47d45a492ec 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -125,12 +125,14 @@ The Vertex AI in Firebase Web SDK. | Variable | Description | | --- | --- | | [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | +| [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | ## Type Aliases | Type Alias | Description | | --- | --- | | [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [Role](./vertexai.md#role) | Role is the producer of the content. | | [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | | [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | @@ -223,6 +225,22 @@ Possible roles. POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] ``` +## ResponseModality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +Signature: + +```typescript +ResponseModality: { + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; +} +``` + ## Part Content part - includes text, image/video, or function call/response part types. @@ -233,6 +251,19 @@ Content part - includes text, image/video, or function call/response part types. export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; ``` +## ResponseModality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +Signature: + +```typescript +export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; +``` + ## Role Role is the producer of the content. diff --git a/packages/vertexai/src/requests/response-helpers.test.ts b/packages/vertexai/src/requests/response-helpers.test.ts index 5371d040253..97dd2f9fe30 100644 --- a/packages/vertexai/src/requests/response-helpers.test.ts +++ b/packages/vertexai/src/requests/response-helpers.test.ts @@ -29,6 +29,7 @@ import { FinishReason, GenerateContentResponse, ImagenGCSImage, + InlineDataPart, ImagenInlineImage } from '../types'; import { getMockResponse } from '../../test-utils/mock-response'; @@ -132,6 +133,44 @@ const fakeResponseMixed3: GenerateContentResponse = { ] }; +const inlineDataPart1: InlineDataPart = { + inlineData: { + mimeType: 'image/png', + data: 'base64encoded...' + } +}; + +const inlineDataPart2: InlineDataPart = { + inlineData: { + mimeType: 'image/jpeg', + data: 'anotherbase64...' + } +}; + +const fakeResponseInlineData: GenerateContentResponse = { + candidates: [ + { + index: 0, + content: { + role: 'model', + parts: [inlineDataPart1, inlineDataPart2] + } + } + ] +}; + +const fakeResponseTextAndInlineData: GenerateContentResponse = { + candidates: [ + { + index: 0, + content: { + role: 'model', + parts: [{ text: 'Describe this:' }, inlineDataPart1] + } + } + ] +}; + const badFakeResponse: GenerateContentResponse = { promptFeedback: { blockReason: BlockReason.SAFETY, @@ -148,6 +187,7 @@ describe('response-helpers methods', () => { const enhancedResponse = addHelpers(fakeResponseText); expect(enhancedResponse.text()).to.equal('Some text and some more text'); expect(enhancedResponse.functionCalls()).to.be.undefined; + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('good response functionCall', async () => { const enhancedResponse = addHelpers(fakeResponseFunctionCall); @@ -155,6 +195,7 @@ describe('response-helpers methods', () => { expect(enhancedResponse.functionCalls()).to.deep.equal([ functionCallPart1.functionCall ]); + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('good response functionCalls', async () => { const enhancedResponse = addHelpers(fakeResponseFunctionCalls); @@ -163,6 +204,7 @@ describe('response-helpers methods', () => { functionCallPart1.functionCall, functionCallPart2.functionCall ]); + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('good response text/functionCall', async () => { const enhancedResponse = addHelpers(fakeResponseMixed1); @@ -170,6 +212,7 @@ describe('response-helpers methods', () => { functionCallPart2.functionCall ]); expect(enhancedResponse.text()).to.equal('some text'); + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('good response functionCall/text', async () => { const enhancedResponse = addHelpers(fakeResponseMixed2); @@ -177,6 +220,7 @@ describe('response-helpers methods', () => { functionCallPart1.functionCall ]); expect(enhancedResponse.text()).to.equal('some text'); + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('good response text/functionCall/text', async () => { const enhancedResponse = addHelpers(fakeResponseMixed3); @@ -184,10 +228,30 @@ describe('response-helpers methods', () => { functionCallPart1.functionCall ]); expect(enhancedResponse.text()).to.equal('some text and more text'); + expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('bad response safety', async () => { const enhancedResponse = addHelpers(badFakeResponse); expect(enhancedResponse.text).to.throw('SAFETY'); + expect(enhancedResponse.functionCalls).to.throw('SAFETY'); + expect(enhancedResponse.inlineDataParts).to.throw('SAFETY'); + }); + it('good response inlineData', async () => { + const enhancedResponse = addHelpers(fakeResponseInlineData); + expect(enhancedResponse.text()).to.equal(''); + expect(enhancedResponse.functionCalls()).to.be.undefined; + expect(enhancedResponse.inlineDataParts()).to.deep.equal([ + inlineDataPart1, + inlineDataPart2 + ]); + }); + it('good response text/inlineData', async () => { + const enhancedResponse = addHelpers(fakeResponseTextAndInlineData); + expect(enhancedResponse.text()).to.equal('Describe this:'); + expect(enhancedResponse.functionCalls()).to.be.undefined; + expect(enhancedResponse.inlineDataParts()).to.deep.equal([ + inlineDataPart1 + ]); }); }); describe('getBlockString', () => { diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index 6d0e3bf2a0a..d820f100a50 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -23,6 +23,7 @@ import { GenerateContentResponse, ImagenGCSImage, ImagenInlineImage, + InlineDataPart, VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; @@ -89,6 +90,40 @@ export function addHelpers( } return ''; }; + (response as EnhancedGenerateContentResponse).inlineDataParts = (): + | InlineDataPart[] + | undefined => { + if (response.candidates && response.candidates.length > 0) { + if (response.candidates.length > 1) { + logger.warn( + `This response had ${response.candidates.length} ` + + `candidates. Returning data from the first candidate only. ` + + `Access response.candidates directly to use the other candidates.` + ); + } + if (hadBadFinishReason(response.candidates[0])) { + throw new VertexAIError( + VertexAIErrorCode.RESPONSE_ERROR, + `Response error: ${formatBlockErrorMessage( + response + )}. Response body stored in error.response`, + { + response + } + ); + } + return getInlineDataParts(response); + } else if (response.promptFeedback) { + throw new VertexAIError( + VertexAIErrorCode.RESPONSE_ERROR, + `Data not available. ${formatBlockErrorMessage(response)}`, + { + response + } + ); + } + return undefined; + }; (response as EnhancedGenerateContentResponse).functionCalls = () => { if (response.candidates && response.candidates.length > 0) { if (response.candidates.length > 1) { @@ -164,6 +199,31 @@ export function getFunctionCalls( } } +/** + * Returns {@link InlineDataPart}s in the first candidate if present. + * + * @internal + */ +export function getInlineDataParts( + response: GenerateContentResponse +): InlineDataPart[] | undefined { + const data: InlineDataPart[] = []; + + if (response.candidates?.[0].content?.parts) { + for (const part of response.candidates?.[0].content?.parts) { + if (part.inlineData) { + data.push(part); + } + } + } + + if (data.length > 0) { + return data; + } else { + return undefined; + } +} + const badFinishReasons = [FinishReason.RECITATION, FinishReason.SAFETY]; function hadBadFinishReason(candidate: GenerateContentCandidate): boolean { diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index a9481d40f5f..d6702a0f1a8 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -240,3 +240,29 @@ export enum Modality { */ DOCUMENT = 'DOCUMENT' } + +/** + * Generation modalities to be returned in generation responses. + * + * @beta + */ +export const ResponseModality = { + /** + * Text. + * @beta + */ + TEXT: 'TEXT', + /** + * Image. + * @beta + */ + IMAGE: 'IMAGE' +} as const; + +/** + * Generation modalities to be returned in generation responses. + * + * @beta + */ +export type ResponseModality = + (typeof ResponseModality)[keyof typeof ResponseModality]; diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index c15258b06d0..ee45b636673 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -21,7 +21,8 @@ import { FunctionCallingMode, HarmBlockMethod, HarmBlockThreshold, - HarmCategory + HarmCategory, + ResponseModality } from './enums'; import { ObjectSchemaInterface, SchemaRequest } from './schema'; @@ -95,6 +96,16 @@ export interface GenerationConfig { * this is limited to `application/json` and `text/x.enum`. */ responseSchema?: TypedSchema | SchemaRequest; + /** + * Generation modalities to be returned in generation responses. + * + * @remarks + * - Multimodal response generation is only supported by some Gemini models and versions; see {@link https://firebase.google.com/docs/vertex-ai/models | model versions}. + * - Only image generation (`ResponseModality.IMAGE`) is supported. + * + * @beta + */ + responseModalities?: ResponseModality[]; } /** diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 7f68df1e679..e4a247bec49 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Content, FunctionCall } from './content'; +import { Content, FunctionCall, InlineDataPart } from './content'; import { BlockReason, FinishReason, @@ -59,6 +59,15 @@ export interface EnhancedGenerateContentResponse * Throws if the prompt or candidate was blocked. */ text: () => string; + /** + * Aggregates and returns all {@link InlineDataPart}s from the {@link GenerateContentResponse}'s + * first candidate. + * + * @returns An array of {@link InlineDataPart}s containing data from the response, if available. + * + * @throws If the prompt or candidate was blocked. + */ + inlineDataParts: () => InlineDataPart[] | undefined; functionCalls: () => FunctionCall[] | undefined; } From 88584fdeb32d33994f0212c82d460b0a6eb43fb0 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 8 May 2025 14:09:43 -0400 Subject: [PATCH 185/295] test: Clean up vscode launch file and add vertexai debug config (#9000) --- .vscode/launch.json | 109 ++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e0a16340123..df14c96daa6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,26 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "AI Unit Tests (node)", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/node_modules/.bin/_mocha", + "cwd": "${workspaceRoot}/packages/vertexai", + "args": [ + "--require", + "ts-node/register", + "--require", + "src/index.node.ts", + "--timeout", + "5000", + "src/**/*.test.ts" + ], + "env": { + "TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}" + }, + "sourceMaps": true + }, { "type": "node", "request": "launch", @@ -18,9 +38,9 @@ "${workspaceFolder}/repo-scripts/prune-dts/*.test.ts" ], "env": { - "TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}" + "TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}" }, - "sourceMaps": true, + "sourceMaps": true }, { "type": "node", @@ -30,16 +50,17 @@ "cwd": "${workspaceRoot}/packages/database", "args": [ "test/{,!(browser)/**/}*.test.ts", - "--file", "src/index.node.ts", - "--config", "../../config/mocharc.node.js", + "--file", + "src/index.node.ts", + "--config", + "../../config/mocharc.node.js" ], "env": { - "TS_NODE_FILES":true, + "TS_NODE_FILES": true, "TS_NODE_CACHE": "NO", - "TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}" + "TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}" }, - "sourceMaps": true, - "protocol": "inspector" + "sourceMaps": true }, { "type": "node", @@ -48,14 +69,16 @@ "program": "${workspaceRoot}/node_modules/.bin/_mocha", "cwd": "${workspaceRoot}/packages/firestore", "args": [ - "--require", "babel-register.js", - "--require", "src/index.node.ts", - "--timeout", "5000", + "--require", + "babel-register.js", + "--require", + "src/index.node.ts", + "--timeout", + "5000", "test/{,!(browser|integration)/**/}*.test.ts", "--exit" ], - "sourceMaps": true, - "protocol": "inspector" + "sourceMaps": true }, { "type": "node", @@ -64,18 +87,21 @@ "program": "${workspaceRoot}/node_modules/.bin/_mocha", "cwd": "${workspaceRoot}/packages/firestore", "args": [ - "--require", "babel-register.js", - "--require", "index.node.ts", - "--require", "test/util/node_persistence.ts", - "--timeout", "5000", + "--require", + "babel-register.js", + "--require", + "index.node.ts", + "--require", + "test/util/node_persistence.ts", + "--timeout", + "5000", "test/{,!(browser|integration)/**/}*.test.ts", "--exit" ], "env": { "USE_MOCK_PERSISTENCE": "YES" }, - "sourceMaps": true, - "protocol": "inspector" + "sourceMaps": true }, { "type": "node", @@ -84,17 +110,19 @@ "program": "${workspaceRoot}/node_modules/.bin/_mocha", "cwd": "${workspaceRoot}/packages/firestore", "args": [ - "--require", "babel-register.js", - "--require", "index.node.ts", - "--timeout", "5000", + "--require", + "babel-register.js", + "--require", + "index.node.ts", + "--timeout", + "5000", "test/{,!(browser|unit)/**/}*.test.ts", "--exit" ], "env": { - "FIRESTORE_TARGET_BACKEND" : "emulator", + "FIRESTORE_TARGET_BACKEND": "emulator" }, - "sourceMaps": true, - "protocol": "inspector" + "sourceMaps": true }, { "type": "node", @@ -103,19 +131,22 @@ "program": "${workspaceRoot}/node_modules/.bin/_mocha", "cwd": "${workspaceRoot}/packages/firestore", "args": [ - "--require", "babel-register.js", - "--require", "index.node.ts", - "--require", "test/util/node_persistence.ts", - "--timeout", "5000", + "--require", + "babel-register.js", + "--require", + "index.node.ts", + "--require", + "test/util/node_persistence.ts", + "--timeout", + "5000", "test/{,!(browser|unit)/**/}*.test.ts", "--exit" ], "env": { "USE_MOCK_PERSISTENCE": "YES", - "FIRESTORE_TARGET_BACKEND" : "emulator", + "FIRESTORE_TARGET_BACKEND": "emulator" }, - "sourceMaps": true, - "protocol": "inspector" + "sourceMaps": true }, { "type": "node", @@ -123,12 +154,7 @@ "name": "Firestore Unit Tests (Browser)", "program": "${workspaceRoot}/node_modules/.bin/karma", "cwd": "${workspaceRoot}/packages/firestore", - "args": [ - "start", - "--auto-watch", - "--unit", - "--browsers", "Chrome" - ] + "args": ["start", "--auto-watch", "--unit", "--browsers", "Chrome"] }, { "type": "node", @@ -136,12 +162,7 @@ "name": "Firestore Integration Tests (Browser)", "program": "${workspaceRoot}/node_modules/.bin/karma", "cwd": "${workspaceRoot}/packages/firestore", - "args": [ - "start", - "--auto-watch", - "--integration", - "--browsers", "Chrome" - ] + "args": ["start", "--auto-watch", "--integration", "--browsers", "Chrome"] } ] } From 8a03143b9217effdd86d68bdf195493c0979aa27 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 9 May 2025 14:45:08 -0600 Subject: [PATCH 186/295] Fix encoding of CSI keys in Safari (#8993) --- .changeset/eighty-starfishes-listen.md | 6 + common/api-review/util.api.md | 5 + config/karma.base.js | 1 + packages/firestore/package.json | 2 + packages/firestore/src/index/index_entry.ts | 121 +++++++++++++++--- .../src/local/indexeddb_index_manager.ts | 65 +++++----- .../firestore/src/local/indexeddb_schema.ts | 12 +- .../src/local/indexeddb_schema_converter.ts | 18 +++ .../src/local/indexeddb_sentinels.ts | 22 +++- packages/util/src/environment.ts | 11 ++ 10 files changed, 204 insertions(+), 59 deletions(-) create mode 100644 .changeset/eighty-starfishes-listen.md diff --git a/.changeset/eighty-starfishes-listen.md b/.changeset/eighty-starfishes-listen.md new file mode 100644 index 00000000000..4f53b0fb786 --- /dev/null +++ b/.changeset/eighty-starfishes-listen.md @@ -0,0 +1,6 @@ +--- +"@firebase/firestore": patch +"@firebase/util": minor +--- + +Fix Safari/WebKit cache issues when client-side indexing is used. diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 0f8fc13cd3a..427cb5e174a 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -317,6 +317,11 @@ export function isReactNative(): boolean; // @public export function isSafari(): boolean; +// Warning: (ae-missing-release-tag) "isSafariOrWebkit" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function isSafariOrWebkit(): boolean; + // Warning: (ae-missing-release-tag) "issuedAtTime" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/config/karma.base.js b/config/karma.base.js index c49b1246ed6..9d92053115f 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -53,6 +53,7 @@ const config = { // Doing 65 seconds to allow for the 20 second firestore tests browserNoActivityTimeout: 65000, + browserDisconnectTimeout: 65000, // Preprocess matching files before serving them to the browser. // Available preprocessors: diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 38eea5b1505..fdf849b996e 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -36,6 +36,8 @@ "test:browser:emulator": "karma start --targetBackend=emulator", "test:browser:nightly": "karma start --targetBackend=nightly", "test:browser:prod": "karma start --targetBackend=prod", + "test:webkit:prod": "BROWSERS=WebkitHeadless karma start --targetBackend=prod", + "test:webkit:unit": "BROWSERS=WebkitHeadless karma start --unit --targetBackend=prod", "test:browser:prod:nameddb": "karma start --targetBackend=prod --databaseId=test-db", "test:browser:unit": "karma start --unit", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", diff --git a/packages/firestore/src/index/index_entry.ts b/packages/firestore/src/index/index_entry.ts index ee80276f325..c9f3218c65e 100644 --- a/packages/firestore/src/index/index_entry.ts +++ b/packages/firestore/src/index/index_entry.ts @@ -15,15 +15,19 @@ * limitations under the License. */ +import { isSafariOrWebkit } from '@firebase/util'; + +import { DbIndexEntry } from '../local/indexeddb_schema'; +import { DbIndexEntryKey, KeySafeBytes } from '../local/indexeddb_sentinels'; import { DocumentKey } from '../model/document_key'; /** Represents an index entry saved by the SDK in persisted storage. */ export class IndexEntry { constructor( - readonly indexId: number, - readonly documentKey: DocumentKey, - readonly arrayValue: Uint8Array, - readonly directionalValue: Uint8Array + readonly _indexId: number, + readonly _documentKey: DocumentKey, + readonly _arrayValue: Uint8Array, + readonly _directionalValue: Uint8Array ) {} /** @@ -31,49 +35,82 @@ export class IndexEntry { * directional value. */ successor(): IndexEntry { - const currentLength = this.directionalValue.length; + const currentLength = this._directionalValue.length; const newLength = - currentLength === 0 || this.directionalValue[currentLength - 1] === 255 + currentLength === 0 || this._directionalValue[currentLength - 1] === 255 ? currentLength + 1 : currentLength; const successor = new Uint8Array(newLength); - successor.set(this.directionalValue, 0); + successor.set(this._directionalValue, 0); if (newLength !== currentLength) { - successor.set([0], this.directionalValue.length); + successor.set([0], this._directionalValue.length); } else { ++successor[successor.length - 1]; } return new IndexEntry( - this.indexId, - this.documentKey, - this.arrayValue, + this._indexId, + this._documentKey, + this._arrayValue, successor ); } + + // Create a representation of the Index Entry as a DbIndexEntry + dbIndexEntry( + uid: string, + orderedDocumentKey: Uint8Array, + documentKey: DocumentKey + ): DbIndexEntry { + return { + indexId: this._indexId, + uid, + arrayValue: encodeKeySafeBytes(this._arrayValue), + directionalValue: encodeKeySafeBytes(this._directionalValue), + orderedDocumentKey: encodeKeySafeBytes(orderedDocumentKey), + documentKey: documentKey.path.toArray() + }; + } + + // Create a representation of the Index Entry as a DbIndexEntryKey + dbIndexEntryKey( + uid: string, + orderedDocumentKey: Uint8Array, + documentKey: DocumentKey + ): DbIndexEntryKey { + const entry = this.dbIndexEntry(uid, orderedDocumentKey, documentKey); + return [ + entry.indexId, + entry.uid, + entry.arrayValue, + entry.directionalValue, + entry.orderedDocumentKey, + entry.documentKey + ]; + } } export function indexEntryComparator( left: IndexEntry, right: IndexEntry ): number { - let cmp = left.indexId - right.indexId; + let cmp = left._indexId - right._indexId; if (cmp !== 0) { return cmp; } - cmp = compareByteArrays(left.arrayValue, right.arrayValue); + cmp = compareByteArrays(left._arrayValue, right._arrayValue); if (cmp !== 0) { return cmp; } - cmp = compareByteArrays(left.directionalValue, right.directionalValue); + cmp = compareByteArrays(left._directionalValue, right._directionalValue); if (cmp !== 0) { return cmp; } - return DocumentKey.comparator(left.documentKey, right.documentKey); + return DocumentKey.comparator(left._documentKey, right._documentKey); } export function compareByteArrays(left: Uint8Array, right: Uint8Array): number { @@ -85,3 +122,57 @@ export function compareByteArrays(left: Uint8Array, right: Uint8Array): number { } return left.length - right.length; } + +/** + * Workaround for WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=292721 + * Create a key safe representation of Uint8Array values. + * If the browser is detected as Safari or WebKit, then + * the input array will be converted to "sortable byte string". + * Otherwise, the input array will be returned in its original type. + */ +export function encodeKeySafeBytes(array: Uint8Array): KeySafeBytes { + if (isSafariOrWebkit()) { + return encodeUint8ArrayToSortableString(array); + } + return array; +} + +/** + * Reverts the key safe representation of Uint8Array (created by + * encodeKeySafeBytes) to a normal Uint8Array. + */ +export function decodeKeySafeBytes(input: KeySafeBytes): Uint8Array { + if (typeof input !== 'string') { + return input; + } + return decodeSortableStringToUint8Array(input); +} + +/** + * Encodes a Uint8Array into a "sortable byte string". + * A "sortable byte string" sorts in the same order as the Uint8Array. + * This works because JS string comparison sorts strings based on code points. + */ +function encodeUint8ArrayToSortableString(array: Uint8Array): string { + let byteString = ''; + for (let i = 0; i < array.length; i++) { + byteString += String.fromCharCode(array[i]); + } + + return byteString; +} + +/** + * Decodes a "sortable byte string" back into a Uint8Array. + * A "sortable byte string" is assumed to be created where each character's + * Unicode code point directly corresponds to a single byte value (0-255). + */ +function decodeSortableStringToUint8Array(byteString: string): Uint8Array { + const uint8array = new Uint8Array(byteString.length); + + for (let i = 0; i < byteString.length; i++) { + uint8array[i] = byteString.charCodeAt(i); + } + + return uint8array; +} diff --git a/packages/firestore/src/local/indexeddb_index_manager.ts b/packages/firestore/src/local/indexeddb_index_manager.ts index d2b8bc47163..2d707470b2f 100644 --- a/packages/firestore/src/local/indexeddb_index_manager.ts +++ b/packages/firestore/src/local/indexeddb_index_manager.ts @@ -39,7 +39,12 @@ import { } from '../core/target'; import { FirestoreIndexValueWriter } from '../index/firestore_index_value_writer'; import { IndexByteEncoder } from '../index/index_byte_encoder'; -import { IndexEntry, indexEntryComparator } from '../index/index_entry'; +import { + IndexEntry, + indexEntryComparator, + encodeKeySafeBytes, + decodeKeySafeBytes +} from '../index/index_entry'; import { documentKeySet, DocumentMap } from '../model/collections'; import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; @@ -817,14 +822,13 @@ export class IndexedDbIndexManager implements IndexManager { indexEntry: IndexEntry ): PersistencePromise { const indexEntries = indexEntriesStore(transaction); - return indexEntries.put({ - indexId: indexEntry.indexId, - uid: this.uid, - arrayValue: indexEntry.arrayValue, - directionalValue: indexEntry.directionalValue, - orderedDocumentKey: this.encodeDirectionalKey(fieldIndex, document.key), - documentKey: document.key.path.toArray() - }); + return indexEntries.put( + indexEntry.dbIndexEntry( + this.uid, + this.encodeDirectionalKey(fieldIndex, document.key), + document.key + ) + ); } private deleteIndexEntry( @@ -834,14 +838,13 @@ export class IndexedDbIndexManager implements IndexManager { indexEntry: IndexEntry ): PersistencePromise { const indexEntries = indexEntriesStore(transaction); - return indexEntries.delete([ - indexEntry.indexId, - this.uid, - indexEntry.arrayValue, - indexEntry.directionalValue, - this.encodeDirectionalKey(fieldIndex, document.key), - document.key.path.toArray() - ]); + return indexEntries.delete( + indexEntry.dbIndexEntryKey( + this.uid, + this.encodeDirectionalKey(fieldIndex, document.key), + document.key + ) + ); } private getExistingIndexEntries( @@ -858,7 +861,9 @@ export class IndexedDbIndexManager implements IndexManager { range: IDBKeyRange.only([ fieldIndex.indexId, this.uid, - this.encodeDirectionalKey(fieldIndex, documentKey) + encodeKeySafeBytes( + this.encodeDirectionalKey(fieldIndex, documentKey) + ) ]) }, (_, entry) => { @@ -866,8 +871,8 @@ export class IndexedDbIndexManager implements IndexManager { new IndexEntry( fieldIndex.indexId, documentKey, - entry.arrayValue, - entry.directionalValue + decodeKeySafeBytes(entry.arrayValue), + decodeKeySafeBytes(entry.directionalValue) ) ); } @@ -1020,24 +1025,16 @@ export class IndexedDbIndexManager implements IndexManager { return []; } - const lowerBound = [ - bounds[i].indexId, + const lowerBound = bounds[i].dbIndexEntryKey( this.uid, - bounds[i].arrayValue, - bounds[i].directionalValue, EMPTY_VALUE, - [] - ] as DbIndexEntryKey; - - const upperBound = [ - bounds[i + 1].indexId, + DocumentKey.empty() + ); + const upperBound = bounds[i + 1].dbIndexEntryKey( this.uid, - bounds[i + 1].arrayValue, - bounds[i + 1].directionalValue, EMPTY_VALUE, - [] - ] as DbIndexEntryKey; - + DocumentKey.empty() + ); ranges.push(IDBKeyRange.bound(lowerBound, upperBound)); } return ranges; diff --git a/packages/firestore/src/local/indexeddb_schema.ts b/packages/firestore/src/local/indexeddb_schema.ts index 0395756ab96..b8b6c1111d8 100644 --- a/packages/firestore/src/local/indexeddb_schema.ts +++ b/packages/firestore/src/local/indexeddb_schema.ts @@ -26,7 +26,7 @@ import { } from '../protos/firestore_proto_api'; import { EncodedResourcePath } from './encoded_resource_path'; -import { DbTimestampKey } from './indexeddb_sentinels'; +import { DbTimestampKey, KeySafeBytes } from './indexeddb_sentinels'; /** * Schema Version for the Web client: @@ -52,9 +52,11 @@ import { DbTimestampKey } from './indexeddb_sentinels'; * 14. Add overlays. * 15. Add indexing support. * 16. Parse timestamp strings before creating index entries. + * 17. TODO(tomandersen) + * 18. Encode key safe representations of IndexEntry in DbIndexEntryStore. */ -export const SCHEMA_VERSION = 17; +export const SCHEMA_VERSION = 18; /** * Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects. @@ -507,14 +509,14 @@ export interface DbIndexEntry { /** The user id for this entry. */ uid: string; /** The encoded array index value for this entry. */ - arrayValue: Uint8Array; + arrayValue: KeySafeBytes; /** The encoded directional value for equality and inequality filters. */ - directionalValue: Uint8Array; + directionalValue: KeySafeBytes; /** * The document key this entry points to. This entry is encoded by an ordered * encoder to match the key order of the index. */ - orderedDocumentKey: Uint8Array; + orderedDocumentKey: KeySafeBytes; /** The segments of the document key this entry points to. */ documentKey: string[]; } diff --git a/packages/firestore/src/local/indexeddb_schema_converter.ts b/packages/firestore/src/local/indexeddb_schema_converter.ts index 7446ae7ae20..1b84fa4f2c1 100644 --- a/packages/firestore/src/local/indexeddb_schema_converter.ts +++ b/packages/firestore/src/local/indexeddb_schema_converter.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { isSafariOrWebkit } from '@firebase/util'; + import { User } from '../auth/user'; import { ListenSequence } from '../core/listen_sequence'; import { SnapshotVersion } from '../core/snapshot_version'; @@ -277,6 +279,22 @@ export class SchemaConverter implements SimpleDbSchemaConverter { }); } + if (fromVersion < 18 && toVersion >= 18) { + // Clear the IndexEntryStores on WebKit and Safari to remove possibly + // corrupted index entries + if (isSafariOrWebkit()) { + p = p + .next(() => { + const indexStateStore = txn.objectStore(DbIndexStateStore); + indexStateStore.clear(); + }) + .next(() => { + const indexEntryStore = txn.objectStore(DbIndexEntryStore); + indexEntryStore.clear(); + }); + } + } + return p; } diff --git a/packages/firestore/src/local/indexeddb_sentinels.ts b/packages/firestore/src/local/indexeddb_sentinels.ts index cb6ebcb664a..0b4f5ed8918 100644 --- a/packages/firestore/src/local/indexeddb_sentinels.ts +++ b/packages/firestore/src/local/indexeddb_sentinels.ts @@ -305,6 +305,15 @@ export const DbIndexStateSequenceNumberIndex = 'sequenceNumberIndex'; export const DbIndexStateSequenceNumberIndexPath = ['uid', 'sequenceNumber']; +/** + * Representation of a byte array that is safe for + * use in an IndexedDb key. The value is either + * a "sortable byte string", which is key safe in + * Safari/WebKit, or the value is a Uint8Array, + * which is key safe in other browsers. + */ +export type KeySafeBytes = Uint8Array | string; + /** * The key for each index entry consists of the index id and its user id, * the encoded array and directional value for the indexed fields as well as @@ -313,9 +322,9 @@ export const DbIndexStateSequenceNumberIndexPath = ['uid', 'sequenceNumber']; export type DbIndexEntryKey = [ number, string, - Uint8Array, - Uint8Array, - Uint8Array, + KeySafeBytes, + KeySafeBytes, + KeySafeBytes, string[] ]; @@ -425,6 +434,7 @@ export const V15_STORES = [ ]; export const V16_STORES = V15_STORES; export const V17_STORES = [...V15_STORES, DbGlobalsStore]; +export const V18_STORES = V17_STORES; /** * The list of all default IndexedDB stores used throughout the SDK. This is @@ -435,7 +445,9 @@ export const ALL_STORES = V12_STORES; /** Returns the object stores for the provided schema. */ export function getObjectStores(schemaVersion: number): string[] { - if (schemaVersion === 17) { + if (schemaVersion === 18) { + return V18_STORES; + } else if (schemaVersion === 17) { return V17_STORES; } else if (schemaVersion === 16) { return V16_STORES; @@ -450,6 +462,6 @@ export function getObjectStores(schemaVersion: number): string[] { } else if (schemaVersion === 11) { return V11_STORES; } else { - fail(0xeb55, 'Only schema version 11 and 12 and 13 are supported'); + fail(0xeb55, 'Only schema versions >11 are supported'); } } diff --git a/packages/util/src/environment.ts b/packages/util/src/environment.ts index a0467b08c59..85410494241 100644 --- a/packages/util/src/environment.ts +++ b/packages/util/src/environment.ts @@ -173,6 +173,17 @@ export function isSafari(): boolean { ); } +/** Returns true if we are running in Safari or WebKit */ +export function isSafariOrWebkit(): boolean { + return ( + !isNode() && + !!navigator.userAgent && + (navigator.userAgent.includes('Safari') || + navigator.userAgent.includes('WebKit')) && + !navigator.userAgent.includes('Chrome') + ); +} + /** * This method checks if indexedDB is supported by current browser/service worker context * @return true if indexedDB is supported by current browser/service worker context From 6be75f74dec92d1b84f77f79ccb770a3e23280b7 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 12 May 2025 09:42:19 -0700 Subject: [PATCH 187/295] Restore #8999 (#9010) * Revert "Roll back #8999 (#9007)" This reverts commit 51e7b489d8aadd531453f882421903da8727b19d. * Changeset --- .changeset/ninety-ways-dress.md | 8 ++ docs-devsite/app.firebaseappsettings.md | 4 +- packages/app-check/src/api.test.ts | 73 ++++++++++++++++++- packages/app-check/src/api.ts | 20 +++-- .../app-compat/test/firebaseAppCompat.test.ts | 8 +- packages/app/src/api.test.ts | 19 +++-- packages/app/src/api.ts | 4 +- packages/app/src/firebaseApp.test.ts | 4 +- packages/app/src/firebaseServerApp.ts | 2 +- packages/app/src/public-types.ts | 2 +- 10 files changed, 116 insertions(+), 28 deletions(-) create mode 100644 .changeset/ninety-ways-dress.md diff --git a/.changeset/ninety-ways-dress.md b/.changeset/ninety-ways-dress.md new file mode 100644 index 00000000000..82c9e15cf4d --- /dev/null +++ b/.changeset/ninety-ways-dress.md @@ -0,0 +1,8 @@ +--- +'@firebase/app-compat': minor +'@firebase/app-check': minor +'@firebase/app': minor +'firebase': minor +--- + +Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. diff --git a/docs-devsite/app.firebaseappsettings.md b/docs-devsite/app.firebaseappsettings.md index 1515e21ac93..e7838ab4185 100644 --- a/docs-devsite/app.firebaseappsettings.md +++ b/docs-devsite/app.firebaseappsettings.md @@ -22,12 +22,12 @@ export interface FirebaseAppSettings | Property | Type | Description | | --- | --- | --- | -| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out | +| [automaticDataCollectionEnabled](./app.firebaseappsettings.md#firebaseappsettingsautomaticdatacollectionenabled) | boolean | The settable config flag for GDPR opt-in/opt-out. Defaults to true. | | [name](./app.firebaseappsettings.md#firebaseappsettingsname) | string | custom name for the Firebase App. The default value is "[DEFAULT]". | ## FirebaseAppSettings.automaticDataCollectionEnabled -The settable config flag for GDPR opt-in/opt-out +The settable config flag for GDPR opt-in/opt-out. Defaults to true. Signature: diff --git a/packages/app-check/src/api.test.ts b/packages/app-check/src/api.test.ts index a6805d1b0b3..b71971e9d70 100644 --- a/packages/app-check/src/api.test.ts +++ b/packages/app-check/src/api.test.ts @@ -239,7 +239,7 @@ describe('api', () => { expect(getStateReference(app).activated).to.equal(true); }); - it('isTokenAutoRefreshEnabled value defaults to global setting', () => { + it('global false + local unset = false', () => { app.automaticDataCollectionEnabled = false; initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) @@ -247,8 +247,77 @@ describe('api', () => { expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); }); - it('sets isTokenAutoRefreshEnabled correctly, overriding global setting', () => { + it('global false + local true = false', () => { app.automaticDataCollectionEnabled = false; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global false + local false = false', () => { + app.automaticDataCollectionEnabled = false; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local unset = false', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local false = false', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global unset + local true = true', () => { + // Global unset should default to true. + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); + }); + + it('global true + local unset = false', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global true + local false = false', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: false + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(false); + }); + + it('global true + local true = true', () => { + app.automaticDataCollectionEnabled = true; + initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), + isTokenAutoRefreshEnabled: true + }); + expect(getStateReference(app).isTokenAutoRefreshEnabled).to.equal(true); + }); + + it('sets isTokenAutoRefreshEnabled correctly, overriding global setting', () => { initializeAppCheck(app, { provider: new ReCaptchaV3Provider(FAKE_SITE_KEY), isTokenAutoRefreshEnabled: true diff --git a/packages/app-check/src/api.ts b/packages/app-check/src/api.ts index a4dd87a4e77..e7c9f8cfcf9 100644 --- a/packages/app-check/src/api.ts +++ b/packages/app-check/src/api.ts @@ -43,6 +43,7 @@ import { } from './internal-api'; import { readTokenFromStorage } from './storage'; import { getDebugToken, initializeDebugMode, isDebugMode } from './debug'; +import { logger } from './logger'; declare module '@firebase/component' { interface NameServiceMapping { @@ -132,7 +133,7 @@ export function initializeAppCheck( function _activate( app: FirebaseApp, provider: AppCheckProvider, - isTokenAutoRefreshEnabled?: boolean + isTokenAutoRefreshEnabled: boolean = false ): void { // Create an entry in the APP_CHECK_STATES map. Further changes should // directly mutate this object. @@ -149,13 +150,18 @@ function _activate( return cachedToken; }); - // Use value of global `automaticDataCollectionEnabled` (which - // itself defaults to false if not specified in config) if - // `isTokenAutoRefreshEnabled` param was not provided by user. + // Global `automaticDataCollectionEnabled` (defaults to true) and + // `isTokenAutoRefreshEnabled` must both be true. state.isTokenAutoRefreshEnabled = - isTokenAutoRefreshEnabled === undefined - ? app.automaticDataCollectionEnabled - : isTokenAutoRefreshEnabled; + isTokenAutoRefreshEnabled && app.automaticDataCollectionEnabled; + + if (!app.automaticDataCollectionEnabled && isTokenAutoRefreshEnabled) { + logger.warn( + '`isTokenAutoRefreshEnabled` is true but ' + + '`automaticDataCollectionEnabled` was set to false during' + + ' `initializeApp()`. This blocks automatic token refresh.' + ); + } state.provider.initialize(app); } diff --git a/packages/app-compat/test/firebaseAppCompat.test.ts b/packages/app-compat/test/firebaseAppCompat.test.ts index f12a73e61a8..61bbed848d8 100644 --- a/packages/app-compat/test/firebaseAppCompat.test.ts +++ b/packages/app-compat/test/firebaseAppCompat.test.ts @@ -403,17 +403,17 @@ function firebaseAppTests( ).throws(/'abc'.*exists/i); }); - it('automaticDataCollectionEnabled is `false` by default', () => { + it('automaticDataCollectionEnabled is `true` by default', () => { const app = firebase.initializeApp({}, 'my-app'); - expect(app.automaticDataCollectionEnabled).to.eq(false); + expect(app.automaticDataCollectionEnabled).to.eq(true); }); it('automaticDataCollectionEnabled can be set via the config object', () => { const app = firebase.initializeApp( {}, - { automaticDataCollectionEnabled: true } + { automaticDataCollectionEnabled: false } ); - expect(app.automaticDataCollectionEnabled).to.eq(true); + expect(app.automaticDataCollectionEnabled).to.eq(false); }); it('Modifying options object does not change options.', () => { diff --git a/packages/app/src/api.test.ts b/packages/app/src/api.test.ts index f6cf922ba05..4e79ad58d82 100644 --- a/packages/app/src/api.test.ts +++ b/packages/app/src/api.test.ts @@ -128,14 +128,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { automaticDataCollectionEnabled: true } + { automaticDataCollectionEnabled: false } ); expect(() => initializeApp( { apiKey: 'test1' }, - { automaticDataCollectionEnabled: false } + { automaticDataCollectionEnabled: true } ) ).throws(/\[DEFAULT\].*exists/i); }); @@ -146,14 +146,14 @@ describe('API tests', () => { { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: true } + { name: appName, automaticDataCollectionEnabled: false } ); expect(() => initializeApp( { apiKey: 'test1' }, - { name: appName, automaticDataCollectionEnabled: false } + { name: appName, automaticDataCollectionEnabled: true } ) ).throws(/'MyApp'.*exists/i); }); @@ -164,11 +164,16 @@ describe('API tests', () => { expect(app.name).to.equal(appName); }); - it('sets automaticDataCollectionEnabled', () => { - const app = initializeApp({}, { automaticDataCollectionEnabled: true }); + it('sets automaticDataCollectionEnabled to true by default', () => { + const app = initializeApp({}); expect(app.automaticDataCollectionEnabled).to.be.true; }); + it('sets a new automaticDataCollectionEnabled value if provided', () => { + const app = initializeApp({}, { automaticDataCollectionEnabled: false }); + expect(app.automaticDataCollectionEnabled).to.be.false; + }); + it('adds registered components to App', () => { _clearComponents(); const comp1 = createTestComponent('test1'); @@ -211,7 +216,7 @@ describe('API tests', () => { const app = initializeServerApp(options, serverAppSettings); expect(app).to.not.equal(null); - expect(app.automaticDataCollectionEnabled).to.be.false; + expect(app.automaticDataCollectionEnabled).to.be.true; await deleteApp(app); expect((app as FirebaseServerAppImpl).isDeleted).to.be.true; }); diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index b8ec25fc509..9cba8ec6f50 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -143,7 +143,7 @@ export function initializeApp( const config: Required = { name: DEFAULT_ENTRY_NAME, - automaticDataCollectionEnabled: false, + automaticDataCollectionEnabled: true, ...rawConfig }; const name = config.name; @@ -241,7 +241,7 @@ export function initializeServerApp( } if (_serverAppConfig.automaticDataCollectionEnabled === undefined) { - _serverAppConfig.automaticDataCollectionEnabled = false; + _serverAppConfig.automaticDataCollectionEnabled = true; } let appOptions: FirebaseOptions; diff --git a/packages/app/src/firebaseApp.test.ts b/packages/app/src/firebaseApp.test.ts index 419eeef4f1f..3acbb4a2869 100644 --- a/packages/app/src/firebaseApp.test.ts +++ b/packages/app/src/firebaseApp.test.ts @@ -27,11 +27,11 @@ describe('FirebaseAppNext', () => { }; const app = new FirebaseAppImpl( options, - { name: 'test', automaticDataCollectionEnabled: false }, + { name: 'test', automaticDataCollectionEnabled: true }, new ComponentContainer('test') ); - expect(app.automaticDataCollectionEnabled).to.be.false; + expect(app.automaticDataCollectionEnabled).to.be.true; expect(app.name).to.equal('test'); expect(app.options).to.deep.equal(options); }); diff --git a/packages/app/src/firebaseServerApp.ts b/packages/app/src/firebaseServerApp.ts index 21232869c3c..2bb8efc7a63 100644 --- a/packages/app/src/firebaseServerApp.ts +++ b/packages/app/src/firebaseServerApp.ts @@ -74,7 +74,7 @@ export class FirebaseServerAppImpl const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined ? serverConfig.automaticDataCollectionEnabled - : false; + : true; // Create the FirebaseAppSettings object for the FirebaseAppImp constructor. const config: Required = { diff --git a/packages/app/src/public-types.ts b/packages/app/src/public-types.ts index ea68579a7e9..4f8373f2250 100644 --- a/packages/app/src/public-types.ts +++ b/packages/app/src/public-types.ts @@ -165,7 +165,7 @@ export interface FirebaseAppSettings { */ name?: string; /** - * The settable config flag for GDPR opt-in/opt-out + * The settable config flag for GDPR opt-in/opt-out. Defaults to true. */ automaticDataCollectionEnabled?: boolean; } From d5082f9f2fc4de98a6bfd1c6a5af4571af4d0bc6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 12 May 2025 15:43:44 -0400 Subject: [PATCH 188/295] feat(ai): Migrate to `AI` and add GoogleAI support (#8931) --- .changeset/tall-zoos-stare.md | 6 + common/api-review/vertexai.api.md | 197 ++++++--- docs-devsite/_toc.yaml | 20 +- docs-devsite/index.md | 2 +- docs-devsite/vertexai.ai.md | 64 +++ ...i.vertexaierror.md => vertexai.aierror.md} | 26 +- docs-devsite/vertexai.aimodel.md | 39 ++ docs-devsite/vertexai.aioptions.md | 35 ++ docs-devsite/vertexai.backend.md | 57 +++ docs-devsite/vertexai.citation.md | 12 +- docs-devsite/vertexai.counttokensresponse.md | 4 +- docs-devsite/vertexai.generativemodel.md | 10 +- docs-devsite/vertexai.googleaibackend.md | 38 ++ .../vertexai.imagengenerationconfig.md | 8 +- docs-devsite/vertexai.imagenmodel.md | 12 +- docs-devsite/vertexai.md | 225 +++++++--- docs-devsite/vertexai.modelparams.md | 2 +- docs-devsite/vertexai.promptfeedback.md | 6 +- docs-devsite/vertexai.requestoptions.md | 2 +- docs-devsite/vertexai.safetyrating.md | 18 +- docs-devsite/vertexai.safetysetting.md | 6 +- docs-devsite/vertexai.schemashared.md | 4 +- docs-devsite/vertexai.vertexai.md | 44 -- docs-devsite/vertexai.vertexaibackend.md | 60 +++ docs-devsite/vertexai.vertexaimodel.md | 66 --- docs-devsite/vertexai.vertexaioptions.md | 2 +- packages/firebase/ai/index.ts | 18 + packages/firebase/ai/package.json | 7 + packages/firebase/package.json | 13 + packages/vertexai/src/api.test.ts | 123 +++--- packages/vertexai/src/api.ts | 117 ++++-- packages/vertexai/src/backend.test.ts | 52 +++ packages/vertexai/src/backend.ts | 92 +++++ .../src/backwards-compatbility.test.ts | 85 ++++ packages/vertexai/src/constants.ts | 3 + packages/vertexai/src/errors.ts | 25 +- .../vertexai/src/googleai-mappers.test.ts | 391 ++++++++++++++++++ packages/vertexai/src/googleai-mappers.ts | 227 ++++++++++ packages/vertexai/src/helpers.test.ts | 121 ++++++ packages/vertexai/src/helpers.ts | 74 ++++ packages/vertexai/src/index.node.ts | 28 +- packages/vertexai/src/index.ts | 30 +- .../src/methods/chat-session-helpers.ts | 34 +- .../vertexai/src/methods/chat-session.test.ts | 4 +- .../vertexai/src/methods/count-tokens.test.ts | 41 +- packages/vertexai/src/methods/count-tokens.ts | 11 +- .../src/methods/generate-content.test.ts | 96 ++++- .../vertexai/src/methods/generate-content.ts | 31 +- ...ertexai-model.test.ts => ai-model.test.ts} | 51 +-- .../models/{vertexai-model.ts => ai-model.ts} | 102 +++-- .../src/models/generative-model.test.ts | 49 ++- .../vertexai/src/models/generative-model.ts | 10 +- .../vertexai/src/models/imagen-model.test.ts | 22 +- packages/vertexai/src/models/imagen-model.ts | 14 +- packages/vertexai/src/models/index.ts | 2 +- packages/vertexai/src/public-types.ts | 85 +++- .../vertexai/src/requests/request-helpers.ts | 17 +- .../vertexai/src/requests/request.test.ts | 74 ++-- packages/vertexai/src/requests/request.ts | 74 ++-- .../vertexai/src/requests/response-helpers.ts | 38 +- .../src/requests/schema-builder.test.ts | 4 +- .../vertexai/src/requests/schema-builder.ts | 8 +- .../src/requests/stream-reader.test.ts | 44 +- .../vertexai/src/requests/stream-reader.ts | 59 ++- packages/vertexai/src/service.test.ts | 18 +- packages/vertexai/src/service.ts | 19 +- packages/vertexai/src/types/enums.ts | 13 +- packages/vertexai/src/types/error.ts | 9 +- packages/vertexai/src/types/googleai.ts | 70 ++++ .../vertexai/src/types/imagen/requests.ts | 6 + packages/vertexai/src/types/index.ts | 1 + packages/vertexai/src/types/internal.ts | 7 +- packages/vertexai/src/types/requests.ts | 7 + packages/vertexai/src/types/responses.ts | 36 ++ packages/vertexai/src/types/schema.ts | 5 +- scripts/update_vertexai_responses.sh | 2 +- 76 files changed, 2765 insertions(+), 669 deletions(-) create mode 100644 .changeset/tall-zoos-stare.md create mode 100644 docs-devsite/vertexai.ai.md rename docs-devsite/{vertexai.vertexaierror.md => vertexai.aierror.md} (50%) create mode 100644 docs-devsite/vertexai.aimodel.md create mode 100644 docs-devsite/vertexai.aioptions.md create mode 100644 docs-devsite/vertexai.backend.md create mode 100644 docs-devsite/vertexai.googleaibackend.md delete mode 100644 docs-devsite/vertexai.vertexai.md create mode 100644 docs-devsite/vertexai.vertexaibackend.md delete mode 100644 docs-devsite/vertexai.vertexaimodel.md create mode 100644 packages/firebase/ai/index.ts create mode 100644 packages/firebase/ai/package.json create mode 100644 packages/vertexai/src/backend.test.ts create mode 100644 packages/vertexai/src/backend.ts create mode 100644 packages/vertexai/src/backwards-compatbility.test.ts create mode 100644 packages/vertexai/src/googleai-mappers.test.ts create mode 100644 packages/vertexai/src/googleai-mappers.ts create mode 100644 packages/vertexai/src/helpers.test.ts create mode 100644 packages/vertexai/src/helpers.ts rename packages/vertexai/src/models/{vertexai-model.test.ts => ai-model.test.ts} (66%) rename packages/vertexai/src/models/{vertexai-model.ts => ai-model.ts} (55%) create mode 100644 packages/vertexai/src/types/googleai.ts diff --git a/.changeset/tall-zoos-stare.md b/.changeset/tall-zoos-stare.md new file mode 100644 index 00000000000..2711107986c --- /dev/null +++ b/.changeset/tall-zoos-stare.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/vertexai': minor +--- + +Add support for the Gemini Developer API, enabling usage in a free tier, and add new `AI` API to accomodate new product naming. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index f9cf3dac5bd..42da114f9e9 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -9,6 +9,62 @@ import { FirebaseApp } from '@firebase/app'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; import { FirebaseError } from '@firebase/util'; +// @public +export interface AI { + app: FirebaseApp; + backend: Backend; + // @deprecated + location: string; +} + +// @public +export class AIError extends FirebaseError { + constructor(code: AIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); + // (undocumented) + readonly code: AIErrorCode; + // (undocumented) + readonly customErrorData?: CustomErrorData | undefined; +} + +// @public +const enum AIErrorCode { + API_NOT_ENABLED = "api-not-enabled", + ERROR = "error", + FETCH_ERROR = "fetch-error", + INVALID_CONTENT = "invalid-content", + INVALID_SCHEMA = "invalid-schema", + NO_API_KEY = "no-api-key", + NO_APP_ID = "no-app-id", + NO_MODEL = "no-model", + NO_PROJECT_ID = "no-project-id", + PARSE_FAILED = "parse-failed", + REQUEST_ERROR = "request-error", + RESPONSE_ERROR = "response-error", + UNSUPPORTED = "unsupported" +} + +export { AIErrorCode } + +export { AIErrorCode as VertexAIErrorCode } + +// @public +export abstract class AIModel { + // @internal + protected constructor(ai: AI, modelName: string); + // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts + // + // @internal (undocumented) + protected _apiSettings: ApiSettings; + readonly model: string; + // @internal + static normalizeModelName(modelName: string, backendType: BackendType): string; + } + +// @public +export interface AIOptions { + backend: Backend; +} + // @public export class ArraySchema extends Schema { constructor(schemaParams: SchemaParams, items: TypedSchema); @@ -18,6 +74,21 @@ export class ArraySchema extends Schema { toJSON(): SchemaRequest; } +// @public +export abstract class Backend { + protected constructor(type: BackendType); + readonly backendType: BackendType; +} + +// @public +export const BackendType: { + readonly VERTEX_AI: "VERTEX_AI"; + readonly GOOGLE_AI: "GOOGLE_AI"; +}; + +// @public +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; + // @public export interface BaseParams { // (undocumented) @@ -41,7 +112,6 @@ export class BooleanSchema extends Schema { // @public export class ChatSession { - // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); getHistory(): Promise; // (undocumented) @@ -60,11 +130,9 @@ export interface Citation { endIndex?: number; // (undocumented) license?: string; - // (undocumented) publicationDate?: Date_2; // (undocumented) startIndex?: number; - // (undocumented) title?: string; // (undocumented) uri?: string; @@ -326,8 +394,8 @@ export interface GenerativeContentBlob { } // @public -export class GenerativeModel extends VertexAIModel { - constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +export class GenerativeModel extends AIModel { + constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); countTokens(request: CountTokensRequest | string | Array): Promise; generateContent(request: GenerateContentRequest | string | Array): Promise; generateContentStream(request: GenerateContentRequest | string | Array): Promise; @@ -347,14 +415,76 @@ export class GenerativeModel extends VertexAIModel { } // @public -export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +export function getAI(app?: FirebaseApp, options?: AIOptions): AI; + +// @public +export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; // @beta -export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; +export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; // @public export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +// @public +export class GoogleAIBackend extends Backend { + constructor(); +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAICitationMetadata" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAICitationMetadata { + // (undocumented) + citationSources: Citation[]; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAICountTokensRequest" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAICountTokensRequest { + // (undocumented) + generateContentRequest: { + model: string; + contents: Content[]; + systemInstruction?: string | Part | Content; + tools?: Tool[]; + generationConfig?: GenerationConfig; + }; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentCandidate" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAIGenerateContentCandidate { + // (undocumented) + citationMetadata?: GoogleAICitationMetadata; + // (undocumented) + content: Content; + // (undocumented) + finishMessage?: string; + // (undocumented) + finishReason?: FinishReason; + // (undocumented) + groundingMetadata?: GroundingMetadata; + // (undocumented) + index: number; + // (undocumented) + safetyRatings?: SafetyRating[]; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentResponse" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAIGenerateContentResponse { + // (undocumented) + candidates?: GoogleAIGenerateContentCandidate[]; + // (undocumented) + promptFeedback?: PromptFeedback; + // (undocumented) + usageMetadata?: UsageMetadata; +} + // @public @deprecated (undocumented) export interface GroundingAttribution { // (undocumented) @@ -377,7 +507,7 @@ export interface GroundingMetadata { webSearchQueries?: string[]; } -// @public (undocumented) +// @public export enum HarmBlockMethod { PROBABILITY = "PROBABILITY", SEVERITY = "SEVERITY" @@ -416,7 +546,8 @@ export enum HarmSeverity { HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", - HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE" + HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", + HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED" } // @beta @@ -464,8 +595,8 @@ export interface ImagenInlineImage { } // @beta -export class ImagenModel extends VertexAIModel { - constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); +export class ImagenModel extends AIModel { + constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); generateImages(prompt: string): Promise>; // @internal generateImagesGCS(prompt: string, gcsURI: string): Promise>; @@ -587,7 +718,6 @@ export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; export interface PromptFeedback { // (undocumented) blockReason?: BlockReason; - // (undocumented) blockReasonMessage?: string; // (undocumented) safetyRatings: SafetyRating[]; @@ -627,11 +757,8 @@ export interface SafetyRating { category: HarmCategory; // (undocumented) probability: HarmProbability; - // (undocumented) probabilityScore: number; - // (undocumented) severity: HarmSeverity; - // (undocumented) severityScore: number; } @@ -639,7 +766,6 @@ export interface SafetyRating { export interface SafetySetting { // (undocumented) category: HarmCategory; - // (undocumented) method?: HarmBlockMethod; // (undocumented) threshold: HarmBlockThreshold; @@ -791,46 +917,19 @@ export interface UsageMetadata { } // @public -export interface VertexAI { - app: FirebaseApp; - // (undocumented) - location: string; -} +export type VertexAI = AI; // @public -export class VertexAIError extends FirebaseError { - constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); - // (undocumented) - readonly code: VertexAIErrorCode; - // (undocumented) - readonly customErrorData?: CustomErrorData | undefined; +export class VertexAIBackend extends Backend { + constructor(location?: string); + readonly location: string; } // @public -export const enum VertexAIErrorCode { - API_NOT_ENABLED = "api-not-enabled", - ERROR = "error", - FETCH_ERROR = "fetch-error", - INVALID_CONTENT = "invalid-content", - INVALID_SCHEMA = "invalid-schema", - NO_API_KEY = "no-api-key", - NO_APP_ID = "no-app-id", - NO_MODEL = "no-model", - NO_PROJECT_ID = "no-project-id", - PARSE_FAILED = "parse-failed", - REQUEST_ERROR = "request-error", - RESPONSE_ERROR = "response-error" -} +export const VertexAIError: typeof AIError; // @public -export abstract class VertexAIModel { - // @internal - protected constructor(vertexAI: VertexAI, modelName: string); - // @internal (undocumented) - protected _apiSettings: ApiSettings; - readonly model: string; - static normalizeModelName(modelName: string): string; -} +export const VertexAIModel: typeof AIModel; // @public export interface VertexAIOptions { diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 665222edb9d..c507b44ce99 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -472,8 +472,18 @@ toc: - title: vertexai path: /docs/reference/js/vertexai.md section: + - title: AI + path: /docs/reference/js/vertexai.ai.md + - title: AIError + path: /docs/reference/js/vertexai.aierror.md + - title: AIModel + path: /docs/reference/js/vertexai.aimodel.md + - title: AIOptions + path: /docs/reference/js/vertexai.aioptions.md - title: ArraySchema path: /docs/reference/js/vertexai.arrayschema.md + - title: Backend + path: /docs/reference/js/vertexai.backend.md - title: BaseParams path: /docs/reference/js/vertexai.baseparams.md - title: BooleanSchema @@ -532,6 +542,8 @@ toc: path: /docs/reference/js/vertexai.generativecontentblob.md - title: GenerativeModel path: /docs/reference/js/vertexai.generativemodel.md + - title: GoogleAIBackend + path: /docs/reference/js/vertexai.googleaibackend.md - title: GroundingAttribution path: /docs/reference/js/vertexai.groundingattribution.md - title: GroundingMetadata @@ -598,12 +610,8 @@ toc: path: /docs/reference/js/vertexai.toolconfig.md - title: UsageMetadata path: /docs/reference/js/vertexai.usagemetadata.md - - title: VertexAI - path: /docs/reference/js/vertexai.vertexai.md - - title: VertexAIError - path: /docs/reference/js/vertexai.vertexaierror.md - - title: VertexAIModel - path: /docs/reference/js/vertexai.vertexaimodel.md + - title: VertexAIBackend + path: /docs/reference/js/vertexai.vertexaibackend.md - title: VertexAIOptions path: /docs/reference/js/vertexai.vertexaioptions.md - title: VideoMetadata diff --git a/docs-devsite/index.md b/docs-devsite/index.md index 82fdb36f076..af34d0d0250 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -27,5 +27,5 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Vertex AI in Firebase Web SDK. | +| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Firebase AI Web SDK. | diff --git a/docs-devsite/vertexai.ai.md b/docs-devsite/vertexai.ai.md new file mode 100644 index 00000000000..661bf0b4fe3 --- /dev/null +++ b/docs-devsite/vertexai.ai.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AI interface +An instance of the Firebase AI SDK. + +Do not create this instance directly. Instead, use [getAI()](./vertexai.md#getai_a94a413). + +Signature: + +```typescript +export interface AI +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [app](./vertexai.ai.md#aiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./vertexai.ai.md#ai_interface) instance is associated with. | +| [backend](./vertexai.ai.md#aibackend) | [Backend](./vertexai.backend.md#backend_class) | A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | +| [location](./vertexai.ai.md#ailocation) | string | The location configured for this AI service instance, relevant for Vertex AI backends. | + +## AI.app + +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./vertexai.ai.md#ai_interface) instance is associated with. + +Signature: + +```typescript +app: FirebaseApp; +``` + +## AI.backend + +A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). + +Signature: + +```typescript +backend: Backend; +``` + +## AI.location + +> Warning: This API is now obsolete. +> +> use `AI.backend.location` instead. +> + +The location configured for this AI service instance, relevant for Vertex AI backends. + +Signature: + +```typescript +location: string; +``` diff --git a/docs-devsite/vertexai.vertexaierror.md b/docs-devsite/vertexai.aierror.md similarity index 50% rename from docs-devsite/vertexai.vertexaierror.md rename to docs-devsite/vertexai.aierror.md index 31f527e59b3..dac50815b6a 100644 --- a/docs-devsite/vertexai.vertexaierror.md +++ b/docs-devsite/vertexai.aierror.md @@ -9,13 +9,13 @@ overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %} -# VertexAIError class -Error class for the Vertex AI in Firebase SDK. +# AIError class +Error class for the Firebase AI SDK. Signature: ```typescript -export declare class VertexAIError extends FirebaseError +export declare class AIError extends FirebaseError ``` Extends: [FirebaseError](./util.firebaseerror.md#firebaseerror_class) @@ -23,42 +23,42 @@ export declare class VertexAIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | +| [(constructor)(code, message, customErrorData)](./vertexai.aierror.md#aierrorconstructor) | | Constructs a new instance of the AIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | | -| [customErrorData](./vertexai.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | +| [code](./vertexai.aierror.md#aierrorcode) | | [AIErrorCode](./vertexai.md#aierrorcode) | | +| [customErrorData](./vertexai.aierror.md#aierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | -## VertexAIError.(constructor) +## AIError.(constructor) -Constructs a new instance of the `VertexAIError` class. +Constructs a new instance of the `AIError` class. Signature: ```typescript -constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); +constructor(code: AIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | +| code | [AIErrorCode](./vertexai.md#aierrorcode) | The error code from [AIErrorCode](./vertexai.md#aierrorcode). | | message | string | A human-readable message describing the error. | | customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | -## VertexAIError.code +## AIError.code Signature: ```typescript -readonly code: VertexAIErrorCode; +readonly code: AIErrorCode; ``` -## VertexAIError.customErrorData +## AIError.customErrorData Signature: diff --git a/docs-devsite/vertexai.aimodel.md b/docs-devsite/vertexai.aimodel.md new file mode 100644 index 00000000000..0ff091a0d03 --- /dev/null +++ b/docs-devsite/vertexai.aimodel.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AIModel class +Base class for Firebase AI model APIs. + +Instances of this class are associated with a specific Firebase AI [Backend](./vertexai.backend.md#backend_class) and provide methods for interacting with the configured generative model. + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AIModel` class. + +Signature: + +```typescript +export declare abstract class AIModel +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai.aimodel.md#aimodelmodel) | | string | The fully qualified model resource name to use for generating images (for example, publishers/google/models/imagen-3.0-generate-002). | + +## AIModel.model + +The fully qualified model resource name to use for generating images (for example, `publishers/google/models/imagen-3.0-generate-002`). + +Signature: + +```typescript +readonly model: string; +``` diff --git a/docs-devsite/vertexai.aioptions.md b/docs-devsite/vertexai.aioptions.md new file mode 100644 index 00000000000..00ff0153527 --- /dev/null +++ b/docs-devsite/vertexai.aioptions.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AIOptions interface +Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). + +Signature: + +```typescript +export interface AIOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [backend](./vertexai.aioptions.md#aioptionsbackend) | [Backend](./vertexai.backend.md#backend_class) | The backend configuration to use for the AI service instance. | + +## AIOptions.backend + +The backend configuration to use for the AI service instance. + +Signature: + +```typescript +backend: Backend; +``` diff --git a/docs-devsite/vertexai.backend.md b/docs-devsite/vertexai.backend.md new file mode 100644 index 00000000000..e6a2606901e --- /dev/null +++ b/docs-devsite/vertexai.backend.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Backend class +Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. + +Signature: + +```typescript +export declare abstract class Backend +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(type)](./vertexai.backend.md#backendconstructor) | | Protected constructor for use by subclasses. | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [backendType](./vertexai.backend.md#backendbackendtype) | | [BackendType](./vertexai.md#backendtype) | Specifies the backend type. | + +## Backend.(constructor) + +Protected constructor for use by subclasses. + +Signature: + +```typescript +protected constructor(type: BackendType); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| type | [BackendType](./vertexai.md#backendtype) | The backend type. | + +## Backend.backendType + +Specifies the backend type. + +Signature: + +```typescript +readonly backendType: BackendType; +``` diff --git a/docs-devsite/vertexai.citation.md b/docs-devsite/vertexai.citation.md index b5f5a19f231..c694f6c2a9c 100644 --- a/docs-devsite/vertexai.citation.md +++ b/docs-devsite/vertexai.citation.md @@ -24,9 +24,9 @@ export interface Citation | --- | --- | --- | | [endIndex](./vertexai.citation.md#citationendindex) | number | | | [license](./vertexai.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | | +| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | The publication date of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | | [startIndex](./vertexai.citation.md#citationstartindex) | number | | -| [title](./vertexai.citation.md#citationtitle) | string | | +| [title](./vertexai.citation.md#citationtitle) | string | The title of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | | [uri](./vertexai.citation.md#citationuri) | string | | ## Citation.endIndex @@ -47,6 +47,10 @@ license?: string; ## Citation.publicationDate +The publication date of the cited source, if available. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). + Signature: ```typescript @@ -63,6 +67,10 @@ startIndex?: number; ## Citation.title +The title of the cited source, if available. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). + Signature: ```typescript diff --git a/docs-devsite/vertexai.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md index d67cc99fab2..b304ccb82a0 100644 --- a/docs-devsite/vertexai.counttokensresponse.md +++ b/docs-devsite/vertexai.counttokensresponse.md @@ -23,7 +23,7 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | | [promptTokensDetails](./vertexai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. | -| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | +| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | | [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.promptTokensDetails @@ -40,6 +40,8 @@ promptTokensDetails?: ModalityTokenCount[]; The total number of billable characters counted across all instances from the request. +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + Signature: ```typescript diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md index e4a238b0af5..ba82b65aceb 100644 --- a/docs-devsite/vertexai.generativemodel.md +++ b/docs-devsite/vertexai.generativemodel.md @@ -15,15 +15,15 @@ Class for generative model APIs. Signature: ```typescript -export declare class GenerativeModel extends VertexAIModel +export declare class GenerativeModel extends AIModel ``` -Extends: [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) +Extends: [AIModel](./vertexai.aimodel.md#aimodel_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | +| [(constructor)(ai, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | ## Properties @@ -52,14 +52,14 @@ Constructs a new instance of the `GenerativeModel` class Signature: ```typescript -constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| ai | [AI](./vertexai.ai.md#ai_interface) | | | modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | | requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | diff --git a/docs-devsite/vertexai.googleaibackend.md b/docs-devsite/vertexai.googleaibackend.md new file mode 100644 index 00000000000..e302a0eba91 --- /dev/null +++ b/docs-devsite/vertexai.googleaibackend.md @@ -0,0 +1,38 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GoogleAIBackend class +Configuration class for the Gemini Developer API. + +Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Gemini Developer API as the backend. + +Signature: + +```typescript +export declare class GoogleAIBackend extends Backend +``` +Extends: [Backend](./vertexai.backend.md#backend_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)()](./vertexai.googleaibackend.md#googleaibackendconstructor) | | Creates a configuration object for the Gemini Developer API backend. | + +## GoogleAIBackend.(constructor) + +Creates a configuration object for the Gemini Developer API backend. + +Signature: + +```typescript +constructor(); +``` diff --git a/docs-devsite/vertexai.imagengenerationconfig.md b/docs-devsite/vertexai.imagengenerationconfig.md index b6785b9b2bb..51a66b147dc 100644 --- a/docs-devsite/vertexai.imagengenerationconfig.md +++ b/docs-devsite/vertexai.imagengenerationconfig.md @@ -27,10 +27,10 @@ export interface ImagenGenerationConfig | Property | Type | Description | | --- | --- | --- | -| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details. | +| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | | [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. | | [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. | -| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. | +| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | | [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | ## ImagenGenerationConfig.addWatermark @@ -44,6 +44,8 @@ If set to `true`, an invisible SynthID watermark is embedded in generate For Imagen 3 models, the default value is `true`; see the addWatermark documentation for more details. +When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. + Signature: ```typescript @@ -89,6 +91,8 @@ Support for negative prompts depends on the Imagen model. See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. +This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) in versions greater than `imagen-3.0-generate-002`. + Signature: ```typescript diff --git a/docs-devsite/vertexai.imagenmodel.md b/docs-devsite/vertexai.imagenmodel.md index ed40dc8f578..e69c49b8572 100644 --- a/docs-devsite/vertexai.imagenmodel.md +++ b/docs-devsite/vertexai.imagenmodel.md @@ -20,15 +20,15 @@ This class provides methods for generating images using the Imagen model. Signature: ```typescript -export declare class ImagenModel extends VertexAIModel +export declare class ImagenModel extends AIModel ``` -Extends: [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) +Extends: [AIModel](./vertexai.aimodel.md#aimodel_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | +| [(constructor)(ai, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | ## Properties @@ -54,14 +54,14 @@ Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenm Signature: ```typescript -constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); +constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| ai | [AI](./vertexai.ai.md#ai_interface) | an [AI](./vertexai.ai.md#ai_interface) instance. | | modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making requests to Imagen. | | requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | Additional options to use when making requests. | @@ -142,7 +142,7 @@ If the request to generate images fails. This happens if the prompt is blocked. ```javascript const imagen = new ImagenModel( - vertexAI, + ai, { model: 'imagen-3.0-generate-002' } diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index 47d45a492ec..7f56e0b373c 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -10,26 +10,31 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # vertexai package -The Vertex AI in Firebase Web SDK. +The Firebase AI Web SDK. ## Functions | Function | Description | | --- | --- | | function(app, ...) | -| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | -| function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | -| [getImagenModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getimagenmodel_812c375) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| [getAI(app, options)](./vertexai.md#getai_a94a413) | Returns the default [AI](./vertexai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | +| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413).Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. | +| function(ai, ...) | +| [getGenerativeModel(ai, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | +| [getImagenModel(ai, modelParams, requestOptions)](./vertexai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | ## Classes | Class | Description | | --- | --- | +| [AIError](./vertexai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. | +| [AIModel](./vertexai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.Instances of this class are associated with a specific Firebase AI [Backend](./vertexai.backend.md#backend_class) and provide methods for interacting with the configured generative model. | | [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | +| [Backend](./vertexai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. | | [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | | [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | | [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Gemini Developer API as the backend. | | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). | | [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | @@ -37,17 +42,17 @@ The Vertex AI in Firebase Web SDK. | [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | | [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | | [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | -| [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | -| [VertexAIModel](./vertexai.vertexaimodel.md#vertexaimodel_class) | Base class for Vertex AI in Firebase model APIs. | +| [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. | ## Enumerations | Enumeration | Description | | --- | --- | +| [AIErrorCode](./vertexai.md#aierrorcode) | Standardized error codes that [AIError](./vertexai.aierror.md#aierror_class) can have. | | [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | | [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | -| [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [HarmBlockMethod](./vertexai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)). | | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | | [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | @@ -57,12 +62,13 @@ The Vertex AI in Firebase Web SDK. | [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [Modality](./vertexai.md#modality) | Content part modality. | | [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | -| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | ## Interfaces | Interface | Description | | --- | --- | +| [AI](./vertexai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./vertexai.md#getai_a94a413). | +| [AIOptions](./vertexai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | | [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | | [Citation](./vertexai.citation.md#citation_interface) | A single citation. | | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | @@ -99,10 +105,10 @@ The Vertex AI in Firebase Web SDK. | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | -| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). | | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). | | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | @@ -115,8 +121,7 @@ The Vertex AI in Firebase Web SDK. | [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | -| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | +| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | @@ -124,24 +129,80 @@ The Vertex AI in Firebase Web SDK. | Variable | Description | | --- | --- | +| [BackendType](./vertexai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.These values are assigned to the backendType property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. | | [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | | [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | +| [VertexAIError](./vertexai.md#vertexaierror) | Error class for the Firebase AI SDK.For more information, refer to the documentation for the new [AIError](./vertexai.aierror.md#aierror_class). | +| [VertexAIModel](./vertexai.md#vertexaimodel) | Base class for Firebase AI model APIs.For more information, refer to the documentation for the new [AIModel](./vertexai.aimodel.md#aimodel_class). | ## Type Aliases | Type Alias | Description | | --- | --- | +| [BackendType](./vertexai.md#backendtype) | Type alias representing valid backend types. It can be either 'VERTEX_AI' or 'GOOGLE_AI'. | | [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [Role](./vertexai.md#role) | Role is the producer of the content. | | [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | | [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | +| [VertexAI](./vertexai.md#vertexai) | An instance of the Firebase AI SDK.For more information, refer to the documentation for the new [AI](./vertexai.ai.md#ai_interface) interface. | ## function(app, ...) +### getAI(app, options) {:#getai_a94a413} + +Returns the default [AI](./vertexai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. + +Signature: + +```typescript +export declare function getAI(app?: FirebaseApp, options?: AIOptions): AI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [AIOptions](./vertexai.aioptions.md#aioptions_interface) | [AIOptions](./vertexai.aioptions.md#aioptions_interface) that configure the AI instance. | + +Returns: + +[AI](./vertexai.ai.md#ai_interface) + +The default [AI](./vertexai.ai.md#ai_interface) instance for the given [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). + +### Example 1 + + +```javascript +const ai = getAI(app); + +``` + +### Example 2 + + +```javascript +// Get an AI instance configured to use the Gemini Developer API (via Google AI). +const ai = getAI(app, { backend: new GoogleAIBackend() }); + +``` + +### Example 3 + + +```javascript +// Get an AI instance configured to use the Vertex AI Gemini API. +const ai = getAI(app, { backend: new VertexAIBackend() }); + +``` + ### getVertexAI(app, options) {:#getvertexai_04094cf} -Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. +It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413). + +Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. Signature: @@ -154,29 +215,29 @@ export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions | Parameter | Type | Description | | --- | --- | --- | | app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | | +| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options to configure the Vertex AI instance, including the location. | Returns: -[VertexAI](./vertexai.vertexai.md#vertexai_interface) +[VertexAI](./vertexai.md#vertexai) -## function(vertexAI, ...) +## function(ai, ...) -### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} +### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839} Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. Signature: ```typescript -export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| ai | [AI](./vertexai.ai.md#ai_interface) | | | modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | | requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | @@ -184,7 +245,7 @@ export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: Mode [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) -### getImagenModel(vertexAI, modelParams, requestOptions) {:#getimagenmodel_812c375} +### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645} > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > @@ -196,14 +257,14 @@ Only Imagen 3 models (named `imagen-3.0-*`) are supported. Signature: ```typescript -export declare function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; +export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; ``` #### Parameters | Parameter | Type | Description | | --- | --- | --- | -| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| ai | [AI](./vertexai.ai.md#ai_interface) | An [AI](./vertexai.ai.md#ai_interface) instance. | | modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. | | requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. | @@ -215,6 +276,21 @@ export declare function getImagenModel(vertexAI: VertexAI, modelParams: ImagenMo If the `apiKey` or `projectId` fields are missing in your Firebase config. +## BackendType + +An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with. + +These values are assigned to the `backendType` property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. + +Signature: + +```typescript +BackendType: { + readonly VERTEX_AI: "VERTEX_AI"; + readonly GOOGLE_AI: "GOOGLE_AI"; +} +``` + ## POSSIBLE\_ROLES Possible roles. @@ -241,6 +317,40 @@ ResponseModality: { } ``` +## VertexAIError + +Error class for the Firebase AI SDK. + +For more information, refer to the documentation for the new [AIError](./vertexai.aierror.md#aierror_class). + +Signature: + +```typescript +VertexAIError: typeof AIError +``` + +## VertexAIModel + +Base class for Firebase AI model APIs. + +For more information, refer to the documentation for the new [AIModel](./vertexai.aimodel.md#aimodel_class). + +Signature: + +```typescript +VertexAIModel: typeof AIModel +``` + +## BackendType + +Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. + +Signature: + +```typescript +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; +``` + ## Part Content part - includes text, image/video, or function call/response part types. @@ -294,6 +404,46 @@ A type that includes all specific Schema types. export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; ``` +## VertexAI + +An instance of the Firebase AI SDK. + +For more information, refer to the documentation for the new [AI](./vertexai.ai.md#ai_interface) interface. + +Signature: + +```typescript +export type VertexAI = AI; +``` + +## AIErrorCode + +Standardized error codes that [AIError](./vertexai.aierror.md#aierror_class) can have. + +Signature: + +```typescript +export declare const enum AIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | +| UNSUPPORTED | "unsupported" | An error occured due an attempt to use an unsupported feature. | + ## BlockReason Reason that a prompt was blocked. @@ -356,6 +506,7 @@ export declare enum FunctionCallingMode ## HarmBlockMethod +This property is not supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)). Signature: @@ -445,6 +596,7 @@ export declare enum HarmSeverity | HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | Low level of harm severity. | | HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | Medium level of harm severity. | | HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | Negligible level of harm severity. | +| HARM\_SEVERITY\_UNSUPPORTED | "HARM_SEVERITY_UNSUPPORTED" | Harm severity is not supported. | ## ImagenAspectRatio @@ -562,30 +714,3 @@ export declare enum SchemaType | OBJECT | "object" | Object type. | | STRING | "string" | String type. | -## VertexAIErrorCode - -Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. - -Signature: - -```typescript -export declare const enum VertexAIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | - diff --git a/docs-devsite/vertexai.modelparams.md b/docs-devsite/vertexai.modelparams.md index d3963d240eb..bb8a87d5fb2 100644 --- a/docs-devsite/vertexai.modelparams.md +++ b/docs-devsite/vertexai.modelparams.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). Signature: diff --git a/docs-devsite/vertexai.promptfeedback.md b/docs-devsite/vertexai.promptfeedback.md index 369ef02051d..08ea4aaf4cf 100644 --- a/docs-devsite/vertexai.promptfeedback.md +++ b/docs-devsite/vertexai.promptfeedback.md @@ -23,7 +23,7 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | | [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | -| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | +| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | A human-readable description of the blockReason.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | | [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason @@ -36,6 +36,10 @@ blockReason?: BlockReason; ## PromptFeedback.blockReasonMessage +A human-readable description of the `blockReason`. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). + Signature: ```typescript diff --git a/docs-devsite/vertexai.requestoptions.md b/docs-devsite/vertexai.requestoptions.md index dcd0c552ecb..3c233d72b90 100644 --- a/docs-devsite/vertexai.requestoptions.md +++ b/docs-devsite/vertexai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). Signature: diff --git a/docs-devsite/vertexai.safetyrating.md b/docs-devsite/vertexai.safetyrating.md index 28493bafef0..ebe5003c662 100644 --- a/docs-devsite/vertexai.safetyrating.md +++ b/docs-devsite/vertexai.safetyrating.md @@ -25,9 +25,9 @@ export interface SafetyRating | [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | | [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | | [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | -| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | | -| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | | -| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | | +| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | The probability score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | +| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | The harm severity level.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to HarmSeverity.UNSUPPORTED. | +| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | The severity score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | ## SafetyRating.blocked @@ -55,6 +55,10 @@ probability: HarmProbability; ## SafetyRating.probabilityScore +The probability score of the harm category. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + Signature: ```typescript @@ -63,6 +67,10 @@ probabilityScore: number; ## SafetyRating.severity +The harm severity level. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to `HarmSeverity.UNSUPPORTED`. + Signature: ```typescript @@ -71,6 +79,10 @@ severity: HarmSeverity; ## SafetyRating.severityScore +The severity score of the harm category. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + Signature: ```typescript diff --git a/docs-devsite/vertexai.safetysetting.md b/docs-devsite/vertexai.safetysetting.md index 17fa1cff839..a91843faaa5 100644 --- a/docs-devsite/vertexai.safetysetting.md +++ b/docs-devsite/vertexai.safetysetting.md @@ -23,7 +23,7 @@ export interface SafetySetting | Property | Type | Description | | --- | --- | --- | | [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | -| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | The harm block method.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), an [AIError](./vertexai.aierror.md#aierror_class) will be thrown if this property is defined. | | [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | ## SafetySetting.category @@ -36,6 +36,10 @@ category: HarmCategory; ## SafetySetting.method +The harm block method. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), an [AIError](./vertexai.aierror.md#aierror_class) will be thrown if this property is defined. + Signature: ```typescript diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md index 0764a53bdc0..4fdf8941438 100644 --- a/docs-devsite/vertexai.schemashared.md +++ b/docs-devsite/vertexai.schemashared.md @@ -25,7 +25,7 @@ export interface SchemaShared | [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | | [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | | [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | -| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. | +| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | | [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | | [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | | [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | @@ -62,7 +62,7 @@ example?: unknown; ## SchemaShared.format -Optional. The format of the property. +Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this must be either `'enum'` or `'date-time'`, otherwise requests will fail. Signature: diff --git a/docs-devsite/vertexai.vertexai.md b/docs-devsite/vertexai.vertexai.md deleted file mode 100644 index d30d0f7113e..00000000000 --- a/docs-devsite/vertexai.vertexai.md +++ /dev/null @@ -1,44 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# VertexAI interface -An instance of the Vertex AI in Firebase SDK. - -Signature: - -```typescript -export interface VertexAI -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | -| [location](./vertexai.vertexai.md#vertexailocation) | string | | - -## VertexAI.app - -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. - -Signature: - -```typescript -app: FirebaseApp; -``` - -## VertexAI.location - -Signature: - -```typescript -location: string; -``` diff --git a/docs-devsite/vertexai.vertexaibackend.md b/docs-devsite/vertexai.vertexaibackend.md new file mode 100644 index 00000000000..ba82c775ca8 --- /dev/null +++ b/docs-devsite/vertexai.vertexaibackend.md @@ -0,0 +1,60 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# VertexAIBackend class +Configuration class for the Vertex AI Gemini API. + +Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. + +Signature: + +```typescript +export declare class VertexAIBackend extends Backend +``` +Extends: [Backend](./vertexai.backend.md#backend_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(location)](./vertexai.vertexaibackend.md#vertexaibackendconstructor) | | Creates a configuration object for the Vertex AI backend. | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [location](./vertexai.vertexaibackend.md#vertexaibackendlocation) | | string | The region identifier. See [Vertex AI locations](https://firebase.google.com/docs/vertex-ai/locations#available-locations) for a list of supported locations. | + +## VertexAIBackend.(constructor) + +Creates a configuration object for the Vertex AI backend. + +Signature: + +```typescript +constructor(location?: string); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| location | string | The region identifier, defaulting to us-central1; see [Vertex AI locations](https://firebase.google.com/docs/vertex-ai/locations#available-locations) for a list of supported locations. | + +## VertexAIBackend.location + +The region identifier. See [Vertex AI locations](https://firebase.google.com/docs/vertex-ai/locations#available-locations) for a list of supported locations. + +Signature: + +```typescript +readonly location: string; +``` diff --git a/docs-devsite/vertexai.vertexaimodel.md b/docs-devsite/vertexai.vertexaimodel.md deleted file mode 100644 index 5c3244fe1e5..00000000000 --- a/docs-devsite/vertexai.vertexaimodel.md +++ /dev/null @@ -1,66 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# VertexAIModel class -Base class for Vertex AI in Firebase model APIs. - -The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `VertexAIModel` class. - -Signature: - -```typescript -export declare abstract class VertexAIModel -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [model](./vertexai.vertexaimodel.md#vertexaimodelmodel) | | string | The fully qualified model resource name to use for generating images (for example, publishers/google/models/imagen-3.0-generate-002). | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [normalizeModelName(modelName)](./vertexai.vertexaimodel.md#vertexaimodelnormalizemodelname) | static | Normalizes the given model name to a fully qualified model resource name. | - -## VertexAIModel.model - -The fully qualified model resource name to use for generating images (for example, `publishers/google/models/imagen-3.0-generate-002`). - -Signature: - -```typescript -readonly model: string; -``` - -## VertexAIModel.normalizeModelName() - -Normalizes the given model name to a fully qualified model resource name. - -Signature: - -```typescript -static normalizeModelName(modelName: string): string; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| modelName | string | The model name to normalize. | - -Returns: - -string - -The fully qualified model resource name. - diff --git a/docs-devsite/vertexai.vertexaioptions.md b/docs-devsite/vertexai.vertexaioptions.md index e15b525bfed..776dfd29374 100644 --- a/docs-devsite/vertexai.vertexaioptions.md +++ b/docs-devsite/vertexai.vertexaioptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # VertexAIOptions interface -Options when initializing the Vertex AI in Firebase SDK. +Options when initializing the Firebase AI SDK. Signature: diff --git a/packages/firebase/ai/index.ts b/packages/firebase/ai/index.ts new file mode 100644 index 00000000000..2645fd3004f --- /dev/null +++ b/packages/firebase/ai/index.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2024 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. + */ + +export * from '@firebase/vertexai'; diff --git a/packages/firebase/ai/package.json b/packages/firebase/ai/package.json new file mode 100644 index 00000000000..75405002478 --- /dev/null +++ b/packages/firebase/ai/package.json @@ -0,0 +1,7 @@ +{ + "name": "firebase/ai", + "main": "dist/index.cjs.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", + "typings": "dist/vertexai/index.d.ts" +} \ No newline at end of file diff --git a/packages/firebase/package.json b/packages/firebase/package.json index f4fe3bb2d50..c61bc701426 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -227,6 +227,18 @@ }, "default": "./storage/dist/esm/index.esm.js" }, + "./ai": { + "types": "./vertexai/dist/vertexai/index.d.ts", + "node": { + "require": "./vertexai/dist/index.cjs.js", + "import": "./vertexai/dist/index.mjs" + }, + "browser": { + "require": "./vertexai/dist/index.cjs.js", + "import": "./vertexai/dist/esm/index.esm.js" + }, + "default": "./vertexai/dist/esm/index.esm.js" + }, "./vertexai": { "types": "./vertexai/dist/vertexai/index.d.ts", "node": { @@ -443,6 +455,7 @@ "rollup-plugin-license": "3.5.3" }, "components": [ + "ai", "analytics", "app", "app-check", diff --git a/packages/vertexai/src/api.test.ts b/packages/vertexai/src/api.test.ts index 4a0b978d858..27237b4edd3 100644 --- a/packages/vertexai/src/api.test.ts +++ b/packages/vertexai/src/api.test.ts @@ -14,14 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ImagenModelParams, ModelParams, VertexAIErrorCode } from './types'; -import { VertexAIError } from './errors'; +import { ImagenModelParams, ModelParams, AIErrorCode } from './types'; +import { AIError } from './errors'; import { ImagenModel, getGenerativeModel, getImagenModel } from './api'; import { expect } from 'chai'; -import { VertexAI } from './public-types'; +import { AI } from './public-types'; import { GenerativeModel } from './models/generative-model'; +import { VertexAIBackend } from './backend'; +import { AI_TYPE } from './constants'; -const fakeVertexAI: VertexAI = { +const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -31,139 +33,136 @@ const fakeVertexAI: VertexAI = { appId: 'my-appid' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; describe('Top level API', () => { it('getGenerativeModel throws if no model is provided', () => { try { - getGenerativeModel(fakeVertexAI, {} as ModelParams); + getGenerativeModel(fakeAI, {} as ModelParams); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_MODEL); - expect((e as VertexAIError).message).includes( - `VertexAI: Must provide a model name. Example: ` + - `getGenerativeModel({ model: 'my-model-name' }) (vertexAI/${VertexAIErrorCode.NO_MODEL})` + expect((e as AIError).code).includes(AIErrorCode.NO_MODEL); + expect((e as AIError).message).includes( + `AI: Must provide a model name. Example: ` + + `getGenerativeModel({ model: 'my-model-name' }) (${AI_TYPE}/${AIErrorCode.NO_MODEL})` ); } }); it('getGenerativeModel throws if no apiKey is provided', () => { const fakeVertexNoApiKey = { - ...fakeVertexAI, + ...fakeAI, app: { options: { projectId: 'my-project', appId: 'my-appid' } } - } as VertexAI; + } as AI; try { getGenerativeModel(fakeVertexNoApiKey, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_API_KEY); - expect((e as VertexAIError).message).equals( - `VertexAI: The "apiKey" field is empty in the local ` + - `Firebase config. Firebase VertexAI requires this field to` + - ` contain a valid API key. (vertexAI/${VertexAIErrorCode.NO_API_KEY})` + expect((e as AIError).code).includes(AIErrorCode.NO_API_KEY); + expect((e as AIError).message).equals( + `AI: The "apiKey" field is empty in the local ` + + `Firebase config. Firebase AI requires this field to` + + ` contain a valid API key. (${AI_TYPE}/${AIErrorCode.NO_API_KEY})` ); } }); it('getGenerativeModel throws if no projectId is provided', () => { const fakeVertexNoProject = { - ...fakeVertexAI, + ...fakeAI, app: { options: { apiKey: 'my-key', appId: 'my-appid' } } - } as VertexAI; + } as AI; try { getGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes( - VertexAIErrorCode.NO_PROJECT_ID - ); - expect((e as VertexAIError).message).equals( - `VertexAI: The "projectId" field is empty in the local` + - ` Firebase config. Firebase VertexAI requires this field ` + - `to contain a valid project ID. (vertexAI/${VertexAIErrorCode.NO_PROJECT_ID})` + expect((e as AIError).code).includes(AIErrorCode.NO_PROJECT_ID); + expect((e as AIError).message).equals( + `AI: The "projectId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid project ID. (${AI_TYPE}/${AIErrorCode.NO_PROJECT_ID})` ); } }); it('getGenerativeModel throws if no appId is provided', () => { const fakeVertexNoProject = { - ...fakeVertexAI, + ...fakeAI, app: { options: { apiKey: 'my-key', projectId: 'my-projectid' } } - } as VertexAI; + } as AI; try { getGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_APP_ID); - expect((e as VertexAIError).message).equals( - `VertexAI: The "appId" field is empty in the local` + - ` Firebase config. Firebase VertexAI requires this field ` + - `to contain a valid app ID. (vertexAI/${VertexAIErrorCode.NO_APP_ID})` + expect((e as AIError).code).includes(AIErrorCode.NO_APP_ID); + expect((e as AIError).message).equals( + `AI: The "appId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid app ID. (${AI_TYPE}/${AIErrorCode.NO_APP_ID})` ); } }); it('getGenerativeModel gets a GenerativeModel', () => { - const genModel = getGenerativeModel(fakeVertexAI, { model: 'my-model' }); + const genModel = getGenerativeModel(fakeAI, { model: 'my-model' }); expect(genModel).to.be.an.instanceOf(GenerativeModel); expect(genModel.model).to.equal('publishers/google/models/my-model'); }); it('getImagenModel throws if no model is provided', () => { try { - getImagenModel(fakeVertexAI, {} as ImagenModelParams); + getImagenModel(fakeAI, {} as ImagenModelParams); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_MODEL); - expect((e as VertexAIError).message).includes( - `VertexAI: Must provide a model name. Example: ` + - `getImagenModel({ model: 'my-model-name' }) (vertexAI/${VertexAIErrorCode.NO_MODEL})` + expect((e as AIError).code).includes(AIErrorCode.NO_MODEL); + expect((e as AIError).message).includes( + `AI: Must provide a model name. Example: ` + + `getImagenModel({ model: 'my-model-name' }) (${AI_TYPE}/${AIErrorCode.NO_MODEL})` ); } }); it('getImagenModel throws if no apiKey is provided', () => { const fakeVertexNoApiKey = { - ...fakeVertexAI, + ...fakeAI, app: { options: { projectId: 'my-project', appId: 'my-appid' } } - } as VertexAI; + } as AI; try { getImagenModel(fakeVertexNoApiKey, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_API_KEY); - expect((e as VertexAIError).message).equals( - `VertexAI: The "apiKey" field is empty in the local ` + - `Firebase config. Firebase VertexAI requires this field to` + - ` contain a valid API key. (vertexAI/${VertexAIErrorCode.NO_API_KEY})` + expect((e as AIError).code).includes(AIErrorCode.NO_API_KEY); + expect((e as AIError).message).equals( + `AI: The "apiKey" field is empty in the local ` + + `Firebase config. Firebase AI requires this field to` + + ` contain a valid API key. (${AI_TYPE}/${AIErrorCode.NO_API_KEY})` ); } }); it('getImagenModel throws if no projectId is provided', () => { const fakeVertexNoProject = { - ...fakeVertexAI, + ...fakeAI, app: { options: { apiKey: 'my-key', appId: 'my-appid' } } - } as VertexAI; + } as AI; try { getImagenModel(fakeVertexNoProject, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes( - VertexAIErrorCode.NO_PROJECT_ID - ); - expect((e as VertexAIError).message).equals( - `VertexAI: The "projectId" field is empty in the local` + - ` Firebase config. Firebase VertexAI requires this field ` + - `to contain a valid project ID. (vertexAI/${VertexAIErrorCode.NO_PROJECT_ID})` + expect((e as AIError).code).includes(AIErrorCode.NO_PROJECT_ID); + expect((e as AIError).message).equals( + `AI: The "projectId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid project ID. (${AI_TYPE}/${AIErrorCode.NO_PROJECT_ID})` ); } }); it('getImagenModel throws if no appId is provided', () => { const fakeVertexNoProject = { - ...fakeVertexAI, + ...fakeAI, app: { options: { apiKey: 'my-key', projectId: 'my-project' } } - } as VertexAI; + } as AI; try { getImagenModel(fakeVertexNoProject, { model: 'my-model' }); } catch (e) { - expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_APP_ID); - expect((e as VertexAIError).message).equals( - `VertexAI: The "appId" field is empty in the local` + - ` Firebase config. Firebase VertexAI requires this field ` + - `to contain a valid app ID. (vertexAI/${VertexAIErrorCode.NO_APP_ID})` + expect((e as AIError).code).includes(AIErrorCode.NO_APP_ID); + expect((e as AIError).message).equals( + `AI: The "appId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid app ID. (${AI_TYPE}/${AIErrorCode.NO_APP_ID})` ); } }); it('getImagenModel gets an ImagenModel', () => { - const genModel = getImagenModel(fakeVertexAI, { model: 'my-model' }); + const genModel = getImagenModel(fakeAI, { model: 'my-model' }); expect(genModel).to.be.an.instanceOf(ImagenModel); expect(genModel.model).to.equal('publishers/google/models/my-model'); }); diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 7843a5bdeee..06bd747746a 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -18,36 +18,63 @@ import { FirebaseApp, getApp, _getProvider } from '@firebase/app'; import { Provider } from '@firebase/component'; import { getModularInstance } from '@firebase/util'; -import { DEFAULT_LOCATION, VERTEX_TYPE } from './constants'; -import { VertexAIService } from './service'; -import { VertexAI, VertexAIOptions } from './public-types'; +import { AI_TYPE } from './constants'; +import { AIService } from './service'; +import { AI, AIOptions, VertexAI, VertexAIOptions } from './public-types'; import { ImagenModelParams, ModelParams, RequestOptions, - VertexAIErrorCode + AIErrorCode } from './types'; -import { VertexAIError } from './errors'; -import { VertexAIModel, GenerativeModel, ImagenModel } from './models'; +import { AIError } from './errors'; +import { AIModel, GenerativeModel, ImagenModel } from './models'; +import { encodeInstanceIdentifier } from './helpers'; +import { GoogleAIBackend, VertexAIBackend } from './backend'; export { ChatSession } from './methods/chat-session'; export * from './requests/schema-builder'; export { ImagenImageFormat } from './requests/imagen-image-format'; -export { VertexAIModel, GenerativeModel, ImagenModel }; -export { VertexAIError }; +export { AIModel, GenerativeModel, ImagenModel, AIError }; +export { Backend, VertexAIBackend, GoogleAIBackend } from './backend'; + +export { AIErrorCode as VertexAIErrorCode }; + +/** + * Base class for Firebase AI model APIs. + * + * For more information, refer to the documentation for the new {@link AIModel}. + * + * @public + */ +export const VertexAIModel = AIModel; + +/** + * Error class for the Firebase AI SDK. + * + * For more information, refer to the documentation for the new {@link AIError}. + * + * @public + */ +export const VertexAIError = AIError; declare module '@firebase/component' { interface NameServiceMapping { - [VERTEX_TYPE]: VertexAIService; + [AI_TYPE]: AIService; } } /** - * Returns a {@link VertexAI} instance for the given app. + * It is recommended to use the new {@link getAI | getAI()}. * - * @public + * Returns a {@link VertexAI} instance for the given app, configured to use the + * Vertex AI Gemini API. This instance will be + * configured to use the Vertex AI Gemini API. * * @param app - The {@link @firebase/app#FirebaseApp} to use. + * @param options - Options to configure the Vertex AI instance, including the location. + * + * @public */ export function getVertexAI( app: FirebaseApp = getApp(), @@ -55,10 +82,54 @@ export function getVertexAI( ): VertexAI { app = getModularInstance(app); // Dependencies - const vertexProvider: Provider<'vertexAI'> = _getProvider(app, VERTEX_TYPE); + const AIProvider: Provider<'AI'> = _getProvider(app, AI_TYPE); + + const backend = new VertexAIBackend(options?.location); + const identifier = encodeInstanceIdentifier(backend); + return AIProvider.getImmediate({ + identifier + }); +} + +/** + * Returns the default {@link AI} instance that is associated with the provided + * {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new instance with the + * default settings. + * + * @example + * ```javascript + * const ai = getAI(app); + * ``` + * + * @example + * ```javascript + * // Get an AI instance configured to use the Gemini Developer API (via Google AI). + * const ai = getAI(app, { backend: new GoogleAIBackend() }); + * ``` + * + * @example + * ```javascript + * // Get an AI instance configured to use the Vertex AI Gemini API. + * const ai = getAI(app, { backend: new VertexAIBackend() }); + * ``` + * + * @param app - The {@link @firebase/app#FirebaseApp} to use. + * @param options - {@link AIOptions} that configure the AI instance. + * @returns The default {@link AI} instance for the given {@link @firebase/app#FirebaseApp}. + * + * @public + */ +export function getAI( + app: FirebaseApp = getApp(), + options: AIOptions = { backend: new GoogleAIBackend() } +): AI { + app = getModularInstance(app); + // Dependencies + const AIProvider: Provider<'AI'> = _getProvider(app, AI_TYPE); - return vertexProvider.getImmediate({ - identifier: options?.location || DEFAULT_LOCATION + const identifier = encodeInstanceIdentifier(options.backend); + return AIProvider.getImmediate({ + identifier }); } @@ -69,17 +140,17 @@ export function getVertexAI( * @public */ export function getGenerativeModel( - vertexAI: VertexAI, + ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions ): GenerativeModel { if (!modelParams.model) { - throw new VertexAIError( - VertexAIErrorCode.NO_MODEL, + throw new AIError( + AIErrorCode.NO_MODEL, `Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })` ); } - return new GenerativeModel(vertexAI, modelParams, requestOptions); + return new GenerativeModel(ai, modelParams, requestOptions); } /** @@ -87,7 +158,7 @@ export function getGenerativeModel( * * Only Imagen 3 models (named `imagen-3.0-*`) are supported. * - * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param ai - An {@link AI} instance. * @param modelParams - Parameters to use when making Imagen requests. * @param requestOptions - Additional options to use when making requests. * @@ -97,15 +168,15 @@ export function getGenerativeModel( * @beta */ export function getImagenModel( - vertexAI: VertexAI, + ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions ): ImagenModel { if (!modelParams.model) { - throw new VertexAIError( - VertexAIErrorCode.NO_MODEL, + throw new AIError( + AIErrorCode.NO_MODEL, `Must provide a model name. Example: getImagenModel({ model: 'my-model-name' })` ); } - return new ImagenModel(vertexAI, modelParams, requestOptions); + return new ImagenModel(ai, modelParams, requestOptions); } diff --git a/packages/vertexai/src/backend.test.ts b/packages/vertexai/src/backend.test.ts new file mode 100644 index 00000000000..0c6609277e3 --- /dev/null +++ b/packages/vertexai/src/backend.test.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { GoogleAIBackend, VertexAIBackend } from './backend'; +import { BackendType } from './public-types'; +import { DEFAULT_LOCATION } from './constants'; + +describe('Backend', () => { + describe('GoogleAIBackend', () => { + it('sets backendType to GOOGLE_AI', () => { + const backend = new GoogleAIBackend(); + expect(backend.backendType).to.equal(BackendType.GOOGLE_AI); + }); + }); + describe('VertexAIBackend', () => { + it('set backendType to VERTEX_AI', () => { + const backend = new VertexAIBackend(); + expect(backend.backendType).to.equal(BackendType.VERTEX_AI); + expect(backend.location).to.equal(DEFAULT_LOCATION); + }); + it('sets custom location', () => { + const backend = new VertexAIBackend('test-location'); + expect(backend.backendType).to.equal(BackendType.VERTEX_AI); + expect(backend.location).to.equal('test-location'); + }); + it('uses default location if location is empty string', () => { + const backend = new VertexAIBackend(''); + expect(backend.backendType).to.equal(BackendType.VERTEX_AI); + expect(backend.location).to.equal(DEFAULT_LOCATION); + }); + it('uses default location if location is null', () => { + const backend = new VertexAIBackend(null as any); + expect(backend.backendType).to.equal(BackendType.VERTEX_AI); + expect(backend.location).to.equal(DEFAULT_LOCATION); + }); + }); +}); diff --git a/packages/vertexai/src/backend.ts b/packages/vertexai/src/backend.ts new file mode 100644 index 00000000000..7209828122b --- /dev/null +++ b/packages/vertexai/src/backend.ts @@ -0,0 +1,92 @@ +/** + * @license + * Copyright 2025 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 { DEFAULT_LOCATION } from './constants'; +import { BackendType } from './public-types'; + +/** + * Abstract base class representing the configuration for an AI service backend. + * This class should not be instantiated directly. Use its subclasses; {@link GoogleAIBackend} for + * the Gemini Developer API (via {@link https://ai.google/ | Google AI}), and + * {@link VertexAIBackend} for the Vertex AI Gemini API. + * + * @public + */ +export abstract class Backend { + /** + * Specifies the backend type. + */ + readonly backendType: BackendType; + + /** + * Protected constructor for use by subclasses. + * @param type - The backend type. + */ + protected constructor(type: BackendType) { + this.backendType = type; + } +} + +/** + * Configuration class for the Gemini Developer API. + * + * Use this with {@link AIOptions} when initializing the AI service via + * {@link getAI | getAI()} to specify the Gemini Developer API as the backend. + * + * @public + */ +export class GoogleAIBackend extends Backend { + /** + * Creates a configuration object for the Gemini Developer API backend. + */ + constructor() { + super(BackendType.GOOGLE_AI); + } +} + +/** + * Configuration class for the Vertex AI Gemini API. + * + * Use this with {@link AIOptions} when initializing the AI service via + * {@link getAI | getAI()} to specify the Vertex AI Gemini API as the backend. + * + * @public + */ +export class VertexAIBackend extends Backend { + /** + * The region identifier. + * See {@link https://firebase.google.com/docs/vertex-ai/locations#available-locations | Vertex AI locations} + * for a list of supported locations. + */ + readonly location: string; + + /** + * Creates a configuration object for the Vertex AI backend. + * + * @param location - The region identifier, defaulting to `us-central1`; + * see {@link https://firebase.google.com/docs/vertex-ai/locations#available-locations | Vertex AI locations} + * for a list of supported locations. + */ + constructor(location: string = DEFAULT_LOCATION) { + super(BackendType.VERTEX_AI); + if (!location) { + this.location = DEFAULT_LOCATION; + } else { + this.location = location; + } + } +} diff --git a/packages/vertexai/src/backwards-compatbility.test.ts b/packages/vertexai/src/backwards-compatbility.test.ts new file mode 100644 index 00000000000..62463009b24 --- /dev/null +++ b/packages/vertexai/src/backwards-compatbility.test.ts @@ -0,0 +1,85 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + AIError, + AIModel, + GenerativeModel, + VertexAIError, + VertexAIErrorCode, + VertexAIModel, + getGenerativeModel, + getImagenModel +} from './api'; +import { AI, VertexAI, AIErrorCode } from './public-types'; +import { VertexAIBackend } from './backend'; + +function assertAssignable(): void {} + +const fakeAI: AI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key', + projectId: 'my-project', + appId: 'app-id' + } + }, + backend: new VertexAIBackend('us-central1'), + location: 'us-central1' +}; + +const fakeVertexAI: VertexAI = fakeAI; + +describe('backwards-compatible types', () => { + it('AI is backwards compatible with VertexAI', () => { + assertAssignable(); + }); + it('AIError is backwards compatible with VertexAIError', () => { + assertAssignable(); + const err = new VertexAIError(VertexAIErrorCode.ERROR, ''); + expect(err).instanceOf(AIError); + expect(err).instanceOf(VertexAIError); + }); + it('AIErrorCode is backwards compatible with VertexAIErrorCode', () => { + assertAssignable(); + const errCode = AIErrorCode.ERROR; + expect(errCode).to.equal(VertexAIErrorCode.ERROR); + }); + it('AIModel is backwards compatible with VertexAIModel', () => { + assertAssignable(); + + const model = new GenerativeModel(fakeAI, { model: 'model-name' }); + expect(model).to.be.instanceOf(AIModel); + expect(model).to.be.instanceOf(VertexAIModel); + }); +}); + +describe('backward-compatible functions', () => { + it('getGenerativeModel', () => { + const model = getGenerativeModel(fakeVertexAI, { model: 'model-name' }); + expect(model).to.be.instanceOf(AIModel); + expect(model).to.be.instanceOf(VertexAIModel); + }); + it('getImagenModel', () => { + const model = getImagenModel(fakeVertexAI, { model: 'model-name' }); + expect(model).to.be.instanceOf(AIModel); + expect(model).to.be.instanceOf(VertexAIModel); + }); +}); diff --git a/packages/vertexai/src/constants.ts b/packages/vertexai/src/constants.ts index 357e6c4e77c..6339ce63017 100644 --- a/packages/vertexai/src/constants.ts +++ b/packages/vertexai/src/constants.ts @@ -17,8 +17,11 @@ import { version } from '../package.json'; +// TODO (v12): Remove this export const VERTEX_TYPE = 'vertexAI'; +export const AI_TYPE = 'AI'; + export const DEFAULT_LOCATION = 'us-central1'; export const DEFAULT_BASE_URL = 'https://firebasevertexai.googleapis.com'; diff --git a/packages/vertexai/src/errors.ts b/packages/vertexai/src/errors.ts index ad3f9b72f5a..2e9787d0bf2 100644 --- a/packages/vertexai/src/errors.ts +++ b/packages/vertexai/src/errors.ts @@ -16,32 +16,31 @@ */ import { FirebaseError } from '@firebase/util'; -import { VertexAIErrorCode, CustomErrorData } from './types'; -import { VERTEX_TYPE } from './constants'; +import { AIErrorCode, CustomErrorData } from './types'; +import { AI_TYPE } from './constants'; /** - * Error class for the Vertex AI in Firebase SDK. + * Error class for the Firebase AI SDK. * * @public */ -export class VertexAIError extends FirebaseError { +export class AIError extends FirebaseError { /** - * Constructs a new instance of the `VertexAIError` class. + * Constructs a new instance of the `AIError` class. * - * @param code - The error code from {@link VertexAIErrorCode}. + * @param code - The error code from {@link AIErrorCode}. * @param message - A human-readable message describing the error. * @param customErrorData - Optional error data. */ constructor( - readonly code: VertexAIErrorCode, + readonly code: AIErrorCode, message: string, readonly customErrorData?: CustomErrorData ) { // Match error format used by FirebaseError from ErrorFactory - const service = VERTEX_TYPE; - const serviceName = 'VertexAI'; + const service = AI_TYPE; const fullCode = `${service}/${code}`; - const fullMessage = `${serviceName}: ${message} (${fullCode})`; + const fullMessage = `${service}: ${message} (${fullCode})`; super(code, fullMessage); // FirebaseError initializes a stack trace, but it assumes the error is created from the error @@ -51,14 +50,14 @@ export class VertexAIError extends FirebaseError { if (Error.captureStackTrace) { // Allows us to initialize the stack trace without including the constructor itself at the // top level of the stack trace. - Error.captureStackTrace(this, VertexAIError); + Error.captureStackTrace(this, AIError); } - // Allows instanceof VertexAIError in ES5/ES6 + // Allows instanceof AIError in ES5/ES6 // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work // TODO(dlarocque): Replace this with `new.target`: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget // which we can now use since we no longer target ES5. - Object.setPrototypeOf(this, VertexAIError.prototype); + Object.setPrototypeOf(this, AIError.prototype); // Since Error is an interface, we don't inherit toString and so we define it ourselves. this.toString = () => fullMessage; diff --git a/packages/vertexai/src/googleai-mappers.test.ts b/packages/vertexai/src/googleai-mappers.test.ts new file mode 100644 index 00000000000..12f422625f5 --- /dev/null +++ b/packages/vertexai/src/googleai-mappers.test.ts @@ -0,0 +1,391 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import sinon, { restore, stub } from 'sinon'; +import sinonChai from 'sinon-chai'; +import { + mapCountTokensRequest, + mapGenerateContentCandidates, + mapGenerateContentRequest, + mapGenerateContentResponse, + mapPromptFeedback +} from './googleai-mappers'; +import { + BlockReason, + Content, + CountTokensRequest, + GenerateContentRequest, + HarmBlockMethod, + HarmBlockThreshold, + HarmCategory, + HarmProbability, + HarmSeverity, + SafetyRating, + AIErrorCode, + FinishReason, + PromptFeedback +} from './types'; +import { + GoogleAIGenerateContentResponse, + GoogleAIGenerateContentCandidate, + GoogleAICountTokensRequest +} from './types/googleai'; +import { logger } from './logger'; +import { AIError } from './errors'; +import { getMockResponse } from '../test-utils/mock-response'; + +use(sinonChai); + +const fakeModel = 'models/gemini-pro'; + +const fakeContents: Content[] = [{ role: 'user', parts: [{ text: 'hello' }] }]; + +describe('Google AI Mappers', () => { + let loggerWarnStub: sinon.SinonStub; + + beforeEach(() => { + loggerWarnStub = stub(logger, 'warn'); + }); + + afterEach(() => { + restore(); + }); + + describe('mapGenerateContentRequest', () => { + it('should throw if safetySettings contain method', () => { + const request: GenerateContentRequest = { + contents: fakeContents, + safetySettings: [ + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + method: HarmBlockMethod.SEVERITY + } + ] + }; + expect(() => mapGenerateContentRequest(request)) + .to.throw(AIError, /SafetySetting.method is not supported/i) + .with.property('code', AIErrorCode.UNSUPPORTED); + }); + + it('should warn and round topK if present', () => { + const request: GenerateContentRequest = { + contents: fakeContents, + generationConfig: { + topK: 15.7 + } + }; + const mappedRequest = mapGenerateContentRequest(request); + expect(loggerWarnStub).to.have.been.calledOnceWith( + 'topK in GenerationConfig has been rounded to the nearest integer to match the format for requests to the Gemini Developer API.' + ); + expect(mappedRequest.generationConfig?.topK).to.equal(16); + }); + + it('should not modify topK if it is already an integer', () => { + const request: GenerateContentRequest = { + contents: fakeContents, + generationConfig: { + topK: 16 + } + }; + const mappedRequest = mapGenerateContentRequest(request); + expect(loggerWarnStub).to.not.have.been.called; + expect(mappedRequest.generationConfig?.topK).to.equal(16); + }); + + it('should return the request mostly unchanged if valid', () => { + const request: GenerateContentRequest = { + contents: fakeContents, + safetySettings: [ + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE + } + ], + generationConfig: { + temperature: 0.5 + } + }; + const mappedRequest = mapGenerateContentRequest({ ...request }); + expect(mappedRequest).to.deep.equal(request); + expect(loggerWarnStub).to.not.have.been.called; + }); + }); + + describe('mapGenerateContentResponse', () => { + it('should map a full Google AI response', async () => { + const googleAIMockResponse: GoogleAIGenerateContentResponse = await ( + getMockResponse('googleAI', 'unary-success-citations.json') as Response + ).json(); + const mappedResponse = mapGenerateContentResponse(googleAIMockResponse); + + expect(mappedResponse.candidates).to.exist; + expect(mappedResponse.candidates?.[0].content.parts[0].text).to.contain( + 'quantum mechanics' + ); + + // Mapped citations + expect( + mappedResponse.candidates?.[0].citationMetadata?.citations[0].startIndex + ).to.equal( + googleAIMockResponse.candidates?.[0].citationMetadata + ?.citationSources[0].startIndex + ); + expect( + mappedResponse.candidates?.[0].citationMetadata?.citations[0].endIndex + ).to.equal( + googleAIMockResponse.candidates?.[0].citationMetadata + ?.citationSources[0].endIndex + ); + + // Mapped safety ratings + expect( + mappedResponse.candidates?.[0].safetyRatings?.[0].probabilityScore + ).to.equal(0); + expect( + mappedResponse.candidates?.[0].safetyRatings?.[0].severityScore + ).to.equal(0); + expect( + mappedResponse.candidates?.[0].safetyRatings?.[0].severity + ).to.equal(HarmSeverity.HARM_SEVERITY_UNSUPPORTED); + + expect(mappedResponse.candidates?.[0].finishReason).to.equal( + FinishReason.STOP + ); + + // Check usage metadata passthrough + expect(mappedResponse.usageMetadata).to.deep.equal( + googleAIMockResponse.usageMetadata + ); + }); + + it('should handle missing candidates and promptFeedback', () => { + const googleAIResponse: GoogleAIGenerateContentResponse = { + // No candidates + // No promptFeedback + usageMetadata: { + promptTokenCount: 5, + candidatesTokenCount: 0, + totalTokenCount: 5 + } + }; + const mappedResponse = mapGenerateContentResponse(googleAIResponse); + expect(mappedResponse.candidates).to.be.undefined; + expect(mappedResponse.promptFeedback).to.be.undefined; // Mapped to undefined + expect(mappedResponse.usageMetadata).to.deep.equal( + googleAIResponse.usageMetadata + ); + }); + + it('should handle empty candidates array', () => { + const googleAIResponse: GoogleAIGenerateContentResponse = { + candidates: [], + usageMetadata: { + promptTokenCount: 5, + candidatesTokenCount: 0, + totalTokenCount: 5 + } + }; + const mappedResponse = mapGenerateContentResponse(googleAIResponse); + expect(mappedResponse.candidates).to.deep.equal([]); + expect(mappedResponse.promptFeedback).to.be.undefined; + expect(mappedResponse.usageMetadata).to.deep.equal( + googleAIResponse.usageMetadata + ); + }); + }); + + describe('mapCountTokensRequest', () => { + it('should map a Vertex AI CountTokensRequest to Google AI format', () => { + const vertexRequest: CountTokensRequest = { + contents: fakeContents, + systemInstruction: { role: 'system', parts: [{ text: 'Be nice' }] }, + tools: [ + { functionDeclarations: [{ name: 'foo', description: 'bar' }] } + ], + generationConfig: { temperature: 0.8 } + }; + + const expectedGoogleAIRequest: GoogleAICountTokensRequest = { + generateContentRequest: { + model: fakeModel, + contents: vertexRequest.contents, + systemInstruction: vertexRequest.systemInstruction, + tools: vertexRequest.tools, + generationConfig: vertexRequest.generationConfig + } + }; + + const mappedRequest = mapCountTokensRequest(vertexRequest, fakeModel); + expect(mappedRequest).to.deep.equal(expectedGoogleAIRequest); + }); + + it('should map a minimal Vertex AI CountTokensRequest', () => { + const vertexRequest: CountTokensRequest = { + contents: fakeContents, + systemInstruction: { role: 'system', parts: [{ text: 'Be nice' }] }, + generationConfig: { temperature: 0.8 } + }; + + const expectedGoogleAIRequest: GoogleAICountTokensRequest = { + generateContentRequest: { + model: fakeModel, + contents: vertexRequest.contents, + systemInstruction: { role: 'system', parts: [{ text: 'Be nice' }] }, + generationConfig: { temperature: 0.8 } + } + }; + + const mappedRequest = mapCountTokensRequest(vertexRequest, fakeModel); + expect(mappedRequest).to.deep.equal(expectedGoogleAIRequest); + }); + }); + + describe('mapGenerateContentCandidates', () => { + it('should map citationSources to citationMetadata.citations', () => { + const candidates: GoogleAIGenerateContentCandidate[] = [ + { + index: 0, + content: { role: 'model', parts: [{ text: 'Cited text' }] }, + citationMetadata: { + citationSources: [ + { startIndex: 0, endIndex: 5, uri: 'uri1', license: 'MIT' }, + { startIndex: 6, endIndex: 10, uri: 'uri2' } + ] + } + } + ]; + const mapped = mapGenerateContentCandidates(candidates); + expect(mapped[0].citationMetadata).to.exist; + expect(mapped[0].citationMetadata?.citations).to.deep.equal( + candidates[0].citationMetadata?.citationSources + ); + expect(mapped[0].citationMetadata?.citations[0].title).to.be.undefined; // Not in Google AI + expect(mapped[0].citationMetadata?.citations[0].publicationDate).to.be + .undefined; // Not in Google AI + }); + + it('should add default safety rating properties', () => { + const candidates: GoogleAIGenerateContentCandidate[] = [ + { + index: 0, + content: { role: 'model', parts: [{ text: 'Maybe unsafe' }] }, + safetyRatings: [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + probability: HarmProbability.MEDIUM, + blocked: false + // Missing severity, probabilityScore, severityScore + } as any + ] + } + ]; + const mapped = mapGenerateContentCandidates(candidates); + expect(mapped[0].safetyRatings).to.exist; + const safetyRating = mapped[0].safetyRatings?.[0] as SafetyRating; // Type assertion + expect(safetyRating.severity).to.equal( + HarmSeverity.HARM_SEVERITY_UNSUPPORTED + ); + expect(safetyRating.probabilityScore).to.equal(0); + expect(safetyRating.severityScore).to.equal(0); + // Existing properties should be preserved + expect(safetyRating.category).to.equal( + HarmCategory.HARM_CATEGORY_HARASSMENT + ); + expect(safetyRating.probability).to.equal(HarmProbability.MEDIUM); + expect(safetyRating.blocked).to.be.false; + }); + + it('should throw if videoMetadata is present in parts', () => { + const candidates: GoogleAIGenerateContentCandidate[] = [ + { + index: 0, + content: { + role: 'model', + parts: [ + { + inlineData: { mimeType: 'video/mp4', data: 'base64==' }, + videoMetadata: { startOffset: '0s', endOffset: '5s' } // Unsupported + } + ] + } + } + ]; + expect(() => mapGenerateContentCandidates(candidates)) + .to.throw(AIError, /Part.videoMetadata is not supported/i) + .with.property('code', AIErrorCode.UNSUPPORTED); + }); + + it('should handle candidates without citation or safety ratings', () => { + const candidates: GoogleAIGenerateContentCandidate[] = [ + { + index: 0, + content: { role: 'model', parts: [{ text: 'Simple text' }] }, + finishReason: FinishReason.STOP + } + ]; + const mapped = mapGenerateContentCandidates(candidates); + expect(mapped[0].citationMetadata).to.be.undefined; + expect(mapped[0].safetyRatings).to.be.undefined; + expect(mapped[0].content.parts[0].text).to.equal('Simple text'); + expect(loggerWarnStub).to.not.have.been.called; + }); + + it('should handle empty candidate array', () => { + const candidates: GoogleAIGenerateContentCandidate[] = []; + const mapped = mapGenerateContentCandidates(candidates); + expect(mapped).to.deep.equal([]); + expect(loggerWarnStub).to.not.have.been.called; + }); + }); + + describe('mapPromptFeedback', () => { + it('should add default safety rating properties', () => { + const feedback: PromptFeedback = { + blockReason: BlockReason.OTHER, + safetyRatings: [ + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + probability: HarmProbability.HIGH, + blocked: true + // Missing severity, probabilityScore, severityScore + } as any + ] + // Missing blockReasonMessage + }; + const mapped = mapPromptFeedback(feedback); + expect(mapped.safetyRatings).to.exist; + const safetyRating = mapped.safetyRatings[0] as SafetyRating; // Type assertion + expect(safetyRating.severity).to.equal( + HarmSeverity.HARM_SEVERITY_UNSUPPORTED + ); + expect(safetyRating.probabilityScore).to.equal(0); + expect(safetyRating.severityScore).to.equal(0); + // Existing properties should be preserved + expect(safetyRating.category).to.equal( + HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT + ); + expect(safetyRating.probability).to.equal(HarmProbability.HIGH); + expect(safetyRating.blocked).to.be.true; + // Other properties + expect(mapped.blockReason).to.equal(BlockReason.OTHER); + expect(mapped.blockReasonMessage).to.be.undefined; // Not present in input + }); + }); +}); diff --git a/packages/vertexai/src/googleai-mappers.ts b/packages/vertexai/src/googleai-mappers.ts new file mode 100644 index 00000000000..23c238c1e3b --- /dev/null +++ b/packages/vertexai/src/googleai-mappers.ts @@ -0,0 +1,227 @@ +/** + * @license + * Copyright 2025 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 { AIError } from './errors'; +import { logger } from './logger'; +import { + CitationMetadata, + CountTokensRequest, + GenerateContentCandidate, + GenerateContentRequest, + GenerateContentResponse, + HarmSeverity, + InlineDataPart, + PromptFeedback, + SafetyRating, + AIErrorCode +} from './types'; +import { + GoogleAIGenerateContentResponse, + GoogleAIGenerateContentCandidate, + GoogleAICountTokensRequest +} from './types/googleai'; + +/** + * This SDK supports both the Vertex AI Gemini API and the Gemini Developer API (using Google AI). + * The public API prioritizes the format used by the Vertex AI Gemini API. + * We avoid having two sets of types by translating requests and responses between the two API formats. + * This translation allows developers to switch between the Vertex AI Gemini API and the Gemini Developer API + * with minimal code changes. + * + * In here are functions that map requests and responses between the two API formats. + * Requests in the Vertex AI format are mapped to the Google AI format before being sent. + * Responses from the Google AI backend are mapped back to the Vertex AI format before being returned to the user. + */ + +/** + * Maps a Vertex AI {@link GenerateContentRequest} to a format that can be sent to Google AI. + * + * @param generateContentRequest The {@link GenerateContentRequest} to map. + * @returns A {@link GenerateContentResponse} that conforms to the Google AI format. + * + * @throws If the request contains properties that are unsupported by Google AI. + * + * @internal + */ +export function mapGenerateContentRequest( + generateContentRequest: GenerateContentRequest +): GenerateContentRequest { + generateContentRequest.safetySettings?.forEach(safetySetting => { + if (safetySetting.method) { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'SafetySetting.method is not supported in the the Gemini Developer API. Please remove this property.' + ); + } + }); + + if (generateContentRequest.generationConfig?.topK) { + const roundedTopK = Math.round( + generateContentRequest.generationConfig.topK + ); + + if (roundedTopK !== generateContentRequest.generationConfig.topK) { + logger.warn( + 'topK in GenerationConfig has been rounded to the nearest integer to match the format for requests to the Gemini Developer API.' + ); + generateContentRequest.generationConfig.topK = roundedTopK; + } + } + + return generateContentRequest; +} + +/** + * Maps a {@link GenerateContentResponse} from Google AI to the format of the + * {@link GenerateContentResponse} that we get from VertexAI that is exposed in the public API. + * + * @param googleAIResponse The {@link GenerateContentResponse} from Google AI. + * @returns A {@link GenerateContentResponse} that conforms to the public API's format. + * + * @internal + */ +export function mapGenerateContentResponse( + googleAIResponse: GoogleAIGenerateContentResponse +): GenerateContentResponse { + const generateContentResponse = { + candidates: googleAIResponse.candidates + ? mapGenerateContentCandidates(googleAIResponse.candidates) + : undefined, + prompt: googleAIResponse.promptFeedback + ? mapPromptFeedback(googleAIResponse.promptFeedback) + : undefined, + usageMetadata: googleAIResponse.usageMetadata + }; + + return generateContentResponse; +} + +/** + * Maps a Vertex AI {@link CountTokensRequest} to a format that can be sent to Google AI. + * + * @param countTokensRequest The {@link CountTokensRequest} to map. + * @param model The model to count tokens with. + * @returns A {@link CountTokensRequest} that conforms to the Google AI format. + * + * @internal + */ +export function mapCountTokensRequest( + countTokensRequest: CountTokensRequest, + model: string +): GoogleAICountTokensRequest { + const mappedCountTokensRequest: GoogleAICountTokensRequest = { + generateContentRequest: { + model, + ...countTokensRequest + } + }; + + return mappedCountTokensRequest; +} + +/** + * Maps a Google AI {@link GoogleAIGenerateContentCandidate} to a format that conforms + * to the Vertex AI API format. + * + * @param candidates The {@link GoogleAIGenerateContentCandidate} to map. + * @returns A {@link GenerateContentCandidate} that conforms to the Vertex AI format. + * + * @throws If any {@link Part} in the candidates has a `videoMetadata` property. + * + * @internal + */ +export function mapGenerateContentCandidates( + candidates: GoogleAIGenerateContentCandidate[] +): GenerateContentCandidate[] { + const mappedCandidates: GenerateContentCandidate[] = []; + let mappedSafetyRatings: SafetyRating[]; + if (mappedCandidates) { + candidates.forEach(candidate => { + // Map citationSources to citations. + let citationMetadata: CitationMetadata | undefined; + if (candidate.citationMetadata) { + citationMetadata = { + citations: candidate.citationMetadata.citationSources + }; + } + + // Assign missing candidate SafetyRatings properties to their defaults if undefined. + if (candidate.safetyRatings) { + mappedSafetyRatings = candidate.safetyRatings.map(safetyRating => { + return { + ...safetyRating, + severity: + safetyRating.severity ?? HarmSeverity.HARM_SEVERITY_UNSUPPORTED, + probabilityScore: safetyRating.probabilityScore ?? 0, + severityScore: safetyRating.severityScore ?? 0 + }; + }); + } + + // videoMetadata is not supported. + // Throw early since developers may send a long video as input and only expect to pay + // for inference on a small portion of the video. + if ( + candidate.content?.parts.some( + part => (part as InlineDataPart)?.videoMetadata + ) + ) { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'Part.videoMetadata is not supported in the Gemini Developer API. Please remove this property.' + ); + } + + const mappedCandidate = { + index: candidate.index, + content: candidate.content, + finishReason: candidate.finishReason, + finishMessage: candidate.finishMessage, + safetyRatings: mappedSafetyRatings, + citationMetadata, + groundingMetadata: candidate.groundingMetadata + }; + mappedCandidates.push(mappedCandidate); + }); + } + + return mappedCandidates; +} + +export function mapPromptFeedback( + promptFeedback: PromptFeedback +): PromptFeedback { + // Assign missing SafetyRating properties to their defaults if undefined. + const mappedSafetyRatings: SafetyRating[] = []; + promptFeedback.safetyRatings.forEach(safetyRating => { + mappedSafetyRatings.push({ + category: safetyRating.category, + probability: safetyRating.probability, + severity: safetyRating.severity ?? HarmSeverity.HARM_SEVERITY_UNSUPPORTED, + probabilityScore: safetyRating.probabilityScore ?? 0, + severityScore: safetyRating.severityScore ?? 0, + blocked: safetyRating.blocked + }); + }); + + const mappedPromptFeedback: PromptFeedback = { + blockReason: promptFeedback.blockReason, + safetyRatings: mappedSafetyRatings, + blockReasonMessage: promptFeedback.blockReasonMessage + }; + return mappedPromptFeedback; +} diff --git a/packages/vertexai/src/helpers.test.ts b/packages/vertexai/src/helpers.test.ts new file mode 100644 index 00000000000..8f5f164d6b8 --- /dev/null +++ b/packages/vertexai/src/helpers.test.ts @@ -0,0 +1,121 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { AI_TYPE, DEFAULT_LOCATION } from './constants'; +import { encodeInstanceIdentifier, decodeInstanceIdentifier } from './helpers'; +import { AIError } from './errors'; +import { AIErrorCode } from './types'; +import { GoogleAIBackend, VertexAIBackend } from './backend'; + +describe('Identifier Encoding/Decoding', () => { + describe('encodeInstanceIdentifier', () => { + it('should encode Vertex AI identifier with a specific location', () => { + const backend = new VertexAIBackend('us-east1'); + const expected = `${AI_TYPE}/vertexai/us-east1`; + expect(encodeInstanceIdentifier(backend)).to.equal(expected); + }); + + it('should encode Vertex AI identifier using default location if location is empty string', () => { + const backend = new VertexAIBackend(''); + const expected = `${AI_TYPE}/vertexai/${DEFAULT_LOCATION}`; + expect(encodeInstanceIdentifier(backend)).to.equal(expected); + }); + + it('should encode Google AI identifier', () => { + const backend = new GoogleAIBackend(); + const expected = `${AI_TYPE}/googleai`; + expect(encodeInstanceIdentifier(backend)).to.equal(expected); + }); + + it('should throw AIError for unknown backend type', () => { + expect(() => encodeInstanceIdentifier({} as any)).to.throw(AIError); + + try { + encodeInstanceIdentifier({} as any); + expect.fail('Expected encodeInstanceIdentifier to throw'); + } catch (e) { + expect(e).to.be.instanceOf(AIError); + const error = e as AIError; + expect(error.message).to.contain('Invalid backend'); + expect(error.code).to.equal(AIErrorCode.ERROR); + } + }); + }); + + describe('decodeInstanceIdentifier', () => { + it('should decode Vertex AI identifier with location', () => { + const encoded = `${AI_TYPE}/vertexai/europe-west1`; + const backend = new VertexAIBackend('europe-west1'); + expect(decodeInstanceIdentifier(encoded)).to.deep.equal(backend); + }); + + it('should throw an error if Vertex AI identifier string without explicit location part', () => { + const encoded = `${AI_TYPE}/vertexai`; + expect(() => decodeInstanceIdentifier(encoded)).to.throw(AIError); + + try { + decodeInstanceIdentifier(encoded); + expect.fail('Expected encodeInstanceIdentifier to throw'); + } catch (e) { + expect(e).to.be.instanceOf(AIError); + const error = e as AIError; + expect(error.message).to.contain( + `Invalid instance identifier, unknown location` + ); + expect(error.code).to.equal(AIErrorCode.ERROR); + } + }); + + it('should decode Google AI identifier', () => { + const encoded = `${AI_TYPE}/googleai`; + const backend = new GoogleAIBackend(); + expect(decodeInstanceIdentifier(encoded)).to.deep.equal(backend); + }); + + it('should throw AIError for invalid backend string', () => { + const encoded = `${AI_TYPE}/someotherbackend/location`; + expect(() => decodeInstanceIdentifier(encoded)).to.throw( + AIError, + `Invalid instance identifier string: '${encoded}'` + ); + try { + decodeInstanceIdentifier(encoded); + expect.fail('Expected decodeInstanceIdentifier to throw'); + } catch (e) { + expect(e).to.be.instanceOf(AIError); + expect((e as AIError).code).to.equal(AIErrorCode.ERROR); + } + }); + + it('should throw AIError for malformed identifier string (too few parts)', () => { + const encoded = AI_TYPE; + expect(() => decodeInstanceIdentifier(encoded)).to.throw( + AIError, + `Invalid instance identifier string: '${encoded}'` + ); + }); + + it('should throw AIError for malformed identifier string (incorrect prefix)', () => { + const encoded = 'firebase/AI/location'; + // This will also hit the default case in the switch statement + expect(() => decodeInstanceIdentifier(encoded)).to.throw( + AIError, + `Invalid instance identifier, unknown prefix 'firebase'` + ); + }); + }); +}); diff --git a/packages/vertexai/src/helpers.ts b/packages/vertexai/src/helpers.ts new file mode 100644 index 00000000000..709bf4369c5 --- /dev/null +++ b/packages/vertexai/src/helpers.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright 2025 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 { AI_TYPE } from './constants'; +import { AIError } from './errors'; +import { AIErrorCode } from './types'; +import { Backend, GoogleAIBackend, VertexAIBackend } from './backend'; + +/** + * Encodes a {@link Backend} into a string that will be used to uniquely identify {@link AI} + * instances by backend type. + * + * @internal + */ +export function encodeInstanceIdentifier(backend: Backend): string { + if (backend instanceof GoogleAIBackend) { + return `${AI_TYPE}/googleai`; + } else if (backend instanceof VertexAIBackend) { + return `${AI_TYPE}/vertexai/${backend.location}`; + } else { + throw new AIError( + AIErrorCode.ERROR, + `Invalid backend: ${JSON.stringify(backend.backendType)}` + ); + } +} + +/** + * Decodes an instance identifier string into a {@link Backend}. + * + * @internal + */ +export function decodeInstanceIdentifier(instanceIdentifier: string): Backend { + const identifierParts = instanceIdentifier.split('/'); + if (identifierParts[0] !== AI_TYPE) { + throw new AIError( + AIErrorCode.ERROR, + `Invalid instance identifier, unknown prefix '${identifierParts[0]}'` + ); + } + const backendType = identifierParts[1]; + switch (backendType) { + case 'vertexai': + const location: string | undefined = identifierParts[2]; + if (!location) { + throw new AIError( + AIErrorCode.ERROR, + `Invalid instance identifier, unknown location '${instanceIdentifier}'` + ); + } + return new VertexAIBackend(location); + case 'googleai': + return new GoogleAIBackend(); + default: + throw new AIError( + AIErrorCode.ERROR, + `Invalid instance identifier string: '${instanceIdentifier}'` + ); + } +} diff --git a/packages/vertexai/src/index.node.ts b/packages/vertexai/src/index.node.ts index 6a18788141a..1908e65b1cd 100644 --- a/packages/vertexai/src/index.node.ts +++ b/packages/vertexai/src/index.node.ts @@ -1,5 +1,5 @@ /** - * The Vertex AI in Firebase Web SDK. + * The Firebase AI Web SDK. * * @packageDocumentation */ @@ -22,21 +22,33 @@ */ import { registerVersion, _registerComponent } from '@firebase/app'; -import { VertexAIService } from './service'; -import { VERTEX_TYPE } from './constants'; +import { AIService } from './service'; +import { AI_TYPE } from './constants'; import { Component, ComponentType } from '@firebase/component'; import { name, version } from '../package.json'; +import { decodeInstanceIdentifier } from './helpers'; +import { AIError } from './errors'; +import { AIErrorCode } from './public-types'; -function registerVertex(): void { +function registerAI(): void { _registerComponent( new Component( - VERTEX_TYPE, - (container, { instanceIdentifier: location }) => { + AI_TYPE, + (container, { instanceIdentifier }) => { + if (!instanceIdentifier) { + throw new AIError( + AIErrorCode.ERROR, + 'AIService instance identifier is undefined.' + ); + } + + const backend = decodeInstanceIdentifier(instanceIdentifier); + // getImmediate for FirebaseApp will always succeed const app = container.getProvider('app').getImmediate(); const auth = container.getProvider('auth-internal'); const appCheckProvider = container.getProvider('app-check-internal'); - return new VertexAIService(app, auth, appCheckProvider, { location }); + return new AIService(app, backend, auth, appCheckProvider); }, ComponentType.PUBLIC ).setMultipleInstances(true) @@ -47,7 +59,7 @@ function registerVertex(): void { registerVersion(name, version, '__BUILD_TARGET__'); } -registerVertex(); +registerAI(); export * from './api'; export * from './public-types'; diff --git a/packages/vertexai/src/index.ts b/packages/vertexai/src/index.ts index 5d646e8d9d0..8451d68bbf0 100644 --- a/packages/vertexai/src/index.ts +++ b/packages/vertexai/src/index.ts @@ -1,12 +1,12 @@ /** - * The Vertex AI in Firebase Web SDK. + * The Firebase AI Web SDK. * * @packageDocumentation */ /** * @license - * Copyright 2024 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,13 @@ */ import { registerVersion, _registerComponent } from '@firebase/app'; -import { VertexAIService } from './service'; -import { VERTEX_TYPE } from './constants'; +import { AIService } from './service'; +import { AI_TYPE } from './constants'; import { Component, ComponentType } from '@firebase/component'; import { name, version } from '../package.json'; +import { decodeInstanceIdentifier } from './helpers'; +import { AIError } from './api'; +import { AIErrorCode } from './types'; declare global { interface Window { @@ -33,16 +36,25 @@ declare global { } } -function registerVertex(): void { +function registerAI(): void { _registerComponent( new Component( - VERTEX_TYPE, - (container, { instanceIdentifier: location }) => { + AI_TYPE, + (container, { instanceIdentifier }) => { + if (!instanceIdentifier) { + throw new AIError( + AIErrorCode.ERROR, + 'AIService instance identifier is undefined.' + ); + } + + const backend = decodeInstanceIdentifier(instanceIdentifier); + // getImmediate for FirebaseApp will always succeed const app = container.getProvider('app').getImmediate(); const auth = container.getProvider('auth-internal'); const appCheckProvider = container.getProvider('app-check-internal'); - return new VertexAIService(app, auth, appCheckProvider, { location }); + return new AIService(app, backend, auth, appCheckProvider); }, ComponentType.PUBLIC ).setMultipleInstances(true) @@ -53,7 +65,7 @@ function registerVertex(): void { registerVersion(name, version, '__BUILD_TARGET__'); } -registerVertex(); +registerAI(); export * from './api'; export * from './public-types'; diff --git a/packages/vertexai/src/methods/chat-session-helpers.ts b/packages/vertexai/src/methods/chat-session-helpers.ts index 2106a40b90b..1bb0e2798f2 100644 --- a/packages/vertexai/src/methods/chat-session-helpers.ts +++ b/packages/vertexai/src/methods/chat-session-helpers.ts @@ -15,14 +15,8 @@ * limitations under the License. */ -import { - Content, - POSSIBLE_ROLES, - Part, - Role, - VertexAIErrorCode -} from '../types'; -import { VertexAIError } from '../errors'; +import { Content, POSSIBLE_ROLES, Part, Role, AIErrorCode } from '../types'; +import { AIError } from '../errors'; // https://ai.google.dev/api/rest/v1beta/Content#part @@ -54,14 +48,14 @@ export function validateChatHistory(history: Content[]): void { for (const currContent of history) { const { role, parts } = currContent; if (!prevContent && role !== 'user') { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `First Content should be with role 'user', got ${role}` ); } if (!POSSIBLE_ROLES.includes(role)) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `Each item should include role field. Got ${role} but valid roles are: ${JSON.stringify( POSSIBLE_ROLES )}` @@ -69,15 +63,15 @@ export function validateChatHistory(history: Content[]): void { } if (!Array.isArray(parts)) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `Content should have 'parts' but property with an array of Parts` ); } if (parts.length === 0) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `Each Content should have at least one part` ); } @@ -99,8 +93,8 @@ export function validateChatHistory(history: Content[]): void { const validParts = VALID_PARTS_PER_ROLE[role]; for (const key of VALID_PART_FIELDS) { if (!validParts.includes(key) && countFields[key] > 0) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `Content with role '${role}' can't contain '${key}' part` ); } @@ -109,8 +103,8 @@ export function validateChatHistory(history: Content[]): void { if (prevContent) { const validPreviousContentRoles = VALID_PREVIOUS_CONTENT_ROLES[role]; if (!validPreviousContentRoles.includes(prevContent.role)) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, `Content with role '${role}' can't follow '${ prevContent.role }'. Valid previous roles: ${JSON.stringify( diff --git a/packages/vertexai/src/methods/chat-session.test.ts b/packages/vertexai/src/methods/chat-session.test.ts index bd389a3d778..0564aa84ed6 100644 --- a/packages/vertexai/src/methods/chat-session.test.ts +++ b/packages/vertexai/src/methods/chat-session.test.ts @@ -23,6 +23,7 @@ import * as generateContentMethods from './generate-content'; import { GenerateContentStreamResult } from '../types'; import { ChatSession } from './chat-session'; import { ApiSettings } from '../types/internal'; +import { VertexAIBackend } from '../backend'; use(sinonChai); use(chaiAsPromised); @@ -31,7 +32,8 @@ const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', appId: 'my-appid', - location: 'us-central1' + location: 'us-central1', + backend: new VertexAIBackend() }; describe('ChatSession', () => { diff --git a/packages/vertexai/src/methods/count-tokens.test.ts b/packages/vertexai/src/methods/count-tokens.test.ts index 9eccbf702fe..7e04ddb3561 100644 --- a/packages/vertexai/src/methods/count-tokens.test.ts +++ b/packages/vertexai/src/methods/count-tokens.test.ts @@ -16,7 +16,7 @@ */ import { expect, use } from 'chai'; -import { match, restore, stub } from 'sinon'; +import Sinon, { match, restore, stub } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import { getMockResponse } from '../../test-utils/mock-response'; @@ -25,6 +25,8 @@ import { countTokens } from './count-tokens'; import { CountTokensRequest } from '../types'; import { ApiSettings } from '../types/internal'; import { Task } from '../requests/request'; +import { mapCountTokensRequest } from '../googleai-mappers'; +import { GoogleAIBackend, VertexAIBackend } from '../backend'; use(sinonChai); use(chaiAsPromised); @@ -33,7 +35,16 @@ const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', appId: 'my-appid', - location: 'us-central1' + location: 'us-central1', + backend: new VertexAIBackend() +}; + +const fakeGoogleAIApiSettings: ApiSettings = { + apiKey: 'key', + project: 'my-project', + appId: 'my-appid', + location: '', + backend: new GoogleAIBackend() }; const fakeRequestParams: CountTokensRequest = { @@ -139,4 +150,30 @@ describe('countTokens()', () => { ).to.be.rejectedWith(/404.*not found/); expect(mockFetch).to.be.called; }); + describe('googleAI', () => { + let makeRequestStub: Sinon.SinonStub; + + beforeEach(() => { + makeRequestStub = stub(request, 'makeRequest'); + }); + + afterEach(() => { + restore(); + }); + + it('maps request to GoogleAI format', async () => { + makeRequestStub.resolves({ ok: true, json: () => {} } as Response); // Unused + + await countTokens(fakeGoogleAIApiSettings, 'model', fakeRequestParams); + + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.COUNT_TOKENS, + fakeGoogleAIApiSettings, + false, + JSON.stringify(mapCountTokensRequest(fakeRequestParams, 'model')), + undefined + ); + }); + }); }); diff --git a/packages/vertexai/src/methods/count-tokens.ts b/packages/vertexai/src/methods/count-tokens.ts index c9d43a5b6fd..b1e60e3a182 100644 --- a/packages/vertexai/src/methods/count-tokens.ts +++ b/packages/vertexai/src/methods/count-tokens.ts @@ -22,6 +22,8 @@ import { } from '../types'; import { Task, makeRequest } from '../requests/request'; import { ApiSettings } from '../types/internal'; +import * as GoogleAIMapper from '../googleai-mappers'; +import { BackendType } from '../public-types'; export async function countTokens( apiSettings: ApiSettings, @@ -29,12 +31,19 @@ export async function countTokens( params: CountTokensRequest, requestOptions?: RequestOptions ): Promise { + let body: string = ''; + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + const mappedParams = GoogleAIMapper.mapCountTokensRequest(params, model); + body = JSON.stringify(mappedParams); + } else { + body = JSON.stringify(params); + } const response = await makeRequest( model, Task.COUNT_TOKENS, apiSettings, false, - JSON.stringify(params), + body, requestOptions ); return response.json(); diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/vertexai/src/methods/generate-content.test.ts index 1d15632f828..13250fd83dd 100644 --- a/packages/vertexai/src/methods/generate-content.test.ts +++ b/packages/vertexai/src/methods/generate-content.test.ts @@ -16,13 +16,14 @@ */ import { expect, use } from 'chai'; -import { match, restore, stub } from 'sinon'; +import Sinon, { match, restore, stub } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import { getMockResponse } from '../../test-utils/mock-response'; import * as request from '../requests/request'; import { generateContent } from './generate-content'; import { + AIErrorCode, GenerateContentRequest, HarmBlockMethod, HarmBlockThreshold, @@ -30,6 +31,9 @@ import { } from '../types'; import { ApiSettings } from '../types/internal'; import { Task } from '../requests/request'; +import { AIError } from '../api'; +import { mapGenerateContentRequest } from '../googleai-mappers'; +import { GoogleAIBackend, VertexAIBackend } from '../backend'; use(sinonChai); use(chaiAsPromised); @@ -38,7 +42,16 @@ const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', appId: 'my-appid', - location: 'us-central1' + location: 'us-central1', + backend: new VertexAIBackend() +}; + +const fakeGoogleAIApiSettings: ApiSettings = { + apiKey: 'key', + project: 'my-project', + appId: 'my-appid', + location: 'us-central1', + backend: new GoogleAIBackend() }; const fakeRequestParams: GenerateContentRequest = { @@ -55,6 +68,19 @@ const fakeRequestParams: GenerateContentRequest = { ] }; +const fakeGoogleAIRequestParams: GenerateContentRequest = { + contents: [{ parts: [{ text: 'hello' }], role: 'user' }], + generationConfig: { + topK: 16 + }, + safetySettings: [ + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + } + ] +}; + describe('generateContent()', () => { afterEach(() => { restore(); @@ -78,9 +104,7 @@ describe('generateContent()', () => { Task.GENERATE_CONTENT, fakeApiSettings, false, - match((value: string) => { - return value.includes('contents'); - }), + JSON.stringify(fakeRequestParams), undefined ); }); @@ -289,4 +313,66 @@ describe('generateContent()', () => { ); expect(mockFetch).to.be.called; }); + describe('googleAI', () => { + let makeRequestStub: Sinon.SinonStub; + + beforeEach(() => { + makeRequestStub = stub(request, 'makeRequest'); + }); + + afterEach(() => { + restore(); + }); + + it('throws error when method is defined', async () => { + const mockResponse = getMockResponse( + 'googleAI', + 'unary-success-basic-reply-short.txt' + ); + makeRequestStub.resolves(mockResponse as Response); + + const requestParamsWithMethod: GenerateContentRequest = { + contents: [{ parts: [{ text: 'hello' }], role: 'user' }], + safetySettings: [ + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + method: HarmBlockMethod.SEVERITY // Unsupported in Google AI. + } + ] + }; + + // Expect generateContent to throw a AIError that method is not supported. + await expect( + generateContent( + fakeGoogleAIApiSettings, + 'model', + requestParamsWithMethod + ) + ).to.be.rejectedWith(AIError, AIErrorCode.UNSUPPORTED); + expect(makeRequestStub).to.not.be.called; + }); + it('maps request to GoogleAI format', async () => { + const mockResponse = getMockResponse( + 'googleAI', + 'unary-success-basic-reply-short.txt' + ); + makeRequestStub.resolves(mockResponse as Response); + + await generateContent( + fakeGoogleAIApiSettings, + 'model', + fakeGoogleAIRequestParams + ); + + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.GENERATE_CONTENT, + fakeGoogleAIApiSettings, + false, + JSON.stringify(mapGenerateContentRequest(fakeGoogleAIRequestParams)), + undefined + ); + }); + }); }); diff --git a/packages/vertexai/src/methods/generate-content.ts b/packages/vertexai/src/methods/generate-content.ts index 0944b38016a..5f7902f5954 100644 --- a/packages/vertexai/src/methods/generate-content.ts +++ b/packages/vertexai/src/methods/generate-content.ts @@ -26,6 +26,8 @@ import { Task, makeRequest } from '../requests/request'; import { createEnhancedContentResponse } from '../requests/response-helpers'; import { processStream } from '../requests/stream-reader'; import { ApiSettings } from '../types/internal'; +import * as GoogleAIMapper from '../googleai-mappers'; +import { BackendType } from '../public-types'; export async function generateContentStream( apiSettings: ApiSettings, @@ -33,6 +35,9 @@ export async function generateContentStream( params: GenerateContentRequest, requestOptions?: RequestOptions ): Promise { + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + params = GoogleAIMapper.mapGenerateContentRequest(params); + } const response = await makeRequest( model, Task.STREAM_GENERATE_CONTENT, @@ -41,7 +46,7 @@ export async function generateContentStream( JSON.stringify(params), requestOptions ); - return processStream(response); + return processStream(response, apiSettings); // TODO: Map streaming responses } export async function generateContent( @@ -50,6 +55,9 @@ export async function generateContent( params: GenerateContentRequest, requestOptions?: RequestOptions ): Promise { + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + params = GoogleAIMapper.mapGenerateContentRequest(params); + } const response = await makeRequest( model, Task.GENERATE_CONTENT, @@ -58,9 +66,26 @@ export async function generateContent( JSON.stringify(params), requestOptions ); - const responseJson: GenerateContentResponse = await response.json(); - const enhancedResponse = createEnhancedContentResponse(responseJson); + const generateContentResponse = await processGenerateContentResponse( + response, + apiSettings + ); + const enhancedResponse = createEnhancedContentResponse( + generateContentResponse + ); return { response: enhancedResponse }; } + +async function processGenerateContentResponse( + response: Response, + apiSettings: ApiSettings +): Promise { + const responseJson = await response.json(); + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + return GoogleAIMapper.mapGenerateContentResponse(responseJson); + } else { + return responseJson; + } +} diff --git a/packages/vertexai/src/models/vertexai-model.test.ts b/packages/vertexai/src/models/ai-model.test.ts similarity index 66% rename from packages/vertexai/src/models/vertexai-model.test.ts rename to packages/vertexai/src/models/ai-model.test.ts index 7aa7f806e7f..4f23fe9d06f 100644 --- a/packages/vertexai/src/models/vertexai-model.test.ts +++ b/packages/vertexai/src/models/ai-model.test.ts @@ -15,24 +15,25 @@ * limitations under the License. */ import { use, expect } from 'chai'; -import { VertexAI, VertexAIErrorCode } from '../public-types'; +import { AI, AIErrorCode } from '../public-types'; import sinonChai from 'sinon-chai'; -import { VertexAIModel } from './vertexai-model'; -import { VertexAIError } from '../errors'; +import { AIModel } from './ai-model'; +import { AIError } from '../errors'; +import { VertexAIBackend } from '../backend'; use(sinonChai); /** - * A class that extends VertexAIModel that allows us to test the protected constructor. + * A class that extends AIModel that allows us to test the protected constructor. */ -class TestModel extends VertexAIModel { +class TestModel extends AIModel { /* eslint-disable @typescript-eslint/no-useless-constructor */ - constructor(vertexAI: VertexAI, modelName: string) { - super(vertexAI, modelName); + constructor(ai: AI, modelName: string) { + super(ai, modelName); } } -const fakeVertexAI: VertexAI = { +const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -42,31 +43,32 @@ const fakeVertexAI: VertexAI = { appId: 'my-appid' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; -describe('VertexAIModel', () => { +describe('AIModel', () => { it('handles plain model name', () => { - const testModel = new TestModel(fakeVertexAI, 'my-model'); + const testModel = new TestModel(fakeAI, 'my-model'); expect(testModel.model).to.equal('publishers/google/models/my-model'); }); it('handles models/ prefixed model name', () => { - const testModel = new TestModel(fakeVertexAI, 'models/my-model'); + const testModel = new TestModel(fakeAI, 'models/my-model'); expect(testModel.model).to.equal('publishers/google/models/my-model'); }); it('handles full model name', () => { const testModel = new TestModel( - fakeVertexAI, + fakeAI, 'publishers/google/models/my-model' ); expect(testModel.model).to.equal('publishers/google/models/my-model'); }); it('handles prefixed tuned model name', () => { - const testModel = new TestModel(fakeVertexAI, 'tunedModels/my-model'); + const testModel = new TestModel(fakeAI, 'tunedModels/my-model'); expect(testModel.model).to.equal('tunedModels/my-model'); }); it('throws if not passed an api key', () => { - const fakeVertexAI: VertexAI = { + const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -74,16 +76,17 @@ describe('VertexAIModel', () => { projectId: 'my-project' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; try { - new TestModel(fakeVertexAI, 'my-model'); + new TestModel(fakeAI, 'my-model'); } catch (e) { - expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.NO_API_KEY); + expect((e as AIError).code).to.equal(AIErrorCode.NO_API_KEY); } }); it('throws if not passed a project ID', () => { - const fakeVertexAI: VertexAI = { + const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -91,18 +94,17 @@ describe('VertexAIModel', () => { apiKey: 'key' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; try { - new TestModel(fakeVertexAI, 'my-model'); + new TestModel(fakeAI, 'my-model'); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.NO_PROJECT_ID - ); + expect((e as AIError).code).to.equal(AIErrorCode.NO_PROJECT_ID); } }); it('throws if not passed an app ID', () => { - const fakeVertexAI: VertexAI = { + const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -111,12 +113,13 @@ describe('VertexAIModel', () => { projectId: 'my-project' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; try { - new TestModel(fakeVertexAI, 'my-model'); + new TestModel(fakeAI, 'my-model'); } catch (e) { - expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.NO_APP_ID); + expect((e as AIError).code).to.equal(AIErrorCode.NO_APP_ID); } }); }); diff --git a/packages/vertexai/src/models/vertexai-model.ts b/packages/vertexai/src/models/ai-model.ts similarity index 55% rename from packages/vertexai/src/models/vertexai-model.ts rename to packages/vertexai/src/models/ai-model.ts index cac14845961..084dbe329cc 100644 --- a/packages/vertexai/src/models/vertexai-model.ts +++ b/packages/vertexai/src/models/ai-model.ts @@ -15,18 +15,21 @@ * limitations under the License. */ -import { VertexAIError } from '../errors'; -import { VertexAI, VertexAIErrorCode } from '../public-types'; -import { VertexAIService } from '../service'; +import { AIError } from '../errors'; +import { AIErrorCode, AI, BackendType } from '../public-types'; +import { AIService } from '../service'; import { ApiSettings } from '../types/internal'; import { _isFirebaseServerApp } from '@firebase/app'; /** - * Base class for Vertex AI in Firebase model APIs. + * Base class for Firebase AI model APIs. + * + * Instances of this class are associated with a specific Firebase AI {@link Backend} + * and provide methods for interacting with the configured generative model. * * @public */ -export abstract class VertexAIModel { +export abstract class AIModel { /** * The fully qualified model resource name to use for generating images * (for example, `publishers/google/models/imagen-3.0-generate-002`). @@ -39,12 +42,12 @@ export abstract class VertexAIModel { protected _apiSettings: ApiSettings; /** - * Constructs a new instance of the {@link VertexAIModel} class. + * Constructs a new instance of the {@link AIModel} class. * * This constructor should only be called from subclasses that provide * a model API. * - * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param ai - an {@link AI} instance. * @param modelName - The name of the model being used. It can be in one of the following formats: * - `my-model` (short name, will resolve to `publishers/google/models/my-model`) * - `models/my-model` (will resolve to `publishers/google/models/my-model`) @@ -55,51 +58,51 @@ export abstract class VertexAIModel { * * @internal */ - protected constructor(vertexAI: VertexAI, modelName: string) { - this.model = VertexAIModel.normalizeModelName(modelName); - - if (!vertexAI.app?.options?.apiKey) { - throw new VertexAIError( - VertexAIErrorCode.NO_API_KEY, - `The "apiKey" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid API key.` + protected constructor(ai: AI, modelName: string) { + if (!ai.app?.options?.apiKey) { + throw new AIError( + AIErrorCode.NO_API_KEY, + `The "apiKey" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid API key.` ); - } else if (!vertexAI.app?.options?.projectId) { - throw new VertexAIError( - VertexAIErrorCode.NO_PROJECT_ID, - `The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` + } else if (!ai.app?.options?.projectId) { + throw new AIError( + AIErrorCode.NO_PROJECT_ID, + `The "projectId" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid project ID.` ); - } else if (!vertexAI.app?.options?.appId) { - throw new VertexAIError( - VertexAIErrorCode.NO_APP_ID, - `The "appId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid app ID.` + } else if (!ai.app?.options?.appId) { + throw new AIError( + AIErrorCode.NO_APP_ID, + `The "appId" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid app ID.` ); } else { this._apiSettings = { - apiKey: vertexAI.app.options.apiKey, - project: vertexAI.app.options.projectId, - appId: vertexAI.app.options.appId, - automaticDataCollectionEnabled: - vertexAI.app.automaticDataCollectionEnabled, - location: vertexAI.location + apiKey: ai.app.options.apiKey, + project: ai.app.options.projectId, + appId: ai.app.options.appId, + automaticDataCollectionEnabled: ai.app.automaticDataCollectionEnabled, + location: ai.location, + backend: ai.backend }; - if ( - _isFirebaseServerApp(vertexAI.app) && - vertexAI.app.settings.appCheckToken - ) { - const token = vertexAI.app.settings.appCheckToken; + if (_isFirebaseServerApp(ai.app) && ai.app.settings.appCheckToken) { + const token = ai.app.settings.appCheckToken; this._apiSettings.getAppCheckToken = () => { return Promise.resolve({ token }); }; - } else if ((vertexAI as VertexAIService).appCheck) { + } else if ((ai as AIService).appCheck) { this._apiSettings.getAppCheckToken = () => - (vertexAI as VertexAIService).appCheck!.getToken(); + (ai as AIService).appCheck!.getToken(); } - if ((vertexAI as VertexAIService).auth) { + if ((ai as AIService).auth) { this._apiSettings.getAuthToken = () => - (vertexAI as VertexAIService).auth!.getToken(); + (ai as AIService).auth!.getToken(); } + + this.model = AIModel.normalizeModelName( + modelName, + this._apiSettings.backend.backendType + ); } } @@ -108,8 +111,31 @@ export abstract class VertexAIModel { * * @param modelName - The model name to normalize. * @returns The fully qualified model resource name. + * + * @internal + */ + static normalizeModelName( + modelName: string, + backendType: BackendType + ): string { + if (backendType === BackendType.GOOGLE_AI) { + return AIModel.normalizeGoogleAIModelName(modelName); + } else { + return AIModel.normalizeVertexAIModelName(modelName); + } + } + + /** + * @internal + */ + private static normalizeGoogleAIModelName(modelName: string): string { + return `models/${modelName}`; + } + + /** + * @internal */ - static normalizeModelName(modelName: string): string { + private static normalizeVertexAIModelName(modelName: string): string { let model: string; if (modelName.includes('/')) { if (modelName.startsWith('models/')) { diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index 51ea8aafead..d055b82b1be 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -16,15 +16,16 @@ */ import { use, expect } from 'chai'; import { GenerativeModel } from './generative-model'; -import { FunctionCallingMode, VertexAI } from '../public-types'; +import { FunctionCallingMode, AI } from '../public-types'; import * as request from '../requests/request'; import { match, restore, stub } from 'sinon'; import { getMockResponse } from '../../test-utils/mock-response'; import sinonChai from 'sinon-chai'; +import { VertexAIBackend } from '../backend'; use(sinonChai); -const fakeVertexAI: VertexAI = { +const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -34,12 +35,13 @@ const fakeVertexAI: VertexAI = { appId: 'my-appid' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; describe('GenerativeModel', () => { it('passes params through to generateContent', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', tools: [ { @@ -84,7 +86,7 @@ describe('GenerativeModel', () => { restore(); }); it('passes text-only systemInstruction through to generateContent', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', systemInstruction: 'be friendly' }); @@ -110,7 +112,7 @@ describe('GenerativeModel', () => { restore(); }); it('generateContent overrides model values', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', tools: [ { @@ -165,8 +167,37 @@ describe('GenerativeModel', () => { ); restore(); }); + it('passes base model params through to ChatSession when there are no startChatParams', async () => { + const genModel = new GenerativeModel(fakeAI, { + model: 'my-model', + generationConfig: { + topK: 1 + } + }); + const chatSession = genModel.startChat(); + expect(chatSession.params?.generationConfig).to.deep.equal({ + topK: 1 + }); + restore(); + }); + it('overrides base model params with startChatParams', () => { + const genModel = new GenerativeModel(fakeAI, { + model: 'my-model', + generationConfig: { + topK: 1 + } + }); + const chatSession = genModel.startChat({ + generationConfig: { + topK: 2 + } + }); + expect(chatSession.params?.generationConfig).to.deep.equal({ + topK: 2 + }); + }); it('passes params through to chat.sendMessage', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', tools: [ { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } @@ -208,7 +239,7 @@ describe('GenerativeModel', () => { restore(); }); it('passes text-only systemInstruction through to chat.sendMessage', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', systemInstruction: 'be friendly' }); @@ -234,7 +265,7 @@ describe('GenerativeModel', () => { restore(); }); it('startChat overrides model values', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { + const genModel = new GenerativeModel(fakeAI, { model: 'my-model', tools: [ { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } @@ -294,7 +325,7 @@ describe('GenerativeModel', () => { restore(); }); it('calls countTokens', async () => { - const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model' }); + const genModel = new GenerativeModel(fakeAI, { model: 'my-model' }); const mockResponse = getMockResponse( 'vertexAI', 'unary-success-total-tokens.json' diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index 1af1ee700d5..b09a9290aa4 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -41,14 +41,14 @@ import { formatGenerateContentInput, formatSystemInstruction } from '../requests/request-helpers'; -import { VertexAI } from '../public-types'; -import { VertexAIModel } from './vertexai-model'; +import { AI } from '../public-types'; +import { AIModel } from './ai-model'; /** * Class for generative model APIs. * @public */ -export class GenerativeModel extends VertexAIModel { +export class GenerativeModel extends AIModel { generationConfig: GenerationConfig; safetySettings: SafetySetting[]; requestOptions?: RequestOptions; @@ -57,11 +57,11 @@ export class GenerativeModel extends VertexAIModel { systemInstruction?: Content; constructor( - vertexAI: VertexAI, + ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions ) { - super(vertexAI, modelParams.model); + super(ai, modelParams.model); this.generationConfig = modelParams.generationConfig || {}; this.safetySettings = modelParams.safetySettings || []; this.tools = modelParams.tools; diff --git a/packages/vertexai/src/models/imagen-model.test.ts b/packages/vertexai/src/models/imagen-model.test.ts index 9e534f2195a..f4121e18f2d 100644 --- a/packages/vertexai/src/models/imagen-model.test.ts +++ b/packages/vertexai/src/models/imagen-model.test.ts @@ -20,18 +20,19 @@ import { ImagenAspectRatio, ImagenPersonFilterLevel, ImagenSafetyFilterLevel, - VertexAI, - VertexAIErrorCode + AI, + AIErrorCode } from '../public-types'; import * as request from '../requests/request'; import sinonChai from 'sinon-chai'; -import { VertexAIError } from '../errors'; +import { AIError } from '../errors'; import { getMockResponse } from '../../test-utils/mock-response'; import { match, restore, stub } from 'sinon'; +import { VertexAIBackend } from '../backend'; use(sinonChai); -const fakeVertexAI: VertexAI = { +const fakeAI: AI = { app: { name: 'DEFAULT', automaticDataCollectionEnabled: true, @@ -41,6 +42,7 @@ const fakeVertexAI: VertexAI = { appId: 'my-appid' } }, + backend: new VertexAIBackend('us-central1'), location: 'us-central1' }; @@ -54,7 +56,7 @@ describe('ImagenModel', () => { mockResponse as Response ); - const imagenModel = new ImagenModel(fakeVertexAI, { + const imagenModel = new ImagenModel(fakeAI, { model: 'my-model' }); const prompt = 'A photorealistic image of a toy boat at sea.'; @@ -75,7 +77,7 @@ describe('ImagenModel', () => { restore(); }); it('generateImages makes a request to predict with generation config and safety settings', async () => { - const imagenModel = new ImagenModel(fakeVertexAI, { + const imagenModel = new ImagenModel(fakeAI, { model: 'my-model', generationConfig: { negativePrompt: 'do not hallucinate', @@ -146,15 +148,15 @@ describe('ImagenModel', () => { json: mockResponse.json } as Response); - const imagenModel = new ImagenModel(fakeVertexAI, { + const imagenModel = new ImagenModel(fakeAI, { model: 'my-model' }); try { await imagenModel.generateImages('some inappropriate prompt.'); } catch (e) { - expect((e as VertexAIError).code).to.equal(VertexAIErrorCode.FETCH_ERROR); - expect((e as VertexAIError).message).to.include('400'); - expect((e as VertexAIError).message).to.include( + expect((e as AIError).code).to.equal(AIErrorCode.FETCH_ERROR); + expect((e as AIError).message).to.include('400'); + expect((e as AIError).message).to.include( "Image generation failed with the following error: The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices. Try rephrasing the prompt. If you think this was an error, send feedback." ); } finally { diff --git a/packages/vertexai/src/models/imagen-model.ts b/packages/vertexai/src/models/imagen-model.ts index 04514ef6ffd..3c76a1c721c 100644 --- a/packages/vertexai/src/models/imagen-model.ts +++ b/packages/vertexai/src/models/imagen-model.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { VertexAI } from '../public-types'; +import { AI } from '../public-types'; import { Task, makeRequest } from '../requests/request'; import { createPredictRequestBody } from '../requests/request-helpers'; import { handlePredictResponse } from '../requests/response-helpers'; @@ -28,7 +28,7 @@ import { ImagenGenerationResponse, ImagenSafetySettings } from '../types'; -import { VertexAIModel } from './vertexai-model'; +import { AIModel } from './ai-model'; /** * Class for Imagen model APIs. @@ -38,7 +38,7 @@ import { VertexAIModel } from './vertexai-model'; * @example * ```javascript * const imagen = new ImagenModel( - * vertexAI, + * ai, * { * model: 'imagen-3.0-generate-002' * } @@ -52,7 +52,7 @@ import { VertexAIModel } from './vertexai-model'; * * @beta */ -export class ImagenModel extends VertexAIModel { +export class ImagenModel extends AIModel { /** * The Imagen generation configuration. */ @@ -65,7 +65,7 @@ export class ImagenModel extends VertexAIModel { /** * Constructs a new instance of the {@link ImagenModel} class. * - * @param vertexAI - An instance of the Vertex AI in Firebase SDK. + * @param ai - an {@link AI} instance. * @param modelParams - Parameters to use when making requests to Imagen. * @param requestOptions - Additional options to use when making requests. * @@ -73,12 +73,12 @@ export class ImagenModel extends VertexAIModel { * Firebase config. */ constructor( - vertexAI: VertexAI, + ai: AI, modelParams: ImagenModelParams, public requestOptions?: RequestOptions ) { const { model, generationConfig, safetySettings } = modelParams; - super(vertexAI, model); + super(ai, model); this.generationConfig = generationConfig; this.safetySettings = safetySettings; } diff --git a/packages/vertexai/src/models/index.ts b/packages/vertexai/src/models/index.ts index aec06be26fd..cb694a5360b 100644 --- a/packages/vertexai/src/models/index.ts +++ b/packages/vertexai/src/models/index.ts @@ -15,6 +15,6 @@ * limitations under the License. */ -export * from './vertexai-model'; +export * from './ai-model'; export * from './generative-model'; export * from './imagen-model'; diff --git a/packages/vertexai/src/public-types.ts b/packages/vertexai/src/public-types.ts index fbc5d51084d..b12615a81ed 100644 --- a/packages/vertexai/src/public-types.ts +++ b/packages/vertexai/src/public-types.ts @@ -16,25 +16,98 @@ */ import { FirebaseApp } from '@firebase/app'; +import { Backend } from './backend'; export * from './types'; /** - * An instance of the Vertex AI in Firebase SDK. + * An instance of the Firebase AI SDK. + * + * For more information, refer to the documentation for the new {@link AI} interface. + * * @public */ -export interface VertexAI { +export type VertexAI = AI; + +/** + * Options when initializing the Firebase AI SDK. + * + * @public + */ +export interface VertexAIOptions { + location?: string; +} + +/** + * An instance of the Firebase AI SDK. + * + * Do not create this instance directly. Instead, use {@link getAI | getAI()}. + * + * @public + */ +export interface AI { /** - * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. + * The {@link @firebase/app#FirebaseApp} this {@link AI} instance is associated with. */ app: FirebaseApp; + /** + * A {@link Backend} instance that specifies the configuration for the target backend, + * either the Gemini Developer API (using {@link GoogleAIBackend}) or the + * Vertex AI Gemini API (using {@link VertexAIBackend}). + */ + backend: Backend; + /** + * The location configured for this AI service instance, relevant for Vertex AI backends. + * + * @deprecated use `AI.backend.location` instead. + */ location: string; } /** - * Options when initializing the Vertex AI in Firebase SDK. + * An enum-like object containing constants that represent the supported backends + * for the Firebase AI SDK. + * This determines which backend service (Vertex AI Gemini API or Gemini Developer API) + * the SDK will communicate with. + * + * These values are assigned to the `backendType` property within the specific backend + * configuration objects ({@link GoogleAIBackend} or {@link VertexAIBackend}) to identify + * which service to target. + * * @public */ -export interface VertexAIOptions { - location?: string; +export const BackendType = { + /** + * Identifies the backend service for the Vertex AI Gemini API provided through Google Cloud. + * Use this constant when creating a {@link VertexAIBackend} configuration. + */ + VERTEX_AI: 'VERTEX_AI', + + /** + * Identifies the backend service for the Gemini Developer API ({@link https://ai.google/ | Google AI}). + * Use this constant when creating a {@link GoogleAIBackend} configuration. + */ + GOOGLE_AI: 'GOOGLE_AI' +} as const; // Using 'as const' makes the string values literal types + +/** + * Type alias representing valid backend types. + * It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. + * + * @public + */ +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; + +/** + * Options for initializing the AI service using {@link getAI | getAI()}. + * This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) + * and configuring its specific options (like location for Vertex AI). + * + * @public + */ +export interface AIOptions { + /** + * The backend configuration to use for the AI service instance. + */ + backend: Backend; } diff --git a/packages/vertexai/src/requests/request-helpers.ts b/packages/vertexai/src/requests/request-helpers.ts index fd2cd04e0fd..c4cc1a20acc 100644 --- a/packages/vertexai/src/requests/request-helpers.ts +++ b/packages/vertexai/src/requests/request-helpers.ts @@ -15,13 +15,8 @@ * limitations under the License. */ -import { - Content, - GenerateContentRequest, - Part, - VertexAIErrorCode -} from '../types'; -import { VertexAIError } from '../errors'; +import { Content, GenerateContentRequest, Part, AIErrorCode } from '../types'; +import { AIError } from '../errors'; import { ImagenGenerationParams, PredictRequestBody } from '../types/internal'; export function formatSystemInstruction( @@ -87,15 +82,15 @@ function assignRoleToPartsAndValidateSendMessageRequest( } if (hasUserContent && hasFunctionContent) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, 'Within a single message, FunctionResponse cannot be mixed with other type of Part in the request for sending chat message.' ); } if (!hasUserContent && !hasFunctionContent) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, 'No Content is provided for sending chat message.' ); } diff --git a/packages/vertexai/src/requests/request.test.ts b/packages/vertexai/src/requests/request.test.ts index cd39a0f8ae5..0d162906fdc 100644 --- a/packages/vertexai/src/requests/request.test.ts +++ b/packages/vertexai/src/requests/request.test.ts @@ -22,9 +22,10 @@ import chaiAsPromised from 'chai-as-promised'; import { RequestUrl, Task, getHeaders, makeRequest } from './request'; import { ApiSettings } from '../types/internal'; import { DEFAULT_API_VERSION } from '../constants'; -import { VertexAIErrorCode } from '../types'; -import { VertexAIError } from '../errors'; +import { AIErrorCode } from '../types'; +import { AIError } from '../errors'; import { getMockResponse } from '../../test-utils/mock-response'; +import { VertexAIBackend } from '../backend'; use(sinonChai); use(chaiAsPromised); @@ -33,7 +34,8 @@ const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', appId: 'my-appid', - location: 'us-central1' + location: 'us-central1', + backend: new VertexAIBackend() }; describe('request methods', () => { @@ -106,6 +108,7 @@ describe('request methods', () => { project: 'myproject', appId: 'my-appid', location: 'moon', + backend: new VertexAIBackend(), getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) }; @@ -132,6 +135,7 @@ describe('request methods', () => { project: 'myproject', appId: 'my-appid', location: 'moon', + backend: new VertexAIBackend(), automaticDataCollectionEnabled: true, getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) @@ -156,6 +160,7 @@ describe('request methods', () => { project: 'myproject', appId: 'my-appid', location: 'moon', + backend: new VertexAIBackend(), automaticDataCollectionEnabled: false, getAuthToken: () => Promise.resolve({ accessToken: 'authtoken' }), getAppCheckToken: () => Promise.resolve({ token: 'appchecktoken' }) @@ -182,7 +187,8 @@ describe('request methods', () => { apiKey: 'key', project: 'myproject', appId: 'my-appid', - location: 'moon' + location: 'moon', + backend: new VertexAIBackend() }, true, {} @@ -216,6 +222,7 @@ describe('request methods', () => { project: 'myproject', appId: 'my-appid', location: 'moon', + backend: new VertexAIBackend(), getAppCheckToken: () => Promise.resolve({ token: 'dummytoken', error: Error('oops') }) }, @@ -242,7 +249,8 @@ describe('request methods', () => { apiKey: 'key', project: 'myproject', appId: 'my-appid', - location: 'moon' + location: 'moon', + backend: new VertexAIBackend() }, true, {} @@ -302,14 +310,12 @@ describe('request methods', () => { } ); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.FETCH_ERROR - ); - expect((e as VertexAIError).customErrorData?.status).to.equal(500); - expect((e as VertexAIError).customErrorData?.statusText).to.equal( + expect((e as AIError).code).to.equal(AIErrorCode.FETCH_ERROR); + expect((e as AIError).customErrorData?.status).to.equal(500); + expect((e as AIError).customErrorData?.statusText).to.equal( 'AbortError' ); - expect((e as VertexAIError).message).to.include('500 AbortError'); + expect((e as AIError).message).to.include('500 AbortError'); } expect(fetchStub).to.be.calledOnce; @@ -329,14 +335,12 @@ describe('request methods', () => { '' ); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.FETCH_ERROR - ); - expect((e as VertexAIError).customErrorData?.status).to.equal(500); - expect((e as VertexAIError).customErrorData?.statusText).to.equal( + expect((e as AIError).code).to.equal(AIErrorCode.FETCH_ERROR); + expect((e as AIError).customErrorData?.status).to.equal(500); + expect((e as AIError).customErrorData?.statusText).to.equal( 'Server Error' ); - expect((e as VertexAIError).message).to.include('500 Server Error'); + expect((e as AIError).message).to.include('500 Server Error'); } expect(fetchStub).to.be.calledOnce; }); @@ -356,15 +360,13 @@ describe('request methods', () => { '' ); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.FETCH_ERROR - ); - expect((e as VertexAIError).customErrorData?.status).to.equal(500); - expect((e as VertexAIError).customErrorData?.statusText).to.equal( + expect((e as AIError).code).to.equal(AIErrorCode.FETCH_ERROR); + expect((e as AIError).customErrorData?.status).to.equal(500); + expect((e as AIError).customErrorData?.statusText).to.equal( 'Server Error' ); - expect((e as VertexAIError).message).to.include('500 Server Error'); - expect((e as VertexAIError).message).to.include('extra info'); + expect((e as AIError).message).to.include('500 Server Error'); + expect((e as AIError).message).to.include('extra info'); } expect(fetchStub).to.be.calledOnce; }); @@ -396,18 +398,14 @@ describe('request methods', () => { '' ); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.FETCH_ERROR - ); - expect((e as VertexAIError).customErrorData?.status).to.equal(500); - expect((e as VertexAIError).customErrorData?.statusText).to.equal( + expect((e as AIError).code).to.equal(AIErrorCode.FETCH_ERROR); + expect((e as AIError).customErrorData?.status).to.equal(500); + expect((e as AIError).customErrorData?.statusText).to.equal( 'Server Error' ); - expect((e as VertexAIError).message).to.include('500 Server Error'); - expect((e as VertexAIError).message).to.include('extra info'); - expect((e as VertexAIError).message).to.include( - 'generic::invalid_argument' - ); + expect((e as AIError).message).to.include('500 Server Error'); + expect((e as AIError).message).to.include('extra info'); + expect((e as AIError).message).to.include('generic::invalid_argument'); } expect(fetchStub).to.be.calledOnce; }); @@ -429,11 +427,9 @@ describe('request methods', () => { '' ); } catch (e) { - expect((e as VertexAIError).code).to.equal( - VertexAIErrorCode.API_NOT_ENABLED - ); - expect((e as VertexAIError).message).to.include('my-project'); - expect((e as VertexAIError).message).to.include('googleapis.com'); + expect((e as AIError).code).to.equal(AIErrorCode.API_NOT_ENABLED); + expect((e as AIError).message).to.include('my-project'); + expect((e as AIError).message).to.include('googleapis.com'); } expect(fetchStub).to.be.calledOnce; }); diff --git a/packages/vertexai/src/requests/request.ts b/packages/vertexai/src/requests/request.ts index 47e4c6ab446..31c5e9b8125 100644 --- a/packages/vertexai/src/requests/request.ts +++ b/packages/vertexai/src/requests/request.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { ErrorDetails, RequestOptions, VertexAIErrorCode } from '../types'; -import { VertexAIError } from '../errors'; +import { ErrorDetails, RequestOptions, AIErrorCode } from '../types'; +import { AIError } from '../errors'; import { ApiSettings } from '../types/internal'; import { DEFAULT_API_VERSION, @@ -26,6 +26,7 @@ import { PACKAGE_VERSION } from '../constants'; import { logger } from '../logger'; +import { GoogleAIBackend, VertexAIBackend } from '../backend'; export enum Task { GENERATE_CONTENT = 'generateContent', @@ -43,29 +44,40 @@ export class RequestUrl { public requestOptions?: RequestOptions ) {} toString(): string { - // TODO: allow user-set option if that feature becomes available - const apiVersion = DEFAULT_API_VERSION; - const baseUrl = this.requestOptions?.baseUrl || DEFAULT_BASE_URL; - let url = `${baseUrl}/${apiVersion}`; - url += `/projects/${this.apiSettings.project}`; - url += `/locations/${this.apiSettings.location}`; - url += `/${this.model}`; - url += `:${this.task}`; - if (this.stream) { - url += '?alt=sse'; + const url = new URL(this.baseUrl); // Throws if the URL is invalid + url.pathname = `/${this.apiVersion}/${this.modelPath}:${this.task}`; + url.search = this.queryParams.toString(); + return url.toString(); + } + + private get baseUrl(): string { + return this.requestOptions?.baseUrl || DEFAULT_BASE_URL; + } + + private get apiVersion(): string { + return DEFAULT_API_VERSION; // TODO: allow user-set options if that feature becomes available + } + + private get modelPath(): string { + if (this.apiSettings.backend instanceof GoogleAIBackend) { + return `projects/${this.apiSettings.project}/${this.model}`; + } else if (this.apiSettings.backend instanceof VertexAIBackend) { + return `projects/${this.apiSettings.project}/locations/${this.apiSettings.backend.location}/${this.model}`; + } else { + throw new AIError( + AIErrorCode.ERROR, + `Invalid backend: ${JSON.stringify(this.apiSettings.backend)}` + ); } - return url; } - /** - * If the model needs to be passed to the backend, it needs to - * include project and location path. - */ - get fullModelString(): string { - let modelString = `projects/${this.apiSettings.project}`; - modelString += `/locations/${this.apiSettings.location}`; - modelString += `/${this.model}`; - return modelString; + private get queryParams(): URLSearchParams { + const params = new URLSearchParams(); + if (this.stream) { + params.set('alt', 'sse'); + } + + return params; } } @@ -184,9 +196,9 @@ export async function makeRequest( ) ) ) { - throw new VertexAIError( - VertexAIErrorCode.API_NOT_ENABLED, - `The Vertex AI in Firebase SDK requires the Vertex AI in Firebase ` + + throw new AIError( + AIErrorCode.API_NOT_ENABLED, + `The Firebase AI SDK requires the Firebase AI ` + `API ('firebasevertexai.googleapis.com') to be enabled in your ` + `Firebase project. Enable this API by visiting the Firebase Console ` + `at https://console.firebase.google.com/project/${url.apiSettings.project}/genai/ ` + @@ -200,8 +212,8 @@ export async function makeRequest( } ); } - throw new VertexAIError( - VertexAIErrorCode.FETCH_ERROR, + throw new AIError( + AIErrorCode.FETCH_ERROR, `Error fetching from ${url}: [${response.status} ${response.statusText}] ${message}`, { status: response.status, @@ -213,12 +225,12 @@ export async function makeRequest( } catch (e) { let err = e as Error; if ( - (e as VertexAIError).code !== VertexAIErrorCode.FETCH_ERROR && - (e as VertexAIError).code !== VertexAIErrorCode.API_NOT_ENABLED && + (e as AIError).code !== AIErrorCode.FETCH_ERROR && + (e as AIError).code !== AIErrorCode.API_NOT_ENABLED && e instanceof Error ) { - err = new VertexAIError( - VertexAIErrorCode.ERROR, + err = new AIError( + AIErrorCode.ERROR, `Error fetching from ${url.toString()}: ${e.message}` ); err.stack = e.stack; diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index d820f100a50..20678eeea68 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -23,10 +23,10 @@ import { GenerateContentResponse, ImagenGCSImage, ImagenInlineImage, - InlineDataPart, - VertexAIErrorCode + AIErrorCode, + InlineDataPart } from '../types'; -import { VertexAIError } from '../errors'; +import { AIError } from '../errors'; import { logger } from '../logger'; import { ImagenResponseInternal } from '../types/internal'; @@ -68,8 +68,8 @@ export function addHelpers( ); } if (hadBadFinishReason(response.candidates[0])) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Response error: ${formatBlockErrorMessage( response )}. Response body stored in error.response`, @@ -80,8 +80,8 @@ export function addHelpers( } return getText(response); } else if (response.promptFeedback) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Text not available. ${formatBlockErrorMessage(response)}`, { response @@ -102,8 +102,8 @@ export function addHelpers( ); } if (hadBadFinishReason(response.candidates[0])) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Response error: ${formatBlockErrorMessage( response )}. Response body stored in error.response`, @@ -114,8 +114,8 @@ export function addHelpers( } return getInlineDataParts(response); } else if (response.promptFeedback) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Data not available. ${formatBlockErrorMessage(response)}`, { response @@ -134,8 +134,8 @@ export function addHelpers( ); } if (hadBadFinishReason(response.candidates[0])) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Response error: ${formatBlockErrorMessage( response )}. Response body stored in error.response`, @@ -146,8 +146,8 @@ export function addHelpers( } return getFunctionCalls(response); } else if (response.promptFeedback) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Function call not available. ${formatBlockErrorMessage(response)}`, { response @@ -277,8 +277,8 @@ export async function handlePredictResponse< // The backend should always send a non-empty array of predictions if the response was successful. if (!responseJson.predictions || responseJson.predictions?.length === 0) { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, 'No predictions or filtered reason received from Vertex AI. Please report this issue with the full error details at https://github.com/firebase/firebase-js-sdk/issues.' ); } @@ -297,8 +297,8 @@ export async function handlePredictResponse< gcsURI: prediction.gcsUri } as T); } else { - throw new VertexAIError( - VertexAIErrorCode.RESPONSE_ERROR, + throw new AIError( + AIErrorCode.RESPONSE_ERROR, `Predictions array in response has missing properties. Response: ${JSON.stringify( responseJson )}` diff --git a/packages/vertexai/src/requests/schema-builder.test.ts b/packages/vertexai/src/requests/schema-builder.test.ts index b95acaae9f1..d05b81381ea 100644 --- a/packages/vertexai/src/requests/schema-builder.test.ts +++ b/packages/vertexai/src/requests/schema-builder.test.ts @@ -18,7 +18,7 @@ import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; import { Schema } from './schema-builder'; -import { VertexAIErrorCode } from '../types'; +import { AIErrorCode } from '../types'; use(sinonChai); @@ -243,7 +243,7 @@ describe('Schema builder', () => { }, optionalProperties: ['cat'] }); - expect(() => schema.toJSON()).to.throw(VertexAIErrorCode.INVALID_SCHEMA); + expect(() => schema.toJSON()).to.throw(AIErrorCode.INVALID_SCHEMA); }); }); diff --git a/packages/vertexai/src/requests/schema-builder.ts b/packages/vertexai/src/requests/schema-builder.ts index 3d219d58b13..524cfdb1c20 100644 --- a/packages/vertexai/src/requests/schema-builder.ts +++ b/packages/vertexai/src/requests/schema-builder.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { VertexAIError } from '../errors'; -import { VertexAIErrorCode } from '../types'; +import { AIError } from '../errors'; +import { AIErrorCode } from '../types'; import { SchemaInterface, SchemaType, @@ -266,8 +266,8 @@ export class ObjectSchema extends Schema { if (this.optionalProperties) { for (const propertyKey of this.optionalProperties) { if (!this.properties.hasOwnProperty(propertyKey)) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_SCHEMA, + throw new AIError( + AIErrorCode.INVALID_SCHEMA, `Property "${propertyKey}" specified in "optionalProperties" does not exist.` ); } diff --git a/packages/vertexai/src/requests/stream-reader.test.ts b/packages/vertexai/src/requests/stream-reader.test.ts index bf959276a93..ea832c7816f 100644 --- a/packages/vertexai/src/requests/stream-reader.test.ts +++ b/packages/vertexai/src/requests/stream-reader.test.ts @@ -34,9 +34,19 @@ import { HarmCategory, HarmProbability, SafetyRating, - VertexAIErrorCode + AIErrorCode } from '../types'; -import { VertexAIError } from '../errors'; +import { AIError } from '../errors'; +import { ApiSettings } from '../types/internal'; +import { VertexAIBackend } from '../backend'; + +const fakeApiSettings: ApiSettings = { + apiKey: 'key', + project: 'my-project', + appId: 'my-appid', + location: 'us-central1', + backend: new VertexAIBackend() +}; use(sinonChai); @@ -75,7 +85,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-basic-reply-short.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); for await (const response of result.stream) { expect(response.text()).to.not.be.empty; } @@ -87,7 +97,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-basic-reply-long.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); for await (const response of result.stream) { expect(response.text()).to.not.be.empty; } @@ -101,7 +111,7 @@ describe('processStream', () => { 'streaming-success-basic-reply-long.txt', 1e6 ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); for await (const response of result.stream) { expect(response.text()).to.not.be.empty; } @@ -114,7 +124,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-utf8.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); for await (const response of result.stream) { expect(response.text()).to.not.be.empty; } @@ -127,7 +137,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-function-call-short.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); for await (const response of result.stream) { expect(response.text()).to.be.empty; expect(response.functionCalls()).to.be.deep.equal([ @@ -151,7 +161,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-failure-finish-reason-safety.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.candidates?.[0].finishReason).to.equal('SAFETY'); expect(aggregatedResponse.text).to.throw('SAFETY'); @@ -164,7 +174,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-failure-prompt-blocked-safety.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text).to.throw('SAFETY'); expect(aggregatedResponse.promptFeedback?.blockReason).to.equal('SAFETY'); @@ -177,7 +187,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-failure-empty-content.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text()).to.equal(''); for await (const response of result.stream) { @@ -189,7 +199,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-unknown-safety-enum.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text()).to.include('Cats'); for await (const response of result.stream) { @@ -201,7 +211,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-failure-recitation-no-content.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text).to.throw('RECITATION'); expect(aggregatedResponse.candidates?.[0].content.parts[0].text).to.include( @@ -220,7 +230,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-citations.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text()).to.include('Quantum mechanics is'); expect( @@ -240,7 +250,7 @@ describe('processStream', () => { 'vertexAI', 'streaming-success-empty-text-part.txt' ); - const result = processStream(fakeResponse as Response); + const result = processStream(fakeResponse as Response, fakeApiSettings); const aggregatedResponse = await result.response; expect(aggregatedResponse.text()).to.equal('1'); expect(aggregatedResponse.candidates?.length).to.equal(1); @@ -472,10 +482,8 @@ describe('aggregateResponses', () => { try { aggregateResponses(responsesToAggregate); } catch (e) { - expect((e as VertexAIError).code).includes( - VertexAIErrorCode.INVALID_CONTENT - ); - expect((e as VertexAIError).message).to.include( + expect((e as AIError).code).includes(AIErrorCode.INVALID_CONTENT); + expect((e as AIError).message).to.include( 'Part should have at least one property, but there are none. This is likely caused ' + 'by a malformed response from the backend.' ); diff --git a/packages/vertexai/src/requests/stream-reader.ts b/packages/vertexai/src/requests/stream-reader.ts index 5c419d114e0..543d1d02266 100644 --- a/packages/vertexai/src/requests/stream-reader.ts +++ b/packages/vertexai/src/requests/stream-reader.ts @@ -21,10 +21,14 @@ import { GenerateContentResponse, GenerateContentStreamResult, Part, - VertexAIErrorCode + AIErrorCode } from '../types'; -import { VertexAIError } from '../errors'; +import { AIError } from '../errors'; import { createEnhancedContentResponse } from './response-helpers'; +import * as GoogleAIMapper from '../googleai-mappers'; +import { GoogleAIGenerateContentResponse } from '../types/googleai'; +import { ApiSettings } from '../types/internal'; +import { BackendType } from '../public-types'; const responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; @@ -36,7 +40,10 @@ const responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; * * @param response - Response from a fetch call */ -export function processStream(response: Response): GenerateContentStreamResult { +export function processStream( + response: Response, + apiSettings: ApiSettings +): GenerateContentStreamResult { const inputStream = response.body!.pipeThrough( new TextDecoderStream('utf8', { fatal: true }) ); @@ -44,23 +51,27 @@ export function processStream(response: Response): GenerateContentStreamResult { getResponseStream(inputStream); const [stream1, stream2] = responseStream.tee(); return { - stream: generateResponseSequence(stream1), - response: getResponsePromise(stream2) + stream: generateResponseSequence(stream1, apiSettings), + response: getResponsePromise(stream2, apiSettings) }; } async function getResponsePromise( - stream: ReadableStream + stream: ReadableStream, + apiSettings: ApiSettings ): Promise { const allResponses: GenerateContentResponse[] = []; const reader = stream.getReader(); while (true) { const { done, value } = await reader.read(); if (done) { - const enhancedResponse = createEnhancedContentResponse( - aggregateResponses(allResponses) - ); - return enhancedResponse; + let generateContentResponse = aggregateResponses(allResponses); + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + generateContentResponse = GoogleAIMapper.mapGenerateContentResponse( + generateContentResponse as GoogleAIGenerateContentResponse + ); + } + return createEnhancedContentResponse(generateContentResponse); } allResponses.push(value); @@ -68,7 +79,8 @@ async function getResponsePromise( } async function* generateResponseSequence( - stream: ReadableStream + stream: ReadableStream, + apiSettings: ApiSettings ): AsyncGenerator { const reader = stream.getReader(); while (true) { @@ -77,7 +89,17 @@ async function* generateResponseSequence( break; } - const enhancedResponse = createEnhancedContentResponse(value); + let enhancedResponse: EnhancedGenerateContentResponse; + if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + enhancedResponse = createEnhancedContentResponse( + GoogleAIMapper.mapGenerateContentResponse( + value as GoogleAIGenerateContentResponse + ) + ); + } else { + enhancedResponse = createEnhancedContentResponse(value); + } + yield enhancedResponse; } } @@ -100,10 +122,7 @@ export function getResponseStream( if (done) { if (currentText.trim()) { controller.error( - new VertexAIError( - VertexAIErrorCode.PARSE_FAILED, - 'Failed to parse stream' - ) + new AIError(AIErrorCode.PARSE_FAILED, 'Failed to parse stream') ); return; } @@ -119,8 +138,8 @@ export function getResponseStream( parsedResponse = JSON.parse(match[1]); } catch (e) { controller.error( - new VertexAIError( - VertexAIErrorCode.PARSE_FAILED, + new AIError( + AIErrorCode.PARSE_FAILED, `Error parsing JSON response: "${match[1]}` ) ); @@ -198,8 +217,8 @@ export function aggregateResponses( newPart.functionCall = part.functionCall; } if (Object.keys(newPart).length === 0) { - throw new VertexAIError( - VertexAIErrorCode.INVALID_CONTENT, + throw new AIError( + AIErrorCode.INVALID_CONTENT, 'Part should have at least one property, but there are none. This is likely caused ' + 'by a malformed response from the backend.' ); diff --git a/packages/vertexai/src/service.test.ts b/packages/vertexai/src/service.test.ts index d3487e9bdd2..ba4c736e810 100644 --- a/packages/vertexai/src/service.test.ts +++ b/packages/vertexai/src/service.test.ts @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { VertexAIBackend } from './backend'; import { DEFAULT_LOCATION } from './constants'; -import { VertexAIService } from './service'; +import { AIService } from './service'; import { expect } from 'chai'; const fakeApp = { @@ -27,18 +28,19 @@ const fakeApp = { } }; -describe('VertexAIService', () => { +describe('AIService', () => { + // TODO (dlarocque): move some of these tests to helpers.test.ts it('uses default location if not specified', () => { - const vertexAI = new VertexAIService(fakeApp); - expect(vertexAI.location).to.equal(DEFAULT_LOCATION); + const ai = new AIService(fakeApp, new VertexAIBackend()); + expect(ai.location).to.equal(DEFAULT_LOCATION); }); it('uses custom location if specified', () => { - const vertexAI = new VertexAIService( + const ai = new AIService( fakeApp, + new VertexAIBackend('somewhere'), /* authProvider */ undefined, - /* appCheckProvider */ undefined, - { location: 'somewhere' } + /* appCheckProvider */ undefined ); - expect(vertexAI.location).to.equal('somewhere'); + expect(ai.location).to.equal('somewhere'); }); }); diff --git a/packages/vertexai/src/service.ts b/packages/vertexai/src/service.ts index 05b2d559e58..006cc45a94e 100644 --- a/packages/vertexai/src/service.ts +++ b/packages/vertexai/src/service.ts @@ -16,7 +16,7 @@ */ import { FirebaseApp, _FirebaseService } from '@firebase/app'; -import { VertexAI, VertexAIOptions } from './public-types'; +import { AI } from './public-types'; import { AppCheckInternalComponentName, FirebaseAppCheckInternal @@ -26,24 +26,29 @@ import { FirebaseAuthInternal, FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { DEFAULT_LOCATION } from './constants'; +import { Backend, VertexAIBackend } from './backend'; -export class VertexAIService implements VertexAI, _FirebaseService { +export class AIService implements AI, _FirebaseService { auth: FirebaseAuthInternal | null; appCheck: FirebaseAppCheckInternal | null; - location: string; + location: string; // This is here for backwards-compatibility constructor( public app: FirebaseApp, + public backend: Backend, authProvider?: Provider, - appCheckProvider?: Provider, - public options?: VertexAIOptions + appCheckProvider?: Provider ) { const appCheck = appCheckProvider?.getImmediate({ optional: true }); const auth = authProvider?.getImmediate({ optional: true }); this.auth = auth || null; this.appCheck = appCheck || null; - this.location = this.options?.location || DEFAULT_LOCATION; + + if (backend instanceof VertexAIBackend) { + this.location = backend.location; + } else { + this.location = ''; + } } _delete(): Promise { diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index d6702a0f1a8..5c6612ce26a 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -62,11 +62,13 @@ export enum HarmBlockThreshold { } /** + * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}). + * * @public */ export enum HarmBlockMethod { /** - * The harm block method uses both probability and severity scores. + * The harm block method uses both probability and severity scores. */ SEVERITY = 'SEVERITY', /** @@ -118,7 +120,14 @@ export enum HarmSeverity { /** * High level of harm severity. */ - HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH' + HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH', + /** + * Harm severity is not supported. + * + * @remarks + * The GoogleAI backend does not support `HarmSeverity`, so this value is used as a fallback. + */ + HARM_SEVERITY_UNSUPPORTED = 'HARM_SEVERITY_UNSUPPORTED' } /** diff --git a/packages/vertexai/src/types/error.ts b/packages/vertexai/src/types/error.ts index b1f075101a6..ef3ad7fc30c 100644 --- a/packages/vertexai/src/types/error.ts +++ b/packages/vertexai/src/types/error.ts @@ -58,11 +58,11 @@ export interface CustomErrorData { } /** - * Standardized error codes that {@link VertexAIError} can have. + * Standardized error codes that {@link AIError} can have. * * @public */ -export const enum VertexAIErrorCode { +export const enum AIErrorCode { /** A generic error occurred. */ ERROR = 'error', @@ -97,5 +97,8 @@ export const enum VertexAIErrorCode { NO_PROJECT_ID = 'no-project-id', /** An error occurred while parsing. */ - PARSE_FAILED = 'parse-failed' + PARSE_FAILED = 'parse-failed', + + /** An error occured due an attempt to use an unsupported feature. */ + UNSUPPORTED = 'unsupported' } diff --git a/packages/vertexai/src/types/googleai.ts b/packages/vertexai/src/types/googleai.ts new file mode 100644 index 00000000000..38c27b3fe8b --- /dev/null +++ b/packages/vertexai/src/types/googleai.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2025 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 { + Tool, + GenerationConfig, + Citation, + FinishReason, + GroundingMetadata, + PromptFeedback, + SafetyRating, + UsageMetadata +} from '../public-types'; +import { Content, Part } from './content'; + +/** + * @internal + */ +export interface GoogleAICountTokensRequest { + generateContentRequest: { + model: string; // 'models/model-name' + contents: Content[]; + systemInstruction?: string | Part | Content; + tools?: Tool[]; + generationConfig?: GenerationConfig; + }; +} + +/** + * @internal + */ +export interface GoogleAIGenerateContentResponse { + candidates?: GoogleAIGenerateContentCandidate[]; + promptFeedback?: PromptFeedback; + usageMetadata?: UsageMetadata; +} + +/** + * @internal + */ +export interface GoogleAIGenerateContentCandidate { + index: number; + content: Content; + finishReason?: FinishReason; + finishMessage?: string; + safetyRatings?: SafetyRating[]; + citationMetadata?: GoogleAICitationMetadata; + groundingMetadata?: GroundingMetadata; +} + +/** + * @internal + */ +export interface GoogleAICitationMetadata { + citationSources: Citation[]; // Maps to `citations` +} diff --git a/packages/vertexai/src/types/imagen/requests.ts b/packages/vertexai/src/types/imagen/requests.ts index 70ae182238e..09bd3dedc9b 100644 --- a/packages/vertexai/src/types/imagen/requests.ts +++ b/packages/vertexai/src/types/imagen/requests.ts @@ -58,6 +58,9 @@ export interface ImagenGenerationConfig { * Support for negative prompts depends on the Imagen model. * * See the {@link http://firebase.google.com/docs/vertex-ai/model-parameters#imagen | documentation} for more details. + * + * This is no longer supported in the Gemini Developer API ({@link GoogleAIBackend}) in versions + * greater than `imagen-3.0-generate-002`. */ negativePrompt?: string; /** @@ -88,6 +91,9 @@ export interface ImagenGenerationConfig { * * For Imagen 3 models, the default value is `true`; see the addWatermark * documentation for more details. + * + * When using the Gemini Developer API ({@link GoogleAIBackend}), this will default to true, + * and cannot be turned off. */ addWatermark?: boolean; } diff --git a/packages/vertexai/src/types/index.ts b/packages/vertexai/src/types/index.ts index f575c5ba8e9..01f3e7a701a 100644 --- a/packages/vertexai/src/types/index.ts +++ b/packages/vertexai/src/types/index.ts @@ -22,3 +22,4 @@ export * from './responses'; export * from './error'; export * from './schema'; export * from './imagen'; +export * from './googleai'; diff --git a/packages/vertexai/src/types/internal.ts b/packages/vertexai/src/types/internal.ts index a3476afd028..a41ec5652d3 100644 --- a/packages/vertexai/src/types/internal.ts +++ b/packages/vertexai/src/types/internal.ts @@ -17,6 +17,7 @@ import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; +import { Backend } from '../backend'; export * from './imagen/internal'; @@ -24,8 +25,12 @@ export interface ApiSettings { apiKey: string; project: string; appId: string; - location: string; automaticDataCollectionEnabled?: boolean; + /** + * @deprecated Use `backend.location` instead. + */ + location: string; + backend: Backend; getAuthToken?: () => Promise; getAppCheckToken?: () => Promise; } diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index ee45b636673..67f45095c2a 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -64,6 +64,13 @@ export interface GenerateContentRequest extends BaseParams { export interface SafetySetting { category: HarmCategory; threshold: HarmBlockThreshold; + /** + * The harm block method. + * + * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), an {@link AIError} will be + * thrown if this property is defined. + */ method?: HarmBlockMethod; } diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index e4a247bec49..e33b8a86bd3 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -117,6 +117,11 @@ export interface ModalityTokenCount { export interface PromptFeedback { blockReason?: BlockReason; safetyRatings: SafetyRating[]; + /** + * A human-readable description of the `blockReason`. + * + * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}). + */ blockReasonMessage?: string; } @@ -151,7 +156,17 @@ export interface Citation { endIndex?: number; uri?: string; license?: string; + /** + * The title of the cited source, if available. + * + * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}). + */ title?: string; + /** + * The publication date of the cited source, if available. + * + * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}). + */ publicationDate?: Date; } @@ -221,8 +236,26 @@ export interface Date { export interface SafetyRating { category: HarmCategory; probability: HarmProbability; + /** + * The harm severity level. + * + * This property is only supported when using the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property is not supported and will default to `HarmSeverity.UNSUPPORTED`. + */ severity: HarmSeverity; + /** + * The probability score of the harm category. + * + * This property is only supported when using the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property is not supported and will default to 0. + */ probabilityScore: number; + /** + * The severity score of the harm category. + * + * This property is only supported when using the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property is not supported and will default to 0. + */ severityScore: number; blocked: boolean; } @@ -239,6 +272,9 @@ export interface CountTokensResponse { /** * The total number of billable characters counted across all instances * from the request. + * + * This property is only supported when using the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property is not supported and will default to 0. */ totalBillableCharacters?: number; /** diff --git a/packages/vertexai/src/types/schema.ts b/packages/vertexai/src/types/schema.ts index 5c23655be0e..e9fe9286b61 100644 --- a/packages/vertexai/src/types/schema.ts +++ b/packages/vertexai/src/types/schema.ts @@ -42,7 +42,10 @@ export enum SchemaType { * @public */ export interface SchemaShared { - /** Optional. The format of the property. */ + /** Optional. The format of the property. + * When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or + * `'date-time'`, otherwise requests will fail. + */ format?: string; /** Optional. The description of the property. */ description?: string; diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index bf55a645a66..d80959febce 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v10.*' # The major version of mock responses to use +RESPONSES_VERSION='v11.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From 72852e12d07370a7cf07560e698246a7ff9c34dc Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 12 May 2025 13:50:11 -0700 Subject: [PATCH 189/295] Add Emulator Overlay (#8977) --- .changeset/three-singers-wonder.md | 10 ++ common/api-review/util.api.md | 3 + packages/auth/src/core/auth/emulator.ts | 16 +- packages/auth/src/platform_browser/index.ts | 8 +- packages/database/src/api/Database.ts | 8 +- packages/firestore/src/lite-api/database.ts | 11 +- packages/functions/src/api.ts | 4 +- packages/functions/src/service.ts | 7 +- packages/storage/src/api.ts | 4 +- packages/storage/src/service.ts | 4 +- packages/util/src/emulator.ts | 178 ++++++++++++++++++++ 11 files changed, 238 insertions(+), 15 deletions(-) create mode 100644 .changeset/three-singers-wonder.md diff --git a/.changeset/three-singers-wonder.md b/.changeset/three-singers-wonder.md new file mode 100644 index 00000000000..72dea9d7aa5 --- /dev/null +++ b/.changeset/three-singers-wonder.md @@ -0,0 +1,10 @@ +--- +"@firebase/auth": patch +"@firebase/firestore": patch +"@firebase/util": patch +"@firebase/database": patch +"@firebase/storage": patch +"@firebase/functions": patch +--- + +Add Emulator Overlay diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 427cb5e174a..f263f450da3 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -487,6 +487,9 @@ export interface Subscribe { // @public (undocumented) export type Unsubscribe = () => void; +// @public +export function updateEmulatorBanner(name: string, isRunningEmulator: boolean): void; + // Warning: (ae-missing-release-tag) "validateArgCount" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 8547f7bad6c..42fbda3f095 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; +import { + deepEqual, + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -97,13 +102,12 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; - if (!disableWarnings) { - emitEmulatorWarning(); - } - - // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { + updateEmulatorBanner('Auth', true); + // Workaround to get cookies in Firebase Studio void pingServer(`${protocol}//${host}${portStr}`); + } else if (!disableWarnings) { + emitEmulatorWarning(); } } diff --git a/packages/auth/src/platform_browser/index.ts b/packages/auth/src/platform_browser/index.ts index f94525bfeb7..99ab834cbdb 100644 --- a/packages/auth/src/platform_browser/index.ts +++ b/packages/auth/src/platform_browser/index.ts @@ -30,7 +30,11 @@ import { browserSessionPersistence } from './persistence/session_storage'; import { indexedDBLocalPersistence } from './persistence/indexed_db'; import { browserPopupRedirectResolver } from './popup_redirect'; import { Auth, User } from '../model/public_types'; -import { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util'; +import { + getDefaultEmulatorHost, + getExperimentalSetting, + updateEmulatorBanner +} from '@firebase/util'; import { _setExternalJSProvider } from './load_js'; import { _createError } from '../core/util/assert'; import { AuthErrorCode } from '../core/errors'; @@ -110,6 +114,8 @@ export function getAuth(app: FirebaseApp = getApp()): Auth { const authEmulatorHost = getDefaultEmulatorHost('auth'); if (authEmulatorHost) { connectAuthEmulator(auth, `http://${authEmulatorHost}`); + } else { + updateEmulatorBanner('Auth', false); } return auth; diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 515e278b5c5..a94b04518d7 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -31,7 +31,8 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -257,6 +258,10 @@ export class Database implements _FirebaseService { this.app.options['databaseAuthVariableOverride'] ); this._instanceStarted = true; + updateEmulatorBanner( + 'Database', + this._repo.repoInfo_.emulatorOptions !== null + ); } return this._repoInternal; } @@ -393,6 +398,7 @@ export function connectDatabaseEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(host); + updateEmulatorBanner('Database', true); } // Modify the repo to apply emulator settings diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 8e7fdb27e90..fce6d5843b7 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,6 +28,7 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, + updateEmulatorBanner, pingServer } from '@firebase/util'; @@ -142,6 +143,7 @@ export class Firestore implements FirestoreService { _freezeSettings(): FirestoreSettingsImpl { this._settingsFrozen = true; + updateEmulatorBanner('Firestore', this._settings.isUsingEmulator); return this._settings; } @@ -334,9 +336,7 @@ export function connectFirestoreEmulator( emulatorOptions: firestore._getEmulatorOptions() }; const newHostSetting = `${host}:${port}`; - if (useSsl) { - void pingServer(`https://${newHostSetting}`); - } + if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + @@ -357,6 +357,11 @@ export function connectFirestoreEmulator( firestore._setSettings(newConfig); + if (useSsl) { + void pingServer(`https://${newHostSetting}`); + updateEmulatorBanner('Firestore', true); + } + if (options.mockUserToken) { let token: string; let user: User; diff --git a/packages/functions/src/api.ts b/packages/functions/src/api.ts index 7f92cba8343..cb987035145 100644 --- a/packages/functions/src/api.ts +++ b/packages/functions/src/api.ts @@ -29,7 +29,8 @@ import { } from './service'; import { getModularInstance, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + updateEmulatorBanner } from '@firebase/util'; export { FunctionsError } from './error'; @@ -47,6 +48,7 @@ export function getFunctions( app: FirebaseApp = getApp(), regionOrCustomDomain: string = DEFAULT_REGION ): Functions { + updateEmulatorBanner('Functions', false); // Dependencies const functionsProvider: Provider<'functions'> = _getProvider( getModularInstance(app), diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index af9d8898d2e..57504a4c7a4 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,7 +30,11 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { isCloudWorkstation, pingServer } from '@firebase/util'; +import { + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -182,6 +186,7 @@ export function connectFunctionsEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(functionsInstance.emulatorOrigin); + updateEmulatorBanner('Functions', true); } } diff --git a/packages/storage/src/api.ts b/packages/storage/src/api.ts index 84c77ea0c8c..b164a1324c3 100644 --- a/packages/storage/src/api.ts +++ b/packages/storage/src/api.ts @@ -53,7 +53,8 @@ import { STORAGE_TYPE } from './constants'; import { EmulatorMockTokenOptions, getModularInstance, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + updateEmulatorBanner } from '@firebase/util'; import { StringFormat } from './implementation/string'; @@ -332,6 +333,7 @@ export function getStorage( bucketUrl?: string ): FirebaseStorage { app = getModularInstance(app); + updateEmulatorBanner('Storage', false); const storageProvider: Provider<'storage'> = _getProvider(app, STORAGE_TYPE); const storageInstance = storageProvider.getImmediate({ identifier: bucketUrl diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 741dd6eaa1a..97d1407bb52 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -46,7 +46,8 @@ import { createMockUserToken, EmulatorMockTokenOptions, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -150,6 +151,7 @@ export function connectStorageEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(`https://${storage.host}`); + updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; diff --git a/packages/util/src/emulator.ts b/packages/util/src/emulator.ts index 2850b5be378..ff09940d88f 100644 --- a/packages/util/src/emulator.ts +++ b/packages/util/src/emulator.ts @@ -16,6 +16,7 @@ */ import { base64urlEncodeWithoutPadding } from './crypt'; +import { isCloudWorkstation } from './url'; // Firebase Auth tokens contain snake_case claims following the JWT standard / convention. /* eslint-disable camelcase */ @@ -140,3 +141,180 @@ export function createMockUserToken( signature ].join('.'); } + +interface EmulatorStatusMap { + [name: string]: boolean; +} +const emulatorStatus: EmulatorStatusMap = {}; + +interface EmulatorSummary { + prod: string[]; + emulator: string[]; +} + +// Checks whether any products are running on an emulator +function getEmulatorSummary(): EmulatorSummary { + const summary: EmulatorSummary = { + prod: [], + emulator: [] + }; + for (const key of Object.keys(emulatorStatus)) { + if (emulatorStatus[key]) { + summary.emulator.push(key); + } else { + summary.prod.push(key); + } + } + return summary; +} + +function getOrCreateEl(id: string): { created: boolean; element: HTMLElement } { + let parentDiv = document.getElementById(id); + let created = false; + if (!parentDiv) { + parentDiv = document.createElement('div'); + parentDiv.setAttribute('id', id); + created = true; + } + return { created, element: parentDiv }; +} + +let previouslyDismissed = false; +/** + * Updates Emulator Banner. Primarily used for Firebase Studio + * @param name + * @param isRunningEmulator + * @public + */ +export function updateEmulatorBanner( + name: string, + isRunningEmulator: boolean +): void { + if ( + typeof window === 'undefined' || + typeof document === 'undefined' || + !isCloudWorkstation(window.location.host) || + emulatorStatus[name] === isRunningEmulator || + emulatorStatus[name] || // If already set to use emulator, can't go back to prod. + previouslyDismissed + ) { + return; + } + + emulatorStatus[name] = isRunningEmulator; + + function prefixedId(id: string): string { + return `__firebase__banner__${id}`; + } + const bannerId = '__firebase__banner'; + const summary = getEmulatorSummary(); + const showError = summary.prod.length > 0; + + function tearDown(): void { + const element = document.getElementById(bannerId); + if (element) { + element.remove(); + } + } + + function setupBannerStyles(bannerEl: HTMLElement): void { + bannerEl.style.display = 'flex'; + bannerEl.style.background = '#7faaf0'; + bannerEl.style.position = 'absolute'; + bannerEl.style.bottom = '5px'; + bannerEl.style.left = '5px'; + bannerEl.style.padding = '.5em'; + bannerEl.style.borderRadius = '5px'; + bannerEl.style.alignItems = 'center'; + } + + function setupIconStyles(prependIcon: SVGElement, iconId: string): void { + prependIcon.setAttribute('width', '24'); + prependIcon.setAttribute('id', iconId); + prependIcon.setAttribute('height', '24'); + prependIcon.setAttribute('viewBox', '0 0 24 24'); + prependIcon.setAttribute('fill', 'none'); + prependIcon.style.marginLeft = '-6px'; + } + + function setupCloseBtn(): HTMLSpanElement { + const closeBtn = document.createElement('span'); + closeBtn.style.cursor = 'pointer'; + closeBtn.style.marginLeft = '16px'; + closeBtn.style.fontSize = '24px'; + closeBtn.innerHTML = ' ×'; + closeBtn.onclick = () => { + previouslyDismissed = true; + tearDown(); + }; + return closeBtn; + } + + function setupLinkStyles( + learnMoreLink: HTMLAnchorElement, + learnMoreId: string + ): void { + learnMoreLink.setAttribute('id', learnMoreId); + learnMoreLink.innerText = 'Learn more'; + learnMoreLink.href = + 'https://firebase.google.com/docs/studio/preview-apps#preview-backend'; + learnMoreLink.setAttribute('target', '__blank'); + learnMoreLink.style.paddingLeft = '5px'; + learnMoreLink.style.textDecoration = 'underline'; + } + + function setupDom(): void { + const banner = getOrCreateEl(bannerId); + const firebaseTextId = prefixedId('text'); + const firebaseText: HTMLSpanElement = + document.getElementById(firebaseTextId) || document.createElement('span'); + const learnMoreId = prefixedId('learnmore'); + const learnMoreLink: HTMLAnchorElement = + (document.getElementById(learnMoreId) as HTMLAnchorElement) || + document.createElement('a'); + const prependIconId = prefixedId('preprendIcon'); + const prependIcon: SVGElement = + (document.getElementById( + prependIconId + ) as HTMLOrSVGElement as SVGElement) || + document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + if (banner.created) { + // update styles + const bannerEl = banner.element; + setupBannerStyles(bannerEl); + setupLinkStyles(learnMoreLink, learnMoreId); + const closeBtn = setupCloseBtn(); + setupIconStyles(prependIcon, prependIconId); + bannerEl.append(prependIcon, firebaseText, learnMoreLink, closeBtn); + document.body.appendChild(bannerEl); + } + + if (showError) { + firebaseText.innerText = `Preview backend disconnected.`; + prependIcon.innerHTML = ` + + + + + + +`; + } else { + prependIcon.innerHTML = ` + + + + + + +`; + firebaseText.innerText = 'Preview backend running in this workspace.'; + } + firebaseText.setAttribute('id', firebaseTextId); + } + if (document.readyState === 'loading') { + window.addEventListener('DOMContentLoaded', setupDom); + } else { + setupDom(); + } +} From 39505cc72d346ed8fa75267181fd80fb046f5635 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 12 May 2025 16:54:33 -0400 Subject: [PATCH 190/295] Rename `@firebase/vertexai` package to `@firebase/ai` (#9011) --- .changeset/fast-mangos-chew.md | 2 +- .changeset/perfect-camels-try.md | 2 +- .changeset/tall-zoos-stare.md | 2 +- .github/workflows/canary-deploy.yml | 2 +- .../workflows/check-vertexai-responses.yml | 2 +- .../workflows/prerelease-manual-deploy.yml | 2 +- .github/workflows/release-prod.yml | 2 +- .github/workflows/release-staging.yml | 2 +- common/api-review/ai.api.md | 955 ++++++++++++++++++ docs-devsite/_toc.yaml | 298 +++--- docs-devsite/ai.ai.md | 64 ++ .../{vertexai.aierror.md => ai.aierror.md} | 10 +- .../{vertexai.aimodel.md => ai.aimodel.md} | 4 +- ...{vertexai.aioptions.md => ai.aioptions.md} | 4 +- ...texai.arrayschema.md => ai.arrayschema.md} | 10 +- .../{vertexai.backend.md => ai.backend.md} | 8 +- ...ertexai.baseparams.md => ai.baseparams.md} | 4 +- ...i.booleanschema.md => ai.booleanschema.md} | 6 +- ...texai.chatsession.md => ai.chatsession.md} | 32 +- .../{vertexai.citation.md => ai.citation.md} | 16 +- ...tionmetadata.md => ai.citationmetadata.md} | 4 +- .../{vertexai.content.md => ai.content.md} | 4 +- ...ensrequest.md => ai.counttokensrequest.md} | 12 +- docs-devsite/ai.counttokensresponse.md | 59 ++ ...stomerrordata.md => ai.customerrordata.md} | 10 +- .../{vertexai.date_2.md => ai.date_2.md} | 6 +- .../ai.enhancedgeneratecontentresponse.md | 56 + ...xai.errordetails.md => ai.errordetails.md} | 8 +- .../{vertexai.filedata.md => ai.filedata.md} | 4 +- ...xai.filedatapart.md => ai.filedatapart.md} | 12 +- ...xai.functioncall.md => ai.functioncall.md} | 6 +- ...gconfig.md => ai.functioncallingconfig.md} | 4 +- ...tioncallpart.md => ai.functioncallpart.md} | 10 +- ...claration.md => ai.functiondeclaration.md} | 6 +- docs-devsite/ai.functiondeclarationstool.md | 35 + ...tionresponse.md => ai.functionresponse.md} | 6 +- ...onsepart.md => ai.functionresponsepart.md} | 10 +- ...date.md => ai.generatecontentcandidate.md} | 16 +- ...equest.md => ai.generatecontentrequest.md} | 12 +- docs-devsite/ai.generatecontentresponse.md | 51 + ...tresult.md => ai.generatecontentresult.md} | 4 +- ...t.md => ai.generatecontentstreamresult.md} | 6 +- docs-devsite/ai.generationconfig.md | 134 +++ ...entblob.md => ai.generativecontentblob.md} | 4 +- docs-devsite/ai.generativemodel.md | 193 ++++ ...ogleaibackend.md => ai.googleaibackend.md} | 6 +- ...ribution.md => ai.groundingattribution.md} | 8 +- ...ingmetadata.md => ai.groundingmetadata.md} | 6 +- ...imagengcsimage.md => ai.imagengcsimage.md} | 6 +- ...config.md => ai.imagengenerationconfig.md} | 18 +- ...onse.md => ai.imagengenerationresponse.md} | 6 +- ...imageformat.md => ai.imagenimageformat.md} | 22 +- ...inlineimage.md => ai.imageninlineimage.md} | 6 +- ...texai.imagenmodel.md => ai.imagenmodel.md} | 24 +- ...modelparams.md => ai.imagenmodelparams.md} | 8 +- ...settings.md => ai.imagensafetysettings.md} | 4 +- ...inlinedatapart.md => ai.inlinedatapart.md} | 10 +- ...i.integerschema.md => ai.integerschema.md} | 6 +- docs-devsite/ai.md | 728 +++++++++++++ ...tokencount.md => ai.modalitytokencount.md} | 4 +- ...texai.modelparams.md => ai.modelparams.md} | 12 +- ...xai.numberschema.md => ai.numberschema.md} | 6 +- ...xai.objectschema.md => ai.objectschema.md} | 12 +- ...terface.md => ai.objectschemainterface.md} | 8 +- ...promptfeedback.md => ai.promptfeedback.md} | 8 +- ...requestoptions.md => ai.requestoptions.md} | 6 +- ...n.md => ai.retrievedcontextattribution.md} | 4 +- docs-devsite/ai.safetyrating.md | 90 ++ docs-devsite/ai.safetysetting.md | 55 + .../{vertexai.schema.md => ai.schema.md} | 60 +- ...hemainterface.md => ai.schemainterface.md} | 8 +- ...xai.schemaparams.md => ai.schemaparams.md} | 4 +- ...i.schemarequest.md => ai.schemarequest.md} | 10 +- ...xai.schemashared.md => ai.schemashared.md} | 18 +- .../{vertexai.segment.md => ai.segment.md} | 6 +- ...artchatparams.md => ai.startchatparams.md} | 12 +- ...xai.stringschema.md => ai.stringschema.md} | 8 +- .../{vertexai.textpart.md => ai.textpart.md} | 8 +- ...ertexai.toolconfig.md => ai.toolconfig.md} | 2 +- ...i.usagemetadata.md => ai.usagemetadata.md} | 12 +- ...rtexaibackend.md => ai.vertexaibackend.md} | 8 +- ...rtexaioptions.md => ai.vertexaioptions.md} | 2 +- ...i.videometadata.md => ai.videometadata.md} | 4 +- ...webattribution.md => ai.webattribution.md} | 4 +- docs-devsite/index.md | 2 +- docs-devsite/vertexai.ai.md | 64 -- docs-devsite/vertexai.counttokensresponse.md | 59 -- ...ertexai.enhancedgeneratecontentresponse.md | 56 - .../vertexai.functiondeclarationstool.md | 35 - .../vertexai.generatecontentresponse.md | 51 - docs-devsite/vertexai.generationconfig.md | 134 --- docs-devsite/vertexai.generativemodel.md | 193 ---- docs-devsite/vertexai.md | 716 ------------- docs-devsite/vertexai.safetyrating.md | 90 -- docs-devsite/vertexai.safetysetting.md | 55 - packages/{vertexai => ai}/.eslintrc.js | 0 packages/{vertexai => ai}/CHANGELOG.md | 2 +- packages/{vertexai => ai}/README.md | 4 +- packages/{vertexai => ai}/api-extractor.json | 0 packages/{vertexai => ai}/karma.conf.js | 0 packages/{vertexai => ai}/package.json | 12 +- packages/{vertexai => ai}/rollup.config.js | 0 packages/{vertexai => ai}/src/api.test.ts | 0 packages/{vertexai => ai}/src/api.ts | 16 +- packages/{vertexai => ai}/src/backend.test.ts | 0 packages/{vertexai => ai}/src/backend.ts | 0 .../src/backwards-compatbility.test.ts | 0 packages/{vertexai => ai}/src/constants.ts | 3 - packages/{vertexai => ai}/src/errors.ts | 0 .../src/googleai-mappers.test.ts | 0 .../{vertexai => ai}/src/googleai-mappers.ts | 0 packages/{vertexai => ai}/src/helpers.test.ts | 0 packages/{vertexai => ai}/src/helpers.ts | 0 packages/{vertexai => ai}/src/index.node.ts | 0 packages/{vertexai => ai}/src/index.ts | 0 packages/{vertexai => ai}/src/logger.ts | 0 .../src/methods/chat-session-helpers.test.ts | 0 .../src/methods/chat-session-helpers.ts | 0 .../src/methods/chat-session.test.ts | 0 .../src/methods/chat-session.ts | 0 .../src/methods/count-tokens.test.ts | 0 .../src/methods/count-tokens.ts | 0 .../src/methods/generate-content.test.ts | 0 .../src/methods/generate-content.ts | 0 .../src/models/ai-model.test.ts | 0 .../{vertexai => ai}/src/models/ai-model.ts | 0 .../src/models/generative-model.test.ts | 0 .../src/models/generative-model.ts | 0 .../src/models/imagen-model.test.ts | 0 .../src/models/imagen-model.ts | 0 packages/{vertexai => ai}/src/models/index.ts | 0 packages/{vertexai => ai}/src/public-types.ts | 10 +- .../src/requests/imagen-image-format.ts | 0 .../src/requests/request-helpers.test.ts | 0 .../src/requests/request-helpers.ts | 0 .../src/requests/request.test.ts | 0 .../{vertexai => ai}/src/requests/request.ts | 0 .../src/requests/response-helpers.test.ts | 0 .../src/requests/response-helpers.ts | 0 .../src/requests/schema-builder.test.ts | 0 .../src/requests/schema-builder.ts | 0 .../src/requests/stream-reader.test.ts | 0 .../src/requests/stream-reader.ts | 0 packages/{vertexai => ai}/src/service.test.ts | 0 packages/{vertexai => ai}/src/service.ts | 0 .../{vertexai => ai}/src/types/content.ts | 0 packages/{vertexai => ai}/src/types/enums.ts | 0 packages/{vertexai => ai}/src/types/error.ts | 0 .../{vertexai => ai}/src/types/googleai.ts | 0 .../src/types/imagen/index.ts | 0 .../src/types/imagen/internal.ts | 0 .../src/types/imagen/requests.ts | 0 .../src/types/imagen/responses.ts | 0 packages/{vertexai => ai}/src/types/index.ts | 0 .../{vertexai => ai}/src/types/internal.ts | 0 .../{vertexai => ai}/src/types/requests.ts | 0 .../{vertexai => ai}/src/types/responses.ts | 0 packages/{vertexai => ai}/src/types/schema.ts | 0 .../{vertexai => ai}/test-utils/base64cat.ts | 0 packages/{vertexai => ai}/test-utils/cat.jpeg | Bin packages/{vertexai => ai}/test-utils/cat.png | Bin .../test-utils/convert-mocks.ts | 2 +- .../test-utils/mock-response.ts | 0 packages/{vertexai => ai}/tsconfig.json | 0 packages/app/src/constants.ts | 4 +- packages/firebase/ai/index.ts | 4 +- packages/firebase/ai/package.json | 4 +- packages/firebase/package.json | 28 +- packages/firebase/vertexai/index.ts | 2 +- packages/firebase/vertexai/package.json | 4 +- scripts/docgen/docgen.ts | 2 +- scripts/update_vertexai_responses.sh | 2 +- 172 files changed, 2927 insertions(+), 1955 deletions(-) create mode 100644 common/api-review/ai.api.md create mode 100644 docs-devsite/ai.ai.md rename docs-devsite/{vertexai.aierror.md => ai.aierror.md} (65%) rename docs-devsite/{vertexai.aimodel.md => ai.aimodel.md} (74%) rename docs-devsite/{vertexai.aioptions.md => ai.aioptions.md} (59%) rename docs-devsite/{vertexai.arrayschema.md => ai.arrayschema.md} (69%) rename docs-devsite/{vertexai.backend.md => ai.backend.md} (64%) rename docs-devsite/{vertexai.baseparams.md => ai.baseparams.md} (69%) rename docs-devsite/{vertexai.booleanschema.md => ai.booleanschema.md} (71%) rename docs-devsite/{vertexai.chatsession.md => ai.chatsession.md} (52%) rename docs-devsite/{vertexai.citation.md => ai.citation.md} (55%) rename docs-devsite/{vertexai.citationmetadata.md => ai.citationmetadata.md} (73%) rename docs-devsite/{vertexai.content.md => ai.content.md} (79%) rename docs-devsite/{vertexai.counttokensrequest.md => ai.counttokensrequest.md} (52%) create mode 100644 docs-devsite/ai.counttokensresponse.md rename docs-devsite/{vertexai.customerrordata.md => ai.customerrordata.md} (55%) rename docs-devsite/{vertexai.date_2.md => ai.date_2.md} (80%) create mode 100644 docs-devsite/ai.enhancedgeneratecontentresponse.md rename docs-devsite/{vertexai.errordetails.md => ai.errordetails.md} (70%) rename docs-devsite/{vertexai.filedata.md => ai.filedata.md} (83%) rename docs-devsite/{vertexai.filedatapart.md => ai.filedatapart.md} (62%) rename docs-devsite/{vertexai.functioncall.md => ai.functioncall.md} (59%) rename docs-devsite/{vertexai.functioncallingconfig.md => ai.functioncallingconfig.md} (73%) rename docs-devsite/{vertexai.functioncallpart.md => ai.functioncallpart.md} (66%) rename docs-devsite/{vertexai.functiondeclaration.md => ai.functiondeclaration.md} (65%) create mode 100644 docs-devsite/ai.functiondeclarationstool.md rename docs-devsite/{vertexai.functionresponse.md => ai.functionresponse.md} (51%) rename docs-devsite/{vertexai.functionresponsepart.md => ai.functionresponsepart.md} (64%) rename docs-devsite/{vertexai.generatecontentcandidate.md => ai.generatecontentcandidate.md} (51%) rename docs-devsite/{vertexai.generatecontentrequest.md => ai.generatecontentrequest.md} (53%) create mode 100644 docs-devsite/ai.generatecontentresponse.md rename docs-devsite/{vertexai.generatecontentresult.md => ai.generatecontentresult.md} (71%) rename docs-devsite/{vertexai.generatecontentstreamresult.md => ai.generatecontentstreamresult.md} (54%) create mode 100644 docs-devsite/ai.generationconfig.md rename docs-devsite/{vertexai.generativecontentblob.md => ai.generativecontentblob.md} (78%) create mode 100644 docs-devsite/ai.generativemodel.md rename docs-devsite/{vertexai.googleaibackend.md => ai.googleaibackend.md} (63%) rename docs-devsite/{vertexai.groundingattribution.md => ai.groundingattribution.md} (61%) rename docs-devsite/{vertexai.groundingmetadata.md => ai.groundingmetadata.md} (68%) rename docs-devsite/{vertexai.imagengcsimage.md => ai.imagengcsimage.md} (62%) rename docs-devsite/{vertexai.imagengenerationconfig.md => ai.imagengenerationconfig.md} (52%) rename docs-devsite/{vertexai.imagengenerationresponse.md => ai.imagengenerationresponse.md} (56%) rename docs-devsite/{vertexai.imagenimageformat.md => ai.imagenimageformat.md} (61%) rename docs-devsite/{vertexai.imageninlineimage.md => ai.imageninlineimage.md} (66%) rename docs-devsite/{vertexai.imagenmodel.md => ai.imagenmodel.md} (62%) rename docs-devsite/{vertexai.imagenmodelparams.md => ai.imagenmodelparams.md} (63%) rename docs-devsite/{vertexai.imagensafetysettings.md => ai.imagensafetysettings.md} (72%) rename docs-devsite/{vertexai.inlinedatapart.md => ai.inlinedatapart.md} (62%) rename docs-devsite/{vertexai.integerschema.md => ai.integerschema.md} (71%) create mode 100644 docs-devsite/ai.md rename docs-devsite/{vertexai.modalitytokencount.md => ai.modalitytokencount.md} (74%) rename docs-devsite/{vertexai.modelparams.md => ai.modelparams.md} (57%) rename docs-devsite/{vertexai.numberschema.md => ai.numberschema.md} (72%) rename docs-devsite/{vertexai.objectschema.md => ai.objectschema.md} (68%) rename docs-devsite/{vertexai.objectschemainterface.md => ai.objectschemainterface.md} (62%) rename docs-devsite/{vertexai.promptfeedback.md => ai.promptfeedback.md} (60%) rename docs-devsite/{vertexai.requestoptions.md => ai.requestoptions.md} (67%) rename docs-devsite/{vertexai.retrievedcontextattribution.md => ai.retrievedcontextattribution.md} (77%) create mode 100644 docs-devsite/ai.safetyrating.md create mode 100644 docs-devsite/ai.safetysetting.md rename docs-devsite/{vertexai.schema.md => ai.schema.md} (53%) rename docs-devsite/{vertexai.schemainterface.md => ai.schemainterface.md} (55%) rename docs-devsite/{vertexai.schemaparams.md => ai.schemaparams.md} (58%) rename docs-devsite/{vertexai.schemarequest.md => ai.schemarequest.md} (53%) rename docs-devsite/{vertexai.schemashared.md => ai.schemashared.md} (51%) rename docs-devsite/{vertexai.segment.md => ai.segment.md} (77%) rename docs-devsite/{vertexai.startchatparams.md => ai.startchatparams.md} (54%) rename docs-devsite/{vertexai.stringschema.md => ai.stringschema.md} (72%) rename docs-devsite/{vertexai.textpart.md => ai.textpart.md} (74%) rename docs-devsite/{vertexai.toolconfig.md => ai.toolconfig.md} (78%) rename docs-devsite/{vertexai.usagemetadata.md => ai.usagemetadata.md} (56%) rename docs-devsite/{vertexai.vertexaibackend.md => ai.vertexaibackend.md} (67%) rename docs-devsite/{vertexai.vertexaioptions.md => ai.vertexaioptions.md} (88%) rename docs-devsite/{vertexai.videometadata.md => ai.videometadata.md} (75%) rename docs-devsite/{vertexai.webattribution.md => ai.webattribution.md} (81%) delete mode 100644 docs-devsite/vertexai.ai.md delete mode 100644 docs-devsite/vertexai.counttokensresponse.md delete mode 100644 docs-devsite/vertexai.enhancedgeneratecontentresponse.md delete mode 100644 docs-devsite/vertexai.functiondeclarationstool.md delete mode 100644 docs-devsite/vertexai.generatecontentresponse.md delete mode 100644 docs-devsite/vertexai.generationconfig.md delete mode 100644 docs-devsite/vertexai.generativemodel.md delete mode 100644 docs-devsite/vertexai.md delete mode 100644 docs-devsite/vertexai.safetyrating.md delete mode 100644 docs-devsite/vertexai.safetysetting.md rename packages/{vertexai => ai}/.eslintrc.js (100%) rename packages/{vertexai => ai}/CHANGELOG.md (99%) rename packages/{vertexai => ai}/README.md (65%) rename packages/{vertexai => ai}/api-extractor.json (100%) rename packages/{vertexai => ai}/karma.conf.js (100%) rename packages/{vertexai => ai}/package.json (89%) rename packages/{vertexai => ai}/rollup.config.js (100%) rename packages/{vertexai => ai}/src/api.test.ts (100%) rename packages/{vertexai => ai}/src/api.ts (84%) rename packages/{vertexai => ai}/src/backend.test.ts (100%) rename packages/{vertexai => ai}/src/backend.ts (100%) rename packages/{vertexai => ai}/src/backwards-compatbility.test.ts (100%) rename packages/{vertexai => ai}/src/constants.ts (93%) rename packages/{vertexai => ai}/src/errors.ts (100%) rename packages/{vertexai => ai}/src/googleai-mappers.test.ts (100%) rename packages/{vertexai => ai}/src/googleai-mappers.ts (100%) rename packages/{vertexai => ai}/src/helpers.test.ts (100%) rename packages/{vertexai => ai}/src/helpers.ts (100%) rename packages/{vertexai => ai}/src/index.node.ts (100%) rename packages/{vertexai => ai}/src/index.ts (100%) rename packages/{vertexai => ai}/src/logger.ts (100%) rename packages/{vertexai => ai}/src/methods/chat-session-helpers.test.ts (100%) rename packages/{vertexai => ai}/src/methods/chat-session-helpers.ts (100%) rename packages/{vertexai => ai}/src/methods/chat-session.test.ts (100%) rename packages/{vertexai => ai}/src/methods/chat-session.ts (100%) rename packages/{vertexai => ai}/src/methods/count-tokens.test.ts (100%) rename packages/{vertexai => ai}/src/methods/count-tokens.ts (100%) rename packages/{vertexai => ai}/src/methods/generate-content.test.ts (100%) rename packages/{vertexai => ai}/src/methods/generate-content.ts (100%) rename packages/{vertexai => ai}/src/models/ai-model.test.ts (100%) rename packages/{vertexai => ai}/src/models/ai-model.ts (100%) rename packages/{vertexai => ai}/src/models/generative-model.test.ts (100%) rename packages/{vertexai => ai}/src/models/generative-model.ts (100%) rename packages/{vertexai => ai}/src/models/imagen-model.test.ts (100%) rename packages/{vertexai => ai}/src/models/imagen-model.ts (100%) rename packages/{vertexai => ai}/src/models/index.ts (100%) rename packages/{vertexai => ai}/src/public-types.ts (90%) rename packages/{vertexai => ai}/src/requests/imagen-image-format.ts (100%) rename packages/{vertexai => ai}/src/requests/request-helpers.test.ts (100%) rename packages/{vertexai => ai}/src/requests/request-helpers.ts (100%) rename packages/{vertexai => ai}/src/requests/request.test.ts (100%) rename packages/{vertexai => ai}/src/requests/request.ts (100%) rename packages/{vertexai => ai}/src/requests/response-helpers.test.ts (100%) rename packages/{vertexai => ai}/src/requests/response-helpers.ts (100%) rename packages/{vertexai => ai}/src/requests/schema-builder.test.ts (100%) rename packages/{vertexai => ai}/src/requests/schema-builder.ts (100%) rename packages/{vertexai => ai}/src/requests/stream-reader.test.ts (100%) rename packages/{vertexai => ai}/src/requests/stream-reader.ts (100%) rename packages/{vertexai => ai}/src/service.test.ts (100%) rename packages/{vertexai => ai}/src/service.ts (100%) rename packages/{vertexai => ai}/src/types/content.ts (100%) rename packages/{vertexai => ai}/src/types/enums.ts (100%) rename packages/{vertexai => ai}/src/types/error.ts (100%) rename packages/{vertexai => ai}/src/types/googleai.ts (100%) rename packages/{vertexai => ai}/src/types/imagen/index.ts (100%) rename packages/{vertexai => ai}/src/types/imagen/internal.ts (100%) rename packages/{vertexai => ai}/src/types/imagen/requests.ts (100%) rename packages/{vertexai => ai}/src/types/imagen/responses.ts (100%) rename packages/{vertexai => ai}/src/types/index.ts (100%) rename packages/{vertexai => ai}/src/types/internal.ts (100%) rename packages/{vertexai => ai}/src/types/requests.ts (100%) rename packages/{vertexai => ai}/src/types/responses.ts (100%) rename packages/{vertexai => ai}/src/types/schema.ts (100%) rename packages/{vertexai => ai}/test-utils/base64cat.ts (100%) rename packages/{vertexai => ai}/test-utils/cat.jpeg (100%) rename packages/{vertexai => ai}/test-utils/cat.png (100%) rename packages/{vertexai => ai}/test-utils/convert-mocks.ts (97%) rename packages/{vertexai => ai}/test-utils/mock-response.ts (100%) rename packages/{vertexai => ai}/tsconfig.json (100%) diff --git a/.changeset/fast-mangos-chew.md b/.changeset/fast-mangos-chew.md index c5d2e4b4d1f..4e1f7ab3121 100644 --- a/.changeset/fast-mangos-chew.md +++ b/.changeset/fast-mangos-chew.md @@ -1,5 +1,5 @@ --- -'@firebase/vertexai': patch +'@firebase/ai': patch --- Pass `GenerativeModel`'s `BaseParams` to created chat sessions. This fixes an issue where `GenerationConfig` would not be inherited from `ChatSession`. diff --git a/.changeset/perfect-camels-try.md b/.changeset/perfect-camels-try.md index 409a598531d..52292807f0a 100644 --- a/.changeset/perfect-camels-try.md +++ b/.changeset/perfect-camels-try.md @@ -1,6 +1,6 @@ --- 'firebase': minor -'@firebase/vertexai': minor +'@firebase/ai': minor --- Add support for Gemini multimodal output diff --git a/.changeset/tall-zoos-stare.md b/.changeset/tall-zoos-stare.md index 2711107986c..96d480762ea 100644 --- a/.changeset/tall-zoos-stare.md +++ b/.changeset/tall-zoos-stare.md @@ -1,6 +1,6 @@ --- 'firebase': minor -'@firebase/vertexai': minor +'@firebase/ai': minor --- Add support for the Gemini Developer API, enabling usage in a free tier, and add new `AI` API to accomodate new product naming. diff --git a/.github/workflows/canary-deploy.yml b/.github/workflows/canary-deploy.yml index 2a9a6a803a6..318db24f667 100644 --- a/.github/workflows/canary-deploy.yml +++ b/.github/workflows/canary-deploy.yml @@ -71,7 +71,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 5014ad44266..4eceacd61b1 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -33,7 +33,7 @@ jobs: LATEST=$(git tag --sort=v:refname | tail -n1) echo "cloned_tag=$CLONED" >> $GITHUB_ENV echo "latest_tag=$LATEST" >> $GITHUB_ENV - working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data + working-directory: packages/ai/test-utils/vertexai-sdk-test-data - name: Find comment from previous run if exists # This commit represents v3.1.0 uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index e5ccabdd144..d1ab281634c 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -74,7 +74,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index f5a5b808629..3ae667df6be 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -84,7 +84,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index c4adefb44a8..2f5cf5eeb38 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -110,7 +110,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md new file mode 100644 index 00000000000..d096d4c27f6 --- /dev/null +++ b/common/api-review/ai.api.md @@ -0,0 +1,955 @@ +## API Report File for "@firebase/ai" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; +import { FirebaseError } from '@firebase/util'; + +// @public +export interface AI { + app: FirebaseApp; + backend: Backend; + // @deprecated (undocumented) + location: string; +} + +// @public +export class AIError extends FirebaseError { + constructor(code: AIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); + // (undocumented) + readonly code: AIErrorCode; + // (undocumented) + readonly customErrorData?: CustomErrorData | undefined; +} + +// @public +const enum AIErrorCode { + API_NOT_ENABLED = "api-not-enabled", + ERROR = "error", + FETCH_ERROR = "fetch-error", + INVALID_CONTENT = "invalid-content", + INVALID_SCHEMA = "invalid-schema", + NO_API_KEY = "no-api-key", + NO_APP_ID = "no-app-id", + NO_MODEL = "no-model", + NO_PROJECT_ID = "no-project-id", + PARSE_FAILED = "parse-failed", + REQUEST_ERROR = "request-error", + RESPONSE_ERROR = "response-error", + UNSUPPORTED = "unsupported" +} + +export { AIErrorCode } + +export { AIErrorCode as VertexAIErrorCode } + +// @public +export abstract class AIModel { + // @internal + protected constructor(ai: AI, modelName: string); + // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts + // + // @internal (undocumented) + protected _apiSettings: ApiSettings; + readonly model: string; + // @internal + static normalizeModelName(modelName: string, backendType: BackendType): string; + } + +// @public +export interface AIOptions { + backend: Backend; +} + +// @public +export class ArraySchema extends Schema { + constructor(schemaParams: SchemaParams, items: TypedSchema); + // (undocumented) + items: TypedSchema; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + +// @public +export abstract class Backend { + protected constructor(type: BackendType); + readonly backendType: BackendType; +} + +// @public +export const BackendType: { + readonly VERTEX_AI: "VERTEX_AI"; + readonly GOOGLE_AI: "GOOGLE_AI"; +}; + +// @public +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; + +// @public +export interface BaseParams { + // (undocumented) + generationConfig?: GenerationConfig; + // (undocumented) + safetySettings?: SafetySetting[]; +} + +// @public +export enum BlockReason { + BLOCKLIST = "BLOCKLIST", + OTHER = "OTHER", + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", + SAFETY = "SAFETY" +} + +// @public +export class BooleanSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + +// @public +export class ChatSession { + constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); + getHistory(): Promise; + // (undocumented) + model: string; + // (undocumented) + params?: StartChatParams | undefined; + // (undocumented) + requestOptions?: RequestOptions | undefined; + sendMessage(request: string | Array): Promise; + sendMessageStream(request: string | Array): Promise; + } + +// @public +export interface Citation { + // (undocumented) + endIndex?: number; + // (undocumented) + license?: string; + publicationDate?: Date_2; + // (undocumented) + startIndex?: number; + title?: string; + // (undocumented) + uri?: string; +} + +// @public +export interface CitationMetadata { + // (undocumented) + citations: Citation[]; +} + +// @public +export interface Content { + // (undocumented) + parts: Part[]; + // (undocumented) + role: Role; +} + +// @public +export interface CountTokensRequest { + // (undocumented) + contents: Content[]; + generationConfig?: GenerationConfig; + systemInstruction?: string | Part | Content; + tools?: Tool[]; +} + +// @public +export interface CountTokensResponse { + promptTokensDetails?: ModalityTokenCount[]; + totalBillableCharacters?: number; + totalTokens: number; +} + +// @public +export interface CustomErrorData { + errorDetails?: ErrorDetails[]; + response?: GenerateContentResponse; + status?: number; + statusText?: string; +} + +// @public +interface Date_2 { + // (undocumented) + day: number; + // (undocumented) + month: number; + // (undocumented) + year: number; +} + +export { Date_2 as Date } + +// @public +export interface EnhancedGenerateContentResponse extends GenerateContentResponse { + // (undocumented) + functionCalls: () => FunctionCall[] | undefined; + inlineDataParts: () => InlineDataPart[] | undefined; + text: () => string; +} + +// @public +export interface ErrorDetails { + // (undocumented) + '@type'?: string; + [key: string]: unknown; + domain?: string; + metadata?: Record; + reason?: string; +} + +// @public +export interface FileData { + // (undocumented) + fileUri: string; + // (undocumented) + mimeType: string; +} + +// @public +export interface FileDataPart { + // (undocumented) + fileData: FileData; + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; +} + +// @public +export enum FinishReason { + BLOCKLIST = "BLOCKLIST", + MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", + MAX_TOKENS = "MAX_TOKENS", + OTHER = "OTHER", + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", + RECITATION = "RECITATION", + SAFETY = "SAFETY", + SPII = "SPII", + STOP = "STOP" +} + +// @public +export interface FunctionCall { + // (undocumented) + args: object; + // (undocumented) + name: string; +} + +// @public (undocumented) +export interface FunctionCallingConfig { + // (undocumented) + allowedFunctionNames?: string[]; + // (undocumented) + mode?: FunctionCallingMode; +} + +// @public (undocumented) +export enum FunctionCallingMode { + ANY = "ANY", + AUTO = "AUTO", + NONE = "NONE" +} + +// @public +export interface FunctionCallPart { + // (undocumented) + functionCall: FunctionCall; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; +} + +// @public +export interface FunctionDeclaration { + description: string; + name: string; + parameters?: ObjectSchemaInterface; +} + +// @public +export interface FunctionDeclarationsTool { + functionDeclarations?: FunctionDeclaration[]; +} + +// @public +export interface FunctionResponse { + // (undocumented) + name: string; + // (undocumented) + response: object; +} + +// @public +export interface FunctionResponsePart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse: FunctionResponse; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; +} + +// @public +export interface GenerateContentCandidate { + // (undocumented) + citationMetadata?: CitationMetadata; + // (undocumented) + content: Content; + // (undocumented) + finishMessage?: string; + // (undocumented) + finishReason?: FinishReason; + // (undocumented) + groundingMetadata?: GroundingMetadata; + // (undocumented) + index: number; + // (undocumented) + safetyRatings?: SafetyRating[]; +} + +// @public +export interface GenerateContentRequest extends BaseParams { + // (undocumented) + contents: Content[]; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export interface GenerateContentResponse { + // (undocumented) + candidates?: GenerateContentCandidate[]; + // (undocumented) + promptFeedback?: PromptFeedback; + // (undocumented) + usageMetadata?: UsageMetadata; +} + +// @public +export interface GenerateContentResult { + // (undocumented) + response: EnhancedGenerateContentResponse; +} + +// @public +export interface GenerateContentStreamResult { + // (undocumented) + response: Promise; + // (undocumented) + stream: AsyncGenerator; +} + +// @public +export interface GenerationConfig { + // (undocumented) + candidateCount?: number; + // (undocumented) + frequencyPenalty?: number; + // (undocumented) + maxOutputTokens?: number; + // (undocumented) + presencePenalty?: number; + responseMimeType?: string; + // @beta + responseModalities?: ResponseModality[]; + responseSchema?: TypedSchema | SchemaRequest; + // (undocumented) + stopSequences?: string[]; + // (undocumented) + temperature?: number; + // (undocumented) + topK?: number; + // (undocumented) + topP?: number; +} + +// @public +export interface GenerativeContentBlob { + data: string; + // (undocumented) + mimeType: string; +} + +// @public +export class GenerativeModel extends AIModel { + constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); + countTokens(request: CountTokensRequest | string | Array): Promise; + generateContent(request: GenerateContentRequest | string | Array): Promise; + generateContentStream(request: GenerateContentRequest | string | Array): Promise; + // (undocumented) + generationConfig: GenerationConfig; + // (undocumented) + requestOptions?: RequestOptions; + // (undocumented) + safetySettings: SafetySetting[]; + startChat(startChatParams?: StartChatParams): ChatSession; + // (undocumented) + systemInstruction?: Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export function getAI(app?: FirebaseApp, options?: AIOptions): AI; + +// @public +export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; + +// @beta +export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; + +// @public @deprecated (undocumented) +export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; + +// @public +export class GoogleAIBackend extends Backend { + constructor(); +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAICitationMetadata" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAICitationMetadata { + // (undocumented) + citationSources: Citation[]; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAICountTokensRequest" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAICountTokensRequest { + // (undocumented) + generateContentRequest: { + model: string; + contents: Content[]; + systemInstruction?: string | Part | Content; + tools?: Tool[]; + generationConfig?: GenerationConfig; + }; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentCandidate" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAIGenerateContentCandidate { + // (undocumented) + citationMetadata?: GoogleAICitationMetadata; + // (undocumented) + content: Content; + // (undocumented) + finishMessage?: string; + // (undocumented) + finishReason?: FinishReason; + // (undocumented) + groundingMetadata?: GroundingMetadata; + // (undocumented) + index: number; + // (undocumented) + safetyRatings?: SafetyRating[]; +} + +// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentResponse" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export interface GoogleAIGenerateContentResponse { + // (undocumented) + candidates?: GoogleAIGenerateContentCandidate[]; + // (undocumented) + promptFeedback?: PromptFeedback; + // (undocumented) + usageMetadata?: UsageMetadata; +} + +// @public @deprecated (undocumented) +export interface GroundingAttribution { + // (undocumented) + confidenceScore?: number; + // (undocumented) + retrievedContext?: RetrievedContextAttribution; + // (undocumented) + segment: Segment; + // (undocumented) + web?: WebAttribution; +} + +// @public +export interface GroundingMetadata { + // @deprecated (undocumented) + groundingAttributions: GroundingAttribution[]; + // (undocumented) + retrievalQueries?: string[]; + // (undocumented) + webSearchQueries?: string[]; +} + +// @public +export enum HarmBlockMethod { + PROBABILITY = "PROBABILITY", + SEVERITY = "SEVERITY" +} + +// @public +export enum HarmBlockThreshold { + BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", + BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", + BLOCK_NONE = "BLOCK_NONE", + BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" +} + +// @public +export enum HarmCategory { + // (undocumented) + HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", + // (undocumented) + HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", + // (undocumented) + HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", + // (undocumented) + HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT" +} + +// @public +export enum HarmProbability { + HIGH = "HIGH", + LOW = "LOW", + MEDIUM = "MEDIUM", + NEGLIGIBLE = "NEGLIGIBLE" +} + +// @public +export enum HarmSeverity { + HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", + HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", + HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", + HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", + HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED" +} + +// @beta +export enum ImagenAspectRatio { + LANDSCAPE_16x9 = "16:9", + LANDSCAPE_3x4 = "3:4", + PORTRAIT_4x3 = "4:3", + PORTRAIT_9x16 = "9:16", + SQUARE = "1:1" +} + +// @public +export interface ImagenGCSImage { + gcsURI: string; + mimeType: string; +} + +// @beta +export interface ImagenGenerationConfig { + addWatermark?: boolean; + aspectRatio?: ImagenAspectRatio; + imageFormat?: ImagenImageFormat; + negativePrompt?: string; + numberOfImages?: number; +} + +// @beta +export interface ImagenGenerationResponse { + filteredReason?: string; + images: T[]; +} + +// @beta +export class ImagenImageFormat { + compressionQuality?: number; + static jpeg(compressionQuality?: number): ImagenImageFormat; + mimeType: string; + static png(): ImagenImageFormat; +} + +// @beta +export interface ImagenInlineImage { + bytesBase64Encoded: string; + mimeType: string; +} + +// @beta +export class ImagenModel extends AIModel { + constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); + generateImages(prompt: string): Promise>; + // @internal + generateImagesGCS(prompt: string, gcsURI: string): Promise>; + generationConfig?: ImagenGenerationConfig; + // (undocumented) + requestOptions?: RequestOptions | undefined; + safetySettings?: ImagenSafetySettings; +} + +// @beta +export interface ImagenModelParams { + generationConfig?: ImagenGenerationConfig; + model: string; + safetySettings?: ImagenSafetySettings; +} + +// @beta +export enum ImagenPersonFilterLevel { + ALLOW_ADULT = "allow_adult", + ALLOW_ALL = "allow_all", + BLOCK_ALL = "dont_allow" +} + +// @beta +export enum ImagenSafetyFilterLevel { + BLOCK_LOW_AND_ABOVE = "block_low_and_above", + BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above", + BLOCK_NONE = "block_none", + BLOCK_ONLY_HIGH = "block_only_high" +} + +// @beta +export interface ImagenSafetySettings { + personFilterLevel?: ImagenPersonFilterLevel; + safetyFilterLevel?: ImagenSafetyFilterLevel; +} + +// @public +export interface InlineDataPart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData: GenerativeContentBlob; + // (undocumented) + text?: never; + videoMetadata?: VideoMetadata; +} + +// @public +export class IntegerSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + +// @public +export enum Modality { + AUDIO = "AUDIO", + DOCUMENT = "DOCUMENT", + IMAGE = "IMAGE", + MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED", + TEXT = "TEXT", + VIDEO = "VIDEO" +} + +// @public +export interface ModalityTokenCount { + modality: Modality; + tokenCount: number; +} + +// @public +export interface ModelParams extends BaseParams { + // (undocumented) + model: string; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export class NumberSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + +// @public +export class ObjectSchema extends Schema { + constructor(schemaParams: SchemaParams, properties: { + [k: string]: TypedSchema; + }, optionalProperties?: string[]); + // (undocumented) + optionalProperties: string[]; + // (undocumented) + properties: { + [k: string]: TypedSchema; + }; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + +// @public +export interface ObjectSchemaInterface extends SchemaInterface { + // (undocumented) + optionalProperties?: string[]; + // (undocumented) + type: SchemaType.OBJECT; +} + +// @public +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; + +// @public +export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; + +// @public +export interface PromptFeedback { + // (undocumented) + blockReason?: BlockReason; + blockReasonMessage?: string; + // (undocumented) + safetyRatings: SafetyRating[]; +} + +// @public +export interface RequestOptions { + baseUrl?: string; + timeout?: number; +} + +// @beta +export const ResponseModality: { + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; +}; + +// @beta +export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; + +// @public (undocumented) +export interface RetrievedContextAttribution { + // (undocumented) + title: string; + // (undocumented) + uri: string; +} + +// @public +export type Role = (typeof POSSIBLE_ROLES)[number]; + +// @public +export interface SafetyRating { + // (undocumented) + blocked: boolean; + // (undocumented) + category: HarmCategory; + // (undocumented) + probability: HarmProbability; + probabilityScore: number; + severity: HarmSeverity; + severityScore: number; +} + +// @public +export interface SafetySetting { + // (undocumented) + category: HarmCategory; + method?: HarmBlockMethod; + // (undocumented) + threshold: HarmBlockThreshold; +} + +// @public +export abstract class Schema implements SchemaInterface { + constructor(schemaParams: SchemaInterface); + [key: string]: unknown; + // (undocumented) + static array(arrayParams: SchemaParams & { + items: Schema; + }): ArraySchema; + // (undocumented) + static boolean(booleanParams?: SchemaParams): BooleanSchema; + description?: string; + // (undocumented) + static enumString(stringParams: SchemaParams & { + enum: string[]; + }): StringSchema; + example?: unknown; + format?: string; + // (undocumented) + static integer(integerParams?: SchemaParams): IntegerSchema; + nullable: boolean; + // (undocumented) + static number(numberParams?: SchemaParams): NumberSchema; + // (undocumented) + static object(objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + }): ObjectSchema; + // (undocumented) + static string(stringParams?: SchemaParams): StringSchema; + // @internal + toJSON(): SchemaRequest; + type: SchemaType; +} + +// @public +export interface SchemaInterface extends SchemaShared { + type: SchemaType; +} + +// @public +export interface SchemaParams extends SchemaShared { +} + +// @public +export interface SchemaRequest extends SchemaShared { + required?: string[]; + type: SchemaType; +} + +// @public +export interface SchemaShared { + // (undocumented) + [key: string]: unknown; + description?: string; + enum?: string[]; + example?: unknown; + format?: string; + items?: T; + nullable?: boolean; + properties?: { + [k: string]: T; + }; +} + +// @public +export enum SchemaType { + ARRAY = "array", + BOOLEAN = "boolean", + INTEGER = "integer", + NUMBER = "number", + OBJECT = "object", + STRING = "string" +} + +// @public (undocumented) +export interface Segment { + // (undocumented) + endIndex: number; + // (undocumented) + partIndex: number; + // (undocumented) + startIndex: number; +} + +// @public +export interface StartChatParams extends BaseParams { + // (undocumented) + history?: Content[]; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export class StringSchema extends Schema { + constructor(schemaParams?: SchemaParams, enumValues?: string[]); + // (undocumented) + enum?: string[]; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + +// @public +export interface TextPart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text: string; +} + +// @public +export type Tool = FunctionDeclarationsTool; + +// @public +export interface ToolConfig { + // (undocumented) + functionCallingConfig?: FunctionCallingConfig; +} + +// @public +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; + +// @public +export interface UsageMetadata { + // (undocumented) + candidatesTokenCount: number; + // (undocumented) + candidatesTokensDetails?: ModalityTokenCount[]; + // (undocumented) + promptTokenCount: number; + // (undocumented) + promptTokensDetails?: ModalityTokenCount[]; + // (undocumented) + totalTokenCount: number; +} + +// @public @deprecated (undocumented) +export type VertexAI = AI; + +// @public +export class VertexAIBackend extends Backend { + constructor(location?: string); + readonly location: string; +} + +// @public @deprecated (undocumented) +export const VertexAIError: typeof AIError; + +// @public @deprecated (undocumented) +export const VertexAIModel: typeof AIModel; + +// @public +export interface VertexAIOptions { + // (undocumented) + location?: string; +} + +// @public +export interface VideoMetadata { + endOffset: string; + startOffset: string; +} + +// @public (undocumented) +export interface WebAttribution { + // (undocumented) + title: string; + // (undocumented) + uri: string; +} + + +``` diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index c507b44ce99..b77a6b5910e 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -1,6 +1,155 @@ toc: - title: firebase path: /docs/reference/js/index +- title: ai + path: /docs/reference/js/ai.md + section: + - title: AI + path: /docs/reference/js/ai.ai.md + - title: AIError + path: /docs/reference/js/ai.aierror.md + - title: AIModel + path: /docs/reference/js/ai.aimodel.md + - title: AIOptions + path: /docs/reference/js/ai.aioptions.md + - title: ArraySchema + path: /docs/reference/js/ai.arrayschema.md + - title: Backend + path: /docs/reference/js/ai.backend.md + - title: BaseParams + path: /docs/reference/js/ai.baseparams.md + - title: BooleanSchema + path: /docs/reference/js/ai.booleanschema.md + - title: ChatSession + path: /docs/reference/js/ai.chatsession.md + - title: Citation + path: /docs/reference/js/ai.citation.md + - title: CitationMetadata + path: /docs/reference/js/ai.citationmetadata.md + - title: Content + path: /docs/reference/js/ai.content.md + - title: CountTokensRequest + path: /docs/reference/js/ai.counttokensrequest.md + - title: CountTokensResponse + path: /docs/reference/js/ai.counttokensresponse.md + - title: CustomErrorData + path: /docs/reference/js/ai.customerrordata.md + - title: Date_2 + path: /docs/reference/js/ai.date_2.md + - title: EnhancedGenerateContentResponse + path: /docs/reference/js/ai.enhancedgeneratecontentresponse.md + - title: ErrorDetails + path: /docs/reference/js/ai.errordetails.md + - title: FileData + path: /docs/reference/js/ai.filedata.md + - title: FileDataPart + path: /docs/reference/js/ai.filedatapart.md + - title: FunctionCall + path: /docs/reference/js/ai.functioncall.md + - title: FunctionCallingConfig + path: /docs/reference/js/ai.functioncallingconfig.md + - title: FunctionCallPart + path: /docs/reference/js/ai.functioncallpart.md + - title: FunctionDeclaration + path: /docs/reference/js/ai.functiondeclaration.md + - title: FunctionDeclarationsTool + path: /docs/reference/js/ai.functiondeclarationstool.md + - title: FunctionResponse + path: /docs/reference/js/ai.functionresponse.md + - title: FunctionResponsePart + path: /docs/reference/js/ai.functionresponsepart.md + - title: GenerateContentCandidate + path: /docs/reference/js/ai.generatecontentcandidate.md + - title: GenerateContentRequest + path: /docs/reference/js/ai.generatecontentrequest.md + - title: GenerateContentResponse + path: /docs/reference/js/ai.generatecontentresponse.md + - title: GenerateContentResult + path: /docs/reference/js/ai.generatecontentresult.md + - title: GenerateContentStreamResult + path: /docs/reference/js/ai.generatecontentstreamresult.md + - title: GenerationConfig + path: /docs/reference/js/ai.generationconfig.md + - title: GenerativeContentBlob + path: /docs/reference/js/ai.generativecontentblob.md + - title: GenerativeModel + path: /docs/reference/js/ai.generativemodel.md + - title: GoogleAIBackend + path: /docs/reference/js/ai.googleaibackend.md + - title: GroundingAttribution + path: /docs/reference/js/ai.groundingattribution.md + - title: GroundingMetadata + path: /docs/reference/js/ai.groundingmetadata.md + - title: ImagenGCSImage + path: /docs/reference/js/ai.imagengcsimage.md + - title: ImagenGenerationConfig + path: /docs/reference/js/ai.imagengenerationconfig.md + - title: ImagenGenerationResponse + path: /docs/reference/js/ai.imagengenerationresponse.md + - title: ImagenImageFormat + path: /docs/reference/js/ai.imagenimageformat.md + - title: ImagenInlineImage + path: /docs/reference/js/ai.imageninlineimage.md + - title: ImagenModel + path: /docs/reference/js/ai.imagenmodel.md + - title: ImagenModelParams + path: /docs/reference/js/ai.imagenmodelparams.md + - title: ImagenSafetySettings + path: /docs/reference/js/ai.imagensafetysettings.md + - title: InlineDataPart + path: /docs/reference/js/ai.inlinedatapart.md + - title: IntegerSchema + path: /docs/reference/js/ai.integerschema.md + - title: ModalityTokenCount + path: /docs/reference/js/ai.modalitytokencount.md + - title: ModelParams + path: /docs/reference/js/ai.modelparams.md + - title: NumberSchema + path: /docs/reference/js/ai.numberschema.md + - title: ObjectSchema + path: /docs/reference/js/ai.objectschema.md + - title: ObjectSchemaInterface + path: /docs/reference/js/ai.objectschemainterface.md + - title: PromptFeedback + path: /docs/reference/js/ai.promptfeedback.md + - title: RequestOptions + path: /docs/reference/js/ai.requestoptions.md + - title: RetrievedContextAttribution + path: /docs/reference/js/ai.retrievedcontextattribution.md + - title: SafetyRating + path: /docs/reference/js/ai.safetyrating.md + - title: SafetySetting + path: /docs/reference/js/ai.safetysetting.md + - title: Schema + path: /docs/reference/js/ai.schema.md + - title: SchemaInterface + path: /docs/reference/js/ai.schemainterface.md + - title: SchemaParams + path: /docs/reference/js/ai.schemaparams.md + - title: SchemaRequest + path: /docs/reference/js/ai.schemarequest.md + - title: SchemaShared + path: /docs/reference/js/ai.schemashared.md + - title: Segment + path: /docs/reference/js/ai.segment.md + - title: StartChatParams + path: /docs/reference/js/ai.startchatparams.md + - title: StringSchema + path: /docs/reference/js/ai.stringschema.md + - title: TextPart + path: /docs/reference/js/ai.textpart.md + - title: ToolConfig + path: /docs/reference/js/ai.toolconfig.md + - title: UsageMetadata + path: /docs/reference/js/ai.usagemetadata.md + - title: VertexAIBackend + path: /docs/reference/js/ai.vertexaibackend.md + - title: VertexAIOptions + path: /docs/reference/js/ai.vertexaioptions.md + - title: VideoMetadata + path: /docs/reference/js/ai.videometadata.md + - title: WebAttribution + path: /docs/reference/js/ai.webattribution.md - title: analytics path: /docs/reference/js/analytics.md section: @@ -469,152 +618,3 @@ toc: path: /docs/reference/js/storage.uploadtask.md - title: UploadTaskSnapshot path: /docs/reference/js/storage.uploadtasksnapshot.md -- title: vertexai - path: /docs/reference/js/vertexai.md - section: - - title: AI - path: /docs/reference/js/vertexai.ai.md - - title: AIError - path: /docs/reference/js/vertexai.aierror.md - - title: AIModel - path: /docs/reference/js/vertexai.aimodel.md - - title: AIOptions - path: /docs/reference/js/vertexai.aioptions.md - - title: ArraySchema - path: /docs/reference/js/vertexai.arrayschema.md - - title: Backend - path: /docs/reference/js/vertexai.backend.md - - title: BaseParams - path: /docs/reference/js/vertexai.baseparams.md - - title: BooleanSchema - path: /docs/reference/js/vertexai.booleanschema.md - - title: ChatSession - path: /docs/reference/js/vertexai.chatsession.md - - title: Citation - path: /docs/reference/js/vertexai.citation.md - - title: CitationMetadata - path: /docs/reference/js/vertexai.citationmetadata.md - - title: Content - path: /docs/reference/js/vertexai.content.md - - title: CountTokensRequest - path: /docs/reference/js/vertexai.counttokensrequest.md - - title: CountTokensResponse - path: /docs/reference/js/vertexai.counttokensresponse.md - - title: CustomErrorData - path: /docs/reference/js/vertexai.customerrordata.md - - title: Date_2 - path: /docs/reference/js/vertexai.date_2.md - - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md - - title: ErrorDetails - path: /docs/reference/js/vertexai.errordetails.md - - title: FileData - path: /docs/reference/js/vertexai.filedata.md - - title: FileDataPart - path: /docs/reference/js/vertexai.filedatapart.md - - title: FunctionCall - path: /docs/reference/js/vertexai.functioncall.md - - title: FunctionCallingConfig - path: /docs/reference/js/vertexai.functioncallingconfig.md - - title: FunctionCallPart - path: /docs/reference/js/vertexai.functioncallpart.md - - title: FunctionDeclaration - path: /docs/reference/js/vertexai.functiondeclaration.md - - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai.functiondeclarationstool.md - - title: FunctionResponse - path: /docs/reference/js/vertexai.functionresponse.md - - title: FunctionResponsePart - path: /docs/reference/js/vertexai.functionresponsepart.md - - title: GenerateContentCandidate - path: /docs/reference/js/vertexai.generatecontentcandidate.md - - title: GenerateContentRequest - path: /docs/reference/js/vertexai.generatecontentrequest.md - - title: GenerateContentResponse - path: /docs/reference/js/vertexai.generatecontentresponse.md - - title: GenerateContentResult - path: /docs/reference/js/vertexai.generatecontentresult.md - - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai.generatecontentstreamresult.md - - title: GenerationConfig - path: /docs/reference/js/vertexai.generationconfig.md - - title: GenerativeContentBlob - path: /docs/reference/js/vertexai.generativecontentblob.md - - title: GenerativeModel - path: /docs/reference/js/vertexai.generativemodel.md - - title: GoogleAIBackend - path: /docs/reference/js/vertexai.googleaibackend.md - - title: GroundingAttribution - path: /docs/reference/js/vertexai.groundingattribution.md - - title: GroundingMetadata - path: /docs/reference/js/vertexai.groundingmetadata.md - - title: ImagenGCSImage - path: /docs/reference/js/vertexai.imagengcsimage.md - - title: ImagenGenerationConfig - path: /docs/reference/js/vertexai.imagengenerationconfig.md - - title: ImagenGenerationResponse - path: /docs/reference/js/vertexai.imagengenerationresponse.md - - title: ImagenImageFormat - path: /docs/reference/js/vertexai.imagenimageformat.md - - title: ImagenInlineImage - path: /docs/reference/js/vertexai.imageninlineimage.md - - title: ImagenModel - path: /docs/reference/js/vertexai.imagenmodel.md - - title: ImagenModelParams - path: /docs/reference/js/vertexai.imagenmodelparams.md - - title: ImagenSafetySettings - path: /docs/reference/js/vertexai.imagensafetysettings.md - - title: InlineDataPart - path: /docs/reference/js/vertexai.inlinedatapart.md - - title: IntegerSchema - path: /docs/reference/js/vertexai.integerschema.md - - title: ModalityTokenCount - path: /docs/reference/js/vertexai.modalitytokencount.md - - title: ModelParams - path: /docs/reference/js/vertexai.modelparams.md - - title: NumberSchema - path: /docs/reference/js/vertexai.numberschema.md - - title: ObjectSchema - path: /docs/reference/js/vertexai.objectschema.md - - title: ObjectSchemaInterface - path: /docs/reference/js/vertexai.objectschemainterface.md - - title: PromptFeedback - path: /docs/reference/js/vertexai.promptfeedback.md - - title: RequestOptions - path: /docs/reference/js/vertexai.requestoptions.md - - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai.retrievedcontextattribution.md - - title: SafetyRating - path: /docs/reference/js/vertexai.safetyrating.md - - title: SafetySetting - path: /docs/reference/js/vertexai.safetysetting.md - - title: Schema - path: /docs/reference/js/vertexai.schema.md - - title: SchemaInterface - path: /docs/reference/js/vertexai.schemainterface.md - - title: SchemaParams - path: /docs/reference/js/vertexai.schemaparams.md - - title: SchemaRequest - path: /docs/reference/js/vertexai.schemarequest.md - - title: SchemaShared - path: /docs/reference/js/vertexai.schemashared.md - - title: Segment - path: /docs/reference/js/vertexai.segment.md - - title: StartChatParams - path: /docs/reference/js/vertexai.startchatparams.md - - title: StringSchema - path: /docs/reference/js/vertexai.stringschema.md - - title: TextPart - path: /docs/reference/js/vertexai.textpart.md - - title: ToolConfig - path: /docs/reference/js/vertexai.toolconfig.md - - title: UsageMetadata - path: /docs/reference/js/vertexai.usagemetadata.md - - title: VertexAIBackend - path: /docs/reference/js/vertexai.vertexaibackend.md - - title: VertexAIOptions - path: /docs/reference/js/vertexai.vertexaioptions.md - - title: VideoMetadata - path: /docs/reference/js/vertexai.videometadata.md - - title: WebAttribution - path: /docs/reference/js/vertexai.webattribution.md diff --git a/docs-devsite/ai.ai.md b/docs-devsite/ai.ai.md new file mode 100644 index 00000000000..d4127ffb7e8 --- /dev/null +++ b/docs-devsite/ai.ai.md @@ -0,0 +1,64 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AI interface +An instance of the Firebase AI SDK. + +Do not create this instance directly. Instead, use [getAI()](./ai.md#getai_a94a413). + +Signature: + +```typescript +export interface AI +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [app](./ai.ai.md#aiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./ai.ai.md#ai_interface) instance is associated with. | +| [backend](./ai.ai.md#aibackend) | [Backend](./ai.backend.md#backend_class) | A [Backend](./ai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). | +| [location](./ai.ai.md#ailocation) | string | | + +## AI.app + +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./ai.ai.md#ai_interface) instance is associated with. + +Signature: + +```typescript +app: FirebaseApp; +``` + +## AI.backend + +A [Backend](./ai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). + +Signature: + +```typescript +backend: Backend; +``` + +## AI.location + +> Warning: This API is now obsolete. +> +> use `AI.backend.location` instead. +> +> The location configured for this AI service instance, relevant for Vertex AI backends. +> + +Signature: + +```typescript +location: string; +``` diff --git a/docs-devsite/vertexai.aierror.md b/docs-devsite/ai.aierror.md similarity index 65% rename from docs-devsite/vertexai.aierror.md rename to docs-devsite/ai.aierror.md index dac50815b6a..cf2d7e2b4c1 100644 --- a/docs-devsite/vertexai.aierror.md +++ b/docs-devsite/ai.aierror.md @@ -23,14 +23,14 @@ export declare class AIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai.aierror.md#aierrorconstructor) | | Constructs a new instance of the AIError class. | +| [(constructor)(code, message, customErrorData)](./ai.aierror.md#aierrorconstructor) | | Constructs a new instance of the AIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai.aierror.md#aierrorcode) | | [AIErrorCode](./vertexai.md#aierrorcode) | | -| [customErrorData](./vertexai.aierror.md#aierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | +| [code](./ai.aierror.md#aierrorcode) | | [AIErrorCode](./ai.md#aierrorcode) | | +| [customErrorData](./ai.aierror.md#aierrorcustomerrordata) | | [CustomErrorData](./ai.customerrordata.md#customerrordata_interface) \| undefined | | ## AIError.(constructor) @@ -46,9 +46,9 @@ constructor(code: AIErrorCode, message: string, customErrorData?: CustomErrorDat | Parameter | Type | Description | | --- | --- | --- | -| code | [AIErrorCode](./vertexai.md#aierrorcode) | The error code from [AIErrorCode](./vertexai.md#aierrorcode). | +| code | [AIErrorCode](./ai.md#aierrorcode) | The error code from [AIErrorCode](./ai.md#aierrorcode). | | message | string | A human-readable message describing the error. | -| customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | +| customErrorData | [CustomErrorData](./ai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | ## AIError.code diff --git a/docs-devsite/vertexai.aimodel.md b/docs-devsite/ai.aimodel.md similarity index 74% rename from docs-devsite/vertexai.aimodel.md rename to docs-devsite/ai.aimodel.md index 0ff091a0d03..d8910c11dc5 100644 --- a/docs-devsite/vertexai.aimodel.md +++ b/docs-devsite/ai.aimodel.md @@ -12,7 +12,7 @@ https://github.com/firebase/firebase-js-sdk # AIModel class Base class for Firebase AI model APIs. -Instances of this class are associated with a specific Firebase AI [Backend](./vertexai.backend.md#backend_class) and provide methods for interacting with the configured generative model. +Instances of this class are associated with a specific Firebase AI [Backend](./ai.backend.md#backend_class) and provide methods for interacting with the configured generative model. The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AIModel` class. @@ -26,7 +26,7 @@ export declare abstract class AIModel | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [model](./vertexai.aimodel.md#aimodelmodel) | | string | The fully qualified model resource name to use for generating images (for example, publishers/google/models/imagen-3.0-generate-002). | +| [model](./ai.aimodel.md#aimodelmodel) | | string | The fully qualified model resource name to use for generating images (for example, publishers/google/models/imagen-3.0-generate-002). | ## AIModel.model diff --git a/docs-devsite/vertexai.aioptions.md b/docs-devsite/ai.aioptions.md similarity index 59% rename from docs-devsite/vertexai.aioptions.md rename to docs-devsite/ai.aioptions.md index 00ff0153527..a092046900b 100644 --- a/docs-devsite/vertexai.aioptions.md +++ b/docs-devsite/ai.aioptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # AIOptions interface -Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). +Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). Signature: @@ -22,7 +22,7 @@ export interface AIOptions | Property | Type | Description | | --- | --- | --- | -| [backend](./vertexai.aioptions.md#aioptionsbackend) | [Backend](./vertexai.backend.md#backend_class) | The backend configuration to use for the AI service instance. | +| [backend](./ai.aioptions.md#aioptionsbackend) | [Backend](./ai.backend.md#backend_class) | The backend configuration to use for the AI service instance. | ## AIOptions.backend diff --git a/docs-devsite/vertexai.arrayschema.md b/docs-devsite/ai.arrayschema.md similarity index 69% rename from docs-devsite/vertexai.arrayschema.md rename to docs-devsite/ai.arrayschema.md index 8f228baf9e8..ef29bbd63f5 100644 --- a/docs-devsite/vertexai.arrayschema.md +++ b/docs-devsite/ai.arrayschema.md @@ -17,19 +17,19 @@ Schema class for "array" types. The `items` param should refer to the type of it ```typescript export declare class ArraySchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams, items)](./vertexai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | +| [(constructor)(schemaParams, items)](./ai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [items](./vertexai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./vertexai.md#typedschema) | | +| [items](./ai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./ai.md#typedschema) | | ## ArraySchema.(constructor) @@ -45,8 +45,8 @@ constructor(schemaParams: SchemaParams, items: TypedSchema); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | -| items | [TypedSchema](./vertexai.md#typedschema) | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | +| items | [TypedSchema](./ai.md#typedschema) | | ## ArraySchema.items diff --git a/docs-devsite/vertexai.backend.md b/docs-devsite/ai.backend.md similarity index 64% rename from docs-devsite/vertexai.backend.md rename to docs-devsite/ai.backend.md index e6a2606901e..967c1de19de 100644 --- a/docs-devsite/vertexai.backend.md +++ b/docs-devsite/ai.backend.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # Backend class -Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. +Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. Signature: @@ -22,13 +22,13 @@ export declare abstract class Backend | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(type)](./vertexai.backend.md#backendconstructor) | | Protected constructor for use by subclasses. | +| [(constructor)(type)](./ai.backend.md#backendconstructor) | | Protected constructor for use by subclasses. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [backendType](./vertexai.backend.md#backendbackendtype) | | [BackendType](./vertexai.md#backendtype) | Specifies the backend type. | +| [backendType](./ai.backend.md#backendbackendtype) | | [BackendType](./ai.md#backendtype) | Specifies the backend type. | ## Backend.(constructor) @@ -44,7 +44,7 @@ protected constructor(type: BackendType); | Parameter | Type | Description | | --- | --- | --- | -| type | [BackendType](./vertexai.md#backendtype) | The backend type. | +| type | [BackendType](./ai.md#backendtype) | The backend type. | ## Backend.backendType diff --git a/docs-devsite/vertexai.baseparams.md b/docs-devsite/ai.baseparams.md similarity index 69% rename from docs-devsite/vertexai.baseparams.md rename to docs-devsite/ai.baseparams.md index 382ec825210..62484281f3b 100644 --- a/docs-devsite/vertexai.baseparams.md +++ b/docs-devsite/ai.baseparams.md @@ -22,8 +22,8 @@ export interface BaseParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | -| [safetySettings](./vertexai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | +| [generationConfig](./ai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | | +| [safetySettings](./ai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./ai.safetysetting.md#safetysetting_interface)\[\] | | ## BaseParams.generationConfig diff --git a/docs-devsite/vertexai.booleanschema.md b/docs-devsite/ai.booleanschema.md similarity index 71% rename from docs-devsite/vertexai.booleanschema.md rename to docs-devsite/ai.booleanschema.md index 89449f26142..5797d530286 100644 --- a/docs-devsite/vertexai.booleanschema.md +++ b/docs-devsite/ai.booleanschema.md @@ -17,13 +17,13 @@ Schema class for "boolean" types. ```typescript export declare class BooleanSchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | +| [(constructor)(schemaParams)](./ai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | ## BooleanSchema.(constructor) @@ -39,5 +39,5 @@ constructor(schemaParams?: SchemaParams); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/ai.chatsession.md similarity index 52% rename from docs-devsite/vertexai.chatsession.md rename to docs-devsite/ai.chatsession.md index ed359f7e08c..1d6e403b6a8 100644 --- a/docs-devsite/vertexai.chatsession.md +++ b/docs-devsite/ai.chatsession.md @@ -22,23 +22,23 @@ export declare class ChatSession | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | +| [(constructor)(apiSettings, model, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [model](./vertexai.chatsession.md#chatsessionmodel) | | string | | -| [params](./vertexai.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | -| [requestOptions](./vertexai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | +| [model](./ai.chatsession.md#chatsessionmodel) | | string | | +| [params](./ai.chatsession.md#chatsessionparams) | | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) \| undefined | | +| [requestOptions](./ai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | +| [getHistory()](./ai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | +| [sendMessage(request)](./ai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./ai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | ## ChatSession.(constructor) @@ -56,8 +56,8 @@ constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | | --- | --- | --- | | apiSettings | ApiSettings | | | model | string | | -| params | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | +| params | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) \| undefined | | +| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | | ## ChatSession.model @@ -94,11 +94,11 @@ getHistory(): Promise; ``` Returns: -Promise<[Content](./vertexai.content.md#content_interface)\[\]> +Promise<[Content](./ai.content.md#content_interface)\[\]> ## ChatSession.sendMessage() -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) +Sends a chat message and receives a non-streaming [GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface) Signature: @@ -110,15 +110,15 @@ sendMessage(request: string | Array): Promise> | | +| request | string \| Array<string \| [Part](./ai.md#part)> | | Returns: -Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> +Promise<[GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface)> ## ChatSession.sendMessageStream() -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. +Sends a chat message and receives the response as a [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. Signature: @@ -130,9 +130,9 @@ sendMessageStream(request: string | Array): Promise> | | +| request | string \| Array<string \| [Part](./ai.md#part)> | | Returns: -Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> +Promise<[GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> diff --git a/docs-devsite/vertexai.citation.md b/docs-devsite/ai.citation.md similarity index 55% rename from docs-devsite/vertexai.citation.md rename to docs-devsite/ai.citation.md index c694f6c2a9c..3ed9dddc70d 100644 --- a/docs-devsite/vertexai.citation.md +++ b/docs-devsite/ai.citation.md @@ -22,12 +22,12 @@ export interface Citation | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai.citation.md#citationendindex) | number | | -| [license](./vertexai.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | The publication date of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | -| [startIndex](./vertexai.citation.md#citationstartindex) | number | | -| [title](./vertexai.citation.md#citationtitle) | string | The title of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | -| [uri](./vertexai.citation.md#citationuri) | string | | +| [endIndex](./ai.citation.md#citationendindex) | number | | +| [license](./ai.citation.md#citationlicense) | string | | +| [publicationDate](./ai.citation.md#citationpublicationdate) | Date | The publication date of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). | +| [startIndex](./ai.citation.md#citationstartindex) | number | | +| [title](./ai.citation.md#citationtitle) | string | The title of the cited source, if available.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). | +| [uri](./ai.citation.md#citationuri) | string | | ## Citation.endIndex @@ -49,7 +49,7 @@ license?: string; The publication date of the cited source, if available. -This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). Signature: @@ -69,7 +69,7 @@ startIndex?: number; The title of the cited source, if available. -This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). Signature: diff --git a/docs-devsite/vertexai.citationmetadata.md b/docs-devsite/ai.citationmetadata.md similarity index 73% rename from docs-devsite/vertexai.citationmetadata.md rename to docs-devsite/ai.citationmetadata.md index c317160e64f..a87654de38f 100644 --- a/docs-devsite/vertexai.citationmetadata.md +++ b/docs-devsite/ai.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: @@ -22,7 +22,7 @@ export interface CitationMetadata | Property | Type | Description | | --- | --- | --- | -| [citations](./vertexai.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai.citation.md#citation_interface)\[\] | | +| [citations](./ai.citationmetadata.md#citationmetadatacitations) | [Citation](./ai.citation.md#citation_interface)\[\] | | ## CitationMetadata.citations diff --git a/docs-devsite/vertexai.content.md b/docs-devsite/ai.content.md similarity index 79% rename from docs-devsite/vertexai.content.md rename to docs-devsite/ai.content.md index 7a4634a62bc..299a0947924 100644 --- a/docs-devsite/vertexai.content.md +++ b/docs-devsite/ai.content.md @@ -22,8 +22,8 @@ export interface Content | Property | Type | Description | | --- | --- | --- | -| [parts](./vertexai.content.md#contentparts) | [Part](./vertexai.md#part)\[\] | | -| [role](./vertexai.content.md#contentrole) | [Role](./vertexai.md#role) | | +| [parts](./ai.content.md#contentparts) | [Part](./ai.md#part)\[\] | | +| [role](./ai.content.md#contentrole) | [Role](./ai.md#role) | | ## Content.parts diff --git a/docs-devsite/vertexai.counttokensrequest.md b/docs-devsite/ai.counttokensrequest.md similarity index 52% rename from docs-devsite/vertexai.counttokensrequest.md rename to docs-devsite/ai.counttokensrequest.md index 740ae5feed4..ddcb020378b 100644 --- a/docs-devsite/vertexai.counttokensrequest.md +++ b/docs-devsite/ai.counttokensrequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensRequest interface -Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) +Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) Signature: @@ -22,10 +22,10 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | -| [generationConfig](./vertexai.counttokensrequest.md#counttokensrequestgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Configuration options that control how the model generates a response. | -| [systemInstruction](./vertexai.counttokensrequest.md#counttokensrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | Instructions that direct the model to behave a certain way. | -| [tools](./vertexai.counttokensrequest.md#counttokensrequesttools) | [Tool](./vertexai.md#tool)\[\] | [Tool](./vertexai.md#tool) configuration. | +| [contents](./ai.counttokensrequest.md#counttokensrequestcontents) | [Content](./ai.content.md#content_interface)\[\] | | +| [generationConfig](./ai.counttokensrequest.md#counttokensrequestgenerationconfig) | [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | Configuration options that control how the model generates a response. | +| [systemInstruction](./ai.counttokensrequest.md#counttokensrequestsysteminstruction) | string \| [Part](./ai.md#part) \| [Content](./ai.content.md#content_interface) | Instructions that direct the model to behave a certain way. | +| [tools](./ai.counttokensrequest.md#counttokensrequesttools) | [Tool](./ai.md#tool)\[\] | [Tool](./ai.md#tool) configuration. | ## CountTokensRequest.contents @@ -57,7 +57,7 @@ systemInstruction?: string | Part | Content; ## CountTokensRequest.tools -[Tool](./vertexai.md#tool) configuration. +[Tool](./ai.md#tool) configuration. Signature: diff --git a/docs-devsite/ai.counttokensresponse.md b/docs-devsite/ai.counttokensresponse.md new file mode 100644 index 00000000000..71e64d885d8 --- /dev/null +++ b/docs-devsite/ai.counttokensresponse.md @@ -0,0 +1,59 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CountTokensResponse interface +Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens). + +Signature: + +```typescript +export interface CountTokensResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [promptTokensDetails](./ai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. | +| [totalBillableCharacters](./ai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | +| [totalTokens](./ai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | + +## CountTokensResponse.promptTokensDetails + +The breakdown, by modality, of how many tokens are consumed by the prompt. + +Signature: + +```typescript +promptTokensDetails?: ModalityTokenCount[]; +``` + +## CountTokensResponse.totalBillableCharacters + +The total number of billable characters counted across all instances from the request. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + +Signature: + +```typescript +totalBillableCharacters?: number; +``` + +## CountTokensResponse.totalTokens + +The total number of tokens counted across all instances from the request. + +Signature: + +```typescript +totalTokens: number; +``` diff --git a/docs-devsite/vertexai.customerrordata.md b/docs-devsite/ai.customerrordata.md similarity index 55% rename from docs-devsite/vertexai.customerrordata.md rename to docs-devsite/ai.customerrordata.md index 100f4a85fd9..149ad876191 100644 --- a/docs-devsite/vertexai.customerrordata.md +++ b/docs-devsite/ai.customerrordata.md @@ -22,10 +22,10 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | -| [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | -| [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | -| [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | +| [errorDetails](./ai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./ai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | +| [response](./ai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | +| [status](./ai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | +| [statusText](./ai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | ## CustomErrorData.errorDetails @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai.date_2.md b/docs-devsite/ai.date_2.md similarity index 80% rename from docs-devsite/vertexai.date_2.md rename to docs-devsite/ai.date_2.md index cf073bb86fe..10b3cfc41e9 100644 --- a/docs-devsite/vertexai.date_2.md +++ b/docs-devsite/ai.date_2.md @@ -22,9 +22,9 @@ export interface Date | Property | Type | Description | | --- | --- | --- | -| [day](./vertexai.date_2.md#date_2day) | number | | -| [month](./vertexai.date_2.md#date_2month) | number | | -| [year](./vertexai.date_2.md#date_2year) | number | | +| [day](./ai.date_2.md#date_2day) | number | | +| [month](./ai.date_2.md#date_2month) | number | | +| [year](./ai.date_2.md#date_2year) | number | | ## Date\_2.day diff --git a/docs-devsite/ai.enhancedgeneratecontentresponse.md b/docs-devsite/ai.enhancedgeneratecontentresponse.md new file mode 100644 index 00000000000..330dc10f322 --- /dev/null +++ b/docs-devsite/ai.enhancedgeneratecontentresponse.md @@ -0,0 +1,56 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# EnhancedGenerateContentResponse interface +Response object wrapped with helper methods. + +Signature: + +```typescript +export interface EnhancedGenerateContentResponse extends GenerateContentResponse +``` +Extends: [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () => [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)\[\] \| undefined | Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. | +| [text](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | + +## EnhancedGenerateContentResponse.functionCalls + +Signature: + +```typescript +functionCalls: () => FunctionCall[] | undefined; +``` + +## EnhancedGenerateContentResponse.inlineDataParts + +Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. + +Signature: + +```typescript +inlineDataParts: () => InlineDataPart[] | undefined; +``` + +## EnhancedGenerateContentResponse.text + +Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. + +Signature: + +```typescript +text: () => string; +``` diff --git a/docs-devsite/vertexai.errordetails.md b/docs-devsite/ai.errordetails.md similarity index 70% rename from docs-devsite/vertexai.errordetails.md rename to docs-devsite/ai.errordetails.md index 68959343439..efa49c23021 100644 --- a/docs-devsite/vertexai.errordetails.md +++ b/docs-devsite/ai.errordetails.md @@ -22,10 +22,10 @@ export interface ErrorDetails | Property | Type | Description | | --- | --- | --- | -| ["@type"](./vertexai.errordetails.md#errordetails"@type") | string | | -| [domain](./vertexai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | -| [metadata](./vertexai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | -| [reason](./vertexai.errordetails.md#errordetailsreason) | string | The reason for the error. | +| ["@type"](./ai.errordetails.md#errordetails"@type") | string | | +| [domain](./ai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | +| [metadata](./ai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | +| [reason](./ai.errordetails.md#errordetailsreason) | string | The reason for the error. | ## ErrorDetails."@type" diff --git a/docs-devsite/vertexai.filedata.md b/docs-devsite/ai.filedata.md similarity index 83% rename from docs-devsite/vertexai.filedata.md rename to docs-devsite/ai.filedata.md index 7e000174692..c88ca71a8bb 100644 --- a/docs-devsite/vertexai.filedata.md +++ b/docs-devsite/ai.filedata.md @@ -22,8 +22,8 @@ export interface FileData | Property | Type | Description | | --- | --- | --- | -| [fileUri](./vertexai.filedata.md#filedatafileuri) | string | | -| [mimeType](./vertexai.filedata.md#filedatamimetype) | string | | +| [fileUri](./ai.filedata.md#filedatafileuri) | string | | +| [mimeType](./ai.filedata.md#filedatamimetype) | string | | ## FileData.fileUri diff --git a/docs-devsite/vertexai.filedatapart.md b/docs-devsite/ai.filedatapart.md similarity index 62% rename from docs-devsite/vertexai.filedatapart.md rename to docs-devsite/ai.filedatapart.md index 76162227526..65cb9dc00ef 100644 --- a/docs-devsite/vertexai.filedatapart.md +++ b/docs-devsite/ai.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./ai.filedata.md#filedata_interface) Signature: @@ -22,11 +22,11 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | -| [fileData](./vertexai.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai.filedata.md#filedata_interface) | | -| [functionCall](./vertexai.filedatapart.md#filedatapartfunctioncall) | never | | -| [functionResponse](./vertexai.filedatapart.md#filedatapartfunctionresponse) | never | | -| [inlineData](./vertexai.filedatapart.md#filedatapartinlinedata) | never | | -| [text](./vertexai.filedatapart.md#filedataparttext) | never | | +| [fileData](./ai.filedatapart.md#filedatapartfiledata) | [FileData](./ai.filedata.md#filedata_interface) | | +| [functionCall](./ai.filedatapart.md#filedatapartfunctioncall) | never | | +| [functionResponse](./ai.filedatapart.md#filedatapartfunctionresponse) | never | | +| [inlineData](./ai.filedatapart.md#filedatapartinlinedata) | never | | +| [text](./ai.filedatapart.md#filedataparttext) | never | | ## FileDataPart.fileData diff --git a/docs-devsite/vertexai.functioncall.md b/docs-devsite/ai.functioncall.md similarity index 59% rename from docs-devsite/vertexai.functioncall.md rename to docs-devsite/ai.functioncall.md index 299fb7130f4..1c789784fe1 100644 --- a/docs-devsite/vertexai.functioncall.md +++ b/docs-devsite/ai.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./ai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: @@ -22,8 +22,8 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | -| [args](./vertexai.functioncall.md#functioncallargs) | object | | -| [name](./vertexai.functioncall.md#functioncallname) | string | | +| [args](./ai.functioncall.md#functioncallargs) | object | | +| [name](./ai.functioncall.md#functioncallname) | string | | ## FunctionCall.args diff --git a/docs-devsite/vertexai.functioncallingconfig.md b/docs-devsite/ai.functioncallingconfig.md similarity index 73% rename from docs-devsite/vertexai.functioncallingconfig.md rename to docs-devsite/ai.functioncallingconfig.md index 3724fec5bf7..99531b4cb1f 100644 --- a/docs-devsite/vertexai.functioncallingconfig.md +++ b/docs-devsite/ai.functioncallingconfig.md @@ -21,8 +21,8 @@ export interface FunctionCallingConfig | Property | Type | Description | | --- | --- | --- | -| [allowedFunctionNames](./vertexai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | -| [mode](./vertexai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | +| [allowedFunctionNames](./ai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | +| [mode](./ai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./ai.md#functioncallingmode) | | ## FunctionCallingConfig.allowedFunctionNames diff --git a/docs-devsite/vertexai.functioncallpart.md b/docs-devsite/ai.functioncallpart.md similarity index 66% rename from docs-devsite/vertexai.functioncallpart.md rename to docs-devsite/ai.functioncallpart.md index 58fe0f5fa97..b16e58f80a6 100644 --- a/docs-devsite/vertexai.functioncallpart.md +++ b/docs-devsite/ai.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./ai.functioncall.md#functioncall_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | | -| [functionResponse](./vertexai.functioncallpart.md#functioncallpartfunctionresponse) | never | | -| [inlineData](./vertexai.functioncallpart.md#functioncallpartinlinedata) | never | | -| [text](./vertexai.functioncallpart.md#functioncallparttext) | never | | +| [functionCall](./ai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./ai.functioncall.md#functioncall_interface) | | +| [functionResponse](./ai.functioncallpart.md#functioncallpartfunctionresponse) | never | | +| [inlineData](./ai.functioncallpart.md#functioncallpartinlinedata) | never | | +| [text](./ai.functioncallpart.md#functioncallparttext) | never | | ## FunctionCallPart.functionCall diff --git a/docs-devsite/vertexai.functiondeclaration.md b/docs-devsite/ai.functiondeclaration.md similarity index 65% rename from docs-devsite/vertexai.functiondeclaration.md rename to docs-devsite/ai.functiondeclaration.md index 211c1dd868d..2a87d67ed47 100644 --- a/docs-devsite/vertexai.functiondeclaration.md +++ b/docs-devsite/ai.functiondeclaration.md @@ -22,9 +22,9 @@ export declare interface FunctionDeclaration | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | -| [name](./vertexai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./vertexai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [description](./ai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | +| [name](./ai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | +| [parameters](./ai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description diff --git a/docs-devsite/ai.functiondeclarationstool.md b/docs-devsite/ai.functiondeclarationstool.md new file mode 100644 index 00000000000..bde785d730b --- /dev/null +++ b/docs-devsite/ai.functiondeclarationstool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationsTool interface +A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + +Signature: + +```typescript +export declare interface FunctionDeclarationsTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionDeclarations](./ai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./ai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./ai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | + +## FunctionDeclarationsTool.functionDeclarations + +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./ai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. + +Signature: + +```typescript +functionDeclarations?: FunctionDeclaration[]; +``` diff --git a/docs-devsite/vertexai.functionresponse.md b/docs-devsite/ai.functionresponse.md similarity index 51% rename from docs-devsite/vertexai.functionresponse.md rename to docs-devsite/ai.functionresponse.md index 072a08b3486..e0838cf515a 100644 --- a/docs-devsite/vertexai.functionresponse.md +++ b/docs-devsite/ai.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./ai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./ai.functioncall.md#functioncall_interface) made based on model prediction. Signature: @@ -22,8 +22,8 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | -| [name](./vertexai.functionresponse.md#functionresponsename) | string | | -| [response](./vertexai.functionresponse.md#functionresponseresponse) | object | | +| [name](./ai.functionresponse.md#functionresponsename) | string | | +| [response](./ai.functionresponse.md#functionresponseresponse) | object | | ## FunctionResponse.name diff --git a/docs-devsite/vertexai.functionresponsepart.md b/docs-devsite/ai.functionresponsepart.md similarity index 64% rename from docs-devsite/vertexai.functionresponsepart.md rename to docs-devsite/ai.functionresponsepart.md index ffbf2ad0517..9c80258f43f 100644 --- a/docs-devsite/vertexai.functionresponsepart.md +++ b/docs-devsite/ai.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./ai.functionresponse.md#functionresponse_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | -| [functionResponse](./vertexai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | | -| [inlineData](./vertexai.functionresponsepart.md#functionresponsepartinlinedata) | never | | -| [text](./vertexai.functionresponsepart.md#functionresponseparttext) | never | | +| [functionCall](./ai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | +| [functionResponse](./ai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) | | +| [inlineData](./ai.functionresponsepart.md#functionresponsepartinlinedata) | never | | +| [text](./ai.functionresponsepart.md#functionresponseparttext) | never | | ## FunctionResponsePart.functionCall diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/ai.generatecontentcandidate.md similarity index 51% rename from docs-devsite/vertexai.generatecontentcandidate.md rename to docs-devsite/ai.generatecontentcandidate.md index e5fd9eacbbe..ca0383549a7 100644 --- a/docs-devsite/vertexai.generatecontentcandidate.md +++ b/docs-devsite/ai.generatecontentcandidate.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +A candidate returned as part of a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,13 +22,13 @@ export interface GenerateContentCandidate | Property | Type | Description | | --- | --- | --- | -| [citationMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | | -| [content](./vertexai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai.content.md#content_interface) | | -| [finishMessage](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | -| [finishReason](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai.md#finishreason) | | -| [groundingMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | | -| [index](./vertexai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | -| [safetyRatings](./vertexai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | +| [citationMetadata](./ai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | | +| [content](./ai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./ai.content.md#content_interface) | | +| [finishMessage](./ai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | +| [finishReason](./ai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./ai.md#finishreason) | | +| [groundingMetadata](./ai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | | +| [index](./ai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | +| [safetyRatings](./ai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./ai.safetyrating.md#safetyrating_interface)\[\] | | ## GenerateContentCandidate.citationMetadata diff --git a/docs-devsite/vertexai.generatecontentrequest.md b/docs-devsite/ai.generatecontentrequest.md similarity index 53% rename from docs-devsite/vertexai.generatecontentrequest.md rename to docs-devsite/ai.generatecontentrequest.md index 31f1103a2e2..257a2d308fa 100644 --- a/docs-devsite/vertexai.generatecontentrequest.md +++ b/docs-devsite/ai.generatecontentrequest.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentRequest interface -Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) +Request sent through [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) Signature: ```typescript export interface GenerateContentRequest extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./ai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai.md#tool)\[\] | | +| [contents](./ai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./ai.content.md#content_interface)\[\] | | +| [systemInstruction](./ai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./ai.md#part) \| [Content](./ai.content.md#content_interface) | | +| [toolConfig](./ai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | | +| [tools](./ai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./ai.md#tool)\[\] | | ## GenerateContentRequest.contents diff --git a/docs-devsite/ai.generatecontentresponse.md b/docs-devsite/ai.generatecontentresponse.md new file mode 100644 index 00000000000..7c2dc1dc86a --- /dev/null +++ b/docs-devsite/ai.generatecontentresponse.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerateContentResponse interface +Individual response from [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. + +Signature: + +```typescript +export interface GenerateContentResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidates](./ai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | +| [promptFeedback](./ai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | | +| [usageMetadata](./ai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | | + +## GenerateContentResponse.candidates + +Signature: + +```typescript +candidates?: GenerateContentCandidate[]; +``` + +## GenerateContentResponse.promptFeedback + +Signature: + +```typescript +promptFeedback?: PromptFeedback; +``` + +## GenerateContentResponse.usageMetadata + +Signature: + +```typescript +usageMetadata?: UsageMetadata; +``` diff --git a/docs-devsite/vertexai.generatecontentresult.md b/docs-devsite/ai.generatecontentresult.md similarity index 71% rename from docs-devsite/vertexai.generatecontentresult.md rename to docs-devsite/ai.generatecontentresult.md index 3e162f9ebb2..a59e75f8672 100644 --- a/docs-devsite/vertexai.generatecontentresult.md +++ b/docs-devsite/ai.generatecontentresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResult interface -Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. +Result object returned from [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) call. Signature: @@ -22,7 +22,7 @@ export interface GenerateContentResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | +| [response](./ai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | ## GenerateContentResult.response diff --git a/docs-devsite/vertexai.generatecontentstreamresult.md b/docs-devsite/ai.generatecontentstreamresult.md similarity index 54% rename from docs-devsite/vertexai.generatecontentstreamresult.md rename to docs-devsite/ai.generatecontentstreamresult.md index 340abb1d0bd..fd3a06e933e 100644 --- a/docs-devsite/vertexai.generatecontentstreamresult.md +++ b/docs-devsite/ai.generatecontentstreamresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentStreamResult interface -Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. +Result object returned from [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. Signature: @@ -22,8 +22,8 @@ export interface GenerateContentStreamResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | -| [stream](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [response](./ai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [stream](./ai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | ## GenerateContentStreamResult.response diff --git a/docs-devsite/ai.generationconfig.md b/docs-devsite/ai.generationconfig.md new file mode 100644 index 00000000000..f9697a07454 --- /dev/null +++ b/docs-devsite/ai.generationconfig.md @@ -0,0 +1,134 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerationConfig interface +Config options for content-related requests + +Signature: + +```typescript +export interface GenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidateCount](./ai.generationconfig.md#generationconfigcandidatecount) | number | | +| [frequencyPenalty](./ai.generationconfig.md#generationconfigfrequencypenalty) | number | | +| [maxOutputTokens](./ai.generationconfig.md#generationconfigmaxoutputtokens) | number | | +| [presencePenalty](./ai.generationconfig.md#generationconfigpresencepenalty) | number | | +| [responseMimeType](./ai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | +| [responseModalities](./ai.generationconfig.md#generationconfigresponsemodalities) | [ResponseModality](./ai.md#responsemodality)\[\] | (Public Preview) Generation modalities to be returned in generation responses. | +| [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [stopSequences](./ai.generationconfig.md#generationconfigstopsequences) | string\[\] | | +| [temperature](./ai.generationconfig.md#generationconfigtemperature) | number | | +| [topK](./ai.generationconfig.md#generationconfigtopk) | number | | +| [topP](./ai.generationconfig.md#generationconfigtopp) | number | | + +## GenerationConfig.candidateCount + +Signature: + +```typescript +candidateCount?: number; +``` + +## GenerationConfig.frequencyPenalty + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## GenerationConfig.maxOutputTokens + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## GenerationConfig.presencePenalty + +Signature: + +```typescript +presencePenalty?: number; +``` + +## GenerationConfig.responseMimeType + +Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. + +Signature: + +```typescript +responseMimeType?: string; +``` + +## GenerationConfig.responseModalities + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +- Multimodal response generation is only supported by some Gemini models and versions; see [model versions](https://firebase.google.com/docs/vertex-ai/models). - Only image generation (`ResponseModality.IMAGE`) is supported. + +Signature: + +```typescript +responseModalities?: ResponseModality[]; +``` + +## GenerationConfig.responseSchema + +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. + +Signature: + +```typescript +responseSchema?: TypedSchema | SchemaRequest; +``` + +## GenerationConfig.stopSequences + +Signature: + +```typescript +stopSequences?: string[]; +``` + +## GenerationConfig.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## GenerationConfig.topK + +Signature: + +```typescript +topK?: number; +``` + +## GenerationConfig.topP + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/vertexai.generativecontentblob.md b/docs-devsite/ai.generativecontentblob.md similarity index 78% rename from docs-devsite/vertexai.generativecontentblob.md rename to docs-devsite/ai.generativecontentblob.md index dfcd098291f..74a582aae6d 100644 --- a/docs-devsite/vertexai.generativecontentblob.md +++ b/docs-devsite/ai.generativecontentblob.md @@ -22,8 +22,8 @@ export interface GenerativeContentBlob | Property | Type | Description | | --- | --- | --- | -| [data](./vertexai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | -| [mimeType](./vertexai.generativecontentblob.md#generativecontentblobmimetype) | string | | +| [data](./ai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | +| [mimeType](./ai.generativecontentblob.md#generativecontentblobmimetype) | string | | ## GenerativeContentBlob.data diff --git a/docs-devsite/ai.generativemodel.md b/docs-devsite/ai.generativemodel.md new file mode 100644 index 00000000000..d91cf80e881 --- /dev/null +++ b/docs-devsite/ai.generativemodel.md @@ -0,0 +1,193 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerativeModel class +Class for generative model APIs. + +Signature: + +```typescript +export declare class GenerativeModel extends AIModel +``` +Extends: [AIModel](./ai.aimodel.md#aimodel_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(ai, modelParams, requestOptions)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./ai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | | +| [requestOptions](./ai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | | +| [safetySettings](./ai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./ai.safetysetting.md#safetysetting_interface)\[\] | | +| [systemInstruction](./ai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./ai.content.md#content_interface) | | +| [toolConfig](./ai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | | +| [tools](./ai.generativemodel.md#generativemodeltools) | | [Tool](./ai.md#tool)\[\] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [countTokens(request)](./ai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | +| [generateContent(request)](./ai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContentStream(request)](./ai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | +| [startChat(startChatParams)](./ai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./ai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | + +## GenerativeModel.(constructor) + +Constructs a new instance of the `GenerativeModel` class + +Signature: + +```typescript +constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| ai | [AI](./ai.ai.md#ai_interface) | | +| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | | + +## GenerativeModel.generationConfig + +Signature: + +```typescript +generationConfig: GenerationConfig; +``` + +## GenerativeModel.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions; +``` + +## GenerativeModel.safetySettings + +Signature: + +```typescript +safetySettings: SafetySetting[]; +``` + +## GenerativeModel.systemInstruction + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## GenerativeModel.toolConfig + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## GenerativeModel.tools + +Signature: + +```typescript +tools?: Tool[]; +``` + +## GenerativeModel.countTokens() + +Counts the tokens in the provided request. + +Signature: + +```typescript +countTokens(request: CountTokensRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./ai.md#part)> | | + +Returns: + +Promise<[CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface)> + +## GenerativeModel.generateContent() + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +generateContent(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./ai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface)> + +## GenerativeModel.generateContentStream() + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./ai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + +## GenerativeModel.startChat() + +Gets a new [ChatSession](./ai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. + +Signature: + +```typescript +startChat(startChatParams?: StartChatParams): ChatSession; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| startChatParams | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | | + +Returns: + +[ChatSession](./ai.chatsession.md#chatsession_class) + diff --git a/docs-devsite/vertexai.googleaibackend.md b/docs-devsite/ai.googleaibackend.md similarity index 63% rename from docs-devsite/vertexai.googleaibackend.md rename to docs-devsite/ai.googleaibackend.md index e302a0eba91..7ccf8834a0a 100644 --- a/docs-devsite/vertexai.googleaibackend.md +++ b/docs-devsite/ai.googleaibackend.md @@ -12,20 +12,20 @@ https://github.com/firebase/firebase-js-sdk # GoogleAIBackend class Configuration class for the Gemini Developer API. -Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Gemini Developer API as the backend. +Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Gemini Developer API as the backend. Signature: ```typescript export declare class GoogleAIBackend extends Backend ``` -Extends: [Backend](./vertexai.backend.md#backend_class) +Extends: [Backend](./ai.backend.md#backend_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)()](./vertexai.googleaibackend.md#googleaibackendconstructor) | | Creates a configuration object for the Gemini Developer API backend. | +| [(constructor)()](./ai.googleaibackend.md#googleaibackendconstructor) | | Creates a configuration object for the Gemini Developer API backend. | ## GoogleAIBackend.(constructor) diff --git a/docs-devsite/vertexai.groundingattribution.md b/docs-devsite/ai.groundingattribution.md similarity index 61% rename from docs-devsite/vertexai.groundingattribution.md rename to docs-devsite/ai.groundingattribution.md index b3a3b6257c3..a0895550bf1 100644 --- a/docs-devsite/vertexai.groundingattribution.md +++ b/docs-devsite/ai.groundingattribution.md @@ -24,10 +24,10 @@ export interface GroundingAttribution | Property | Type | Description | | --- | --- | --- | -| [confidenceScore](./vertexai.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./vertexai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./vertexai.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai.segment.md#segment_interface) | | -| [web](./vertexai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | +| [confidenceScore](./ai.groundingattribution.md#groundingattributionconfidencescore) | number | | +| [retrievedContext](./ai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [segment](./ai.groundingattribution.md#groundingattributionsegment) | [Segment](./ai.segment.md#segment_interface) | | +| [web](./ai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./ai.webattribution.md#webattribution_interface) | | ## GroundingAttribution.confidenceScore diff --git a/docs-devsite/vertexai.groundingmetadata.md b/docs-devsite/ai.groundingmetadata.md similarity index 68% rename from docs-devsite/vertexai.groundingmetadata.md rename to docs-devsite/ai.groundingmetadata.md index 24686da39ba..90994d9c01c 100644 --- a/docs-devsite/vertexai.groundingmetadata.md +++ b/docs-devsite/ai.groundingmetadata.md @@ -22,9 +22,9 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./vertexai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface)\[\] | | -| [retrievalQueries](./vertexai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./vertexai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [groundingAttributions](./ai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface)\[\] | | +| [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | +| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | ## GroundingMetadata.groundingAttributions diff --git a/docs-devsite/vertexai.imagengcsimage.md b/docs-devsite/ai.imagengcsimage.md similarity index 62% rename from docs-devsite/vertexai.imagengcsimage.md rename to docs-devsite/ai.imagengcsimage.md index 23770192b3b..cd11d8ee354 100644 --- a/docs-devsite/vertexai.imagengcsimage.md +++ b/docs-devsite/ai.imagengcsimage.md @@ -24,8 +24,8 @@ export interface ImagenGCSImage | Property | Type | Description | | --- | --- | --- | -| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | -| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | +| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenGCSImage.gcsURI @@ -45,7 +45,7 @@ gcsURI: string; The MIME type of the image; either `"image/png"` or `"image/jpeg"`. -To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). Signature: diff --git a/docs-devsite/vertexai.imagengenerationconfig.md b/docs-devsite/ai.imagengenerationconfig.md similarity index 52% rename from docs-devsite/vertexai.imagengenerationconfig.md rename to docs-devsite/ai.imagengenerationconfig.md index 51a66b147dc..d4f32a7e5a3 100644 --- a/docs-devsite/vertexai.imagengenerationconfig.md +++ b/docs-devsite/ai.imagengenerationconfig.md @@ -27,11 +27,11 @@ export interface ImagenGenerationConfig | Property | Type | Description | | --- | --- | --- | -| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | -| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. | -| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. | -| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | -| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | +| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | +| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. | +| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. | +| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | +| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | ## ImagenGenerationConfig.addWatermark @@ -44,7 +44,7 @@ If set to `true`, an invisible SynthID watermark is embedded in generate For Imagen 3 models, the default value is `true`; see the addWatermark documentation for more details. -When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. +When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. Signature: @@ -57,7 +57,7 @@ addWatermark?: boolean; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./vertexai.md#imagenaspectratio) for more details. +The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. Signature: @@ -72,7 +72,7 @@ aspectRatio?: ImagenAspectRatio; The image format of the generated images. The default is PNG. -See [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for more details. +See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. Signature: @@ -91,7 +91,7 @@ Support for negative prompts depends on the Imagen model. See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details. -This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) in versions greater than `imagen-3.0-generate-002`. +This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than `imagen-3.0-generate-002`. Signature: diff --git a/docs-devsite/vertexai.imagengenerationresponse.md b/docs-devsite/ai.imagengenerationresponse.md similarity index 56% rename from docs-devsite/vertexai.imagengenerationresponse.md rename to docs-devsite/ai.imagengenerationresponse.md index d8de93df3ec..54b0ac9b1a9 100644 --- a/docs-devsite/vertexai.imagengenerationresponse.md +++ b/docs-devsite/ai.imagengenerationresponse.md @@ -25,8 +25,8 @@ export interface ImagenGenerationResponse(Public Preview)
The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | -| [images](./vertexai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | +| [filteredReason](./ai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | (Public Preview) The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | +| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | ## ImagenGenerationResponse.filteredReason @@ -35,7 +35,7 @@ export interface ImagenGenerationResponse, [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface). +Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface). See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. diff --git a/docs-devsite/vertexai.imagenimageformat.md b/docs-devsite/ai.imagenimageformat.md similarity index 61% rename from docs-devsite/vertexai.imagenimageformat.md rename to docs-devsite/ai.imagenimageformat.md index 68db8bbdae0..bd0bdf1baa7 100644 --- a/docs-devsite/vertexai.imagenimageformat.md +++ b/docs-devsite/ai.imagenimageformat.md @@ -15,7 +15,7 @@ https://github.com/firebase/firebase-js-sdk Defines the image format for images generated by Imagen. -Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). +Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). Signature: @@ -27,15 +27,15 @@ export declare class ImagenImageFormat | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [compressionQuality](./vertexai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). | -| [mimeType](./vertexai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. | +| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). | +| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | -| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | +| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | +| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | ## ImagenImageFormat.compressionQuality @@ -68,7 +68,7 @@ mimeType: string; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. +Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. Signature: @@ -84,16 +84,16 @@ static jpeg(compressionQuality?: number): ImagenImageFormat; Returns: -[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) +[ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) -An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a JPEG image. +An [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) object for a JPEG image. ## ImagenImageFormat.png() > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Creates an [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) for a PNG image. +Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. Signature: @@ -102,9 +102,9 @@ static png(): ImagenImageFormat; ``` Returns: -[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) +[ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) -An [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) object for a PNG image. +An [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) object for a PNG image. ### Example diff --git a/docs-devsite/vertexai.imageninlineimage.md b/docs-devsite/ai.imageninlineimage.md similarity index 66% rename from docs-devsite/vertexai.imageninlineimage.md rename to docs-devsite/ai.imageninlineimage.md index a72937b5e5d..4bb81cac55d 100644 --- a/docs-devsite/vertexai.imageninlineimage.md +++ b/docs-devsite/ai.imageninlineimage.md @@ -25,8 +25,8 @@ export interface ImagenInlineImage | Property | Type | Description | | --- | --- | --- | -| [bytesBase64Encoded](./vertexai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | -| [mimeType](./vertexai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | +| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenInlineImage.bytesBase64Encoded @@ -48,7 +48,7 @@ bytesBase64Encoded: string; The MIME type of the image; either `"image/png"` or `"image/jpeg"`. -To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). +To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). Signature: diff --git a/docs-devsite/vertexai.imagenmodel.md b/docs-devsite/ai.imagenmodel.md similarity index 62% rename from docs-devsite/vertexai.imagenmodel.md rename to docs-devsite/ai.imagenmodel.md index e69c49b8572..911971e0988 100644 --- a/docs-devsite/vertexai.imagenmodel.md +++ b/docs-devsite/ai.imagenmodel.md @@ -22,34 +22,34 @@ This class provides methods for generating images using the Imagen model. ```typescript export declare class ImagenModel extends AIModel ``` -Extends: [AIModel](./vertexai.aimodel.md#aimodel_class) +Extends: [AIModel](./ai.aimodel.md#aimodel_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(ai, modelParams, requestOptions)](./vertexai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. | +| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [generationConfig](./vertexai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. | -| [requestOptions](./vertexai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) | -| [safetySettings](./vertexai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. | +| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. | +| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) | +| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [generateImages(prompt)](./vertexai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. | +| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. | ## ImagenModel.(constructor) > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Constructs a new instance of the [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class. +Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. Signature: @@ -61,9 +61,9 @@ constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOpti | Parameter | Type | Description | | --- | --- | --- | -| ai | [AI](./vertexai.ai.md#ai_interface) | an [AI](./vertexai.ai.md#ai_interface) instance. | -| modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making requests to Imagen. | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | Additional options to use when making requests. | +| ai | [AI](./ai.ai.md#ai_interface) | an [AI](./ai.ai.md#ai_interface) instance. | +| modelParams | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making requests to Imagen. | +| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | Additional options to use when making requests. | #### Exceptions @@ -129,9 +129,9 @@ generateImages(prompt: string): PromiseReturns:
-Promise<[ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface)<[ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface)>> +Promise<[ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface)<[ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface)>> -A promise that resolves to an [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) object containing the generated images. +A promise that resolves to an [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) object containing the generated images. #### Exceptions diff --git a/docs-devsite/vertexai.imagenmodelparams.md b/docs-devsite/ai.imagenmodelparams.md similarity index 63% rename from docs-devsite/vertexai.imagenmodelparams.md rename to docs-devsite/ai.imagenmodelparams.md index 5396a36e4d1..a63345b64e6 100644 --- a/docs-devsite/vertexai.imagenmodelparams.md +++ b/docs-devsite/ai.imagenmodelparams.md @@ -13,7 +13,7 @@ https://github.com/firebase/firebase-js-sdk > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). +Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). Signature: @@ -25,9 +25,9 @@ export interface ImagenModelParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. | -| [model](./vertexai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | -| [safetySettings](./vertexai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. | +| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. | +| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | +| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. | ## ImagenModelParams.generationConfig diff --git a/docs-devsite/vertexai.imagensafetysettings.md b/docs-devsite/ai.imagensafetysettings.md similarity index 72% rename from docs-devsite/vertexai.imagensafetysettings.md rename to docs-devsite/ai.imagensafetysettings.md index 3cf7931a959..366e615d243 100644 --- a/docs-devsite/vertexai.imagensafetysettings.md +++ b/docs-devsite/ai.imagensafetysettings.md @@ -27,8 +27,8 @@ export interface ImagenSafetySettings | Property | Type | Description | | --- | --- | --- | -| [personFilterLevel](./vertexai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. | -| [safetyFilterLevel](./vertexai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. | +| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. | +| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. | ## ImagenSafetySettings.personFilterLevel diff --git a/docs-devsite/vertexai.inlinedatapart.md b/docs-devsite/ai.inlinedatapart.md similarity index 62% rename from docs-devsite/vertexai.inlinedatapart.md rename to docs-devsite/ai.inlinedatapart.md index 0cb064fc357..0dd68edda68 100644 --- a/docs-devsite/vertexai.inlinedatapart.md +++ b/docs-devsite/ai.inlinedatapart.md @@ -22,11 +22,11 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | -| [functionResponse](./vertexai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | -| [inlineData](./vertexai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | | -| [text](./vertexai.inlinedatapart.md#inlinedataparttext) | never | | -| [videoMetadata](./vertexai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +| [functionCall](./ai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | +| [functionResponse](./ai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | +| [inlineData](./ai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | | +| [text](./ai.inlinedatapart.md#inlinedataparttext) | never | | +| [videoMetadata](./ai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall diff --git a/docs-devsite/vertexai.integerschema.md b/docs-devsite/ai.integerschema.md similarity index 71% rename from docs-devsite/vertexai.integerschema.md rename to docs-devsite/ai.integerschema.md index 4822bdd618b..4ba96e49ca5 100644 --- a/docs-devsite/vertexai.integerschema.md +++ b/docs-devsite/ai.integerschema.md @@ -17,13 +17,13 @@ Schema class for "integer" types. ```typescript export declare class IntegerSchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | +| [(constructor)(schemaParams)](./ai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | ## IntegerSchema.(constructor) @@ -39,5 +39,5 @@ constructor(schemaParams?: SchemaParams); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md new file mode 100644 index 00000000000..c43c0391ba4 --- /dev/null +++ b/docs-devsite/ai.md @@ -0,0 +1,728 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ai package +The Firebase AI Web SDK. + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getAI(app, options)](./ai.md#getai_a94a413) | Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | +| [getVertexAI(app, options)](./ai.md#getvertexai_04094cf) | | +| function(ai, ...) | +| [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | +| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | + +## Classes + +| Class | Description | +| --- | --- | +| [AIError](./ai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. | +| [AIModel](./ai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.Instances of this class are associated with a specific Firebase AI [Backend](./ai.backend.md#backend_class) and provide methods for interacting with the configured generative model. | +| [ArraySchema](./ai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | +| [Backend](./ai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. | +| [BooleanSchema](./ai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | +| [ChatSession](./ai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | +| [GenerativeModel](./ai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Gemini Developer API as the backend. | +| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | +| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | +| [IntegerSchema](./ai.integerschema.md#integerschema_class) | Schema class for "integer" types. | +| [NumberSchema](./ai.numberschema.md#numberschema_class) | Schema class for "number" types. | +| [ObjectSchema](./ai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | +| [Schema](./ai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | +| [StringSchema](./ai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | +| [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. | +| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./ai.md#functioncallingmode) | | +| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). | +| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [Modality](./ai.md#modality) | Content part modality. | +| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [AI](./ai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./ai.md#getai_a94a413). | +| [AIOptions](./ai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | +| [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [Citation](./ai.citation.md#citation_interface) | A single citation. | +| [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. | +| [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) | +| [CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens). | +| [CustomErrorData](./ai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | +| [Date\_2](./ai.date_2.md#date_2_interface) | Protobuf google.type.Date | +| [EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | +| [ErrorDetails](./ai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [FileData](./ai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | +| [FileDataPart](./ai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./ai.filedata.md#filedata_interface) | +| [FunctionCall](./ai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./ai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FunctionCallingConfig](./ai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [FunctionCallPart](./ai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./ai.functioncall.md#functioncall_interface). | +| [FunctionDeclaration](./ai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | +| [FunctionDeclarationsTool](./ai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | +| [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./ai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./ai.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./ai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./ai.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | +| [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) | +| [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | +| [GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) call. | +| [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | +| [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | +| [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface) | | +| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | +| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | +| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | +| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | +| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | +| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | +| [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | +| [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | +| [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class. | +| [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | +| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | +| [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [SafetyRating](./ai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetySetting](./ai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | +| [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./ai.schema.md#schema_class) class. | +| [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./ai.schema.md#schema_class) static methods to create specific [Schema](./ai.schema.md#schema_class) classes. | +| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./ai.schema.md#schema_class) params passed to backend requests. | +| [SchemaShared](./ai.schemashared.md#schemashared_interface) | Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. | +| [Segment](./ai.segment.md#segment_interface) | | +| [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). | +| [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | +| [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | +| [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. | +| [WebAttribution](./ai.webattribution.md#webattribution_interface) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [BackendType](./ai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.These values are assigned to the backendType property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. | +| [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | +| [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | +| [VertexAIError](./ai.md#vertexaierror) | | +| [VertexAIModel](./ai.md#vertexaimodel) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [BackendType](./ai.md#backendtype) | Type alias representing valid backend types. It can be either 'VERTEX_AI' or 'GOOGLE_AI'. | +| [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | +| [Role](./ai.md#role) | Role is the producer of the content. | +| [Tool](./ai.md#tool) | Defines a tool that model can call to access external knowledge. | +| [TypedSchema](./ai.md#typedschema) | A type that includes all specific Schema types. | +| [VertexAI](./ai.md#vertexai) | | + +## function(app, ...) + +### getAI(app, options) {:#getai_a94a413} + +Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. + +Signature: + +```typescript +export declare function getAI(app?: FirebaseApp, options?: AIOptions): AI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [AIOptions](./ai.aioptions.md#aioptions_interface) | [AIOptions](./ai.aioptions.md#aioptions_interface) that configure the AI instance. | + +Returns: + +[AI](./ai.ai.md#ai_interface) + +The default [AI](./ai.ai.md#ai_interface) instance for the given [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). + +### Example 1 + + +```javascript +const ai = getAI(app); + +``` + +### Example 2 + + +```javascript +// Get an AI instance configured to use the Gemini Developer API (via Google AI). +const ai = getAI(app, { backend: new GoogleAIBackend() }); + +``` + +### Example 3 + + +```javascript +// Get an AI instance configured to use the Vertex AI Gemini API. +const ai = getAI(app, { backend: new VertexAIBackend() }); + +``` + +### getVertexAI(app, options) {:#getvertexai_04094cf} + +> Warning: This API is now obsolete. +> +> Use the new [getAI()](./ai.md#getai_a94a413) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). +> +> Returns a [VertexAI](./ai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. +> + +Signature: + +```typescript +export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options to configure the Vertex AI instance, including the location. | + +Returns: + +[VertexAI](./ai.md#vertexai) + +## function(ai, ...) + +### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839} + +Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. + +Signature: + +```typescript +export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| ai | [AI](./ai.ai.md#ai_interface) | | +| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | | + +Returns: + +[GenerativeModel](./ai.generativemodel.md#generativemodel_class) + +### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. + +Only Imagen 3 models (named `imagen-3.0-*`) are supported. + +Signature: + +```typescript +export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| ai | [AI](./ai.ai.md#ai_interface) | An [AI](./ai.ai.md#ai_interface) instance. | +| modelParams | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. | +| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. | + +Returns: + +[ImagenModel](./ai.imagenmodel.md#imagenmodel_class) + +#### Exceptions + +If the `apiKey` or `projectId` fields are missing in your Firebase config. + +## BackendType + +An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with. + +These values are assigned to the `backendType` property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. + +Signature: + +```typescript +BackendType: { + readonly VERTEX_AI: "VERTEX_AI"; + readonly GOOGLE_AI: "GOOGLE_AI"; +} +``` + +## POSSIBLE\_ROLES + +Possible roles. + +Signature: + +```typescript +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +``` + +## ResponseModality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +Signature: + +```typescript +ResponseModality: { + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; +} +``` + +## VertexAIError + +> Warning: This API is now obsolete. +> +> Use the new [AIError](./ai.aierror.md#aierror_class) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). +> +> Error class for the Firebase AI SDK. +> + +Signature: + +```typescript +VertexAIError: typeof AIError +``` + +## VertexAIModel + +> Warning: This API is now obsolete. +> +> Use the new [AIModel](./ai.aimodel.md#aimodel_class) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). +> +> Base class for Firebase AI model APIs. +> + +Signature: + +```typescript +VertexAIModel: typeof AIModel +``` + +## BackendType + +Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. + +Signature: + +```typescript +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; +``` + +## Part + +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## ResponseModality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +Signature: + +```typescript +export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export type Role = (typeof POSSIBLE_ROLES)[number]; +``` + +## Tool + +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export declare type Tool = FunctionDeclarationsTool; +``` + +## TypedSchema + +A type that includes all specific Schema types. + +Signature: + +```typescript +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +``` + +## VertexAI + +> Warning: This API is now obsolete. +> +> Use the new [AI](./ai.ai.md#ai_interface) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). +> +> An instance of the Firebase AI SDK. +> + +Signature: + +```typescript +export type VertexAI = AI; +``` + +## AIErrorCode + +Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. + +Signature: + +```typescript +export declare const enum AIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | +| UNSUPPORTED | "unsupported" | An error occured due an attempt to use an unsupported feature. | + +## BlockReason + +Reason that a prompt was blocked. + +Signature: + +```typescript +export declare enum BlockReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | +| OTHER | "OTHER" | Content was blocked, but the reason is uncategorized. | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | +| SAFETY | "SAFETY" | Content was blocked by safety settings. | + +## FinishReason + +Reason that a candidate finished. + +Signature: + +```typescript +export declare enum FinishReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | +| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | +| MAX\_TOKENS | "MAX_TOKENS" | The maximum number of tokens as specified in the request was reached. | +| OTHER | "OTHER" | Unknown reason. | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | +| RECITATION | "RECITATION" | The candidate content was flagged for recitation reasons. | +| SAFETY | "SAFETY" | The candidate content was flagged for safety reasons. | +| SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | +| STOP | "STOP" | Natural stop point of the model or provided stop sequence. | + +## FunctionCallingMode + + +Signature: + +```typescript +export declare enum FunctionCallingMode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ANY | "ANY" | Model is constrained to always predicting a function call only. If allowed_function_names is set, the predicted function call will be limited to any one of allowed_function_names, else the predicted function call will be any one of the provided function_declarations. | +| AUTO | "AUTO" | Default model behavior; model decides to predict either a function call or a natural language response. | +| NONE | "NONE" | Model will not predict any function call. Model behavior is same as when not passing any function declarations. | + +## HarmBlockMethod + +This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). + +Signature: + +```typescript +export declare enum HarmBlockMethod +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| PROBABILITY | "PROBABILITY" | The harm block method uses the probability score. | +| SEVERITY | "SEVERITY" | The harm block method uses both probability and severity scores. | + +## HarmBlockThreshold + +Threshold above which a prompt or candidate will be blocked. + +Signature: + +```typescript +export declare enum HarmBlockThreshold +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | Content with NEGLIGIBLE will be allowed. | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | +| BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | + +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +export declare enum HarmCategory +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | +| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | +| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | +| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +export declare enum HarmProbability +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HIGH | "HIGH" | Content has a high chance of being unsafe. | +| LOW | "LOW" | Content has a low chance of being unsafe. | +| MEDIUM | "MEDIUM" | Content has a medium chance of being unsafe. | +| NEGLIGIBLE | "NEGLIGIBLE" | Content has a negligible chance of being unsafe. | + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +export declare enum HarmSeverity +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | High level of harm severity. | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | Low level of harm severity. | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | Medium level of harm severity. | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | Negligible level of harm severity. | +| HARM\_SEVERITY\_UNSUPPORTED | "HARM_SEVERITY_UNSUPPORTED" | Harm severity is not supported. | + +## ImagenAspectRatio + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Aspect ratios for Imagen images. + +To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). + +See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. + +Signature: + +```typescript +export declare enum ImagenAspectRatio +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| LANDSCAPE\_16x9 | "16:9" | (Public Preview) Landscape (16:9) aspect ratio. | +| LANDSCAPE\_3x4 | "3:4" | (Public Preview) Landscape (3:4) aspect ratio. | +| PORTRAIT\_4x3 | "4:3" | (Public Preview) Portrait (4:3) aspect ratio. | +| PORTRAIT\_9x16 | "9:16" | (Public Preview) Portrait (9:16) aspect ratio. | +| SQUARE | "1:1" | (Public Preview) Square (1:1) aspect ratio. | + +## ImagenPersonFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling whether generation of images containing people or faces is allowed. + +See the personGeneration documentation for more details. + +Signature: + +```typescript +export declare enum ImagenPersonFilterLevel +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ALLOW\_ADULT | "allow_adult" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | +| ALLOW\_ALL | "allow_all" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | +| BLOCK\_ALL | "dont_allow" | (Public Preview) Disallow generation of images containing people or faces; images of people are filtered out. | + +## ImagenSafetyFilterLevel + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling how aggressively to filter sensitive content. + +Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. + +Signature: + +```typescript +export declare enum ImagenSafetyFilterLevel +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "block_low_and_above" | (Public Preview) The most aggressive filtering level; most strict blocking. | +| BLOCK\_MEDIUM\_AND\_ABOVE | "block_medium_and_above" | (Public Preview) Blocks some sensitive prompts and responses. | +| BLOCK\_NONE | "block_none" | (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. | +| BLOCK\_ONLY\_HIGH | "block_only_high" | (Public Preview) Blocks few sensitive prompts and responses. | + +## Modality + +Content part modality. + +Signature: + +```typescript +export declare enum Modality +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| AUDIO | "AUDIO" | Audio. | +| DOCUMENT | "DOCUMENT" | Document (for example, PDF). | +| IMAGE | "IMAGE" | Image. | +| MODALITY\_UNSPECIFIED | "MODALITY_UNSPECIFIED" | Unspecified modality. | +| TEXT | "TEXT" | Plain text. | +| VIDEO | "VIDEO" | Video. | + +## SchemaType + +Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) + +Signature: + +```typescript +export declare enum SchemaType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ARRAY | "array" | Array type. | +| BOOLEAN | "boolean" | Boolean type. | +| INTEGER | "integer" | Integer type. | +| NUMBER | "number" | Number type. | +| OBJECT | "object" | Object type. | +| STRING | "string" | String type. | + diff --git a/docs-devsite/vertexai.modalitytokencount.md b/docs-devsite/ai.modalitytokencount.md similarity index 74% rename from docs-devsite/vertexai.modalitytokencount.md rename to docs-devsite/ai.modalitytokencount.md index d710b51fba6..b1a504dddbc 100644 --- a/docs-devsite/vertexai.modalitytokencount.md +++ b/docs-devsite/ai.modalitytokencount.md @@ -22,8 +22,8 @@ export interface ModalityTokenCount | Property | Type | Description | | --- | --- | --- | -| [modality](./vertexai.modalitytokencount.md#modalitytokencountmodality) | [Modality](./vertexai.md#modality) | The modality associated with this token count. | -| [tokenCount](./vertexai.modalitytokencount.md#modalitytokencounttokencount) | number | The number of tokens counted. | +| [modality](./ai.modalitytokencount.md#modalitytokencountmodality) | [Modality](./ai.md#modality) | The modality associated with this token count. | +| [tokenCount](./ai.modalitytokencount.md#modalitytokencounttokencount) | number | The number of tokens counted. | ## ModalityTokenCount.modality diff --git a/docs-devsite/vertexai.modelparams.md b/docs-devsite/ai.modelparams.md similarity index 57% rename from docs-devsite/vertexai.modelparams.md rename to docs-devsite/ai.modelparams.md index bb8a87d5fb2..a92b2e9035d 100644 --- a/docs-devsite/vertexai.modelparams.md +++ b/docs-devsite/ai.modelparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). +Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). Signature: ```typescript export interface ModelParams extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./ai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [model](./vertexai.modelparams.md#modelparamsmodel) | string | | -| [systemInstruction](./vertexai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.modelparams.md#modelparamstools) | [Tool](./vertexai.md#tool)\[\] | | +| [model](./ai.modelparams.md#modelparamsmodel) | string | | +| [systemInstruction](./ai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./ai.md#part) \| [Content](./ai.content.md#content_interface) | | +| [toolConfig](./ai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | | +| [tools](./ai.modelparams.md#modelparamstools) | [Tool](./ai.md#tool)\[\] | | ## ModelParams.model diff --git a/docs-devsite/vertexai.numberschema.md b/docs-devsite/ai.numberschema.md similarity index 72% rename from docs-devsite/vertexai.numberschema.md rename to docs-devsite/ai.numberschema.md index 8fdd9374652..4e7800cfb21 100644 --- a/docs-devsite/vertexai.numberschema.md +++ b/docs-devsite/ai.numberschema.md @@ -17,13 +17,13 @@ Schema class for "number" types. ```typescript export declare class NumberSchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | +| [(constructor)(schemaParams)](./ai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | ## NumberSchema.(constructor) @@ -39,5 +39,5 @@ constructor(schemaParams?: SchemaParams); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | diff --git a/docs-devsite/vertexai.objectschema.md b/docs-devsite/ai.objectschema.md similarity index 68% rename from docs-devsite/vertexai.objectschema.md rename to docs-devsite/ai.objectschema.md index 8731960b220..2ba358c6b07 100644 --- a/docs-devsite/vertexai.objectschema.md +++ b/docs-devsite/ai.objectschema.md @@ -17,20 +17,20 @@ Schema class for "object" types. The `properties` param must be a map of `Schema ```typescript export declare class ObjectSchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams, properties, optionalProperties)](./vertexai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | +| [(constructor)(schemaParams, properties, optionalProperties)](./ai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [optionalProperties](./vertexai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | -| [properties](./vertexai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | +| [optionalProperties](./ai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | +| [properties](./ai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./ai.md#typedschema); } | | ## ObjectSchema.(constructor) @@ -48,8 +48,8 @@ constructor(schemaParams: SchemaParams, properties: { | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | -| properties | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | +| properties | { \[k: string\]: [TypedSchema](./ai.md#typedschema); } | | | optionalProperties | string\[\] | | ## ObjectSchema.optionalProperties diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/ai.objectschemainterface.md similarity index 62% rename from docs-devsite/vertexai.objectschemainterface.md rename to docs-devsite/ai.objectschemainterface.md index 4eb7a5d80e7..15b1a97f40d 100644 --- a/docs-devsite/vertexai.objectschemainterface.md +++ b/docs-devsite/ai.objectschemainterface.md @@ -10,21 +10,21 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ObjectSchemaInterface interface -Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. +Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class. Signature: ```typescript export interface ObjectSchemaInterface extends SchemaInterface ``` -Extends: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) +Extends: [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [optionalProperties](./vertexai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | -| [type](./vertexai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./vertexai.md#schematypeobject_enummember) | | +| [optionalProperties](./ai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | +| [type](./ai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) | | ## ObjectSchemaInterface.optionalProperties diff --git a/docs-devsite/vertexai.promptfeedback.md b/docs-devsite/ai.promptfeedback.md similarity index 60% rename from docs-devsite/vertexai.promptfeedback.md rename to docs-devsite/ai.promptfeedback.md index 08ea4aaf4cf..b874c0e70b1 100644 --- a/docs-devsite/vertexai.promptfeedback.md +++ b/docs-devsite/ai.promptfeedback.md @@ -22,9 +22,9 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | -| [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | -| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | A human-readable description of the blockReason.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | -| [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | +| [blockReason](./ai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./ai.md#blockreason) | | +| [blockReasonMessage](./ai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | A human-readable description of the blockReason.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). | +| [safetyRatings](./ai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./ai.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason @@ -38,7 +38,7 @@ blockReason?: BlockReason; A human-readable description of the `blockReason`. -This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). Signature: diff --git a/docs-devsite/vertexai.requestoptions.md b/docs-devsite/ai.requestoptions.md similarity index 67% rename from docs-devsite/vertexai.requestoptions.md rename to docs-devsite/ai.requestoptions.md index 3c233d72b90..73aa03c1d25 100644 --- a/docs-devsite/vertexai.requestoptions.md +++ b/docs-devsite/ai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). +Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). Signature: @@ -22,8 +22,8 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | -| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | +| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | +| [timeout](./ai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | ## RequestOptions.baseUrl diff --git a/docs-devsite/vertexai.retrievedcontextattribution.md b/docs-devsite/ai.retrievedcontextattribution.md similarity index 77% rename from docs-devsite/vertexai.retrievedcontextattribution.md rename to docs-devsite/ai.retrievedcontextattribution.md index e36bfacb3ec..21b12b79c18 100644 --- a/docs-devsite/vertexai.retrievedcontextattribution.md +++ b/docs-devsite/ai.retrievedcontextattribution.md @@ -21,8 +21,8 @@ export interface RetrievedContextAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | -| [uri](./vertexai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | +| [title](./ai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | +| [uri](./ai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | ## RetrievedContextAttribution.title diff --git a/docs-devsite/ai.safetyrating.md b/docs-devsite/ai.safetyrating.md new file mode 100644 index 00000000000..86b1549569e --- /dev/null +++ b/docs-devsite/ai.safetyrating.md @@ -0,0 +1,90 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SafetyRating interface +A safety rating associated with a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface) + +Signature: + +```typescript +export interface SafetyRating +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [blocked](./ai.safetyrating.md#safetyratingblocked) | boolean | | +| [category](./ai.safetyrating.md#safetyratingcategory) | [HarmCategory](./ai.md#harmcategory) | | +| [probability](./ai.safetyrating.md#safetyratingprobability) | [HarmProbability](./ai.md#harmprobability) | | +| [probabilityScore](./ai.safetyrating.md#safetyratingprobabilityscore) | number | The probability score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | +| [severity](./ai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./ai.md#harmseverity) | The harm severity level.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to HarmSeverity.UNSUPPORTED. | +| [severityScore](./ai.safetyrating.md#safetyratingseverityscore) | number | The severity score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | + +## SafetyRating.blocked + +Signature: + +```typescript +blocked: boolean; +``` + +## SafetyRating.category + +Signature: + +```typescript +category: HarmCategory; +``` + +## SafetyRating.probability + +Signature: + +```typescript +probability: HarmProbability; +``` + +## SafetyRating.probabilityScore + +The probability score of the harm category. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + +Signature: + +```typescript +probabilityScore: number; +``` + +## SafetyRating.severity + +The harm severity level. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to `HarmSeverity.UNSUPPORTED`. + +Signature: + +```typescript +severity: HarmSeverity; +``` + +## SafetyRating.severityScore + +The severity score of the harm category. + +This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. + +Signature: + +```typescript +severityScore: number; +``` diff --git a/docs-devsite/ai.safetysetting.md b/docs-devsite/ai.safetysetting.md new file mode 100644 index 00000000000..b6c770a5f60 --- /dev/null +++ b/docs-devsite/ai.safetysetting.md @@ -0,0 +1,55 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SafetySetting interface +Safety setting that can be sent as part of request parameters. + +Signature: + +```typescript +export interface SafetySetting +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [category](./ai.safetysetting.md#safetysettingcategory) | [HarmCategory](./ai.md#harmcategory) | | +| [method](./ai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./ai.md#harmblockmethod) | The harm block method.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), an [AIError](./ai.aierror.md#aierror_class) will be thrown if this property is defined. | +| [threshold](./ai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./ai.md#harmblockthreshold) | | + +## SafetySetting.category + +Signature: + +```typescript +category: HarmCategory; +``` + +## SafetySetting.method + +The harm block method. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), an [AIError](./ai.aierror.md#aierror_class) will be thrown if this property is defined. + +Signature: + +```typescript +method?: HarmBlockMethod; +``` + +## SafetySetting.threshold + +Signature: + +```typescript +threshold: HarmBlockThreshold; +``` diff --git a/docs-devsite/vertexai.schema.md b/docs-devsite/ai.schema.md similarity index 53% rename from docs-devsite/vertexai.schema.md rename to docs-devsite/ai.schema.md index f4a36c3c506..b0681b0cdf3 100644 --- a/docs-devsite/vertexai.schema.md +++ b/docs-devsite/ai.schema.md @@ -17,35 +17,35 @@ Parent class encompassing all Schema types, with static methods that allow build ```typescript export declare abstract class Schema implements SchemaInterface ``` -Implements: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) +Implements: [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams)](./vertexai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | +| [(constructor)(schemaParams)](./ai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [description](./vertexai.schema.md#schemadescription) | | string | Optional. The description of the property. | -| [example](./vertexai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | -| [format](./vertexai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:

  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| -| [nullable](./vertexai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | -| [type](./vertexai.schema.md#schematype) | | [SchemaType](./vertexai.md#schematype) | Optional. The type of the property. [SchemaType](./vertexai.md#schematype). | +| [description](./ai.schema.md#schemadescription) | | string | Optional. The description of the property. | +| [example](./ai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | +| [format](./ai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| +| [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | +| [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [array(arrayParams)](./vertexai.schema.md#schemaarray) | static | | -| [boolean(booleanParams)](./vertexai.schema.md#schemaboolean) | static | | -| [enumString(stringParams)](./vertexai.schema.md#schemaenumstring) | static | | -| [integer(integerParams)](./vertexai.schema.md#schemainteger) | static | | -| [number(numberParams)](./vertexai.schema.md#schemanumber) | static | | -| [object(objectParams)](./vertexai.schema.md#schemaobject) | static | | -| [string(stringParams)](./vertexai.schema.md#schemastring) | static | | +| [array(arrayParams)](./ai.schema.md#schemaarray) | static | | +| [boolean(booleanParams)](./ai.schema.md#schemaboolean) | static | | +| [enumString(stringParams)](./ai.schema.md#schemaenumstring) | static | | +| [integer(integerParams)](./ai.schema.md#schemainteger) | static | | +| [number(numberParams)](./ai.schema.md#schemanumber) | static | | +| [object(objectParams)](./ai.schema.md#schemaobject) | static | | +| [string(stringParams)](./ai.schema.md#schemastring) | static | | ## Schema.(constructor) @@ -61,7 +61,7 @@ constructor(schemaParams: SchemaInterface); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | | +| schemaParams | [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | | ## Schema.description @@ -105,7 +105,7 @@ nullable: boolean; ## Schema.type -Optional. The type of the property. [SchemaType](./vertexai.md#schematype). +Optional. The type of the property. [SchemaType](./ai.md#schematype). Signature: @@ -127,11 +127,11 @@ static array(arrayParams: SchemaParams & { | Parameter | Type | Description | | --- | --- | --- | -| arrayParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { items: [Schema](./vertexai.schema.md#schema_class); } | | +| arrayParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { items: [Schema](./ai.schema.md#schema_class); } | | Returns: -[ArraySchema](./vertexai.arrayschema.md#arrayschema_class) +[ArraySchema](./ai.arrayschema.md#arrayschema_class) ## Schema.boolean() @@ -145,11 +145,11 @@ static boolean(booleanParams?: SchemaParams): BooleanSchema; | Parameter | Type | Description | | --- | --- | --- | -| booleanParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| booleanParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | Returns: -[BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) +[BooleanSchema](./ai.booleanschema.md#booleanschema_class) ## Schema.enumString() @@ -165,11 +165,11 @@ static enumString(stringParams: SchemaParams & { | Parameter | Type | Description | | --- | --- | --- | -| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | +| stringParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | Returns: -[StringSchema](./vertexai.stringschema.md#stringschema_class) +[StringSchema](./ai.stringschema.md#stringschema_class) ## Schema.integer() @@ -183,11 +183,11 @@ static integer(integerParams?: SchemaParams): IntegerSchema; | Parameter | Type | Description | | --- | --- | --- | -| integerParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| integerParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | Returns: -[IntegerSchema](./vertexai.integerschema.md#integerschema_class) +[IntegerSchema](./ai.integerschema.md#integerschema_class) ## Schema.number() @@ -201,11 +201,11 @@ static number(numberParams?: SchemaParams): NumberSchema; | Parameter | Type | Description | | --- | --- | --- | -| numberParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| numberParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | Returns: -[NumberSchema](./vertexai.numberschema.md#numberschema_class) +[NumberSchema](./ai.numberschema.md#numberschema_class) ## Schema.object() @@ -224,11 +224,11 @@ static object(objectParams: SchemaParams & { | Parameter | Type | Description | | --- | --- | --- | -| objectParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./vertexai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | +| objectParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./ai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | Returns: -[ObjectSchema](./vertexai.objectschema.md#objectschema_class) +[ObjectSchema](./ai.objectschema.md#objectschema_class) ## Schema.string() @@ -242,9 +242,9 @@ static string(stringParams?: SchemaParams): StringSchema; | Parameter | Type | Description | | --- | --- | --- | -| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| stringParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | Returns: -[StringSchema](./vertexai.stringschema.md#stringschema_class) +[StringSchema](./ai.stringschema.md#stringschema_class) diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/ai.schemainterface.md similarity index 55% rename from docs-devsite/vertexai.schemainterface.md rename to docs-devsite/ai.schemainterface.md index c14b561193b..6dd33e69e18 100644 --- a/docs-devsite/vertexai.schemainterface.md +++ b/docs-devsite/ai.schemainterface.md @@ -10,24 +10,24 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaInterface interface -Interface for [Schema](./vertexai.schema.md#schema_class) class. +Interface for [Schema](./ai.schema.md#schema_class) class. Signature: ```typescript export interface SchemaInterface extends SchemaShared ``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> +Extends: [SchemaShared](./ai.schemashared.md#schemashared_interface)<[SchemaInterface](./ai.schemainterface.md#schemainterface_interface)> ## Properties | Property | Type | Description | | --- | --- | --- | -| [type](./vertexai.schemainterface.md#schemainterfacetype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | +| [type](./ai.schemainterface.md#schemainterfacetype) | [SchemaType](./ai.md#schematype) | The type of the property. [SchemaType](./ai.md#schematype). | ## SchemaInterface.type -The type of the property. [SchemaType](./vertexai.md#schematype). +The type of the property. [SchemaType](./ai.md#schematype). Signature: diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/ai.schemaparams.md similarity index 58% rename from docs-devsite/vertexai.schemaparams.md rename to docs-devsite/ai.schemaparams.md index 8e4a41f6bdc..3f9626306c2 100644 --- a/docs-devsite/vertexai.schemaparams.md +++ b/docs-devsite/ai.schemaparams.md @@ -10,12 +10,12 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaParams interface -Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. +Params passed to [Schema](./ai.schema.md#schema_class) static methods to create specific [Schema](./ai.schema.md#schema_class) classes. Signature: ```typescript export interface SchemaParams extends SchemaShared ``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> +Extends: [SchemaShared](./ai.schemashared.md#schemashared_interface)<[SchemaInterface](./ai.schemainterface.md#schemainterface_interface)> diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/ai.schemarequest.md similarity index 53% rename from docs-devsite/vertexai.schemarequest.md rename to docs-devsite/ai.schemarequest.md index c382c2a6297..e71d24a6b1a 100644 --- a/docs-devsite/vertexai.schemarequest.md +++ b/docs-devsite/ai.schemarequest.md @@ -10,21 +10,21 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaRequest interface -Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. +Final format for [Schema](./ai.schema.md#schema_class) params passed to backend requests. Signature: ```typescript export interface SchemaRequest extends SchemaShared ``` -Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface)> +Extends: [SchemaShared](./ai.schemashared.md#schemashared_interface)<[SchemaRequest](./ai.schemarequest.md#schemarequest_interface)> ## Properties | Property | Type | Description | | --- | --- | --- | -| [required](./vertexai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | -| [type](./vertexai.schemarequest.md#schemarequesttype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | +| [required](./ai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | +| [type](./ai.schemarequest.md#schemarequesttype) | [SchemaType](./ai.md#schematype) | The type of the property. [SchemaType](./ai.md#schematype). | ## SchemaRequest.required @@ -38,7 +38,7 @@ required?: string[]; ## SchemaRequest.type -The type of the property. [SchemaType](./vertexai.md#schematype). +The type of the property. [SchemaType](./ai.md#schematype). Signature: diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/ai.schemashared.md similarity index 51% rename from docs-devsite/vertexai.schemashared.md rename to docs-devsite/ai.schemashared.md index 4fdf8941438..eba57f82935 100644 --- a/docs-devsite/vertexai.schemashared.md +++ b/docs-devsite/ai.schemashared.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SchemaShared interface -Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. +Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. Signature: @@ -22,13 +22,13 @@ export interface SchemaShared | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | -| [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | -| [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | -| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | -| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | -| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | -| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | +| [description](./ai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | +| [enum](./ai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | +| [example](./ai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | +| [format](./ai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | +| [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | +| [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | +| [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | ## SchemaShared.description @@ -62,7 +62,7 @@ example?: unknown; ## SchemaShared.format -Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this must be either `'enum'` or `'date-time'`, otherwise requests will fail. +Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this must be either `'enum'` or `'date-time'`, otherwise requests will fail. Signature: diff --git a/docs-devsite/vertexai.segment.md b/docs-devsite/ai.segment.md similarity index 77% rename from docs-devsite/vertexai.segment.md rename to docs-devsite/ai.segment.md index db61f00a149..69f4aaf8407 100644 --- a/docs-devsite/vertexai.segment.md +++ b/docs-devsite/ai.segment.md @@ -21,9 +21,9 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai.segment.md#segmentendindex) | number | | -| [partIndex](./vertexai.segment.md#segmentpartindex) | number | | -| [startIndex](./vertexai.segment.md#segmentstartindex) | number | | +| [endIndex](./ai.segment.md#segmentendindex) | number | | +| [partIndex](./ai.segment.md#segmentpartindex) | number | | +| [startIndex](./ai.segment.md#segmentstartindex) | number | | ## Segment.endIndex diff --git a/docs-devsite/vertexai.startchatparams.md b/docs-devsite/ai.startchatparams.md similarity index 54% rename from docs-devsite/vertexai.startchatparams.md rename to docs-devsite/ai.startchatparams.md index e07bbd91d82..2d039bbe868 100644 --- a/docs-devsite/vertexai.startchatparams.md +++ b/docs-devsite/ai.startchatparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # StartChatParams interface -Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). +Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). Signature: ```typescript export interface StartChatParams extends BaseParams ``` -Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) +Extends: [BaseParams](./ai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [history](./vertexai.startchatparams.md#startchatparamshistory) | [Content](./vertexai.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.startchatparams.md#startchatparamstools) | [Tool](./vertexai.md#tool)\[\] | | +| [history](./ai.startchatparams.md#startchatparamshistory) | [Content](./ai.content.md#content_interface)\[\] | | +| [systemInstruction](./ai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./ai.md#part) \| [Content](./ai.content.md#content_interface) | | +| [toolConfig](./ai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | | +| [tools](./ai.startchatparams.md#startchatparamstools) | [Tool](./ai.md#tool)\[\] | | ## StartChatParams.history diff --git a/docs-devsite/vertexai.stringschema.md b/docs-devsite/ai.stringschema.md similarity index 72% rename from docs-devsite/vertexai.stringschema.md rename to docs-devsite/ai.stringschema.md index bfafe0fe9df..c3ab8f13a6f 100644 --- a/docs-devsite/vertexai.stringschema.md +++ b/docs-devsite/ai.stringschema.md @@ -17,19 +17,19 @@ Schema class for "string" types. Can be used with or without enum values. ```typescript export declare class StringSchema extends Schema ``` -Extends: [Schema](./vertexai.schema.md#schema_class) +Extends: [Schema](./ai.schema.md#schema_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(schemaParams, enumValues)](./vertexai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | +| [(constructor)(schemaParams, enumValues)](./ai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [enum](./vertexai.stringschema.md#stringschemaenum) | | string\[\] | | +| [enum](./ai.stringschema.md#stringschemaenum) | | string\[\] | | ## StringSchema.(constructor) @@ -45,7 +45,7 @@ constructor(schemaParams?: SchemaParams, enumValues?: string[]); | Parameter | Type | Description | | --- | --- | --- | -| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | | | enumValues | string\[\] | | ## StringSchema.enum diff --git a/docs-devsite/vertexai.textpart.md b/docs-devsite/ai.textpart.md similarity index 74% rename from docs-devsite/vertexai.textpart.md rename to docs-devsite/ai.textpart.md index afee40a369d..2057d95d32e 100644 --- a/docs-devsite/vertexai.textpart.md +++ b/docs-devsite/ai.textpart.md @@ -22,10 +22,10 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai.textpart.md#textpartfunctioncall) | never | | -| [functionResponse](./vertexai.textpart.md#textpartfunctionresponse) | never | | -| [inlineData](./vertexai.textpart.md#textpartinlinedata) | never | | -| [text](./vertexai.textpart.md#textparttext) | string | | +| [functionCall](./ai.textpart.md#textpartfunctioncall) | never | | +| [functionResponse](./ai.textpart.md#textpartfunctionresponse) | never | | +| [inlineData](./ai.textpart.md#textpartinlinedata) | never | | +| [text](./ai.textpart.md#textparttext) | string | | ## TextPart.functionCall diff --git a/docs-devsite/vertexai.toolconfig.md b/docs-devsite/ai.toolconfig.md similarity index 78% rename from docs-devsite/vertexai.toolconfig.md rename to docs-devsite/ai.toolconfig.md index 30c62c17c01..81bd6ccd8fc 100644 --- a/docs-devsite/vertexai.toolconfig.md +++ b/docs-devsite/ai.toolconfig.md @@ -22,7 +22,7 @@ export interface ToolConfig | Property | Type | Description | | --- | --- | --- | -| [functionCallingConfig](./vertexai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [functionCallingConfig](./ai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./ai.functioncallingconfig.md#functioncallingconfig_interface) | | ## ToolConfig.functionCallingConfig diff --git a/docs-devsite/vertexai.usagemetadata.md b/docs-devsite/ai.usagemetadata.md similarity index 56% rename from docs-devsite/vertexai.usagemetadata.md rename to docs-devsite/ai.usagemetadata.md index 176878235d5..4211fea72b4 100644 --- a/docs-devsite/vertexai.usagemetadata.md +++ b/docs-devsite/ai.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,11 +22,11 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | -| [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | -| [candidatesTokensDetails](./vertexai.usagemetadata.md#usagemetadatacandidatestokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | | -| [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | -| [promptTokensDetails](./vertexai.usagemetadata.md#usagemetadataprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | | -| [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | +| [candidatesTokenCount](./ai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [candidatesTokensDetails](./ai.usagemetadata.md#usagemetadatacandidatestokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | | +| [promptTokenCount](./ai.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [promptTokensDetails](./ai.usagemetadata.md#usagemetadataprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | | +| [totalTokenCount](./ai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount diff --git a/docs-devsite/vertexai.vertexaibackend.md b/docs-devsite/ai.vertexaibackend.md similarity index 67% rename from docs-devsite/vertexai.vertexaibackend.md rename to docs-devsite/ai.vertexaibackend.md index ba82c775ca8..88424b75c45 100644 --- a/docs-devsite/vertexai.vertexaibackend.md +++ b/docs-devsite/ai.vertexaibackend.md @@ -12,26 +12,26 @@ https://github.com/firebase/firebase-js-sdk # VertexAIBackend class Configuration class for the Vertex AI Gemini API. -Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. +Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. Signature: ```typescript export declare class VertexAIBackend extends Backend ``` -Extends: [Backend](./vertexai.backend.md#backend_class) +Extends: [Backend](./ai.backend.md#backend_class) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(location)](./vertexai.vertexaibackend.md#vertexaibackendconstructor) | | Creates a configuration object for the Vertex AI backend. | +| [(constructor)(location)](./ai.vertexaibackend.md#vertexaibackendconstructor) | | Creates a configuration object for the Vertex AI backend. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [location](./vertexai.vertexaibackend.md#vertexaibackendlocation) | | string | The region identifier. See [Vertex AI locations](https://firebase.google.com/docs/vertex-ai/locations#available-locations) for a list of supported locations. | +| [location](./ai.vertexaibackend.md#vertexaibackendlocation) | | string | The region identifier. See [Vertex AI locations](https://firebase.google.com/docs/vertex-ai/locations#available-locations) for a list of supported locations. | ## VertexAIBackend.(constructor) diff --git a/docs-devsite/vertexai.vertexaioptions.md b/docs-devsite/ai.vertexaioptions.md similarity index 88% rename from docs-devsite/vertexai.vertexaioptions.md rename to docs-devsite/ai.vertexaioptions.md index 776dfd29374..311fa4785f7 100644 --- a/docs-devsite/vertexai.vertexaioptions.md +++ b/docs-devsite/ai.vertexaioptions.md @@ -22,7 +22,7 @@ export interface VertexAIOptions | Property | Type | Description | | --- | --- | --- | -| [location](./vertexai.vertexaioptions.md#vertexaioptionslocation) | string | | +| [location](./ai.vertexaioptions.md#vertexaioptionslocation) | string | | ## VertexAIOptions.location diff --git a/docs-devsite/vertexai.videometadata.md b/docs-devsite/ai.videometadata.md similarity index 75% rename from docs-devsite/vertexai.videometadata.md rename to docs-devsite/ai.videometadata.md index b4f872c4e3d..d63447837be 100644 --- a/docs-devsite/vertexai.videometadata.md +++ b/docs-devsite/ai.videometadata.md @@ -22,8 +22,8 @@ export interface VideoMetadata | Property | Type | Description | | --- | --- | --- | -| [endOffset](./vertexai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | -| [startOffset](./vertexai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [endOffset](./ai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [startOffset](./ai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | ## VideoMetadata.endOffset diff --git a/docs-devsite/vertexai.webattribution.md b/docs-devsite/ai.webattribution.md similarity index 81% rename from docs-devsite/vertexai.webattribution.md rename to docs-devsite/ai.webattribution.md index bb4fecf874d..2040d9eb82a 100644 --- a/docs-devsite/vertexai.webattribution.md +++ b/docs-devsite/ai.webattribution.md @@ -21,8 +21,8 @@ export interface WebAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai.webattribution.md#webattributiontitle) | string | | -| [uri](./vertexai.webattribution.md#webattributionuri) | string | | +| [title](./ai.webattribution.md#webattributiontitle) | string | | +| [uri](./ai.webattribution.md#webattributionuri) | string | | ## WebAttribution.title diff --git a/docs-devsite/index.md b/docs-devsite/index.md index af34d0d0250..47ec0be16ba 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -15,6 +15,7 @@ https://github.com/firebase/firebase-js-sdk | Package | Description | | --- | --- | +| [@firebase/ai](./ai.md#ai_package) | The Firebase AI Web SDK. | | [@firebase/analytics](./analytics.md#analytics_package) | The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/app](./app.md#app_package) | Firebase App | | [@firebase/app-check](./app-check.md#app-check_package) | The Firebase App Check Web SDK. | @@ -27,5 +28,4 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Firebase AI Web SDK. | diff --git a/docs-devsite/vertexai.ai.md b/docs-devsite/vertexai.ai.md deleted file mode 100644 index 661bf0b4fe3..00000000000 --- a/docs-devsite/vertexai.ai.md +++ /dev/null @@ -1,64 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# AI interface -An instance of the Firebase AI SDK. - -Do not create this instance directly. Instead, use [getAI()](./vertexai.md#getai_a94a413). - -Signature: - -```typescript -export interface AI -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [app](./vertexai.ai.md#aiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./vertexai.ai.md#ai_interface) instance is associated with. | -| [backend](./vertexai.ai.md#aibackend) | [Backend](./vertexai.backend.md#backend_class) | A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). | -| [location](./vertexai.ai.md#ailocation) | string | The location configured for this AI service instance, relevant for Vertex AI backends. | - -## AI.app - -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./vertexai.ai.md#ai_interface) instance is associated with. - -Signature: - -```typescript -app: FirebaseApp; -``` - -## AI.backend - -A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). - -Signature: - -```typescript -backend: Backend; -``` - -## AI.location - -> Warning: This API is now obsolete. -> -> use `AI.backend.location` instead. -> - -The location configured for this AI service instance, relevant for Vertex AI backends. - -Signature: - -```typescript -location: string; -``` diff --git a/docs-devsite/vertexai.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md deleted file mode 100644 index b304ccb82a0..00000000000 --- a/docs-devsite/vertexai.counttokensresponse.md +++ /dev/null @@ -1,59 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# CountTokensResponse interface -Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). - -Signature: - -```typescript -export interface CountTokensResponse -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [promptTokensDetails](./vertexai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. | -| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | -| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | - -## CountTokensResponse.promptTokensDetails - -The breakdown, by modality, of how many tokens are consumed by the prompt. - -Signature: - -```typescript -promptTokensDetails?: ModalityTokenCount[]; -``` - -## CountTokensResponse.totalBillableCharacters - -The total number of billable characters counted across all instances from the request. - -This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. - -Signature: - -```typescript -totalBillableCharacters?: number; -``` - -## CountTokensResponse.totalTokens - -The total number of tokens counted across all instances from the request. - -Signature: - -```typescript -totalTokens: number; -``` diff --git a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md deleted file mode 100644 index b557219bf84..00000000000 --- a/docs-devsite/vertexai.enhancedgeneratecontentresponse.md +++ /dev/null @@ -1,56 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# EnhancedGenerateContentResponse interface -Response object wrapped with helper methods. - -Signature: - -```typescript -export interface EnhancedGenerateContentResponse extends GenerateContentResponse -``` -Extends: [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [inlineDataParts](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () => [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)\[\] \| undefined | Aggregates and returns all [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. | -| [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | - -## EnhancedGenerateContentResponse.functionCalls - -Signature: - -```typescript -functionCalls: () => FunctionCall[] | undefined; -``` - -## EnhancedGenerateContentResponse.inlineDataParts - -Aggregates and returns all [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. - -Signature: - -```typescript -inlineDataParts: () => InlineDataPart[] | undefined; -``` - -## EnhancedGenerateContentResponse.text - -Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. - -Signature: - -```typescript -text: () => string; -``` diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md deleted file mode 100644 index 2eff3138d8d..00000000000 --- a/docs-devsite/vertexai.functiondeclarationstool.md +++ /dev/null @@ -1,35 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationsTool interface -A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - -Signature: - -```typescript -export declare interface FunctionDeclarationsTool -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | - -## FunctionDeclarationsTool.functionDeclarations - -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. - -Signature: - -```typescript -functionDeclarations?: FunctionDeclaration[]; -``` diff --git a/docs-devsite/vertexai.generatecontentresponse.md b/docs-devsite/vertexai.generatecontentresponse.md deleted file mode 100644 index 304674c9b6f..00000000000 --- a/docs-devsite/vertexai.generatecontentresponse.md +++ /dev/null @@ -1,51 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerateContentResponse interface -Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. - -Signature: - -```typescript -export interface GenerateContentResponse -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidates](./vertexai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | -| [promptFeedback](./vertexai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | | -| [usageMetadata](./vertexai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | | - -## GenerateContentResponse.candidates - -Signature: - -```typescript -candidates?: GenerateContentCandidate[]; -``` - -## GenerateContentResponse.promptFeedback - -Signature: - -```typescript -promptFeedback?: PromptFeedback; -``` - -## GenerateContentResponse.usageMetadata - -Signature: - -```typescript -usageMetadata?: UsageMetadata; -``` diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md deleted file mode 100644 index 360ef709419..00000000000 --- a/docs-devsite/vertexai.generationconfig.md +++ /dev/null @@ -1,134 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerationConfig interface -Config options for content-related requests - -Signature: - -```typescript -export interface GenerationConfig -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidateCount](./vertexai.generationconfig.md#generationconfigcandidatecount) | number | | -| [frequencyPenalty](./vertexai.generationconfig.md#generationconfigfrequencypenalty) | number | | -| [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | -| [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | -| [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | -| [responseModalities](./vertexai.generationconfig.md#generationconfigresponsemodalities) | [ResponseModality](./vertexai.md#responsemodality)\[\] | (Public Preview) Generation modalities to be returned in generation responses. | -| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | -| [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | -| [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | -| [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | -| [topP](./vertexai.generationconfig.md#generationconfigtopp) | number | | - -## GenerationConfig.candidateCount - -Signature: - -```typescript -candidateCount?: number; -``` - -## GenerationConfig.frequencyPenalty - -Signature: - -```typescript -frequencyPenalty?: number; -``` - -## GenerationConfig.maxOutputTokens - -Signature: - -```typescript -maxOutputTokens?: number; -``` - -## GenerationConfig.presencePenalty - -Signature: - -```typescript -presencePenalty?: number; -``` - -## GenerationConfig.responseMimeType - -Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. - -Signature: - -```typescript -responseMimeType?: string; -``` - -## GenerationConfig.responseModalities - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Generation modalities to be returned in generation responses. - -- Multimodal response generation is only supported by some Gemini models and versions; see [model versions](https://firebase.google.com/docs/vertex-ai/models). - Only image generation (`ResponseModality.IMAGE`) is supported. - -Signature: - -```typescript -responseModalities?: ResponseModality[]; -``` - -## GenerationConfig.responseSchema - -Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. - -Signature: - -```typescript -responseSchema?: TypedSchema | SchemaRequest; -``` - -## GenerationConfig.stopSequences - -Signature: - -```typescript -stopSequences?: string[]; -``` - -## GenerationConfig.temperature - -Signature: - -```typescript -temperature?: number; -``` - -## GenerationConfig.topK - -Signature: - -```typescript -topK?: number; -``` - -## GenerationConfig.topP - -Signature: - -```typescript -topP?: number; -``` diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md deleted file mode 100644 index ba82b65aceb..00000000000 --- a/docs-devsite/vertexai.generativemodel.md +++ /dev/null @@ -1,193 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerativeModel class -Class for generative model APIs. - -Signature: - -```typescript -export declare class GenerativeModel extends AIModel -``` -Extends: [AIModel](./vertexai.aimodel.md#aimodel_class) - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(ai, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | -| [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | -| [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | -| [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | -| [toolConfig](./vertexai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai.generativemodel.md#generativemodeltools) | | [Tool](./vertexai.md#tool)\[\] | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | - -## GenerativeModel.(constructor) - -Constructs a new instance of the `GenerativeModel` class - -Signature: - -```typescript -constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| ai | [AI](./vertexai.ai.md#ai_interface) | | -| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | - -## GenerativeModel.generationConfig - -Signature: - -```typescript -generationConfig: GenerationConfig; -``` - -## GenerativeModel.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions; -``` - -## GenerativeModel.safetySettings - -Signature: - -```typescript -safetySettings: SafetySetting[]; -``` - -## GenerativeModel.systemInstruction - -Signature: - -```typescript -systemInstruction?: Content; -``` - -## GenerativeModel.toolConfig - -Signature: - -```typescript -toolConfig?: ToolConfig; -``` - -## GenerativeModel.tools - -Signature: - -```typescript -tools?: Tool[]; -``` - -## GenerativeModel.countTokens() - -Counts the tokens in the provided request. - -Signature: - -```typescript -countTokens(request: CountTokensRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface)> - -## GenerativeModel.generateContent() - -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -generateContent(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> - -## GenerativeModel.generateContentStream() - -Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. - -Signature: - -```typescript -generateContentStream(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - -## GenerativeModel.startChat() - -Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. - -Signature: - -```typescript -startChat(startChatParams?: StartChatParams): ChatSession; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| startChatParams | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | | - -Returns: - -[ChatSession](./vertexai.chatsession.md#chatsession_class) - diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md deleted file mode 100644 index 7f56e0b373c..00000000000 --- a/docs-devsite/vertexai.md +++ /dev/null @@ -1,716 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# vertexai package -The Firebase AI Web SDK. - -## Functions - -| Function | Description | -| --- | --- | -| function(app, ...) | -| [getAI(app, options)](./vertexai.md#getai_a94a413) | Returns the default [AI](./vertexai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | -| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413).Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. | -| function(ai, ...) | -| [getGenerativeModel(ai, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | -| [getImagenModel(ai, modelParams, requestOptions)](./vertexai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | - -## Classes - -| Class | Description | -| --- | --- | -| [AIError](./vertexai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. | -| [AIModel](./vertexai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.Instances of this class are associated with a specific Firebase AI [Backend](./vertexai.backend.md#backend_class) and provide methods for interacting with the configured generative model. | -| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | -| [Backend](./vertexai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. | -| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | -| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | -| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Gemini Developer API as the backend. | -| [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface). | -| [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | -| [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | -| [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | -| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | -| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | -| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | -| [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. | - -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [AIErrorCode](./vertexai.md#aierrorcode) | Standardized error codes that [AIError](./vertexai.aierror.md#aierror_class) can have. | -| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./vertexai.md#functioncallingmode) | | -| [HarmBlockMethod](./vertexai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)). | -| [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | -| [Modality](./vertexai.md#modality) | Content part modality. | -| [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [AI](./vertexai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./vertexai.md#getai_a94a413). | -| [AIOptions](./vertexai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | -| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [Citation](./vertexai.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | -| [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | -| [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | -| [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | -| [Date\_2](./vertexai.date_2.md#date_2_interface) | Protobuf google.type.Date | -| [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | -| [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | -| [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | -| [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | -| [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | -| [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | -| [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | -| [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | -| [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | -| [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | -| [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | -| [ImagenGCSImage](./vertexai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | -| [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | -| [ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | -| [ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | -| [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class). | -| [ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | -| [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | -| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). | -| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | -| [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_80bd839). | -| [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | -| [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | -| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | -| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | -| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | -| [Segment](./vertexai.segment.md#segment_interface) | | -| [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | -| [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | -| [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | -| [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | -| [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [BackendType](./vertexai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.These values are assigned to the backendType property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. | -| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | -| [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | -| [VertexAIError](./vertexai.md#vertexaierror) | Error class for the Firebase AI SDK.For more information, refer to the documentation for the new [AIError](./vertexai.aierror.md#aierror_class). | -| [VertexAIModel](./vertexai.md#vertexaimodel) | Base class for Firebase AI model APIs.For more information, refer to the documentation for the new [AIModel](./vertexai.aimodel.md#aimodel_class). | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [BackendType](./vertexai.md#backendtype) | Type alias representing valid backend types. It can be either 'VERTEX_AI' or 'GOOGLE_AI'. | -| [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | -| [ResponseModality](./vertexai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | -| [Role](./vertexai.md#role) | Role is the producer of the content. | -| [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | -| [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | -| [VertexAI](./vertexai.md#vertexai) | An instance of the Firebase AI SDK.For more information, refer to the documentation for the new [AI](./vertexai.ai.md#ai_interface) interface. | - -## function(app, ...) - -### getAI(app, options) {:#getai_a94a413} - -Returns the default [AI](./vertexai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. - -Signature: - -```typescript -export declare function getAI(app?: FirebaseApp, options?: AIOptions): AI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [AIOptions](./vertexai.aioptions.md#aioptions_interface) | [AIOptions](./vertexai.aioptions.md#aioptions_interface) that configure the AI instance. | - -Returns: - -[AI](./vertexai.ai.md#ai_interface) - -The default [AI](./vertexai.ai.md#ai_interface) instance for the given [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). - -### Example 1 - - -```javascript -const ai = getAI(app); - -``` - -### Example 2 - - -```javascript -// Get an AI instance configured to use the Gemini Developer API (via Google AI). -const ai = getAI(app, { backend: new GoogleAIBackend() }); - -``` - -### Example 3 - - -```javascript -// Get an AI instance configured to use the Vertex AI Gemini API. -const ai = getAI(app, { backend: new VertexAIBackend() }); - -``` - -### getVertexAI(app, options) {:#getvertexai_04094cf} - -It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413). - -Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options to configure the Vertex AI instance, including the location. | - -Returns: - -[VertexAI](./vertexai.md#vertexai) - -## function(ai, ...) - -### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839} - -Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. - -Signature: - -```typescript -export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| ai | [AI](./vertexai.ai.md#ai_interface) | | -| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | - -Returns: - -[GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) - -### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645} - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. - -Only Imagen 3 models (named `imagen-3.0-*`) are supported. - -Signature: - -```typescript -export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| ai | [AI](./vertexai.ai.md#ai_interface) | An [AI](./vertexai.ai.md#ai_interface) instance. | -| modelParams | [ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. | -| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. | - -Returns: - -[ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) - -#### Exceptions - -If the `apiKey` or `projectId` fields are missing in your Firebase config. - -## BackendType - -An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with. - -These values are assigned to the `backendType` property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. - -Signature: - -```typescript -BackendType: { - readonly VERTEX_AI: "VERTEX_AI"; - readonly GOOGLE_AI: "GOOGLE_AI"; -} -``` - -## POSSIBLE\_ROLES - -Possible roles. - -Signature: - -```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] -``` - -## ResponseModality - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Generation modalities to be returned in generation responses. - -Signature: - -```typescript -ResponseModality: { - readonly TEXT: "TEXT"; - readonly IMAGE: "IMAGE"; -} -``` - -## VertexAIError - -Error class for the Firebase AI SDK. - -For more information, refer to the documentation for the new [AIError](./vertexai.aierror.md#aierror_class). - -Signature: - -```typescript -VertexAIError: typeof AIError -``` - -## VertexAIModel - -Base class for Firebase AI model APIs. - -For more information, refer to the documentation for the new [AIModel](./vertexai.aimodel.md#aimodel_class). - -Signature: - -```typescript -VertexAIModel: typeof AIModel -``` - -## BackendType - -Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. - -Signature: - -```typescript -export type BackendType = (typeof BackendType)[keyof typeof BackendType]; -``` - -## Part - -Content part - includes text, image/video, or function call/response part types. - -Signature: - -```typescript -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; -``` - -## ResponseModality - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Generation modalities to be returned in generation responses. - -Signature: - -```typescript -export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; -``` - -## Role - -Role is the producer of the content. - -Signature: - -```typescript -export type Role = (typeof POSSIBLE_ROLES)[number]; -``` - -## Tool - -Defines a tool that model can call to access external knowledge. - -Signature: - -```typescript -export declare type Tool = FunctionDeclarationsTool; -``` - -## TypedSchema - -A type that includes all specific Schema types. - -Signature: - -```typescript -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; -``` - -## VertexAI - -An instance of the Firebase AI SDK. - -For more information, refer to the documentation for the new [AI](./vertexai.ai.md#ai_interface) interface. - -Signature: - -```typescript -export type VertexAI = AI; -``` - -## AIErrorCode - -Standardized error codes that [AIError](./vertexai.aierror.md#aierror_class) can have. - -Signature: - -```typescript -export declare const enum AIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | -| UNSUPPORTED | "unsupported" | An error occured due an attempt to use an unsupported feature. | - -## BlockReason - -Reason that a prompt was blocked. - -Signature: - -```typescript -export declare enum BlockReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | -| OTHER | "OTHER" | Content was blocked, but the reason is uncategorized. | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | -| SAFETY | "SAFETY" | Content was blocked by safety settings. | - -## FinishReason - -Reason that a candidate finished. - -Signature: - -```typescript -export declare enum FinishReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | -| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | -| MAX\_TOKENS | "MAX_TOKENS" | The maximum number of tokens as specified in the request was reached. | -| OTHER | "OTHER" | Unknown reason. | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | -| RECITATION | "RECITATION" | The candidate content was flagged for recitation reasons. | -| SAFETY | "SAFETY" | The candidate content was flagged for safety reasons. | -| SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | -| STOP | "STOP" | Natural stop point of the model or provided stop sequence. | - -## FunctionCallingMode - - -Signature: - -```typescript -export declare enum FunctionCallingMode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | Model is constrained to always predicting a function call only. If allowed_function_names is set, the predicted function call will be limited to any one of allowed_function_names, else the predicted function call will be any one of the provided function_declarations. | -| AUTO | "AUTO" | Default model behavior; model decides to predict either a function call or a natural language response. | -| NONE | "NONE" | Model will not predict any function call. Model behavior is same as when not passing any function declarations. | - -## HarmBlockMethod - -This property is not supported in the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)). - -Signature: - -```typescript -export declare enum HarmBlockMethod -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| PROBABILITY | "PROBABILITY" | The harm block method uses the probability score. | -| SEVERITY | "SEVERITY" | The harm block method uses both probability and severity scores. | - -## HarmBlockThreshold - -Threshold above which a prompt or candidate will be blocked. - -Signature: - -```typescript -export declare enum HarmBlockThreshold -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | Content with NEGLIGIBLE will be allowed. | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | -| BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | - -## HarmCategory - -Harm categories that would cause prompts or candidates to be blocked. - -Signature: - -```typescript -export declare enum HarmCategory -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | - -## HarmProbability - -Probability that a prompt or candidate matches a harm category. - -Signature: - -```typescript -export declare enum HarmProbability -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HIGH | "HIGH" | Content has a high chance of being unsafe. | -| LOW | "LOW" | Content has a low chance of being unsafe. | -| MEDIUM | "MEDIUM" | Content has a medium chance of being unsafe. | -| NEGLIGIBLE | "NEGLIGIBLE" | Content has a negligible chance of being unsafe. | - -## HarmSeverity - -Harm severity levels. - -Signature: - -```typescript -export declare enum HarmSeverity -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | High level of harm severity. | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | Low level of harm severity. | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | Medium level of harm severity. | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | Negligible level of harm severity. | -| HARM\_SEVERITY\_UNSUPPORTED | "HARM_SEVERITY_UNSUPPORTED" | Harm severity is not supported. | - -## ImagenAspectRatio - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -Aspect ratios for Imagen images. - -To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface). - -See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. - -Signature: - -```typescript -export declare enum ImagenAspectRatio -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| LANDSCAPE\_16x9 | "16:9" | (Public Preview) Landscape (16:9) aspect ratio. | -| LANDSCAPE\_3x4 | "3:4" | (Public Preview) Landscape (3:4) aspect ratio. | -| PORTRAIT\_4x3 | "4:3" | (Public Preview) Portrait (4:3) aspect ratio. | -| PORTRAIT\_9x16 | "9:16" | (Public Preview) Portrait (9:16) aspect ratio. | -| SQUARE | "1:1" | (Public Preview) Square (1:1) aspect ratio. | - -## ImagenPersonFilterLevel - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A filter level controlling whether generation of images containing people or faces is allowed. - -See the personGeneration documentation for more details. - -Signature: - -```typescript -export declare enum ImagenPersonFilterLevel -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ALLOW\_ADULT | "allow_adult" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | -| ALLOW\_ALL | "allow_all" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | -| BLOCK\_ALL | "dont_allow" | (Public Preview) Disallow generation of images containing people or faces; images of people are filtered out. | - -## ImagenSafetyFilterLevel - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -A filter level controlling how aggressively to filter sensitive content. - -Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. - -Signature: - -```typescript -export declare enum ImagenSafetyFilterLevel -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "block_low_and_above" | (Public Preview) The most aggressive filtering level; most strict blocking. | -| BLOCK\_MEDIUM\_AND\_ABOVE | "block_medium_and_above" | (Public Preview) Blocks some sensitive prompts and responses. | -| BLOCK\_NONE | "block_none" | (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. | -| BLOCK\_ONLY\_HIGH | "block_only_high" | (Public Preview) Blocks few sensitive prompts and responses. | - -## Modality - -Content part modality. - -Signature: - -```typescript -export declare enum Modality -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| AUDIO | "AUDIO" | Audio. | -| DOCUMENT | "DOCUMENT" | Document (for example, PDF). | -| IMAGE | "IMAGE" | Image. | -| MODALITY\_UNSPECIFIED | "MODALITY_UNSPECIFIED" | Unspecified modality. | -| TEXT | "TEXT" | Plain text. | -| VIDEO | "VIDEO" | Video. | - -## SchemaType - -Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) - -Signature: - -```typescript -export declare enum SchemaType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "array" | Array type. | -| BOOLEAN | "boolean" | Boolean type. | -| INTEGER | "integer" | Integer type. | -| NUMBER | "number" | Number type. | -| OBJECT | "object" | Object type. | -| STRING | "string" | String type. | - diff --git a/docs-devsite/vertexai.safetyrating.md b/docs-devsite/vertexai.safetyrating.md deleted file mode 100644 index ebe5003c662..00000000000 --- a/docs-devsite/vertexai.safetyrating.md +++ /dev/null @@ -1,90 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) - -Signature: - -```typescript -export interface SafetyRating -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | -| [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | -| [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | -| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | The probability score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | -| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | The harm severity level.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to HarmSeverity.UNSUPPORTED. | -| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | The severity score of the harm category.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | - -## SafetyRating.blocked - -Signature: - -```typescript -blocked: boolean; -``` - -## SafetyRating.category - -Signature: - -```typescript -category: HarmCategory; -``` - -## SafetyRating.probability - -Signature: - -```typescript -probability: HarmProbability; -``` - -## SafetyRating.probabilityScore - -The probability score of the harm category. - -This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. - -Signature: - -```typescript -probabilityScore: number; -``` - -## SafetyRating.severity - -The harm severity level. - -This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to `HarmSeverity.UNSUPPORTED`. - -Signature: - -```typescript -severity: HarmSeverity; -``` - -## SafetyRating.severityScore - -The severity score of the harm category. - -This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. - -Signature: - -```typescript -severityScore: number; -``` diff --git a/docs-devsite/vertexai.safetysetting.md b/docs-devsite/vertexai.safetysetting.md deleted file mode 100644 index a91843faaa5..00000000000 --- a/docs-devsite/vertexai.safetysetting.md +++ /dev/null @@ -1,55 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# SafetySetting interface -Safety setting that can be sent as part of request parameters. - -Signature: - -```typescript -export interface SafetySetting -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | -| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | The harm block method.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), an [AIError](./vertexai.aierror.md#aierror_class) will be thrown if this property is defined. | -| [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | - -## SafetySetting.category - -Signature: - -```typescript -category: HarmCategory; -``` - -## SafetySetting.method - -The harm block method. - -This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)), an [AIError](./vertexai.aierror.md#aierror_class) will be thrown if this property is defined. - -Signature: - -```typescript -method?: HarmBlockMethod; -``` - -## SafetySetting.threshold - -Signature: - -```typescript -threshold: HarmBlockThreshold; -``` diff --git a/packages/vertexai/.eslintrc.js b/packages/ai/.eslintrc.js similarity index 100% rename from packages/vertexai/.eslintrc.js rename to packages/ai/.eslintrc.js diff --git a/packages/vertexai/CHANGELOG.md b/packages/ai/CHANGELOG.md similarity index 99% rename from packages/vertexai/CHANGELOG.md rename to packages/ai/CHANGELOG.md index 8fa9e9d4b4a..a49b5dacbd4 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,4 +1,4 @@ -# @firebase/vertexai +# @firebase/ai ## 1.2.2 diff --git a/packages/vertexai/README.md b/packages/ai/README.md similarity index 65% rename from packages/vertexai/README.md rename to packages/ai/README.md index b559a1e739e..94c95e50b25 100644 --- a/packages/vertexai/README.md +++ b/packages/ai/README.md @@ -1,5 +1,5 @@ -# @firebase/vertexai +# @firebase/ai -This is the Firebase Vertex AI component of the Firebase JS SDK. +This is the Firebase AI component of the Firebase JS SDK. **This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.** diff --git a/packages/vertexai/api-extractor.json b/packages/ai/api-extractor.json similarity index 100% rename from packages/vertexai/api-extractor.json rename to packages/ai/api-extractor.json diff --git a/packages/vertexai/karma.conf.js b/packages/ai/karma.conf.js similarity index 100% rename from packages/vertexai/karma.conf.js rename to packages/ai/karma.conf.js diff --git a/packages/vertexai/package.json b/packages/ai/package.json similarity index 89% rename from packages/vertexai/package.json rename to packages/ai/package.json index 0c6b24fc495..d159793b206 100644 --- a/packages/vertexai/package.json +++ b/packages/ai/package.json @@ -1,7 +1,7 @@ { - "name": "@firebase/vertexai", + "name": "@firebase/ai", "version": "1.2.2", - "description": "A Firebase SDK for VertexAI", + "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { "node": ">=18.0.0" @@ -11,7 +11,7 @@ "module": "dist/esm/index.esm2017.js", "exports": { ".": { - "types": "./dist/vertexai-public.d.ts", + "types": "./dist/ai-public.d.ts", "node": { "require": "./dist/index.node.cjs.js", "import": "./dist/index.node.mjs" @@ -31,7 +31,7 @@ "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "rollup -c && yarn api-report", - "build:deps": "lerna run --scope @firebase/vertexai --include-dependencies build", + "build:deps": "lerna run --scope @firebase/ai --include-dependencies build", "dev": "rollup -c -w", "update-responses": "../../scripts/update_vertexai_responses.sh", "testsetup": "yarn update-responses && yarn ts-node ./test-utils/convert-mocks.ts", @@ -40,7 +40,7 @@ "test:skip-clone": "karma start", "test:browser": "yarn testsetup && karma start", "api-report": "api-extractor run --local --verbose", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/vertexai-public.d.ts", + "typings:public": "node ../../scripts/build/use_typings.js ./dist/ai-public.d.ts", "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "peerDependencies": { @@ -64,7 +64,7 @@ "typescript": "5.5.4" }, "repository": { - "directory": "packages/vertexai", + "directory": "packages/ai", "type": "git", "url": "git+https://github.com/firebase/firebase-js-sdk.git" }, diff --git a/packages/vertexai/rollup.config.js b/packages/ai/rollup.config.js similarity index 100% rename from packages/vertexai/rollup.config.js rename to packages/ai/rollup.config.js diff --git a/packages/vertexai/src/api.test.ts b/packages/ai/src/api.test.ts similarity index 100% rename from packages/vertexai/src/api.test.ts rename to packages/ai/src/api.test.ts diff --git a/packages/vertexai/src/api.ts b/packages/ai/src/api.ts similarity index 84% rename from packages/vertexai/src/api.ts rename to packages/ai/src/api.ts index 06bd747746a..d2229c067fc 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/ai/src/api.ts @@ -41,18 +41,22 @@ export { Backend, VertexAIBackend, GoogleAIBackend } from './backend'; export { AIErrorCode as VertexAIErrorCode }; /** - * Base class for Firebase AI model APIs. + * @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been + * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and + * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * - * For more information, refer to the documentation for the new {@link AIModel}. + * Base class for Firebase AI model APIs. * * @public */ export const VertexAIModel = AIModel; /** - * Error class for the Firebase AI SDK. + * @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been + * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and + * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * - * For more information, refer to the documentation for the new {@link AIError}. + * Error class for the Firebase AI SDK. * * @public */ @@ -65,7 +69,9 @@ declare module '@firebase/component' { } /** - * It is recommended to use the new {@link getAI | getAI()}. + * @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been + * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and + * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * * Returns a {@link VertexAI} instance for the given app, configured to use the * Vertex AI Gemini API. This instance will be diff --git a/packages/vertexai/src/backend.test.ts b/packages/ai/src/backend.test.ts similarity index 100% rename from packages/vertexai/src/backend.test.ts rename to packages/ai/src/backend.test.ts diff --git a/packages/vertexai/src/backend.ts b/packages/ai/src/backend.ts similarity index 100% rename from packages/vertexai/src/backend.ts rename to packages/ai/src/backend.ts diff --git a/packages/vertexai/src/backwards-compatbility.test.ts b/packages/ai/src/backwards-compatbility.test.ts similarity index 100% rename from packages/vertexai/src/backwards-compatbility.test.ts rename to packages/ai/src/backwards-compatbility.test.ts diff --git a/packages/vertexai/src/constants.ts b/packages/ai/src/constants.ts similarity index 93% rename from packages/vertexai/src/constants.ts rename to packages/ai/src/constants.ts index 6339ce63017..cb54567735a 100644 --- a/packages/vertexai/src/constants.ts +++ b/packages/ai/src/constants.ts @@ -17,9 +17,6 @@ import { version } from '../package.json'; -// TODO (v12): Remove this -export const VERTEX_TYPE = 'vertexAI'; - export const AI_TYPE = 'AI'; export const DEFAULT_LOCATION = 'us-central1'; diff --git a/packages/vertexai/src/errors.ts b/packages/ai/src/errors.ts similarity index 100% rename from packages/vertexai/src/errors.ts rename to packages/ai/src/errors.ts diff --git a/packages/vertexai/src/googleai-mappers.test.ts b/packages/ai/src/googleai-mappers.test.ts similarity index 100% rename from packages/vertexai/src/googleai-mappers.test.ts rename to packages/ai/src/googleai-mappers.test.ts diff --git a/packages/vertexai/src/googleai-mappers.ts b/packages/ai/src/googleai-mappers.ts similarity index 100% rename from packages/vertexai/src/googleai-mappers.ts rename to packages/ai/src/googleai-mappers.ts diff --git a/packages/vertexai/src/helpers.test.ts b/packages/ai/src/helpers.test.ts similarity index 100% rename from packages/vertexai/src/helpers.test.ts rename to packages/ai/src/helpers.test.ts diff --git a/packages/vertexai/src/helpers.ts b/packages/ai/src/helpers.ts similarity index 100% rename from packages/vertexai/src/helpers.ts rename to packages/ai/src/helpers.ts diff --git a/packages/vertexai/src/index.node.ts b/packages/ai/src/index.node.ts similarity index 100% rename from packages/vertexai/src/index.node.ts rename to packages/ai/src/index.node.ts diff --git a/packages/vertexai/src/index.ts b/packages/ai/src/index.ts similarity index 100% rename from packages/vertexai/src/index.ts rename to packages/ai/src/index.ts diff --git a/packages/vertexai/src/logger.ts b/packages/ai/src/logger.ts similarity index 100% rename from packages/vertexai/src/logger.ts rename to packages/ai/src/logger.ts diff --git a/packages/vertexai/src/methods/chat-session-helpers.test.ts b/packages/ai/src/methods/chat-session-helpers.test.ts similarity index 100% rename from packages/vertexai/src/methods/chat-session-helpers.test.ts rename to packages/ai/src/methods/chat-session-helpers.test.ts diff --git a/packages/vertexai/src/methods/chat-session-helpers.ts b/packages/ai/src/methods/chat-session-helpers.ts similarity index 100% rename from packages/vertexai/src/methods/chat-session-helpers.ts rename to packages/ai/src/methods/chat-session-helpers.ts diff --git a/packages/vertexai/src/methods/chat-session.test.ts b/packages/ai/src/methods/chat-session.test.ts similarity index 100% rename from packages/vertexai/src/methods/chat-session.test.ts rename to packages/ai/src/methods/chat-session.test.ts diff --git a/packages/vertexai/src/methods/chat-session.ts b/packages/ai/src/methods/chat-session.ts similarity index 100% rename from packages/vertexai/src/methods/chat-session.ts rename to packages/ai/src/methods/chat-session.ts diff --git a/packages/vertexai/src/methods/count-tokens.test.ts b/packages/ai/src/methods/count-tokens.test.ts similarity index 100% rename from packages/vertexai/src/methods/count-tokens.test.ts rename to packages/ai/src/methods/count-tokens.test.ts diff --git a/packages/vertexai/src/methods/count-tokens.ts b/packages/ai/src/methods/count-tokens.ts similarity index 100% rename from packages/vertexai/src/methods/count-tokens.ts rename to packages/ai/src/methods/count-tokens.ts diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts similarity index 100% rename from packages/vertexai/src/methods/generate-content.test.ts rename to packages/ai/src/methods/generate-content.test.ts diff --git a/packages/vertexai/src/methods/generate-content.ts b/packages/ai/src/methods/generate-content.ts similarity index 100% rename from packages/vertexai/src/methods/generate-content.ts rename to packages/ai/src/methods/generate-content.ts diff --git a/packages/vertexai/src/models/ai-model.test.ts b/packages/ai/src/models/ai-model.test.ts similarity index 100% rename from packages/vertexai/src/models/ai-model.test.ts rename to packages/ai/src/models/ai-model.test.ts diff --git a/packages/vertexai/src/models/ai-model.ts b/packages/ai/src/models/ai-model.ts similarity index 100% rename from packages/vertexai/src/models/ai-model.ts rename to packages/ai/src/models/ai-model.ts diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/ai/src/models/generative-model.test.ts similarity index 100% rename from packages/vertexai/src/models/generative-model.test.ts rename to packages/ai/src/models/generative-model.test.ts diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/ai/src/models/generative-model.ts similarity index 100% rename from packages/vertexai/src/models/generative-model.ts rename to packages/ai/src/models/generative-model.ts diff --git a/packages/vertexai/src/models/imagen-model.test.ts b/packages/ai/src/models/imagen-model.test.ts similarity index 100% rename from packages/vertexai/src/models/imagen-model.test.ts rename to packages/ai/src/models/imagen-model.test.ts diff --git a/packages/vertexai/src/models/imagen-model.ts b/packages/ai/src/models/imagen-model.ts similarity index 100% rename from packages/vertexai/src/models/imagen-model.ts rename to packages/ai/src/models/imagen-model.ts diff --git a/packages/vertexai/src/models/index.ts b/packages/ai/src/models/index.ts similarity index 100% rename from packages/vertexai/src/models/index.ts rename to packages/ai/src/models/index.ts diff --git a/packages/vertexai/src/public-types.ts b/packages/ai/src/public-types.ts similarity index 90% rename from packages/vertexai/src/public-types.ts rename to packages/ai/src/public-types.ts index b12615a81ed..7a5b7dc3997 100644 --- a/packages/vertexai/src/public-types.ts +++ b/packages/ai/src/public-types.ts @@ -21,9 +21,11 @@ import { Backend } from './backend'; export * from './types'; /** - * An instance of the Firebase AI SDK. + * @deprecated Use the new {@link AI | AI} instead. The Vertex AI in Firebase SDK has been + * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and + * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * - * For more information, refer to the documentation for the new {@link AI} interface. + * An instance of the Firebase AI SDK. * * @public */ @@ -57,9 +59,9 @@ export interface AI { */ backend: Backend; /** - * The location configured for this AI service instance, relevant for Vertex AI backends. - * * @deprecated use `AI.backend.location` instead. + * + * The location configured for this AI service instance, relevant for Vertex AI backends. */ location: string; } diff --git a/packages/vertexai/src/requests/imagen-image-format.ts b/packages/ai/src/requests/imagen-image-format.ts similarity index 100% rename from packages/vertexai/src/requests/imagen-image-format.ts rename to packages/ai/src/requests/imagen-image-format.ts diff --git a/packages/vertexai/src/requests/request-helpers.test.ts b/packages/ai/src/requests/request-helpers.test.ts similarity index 100% rename from packages/vertexai/src/requests/request-helpers.test.ts rename to packages/ai/src/requests/request-helpers.test.ts diff --git a/packages/vertexai/src/requests/request-helpers.ts b/packages/ai/src/requests/request-helpers.ts similarity index 100% rename from packages/vertexai/src/requests/request-helpers.ts rename to packages/ai/src/requests/request-helpers.ts diff --git a/packages/vertexai/src/requests/request.test.ts b/packages/ai/src/requests/request.test.ts similarity index 100% rename from packages/vertexai/src/requests/request.test.ts rename to packages/ai/src/requests/request.test.ts diff --git a/packages/vertexai/src/requests/request.ts b/packages/ai/src/requests/request.ts similarity index 100% rename from packages/vertexai/src/requests/request.ts rename to packages/ai/src/requests/request.ts diff --git a/packages/vertexai/src/requests/response-helpers.test.ts b/packages/ai/src/requests/response-helpers.test.ts similarity index 100% rename from packages/vertexai/src/requests/response-helpers.test.ts rename to packages/ai/src/requests/response-helpers.test.ts diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/ai/src/requests/response-helpers.ts similarity index 100% rename from packages/vertexai/src/requests/response-helpers.ts rename to packages/ai/src/requests/response-helpers.ts diff --git a/packages/vertexai/src/requests/schema-builder.test.ts b/packages/ai/src/requests/schema-builder.test.ts similarity index 100% rename from packages/vertexai/src/requests/schema-builder.test.ts rename to packages/ai/src/requests/schema-builder.test.ts diff --git a/packages/vertexai/src/requests/schema-builder.ts b/packages/ai/src/requests/schema-builder.ts similarity index 100% rename from packages/vertexai/src/requests/schema-builder.ts rename to packages/ai/src/requests/schema-builder.ts diff --git a/packages/vertexai/src/requests/stream-reader.test.ts b/packages/ai/src/requests/stream-reader.test.ts similarity index 100% rename from packages/vertexai/src/requests/stream-reader.test.ts rename to packages/ai/src/requests/stream-reader.test.ts diff --git a/packages/vertexai/src/requests/stream-reader.ts b/packages/ai/src/requests/stream-reader.ts similarity index 100% rename from packages/vertexai/src/requests/stream-reader.ts rename to packages/ai/src/requests/stream-reader.ts diff --git a/packages/vertexai/src/service.test.ts b/packages/ai/src/service.test.ts similarity index 100% rename from packages/vertexai/src/service.test.ts rename to packages/ai/src/service.test.ts diff --git a/packages/vertexai/src/service.ts b/packages/ai/src/service.ts similarity index 100% rename from packages/vertexai/src/service.ts rename to packages/ai/src/service.ts diff --git a/packages/vertexai/src/types/content.ts b/packages/ai/src/types/content.ts similarity index 100% rename from packages/vertexai/src/types/content.ts rename to packages/ai/src/types/content.ts diff --git a/packages/vertexai/src/types/enums.ts b/packages/ai/src/types/enums.ts similarity index 100% rename from packages/vertexai/src/types/enums.ts rename to packages/ai/src/types/enums.ts diff --git a/packages/vertexai/src/types/error.ts b/packages/ai/src/types/error.ts similarity index 100% rename from packages/vertexai/src/types/error.ts rename to packages/ai/src/types/error.ts diff --git a/packages/vertexai/src/types/googleai.ts b/packages/ai/src/types/googleai.ts similarity index 100% rename from packages/vertexai/src/types/googleai.ts rename to packages/ai/src/types/googleai.ts diff --git a/packages/vertexai/src/types/imagen/index.ts b/packages/ai/src/types/imagen/index.ts similarity index 100% rename from packages/vertexai/src/types/imagen/index.ts rename to packages/ai/src/types/imagen/index.ts diff --git a/packages/vertexai/src/types/imagen/internal.ts b/packages/ai/src/types/imagen/internal.ts similarity index 100% rename from packages/vertexai/src/types/imagen/internal.ts rename to packages/ai/src/types/imagen/internal.ts diff --git a/packages/vertexai/src/types/imagen/requests.ts b/packages/ai/src/types/imagen/requests.ts similarity index 100% rename from packages/vertexai/src/types/imagen/requests.ts rename to packages/ai/src/types/imagen/requests.ts diff --git a/packages/vertexai/src/types/imagen/responses.ts b/packages/ai/src/types/imagen/responses.ts similarity index 100% rename from packages/vertexai/src/types/imagen/responses.ts rename to packages/ai/src/types/imagen/responses.ts diff --git a/packages/vertexai/src/types/index.ts b/packages/ai/src/types/index.ts similarity index 100% rename from packages/vertexai/src/types/index.ts rename to packages/ai/src/types/index.ts diff --git a/packages/vertexai/src/types/internal.ts b/packages/ai/src/types/internal.ts similarity index 100% rename from packages/vertexai/src/types/internal.ts rename to packages/ai/src/types/internal.ts diff --git a/packages/vertexai/src/types/requests.ts b/packages/ai/src/types/requests.ts similarity index 100% rename from packages/vertexai/src/types/requests.ts rename to packages/ai/src/types/requests.ts diff --git a/packages/vertexai/src/types/responses.ts b/packages/ai/src/types/responses.ts similarity index 100% rename from packages/vertexai/src/types/responses.ts rename to packages/ai/src/types/responses.ts diff --git a/packages/vertexai/src/types/schema.ts b/packages/ai/src/types/schema.ts similarity index 100% rename from packages/vertexai/src/types/schema.ts rename to packages/ai/src/types/schema.ts diff --git a/packages/vertexai/test-utils/base64cat.ts b/packages/ai/test-utils/base64cat.ts similarity index 100% rename from packages/vertexai/test-utils/base64cat.ts rename to packages/ai/test-utils/base64cat.ts diff --git a/packages/vertexai/test-utils/cat.jpeg b/packages/ai/test-utils/cat.jpeg similarity index 100% rename from packages/vertexai/test-utils/cat.jpeg rename to packages/ai/test-utils/cat.jpeg diff --git a/packages/vertexai/test-utils/cat.png b/packages/ai/test-utils/cat.png similarity index 100% rename from packages/vertexai/test-utils/cat.png rename to packages/ai/test-utils/cat.png diff --git a/packages/vertexai/test-utils/convert-mocks.ts b/packages/ai/test-utils/convert-mocks.ts similarity index 97% rename from packages/vertexai/test-utils/convert-mocks.ts rename to packages/ai/test-utils/convert-mocks.ts index 8690af4ac72..4bac70d1d10 100644 --- a/packages/vertexai/test-utils/convert-mocks.ts +++ b/packages/ai/test-utils/convert-mocks.ts @@ -47,7 +47,7 @@ function generateMockLookupFile(): void { const fileText = ` /** - * DO NOT EDIT - This file was generated by the packages/vertexai/test-utils/convert-mocks.ts script. + * DO NOT EDIT - This file was generated by the packages/ai/test-utils/convert-mocks.ts script. * * These objects map mock response filenames to their JSON contents. * diff --git a/packages/vertexai/test-utils/mock-response.ts b/packages/ai/test-utils/mock-response.ts similarity index 100% rename from packages/vertexai/test-utils/mock-response.ts rename to packages/ai/test-utils/mock-response.ts diff --git a/packages/vertexai/tsconfig.json b/packages/ai/tsconfig.json similarity index 100% rename from packages/vertexai/tsconfig.json rename to packages/ai/tsconfig.json diff --git a/packages/app/src/constants.ts b/packages/app/src/constants.ts index 8ef4eada39c..21ded00529a 100644 --- a/packages/app/src/constants.ts +++ b/packages/app/src/constants.ts @@ -39,7 +39,7 @@ import { name as remoteConfigCompatName } from '../../../packages/remote-config- import { name as storageName } from '../../../packages/storage/package.json'; import { name as storageCompatName } from '../../../packages/storage-compat/package.json'; import { name as firestoreName } from '../../../packages/firestore/package.json'; -import { name as vertexName } from '../../../packages/vertexai/package.json'; +import { name as aiName } from '../../../packages/ai/package.json'; import { name as firestoreCompatName } from '../../../packages/firestore-compat/package.json'; import { name as packageName } from '../../../packages/firebase/package.json'; @@ -76,7 +76,7 @@ export const PLATFORM_LOG_STRING = { [storageCompatName]: 'fire-gcs-compat', [firestoreName]: 'fire-fst', [firestoreCompatName]: 'fire-fst-compat', - [vertexName]: 'fire-vertex', + [aiName]: 'fire-vertex', 'fire-js': 'fire-js', // Platform identifier for JS SDK. [packageName]: 'fire-js-all' } as const; diff --git a/packages/firebase/ai/index.ts b/packages/firebase/ai/index.ts index 2645fd3004f..ea092d0f6e9 100644 --- a/packages/firebase/ai/index.ts +++ b/packages/firebase/ai/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2024 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,4 +15,4 @@ * limitations under the License. */ -export * from '@firebase/vertexai'; +export * from '@firebase/ai'; diff --git a/packages/firebase/ai/package.json b/packages/firebase/ai/package.json index 75405002478..932f0f8d2a1 100644 --- a/packages/firebase/ai/package.json +++ b/packages/firebase/ai/package.json @@ -3,5 +3,5 @@ "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm.js", "module": "dist/esm/index.esm.js", - "typings": "dist/vertexai/index.d.ts" -} \ No newline at end of file + "typings": "dist/ai/index.d.ts" +} diff --git a/packages/firebase/package.json b/packages/firebase/package.json index c61bc701426..caaba0fd528 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -228,28 +228,28 @@ "default": "./storage/dist/esm/index.esm.js" }, "./ai": { - "types": "./vertexai/dist/vertexai/index.d.ts", + "types": "./ai/dist/ai/index.d.ts", "node": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/index.mjs" + "require": "./ai/dist/index.cjs.js", + "import": "./ai/dist/index.mjs" }, "browser": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/esm/index.esm.js" + "require": "./ai/dist/index.cjs.js", + "import": "./ai/dist/esm/index.esm.js" }, - "default": "./vertexai/dist/esm/index.esm.js" + "default": "./ai/dist/esm/index.esm.js" }, "./vertexai": { - "types": "./vertexai/dist/vertexai/index.d.ts", + "types": "./ai/dist/ai/index.d.ts", "node": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/index.mjs" + "require": "./ai/dist/index.cjs.js", + "import": "./ai/dist/index.mjs" }, "browser": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/esm/index.esm.js" + "require": "./ai/dist/index.cjs.js", + "import": "./ai/dist/esm/index.esm.js" }, - "default": "./vertexai/dist/esm/index.esm.js" + "default": "./ai/dist/esm/index.esm.js" }, "./compat/analytics": { "types": "./compat/analytics/dist/compat/analytics/index.d.ts", @@ -411,6 +411,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { + "@firebase/ai": "1.2.2", "@firebase/app": "0.12.1", "@firebase/app-compat": "0.3.1", "@firebase/app-types": "0.9.3", @@ -437,8 +438,7 @@ "@firebase/analytics-compat": "0.2.19", "@firebase/app-check": "0.9.1", "@firebase/app-check-compat": "0.3.22", - "@firebase/util": "1.11.1", - "@firebase/vertexai": "1.2.2" + "@firebase/util": "1.11.1" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firebase/vertexai/index.ts b/packages/firebase/vertexai/index.ts index 2645fd3004f..530f99162ed 100644 --- a/packages/firebase/vertexai/index.ts +++ b/packages/firebase/vertexai/index.ts @@ -15,4 +15,4 @@ * limitations under the License. */ -export * from '@firebase/vertexai'; +export * from '@firebase/ai'; diff --git a/packages/firebase/vertexai/package.json b/packages/firebase/vertexai/package.json index 20e04a3bbb5..3da541949dc 100644 --- a/packages/firebase/vertexai/package.json +++ b/packages/firebase/vertexai/package.json @@ -3,5 +3,5 @@ "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm.js", "module": "dist/esm/index.esm.js", - "typings": "dist/vertexai/index.d.ts" -} \ No newline at end of file + "typings": "dist/ai/index.d.ts" +} diff --git a/scripts/docgen/docgen.ts b/scripts/docgen/docgen.ts index 113e4a6b339..811570decd1 100644 --- a/scripts/docgen/docgen.ts +++ b/scripts/docgen/docgen.ts @@ -60,7 +60,7 @@ const PREFERRED_PARAMS = [ 'performance', 'remoteConfig', 'storage', - 'vertexAI' + 'ai' ]; let authApiReportOriginal: string; diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index d80959febce..680a71ff776 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -21,7 +21,7 @@ RESPONSES_VERSION='v11.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" -cd "$(dirname "$0")/../packages/vertexai/test-utils" || exit +cd "$(dirname "$0")/../packages/ai/test-utils" || exit rm -rf "$REPO_NAME" git clone "$REPO_LINK" --quiet || exit cd "$REPO_NAME" || exit From 8593fa05bd884c2f1f6f3b4ae062efa48af93d24 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 13 May 2025 13:45:07 -0700 Subject: [PATCH 191/295] Add Emulator Overlay (#8977) (#9031) Co-authored-by: Maneesh Tewani --- .changeset/three-singers-wonder.md | 10 ++ common/api-review/util.api.md | 3 + packages/auth/src/core/auth/emulator.ts | 16 +- packages/auth/src/platform_browser/index.ts | 8 +- packages/database/src/api/Database.ts | 8 +- packages/firestore/src/lite-api/database.ts | 11 +- packages/functions/src/api.ts | 4 +- packages/functions/src/service.ts | 7 +- packages/storage/src/api.ts | 4 +- packages/storage/src/service.ts | 4 +- packages/util/src/emulator.ts | 178 ++++++++++++++++++++ 11 files changed, 238 insertions(+), 15 deletions(-) create mode 100644 .changeset/three-singers-wonder.md diff --git a/.changeset/three-singers-wonder.md b/.changeset/three-singers-wonder.md new file mode 100644 index 00000000000..72dea9d7aa5 --- /dev/null +++ b/.changeset/three-singers-wonder.md @@ -0,0 +1,10 @@ +--- +"@firebase/auth": patch +"@firebase/firestore": patch +"@firebase/util": patch +"@firebase/database": patch +"@firebase/storage": patch +"@firebase/functions": patch +--- + +Add Emulator Overlay diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 0f8fc13cd3a..98f8657fd5d 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -482,6 +482,9 @@ export interface Subscribe { // @public (undocumented) export type Unsubscribe = () => void; +// @public +export function updateEmulatorBanner(name: string, isRunningEmulator: boolean): void; + // Warning: (ae-missing-release-tag) "validateArgCount" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 8547f7bad6c..42fbda3f095 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; +import { + deepEqual, + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -97,13 +102,12 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; - if (!disableWarnings) { - emitEmulatorWarning(); - } - - // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { + updateEmulatorBanner('Auth', true); + // Workaround to get cookies in Firebase Studio void pingServer(`${protocol}//${host}${portStr}`); + } else if (!disableWarnings) { + emitEmulatorWarning(); } } diff --git a/packages/auth/src/platform_browser/index.ts b/packages/auth/src/platform_browser/index.ts index f94525bfeb7..99ab834cbdb 100644 --- a/packages/auth/src/platform_browser/index.ts +++ b/packages/auth/src/platform_browser/index.ts @@ -30,7 +30,11 @@ import { browserSessionPersistence } from './persistence/session_storage'; import { indexedDBLocalPersistence } from './persistence/indexed_db'; import { browserPopupRedirectResolver } from './popup_redirect'; import { Auth, User } from '../model/public_types'; -import { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util'; +import { + getDefaultEmulatorHost, + getExperimentalSetting, + updateEmulatorBanner +} from '@firebase/util'; import { _setExternalJSProvider } from './load_js'; import { _createError } from '../core/util/assert'; import { AuthErrorCode } from '../core/errors'; @@ -110,6 +114,8 @@ export function getAuth(app: FirebaseApp = getApp()): Auth { const authEmulatorHost = getDefaultEmulatorHost('auth'); if (authEmulatorHost) { connectAuthEmulator(auth, `http://${authEmulatorHost}`); + } else { + updateEmulatorBanner('Auth', false); } return auth; diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 515e278b5c5..a94b04518d7 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -31,7 +31,8 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -257,6 +258,10 @@ export class Database implements _FirebaseService { this.app.options['databaseAuthVariableOverride'] ); this._instanceStarted = true; + updateEmulatorBanner( + 'Database', + this._repo.repoInfo_.emulatorOptions !== null + ); } return this._repoInternal; } @@ -393,6 +398,7 @@ export function connectDatabaseEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(host); + updateEmulatorBanner('Database', true); } // Modify the repo to apply emulator settings diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 8e7fdb27e90..fce6d5843b7 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,6 +28,7 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, + updateEmulatorBanner, pingServer } from '@firebase/util'; @@ -142,6 +143,7 @@ export class Firestore implements FirestoreService { _freezeSettings(): FirestoreSettingsImpl { this._settingsFrozen = true; + updateEmulatorBanner('Firestore', this._settings.isUsingEmulator); return this._settings; } @@ -334,9 +336,7 @@ export function connectFirestoreEmulator( emulatorOptions: firestore._getEmulatorOptions() }; const newHostSetting = `${host}:${port}`; - if (useSsl) { - void pingServer(`https://${newHostSetting}`); - } + if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + @@ -357,6 +357,11 @@ export function connectFirestoreEmulator( firestore._setSettings(newConfig); + if (useSsl) { + void pingServer(`https://${newHostSetting}`); + updateEmulatorBanner('Firestore', true); + } + if (options.mockUserToken) { let token: string; let user: User; diff --git a/packages/functions/src/api.ts b/packages/functions/src/api.ts index 7f92cba8343..cb987035145 100644 --- a/packages/functions/src/api.ts +++ b/packages/functions/src/api.ts @@ -29,7 +29,8 @@ import { } from './service'; import { getModularInstance, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + updateEmulatorBanner } from '@firebase/util'; export { FunctionsError } from './error'; @@ -47,6 +48,7 @@ export function getFunctions( app: FirebaseApp = getApp(), regionOrCustomDomain: string = DEFAULT_REGION ): Functions { + updateEmulatorBanner('Functions', false); // Dependencies const functionsProvider: Provider<'functions'> = _getProvider( getModularInstance(app), diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index af9d8898d2e..57504a4c7a4 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,7 +30,11 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { isCloudWorkstation, pingServer } from '@firebase/util'; +import { + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -182,6 +186,7 @@ export function connectFunctionsEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(functionsInstance.emulatorOrigin); + updateEmulatorBanner('Functions', true); } } diff --git a/packages/storage/src/api.ts b/packages/storage/src/api.ts index 84c77ea0c8c..b164a1324c3 100644 --- a/packages/storage/src/api.ts +++ b/packages/storage/src/api.ts @@ -53,7 +53,8 @@ import { STORAGE_TYPE } from './constants'; import { EmulatorMockTokenOptions, getModularInstance, - getDefaultEmulatorHostnameAndPort + getDefaultEmulatorHostnameAndPort, + updateEmulatorBanner } from '@firebase/util'; import { StringFormat } from './implementation/string'; @@ -332,6 +333,7 @@ export function getStorage( bucketUrl?: string ): FirebaseStorage { app = getModularInstance(app); + updateEmulatorBanner('Storage', false); const storageProvider: Provider<'storage'> = _getProvider(app, STORAGE_TYPE); const storageInstance = storageProvider.getImmediate({ identifier: bucketUrl diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 741dd6eaa1a..97d1407bb52 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -46,7 +46,8 @@ import { createMockUserToken, EmulatorMockTokenOptions, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -150,6 +151,7 @@ export function connectStorageEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(`https://${storage.host}`); + updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; diff --git a/packages/util/src/emulator.ts b/packages/util/src/emulator.ts index 2850b5be378..ff09940d88f 100644 --- a/packages/util/src/emulator.ts +++ b/packages/util/src/emulator.ts @@ -16,6 +16,7 @@ */ import { base64urlEncodeWithoutPadding } from './crypt'; +import { isCloudWorkstation } from './url'; // Firebase Auth tokens contain snake_case claims following the JWT standard / convention. /* eslint-disable camelcase */ @@ -140,3 +141,180 @@ export function createMockUserToken( signature ].join('.'); } + +interface EmulatorStatusMap { + [name: string]: boolean; +} +const emulatorStatus: EmulatorStatusMap = {}; + +interface EmulatorSummary { + prod: string[]; + emulator: string[]; +} + +// Checks whether any products are running on an emulator +function getEmulatorSummary(): EmulatorSummary { + const summary: EmulatorSummary = { + prod: [], + emulator: [] + }; + for (const key of Object.keys(emulatorStatus)) { + if (emulatorStatus[key]) { + summary.emulator.push(key); + } else { + summary.prod.push(key); + } + } + return summary; +} + +function getOrCreateEl(id: string): { created: boolean; element: HTMLElement } { + let parentDiv = document.getElementById(id); + let created = false; + if (!parentDiv) { + parentDiv = document.createElement('div'); + parentDiv.setAttribute('id', id); + created = true; + } + return { created, element: parentDiv }; +} + +let previouslyDismissed = false; +/** + * Updates Emulator Banner. Primarily used for Firebase Studio + * @param name + * @param isRunningEmulator + * @public + */ +export function updateEmulatorBanner( + name: string, + isRunningEmulator: boolean +): void { + if ( + typeof window === 'undefined' || + typeof document === 'undefined' || + !isCloudWorkstation(window.location.host) || + emulatorStatus[name] === isRunningEmulator || + emulatorStatus[name] || // If already set to use emulator, can't go back to prod. + previouslyDismissed + ) { + return; + } + + emulatorStatus[name] = isRunningEmulator; + + function prefixedId(id: string): string { + return `__firebase__banner__${id}`; + } + const bannerId = '__firebase__banner'; + const summary = getEmulatorSummary(); + const showError = summary.prod.length > 0; + + function tearDown(): void { + const element = document.getElementById(bannerId); + if (element) { + element.remove(); + } + } + + function setupBannerStyles(bannerEl: HTMLElement): void { + bannerEl.style.display = 'flex'; + bannerEl.style.background = '#7faaf0'; + bannerEl.style.position = 'absolute'; + bannerEl.style.bottom = '5px'; + bannerEl.style.left = '5px'; + bannerEl.style.padding = '.5em'; + bannerEl.style.borderRadius = '5px'; + bannerEl.style.alignItems = 'center'; + } + + function setupIconStyles(prependIcon: SVGElement, iconId: string): void { + prependIcon.setAttribute('width', '24'); + prependIcon.setAttribute('id', iconId); + prependIcon.setAttribute('height', '24'); + prependIcon.setAttribute('viewBox', '0 0 24 24'); + prependIcon.setAttribute('fill', 'none'); + prependIcon.style.marginLeft = '-6px'; + } + + function setupCloseBtn(): HTMLSpanElement { + const closeBtn = document.createElement('span'); + closeBtn.style.cursor = 'pointer'; + closeBtn.style.marginLeft = '16px'; + closeBtn.style.fontSize = '24px'; + closeBtn.innerHTML = ' ×'; + closeBtn.onclick = () => { + previouslyDismissed = true; + tearDown(); + }; + return closeBtn; + } + + function setupLinkStyles( + learnMoreLink: HTMLAnchorElement, + learnMoreId: string + ): void { + learnMoreLink.setAttribute('id', learnMoreId); + learnMoreLink.innerText = 'Learn more'; + learnMoreLink.href = + 'https://firebase.google.com/docs/studio/preview-apps#preview-backend'; + learnMoreLink.setAttribute('target', '__blank'); + learnMoreLink.style.paddingLeft = '5px'; + learnMoreLink.style.textDecoration = 'underline'; + } + + function setupDom(): void { + const banner = getOrCreateEl(bannerId); + const firebaseTextId = prefixedId('text'); + const firebaseText: HTMLSpanElement = + document.getElementById(firebaseTextId) || document.createElement('span'); + const learnMoreId = prefixedId('learnmore'); + const learnMoreLink: HTMLAnchorElement = + (document.getElementById(learnMoreId) as HTMLAnchorElement) || + document.createElement('a'); + const prependIconId = prefixedId('preprendIcon'); + const prependIcon: SVGElement = + (document.getElementById( + prependIconId + ) as HTMLOrSVGElement as SVGElement) || + document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + if (banner.created) { + // update styles + const bannerEl = banner.element; + setupBannerStyles(bannerEl); + setupLinkStyles(learnMoreLink, learnMoreId); + const closeBtn = setupCloseBtn(); + setupIconStyles(prependIcon, prependIconId); + bannerEl.append(prependIcon, firebaseText, learnMoreLink, closeBtn); + document.body.appendChild(bannerEl); + } + + if (showError) { + firebaseText.innerText = `Preview backend disconnected.`; + prependIcon.innerHTML = ` + + + + + + +`; + } else { + prependIcon.innerHTML = ` + + + + + + +`; + firebaseText.innerText = 'Preview backend running in this workspace.'; + } + firebaseText.setAttribute('id', firebaseTextId); + } + if (document.readyState === 'loading') { + window.addEventListener('DOMContentLoaded', setupDom); + } else { + setupDom(); + } +} From bf8c3d18abe5d3707b4b623b78fcf4f200cf62fb Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 13 May 2025 13:52:02 -0700 Subject: [PATCH 192/295] add temporary release branch (#9032) --- .github/workflows/release-staging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index c4adefb44a8..a23cdeb0941 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -30,6 +30,7 @@ on: options: - main - v8 + - at-11-7-1 verbose: description: 'Enable verbose logging' type: boolean From f92069a214f430bcd8d1056e3605fc9eb6e053ed Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 13 May 2025 13:56:30 -0700 Subject: [PATCH 193/295] Allow custom branch for release (#9033) * add temporary release branch --- .github/workflows/release-staging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 2f5cf5eeb38..16d358424a2 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -30,6 +30,7 @@ on: options: - main - v8 + - at-11-7-1 verbose: description: 'Enable verbose logging' type: boolean From 799de5997077b0a277af5f1377083ad407bfcd6c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 13 May 2025 14:23:52 -0700 Subject: [PATCH 194/295] restore Vertex token for temp publish (#9036) --- .github/workflows/canary-deploy.yml | 1 + .github/workflows/prerelease-manual-deploy.yml | 1 + .github/workflows/release-prod.yml | 1 + .github/workflows/release-staging.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/canary-deploy.yml b/.github/workflows/canary-deploy.yml index 318db24f667..4b4cce63761 100644 --- a/.github/workflows/canary-deploy.yml +++ b/.github/workflows/canary-deploy.yml @@ -72,6 +72,7 @@ jobs: NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index d1ab281634c..73e82f11943 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -75,6 +75,7 @@ jobs: NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 3ae667df6be..c89c7934db6 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -85,6 +85,7 @@ jobs: NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 16d358424a2..e75ee4e703d 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -112,6 +112,7 @@ jobs: NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} From 9338d9d160cc2d9eddeb9ff4bb58e895f8cb9ae9 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 14 May 2025 12:08:58 -0700 Subject: [PATCH 195/295] Version Packages (manual PR) (#9034) --- .changeset/three-singers-wonder.md | 10 ---- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 8 ++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 9 ++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 8 ++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 10 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 8 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 10 ++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 10 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 33 +++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 10 ++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 10 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 9 ++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 10 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 ++++ packages/vertexai/package.json | 8 ++-- repo-scripts/size-analysis/package.json | 4 +- 66 files changed, 464 insertions(+), 186 deletions(-) delete mode 100644 .changeset/three-singers-wonder.md diff --git a/.changeset/three-singers-wonder.md b/.changeset/three-singers-wonder.md deleted file mode 100644 index 72dea9d7aa5..00000000000 --- a/.changeset/three-singers-wonder.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@firebase/auth": patch -"@firebase/firestore": patch -"@firebase/util": patch -"@firebase/database": patch -"@firebase/storage": patch -"@firebase/functions": patch ---- - -Add Emulator Overlay diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index c28006dd7d3..ddaf85b0762 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.12.1", - "@firebase/app-compat": "0.3.1", - "@firebase/analytics": "0.10.13", - "@firebase/analytics-compat": "0.2.19", - "@firebase/auth": "1.10.2", - "@firebase/auth-compat": "0.5.22", - "@firebase/functions": "0.12.4", - "@firebase/functions-compat": "0.3.21", - "@firebase/messaging": "0.12.18", - "@firebase/messaging-compat": "0.2.18", - "@firebase/performance": "0.7.3", - "@firebase/performance-compat": "0.2.16", - "@firebase/remote-config": "0.6.1", - "@firebase/remote-config-compat": "0.2.14" + "@firebase/app": "0.12.2", + "@firebase/app-compat": "0.3.2", + "@firebase/analytics": "0.10.14", + "@firebase/analytics-compat": "0.2.20", + "@firebase/auth": "1.10.3", + "@firebase/auth-compat": "0.5.23", + "@firebase/functions": "0.12.5", + "@firebase/functions-compat": "0.3.22", + "@firebase/messaging": "0.12.19", + "@firebase/messaging-compat": "0.2.19", + "@firebase/performance": "0.7.4", + "@firebase/performance-compat": "0.2.17", + "@firebase/remote-config": "0.6.2", + "@firebase/remote-config-compat": "0.2.15" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index ee49ae9734f..8fc6d1c6597 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.12.1", - "@firebase/firestore": "4.7.12" + "@firebase/app": "0.12.2", + "@firebase/firestore": "4.7.13" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index a8f0fd1cf7a..2d8b5431375 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.7.1", + "firebase": "11.7.2", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 0a349c8d806..1c577c35f85 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.20 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/analytics@0.10.14 + - @firebase/component@0.6.15 + ## 0.2.19 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index dc614771cda..ec23086ca6f 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.19", + "version": "0.2.20", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.14", - "@firebase/analytics": "0.10.13", + "@firebase/component": "0.6.15", + "@firebase/analytics": "0.10.14", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 964d404dc9c..75441edf909 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.14 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/installations@0.6.15 + ## 0.10.13 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 3878c34658e..82c989ebdd6 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.13", + "version": "0.10.14", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.14", + "@firebase/installations": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index db793dea557..f23eb3b7cfc 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.23 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/app-check@0.9.2 + - @firebase/component@0.6.15 + ## 0.3.22 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 05be510bdf8..abaee8bf502 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.22", + "version": "0.3.23", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.9.1", + "@firebase/app-check": "0.9.2", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index a3afb0864cb..eaad91dc099 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app-check +## 0.9.2 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.9.1 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 7dc2a2bb139..589adcd1880 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.9.1", + "version": "0.9.2", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index be47b8e2e3b..35d1b7adc88 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.3.2 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/app@0.12.2 + - @firebase/component@0.6.15 + ## 0.3.1 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 725c2fa99b1..fbc7cf5c395 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.3.1", + "version": "0.3.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.12.1", - "@firebase/util": "1.11.1", + "@firebase/app": "0.12.2", + "@firebase/util": "1.11.2", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index c8950255f24..9620acb9518 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app +## 0.12.2 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.12.1 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 24d32c0a686..4f78c2c6699 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.12.1", + "version": "0.12.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index c3d3e3e3983..d0fd0f12faa 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.23 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/auth@1.10.3 + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.5.22 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index d061a5f17a0..7310e55a2e7 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.22", + "version": "0.5.23", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.2", + "@firebase/auth": "1.10.3", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.14", - "@firebase/util": "1.11.1", + "@firebase/component": "0.6.15", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 74d290fead1..2eb6f477f78 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/auth +## 1.10.3 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 1.10.2 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index a58608538db..26f8a4c73db 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.2", + "version": "1.10.3", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 6213c4204ae..b711d33fbdd 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.15 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + ## 0.6.14 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index f3338c83fdc..2297a386eb1 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.14", + "version": "0.6.15", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index c222e97117a..7dca51b9ddd 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 0.3.6 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.3.5 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 2c0c454ff55..3982438f5b8 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.5", + "version": "0.3.6", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 9fde0eac95c..02d06d6f5c4 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.7 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/database@1.0.16 + - @firebase/component@0.6.15 + - @firebase/database-types@1.0.12 + ## 2.0.6 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index ec0e6994468..6b552d78128 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.6", + "version": "2.0.7", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.15", - "@firebase/database-types": "1.0.11", + "@firebase/database": "1.0.16", + "@firebase/database-types": "1.0.12", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index e24ab9364a6..9cef5bc8ef4 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.12 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + ## 1.0.11 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 20565d5c28a..b93ba52dd38 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.11", + "version": "1.0.12", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.11.1" + "@firebase/util": "1.11.2" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 1cfa56fd78e..7fdf8b2ee08 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,15 @@ # Unreleased +## 1.0.16 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 1.0.15 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index e68132857d4..a1fb1e8bd1c 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.15", + "version": "1.0.16", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 3ecab3e54f6..ecb0b1ac653 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,38 @@ # firebase +## 11.7.2 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/auth@1.10.3 + - @firebase/firestore@4.7.13 + - @firebase/util@1.11.2 + - @firebase/database@1.0.16 + - @firebase/storage@0.13.9 + - @firebase/functions@0.12.5 + - @firebase/auth-compat@0.5.23 + - @firebase/firestore-compat@0.3.48 + - @firebase/analytics@0.10.14 + - @firebase/analytics-compat@0.2.20 + - @firebase/app@0.12.2 + - @firebase/app-check@0.9.2 + - @firebase/app-check-compat@0.3.23 + - @firebase/app-compat@0.3.2 + - @firebase/data-connect@0.3.6 + - @firebase/database-compat@2.0.7 + - @firebase/functions-compat@0.3.22 + - @firebase/installations@0.6.15 + - @firebase/installations-compat@0.2.15 + - @firebase/messaging@0.12.19 + - @firebase/messaging-compat@0.2.19 + - @firebase/performance@0.7.4 + - @firebase/performance-compat@0.2.17 + - @firebase/remote-config@0.6.2 + - @firebase/remote-config-compat@0.2.15 + - @firebase/storage-compat@0.3.19 + - @firebase/vertexai@1.2.3 + ## 11.7.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index f4fe3bb2d50..b4edcedca3a 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.7.1", + "version": "11.7.2", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.12.1", - "@firebase/app-compat": "0.3.1", + "@firebase/app": "0.12.2", + "@firebase/app-compat": "0.3.2", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.2", - "@firebase/auth-compat": "0.5.22", - "@firebase/data-connect": "0.3.5", - "@firebase/database": "1.0.15", - "@firebase/database-compat": "2.0.6", - "@firebase/firestore": "4.7.12", - "@firebase/firestore-compat": "0.3.47", - "@firebase/functions": "0.12.4", - "@firebase/functions-compat": "0.3.21", - "@firebase/installations": "0.6.14", - "@firebase/installations-compat": "0.2.14", - "@firebase/messaging": "0.12.18", - "@firebase/messaging-compat": "0.2.18", - "@firebase/storage": "0.13.8", - "@firebase/storage-compat": "0.3.18", - "@firebase/performance": "0.7.3", - "@firebase/performance-compat": "0.2.16", - "@firebase/remote-config": "0.6.1", - "@firebase/remote-config-compat": "0.2.14", - "@firebase/analytics": "0.10.13", - "@firebase/analytics-compat": "0.2.19", - "@firebase/app-check": "0.9.1", - "@firebase/app-check-compat": "0.3.22", - "@firebase/util": "1.11.1", - "@firebase/vertexai": "1.2.2" + "@firebase/auth": "1.10.3", + "@firebase/auth-compat": "0.5.23", + "@firebase/data-connect": "0.3.6", + "@firebase/database": "1.0.16", + "@firebase/database-compat": "2.0.7", + "@firebase/firestore": "4.7.13", + "@firebase/firestore-compat": "0.3.48", + "@firebase/functions": "0.12.5", + "@firebase/functions-compat": "0.3.22", + "@firebase/installations": "0.6.15", + "@firebase/installations-compat": "0.2.15", + "@firebase/messaging": "0.12.19", + "@firebase/messaging-compat": "0.2.19", + "@firebase/storage": "0.13.9", + "@firebase/storage-compat": "0.3.19", + "@firebase/performance": "0.7.4", + "@firebase/performance-compat": "0.2.17", + "@firebase/remote-config": "0.6.2", + "@firebase/remote-config-compat": "0.2.15", + "@firebase/analytics": "0.10.14", + "@firebase/analytics-compat": "0.2.20", + "@firebase/app-check": "0.9.2", + "@firebase/app-check-compat": "0.3.23", + "@firebase/util": "1.11.2", + "@firebase/vertexai": "1.2.3" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index c721b0b7b20..4b05f22a243 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.48 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/firestore@4.7.13 + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.3.47 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 648cf8ee019..29d57083e1a 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.47", + "version": "0.3.48", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.14", - "@firebase/firestore": "4.7.12", - "@firebase/util": "1.11.1", + "@firebase/component": "0.6.15", + "@firebase/firestore": "4.7.13", + "@firebase/util": "1.11.2", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 0fd288b01c8..84bbccd8b8b 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/firestore +## 4.7.13 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 4.7.12 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 38eea5b1505..5ff890803a3 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.12", + "version": "4.7.13", "engines": { "node": ">=18.0.0" }, @@ -98,9 +98,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -110,9 +110,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.1", - "@firebase/app-compat": "0.3.1", - "@firebase/auth": "1.10.2", + "@firebase/app": "0.12.2", + "@firebase/app-compat": "0.3.2", + "@firebase/auth": "1.10.3", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 28a5efc295d..60a92238883 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.22 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/functions@0.12.5 + - @firebase/component@0.6.15 + ## 0.3.21 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 02725731af4..75238014aed 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.21", + "version": "0.3.22", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.14", - "@firebase/functions": "0.12.4", + "@firebase/component": "0.6.15", + "@firebase/functions": "0.12.5", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index c0a54ac71b0..89a0f1cd396 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/functions +## 0.12.5 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.12.4 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index e2e6d9f99fc..560327628a8 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.4", + "version": "0.12.5", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index e34cf0add2a..1e63861c661 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.15 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/installations@0.6.15 + ## 0.2.14 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index ce75757d337..c485f5d1ff2 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.14", + "version": "0.2.15", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.14", + "@firebase/installations": "0.6.15", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 71a9e9757cd..79c23c4ba6f 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.15 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.6.14 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index 32285b7fb1c..f1b21b10b96 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.14", + "version": "0.6.15", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index 61da0c87ed3..e0a157271dc 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.19 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/messaging@0.12.19 + ## 0.2.18 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 1021d98c515..cc134aaf97a 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.18", + "version": "0.2.19", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.18", - "@firebase/component": "0.6.14", - "@firebase/util": "1.11.1", + "@firebase/messaging": "0.12.19", + "@firebase/component": "0.6.15", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", + "@firebase/app-compat": "0.3.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index d0a684dcb8e..9b8472b8520 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.19 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/installations@0.6.15 + ## 0.12.18 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 3d2e70ebfb4..b3b81cf0836 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.18", + "version": "0.12.19", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.14", + "@firebase/installations": "0.6.15", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 56d5b805eef..e0b57fd0f43 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.17 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/performance@0.7.4 + ## 0.2.16 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 37b49ad2455..741ff2f83d0 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.16", + "version": "0.2.17", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.3", + "@firebase/performance": "0.7.4", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.1" + "@firebase/app-compat": "0.3.2" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index b03ece7ed0c..6e3bdfb842f 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.4 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/installations@0.6.15 + ## 0.7.3 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index a6256c12f39..c676fd7ad96 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.3", + "version": "0.7.4", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.14", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/installations": "0.6.15", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 01ed6bc0cef..ec5e443efe8 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.15 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/remote-config@0.6.2 + ## 0.2.14 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 9839182086c..3d8e22e6dbf 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.14", + "version": "0.2.15", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.1", + "@firebase/remote-config": "0.6.2", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.1" + "@firebase/app-compat": "0.3.2" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 4a209ee5e38..640f6c34f4d 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config +## 0.6.2 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + - @firebase/installations@0.6.15 + ## 0.6.1 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 1b068256178..4f1fe85e9f8 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.1", + "version": "0.6.2", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.14", + "@firebase/installations": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 309cd864964..31689803f0a 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.19 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/storage@0.13.9 + - @firebase/component@0.6.15 + ## 0.3.18 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index fe7b9772ec0..445b13d5045 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.18", + "version": "0.3.19", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.8", + "@firebase/storage": "0.13.9", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.1", - "@firebase/auth-compat": "0.5.22", + "@firebase/app-compat": "0.3.2", + "@firebase/auth-compat": "0.5.23", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 7636c13260d..e18aa9af7b3 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,15 @@ #Unreleased +## 0.13.9 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 0.13.8 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 963ad3e86d6..5b3e9bb871d 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.8", + "version": "0.13.9", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.11.1", - "@firebase/component": "0.6.14", + "@firebase/util": "1.11.2", + "@firebase/component": "0.6.15", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.1", - "@firebase/auth": "1.10.2", + "@firebase/app": "0.12.2", + "@firebase/auth": "1.10.3", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 7f5bf9cb1bd..d8d49446172 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 5a33cbad42b..79857db4665 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.11.2 + +### Patch Changes + +- [`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24) [#9031](https://github.com/firebase/firebase-js-sdk/pull/9031) - Add Emulator Overlay + ## 1.11.1 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index 8d8c85b3f2e..61ea91f5a6c 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.11.1", + "version": "1.11.2", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 8fa9e9d4b4a..168841c958c 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.2.3 + +### Patch Changes + +- Updated dependencies [[`8593fa0`](https://github.com/firebase/firebase-js-sdk/commit/8593fa05bd884c2f1f6f3b4ae062efa48af93d24)]: + - @firebase/util@1.11.2 + - @firebase/component@0.6.15 + ## 1.2.2 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 0c6b24fc495..e8a7e4e6d09 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.2.2", + "version": "1.2.3", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.14", + "@firebase/component": "0.6.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 85590c3c77d..fa4b0eca4fd 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.1", + "@firebase/app": "0.12.2", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.1", + "@firebase/util": "1.11.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 9bcd1ea9b8cc5b55692765d40df000da8ddef02b Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 14 May 2025 15:09:28 -0700 Subject: [PATCH 196/295] Fixed scroll behavior (#9043) --- .changeset/two-donkeys-cry.md | 5 +++++ packages/util/src/emulator.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/two-donkeys-cry.md diff --git a/.changeset/two-donkeys-cry.md b/.changeset/two-donkeys-cry.md new file mode 100644 index 00000000000..5462fdcc941 --- /dev/null +++ b/.changeset/two-donkeys-cry.md @@ -0,0 +1,5 @@ +--- +"@firebase/util": patch +--- + +Fixed emulator overlay behavior on scroll diff --git a/packages/util/src/emulator.ts b/packages/util/src/emulator.ts index ff09940d88f..1c4d4ae7a7d 100644 --- a/packages/util/src/emulator.ts +++ b/packages/util/src/emulator.ts @@ -220,7 +220,7 @@ export function updateEmulatorBanner( function setupBannerStyles(bannerEl: HTMLElement): void { bannerEl.style.display = 'flex'; bannerEl.style.background = '#7faaf0'; - bannerEl.style.position = 'absolute'; + bannerEl.style.position = 'fixed'; bannerEl.style.bottom = '5px'; bannerEl.style.left = '5px'; bannerEl.style.padding = '.5em'; From 8601ecb6e847343ded621353a4ad6dc43912c9a9 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 14 May 2025 15:58:47 -0700 Subject: [PATCH 197/295] Version Packages (manual PR) (#9044) --- .changeset/two-donkeys-cry.md | 5 -- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 8 ++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 9 ++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 8 ++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 8 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 8 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 10 ++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 8 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 33 +++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 8 ++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 8 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 9 ++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 8 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- packages/vertexai/CHANGELOG.md | 8 ++++ packages/vertexai/package.json | 8 ++-- repo-scripts/size-analysis/package.json | 4 +- 66 files changed, 454 insertions(+), 181 deletions(-) delete mode 100644 .changeset/two-donkeys-cry.md diff --git a/.changeset/two-donkeys-cry.md b/.changeset/two-donkeys-cry.md deleted file mode 100644 index 5462fdcc941..00000000000 --- a/.changeset/two-donkeys-cry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/util": patch ---- - -Fixed emulator overlay behavior on scroll diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index ddaf85b0762..7b97998233e 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.12.2", - "@firebase/app-compat": "0.3.2", - "@firebase/analytics": "0.10.14", - "@firebase/analytics-compat": "0.2.20", - "@firebase/auth": "1.10.3", - "@firebase/auth-compat": "0.5.23", - "@firebase/functions": "0.12.5", - "@firebase/functions-compat": "0.3.22", - "@firebase/messaging": "0.12.19", - "@firebase/messaging-compat": "0.2.19", - "@firebase/performance": "0.7.4", - "@firebase/performance-compat": "0.2.17", - "@firebase/remote-config": "0.6.2", - "@firebase/remote-config-compat": "0.2.15" + "@firebase/app": "0.12.3", + "@firebase/app-compat": "0.3.3", + "@firebase/analytics": "0.10.15", + "@firebase/analytics-compat": "0.2.21", + "@firebase/auth": "1.10.4", + "@firebase/auth-compat": "0.5.24", + "@firebase/functions": "0.12.6", + "@firebase/functions-compat": "0.3.23", + "@firebase/messaging": "0.12.20", + "@firebase/messaging-compat": "0.2.20", + "@firebase/performance": "0.7.5", + "@firebase/performance-compat": "0.2.18", + "@firebase/remote-config": "0.6.3", + "@firebase/remote-config-compat": "0.2.16" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 8fc6d1c6597..dac850a09b3 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.12.2", - "@firebase/firestore": "4.7.13" + "@firebase/app": "0.12.3", + "@firebase/firestore": "4.7.14" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 2d8b5431375..f883f54f098 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.7.2", + "firebase": "11.7.3", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 1c577c35f85..e950b6ad5eb 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.21 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/analytics@0.10.15 + - @firebase/component@0.6.16 + ## 0.2.20 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ec23086ca6f..fc86eff94ff 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.20", + "version": "0.2.21", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.15", - "@firebase/analytics": "0.10.14", + "@firebase/component": "0.6.16", + "@firebase/analytics": "0.10.15", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 75441edf909..06548ecd2cd 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.15 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/installations@0.6.16 + ## 0.10.14 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 82c989ebdd6..2ffd405cc81 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.14", + "version": "0.10.15", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.15", + "@firebase/installations": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index f23eb3b7cfc..825cf013e08 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.24 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/app-check@0.9.3 + - @firebase/component@0.6.16 + ## 0.3.23 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index abaee8bf502..e2e214c2d24 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.23", + "version": "0.3.24", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.9.2", + "@firebase/app-check": "0.9.3", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index eaad91dc099..d7e6fdf6446 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app-check +## 0.9.3 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.9.2 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 589adcd1880..25b27f90ca4 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.9.2", + "version": "0.9.3", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 35d1b7adc88..38ae80099ea 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.3.3 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/app@0.12.3 + - @firebase/component@0.6.16 + ## 0.3.2 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index fbc7cf5c395..a0e0b89a9fc 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.3.2", + "version": "0.3.3", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.12.2", - "@firebase/util": "1.11.2", + "@firebase/app": "0.12.3", + "@firebase/util": "1.11.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 9620acb9518..10a196ca0fa 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app +## 0.12.3 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.12.2 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 4f78c2c6699..07e70ba14ec 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.12.2", + "version": "0.12.3", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index d0fd0f12faa..97ec10f7a77 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.24 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/auth@1.10.4 + - @firebase/component@0.6.16 + ## 0.5.23 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 7310e55a2e7..c244b8e3f7a 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.23", + "version": "0.5.24", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.3", + "@firebase/auth": "1.10.4", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.15", - "@firebase/util": "1.11.2", + "@firebase/component": "0.6.16", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 2eb6f477f78..9999db32429 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.10.4 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 1.10.3 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 26f8a4c73db..deb2006f9b9 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.3", + "version": "1.10.4", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index b711d33fbdd..5dca079098c 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.16 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + ## 0.6.15 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index 2297a386eb1..cb0e6a336d2 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.15", + "version": "0.6.16", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 7dca51b9ddd..5e9eb3532bb 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 0.3.7 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.3.6 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 3982438f5b8..f4dfa7e0863 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.6", + "version": "0.3.7", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 02d06d6f5c4..1dab50a408f 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.8 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/database@1.0.17 + - @firebase/database-types@1.0.13 + ## 2.0.7 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 6b552d78128..d24167a9965 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.7", + "version": "2.0.8", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.16", - "@firebase/database-types": "1.0.12", + "@firebase/database": "1.0.17", + "@firebase/database-types": "1.0.13", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 9cef5bc8ef4..b2be70c2efc 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.13 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + ## 1.0.12 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index b93ba52dd38..f6cbb176699 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.12", + "version": "1.0.13", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.11.2" + "@firebase/util": "1.11.3" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 7fdf8b2ee08..ea27ec478d8 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Unreleased +## 1.0.17 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 1.0.16 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index a1fb1e8bd1c..719469d5cca 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.16", + "version": "1.0.17", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index ecb0b1ac653..ed42e9ee853 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,38 @@ # firebase +## 11.7.3 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/analytics@0.10.15 + - @firebase/analytics-compat@0.2.21 + - @firebase/app@0.12.3 + - @firebase/app-check@0.9.3 + - @firebase/app-check-compat@0.3.24 + - @firebase/app-compat@0.3.3 + - @firebase/auth@1.10.4 + - @firebase/auth-compat@0.5.24 + - @firebase/data-connect@0.3.7 + - @firebase/database@1.0.17 + - @firebase/database-compat@2.0.8 + - @firebase/firestore@4.7.14 + - @firebase/firestore-compat@0.3.49 + - @firebase/functions@0.12.6 + - @firebase/functions-compat@0.3.23 + - @firebase/installations@0.6.16 + - @firebase/installations-compat@0.2.16 + - @firebase/messaging@0.12.20 + - @firebase/messaging-compat@0.2.20 + - @firebase/performance@0.7.5 + - @firebase/performance-compat@0.2.18 + - @firebase/remote-config@0.6.3 + - @firebase/remote-config-compat@0.2.16 + - @firebase/storage@0.13.10 + - @firebase/storage-compat@0.3.20 + - @firebase/vertexai@1.2.4 + ## 11.7.2 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index b4edcedca3a..da489e837ea 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.7.2", + "version": "11.7.3", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.12.2", - "@firebase/app-compat": "0.3.2", + "@firebase/app": "0.12.3", + "@firebase/app-compat": "0.3.3", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.3", - "@firebase/auth-compat": "0.5.23", - "@firebase/data-connect": "0.3.6", - "@firebase/database": "1.0.16", - "@firebase/database-compat": "2.0.7", - "@firebase/firestore": "4.7.13", - "@firebase/firestore-compat": "0.3.48", - "@firebase/functions": "0.12.5", - "@firebase/functions-compat": "0.3.22", - "@firebase/installations": "0.6.15", - "@firebase/installations-compat": "0.2.15", - "@firebase/messaging": "0.12.19", - "@firebase/messaging-compat": "0.2.19", - "@firebase/storage": "0.13.9", - "@firebase/storage-compat": "0.3.19", - "@firebase/performance": "0.7.4", - "@firebase/performance-compat": "0.2.17", - "@firebase/remote-config": "0.6.2", - "@firebase/remote-config-compat": "0.2.15", - "@firebase/analytics": "0.10.14", - "@firebase/analytics-compat": "0.2.20", - "@firebase/app-check": "0.9.2", - "@firebase/app-check-compat": "0.3.23", - "@firebase/util": "1.11.2", - "@firebase/vertexai": "1.2.3" + "@firebase/auth": "1.10.4", + "@firebase/auth-compat": "0.5.24", + "@firebase/data-connect": "0.3.7", + "@firebase/database": "1.0.17", + "@firebase/database-compat": "2.0.8", + "@firebase/firestore": "4.7.14", + "@firebase/firestore-compat": "0.3.49", + "@firebase/functions": "0.12.6", + "@firebase/functions-compat": "0.3.23", + "@firebase/installations": "0.6.16", + "@firebase/installations-compat": "0.2.16", + "@firebase/messaging": "0.12.20", + "@firebase/messaging-compat": "0.2.20", + "@firebase/storage": "0.13.10", + "@firebase/storage-compat": "0.3.20", + "@firebase/performance": "0.7.5", + "@firebase/performance-compat": "0.2.18", + "@firebase/remote-config": "0.6.3", + "@firebase/remote-config-compat": "0.2.16", + "@firebase/analytics": "0.10.15", + "@firebase/analytics-compat": "0.2.21", + "@firebase/app-check": "0.9.3", + "@firebase/app-check-compat": "0.3.24", + "@firebase/util": "1.11.3", + "@firebase/vertexai": "1.2.4" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 4b05f22a243..f22abcaf049 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.49 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/firestore@4.7.14 + ## 0.3.48 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 29d57083e1a..e2243ccba9f 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.48", + "version": "0.3.49", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.15", - "@firebase/firestore": "4.7.13", - "@firebase/util": "1.11.2", + "@firebase/component": "0.6.16", + "@firebase/firestore": "4.7.14", + "@firebase/util": "1.11.3", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 84bbccd8b8b..19144f16afd 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/firestore +## 4.7.14 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 4.7.13 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 5ff890803a3..7c4a27a291b 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.13", + "version": "4.7.14", "engines": { "node": ">=18.0.0" }, @@ -98,9 +98,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -110,9 +110,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.2", - "@firebase/app-compat": "0.3.2", - "@firebase/auth": "1.10.3", + "@firebase/app": "0.12.3", + "@firebase/app-compat": "0.3.3", + "@firebase/auth": "1.10.4", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 60a92238883..991f41c0868 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.23 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/functions@0.12.6 + ## 0.3.22 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 75238014aed..60d1ffacfbc 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.22", + "version": "0.3.23", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.15", - "@firebase/functions": "0.12.5", + "@firebase/component": "0.6.16", + "@firebase/functions": "0.12.6", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index 89a0f1cd396..a63cd968b70 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.6 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.12.5 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 560327628a8..6fde3987e75 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.5", + "version": "0.12.6", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 1e63861c661..c46d91d70ab 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.16 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/installations@0.6.16 + ## 0.2.15 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index c485f5d1ff2..73b318577ce 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.15", + "version": "0.2.16", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.15", + "@firebase/installations": "0.6.16", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 79c23c4ba6f..035655cf96f 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.16 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.6.15 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index f1b21b10b96..bd35c91a7ee 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.15", + "version": "0.6.16", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index e0a157271dc..cafca2b6ec5 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.20 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/messaging@0.12.20 + ## 0.2.19 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index cc134aaf97a..4f36674d8ef 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.19", + "version": "0.2.20", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.19", - "@firebase/component": "0.6.15", - "@firebase/util": "1.11.2", + "@firebase/messaging": "0.12.20", + "@firebase/component": "0.6.16", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", + "@firebase/app-compat": "0.3.3", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 9b8472b8520..c8b10a8e5d1 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.20 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/installations@0.6.16 + ## 0.12.19 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index b3b81cf0836..c412ba5eecc 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.19", + "version": "0.12.20", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.15", + "@firebase/installations": "0.6.16", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index e0b57fd0f43..ee1ed073fdb 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.18 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/performance@0.7.5 + ## 0.2.17 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 741ff2f83d0..71286577acc 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.17", + "version": "0.2.18", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.4", + "@firebase/performance": "0.7.5", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.2" + "@firebase/app-compat": "0.3.3" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index 6e3bdfb842f..fe169a3ad39 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.5 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/installations@0.6.16 + ## 0.7.4 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index c676fd7ad96..e7a9fed6020 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.4", + "version": "0.7.5", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.15", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/installations": "0.6.16", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index ec5e443efe8..d2bdfb1fac2 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.16 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/remote-config@0.6.3 + ## 0.2.15 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 3d8e22e6dbf..7d2e5483efe 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.15", + "version": "0.2.16", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.2", + "@firebase/remote-config": "0.6.3", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.2" + "@firebase/app-compat": "0.3.3" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 640f6c34f4d..07fe5cc9605 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config +## 0.6.3 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/installations@0.6.16 + ## 0.6.2 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 4f1fe85e9f8..ffa93164d3a 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.2", + "version": "0.6.3", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.15", + "@firebase/installations": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 31689803f0a..a9a3f9e1621 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.20 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + - @firebase/storage@0.13.10 + ## 0.3.19 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 445b13d5045..046b0a79563 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.19", + "version": "0.3.20", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.9", + "@firebase/storage": "0.13.10", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.2", - "@firebase/auth-compat": "0.5.23", + "@firebase/app-compat": "0.3.3", + "@firebase/auth-compat": "0.5.24", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index e18aa9af7b3..2872e5a792b 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.10 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 0.13.9 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 5b3e9bb871d..9c5a738bee1 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.9", + "version": "0.13.10", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.11.2", - "@firebase/component": "0.6.15", + "@firebase/util": "1.11.3", + "@firebase/component": "0.6.16", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.2", - "@firebase/auth": "1.10.3", + "@firebase/app": "0.12.3", + "@firebase/auth": "1.10.4", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index d8d49446172..5d8c84d3566 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 79857db4665..9eaaa3415e4 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.11.3 + +### Patch Changes + +- [`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b) [#9043](https://github.com/firebase/firebase-js-sdk/pull/9043) - Fixed emulator overlay behavior on scroll + ## 1.11.2 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index 61ea91f5a6c..4e50552bb2f 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.11.2", + "version": "1.11.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index 168841c958c..d1f30760110 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/vertexai +## 1.2.4 + +### Patch Changes + +- Updated dependencies [[`9bcd1ea`](https://github.com/firebase/firebase-js-sdk/commit/9bcd1ea9b8cc5b55692765d40df000da8ddef02b)]: + - @firebase/util@1.11.3 + - @firebase/component@0.6.16 + ## 1.2.3 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index e8a7e4e6d09..54e928d0f77 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/vertexai", - "version": "1.2.3", + "version": "1.2.4", "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.15", + "@firebase/component": "0.6.16", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index fa4b0eca4fd..09b6cc14ca6 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.2", + "@firebase/app": "0.12.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.2", + "@firebase/util": "1.11.3", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 5b539058e150a3a1fea72850fe967b3bb60ec69f Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 15 May 2025 09:26:28 -0700 Subject: [PATCH 198/295] Remove redundant changeset --- .changeset/three-singers-wonder.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .changeset/three-singers-wonder.md diff --git a/.changeset/three-singers-wonder.md b/.changeset/three-singers-wonder.md deleted file mode 100644 index 72dea9d7aa5..00000000000 --- a/.changeset/three-singers-wonder.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@firebase/auth": patch -"@firebase/firestore": patch -"@firebase/util": patch -"@firebase/database": patch -"@firebase/storage": patch -"@firebase/functions": patch ---- - -Add Emulator Overlay From 880110bbac7868419fad447fc191d8f1d7ada38d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 15 May 2025 10:13:03 -0700 Subject: [PATCH 199/295] Update e2e tests to reflect AI package and new API (#9017) --- e2e/package.json | 2 +- e2e/sample-apps/modular.js | 16 +- e2e/tests/modular.test.ts | 15 +- e2e/yarn.lock | 2189 ++++++++++++++++++------------------ 4 files changed, 1136 insertions(+), 1086 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 189479017e4..ca33e7f696f 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -17,7 +17,7 @@ "author": "", "license": "ISC", "dependencies": { - "firebase": "11.3.0" + "firebase": "^11.8.0-20250512211235" }, "devDependencies": { "@babel/core": "7.26.8", diff --git a/e2e/sample-apps/modular.js b/e2e/sample-apps/modular.js index 9e943e04494..d01b5b0139d 100644 --- a/e2e/sample-apps/modular.js +++ b/e2e/sample-apps/modular.js @@ -58,7 +58,7 @@ import { onValue, off } from 'firebase/database'; -import { getGenerativeModel, getVertexAI, VertexAI } from 'firebase/vertexai'; +import { getGenerativeModel, getAI, VertexAIBackend } from 'firebase/ai'; import { getDataConnect, DataConnect } from 'firebase/data-connect'; /** @@ -307,15 +307,15 @@ function callPerformance(app) { } /** - * VertexAI smoke test. + * AI smoke test. * Just make sure some functions can be called without obvious errors. */ -async function callVertexAI(app) { - console.log('[VERTEXAI] start'); - const vertexAI = getVertexAI(app); - const model = getGenerativeModel(vertexAI, { model: 'gemini-1.5-flash' }); +async function callAI(app) { + console.log('[AI] start'); + const ai = getAI(app, { backend: new VertexAIBackend() }); + const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' }); const result = await model.countTokens('abcdefg'); - console.log(`[VERTEXAI] counted tokens: ${result.totalTokens}`); + console.log(`[AI] counted tokens: ${result.totalTokens}`); } /** @@ -350,7 +350,7 @@ async function main() { callAnalytics(app); callPerformance(app); await callFunctions(app); - await callVertexAI(app); + await callAI(app); callDataConnect(app); await authLogout(app); console.log('DONE'); diff --git a/e2e/tests/modular.test.ts b/e2e/tests/modular.test.ts index 005fadef19a..c6cd0b88c8e 100644 --- a/e2e/tests/modular.test.ts +++ b/e2e/tests/modular.test.ts @@ -86,7 +86,12 @@ import { StorageReference, deleteObject } from 'firebase/storage'; -import { getGenerativeModel, getVertexAI, VertexAI } from 'firebase/vertexai'; +import { + getGenerativeModel, + getAI, + AI, + VertexAIBackend +} from 'firebase/vertexai'; import { getDataConnect, DataConnect } from 'firebase/data-connect'; import { config, testAccount } from '../firebase-config'; import 'jest'; @@ -307,13 +312,13 @@ describe('MODULAR', () => { }); }); - describe('VERTEXAI', () => { - let vertexAI: VertexAI; + describe('AI', () => { + let ai: AI; it('getVertexAI()', () => { - vertexAI = getVertexAI(app); + ai = getAI(app, { backend: new VertexAIBackend() }); }); it('getGenerativeModel() and countTokens()', async () => { - const model = getGenerativeModel(vertexAI, { model: 'gemini-1.5-flash' }); + const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' }); expect(model.model).toMatch(/gemini-1.5-flash$/); const result = await model.countTokens('abcdefg'); expect(result.totalTokens).toBeTruthy; diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 08a958955b7..c20459aecdd 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -4,7 +4,7 @@ "@ampproject/remapping@^2.2.0": version "2.3.0" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz" integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== dependencies: "@jridgewell/gen-mapping" "^0.3.5" @@ -12,16 +12,25 @@ "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": version "7.26.2" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz" integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== dependencies: "@babel/helper-validator-identifier" "^7.25.9" js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": +"@babel/code-frame@^7.25.9": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz#9374b5cd068d128dac0b94ff482594273b1c2815" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz" + integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/code-frame@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz" integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== dependencies: "@babel/helper-validator-identifier" "^7.25.9" @@ -30,17 +39,17 @@ "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== "@babel/compat-data@^7.26.5", "@babel/compat-data@^7.26.8": version "7.26.8" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz#821c1d35641c355284d4a870b8a4a7b0c141e367" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz" integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== -"@babel/core@7.26.8": +"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.0.0-0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.12.0", "@babel/core@^7.13.0", "@babel/core@^7.4.0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.8.0", "@babel/core@7.26.8": version "7.26.8" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz#7742f11c75acea6b08a8e24c5c0c8c89e89bf53e" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz" integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== dependencies: "@ampproject/remapping" "^2.2.0" @@ -60,9 +69,51 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": +"@babel/core@^7.11.6": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.12.3": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.23.9": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== dependencies: "@ampproject/remapping" "^2.2.0" @@ -83,7 +134,7 @@ "@babel/generator@^7.25.9", "@babel/generator@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz#505cc7c90d92513f458a477e5ef0703e7c91b8d7" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz" integrity sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w== dependencies: "@babel/parser" "^7.26.0" @@ -94,7 +145,7 @@ "@babel/generator@^7.26.8", "@babel/generator@^7.26.9": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz#75a9482ad3d0cc7188a537aa4910bc59db67cbca" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz" integrity sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg== dependencies: "@babel/parser" "^7.26.9" @@ -105,7 +156,7 @@ "@babel/generator@^7.7.2": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz" integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== dependencies: "@babel/parser" "^7.26.3" @@ -116,14 +167,14 @@ "@babel/helper-annotate-as-pure@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz" integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== dependencies: "@babel/types" "^7.25.9" "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz" integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== dependencies: "@babel/compat-data" "^7.25.9" @@ -134,7 +185,7 @@ "@babel/helper-compilation-targets@^7.26.5": version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz#75d92bb8d8d51301c0d49e52a65c9a7fe94514d8" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz" integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== dependencies: "@babel/compat-data" "^7.26.5" @@ -145,7 +196,7 @@ "@babel/helper-create-class-features-plugin@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz" integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -158,7 +209,7 @@ "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz#3e8999db94728ad2b2458d7a470e7770b7764e26" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz" integrity sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -167,7 +218,7 @@ "@babel/helper-define-polyfill-provider@^0.6.2": version "0.6.2" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz#18594f789c3594acb24cfdb4a7f7b7d2e8bd912d" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz" integrity sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ== dependencies: "@babel/helper-compilation-targets" "^7.22.6" @@ -178,7 +229,7 @@ "@babel/helper-define-polyfill-provider@^0.6.3": version "0.6.3" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz" integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== dependencies: "@babel/helper-compilation-targets" "^7.22.6" @@ -189,7 +240,7 @@ "@babel/helper-member-expression-to-functions@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz" integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== dependencies: "@babel/traverse" "^7.25.9" @@ -197,7 +248,7 @@ "@babel/helper-module-imports@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz" integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== dependencies: "@babel/traverse" "^7.25.9" @@ -205,7 +256,7 @@ "@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz" integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== dependencies: "@babel/helper-module-imports" "^7.25.9" @@ -214,24 +265,24 @@ "@babel/helper-optimise-call-expression@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz" integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== dependencies: "@babel/types" "^7.25.9" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== "@babel/helper-plugin-utils@^7.26.5": version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz#18580d00c9934117ad719392c4f6585c9333cc35" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz" integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== "@babel/helper-remap-async-to-generator@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" + resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz" integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -240,7 +291,7 @@ "@babel/helper-replace-supers@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz" integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== dependencies: "@babel/helper-member-expression-to-functions" "^7.25.9" @@ -249,7 +300,7 @@ "@babel/helper-simple-access@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz" integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== dependencies: "@babel/traverse" "^7.25.9" @@ -257,7 +308,7 @@ "@babel/helper-skip-transparent-expression-wrappers@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" + resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz" integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== dependencies: "@babel/traverse" "^7.25.9" @@ -265,22 +316,22 @@ "@babel/helper-string-parser@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz" integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== "@babel/helper-validator-identifier@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz" integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== "@babel/helper-validator-option@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz" integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== "@babel/helper-wrap-function@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz" integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== dependencies: "@babel/template" "^7.25.9" @@ -289,7 +340,7 @@ "@babel/helpers@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz" integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== dependencies: "@babel/template" "^7.25.9" @@ -297,36 +348,50 @@ "@babel/helpers@^7.26.7": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz#28f3fb45252fc88ef2dc547c8a911c255fc9fef6" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz" integrity sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA== dependencies: "@babel/template" "^7.26.9" "@babel/types" "^7.26.9" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz" integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== dependencies: "@babel/types" "^7.26.3" -"@babel/parser@^7.25.9", "@babel/parser@^7.26.0": +"@babel/parser@^7.25.9": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz#710a75a7d805a8f72753154e451474e9795b121c" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz" integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== dependencies: "@babel/types" "^7.26.0" +"@babel/parser@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz" + integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== + dependencies: + "@babel/types" "^7.26.0" + +"@babel/parser@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== + dependencies: + "@babel/types" "^7.26.3" + "@babel/parser@^7.26.8", "@babel/parser@^7.26.9": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz#d9e78bee6dc80f9efd8f2349dcfbbcdace280fd5" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz" integrity sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A== dependencies: "@babel/types" "^7.26.9" "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz" integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -334,21 +399,21 @@ "@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz" integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz" integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz" integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -357,7 +422,7 @@ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz" integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -365,138 +430,138 @@ "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz" integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-bigint@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-class-static-block@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-assertions@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz" integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-import-attributes@^7.24.7", "@babel/plugin-syntax-import-attributes@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz" integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.25.9", "@babel/plugin-syntax-jsx@^7.7.2": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz" integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-private-property-in-object@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.25.9", "@babel/plugin-syntax-typescript@^7.7.2": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz" integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz" integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" @@ -504,14 +569,14 @@ "@babel/plugin-transform-arrow-functions@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz" integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-async-generator-functions@^7.26.8": version "7.26.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz#5e3991135e3b9c6eaaf5eff56d1ae5a11df45ff8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.26.8.tgz" integrity sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg== dependencies: "@babel/helper-plugin-utils" "^7.26.5" @@ -520,7 +585,7 @@ "@babel/plugin-transform-async-to-generator@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz" integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== dependencies: "@babel/helper-module-imports" "^7.25.9" @@ -529,21 +594,21 @@ "@babel/plugin-transform-block-scoped-functions@^7.26.5": version "7.26.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz#3dc4405d31ad1cbe45293aa57205a6e3b009d53e" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz" integrity sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ== dependencies: "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-block-scoping@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz" integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-class-properties@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz" integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== dependencies: "@babel/helper-create-class-features-plugin" "^7.25.9" @@ -551,7 +616,7 @@ "@babel/plugin-transform-class-static-block@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz" integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== dependencies: "@babel/helper-create-class-features-plugin" "^7.25.9" @@ -559,7 +624,7 @@ "@babel/plugin-transform-classes@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz" integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -571,7 +636,7 @@ "@babel/plugin-transform-computed-properties@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz" integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -579,14 +644,14 @@ "@babel/plugin-transform-destructuring@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz" integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-dotall-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz" integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -594,14 +659,14 @@ "@babel/plugin-transform-duplicate-keys@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz" integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz" integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -609,28 +674,28 @@ "@babel/plugin-transform-dynamic-import@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz" integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-exponentiation-operator@^7.26.3": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz" integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-export-namespace-from@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" + resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz" integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-for-of@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz" integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -638,7 +703,7 @@ "@babel/plugin-transform-function-name@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz" integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== dependencies: "@babel/helper-compilation-targets" "^7.25.9" @@ -647,35 +712,35 @@ "@babel/plugin-transform-json-strings@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" + resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz" integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-literals@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz" integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-logical-assignment-operators@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" + resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz" integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-member-expression-literals@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz" integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-modules-amd@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz" integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== dependencies: "@babel/helper-module-transforms" "^7.25.9" @@ -683,7 +748,7 @@ "@babel/plugin-transform-modules-commonjs@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz#d165c8c569a080baf5467bda88df6425fc060686" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz" integrity sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg== dependencies: "@babel/helper-module-transforms" "^7.25.9" @@ -692,7 +757,7 @@ "@babel/plugin-transform-modules-commonjs@^7.26.3": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz" integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== dependencies: "@babel/helper-module-transforms" "^7.26.0" @@ -700,7 +765,7 @@ "@babel/plugin-transform-modules-systemjs@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz" integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== dependencies: "@babel/helper-module-transforms" "^7.25.9" @@ -710,7 +775,7 @@ "@babel/plugin-transform-modules-umd@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz" integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== dependencies: "@babel/helper-module-transforms" "^7.25.9" @@ -718,7 +783,7 @@ "@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz" integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -726,28 +791,28 @@ "@babel/plugin-transform-new-target@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz" integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-nullish-coalescing-operator@^7.26.6": version "7.26.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz#fbf6b3c92cb509e7b319ee46e3da89c5bedd31fe" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz" integrity sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw== dependencies: "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-numeric-separator@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" + resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz" integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-object-rest-spread@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz" integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== dependencies: "@babel/helper-compilation-targets" "^7.25.9" @@ -756,7 +821,7 @@ "@babel/plugin-transform-object-super@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz" integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -764,14 +829,14 @@ "@babel/plugin-transform-optional-catch-binding@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz" integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-optional-chaining@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz" integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -779,14 +844,14 @@ "@babel/plugin-transform-parameters@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz" integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-private-methods@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz" integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== dependencies: "@babel/helper-create-class-features-plugin" "^7.25.9" @@ -794,7 +859,7 @@ "@babel/plugin-transform-private-property-in-object@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz" integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -803,14 +868,14 @@ "@babel/plugin-transform-property-literals@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz" integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-regenerator@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz" integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -818,7 +883,7 @@ "@babel/plugin-transform-regexp-modifiers@^7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz" integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -826,21 +891,21 @@ "@babel/plugin-transform-reserved-words@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz" integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-shorthand-properties@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz" integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-spread@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz" integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -848,28 +913,28 @@ "@babel/plugin-transform-sticky-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz" integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-template-literals@^7.26.8": version "7.26.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz#966b15d153a991172a540a69ad5e1845ced990b5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.26.8.tgz" integrity sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q== dependencies: "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typeof-symbol@^7.26.7": version "7.26.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz#d0e33acd9223744c1e857dbd6fa17bd0a3786937" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz" integrity sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw== dependencies: "@babel/helper-plugin-utils" "^7.26.5" "@babel/plugin-transform-typescript@^7.25.9": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.3.tgz#3d6add9c78735623317387ee26d5ada540eee3fd" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.3.tgz" integrity sha512-6+5hpdr6mETwSKjmJUdYw0EIkATiQhnELWlE3kJFBwSg/BGIVwVaVbX+gOXBCdc7Ln1RXZxyWGecIXhUfnl7oA== dependencies: "@babel/helper-annotate-as-pure" "^7.25.9" @@ -880,14 +945,14 @@ "@babel/plugin-transform-unicode-escapes@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz" integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== dependencies: "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-transform-unicode-property-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz" integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -895,7 +960,7 @@ "@babel/plugin-transform-unicode-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz" integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -903,7 +968,7 @@ "@babel/plugin-transform-unicode-sets-regex@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz" integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.25.9" @@ -911,7 +976,7 @@ "@babel/preset-env@7.26.8": version "7.26.8" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz#7af0090829b606d2046db99679004731e1dc364d" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.8.tgz" integrity sha512-um7Sy+2THd697S4zJEfv/U5MHGJzkN2xhtsR3T/SWRbVSic62nbISh51VVfU9JiO/L/Z97QczHTaFVkOU8IzNg== dependencies: "@babel/compat-data" "^7.26.8" @@ -986,7 +1051,7 @@ "@babel/preset-modules@0.1.6-no-external-plugins": version "0.1.6-no-external-plugins" - resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz" integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -995,7 +1060,7 @@ "@babel/preset-typescript@7.26.0": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz#4a570f1b8d104a242d923957ffa1eaff142a106d" + resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz" integrity sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg== dependencies: "@babel/helper-plugin-utils" "^7.25.9" @@ -1006,14 +1071,14 @@ "@babel/runtime@^7.8.4": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz" integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== dependencies: regenerator-runtime "^0.14.0" "@babel/template@^7.25.9", "@babel/template@^7.3.3": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz" integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== dependencies: "@babel/code-frame" "^7.25.9" @@ -1022,7 +1087,7 @@ "@babel/template@^7.26.8", "@babel/template@^7.26.9": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz#4577ad3ddf43d194528cff4e1fa6b232fa609bb2" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz" integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== dependencies: "@babel/code-frame" "^7.26.2" @@ -1031,7 +1096,7 @@ "@babel/traverse@^7.25.9": version "7.25.9" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz" integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== dependencies: "@babel/code-frame" "^7.25.9" @@ -1044,7 +1109,7 @@ "@babel/traverse@^7.26.8": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz" integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== dependencies: "@babel/code-frame" "^7.26.2" @@ -1055,9 +1120,17 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": +"@babel/types@^7.0.0": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@babel/types@^7.20.7": version "7.26.3" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== dependencies: "@babel/helper-string-parser" "^7.25.9" @@ -1065,15 +1138,23 @@ "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.4.4": version "7.26.0" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz" integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== dependencies: "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.26.3", "@babel/types@^7.3.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/types@^7.26.8", "@babel/types@^7.26.9": version "7.26.9" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz#08b43dec79ee8e682c2ac631c010bdcac54a21ce" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz" integrity sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw== dependencies: "@babel/helper-string-parser" "^7.25.9" @@ -1081,415 +1162,376 @@ "@bcoe/v8-coverage@^0.2.3": version "0.2.3" - resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" - resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@discoveryjs/json-ext@^0.5.0": version "0.5.7" - resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@firebase/analytics-compat@0.2.17": - version "0.2.17" - resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.17.tgz#c3cfc8ffb863d574ec26d86f9c8344d752832995" - integrity sha512-SJNVOeTvzdqZQvXFzj7yAirXnYcLDxh57wBFROfeowq/kRN1AqOw1tG6U4OiFOEhqi7s3xLze/LMkZatk2IEww== +"@firebase/ai@1.3.0-20250512211235": + version "1.3.0-20250512211235" + resolved "https://registry.npmjs.org/@firebase/ai/-/ai-1.3.0-20250512211235.tgz" + integrity sha512-L/3vFDzzmAScgRVcZXiqyQHLXTjyBvfC4bVHvsHGlUyBYjlS+xcPUFdNHFowM84r6qyp/X94pO58ERgRO/CUCg== dependencies: - "@firebase/analytics" "0.10.11" + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/component" "0.6.14" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.11.1" + tslib "^2.1.0" + +"@firebase/analytics-compat@0.2.20-20250512211235": + version "0.2.20-20250512211235" + dependencies: + "@firebase/analytics" "0.10.14-20250512211235" "@firebase/analytics-types" "0.8.3" - "@firebase/component" "0.6.12" - "@firebase/util" "1.10.3" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/analytics-types@0.8.3": version "0.8.3" - resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz#d08cd39a6209693ca2039ba7a81570dfa6c1518f" + resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz" integrity sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg== -"@firebase/analytics@0.10.11": - version "0.10.11" - resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.11.tgz#6896413e92613573af775c45050af889a43676da" - integrity sha512-zwuPiRE0+hgcS95JZbJ6DFQN4xYFO8IyGxpeePTV51YJMwCf3lkBa6FnZ/iXIqDKcBPMgMuuEZozI0BJWaLEYg== +"@firebase/analytics@0.10.14-20250512211235": + version "0.10.14-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/installations" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/app-check-compat@0.3.18": - version "0.3.18" - resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.18.tgz#abe63858fca86b61ea431e0d9e58ccb8bac1b275" - integrity sha512-qjozwnwYmAIdrsVGrJk+hnF1WBois54IhZR6gO0wtZQoTvWL/GtiA2F31TIgAhF0ayUiZhztOv1RfC7YyrZGDQ== +"@firebase/app-check-compat@0.3.23-20250512211235": + version "0.3.23-20250512211235" dependencies: - "@firebase/app-check" "0.8.11" + "@firebase/app-check" "0.10.0-20250512211235" "@firebase/app-check-types" "0.5.3" - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/app-check-interop-types@0.3.3": version "0.3.3" - resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz#ed9c4a4f48d1395ef378f007476db3940aa5351a" + resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz" integrity sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A== "@firebase/app-check-types@0.5.3": version "0.5.3" - resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz#38ba954acf4bffe451581a32fffa20337f11d8e5" + resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz" integrity sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng== -"@firebase/app-check@0.8.11": - version "0.8.11" - resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.11.tgz#3c67148046fea0a0a9a1eecf1a17fdc31a76eda7" - integrity sha512-42zIfRI08/7bQqczAy7sY2JqZYEv3a1eNa4fLFdtJ54vNevbBIRSEA3fZgRqWFNHalh5ohsBXdrYgFqaRIuCcQ== +"@firebase/app-check@0.10.0-20250512211235": + version "0.10.0-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/app-compat@0.2.49": - version "0.2.49" - resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.49.tgz#715a519ce8566d37c44db399c02a4785359b7b22" - integrity sha512-vf838b9WrHs2GH6NfsvA27a3ngDzCnR7oxmc5LJHaJ7mWSCuce1iDRJ2B6raJ6SH9592XXvtW+kzRcPYhC/LoA== +"@firebase/app-compat@0.4.0-20250512211235": + version "0.4.0-20250512211235" dependencies: - "@firebase/app" "0.11.0" - "@firebase/component" "0.6.12" + "@firebase/app" "0.13.0-20250512211235" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/app-types@0.9.3": +"@firebase/app-types@0.9.3", "@firebase/app-types@0.x": version "0.9.3" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz#8408219eae9b1fb74f86c24e7150a148460414ad" + resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz" integrity sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw== -"@firebase/app@0.11.0": - version "0.11.0" - resolved "https://registry.npmjs.org/@firebase/app/-/app-0.11.0.tgz#9f6333fe352283a2ecba9bddc0d66fa637cbf251" - integrity sha512-FaPl2RB2iClQK4IIAN4ruhzyGNRcvAwXk0Ltqdt55RiTmQ4aM2EAJicgI8QNQd2JIkeCT1K8JKsEba3T1/J7FA== +"@firebase/app@0.13.0-20250512211235", "@firebase/app@0.x": + version "0.13.0-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" idb "7.1.1" tslib "^2.1.0" -"@firebase/auth-compat@0.5.18": - version "0.5.18" - resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.18.tgz#ba1674287e6df4f95675866d6f960a9fc4a9abfc" - integrity sha512-dFBev8AMNb2AgIt9afwf/Ku4/0Wq9R9OFSeBB/xjyJt+RfQ9PnNWqU2oFphews23byLg6jle8twRA7iOYfRGRw== +"@firebase/auth-compat@0.5.23-20250512211235": + version "0.5.23-20250512211235" dependencies: - "@firebase/auth" "1.9.0" + "@firebase/auth" "1.10.3-20250512211235" "@firebase/auth-types" "0.13.0" - "@firebase/component" "0.6.12" - "@firebase/util" "1.10.3" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/auth-interop-types@0.2.4": version "0.2.4" - resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz#176a08686b0685596ff03d7879b7e4115af53de0" + resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz" integrity sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA== "@firebase/auth-types@0.13.0": version "0.13.0" - resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.13.0.tgz#ae6e0015e3bd4bfe18edd0942b48a0a118a098d9" + resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.13.0.tgz" integrity sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg== -"@firebase/auth@1.9.0": - version "1.9.0" - resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.9.0.tgz#eea1ab78fd3d68db3cdef69a0d7fba3663a940c5" - integrity sha512-Xz2mbEYauF689qXG/4HppS2+/yGo9R7B6eNUBh3H2+XpAZTGdx8d8TFsW/BMTAK9Q95NB0pb1Bbvfx0lwofq8Q== +"@firebase/auth@1.10.3-20250512211235": + version "1.10.3-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/component@0.6.12": - version "0.6.12" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.12.tgz#08905a534e9b769164e7e1b1e80f6e7611eb67f3" - integrity sha512-YnxqjtohLbnb7raXt2YuA44cC1wA9GiehM/cmxrsoxKlFxBLy2V0OkRSj9gpngAE0UoJ421Wlav9ycO7lTPAUw== +"@firebase/component@0.6.14": + version "0.6.14" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.14.tgz" + integrity sha512-kf/zAT8GQJ9nYoHuj0mv7twp1QzifKYrO+GsmsVHHM+Hi9KkmI7E3B3J0CtihHpb34vinl4gbJrYJ2p2wfvc9A== dependencies: - "@firebase/util" "1.10.3" + "@firebase/util" "1.11.1" tslib "^2.1.0" -"@firebase/data-connect@0.3.0": - version "0.3.0" - resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.3.0.tgz#5602986c28e2ac94df2499a7cf68ad622957089e" - integrity sha512-inbLq0JyQD/d02Al3Lso0Hc8z1BVpB3dYSMFcQkeKhYyjn5bspLczLdasPbCOEUp8MOkLblLZhJuRs7Q/spFnw== +"@firebase/component@0.6.15-20250512211235": + version "0.6.15-20250512211235" + dependencies: + "@firebase/util" "1.12.0-20250512211235" + tslib "^2.1.0" + +"@firebase/data-connect@0.3.6-20250512211235": + version "0.3.6-20250512211235" dependencies: "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/database-compat@2.0.3": - version "2.0.3" - resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.3.tgz#87f18e814c06d62fea4bfb10d3b833f4259345ca" - integrity sha512-uHGQrSUeJvsDfA+IyHW5O4vdRPsCksEzv4T4Jins+bmQgYy20ZESU4x01xrQCn/nzqKHuQMEW99CoCO7D+5NiQ== +"@firebase/database-compat@2.0.7-20250512211235": + version "2.0.7-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/database" "1.0.12" - "@firebase/database-types" "1.0.8" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/database" "1.0.16-20250512211235" + "@firebase/database-types" "1.0.12-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/database-types@1.0.8": - version "1.0.8" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.8.tgz#eddcce594be118bf9aebb043b5a6d51cfb6de620" - integrity sha512-6lPWIGeufhUq1heofZULyVvWFhD01TUrkkB9vyhmksjZ4XF7NaivQp9rICMk7QNhqwa+uDCaj4j+Q8qqcSVZ9g== +"@firebase/database-types@1.0.12-20250512211235": + version "1.0.12-20250512211235" dependencies: "@firebase/app-types" "0.9.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" -"@firebase/database@1.0.12": - version "1.0.12" - resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.12.tgz#4e1807b82dc734df8596eac44d7766ff96c2de24" - integrity sha512-psFl5t6rSFHq3i3fnU1QQlc4BB9Hnhh8TgEqvQlPPm8kDLw8gYxvjqYw3c5CZW0+zKR837nwT6im/wtJUivMKw== +"@firebase/database@1.0.16-20250512211235": + version "1.0.16-20250512211235" dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/firestore-compat@0.3.42": - version "0.3.42" - resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.42.tgz#0acad6d6e05df9764a86b0125886afdffedb08f2" - integrity sha512-L/JqnVw7Bf+2jcCmW1nCiknkIVVM5RIR4rHE1UrtInAvP9vo8pUhFEZVzbwX71SuCoHOwjiaPDvVSeOFachokg== +"@firebase/firestore-compat@0.3.48-20250512211235": + version "0.3.48-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/firestore" "4.7.7" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/firestore" "4.7.13-20250512211235" "@firebase/firestore-types" "3.0.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/firestore-types@3.0.3": version "3.0.3" - resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz#7d0c3dd8850c0193d8f5ee0cc8f11961407742c1" + resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz" integrity sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q== -"@firebase/firestore@4.7.7": - version "4.7.7" - resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.7.tgz#f9cf680e7402a833cf24a13d4f866ca1971e2c1b" - integrity sha512-DDYBjqSyd2vD3SjfRqI2Q9Ua1N0URP+1P0/SnNdVSp0/S5mkbaklIX/eU+199ze0XXnC61RYLqi6KYTYtGoz2A== +"@firebase/firestore@4.7.13-20250512211235": + version "4.7.13-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" "@firebase/webchannel-wrapper" "1.0.3" "@grpc/grpc-js" "~1.9.0" "@grpc/proto-loader" "^0.7.8" tslib "^2.1.0" -"@firebase/functions-compat@0.3.19": - version "0.3.19" - resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.19.tgz#f1d1ce51674a6ee8d5449b721374d35243dc3002" - integrity sha512-uw4tR8NcJCDu86UD63Za8A8SgFgmAVFb1XsGlkuBY7gpLyZWEFavWnwRkZ/8cUwpqUhp/SptXFZ1WFJSnOokLw== +"@firebase/functions-compat@0.3.22-20250512211235": + version "0.3.22-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/functions" "0.12.2" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/functions" "0.12.5-20250512211235" "@firebase/functions-types" "0.6.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/functions-types@0.6.3": version "0.6.3" - resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz#f5faf770248b13f45d256f614230da6a11bfb654" + resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz" integrity sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg== -"@firebase/functions@0.12.2": - version "0.12.2" - resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.12.2.tgz#bea33b35437278228be563dfc02520d8623d43f4" - integrity sha512-iKpFDoCYk/Qm+Qwv5ynRb9/yq64QOt0A0+t9NuekyAZnSoV56kSNq/PmsVmBauar5SlmEjhHk6QKdMBP9S0gXA== +"@firebase/functions@0.12.5-20250512211235": + version "0.12.5-20250512211235" dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/messaging-interop-types" "0.2.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/installations-compat@0.2.12": - version "0.2.12" - resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.12.tgz#ee6396f3cc787c0dd4fc5dd87fec1db9dbb40c97" - integrity sha512-RhcGknkxmFu92F6Jb3rXxv6a4sytPjJGifRZj8MSURPuv2Xu+/AispCXEfY1ZraobhEHTG5HLGsP6R4l9qB5aA== +"@firebase/installations-compat@0.2.15-20250512211235": + version "0.2.15-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/installations" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" "@firebase/installations-types" "0.5.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/installations-types@0.5.3": version "0.5.3" - resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz#cac8a14dd49f09174da9df8ae453f9b359c3ef2f" + resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz" integrity sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA== -"@firebase/installations@0.6.12": - version "0.6.12" - resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.12.tgz#6d9ad14e60caa8fae4ec0120c0e46ceb9d6fbdae" - integrity sha512-ES/WpuAV2k2YtBTvdaknEo7IY8vaGjIjS3zhnHSAIvY9KwTR8XZFXOJoZ3nSkjN1A5R4MtEh+07drnzPDg9vaw== +"@firebase/installations@0.6.15-20250512211235": + version "0.6.15-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/util" "1.10.3" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/util" "1.12.0-20250512211235" idb "7.1.1" tslib "^2.1.0" "@firebase/logger@0.4.4": version "0.4.4" - resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.4.tgz#29e8379d20fd1149349a195ee6deee4573a86f48" + resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.4.tgz" integrity sha512-mH0PEh1zoXGnaR8gD1DeGeNZtWFKbnz9hDO91dIml3iou1gpOnLqXQ2dJfB71dj6dpmUjcQ6phY3ZZJbjErr9g== dependencies: tslib "^2.1.0" -"@firebase/messaging-compat@0.2.16": - version "0.2.16" - resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.16.tgz#533af4542a54b932146d175d5687aedd428be972" - integrity sha512-9HZZ88Ig3zQ0ok/Pwt4gQcNsOhoEy8hDHoGsV1am6ulgMuGuDVD2gl11Lere2ksL+msM12Lddi2x/7TCqmODZw== +"@firebase/messaging-compat@0.2.19-20250512211235": + version "0.2.19-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/messaging" "0.12.16" - "@firebase/util" "1.10.3" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/messaging" "0.12.19-20250512211235" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/messaging-interop-types@0.2.3": version "0.2.3" - resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz#e647c9cd1beecfe6a6e82018a6eec37555e4da3e" + resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz" integrity sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q== -"@firebase/messaging@0.12.16": - version "0.12.16" - resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.16.tgz#bd8a768274bdc4368396bd9eaa356bffb998bef2" - integrity sha512-VJ8sCEIeP3+XkfbJA7410WhYGHdloYFZXoHe/vt+vNVDGw8JQPTQSVTRvjrUprEf5I4Tbcnpr2H34lS6zhCHSA== +"@firebase/messaging@0.12.19-20250512211235": + version "0.12.19-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/installations" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" "@firebase/messaging-interop-types" "0.2.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" idb "7.1.1" tslib "^2.1.0" -"@firebase/performance-compat@0.2.13": - version "0.2.13" - resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.13.tgz#29bb94909c10553b40ca97e7f7d0e163bad8a77d" - integrity sha512-pB0SMQj2TLQ6roDcX0YQDWvUnVgsVOl0VnUvyT/VBdCUuQYDHobZsPEuQsoEqmPA44KS/Gl0oyKqf+I8UPtRgw== +"@firebase/performance-compat@0.2.17-20250512211235": + version "0.2.17-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/performance" "0.7.0" + "@firebase/performance" "0.7.4-20250512211235" "@firebase/performance-types" "0.2.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/performance-types@0.2.3": version "0.2.3" - resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz#5ce64e90fa20ab5561f8b62a305010cf9fab86fb" + resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz" integrity sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ== -"@firebase/performance@0.7.0": - version "0.7.0" - resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.0.tgz#1cd82039f7e06e0f059287dfa21705c68ec9a691" - integrity sha512-L91PwYuiJdKXKSRqsWNicvTppAJVzKjye03UlegeD6TkpKjb93T8AmJ9B0Mt0bcWHCNtnnRBCdSCvD2U9GZDjw== +"@firebase/performance@0.7.4-20250512211235": + version "0.7.4-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/installations" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" web-vitals "^4.2.4" -"@firebase/remote-config-compat@0.2.12": - version "0.2.12" - resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.12.tgz#ae0b597b3228deef0e3c6b2c6e631f19213eca4c" - integrity sha512-91jLWPtubIuPBngg9SzwvNCWzhMLcyBccmt7TNZP+y1cuYFNOWWHKUXQ3IrxCLB7WwLqQaEu7fTDAjHsTyBsSw== +"@firebase/remote-config-compat@0.2.15-20250512211235": + version "0.2.15-20250512211235" dependencies: - "@firebase/component" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/remote-config" "0.5.0" + "@firebase/remote-config" "0.6.2-20250512211235" "@firebase/remote-config-types" "0.4.0" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/remote-config-types@0.4.0": version "0.4.0" - resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.4.0.tgz#91b9a836d5ca30ced68c1516163b281fbb544537" + resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.4.0.tgz" integrity sha512-7p3mRE/ldCNYt8fmWMQ/MSGRmXYlJ15Rvs9Rk17t8p0WwZDbeK7eRmoI1tvCPaDzn9Oqh+yD6Lw+sGLsLg4kKg== -"@firebase/remote-config@0.5.0": - version "0.5.0" - resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.5.0.tgz#30212fa77adba8a62fc6408eb32122147ae80790" - integrity sha512-weiEbpBp5PBJTHUWR4GwI7ZacaAg68BKha5QnZ8Go65W4oQjEWqCW/rfskABI/OkrGijlL3CUmCB/SA6mVo0qA== +"@firebase/remote-config@0.6.2-20250512211235": + version "0.6.2-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/installations" "0.6.12" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/storage-compat@0.3.16": - version "0.3.16" - resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.16.tgz#49ab9c572bb172e6335c099d95a48bee0f17cc98" - integrity sha512-EeMuok/s0r938lEomia8XILEqSYULm7HcYZ/GTZLDWur0kMf2ktuPVZiTdRiwEV3Iki7FtQO5txrQ/0pLRVLAw== +"@firebase/storage-compat@0.3.19-20250512211235": + version "0.3.19-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/storage" "0.13.6" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/storage" "0.13.9-20250512211235" "@firebase/storage-types" "0.8.3" - "@firebase/util" "1.10.3" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/storage-types@0.8.3": version "0.8.3" - resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz#2531ef593a3452fc12c59117195d6485c6632d3d" + resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz" integrity sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg== -"@firebase/storage@0.13.6": - version "0.13.6" - resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.6.tgz#322def6cda335df991ce9787aa5ef5650db901bd" - integrity sha512-BEJLYQzVgAoglRl5VRIRZ91RRBZgS/O37/PSGQJBYNuoLmFZUrtwrlLTOAwG776NlO9VQR+K2j15/36Lr2EqHA== +"@firebase/storage@0.13.9-20250512211235": + version "0.13.9-20250512211235" dependencies: - "@firebase/component" "0.6.12" - "@firebase/util" "1.10.3" + "@firebase/component" "0.6.15-20250512211235" + "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/util@1.10.3": - version "1.10.3" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.3.tgz#63fc5fea7b36236219c4875731597494416678d1" - integrity sha512-wfoF5LTy0m2ufUapV0ZnpcGQvuavTbJ5Qr1Ze9OJGL70cSMvhDyjS4w2121XdA3lGZSTOsDOyGhpoDtYwck85A== +"@firebase/util@1.11.1", "@firebase/util@1.x": + version "1.11.1" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.11.1.tgz" + integrity sha512-RXg4WE8C2LUrvoV/TMGRTu223zZf9Dq9MR8yHZio9nF9TpLnpCPURw9VWWB2WATDl6HfIdWfl2x2SJYtHkN4hw== dependencies: tslib "^2.1.0" -"@firebase/vertexai@1.0.4": - version "1.0.4" - resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.4.tgz#1966ddfb32492d004f595f639e57162d488c84ba" - integrity sha512-Nkf/r4u166b4Id6zrrW0Qtg1KyZpQvvYchtkebamnHtIfY+Qnt51I/sx4Saos/WrmO8SnrSU850LfmJ7pehYXg== +"@firebase/util@1.12.0-20250512211235": + version "1.12.0-20250512211235" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.12.0-20250512211235.tgz" + integrity sha512-o7CkpIAymb6irDYCoK0wKZiEMMgHX4oGdsXEXvsIPBWjoZsUavF6HH4iYVGslL4KkasEEjJiLNiomxxGbJPqKg== dependencies: - "@firebase/app-check-interop-types" "0.3.3" - "@firebase/component" "0.6.12" - "@firebase/logger" "0.4.4" - "@firebase/util" "1.10.3" tslib "^2.1.0" "@firebase/webchannel-wrapper@1.0.3": version "1.0.3" - resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz#a73bab8eb491d7b8b7be2f0e6c310647835afe83" + resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz" integrity sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ== "@grpc/grpc-js@~1.9.0": version "1.9.15" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz#433d7ac19b1754af690ea650ab72190bd700739b" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz" integrity sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ== dependencies: "@grpc/proto-loader" "^0.7.8" @@ -1497,7 +1539,7 @@ "@grpc/proto-loader@^0.7.8": version "0.7.13" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz" integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== dependencies: lodash.camelcase "^4.3.0" @@ -1507,7 +1549,7 @@ "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== dependencies: camelcase "^5.3.1" @@ -1518,12 +1560,12 @@ "@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== "@jest/console@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz" integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: "@jest/types" "^29.6.3" @@ -1535,7 +1577,7 @@ "@jest/core@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz" integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== dependencies: "@jest/console" "^29.7.0" @@ -1569,7 +1611,7 @@ "@jest/environment@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz" integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: "@jest/fake-timers" "^29.7.0" @@ -1579,14 +1621,14 @@ "@jest/expect-utils@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz" integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: jest-get-type "^29.6.3" "@jest/expect@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz" integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== dependencies: expect "^29.7.0" @@ -1594,7 +1636,7 @@ "@jest/fake-timers@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz" integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== dependencies: "@jest/types" "^29.6.3" @@ -1606,7 +1648,7 @@ "@jest/globals@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz" integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: "@jest/environment" "^29.7.0" @@ -1616,7 +1658,7 @@ "@jest/reporters@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz" integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" @@ -1646,14 +1688,14 @@ "@jest/schemas@^29.6.3": version "29.6.3" - resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz" integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: "@sinclair/typebox" "^0.27.8" "@jest/source-map@^29.6.3": version "29.6.3" - resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz" integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== dependencies: "@jridgewell/trace-mapping" "^0.3.18" @@ -1662,7 +1704,7 @@ "@jest/test-result@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz" integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: "@jest/console" "^29.7.0" @@ -1672,7 +1714,7 @@ "@jest/test-sequencer@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz" integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: "@jest/test-result" "^29.7.0" @@ -1682,7 +1724,7 @@ "@jest/transform@^29.7.0": version "29.7.0" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz" integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: "@babel/core" "^7.11.6" @@ -1703,7 +1745,7 @@ "@jest/types@^29.6.3": version "29.6.3" - resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: "@jest/schemas" "^29.6.3" @@ -1715,7 +1757,7 @@ "@jridgewell/gen-mapping@^0.3.5": version "0.3.5" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz" integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== dependencies: "@jridgewell/set-array" "^1.2.1" @@ -1724,17 +1766,17 @@ "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== "@jridgewell/set-array@^1.2.1": version "1.2.1" - resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz" integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== "@jridgewell/source-map@^0.3.3": version "0.3.6" - resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz" integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== dependencies: "@jridgewell/gen-mapping" "^0.3.5" @@ -1742,33 +1784,33 @@ "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.5.0" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jsonjoy.com/base64@^1.1.1": version "1.1.2" - resolved "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz#cf8ea9dcb849b81c95f14fc0aaa151c6b54d2578" + resolved "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz" integrity sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA== "@jsonjoy.com/json-pack@^1.0.3": version "1.1.0" - resolved "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz#33ca57ee29d12feef540f2139225597469dec894" + resolved "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz" integrity sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg== dependencies: "@jsonjoy.com/base64" "^1.1.1" @@ -1778,37 +1820,37 @@ "@jsonjoy.com/util@^1.1.2", "@jsonjoy.com/util@^1.3.0": version "1.5.0" - resolved "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.5.0.tgz#6008e35b9d9d8ee27bc4bfaa70c8cbf33a537b4c" + resolved "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.5.0.tgz" integrity sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA== "@leichtgewicht/ip-codec@^2.0.1": version "2.0.5" - resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" + resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz" integrity sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz" integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== "@protobufjs/base64@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz" integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== "@protobufjs/codegen@^2.0.4": version "2.0.4" - resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz" integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== "@protobufjs/eventemitter@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz" integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== "@protobufjs/fetch@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz" integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== dependencies: "@protobufjs/aspromise" "^1.1.1" @@ -1816,76 +1858,76 @@ "@protobufjs/float@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz" integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== "@protobufjs/inquire@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz" integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== "@protobufjs/path@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz" integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== "@protobufjs/pool@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz" integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== "@protobufjs/utf8@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== "@sinclair/typebox@^0.27.8": version "0.27.8" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== "@sinonjs/commons@^3.0.0": version "3.0.1" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz" integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== dependencies: type-detect "4.0.8" "@sinonjs/fake-timers@^10.0.2": version "10.3.0" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz" integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: "@sinonjs/commons" "^3.0.0" "@tootallnate/once@2": version "2.0.0" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@tsconfig/node10@^1.0.7": version "1.0.11" - resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz" integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== "@tsconfig/node12@^1.0.7": version "1.0.11" - resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz" integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": version "1.0.3" - resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz" integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": version "1.0.4" - resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/babel__core@^7.1.14": version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== dependencies: "@babel/parser" "^7.20.7" @@ -1896,14 +1938,14 @@ "@types/babel__generator@*": version "7.6.8" - resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" + resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz" integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": version "7.4.4" - resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" @@ -1911,14 +1953,14 @@ "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.20.6" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz" integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== dependencies: "@babel/types" "^7.20.7" "@types/body-parser@*": version "1.19.5" - resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" + resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz" integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg== dependencies: "@types/connect" "*" @@ -1926,14 +1968,14 @@ "@types/bonjour@^3.5.13": version "3.5.13" - resolved "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz#adf90ce1a105e81dd1f9c61fdc5afda1bfb92956" + resolved "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz" integrity sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ== dependencies: "@types/node" "*" "@types/connect-history-api-fallback@^1.5.4": version "1.5.4" - resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" + resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz" integrity sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw== dependencies: "@types/express-serve-static-core" "*" @@ -1941,19 +1983,29 @@ "@types/connect@*": version "3.4.38" - resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz" integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== dependencies: "@types/node" "*" -"@types/estree@^1.0.5": - version "1.0.6" - resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" - integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "9.6.1" + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^1.0.6": + version "1.0.7" "@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0": version "5.0.1" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz#3c9997ae9d00bc236e45c6374e84f2596458d9db" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz" integrity sha512-CRICJIl0N5cXDONAdlTv5ShATZ4HEwk6kDDIW2/w9qOWKg+NU/5F8wYRWCrONad0/UKkloNSmmyN/wX4rtpbVA== dependencies: "@types/node" "*" @@ -1963,7 +2015,7 @@ "@types/express-serve-static-core@^4.17.33": version "4.19.6" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz#e01324c2a024ff367d92c66f48553ced0ab50267" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz" integrity sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A== dependencies: "@types/node" "*" @@ -1973,7 +2025,7 @@ "@types/express@*": version "5.0.0" - resolved "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz#13a7d1f75295e90d19ed6e74cab3678488eaa96c" + resolved "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz" integrity sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ== dependencies: "@types/body-parser" "*" @@ -1981,9 +2033,9 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/express@^4.17.21": +"@types/express@^4.17.13", "@types/express@^4.17.21": version "4.17.21" - resolved "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d" + resolved "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz" integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== dependencies: "@types/body-parser" "*" @@ -1993,50 +2045,50 @@ "@types/gensync@^1.0.0": version "1.0.4" - resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz#7122d8f0cd3bf437f9725cc95b180197190cf50b" + resolved "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz" integrity sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA== "@types/graceful-fs@^4.1.3": version "4.1.9" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/http-errors@*": version "2.0.4" - resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" + resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz" integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA== "@types/http-proxy@^1.17.8": version "1.17.15" - resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz#12118141ce9775a6499ecb4c01d02f90fc839d36" + resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz" integrity sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.6" - resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz" integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": version "3.0.3" - resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz" integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": version "3.0.4" - resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz" integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" "@types/jest@29.5.14": version "29.5.14" - resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" + resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz" integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== dependencies: expect "^29.0.0" @@ -2044,55 +2096,55 @@ "@types/jsdom@^20.0.0": version "20.0.1" - resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz" integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== dependencies: "@types/node" "*" "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.9": version "7.0.15" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/mime@^1": version "1.3.5" - resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" + resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== "@types/node-forge@^1.3.0": version "1.3.11" - resolved "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz#0972ea538ddb0f4d9c2fa0ec5db5724773a604da" + resolved "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz" integrity sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ== dependencies: "@types/node" "*" "@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "22.8.0" - resolved "https://registry.npmjs.org/@types/node/-/node-22.8.0.tgz#193c6f82f9356ce0e6bba86b59f2ffe06e7e320b" + resolved "https://registry.npmjs.org/@types/node/-/node-22.8.0.tgz" integrity sha512-84rafSBHC/z1i1E3p0cJwKA+CfYDNSXX9WSZBRopjIzLET8oNt6ht2tei4C7izwDeEiLLfdeSVBv1egOH916hg== dependencies: undici-types "~6.19.8" "@types/qs@*": version "6.9.16" - resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794" + resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz" integrity sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A== "@types/range-parser@*": version "1.2.7" - resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" + resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== "@types/retry@0.12.2": version "0.12.2" - resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a" + resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz" integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow== "@types/send@*": version "0.17.4" - resolved "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a" + resolved "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz" integrity sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA== dependencies: "@types/mime" "^1" @@ -2100,14 +2152,14 @@ "@types/serve-index@^1.9.4": version "1.9.4" - resolved "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz#e6ae13d5053cb06ed36392110b4f9a49ac4ec898" + resolved "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz" integrity sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug== dependencies: "@types/express" "*" "@types/serve-static@*", "@types/serve-static@^1.15.5": version "1.15.7" - resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz#22174bbd74fb97fe303109738e9b5c2f3064f714" + resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz" integrity sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw== dependencies: "@types/http-errors" "*" @@ -2116,43 +2168,43 @@ "@types/sockjs@^0.3.36": version "0.3.36" - resolved "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz#ce322cf07bcc119d4cbf7f88954f3a3bd0f67535" + resolved "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz" integrity sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q== dependencies: "@types/node" "*" "@types/stack-utils@^2.0.0": version "2.0.3" - resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/tough-cookie@*": version "4.0.5" - resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz" integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== "@types/ws@^8.5.10": version "8.5.12" - resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e" + resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz" integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ== dependencies: "@types/node" "*" "@types/yargs-parser@*": version "21.0.3" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": version "17.0.33" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz" integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== dependencies: "@types/yargs-parser" "*" -"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.12.1": +"@webassemblyjs/ast@^1.14.1", "@webassemblyjs/ast@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz" integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: "@webassemblyjs/helper-numbers" "1.13.2" @@ -2160,22 +2212,22 @@ "@webassemblyjs/floating-point-hex-parser@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz" integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== "@webassemblyjs/helper-api-error@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz" integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== "@webassemblyjs/helper-buffer@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz" integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== "@webassemblyjs/helper-numbers@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz" integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: "@webassemblyjs/floating-point-hex-parser" "1.13.2" @@ -2184,12 +2236,12 @@ "@webassemblyjs/helper-wasm-bytecode@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz" integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== "@webassemblyjs/helper-wasm-section@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz" integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: "@webassemblyjs/ast" "1.14.1" @@ -2199,27 +2251,25 @@ "@webassemblyjs/ieee754@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz" integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" "@webassemblyjs/leb128@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz" integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" "@webassemblyjs/utf8@1.13.2": version "1.13.2" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz" integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== -"@webassemblyjs/wasm-edit@^1.12.1": +"@webassemblyjs/wasm-edit@^1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" - integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== dependencies: "@webassemblyjs/ast" "1.14.1" "@webassemblyjs/helper-buffer" "1.14.1" @@ -2232,7 +2282,7 @@ "@webassemblyjs/wasm-gen@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz" integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== dependencies: "@webassemblyjs/ast" "1.14.1" @@ -2243,7 +2293,7 @@ "@webassemblyjs/wasm-opt@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz" integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== dependencies: "@webassemblyjs/ast" "1.14.1" @@ -2251,9 +2301,9 @@ "@webassemblyjs/wasm-gen" "1.14.1" "@webassemblyjs/wasm-parser" "1.14.1" -"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.12.1": +"@webassemblyjs/wasm-parser@^1.14.1", "@webassemblyjs/wasm-parser@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz" integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== dependencies: "@webassemblyjs/ast" "1.14.1" @@ -2265,7 +2315,7 @@ "@webassemblyjs/wast-printer@1.14.1": version "1.14.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz" integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== dependencies: "@webassemblyjs/ast" "1.14.1" @@ -2273,37 +2323,37 @@ "@webpack-cli/configtest@^2.1.1": version "2.1.1" - resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz" integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== "@webpack-cli/info@^2.0.2": version "2.0.2" - resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz" integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== "@webpack-cli/serve@^2.0.5": version "2.0.5" - resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz" integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" - resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== "@xtuc/long@4.2.2": version "4.2.2" - resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== abab@^2.0.6: version "2.0.6" - resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: version "1.3.8" - resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: mime-types "~2.1.34" @@ -2311,63 +2361,61 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: acorn-globals@^7.0.0: version "7.0.1" - resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz" integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== dependencies: acorn "^8.1.0" acorn-walk "^8.0.2" -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-walk@^8.0.2, acorn-walk@^8.1.1: version "8.3.4" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz" integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== dependencies: acorn "^8.11.0" acorn@^8.1.0, acorn@^8.11.0, acorn@^8.4.1, acorn@^8.8.1: version "8.14.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== -acorn@^8.7.1, acorn@^8.8.2: +acorn@^8.14.0: + version "8.14.1" + +acorn@^8.8.2: version "8.13.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz" integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== agent-base@6: version "6.0.2" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: debug "4" ajv-formats@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== dependencies: ajv "^8.0.0" ajv-keywords@^3.5.2: version "3.5.2" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== ajv-keywords@^5.1.0: version "5.1.0" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz" integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== dependencies: fast-deep-equal "^3.1.3" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.4, ajv@^6.9.1: version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" @@ -2375,9 +2423,9 @@ ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.9.0: +ajv@^8.0.0, ajv@^8.8.2, ajv@^8.9.0: version "8.17.1" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== dependencies: fast-deep-equal "^3.1.3" @@ -2387,36 +2435,36 @@ ajv@^8.0.0, ajv@^8.9.0: ansi-escapes@^4.2.1: version "4.3.2" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: type-fest "^0.21.3" ansi-html-community@^0.0.8: version "0.0.8" - resolved "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" + resolved "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz" integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" ansi-styles@^5.0.0: version "5.2.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" @@ -2424,29 +2472,29 @@ anymatch@^3.0.3, anymatch@~3.1.2: arg@^4.1.0: version "4.1.3" - resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== argparse@^1.0.7: version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" array-flatten@1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== asynckit@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -babel-jest@29.7.0, babel-jest@^29.7.0: +babel-jest@^29.7.0, babel-jest@29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: "@jest/transform" "^29.7.0" @@ -2459,7 +2507,7 @@ babel-jest@29.7.0, babel-jest@^29.7.0: babel-loader@8.4.1: version "8.4.1" - resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz" integrity sha512-nXzRChX+Z1GoE6yWavBQg6jDslyFF3SDjl2paADuoQtQW10JqShJt62R6eJQ5m/pjJFDT8xgKIWSP85OY8eXeA== dependencies: find-cache-dir "^3.3.1" @@ -2469,7 +2517,7 @@ babel-loader@8.4.1: babel-plugin-istanbul@^6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -2480,7 +2528,7 @@ babel-plugin-istanbul@^6.1.1: babel-plugin-jest-hoist@^29.6.3: version "29.6.3" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz" integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== dependencies: "@babel/template" "^7.3.3" @@ -2490,7 +2538,7 @@ babel-plugin-jest-hoist@^29.6.3: babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz" integrity sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q== dependencies: "@babel/compat-data" "^7.22.6" @@ -2499,7 +2547,7 @@ babel-plugin-polyfill-corejs2@^0.4.10: babel-plugin-polyfill-corejs3@^0.11.0: version "0.11.1" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz#4e4e182f1bb37c7ba62e2af81d8dd09df31344f6" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz" integrity sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ== dependencies: "@babel/helper-define-polyfill-provider" "^0.6.3" @@ -2507,14 +2555,14 @@ babel-plugin-polyfill-corejs3@^0.11.0: babel-plugin-polyfill-regenerator@^0.6.1: version "0.6.2" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz#addc47e240edd1da1058ebda03021f382bba785e" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz" integrity sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg== dependencies: "@babel/helper-define-polyfill-provider" "^0.6.2" babel-preset-current-node-syntax@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" + resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz" integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" @@ -2535,7 +2583,7 @@ babel-preset-current-node-syntax@^1.0.0: babel-preset-jest@^29.6.3: version "29.6.3" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz" integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== dependencies: babel-plugin-jest-hoist "^29.6.3" @@ -2543,27 +2591,27 @@ babel-preset-jest@^29.6.3: balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== batch@0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" + resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== big.js@^5.2.2: version "5.2.2" - resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== binary-extensions@^2.0.0: version "2.3.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz" integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== body-parser@1.20.3: version "1.20.3" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz" integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" @@ -2581,7 +2629,7 @@ body-parser@1.20.3: bonjour-service@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz#eb41b3085183df3321da1264719fbada12478d02" + resolved "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz" integrity sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw== dependencies: fast-deep-equal "^3.1.3" @@ -2589,7 +2637,7 @@ bonjour-service@^1.2.1: brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -2597,24 +2645,14 @@ brace-expansion@^1.1.7: braces@^3.0.3, braces@~3.0.2: version "3.0.3" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" -browserslist@^4.21.10, browserslist@^4.24.4: - version "4.24.4" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" - integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== - dependencies: - caniuse-lite "^1.0.30001688" - electron-to-chromium "^1.5.73" - node-releases "^2.0.19" - update-browserslist-db "^1.1.1" - -browserslist@^4.24.0: +browserslist@^4.24.0, "browserslist@>= 4.21.0": version "4.24.2" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== dependencies: caniuse-lite "^1.0.30001669" @@ -2622,38 +2660,48 @@ browserslist@^4.24.0: node-releases "^2.0.18" update-browserslist-db "^1.1.1" +browserslist@^4.24.4: + version "4.24.4" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== + dependencies: + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" + bser@2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== dependencies: node-int64 "^0.4.0" buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== bundle-name@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz#f3b96b34160d6431a19d7688135af7cfb8797889" + resolved "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz" integrity sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q== dependencies: run-applescript "^7.0.0" bytes@3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz" integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== bytes@3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== call-bind@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: es-define-property "^1.0.0" @@ -2664,32 +2712,32 @@ call-bind@^1.0.7: callsites@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase@^5.3.1: version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.2.0: version "6.3.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001669: version "1.0.30001669" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz" integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== caniuse-lite@^1.0.30001688: version "1.0.30001702" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz#cde16fa8adaa066c04aec2967b6cde46354644c4" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz" integrity sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA== chalk@^4.0.0: version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" @@ -2697,12 +2745,12 @@ chalk@^4.0.0: char-regex@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== chokidar@^3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" @@ -2717,22 +2765,22 @@ chokidar@^3.6.0: chrome-trace-event@^1.0.2: version "1.0.4" - resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz" integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== ci-info@^3.2.0: version "3.9.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cjs-module-lexer@^1.0.0: version "1.4.1" - resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" + resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz" integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== cliui@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" @@ -2741,7 +2789,7 @@ cliui@^8.0.1: clone-deep@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== dependencies: is-plain-object "^2.0.4" @@ -2750,63 +2798,63 @@ clone-deep@^4.0.1: co@^4.6.0: version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@~1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== colorette@^2.0.10, colorette@^2.0.14: version "2.0.20" - resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== combined-stream@^1.0.8: version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" commander@^10.0.1: version "10.0.1" - resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== commander@^2.20.0: version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commondir@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== compressible@~2.0.16: version "2.0.18" - resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" + resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz" integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== dependencies: mime-db ">= 1.43.0 < 2" compression@^1.7.4: version "1.7.4" - resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz" integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== dependencies: accepts "~1.3.5" @@ -2819,56 +2867,56 @@ compression@^1.7.4: concat-map@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== connect-history-api-fallback@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" + resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== content-disposition@0.5.4: version "0.5.4" - resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: safe-buffer "5.2.1" content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== convert-source-map@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== cookie-signature@1.0.6: version "1.0.6" - resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== cookie@0.7.1: version "0.7.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz" integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== core-js-compat@^3.40.0: version "3.41.0" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.41.0.tgz#4cdfce95f39a8f27759b667cf693d96e5dda3d17" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.41.0.tgz" integrity sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A== dependencies: browserslist "^4.24.4" core-util-is@~1.0.0: version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== create-jest@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz" integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== dependencies: "@jest/types" "^29.6.3" @@ -2881,12 +2929,12 @@ create-jest@^29.7.0: create-require@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.3: version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" @@ -2895,67 +2943,67 @@ cross-spawn@^7.0.3: cssom@^0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz" integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== cssom@~0.3.6: version "0.3.8" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" data-urls@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + resolved "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz" integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== dependencies: abab "^2.0.6" whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@4: + version "4.3.7" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + debug@2.6.9: version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.7" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== - dependencies: - ms "^2.1.3" - decimal.js@^10.4.2: version "10.4.3" - resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== dedent@^1.0.0: version "1.5.3" - resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" + resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz" integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== deepmerge@^4.2.2: version "4.3.1" - resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== default-browser-id@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz#a1d98bf960c15082d8a3fa69e83150ccccc3af26" + resolved "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz" integrity sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA== default-browser@^5.2.1: version "5.2.1" - resolved "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz#7b7ba61204ff3e425b556869ae6d3e9d9f1712cf" + resolved "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz" integrity sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg== dependencies: bundle-name "^4.1.0" @@ -2963,7 +3011,7 @@ default-browser@^5.2.1: define-data-property@^1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== dependencies: es-define-property "^1.0.0" @@ -2972,106 +3020,106 @@ define-data-property@^1.1.4: define-lazy-prop@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz" integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== delayed-stream@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -depd@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - depd@~1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +depd@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + destroy@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== detect-newline@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== detect-node@^2.0.4: version "2.1.0" - resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz" integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== diff-sequences@^29.6.3: version "29.6.3" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== diff@^4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== dns-packet@^5.2.2: version "5.6.1" - resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" + resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz" integrity sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw== dependencies: "@leichtgewicht/ip-codec" "^2.0.1" domexception@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + resolved "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz" integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== dependencies: webidl-conversions "^7.0.0" ee-first@1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.5.41: version "1.5.45" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz" integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== electron-to-chromium@^1.5.73: version "1.5.112" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz#8d3d95d4d5653836327890282c8eda5c6f26626d" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz" integrity sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA== emittery@^0.13.1: version "0.13.1" - resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz" integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== emojis-list@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== encodeurl@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== encodeurl@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz" integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== enhanced-resolve@^5.17.1: version "5.18.1" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz" integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== dependencies: graceful-fs "^4.2.4" @@ -3079,56 +3127,56 @@ enhanced-resolve@^5.17.1: entities@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== envinfo@^7.7.3: version "7.14.0" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz" integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== error-ex@^1.3.1: version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-define-property@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz" integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== dependencies: get-intrinsic "^1.2.4" es-errors@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-module-lexer@^1.2.1: version "1.6.0" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz" integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz" integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-html@~1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== escodegen@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz" integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== dependencies: esprima "^4.0.1" @@ -3139,7 +3187,7 @@ escodegen@^2.0.0: eslint-scope@5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: esrecurse "^4.3.0" @@ -3147,49 +3195,49 @@ eslint-scope@5.1.1: esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esrecurse@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" estraverse@^4.1.1: version "4.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.2.0: version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" - resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== etag@~1.8.1: version "1.8.1" - resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== eventemitter3@^4.0.0: version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== events@^3.2.0: version "3.3.0" - resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== execa@^5.0.0: version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== dependencies: cross-spawn "^7.0.3" @@ -3204,12 +3252,12 @@ execa@^5.0.0: exit@^0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== expect@^29.0.0, expect@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz" integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: "@jest/expect-utils" "^29.7.0" @@ -3220,7 +3268,7 @@ expect@^29.0.0, expect@^29.7.0: express@^4.21.2: version "4.21.2" - resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + resolved "https://registry.npmjs.org/express/-/express-4.21.2.tgz" integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== dependencies: accepts "~1.3.8" @@ -3257,48 +3305,48 @@ express@^4.21.2: fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-uri@^3.0.1: version "3.0.3" - resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz" integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== fastest-levenshtein@^1.0.12: version "1.0.16" - resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== -faye-websocket@0.11.4, faye-websocket@^0.11.3: +faye-websocket@^0.11.3, faye-websocket@0.11.4: version "0.11.4" - resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== dependencies: websocket-driver ">=0.5.1" fb-watchman@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" fill-range@^7.1.1: version "7.1.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" finalhandler@1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz" integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" @@ -3311,7 +3359,7 @@ finalhandler@1.3.1: find-cache-dir@^3.3.1: version "3.3.2" - resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz" integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== dependencies: commondir "^1.0.1" @@ -3320,59 +3368,59 @@ find-cache-dir@^3.3.1: find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" path-exists "^4.0.0" -firebase@11.3.0: - version "11.3.0" - resolved "https://registry.npmjs.org/firebase/-/firebase-11.3.0.tgz#3e6a61411cee00c1c7b307c546b5c7d40b3e2d1a" - integrity sha512-wLuBsWqg/M3pay2qOOLLKjTQxPUO2yrJgZLt4TKUwA3c3lrFNM2zc40uzD9LQdUk6H9HEK6bXjGPFrpwmu7HzA== - dependencies: - "@firebase/analytics" "0.10.11" - "@firebase/analytics-compat" "0.2.17" - "@firebase/app" "0.11.0" - "@firebase/app-check" "0.8.11" - "@firebase/app-check-compat" "0.3.18" - "@firebase/app-compat" "0.2.49" +firebase@^11.8.0-20250512211235: + version "11.8.0-20250512211235" + resolved "https://registry.npmjs.org/firebase/-/firebase-11.8.0-20250512211235.tgz" + integrity sha512-0juBB1XpC52s4BF/6OwJd7ka8imyXIIbsnjp6yVr1n8W0GpYIpvXzKP0oahiV2Wiv9l0DfVRZpsMB0OJvk9nQw== + dependencies: + "@firebase/ai" "1.3.0-20250512211235" + "@firebase/analytics" "0.10.14-20250512211235" + "@firebase/analytics-compat" "0.2.20-20250512211235" + "@firebase/app" "0.13.0-20250512211235" + "@firebase/app-check" "0.10.0-20250512211235" + "@firebase/app-check-compat" "0.3.23-20250512211235" + "@firebase/app-compat" "0.4.0-20250512211235" "@firebase/app-types" "0.9.3" - "@firebase/auth" "1.9.0" - "@firebase/auth-compat" "0.5.18" - "@firebase/data-connect" "0.3.0" - "@firebase/database" "1.0.12" - "@firebase/database-compat" "2.0.3" - "@firebase/firestore" "4.7.7" - "@firebase/firestore-compat" "0.3.42" - "@firebase/functions" "0.12.2" - "@firebase/functions-compat" "0.3.19" - "@firebase/installations" "0.6.12" - "@firebase/installations-compat" "0.2.12" - "@firebase/messaging" "0.12.16" - "@firebase/messaging-compat" "0.2.16" - "@firebase/performance" "0.7.0" - "@firebase/performance-compat" "0.2.13" - "@firebase/remote-config" "0.5.0" - "@firebase/remote-config-compat" "0.2.12" - "@firebase/storage" "0.13.6" - "@firebase/storage-compat" "0.3.16" - "@firebase/util" "1.10.3" - "@firebase/vertexai" "1.0.4" + "@firebase/auth" "1.10.3-20250512211235" + "@firebase/auth-compat" "0.5.23-20250512211235" + "@firebase/data-connect" "0.3.6-20250512211235" + "@firebase/database" "1.0.16-20250512211235" + "@firebase/database-compat" "2.0.7-20250512211235" + "@firebase/firestore" "4.7.13-20250512211235" + "@firebase/firestore-compat" "0.3.48-20250512211235" + "@firebase/functions" "0.12.5-20250512211235" + "@firebase/functions-compat" "0.3.22-20250512211235" + "@firebase/installations" "0.6.15-20250512211235" + "@firebase/installations-compat" "0.2.15-20250512211235" + "@firebase/messaging" "0.12.19-20250512211235" + "@firebase/messaging-compat" "0.2.19-20250512211235" + "@firebase/performance" "0.7.4-20250512211235" + "@firebase/performance-compat" "0.2.17-20250512211235" + "@firebase/remote-config" "0.6.2-20250512211235" + "@firebase/remote-config-compat" "0.2.15-20250512211235" + "@firebase/storage" "0.13.9-20250512211235" + "@firebase/storage-compat" "0.3.19-20250512211235" + "@firebase/util" "1.12.0-20250512211235" flat@^5.0.2: version "5.0.2" - resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== follow-redirects@^1.0.0: version "1.15.9" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== form-data@^4.0.0: version "4.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz" integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: asynckit "^0.4.0" @@ -3381,42 +3429,42 @@ form-data@^4.0.0: forwarded@0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== fresh@0.5.2: version "0.5.2" - resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== function-bind@^1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" - resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: version "1.2.4" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== dependencies: es-errors "^1.3.0" @@ -3427,29 +3475,29 @@ get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: get-package-type@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-stream@^6.0.0: version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" glob-to-regexp@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@^7.1.3, glob@^7.1.4: version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" @@ -3461,58 +3509,58 @@ glob@^7.1.3, glob@^7.1.4: globals@^11.1.0: version "11.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== gopd@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz" integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== dependencies: get-intrinsic "^1.1.3" graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== handle-thing@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" + resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== has-flag@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-property-descriptors@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== dependencies: es-define-property "^1.0.0" has-proto@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz" integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== has-symbols@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== hasown@^2.0.0, hasown@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: function-bind "^1.1.2" hpack.js@^2.1.6: version "2.1.6" - resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz" integrity sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ== dependencies: inherits "^2.0.1" @@ -3522,24 +3570,34 @@ hpack.js@^2.1.6: html-encoding-sniffer@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz" integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== dependencies: whatwg-encoding "^2.0.0" html-escaper@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== http-deceiver@^1.2.7: version "1.2.7" - resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz" integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" + integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + http-errors@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: depd "2.0.0" @@ -3548,24 +3606,14 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - http-parser-js@>=0.5.1: version "0.5.8" - resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" + resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz" integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== http-proxy-agent@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz" integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== dependencies: "@tootallnate/once" "2" @@ -3574,7 +3622,7 @@ http-proxy-agent@^5.0.0: http-proxy-middleware@^2.0.7: version "2.0.7" - resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz" integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" @@ -3585,7 +3633,7 @@ http-proxy-middleware@^2.0.7: http-proxy@^1.18.1: version "1.18.1" - resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz" integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== dependencies: eventemitter3 "^4.0.0" @@ -3594,7 +3642,7 @@ http-proxy@^1.18.1: https-proxy-agent@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: agent-base "6" @@ -3602,36 +3650,36 @@ https-proxy-agent@^5.0.1: human-signals@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== hyperdyperid@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" + resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz" integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== iconv-lite@0.4.24: version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@0.6.3: version "0.6.3" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== dependencies: safer-buffer ">= 2.1.2 < 3.0.0" idb@7.1.1: version "7.1.1" - resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" + resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz" integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ== import-local@^3.0.2: version "3.2.0" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz" integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== dependencies: pkg-dir "^4.2.0" @@ -3639,157 +3687,157 @@ import-local@^3.0.2: imurmurhash@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== inflight@^1.0.4: version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: +inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3, inherits@2, inherits@2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== interpret@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz" integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - ipaddr.js@^2.1.0: version "2.2.0" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz" integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-arrayish@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" is-core-module@^2.13.0: version "2.15.1" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz" integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== dependencies: hasown "^2.0.2" is-docker@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + resolved "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz" integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-generator-fn@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-inside-container@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + resolved "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz" integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== dependencies: is-docker "^3.0.0" is-network-error@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz#d26a760e3770226d11c169052f266a4803d9c997" + resolved "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz" integrity sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g== is-number@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-plain-obj@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== is-plain-object@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-potential-custom-element-name@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-stream@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-wsl@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz#e1c657e39c10090afcbedec61720f6b924c3cbd2" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz" integrity sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw== dependencies: is-inside-container "^1.0.0" isarray@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== isobject@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz" integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^5.0.4: version "5.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: "@babel/core" "^7.12.3" @@ -3800,7 +3848,7 @@ istanbul-lib-instrument@^5.0.4: istanbul-lib-instrument@^6.0.0: version "6.0.3" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz" integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== dependencies: "@babel/core" "^7.23.9" @@ -3811,7 +3859,7 @@ istanbul-lib-instrument@^6.0.0: istanbul-lib-report@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" @@ -3820,7 +3868,7 @@ istanbul-lib-report@^3.0.0: istanbul-lib-source-maps@^4.0.0: version "4.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" @@ -3829,7 +3877,7 @@ istanbul-lib-source-maps@^4.0.0: istanbul-reports@^3.1.3: version "3.1.7" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz" integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== dependencies: html-escaper "^2.0.0" @@ -3837,7 +3885,7 @@ istanbul-reports@^3.1.3: jest-changed-files@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz" integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: execa "^5.0.0" @@ -3846,7 +3894,7 @@ jest-changed-files@^29.7.0: jest-circus@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz" integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: "@jest/environment" "^29.7.0" @@ -3872,7 +3920,7 @@ jest-circus@^29.7.0: jest-cli@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz" integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: "@jest/core" "^29.7.0" @@ -3889,7 +3937,7 @@ jest-cli@^29.7.0: jest-config@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz" integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: "@babel/core" "^7.11.6" @@ -3917,7 +3965,7 @@ jest-config@^29.7.0: jest-diff@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== dependencies: chalk "^4.0.0" @@ -3927,14 +3975,14 @@ jest-diff@^29.7.0: jest-docblock@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz" integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: detect-newline "^3.0.0" jest-each@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz" integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: "@jest/types" "^29.6.3" @@ -3945,7 +3993,7 @@ jest-each@^29.7.0: jest-environment-jsdom@29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz" integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== dependencies: "@jest/environment" "^29.7.0" @@ -3959,7 +4007,7 @@ jest-environment-jsdom@29.7.0: jest-environment-node@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz" integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== dependencies: "@jest/environment" "^29.7.0" @@ -3971,12 +4019,12 @@ jest-environment-node@^29.7.0: jest-get-type@^29.6.3: version "29.6.3" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== jest-haste-map@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz" integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== dependencies: "@jest/types" "^29.6.3" @@ -3995,7 +4043,7 @@ jest-haste-map@^29.7.0: jest-leak-detector@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz" integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: jest-get-type "^29.6.3" @@ -4003,7 +4051,7 @@ jest-leak-detector@^29.7.0: jest-matcher-utils@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz" integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" @@ -4013,7 +4061,7 @@ jest-matcher-utils@^29.7.0: jest-message-util@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz" integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" @@ -4028,7 +4076,7 @@ jest-message-util@^29.7.0: jest-mock@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz" integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== dependencies: "@jest/types" "^29.6.3" @@ -4037,25 +4085,25 @@ jest-mock@^29.7.0: jest-pnp-resolver@^1.2.2: version "1.2.3" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^29.6.3: version "29.6.3" - resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== jest-resolve-dependencies@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz" integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@^29.7.0: +jest-resolve@*, jest-resolve@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: chalk "^4.0.0" @@ -4070,7 +4118,7 @@ jest-resolve@^29.7.0: jest-runner@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz" integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== dependencies: "@jest/console" "^29.7.0" @@ -4097,7 +4145,7 @@ jest-runner@^29.7.0: jest-runtime@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz" integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== dependencies: "@jest/environment" "^29.7.0" @@ -4125,7 +4173,7 @@ jest-runtime@^29.7.0: jest-snapshot@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz" integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: "@babel/core" "^7.11.6" @@ -4151,7 +4199,7 @@ jest-snapshot@^29.7.0: jest-util@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz" integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: "@jest/types" "^29.6.3" @@ -4163,7 +4211,7 @@ jest-util@^29.7.0: jest-validate@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz" integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: "@jest/types" "^29.6.3" @@ -4175,7 +4223,7 @@ jest-validate@^29.7.0: jest-watcher@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz" integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: "@jest/test-result" "^29.7.0" @@ -4189,7 +4237,7 @@ jest-watcher@^29.7.0: jest-worker@^27.4.5: version "27.5.1" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz" integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" @@ -4198,7 +4246,7 @@ jest-worker@^27.4.5: jest-worker@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz" integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" @@ -4208,7 +4256,7 @@ jest-worker@^29.7.0: jest@29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: "@jest/core" "^29.7.0" @@ -4218,12 +4266,12 @@ jest@29.7.0: js-tokens@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" @@ -4231,7 +4279,7 @@ js-yaml@^3.13.1: jsdom@^20.0.0: version "20.0.3" - resolved "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + resolved "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz" integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== dependencies: abab "^2.0.6" @@ -4263,42 +4311,42 @@ jsdom@^20.0.0: jsesc@^3.0.2, jsesc@~3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz" integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-schema-traverse@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== json5@^2.1.2, json5@^2.2.3: version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== kind-of@^6.0.2: version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== kleur@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== launch-editor@^2.6.1: version "2.9.1" - resolved "https://registry.npmjs.org/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047" + resolved "https://registry.npmjs.org/launch-editor/-/launch-editor-2.9.1.tgz" integrity sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w== dependencies: picocolors "^1.0.0" @@ -4306,22 +4354,22 @@ launch-editor@^2.6.1: leven@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== lines-and-columns@^1.1.6: version "1.2.4" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== loader-runner@^4.2.0: version "4.3.0" - resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz" integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" @@ -4330,67 +4378,67 @@ loader-utils@^2.0.4: locate-path@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" lodash.camelcase@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== lodash.debounce@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== long@^5.0.0: version "5.2.3" - resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== lru-cache@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" make-dir@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== dependencies: semver "^7.5.3" make-error@^1.1.1: version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== makeerror@1.0.12: version "1.0.12" - resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: tmpl "1.0.5" media-typer@0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== memfs@^4.6.0: version "4.14.0" - resolved "https://registry.npmjs.org/memfs/-/memfs-4.14.0.tgz#48d5e85a03ea0b428280003212fbca3063531be3" + resolved "https://registry.npmjs.org/memfs/-/memfs-4.14.0.tgz" integrity sha512-JUeY0F/fQZgIod31Ja1eJgiSxLn7BfQlCnqhwXFBzFHEw63OdLK7VJUJ7bnzNsWgCyoUP5tEp1VRY8rDaYzqOA== dependencies: "@jsonjoy.com/json-pack" "^1.0.3" @@ -4400,79 +4448,79 @@ memfs@^4.6.0: merge-descriptors@1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz" integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-stream@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== methods@~1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.8" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - "mime-db@>= 1.43.0 < 2": version "1.53.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz" integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" mime@1.6.0: version "1.6.0" - resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== mimic-fn@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimalistic-assert@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" +ms@^2.1.3, ms@2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + ms@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.3, ms@^2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - multicast-dns@^7.2.5: version "7.2.5" - resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" + resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz" integrity sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg== dependencies: dns-packet "^5.2.2" @@ -4480,95 +4528,95 @@ multicast-dns@^7.2.5: natural-compare@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== negotiator@0.6.3: version "0.6.3" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== neo-async@^2.6.2: version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== node-forge@^1: version "1.3.1" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" + resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== node-int64@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.18: version "2.0.18" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz" integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== node-releases@^2.0.19: version "2.0.19" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz" integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== npm-run-path@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" nwsapi@^2.2.2: version "2.2.16" - resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.16.tgz" integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== object-inspect@^1.13.1: version "1.13.2" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz" integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -on-finished@2.4.1, on-finished@^2.4.1: +on-finished@^2.4.1, on-finished@2.4.1: version "2.4.1" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: ee-first "1.1.1" on-headers@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== once@^1.3.0: version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" onetime@^5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" open@^10.0.3: version "10.1.0" - resolved "https://registry.npmjs.org/open/-/open-10.1.0.tgz#a7795e6e5d519abe4286d9937bb24b51122598e1" + resolved "https://registry.npmjs.org/open/-/open-10.1.0.tgz" integrity sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw== dependencies: default-browser "^5.2.1" @@ -4578,28 +4626,28 @@ open@^10.0.3: p-limit@^2.2.0: version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" p-limit@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-retry@^6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz#8d6df01af298750009691ce2f9b3ad2d5968f3bd" + resolved "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz" integrity sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA== dependencies: "@types/retry" "0.12.2" @@ -4608,12 +4656,12 @@ p-retry@^6.2.0: p-try@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== parse-json@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" @@ -4623,66 +4671,66 @@ parse-json@^5.2.0: parse5@^7.0.0, parse5@^7.1.1: version "7.2.1" - resolved "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + resolved "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz" integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== dependencies: entities "^4.5.0" parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" - resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-to-regexp@0.1.12: version "0.1.12" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz" integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: version "4.0.6" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz" integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== dependencies: "@jest/schemas" "^29.6.3" @@ -4691,12 +4739,12 @@ pretty-format@^29.0.0, pretty-format@^29.7.0: process-nextick-args@~2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== prompts@^2.0.1: version "2.4.2" - resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" @@ -4704,7 +4752,7 @@ prompts@^2.0.1: protobufjs@^7.2.5: version "7.4.0" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz" integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== dependencies: "@protobufjs/aspromise" "^1.1.2" @@ -4722,7 +4770,7 @@ protobufjs@^7.2.5: proxy-addr@~2.0.7: version "2.0.7" - resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz" integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== dependencies: forwarded "0.2.0" @@ -4730,48 +4778,48 @@ proxy-addr@~2.0.7: psl@^1.1.33: version "1.15.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + resolved "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz" integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== dependencies: punycode "^2.3.1" punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pure-rand@^6.0.0: version "6.1.0" - resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" + resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz" integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== qs@6.13.0: version "6.13.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz" integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: side-channel "^1.0.6" querystringify@^2.1.1: version "2.2.0" - resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== raw-body@2.5.2: version "2.5.2" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz" integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" @@ -4781,12 +4829,12 @@ raw-body@2.5.2: react-is@^18.0.0: version "18.3.1" - resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== readable-stream@^2.0.1: version "2.3.8" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" @@ -4799,7 +4847,7 @@ readable-stream@^2.0.1: readable-stream@^3.0.6: version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" @@ -4808,45 +4856,45 @@ readable-stream@^3.0.6: readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" rechoir@^0.8.0: version "0.8.0" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz" integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: resolve "^1.20.0" regenerate-unicode-properties@^10.2.0: version "10.2.0" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz" integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== dependencies: regenerate "^1.4.2" regenerate@^1.4.2: version "1.4.2" - resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== regenerator-runtime@^0.14.0: version "0.14.1" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== regenerator-transform@^0.15.2: version "0.15.2" - resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz" integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" regexpu-core@^6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz#b469b245594cb2d088ceebc6369dceb8c00becac" + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz" integrity sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw== dependencies: regenerate "^1.4.2" @@ -4858,51 +4906,51 @@ regexpu-core@^6.1.1: regjsgen@^0.8.0: version "0.8.0" - resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" + resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz" integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== regjsparser@^0.11.0: version "0.11.1" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.11.1.tgz#ae55c74f646db0c8fcb922d4da635e33da405149" + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.11.1.tgz" integrity sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ== dependencies: jsesc "~3.0.2" require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== requires-port@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== resolve-cwd@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: resolve-from "^5.0.0" resolve-from@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^2.0.0: version "2.0.3" - resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" + resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz" integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.14.2, resolve@^1.20.0: version "1.22.8" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" @@ -4911,57 +4959,53 @@ resolve@^1.14.2, resolve@^1.20.0: retry@^0.13.1: version "0.13.1" - resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== run-applescript@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz#e5a553c2bffd620e169d276c1cd8f1b64778fbeb" + resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz" integrity sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A== -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.1.0, safe-buffer@>=5.1.0, safe-buffer@~5.2.0, safe-buffer@5.2.1: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== saxes@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + resolved "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz" integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== dependencies: xmlchars "^2.2.0" schema-utils@^2.6.5: version "2.7.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz" integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== dependencies: "@types/json-schema" "^7.0.5" ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.2.0: - version "3.3.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" - integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== - dependencies: - "@types/json-schema" "^7.0.8" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - schema-utils@^4.0.0, schema-utils@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz" integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== dependencies: "@types/json-schema" "^7.0.9" @@ -4971,7 +5015,7 @@ schema-utils@^4.0.0, schema-utils@^4.2.0: schema-utils@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz" integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== dependencies: "@types/json-schema" "^7.0.9" @@ -4981,12 +5025,12 @@ schema-utils@^4.3.0: select-hose@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz" integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== selfsigned@^2.4.1: version "2.4.1" - resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz#560d90565442a3ed35b674034cec4e95dceb4ae0" + resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz" integrity sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q== dependencies: "@types/node-forge" "^1.3.0" @@ -4994,17 +5038,22 @@ selfsigned@^2.4.1: semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3: version "7.6.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +semver@^7.5.4: + version "7.6.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== send@0.19.0: version "0.19.0" - resolved "https://registry.npmjs.org/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + resolved "https://registry.npmjs.org/send/-/send-0.19.0.tgz" integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" @@ -5023,14 +5072,14 @@ send@0.19.0: serialize-javascript@^6.0.2: version "6.0.2" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" serve-index@^1.9.1: version "1.9.1" - resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" + resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz" integrity sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw== dependencies: accepts "~1.3.4" @@ -5043,7 +5092,7 @@ serve-index@^1.9.1: serve-static@1.16.2: version "1.16.2" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz" integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: encodeurl "~2.0.0" @@ -5053,7 +5102,7 @@ serve-static@1.16.2: set-function-length@^1.2.1: version "1.2.2" - resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== dependencies: define-data-property "^1.1.4" @@ -5065,41 +5114,41 @@ set-function-length@^1.2.1: setprototypeof@1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== setprototypeof@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== shallow-clone@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: kind-of "^6.0.2" shebang-command@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== shell-quote@^1.8.1: version "1.8.1" - resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" + resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz" integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== side-channel@^1.0.6: version "1.0.6" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz" integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== dependencies: call-bind "^1.0.7" @@ -5109,52 +5158,52 @@ side-channel@^1.0.6: signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== sisteransi@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== slash@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== sockjs@^0.3.24: version "0.3.24" - resolved "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" + resolved "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz" integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== dependencies: faye-websocket "^0.11.3" uuid "^8.3.2" websocket-driver "^0.7.4" -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spdy-transport@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" + resolved "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz" integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== dependencies: debug "^4.1.0" @@ -5166,7 +5215,7 @@ spdy-transport@^3.0.0: spdy@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz#b74f466203a3eda452c02492b91fb9e84a27677b" + resolved "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz" integrity sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA== dependencies: debug "^4.1.0" @@ -5177,29 +5226,43 @@ spdy@^4.0.2: sprintf-js@~1.0.2: version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== stack-utils@^2.0.3: version "2.0.6" - resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz" integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + statuses@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" string-length@^4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: char-regex "^1.0.2" @@ -5207,82 +5270,66 @@ string-length@^4.0.1: string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-bom@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-final-newline@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== strip-json-comments@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@^7.1.0: version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" supports-color@^8.0.0: version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== symbol-tree@^3.2.4: version "3.2.4" - resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" - resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -terser-webpack-plugin@^5.3.10: +terser-webpack-plugin@^5.3.11: version "5.3.14" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" - integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -5292,7 +5339,7 @@ terser-webpack-plugin@^5.3.10: terser@^5.31.1: version "5.39.0" - resolved "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz#0e82033ed57b3ddf1f96708d123cca717d86ca3a" + resolved "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz" integrity sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw== dependencies: "@jridgewell/source-map" "^0.3.3" @@ -5302,7 +5349,7 @@ terser@^5.31.1: test-exclude@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: "@istanbuljs/schema" "^0.1.2" @@ -5311,34 +5358,34 @@ test-exclude@^6.0.0: thingies@^1.20.0: version "1.21.0" - resolved "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1" + resolved "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz" integrity sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g== thunky@^1.0.2: version "1.1.0" - resolved "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" + resolved "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== tmpl@1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" toidentifier@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tough-cookie@^4.1.2: version "4.1.4" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz" integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== dependencies: psl "^1.1.33" @@ -5348,19 +5395,19 @@ tough-cookie@^4.1.2: tr46@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz" integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== dependencies: punycode "^2.1.1" tree-dump@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" + resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz" integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== -ts-node@10.9.2: +ts-node@>=9.0.0, ts-node@10.9.2: version "10.9.2" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== dependencies: "@cspotcode/source-map-support" "^0.8.0" @@ -5377,47 +5424,47 @@ ts-node@10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tslib@^2.0.0, tslib@^2.1.0: +tslib@^2, tslib@^2.0.0, tslib@^2.1.0, tslib@2: version "2.8.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz#d124c86c3c05a40a91e6fdea4021bd31d377971b" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz" integrity sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA== type-detect@4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== type-fest@^0.21.3: version "0.21.3" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-is@~1.6.18: version "1.6.18" - resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== dependencies: media-typer "0.3.0" mime-types "~2.1.24" -typescript@5.5.4: +typescript@>=2.7, typescript@5.5.4: version "5.5.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== undici-types@~6.19.8: version "6.19.8" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" + resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz" integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== unicode-match-property-ecmascript@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: unicode-canonical-property-names-ecmascript "^2.0.0" @@ -5425,27 +5472,27 @@ unicode-match-property-ecmascript@^2.0.0: unicode-match-property-value-ecmascript@^2.1.0: version "2.2.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz" integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== universalify@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -unpipe@1.0.0, unpipe@~1.0.0: +unpipe@~1.0.0, unpipe@1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== update-browserslist-db@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz" integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== dependencies: escalade "^3.2.0" @@ -5453,14 +5500,14 @@ update-browserslist-db@^1.1.1: uri-js@^4.2.2: version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" url-parse@^1.5.3: version "1.5.10" - resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: querystringify "^2.1.1" @@ -5468,27 +5515,27 @@ url-parse@^1.5.3: util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== utils-merge@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@^8.3.2: version "8.3.2" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache-lib@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== v8-to-istanbul@^9.0.1: version "9.3.0" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" + resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz" integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== dependencies: "@jridgewell/trace-mapping" "^0.3.12" @@ -5497,26 +5544,26 @@ v8-to-istanbul@^9.0.1: vary@~1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== w3c-xmlserializer@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz" integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== dependencies: xml-name-validator "^4.0.0" walker@^1.0.8: version "1.0.8" - resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: makeerror "1.0.12" watchpack@^2.4.1: version "2.4.2" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz" integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" @@ -5524,24 +5571,24 @@ watchpack@^2.4.1: wbuf@^1.1.0, wbuf@^1.7.3: version "1.7.3" - resolved "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" + resolved "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz" integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== dependencies: minimalistic-assert "^1.0.0" web-vitals@^4.2.4: version "4.2.4" - resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz" integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== webidl-conversions@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -webpack-cli@5.1.4: +webpack-cli@5.1.4, webpack-cli@5.x.x: version "5.1.4" - resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz" integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== dependencies: "@discoveryjs/json-ext" "^0.5.0" @@ -5560,7 +5607,7 @@ webpack-cli@5.1.4: webpack-dev-middleware@^7.4.2: version "7.4.2" - resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz#40e265a3d3d26795585cff8207630d3a8ff05877" + resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz" integrity sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA== dependencies: colorette "^2.0.10" @@ -5572,7 +5619,7 @@ webpack-dev-middleware@^7.4.2: webpack-dev-server@5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz#68043886edaa3fd875ad20e01589990a79612f9c" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.0.tgz" integrity sha512-90SqqYXA2SK36KcT6o1bvwvZfJFcmoamqeJY7+boioffX9g9C0wjjJRGUrQIuh43pb0ttX7+ssavmj/WN2RHtA== dependencies: "@types/bonjour" "^3.5.13" @@ -5605,7 +5652,7 @@ webpack-dev-server@5.2.0: webpack-merge@^5.7.3: version "5.10.0" - resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" + resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz" integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== dependencies: clone-deep "^4.0.1" @@ -5614,21 +5661,19 @@ webpack-merge@^5.7.3: webpack-sources@^3.2.3: version "3.2.3" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@5.94.0: - version "5.94.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" - integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== - dependencies: - "@types/estree" "^1.0.5" - "@webassemblyjs/ast" "^1.12.1" - "@webassemblyjs/wasm-edit" "^1.12.1" - "@webassemblyjs/wasm-parser" "^1.12.1" - acorn "^8.7.1" - acorn-import-attributes "^1.9.5" - browserslist "^4.21.10" +webpack@^5.0.0, webpack@^5.1.0, webpack@>=2, webpack@5.98.0, webpack@5.x.x: + version "5.98.0" + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" @@ -5640,15 +5685,15 @@ webpack@5.94.0: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.2.0" + schema-utils "^4.3.0" tapable "^2.1.1" - terser-webpack-plugin "^5.3.10" + terser-webpack-plugin "^5.3.11" watchpack "^2.4.1" webpack-sources "^3.2.3" -websocket-driver@>=0.5.1, websocket-driver@^0.7.4: +websocket-driver@^0.7.4, websocket-driver@>=0.5.1: version "0.7.4" - resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" + resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== dependencies: http-parser-js ">=0.5.1" @@ -5657,24 +5702,24 @@ websocket-driver@>=0.5.1, websocket-driver@^0.7.4: websocket-extensions@>=0.1.1: version "0.1.4" - resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== whatwg-encoding@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz" integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== dependencies: iconv-lite "0.6.3" whatwg-mimetype@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz" integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== whatwg-url@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz" integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== dependencies: tr46 "^3.0.0" @@ -5682,19 +5727,19 @@ whatwg-url@^11.0.0: which@^2.0.1: version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" wildcard@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" + resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -5703,12 +5748,12 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" @@ -5716,37 +5761,37 @@ write-file-atomic@^4.0.2: ws@^8.11.0, ws@^8.18.0: version "8.18.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== xml-name-validator@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz" integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== xmlchars@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^3.0.2: version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yargs-parser@^21.1.1: version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1, yargs@^17.7.2: version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" @@ -5759,10 +5804,10 @@ yargs@^17.3.1, yargs@^17.7.2: yn@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 2fe754727d29e2fcc2c28a6c59ff5d0b84a12033 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Tue, 20 May 2025 08:34:52 -0700 Subject: [PATCH 200/295] Version Packages (#9016) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/eighty-starfishes-listen.md | 6 --- .changeset/fast-mangos-chew.md | 5 -- .changeset/ninety-ways-dress.md | 8 ---- .changeset/perfect-camels-try.md | 6 --- .changeset/tall-zoos-stare.md | 6 --- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 16 +++++++ packages/ai/package.json | 8 ++-- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 9 ++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 12 +++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 13 +++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 12 +++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 8 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 8 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 10 ++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 8 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 41 ++++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 10 ++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 8 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 9 ++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 8 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- repo-scripts/size-analysis/package.json | 4 +- 70 files changed, 484 insertions(+), 207 deletions(-) delete mode 100644 .changeset/eighty-starfishes-listen.md delete mode 100644 .changeset/fast-mangos-chew.md delete mode 100644 .changeset/ninety-ways-dress.md delete mode 100644 .changeset/perfect-camels-try.md delete mode 100644 .changeset/tall-zoos-stare.md diff --git a/.changeset/eighty-starfishes-listen.md b/.changeset/eighty-starfishes-listen.md deleted file mode 100644 index 4f53b0fb786..00000000000 --- a/.changeset/eighty-starfishes-listen.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@firebase/firestore": patch -"@firebase/util": minor ---- - -Fix Safari/WebKit cache issues when client-side indexing is used. diff --git a/.changeset/fast-mangos-chew.md b/.changeset/fast-mangos-chew.md deleted file mode 100644 index 4e1f7ab3121..00000000000 --- a/.changeset/fast-mangos-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Pass `GenerativeModel`'s `BaseParams` to created chat sessions. This fixes an issue where `GenerationConfig` would not be inherited from `ChatSession`. diff --git a/.changeset/ninety-ways-dress.md b/.changeset/ninety-ways-dress.md deleted file mode 100644 index 82c9e15cf4d..00000000000 --- a/.changeset/ninety-ways-dress.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@firebase/app-compat': minor -'@firebase/app-check': minor -'@firebase/app': minor -'firebase': minor ---- - -Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. diff --git a/.changeset/perfect-camels-try.md b/.changeset/perfect-camels-try.md deleted file mode 100644 index 52292807f0a..00000000000 --- a/.changeset/perfect-camels-try.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for Gemini multimodal output diff --git a/.changeset/tall-zoos-stare.md b/.changeset/tall-zoos-stare.md deleted file mode 100644 index 96d480762ea..00000000000 --- a/.changeset/tall-zoos-stare.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for the Gemini Developer API, enabling usage in a free tier, and add new `AI` API to accomodate new product naming. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 7b97998233e..11360a5b954 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.12.3", - "@firebase/app-compat": "0.3.3", - "@firebase/analytics": "0.10.15", - "@firebase/analytics-compat": "0.2.21", - "@firebase/auth": "1.10.4", - "@firebase/auth-compat": "0.5.24", - "@firebase/functions": "0.12.6", - "@firebase/functions-compat": "0.3.23", - "@firebase/messaging": "0.12.20", - "@firebase/messaging-compat": "0.2.20", - "@firebase/performance": "0.7.5", - "@firebase/performance-compat": "0.2.18", - "@firebase/remote-config": "0.6.3", - "@firebase/remote-config-compat": "0.2.16" + "@firebase/app": "0.13.0", + "@firebase/app-compat": "0.4.0", + "@firebase/analytics": "0.10.16", + "@firebase/analytics-compat": "0.2.22", + "@firebase/auth": "1.10.5", + "@firebase/auth-compat": "0.5.25", + "@firebase/functions": "0.12.7", + "@firebase/functions-compat": "0.3.24", + "@firebase/messaging": "0.12.21", + "@firebase/messaging-compat": "0.2.21", + "@firebase/performance": "0.7.6", + "@firebase/performance-compat": "0.2.19", + "@firebase/remote-config": "0.6.4", + "@firebase/remote-config-compat": "0.2.17" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index dac850a09b3..c509b23e5b5 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.12.3", - "@firebase/firestore": "4.7.14" + "@firebase/app": "0.13.0", + "@firebase/firestore": "4.7.15" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index f883f54f098..b4eaccebdab 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.7.3", + "firebase": "11.8.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 1dab92bcca1..298fb06a9b5 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,21 @@ # @firebase/ai +## 1.3.0 + +### Minor Changes + +- [`e99683b`](https://github.com/firebase/firebase-js-sdk/commit/e99683b17cf75c581bd362a1d7cb85f0b9c110ba) [#8922](https://github.com/firebase/firebase-js-sdk/pull/8922) - Add support for Gemini multimodal output + +- [`d5082f9`](https://github.com/firebase/firebase-js-sdk/commit/d5082f9f2fc4de98a6bfd1c6a5af4571af4d0bc6) [#8931](https://github.com/firebase/firebase-js-sdk/pull/8931) - Add support for the Gemini Developer API, enabling usage in a free tier, and add new `AI` API to accomodate new product naming. + +### Patch Changes + +- [`050c1b6`](https://github.com/firebase/firebase-js-sdk/commit/050c1b6a099b87be1488b9207e4fad4da9f8f64b) [#8972](https://github.com/firebase/firebase-js-sdk/pull/8972) - Pass `GenerativeModel`'s `BaseParams` to created chat sessions. This fixes an issue where `GenerationConfig` would not be inherited from `ChatSession`. + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 1.2.4 ### Patch Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 6aeede834ad..98e204320bc 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "1.2.4", + "version": "1.3.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -49,14 +49,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index e950b6ad5eb..ce440211b4a 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.22 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/analytics@0.10.16 + - @firebase/component@0.6.17 + ## 0.2.21 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index fc86eff94ff..cb8c4c5a2f7 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.21", + "version": "0.2.22", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.16", - "@firebase/analytics": "0.10.15", + "@firebase/component": "0.6.17", + "@firebase/analytics": "0.10.16", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 06548ecd2cd..2507a977522 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics +## 0.10.16 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/installations@0.6.17 + ## 0.10.15 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 2ffd405cc81..2f7b6cfbadf 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.15", + "version": "0.10.16", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.16", + "@firebase/installations": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 825cf013e08..b5456ba7b69 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.25 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27), [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7)]: + - @firebase/util@1.12.0 + - @firebase/app-check@0.10.0 + - @firebase/component@0.6.17 + ## 0.3.24 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index e2e214c2d24..15cc2a9273f 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.24", + "version": "0.3.25", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.9.3", + "@firebase/app-check": "0.10.0", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index d7e6fdf6446..764c17928cb 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app-check +## 0.10.0 + +### Minor Changes + +- [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7) [#9010](https://github.com/firebase/firebase-js-sdk/pull/9010) - Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.9.3 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 25b27f90ca4..4187145ed67 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.9.3", + "version": "0.10.0", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 38ae80099ea..6e27613a249 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/app-compat +## 0.4.0 + +### Minor Changes + +- [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7) [#9010](https://github.com/firebase/firebase-js-sdk/pull/9010) - Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27), [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7)]: + - @firebase/util@1.12.0 + - @firebase/app@0.13.0 + - @firebase/component@0.6.17 + ## 0.3.3 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index a0e0b89a9fc..3d70accd107 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.3.3", + "version": "0.4.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.12.3", - "@firebase/util": "1.11.3", + "@firebase/app": "0.13.0", + "@firebase/util": "1.12.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 10a196ca0fa..2b239c453cc 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app +## 0.13.0 + +### Minor Changes + +- [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7) [#9010](https://github.com/firebase/firebase-js-sdk/pull/9010) - Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.12.3 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 07e70ba14ec..3d385028412 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.12.3", + "version": "0.13.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 97ec10f7a77..b0876dd935c 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.25 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/auth@1.10.5 + - @firebase/component@0.6.17 + ## 0.5.24 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index c244b8e3f7a..f2fcfac236a 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.24", + "version": "0.5.25", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.4", + "@firebase/auth": "1.10.5", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.16", - "@firebase/util": "1.11.3", + "@firebase/component": "0.6.17", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 9999db32429..cb1ecc4fda7 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.10.5 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 1.10.4 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index deb2006f9b9..5777c7500d1 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.4", + "version": "1.10.5", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 5dca079098c..f4e008fc2b1 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.17 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + ## 0.6.16 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index cb0e6a336d2..b95204050f3 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.16", + "version": "0.6.17", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 5e9eb3532bb..dfec86ea4d0 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 0.3.8 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.3.7 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index f4dfa7e0863..aeb5aaee50f 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.7", + "version": "0.3.8", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 1dab50a408f..3376ad0c953 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.9 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/database@1.0.18 + - @firebase/database-types@1.0.14 + ## 2.0.8 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index d24167a9965..6a3f4d83335 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.8", + "version": "2.0.9", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.17", - "@firebase/database-types": "1.0.13", + "@firebase/database": "1.0.18", + "@firebase/database-types": "1.0.14", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index b2be70c2efc..316d77556a7 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.14 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + ## 1.0.13 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index f6cbb176699..95866297115 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.13", + "version": "1.0.14", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.11.3" + "@firebase/util": "1.12.0" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index ea27ec478d8..c7fcbd37dd0 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Unreleased +## 1.0.18 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 1.0.17 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 719469d5cca..72050a5bd2e 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.17", + "version": "1.0.18", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index ed42e9ee853..436053673b2 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,46 @@ # firebase +## 11.8.0 + +### Minor Changes + +- [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7) [#9010](https://github.com/firebase/firebase-js-sdk/pull/9010) - Default `automaticDataCollectionEnabled` to true without changing App Check's default behavior. + +- [`e99683b`](https://github.com/firebase/firebase-js-sdk/commit/e99683b17cf75c581bd362a1d7cb85f0b9c110ba) [#8922](https://github.com/firebase/firebase-js-sdk/pull/8922) - Add support for Gemini multimodal output + +- [`d5082f9`](https://github.com/firebase/firebase-js-sdk/commit/d5082f9f2fc4de98a6bfd1c6a5af4571af4d0bc6) [#8931](https://github.com/firebase/firebase-js-sdk/pull/8931) - Add support for the Gemini Developer API, enabling usage in a free tier, and add new `AI` API to accomodate new product naming. + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27), [`050c1b6`](https://github.com/firebase/firebase-js-sdk/commit/050c1b6a099b87be1488b9207e4fad4da9f8f64b), [`6be75f7`](https://github.com/firebase/firebase-js-sdk/commit/6be75f74dec92d1b84f77f79ccb770a3e23280b7), [`e99683b`](https://github.com/firebase/firebase-js-sdk/commit/e99683b17cf75c581bd362a1d7cb85f0b9c110ba), [`d5082f9`](https://github.com/firebase/firebase-js-sdk/commit/d5082f9f2fc4de98a6bfd1c6a5af4571af4d0bc6)]: + - @firebase/firestore@4.7.15 + - @firebase/util@1.12.0 + - @firebase/ai@1.3.0 + - @firebase/app-compat@0.4.0 + - @firebase/app-check@0.10.0 + - @firebase/app@0.13.0 + - @firebase/firestore-compat@0.3.50 + - @firebase/analytics@0.10.16 + - @firebase/analytics-compat@0.2.22 + - @firebase/app-check-compat@0.3.25 + - @firebase/auth@1.10.5 + - @firebase/auth-compat@0.5.25 + - @firebase/data-connect@0.3.8 + - @firebase/database@1.0.18 + - @firebase/database-compat@2.0.9 + - @firebase/functions@0.12.7 + - @firebase/functions-compat@0.3.24 + - @firebase/installations@0.6.17 + - @firebase/installations-compat@0.2.17 + - @firebase/messaging@0.12.21 + - @firebase/messaging-compat@0.2.21 + - @firebase/performance@0.7.6 + - @firebase/performance-compat@0.2.19 + - @firebase/remote-config@0.6.4 + - @firebase/remote-config-compat@0.2.17 + - @firebase/storage@0.13.11 + - @firebase/storage-compat@0.3.21 + ## 11.7.3 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 0ed42235a3e..9ce4835a2f4 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.7.3", + "version": "11.8.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -411,34 +411,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "1.2.4", - "@firebase/app": "0.12.3", - "@firebase/app-compat": "0.3.3", + "@firebase/ai": "1.3.0", + "@firebase/app": "0.13.0", + "@firebase/app-compat": "0.4.0", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.4", - "@firebase/auth-compat": "0.5.24", - "@firebase/data-connect": "0.3.7", - "@firebase/database": "1.0.17", - "@firebase/database-compat": "2.0.8", - "@firebase/firestore": "4.7.14", - "@firebase/firestore-compat": "0.3.49", - "@firebase/functions": "0.12.6", - "@firebase/functions-compat": "0.3.23", - "@firebase/installations": "0.6.16", - "@firebase/installations-compat": "0.2.16", - "@firebase/messaging": "0.12.20", - "@firebase/messaging-compat": "0.2.20", - "@firebase/storage": "0.13.10", - "@firebase/storage-compat": "0.3.20", - "@firebase/performance": "0.7.5", - "@firebase/performance-compat": "0.2.18", - "@firebase/remote-config": "0.6.3", - "@firebase/remote-config-compat": "0.2.16", - "@firebase/analytics": "0.10.15", - "@firebase/analytics-compat": "0.2.21", - "@firebase/app-check": "0.9.3", - "@firebase/app-check-compat": "0.3.24", - "@firebase/util": "1.11.3" + "@firebase/auth": "1.10.5", + "@firebase/auth-compat": "0.5.25", + "@firebase/data-connect": "0.3.8", + "@firebase/database": "1.0.18", + "@firebase/database-compat": "2.0.9", + "@firebase/firestore": "4.7.15", + "@firebase/firestore-compat": "0.3.50", + "@firebase/functions": "0.12.7", + "@firebase/functions-compat": "0.3.24", + "@firebase/installations": "0.6.17", + "@firebase/installations-compat": "0.2.17", + "@firebase/messaging": "0.12.21", + "@firebase/messaging-compat": "0.2.21", + "@firebase/storage": "0.13.11", + "@firebase/storage-compat": "0.3.21", + "@firebase/performance": "0.7.6", + "@firebase/performance-compat": "0.2.19", + "@firebase/remote-config": "0.6.4", + "@firebase/remote-config-compat": "0.2.17", + "@firebase/analytics": "0.10.16", + "@firebase/analytics-compat": "0.2.22", + "@firebase/app-check": "0.10.0", + "@firebase/app-check-compat": "0.3.25", + "@firebase/util": "1.12.0" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index f22abcaf049..2ab0cc98150 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.50 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/firestore@4.7.15 + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.3.49 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index e2243ccba9f..68c135058e6 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.49", + "version": "0.3.50", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.16", - "@firebase/firestore": "4.7.14", - "@firebase/util": "1.11.3", + "@firebase/component": "0.6.17", + "@firebase/firestore": "4.7.15", + "@firebase/util": "1.12.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 19144f16afd..7f9e6fe4a91 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/firestore +## 4.7.15 + +### Patch Changes + +- [`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27) [#8993](https://github.com/firebase/firebase-js-sdk/pull/8993) - Fix Safari/WebKit cache issues when client-side indexing is used. + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 4.7.14 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 24daaf37b42..b7d76fb4fca 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.14", + "version": "4.7.15", "engines": { "node": ">=18.0.0" }, @@ -100,9 +100,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -112,9 +112,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.3", - "@firebase/app-compat": "0.3.3", - "@firebase/auth": "1.10.4", + "@firebase/app": "0.13.0", + "@firebase/app-compat": "0.4.0", + "@firebase/auth": "1.10.5", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 991f41c0868..ddff93a8f81 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.24 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/functions@0.12.7 + ## 0.3.23 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 60d1ffacfbc..56c5bcbb89d 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.23", + "version": "0.3.24", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.16", - "@firebase/functions": "0.12.6", + "@firebase/component": "0.6.17", + "@firebase/functions": "0.12.7", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index a63cd968b70..68afc468a1c 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.7 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.12.6 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 6fde3987e75..80ca8986c56 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.6", + "version": "0.12.7", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index c46d91d70ab..213a1ba641e 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.17 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/installations@0.6.17 + ## 0.2.16 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 73b318577ce..11f1838f66c 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.16", + "version": "0.2.17", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.16", + "@firebase/installations": "0.6.17", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index 035655cf96f..bb0e09f277f 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.17 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.6.16 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index bd35c91a7ee..be4d1b4a79f 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.16", + "version": "0.6.17", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index cafca2b6ec5..b150f2f2939 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.21 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/messaging@0.12.21 + ## 0.2.20 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 4f36674d8ef..fd145f06bf7 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.20", + "version": "0.2.21", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.20", - "@firebase/component": "0.6.16", - "@firebase/util": "1.11.3", + "@firebase/messaging": "0.12.21", + "@firebase/component": "0.6.17", + "@firebase/util": "1.12.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", + "@firebase/app-compat": "0.4.0", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index c8b10a8e5d1..8df2d983835 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.21 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/installations@0.6.17 + ## 0.12.20 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index c412ba5eecc..9d8cfc71926 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.20", + "version": "0.12.21", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.16", + "@firebase/installations": "0.6.17", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index ee1ed073fdb..11b9eed3d2f 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.19 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/performance@0.7.6 + ## 0.2.18 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 71286577acc..0ec3cc56e66 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.18", + "version": "0.2.19", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.5", + "@firebase/performance": "0.7.6", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.3" + "@firebase/app-compat": "0.4.0" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index fe169a3ad39..ce6d7e391e5 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.6 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/installations@0.6.17 + ## 0.7.5 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index e7a9fed6020..b3495c8a566 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.5", + "version": "0.7.6", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.16", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/installations": "0.6.17", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index d2bdfb1fac2..052bc765c9c 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.17 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/remote-config@0.6.4 + ## 0.2.16 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 7d2e5483efe..84c66d579bc 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.16", + "version": "0.2.17", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.3", + "@firebase/remote-config": "0.6.4", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.16", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.3.3" + "@firebase/app-compat": "0.4.0" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 07fe5cc9605..529e0417e75 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config +## 0.6.4 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/installations@0.6.17 + ## 0.6.3 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index ffa93164d3a..09dd8b6531e 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.3", + "version": "0.6.4", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.16", + "@firebase/installations": "0.6.17", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index a9a3f9e1621..2bb419259cf 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.21 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + - @firebase/storage@0.13.11 + ## 0.3.20 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 046b0a79563..26633a8218c 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.20", + "version": "0.3.21", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.10", + "@firebase/storage": "0.13.11", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.3.3", - "@firebase/auth-compat": "0.5.24", + "@firebase/app-compat": "0.4.0", + "@firebase/auth-compat": "0.5.25", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 2872e5a792b..e123d70cdce 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.11 + +### Patch Changes + +- Updated dependencies [[`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27)]: + - @firebase/util@1.12.0 + - @firebase/component@0.6.17 + ## 0.13.10 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 9c5a738bee1..67c205ac245 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.10", + "version": "0.13.11", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.11.3", - "@firebase/component": "0.6.16", + "@firebase/util": "1.12.0", + "@firebase/component": "0.6.17", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.12.3", - "@firebase/auth": "1.10.4", + "@firebase/app": "0.13.0", + "@firebase/auth": "1.10.5", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 5d8c84d3566..6d178ded575 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 9eaaa3415e4..c208cce58db 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.12.0 + +### Minor Changes + +- [`8a03143`](https://github.com/firebase/firebase-js-sdk/commit/8a03143b9217effdd86d68bdf195493c0979aa27) [#8993](https://github.com/firebase/firebase-js-sdk/pull/8993) - Fix Safari/WebKit cache issues when client-side indexing is used. + ## 1.11.3 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index 4e50552bb2f..8a1ebb49dd5 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.11.3", + "version": "1.12.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 09b6cc14ca6..184020a8acc 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.12.3", + "@firebase/app": "0.13.0", "@firebase/logger": "0.4.4", - "@firebase/util": "1.11.3", + "@firebase/util": "1.12.0", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 35ad5266304e14425988fcf5ad06d028b37588ac Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 20 May 2025 11:32:24 -0700 Subject: [PATCH 201/295] Revert "Fixed scroll behavior (#8977)" (#9053) * Revert "Fixed scroll behavior (#9043)" This reverts commit 9bcd1ea9b8cc5b55692765d40df000da8ddef02b. * Revert "Add Emulator Overlay (#8977) (#9031)" This reverts commit 8593fa05bd884c2f1f6f3b4ae062efa48af93d24. * Undid revert of util * Create dirty-crews-cross.md * Removed unnecessary markdown file --- .changeset/dirty-crews-cross.md | 9 +++++++++ packages/auth/src/core/auth/emulator.ts | 16 ++++++---------- packages/auth/src/platform_browser/index.ts | 8 +------- packages/database/src/api/Database.ts | 8 +------- packages/firestore/src/lite-api/database.ts | 11 +++-------- packages/functions/src/api.ts | 4 +--- packages/functions/src/service.ts | 7 +------ packages/storage/src/api.ts | 4 +--- packages/storage/src/service.ts | 4 +--- 9 files changed, 24 insertions(+), 47 deletions(-) create mode 100644 .changeset/dirty-crews-cross.md diff --git a/.changeset/dirty-crews-cross.md b/.changeset/dirty-crews-cross.md new file mode 100644 index 00000000000..08a962670f0 --- /dev/null +++ b/.changeset/dirty-crews-cross.md @@ -0,0 +1,9 @@ +--- +"@firebase/auth": patch +"@firebase/database": patch +"@firebase/firestore": patch +"@firebase/functions": patch +"@firebase/storage": patch +--- + +Revert "Fixed scroll behavior (#9043)" diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 42fbda3f095..8547f7bad6c 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,12 +18,7 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { - deepEqual, - isCloudWorkstation, - pingServer, - updateEmulatorBanner -} from '@firebase/util'; +import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -102,12 +97,13 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; + if (!disableWarnings) { + emitEmulatorWarning(); + } + + // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { - updateEmulatorBanner('Auth', true); - // Workaround to get cookies in Firebase Studio void pingServer(`${protocol}//${host}${portStr}`); - } else if (!disableWarnings) { - emitEmulatorWarning(); } } diff --git a/packages/auth/src/platform_browser/index.ts b/packages/auth/src/platform_browser/index.ts index 99ab834cbdb..f94525bfeb7 100644 --- a/packages/auth/src/platform_browser/index.ts +++ b/packages/auth/src/platform_browser/index.ts @@ -30,11 +30,7 @@ import { browserSessionPersistence } from './persistence/session_storage'; import { indexedDBLocalPersistence } from './persistence/indexed_db'; import { browserPopupRedirectResolver } from './popup_redirect'; import { Auth, User } from '../model/public_types'; -import { - getDefaultEmulatorHost, - getExperimentalSetting, - updateEmulatorBanner -} from '@firebase/util'; +import { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util'; import { _setExternalJSProvider } from './load_js'; import { _createError } from '../core/util/assert'; import { AuthErrorCode } from '../core/errors'; @@ -114,8 +110,6 @@ export function getAuth(app: FirebaseApp = getApp()): Auth { const authEmulatorHost = getDefaultEmulatorHost('auth'); if (authEmulatorHost) { connectAuthEmulator(auth, `http://${authEmulatorHost}`); - } else { - updateEmulatorBanner('Auth', false); } return auth; diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index a94b04518d7..515e278b5c5 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -31,8 +31,7 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer, - updateEmulatorBanner + pingServer } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -258,10 +257,6 @@ export class Database implements _FirebaseService { this.app.options['databaseAuthVariableOverride'] ); this._instanceStarted = true; - updateEmulatorBanner( - 'Database', - this._repo.repoInfo_.emulatorOptions !== null - ); } return this._repoInternal; } @@ -398,7 +393,6 @@ export function connectDatabaseEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(host); - updateEmulatorBanner('Database', true); } // Modify the repo to apply emulator settings diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index fce6d5843b7..8e7fdb27e90 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,7 +28,6 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - updateEmulatorBanner, pingServer } from '@firebase/util'; @@ -143,7 +142,6 @@ export class Firestore implements FirestoreService { _freezeSettings(): FirestoreSettingsImpl { this._settingsFrozen = true; - updateEmulatorBanner('Firestore', this._settings.isUsingEmulator); return this._settings; } @@ -336,7 +334,9 @@ export function connectFirestoreEmulator( emulatorOptions: firestore._getEmulatorOptions() }; const newHostSetting = `${host}:${port}`; - + if (useSsl) { + void pingServer(`https://${newHostSetting}`); + } if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + @@ -357,11 +357,6 @@ export function connectFirestoreEmulator( firestore._setSettings(newConfig); - if (useSsl) { - void pingServer(`https://${newHostSetting}`); - updateEmulatorBanner('Firestore', true); - } - if (options.mockUserToken) { let token: string; let user: User; diff --git a/packages/functions/src/api.ts b/packages/functions/src/api.ts index cb987035145..7f92cba8343 100644 --- a/packages/functions/src/api.ts +++ b/packages/functions/src/api.ts @@ -29,8 +29,7 @@ import { } from './service'; import { getModularInstance, - getDefaultEmulatorHostnameAndPort, - updateEmulatorBanner + getDefaultEmulatorHostnameAndPort } from '@firebase/util'; export { FunctionsError } from './error'; @@ -48,7 +47,6 @@ export function getFunctions( app: FirebaseApp = getApp(), regionOrCustomDomain: string = DEFAULT_REGION ): Functions { - updateEmulatorBanner('Functions', false); // Dependencies const functionsProvider: Provider<'functions'> = _getProvider( getModularInstance(app), diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index 57504a4c7a4..af9d8898d2e 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,11 +30,7 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { - isCloudWorkstation, - pingServer, - updateEmulatorBanner -} from '@firebase/util'; +import { isCloudWorkstation, pingServer } from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -186,7 +182,6 @@ export function connectFunctionsEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(functionsInstance.emulatorOrigin); - updateEmulatorBanner('Functions', true); } } diff --git a/packages/storage/src/api.ts b/packages/storage/src/api.ts index b164a1324c3..84c77ea0c8c 100644 --- a/packages/storage/src/api.ts +++ b/packages/storage/src/api.ts @@ -53,8 +53,7 @@ import { STORAGE_TYPE } from './constants'; import { EmulatorMockTokenOptions, getModularInstance, - getDefaultEmulatorHostnameAndPort, - updateEmulatorBanner + getDefaultEmulatorHostnameAndPort } from '@firebase/util'; import { StringFormat } from './implementation/string'; @@ -333,7 +332,6 @@ export function getStorage( bucketUrl?: string ): FirebaseStorage { app = getModularInstance(app); - updateEmulatorBanner('Storage', false); const storageProvider: Provider<'storage'> = _getProvider(app, STORAGE_TYPE); const storageInstance = storageProvider.getImmediate({ identifier: bucketUrl diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 97d1407bb52..741dd6eaa1a 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -46,8 +46,7 @@ import { createMockUserToken, EmulatorMockTokenOptions, isCloudWorkstation, - pingServer, - updateEmulatorBanner + pingServer } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -151,7 +150,6 @@ export function connectStorageEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(`https://${storage.host}`); - updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; From b5df4ae71c1b5b54d9237e7929d0f793189b82c9 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 21 May 2025 16:20:48 -0700 Subject: [PATCH 202/295] Updated to only show banner when calling connect*Emulator (#9055) --- .changeset/large-windows-mate.md | 10 ++++++++++ packages/auth/src/core/auth/emulator.ts | 14 +++++++++----- packages/data-connect/src/api/DataConnect.ts | 7 ++++++- packages/database/src/api/Database.ts | 4 +++- packages/firestore/src/lite-api/database.ts | 4 +++- packages/functions/src/service.ts | 7 ++++++- packages/storage/src/service.ts | 4 +++- 7 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .changeset/large-windows-mate.md diff --git a/.changeset/large-windows-mate.md b/.changeset/large-windows-mate.md new file mode 100644 index 00000000000..004f3284936 --- /dev/null +++ b/.changeset/large-windows-mate.md @@ -0,0 +1,10 @@ +--- +"@firebase/auth": patch +"@firebase/data-connect": patch +"@firebase/database": patch +"@firebase/firestore": patch +"@firebase/functions": patch +"@firebase/storage": patch +--- + +Updated to only show banner when calling connect*Emulator diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 8547f7bad6c..15da907286f 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; +import { + deepEqual, + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -97,13 +102,12 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; - if (!disableWarnings) { - emitEmulatorWarning(); - } - // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(`${protocol}//${host}${portStr}`); + updateEmulatorBanner('Auth', true); + } else if (!disableWarnings) { + emitEmulatorWarning(); } } diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index c25a09039ac..b7311363784 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -24,7 +24,11 @@ import { import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { Provider } from '@firebase/component'; -import { isCloudWorkstation, pingServer } from '@firebase/util'; +import { + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; import { Code, DataConnectError } from '../core/error'; @@ -241,6 +245,7 @@ export function connectDataConnectEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(`https://${host}${port ? `:${port}` : ''}`); + updateEmulatorBanner('Data Connect', true); } dc.enableEmulator({ host, port, sslEnabled }); } diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 515e278b5c5..338255be46f 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -31,7 +31,8 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -393,6 +394,7 @@ export function connectDatabaseEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(host); + updateEmulatorBanner('Database', true); } // Modify the repo to apply emulator settings diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 8e7fdb27e90..6af324e4ba4 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,7 +28,8 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { @@ -336,6 +337,7 @@ export function connectFirestoreEmulator( const newHostSetting = `${host}:${port}`; if (useSsl) { void pingServer(`https://${newHostSetting}`); + updateEmulatorBanner('Firestore', true); } if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index af9d8898d2e..57504a4c7a4 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,7 +30,11 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { isCloudWorkstation, pingServer } from '@firebase/util'; +import { + isCloudWorkstation, + pingServer, + updateEmulatorBanner +} from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -182,6 +186,7 @@ export function connectFunctionsEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(functionsInstance.emulatorOrigin); + updateEmulatorBanner('Functions', true); } } diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 741dd6eaa1a..97d1407bb52 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -46,7 +46,8 @@ import { createMockUserToken, EmulatorMockTokenOptions, isCloudWorkstation, - pingServer + pingServer, + updateEmulatorBanner } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -150,6 +151,7 @@ export function connectStorageEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(`https://${storage.host}`); + updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; From 770e455a63c32d4340c3204ca013ed08440e73ec Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Wed, 21 May 2025 17:04:09 -0700 Subject: [PATCH 203/295] Version Packages (#9054) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/dirty-crews-cross.md | 9 --------- .changeset/large-windows-mate.md | 10 ---------- integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/auth-compat/CHANGELOG.md | 7 +++++++ packages/auth-compat/package.json | 4 ++-- packages/auth/CHANGELOG.md | 8 ++++++++ packages/auth/package.json | 2 +- packages/data-connect/CHANGELOG.md | 6 ++++++ packages/data-connect/package.json | 2 +- packages/database-compat/CHANGELOG.md | 7 +++++++ packages/database-compat/package.json | 4 ++-- packages/database/CHANGELOG.md | 8 ++++++++ packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 17 +++++++++++++++++ packages/firebase/package.json | 24 ++++++++++++------------ packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 4 ++-- packages/firestore/CHANGELOG.md | 8 ++++++++ packages/firestore/package.json | 4 ++-- packages/functions-compat/CHANGELOG.md | 7 +++++++ packages/functions-compat/package.json | 4 ++-- packages/functions/CHANGELOG.md | 8 ++++++++ packages/functions/package.json | 2 +- packages/storage-compat/CHANGELOG.md | 7 +++++++ packages/storage-compat/package.json | 6 +++--- packages/storage/CHANGELOG.md | 8 ++++++++ packages/storage/package.json | 4 ++-- 29 files changed, 135 insertions(+), 56 deletions(-) delete mode 100644 .changeset/dirty-crews-cross.md delete mode 100644 .changeset/large-windows-mate.md diff --git a/.changeset/dirty-crews-cross.md b/.changeset/dirty-crews-cross.md deleted file mode 100644 index 08a962670f0..00000000000 --- a/.changeset/dirty-crews-cross.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@firebase/auth": patch -"@firebase/database": patch -"@firebase/firestore": patch -"@firebase/functions": patch -"@firebase/storage": patch ---- - -Revert "Fixed scroll behavior (#9043)" diff --git a/.changeset/large-windows-mate.md b/.changeset/large-windows-mate.md deleted file mode 100644 index 004f3284936..00000000000 --- a/.changeset/large-windows-mate.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@firebase/auth": patch -"@firebase/data-connect": patch -"@firebase/database": patch -"@firebase/firestore": patch -"@firebase/functions": patch -"@firebase/storage": patch ---- - -Updated to only show banner when calling connect*Emulator diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 11360a5b954..117a8220fc0 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -12,10 +12,10 @@ "@firebase/app-compat": "0.4.0", "@firebase/analytics": "0.10.16", "@firebase/analytics-compat": "0.2.22", - "@firebase/auth": "1.10.5", - "@firebase/auth-compat": "0.5.25", - "@firebase/functions": "0.12.7", - "@firebase/functions-compat": "0.3.24", + "@firebase/auth": "1.10.6", + "@firebase/auth-compat": "0.5.26", + "@firebase/functions": "0.12.8", + "@firebase/functions-compat": "0.3.25", "@firebase/messaging": "0.12.21", "@firebase/messaging-compat": "0.2.21", "@firebase/performance": "0.7.6", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index c509b23e5b5..0c722a5352b 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@firebase/app": "0.13.0", - "@firebase/firestore": "4.7.15" + "@firebase/firestore": "4.7.16" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index b4eaccebdab..9cb2bf233fc 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.8.0", + "firebase": "11.8.1", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index b0876dd935c..aed6222d935 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/auth-compat +## 0.5.26 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/auth@1.10.6 + ## 0.5.25 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index f2fcfac236a..c8a6f40b357 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.25", + "version": "0.5.26", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.5", + "@firebase/auth": "1.10.6", "@firebase/auth-types": "0.13.0", "@firebase/component": "0.6.17", "@firebase/util": "1.12.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index cb1ecc4fda7..fe546adc28a 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.10.6 + +### Patch Changes + +- [`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac) [#9053](https://github.com/firebase/firebase-js-sdk/pull/9053) - Revert "Fixed scroll behavior (#9043)" + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 1.10.5 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 5777c7500d1..ea47732d398 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.5", + "version": "1.10.6", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index dfec86ea4d0..cb5e53a5c54 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +## 0.3.9 + +### Patch Changes + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 0.3.8 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index aeb5aaee50f..a342c7d4f14 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.8", + "version": "0.3.9", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 3376ad0c953..b15d780739a 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-compat +## 2.0.10 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/database@1.0.19 + ## 2.0.9 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 6a3f4d83335..104f57d56dc 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.9", + "version": "2.0.10", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,7 +49,7 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.18", + "@firebase/database": "1.0.19", "@firebase/database-types": "1.0.14", "@firebase/logger": "0.4.4", "@firebase/util": "1.12.0", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index c7fcbd37dd0..2c8060f7860 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Unreleased +## 1.0.19 + +### Patch Changes + +- [`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac) [#9053](https://github.com/firebase/firebase-js-sdk/pull/9053) - Revert "Fixed scroll behavior (#9043)" + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 1.0.18 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 72050a5bd2e..0fe42bddeed 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.18", + "version": "1.0.19", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 436053673b2..2a17f24d933 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,22 @@ # firebase +## 11.8.1 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/auth@1.10.6 + - @firebase/database@1.0.19 + - @firebase/firestore@4.7.16 + - @firebase/functions@0.12.8 + - @firebase/storage@0.13.12 + - @firebase/data-connect@0.3.9 + - @firebase/auth-compat@0.5.26 + - @firebase/database-compat@2.0.10 + - @firebase/firestore-compat@0.3.51 + - @firebase/functions-compat@0.3.25 + - @firebase/storage-compat@0.3.22 + ## 11.8.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 9ce4835a2f4..aec5e6e8fec 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.8.0", + "version": "11.8.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -415,21 +415,21 @@ "@firebase/app": "0.13.0", "@firebase/app-compat": "0.4.0", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.5", - "@firebase/auth-compat": "0.5.25", - "@firebase/data-connect": "0.3.8", - "@firebase/database": "1.0.18", - "@firebase/database-compat": "2.0.9", - "@firebase/firestore": "4.7.15", - "@firebase/firestore-compat": "0.3.50", - "@firebase/functions": "0.12.7", - "@firebase/functions-compat": "0.3.24", + "@firebase/auth": "1.10.6", + "@firebase/auth-compat": "0.5.26", + "@firebase/data-connect": "0.3.9", + "@firebase/database": "1.0.19", + "@firebase/database-compat": "2.0.10", + "@firebase/firestore": "4.7.16", + "@firebase/firestore-compat": "0.3.51", + "@firebase/functions": "0.12.8", + "@firebase/functions-compat": "0.3.25", "@firebase/installations": "0.6.17", "@firebase/installations-compat": "0.2.17", "@firebase/messaging": "0.12.21", "@firebase/messaging-compat": "0.2.21", - "@firebase/storage": "0.13.11", - "@firebase/storage-compat": "0.3.21", + "@firebase/storage": "0.13.12", + "@firebase/storage-compat": "0.3.22", "@firebase/performance": "0.7.6", "@firebase/performance-compat": "0.2.19", "@firebase/remote-config": "0.6.4", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 2ab0cc98150..861e35792c5 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.51 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/firestore@4.7.16 + ## 0.3.50 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 68c135058e6..6e3db51e597 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.50", + "version": "0.3.51", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,7 +47,7 @@ }, "dependencies": { "@firebase/component": "0.6.17", - "@firebase/firestore": "4.7.15", + "@firebase/firestore": "4.7.16", "@firebase/util": "1.12.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 7f9e6fe4a91..0671f0e8c63 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/firestore +## 4.7.16 + +### Patch Changes + +- [`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac) [#9053](https://github.com/firebase/firebase-js-sdk/pull/9053) - Revert "Fixed scroll behavior (#9043)" + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 4.7.15 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index b7d76fb4fca..6fc04a3579d 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.15", + "version": "4.7.16", "engines": { "node": ">=18.0.0" }, @@ -114,7 +114,7 @@ "devDependencies": { "@firebase/app": "0.13.0", "@firebase/app-compat": "0.4.0", - "@firebase/auth": "1.10.5", + "@firebase/auth": "1.10.6", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index ddff93a8f81..e2317dd8152 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/functions-compat +## 0.3.25 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/functions@0.12.8 + ## 0.3.24 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 56c5bcbb89d..09a4514114c 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.24", + "version": "0.3.25", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -63,7 +63,7 @@ "typings": "dist/src/index.d.ts", "dependencies": { "@firebase/component": "0.6.17", - "@firebase/functions": "0.12.7", + "@firebase/functions": "0.12.8", "@firebase/functions-types": "0.6.3", "@firebase/util": "1.12.0", "tslib": "^2.1.0" diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index 68afc468a1c..dcad8633b23 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.8 + +### Patch Changes + +- [`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac) [#9053](https://github.com/firebase/firebase-js-sdk/pull/9053) - Revert "Fixed scroll behavior (#9043)" + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 0.12.7 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 80ca8986c56..004181eeb39 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.7", + "version": "0.12.8", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 2bb419259cf..48117be7e87 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/storage-compat +## 0.3.22 + +### Patch Changes + +- Updated dependencies [[`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac), [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9)]: + - @firebase/storage@0.13.12 + ## 0.3.21 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 26633a8218c..724685153ce 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.21", + "version": "0.3.22", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,7 +37,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.11", + "@firebase/storage": "0.13.12", "@firebase/storage-types": "0.8.3", "@firebase/util": "1.12.0", "@firebase/component": "0.6.17", @@ -45,7 +45,7 @@ }, "devDependencies": { "@firebase/app-compat": "0.4.0", - "@firebase/auth-compat": "0.5.25", + "@firebase/auth-compat": "0.5.26", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index e123d70cdce..cabce495546 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,13 @@ #Unreleased +## 0.13.12 + +### Patch Changes + +- [`35ad526`](https://github.com/firebase/firebase-js-sdk/commit/35ad5266304e14425988fcf5ad06d028b37588ac) [#9053](https://github.com/firebase/firebase-js-sdk/pull/9053) - Revert "Fixed scroll behavior (#9043)" + +- [`b5df4ae`](https://github.com/firebase/firebase-js-sdk/commit/b5df4ae71c1b5b54d9237e7929d0f793189b82c9) [#9055](https://github.com/firebase/firebase-js-sdk/pull/9055) - Updated to only show banner when calling connect\*Emulator + ## 0.13.11 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 67c205ac245..f7d52a2e8e2 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.11", + "version": "0.13.12", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ }, "devDependencies": { "@firebase/app": "0.13.0", - "@firebase/auth": "1.10.5", + "@firebase/auth": "1.10.6", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", From 9964849e9540f08d02fa3825ecec32c1bfedc62d Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 22 May 2025 10:40:43 -0600 Subject: [PATCH 204/295] Close webchannel instances on terminate (#9041) Explicitly close any unclosed WebChannel instances on Firestore#terminate() --- .changeset/spotty-ghosts-kneel.md | 5 +++ .../platform/browser/webchannel_connection.ts | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .changeset/spotty-ghosts-kneel.md diff --git a/.changeset/spotty-ghosts-kneel.md b/.changeset/spotty-ghosts-kneel.md new file mode 100644 index 00000000000..0db91b7bf19 --- /dev/null +++ b/.changeset/spotty-ghosts-kneel.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Clean up leaked WebChannel instances when the Firestore instance is terminated. diff --git a/packages/firestore/src/platform/browser/webchannel_connection.ts b/packages/firestore/src/platform/browser/webchannel_connection.ts index 9a69164457e..56f57aa9595 100644 --- a/packages/firestore/src/platform/browser/webchannel_connection.ts +++ b/packages/firestore/src/platform/browser/webchannel_connection.ts @@ -59,6 +59,9 @@ export class WebChannelConnection extends RestConnection { private readonly useFetchStreams: boolean; private readonly longPollingOptions: ExperimentalLongPollingOptions; + /** A collection of open WebChannel instances */ + private openWebChannels: WebChannel[] = []; + constructor(info: DatabaseInfo) { super(info); this.forceLongPolling = info.forceLongPolling; @@ -239,6 +242,7 @@ export class WebChannelConnection extends RestConnection { request ); const channel = webchannelTransport.createWebChannel(url, request); + this.addOpenWebChannel(channel); // WebChannel supports sending the first message with the handshake - saving // a network round trip. However, it will have to call send in the same @@ -321,6 +325,7 @@ export class WebChannelConnection extends RestConnection { `RPC '${rpcName}' stream ${streamId} transport closed` ); streamBridge.callOnClose(); + this.removeOpenWebChannel(channel); } }); @@ -427,4 +432,32 @@ export class WebChannelConnection extends RestConnection { }, 0); return streamBridge; } + + /** + * Closes and cleans up any resources associated with the connection. + */ + terminate(): void { + // If the Firestore instance is terminated, we will explicitly + // close any remaining open WebChannel instances. + this.openWebChannels.forEach(webChannel => webChannel.close()); + this.openWebChannels = []; + } + + /** + * Add a WebChannel instance to the collection of open instances. + * @param webChannel + */ + addOpenWebChannel(webChannel: WebChannel): void { + this.openWebChannels.push(webChannel); + } + + /** + * Remove a WebChannel instance from the collection of open instances. + * @param webChannel + */ + removeOpenWebChannel(webChannel: WebChannel): void { + this.openWebChannels = this.openWebChannels.filter( + instance => instance === webChannel + ); + } } From d5e5795c944930eb8df424c3e9bc33e17ab00b84 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 22 May 2025 12:17:01 -0600 Subject: [PATCH 205/295] Reorder reporters to prevent log message duplication in CI (#9040) --- config/karma.base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/karma.base.js b/config/karma.base.js index 9d92053115f..fdfe0d35907 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -68,7 +68,7 @@ const config = { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['mocha', 'coverage-istanbul'], + reporters: ['coverage-istanbul', 'mocha'], // web server port port: 8089, From ec91a8611b069204a9043d55b66e71c7798862ce Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 27 May 2025 09:34:08 -0500 Subject: [PATCH 206/295] docs(ai): Fix 'occured' typo in error codes (#9021) --- docs-devsite/ai.md | 4 ++-- packages/ai/src/types/error.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index c43c0391ba4..9c279febad3 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -448,13 +448,13 @@ export declare const enum AIErrorCode | INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | | INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | | NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_APP\_ID | "no-app-id" | An error occured due to a missing Firebase app ID. | +| NO\_APP\_ID | "no-app-id" | An error occurred due to a missing Firebase app ID. | | NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | | NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | | PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | | REQUEST\_ERROR | "request-error" | An error occurred in a request. | | RESPONSE\_ERROR | "response-error" | An error occurred in a response. | -| UNSUPPORTED | "unsupported" | An error occured due an attempt to use an unsupported feature. | +| UNSUPPORTED | "unsupported" | An error occurred due an attempt to use an unsupported feature. | ## BlockReason diff --git a/packages/ai/src/types/error.ts b/packages/ai/src/types/error.ts index ef3ad7fc30c..84a30f4e872 100644 --- a/packages/ai/src/types/error.ts +++ b/packages/ai/src/types/error.ts @@ -87,7 +87,7 @@ export const enum AIErrorCode { /** An error occurred due to a missing Firebase API key. */ NO_API_KEY = 'no-api-key', - /** An error occured due to a missing Firebase app ID. */ + /** An error occurred due to a missing Firebase app ID. */ NO_APP_ID = 'no-app-id', /** An error occurred due to a model name not being specified during initialization. */ @@ -99,6 +99,6 @@ export const enum AIErrorCode { /** An error occurred while parsing. */ PARSE_FAILED = 'parse-failed', - /** An error occured due an attempt to use an unsupported feature. */ + /** An error occurred due an attempt to use an unsupported feature. */ UNSUPPORTED = 'unsupported' } From 8cb21ffc588d8dd963ad8c78a957eb6929593a3e Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 27 May 2025 09:34:30 -0500 Subject: [PATCH 207/295] feat(ai): Add `HarmBlockThreshold.OFF` (#9050) --- common/api-review/ai.api.md | 3 ++- docs-devsite/ai.md | 1 + packages/ai/src/types/enums.ts | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d096d4c27f6..d24e24e636e 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -518,7 +518,8 @@ export enum HarmBlockThreshold { BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", BLOCK_NONE = "BLOCK_NONE", - BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" + BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", + OFF = "OFF" } // @public diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 9c279febad3..286c8351fd7 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -551,6 +551,7 @@ export declare enum HarmBlockThreshold | BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | | BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | | BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | +| OFF | "OFF" | All content will be allowed. This is the same as BLOCK_NONE, but the metadata corresponding to the [HarmCategory](./ai.md#harmcategory) will not be present in the response. | ## HarmCategory diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 5c6612ce26a..47d654bbcd1 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -58,7 +58,12 @@ export enum HarmBlockThreshold { /** * All content will be allowed. */ - BLOCK_NONE = 'BLOCK_NONE' + BLOCK_NONE = 'BLOCK_NONE', + /** + * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding + * to the {@link HarmCategory} will not be present in the response. + */ + OFF = 'OFF' } /** From 40be2dbb884b8e1485862af8bb015e23db69ccbf Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 27 May 2025 09:35:06 -0500 Subject: [PATCH 208/295] feat(ai): Schema `title`, `maximum`, `minimum`, and `propertyOrdering` (#9047) --- .changeset/tricky-years-pump.md | 6 + common/api-review/ai.api.md | 4 + docs-devsite/ai.schemashared.md | 44 +++ .../ai/src/requests/schema-builder.test.ts | 373 +++++++++--------- packages/ai/src/types/schema.ts | 12 + 5 files changed, 261 insertions(+), 178 deletions(-) create mode 100644 .changeset/tricky-years-pump.md diff --git a/.changeset/tricky-years-pump.md b/.changeset/tricky-years-pump.md new file mode 100644 index 00000000000..94bf68604cc --- /dev/null +++ b/.changeset/tricky-years-pump.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add `title`, `maximum`, `minimum`, `propertyOrdering` to Schema builder diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d24e24e636e..523b51d7533 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -832,10 +832,14 @@ export interface SchemaShared { example?: unknown; format?: string; items?: T; + maximum?: number; + minimum?: number; nullable?: boolean; properties?: { [k: string]: T; }; + propertyOrdering?: string[]; + title?: string; } // @public diff --git a/docs-devsite/ai.schemashared.md b/docs-devsite/ai.schemashared.md index eba57f82935..7f0ed27026c 100644 --- a/docs-devsite/ai.schemashared.md +++ b/docs-devsite/ai.schemashared.md @@ -27,8 +27,12 @@ export interface SchemaShared | [example](./ai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | | [format](./ai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | | [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | +| [maximum](./ai.schemashared.md#schemasharedmaximum) | number | The maximum value of a numeric type. | +| [minimum](./ai.schemashared.md#schemasharedminimum) | number | The minimum value of a numeric type. | | [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | | [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | +| [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint suggesting the order in which the keys should appear in the generated JSON string. | +| [title](./ai.schemashared.md#schemasharedtitle) | string | The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field. | ## SchemaShared.description @@ -80,6 +84,26 @@ Optional. The items of the property. items?: T; ``` +## SchemaShared.maximum + +The maximum value of a numeric type. + +Signature: + +```typescript +maximum?: number; +``` + +## SchemaShared.minimum + +The minimum value of a numeric type. + +Signature: + +```typescript +minimum?: number; +``` + ## SchemaShared.nullable Optional. Whether the property is nullable. @@ -101,3 +125,23 @@ properties?: { [k: string]: T; }; ``` + +## SchemaShared.propertyOrdering + +A hint suggesting the order in which the keys should appear in the generated JSON string. + +Signature: + +```typescript +propertyOrdering?: string[]; +``` + +## SchemaShared.title + +The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field. + +Signature: + +```typescript +title?: string; +``` diff --git a/packages/ai/src/requests/schema-builder.test.ts b/packages/ai/src/requests/schema-builder.test.ts index d05b81381ea..ddf655b738d 100644 --- a/packages/ai/src/requests/schema-builder.test.ts +++ b/packages/ai/src/requests/schema-builder.test.ts @@ -31,11 +31,20 @@ describe('Schema builder', () => { }); }); it('builds integer schema with options and overrides', () => { - const schema = Schema.integer({ nullable: true, format: 'int32' }); + const schema = Schema.integer({ + nullable: true, + format: 'int32', + title: 'Age', + minimum: 0, + maximum: 120 + }); expect(schema.toJSON()).to.eql({ type: 'integer', format: 'int32', - nullable: true + nullable: true, + title: 'Age', + minimum: 0, + maximum: 120 }); }); it('builds number schema', () => { @@ -46,46 +55,60 @@ describe('Schema builder', () => { }); }); it('builds number schema with options and unknown options', () => { - const schema = Schema.number({ format: 'float', futureOption: 'test' }); + const schema = Schema.number({ + format: 'float', + futureOption: 'test', + title: 'Price', + minimum: 0.01, + maximum: 1000.99 + }); expect(schema.toJSON()).to.eql({ type: 'number', format: 'float', futureOption: 'test', - nullable: false + nullable: false, + title: 'Price', + minimum: 0.01, + maximum: 1000.99 }); }); it('builds boolean schema', () => { - const schema = Schema.boolean(); + const schema = Schema.boolean({ title: 'Is Active' }); expect(schema.toJSON()).to.eql({ type: 'boolean', - nullable: false + nullable: false, + title: 'Is Active' }); }); it('builds string schema', () => { - const schema = Schema.string({ description: 'hey' }); + const schema = Schema.string({ description: 'hey', title: 'Greeting' }); expect(schema.toJSON()).to.eql({ type: 'string', description: 'hey', - nullable: false + nullable: false, + title: 'Greeting' }); }); it('builds enumString schema', () => { const schema = Schema.enumString({ example: 'east', - enum: ['east', 'west'] + enum: ['east', 'west'], + title: 'Direction' }); expect(schema.toJSON()).to.eql({ type: 'string', example: 'east', enum: ['east', 'west'], - nullable: false + nullable: false, + title: 'Direction' }); }); it('builds an object schema', () => { const schema = Schema.object({ properties: { 'someInput': Schema.string() - } + }, + title: 'Input Object' }); expect(schema.toJSON()).to.eql({ type: 'object', @@ -96,16 +119,20 @@ describe('Schema builder', () => { nullable: false } }, - required: ['someInput'] + required: ['someInput'], + title: 'Input Object' }); }); - it('builds an object schema with optional properties', () => { + it('builds an object schema with optional properties and propertyOrdering', () => { const schema = Schema.object({ properties: { 'someInput': Schema.string(), - 'someBool': Schema.boolean() + 'someBool': Schema.boolean(), + 'anotherInput': Schema.integer() }, - optionalProperties: ['someBool'] + optionalProperties: ['someBool'], + propertyOrdering: ['someInput', 'anotherInput', 'someBool'], + title: 'Ordered Object' }); expect(schema.toJSON()).to.eql({ type: 'object', @@ -118,9 +145,15 @@ describe('Schema builder', () => { 'someBool': { type: 'boolean', nullable: false + }, + 'anotherInput': { + type: 'integer', + nullable: false } }, - required: ['someInput'] + required: ['someInput', 'anotherInput'], + propertyOrdering: ['someInput', 'anotherInput', 'someBool'], + title: 'Ordered Object' }); }); it('builds layered schema - partially filled out', () => { @@ -128,82 +161,162 @@ describe('Schema builder', () => { items: Schema.object({ properties: { country: Schema.string({ - description: 'A country name' + description: 'A country name', + title: 'Country Name' }), - population: Schema.integer(), + population: Schema.integer({ title: 'Population Count', minimum: 0 }), coordinates: Schema.object({ + title: 'Geographical Coordinates', properties: { - latitude: Schema.number({ format: 'float' }), - longitude: Schema.number({ format: 'double' }) + latitude: Schema.number({ format: 'float', title: 'Latitude' }), + longitude: Schema.number({ format: 'double', title: 'Longitude' }) } }), hemisphere: Schema.object({ + title: 'Hemisphere Information', properties: { - latitudinal: Schema.enumString({ enum: ['N', 'S'] }), - longitudinal: Schema.enumString({ enum: ['E', 'W'] }) + latitudinal: Schema.enumString({ + enum: ['N', 'S'], + title: 'Latitudinal Hemisphere' + }), + longitudinal: Schema.enumString({ + enum: ['E', 'W'], + title: 'Longitudinal Hemisphere' + }) } }), - isCapital: Schema.boolean() + isCapital: Schema.boolean({ title: 'Is Capital City' }) } - }) + }), + title: 'List of Countries' }); - expect(schema.toJSON()).to.eql(layeredSchemaOutputPartial); + const jsonSchema = schema.toJSON(); + expect(jsonSchema.title).to.equal('List of Countries'); + expect(jsonSchema.items?.properties?.country.title).to.equal( + 'Country Name' + ); + expect(jsonSchema.items?.properties?.population.title).to.equal( + 'Population Count' + ); + expect(jsonSchema.items?.properties?.population.minimum).to.equal(0); + expect(jsonSchema.items?.properties?.coordinates.title).to.equal( + 'Geographical Coordinates' + ); + expect(jsonSchema.items?.properties?.hemisphere.title).to.equal( + 'Hemisphere Information' + ); + expect(jsonSchema.items?.properties?.isCapital.title).to.equal( + 'Is Capital City' + ); }); - it('builds layered schema - fully filled out', () => { + it('builds layered schema - fully filled out with new properties', () => { const schema = Schema.array({ + title: 'Detailed Country Profiles', items: Schema.object({ description: 'A country profile', nullable: false, + title: 'Country Profile', + propertyOrdering: [ + 'country', + 'population', + 'isCapital', + 'elevation', + 'coordinates', + 'hemisphere' + ], properties: { country: Schema.string({ nullable: false, description: 'Country name', - format: undefined + format: undefined, + title: 'Official Country Name' }), population: Schema.integer({ nullable: false, description: 'Number of people in country', - format: 'int64' + format: 'int64', + title: 'Total Population', + minimum: 1 }), coordinates: Schema.object({ nullable: false, description: 'Latitude and longitude', + title: 'Capital Coordinates', properties: { latitude: Schema.number({ nullable: false, description: 'Latitude of capital', - format: 'float' + format: 'float', + title: 'Latitude Value', + minimum: -90, + maximum: 90 }), longitude: Schema.number({ nullable: false, description: 'Longitude of capital', - format: 'double' + format: 'double', + title: 'Longitude Value', + minimum: -180, + maximum: 180 }) } }), hemisphere: Schema.object({ nullable: false, description: 'Hemisphere(s) country is in', + title: 'Geographical Hemispheres', properties: { - latitudinal: Schema.enumString({ enum: ['N', 'S'] }), - longitudinal: Schema.enumString({ enum: ['E', 'W'] }) + latitudinal: Schema.enumString({ + enum: ['N', 'S'], + title: 'Latitudinal' + }), + longitudinal: Schema.enumString({ + enum: ['E', 'W'], + title: 'Longitudinal' + }) } }), isCapital: Schema.boolean({ nullable: false, - description: "This doesn't make a lot of sense but it's a demo" + description: "This doesn't make a lot of sense but it's a demo", + title: 'Is it a capital?' }), elevation: Schema.integer({ nullable: false, - description: 'Average elevation', - format: 'float' + description: 'Average elevation in meters', + format: 'int32', + title: 'Average Elevation (m)', + minimum: -500, + maximum: 9000 }) }, optionalProperties: [] }) }); - expect(schema.toJSON()).to.eql(layeredSchemaOutput); + const jsonResult = schema.toJSON(); + expect(jsonResult.title).to.equal('Detailed Country Profiles'); + expect(jsonResult.items?.title).to.equal('Country Profile'); + expect(jsonResult.items?.propertyOrdering).to.deep.equal([ + 'country', + 'population', + 'isCapital', + 'elevation', + 'coordinates', + 'hemisphere' + ]); + expect(jsonResult.items?.properties?.population.title).to.equal( + 'Total Population' + ); + expect(jsonResult.items?.properties?.population.minimum).to.equal(1); + expect( + jsonResult.items?.properties?.coordinates.properties?.latitude.maximum + ).to.equal(90); + expect(jsonResult.items?.properties?.elevation.title).to.equal( + 'Average Elevation (m)' + ); + expect(jsonResult.items?.properties?.elevation.minimum).to.equal(-500); + expect(jsonResult.items?.properties?.elevation.maximum).to.equal(9000); }); it('can override "nullable" and set optional properties', () => { const schema = Schema.object({ @@ -245,149 +358,53 @@ describe('Schema builder', () => { }); expect(() => schema.toJSON()).to.throw(AIErrorCode.INVALID_SCHEMA); }); -}); + it('builds schema with minimum and maximum for integer', () => { + const schema = Schema.integer({ minimum: 5, maximum: 10, title: 'Rating' }); + expect(schema.toJSON()).to.eql({ + type: 'integer', + nullable: false, + minimum: 5, + maximum: 10, + title: 'Rating' + }); + }); -const layeredSchemaOutputPartial = { - 'type': 'array', - 'nullable': false, - 'items': { - 'type': 'object', - 'nullable': false, - 'properties': { - 'country': { - 'type': 'string', - 'description': 'A country name', - 'nullable': false - }, - 'population': { - 'type': 'integer', - 'nullable': false - }, - 'coordinates': { - 'type': 'object', - 'nullable': false, - 'properties': { - 'latitude': { - 'type': 'number', - 'format': 'float', - 'nullable': false - }, - 'longitude': { - 'type': 'number', - 'format': 'double', - 'nullable': false - } - }, - 'required': ['latitude', 'longitude'] - }, - 'hemisphere': { - 'type': 'object', - 'nullable': false, - 'properties': { - 'latitudinal': { - 'type': 'string', - 'nullable': false, - 'enum': ['N', 'S'] - }, - 'longitudinal': { - 'type': 'string', - 'nullable': false, - 'enum': ['E', 'W'] - } - }, - 'required': ['latitudinal', 'longitudinal'] - }, - 'isCapital': { - 'type': 'boolean', - 'nullable': false - } - }, - 'required': [ - 'country', - 'population', - 'coordinates', - 'hemisphere', - 'isCapital' - ] - } -}; + it('builds schema with minimum and maximum for number', () => { + const schema = Schema.number({ + minimum: 1.5, + maximum: 9.9, + title: 'Measurement' + }); + expect(schema.toJSON()).to.eql({ + type: 'number', + nullable: false, + minimum: 1.5, + maximum: 9.9, + title: 'Measurement' + }); + }); -const layeredSchemaOutput = { - 'type': 'array', - 'nullable': false, - 'items': { - 'type': 'object', - 'description': 'A country profile', - 'nullable': false, - 'required': [ - 'country', - 'population', - 'coordinates', - 'hemisphere', - 'isCapital', - 'elevation' - ], - 'properties': { - 'country': { - 'type': 'string', - 'description': 'Country name', - 'nullable': false - }, - 'population': { - 'type': 'integer', - 'format': 'int64', - 'description': 'Number of people in country', - 'nullable': false - }, - 'coordinates': { - 'type': 'object', - 'description': 'Latitude and longitude', - 'nullable': false, - 'required': ['latitude', 'longitude'], - 'properties': { - 'latitude': { - 'type': 'number', - 'format': 'float', - 'description': 'Latitude of capital', - 'nullable': false - }, - 'longitude': { - 'type': 'number', - 'format': 'double', - 'description': 'Longitude of capital', - 'nullable': false - } - } - }, - 'hemisphere': { - 'type': 'object', - 'description': 'Hemisphere(s) country is in', - 'nullable': false, - 'required': ['latitudinal', 'longitudinal'], - 'properties': { - 'latitudinal': { - 'type': 'string', - 'nullable': false, - 'enum': ['N', 'S'] - }, - 'longitudinal': { - 'type': 'string', - 'nullable': false, - 'enum': ['E', 'W'] - } - } + it('builds object schema with propertyOrdering', () => { + const schema = Schema.object({ + title: 'User Data', + properties: { + name: Schema.string(), + age: Schema.integer(), + email: Schema.string() }, - 'isCapital': { - 'type': 'boolean', - 'description': "This doesn't make a lot of sense but it's a demo", - 'nullable': false + propertyOrdering: ['name', 'email', 'age'] + }); + expect(schema.toJSON()).to.eql({ + type: 'object', + nullable: false, + title: 'User Data', + properties: { + name: { type: 'string', nullable: false }, + age: { type: 'integer', nullable: false }, + email: { type: 'string', nullable: false } }, - 'elevation': { - 'type': 'integer', - 'format': 'float', - 'description': 'Average elevation', - 'nullable': false - } - } - } -}; + required: ['name', 'age', 'email'], + propertyOrdering: ['name', 'email', 'age'] + }); + }); +}); diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index e9fe9286b61..9cfdfad654b 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -49,18 +49,30 @@ export interface SchemaShared { format?: string; /** Optional. The description of the property. */ description?: string; + /** + * The title of the property. This helps document the schema's purpose but does not typically + * constrain the generated value. It can subtly guide the model by clarifying the intent of a + * field. + */ + title?: string; /** Optional. The items of the property. */ items?: T; /** Optional. Map of `Schema` objects. */ properties?: { [k: string]: T; }; + /** A hint suggesting the order in which the keys should appear in the generated JSON string. */ + propertyOrdering?: string[]; /** Optional. The enum of the property. */ enum?: string[]; /** Optional. The example of the property. */ example?: unknown; /** Optional. Whether the property is nullable. */ nullable?: boolean; + /** The minimum value of a numeric type. */ + minimum?: number; + /** The maximum value of a numeric type. */ + maximum?: number; [key: string]: unknown; } From 1933324e0f3e4c8ed4d4d784f0c701fd0ec6ebc3 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 28 May 2025 08:29:22 -0500 Subject: [PATCH 209/295] feat(ai): Add support for `minItems` and `maxItems` to `Schema` (#9026) --- .changeset/angry-scissors-sit.md | 6 ++ common/api-review/ai.api.md | 5 ++ docs-devsite/ai.schema.md | 33 +++++++ docs-devsite/ai.schemashared.md | 22 +++++ .../ai/src/requests/schema-builder.test.ts | 87 +++++++++++++++++++ packages/ai/src/requests/schema-builder.ts | 6 ++ packages/ai/src/types/schema.ts | 4 + 7 files changed, 163 insertions(+) create mode 100644 .changeset/angry-scissors-sit.md diff --git a/.changeset/angry-scissors-sit.md b/.changeset/angry-scissors-sit.md new file mode 100644 index 00000000000..8aeb7dcaf52 --- /dev/null +++ b/.changeset/angry-scissors-sit.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add support for `minItems` and `maxItems` to `Schema`. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 523b51d7533..23c13688fb1 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -791,6 +791,9 @@ export abstract class Schema implements SchemaInterface { format?: string; // (undocumented) static integer(integerParams?: SchemaParams): IntegerSchema; + items?: SchemaInterface; + maxItems?: number; + minItems?: number; nullable: boolean; // (undocumented) static number(numberParams?: SchemaParams): NumberSchema; @@ -833,7 +836,9 @@ export interface SchemaShared { format?: string; items?: T; maximum?: number; + maxItems?: number; minimum?: number; + minItems?: number; nullable?: boolean; properties?: { [k: string]: T; diff --git a/docs-devsite/ai.schema.md b/docs-devsite/ai.schema.md index b0681b0cdf3..fa1225c91e5 100644 --- a/docs-devsite/ai.schema.md +++ b/docs-devsite/ai.schema.md @@ -32,6 +32,9 @@ export declare abstract class Schema implements SchemaInterface | [description](./ai.schema.md#schemadescription) | | string | Optional. The description of the property. | | [example](./ai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | | [format](./ai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| +| [items](./ai.schema.md#schemaitems) | | [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | Optional. The items of the property. | +| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | +| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | | [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | | [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). | @@ -93,6 +96,36 @@ Optional. The format of the property. Supported formats:
  • for NUMBE format?: string; ``` +## Schema.items + +Optional. The items of the property. + +Signature: + +```typescript +items?: SchemaInterface; +``` + +## Schema.maxItems + +The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). + +Signature: + +```typescript +maxItems?: number; +``` + +## Schema.minItems + +The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). + +Signature: + +```typescript +minItems?: number; +``` + ## Schema.nullable Optional. Whether the property is nullable. Defaults to false. diff --git a/docs-devsite/ai.schemashared.md b/docs-devsite/ai.schemashared.md index 7f0ed27026c..fb75fc50841 100644 --- a/docs-devsite/ai.schemashared.md +++ b/docs-devsite/ai.schemashared.md @@ -28,7 +28,9 @@ export interface SchemaShared | [format](./ai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | | [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | | [maximum](./ai.schemashared.md#schemasharedmaximum) | number | The maximum value of a numeric type. | +| [maxItems](./ai.schemashared.md#schemasharedmaxitems) | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | | [minimum](./ai.schemashared.md#schemasharedminimum) | number | The minimum value of a numeric type. | +| [minItems](./ai.schemashared.md#schemasharedminitems) | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | | [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | | [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | | [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint suggesting the order in which the keys should appear in the generated JSON string. | @@ -94,6 +96,16 @@ The maximum value of a numeric type. maximum?: number; ``` +## SchemaShared.maxItems + +The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). + +Signature: + +```typescript +maxItems?: number; +``` + ## SchemaShared.minimum The minimum value of a numeric type. @@ -104,6 +116,16 @@ The minimum value of a numeric type. minimum?: number; ``` +## SchemaShared.minItems + +The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). + +Signature: + +```typescript +minItems?: number; +``` + ## SchemaShared.nullable Optional. Whether the property is nullable. diff --git a/packages/ai/src/requests/schema-builder.test.ts b/packages/ai/src/requests/schema-builder.test.ts index ddf655b738d..27de1076c5f 100644 --- a/packages/ai/src/requests/schema-builder.test.ts +++ b/packages/ai/src/requests/schema-builder.test.ts @@ -103,6 +103,93 @@ describe('Schema builder', () => { title: 'Direction' }); }); + describe('Schema.array', () => { + it('builds an array schema with basic items', () => { + const schema = Schema.array({ + items: Schema.string() + }); + expect(schema.toJSON()).to.eql({ + type: 'array', + nullable: false, + items: { + type: 'string', + nullable: false + } + }); + }); + + it('builds an array schema with items and minItems', () => { + const schema = Schema.array({ + items: Schema.number(), + minItems: 1 + }); + expect(schema.toJSON()).to.eql({ + type: 'array', + nullable: false, + items: { + type: 'number', + nullable: false + }, + minItems: 1 + }); + }); + + it('builds an array schema with items and maxItems', () => { + const schema = Schema.array({ + items: Schema.boolean(), + maxItems: 10 + }); + expect(schema.toJSON()).to.eql({ + type: 'array', + nullable: false, + items: { + type: 'boolean', + nullable: false + }, + maxItems: 10 + }); + }); + + it('builds an array schema with items, minItems, and maxItems', () => { + const schema = Schema.array({ + items: Schema.integer(), + minItems: 0, + maxItems: 5 + }); + expect(schema.toJSON()).to.eql({ + type: 'array', + nullable: false, + items: { + type: 'integer', + nullable: false + }, + minItems: 0, + maxItems: 5 + }); + }); + + it('builds an array schema with items, minItems, maxItems, and other options', () => { + const schema = Schema.array({ + items: Schema.string({ description: 'A list of names' }), + minItems: 1, + maxItems: 3, + nullable: true, + description: 'An array of strings' + }); + expect(schema.toJSON()).to.eql({ + type: 'array', + nullable: true, + description: 'An array of strings', + items: { + type: 'string', + description: 'A list of names', + nullable: false + }, + minItems: 1, + maxItems: 3 + }); + }); + }); it('builds an object schema', () => { const schema = Schema.object({ properties: { diff --git a/packages/ai/src/requests/schema-builder.ts b/packages/ai/src/requests/schema-builder.ts index 524cfdb1c20..7d9ece462b3 100644 --- a/packages/ai/src/requests/schema-builder.ts +++ b/packages/ai/src/requests/schema-builder.ts @@ -49,6 +49,12 @@ export abstract class Schema implements SchemaInterface { format?: string; /** Optional. The description of the property. */ description?: string; + /** Optional. The items of the property. */ + items?: SchemaInterface; + /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + minItems?: number; + /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + maxItems?: number; /** Optional. Whether the property is nullable. Defaults to false. */ nullable: boolean; /** Optional. The example of the property. */ diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index 9cfdfad654b..3a6c0c7301b 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -57,6 +57,10 @@ export interface SchemaShared { title?: string; /** Optional. The items of the property. */ items?: T; + /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + minItems?: number; + /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + maxItems?: number; /** Optional. Map of `Schema` objects. */ properties?: { [k: string]: T; From af9f8b552d313cff3537dcfbbc3e33bbdca78311 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 30 May 2025 13:00:02 -0700 Subject: [PATCH 210/295] Build out e2e subdirectories (#9065) --- .github/workflows/e2e-test.yml | 8 +- e2e/README.md | 95 +---- e2e/{ => smoke-tests}/.gitignore | 0 e2e/smoke-tests/README.md | 92 +++++ e2e/{ => smoke-tests}/babel.config.js | 0 e2e/{ => smoke-tests}/build/index.html | 0 .../fix-jsdom-environment.ts | 0 e2e/{ => smoke-tests}/jest.config.ts | 0 e2e/{ => smoke-tests}/package.json | 0 e2e/{ => smoke-tests}/sample-apps/compat.js | 2 +- e2e/{ => smoke-tests}/sample-apps/modular.js | 2 +- e2e/{ => smoke-tests}/tests/compat.test.ts | 0 e2e/{ => smoke-tests}/tests/modular.test.ts | 0 e2e/{ => smoke-tests}/webpack.config.js | 0 e2e/{ => smoke-tests}/yarn.lock | 367 ++++++++---------- e2e/template/README.md | 3 + e2e/template/index.js | 18 + e2e/template/package.json | 15 + e2e/template/yarn.lock | 8 + 19 files changed, 322 insertions(+), 288 deletions(-) rename e2e/{ => smoke-tests}/.gitignore (100%) create mode 100644 e2e/smoke-tests/README.md rename e2e/{ => smoke-tests}/babel.config.js (100%) rename e2e/{ => smoke-tests}/build/index.html (100%) rename e2e/{ => smoke-tests}/fix-jsdom-environment.ts (100%) rename e2e/{ => smoke-tests}/jest.config.ts (100%) rename e2e/{ => smoke-tests}/package.json (100%) rename e2e/{ => smoke-tests}/sample-apps/compat.js (99%) rename e2e/{ => smoke-tests}/sample-apps/modular.js (99%) rename e2e/{ => smoke-tests}/tests/compat.test.ts (100%) rename e2e/{ => smoke-tests}/tests/modular.test.ts (100%) rename e2e/{ => smoke-tests}/webpack.config.js (100%) rename e2e/{ => smoke-tests}/yarn.lock (96%) create mode 100644 e2e/template/README.md create mode 100644 e2e/template/index.js create mode 100644 e2e/template/package.json create mode 100644 e2e/template/yarn.lock diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 0857860571f..fbf43beada1 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -30,8 +30,8 @@ jobs: defaults: run: - # Run any command steps in the /e2e subdir - working-directory: './e2e' + # Run any command steps in the /e2e/smoke-tests subdir + working-directory: './e2e/smoke-tests' steps: - name: Checkout Repo @@ -53,7 +53,9 @@ jobs: - name: Poll npm until version to test is available for install run: | echo "Polling npm for firebase@${{ github.event.client_payload.versionOrTag }}" - node ../scripts/release/poll-npm-publish.js + node ./scripts/release/poll-npm-publish.js + # run in root + working-directory: '.' env: VERSION: ${{ github.event.client_payload.versionOrTag }} - name: Yarn install diff --git a/e2e/README.md b/e2e/README.md index b2674506e8b..25223edb371 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -1,92 +1,11 @@ -# Firebase JS SDK E2E Tests +# E2E Tests -This directory contains end-to-end tests for the Firebase JS SDK package as well as minimal quick start sample apps for debugging and development. +This directory is for Firebase E2E tests that are completely independent of the main SDK workspaces. Packages in here should: -## E2E Tests +* Have a start trigger independent of the main CI PR/push triggers (e.g., manual trigger, repository_dispatch, from an external runner like Kokoro, etc.) + + A common use case might be to clone this repo, cd into the chosen directory under e2e, npm install, and run npm scripts. -### Setup +* Have a self-contained set of NPM dependencies. They should not depend on the local version of Firebase in the SDK nor assume inherited availability of any packages in the top level package.json of this repo (typescript, firebase, karma, etc.). -Before running the tests, you will need: - -- a project config -- a test user with an email/password login which has read/write privileges for Storage, Realtime Database, and Firestore -- an App Check debug token -- to deploy the `callTest` Cloud Function - -#### Project Config and Test User - -Create a file named `firebase-config.js` in the top level of this `e2e/` directory. The contents of the file should be: - -```javascript -// A config for a project -export const config = { - apiKey: ************, - authDomain: ************, - databaseURL: ************, - projectId: ************, - storageBucket: ************, - messagingSenderId: ************, - appId: ************, - measurementId: ************ -}; - * -// A user account with read/write privileges in that project -// for storage, database, firestore -export const testAccount = { - email: ************, - password: ************ -} -``` - -#### App Check Debug Token - -Create an App Check debug token in the Firebase Console. Assign it to an environment variable in your shell named `APP_CHECK_DEBUG_TOKEN`. - -#### Deploy `callTest` Cloud Function - -From the top level of the firebase repo, ensure you have the Firebase CLI (`firebase-tools`) installed (if not, `npm install -g firebase-tools`). - -Ensure you are logged in using the CLI (`firebase login`); - -Then deploy the function with: -`firebase deploy --only functions:callTest --project YOUR_PROJECT_ID` - -### Running the Tests - -To run the tests on the default modular API: - -``` -yarn test:modular -``` - -To run the tests on the compat API: - -``` -yarn test:compat -``` - -## Sample Apps - -Two minimal sample apps are provided for quick debugging and development. These apps import and initialize every product in the SDK and call some basic methods. Products can easily be commented out to focus on one or more products you are interested in looking at. - -### Setup - -The setup is the same as for the E2E tests above. Certain tests can be skipped if you are commenting out that product (e.g, no need to deploy the Cloud Function if you are commenting out the `callFunctions()` line in the sample app, and no need to set the App Check debug token env variable if not using App Check). - -### Running Sample Apps - -To run the modular sample app (uses current default version of the API): - -``` -yarn start:modular -``` - -Then open `localhost:8080` in a browser. - -To run the compat sample app (uses current compat version of the API): - -``` -yarn start:compat -``` - -Then open `localhost:8080` in a browser. \ No newline at end of file +See the `template/` directory for an example. \ No newline at end of file diff --git a/e2e/.gitignore b/e2e/smoke-tests/.gitignore similarity index 100% rename from e2e/.gitignore rename to e2e/smoke-tests/.gitignore diff --git a/e2e/smoke-tests/README.md b/e2e/smoke-tests/README.md new file mode 100644 index 00000000000..eb72486e95e --- /dev/null +++ b/e2e/smoke-tests/README.md @@ -0,0 +1,92 @@ +# Firebase JS SDK E2E Tests + +This directory contains end-to-end tests for the Firebase JS SDK package as well as minimal quick start sample apps for debugging and development. + +## E2E Tests + +### Setup + +Before running the tests, you will need: + +- a project config +- a test user with an email/password login which has read/write privileges for Storage, Realtime Database, and Firestore +- an App Check debug token +- to deploy the `callTest` Cloud Function + +#### Project Config and Test User + +Create a file named `firebase-config.js` in the top level of this `e2e/smoke-tests` directory. The contents of the file should be: + +```javascript +// A config for a project +export const config = { + apiKey: ************, + authDomain: ************, + databaseURL: ************, + projectId: ************, + storageBucket: ************, + messagingSenderId: ************, + appId: ************, + measurementId: ************ +}; + * +// A user account with read/write privileges in that project +// for storage, database, firestore +export const testAccount = { + email: ************, + password: ************ +} +``` + +#### App Check Debug Token + +Create an App Check debug token in the Firebase Console. Assign it to an environment variable in your shell named `APP_CHECK_DEBUG_TOKEN`. + +#### Deploy `callTest` Cloud Function + +From the top level of the firebase repo, ensure you have the Firebase CLI (`firebase-tools`) installed (if not, `npm install -g firebase-tools`). + +Ensure you are logged in using the CLI (`firebase login`); + +Then deploy the function with: +`firebase deploy --only functions:callTest --project YOUR_PROJECT_ID` + +### Running the Tests + +To run the tests on the default modular API: + +``` +yarn test:modular +``` + +To run the tests on the compat API: + +``` +yarn test:compat +``` + +## Sample Apps + +Two minimal sample apps are provided for quick debugging and development. These apps import and initialize every product in the SDK and call some basic methods. Products can easily be commented out to focus on one or more products you are interested in looking at. + +### Setup + +The setup is the same as for the E2E tests above. Certain tests can be skipped if you are commenting out that product (e.g, no need to deploy the Cloud Function if you are commenting out the `callFunctions()` line in the sample app, and no need to set the App Check debug token env variable if not using App Check). + +### Running Sample Apps + +To run the modular sample app (uses current default version of the API): + +``` +yarn start:modular +``` + +Then open `localhost:8080` in a browser. + +To run the compat sample app (uses current compat version of the API): + +``` +yarn start:compat +``` + +Then open `localhost:8080` in a browser. \ No newline at end of file diff --git a/e2e/babel.config.js b/e2e/smoke-tests/babel.config.js similarity index 100% rename from e2e/babel.config.js rename to e2e/smoke-tests/babel.config.js diff --git a/e2e/build/index.html b/e2e/smoke-tests/build/index.html similarity index 100% rename from e2e/build/index.html rename to e2e/smoke-tests/build/index.html diff --git a/e2e/fix-jsdom-environment.ts b/e2e/smoke-tests/fix-jsdom-environment.ts similarity index 100% rename from e2e/fix-jsdom-environment.ts rename to e2e/smoke-tests/fix-jsdom-environment.ts diff --git a/e2e/jest.config.ts b/e2e/smoke-tests/jest.config.ts similarity index 100% rename from e2e/jest.config.ts rename to e2e/smoke-tests/jest.config.ts diff --git a/e2e/package.json b/e2e/smoke-tests/package.json similarity index 100% rename from e2e/package.json rename to e2e/smoke-tests/package.json diff --git a/e2e/sample-apps/compat.js b/e2e/smoke-tests/sample-apps/compat.js similarity index 99% rename from e2e/sample-apps/compat.js rename to e2e/smoke-tests/sample-apps/compat.js index 478b960d8e0..e77b7d087d0 100644 --- a/e2e/sample-apps/compat.js +++ b/e2e/smoke-tests/sample-apps/compat.js @@ -82,7 +82,7 @@ async function authLogout() { * * Call a deployed function. * This cloud function must be deployed in this project first. See - * e2e/README.md for more info. + * e2e/smoke-test/README.md for more info. */ async function callFunctions() { console.log('[FUNCTIONS] start'); diff --git a/e2e/sample-apps/modular.js b/e2e/smoke-tests/sample-apps/modular.js similarity index 99% rename from e2e/sample-apps/modular.js rename to e2e/smoke-tests/sample-apps/modular.js index d01b5b0139d..2d66b752081 100644 --- a/e2e/sample-apps/modular.js +++ b/e2e/smoke-tests/sample-apps/modular.js @@ -121,7 +121,7 @@ async function authLogout(app) { * * Call a deployed function. * This cloud function must be deployed in this project first. See - * e2e/README.md for more info. + * e2e/smoke-tests/README.md for more info. */ async function callFunctions(app) { console.log('[FUNCTIONS] start'); diff --git a/e2e/tests/compat.test.ts b/e2e/smoke-tests/tests/compat.test.ts similarity index 100% rename from e2e/tests/compat.test.ts rename to e2e/smoke-tests/tests/compat.test.ts diff --git a/e2e/tests/modular.test.ts b/e2e/smoke-tests/tests/modular.test.ts similarity index 100% rename from e2e/tests/modular.test.ts rename to e2e/smoke-tests/tests/modular.test.ts diff --git a/e2e/webpack.config.js b/e2e/smoke-tests/webpack.config.js similarity index 100% rename from e2e/webpack.config.js rename to e2e/smoke-tests/webpack.config.js diff --git a/e2e/yarn.lock b/e2e/smoke-tests/yarn.lock similarity index 96% rename from e2e/yarn.lock rename to e2e/smoke-tests/yarn.lock index c20459aecdd..b9a6d8e4451 100644 --- a/e2e/yarn.lock +++ b/e2e/smoke-tests/yarn.lock @@ -19,16 +19,7 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/code-frame@^7.25.9": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz" - integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/code-frame@^7.26.0": +"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz" integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== @@ -47,7 +38,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz" integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== -"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.0.0-0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.12.0", "@babel/core@^7.13.0", "@babel/core@^7.4.0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.8.0", "@babel/core@7.26.8": +"@babel/core@7.26.8": version "7.26.8" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz" integrity sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ== @@ -69,49 +60,7 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.11.6": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.12.3": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/core@^7.23.9": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -354,34 +303,20 @@ "@babel/template" "^7.26.9" "@babel/types" "^7.26.9" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz" integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== dependencies: "@babel/types" "^7.26.3" -"@babel/parser@^7.25.9": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz" - integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== - dependencies: - "@babel/types" "^7.26.0" - -"@babel/parser@^7.26.0": +"@babel/parser@^7.25.9", "@babel/parser@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz" integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== dependencies: "@babel/types" "^7.26.0" -"@babel/parser@^7.26.3": - version "7.26.3" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz" - integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== - dependencies: - "@babel/types" "^7.26.3" - "@babel/parser@^7.26.8", "@babel/parser@^7.26.9": version "7.26.9" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz" @@ -1120,15 +1055,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0": - version "7.26.3" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" - integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@babel/types@^7.20.7": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.3", "@babel/types@^7.3.3": version "7.26.3" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== @@ -1144,14 +1071,6 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@babel/types@^7.26.3", "@babel/types@^7.3.3": - version "7.26.3" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz" - integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/types@^7.26.8", "@babel/types@^7.26.9": version "7.26.9" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz" @@ -1190,6 +1109,8 @@ "@firebase/analytics-compat@0.2.20-20250512211235": version "0.2.20-20250512211235" + resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.20-20250512211235.tgz#725ebf8e94ad9aba4ed22f79206c1a2420190a82" + integrity sha512-2MmqqNlHlbs6454pOnKnNbtz8cF54UYgCiFWc0tXV6VNrSAGAyWgY3Ujve5+ayuSmzMuTaLNKk8kOPC90nNmCA== dependencies: "@firebase/analytics" "0.10.14-20250512211235" "@firebase/analytics-types" "0.8.3" @@ -1204,6 +1125,8 @@ "@firebase/analytics@0.10.14-20250512211235": version "0.10.14-20250512211235" + resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.14-20250512211235.tgz#0c9fb8e352e0e641168d1968e616a0c775a4392f" + integrity sha512-yPo0D9Ec5jSWRmI6JYt8PCzTVUHtTvnmhN7s09Wh2ckrbv7kgejIAYOjKOK30Umro+teA6wTsY07Q27C1dOM4A== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/installations" "0.6.15-20250512211235" @@ -1213,6 +1136,8 @@ "@firebase/app-check-compat@0.3.23-20250512211235": version "0.3.23-20250512211235" + resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.23-20250512211235.tgz#f060c925f2bcd936299504a5f34bc81ea872388f" + integrity sha512-iI2mGM/f8z4aQhoB57HnErh8vCqyQJFVQS7USLy6dUyL15FcIe5HQ88N4oD9glagu4IDRlZ+Rohlrw9ObbyNxA== dependencies: "@firebase/app-check" "0.10.0-20250512211235" "@firebase/app-check-types" "0.5.3" @@ -1233,6 +1158,8 @@ "@firebase/app-check@0.10.0-20250512211235": version "0.10.0-20250512211235" + resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.10.0-20250512211235.tgz#304ae95ed148d0837f64b94527d6b2b68966b117" + integrity sha512-zFbNyt3j6ixg6/Gh3WdA+FvMhUxIRASEq/NRC+Jtofm5la5ZJ88wdLDJ/kSHtdMINQfKuneHbJJ832u5BTqpYQ== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1241,6 +1168,8 @@ "@firebase/app-compat@0.4.0-20250512211235": version "0.4.0-20250512211235" + resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.4.0-20250512211235.tgz#4ae94412aa00afcf4663919af564e321ea17b335" + integrity sha512-epnyKsA97L0FMigDHWOcgJ2TeMnlpuyiGIVZdnQiElKfRs3UFgDvBb6AK5dHgT4REe7ZbXqGa/8TSUUGFhEcmw== dependencies: "@firebase/app" "0.13.0-20250512211235" "@firebase/component" "0.6.15-20250512211235" @@ -1248,13 +1177,15 @@ "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/app-types@0.9.3", "@firebase/app-types@0.x": +"@firebase/app-types@0.9.3": version "0.9.3" resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz" integrity sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw== -"@firebase/app@0.13.0-20250512211235", "@firebase/app@0.x": +"@firebase/app@0.13.0-20250512211235": version "0.13.0-20250512211235" + resolved "https://registry.npmjs.org/@firebase/app/-/app-0.13.0-20250512211235.tgz#b8028efcd45ac07b3304ac361008f08b0cfa445f" + integrity sha512-9qcJX9fKMFuZf5+8BxK0Dg1gJU+x4shoH+VFiKnZ7ri6sJ0OP67Y4PnHDYdzKmx7/HJt0KSyZMDUX/hT2Wbl/g== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1264,6 +1195,8 @@ "@firebase/auth-compat@0.5.23-20250512211235": version "0.5.23-20250512211235" + resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.23-20250512211235.tgz#130b8583e137bae9b7e288e8991583ff04b1ab25" + integrity sha512-dWBbbYAiNmrD6+P5m2TgQ9GWPIffjedQ9HRXnPyqKytTiEQzxvYBd91NS3y3YI6bBg1RWAWccMnwtQVjl1eK6A== dependencies: "@firebase/auth" "1.10.3-20250512211235" "@firebase/auth-types" "0.13.0" @@ -1283,6 +1216,8 @@ "@firebase/auth@1.10.3-20250512211235": version "1.10.3-20250512211235" + resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.10.3-20250512211235.tgz#47f55c228e4eb441050914c6e545ccb1f021a712" + integrity sha512-f7Lov3vogDMyroncY7OipDmNL5bqZcDxdIVe1qN/LEaaKygG2wPxKMa+LjSFwxwo/oGp/i6R4ixT8otMkOL2MQ== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1299,12 +1234,16 @@ "@firebase/component@0.6.15-20250512211235": version "0.6.15-20250512211235" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.15-20250512211235.tgz#91f4f234904480f34d26aa41922b8cf4603944c2" + integrity sha512-8U//EzcIE6frUcWUMcmrVzWBAXLBZt2eGWwt8Of1y+yU6t3Zwwu+1JpCz0hbiHpzXnkuTFjPwWA6fKgZQTk0MQ== dependencies: "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" "@firebase/data-connect@0.3.6-20250512211235": version "0.3.6-20250512211235" + resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.3.6-20250512211235.tgz#f20ee3c0cc576f000244ad769e1813151e2aa3cd" + integrity sha512-ZMs7lX9/Sd7XNRaylht535sY1mFUasLCY0toKQWF4KIAdUeij0TNzqWpeULNqNJXtczu+eRrG3Nct1rY4JtiiQ== dependencies: "@firebase/auth-interop-types" "0.2.4" "@firebase/component" "0.6.15-20250512211235" @@ -1314,6 +1253,8 @@ "@firebase/database-compat@2.0.7-20250512211235": version "2.0.7-20250512211235" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.7-20250512211235.tgz#0d78c287cab62583d46525c690469576787aca22" + integrity sha512-8bt/9/EXqxce32RDg254yfkEUsG9x9h3K6+IFdsCeLhPH9mQLosrcRBSHusHGX65oNbY1ATgxkt/+v+uhoj+nw== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/database" "1.0.16-20250512211235" @@ -1324,12 +1265,16 @@ "@firebase/database-types@1.0.12-20250512211235": version "1.0.12-20250512211235" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.12-20250512211235.tgz#4b89e43e99e0fb621fc4abcec792d027c0669f44" + integrity sha512-FsZ/VeSyNLaJWQGLP0Yy955Zonlm/WSPhpdOpof84ToKAekUQobxlI08skPe+Gk2dAUnKrdqfGJPO9pagsByYA== dependencies: "@firebase/app-types" "0.9.3" "@firebase/util" "1.12.0-20250512211235" "@firebase/database@1.0.16-20250512211235": version "1.0.16-20250512211235" + resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.16-20250512211235.tgz#223f45e9010574d361cbaa53e56b51dab17a804d" + integrity sha512-l2jVH/uCzbuAhCYk37+YWFHE2nIkGyTiFL3RthkDvoT+KHDzvaIxnWmjnbAgrQEYSHaimziiw0DmpQM+Safb0g== dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" @@ -1341,6 +1286,8 @@ "@firebase/firestore-compat@0.3.48-20250512211235": version "0.3.48-20250512211235" + resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.48-20250512211235.tgz#547d62fd41bc15495c26f9675d9ed24ff3c3f50c" + integrity sha512-8nWD3QRkN9rUoApULVfBMg112QNYstUWRm58cMwcdp0Wkx6+RV+9YraDYzg7GmsEklL4CnGF36HGNrtzraxOTg== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/firestore" "4.7.13-20250512211235" @@ -1355,6 +1302,8 @@ "@firebase/firestore@4.7.13-20250512211235": version "4.7.13-20250512211235" + resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.13-20250512211235.tgz#cdebb6b7ddba2b7738896458327ae064bb6b540e" + integrity sha512-m3xEnbYrsgp58a5if00Vqrrglm/22yU7amZ3CjwqUD+/M6TFSf1a9lvMqF9S33AuPbwHDxUb3hJ4ogpTQ+uSjQ== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1366,6 +1315,8 @@ "@firebase/functions-compat@0.3.22-20250512211235": version "0.3.22-20250512211235" + resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.22-20250512211235.tgz#2ce718de863e7a26a9ec2f7e19ab6a15cb375306" + integrity sha512-/CrVsUlcVKoCtuzpYzIfBYjdiCBtpMkDIY3M2/MIKv5gwB90ydX4E2OP/E57Ne85eiYfezYoGurt27OXSno/Fg== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/functions" "0.12.5-20250512211235" @@ -1380,6 +1331,8 @@ "@firebase/functions@0.12.5-20250512211235": version "0.12.5-20250512211235" + resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.12.5-20250512211235.tgz#17696d8918136e319459628a43ea45e08e9bfa39" + integrity sha512-3BTjMHjx4ulr22+G1/ut8ZQW6OTGmpS5LC+2MhTl/W8OgSYP+3Hc844OhhlDq4kBjcWO752PG2+I1JwJNK6rPA== dependencies: "@firebase/app-check-interop-types" "0.3.3" "@firebase/auth-interop-types" "0.2.4" @@ -1390,6 +1343,8 @@ "@firebase/installations-compat@0.2.15-20250512211235": version "0.2.15-20250512211235" + resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.15-20250512211235.tgz#5c91a48c29c358164fe34f254f1509b7404373ca" + integrity sha512-i7sV28ZLE8p65lHyy/vni93aiIKIyo7PuOUNyaMnfdam++Sv2mBkNj0koo9B6LidDaWxZ3gZJ2bTxSyPOOukYg== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/installations" "0.6.15-20250512211235" @@ -1404,6 +1359,8 @@ "@firebase/installations@0.6.15-20250512211235": version "0.6.15-20250512211235" + resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.15-20250512211235.tgz#c0b5b07feda48a92b72e7d919a2a2f524a632b35" + integrity sha512-RinZjbNpImsz0JGi6u6B6Yb7ezrE6ej2pdBT7K3ju1cScpBmKRBeWSl7AevD5PEH+W9E5i6U2VX+q2gycI3ZRA== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/util" "1.12.0-20250512211235" @@ -1419,6 +1376,8 @@ "@firebase/messaging-compat@0.2.19-20250512211235": version "0.2.19-20250512211235" + resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.19-20250512211235.tgz#1980cc4c931085742e568596d7b28af0853aa020" + integrity sha512-vTL0hMyPosU/WRvZ1xmi01aURJyjUI3zeBByYnnwSUJN01eF0YX7eM1RId/HSFcHoT/HgfsHFvINUFjy58TVUQ== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/messaging" "0.12.19-20250512211235" @@ -1432,6 +1391,8 @@ "@firebase/messaging@0.12.19-20250512211235": version "0.12.19-20250512211235" + resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.19-20250512211235.tgz#f225f480879c8a550d2927d314ae62e17f30355f" + integrity sha512-h4fraiJuJrLSOSI6WIFlbV1u6L6/8zPfTzcNxqyjCIVj5eFVpgoLIW5lQ2O+G6h6RQiWG29AJkuWGnp26BOJ6Q== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/installations" "0.6.15-20250512211235" @@ -1442,6 +1403,8 @@ "@firebase/performance-compat@0.2.17-20250512211235": version "0.2.17-20250512211235" + resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.17-20250512211235.tgz#ead4a1201effd57aef5a8e1a4353196d6bde9b41" + integrity sha512-5uUlGWbEyoTzGa0JaS6OIUl5T69VwK4gYRAjcET79kuVSZU85l4M1gsDbXqhl/YH1o/gpQEPmm1T1UrK9bRQbw== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1457,6 +1420,8 @@ "@firebase/performance@0.7.4-20250512211235": version "0.7.4-20250512211235" + resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.4-20250512211235.tgz#fadf55c6e8072320e8660e1b8dd97e3d3561650f" + integrity sha512-defCXX20kxX05/3b4qI+V2PreeH/qwn1Egvp82geS+hGyK6cDRFGgV7q94tIcc6idQJoRhsSW32ABKdI99XpWg== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/installations" "0.6.15-20250512211235" @@ -1467,6 +1432,8 @@ "@firebase/remote-config-compat@0.2.15-20250512211235": version "0.2.15-20250512211235" + resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.15-20250512211235.tgz#cb391f23f46aea88e3df0a7f1edb15d24000e965" + integrity sha512-DiHaFVywKBG1GGziN/NA5k8qkvJ68gX+AFe63yQOmzAfvH59W+dbxAgSG116pGrfF3xDH/e/lho4Cs3M6tbL8g== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/logger" "0.4.4" @@ -1482,6 +1449,8 @@ "@firebase/remote-config@0.6.2-20250512211235": version "0.6.2-20250512211235" + resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.6.2-20250512211235.tgz#c19a7057fdb4493efc70c065cebd85b0841744ee" + integrity sha512-FR/IDz/AkQiSXXZw80OJEl/MT++URfbrrUDev3p1Dgc5yuz2hGCReuiq/YYVTA3n/yppwY+BnRdVidV9dRaHSQ== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/installations" "0.6.15-20250512211235" @@ -1491,6 +1460,8 @@ "@firebase/storage-compat@0.3.19-20250512211235": version "0.3.19-20250512211235" + resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.19-20250512211235.tgz#d81a8cd4fb7c5222d11e8c4f67f83f48c8d064f6" + integrity sha512-Qz3kRo4qc6wRSDq/sCRT9ITqT/Of4puErdhideN+GBi40m42bLWOqBkxpkzPmHphOmFNwKUBA8/9Cksr/fj6IA== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/storage" "0.13.9-20250512211235" @@ -1505,12 +1476,14 @@ "@firebase/storage@0.13.9-20250512211235": version "0.13.9-20250512211235" + resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.9-20250512211235.tgz#1d809b25797bd118ee9b83ac220d8a6ae0eafed8" + integrity sha512-68vuBOmYVUu93Tbri++ubk8ECASRQWYnB1cvPpfBT0WoLSgdgxj+2F/+buXqzFZT/3ae8FBcEdgK6cD0gcT7tA== dependencies: "@firebase/component" "0.6.15-20250512211235" "@firebase/util" "1.12.0-20250512211235" tslib "^2.1.0" -"@firebase/util@1.11.1", "@firebase/util@1.x": +"@firebase/util@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@firebase/util/-/util-1.11.1.tgz" integrity sha512-RXg4WE8C2LUrvoV/TMGRTu223zZf9Dq9MR8yHZio9nF9TpLnpCPURw9VWWB2WATDl6HfIdWfl2x2SJYtHkN4hw== @@ -1787,14 +1760,6 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" @@ -1803,6 +1768,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsonjoy.com/base64@^1.1.1": version "1.1.2" resolved "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz" @@ -1990,18 +1963,24 @@ "@types/eslint-scope@^3.7.7": version "3.7.7" + resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== dependencies: "@types/eslint" "*" "@types/estree" "*" "@types/eslint@*": version "9.6.1" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== dependencies: "@types/estree" "*" "@types/json-schema" "*" "@types/estree@*", "@types/estree@^1.0.6": version "1.0.7" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8" + integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ== "@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0": version "5.0.1" @@ -2033,7 +2012,7 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/express@^4.17.13", "@types/express@^4.17.21": +"@types/express@^4.17.21": version "4.17.21" resolved "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz" integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== @@ -2202,7 +2181,7 @@ dependencies: "@types/yargs-parser" "*" -"@webassemblyjs/ast@^1.14.1", "@webassemblyjs/ast@1.14.1": +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz" integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== @@ -2270,6 +2249,8 @@ "@webassemblyjs/wasm-edit@^1.14.1": version "1.14.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== dependencies: "@webassemblyjs/ast" "1.14.1" "@webassemblyjs/helper-buffer" "1.14.1" @@ -2301,7 +2282,7 @@ "@webassemblyjs/wasm-gen" "1.14.1" "@webassemblyjs/wasm-parser" "1.14.1" -"@webassemblyjs/wasm-parser@^1.14.1", "@webassemblyjs/wasm-parser@1.14.1": +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": version "1.14.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz" integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== @@ -2381,6 +2362,8 @@ acorn@^8.1.0, acorn@^8.11.0, acorn@^8.4.1, acorn@^8.8.1: acorn@^8.14.0: version "8.14.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== acorn@^8.8.2: version "8.13.0" @@ -2413,7 +2396,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.12.4, ajv@^6.9.1: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2423,7 +2406,7 @@ ajv@^6.12.4, ajv@^6.9.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.8.2, ajv@^8.9.0: +ajv@^8.0.0, ajv@^8.9.0: version "8.17.1" resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== @@ -2492,7 +2475,7 @@ asynckit@^0.4.0: resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -babel-jest@^29.7.0, babel-jest@29.7.0: +babel-jest@29.7.0, babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== @@ -2650,7 +2633,7 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.24.0, "browserslist@>= 4.21.0": +browserslist@^4.24.0: version "4.24.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -2967,13 +2950,6 @@ data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@4: - version "4.3.7" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== - dependencies: - ms "^2.1.3" - debug@2.6.9: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" @@ -2981,6 +2957,13 @@ debug@2.6.9: dependencies: ms "2.0.0" +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: + version "4.3.7" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + decimal.js@^10.4.2: version "10.4.3" resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" @@ -3028,16 +3011,16 @@ delayed-stream@~1.0.0: resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== - depd@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== + destroy@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz" @@ -3323,7 +3306,7 @@ fastest-levenshtein@^1.0.12: resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== -faye-websocket@^0.11.3, faye-websocket@0.11.4: +faye-websocket@0.11.4, faye-websocket@^0.11.3: version "0.11.4" resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== @@ -3585,16 +3568,6 @@ http-deceiver@^1.2.7: resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz" integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" - integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - http-errors@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" @@ -3606,6 +3579,16 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" + integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + http-parser-js@>=0.5.1: version "0.5.8" resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz" @@ -3698,7 +3681,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3, inherits@2, inherits@2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3713,16 +3696,16 @@ interpret@^3.1.1: resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz" integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -ipaddr.js@^2.1.0: - version "2.2.0" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz" - integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== - ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +ipaddr.js@^2.1.0: + version "2.2.0" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz" + integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" @@ -4101,7 +4084,7 @@ jest-resolve-dependencies@^29.7.0: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@*, jest-resolve@^29.7.0: +jest-resolve@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== @@ -4469,16 +4452,16 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -"mime-db@>= 1.43.0 < 2": - version "1.53.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz" - integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +"mime-db@>= 1.43.0 < 2": + version "1.53.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz" + integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== + mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" @@ -4508,16 +4491,16 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" -ms@^2.1.3, ms@2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== +ms@2.1.3, ms@^2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + multicast-dns@^7.2.5: version "7.2.5" resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz" @@ -4588,7 +4571,7 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -on-finished@^2.4.1, on-finished@2.4.1: +on-finished@2.4.1, on-finished@^2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== @@ -4967,20 +4950,15 @@ run-applescript@^7.0.0: resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz" integrity sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A== -safe-buffer@^5.1.0, safe-buffer@>=5.1.0, safe-buffer@~5.2.0, safe-buffer@5.2.1: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" @@ -5041,12 +5019,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3: - version "7.6.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - -semver@^7.5.4: +semver@^7.5.3, semver@^7.5.4: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -5180,14 +5153,6 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" @@ -5196,6 +5161,14 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" @@ -5236,29 +5209,15 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - statuses@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== string-length@^4.0.1: version "4.0.2" @@ -5277,6 +5236,20 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -5330,6 +5303,8 @@ tapable@^2.1.1, tapable@^2.2.0: terser-webpack-plugin@^5.3.11: version "5.3.14" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" + integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -5405,7 +5380,7 @@ tree-dump@^1.0.1: resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz" integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== -ts-node@>=9.0.0, ts-node@10.9.2: +ts-node@10.9.2: version "10.9.2" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== @@ -5424,7 +5399,7 @@ ts-node@>=9.0.0, ts-node@10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tslib@^2, tslib@^2.0.0, tslib@^2.1.0, tslib@2: +tslib@^2.0.0, tslib@^2.1.0: version "2.8.0" resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz" integrity sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA== @@ -5447,7 +5422,7 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@>=2.7, typescript@5.5.4: +typescript@5.5.4: version "5.5.4" resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== @@ -5485,7 +5460,7 @@ universalify@^0.2.0: resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -unpipe@~1.0.0, unpipe@1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -5586,7 +5561,7 @@ webidl-conversions@^7.0.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -webpack-cli@5.1.4, webpack-cli@5.x.x: +webpack-cli@5.1.4: version "5.1.4" resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz" integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== @@ -5664,8 +5639,10 @@ webpack-sources@^3.2.3: resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.0.0, webpack@^5.1.0, webpack@>=2, webpack@5.98.0, webpack@5.x.x: +webpack@5.98.0: version "5.98.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz#44ae19a8f2ba97537978246072fb89d10d1fbd17" + integrity sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.6" @@ -5691,7 +5668,7 @@ webpack@^5.0.0, webpack@^5.1.0, webpack@>=2, webpack@5.98.0, webpack@5.x.x: watchpack "^2.4.1" webpack-sources "^3.2.3" -websocket-driver@^0.7.4, websocket-driver@>=0.5.1: +websocket-driver@>=0.5.1, websocket-driver@^0.7.4: version "0.7.4" resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== diff --git a/e2e/template/README.md b/e2e/template/README.md new file mode 100644 index 00000000000..ef2b2deb997 --- /dev/null +++ b/e2e/template/README.md @@ -0,0 +1,3 @@ +# E2E Test Package Template + +This is a template for an E2E test package. It contains one small dependency (date-fns) not used in the global monorepo workspace to confirm the dependencies in this directory do not affect the global workspace. \ No newline at end of file diff --git a/e2e/template/index.js b/e2e/template/index.js new file mode 100644 index 00000000000..1e3a1a5d9af --- /dev/null +++ b/e2e/template/index.js @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 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. + */ + +console.log('hello'); diff --git a/e2e/template/package.json b/e2e/template/package.json new file mode 100644 index 00000000000..c07c4c5c080 --- /dev/null +++ b/e2e/template/package.json @@ -0,0 +1,15 @@ +{ + "name": "test-project", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "date-fns": "4.1.0" + } +} diff --git a/e2e/template/yarn.lock b/e2e/template/yarn.lock new file mode 100644 index 00000000000..4d7e448a31b --- /dev/null +++ b/e2e/template/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +date-fns@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz#64b3d83fff5aa80438f5b1a633c2e83b8a1c2d14" + integrity sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg== From 30de503ec90f1ccbece0485b42d689b8e41cfe73 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Fri, 30 May 2025 13:42:29 -0700 Subject: [PATCH 211/295] Added test project to fdc (#8924) --- .../js/default-connector/README.md | 257 ++++++ .../js/default-connector/esm/index.esm.js | 55 ++ .../js/default-connector/esm/package.json | 1 + .../js/default-connector/index.cjs.js | 56 ++ .../js/default-connector/index.d.ts | 86 ++ .../js/default-connector/package.json | 25 + .../dataconnect/connector/connector.yaml | 6 + .../dataconnect/connector/mutations.gql | 33 + .../dataconnect/connector/queries.gql | 78 ++ e2e/data-connect/dataconnect/dataconnect.yaml | 12 + .../dataconnect/schema/schema.gql | 52 ++ e2e/data-connect/dataconnect/test | 0 e2e/data-connect/firebase-js-config.json | 3 + e2e/data-connect/firebase.json | 10 + e2e/data-connect/package.json | 21 + e2e/data-connect/test.ts | 23 + e2e/data-connect/tsconfig.json | 10 + e2e/data-connect/yarn.lock | 814 ++++++++++++++++++ 18 files changed, 1542 insertions(+) create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/README.md create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/esm/index.esm.js create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/esm/package.json create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/index.cjs.js create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/index.d.ts create mode 100644 e2e/data-connect/dataconnect-generated/js/default-connector/package.json create mode 100644 e2e/data-connect/dataconnect/connector/connector.yaml create mode 100644 e2e/data-connect/dataconnect/connector/mutations.gql create mode 100644 e2e/data-connect/dataconnect/connector/queries.gql create mode 100644 e2e/data-connect/dataconnect/dataconnect.yaml create mode 100644 e2e/data-connect/dataconnect/schema/schema.gql create mode 100644 e2e/data-connect/dataconnect/test create mode 100644 e2e/data-connect/firebase-js-config.json create mode 100644 e2e/data-connect/firebase.json create mode 100644 e2e/data-connect/package.json create mode 100644 e2e/data-connect/test.ts create mode 100644 e2e/data-connect/tsconfig.json create mode 100644 e2e/data-connect/yarn.lock diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/README.md b/e2e/data-connect/dataconnect-generated/js/default-connector/README.md new file mode 100644 index 00000000000..b3f5971d704 --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/README.md @@ -0,0 +1,257 @@ +# Table of Contents +- [**Overview**](#generated-typescript-readme) +- [**Accessing the connector**](#accessing-the-connector) + - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) +- [**Queries**](#queries) + - [*ListMovies*](#listmovies) +- [**Mutations**](#mutations) + - [*CreateMovie*](#createmovie) + +# Generated TypeScript README +This README will guide you through the process of using the generated TypeScript SDK package for the connector `default`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. + +***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.* + +You can use this generated SDK by importing from the package `@firebasegen/default-connector` as shown below. Both CommonJS and ESM imports are supported. + +You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client). + +# Accessing the connector +A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default`. + +You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). + +```javascript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@firebasegen/default-connector'; + +const dataConnect = getDataConnect(connectorConfig); +``` + +## Connecting to the local Emulator +By default, the connector will connect to the production service. + +To connect to the emulator, you can use the following code. +You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients). + +```javascript +import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@firebasegen/default-connector'; + +const dataConnect = getDataConnect(connectorConfig); +connectDataConnectEmulator(dataConnect, 'localhost', 9399); +``` + +After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) from your generated SDK. + +# Queries + +There are two ways to execute a Data Connect Query using the generated Web SDK: +- Using a Query Reference function, which returns a `QueryRef` + - The `QueryRef` can be used as an argument to `executeQuery()`, which will execute the Query and return a `QueryPromise` +- Using an action shortcut function, which returns a `QueryPromise` + - Calling the action shortcut function will execute the Query and return a `QueryPromise` + +The following is true for both the action shortcut function and the `QueryRef` function: +- The `QueryPromise` returned will resolve to the result of the Query once it has finished executing +- If the Query accepts arguments, both the action shortcut function and the `QueryRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Query +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default` connector's generated functions to execute each query. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-queries). + +## ListMovies +You can execute the `ListMovies` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): +```javascript +listMovies(): QueryPromise; + +listMoviesRef(): QueryRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```javascript +listMovies(dc: DataConnect): QueryPromise; + +listMoviesRef(dc: DataConnect): QueryRef; +``` + +### Variables +The `ListMovies` query has no variables. +### Return Type +Recall that executing the `ListMovies` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `ListMoviesData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: +```javascript +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} +``` +### Using `ListMovies`'s action shortcut function + +```javascript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, listMovies } from '@firebasegen/default-connector'; + + +// Call the `listMovies()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await listMovies(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await listMovies(dataConnect); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +listMovies().then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +### Using `ListMovies`'s `QueryRef` function + +```javascript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, listMoviesRef } from '@firebasegen/default-connector'; + + +// Call the `listMoviesRef()` function to get a reference to the query. +const ref = listMoviesRef(); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = listMoviesRef(dataConnect); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +# Mutations + +There are two ways to execute a Data Connect Mutation using the generated Web SDK: +- Using a Mutation Reference function, which returns a `MutationRef` + - The `MutationRef` can be used as an argument to `executeMutation()`, which will execute the Mutation and return a `MutationPromise` +- Using an action shortcut function, which returns a `MutationPromise` + - Calling the action shortcut function will execute the Mutation and return a `MutationPromise` + +The following is true for both the action shortcut function and the `MutationRef` function: +- The `MutationPromise` returned will resolve to the result of the Mutation once it has finished executing +- If the Mutation accepts arguments, both the action shortcut function and the `MutationRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Mutation +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default` connector's generated functions to execute each mutation. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-mutations). + +## CreateMovie +You can execute the `CreateMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): +```javascript +createMovie(vars: CreateMovieVariables): MutationPromise; + +createMovieRef(vars: CreateMovieVariables): MutationRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```javascript +createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; + +createMovieRef(dc: DataConnect, vars: CreateMovieVariables): MutationRef; +``` + +### Variables +The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: + +```javascript +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} +``` +### Return Type +Recall that executing the `CreateMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `CreateMovieData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: +```javascript +export interface CreateMovieData { + movie_insert: Movie_Key; +} +``` +### Using `CreateMovie`'s action shortcut function + +```javascript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, createMovie, CreateMovieVariables } from '@firebasegen/default-connector'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await createMovie(createMovieVars); +// Variables can be defined inline as well. +const { data } = await createMovie({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await createMovie(dataConnect, createMovieVars); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +createMovie(createMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + +### Using `CreateMovie`'s `MutationRef` function + +```javascript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, createMovieRef, CreateMovieVariables } from '@firebasegen/default-connector'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovieRef()` function to get a reference to the mutation. +const ref = createMovieRef(createMovieVars); +// Variables can be defined inline as well. +const ref = createMovieRef({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = createMovieRef(dataConnect, createMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/esm/index.esm.js b/e2e/data-connect/dataconnect-generated/js/default-connector/esm/index.esm.js new file mode 100644 index 00000000000..e88d2d56d35 --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/esm/index.esm.js @@ -0,0 +1,55 @@ +/** + * @license + * Copyright 2025 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 { + queryRef, + executeQuery, + mutationRef, + executeMutation, + validateArgs +} from 'firebase/data-connect'; + +export const connectorConfig = { + connector: 'default', + service: 'fdc-test', + location: 'us-central1' +}; + +export function createMovieRef(dcOrVars, vars) { + const { dc: dcInstance, vars: inputVars } = validateArgs( + connectorConfig, + dcOrVars, + vars, + true + ); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} + +export function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +} + +export function listMoviesRef(dc) { + const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} + +export function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +} diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/esm/package.json b/e2e/data-connect/dataconnect-generated/js/default-connector/esm/package.json new file mode 100644 index 00000000000..7c34deb5837 --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/index.cjs.js b/e2e/data-connect/dataconnect-generated/js/default-connector/index.cjs.js new file mode 100644 index 00000000000..814406ff090 --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/index.cjs.js @@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2025 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. + */ + +const { + queryRef, + executeQuery, + mutationRef, + executeMutation, + validateArgs +} = require('firebase/data-connect'); + +const connectorConfig = { + connector: 'default', + service: 'fdc-test', + location: 'us-central1' +}; +exports.connectorConfig = connectorConfig; + +exports.createMovieRef = function createMovieRef(dcOrVars, vars) { + const { dc: dcInstance, vars: inputVars } = validateArgs( + connectorConfig, + dcOrVars, + vars, + true + ); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +}; + +exports.createMovie = function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +}; + +exports.listMoviesRef = function listMoviesRef(dc) { + const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +}; + +exports.listMovies = function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +}; diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/index.d.ts b/e2e/data-connect/dataconnect-generated/js/default-connector/index.d.ts new file mode 100644 index 00000000000..474fefd0f4b --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/index.d.ts @@ -0,0 +1,86 @@ +/** + * @license + * Copyright 2025 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 { + ConnectorConfig, + DataConnect, + QueryRef, + QueryPromise, + MutationRef, + MutationPromise +} from 'firebase/data-connect'; + +export const connectorConfig: ConnectorConfig; + +export type TimestampString = string; +export type UUIDString = string; +export type Int64String = string; +export type DateString = string; + +export interface CreateMovieData { + movie_insert: Movie_Key; +} + +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} + +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} + +export interface Movie_Key { + id: UUIDString; + __typename?: 'Movie_Key'; +} + +/* Allow users to create refs without passing in DataConnect */ +export function createMovieRef( + vars: CreateMovieVariables +): MutationRef; +/* Allow users to pass in custom DataConnect instances */ +export function createMovieRef( + dc: DataConnect, + vars: CreateMovieVariables +): MutationRef; + +export function createMovie( + vars: CreateMovieVariables +): MutationPromise; +export function createMovie( + dc: DataConnect, + vars: CreateMovieVariables +): MutationPromise; + +/* Allow users to create refs without passing in DataConnect */ +export function listMoviesRef(): QueryRef; +/* Allow users to pass in custom DataConnect instances */ +export function listMoviesRef( + dc: DataConnect +): QueryRef; + +export function listMovies(): QueryPromise; +export function listMovies( + dc: DataConnect +): QueryPromise; diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/package.json b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json new file mode 100644 index 00000000000..d0c9852ce3e --- /dev/null +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json @@ -0,0 +1,25 @@ +{ + "name": "@firebasegen/default-connector", + "version": "1.0.0", + "author": "Firebase (https://firebase.google.com/)", + "description": "Generated SDK For default", + "license": "Apache-2.0", + "engines": { + "node": " >=18.0" + }, + "typings": "index.d.ts", + "module": "esm/index.esm.js", + "main": "index.cjs.js", + "browser": "esm/index.esm.js", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs.js", + "default": "./esm/index.esm.js" + }, + "./package.json": "./package.json" + }, + "peerDependencies": { + "firebase": "^10.14.0 || ^11.3.0" + } +} \ No newline at end of file diff --git a/e2e/data-connect/dataconnect/connector/connector.yaml b/e2e/data-connect/dataconnect/connector/connector.yaml new file mode 100644 index 00000000000..b698515fe9f --- /dev/null +++ b/e2e/data-connect/dataconnect/connector/connector.yaml @@ -0,0 +1,6 @@ +connectorId: default +generate: + javascriptSdk: + outputDir: ../../dataconnect-generated/js/default-connector + package: "@firebasegen/default-connector" +# packageJsonDir: ../.. diff --git a/e2e/data-connect/dataconnect/connector/mutations.gql b/e2e/data-connect/dataconnect/connector/mutations.gql new file mode 100644 index 00000000000..2379afeb89c --- /dev/null +++ b/e2e/data-connect/dataconnect/connector/mutations.gql @@ -0,0 +1,33 @@ +# # Example mutations for a simple movie app + +# # Create a movie based on user input +mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!) +@auth(level: USER_EMAIL_VERIFIED) { + movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl }) +} + +# # Upsert (update or insert) a user's username based on their auth.uid +# mutation UpsertUser($username: String!) @auth(level: USER) { +# # The "auth.uid" server value ensures that users can only register their own user. +# user_upsert(data: { id_expr: "auth.uid", username: $username }) +# } + +# # Add a review for a movie +# mutation AddReview($movieId: UUID!, $rating: Int!, $reviewText: String!) +# @auth(level: USER) { +# review_upsert( +# data: { +# userId_expr: "auth.uid" +# movieId: $movieId +# rating: $rating +# reviewText: $reviewText +# # reviewDate defaults to today in the schema. No need to set it manually. +# } +# ) +# } + +# # Logged in user can delete their review for a movie +# mutation DeleteReview($movieId: UUID!) @auth(level: USER) { +# # The "auth.uid" server value ensures that users can only delete their own reviews. +# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId }) +# } diff --git a/e2e/data-connect/dataconnect/connector/queries.gql b/e2e/data-connect/dataconnect/connector/queries.gql new file mode 100644 index 00000000000..cb1a6f630bc --- /dev/null +++ b/e2e/data-connect/dataconnect/connector/queries.gql @@ -0,0 +1,78 @@ +# # Example queries for a simple movie app. + +# # @auth() directives control who can call each operation. +# # Anyone should be able to list all movies, so the auth level is set to PUBLIC +query ListMovies @auth(level: PUBLIC) { + movies { + id + title + imageUrl + genre + } +} + +# # List all users, only admins should be able to list all users, so we use NO_ACCESS +# query ListUsers @auth(level: NO_ACCESS) { +# users { +# id +# username +# } +# } + +# # Logged in users can list all their reviews and movie titles associated with the review +# # Since the query uses the uid of the current authenticated user, we set auth level to USER +# query ListUserReviews @auth(level: USER) { +# user(key: { id_expr: "auth.uid" }) { +# id +# username +# # _on_ makes it easy to grab info from another table +# # Here, we use it to grab all the reviews written by the user. +# reviews: reviews_on_user { +# rating +# reviewDate +# reviewText +# movie { +# id +# title +# } +# } +# } +# } + +# # Get movie by id +# query GetMovieById($id: UUID!) @auth(level: PUBLIC) { +# movie(id: $id) { +# id +# title +# imageUrl +# genre +# metadata: movieMetadata_on_movie { +# rating +# releaseYear +# description +# } +# reviews: reviews_on_movie { +# reviewText +# reviewDate +# rating +# user { +# id +# username +# } +# } +# } +# } + +# # Search for movies, actors, and reviews +# query SearchMovie($titleInput: String, $genre: String) @auth(level: PUBLIC) { +# movies( +# where: { +# _and: [{ genre: { eq: $genre } }, { title: { contains: $titleInput } }] +# } +# ) { +# id +# title +# genre +# imageUrl +# } +# } diff --git a/e2e/data-connect/dataconnect/dataconnect.yaml b/e2e/data-connect/dataconnect/dataconnect.yaml new file mode 100644 index 00000000000..623fad3e209 --- /dev/null +++ b/e2e/data-connect/dataconnect/dataconnect.yaml @@ -0,0 +1,12 @@ +specVersion: "v1beta" +serviceId: "fdc-test" +location: "us-central1" +schema: + source: "./schema" + datasource: + postgresql: + database: "fdcdb" + cloudSql: + instanceId: "fdc-test-fdc" + # schemaValidation: "COMPATIBLE" +connectorDirs: ["./connector"] diff --git a/e2e/data-connect/dataconnect/schema/schema.gql b/e2e/data-connect/dataconnect/schema/schema.gql new file mode 100644 index 00000000000..f114d9a678a --- /dev/null +++ b/e2e/data-connect/dataconnect/schema/schema.gql @@ -0,0 +1,52 @@ +# # Example schema for simple movie review app + +# # User table is keyed by Firebase Auth UID. +# type User @table { +# # `@default(expr: "auth.uid")` sets it to Firebase Auth UID during insert and upsert. +# id: String! @default(expr: "auth.uid") +# username: String! @col(dataType: "varchar(50)") +# # The `user: User!` field in the Review table generates the following one-to-many query field. +# # reviews_on_user: [Review!]! +# # The `Review` join table the following many-to-many query field. +# # movies_via_Review: [Movie!]! +# } + +# # Movie is keyed by a randomly generated UUID. +type Movie @table { + # If you do not pass a 'key' to `@table`, Data Connect automatically adds the following 'id' column. + # Feel free to uncomment and customize it. + # id: UUID! @default(expr: "uuidV4()") + title: String! + imageUrl: String! + genre: String +} + +# # MovieMetadata is a metadata attached to a Movie. +# # Movie <-> MovieMetadata is a one-to-one relationship +# type MovieMetadata @table { +# # @unique ensures each Movie can only one MovieMetadata. +# movie: Movie! @unique +# # The movie field adds the following foreign key field. Feel free to uncomment and customize it. +# # movieId: UUID! +# rating: Float +# releaseYear: Int +# description: String +# } + +# # Reviews is a join table between User and Movie. +# # It has a composite primary keys `userUid` and `movieId`. +# # A user can leave reviews for many movies. A movie can have reviews from many users. +# # User <-> Review is a one-to-many relationship +# # Movie <-> Review is a one-to-many relationship +# # Movie <-> User is a many-to-many relationship +# type Review @table(name: "Reviews", key: ["movie", "user"]) { +# user: User! +# # The user field adds the following foreign key field. Feel free to uncomment and customize it. +# # userUid: String! +# movie: Movie! +# # The movie field adds the following foreign key field. Feel free to uncomment and customize it. +# # movieId: UUID! +# rating: Int +# reviewText: String +# reviewDate: Date! @default(expr: "request.time") +# } diff --git a/e2e/data-connect/dataconnect/test b/e2e/data-connect/dataconnect/test new file mode 100644 index 00000000000..e69de29bb2d diff --git a/e2e/data-connect/firebase-js-config.json b/e2e/data-connect/firebase-js-config.json new file mode 100644 index 00000000000..0e0dcd235c4 --- /dev/null +++ b/e2e/data-connect/firebase-js-config.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/e2e/data-connect/firebase.json b/e2e/data-connect/firebase.json new file mode 100644 index 00000000000..6c9ad90b440 --- /dev/null +++ b/e2e/data-connect/firebase.json @@ -0,0 +1,10 @@ +{ + "emulators": { + "dataconnect": { + "dataDir": "dataconnect/.dataconnect/pgliteData" + } + }, + "dataconnect": { + "source": "dataconnect" + } +} diff --git a/e2e/data-connect/package.json b/e2e/data-connect/package.json new file mode 100644 index 00000000000..d9d1f234ab1 --- /dev/null +++ b/e2e/data-connect/package.json @@ -0,0 +1,21 @@ +{ + "name": "firebase-dataconnect-kokoro-test", + "version": "1.0.0", + "description": "", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "18.19.83", + "ts-node": "^10.9.2", + "tslib": "^2.1.0", + "typescript": "5.5.4" + }, + "dependencies": { + "firebase": "11.8.1" + } +} diff --git a/e2e/data-connect/test.ts b/e2e/data-connect/test.ts new file mode 100644 index 00000000000..cc177b8e47c --- /dev/null +++ b/e2e/data-connect/test.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2025 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 { listMovies } from './dataconnect-generated/js/default-connector'; +import * as json from './firebase-js-config.json'; +import { initializeApp } from 'firebase/app'; + +initializeApp(json); +listMovies(); diff --git a/e2e/data-connect/tsconfig.json b/e2e/data-connect/tsconfig.json new file mode 100644 index 00000000000..e3c427a3163 --- /dev/null +++ b/e2e/data-connect/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "CommonJS", + "resolveJsonModule": true, + "sourceMap": true, + "noEmit": true, + "skipLibCheck": false + } + } diff --git a/e2e/data-connect/yarn.lock b/e2e/data-connect/yarn.lock new file mode 100644 index 00000000000..d8d5a981fef --- /dev/null +++ b/e2e/data-connect/yarn.lock @@ -0,0 +1,814 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@firebase/ai@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@firebase/ai/-/ai-1.3.0.tgz#66b8edaa32d8e5d46c99be0efc337cbf034dffb7" + integrity sha512-qBxJTtl9hpgZr050kVFTRADX6I0Ss6mEQyp/JEkBgKwwxixKnaRNqEDGFba4OKNL7K8E4Y7LlA/ZW6L8aCKH4A== + dependencies: + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/analytics-compat@0.2.22": + version "0.2.22" + resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.22.tgz#5ec880cf719642c233742ad805ba95e5b4dad999" + integrity sha512-VogWHgwkdYhjWKh8O1XU04uPrRaiDihkWvE/EMMmtWtaUtVALnpLnUurc3QtSKdPnvTz5uaIGKlW84DGtSPFbw== + dependencies: + "@firebase/analytics" "0.10.16" + "@firebase/analytics-types" "0.8.3" + "@firebase/component" "0.6.17" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/analytics-types@0.8.3": + version "0.8.3" + resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.8.3.tgz#d08cd39a6209693ca2039ba7a81570dfa6c1518f" + integrity sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg== + +"@firebase/analytics@0.10.16": + version "0.10.16" + resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.16.tgz#516f211465060008538fed46c7f78f0ea14dd549" + integrity sha512-cMtp19He7Fd6uaj/nDEul+8JwvJsN8aRSJyuA1QN3QrKvfDDp+efjVurJO61sJpkVftw9O9nNMdhFbRcTmTfRQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/installations" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/app-check-compat@0.3.25": + version "0.3.25" + resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.25.tgz#03d1941dba78626bdacf544f9d1d48b451dbb49c" + integrity sha512-3zrsPZWAKfV7DVC20T2dgfjzjtQnSJS65OfMOiddMUtJL1S5i0nAZKsdX0bOEvvrd0SBIL8jYnfpfDeQRnhV3w== + dependencies: + "@firebase/app-check" "0.10.0" + "@firebase/app-check-types" "0.5.3" + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/app-check-interop-types@0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz#ed9c4a4f48d1395ef378f007476db3940aa5351a" + integrity sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A== + +"@firebase/app-check-types@0.5.3": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@firebase/app-check-types/-/app-check-types-0.5.3.tgz#38ba954acf4bffe451581a32fffa20337f11d8e5" + integrity sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng== + +"@firebase/app-check@0.10.0": + version "0.10.0" + resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.10.0.tgz#dc833ead2b31930eee13b5c9eb028091c630d21b" + integrity sha512-AZlRlVWKcu8BH4Yf8B5EI8sOi2UNGTS8oMuthV45tbt6OVUTSQwFPIEboZzhNJNKY+fPsg7hH8vixUWFZ3lrhw== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/app-compat@0.4.0": + version "0.4.0" + resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.4.0.tgz#4c908115b2a68756e4944ee8f9bc7042d8715f92" + integrity sha512-LjLUrzbUgTa/sCtPoLKT2C7KShvLVHS3crnU1Du02YxnGVLE0CUBGY/NxgfR/Zg84mEbj1q08/dgesojxjn0dA== + dependencies: + "@firebase/app" "0.13.0" + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/app-types@0.9.3": + version "0.9.3" + resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.9.3.tgz#8408219eae9b1fb74f86c24e7150a148460414ad" + integrity sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw== + +"@firebase/app@0.13.0": + version "0.13.0" + resolved "https://registry.npmjs.org/@firebase/app/-/app-0.13.0.tgz#ef67c7e5dc3f47efb430157f9de969a67abd53a7" + integrity sha512-Vj3MST245nq+V5UmmfEkB3isIgPouyUr8yGJlFeL9Trg/umG5ogAvrjAYvQ8gV7daKDoQSRnJKWI2JFpQqRsuQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/auth-compat@0.5.26": + version "0.5.26" + resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.26.tgz#ff795ad7dd43077dc603a8576bf92e756c6a2064" + integrity sha512-4baB7tR0KukyGzrlD25aeO4t0ChLifwvDQXTBiVJE9WWwJEOjkZpHmoU9Iww0+Vdalsq4sZ3abp6YTNjHyB1dA== + dependencies: + "@firebase/auth" "1.10.6" + "@firebase/auth-types" "0.13.0" + "@firebase/component" "0.6.17" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/auth-interop-types@0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz#176a08686b0685596ff03d7879b7e4115af53de0" + integrity sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA== + +"@firebase/auth-types@0.13.0": + version "0.13.0" + resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.13.0.tgz#ae6e0015e3bd4bfe18edd0942b48a0a118a098d9" + integrity sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg== + +"@firebase/auth@1.10.6": + version "1.10.6" + resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.10.6.tgz#2403e92e382034367f7fefd6715f992e061c3e59" + integrity sha512-cFbo2FymQltog4atI9cKTO6CxKxS0dOMXslTQrlNZRH7qhDG44/d7QeI6GXLweFZtrnlecf52ESnNz1DU6ek8w== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/component@0.6.17": + version "0.6.17" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.17.tgz#6cef28dbe6de80ce393f97147bf3f1ea0a5453ec" + integrity sha512-M6DOg7OySrKEFS8kxA3MU5/xc37fiOpKPMz6cTsMUcsuKB6CiZxxNAvgFta8HGRgEpZbi8WjGIj6Uf+TpOhyzg== + dependencies: + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/data-connect@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.3.9.tgz#9fe2f30d73c4013367b8ddd7ad57387d0438dce1" + integrity sha512-B5tGEh5uQrQeH0i7RvlU8kbZrKOJUmoyxVIX4zLA8qQJIN6A7D+kfBlGXtSwbPdrvyaejcRPcbOtqsDQ9HPJKw== + dependencies: + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/database-compat@2.0.10": + version "2.0.10" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.10.tgz#5cfe487b5fdb68752ded5ad17dabd99e763ba152" + integrity sha512-3sjl6oGaDDYJw/Ny0E5bO6v+KM3KoD4Qo/sAfHGdRFmcJ4QnfxOX9RbG9+ce/evI3m64mkPr24LlmTDduqMpog== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/database" "1.0.19" + "@firebase/database-types" "1.0.14" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/database-types@1.0.14": + version "1.0.14" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.14.tgz#454a33f55da46c243302d6b420b8b319ab80c6ce" + integrity sha512-8a0Q1GrxM0akgF0RiQHliinhmZd+UQPrxEmUv7MnQBYfVFiLtKOgs3g6ghRt/WEGJHyQNslZ+0PocIwNfoDwKw== + dependencies: + "@firebase/app-types" "0.9.3" + "@firebase/util" "1.12.0" + +"@firebase/database@1.0.19": + version "1.0.19" + resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.19.tgz#2d52e731407431bdc1581990d99b533784700fc6" + integrity sha512-khE+MIYK+XlIndVn/7mAQ9F1fwG5JHrGKaG72hblCC6JAlUBDd3SirICH6SMCf2PQ0iYkruTECth+cRhauacyQ== + dependencies: + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + faye-websocket "0.11.4" + tslib "^2.1.0" + +"@firebase/firestore-compat@0.3.51": + version "0.3.51" + resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.51.tgz#46ecebe9de16b60febf27d5014c9f21298064703" + integrity sha512-E5iubPhS6aAM7oSsHMx/FGBwfA2nbEHaK/hCs+MD3l3N7rHKnq4SYCGmVu/AraSJaMndZR1I37N9A/BH7aCq5A== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/firestore" "4.7.16" + "@firebase/firestore-types" "3.0.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/firestore-types@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-3.0.3.tgz#7d0c3dd8850c0193d8f5ee0cc8f11961407742c1" + integrity sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q== + +"@firebase/firestore@4.7.16": + version "4.7.16" + resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.16.tgz#9807d3355965406da106a098ce15d9950585ac51" + integrity sha512-5OpvlwYVUTLEnqewOlXmtIpH8t2ISlZHDW0NDbKROM2D0ATMqFkMHdvl+/wz9zOAcb8GMQYlhCihOnVAliUbpQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + "@firebase/webchannel-wrapper" "1.0.3" + "@grpc/grpc-js" "~1.9.0" + "@grpc/proto-loader" "^0.7.8" + tslib "^2.1.0" + +"@firebase/functions-compat@0.3.25": + version "0.3.25" + resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.25.tgz#9022df60d7471c7111766789f05991966ab692f0" + integrity sha512-V0JKUw5W/7aznXf9BQ8LIYHCX6zVCM8Hdw7XUQ/LU1Y9TVP8WKRCnPB/qdPJ0xGjWWn7fhtwIYbgEw/syH4yTQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/functions" "0.12.8" + "@firebase/functions-types" "0.6.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/functions-types@0.6.3": + version "0.6.3" + resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.6.3.tgz#f5faf770248b13f45d256f614230da6a11bfb654" + integrity sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg== + +"@firebase/functions@0.12.8": + version "0.12.8" + resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.12.8.tgz#c2e42b4ba82746142c9fe1e120c3f71f0464aa3d" + integrity sha512-p+ft6dQW0CJ3BLLxeDb5Hwk9ARw01kHTZjLqiUdPRzycR6w7Z75ThkegNmL6gCss3S0JEpldgvehgZ3kHybVhA== + dependencies: + "@firebase/app-check-interop-types" "0.3.3" + "@firebase/auth-interop-types" "0.2.4" + "@firebase/component" "0.6.17" + "@firebase/messaging-interop-types" "0.2.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/installations-compat@0.2.17": + version "0.2.17" + resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.17.tgz#5d61fb652658432e43ca82b8f91a17d5d21a459b" + integrity sha512-J7afeCXB7yq25FrrJAgbx8mn1nG1lZEubOLvYgG7ZHvyoOCK00sis5rj7TgDrLYJgdj/SJiGaO1BD3BAp55TeA== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/installations" "0.6.17" + "@firebase/installations-types" "0.5.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/installations-types@0.5.3": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.5.3.tgz#cac8a14dd49f09174da9df8ae453f9b359c3ef2f" + integrity sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA== + +"@firebase/installations@0.6.17": + version "0.6.17" + resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.17.tgz#f184e49fcf3053ba25015b0509d9de28db99db77" + integrity sha512-zfhqCNJZRe12KyADtRrtOj+SeSbD1H/K8J24oQAJVv/u02eQajEGlhZtcx9Qk7vhGWF5z9dvIygVDYqLL4o1XQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/util" "1.12.0" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/logger@0.4.4": + version "0.4.4" + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.4.4.tgz#29e8379d20fd1149349a195ee6deee4573a86f48" + integrity sha512-mH0PEh1zoXGnaR8gD1DeGeNZtWFKbnz9hDO91dIml3iou1gpOnLqXQ2dJfB71dj6dpmUjcQ6phY3ZZJbjErr9g== + dependencies: + tslib "^2.1.0" + +"@firebase/messaging-compat@0.2.21": + version "0.2.21" + resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.21.tgz#8d4c5b9557ed9890a774fba2ea7e5459860a901b" + integrity sha512-1yMne+4BGLbHbtyu/VyXWcLiefUE1+K3ZGfVTyKM4BH4ZwDFRGoWUGhhx+tKRX4Tu9z7+8JN67SjnwacyNWK5g== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/messaging" "0.12.21" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/messaging-interop-types@0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz#e647c9cd1beecfe6a6e82018a6eec37555e4da3e" + integrity sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q== + +"@firebase/messaging@0.12.21": + version "0.12.21" + resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.21.tgz#05d76039133c3d2a33208416699a3d3ebd2c0012" + integrity sha512-bYJ2Evj167Z+lJ1ach6UglXz5dUKY1zrJZd15GagBUJSR7d9KfiM1W8dsyL0lDxcmhmA/sLaBYAAhF1uilwN0g== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/installations" "0.6.17" + "@firebase/messaging-interop-types" "0.2.3" + "@firebase/util" "1.12.0" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/performance-compat@0.2.19": + version "0.2.19" + resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.19.tgz#f817a82037285b2240c4c55cc03eb1943ae932d6" + integrity sha512-4cU0T0BJ+LZK/E/UwFcvpBCVdkStgBMQwBztM9fJPT6udrEUk3ugF5/HT+E2Z22FCXtIaXDukJbYkE/c3c6IHw== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/performance" "0.7.6" + "@firebase/performance-types" "0.2.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/performance-types@0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.2.3.tgz#5ce64e90fa20ab5561f8b62a305010cf9fab86fb" + integrity sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ== + +"@firebase/performance@0.7.6": + version "0.7.6" + resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.6.tgz#36376130c725d8f6df492be4da32c1d1f9a605f8" + integrity sha512-AsOz74dSTlyQGlnnbLWXiHFAsrxhpssPOsFFi4HgOJ5DjzkK7ZdZ/E9uMPrwFoXJyMVoybGRuqsL/wkIbFITsA== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/installations" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + web-vitals "^4.2.4" + +"@firebase/remote-config-compat@0.2.17": + version "0.2.17" + resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.17.tgz#d91583dfdd85ddb3e8cdd9c0e433d38f02095f1e" + integrity sha512-KelsBD0sXSC0u3esr/r6sJYGRN6pzn3bYuI/6pTvvmZbjBlxQkRabHAVH6d+YhLcjUXKIAYIjZszczd1QJtOyA== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/remote-config" "0.6.4" + "@firebase/remote-config-types" "0.4.0" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/remote-config-types@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.4.0.tgz#91b9a836d5ca30ced68c1516163b281fbb544537" + integrity sha512-7p3mRE/ldCNYt8fmWMQ/MSGRmXYlJ15Rvs9Rk17t8p0WwZDbeK7eRmoI1tvCPaDzn9Oqh+yD6Lw+sGLsLg4kKg== + +"@firebase/remote-config@0.6.4": + version "0.6.4" + resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.6.4.tgz#30610bf52452639a127f1b40a94de096ac6cf43a" + integrity sha512-ZyLJRT46wtycyz2+opEkGaoFUOqRQjt/0NX1WfUISOMCI/PuVoyDjqGpq24uK+e8D5NknyTpiXCVq5dowhScmg== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/installations" "0.6.17" + "@firebase/logger" "0.4.4" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/storage-compat@0.3.22": + version "0.3.22" + resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.22.tgz#8d5b95b5583d2acac2183e8e3cc302c66c2c3902" + integrity sha512-29j6JgXTjQ76sOIkxmTNHQfYA/hDTeV9qGbn0jolynPXSg/AmzCB0CpCoCYrS0ja0Flgmy1hkA3XYDZ/eiV1Cg== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/storage" "0.13.12" + "@firebase/storage-types" "0.8.3" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/storage-types@0.8.3": + version "0.8.3" + resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.8.3.tgz#2531ef593a3452fc12c59117195d6485c6632d3d" + integrity sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg== + +"@firebase/storage@0.13.12": + version "0.13.12" + resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.12.tgz#213c5e7832b77b361e0c454ff8b787437686c45c" + integrity sha512-5JmoFS01MYjW1XMQa5F5rD/kvMwBN10QF03bmcuJWq4lg+BJ3nRgL3sscWnyJPhwM/ZCyv2eRwcfzESVmsYkdQ== + dependencies: + "@firebase/component" "0.6.17" + "@firebase/util" "1.12.0" + tslib "^2.1.0" + +"@firebase/util@1.12.0": + version "1.12.0" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.12.0.tgz#202e96cfd832f8dde551232e4868861681b8b89a" + integrity sha512-Z4rK23xBCwgKDqmzGVMef+Vb4xso2j5Q8OG0vVL4m4fA5ZjPMYQazu8OJJC3vtQRC3SQ/Pgx/6TPNVsCd70QRw== + dependencies: + tslib "^2.1.0" + +"@firebase/webchannel-wrapper@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz#a73bab8eb491d7b8b7be2f0e6c310647835afe83" + integrity sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ== + +"@grpc/grpc-js@~1.9.0": + version "1.9.15" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.9.15.tgz#433d7ac19b1754af690ea650ab72190bd700739b" + integrity sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ== + dependencies: + "@grpc/proto-loader" "^0.7.8" + "@types/node" ">=12.12.47" + +"@grpc/proto-loader@^0.7.8": + version "0.7.13" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" + integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== + dependencies: + lodash.camelcase "^4.3.0" + long "^5.0.0" + protobufjs "^7.2.5" + yargs "^17.7.2" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + +"@types/node@18.19.83": + version "18.19.83" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.83.tgz#44d302cd09364640bdd45d001bc75e596f7da920" + integrity sha512-D69JeR5SfFS5H6FLbUaS0vE4r1dGhmMBbG4Ed6BNS4wkDK8GZjsdCShT5LCN59vOHEUHnFCY9J4aclXlIphMkA== + dependencies: + undici-types "~5.26.4" + +"@types/node@>=12.12.47", "@types/node@>=13.7.0": + version "22.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.14.0.tgz#d3bfa3936fef0dbacd79ea3eb17d521c628bb47e" + integrity sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA== + dependencies: + undici-types "~6.21.0" + +acorn-walk@^8.1.1: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" + +acorn@^8.11.0, acorn@^8.4.1: + version "8.14.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +faye-websocket@0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== + dependencies: + websocket-driver ">=0.5.1" + +firebase@11.8.1: + version "11.8.1" + resolved "https://registry.npmjs.org/firebase/-/firebase-11.8.1.tgz#7658c4fed6c10102d8a2b00de576b903af78d767" + integrity sha512-oetXhPCvJZM4DVL/n/06442emMU+KzM0JLZjszpwlU6mqdFZqBwumBxn6hQkLukJyU5wsjihZHUY8HEAE2micg== + dependencies: + "@firebase/ai" "1.3.0" + "@firebase/analytics" "0.10.16" + "@firebase/analytics-compat" "0.2.22" + "@firebase/app" "0.13.0" + "@firebase/app-check" "0.10.0" + "@firebase/app-check-compat" "0.3.25" + "@firebase/app-compat" "0.4.0" + "@firebase/app-types" "0.9.3" + "@firebase/auth" "1.10.6" + "@firebase/auth-compat" "0.5.26" + "@firebase/data-connect" "0.3.9" + "@firebase/database" "1.0.19" + "@firebase/database-compat" "2.0.10" + "@firebase/firestore" "4.7.16" + "@firebase/firestore-compat" "0.3.51" + "@firebase/functions" "0.12.8" + "@firebase/functions-compat" "0.3.25" + "@firebase/installations" "0.6.17" + "@firebase/installations-compat" "0.2.17" + "@firebase/messaging" "0.12.21" + "@firebase/messaging-compat" "0.2.21" + "@firebase/performance" "0.7.6" + "@firebase/performance-compat" "0.2.19" + "@firebase/remote-config" "0.6.4" + "@firebase/remote-config-compat" "0.2.17" + "@firebase/storage" "0.13.12" + "@firebase/storage-compat" "0.3.22" + "@firebase/util" "1.12.0" + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +http-parser-js@>=0.5.1: + version "0.5.9" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.9.tgz#b817b3ca0edea6236225000d795378707c169cec" + integrity sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw== + +idb@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" + integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + +long@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/long/-/long-5.3.1.tgz#9d4222d3213f38a5ec809674834e0f0ab21abe96" + integrity sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng== + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +protobufjs@^7.2.5: + version "7.4.0" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" + integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +safe-buffer@>=5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tslib@^2.1.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + +typescript@5.5.4: + version "5.5.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +undici-types@~6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" + integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +web-vitals@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== + +websocket-driver@>=0.5.1: + version "0.7.4" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" + integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== + dependencies: + http-parser-js ">=0.5.1" + safe-buffer ">=5.1.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 89051ca4df350f1881bce8081c5118c8aa31f2a8 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 5 Jun 2025 07:30:17 -0700 Subject: [PATCH 212/295] Version Packages (#9073) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Release version 11.9.0. --- .changeset/angry-scissors-sit.md | 6 ------ .changeset/spotty-ghosts-kneel.md | 5 ----- .changeset/tricky-years-pump.md | 6 ------ integration/compat-interop/package.json | 4 ++-- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 8 ++++++++ packages/ai/package.json | 4 ++-- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 17 +++++++++++++++++ packages/firebase/package.json | 12 ++++++------ packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 6 +++--- packages/firestore/CHANGELOG.md | 6 ++++++ packages/firestore/package.json | 6 +++--- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 41 files changed, 96 insertions(+), 62 deletions(-) delete mode 100644 .changeset/angry-scissors-sit.md delete mode 100644 .changeset/spotty-ghosts-kneel.md delete mode 100644 .changeset/tricky-years-pump.md diff --git a/.changeset/angry-scissors-sit.md b/.changeset/angry-scissors-sit.md deleted file mode 100644 index 8aeb7dcaf52..00000000000 --- a/.changeset/angry-scissors-sit.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for `minItems` and `maxItems` to `Schema`. diff --git a/.changeset/spotty-ghosts-kneel.md b/.changeset/spotty-ghosts-kneel.md deleted file mode 100644 index 0db91b7bf19..00000000000 --- a/.changeset/spotty-ghosts-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/firestore": patch ---- - -Clean up leaked WebChannel instances when the Firestore instance is terminated. diff --git a/.changeset/tricky-years-pump.md b/.changeset/tricky-years-pump.md deleted file mode 100644 index 94bf68604cc..00000000000 --- a/.changeset/tricky-years-pump.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add `title`, `maximum`, `minimum`, `propertyOrdering` to Schema builder diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 117a8220fc0..34a1336c733 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.13.0", - "@firebase/app-compat": "0.4.0", + "@firebase/app": "0.13.1", + "@firebase/app-compat": "0.4.1", "@firebase/analytics": "0.10.16", "@firebase/analytics-compat": "0.2.22", "@firebase/auth": "1.10.6", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 0c722a5352b..903c182a5c0 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.13.0", - "@firebase/firestore": "4.7.16" + "@firebase/app": "0.13.1", + "@firebase/firestore": "4.7.17" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 9cb2bf233fc..e3682df4657 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.8.1", + "firebase": "11.9.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 298fb06a9b5..874cdb40e69 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/ai +## 1.4.0 + +### Minor Changes + +- [`1933324`](https://github.com/firebase/firebase-js-sdk/commit/1933324e0f3e4c8ed4d4d784f0c701fd0ec6ebc3) [#9026](https://github.com/firebase/firebase-js-sdk/pull/9026) - Add support for `minItems` and `maxItems` to `Schema`. + +- [`40be2db`](https://github.com/firebase/firebase-js-sdk/commit/40be2dbb884b8e1485862af8bb015e23db69ccbf) [#9047](https://github.com/firebase/firebase-js-sdk/pull/9047) - Add `title`, `maximum`, `minimum`, `propertyOrdering` to Schema builder + ## 1.3.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 98e204320bc..7be0163d9bc 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "1.3.0", + "version": "1.4.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -56,7 +56,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index cb8c4c5a2f7..d126569486a 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 2f7b6cfbadf..3f8decfc35f 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 15cc2a9273f..29ed9977205 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 4187145ed67..e52ff90dbc7 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 6e27613a249..bc8b1b97982 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.4.1 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.13.1 + ## 0.4.0 ### Minor Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 3d70accd107..8dba6ff2ff6 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.4.0", + "version": "0.4.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "@firebase/util": "1.12.0", "@firebase/logger": "0.4.4", "@firebase/component": "0.6.17", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 2b239c453cc..aa13db67c63 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.13.1 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.13.0 ### Minor Changes diff --git a/packages/app/package.json b/packages/app/package.json index 3d385028412..5f892ecc525 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.13.0", + "version": "0.13.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index c8a6f40b357..cfca5a5bee6 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index ea47732d398..2da4cb10b30 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index a342c7d4f14..99b97e39f3a 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 104f57d56dc..c746b8dde07 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 0fe42bddeed..54a549b9f68 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 2a17f24d933..84eb512291d 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,22 @@ # firebase +## 11.9.0 + +### Minor Changes + +- [`1933324`](https://github.com/firebase/firebase-js-sdk/commit/1933324e0f3e4c8ed4d4d784f0c701fd0ec6ebc3) [#9026](https://github.com/firebase/firebase-js-sdk/pull/9026) - Add support for `minItems` and `maxItems` to `Schema`. + +- [`40be2db`](https://github.com/firebase/firebase-js-sdk/commit/40be2dbb884b8e1485862af8bb015e23db69ccbf) [#9047](https://github.com/firebase/firebase-js-sdk/pull/9047) - Add `title`, `maximum`, `minimum`, `propertyOrdering` to Schema builder + +### Patch Changes + +- Updated dependencies [[`1933324`](https://github.com/firebase/firebase-js-sdk/commit/1933324e0f3e4c8ed4d4d784f0c701fd0ec6ebc3), [`9964849`](https://github.com/firebase/firebase-js-sdk/commit/9964849e9540f08d02fa3825ecec32c1bfedc62d), [`40be2db`](https://github.com/firebase/firebase-js-sdk/commit/40be2dbb884b8e1485862af8bb015e23db69ccbf)]: + - @firebase/ai@1.4.0 + - @firebase/app@0.13.1 + - @firebase/firestore@4.7.17 + - @firebase/app-compat@0.4.1 + - @firebase/firestore-compat@0.3.52 + ## 11.8.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index aec5e6e8fec..85bcab03aa6 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.8.1", + "version": "11.9.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -411,17 +411,17 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "1.3.0", - "@firebase/app": "0.13.0", - "@firebase/app-compat": "0.4.0", + "@firebase/ai": "1.4.0", + "@firebase/app": "0.13.1", + "@firebase/app-compat": "0.4.1", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.10.6", "@firebase/auth-compat": "0.5.26", "@firebase/data-connect": "0.3.9", "@firebase/database": "1.0.19", "@firebase/database-compat": "2.0.10", - "@firebase/firestore": "4.7.16", - "@firebase/firestore-compat": "0.3.51", + "@firebase/firestore": "4.7.17", + "@firebase/firestore-compat": "0.3.52", "@firebase/functions": "0.12.8", "@firebase/functions-compat": "0.3.25", "@firebase/installations": "0.6.17", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 861e35792c5..264da74339b 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.3.52 + +### Patch Changes + +- Updated dependencies [[`9964849`](https://github.com/firebase/firebase-js-sdk/commit/9964849e9540f08d02fa3825ecec32c1bfedc62d)]: + - @firebase/firestore@4.7.17 + ## 0.3.51 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 6e3db51e597..4071cdb236f 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.51", + "version": "0.3.52", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.6.17", - "@firebase/firestore": "4.7.16", + "@firebase/firestore": "4.7.17", "@firebase/util": "1.12.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 0671f0e8c63..3c73ea511d9 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/firestore +## 4.7.17 + +### Patch Changes + +- [`9964849`](https://github.com/firebase/firebase-js-sdk/commit/9964849e9540f08d02fa3825ecec32c1bfedc62d) [#9041](https://github.com/firebase/firebase-js-sdk/pull/9041) - Clean up leaked WebChannel instances when the Firestore instance is terminated. + ## 4.7.16 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 6fc04a3579d..d53f8d36bb0 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.16", + "version": "4.7.17", "engines": { "node": ">=18.0.0" }, @@ -112,8 +112,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.0", - "@firebase/app-compat": "0.4.0", + "@firebase/app": "0.13.1", + "@firebase/app-compat": "0.4.1", "@firebase/auth": "1.10.6", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 09a4514114c..24a8efb46d8 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 004181eeb39..6354ed4dadb 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 11f1838f66c..cb5f6f730a6 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index be4d1b4a79f..a1d89e48321 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index fd145f06bf7..c536cbef067 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 9d8cfc71926..4419ad3acf4 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 0ec3cc56e66..0e84088a37d 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.0" + "@firebase/app-compat": "0.4.1" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index b3495c8a566..27ff0073509 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 84c66d579bc..507bce652f3 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.0" + "@firebase/app-compat": "0.4.1" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 09dd8b6531e..194f9806cb7 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 724685153ce..f631350bce8 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.0", + "@firebase/app-compat": "0.4.1", "@firebase/auth-compat": "0.5.26", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index f7d52a2e8e2..2884f28dea2 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "@firebase/auth": "1.10.6", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index 6d178ded575..9274862e9d1 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 184020a8acc..5084ee78d04 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.0", + "@firebase/app": "0.13.1", "@firebase/logger": "0.4.4", "@firebase/util": "1.12.0", "@rollup/plugin-commonjs": "21.1.0", From d590889d6d9eecfa643d98beaa8c89e170f2e016 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 5 Jun 2025 12:50:13 -0400 Subject: [PATCH 213/295] test(ai): add integration tests (#8853) --- .gitignore | 2 +- .vscode/launch.json | 22 +- packages/ai/integration/chat.test.ts | 132 ++++++++ packages/ai/integration/constants.ts | 81 +++++ packages/ai/integration/count-tokens.test.ts | 286 ++++++++++++++++++ packages/ai/integration/firebase-config.ts | 20 ++ .../ai/integration/generate-content.test.ts | 141 +++++++++ packages/ai/karma.conf.js | 16 +- packages/ai/package.json | 1 + packages/ai/rollup.config.js | 7 +- 10 files changed, 704 insertions(+), 4 deletions(-) create mode 100644 packages/ai/integration/chat.test.ts create mode 100644 packages/ai/integration/constants.ts create mode 100644 packages/ai/integration/count-tokens.test.ts create mode 100644 packages/ai/integration/firebase-config.ts create mode 100644 packages/ai/integration/generate-content.test.ts diff --git a/.gitignore b/.gitignore index 5aaf5c0b5be..a989576ccf3 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,4 @@ vertexai-sdk-test-data mocks-lookup.ts # temp changeset output -changeset-temp.json \ No newline at end of file +changeset-temp.json diff --git a/.vscode/launch.json b/.vscode/launch.json index df14c96daa6..1f627304b61 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "node", "request": "launch", "program": "${workspaceFolder}/node_modules/.bin/_mocha", - "cwd": "${workspaceRoot}/packages/vertexai", + "cwd": "${workspaceRoot}/packages/ai", "args": [ "--require", "ts-node/register", @@ -24,6 +24,26 @@ }, "sourceMaps": true }, + { + "name": "AI Integration Tests (node)", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/node_modules/.bin/_mocha", + "cwd": "${workspaceRoot}/packages/ai", + "args": [ + "--require", + "ts-node/register", + "--require", + "src/index.node.ts", + "--timeout", + "5000", + "integration/**/*.test.ts" + ], + "env": { + "TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}" + }, + "sourceMaps": true + }, { "type": "node", "request": "launch", diff --git a/packages/ai/integration/chat.test.ts b/packages/ai/integration/chat.test.ts new file mode 100644 index 00000000000..6af0e7a9af9 --- /dev/null +++ b/packages/ai/integration/chat.test.ts @@ -0,0 +1,132 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + Content, + GenerationConfig, + HarmBlockThreshold, + HarmCategory, + SafetySetting, + getGenerativeModel +} from '../src'; +import { testConfigs, TOKEN_COUNT_DELTA } from './constants'; + +describe('Chat Session', () => { + testConfigs.forEach(testConfig => { + describe(`${testConfig.toString()}`, () => { + const commonGenerationConfig: GenerationConfig = { + temperature: 0, + topP: 0, + responseMimeType: 'text/plain' + }; + + const commonSafetySettings: SafetySetting[] = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + } + ]; + + const commonSystemInstruction: Content = { + role: 'system', + parts: [ + { + text: 'You are a friendly and helpful assistant.' + } + ] + }; + + it('startChat and sendMessage: text input, text output', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + systemInstruction: commonSystemInstruction + }); + + const chat = model.startChat(); + const result1 = await chat.sendMessage( + 'What is the capital of France?' + ); + const response1 = result1.response; + expect(response1.text().trim().toLowerCase()).to.include('paris'); + + let history = await chat.getHistory(); + expect(history.length).to.equal(2); + expect(history[0].role).to.equal('user'); + expect(history[0].parts[0].text).to.equal( + 'What is the capital of France?' + ); + expect(history[1].role).to.equal('model'); + expect(history[1].parts[0].text?.toLowerCase()).to.include('paris'); + + expect(response1.usageMetadata).to.not.be.null; + // Token counts can vary slightly in chat context + expect(response1.usageMetadata!.promptTokenCount).to.be.closeTo( + 15, // "What is the capital of France?" + system instruction + TOKEN_COUNT_DELTA + 2 // More variance for chat context + ); + expect(response1.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, // "Paris" + TOKEN_COUNT_DELTA + ); + expect(response1.usageMetadata!.totalTokenCount).to.be.closeTo( + 23, // "What is the capital of France?" + system instruction + "Paris" + TOKEN_COUNT_DELTA + 3 // More variance for chat context + ); + + const result2 = await chat.sendMessage('And what about Italy?'); + const response2 = result2.response; + expect(response2.text().trim().toLowerCase()).to.include('rome'); + + history = await chat.getHistory(); + expect(history.length).to.equal(4); + expect(history[2].role).to.equal('user'); + expect(history[2].parts[0].text).to.equal('And what about Italy?'); + expect(history[3].role).to.equal('model'); + expect(history[3].parts[0].text?.toLowerCase()).to.include('rome'); + + expect(response2.usageMetadata).to.not.be.null; + expect(response2.usageMetadata!.promptTokenCount).to.be.closeTo( + 28, // History + "And what about Italy?" + system instruction + TOKEN_COUNT_DELTA + 5 // More variance for chat context with history + ); + expect(response2.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, + TOKEN_COUNT_DELTA + ); + expect(response2.usageMetadata!.totalTokenCount).to.be.closeTo( + 36, + TOKEN_COUNT_DELTA + ); + }); + }); + }); +}); diff --git a/packages/ai/integration/constants.ts b/packages/ai/integration/constants.ts new file mode 100644 index 00000000000..68aebf9eddc --- /dev/null +++ b/packages/ai/integration/constants.ts @@ -0,0 +1,81 @@ +/** + * @license + * Copyright 2025 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 { initializeApp } from '@firebase/app'; +import { + AI, + Backend, + BackendType, + GoogleAIBackend, + VertexAIBackend, + getAI +} from '../src'; +import { FIREBASE_CONFIG } from './firebase-config'; + +const app = initializeApp(FIREBASE_CONFIG); + +/** + * Test config that all tests will be ran against. + */ +export type TestConfig = Readonly<{ + ai: AI; + model: string; + /** This will be used to output the test config at runtime */ + toString: () => string; +}>; + +function formatConfigAsString(config: { ai: AI; model: string }): string { + return `${backendNames.get(config.ai.backend.backendType)} ${config.model}`; +} + +const backends: readonly Backend[] = [ + new GoogleAIBackend(), + new VertexAIBackend() +]; + +const backendNames: Map = new Map([ + [BackendType.GOOGLE_AI, 'Google AI'], + [BackendType.VERTEX_AI, 'Vertex AI'] +]); + +const modelNames: readonly string[] = ['gemini-2.0-flash']; + +/** + * Array of test configurations that is iterated over to get full coverage + * of backends and models. Contains all combinations of backends and models. + */ +export const testConfigs: readonly TestConfig[] = backends.flatMap(backend => { + return modelNames.map(modelName => { + const ai = getAI(app, { backend }); + return { + ai: getAI(app, { backend }), + model: modelName, + toString: () => formatConfigAsString({ ai, model: modelName }) + }; + }); +}); + +export const TINY_IMG_BASE64 = + 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII='; +export const IMAGE_MIME_TYPE = 'image/png'; +export const TINY_MP3_BASE64 = + 'SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYxLjcuMTAwAAAAAAAAAAAAAAD/+0DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAAAUAAAK+AGhoaGhoaGhoaGhoaGhoaGhoaGiOjo6Ojo6Ojo6Ojo6Ojo6Ojo6OjrS0tLS0tLS0tLS0tLS0tLS0tLS02tra2tra2tra2tra2tra2tra2tr//////////////////////////wAAAABMYXZjNjEuMTkAAAAAAAAAAAAAAAAkAwYAAAAAAAACvhC6DYoAAAAAAP/7EMQAA8AAAaQAAAAgAAA0gAAABExBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//sQxCmDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+xDEUwPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7EMR8g8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//sQxKYDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU='; +export const AUDIO_MIME_TYPE = 'audio/mpeg'; + +// Token counts are only expected to differ by at most this number of tokens. +// Set to 1 for whitespace that is not always present. +export const TOKEN_COUNT_DELTA = 1; diff --git a/packages/ai/integration/count-tokens.test.ts b/packages/ai/integration/count-tokens.test.ts new file mode 100644 index 00000000000..3256a9ed9d7 --- /dev/null +++ b/packages/ai/integration/count-tokens.test.ts @@ -0,0 +1,286 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + Content, + GenerationConfig, + HarmBlockMethod, + HarmBlockThreshold, + HarmCategory, + Modality, + SafetySetting, + getGenerativeModel, + Part, + CountTokensRequest, + InlineDataPart, + FileDataPart, + BackendType +} from '../src'; +import { + AUDIO_MIME_TYPE, + IMAGE_MIME_TYPE, + TINY_IMG_BASE64, + TINY_MP3_BASE64, + testConfigs +} from './constants'; +import { FIREBASE_CONFIG } from './firebase-config'; + +describe('Count Tokens', () => { + testConfigs.forEach(testConfig => { + describe(`${testConfig.toString()}`, () => { + it('text input', async () => { + const generationConfig: GenerationConfig = { + temperature: 0, + topP: 0, + responseMimeType: 'text/plain' + }; + + const safetySettings: SafetySetting[] = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + method: HarmBlockMethod.PROBABILITY + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + method: HarmBlockMethod.SEVERITY + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + } + ]; + + const systemInstruction: Content = { + role: 'system', + parts: [ + { + text: 'You are a friendly and helpful assistant.' + } + ] + }; + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig, + systemInstruction, + safetySettings + }); + + const response = await model.countTokens('Why is the sky blue?'); + + expect(response.promptTokensDetails).to.exist; + expect(response.promptTokensDetails!.length).to.equal(1); + expect(response.promptTokensDetails![0].modality).to.equal( + Modality.TEXT + ); + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + expect(response.totalTokens).to.equal(7); + expect(response.totalBillableCharacters).to.be.undefined; + expect(response.promptTokensDetails![0].tokenCount).to.equal(7); + } else if ( + testConfig.ai.backend.backendType === BackendType.VERTEX_AI + ) { + expect(response.totalTokens).to.equal(6); + expect(response.totalBillableCharacters).to.equal(16); + expect(response.promptTokensDetails![0].tokenCount).to.equal(6); + } + }); + + it('image input', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model + }); + const imagePart: Part = { + inlineData: { + mimeType: IMAGE_MIME_TYPE, + data: TINY_IMG_BASE64 + } + }; + const response = await model.countTokens([imagePart]); + + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + const expectedImageTokens = 259; + expect(response.totalTokens).to.equal(expectedImageTokens); + expect(response.totalBillableCharacters).to.be.undefined; // Incorrect behavior + expect(response.promptTokensDetails!.length).to.equal(2); + expect(response.promptTokensDetails![0]).to.deep.equal({ + modality: Modality.TEXT, // Note: 1 unexpected text token observed for Google AI with image-only input. + tokenCount: 1 + }); + expect(response.promptTokensDetails![1]).to.deep.equal({ + modality: Modality.IMAGE, + tokenCount: 258 + }); + } else if ( + testConfig.ai.backend.backendType === BackendType.VERTEX_AI + ) { + const expectedImageTokens = 258; + expect(response.totalTokens).to.equal(expectedImageTokens); + expect(response.totalBillableCharacters).to.be.undefined; // Incorrect behavior + expect(response.promptTokensDetails!.length).to.equal(1); + // Note: No text tokens are present for Vertex AI with image-only input. + expect(response.promptTokensDetails![0]).to.deep.equal({ + modality: Modality.IMAGE, + tokenCount: 258 + }); + expect(response.promptTokensDetails![0].tokenCount).to.equal( + expectedImageTokens + ); + } + }); + + it('audio input', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model + }); + const audioPart: InlineDataPart = { + inlineData: { + mimeType: AUDIO_MIME_TYPE, + data: TINY_MP3_BASE64 + } + }; + + const response = await model.countTokens([audioPart]); + + expect(response.promptTokensDetails).to.exist; + const textDetails = response.promptTokensDetails!.find( + d => d.modality === Modality.TEXT + ); + const audioDetails = response.promptTokensDetails!.find( + d => d.modality === Modality.AUDIO + ); + + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + expect(response.totalTokens).to.equal(6); + expect(response.promptTokensDetails!.length).to.equal(2); + expect(textDetails).to.deep.equal({ + modality: Modality.TEXT, + tokenCount: 1 + }); + expect(audioDetails).to.deep.equal({ + modality: Modality.AUDIO, + tokenCount: 5 + }); + } else if ( + testConfig.ai.backend.backendType === BackendType.VERTEX_AI + ) { + expect(response.totalTokens).to.be.undefined; + expect(response.promptTokensDetails!.length).to.equal(1); // Note: Text modality details absent for Vertex AI with audio-only input. + expect(audioDetails).to.deep.equal({ modality: Modality.AUDIO }); // Note: Audio tokenCount is undefined for Vertex AI with audio-only input. + } + + expect(response.totalBillableCharacters).to.be.undefined; // Incorrect behavior + }); + + it('text, image, and audio input', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model + }); + const textPart: Part = { text: 'Describe these:' }; + const imagePart: Part = { + inlineData: { mimeType: IMAGE_MIME_TYPE, data: TINY_IMG_BASE64 } + }; + const audioPart: Part = { + inlineData: { mimeType: AUDIO_MIME_TYPE, data: TINY_MP3_BASE64 } + }; + + const request: CountTokensRequest = { + contents: [{ role: 'user', parts: [textPart, imagePart, audioPart] }] + }; + const response = await model.countTokens(request); + const textDetails = response.promptTokensDetails!.find( + d => d.modality === Modality.TEXT + ); + const imageDetails = response.promptTokensDetails!.find( + d => d.modality === Modality.IMAGE + ); + const audioDetails = response.promptTokensDetails!.find( + d => d.modality === Modality.AUDIO + ); + expect(response.promptTokensDetails).to.exist; + expect(response.promptTokensDetails!.length).to.equal(3); + + expect(imageDetails).to.deep.equal({ + modality: Modality.IMAGE, + tokenCount: 258 + }); + + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + expect(response.totalTokens).to.equal(267); + expect(response.totalBillableCharacters).to.be.undefined; + expect(textDetails).to.deep.equal({ + modality: Modality.TEXT, + tokenCount: 4 + }); + expect(audioDetails).to.deep.equal({ + modality: Modality.AUDIO, + tokenCount: 5 + }); + } else if ( + testConfig.ai.backend.backendType === BackendType.VERTEX_AI + ) { + expect(response.totalTokens).to.equal(261); + expect(textDetails).to.deep.equal({ + modality: Modality.TEXT, + tokenCount: 3 + }); + const expectedText = 'Describe these:'; + expect(response.totalBillableCharacters).to.equal( + expectedText.length - 1 + ); // Note: BillableCharacters observed as (text length - 1) for Vertex AI. + expect(audioDetails).to.deep.equal({ modality: Modality.AUDIO }); // Incorrect behavior because there's no tokenCount + } + }); + + it('public storage reference', async () => { + // This test is not expected to pass when using Google AI. + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + return; + } + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model + }); + const filePart: FileDataPart = { + fileData: { + mimeType: IMAGE_MIME_TYPE, + fileUri: `gs://${FIREBASE_CONFIG.storageBucket}/images/tree.png` + } + }; + + const response = await model.countTokens([filePart]); + + const expectedFileTokens = 258; + expect(response.totalTokens).to.equal(expectedFileTokens); + expect(response.totalBillableCharacters).to.be.undefined; + expect(response.promptTokensDetails).to.exist; + expect(response.promptTokensDetails!.length).to.equal(1); + expect(response.promptTokensDetails![0].modality).to.equal( + Modality.IMAGE + ); + expect(response.promptTokensDetails![0].tokenCount).to.equal( + expectedFileTokens + ); + }); + }); + }); +}); diff --git a/packages/ai/integration/firebase-config.ts b/packages/ai/integration/firebase-config.ts new file mode 100644 index 00000000000..2527f020530 --- /dev/null +++ b/packages/ai/integration/firebase-config.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2025 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 * as config from '../../../config/ci.config.json'; + +export const FIREBASE_CONFIG = config; diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts new file mode 100644 index 00000000000..af877396cc8 --- /dev/null +++ b/packages/ai/integration/generate-content.test.ts @@ -0,0 +1,141 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + Content, + GenerationConfig, + HarmBlockThreshold, + HarmCategory, + Modality, + SafetySetting, + getGenerativeModel +} from '../src'; +import { testConfigs, TOKEN_COUNT_DELTA } from './constants'; + +describe('Generate Content', () => { + testConfigs.forEach(testConfig => { + describe(`${testConfig.toString()}`, () => { + const commonGenerationConfig: GenerationConfig = { + temperature: 0, + topP: 0, + responseMimeType: 'text/plain' + }; + + const commonSafetySettings: SafetySetting[] = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + } + ]; + + const commonSystemInstruction: Content = { + role: 'system', + parts: [ + { + text: 'You are a friendly and helpful assistant.' + } + ] + }; + + it('generateContent: text input, text output', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + systemInstruction: commonSystemInstruction + }); + + const result = await model.generateContent( + 'Where is Google headquarters located? Answer with the city name only.' + ); + const response = result.response; + + const trimmedText = response.text().trim(); + expect(trimmedText).to.equal('Mountain View'); + + expect(response.usageMetadata).to.not.be.null; + expect(response.usageMetadata!.promptTokenCount).to.be.closeTo( + 21, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 4, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.totalTokenCount).to.be.closeTo( + 25, + TOKEN_COUNT_DELTA * 2 + ); + expect(response.usageMetadata!.promptTokensDetails).to.not.be.null; + expect(response.usageMetadata!.promptTokensDetails!.length).to.equal(1); + expect( + response.usageMetadata!.promptTokensDetails![0].modality + ).to.equal(Modality.TEXT); + expect( + response.usageMetadata!.promptTokensDetails![0].tokenCount + ).to.equal(21); + expect(response.usageMetadata!.candidatesTokensDetails).to.not.be.null; + expect( + response.usageMetadata!.candidatesTokensDetails!.length + ).to.equal(1); + expect( + response.usageMetadata!.candidatesTokensDetails![0].modality + ).to.equal(Modality.TEXT); + expect( + response.usageMetadata!.candidatesTokensDetails![0].tokenCount + ).to.be.closeTo(4, TOKEN_COUNT_DELTA); + }); + + it('generateContentStream: text input, text output', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + systemInstruction: commonSystemInstruction + }); + + const result = await model.generateContentStream( + 'Where is Google headquarters located? Answer with the city name only.' + ); + + let streamText = ''; + for await (const chunk of result.stream) { + streamText += chunk.text(); + } + expect(streamText.trim()).to.equal('Mountain View'); + + const response = await result.response; + const trimmedText = response.text().trim(); + expect(trimmedText).to.equal('Mountain View'); + expect(response.usageMetadata).to.be.undefined; // Note: This is incorrect behavior. + }); + }); + }); +}); diff --git a/packages/ai/karma.conf.js b/packages/ai/karma.conf.js index 3fe2a2f9633..e64048d5f6d 100644 --- a/packages/ai/karma.conf.js +++ b/packages/ai/karma.conf.js @@ -16,14 +16,28 @@ */ const karmaBase = require('../../config/karma.base'); +const { argv } = require('yargs'); const files = [`src/**/*.test.ts`]; module.exports = function (config) { const karmaConfig = { ...karmaBase, + + preprocessors: { + ...karmaBase.preprocessors, + 'integration/**/*.ts': ['webpack', 'sourcemap'] + }, + // files to load into karma - files, + files: (() => { + if (argv.integration) { + return ['integration/**']; + } else { + return ['src/**/*.test.ts']; + } + })(), + // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'] diff --git a/packages/ai/package.json b/packages/ai/package.json index 7be0163d9bc..468f166ad7e 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -39,6 +39,7 @@ "test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test", "test:skip-clone": "karma start", "test:browser": "yarn testsetup && karma start", + "test:integration": "karma start --integration", "api-report": "api-extractor run --local --verbose", "typings:public": "node ../../scripts/build/use_typings.js ./dist/ai-public.d.ts", "trusted-type-check": "tsec -p tsconfig.json --noEmit" diff --git a/packages/ai/rollup.config.js b/packages/ai/rollup.config.js index b3a1e5ebcf8..3b155335898 100644 --- a/packages/ai/rollup.config.js +++ b/packages/ai/rollup.config.js @@ -32,7 +32,12 @@ const buildPlugins = [ typescriptPlugin({ typescript, tsconfigOverride: { - exclude: [...tsconfig.exclude, '**/*.test.ts', 'test-utils'], + exclude: [ + ...tsconfig.exclude, + '**/*.test.ts', + 'test-utils', + 'integration' + ], compilerOptions: { target: 'es2017' } From 5871fd656355b1fd4cb248bfe9f7dd3a7cb1c2e8 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 5 Jun 2025 11:29:29 -0700 Subject: [PATCH 214/295] Update issue template to rename VertexAI > AI (#9074) --- .github/ISSUE_TEMPLATE/bug_report_v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report_v2.yaml b/.github/ISSUE_TEMPLATE/bug_report_v2.yaml index 24cc0efb53e..b466840862d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_v2.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report_v2.yaml @@ -58,6 +58,7 @@ body: description: Select the Firebase product(s) relevant to your issue. You can select multiple options in the dropdown. multiple: true options: + - AI - Analytics - AppCheck - Auth @@ -72,7 +73,6 @@ body: - Performance - Remote-Config - Storage - - VertexAI validations: required: true - type: textarea From 6cc9a0732a4139fc82e6d07c341d087f65ce9f02 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 5 Jun 2025 14:37:37 -0700 Subject: [PATCH 215/295] ci: Fix Firefox error and streamline cross-browser tests (#9015) --- packages/util/test/errors.test.ts | 4 ++-- scripts/run_tests_in_ci.js | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/util/test/errors.test.ts b/packages/util/test/errors.test.ts index 4980b101ee1..6cb6273d326 100644 --- a/packages/util/test/errors.test.ts +++ b/packages/util/test/errors.test.ts @@ -89,8 +89,8 @@ describe('FirebaseError', () => { throw e; } catch (error) { assert.isDefined((error as Error).stack); - // Multi-line match trick - .* does not match \n - assert.match((error as Error).stack!, /FirebaseError[\s\S]/); + // Firefox no longer puts the error class name in the stack + // as of 139.0 so we don't have a string to match on. } }); diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index 0cf6a7f5d3c..7252b6acc3c 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -27,7 +27,9 @@ const crossBrowserPackages = { 'packages/auth': 'test:browser:unit', 'packages/auth-compat': 'test:browser:unit', 'packages/firestore': 'test:browser:unit', - 'packages/firestore-compat': 'test:browser' + 'packages/firestore-compat': 'test:browser', + 'packages/storage': 'test:browser:unit', + 'packages/storage-compat': 'test:browser:unit' }; function writeLogs(status, name, logText) { @@ -59,17 +61,27 @@ const argv = yargs.options({ const myPath = argv.d; let scriptName = argv.s; const dir = path.resolve(myPath); - const { name } = require(`${dir}/package.json`); + const { name, scripts } = require(`${dir}/package.json`); let testProcessOutput = ''; try { if (process.env?.BROWSERS) { + if (scripts['test:browser']) { + scriptName = 'test:browser'; + } for (const package in crossBrowserPackages) { if (dir.endsWith(package)) { scriptName = crossBrowserPackages[package]; } } } + + console.log( + `[${name}][${ + process.env.BROWSERS ?? 'chrome/node' + }]: Running script ${scriptName}` + ); + const testProcess = spawn('yarn', ['--cwd', dir, scriptName]); testProcess.childProcess.stdout.on('data', data => { From c0617a341a693c2578a21b35a4f7b27b726defef Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 5 Jun 2025 14:47:19 -0700 Subject: [PATCH 216/295] Fixed issue where requestSts wasn't including the Studio cookie in it (#9075) --- .changeset/wicked-scissors-yell.md | 5 +++++ .../auth/src/api/authentication/token.test.ts | 20 +++++++++++++++++++ packages/auth/src/api/authentication/token.ts | 13 +++++++++--- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .changeset/wicked-scissors-yell.md diff --git a/.changeset/wicked-scissors-yell.md b/.changeset/wicked-scissors-yell.md new file mode 100644 index 00000000000..7005f64f8f6 --- /dev/null +++ b/.changeset/wicked-scissors-yell.md @@ -0,0 +1,5 @@ +--- +"@firebase/auth": patch +--- + +Fixed issue where requestSts wasn't including the Firebase Studio cookie in it diff --git a/packages/auth/src/api/authentication/token.test.ts b/packages/auth/src/api/authentication/token.test.ts index c30bf552720..9177b4bd4ad 100644 --- a/packages/auth/src/api/authentication/token.test.ts +++ b/packages/auth/src/api/authentication/token.test.ts @@ -95,6 +95,26 @@ describe('requestStsToken', () => { ); }); + it('should use credentials: include when using Firebase Studio', async () => { + const mock = fetch.mock(endpoint, { + 'access_token': 'new-access-token', + 'expires_in': '3600', + 'refresh_token': 'new-refresh-token' + }); + + auth._logFramework('Mythical'); + auth.emulatorConfig = { + host: 'something.cloudworkstations.dev', + port: 443, + options: { disableWarnings: false }, + protocol: 'https' + }; + await requestStsToken(auth, 'some-refresh-token'); + expect(mock.calls[0].fullRequest?.credentials).to.eq('include'); + + auth.emulatorConfig = null; + }); + it('should include whatever headers come from auth impl', async () => { sinon.stub(auth, '_getAdditionalHeaders').returns( Promise.resolve({ diff --git a/packages/auth/src/api/authentication/token.ts b/packages/auth/src/api/authentication/token.ts index 6646321fbe0..478e9451e8b 100644 --- a/packages/auth/src/api/authentication/token.ts +++ b/packages/auth/src/api/authentication/token.ts @@ -17,7 +17,7 @@ /* eslint-disable camelcase */ -import { querystring } from '@firebase/util'; +import { isCloudWorkstation, querystring } from '@firebase/util'; import { _getFinalTarget, @@ -84,11 +84,18 @@ export async function requestStsToken( const headers = await (auth as AuthInternal)._getAdditionalHeaders(); headers[HttpHeader.CONTENT_TYPE] = 'application/x-www-form-urlencoded'; - return FetchProvider.fetch()(url, { + const options: RequestInit = { method: HttpMethod.POST, headers, body - }); + }; + if ( + auth.emulatorConfig && + isCloudWorkstation(auth.emulatorConfig.host) + ) { + options.credentials = 'include'; + } + return FetchProvider.fetch()(url, options); } ); From 0f891d861bdf4e7bac8cd777f5fb32d0b7b9bf8e Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Fri, 6 Jun 2025 10:17:38 -0700 Subject: [PATCH 217/295] Fix issue where we ping an endpoint that hasn't been implemented (#9059) --- .changeset/many-mails-marry.md | 5 +++++ README.md | 2 ++ packages/storage/src/service.ts | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/many-mails-marry.md diff --git a/.changeset/many-mails-marry.md b/.changeset/many-mails-marry.md new file mode 100644 index 00000000000..409001defc6 --- /dev/null +++ b/.changeset/many-mails-marry.md @@ -0,0 +1,5 @@ +--- +'@firebase/storage': patch +--- + +Fixed issue where Firebase Studio wasn't populating cookies for Storage users diff --git a/README.md b/README.md index d1947bd7fe6..1db82c79608 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ and follow the instructions to login. For more information, visit https://firebase.google.com/docs/storage/web/download-files#cors_configuration +Then, make sure you have anonymous sign-in provider enabled: + #### Authentication Support Visit the authentication config in your project and enable the `Anonymous` diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index 97d1407bb52..a4252c77870 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -150,7 +150,7 @@ export function connectStorageEmulator( const useSsl = isCloudWorkstation(host); // Workaround to get cookies in Firebase Studio if (useSsl) { - void pingServer(`https://${storage.host}`); + void pingServer(`https://${storage.host}/b`); updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; From 23069208726dc1924011eb84c8bf34d6f914a3a9 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 9 Jun 2025 16:10:06 -0700 Subject: [PATCH 218/295] Updated firebase auth changeset (#9088) --- .changeset/wicked-scissors-yell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wicked-scissors-yell.md b/.changeset/wicked-scissors-yell.md index 7005f64f8f6..a013da3001b 100644 --- a/.changeset/wicked-scissors-yell.md +++ b/.changeset/wicked-scissors-yell.md @@ -2,4 +2,4 @@ "@firebase/auth": patch --- -Fixed issue where requestSts wasn't including the Firebase Studio cookie in it +Fixed issue where Firebase Auth cookie refresh attempts issues in Firebase Studio resulted in CORS errors. From a0583094aac1bfd20ce695692623770d02068543 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Tue, 10 Jun 2025 11:28:14 -0700 Subject: [PATCH 219/295] build(all): Version Packages v11.9.1 (#9089) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> v11.9.1 release. --- .changeset/many-mails-marry.md | 5 ----- .changeset/wicked-scissors-yell.md | 5 ----- integration/compat-interop/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/auth-compat/CHANGELOG.md | 7 +++++++ packages/auth-compat/package.json | 4 ++-- packages/auth/CHANGELOG.md | 6 ++++++ packages/auth/package.json | 2 +- packages/firebase/CHANGELOG.md | 10 ++++++++++ packages/firebase/package.json | 10 +++++----- packages/firestore/package.json | 2 +- packages/storage-compat/CHANGELOG.md | 7 +++++++ packages/storage-compat/package.json | 6 +++--- packages/storage/CHANGELOG.md | 6 ++++++ packages/storage/package.json | 4 ++-- 15 files changed, 53 insertions(+), 27 deletions(-) delete mode 100644 .changeset/many-mails-marry.md delete mode 100644 .changeset/wicked-scissors-yell.md diff --git a/.changeset/many-mails-marry.md b/.changeset/many-mails-marry.md deleted file mode 100644 index 409001defc6..00000000000 --- a/.changeset/many-mails-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/storage': patch ---- - -Fixed issue where Firebase Studio wasn't populating cookies for Storage users diff --git a/.changeset/wicked-scissors-yell.md b/.changeset/wicked-scissors-yell.md deleted file mode 100644 index a013da3001b..00000000000 --- a/.changeset/wicked-scissors-yell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/auth": patch ---- - -Fixed issue where Firebase Auth cookie refresh attempts issues in Firebase Studio resulted in CORS errors. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 34a1336c733..f7da859c705 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -12,8 +12,8 @@ "@firebase/app-compat": "0.4.1", "@firebase/analytics": "0.10.16", "@firebase/analytics-compat": "0.2.22", - "@firebase/auth": "1.10.6", - "@firebase/auth-compat": "0.5.26", + "@firebase/auth": "1.10.7", + "@firebase/auth-compat": "0.5.27", "@firebase/functions": "0.12.8", "@firebase/functions-compat": "0.3.25", "@firebase/messaging": "0.12.21", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index e3682df4657..9c62c70ca5b 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.9.0", + "firebase": "11.9.1", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index aed6222d935..4dfdf4ce661 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/auth-compat +## 0.5.27 + +### Patch Changes + +- Updated dependencies [[`c0617a3`](https://github.com/firebase/firebase-js-sdk/commit/c0617a341a693c2578a21b35a4f7b27b726defef)]: + - @firebase/auth@1.10.7 + ## 0.5.26 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index cfca5a5bee6..c27a8e1f31a 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.26", + "version": "0.5.27", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.6", + "@firebase/auth": "1.10.7", "@firebase/auth-types": "0.13.0", "@firebase/component": "0.6.17", "@firebase/util": "1.12.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index fe546adc28a..5277c61cfa8 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/auth +## 1.10.7 + +### Patch Changes + +- [`c0617a3`](https://github.com/firebase/firebase-js-sdk/commit/c0617a341a693c2578a21b35a4f7b27b726defef) [#9075](https://github.com/firebase/firebase-js-sdk/pull/9075) - Fixed issue where Firebase Auth cookie refresh attempts issues in Firebase Studio resulted in CORS errors. + ## 1.10.6 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 2da4cb10b30..9ec35cfaec2 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.6", + "version": "1.10.7", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 84eb512291d..7885817632d 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,15 @@ # firebase +## 11.9.1 + +### Patch Changes + +- Updated dependencies [[`0f891d8`](https://github.com/firebase/firebase-js-sdk/commit/0f891d861bdf4e7bac8cd777f5fb32d0b7b9bf8e), [`c0617a3`](https://github.com/firebase/firebase-js-sdk/commit/c0617a341a693c2578a21b35a4f7b27b726defef)]: + - @firebase/storage@0.13.13 + - @firebase/auth@1.10.7 + - @firebase/storage-compat@0.3.23 + - @firebase/auth-compat@0.5.27 + ## 11.9.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 85bcab03aa6..4f785d15c8c 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.9.0", + "version": "11.9.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -415,8 +415,8 @@ "@firebase/app": "0.13.1", "@firebase/app-compat": "0.4.1", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.6", - "@firebase/auth-compat": "0.5.26", + "@firebase/auth": "1.10.7", + "@firebase/auth-compat": "0.5.27", "@firebase/data-connect": "0.3.9", "@firebase/database": "1.0.19", "@firebase/database-compat": "2.0.10", @@ -428,8 +428,8 @@ "@firebase/installations-compat": "0.2.17", "@firebase/messaging": "0.12.21", "@firebase/messaging-compat": "0.2.21", - "@firebase/storage": "0.13.12", - "@firebase/storage-compat": "0.3.22", + "@firebase/storage": "0.13.13", + "@firebase/storage-compat": "0.3.23", "@firebase/performance": "0.7.6", "@firebase/performance-compat": "0.2.19", "@firebase/remote-config": "0.6.4", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index d53f8d36bb0..638b8914483 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -114,7 +114,7 @@ "devDependencies": { "@firebase/app": "0.13.1", "@firebase/app-compat": "0.4.1", - "@firebase/auth": "1.10.6", + "@firebase/auth": "1.10.7", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 48117be7e87..7988847b87b 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/storage-compat +## 0.3.23 + +### Patch Changes + +- Updated dependencies [[`0f891d8`](https://github.com/firebase/firebase-js-sdk/commit/0f891d861bdf4e7bac8cd777f5fb32d0b7b9bf8e)]: + - @firebase/storage@0.13.13 + ## 0.3.22 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index f631350bce8..c5a31d6c6f0 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.22", + "version": "0.3.23", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,7 +37,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.12", + "@firebase/storage": "0.13.13", "@firebase/storage-types": "0.8.3", "@firebase/util": "1.12.0", "@firebase/component": "0.6.17", @@ -45,7 +45,7 @@ }, "devDependencies": { "@firebase/app-compat": "0.4.1", - "@firebase/auth-compat": "0.5.26", + "@firebase/auth-compat": "0.5.27", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index cabce495546..af1ec2bd2f0 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,11 @@ #Unreleased +## 0.13.13 + +### Patch Changes + +- [`0f891d8`](https://github.com/firebase/firebase-js-sdk/commit/0f891d861bdf4e7bac8cd777f5fb32d0b7b9bf8e) [#9059](https://github.com/firebase/firebase-js-sdk/pull/9059) - Fixed issue where Firebase Studio wasn't populating cookies for Storage users + ## 0.13.12 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 2884f28dea2..bb4a5004840 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.12", + "version": "0.13.13", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -55,7 +55,7 @@ }, "devDependencies": { "@firebase/app": "0.13.1", - "@firebase/auth": "1.10.6", + "@firebase/auth": "1.10.7", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", From 7fb64dd82118289950d62a64b2c4a77f00e15c4b Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Fri, 13 Jun 2025 10:07:17 -0400 Subject: [PATCH 220/295] test(ai): Upgrade mock responses to v14 (#9091) --- packages/ai/src/requests/stream-reader.test.ts | 8 ++++---- scripts/update_vertexai_responses.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ai/src/requests/stream-reader.test.ts b/packages/ai/src/requests/stream-reader.test.ts index ea832c7816f..f0298082f68 100644 --- a/packages/ai/src/requests/stream-reader.test.ts +++ b/packages/ai/src/requests/stream-reader.test.ts @@ -102,8 +102,8 @@ describe('processStream', () => { expect(response.text()).to.not.be.empty; } const aggregatedResponse = await result.response; - expect(aggregatedResponse.text()).to.include('**Cats:**'); - expect(aggregatedResponse.text()).to.include('to their owners.'); + expect(aggregatedResponse.text()).to.include('Okay'); + expect(aggregatedResponse.text()).to.include('brewing delicious coffee'); }); it('streaming response - long - big chunk', async () => { const fakeResponse = getMockResponseStreaming( @@ -116,8 +116,8 @@ describe('processStream', () => { expect(response.text()).to.not.be.empty; } const aggregatedResponse = await result.response; - expect(aggregatedResponse.text()).to.include('**Cats:**'); - expect(aggregatedResponse.text()).to.include('to their owners.'); + expect(aggregatedResponse.text()).to.include('Okay'); + expect(aggregatedResponse.text()).to.include('brewing delicious coffee'); }); it('streaming response - utf8', async () => { const fakeResponse = getMockResponseStreaming( diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index 680a71ff776..f6557ab0c0a 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v11.*' # The major version of mock responses to use +RESPONSES_VERSION='v14.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" From 41bde4237052a8cdf1d50d720dda91331cd42a05 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:08:12 -0600 Subject: [PATCH 221/295] Build and test fixes --- .../firestore/lite/pipelines/pipelines.ts | 1 - packages/firestore/src/core/pipeline-util.ts | 2 +- .../firestore/src/lite-api/expressions.ts | 2 +- packages/firestore/src/lite-api/pipeline.ts | 8 ++++++- packages/firestore/src/lite-api/stage.ts | 4 ++-- .../test/integration/api/pipeline.test.ts | 24 +++++++++---------- packages/firestore/test/lite/pipeline.test.ts | 16 ------------- 7 files changed, 23 insertions(+), 34 deletions(-) diff --git a/packages/firestore/lite/pipelines/pipelines.ts b/packages/firestore/lite/pipelines/pipelines.ts index e03e5f4883b..cc7f91e750c 100644 --- a/packages/firestore/lite/pipelines/pipelines.ts +++ b/packages/firestore/lite/pipelines/pipelines.ts @@ -116,7 +116,6 @@ export { neq, lt, countIf, - currentContext, lte, gt, gte, diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index 5f9b7d31844..3f36cf5597e 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -221,7 +221,7 @@ export function toPipeline(query: Query, db: Firestore): Pipeline { ); } - pipeline = pipeline.limit(query.limit!, true); + pipeline = pipeline.limit(query.limit!); pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); } else { pipeline = pipeline.sort(orderings[0], ...orderings.slice(1)); diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index 8120567c561..04227e259d3 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -2345,7 +2345,7 @@ export function constant(value: string): Constant; * @param value The boolean value. * @return A new `Constant` instance. */ -export function constant(value: boolean): BooleanExpr; +export function constant(value: boolean): Constant; /** * Creates a `Constant` instance for a null value. diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index d93a8fd6df0..8b5bebeddb8 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -735,7 +735,13 @@ export class Pipeline implements ProtoSerializable { const alias = field(selectable.alias); this.readUserData('unnest', alias); - return this._addStage(new Unnest(selectable.expr, alias, indexField)); + if (indexField) { + return this._addStage( + new Unnest(selectable.expr, alias, field(indexField)) + ); + } else { + return this._addStage(new Unnest(selectable.expr, alias)); + } } /** diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 2cb95053825..f65af269c76 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -438,7 +438,7 @@ export class Unnest implements Stage { constructor( private expr: Expr, private alias: Field, - private indexField?: string + private indexField?: Field ) {} _toProto(serializer: JsonProtoSerializer): ProtoStage { @@ -449,7 +449,7 @@ export class Unnest implements Stage { if (this.indexField) { stageProto.options = { - indexField: toStringValue(this.indexField) + index_field: this.indexField._toProto(serializer) }; } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 7e7d4e6b82b..5892073b4fc 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -1140,17 +1140,17 @@ apiDescribe.only('Pipelines', persistence => { ); }); - it('where with boolean constant', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(constant(true)) - .sort(ascending('__name__')) - .limit(2) - ); - expectResults(snapshot, 'book1', 'book10'); - }); + // it('where with boolean constant', async () => { + // const snapshot = await execute( + // firestore + // .pipeline() + // .collection(randomCol.path) + // .where(constant(true)) + // .sort(ascending('__name__')) + // .limit(2) + // ); + // expectResults(snapshot, 'book1', 'book10'); + // }); }); describe('sort, offset, and limit stages', () => { @@ -1422,7 +1422,7 @@ apiDescribe.only('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) - .unnest(field('tags').as('tag')) + .unnest(field('tags').as('tag'), 'tagsIndex') .select( 'title', 'author', diff --git a/packages/firestore/test/lite/pipeline.test.ts b/packages/firestore/test/lite/pipeline.test.ts index cedc6b4dcf9..f919e1aa9de 100644 --- a/packages/firestore/test/lite/pipeline.test.ts +++ b/packages/firestore/test/lite/pipeline.test.ts @@ -61,7 +61,6 @@ import { neq, lt, countIf, - currentContext, lte, gt, arrayConcat, @@ -2361,21 +2360,6 @@ describe('Firestore Pipelines', () => { expectResults(snapshot, ...expectedResults); }); - // TODO: current_context tests with are failing because of b/395937453 - itIf(testUnsupportedFeatures)('supports currentContext', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(currentContext().as('currentContext')) - ); - expectResults(snapshot, { - currentContext: 'TODO' - }); - }); - it('supports map', async () => { const snapshot = await execute( firestore From 13e6cce882d687e06c8d9bfb56895f8a77fc57b5 Mon Sep 17 00:00:00 2001 From: eranc-google Date: Wed, 18 Jun 2025 00:40:56 +0300 Subject: [PATCH 222/295] Feat/google3 typings support (#9085) --- .changeset/brave-boats-arrive.md | 7 +++++++ packages/analytics/package.json | 1 + packages/analytics/rollup.config.js | 16 +++++++++++++++- packages/remote-config/package.json | 1 + packages/remote-config/rollup.config.js | 16 +++++++++++++++- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .changeset/brave-boats-arrive.md diff --git a/.changeset/brave-boats-arrive.md b/.changeset/brave-boats-arrive.md new file mode 100644 index 00000000000..1e2f703ddb3 --- /dev/null +++ b/.changeset/brave-boats-arrive.md @@ -0,0 +1,7 @@ +--- +'@firebase/remote-config': patch +'@firebase/analytics': patch +'firebase': patch +--- + +Add rollup config to generate modular typings for google3 diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 3f8decfc35f..5d4c4d06735 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -49,6 +49,7 @@ "devDependencies": { "@firebase/app": "0.13.1", "rollup": "2.79.2", + "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", diff --git a/packages/analytics/rollup.config.js b/packages/analytics/rollup.config.js index a22194d1d4a..529858f147f 100644 --- a/packages/analytics/rollup.config.js +++ b/packages/analytics/rollup.config.js @@ -19,6 +19,7 @@ import json from '@rollup/plugin-json'; import typescriptPlugin from 'rollup-plugin-typescript2'; import replace from 'rollup-plugin-replace'; import typescript from 'typescript'; +import dts from 'rollup-plugin-dts'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; @@ -77,4 +78,17 @@ const cjsBuilds = [ } ]; -export default [...esmBuilds, ...cjsBuilds]; +const google3TypingsBuild = { + input: 'dist/src/index.d.ts', + output: { + file: 'dist/src/global_index.d.ts', + format: 'es' + }, + plugins: [ + dts({ + respectExternal: true + }) + ] +}; + +export default [...esmBuilds, ...cjsBuilds, google3TypingsBuild]; diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 194f9806cb7..43648d267d4 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -50,6 +50,7 @@ "devDependencies": { "@firebase/app": "0.13.1", "rollup": "2.79.2", + "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" }, diff --git a/packages/remote-config/rollup.config.js b/packages/remote-config/rollup.config.js index 36622f4dae2..d8eb3abd315 100644 --- a/packages/remote-config/rollup.config.js +++ b/packages/remote-config/rollup.config.js @@ -19,6 +19,7 @@ import json from '@rollup/plugin-json'; // Enables package.json import in TypeSc import typescriptPlugin from 'rollup-plugin-typescript2'; import replace from 'rollup-plugin-replace'; import typescript from 'typescript'; +import dts from 'rollup-plugin-dts'; import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; import pkg from './package.json'; @@ -70,4 +71,17 @@ const cjsBuild = { ] }; -export default [esmBuild, cjsBuild]; +const google3TypingsBuild = { + input: 'dist/src/index.d.ts', + output: { + file: 'dist/src/global_index.d.ts', + format: 'es' + }, + plugins: [ + dts({ + respectExternal: true + }) + ] +}; + +export default [esmBuild, cjsBuild, google3TypingsBuild]; From b97eab36a3553c906c35f4751a0b17c717178b13 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 18 Jun 2025 15:54:01 -0400 Subject: [PATCH 223/295] fix(ai): Add deprecation tag to `totalBillableCharacters` (#9090) --- .changeset/old-candles-confess.md | 5 +++++ common/api-review/ai.api.md | 1 + docs-devsite/ai.counttokensresponse.md | 11 +++++++---- packages/ai/src/types/responses.ts | 5 ++--- 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .changeset/old-candles-confess.md diff --git a/.changeset/old-candles-confess.md b/.changeset/old-candles-confess.md new file mode 100644 index 00000000000..6fbe742818f --- /dev/null +++ b/.changeset/old-candles-confess.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Add deprecation label to `totalBillableCharacters`. `totalTokens` should be used instead. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 23c13688fb1..ab79447798f 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -164,6 +164,7 @@ export interface CountTokensRequest { // @public export interface CountTokensResponse { promptTokensDetails?: ModalityTokenCount[]; + // @deprecated (undocumented) totalBillableCharacters?: number; totalTokens: number; } diff --git a/docs-devsite/ai.counttokensresponse.md b/docs-devsite/ai.counttokensresponse.md index 71e64d885d8..8a7181a2e03 100644 --- a/docs-devsite/ai.counttokensresponse.md +++ b/docs-devsite/ai.counttokensresponse.md @@ -23,7 +23,7 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | | [promptTokensDetails](./ai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. | -| [totalBillableCharacters](./ai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. | +| [totalBillableCharacters](./ai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | | | [totalTokens](./ai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.promptTokensDetails @@ -38,9 +38,12 @@ promptTokensDetails?: ModalityTokenCount[]; ## CountTokensResponse.totalBillableCharacters -The total number of billable characters counted across all instances from the request. - -This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property is not supported and will default to 0. +> Warning: This API is now obsolete. +> +> Use `totalTokens` instead. This property is undefined when using models greater than `gemini-1.5-*`. +> +> The total number of billable characters counted across all instances from the request. +> Signature: diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index e33b8a86bd3..8072e06fd02 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -270,11 +270,10 @@ export interface CountTokensResponse { */ totalTokens: number; /** + * @deprecated Use `totalTokens` instead. This property is undefined when using models greater than `gemini-1.5-*`. + * * The total number of billable characters counted across all instances * from the request. - * - * This property is only supported when using the Vertex AI Gemini API ({@link VertexAIBackend}). - * When using the Gemini Developer API ({@link GoogleAIBackend}), this property is not supported and will default to 0. */ totalBillableCharacters?: number; /** From 41e3c4cdfc459dcbb9c0e1239684aa12c7d1f779 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Fri, 20 Jun 2025 15:45:18 -0400 Subject: [PATCH 224/295] test(ai): Add `gemini-2.5-flash` to integration tests (#9110) Added gemini-2.5-flash to our integration tests now that it's publicly available. The token counts differ slightly between 2.0-flash and 2.5-flash so I introduced conditionals when checking token counts. --- packages/ai/integration/chat.test.ts | 105 +++++++++++------- packages/ai/integration/constants.ts | 2 +- .../ai/integration/generate-content.test.ts | 91 ++++++++++----- 3 files changed, 129 insertions(+), 69 deletions(-) diff --git a/packages/ai/integration/chat.test.ts b/packages/ai/integration/chat.test.ts index 6af0e7a9af9..b6772a38fb1 100644 --- a/packages/ai/integration/chat.test.ts +++ b/packages/ai/integration/chat.test.ts @@ -76,56 +76,85 @@ describe('Chat Session', () => { 'What is the capital of France?' ); const response1 = result1.response; - expect(response1.text().trim().toLowerCase()).to.include('paris'); + const result2 = await chat.sendMessage('And what about Italy?'); + const response2 = result2.response; + const history = await chat.getHistory(); - let history = await chat.getHistory(); - expect(history.length).to.equal(2); + expect(response1.text().trim().toLowerCase()).to.include('paris'); + expect(response1.usageMetadata).to.not.be.null; + expect(response2.text().trim().toLowerCase()).to.include('rome'); + expect(response2.usageMetadata).to.not.be.null; + expect(history.length).to.equal(4); expect(history[0].role).to.equal('user'); expect(history[0].parts[0].text).to.equal( 'What is the capital of France?' ); expect(history[1].role).to.equal('model'); expect(history[1].parts[0].text?.toLowerCase()).to.include('paris'); - - expect(response1.usageMetadata).to.not.be.null; - // Token counts can vary slightly in chat context - expect(response1.usageMetadata!.promptTokenCount).to.be.closeTo( - 15, // "What is the capital of France?" + system instruction - TOKEN_COUNT_DELTA + 2 // More variance for chat context - ); - expect(response1.usageMetadata!.candidatesTokenCount).to.be.closeTo( - 8, // "Paris" - TOKEN_COUNT_DELTA - ); - expect(response1.usageMetadata!.totalTokenCount).to.be.closeTo( - 23, // "What is the capital of France?" + system instruction + "Paris" - TOKEN_COUNT_DELTA + 3 // More variance for chat context - ); - - const result2 = await chat.sendMessage('And what about Italy?'); - const response2 = result2.response; - expect(response2.text().trim().toLowerCase()).to.include('rome'); - - history = await chat.getHistory(); - expect(history.length).to.equal(4); expect(history[2].role).to.equal('user'); expect(history[2].parts[0].text).to.equal('And what about Italy?'); expect(history[3].role).to.equal('model'); expect(history[3].parts[0].text?.toLowerCase()).to.include('rome'); - expect(response2.usageMetadata).to.not.be.null; - expect(response2.usageMetadata!.promptTokenCount).to.be.closeTo( - 28, // History + "And what about Italy?" + system instruction - TOKEN_COUNT_DELTA + 5 // More variance for chat context with history - ); - expect(response2.usageMetadata!.candidatesTokenCount).to.be.closeTo( - 8, - TOKEN_COUNT_DELTA - ); - expect(response2.usageMetadata!.totalTokenCount).to.be.closeTo( - 36, - TOKEN_COUNT_DELTA - ); + if (model.model.includes('gemini-2.5-flash')) { + // Token counts can vary slightly in chat context + expect(response1.usageMetadata!.promptTokenCount).to.be.closeTo( + 17, // "What is the capital of France?" + system instruction + TOKEN_COUNT_DELTA + 2 // More variance for chat context + ); + expect(response1.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, // "Paris" + TOKEN_COUNT_DELTA + ); + expect(response1.usageMetadata!.totalTokenCount).to.be.closeTo( + 49, // "What is the capital of France?" + system instruction + "Paris" + TOKEN_COUNT_DELTA + 3 // More variance for chat context + ); + expect(response1.usageMetadata!.totalTokenCount).to.be.closeTo( + 49, // "What is the capital of France?" + system instruction + "Paris" + TOKEN_COUNT_DELTA + 3 // More variance for chat context + ); + + expect(response2.usageMetadata!.promptTokenCount).to.be.closeTo( + 32, // History + "And what about Italy?" + system instruction + TOKEN_COUNT_DELTA + 5 // More variance for chat context with history + ); + expect(response2.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, + TOKEN_COUNT_DELTA + ); + expect(response2.usageMetadata!.totalTokenCount).to.be.closeTo( + 68, + TOKEN_COUNT_DELTA + 2 + ); + } else if (model.model.includes('gemini-2.0-flash')) { + expect(response1.usageMetadata).to.not.be.null; + // Token counts can vary slightly in chat context + expect(response1.usageMetadata!.promptTokenCount).to.be.closeTo( + 15, // "What is the capital of France?" + system instruction + TOKEN_COUNT_DELTA + 2 // More variance for chat context + ); + expect(response1.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, // "Paris" + TOKEN_COUNT_DELTA + ); + expect(response1.usageMetadata!.totalTokenCount).to.be.closeTo( + 23, // "What is the capital of France?" + system instruction + "Paris" + TOKEN_COUNT_DELTA + 3 // More variance for chat context + ); + expect(response2.usageMetadata!.promptTokenCount).to.be.closeTo( + 28, // History + "And what about Italy?" + system instruction + TOKEN_COUNT_DELTA + 5 // More variance for chat context with history + ); + expect(response2.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 8, + TOKEN_COUNT_DELTA + ); + expect(response2.usageMetadata!.totalTokenCount).to.be.closeTo( + 36, + TOKEN_COUNT_DELTA + ); + } }); }); }); diff --git a/packages/ai/integration/constants.ts b/packages/ai/integration/constants.ts index 68aebf9eddc..1adfa4f47a0 100644 --- a/packages/ai/integration/constants.ts +++ b/packages/ai/integration/constants.ts @@ -52,7 +52,7 @@ const backendNames: Map = new Map([ [BackendType.VERTEX_AI, 'Vertex AI'] ]); -const modelNames: readonly string[] = ['gemini-2.0-flash']; +const modelNames: readonly string[] = ['gemini-2.0-flash', 'gemini-2.5-flash']; /** * Array of test configurations that is iterated over to get full coverage diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts index af877396cc8..22e4b0a30ac 100644 --- a/packages/ai/integration/generate-content.test.ts +++ b/packages/ai/integration/generate-content.test.ts @@ -81,36 +81,67 @@ describe('Generate Content', () => { expect(trimmedText).to.equal('Mountain View'); expect(response.usageMetadata).to.not.be.null; - expect(response.usageMetadata!.promptTokenCount).to.be.closeTo( - 21, - TOKEN_COUNT_DELTA - ); - expect(response.usageMetadata!.candidatesTokenCount).to.be.closeTo( - 4, - TOKEN_COUNT_DELTA - ); - expect(response.usageMetadata!.totalTokenCount).to.be.closeTo( - 25, - TOKEN_COUNT_DELTA * 2 - ); - expect(response.usageMetadata!.promptTokensDetails).to.not.be.null; - expect(response.usageMetadata!.promptTokensDetails!.length).to.equal(1); - expect( - response.usageMetadata!.promptTokensDetails![0].modality - ).to.equal(Modality.TEXT); - expect( - response.usageMetadata!.promptTokensDetails![0].tokenCount - ).to.equal(21); - expect(response.usageMetadata!.candidatesTokensDetails).to.not.be.null; - expect( - response.usageMetadata!.candidatesTokensDetails!.length - ).to.equal(1); - expect( - response.usageMetadata!.candidatesTokensDetails![0].modality - ).to.equal(Modality.TEXT); - expect( - response.usageMetadata!.candidatesTokensDetails![0].tokenCount - ).to.be.closeTo(4, TOKEN_COUNT_DELTA); + + if (model.model.includes('gemini-2.5-flash')) { + expect(response.usageMetadata!.promptTokenCount).to.be.closeTo( + 22, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 2, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.totalTokenCount).to.be.closeTo( + 55, + TOKEN_COUNT_DELTA * 2 + ); + expect(response.usageMetadata!.promptTokensDetails).to.not.be.null; + expect(response.usageMetadata!.promptTokensDetails!.length).to.equal( + 1 + ); + expect( + response.usageMetadata!.promptTokensDetails![0].modality + ).to.equal(Modality.TEXT); + expect( + response.usageMetadata!.promptTokensDetails![0].tokenCount + ).to.closeTo(22, TOKEN_COUNT_DELTA); + + // candidatesTokenDetails comes back about half the time, so let's just not test it. + } else if (model.model.includes('gemini-2.0-flash')) { + expect(response.usageMetadata!.promptTokenCount).to.be.closeTo( + 21, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.candidatesTokenCount).to.be.closeTo( + 4, + TOKEN_COUNT_DELTA + ); + expect(response.usageMetadata!.totalTokenCount).to.be.closeTo( + 25, + TOKEN_COUNT_DELTA * 2 + ); + expect(response.usageMetadata!.promptTokensDetails).to.not.be.null; + expect(response.usageMetadata!.promptTokensDetails!.length).to.equal( + 1 + ); + expect( + response.usageMetadata!.promptTokensDetails![0].modality + ).to.equal(Modality.TEXT); + expect( + response.usageMetadata!.promptTokensDetails![0].tokenCount + ).to.equal(21); + expect(response.usageMetadata!.candidatesTokensDetails).to.not.be + .null; + expect( + response.usageMetadata!.candidatesTokensDetails!.length + ).to.equal(1); + expect( + response.usageMetadata!.candidatesTokensDetails![0].modality + ).to.equal(Modality.TEXT); + expect( + response.usageMetadata!.candidatesTokensDetails![0].tokenCount + ).to.be.closeTo(4, TOKEN_COUNT_DELTA); + } }); it('generateContentStream: text input, text output', async () => { From f73e08b212314547b39a10cd3e393f9e94776f21 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 20 Jun 2025 21:23:24 +0000 Subject: [PATCH 225/295] firestore: minor refactor of listener registration of "versionchange" indexedb events (#9087) --- .changeset/long-pets-sell.md | 5 +++ .../firestore/src/core/firestore_client.ts | 22 ++++++++--- .../src/local/indexeddb_persistence.ts | 29 +++++++++----- packages/firestore/src/local/persistence.ts | 18 +++++++-- packages/firestore/src/local/simple_db.ts | 38 +++++++++++++------ .../test/unit/specs/spec_test_runner.ts | 10 ++++- 6 files changed, 90 insertions(+), 32 deletions(-) create mode 100644 .changeset/long-pets-sell.md diff --git a/.changeset/long-pets-sell.md b/.changeset/long-pets-sell.md new file mode 100644 index 00000000000..d340f7da82c --- /dev/null +++ b/.changeset/long-pets-sell.md @@ -0,0 +1,5 @@ +--- +'@firebase/firestore': patch +--- + +Internal listener registration change for IndexedDB "versionchange" events. diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index e2aa19aaba8..e43060d229d 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -230,11 +230,23 @@ export async function setOfflineComponentProvider( } }); - // When a user calls clearPersistence() in one client, all other clients - // need to be terminated to allow the delete to succeed. - offlineComponentProvider.persistence.setDatabaseDeletedListener(() => - client.terminate() - ); + offlineComponentProvider.persistence.setDatabaseDeletedListener(() => { + logWarn('Terminating Firestore due to IndexedDb database deletion'); + client + .terminate() + .then(() => { + logDebug( + 'Terminating Firestore due to IndexedDb database deletion ' + + 'completed successfully' + ); + }) + .catch(error => { + logWarn( + 'Terminating Firestore due to IndexedDb database deletion failed', + error + ); + }); + }); client._offlineComponents = offlineComponentProvider; } diff --git a/packages/firestore/src/local/indexeddb_persistence.ts b/packages/firestore/src/local/indexeddb_persistence.ts index 57c26ea5baa..0ec2baabfe4 100644 --- a/packages/firestore/src/local/indexeddb_persistence.ts +++ b/packages/firestore/src/local/indexeddb_persistence.ts @@ -58,7 +58,11 @@ import { IndexedDbTargetCache } from './indexeddb_target_cache'; import { getStore, IndexedDbTransaction } from './indexeddb_transaction'; import { LocalSerializer } from './local_serializer'; import { LruParams } from './lru_garbage_collector'; -import { Persistence, PrimaryStateListener } from './persistence'; +import { + DatabaseDeletedListener, + Persistence, + PrimaryStateListener +} from './persistence'; import { PersistencePromise } from './persistence_promise'; import { PersistenceTransaction, @@ -324,20 +328,25 @@ export class IndexedDbPersistence implements Persistence { } /** - * Registers a listener that gets called when the database receives a - * version change event indicating that it has deleted. + * Registers a listener that gets called when the underlying database receives + * an event indicating that it either has been deleted or is pending deletion + * and must be closed. + * + * For example, this callback will be called in the case that multi-tab + * IndexedDB persistence is in use and another tab calls + * clearIndexedDbPersistence(). In that case, this Firestore instance must + * close its IndexedDB connection in order to allow the deletion initiated by + * the other tab to proceed. + * + * This method may only be called once; subsequent invocations will result in + * an exception, refusing to supersede the previously-registered listener. * * PORTING NOTE: This is only used for Web multi-tab. */ setDatabaseDeletedListener( - databaseDeletedListener: () => Promise + databaseDeletedListener: DatabaseDeletedListener ): void { - this.simpleDb.setVersionChangeListener(async event => { - // Check if an attempt is made to delete IndexedDB. - if (event.newVersion === null) { - await databaseDeletedListener(); - } - }); + this.simpleDb.setDatabaseDeletedListener(databaseDeletedListener); } /** diff --git a/packages/firestore/src/local/persistence.ts b/packages/firestore/src/local/persistence.ts index b014a6479ac..113efe7b7d3 100644 --- a/packages/firestore/src/local/persistence.ts +++ b/packages/firestore/src/local/persistence.ts @@ -98,6 +98,8 @@ export interface ReferenceDelegate { ): PersistencePromise; } +export type DatabaseDeletedListener = () => void; + /** * Persistence is the lowest-level shared interface to persistent storage in * Firestore. @@ -151,13 +153,23 @@ export interface Persistence { shutdown(): Promise; /** - * Registers a listener that gets called when the database receives a - * version change event indicating that it has deleted. + * Registers a listener that gets called when the underlying database receives + * an event indicating that it either has been deleted or is pending deletion + * and must be closed. + * + * For example, this callback will be called in the case that multi-tab + * IndexedDB persistence is in use and another tab calls + * clearIndexedDbPersistence(). In that case, this Firestore instance must + * close its IndexedDB connection in order to allow the deletion initiated by + * the other tab to proceed. + * + * This method may only be called once; subsequent invocations will result in + * an exception, refusing to supersede the previously-registered listener. * * PORTING NOTE: This is only used for Web multi-tab. */ setDatabaseDeletedListener( - databaseDeletedListener: () => Promise + databaseDeletedListener: DatabaseDeletedListener ): void; /** diff --git a/packages/firestore/src/local/simple_db.ts b/packages/firestore/src/local/simple_db.ts index 6d27702e725..1e315c5dae6 100644 --- a/packages/firestore/src/local/simple_db.ts +++ b/packages/firestore/src/local/simple_db.ts @@ -19,9 +19,10 @@ import { getGlobal, getUA, isIndexedDBAvailable } from '@firebase/util'; import { debugAssert } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; -import { logDebug, logError } from '../util/log'; +import { logDebug, logError, logWarn } from '../util/log'; import { Deferred } from '../util/promise'; +import { DatabaseDeletedListener } from './persistence'; import { PersistencePromise } from './persistence_promise'; // References to `indexedDB` are guarded by SimpleDb.isAvailable() and getGlobal() @@ -158,8 +159,8 @@ export class SimpleDbTransaction { */ export class SimpleDb { private db?: IDBDatabase; + private databaseDeletedListener?: DatabaseDeletedListener; private lastClosedDbVersion: number | null = null; - private versionchangelistener?: (event: IDBVersionChangeEvent) => void; /** Deletes the specified database. */ static delete(name: string): Promise { @@ -392,22 +393,35 @@ export class SimpleDb { ); } - if (this.versionchangelistener) { - this.db.onversionchange = event => this.versionchangelistener!(event); - } + this.db.addEventListener( + 'versionchange', + event => { + // Notify the listener if another tab attempted to delete the IndexedDb + // database, such as by calling clearIndexedDbPersistence(). + if (event.newVersion === null) { + logWarn( + `Received "versionchange" event with newVersion===null; ` + + 'notifying the registered DatabaseDeletedListener, if any' + ); + this.databaseDeletedListener?.(); + } + }, + { passive: true } + ); return this.db; } - setVersionChangeListener( - versionChangeListener: (event: IDBVersionChangeEvent) => void + setDatabaseDeletedListener( + databaseDeletedListener: DatabaseDeletedListener ): void { - this.versionchangelistener = versionChangeListener; - if (this.db) { - this.db.onversionchange = (event: IDBVersionChangeEvent) => { - return versionChangeListener(event); - }; + if (this.databaseDeletedListener) { + throw new Error( + 'setDatabaseDeletedListener() may only be called once, ' + + 'and it has already been called' + ); } + this.databaseDeletedListener = databaseDeletedListener; } async runTransaction( diff --git a/packages/firestore/test/unit/specs/spec_test_runner.ts b/packages/firestore/test/unit/specs/spec_test_runner.ts index 51d2229b8a1..daa513edb68 100644 --- a/packages/firestore/test/unit/specs/spec_test_runner.ts +++ b/packages/firestore/test/unit/specs/spec_test_runner.ts @@ -365,8 +365,14 @@ abstract class TestRunner { this.eventManager.onLastRemoteStoreUnlisten = triggerRemoteStoreUnlisten.bind(null, this.syncEngine); - await this.persistence.setDatabaseDeletedListener(async () => { - await this.shutdown(); + this.persistence.setDatabaseDeletedListener(() => { + this.shutdown().catch(error => { + console.warn( + 'WARNING: this.shutdown() failed in callback ' + + 'specified to persistence.setDatabaseDeletedListener', + error + ); + }); }); this.started = true; From 42ac4011787db6bb7a08f8c84f364ea86ea51e83 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 23 Jun 2025 10:07:19 -0700 Subject: [PATCH 226/295] Fixed issue where storage wasn't passing cookies when using firebase Studio (#9111) --- .changeset/brown-pens-confess.md | 6 ++++++ common/api-review/util.api.md | 2 +- packages/storage/test/browser/connection.test.ts | 2 +- packages/util/src/url.ts | 16 ++++++++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .changeset/brown-pens-confess.md diff --git a/.changeset/brown-pens-confess.md b/.changeset/brown-pens-confess.md new file mode 100644 index 00000000000..038b177796e --- /dev/null +++ b/.changeset/brown-pens-confess.md @@ -0,0 +1,6 @@ +--- +"@firebase/storage": patch +"@firebase/util": patch +--- + +Fixed issue where Storage on Firebase Studio throws CORS errors. diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index f263f450da3..4ac51fda550 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -270,7 +270,7 @@ export function isBrowserExtension(): boolean; export function isCloudflareWorker(): boolean; // @public -export function isCloudWorkstation(host: string): boolean; +export function isCloudWorkstation(url: string): boolean; // Warning: (ae-missing-release-tag) "isElectron" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/packages/storage/test/browser/connection.test.ts b/packages/storage/test/browser/connection.test.ts index 2a0320d0c02..4cb4d4cb919 100644 --- a/packages/storage/test/browser/connection.test.ts +++ b/packages/storage/test/browser/connection.test.ts @@ -35,7 +35,7 @@ describe('Connections', () => { const fakeXHR = useFakeXMLHttpRequest(); const connection = new XhrBytesConnection(); const sendPromise = connection.send( - 'https://abc.cloudworkstations.dev', + 'https://abc.cloudworkstations.dev/test', 'GET', true ); diff --git a/packages/util/src/url.ts b/packages/util/src/url.ts index e41d26594c2..6de92584979 100644 --- a/packages/util/src/url.ts +++ b/packages/util/src/url.ts @@ -19,8 +19,20 @@ * Checks whether host is a cloud workstation or not. * @public */ -export function isCloudWorkstation(host: string): boolean { - return host.endsWith('.cloudworkstations.dev'); +export function isCloudWorkstation(url: string): boolean { + // `isCloudWorkstation` is called without protocol in certain connect*Emulator functions + // In HTTP request builders, it's called with the protocol. + // If called with protocol prefix, it's a valid URL, so we extract the hostname + // If called without, we assume the string is the hostname. + try { + const host = + url.startsWith('http://') || url.startsWith('https://') + ? new URL(url).hostname + : url; + return host.endsWith('.cloudworkstations.dev'); + } catch { + return false; + } } /** From bb57947c942e44b39e5b0254324bee6bf665fd4e Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 23 Jun 2025 10:56:53 -0700 Subject: [PATCH 227/295] fix: Add "react-native" entry point to @firebase/app (#9112) --- .changeset/giant-lamps-live.md | 5 +++++ packages/app/package.json | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/giant-lamps-live.md diff --git a/.changeset/giant-lamps-live.md b/.changeset/giant-lamps-live.md new file mode 100644 index 00000000000..f66c22deb86 --- /dev/null +++ b/.changeset/giant-lamps-live.md @@ -0,0 +1,5 @@ +--- +'@firebase/app': patch +--- + +Add "react-native" entry point to @firebase/app diff --git a/packages/app/package.json b/packages/app/package.json index 5f892ecc525..3d6a0ca5dca 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -6,10 +6,12 @@ "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", + "react-native": "dist/index.cjs.js", "exports": { ".": { "types": "./dist/app-public.d.ts", "require": "./dist/index.cjs.js", + "react-native": "./dist/index.cjs.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" From 7ae5b12b901620aa101b5caed94064271fb76fb6 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Mon, 23 Jun 2025 14:57:19 -0400 Subject: [PATCH 228/295] Feat(Firestore) JSON serialization of types to improve SSR support. (#8926) Support the ability to resume `onSnapshot` listeners in the CSR phase based on serialized `DataSnapshot`s and `QuerySnapshot`s built in the SSR phase. Allow Firestore result types to be serialized with `toJSON` and then deserialized with `fromJSON` methods on the objects. `DocumentSnapshot` and `QuerySnapshot` deserialization methods will be standalone, tree-shakable functions `dataSnapshotFromJSON` and `querySnapshotFromJSON`. --- common/api-review/firestore-lite.api.md | 11 + common/api-review/firestore.api.md | 65 ++ docs-devsite/firestore_.bytes.md | 39 + docs-devsite/firestore_.documentreference.md | 65 ++ docs-devsite/firestore_.documentsnapshot.md | 16 + docs-devsite/firestore_.geopoint.md | 32 +- docs-devsite/firestore_.md | 353 +++++++++ docs-devsite/firestore_.querysnapshot.md | 16 + docs-devsite/firestore_.timestamp.md | 24 +- docs-devsite/firestore_.vectorvalue.md | 39 + docs-devsite/firestore_lite.bytes.md | 39 + .../firestore_lite.documentreference.md | 65 ++ docs-devsite/firestore_lite.geopoint.md | 32 +- docs-devsite/firestore_lite.timestamp.md | 24 +- docs-devsite/firestore_lite.vectorvalue.md | 39 + packages/firestore/src/api.ts | 3 + packages/firestore/src/api/reference_impl.ts | 672 +++++++++++++++--- packages/firestore/src/api/snapshot.ts | 326 +++++++++ packages/firestore/src/core/bundle_impl.ts | 49 +- .../firestore/src/core/firestore_client.ts | 12 +- .../firestore/src/core/sync_engine_impl.ts | 8 +- packages/firestore/src/lite-api/bytes.ts | 38 + packages/firestore/src/lite-api/geo_point.ts | 45 +- packages/firestore/src/lite-api/reference.ts | 70 ++ packages/firestore/src/lite-api/timestamp.ts | 35 +- .../src/lite-api/user_data_reader.ts | 2 +- .../firestore/src/lite-api/vector_value.ts | 48 ++ .../src/platform/browser/snapshot_to_json.ts | 43 ++ .../platform/browser_lite/snapshot_to_json.ts | 18 + .../src/platform/node/snapshot_to_json.ts | 84 +++ .../platform/node_lite/snapshot_to_json.ts | 18 + .../src/platform/rn/snapshot_to_json.ts | 21 + .../src/platform/rn_lite/snapshot_to_json.ts | 18 + .../src/platform/snapshot_to_json.ts | 62 ++ packages/firestore/src/remote/serializer.ts | 5 +- .../firestore/src/util/bundle_builder_impl.ts | 284 ++++++++ packages/firestore/src/util/bundle_reader.ts | 21 + .../src/util/bundle_reader_sync_impl.ts | 129 ++++ .../firestore/src/util/json_validation.ts | 142 ++++ .../test/integration/api/database.test.ts | 428 ++++++++++- .../test/integration/api/query.test.ts | 44 ++ .../firestore/test/lite/integration.test.ts | 14 + .../firestore/test/unit/api/bytes.test.ts | 48 ++ .../firestore/test/unit/api/database.test.ts | 517 ++++++++++++++ .../firestore/test/unit/api/geo_point.test.ts | 87 ++- .../firestore/test/unit/api/timestamp.test.ts | 92 ++- .../test/unit/api/vector_value.test.ts | 73 ++ .../unit/local/indexeddb_persistence.test.ts | 6 +- packages/firestore/test/util/api_helpers.ts | 8 +- 49 files changed, 4190 insertions(+), 139 deletions(-) create mode 100644 packages/firestore/src/platform/browser/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/browser_lite/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/node/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/node_lite/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/rn/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/rn_lite/snapshot_to_json.ts create mode 100644 packages/firestore/src/platform/snapshot_to_json.ts create mode 100644 packages/firestore/src/util/bundle_builder_impl.ts create mode 100644 packages/firestore/src/util/bundle_reader_sync_impl.ts create mode 100644 packages/firestore/src/util/json_validation.ts create mode 100644 packages/firestore/test/unit/api/vector_value.test.ts diff --git a/common/api-review/firestore-lite.api.md b/common/api-review/firestore-lite.api.md index 4a9ef4c0171..46b85a0efc5 100644 --- a/common/api-review/firestore-lite.api.md +++ b/common/api-review/firestore-lite.api.md @@ -68,9 +68,11 @@ export function average(field: string | FieldPath): AggregateField { readonly converter: FirestoreDataConverter | null; readonly firestore: Firestore; + static fromJSON(firestore: Firestore, json: object): DocumentReference; + static fromJSON(firestore: Firestore, json: object, converter: FirestoreDataConverter): DocumentReference; get id(): string; get parent(): CollectionReference; get path(): string; + toJSON(): object; readonly type = "document"; withConverter(converter: FirestoreDataConverter): DocumentReference; withConverter(converter: null): DocumentReference; @@ -205,12 +210,14 @@ export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | // @public export class GeoPoint { constructor(latitude: number, longitude: number); + static fromJSON(json: object): GeoPoint; isEqual(other: GeoPoint): boolean; get latitude(): number; get longitude(): number; toJSON(): { latitude: number; longitude: number; + type: string; }; } @@ -416,6 +423,7 @@ export class Timestamp { seconds: number, nanoseconds: number); static fromDate(date: Date): Timestamp; + static fromJSON(json: object): Timestamp; static fromMillis(milliseconds: number): Timestamp; isEqual(other: Timestamp): boolean; readonly nanoseconds: number; @@ -425,6 +433,7 @@ export class Timestamp { toJSON(): { seconds: number; nanoseconds: number; + type: string; }; toMillis(): number; toString(): string; @@ -466,8 +475,10 @@ export function vector(values?: number[]): VectorValue; // @public export class VectorValue { /* Excluded from this release type: __constructor */ + static fromJSON(json: object): VectorValue; isEqual(other: VectorValue): boolean; toArray(): number[]; + toJSON(): object; } // @public diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 34b56b97f21..292d81d7a75 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -68,9 +68,11 @@ export function average(field: string | FieldPath): AggregateField { readonly converter: FirestoreDataConverter | null; readonly firestore: Firestore; + static fromJSON(firestore: Firestore, json: object): DocumentReference; + static fromJSON(firestore: Firestore, json: object, converter: FirestoreDataConverter): DocumentReference; get id(): string; get parent(): CollectionReference; get path(): string; + toJSON(): object; readonly type = "document"; withConverter(converter: FirestoreDataConverter): DocumentReference; withConverter(converter: null): DocumentReference; @@ -178,8 +183,15 @@ export class DocumentSnapshot; + toJSON(): object; } +// @public +export function documentSnapshotFromJSON(db: Firestore, json: object): DocumentSnapshot; + +// @public +export function documentSnapshotFromJSON(db: Firestore, json: object, converter: FirestoreDataConverter): DocumentSnapshot; + export { EmulatorMockTokenOptions } // @public @deprecated @@ -264,12 +276,14 @@ export interface FirestoreSettings { // @public export class GeoPoint { constructor(latitude: number, longitude: number); + static fromJSON(json: object): GeoPoint; isEqual(other: GeoPoint): boolean; get latitude(): number; get longitude(): number; toJSON(): { latitude: number; longitude: number; + type: string; }; } @@ -459,6 +473,46 @@ export function onSnapshot(query // @public export function onSnapshot(query: Query, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void): Unsubscribe; +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; + +// @public +export function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; + // @public export function onSnapshotsInSync(firestore: Firestore, observer: { next?: (value: void) => void; @@ -610,8 +664,15 @@ export class QuerySnapshot; get size(): number; + toJSON(): object; } +// @public +export function querySnapshotFromJSON(db: Firestore, json: object): QuerySnapshot; + +// @public +export function querySnapshotFromJSON(db: Firestore, json: object, converter: FirestoreDataConverter): QuerySnapshot; + // @public export class QueryStartAtConstraint extends QueryConstraint { readonly type: 'startAt' | 'startAfter'; @@ -696,6 +757,7 @@ export class Timestamp { seconds: number, nanoseconds: number); static fromDate(date: Date): Timestamp; + static fromJSON(json: object): Timestamp; static fromMillis(milliseconds: number): Timestamp; isEqual(other: Timestamp): boolean; readonly nanoseconds: number; @@ -705,6 +767,7 @@ export class Timestamp { toJSON(): { seconds: number; nanoseconds: number; + type: string; }; toMillis(): number; toString(): string; @@ -751,8 +814,10 @@ export function vector(values?: number[]): VectorValue; // @public export class VectorValue { /* Excluded from this release type: __constructor */ + static fromJSON(json: object): VectorValue; isEqual(other: VectorValue): boolean; toArray(): number[]; + toJSON(): object; } // @public diff --git a/docs-devsite/firestore_.bytes.md b/docs-devsite/firestore_.bytes.md index 8060d394a45..164ddc1acd9 100644 --- a/docs-devsite/firestore_.bytes.md +++ b/docs-devsite/firestore_.bytes.md @@ -23,9 +23,11 @@ export declare class Bytes | Method | Modifiers | Description | | --- | --- | --- | | [fromBase64String(base64)](./firestore_.bytes.md#bytesfrombase64string) | static | Creates a new Bytes object from the given Base64 string, converting it to bytes. | +| [fromJSON(json)](./firestore_.bytes.md#bytesfromjson) | static | Builds a Bytes instance from a JSON object created by [Bytes.toJSON()](./firestore_.bytes.md#bytestojson). | | [fromUint8Array(array)](./firestore_.bytes.md#bytesfromuint8array) | static | Creates a new Bytes object from the given Uint8Array. | | [isEqual(other)](./firestore_.bytes.md#bytesisequal) | | Returns true if this Bytes object is equal to the provided one. | | [toBase64()](./firestore_.bytes.md#bytestobase64) | | Returns the underlying bytes as a Base64-encoded string. | +| [toJSON()](./firestore_.bytes.md#bytestojson) | | Returns a JSON-serializable representation of this Bytes instance. | | [toString()](./firestore_.bytes.md#bytestostring) | | Returns a string representation of the Bytes object. | | [toUint8Array()](./firestore_.bytes.md#bytestouint8array) | | Returns the underlying bytes in a new Uint8Array. | @@ -49,6 +51,28 @@ static fromBase64String(base64: string): Bytes; [Bytes](./firestore_.bytes.md#bytes_class) +## Bytes.fromJSON() + +Builds a `Bytes` instance from a JSON object created by [Bytes.toJSON()](./firestore_.bytes.md#bytestojson). + +Signature: + +```typescript +static fromJSON(json: object): Bytes; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a Bytes instance | + +Returns: + +[Bytes](./firestore_.bytes.md#bytes_class) + +an instance of [Bytes](./firestore_.bytes.md#bytes_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + ## Bytes.fromUint8Array() Creates a new `Bytes` object from the given Uint8Array. @@ -106,6 +130,21 @@ string The Base64-encoded string created from the `Bytes` object. +## Bytes.toJSON() + +Returns a JSON-serializable representation of this `Bytes` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + ## Bytes.toString() Returns a string representation of the `Bytes` object. diff --git a/docs-devsite/firestore_.documentreference.md b/docs-devsite/firestore_.documentreference.md index c63ba6eab0a..ee4be972b0c 100644 --- a/docs-devsite/firestore_.documentreference.md +++ b/docs-devsite/firestore_.documentreference.md @@ -33,6 +33,9 @@ export declare class DocumentReferencestatic | Builds a DocumentReference instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). | +| [fromJSON(firestore, json, converter)](./firestore_.documentreference.md#documentreferencefromjson) | static | Builds a DocumentReference instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). | +| [toJSON()](./firestore_.documentreference.md#documentreferencetojson) | | Returns a JSON-serializable representation of this DocumentReference instance. | | [withConverter(converter)](./firestore_.documentreference.md#documentreferencewithconverter) | | Applies a custom data converter to this DocumentReference, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc_ee215ad), [getDoc()](./firestore_lite.md#getdoc_4569087), etc. with the returned DocumentReference instance, the provided converter will convert between Firestore data of type NewDbModelType and your custom type NewAppModelType. | | [withConverter(converter)](./firestore_.documentreference.md#documentreferencewithconverter) | | Removes the current converter. | @@ -96,6 +99,68 @@ The type of this Firestore reference. readonly type = "document"; ``` +## DocumentReference.fromJSON() + +Builds a `DocumentReference` instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). + +Signature: + +```typescript +static fromJSON(firestore: Firestore, json: object): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance the snapshot should be loaded for. | +| json | object | a JSON object represention of a DocumentReference instance | + +Returns: + +[DocumentReference](./firestore_.documentreference.md#documentreference_class) + +an instance of [DocumentReference](./firestore_.documentreference.md#documentreference_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +## DocumentReference.fromJSON() + +Builds a `DocumentReference` instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). + +Signature: + +```typescript +static fromJSON(firestore: Firestore, json: object, converter: FirestoreDataConverter): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance the snapshot should be loaded for. | +| json | object | a JSON object represention of a DocumentReference instance | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<NewAppModelType, NewDbModelType> | Converts objects to and from Firestore. | + +Returns: + +[DocumentReference](./firestore_.documentreference.md#documentreference_class)<NewAppModelType, NewDbModelType> + +an instance of [DocumentReference](./firestore_.documentreference.md#documentreference_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +## DocumentReference.toJSON() + +Returns a JSON-serializable representation of this `DocumentReference` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + ## DocumentReference.withConverter() Applies a custom data converter to this `DocumentReference`, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc_ee215ad), [getDoc()](./firestore_lite.md#getdoc_4569087), etc. with the returned `DocumentReference` instance, the provided converter will convert between Firestore data of type `NewDbModelType` and your custom type `NewAppModelType`. diff --git a/docs-devsite/firestore_.documentsnapshot.md b/docs-devsite/firestore_.documentsnapshot.md index 476588b78c0..cece3f79deb 100644 --- a/docs-devsite/firestore_.documentsnapshot.md +++ b/docs-devsite/firestore_.documentsnapshot.md @@ -41,6 +41,7 @@ export declare class DocumentSnapshotObject. Returns undefined if the document doesn't exist.By default, serverTimestamp() values that have not yet been set to their final value will be returned as null. You can override this by passing an options object. | | [exists()](./firestore_.documentsnapshot.md#documentsnapshotexists) | | Returns whether or not the data exists. True if the document exists. | | [get(fieldPath, options)](./firestore_.documentsnapshot.md#documentsnapshotget) | | Retrieves the field specified by fieldPath. Returns undefined if the document or field doesn't exist.By default, a serverTimestamp() that has not yet been set to its final value will be returned as null. You can override this by passing an options object. | +| [toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson) | | Returns a JSON-serializable representation of this DocumentSnapshot instance. | ## DocumentSnapshot.(constructor) @@ -144,3 +145,18 @@ any The data at the specified field location or undefined if no such field exists in the document. +## DocumentSnapshot.toJSON() + +Returns a JSON-serializable representation of this `DocumentSnapshot` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if this `DocumentSnapshot` has pending writes. + diff --git a/docs-devsite/firestore_.geopoint.md b/docs-devsite/firestore_.geopoint.md index d4264a39f5f..c88a5289c64 100644 --- a/docs-devsite/firestore_.geopoint.md +++ b/docs-devsite/firestore_.geopoint.md @@ -37,8 +37,9 @@ export declare class GeoPoint | Method | Modifiers | Description | | --- | --- | --- | +| [fromJSON(json)](./firestore_.geopoint.md#geopointfromjson) | static | Builds a GeoPoint instance from a JSON object created by [GeoPoint.toJSON()](./firestore_.geopoint.md#geopointtojson). | | [isEqual(other)](./firestore_.geopoint.md#geopointisequal) | | Returns true if this GeoPoint is equal to the provided one. | -| [toJSON()](./firestore_.geopoint.md#geopointtojson) | | Returns a JSON-serializable representation of this GeoPoint. | +| [toJSON()](./firestore_.geopoint.md#geopointtojson) | | Returns a JSON-serializable representation of this GeoPoint instance. | ## GeoPoint.(constructor) @@ -77,6 +78,28 @@ The longitude of this `GeoPoint` instance. get longitude(): number; ``` +## GeoPoint.fromJSON() + +Builds a `GeoPoint` instance from a JSON object created by [GeoPoint.toJSON()](./firestore_.geopoint.md#geopointtojson). + +Signature: + +```typescript +static fromJSON(json: object): GeoPoint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a GeoPoint instance | + +Returns: + +[GeoPoint](./firestore_.geopoint.md#geopoint_class) + +an instance of [GeoPoint](./firestore_.geopoint.md#geopoint_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + ## GeoPoint.isEqual() Returns true if this `GeoPoint` is equal to the provided one. @@ -101,7 +124,7 @@ true if this `GeoPoint` is equal to the provided one. ## GeoPoint.toJSON() -Returns a JSON-serializable representation of this GeoPoint. +Returns a JSON-serializable representation of this `GeoPoint` instance. Signature: @@ -109,9 +132,12 @@ Returns a JSON-serializable representation of this GeoPoint. toJSON(): { latitude: number; longitude: number; + type: string; }; ``` Returns: -{ latitude: number; longitude: number; } +{ latitude: number; longitude: number; type: string; } + +a JSON representation of this object. diff --git a/docs-devsite/firestore_.md b/docs-devsite/firestore_.md index 91d21e32708..5d237fcafea 100644 --- a/docs-devsite/firestore_.md +++ b/docs-devsite/firestore_.md @@ -19,6 +19,11 @@ https://github.com/firebase/firebase-js-sdk | [getFirestore(app)](./firestore_.md#getfirestore_cf608e1) | Returns the existing default [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [getFirestore(app, databaseId)](./firestore_.md#getfirestore_48de6cb) | (Public Preview) Returns the existing named [Firestore](./firestore_.firestore.md#firestore_class) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with default settings. | | [initializeFirestore(app, settings, databaseId)](./firestore_.md#initializefirestore_fc7d200) | Initializes a new instance of [Firestore](./firestore_.firestore.md#firestore_class) with the provided settings. Can only be called before any other function, including [getFirestore()](./firestore_.md#getfirestore). If the custom settings are empty, this function is equivalent to calling [getFirestore()](./firestore_.md#getfirestore). | +| function(db, ...) | +| [documentSnapshotFromJSON(db, json)](./firestore_.md#documentsnapshotfromjson_a318ff2) | Builds a DocumentSnapshot instance from a JSON object created by [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| [documentSnapshotFromJSON(db, json, converter)](./firestore_.md#documentsnapshotfromjson_ddb369d) | Builds a DocumentSnapshot instance from a JSON object created by [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| [querySnapshotFromJSON(db, json)](./firestore_.md#querysnapshotfromjson_a318ff2) | Builds a QuerySnapshot instance from a JSON object created by [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | +| [querySnapshotFromJSON(db, json, converter)](./firestore_.md#querysnapshotfromjson_ddb369d) | Builds a QuerySnapshot instance from a JSON object created by [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | | function(firestore, ...) | | [clearIndexedDbPersistence(firestore)](./firestore_.md#clearindexeddbpersistence_231a8e0) | Clears the persistent storage. This includes pending writes and cached documents.Must be called while the [Firestore](./firestore_.firestore.md#firestore_class) instance is not started (after the app is terminated or when the app is first initialized). On startup, this function must be called before other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200) or [getFirestore()](./firestore_.md#getfirestore))). If the [Firestore](./firestore_.firestore.md#firestore_class) instance is still running, the promise will be rejected with the error code of failed-precondition.Note: clearIndexedDbPersistence() is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all. | | [collection(firestore, path, pathSegments)](./firestore_.md#collection_1eb4c23) | Gets a CollectionReference instance that refers to the collection at the specified absolute path. | @@ -32,6 +37,14 @@ https://github.com/firebase/firebase-js-sdk | [getPersistentCacheIndexManager(firestore)](./firestore_.md#getpersistentcacheindexmanager_231a8e0) | Returns the PersistentCache Index Manager used by the given Firestore object. The PersistentCacheIndexManager instance, or null if local persistent storage is not in use. | | [loadBundle(firestore, bundleData)](./firestore_.md#loadbundle_bec5b75) | Loads a Firestore bundle into the local cache. | | [namedQuery(firestore, name)](./firestore_.md#namedquery_6438876) | Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name.The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using loadBundle. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. | +| [onSnapshotResume(firestore, snapshotJson, onNext, onError, onCompletion, converter)](./firestore_.md#onsnapshotresume_7c84f5e) | Attaches a listener for QuerySnapshot events based on data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, onNext, onError, onCompletion, converter)](./firestore_.md#onsnapshotresume_712362a) | Attaches a listener for DocumentSnapshot events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, options, onNext, onError, onCompletion, converter)](./firestore_.md#onsnapshotresume_8807e6e) | Attaches a listener for QuerySnapshot events based on data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, options, onNext, onError, onCompletion, converter)](./firestore_.md#onsnapshotresume_301fcec) | Attaches a listener for DocumentSnapshot events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, observer, converter)](./firestore_.md#onsnapshotresume_b8b5c9d) | Attaches a listener for QuerySnapshot events based on QuerySnapshot data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, observer, converter)](./firestore_.md#onsnapshotresume_9b75d28) | Attaches a listener for DocumentSnapshot events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson) You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, options, observer, converter)](./firestore_.md#onsnapshotresume_fb80adf) | Attaches a listener for QuerySnapshot events based on QuerySnapshot data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | +| [onSnapshotResume(firestore, snapshotJson, options, observer, converter)](./firestore_.md#onsnapshotresume_f76d912) | Attaches a listener for DocumentSnapshot events based on QuerySnapshot data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson) You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. | | [onSnapshotsInSync(firestore, observer)](./firestore_.md#onsnapshotsinsync_2f0dfa4) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [onSnapshotsInSync(firestore, onSync)](./firestore_.md#onsnapshotsinsync_1901c06) | Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners.NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in the individual listeners to determine if a snapshot is from the cache or the server. | | [runTransaction(firestore, updateFunction, options)](./firestore_.md#runtransaction_6f03ec4) | Executes the given updateFunction and then attempts to commit the changes applied within the transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails.The maximum number of writes allowed in a single transaction is 500. | @@ -298,6 +311,102 @@ export declare function initializeFirestore(app: FirebaseApp, settings: Firestor A newly initialized [Firestore](./firestore_.firestore.md#firestore_class) instance. +## function(db, ...) + +### documentSnapshotFromJSON(db, json) {:#documentsnapshotfromjson_a318ff2} + +Builds a `DocumentSnapshot` instance from a JSON object created by [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). + +Signature: + +```typescript +export declare function documentSnapshotFromJSON(db: Firestore, json: object): DocumentSnapshot; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| db | [Firestore](./firestore_.firestore.md#firestore_class) | | +| json | object | a JSON object represention of a DocumentSnapshot instance. | + +Returns: + +[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) + +an instance of [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +### documentSnapshotFromJSON(db, json, converter) {:#documentsnapshotfromjson_ddb369d} + +Builds a `DocumentSnapshot` instance from a JSON object created by [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). + +Signature: + +```typescript +export declare function documentSnapshotFromJSON(db: Firestore, json: object, converter: FirestoreDataConverter): DocumentSnapshot; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| db | [Firestore](./firestore_.firestore.md#firestore_class) | | +| json | object | a JSON object represention of a DocumentSnapshot instance. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<AppModelType, DbModelType> | Converts objects to and from Firestore. | + +Returns: + +[DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType> + +an instance of [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +### querySnapshotFromJSON(db, json) {:#querysnapshotfromjson_a318ff2} + +Builds a `QuerySnapshot` instance from a JSON object created by [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). + +Signature: + +```typescript +export declare function querySnapshotFromJSON(db: Firestore, json: object): QuerySnapshot; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| db | [Firestore](./firestore_.firestore.md#firestore_class) | | +| json | object | a JSON object represention of a QuerySnapshot instance. | + +Returns: + +[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) + +an instance of [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +### querySnapshotFromJSON(db, json, converter) {:#querysnapshotfromjson_ddb369d} + +Builds a `QuerySnapshot` instance from a JSON object created by [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). + +Signature: + +```typescript +export declare function querySnapshotFromJSON(db: Firestore, json: object, converter: FirestoreDataConverter): QuerySnapshot; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| db | [Firestore](./firestore_.firestore.md#firestore_class) | | +| json | object | a JSON object represention of a QuerySnapshot instance. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<AppModelType, DbModelType> | Converts objects to and from Firestore. | + +Returns: + +[QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType> + +an instance of [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + ## function(firestore, ...) ### clearIndexedDbPersistence(firestore) {:#clearindexeddbpersistence_231a8e0} @@ -617,6 +726,250 @@ Promise<[Query](./firestore_.query.md#query_class) \| null> A `Promise` that is resolved with the Query or `null`. +### onSnapshotResume(firestore, snapshotJson, onNext, onError, onCompletion, converter) {:#onsnapshotresume_7c84f5e} + +Attaches a listener for `QuerySnapshot` events based on data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, onNext, onError, onCompletion, converter) {:#onsnapshotresume_712362a} + +Attaches a listener for `DocumentSnapshot` events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, options, onNext, onError, onCompletion, converter) {:#onsnapshotresume_8807e6e} + +Attaches a listener for `QuerySnapshot` events based on data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new QuerySnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, options, onNext, onError, onCompletion, converter) {:#onsnapshotresume_301fcec} + +Attaches a listener for `DocumentSnapshot` events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| onNext | (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void | A callback to be called every time a new DocumentSnapshot is available. | +| onError | (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void | A callback to be called if the listen fails or is cancelled. No further callbacks will occur. | +| onCompletion | () => void | Can be provided, but will not be called since streams are never ending. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, observer, converter) {:#onsnapshotresume_b8b5c9d} + +Attaches a listener for `QuerySnapshot` events based on QuerySnapshot data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | +| observer | { next: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, observer, converter) {:#onsnapshotresume_9b75d28} + +Attaches a listener for `DocumentSnapshot` events based on data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson) You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| observer | { next: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, options, observer, converter) {:#onsnapshotresume_fb80adf} + +Attaches a listener for `QuerySnapshot` events based on QuerySnapshot data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson). | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next: (snapshot: [QuerySnapshot](./firestore_.querysnapshot.md#querysnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + +### onSnapshotResume(firestore, snapshotJson, options, observer, converter) {:#onsnapshotresume_f76d912} + +Attaches a listener for `DocumentSnapshot` events based on QuerySnapshot data generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson) You may either pass individual `onNext` and `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by calling the function that is returned when `onSnapshot` is called. + +NOTE: Although an `onCompletion` callback can be provided, it will never be called because the snapshot stream is never-ending. + +Signature: + +```typescript +export declare function onSnapshotResume(firestore: Firestore, snapshotJson: object, options: SnapshotListenOptions, observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; +}, converter?: FirestoreDataConverter): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance to enable the listener for. | +| snapshotJson | object | A JSON object generated by invoking [DocumentSnapshot.toJSON()](./firestore_.documentsnapshot.md#documentsnapshottojson). | +| options | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md#snapshotlistenoptions_interface) | Options controlling the listen behavior. | +| observer | { next: (snapshot: [DocumentSnapshot](./firestore_.documentsnapshot.md#documentsnapshot_class)<AppModelType, DbModelType>) => void; error?: (error: [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class)) => void; complete?: () => void; } | A single object containing next and error callbacks. | +| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<DbModelType> | An optional object that converts objects from Firestore before the onNext listener is invoked. | + +Returns: + +[Unsubscribe](./firestore_.unsubscribe.md#unsubscribe_interface) + +An unsubscribe function that can be called to cancel the snapshot listener. + ### onSnapshotsInSync(firestore, observer) {:#onsnapshotsinsync_2f0dfa4} Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if a single server-generated change affects multiple listeners. diff --git a/docs-devsite/firestore_.querysnapshot.md b/docs-devsite/firestore_.querysnapshot.md index d9930c68d90..b574320c8c4 100644 --- a/docs-devsite/firestore_.querysnapshot.md +++ b/docs-devsite/firestore_.querysnapshot.md @@ -34,6 +34,7 @@ export declare class QuerySnapshotQuerySnapshot. | +| [toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) | | Returns a JSON-serializable representation of this QuerySnapshot instance. | ## QuerySnapshot.docs @@ -126,3 +127,18 @@ forEach(callback: (result: QueryDocumentSnapshot) => void +## QuerySnapshot.toJSON() + +Returns a JSON-serializable representation of this `QuerySnapshot` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if this `QuerySnapshot` has pending writes. + diff --git a/docs-devsite/firestore_.timestamp.md b/docs-devsite/firestore_.timestamp.md index 6f7a7dd011b..9d7282e5a2a 100644 --- a/docs-devsite/firestore_.timestamp.md +++ b/docs-devsite/firestore_.timestamp.md @@ -40,6 +40,7 @@ export declare class Timestamp | Method | Modifiers | Description | | --- | --- | --- | | [fromDate(date)](./firestore_.timestamp.md#timestampfromdate) | static | Creates a new timestamp from the given date. | +| [fromJSON(json)](./firestore_.timestamp.md#timestampfromjson) | static | Builds a Timestamp instance from a JSON object created by [Timestamp.toJSON()](./firestore_.timestamp.md#timestamptojson). | | [fromMillis(milliseconds)](./firestore_.timestamp.md#timestampfrommillis) | static | Creates a new timestamp from the given number of milliseconds. | | [isEqual(other)](./firestore_.timestamp.md#timestampisequal) | | Returns true if this Timestamp is equal to the provided one. | | [now()](./firestore_.timestamp.md#timestampnow) | static | Creates a new timestamp with the current date, with millisecond precision. | @@ -110,6 +111,26 @@ static fromDate(date: Date): Timestamp; A new `Timestamp` representing the same point in time as the given date. +## Timestamp.fromJSON() + +Builds a `Timestamp` instance from a JSON object created by [Timestamp.toJSON()](./firestore_.timestamp.md#timestamptojson). + +Signature: + +```typescript +static fromJSON(json: object): Timestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | | + +Returns: + +[Timestamp](./firestore_.timestamp.md#timestamp_class) + ## Timestamp.fromMillis() Creates a new timestamp from the given number of milliseconds. @@ -194,11 +215,12 @@ Returns a JSON-serializable representation of this `Timestamp`. toJSON(): { seconds: number; nanoseconds: number; + type: string; }; ``` Returns: -{ seconds: number; nanoseconds: number; } +{ seconds: number; nanoseconds: number; type: string; } ## Timestamp.toMillis() diff --git a/docs-devsite/firestore_.vectorvalue.md b/docs-devsite/firestore_.vectorvalue.md index e35e96ec9ec..1fc4e2b35ab 100644 --- a/docs-devsite/firestore_.vectorvalue.md +++ b/docs-devsite/firestore_.vectorvalue.md @@ -24,8 +24,32 @@ export declare class VectorValue | Method | Modifiers | Description | | --- | --- | --- | +| [fromJSON(json)](./firestore_.vectorvalue.md#vectorvaluefromjson) | static | Builds a VectorValue instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson). | | [isEqual(other)](./firestore_.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise. | | [toArray()](./firestore_.vectorvalue.md#vectorvaluetoarray) | | Returns a copy of the raw number array form of the vector. | +| [toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson) | | Returns a JSON-serializable representation of this VectorValue instance. | + +## VectorValue.fromJSON() + +Builds a `VectorValue` instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson). + +Signature: + +```typescript +static fromJSON(json: object): VectorValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a VectorValue instance. | + +Returns: + +[VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) + +an instance of [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. ## VectorValue.isEqual() @@ -60,3 +84,18 @@ toArray(): number[]; number\[\] +## VectorValue.toJSON() + +Returns a JSON-serializable representation of this `VectorValue` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + diff --git a/docs-devsite/firestore_lite.bytes.md b/docs-devsite/firestore_lite.bytes.md index 51cfb0a9bf0..a26734f90bf 100644 --- a/docs-devsite/firestore_lite.bytes.md +++ b/docs-devsite/firestore_lite.bytes.md @@ -23,9 +23,11 @@ export declare class Bytes | Method | Modifiers | Description | | --- | --- | --- | | [fromBase64String(base64)](./firestore_lite.bytes.md#bytesfrombase64string) | static | Creates a new Bytes object from the given Base64 string, converting it to bytes. | +| [fromJSON(json)](./firestore_lite.bytes.md#bytesfromjson) | static | Builds a Bytes instance from a JSON object created by [Bytes.toJSON()](./firestore_.bytes.md#bytestojson). | | [fromUint8Array(array)](./firestore_lite.bytes.md#bytesfromuint8array) | static | Creates a new Bytes object from the given Uint8Array. | | [isEqual(other)](./firestore_lite.bytes.md#bytesisequal) | | Returns true if this Bytes object is equal to the provided one. | | [toBase64()](./firestore_lite.bytes.md#bytestobase64) | | Returns the underlying bytes as a Base64-encoded string. | +| [toJSON()](./firestore_lite.bytes.md#bytestojson) | | Returns a JSON-serializable representation of this Bytes instance. | | [toString()](./firestore_lite.bytes.md#bytestostring) | | Returns a string representation of the Bytes object. | | [toUint8Array()](./firestore_lite.bytes.md#bytestouint8array) | | Returns the underlying bytes in a new Uint8Array. | @@ -49,6 +51,28 @@ static fromBase64String(base64: string): Bytes; [Bytes](./firestore_lite.bytes.md#bytes_class) +## Bytes.fromJSON() + +Builds a `Bytes` instance from a JSON object created by [Bytes.toJSON()](./firestore_.bytes.md#bytestojson). + +Signature: + +```typescript +static fromJSON(json: object): Bytes; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a Bytes instance | + +Returns: + +[Bytes](./firestore_lite.bytes.md#bytes_class) + +an instance of [Bytes](./firestore_.bytes.md#bytes_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + ## Bytes.fromUint8Array() Creates a new `Bytes` object from the given Uint8Array. @@ -106,6 +130,21 @@ string The Base64-encoded string created from the `Bytes` object. +## Bytes.toJSON() + +Returns a JSON-serializable representation of this `Bytes` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + ## Bytes.toString() Returns a string representation of the `Bytes` object. diff --git a/docs-devsite/firestore_lite.documentreference.md b/docs-devsite/firestore_lite.documentreference.md index 2239850b829..2a09e2e5964 100644 --- a/docs-devsite/firestore_lite.documentreference.md +++ b/docs-devsite/firestore_lite.documentreference.md @@ -33,6 +33,9 @@ export declare class DocumentReferencestatic | Builds a DocumentReference instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). | +| [fromJSON(firestore, json, converter)](./firestore_lite.documentreference.md#documentreferencefromjson) | static | Builds a DocumentReference instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). | +| [toJSON()](./firestore_lite.documentreference.md#documentreferencetojson) | | Returns a JSON-serializable representation of this DocumentReference instance. | | [withConverter(converter)](./firestore_lite.documentreference.md#documentreferencewithconverter) | | Applies a custom data converter to this DocumentReference, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc_ee215ad), [getDoc()](./firestore_lite.md#getdoc_4569087), etc. with the returned DocumentReference instance, the provided converter will convert between Firestore data of type NewDbModelType and your custom type NewAppModelType. | | [withConverter(converter)](./firestore_lite.documentreference.md#documentreferencewithconverter) | | Removes the current converter. | @@ -96,6 +99,68 @@ The type of this Firestore reference. readonly type = "document"; ``` +## DocumentReference.fromJSON() + +Builds a `DocumentReference` instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). + +Signature: + +```typescript +static fromJSON(firestore: Firestore, json: object): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance the snapshot should be loaded for. | +| json | object | a JSON object represention of a DocumentReference instance | + +Returns: + +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class) + +an instance of [DocumentReference](./firestore_.documentreference.md#documentreference_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +## DocumentReference.fromJSON() + +Builds a `DocumentReference` instance from a JSON object created by [DocumentReference.toJSON()](./firestore_.documentreference.md#documentreferencetojson). + +Signature: + +```typescript +static fromJSON(firestore: Firestore, json: object, converter: FirestoreDataConverter): DocumentReference; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| firestore | [Firestore](./firestore_lite.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance the snapshot should be loaded for. | +| json | object | a JSON object represention of a DocumentReference instance | +| converter | [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface)<NewAppModelType, NewDbModelType> | Converts objects to and from Firestore. | + +Returns: + +[DocumentReference](./firestore_lite.documentreference.md#documentreference_class)<NewAppModelType, NewDbModelType> + +an instance of [DocumentReference](./firestore_.documentreference.md#documentreference_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + +## DocumentReference.toJSON() + +Returns a JSON-serializable representation of this `DocumentReference` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + ## DocumentReference.withConverter() Applies a custom data converter to this `DocumentReference`, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc_ee215ad), [getDoc()](./firestore_lite.md#getdoc_4569087), etc. with the returned `DocumentReference` instance, the provided converter will convert between Firestore data of type `NewDbModelType` and your custom type `NewAppModelType`. diff --git a/docs-devsite/firestore_lite.geopoint.md b/docs-devsite/firestore_lite.geopoint.md index fdd760520c8..6b3396107d2 100644 --- a/docs-devsite/firestore_lite.geopoint.md +++ b/docs-devsite/firestore_lite.geopoint.md @@ -37,8 +37,9 @@ export declare class GeoPoint | Method | Modifiers | Description | | --- | --- | --- | +| [fromJSON(json)](./firestore_lite.geopoint.md#geopointfromjson) | static | Builds a GeoPoint instance from a JSON object created by [GeoPoint.toJSON()](./firestore_.geopoint.md#geopointtojson). | | [isEqual(other)](./firestore_lite.geopoint.md#geopointisequal) | | Returns true if this GeoPoint is equal to the provided one. | -| [toJSON()](./firestore_lite.geopoint.md#geopointtojson) | | Returns a JSON-serializable representation of this GeoPoint. | +| [toJSON()](./firestore_lite.geopoint.md#geopointtojson) | | Returns a JSON-serializable representation of this GeoPoint instance. | ## GeoPoint.(constructor) @@ -77,6 +78,28 @@ The longitude of this `GeoPoint` instance. get longitude(): number; ``` +## GeoPoint.fromJSON() + +Builds a `GeoPoint` instance from a JSON object created by [GeoPoint.toJSON()](./firestore_.geopoint.md#geopointtojson). + +Signature: + +```typescript +static fromJSON(json: object): GeoPoint; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a GeoPoint instance | + +Returns: + +[GeoPoint](./firestore_lite.geopoint.md#geopoint_class) + +an instance of [GeoPoint](./firestore_.geopoint.md#geopoint_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. + ## GeoPoint.isEqual() Returns true if this `GeoPoint` is equal to the provided one. @@ -101,7 +124,7 @@ true if this `GeoPoint` is equal to the provided one. ## GeoPoint.toJSON() -Returns a JSON-serializable representation of this GeoPoint. +Returns a JSON-serializable representation of this `GeoPoint` instance. Signature: @@ -109,9 +132,12 @@ Returns a JSON-serializable representation of this GeoPoint. toJSON(): { latitude: number; longitude: number; + type: string; }; ``` Returns: -{ latitude: number; longitude: number; } +{ latitude: number; longitude: number; type: string; } + +a JSON representation of this object. diff --git a/docs-devsite/firestore_lite.timestamp.md b/docs-devsite/firestore_lite.timestamp.md index 506a6c66ade..0fb35ada682 100644 --- a/docs-devsite/firestore_lite.timestamp.md +++ b/docs-devsite/firestore_lite.timestamp.md @@ -40,6 +40,7 @@ export declare class Timestamp | Method | Modifiers | Description | | --- | --- | --- | | [fromDate(date)](./firestore_lite.timestamp.md#timestampfromdate) | static | Creates a new timestamp from the given date. | +| [fromJSON(json)](./firestore_lite.timestamp.md#timestampfromjson) | static | Builds a Timestamp instance from a JSON object created by [Timestamp.toJSON()](./firestore_.timestamp.md#timestamptojson). | | [fromMillis(milliseconds)](./firestore_lite.timestamp.md#timestampfrommillis) | static | Creates a new timestamp from the given number of milliseconds. | | [isEqual(other)](./firestore_lite.timestamp.md#timestampisequal) | | Returns true if this Timestamp is equal to the provided one. | | [now()](./firestore_lite.timestamp.md#timestampnow) | static | Creates a new timestamp with the current date, with millisecond precision. | @@ -110,6 +111,26 @@ static fromDate(date: Date): Timestamp; A new `Timestamp` representing the same point in time as the given date. +## Timestamp.fromJSON() + +Builds a `Timestamp` instance from a JSON object created by [Timestamp.toJSON()](./firestore_.timestamp.md#timestamptojson). + +Signature: + +```typescript +static fromJSON(json: object): Timestamp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | | + +Returns: + +[Timestamp](./firestore_lite.timestamp.md#timestamp_class) + ## Timestamp.fromMillis() Creates a new timestamp from the given number of milliseconds. @@ -194,11 +215,12 @@ Returns a JSON-serializable representation of this `Timestamp`. toJSON(): { seconds: number; nanoseconds: number; + type: string; }; ``` Returns: -{ seconds: number; nanoseconds: number; } +{ seconds: number; nanoseconds: number; type: string; } ## Timestamp.toMillis() diff --git a/docs-devsite/firestore_lite.vectorvalue.md b/docs-devsite/firestore_lite.vectorvalue.md index 28eaf7f5f01..17c18e4c4ed 100644 --- a/docs-devsite/firestore_lite.vectorvalue.md +++ b/docs-devsite/firestore_lite.vectorvalue.md @@ -24,8 +24,32 @@ export declare class VectorValue | Method | Modifiers | Description | | --- | --- | --- | +| [fromJSON(json)](./firestore_lite.vectorvalue.md#vectorvaluefromjson) | static | Builds a VectorValue instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson). | | [isEqual(other)](./firestore_lite.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise. | | [toArray()](./firestore_lite.vectorvalue.md#vectorvaluetoarray) | | Returns a copy of the raw number array form of the vector. | +| [toJSON()](./firestore_lite.vectorvalue.md#vectorvaluetojson) | | Returns a JSON-serializable representation of this VectorValue instance. | + +## VectorValue.fromJSON() + +Builds a `VectorValue` instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson). + +Signature: + +```typescript +static fromJSON(json: object): VectorValue; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| json | object | a JSON object represention of a VectorValue instance. | + +Returns: + +[VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) + +an instance of [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs. ## VectorValue.isEqual() @@ -60,3 +84,18 @@ toArray(): number[]; number\[\] +## VectorValue.toJSON() + +Returns a JSON-serializable representation of this `VectorValue` instance. + +Signature: + +```typescript +toJSON(): object; +``` +Returns: + +object + +a JSON representation of this object. + diff --git a/packages/firestore/src/api.ts b/packages/firestore/src/api.ts index ea969c6b94c..d05f032a910 100644 --- a/packages/firestore/src/api.ts +++ b/packages/firestore/src/api.ts @@ -89,9 +89,11 @@ export { DocumentChange, DocumentChangeType, DocumentSnapshot, + documentSnapshotFromJSON, FirestoreDataConverter, QueryDocumentSnapshot, QuerySnapshot, + querySnapshotFromJSON, snapshotEqual, SnapshotMetadata, SnapshotOptions @@ -161,6 +163,7 @@ export { getDocsFromServer, onSnapshot, onSnapshotsInSync, + onSnapshotResume, setDoc, updateDoc } from './api/reference_impl'; diff --git a/packages/firestore/src/api/reference_impl.ts b/packages/firestore/src/api/reference_impl.ts index e730fb40da7..8fa21a13e6d 100644 --- a/packages/firestore/src/api/reference_impl.ts +++ b/packages/firestore/src/api/reference_impl.ts @@ -17,6 +17,7 @@ import { getModularInstance } from '@firebase/util'; +import { loadBundle, namedQuery } from '../api/database'; import { CompleteFn, ErrorFn, @@ -59,14 +60,20 @@ import { parseUpdateVarargs } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { DocumentKey } from '../model/document_key'; import { DeleteMutation, Mutation, Precondition } from '../model/mutation'; import { debugAssert } from '../util/assert'; import { ByteString } from '../util/byte_string'; -import { FirestoreError } from '../util/error'; +import { Code, FirestoreError } from '../util/error'; import { cast } from '../util/input_validation'; import { ensureFirestoreConfigured, Firestore } from './database'; -import { DocumentSnapshot, QuerySnapshot, SnapshotMetadata } from './snapshot'; +import { + DocumentSnapshot, + FirestoreDataConverter, + QuerySnapshot, + SnapshotMetadata +} from './snapshot'; /** * An options object that can be passed to {@link (onSnapshot:1)} and {@link @@ -483,12 +490,11 @@ export interface Unsubscribe { // integration tests /** - * Attaches a listener for `DocumentSnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. + * Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param reference - A reference to the document to listen to. * @param observer - A single object containing `next` and `error` callbacks. @@ -504,12 +510,11 @@ export function onSnapshot( } ): Unsubscribe; /** - * Attaches a listener for `DocumentSnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. + * Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param reference - A reference to the document to listen to. * @param options - Options controlling the listen behavior. @@ -527,22 +532,18 @@ export function onSnapshot( } ): Unsubscribe; /** - * Attaches a listener for `DocumentSnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. + * Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param reference - A reference to the document to listen to. - * @param onNext - A callback to be called every time a new `DocumentSnapshot` - * is available. - * @param onError - A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @param onCompletion - Can be provided, but will not be called since streams are - * never ending. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @param onNext - A callback to be called every time a new `DocumentSnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( reference: DocumentReference, @@ -551,23 +552,19 @@ export function onSnapshot( onCompletion?: () => void ): Unsubscribe; /** - * Attaches a listener for `DocumentSnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. + * Attaches a listener for `DocumentSnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param reference - A reference to the document to listen to. * @param options - Options controlling the listen behavior. - * @param onNext - A callback to be called every time a new `DocumentSnapshot` - * is available. - * @param onError - A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @param onCompletion - Can be provided, but will not be called since streams are - * never ending. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @param onNext - A callback to be called every time a new `DocumentSnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( reference: DocumentReference, @@ -577,18 +574,16 @@ export function onSnapshot( onCompletion?: () => void ): Unsubscribe; /** - * Attaches a listener for `QuerySnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. The listener can be cancelled by - * calling the function that is returned when `onSnapshot` is called. + * Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The + * listener can be cancelled by calling the function that is returned when `onSnapshot` is called. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param query - The query to listen to. * @param observer - A single object containing `next` and `error` callbacks. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( query: Query, @@ -599,19 +594,17 @@ export function onSnapshot( } ): Unsubscribe; /** - * Attaches a listener for `QuerySnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. The listener can be cancelled by - * calling the function that is returned when `onSnapshot` is called. + * Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The + * listener can be cancelled by calling the function that is returned when `onSnapshot` is called. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param query - The query to listen to. * @param options - Options controlling the listen behavior. * @param observer - A single object containing `next` and `error` callbacks. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( query: Query, @@ -623,23 +616,19 @@ export function onSnapshot( } ): Unsubscribe; /** - * Attaches a listener for `QuerySnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. The listener can be cancelled by - * calling the function that is returned when `onSnapshot` is called. + * Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The + * listener can be cancelled by calling the function that is returned when `onSnapshot` is called. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param query - The query to listen to. - * @param onNext - A callback to be called every time a new `QuerySnapshot` - * is available. - * @param onCompletion - Can be provided, but will not be called since streams are - * never ending. - * @param onError - A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @param onNext - A callback to be called every time a new `QuerySnapshot` is available. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( query: Query, @@ -648,24 +637,20 @@ export function onSnapshot( onCompletion?: () => void ): Unsubscribe; /** - * Attaches a listener for `QuerySnapshot` events. You may either pass - * individual `onNext` and `onError` callbacks or pass a single observer - * object with `next` and `error` callbacks. The listener can be cancelled by - * calling the function that is returned when `onSnapshot` is called. + * Attaches a listener for `QuerySnapshot` events. You may either pass individual `onNext` and + * `onError` callbacks or pass a single observer object with `next` and `error` callbacks. The + * listener can be cancelled by calling the function that is returned when `onSnapshot` is called. * - * NOTE: Although an `onCompletion` callback can be provided, it will - * never be called because the snapshot stream is never-ending. + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. * * @param query - The query to listen to. * @param options - Options controlling the listen behavior. - * @param onNext - A callback to be called every time a new `QuerySnapshot` - * is available. - * @param onCompletion - Can be provided, but will not be called since streams are - * never ending. - * @param onError - A callback to be called if the listen fails or is - * cancelled. No further callbacks will occur. - * @returns An unsubscribe function that can be called to cancel - * the snapshot listener. + * @param onNext - A callback to be called every time a new `QuerySnapshot` is available. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. */ export function onSnapshot( query: Query, @@ -680,16 +665,15 @@ export function onSnapshot( | DocumentReference, ...args: unknown[] ): Unsubscribe { + // onSnapshot for Query or Document. reference = getModularInstance(reference); - let options: SnapshotListenOptions = { includeMetadataChanges: false, source: 'default' }; let currArg = 0; if (typeof args[currArg] === 'object' && !isPartialObserver(args[currArg])) { - options = args[currArg] as SnapshotListenOptions; - currArg++; + options = args[currArg++] as SnapshotListenOptions; } const internalOptions = { @@ -736,7 +720,6 @@ export function onSnapshot( firestore = cast(query.firestore, Firestore); internalQuery = query._query; const userDataWriter = new ExpUserDataWriter(firestore); - observer = { next: snapshot => { if (args[currArg]) { @@ -761,6 +744,340 @@ export function onSnapshot( ); } +/** + * Attaches a listener for `QuerySnapshot` events based on data generated by invoking + * {@link QuerySnapshot.toJSON} You may either pass individual `onNext` and `onError` callbacks or + * pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by + * calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link QuerySnapshot.toJSON}. + * @param onNext - A callback to be called every time a new `QuerySnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + onNext: (snapshot: QuerySnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `DocumentSnapshot` events based on data generated by invoking + * {@link DocumentSnapshot.toJSON}. You may either pass individual `onNext` and `onError` callbacks or + * pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by + * calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link DocumentSnapshot.toJSON}. + * @param onNext - A callback to be called every time a new `DocumentSnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are + * never ending. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + onNext: (snapshot: DocumentSnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `QuerySnapshot` events based on data generated by invoking + * {@link QuerySnapshot.toJSON}. You may either pass individual `onNext` and `onError` callbacks or + * pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by + * calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link QuerySnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param onNext - A callback to be called every time a new `QuerySnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + options: SnapshotListenOptions, + onNext: (snapshot: QuerySnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `DocumentSnapshot` events based on data generated by invoking + * {@link DocumentSnapshot.toJSON}. You may either pass individual `onNext` and `onError` callbacks + * or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled + * by calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link DocumentSnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param onNext - A callback to be called every time a new `DocumentSnapshot` is available. + * @param onError - A callback to be called if the listen fails or is cancelled. No further + * callbacks will occur. + * @param onCompletion - Can be provided, but will not be called since streams are never ending. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel + * the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + options: SnapshotListenOptions, + onNext: (snapshot: DocumentSnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `QuerySnapshot` events based on QuerySnapshot data generated by invoking + * {@link QuerySnapshot.toJSON}. You may either pass individual `onNext` and `onError` callbacks or + * pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by + * calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link QuerySnapshot.toJSON}. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel + * the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `DocumentSnapshot` events based on data generated by invoking + * {@link DocumentSnapshot.toJSON} You may either pass individual `onNext` and `onError` callbacks + * or pass a single observer object with `next` and `error` callbacks. The listener can be cancelled + * by calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link DocumentSnapshot.toJSON}. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel + * the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `QuerySnapshot` events based on QuerySnapshot data generated by invoking + * {@link QuerySnapshot.toJSON} You may either pass individual `onNext` and `onError` callbacks or + * pass a single observer object with `next` and `error` callbacks. The listener can be cancelled by + * calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link QuerySnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel + * the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + options: SnapshotListenOptions, + observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe; +/** + * Attaches a listener for `DocumentSnapshot` events based on QuerySnapshot data generated by + * invoking {@link DocumentSnapshot.toJSON} You may either pass individual `onNext` and `onError` + * callbacks or pass a single observer object with `next` and `error` callbacks. The listener can be + * cancelled by calling the function that is returned when `onSnapshot` is called. + * + * NOTE: Although an `onCompletion` callback can be provided, it will never be called because the + * snapshot stream is never-ending. + * + * @param firestore - The {@link Firestore} instance to enable the listener for. + * @param snapshotJson - A JSON object generated by invoking {@link DocumentSnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot listener. + */ +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>( + firestore: Firestore, + snapshotJson: object, + options: SnapshotListenOptions, + observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe; +export function onSnapshotResume< + AppModelType, + DbModelType extends DocumentData +>(reference: Firestore, snapshotJson: object, ...args: unknown[]): Unsubscribe { + const db = getModularInstance(reference); + const json = normalizeSnapshotJsonFields(snapshotJson); + if (json.error) { + throw new FirestoreError(Code.INVALID_ARGUMENT, json.error); + } + let curArg = 0; + let options: SnapshotListenOptions | undefined = undefined; + if (typeof args[curArg] === 'object' && !isPartialObserver(args[curArg])) { + options = args[curArg++] as SnapshotListenOptions; + } + + if (json.bundleSource === 'QuerySnapshot') { + let observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } | null = null; + if (typeof args[curArg] === 'object' && isPartialObserver(args[curArg])) { + const userObserver = args[curArg++] as PartialObserver< + QuerySnapshot + >; + observer = { + next: userObserver.next!, + error: userObserver.error, + complete: userObserver.complete + }; + } else { + observer = { + next: args[curArg++] as ( + snapshot: QuerySnapshot + ) => void, + error: args[curArg++] as (error: FirestoreError) => void, + complete: args[curArg++] as () => void + }; + } + return onSnapshotQuerySnapshotBundle( + db, + json, + options, + observer!, + args[curArg] as FirestoreDataConverter + ); + } else if (json.bundleSource === 'DocumentSnapshot') { + let observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } | null = null; + if (typeof args[curArg] === 'object' && isPartialObserver(args[curArg])) { + const userObserver = args[curArg++] as PartialObserver< + DocumentSnapshot + >; + observer = { + next: userObserver.next!, + error: userObserver.error, + complete: userObserver.complete + }; + } else { + observer = { + next: args[curArg++] as ( + snapshot: DocumentSnapshot + ) => void, + error: args[curArg++] as (error: FirestoreError) => void, + complete: args[curArg++] as () => void + }; + } + return onSnapshotDocumentSnapshotBundle( + db, + json, + options, + observer!, + args[curArg] as FirestoreDataConverter + ); + } else { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + `unsupported bundle source: ${json.bundleSource}` + ); + } +} + // TODO(firestorexp): Make sure these overloads are tested via the Firestore // integration tests @@ -859,3 +1176,186 @@ function convertToDocSnapshot( ref.converter ); } + +/** + * Ensures the data required to construct an {@link onSnapshot} listener exist in a `snapshotJson` + * object that originates from {@link DocumentSnapshot.toJSON} or {@link Querysnapshot.toJSON}. The + * data is normalized into a typed object. + * + * @param snapshotJson - The JSON object that the app provided to {@link onSnapshot}. + * @returns A normalized object that contains all of the required bundle JSON fields. If + * {@link snapshotJson} doesn't contain the required fields, or if the fields exist as empty + * strings, then the {@link snapshotJson.error} field will be a non empty string. + * + * @internal + */ +function normalizeSnapshotJsonFields(snapshotJson: object): { + bundle: string; + bundleName: string; + bundleSource: string; + error?: string; +} { + const result: { + bundle: string; + bundleName: string; + bundleSource: string; + error?: string; + } = { + bundle: '', + bundleName: '', + bundleSource: '' + }; + const requiredKeys = ['bundle', 'bundleName', 'bundleSource']; + for (const key of requiredKeys) { + if (!(key in snapshotJson)) { + result.error = `snapshotJson missing required field: ${key}`; + break; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const value = (snapshotJson as any)[key]; + if (typeof value !== 'string') { + result.error = `snapshotJson field '${key}' must be a string.`; + break; + } + if (value.length === 0) { + result.error = `snapshotJson field '${key}' cannot be an empty string.`; + break; + } + if (key === 'bundle') { + result.bundle = value; + } else if (key === 'bundleName') { + result.bundleName = value; + } else if (key === 'bundleSource') { + result.bundleSource = value; + } + } + return result; +} + +/** + * Loads the bundle in a separate task and then invokes {@link onSnapshot} with a + * {@link DocumentReference} for the document in the bundle. + * + * @param firestore - The {@link Firestore} instance for the {@link onSnapshot} operation request. + * @param json - The JSON bundle to load, produced by {@link DocumentSnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot + * listener. + * + * @internal + */ +function onSnapshotDocumentSnapshotBundle< + AppModelType, + DbModelType extends DocumentData +>( + db: Firestore, + json: { bundle: string; bundleName: string; bundleSource: string }, + options: SnapshotListenOptions | undefined, + observer: { + next: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe { + let unsubscribed: boolean = false; + let internalUnsubscribe: Unsubscribe | undefined; + const loadTask = loadBundle(db, json.bundle); + loadTask + .then(() => { + if (!unsubscribed) { + const docReference = new DocumentReference( + db, + converter ? converter : null, + DocumentKey.fromPath(json.bundleName) + ); + internalUnsubscribe = onSnapshot( + docReference as DocumentReference, + options ? options : {}, + observer + ); + } + }) + .catch(e => { + if (observer.error) { + observer.error(e); + } + return () => {}; + }); + return () => { + if (unsubscribed) { + return; + } + unsubscribed = true; + if (internalUnsubscribe) { + internalUnsubscribe(); + } + }; +} + +/** + * Loads the bundle in a separate task and then invokes {@link onSnapshot} with a + * {@link Query} that represents the Query in the bundle. + * + * @param firestore - The {@link Firestore} instance for the {@link onSnapshot} operation request. + * @param json - The JSON bundle to load, produced by {@link QuerySnapshot.toJSON}. + * @param options - Options controlling the listen behavior. + * @param observer - A single object containing `next` and `error` callbacks. + * @param converter - An optional object that converts objects from Firestore before the onNext + * listener is invoked. + * @returns An unsubscribe function that can be called to cancel the snapshot + * listener. + * + * @internal + */ +function onSnapshotQuerySnapshotBundle< + AppModelType, + DbModelType extends DocumentData +>( + db: Firestore, + json: { bundle: string; bundleName: string; bundleSource: string }, + options: SnapshotListenOptions | undefined, + observer: { + next: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + }, + converter?: FirestoreDataConverter +): Unsubscribe { + let unsubscribed: boolean = false; + let internalUnsubscribe: Unsubscribe | undefined; + const loadTask = loadBundle(db, json.bundle); + loadTask + .then(() => namedQuery(db, json.bundleName)) + .then(query => { + if (query && !unsubscribed) { + const realQuery: Query = (query as Query)!; + if (converter) { + realQuery.withConverter(converter); + } + internalUnsubscribe = onSnapshot( + query as Query, + options ? options : {}, + observer + ); + } + }) + .catch(e => { + if (observer.error) { + observer.error(e); + } + return () => {}; + }); + return () => { + if (unsubscribed) { + return; + } + unsubscribed = true; + if (internalUnsubscribe) { + internalUnsubscribe(); + } + }; +} diff --git a/packages/firestore/src/api/snapshot.ts b/packages/firestore/src/api/snapshot.ts index 669ac26cafe..c82add0642a 100644 --- a/packages/firestore/src/api/snapshot.ts +++ b/packages/firestore/src/api/snapshot.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +import { BundleLoader } from '../core/bundle_impl'; +import { createBundleReaderSync } from '../core/firestore_client'; import { newQueryComparator } from '../core/query'; import { ChangeType, ViewSnapshot } from '../core/view_snapshot'; import { FieldPath } from '../lite-api/field_path'; @@ -26,6 +28,7 @@ import { SetOptions, WithFieldValue } from '../lite-api/reference'; +import { LiteUserDataWriter } from '../lite-api/reference_impl'; import { DocumentSnapshot as LiteDocumentSnapshot, fieldPathFromArgument, @@ -33,14 +36,30 @@ import { } from '../lite-api/snapshot'; import { UntypedFirestoreDataConverter } from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; +import { fromBundledQuery } from '../local/local_serializer'; +import { documentKeySet } from '../model/collections'; import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; +import { DocumentSet } from '../model/document_set'; +import { ResourcePath } from '../model/path'; +import { newSerializer } from '../platform/serializer'; +import { + buildQuerySnapshotJsonBundle, + buildDocumentSnapshotJsonBundle +} from '../platform/snapshot_to_json'; +import { fromDocument } from '../remote/serializer'; import { debugAssert, fail } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; +// API extractor fails importing 'property' unless we also explicitly import 'Property'. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; +import { AutoId } from '../util/misc'; import { Firestore } from './database'; import { SnapshotListenOptions } from './reference_impl'; +const NOT_SUPPORTED = 'NOT SUPPORTED'; + /** * Converter used by `withConverter()` to transform user objects of type * `AppModelType` into Firestore data of type `DbModelType`. @@ -496,6 +515,148 @@ export class DocumentSnapshot< } return undefined; } + + static _jsonSchemaVersion: string = 'firestore/documentSnapshot/1.0'; + static _jsonSchema = { + type: property('string', DocumentSnapshot._jsonSchemaVersion), + bundleSource: property('string', 'DocumentSnapshot'), + bundleName: property('string'), + bundle: property('string') + }; + + /** + * Returns a JSON-serializable representation of this `DocumentSnapshot` instance. + * + * @returns a JSON representation of this object. Throws a {@link FirestoreError} if this + * `DocumentSnapshot` has pending writes. + */ + toJSON(): object { + if (this.metadata.hasPendingWrites) { + throw new FirestoreError( + Code.FAILED_PRECONDITION, + 'DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. ' + + 'Await waitForPendingWrites() before invoking toJSON().' + ); + } + const document = this._document; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const result: any = {}; + result['type'] = DocumentSnapshot._jsonSchemaVersion; + result['bundle'] = ''; + result['bundleSource'] = 'DocumentSnapshot'; + result['bundleName'] = this._key.toString(); + + if ( + !document || + !document.isValidDocument() || + !document.isFoundDocument() + ) { + return result; + } + const documentData = this._userDataWriter.convertObjectMap( + document.data.value.mapValue.fields, + 'previous' + ); + result['bundle'] = buildDocumentSnapshotJsonBundle( + this._firestore, + document, + documentData, + this.ref.path + ); + return result; + } +} + +/** + * Builds a `DocumentSnapshot` instance from a JSON object created by + * {@link DocumentSnapshot.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json - a JSON object represention of a `DocumentSnapshot` instance. + * @returns an instance of {@link DocumentSnapshot} if the JSON object could be + * parsed. Throws a {@link FirestoreError} if an error occurs. + */ +export function documentSnapshotFromJSON( + db: Firestore, + json: object +): DocumentSnapshot; +/** + * Builds a `DocumentSnapshot` instance from a JSON object created by + * {@link DocumentSnapshot.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json - a JSON object represention of a `DocumentSnapshot` instance. + * @param converter - Converts objects to and from Firestore. + * @returns an instance of {@link DocumentSnapshot} if the JSON object could be + * parsed. Throws a {@link FirestoreError} if an error occurs. + */ +export function documentSnapshotFromJSON< + AppModelType, + DbModelType extends DocumentData = DocumentData +>( + db: Firestore, + json: object, + converter: FirestoreDataConverter +): DocumentSnapshot; +export function documentSnapshotFromJSON< + AppModelType, + DbModelType extends DocumentData = DocumentData +>( + db: Firestore, + json: object, + converter?: FirestoreDataConverter +): DocumentSnapshot { + if (validateJSON(json, DocumentSnapshot._jsonSchema)) { + if (json.bundle === NOT_SUPPORTED) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'The provided JSON object was created in a client environment, which is not supported.' + ); + } + // Parse the bundle data. + const serializer = newSerializer(db._databaseId); + const bundleReader = createBundleReaderSync(json.bundle, serializer); + const elements = bundleReader.getElements(); + const bundleLoader: BundleLoader = new BundleLoader( + bundleReader.getMetadata(), + serializer + ); + for (const element of elements) { + bundleLoader.addSizedElement(element); + } + + // Ensure that we have the correct number of documents in the bundle. + const bundledDocuments = bundleLoader.documents; + if (bundledDocuments.length !== 1) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + `Expected bundle data to contain 1 document, but it contains ${bundledDocuments.length} documents.` + ); + } + + // Build out the internal document data. + const document = fromDocument(serializer, bundledDocuments[0].document!); + const documentKey = new DocumentKey( + ResourcePath.fromString(json.bundleName) + ); + + // Return the external facing DocumentSnapshot. + return new DocumentSnapshot( + db, + new LiteUserDataWriter(db), + documentKey, + document, + new SnapshotMetadata( + /* hasPendingWrites= */ false, + /* fromCache= */ false + ), + converter ? converter : null + ); + } + throw new FirestoreError( + Code.INTERNAL, + 'Unexpected error creating DocumentSnapshot from JSON.' + ); } /** @@ -651,6 +812,171 @@ export class QuerySnapshot< return this._cachedChanges; } + + static _jsonSchemaVersion: string = 'firestore/querySnapshot/1.0'; + static _jsonSchema = { + type: property('string', QuerySnapshot._jsonSchemaVersion), + bundleSource: property('string', 'QuerySnapshot'), + bundleName: property('string'), + bundle: property('string') + }; + + /** + * Returns a JSON-serializable representation of this `QuerySnapshot` instance. + * + * @returns a JSON representation of this object. Throws a {@link FirestoreError} if this + * `QuerySnapshot` has pending writes. + */ + toJSON(): object { + if (this.metadata.hasPendingWrites) { + throw new FirestoreError( + Code.FAILED_PRECONDITION, + 'QuerySnapshot.toJSON() attempted to serialize a document with pending writes. ' + + 'Await waitForPendingWrites() before invoking toJSON().' + ); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const result: any = {}; + result['type'] = QuerySnapshot._jsonSchemaVersion; + result['bundleSource'] = 'QuerySnapshot'; + result['bundleName'] = AutoId.newId(); + + const databaseId = this._firestore._databaseId.database; + const projectId = this._firestore._databaseId.projectId; + const parent = `projects/${projectId}/databases/${databaseId}/documents`; + const documents: Document[] = []; + const documentData: DocumentData[] = []; + const paths: string[] = []; + + this.docs.forEach(doc => { + if (doc._document === null) { + return; + } + documents.push(doc._document); + documentData.push( + this._userDataWriter.convertObjectMap( + doc._document.data.value.mapValue.fields, + 'previous' + ) + ); + paths.push(doc.ref.path); + }); + result['bundle'] = buildQuerySnapshotJsonBundle( + this._firestore, + this.query._query, + result['bundleName'], + parent, + paths, + documents, + documentData + ); + return result; + } +} + +/** + * Builds a `QuerySnapshot` instance from a JSON object created by + * {@link QuerySnapshot.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json - a JSON object represention of a `QuerySnapshot` instance. + * @returns an instance of {@link QuerySnapshot} if the JSON object could be + * parsed. Throws a {@link FirestoreError} if an error occurs. + */ +export function querySnapshotFromJSON( + db: Firestore, + json: object +): QuerySnapshot; +/** + * Builds a `QuerySnapshot` instance from a JSON object created by + * {@link QuerySnapshot.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json - a JSON object represention of a `QuerySnapshot` instance. + * @param converter - Converts objects to and from Firestore. + * @returns an instance of {@link QuerySnapshot} if the JSON object could be + * parsed. Throws a {@link FirestoreError} if an error occurs. + */ +export function querySnapshotFromJSON< + AppModelType, + DbModelType extends DocumentData = DocumentData +>( + db: Firestore, + json: object, + converter: FirestoreDataConverter +): QuerySnapshot; +export function querySnapshotFromJSON< + AppModelType, + DbModelType extends DocumentData +>( + db: Firestore, + json: object, + converter?: FirestoreDataConverter +): QuerySnapshot { + if (validateJSON(json, QuerySnapshot._jsonSchema)) { + if (json.bundle === NOT_SUPPORTED) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'The provided JSON object was created in a client environment, which is not supported.' + ); + } + // Parse the bundle data. + const serializer = newSerializer(db._databaseId); + const bundleReader = createBundleReaderSync(json.bundle, serializer); + const elements = bundleReader.getElements(); + const bundleLoader: BundleLoader = new BundleLoader( + bundleReader.getMetadata(), + serializer + ); + for (const element of elements) { + bundleLoader.addSizedElement(element); + } + + if (bundleLoader.queries.length !== 1) { + throw new FirestoreError( + Code.INVALID_ARGUMENT, + `Snapshot data expected 1 query but found ${bundleLoader.queries.length} queries.` + ); + } + + // Create an internal Query object from the named query in the bundle. + const query = fromBundledQuery(bundleLoader.queries[0].bundledQuery!); + + // Construct the arrays of document data for the query. + const bundledDocuments = bundleLoader.documents; + let documentSet = new DocumentSet(); + bundledDocuments.map(bundledDocument => { + const document = fromDocument(serializer, bundledDocument.document!); + documentSet = documentSet.add(document); + }); + // Create a view snapshot of the query and documents. + const viewSnapshot = ViewSnapshot.fromInitialDocuments( + query, + documentSet, + documentKeySet() /* Zero mutated keys signifies no pending writes. */, + /* fromCache= */ false, + /* hasCachedResults= */ false + ); + + // Create an external Query object, required to construct the QuerySnapshot. + const externalQuery = new Query( + db, + converter ? converter : null, + query + ); + + // Return a new QuerySnapshot with all of the collected data. + return new QuerySnapshot( + db, + new LiteUserDataWriter(db), + externalQuery, + viewSnapshot + ); + } + throw new FirestoreError( + Code.INTERNAL, + 'Unexpected error creating QuerySnapshot from JSON.' + ); } /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */ diff --git a/packages/firestore/src/core/bundle_impl.ts b/packages/firestore/src/core/bundle_impl.ts index 9a42e43261f..b91933f1349 100644 --- a/packages/firestore/src/core/bundle_impl.ts +++ b/packages/firestore/src/core/bundle_impl.ts @@ -82,27 +82,42 @@ export class BundleConverterImpl implements BundleConverter { } /** - * A class to process the elements from a bundle, load them into local + * A class to process the elements from a bundle, and optionally load them into local * storage and provide progress update while loading. */ export class BundleLoader { /** The current progress of loading */ private progress: LoadBundleTaskProgress; /** Batched queries to be saved into storage */ - private queries: ProtoNamedQuery[] = []; + private _queries: ProtoNamedQuery[] = []; /** Batched documents to be saved into storage */ - private documents: BundledDocuments = []; + private _documents: BundledDocuments = []; /** The collection groups affected by this bundle. */ private collectionGroups = new Set(); constructor( private bundleMetadata: ProtoBundleMetadata, - private localStore: LocalStore, private serializer: JsonProtoSerializer ) { this.progress = bundleInitialProgress(bundleMetadata); } + /** + * Returns the named queries that have been parsed from the SizeBundleElements added by + * calling {@link adSizedElement}. + */ + get queries(): ProtoNamedQuery[] { + return this._queries; + } + + /** + * Returns the BundledDocuments that have been parsed from the SizeBundleElements added by + * calling {@link addSizedElement}. + */ + get documents(): BundledDocuments { + return this._documents; + } + /** * Adds an element from the bundle to the loader. * @@ -117,9 +132,9 @@ export class BundleLoader { let documentsLoaded = this.progress.documentsLoaded; if (element.payload.namedQuery) { - this.queries.push(element.payload.namedQuery); + this._queries.push(element.payload.namedQuery); } else if (element.payload.documentMetadata) { - this.documents.push({ metadata: element.payload.documentMetadata }); + this._documents.push({ metadata: element.payload.documentMetadata }); if (!element.payload.documentMetadata.exists) { ++documentsLoaded; } @@ -133,12 +148,12 @@ export class BundleLoader { this.collectionGroups.add(path.get(path.length - 2)); } else if (element.payload.document) { debugAssert( - this.documents.length > 0 && - this.documents[this.documents.length - 1].metadata.name === + this._documents.length > 0 && + this._documents[this._documents.length - 1].metadata.name === element.payload.document.name, 'The document being added does not match the stored metadata.' ); - this.documents[this.documents.length - 1].document = + this._documents[this._documents.length - 1].document = element.payload.document; ++documentsLoaded; } @@ -176,26 +191,28 @@ export class BundleLoader { /** * Update the progress to 'Success' and return the updated progress. */ - async complete(): Promise { + async completeAndStoreAsync( + localStore: LocalStore + ): Promise { debugAssert( - this.documents[this.documents.length - 1]?.metadata.exists !== true || - !!this.documents[this.documents.length - 1].document, + this._documents[this._documents.length - 1]?.metadata.exists !== true || + !!this._documents[this._documents.length - 1].document, 'Bundled documents end with a document metadata element instead of a document.' ); debugAssert(!!this.bundleMetadata.id, 'Bundle ID must be set.'); const changedDocs = await localStoreApplyBundledDocuments( - this.localStore, + localStore, new BundleConverterImpl(this.serializer), - this.documents, + this._documents, this.bundleMetadata.id! ); const queryDocumentMap = this.getQueryDocumentMapping(this.documents); - for (const q of this.queries) { + for (const q of this._queries) { await localStoreSaveNamedQuery( - this.localStore, + localStore, q, queryDocumentMap.get(q.name!) ); diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index e43060d229d..d04f37a3d7b 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -53,8 +53,9 @@ import { JsonProtoSerializer } from '../remote/serializer'; import { debugAssert } from '../util/assert'; import { AsyncObserver } from '../util/async_observer'; import { AsyncQueue, wrapInUserErrorIfRecoverable } from '../util/async_queue'; -import { BundleReader } from '../util/bundle_reader'; +import { BundleReader, BundleReaderSync } from '../util/bundle_reader'; import { newBundleReader } from '../util/bundle_reader_impl'; +import { newBundleReaderSync } from '../util/bundle_reader_sync_impl'; import { Code, FirestoreError } from '../util/error'; import { logDebug, logWarn } from '../util/log'; import { AutoId } from '../util/misc'; @@ -351,7 +352,7 @@ async function ensureOfflineComponents( return client._offlineComponents!; } -async function ensureOnlineComponents( +export async function ensureOnlineComponents( client: FirestoreClient ): Promise { if (!client._onlineComponents) { @@ -833,6 +834,13 @@ function createBundleReader( return newBundleReader(toByteStreamReader(content), serializer); } +export function createBundleReaderSync( + bundleData: string, + serializer: JsonProtoSerializer +): BundleReaderSync { + return newBundleReaderSync(bundleData, serializer); +} + export function firestoreClientSetIndexConfiguration( client: FirestoreClient, indexes: FieldIndex[] diff --git a/packages/firestore/src/core/sync_engine_impl.ts b/packages/firestore/src/core/sync_engine_impl.ts index 404d4663a47..f00acb5a4ee 100644 --- a/packages/firestore/src/core/sync_engine_impl.ts +++ b/packages/firestore/src/core/sync_engine_impl.ts @@ -1697,11 +1697,7 @@ async function loadBundleImpl( task._updateProgress(bundleInitialProgress(metadata)); - const loader = new BundleLoader( - metadata, - syncEngine.localStore, - reader.serializer - ); + const loader = new BundleLoader(metadata, reader.serializer); let element = await reader.nextElement(); while (element) { debugAssert( @@ -1716,7 +1712,7 @@ async function loadBundleImpl( element = await reader.nextElement(); } - const result = await loader.complete(); + const result = await loader.completeAndStoreAsync(syncEngine.localStore); await syncEngineEmitNewSnapsAndNotifyLocalStore( syncEngine, result.changedDocs, diff --git a/packages/firestore/src/lite-api/bytes.ts b/packages/firestore/src/lite-api/bytes.ts index ef16bc54463..225ad7918af 100644 --- a/packages/firestore/src/lite-api/bytes.ts +++ b/packages/firestore/src/lite-api/bytes.ts @@ -17,6 +17,9 @@ import { ByteString } from '../util/byte_string'; import { Code, FirestoreError } from '../util/error'; +// API extractor fails importing property unless we also explicitly import Property. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; /** * An immutable object representing an array of bytes. @@ -91,4 +94,39 @@ export class Bytes { isEqual(other: Bytes): boolean { return this._byteString.isEqual(other._byteString); } + + static _jsonSchemaVersion: string = 'firestore/bytes/1.0'; + static _jsonSchema = { + type: property('string', Bytes._jsonSchemaVersion), + bytes: property('string') + }; + + /** + * Returns a JSON-serializable representation of this `Bytes` instance. + * + * @returns a JSON representation of this object. + */ + toJSON(): object { + return { + type: Bytes._jsonSchemaVersion, + bytes: this.toBase64() + }; + } + + /** + * Builds a `Bytes` instance from a JSON object created by {@link Bytes.toJSON}. + * + * @param json a JSON object represention of a `Bytes` instance + * @returns an instance of {@link Bytes} if the JSON object could be parsed. Throws a + * {@link FirestoreError} if an error occurs. + */ + static fromJSON(json: object): Bytes { + if (validateJSON(json, Bytes._jsonSchema)) { + return Bytes.fromBase64String(json.bytes); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'Unexpected error creating Bytes from JSON.' + ); + } } diff --git a/packages/firestore/src/lite-api/geo_point.ts b/packages/firestore/src/lite-api/geo_point.ts index 3e2944cde29..75194049f89 100644 --- a/packages/firestore/src/lite-api/geo_point.ts +++ b/packages/firestore/src/lite-api/geo_point.ts @@ -16,6 +16,9 @@ */ import { Code, FirestoreError } from '../util/error'; +// API extractor fails importing 'property' unless we also explicitly import 'Property'. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; import { primitiveComparator } from '../util/misc'; /** @@ -79,11 +82,6 @@ export class GeoPoint { return this._lat === other._lat && this._long === other._long; } - /** Returns a JSON-serializable representation of this GeoPoint. */ - toJSON(): { latitude: number; longitude: number } { - return { latitude: this._lat, longitude: this._long }; - } - /** * Actually private to JS consumers of our API, so this function is prefixed * with an underscore. @@ -94,4 +92,41 @@ export class GeoPoint { primitiveComparator(this._long, other._long) ); } + + static _jsonSchemaVersion: string = 'firestore/geoPoint/1.0'; + static _jsonSchema = { + type: property('string', GeoPoint._jsonSchemaVersion), + latitude: property('number'), + longitude: property('number') + }; + + /** + * Returns a JSON-serializable representation of this `GeoPoint` instance. + * + * @returns a JSON representation of this object. + */ + toJSON(): { latitude: number; longitude: number; type: string } { + return { + latitude: this._lat, + longitude: this._long, + type: GeoPoint._jsonSchemaVersion + }; + } + + /** + * Builds a `GeoPoint` instance from a JSON object created by {@link GeoPoint.toJSON}. + * + * @param json a JSON object represention of a `GeoPoint` instance + * @returns an instance of {@link GeoPoint} if the JSON object could be parsed. Throws a + * {@link FirestoreError} if an error occurs. + */ + static fromJSON(json: object): GeoPoint { + if (validateJSON(json, GeoPoint._jsonSchema)) { + return new GeoPoint(json.latitude, json.longitude); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'Unexpected error creating GeoPoint from JSON.' + ); + } } diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index 26ae2fbd433..f38dad9a078 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -32,6 +32,9 @@ import { validateDocumentPath, validateNonEmptyArgument } from '../util/input_validation'; +// API extractor fails importing property unless we also explicitly import Property. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; import { AutoId } from '../util/misc'; import { Firestore } from './database'; @@ -278,6 +281,73 @@ export class DocumentReference< this._key ); } + + static _jsonSchemaVersion: string = 'firestore/documentReference/1.0'; + static _jsonSchema = { + type: property('string', DocumentReference._jsonSchemaVersion), + referencePath: property('string') + }; + + /** + * Returns a JSON-serializable representation of this `DocumentReference` instance. + * + * @returns a JSON representation of this object. + */ + toJSON(): object { + return { + type: DocumentReference._jsonSchemaVersion, + referencePath: this._key.toString() + }; + } + + /** + * Builds a `DocumentReference` instance from a JSON object created by + * {@link DocumentReference.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json a JSON object represention of a `DocumentReference` instance + * @returns an instance of {@link DocumentReference} if the JSON object could be parsed. Throws a + * {@link FirestoreError} if an error occurs. + */ + static fromJSON(firestore: Firestore, json: object): DocumentReference; + /** + * Builds a `DocumentReference` instance from a JSON object created by + * {@link DocumentReference.toJSON}. + * + * @param firestore - The {@link Firestore} instance the snapshot should be loaded for. + * @param json a JSON object represention of a `DocumentReference` instance + * @param converter - Converts objects to and from Firestore. + * @returns an instance of {@link DocumentReference} if the JSON object could be parsed. Throws a + * {@link FirestoreError} if an error occurs. + */ + static fromJSON< + NewAppModelType = DocumentData, + NewDbModelType extends DocumentData = DocumentData + >( + firestore: Firestore, + json: object, + converter: FirestoreDataConverter + ): DocumentReference; + static fromJSON< + NewAppModelType = DocumentData, + NewDbModelType extends DocumentData = DocumentData + >( + firestore: Firestore, + json: object, + converter?: FirestoreDataConverter + ): DocumentReference { + if (validateJSON(json, DocumentReference._jsonSchema)) { + return new DocumentReference( + firestore, + converter ? converter : null, + new DocumentKey(ResourcePath.fromString(json.referencePath)) + ); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'Unexpected error creating Bytes from JSON.' + ); + } } /** diff --git a/packages/firestore/src/lite-api/timestamp.ts b/packages/firestore/src/lite-api/timestamp.ts index e3d945aaf30..48c514feca8 100644 --- a/packages/firestore/src/lite-api/timestamp.ts +++ b/packages/firestore/src/lite-api/timestamp.ts @@ -16,6 +16,9 @@ */ import { Code, FirestoreError } from '../util/error'; +// API extractor fails importing 'property' unless we also explicitly import 'Property'. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; import { primitiveComparator } from '../util/misc'; // The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z). @@ -174,9 +177,35 @@ export class Timestamp { ); } - /** Returns a JSON-serializable representation of this `Timestamp`. */ - toJSON(): { seconds: number; nanoseconds: number } { - return { seconds: this.seconds, nanoseconds: this.nanoseconds }; + static _jsonSchemaVersion: string = 'firestore/timestamp/1.0'; + static _jsonSchema = { + type: property('string', Timestamp._jsonSchemaVersion), + seconds: property('number'), + nanoseconds: property('number') + }; + + /** + * Returns a JSON-serializable representation of this `Timestamp`. + */ + toJSON(): { seconds: number; nanoseconds: number; type: string } { + return { + type: Timestamp._jsonSchemaVersion, + seconds: this.seconds, + nanoseconds: this.nanoseconds + }; + } + + /** + * Builds a `Timestamp` instance from a JSON object created by {@link Timestamp.toJSON}. + */ + static fromJSON(json: object): Timestamp { + if (validateJSON(json, Timestamp._jsonSchema)) { + return new Timestamp(json.seconds, json.nanoseconds); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'Unexpected error creating Timestamp from JSON.' + ); } /** diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index aa5f9eeb5bf..a3022be627e 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -780,7 +780,7 @@ export function parseData( } } -function parseObject( +export function parseObject( obj: Dict, context: ParseContextImpl ): { mapValue: ProtoMapValue } { diff --git a/packages/firestore/src/lite-api/vector_value.ts b/packages/firestore/src/lite-api/vector_value.ts index 9ac9753fef5..c48feaeff3b 100644 --- a/packages/firestore/src/lite-api/vector_value.ts +++ b/packages/firestore/src/lite-api/vector_value.ts @@ -16,6 +16,10 @@ */ import { isPrimitiveArrayEqual } from '../util/array'; +import { Code, FirestoreError } from '../util/error'; +// API extractor fails importing 'property' unless we also explicitly import 'Property'. +// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports-ts +import { Property, property, validateJSON } from '../util/json_validation'; /** * Represents a vector type in Firestore documents. @@ -48,4 +52,48 @@ export class VectorValue { isEqual(other: VectorValue): boolean { return isPrimitiveArrayEqual(this._values, other._values); } + + static _jsonSchemaVersion: string = 'firestore/vectorValue/1.0'; + static _jsonSchema = { + type: property('string', VectorValue._jsonSchemaVersion), + vectorValues: property('object') + }; + + /** + * Returns a JSON-serializable representation of this `VectorValue` instance. + * + * @returns a JSON representation of this object. + */ + toJSON(): object { + return { + type: VectorValue._jsonSchemaVersion, + vectorValues: this._values + }; + } + + /** + * Builds a `VectorValue` instance from a JSON object created by {@link VectorValue.toJSON}. + * + * @param json a JSON object represention of a `VectorValue` instance. + * @returns an instance of {@link VectorValue} if the JSON object could be parsed. Throws a + * {@link FirestoreError} if an error occurs. + */ + static fromJSON(json: object): VectorValue { + if (validateJSON(json, VectorValue._jsonSchema)) { + if ( + Array.isArray(json.vectorValues) && + json.vectorValues.every(element => typeof element === 'number') + ) { + return new VectorValue(json.vectorValues); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + "Expected 'vectorValues' field to be a number array" + ); + } + throw new FirestoreError( + Code.INVALID_ARGUMENT, + 'Unexpected error creating Timestamp from JSON.' + ); + } } diff --git a/packages/firestore/src/platform/browser/snapshot_to_json.ts b/packages/firestore/src/platform/browser/snapshot_to_json.ts new file mode 100644 index 00000000000..37c1a0b556d --- /dev/null +++ b/packages/firestore/src/platform/browser/snapshot_to_json.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2025 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. + */ + +/** Return the Platform-specific build JSON bundle implementations. */ +import { Firestore } from '../../api/database'; +import { Query } from '../../core/query'; +import { DocumentData } from '../../lite-api/reference'; +import { Document } from '../../model/document'; + +export function buildDocumentSnapshotJsonBundle( + db: Firestore, + document: Document, + docData: DocumentData, + path: string +): string { + return 'NOT SUPPORTED'; +} + +export function buildQuerySnapshotJsonBundle( + db: Firestore, + query: Query, + bundleName: string, + parent: string, + paths: string[], + docs: Document[], + documentData: DocumentData[] +): string { + return 'NOT SUPPORTED'; +} diff --git a/packages/firestore/src/platform/browser_lite/snapshot_to_json.ts b/packages/firestore/src/platform/browser_lite/snapshot_to_json.ts new file mode 100644 index 00000000000..4012dc496b2 --- /dev/null +++ b/packages/firestore/src/platform/browser_lite/snapshot_to_json.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 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. + */ + +export * from '../browser/snapshot_to_json'; diff --git a/packages/firestore/src/platform/node/snapshot_to_json.ts b/packages/firestore/src/platform/node/snapshot_to_json.ts new file mode 100644 index 00000000000..61987fbbc3c --- /dev/null +++ b/packages/firestore/src/platform/node/snapshot_to_json.ts @@ -0,0 +1,84 @@ +/** + * @license + * Copyright 2025 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. + */ + +/** Return the Platform-specific build JSON bundle implementations. */ +import { Firestore } from '../../api/database'; +import { Query } from '../../core/query'; +import { DocumentData } from '../../lite-api/reference'; +import { Document } from '../../model/document'; +import { + BundleBuilder, + DocumentSnapshotBundleData, + QuerySnapshotBundleData +} from '../../util/bundle_builder_impl'; +import { AutoId } from '../../util/misc'; + +export function buildDocumentSnapshotJsonBundle( + db: Firestore, + document: Document, + docData: DocumentData, + path: string +): string { + const builder: BundleBuilder = new BundleBuilder(db, AutoId.newId()); + builder.addBundleDocument( + documentToDocumentSnapshotBundleData(path, docData, document) + ); + return builder.build(); +} + +export function buildQuerySnapshotJsonBundle( + db: Firestore, + query: Query, + bundleName: string, + parent: string, + paths: string[], + docs: Document[], + documentData: DocumentData[] +): string { + const docBundleDataArray: DocumentSnapshotBundleData[] = []; + for (let i = 0; i < docs.length; i++) { + docBundleDataArray.push( + documentToDocumentSnapshotBundleData(paths[i], documentData[i], docs[i]) + ); + } + const bundleData: QuerySnapshotBundleData = { + name: bundleName, + query, + parent, + docBundleDataArray + }; + const builder: BundleBuilder = new BundleBuilder(db, bundleName); + builder.addBundleQuery(bundleData); + return builder.build(); +} + +// Formats Document data for bundling a DocumentSnapshot. +function documentToDocumentSnapshotBundleData( + path: string, + documentData: DocumentData, + document: Document +): DocumentSnapshotBundleData { + return { + documentData, + documentKey: document.mutableCopy().key, + documentPath: path, + documentExists: true, + createdTime: document.createTime.toTimestamp(), + readTime: document.readTime.toTimestamp(), + versionTime: document.version.toTimestamp() + }; +} diff --git a/packages/firestore/src/platform/node_lite/snapshot_to_json.ts b/packages/firestore/src/platform/node_lite/snapshot_to_json.ts new file mode 100644 index 00000000000..ba6bbb8424b --- /dev/null +++ b/packages/firestore/src/platform/node_lite/snapshot_to_json.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 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. + */ + +export * from '../node/snapshot_to_json'; diff --git a/packages/firestore/src/platform/rn/snapshot_to_json.ts b/packages/firestore/src/platform/rn/snapshot_to_json.ts new file mode 100644 index 00000000000..551f586d20e --- /dev/null +++ b/packages/firestore/src/platform/rn/snapshot_to_json.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2025 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. + */ + +export { + buildDocumentSnapshotJsonBundle, + buildQuerySnapshotJsonBundle +} from '../browser/snapshot_to_json'; diff --git a/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts b/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts new file mode 100644 index 00000000000..709509c8a4e --- /dev/null +++ b/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 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. + */ + +export { toByteStreamReader } from '../browser/byte_stream_reader'; diff --git a/packages/firestore/src/platform/snapshot_to_json.ts b/packages/firestore/src/platform/snapshot_to_json.ts new file mode 100644 index 00000000000..1eae948eb45 --- /dev/null +++ b/packages/firestore/src/platform/snapshot_to_json.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright 2025 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 { Firestore } from '../api/database'; +import { Query } from '../core/query'; +import { DocumentData } from '../lite-api/reference'; +import { Document } from '../model/document'; + +// This file is only used under ts-node. +// eslint-disable-next-line @typescript-eslint/no-require-imports +const platform = require(`./${ + process.env.TEST_PLATFORM ?? 'node' +}/snapshot_to_json`); + +/** + * Constructs the bundle data for a DocumentSnapshot used in its toJSON serialization. + */ +export function buildDocumentSnapshotJsonBundle( + db: Firestore, + document: Document, + docData: DocumentData, + path: string +): string { + return platform.buildDocumentSnapshotJsonBundle(db, document, docData, path); +} + +/** + * Constructs the bundle data for a QuerySnapshot used in its toJSON serialization. + */ +export function buildQuerySnapshotJsonBundle( + db: Firestore, + query: Query, + bundleName: string, + parent: string, + paths: string[], + docs: Document[], + documentData: DocumentData[] +): string { + return platform.buildQuerySnapshotJsonBundle( + db, + query, + bundleName, + parent, + paths, + docs, + documentData + ); +} diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index aabdb263c1a..830875f5e1b 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -226,7 +226,10 @@ export function toTimestamp( } } -function fromTimestamp(date: ProtoTimestamp): Timestamp { +/** + * Returns a Timestamp typed object given protobuf timestamp value. + */ +export function fromTimestamp(date: ProtoTimestamp): Timestamp { const timestamp = normalizeTimestamp(date); return new Timestamp(timestamp.seconds, timestamp.nanos); } diff --git a/packages/firestore/src/util/bundle_builder_impl.ts b/packages/firestore/src/util/bundle_builder_impl.ts new file mode 100644 index 00000000000..dc94ebca495 --- /dev/null +++ b/packages/firestore/src/util/bundle_builder_impl.ts @@ -0,0 +1,284 @@ +/** + * @license + * Copyright 2025 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 { + JsonProtoSerializer, + fromTimestamp, + toName, + toQueryTarget, + toTimestamp +} from '../../src/remote/serializer'; +import { encoder } from '../../test/unit/util/bundle_data'; +import { Firestore } from '../api/database'; +import { DatabaseId } from '../core/database_info'; +import { Query, queryToTarget } from '../core/query'; +import { DocumentData } from '../lite-api/reference'; +import { Timestamp } from '../lite-api/timestamp'; +import { + parseObject, + UserDataReader, + UserDataSource +} from '../lite-api/user_data_reader'; +import { DocumentKey } from '../model/document_key'; +import { + BundledDocumentMetadata as ProtoBundledDocumentMetadata, + BundleElement as ProtoBundleElement, + BundleMetadata as ProtoBundleMetadata, + NamedQuery as ProtoNamedQuery +} from '../protos/firestore_bundle_proto'; +import { + Document as ProtoDocument, + Document +} from '../protos/firestore_proto_api'; + +const BUNDLE_VERSION = 1; + +/** + * Builds a Firestore data bundle with results from the given document and query snapshots. + */ +export class BundleBuilder { + // Resulting documents for the bundle, keyed by full document path. + private documents: Map = new Map(); + // Named queries saved in the bundle, keyed by query name. + private namedQueries: Map = new Map(); + + // The latest read time among all bundled documents and queries. + private latestReadTime = new Timestamp(0, 0); + + // Database identifier which is part of the serialized bundle. + private databaseId: DatabaseId; + + // Tools to convert public data types into their serialized form. + private readonly serializer: JsonProtoSerializer; + private readonly userDataReader: UserDataReader; + + constructor(private firestore: Firestore, readonly bundleId: string) { + this.databaseId = firestore._databaseId; + + // useProto3Json is true because the objects will be serialized to JSON string + // before being written to the bundle buffer. + this.serializer = new JsonProtoSerializer( + this.databaseId, + /*useProto3Json=*/ true + ); + + this.userDataReader = new UserDataReader( + this.databaseId, + true, + this.serializer + ); + } + + /** + * Adds data from a DocumentSnapshot to the bundle. + * @internal + * @param docBundleData A DocumentSnapshotBundleData containing information from the + * DocumentSnapshot. Note we cannot accept a DocumentSnapshot directly due to a circular + * dependency error. + * @param queryName The name of the QuerySnapshot if this document is part of a Query. + */ + addBundleDocument( + docBundleData: DocumentSnapshotBundleData, + queryName?: string + ): void { + const originalDocument = this.documents.get(docBundleData.documentPath); + const originalQueries = originalDocument?.metadata.queries; + const docReadTime: Timestamp | undefined = docBundleData.readTime; + const origDocReadTime: Timestamp | null = !!originalDocument?.metadata + .readTime + ? fromTimestamp(originalDocument.metadata.readTime) + : null; + + const neitherHasReadTime: boolean = !docReadTime && origDocReadTime == null; + const docIsNewer: boolean = + docReadTime !== undefined && + (origDocReadTime == null || origDocReadTime < docReadTime); + if (neitherHasReadTime || docIsNewer) { + // Store document. + this.documents.set(docBundleData.documentPath, { + document: this.toBundleDocument(docBundleData), + metadata: { + name: toName(this.serializer, docBundleData.documentKey), + readTime: !!docReadTime + ? toTimestamp(this.serializer, docReadTime) // Convert Timestamp to proto format. + : undefined, + exists: docBundleData.documentExists + } + }); + } + if (docReadTime && docReadTime > this.latestReadTime) { + this.latestReadTime = docReadTime; + } + // Update `queries` to include both original and `queryName`. + if (queryName) { + const newDocument = this.documents.get(docBundleData.documentPath)!; + newDocument.metadata.queries = originalQueries || []; + newDocument.metadata.queries!.push(queryName); + } + } + + /** + * Adds data from a QuerySnapshot to the bundle. + * @internal + * @param docBundleData A QuerySnapshotBundleData containing information from the + * QuerySnapshot. Note we cannot accept a QuerySnapshot directly due to a circular + * dependency error. + */ + addBundleQuery(queryBundleData: QuerySnapshotBundleData): void { + if (this.namedQueries.has(queryBundleData.name)) { + throw new Error(`Query name conflict: ${name} has already been added.`); + } + let latestReadTime = new Timestamp(0, 0); + for (const docBundleData of queryBundleData.docBundleDataArray) { + this.addBundleDocument(docBundleData, queryBundleData.name); + if (docBundleData.readTime && docBundleData.readTime > latestReadTime) { + latestReadTime = docBundleData.readTime; + } + } + const queryTarget = toQueryTarget( + this.serializer, + queryToTarget(queryBundleData.query) + ); + const bundledQuery = { + parent: queryBundleData.parent, + structuredQuery: queryTarget.queryTarget.structuredQuery + }; + this.namedQueries.set(queryBundleData.name, { + name: queryBundleData.name, + bundledQuery, + readTime: toTimestamp(this.serializer, latestReadTime) + }); + } + + /** + * Convert data from a DocumentSnapshot into the serialized form within a bundle. + * @private + * @internal + * @param docBundleData a DocumentSnapshotBundleData containing the data required to + * serialize a document. + */ + private toBundleDocument( + docBundleData: DocumentSnapshotBundleData + ): ProtoDocument { + // a parse context is typically used for validating and parsing user data, but in this + // case we are using it internally to convert DocumentData to Proto3 JSON + const context = this.userDataReader.createContext( + UserDataSource.ArrayArgument, + 'internal toBundledDocument' + ); + const proto3Fields = parseObject(docBundleData.documentData, context); + + return { + name: toName(this.serializer, docBundleData.documentKey), + fields: proto3Fields.mapValue.fields, + updateTime: toTimestamp(this.serializer, docBundleData.versionTime), + createTime: toTimestamp(this.serializer, docBundleData.createdTime) + }; + } + + /** + * Converts a IBundleElement to a Buffer whose content is the length prefixed JSON representation + * of the element. + * @private + * @internal + * @param bundleElement A ProtoBundleElement that is expected to be Proto3 JSON compatible. + */ + private lengthPrefixedString(bundleElement: ProtoBundleElement): string { + const str = JSON.stringify(bundleElement); + // TODO: it's not ideal to have to re-encode all of these strings multiple times + // It may be more performant to return a UInt8Array that is concatenated to other + // UInt8Arrays instead of returning and concatenating strings and then + // converting the full string to UInt8Array. + const l = encoder.encode(str).byteLength; + return `${l}${str}`; + } + + /** + * Construct a serialized string containing document and query information that has previously + * been added to the BundleBuilder through the addBundleDocument and addBundleQuery methods. + * @internal + */ + build(): string { + let bundleString = ''; + + for (const namedQuery of this.namedQueries.values()) { + bundleString += this.lengthPrefixedString({ namedQuery }); + } + + for (const bundledDocument of this.documents.values()) { + const documentMetadata: ProtoBundledDocumentMetadata = + bundledDocument.metadata; + + bundleString += this.lengthPrefixedString({ documentMetadata }); + // Write to the bundle if document exists. + const document = bundledDocument.document; + if (document) { + bundleString += this.lengthPrefixedString({ document }); + } + } + + const metadata: ProtoBundleMetadata = { + id: this.bundleId, + createTime: toTimestamp(this.serializer, this.latestReadTime), + version: BUNDLE_VERSION, + totalDocuments: this.documents.size, + // TODO: it's not ideal to have to re-encode all of these strings multiple times + totalBytes: encoder.encode(bundleString).length + }; + // Prepends the metadata element to the bundleBuffer: `bundleBuffer` is the second argument to `Buffer.concat`. + bundleString = this.lengthPrefixedString({ metadata }) + bundleString; + + return bundleString; + } +} + +/** + * Interface for an object that contains data required to bundle a DocumentSnapshot. + * @internal + */ +export interface DocumentSnapshotBundleData { + documentData: DocumentData; + documentKey: DocumentKey; + documentPath: string; + documentExists: boolean; + createdTime: Timestamp; + readTime?: Timestamp; + versionTime: Timestamp; +} + +/** + * Interface for an object that contains data required to bundle a QuerySnapshot. + * @internal + */ +export interface QuerySnapshotBundleData { + name: string; + query: Query; + parent: string; + docBundleDataArray: DocumentSnapshotBundleData[]; +} + +/** + * Convenient class to hold both the metadata and the actual content of a document to be bundled. + * @private + * @internal + */ +class BundledDocument { + constructor( + readonly metadata: ProtoBundledDocumentMetadata, + readonly document?: Document + ) {} +} diff --git a/packages/firestore/src/util/bundle_reader.ts b/packages/firestore/src/util/bundle_reader.ts index 6ebfb2d5e8e..cca1c61a538 100644 --- a/packages/firestore/src/util/bundle_reader.ts +++ b/packages/firestore/src/util/bundle_reader.ts @@ -65,3 +65,24 @@ export interface BundleReader { */ nextElement(): Promise; } + +/** + * A class representing a synchronized bundle reader. + * + * Takes a bundle string buffer, parses the data, and provides accessors to the data contained + * within it. + */ +export interface BundleReaderSync { + serializer: JsonProtoSerializer; + + /** + * Returns the metadata of the bundle. + */ + getMetadata(): BundleMetadata; + + /** + * Returns BundleElements parsed from the bundle. Returns an empty array if no bundle elements + * exist. + */ + getElements(): SizedBundleElement[]; +} diff --git a/packages/firestore/src/util/bundle_reader_sync_impl.ts b/packages/firestore/src/util/bundle_reader_sync_impl.ts new file mode 100644 index 00000000000..9379bb5a5a7 --- /dev/null +++ b/packages/firestore/src/util/bundle_reader_sync_impl.ts @@ -0,0 +1,129 @@ +/** + * @license + * Copyright 2025 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 { BundleMetadata } from '../protos/firestore_bundle_proto'; +import { JsonProtoSerializer } from '../remote/serializer'; +import { Code, FirestoreError } from '../util/error'; + +import { BundleReaderSync, SizedBundleElement } from './bundle_reader'; + +/** + * A class that can parse a bundle form the string serialization of a bundle. + */ +export class BundleReaderSyncImpl implements BundleReaderSync { + private metadata: BundleMetadata; + private elements: SizedBundleElement[]; + private cursor: number; + constructor( + private bundleData: string, + readonly serializer: JsonProtoSerializer + ) { + this.cursor = 0; + this.elements = []; + + let element = this.nextElement(); + if (element && element.isBundleMetadata()) { + this.metadata = element as BundleMetadata; + } else { + throw new Error(`The first element of the bundle is not a metadata object, it is + ${JSON.stringify(element?.payload)}`); + } + + do { + element = this.nextElement(); + if (element !== null) { + this.elements.push(element); + } + } while (element !== null); + } + + /* Returns the parsed metadata of the bundle. */ + getMetadata(): BundleMetadata { + return this.metadata; + } + + /* Returns the DocumentSnapshot or NamedQuery elements of the bundle. */ + getElements(): SizedBundleElement[] { + return this.elements; + } + + /** + * Parses the next element of the bundle. + * + * @returns a SizedBundleElement representation of the next element in the bundle, or null if + * no more elements exist. + */ + private nextElement(): SizedBundleElement | null { + if (this.cursor === this.bundleData.length) { + return null; + } + const length: number = this.readLength(); + const jsonString = this.readJsonString(length); + return new SizedBundleElement(JSON.parse(jsonString), length); + } + + /** + * Reads from a specified position from the bundleData string, for a specified + * number of bytes. + * + * @param length how many characters to read. + * @returns a string parsed from the bundle. + */ + private readJsonString(length: number): string { + if (this.cursor + length > this.bundleData.length) { + throw new FirestoreError( + Code.INTERNAL, + 'Reached the end of bundle when more is expected.' + ); + } + const result = this.bundleData.slice(this.cursor, (this.cursor += length)); + return result; + } + + /** + * Reads from the current cursor until the first '{'. + * + * @returns A string to integer represention of the parsed value. + * @throws An {@link Error} if the cursor has reached the end of the stream, since lengths + * prefix bundle objects. + */ + private readLength(): number { + const startIndex = this.cursor; + let curIndex = this.cursor; + while (curIndex < this.bundleData.length) { + if (this.bundleData[curIndex] === '{') { + if (curIndex === startIndex) { + throw new Error('First character is a bracket and not a number'); + } + this.cursor = curIndex; + return Number(this.bundleData.slice(startIndex, curIndex)); + } + curIndex++; + } + throw new Error('Reached the end of bundle when more is expected.'); + } +} + +/** + * Creates an instance of BundleReader without exposing the BundleReaderSyncImpl class type. + */ +export function newBundleReaderSync( + bundleData: string, + serializer: JsonProtoSerializer +): BundleReaderSync { + return new BundleReaderSyncImpl(bundleData, serializer); +} diff --git a/packages/firestore/src/util/json_validation.ts b/packages/firestore/src/util/json_validation.ts new file mode 100644 index 00000000000..771a7f91ef3 --- /dev/null +++ b/packages/firestore/src/util/json_validation.ts @@ -0,0 +1,142 @@ +/** + * @license + * Copyright 2025 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 { isPlainObject } from '../util/input_validation'; + +import { Code, FirestoreError } from './error'; + +/** + * A list of data types Firestore objects may serialize in their toJSON implemenetations. + * @private + * @internal + */ +export type JsonTypeDesc = + | 'object' + | 'string' + | 'number' + | 'boolean' + | 'null' + | 'undefined'; + +/** + * An association of JsonTypeDesc values to their native types. + * @private + * @internal + */ +export type TSType = T extends 'object' + ? object + : T extends 'string' + ? string + : T extends 'number' + ? number + : T extends 'boolean' + ? boolean + : T extends 'null' + ? null + : T extends 'undefined' + ? undefined + : never; + +/** + * The representation of a JSON object property name and its type value. + * @private + * @internal + */ +export interface Property { + value?: TSType; + typeString: JsonTypeDesc; +} + +/** + * A type Firestore data types may use to define the fields used in their JSON serialization. + * @private + * @internal + */ +export interface JsonSchema { + [key: string]: Property; +} + +/** + * Associates the JSON property type to the native type and sets them to be Required. + * @private + * @internal + */ +export type Json = { + [K in keyof T]: Required['value']; +}; + +/** + * Helper function to define a JSON schema {@link Property}. + * @private + * @internal + */ +export function property( + typeString: T, + optionalValue?: TSType +): Property { + const result: Property = { + typeString + }; + if (optionalValue) { + result.value = optionalValue; + } + return result; +} + +/** + * Validates the JSON object based on the provided schema, and narrows the type to the provided + * JSON schema. + * @private + * @internal + * + * @param json A JSON object to validate. + * @param scheme a {@link JsonSchema} that defines the properties to validate. + * @returns true if the JSON schema exists within the object. Throws a FirestoreError otherwise. + */ +export function validateJSON( + json: object, + schema: S +): json is Json { + if (!isPlainObject(json)) { + throw new FirestoreError(Code.INVALID_ARGUMENT, 'JSON must be an object'); + } + let error: string | undefined = undefined; + for (const key in schema) { + if (schema[key]) { + const typeString = schema[key].typeString; + const value: { value: unknown } | undefined = + 'value' in schema[key] ? { value: schema[key].value } : undefined; + if (!(key in json)) { + error = `JSON missing required field: '${key}'`; + break; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fieldValue = (json as any)[key]; + if (typeString && typeof fieldValue !== typeString) { + error = `JSON field '${key}' must be a ${typeString}.`; + break; + } else if (value !== undefined && fieldValue !== value.value) { + error = `Expected '${key}' field to equal '${value.value}'`; + break; + } + } + } + if (error) { + throw new FirestoreError(Code.INVALID_ARGUMENT, error); + } + return true; +} diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 9675e02efeb..b63c03a4f62 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -16,7 +16,7 @@ */ import { deleteApp } from '@firebase/app'; -import { Deferred } from '@firebase/util'; +import { Deferred, isNode } from '@firebase/util'; import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -33,6 +33,7 @@ import { DocumentData, documentId, DocumentSnapshot, + documentSnapshotFromJSON, enableIndexedDbPersistence, enableNetwork, getDoc, @@ -42,6 +43,7 @@ import { initializeFirestore, limit, onSnapshot, + onSnapshotResume, onSnapshotsInSync, orderBy, query, @@ -66,6 +68,7 @@ import { newTestApp, FirestoreError, QuerySnapshot, + querySnapshotFromJSON, vector, getDocsFromServer } from '../util/firebase_export'; @@ -1206,6 +1209,429 @@ apiDescribe('Database', persistence => { }); }); + it('DocumentSnapshot events for snapshot created by a bundle', async () => { + if (isNode()) { + const initialData = { a: 1 }; + const finalData = { a: 2 }; + await withTestDocAndInitialData( + persistence, + initialData, + async (docRef, db) => { + const doc = await getDoc(docRef); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume( + db, + doc.toJSON(), + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + console.error('DEDB accumulator event 1'); + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(initialData); + }) + .then(() => setDoc(docRef, finalData)) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(finalData); + }); + unsubscribe(); + } + ); + } + }); + + it('DocumentSnapshot updated doc events in snapshot created by a bundle accumulator', async () => { + if (isNode()) { + const initialData = { a: 1 }; + const finalData = { a: 2 }; + await withTestDocAndInitialData( + persistence, + initialData, + async (docRef, db) => { + const doc = await getDoc(docRef); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume( + db, + doc.toJSON(), + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(initialData); + }) + .then(() => setDoc(docRef, finalData)) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(finalData); + }); + unsubscribe(); + } + ); + } + }); + + it('DocumentSnapshot observer events for snapshot created by a bundle', async () => { + if (isNode()) { + const initialData = { a: 1 }; + const finalData = { a: 2 }; + await withTestDocAndInitialData( + persistence, + initialData, + async (docRef, db) => { + const doc = await getDoc(docRef); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume(db, doc.toJSON(), { + next: accumulator.storeEvent + }); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(initialData); + }) + .then(() => setDoc(docRef, finalData)) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(finalData); + }); + unsubscribe(); + } + ); + } + }); + + it('DocumentSnapshot error events for snapshot created by a bundle', async () => { + return withTestDb(persistence, async db => { + const json = { + bundle: 'BadData', + bundleName: 'bundleName', + bundleSource: 'DocumentSnapshot' + }; + const deferred = new Deferred(); + const unsubscribe = onSnapshotResume( + db, + json, + ds => { + expect(ds).to.not.exist; + deferred.resolve(); + }, + err => { + expect(err.name).to.exist; + expect(err.message).to.exist; + deferred.resolve(); + } + ); + await deferred.promise; + unsubscribe(); + }); + }); + + it('DocumentSnapshot observer error events for snapshot created by a bundle', async () => { + return withTestDb(persistence, async db => { + const json = { + bundle: 'BadData', + bundleName: 'bundleName', + bundleSource: 'QuerySnapshot' + }; + const deferred = new Deferred(); + const unsubscribe = onSnapshotResume(db, json, { + next: ds => { + expect(ds).to.not.exist; + deferred.resolve(); + }, + error: err => { + expect(err.name).to.exist; + expect(err.message).to.exist; + deferred.resolve(); + } + }); + await deferred.promise; + unsubscribe(); + }); + }); + + it('DocumentSnapshot updated doc events in snapshot created by fromJSON bundle', async () => { + if (isNode()) { + const initialData = { a: 1 }; + const finalData = { a: 2 }; + await withTestDocAndInitialData( + persistence, + initialData, + async (docRef, db) => { + const doc = await getDoc(docRef); + const fromJsonDoc = documentSnapshotFromJSON(db, doc.toJSON()); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume( + db, + fromJsonDoc.toJSON(), + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(initialData); + }) + .then(() => setDoc(docRef, finalData)) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(finalData); + }); + unsubscribe(); + } + ); + } + }); + + it('DocumentSnapshot updated doc events in snapshot created by fromJSON doc ref', async () => { + if (isNode()) { + const initialData = { a: 1 }; + const finalData = { a: 2 }; + await withTestDocAndInitialData( + persistence, + initialData, + async (docRef, db) => { + const doc = await getDoc(docRef); + const fromJsonDoc = documentSnapshotFromJSON(db, doc.toJSON()); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshot( + fromJsonDoc.ref, + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(initialData); + }) + .then(() => setDoc(docRef, finalData)) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.exists()).to.be.true; + expect(snap.data()).to.deep.equal(finalData); + }); + unsubscribe(); + } + ); + } + }); + + it('Querysnapshot events for snapshot created by a bundle', async () => { + if (isNode()) { + const testDocs = { + a: { foo: 1 }, + b: { bar: 2 } + }; + await withTestCollection(persistence, testDocs, async (coll, db) => { + const querySnap = await getDocs(query(coll, orderBy(documentId()))); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume( + db, + querySnap.toJSON(), + accumulator.storeEvent + ); + await accumulator.awaitEvent().then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal(testDocs.a); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }); + unsubscribe(); + }); + } + }); + + it('Querysnapshot observer events for snapshot created by a bundle', async () => { + if (isNode()) { + const testDocs = { + a: { foo: 1 }, + b: { bar: 2 } + }; + await withTestCollection(persistence, testDocs, async (coll, db) => { + const querySnap = await getDocs(query(coll, orderBy(documentId()))); + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume(db, querySnap.toJSON(), { + next: accumulator.storeEvent + }); + await accumulator.awaitEvent().then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal(testDocs.a); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }); + unsubscribe(); + }); + } + }); + + it('QuerySnapshot error events for snapshot created by a bundle', async () => { + return withTestDb(persistence, async db => { + const json = { + bundle: 'BadData', + bundleName: 'bundleName', + bundleSource: 'QuerySnapshot' + }; + const deferred = new Deferred(); + const unsubscribe = onSnapshotResume( + db, + json, + qs => { + expect(qs).to.not.exist; + deferred.resolve(); + }, + err => { + expect(err.name).to.exist; + expect(err.message).to.exist; + deferred.resolve(); + } + ); + await deferred.promise; + unsubscribe(); + }); + }); + + it('QuerySnapshot observer error events for snapshot created by a bundle', async () => { + return withTestDb(persistence, async db => { + const json = { + bundle: 'BadData', + bundleName: 'bundleName', + bundleSource: 'QuerySnapshot' + }; + const deferred = new Deferred(); + const unsubscribe = onSnapshotResume(db, json, { + next: qs => { + expect(qs).to.not.exist; + deferred.resolve(); + }, + error: err => { + expect(err.name).to.exist; + expect(err.message).to.exist; + deferred.resolve(); + } + }); + await deferred.promise; + unsubscribe(); + }); + }); + + it('QuerySnapshot updated doc events in snapshot created by a bundle', async () => { + if (isNode()) { + const testDocs = { + a: { foo: 1 }, + b: { bar: 2 } + }; + await withTestCollection(persistence, testDocs, async (coll, db) => { + const querySnap = await getDocs(query(coll, orderBy(documentId()))); + const refForDocA = querySnap.docs[0].ref; + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshotResume( + db, + querySnap.toJSON(), + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal(testDocs.a); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }) + .then(() => setDoc(refForDocA, { foo: 0 })) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal({ foo: 0 }); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }); + unsubscribe(); + }); + } + }); + + it('QuerySnapshot updated doc events in snapshot created by fromJSON ', async () => { + if (isNode()) { + const testDocs = { + a: { foo: 1 }, + b: { bar: 2 } + }; + await withTestCollection(persistence, testDocs, async (coll, db) => { + const querySnap = await getDocs(query(coll, orderBy(documentId()))); + const querySnapFromJson = querySnapshotFromJSON(db, querySnap.toJSON()); + const refForDocA = querySnapFromJson.docs[0].ref; + const accumulator = new EventsAccumulator(); + + const unsubscribe = onSnapshotResume( + db, + querySnapFromJson.toJSON(), + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal(testDocs.a); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }) + .then(() => setDoc(refForDocA, { foo: 0 })) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal({ foo: 0 }); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }); + unsubscribe(); + }); + } + }); + + it('QuerySnapshot updated doc events in snapshot created by fromJSON query ref', async () => { + if (isNode()) { + const testDocs = { + a: { foo: 1 }, + b: { bar: 2 } + }; + await withTestCollection(persistence, testDocs, async (coll, db) => { + const querySnap = await getDocs(query(coll, orderBy(documentId()))); + const querySnapFromJson = querySnapshotFromJSON(db, querySnap.toJSON()); + const refForDocA = querySnapFromJson.docs[0].ref; + const accumulator = new EventsAccumulator(); + const unsubscribe = onSnapshot( + querySnapFromJson.query, + accumulator.storeEvent + ); + await accumulator + .awaitEvent() + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal(testDocs.a); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }) + .then(() => setDoc(refForDocA, { foo: 0 })) + .then(() => accumulator.awaitEvent()) + .then(snap => { + expect(snap.docs).not.to.be.null; + expect(snap.docs.length).to.equal(2); + expect(snap.docs[0].data()).to.deep.equal({ foo: 0 }); + expect(snap.docs[1].data()).to.deep.equal(testDocs.b); + }); + unsubscribe(); + }); + } + }); + it('Metadata only changes are not fired when no options provided', () => { return withTestDoc(persistence, docRef => { const secondUpdateFound = new Deferred(); diff --git a/packages/firestore/test/integration/api/query.test.ts b/packages/firestore/test/integration/api/query.test.ts index 0f3c1c82a2d..a12c843bf26 100644 --- a/packages/firestore/test/integration/api/query.test.ts +++ b/packages/firestore/test/integration/api/query.test.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { isNode } from '@firebase/util'; import { expect } from 'chai'; import { addEqualityMatcher } from '../../util/equality_matcher'; @@ -37,9 +38,11 @@ import { endAt, endBefore, GeoPoint, + getDocFromCache, getDocs, limit, limitToLast, + loadBundle, onSnapshot, or, orderBy, @@ -74,6 +77,47 @@ import { captureExistenceFilterMismatches } from '../util/testing_hooks_util'; apiDescribe('Queries', persistence => { addEqualityMatcher(); + it('QuerySnapshot.toJSON bundle getDocFromCache', async () => { + if (isNode()) { + let path: string | null = null; + let jsonBundle: object | null = null; + const testDocs = { + a: { k: 'a' }, + b: { k: 'b' }, + c: { k: 'c' } + }; + // Write an initial document in an isolated Firestore instance so it's not stored in the cache. + await withTestCollection(persistence, testDocs, async collection => { + await getDocs(query(collection)).then(querySnapshot => { + expect(querySnapshot.docs.length).to.equal(3); + // Find the path to a known doc. + querySnapshot.docs.forEach(docSnapshot => { + if (docSnapshot.ref.path.endsWith('a')) { + path = docSnapshot.ref.path; + } + }); + expect(path).to.not.be.null; + jsonBundle = querySnapshot.toJSON(); + }); + }); + expect(jsonBundle).to.not.be.null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = (jsonBundle as any).bundle; + expect(json).to.exist; + expect(json.length).to.be.greaterThan(0); + + if (path !== null) { + await withTestDb(persistence, async db => { + const docRef = doc(db, path!); + await loadBundle(db, json); + const docSnap = await getDocFromCache(docRef); + expect(docSnap.exists); + expect(docSnap.data()).to.deep.equal(testDocs.a); + }); + } + } + }); + it('can issue limit queries', () => { const testDocs = { a: { k: 'a' }, diff --git a/packages/firestore/test/lite/integration.test.ts b/packages/firestore/test/lite/integration.test.ts index 780db5f4f9c..7fb7eafcb1e 100644 --- a/packages/firestore/test/lite/integration.test.ts +++ b/packages/firestore/test/lite/integration.test.ts @@ -423,6 +423,20 @@ describe('getDoc()', () => { expect(docSnap.exists()).to.be.true; }); }); + + it('can get doc with a deserialized reference', () => { + return withTestDocAndInitialData({ val: 1 }, async docRef => { + const docSnap = await getDoc(docRef); + expect(docSnap.exists()).to.be.true; + const json = docRef.toJSON(); + const deserializedDocRef = DocumentReference.fromJSON( + docSnap._firestore, + json + ); + const docSnap2 = await getDoc(deserializedDocRef); + expect(docSnap2.exists()).to.be.true; + }); + }); }); /** diff --git a/packages/firestore/test/unit/api/bytes.test.ts b/packages/firestore/test/unit/api/bytes.test.ts index afc37400d8e..8fa8919b1e2 100644 --- a/packages/firestore/test/unit/api/bytes.test.ts +++ b/packages/firestore/test/unit/api/bytes.test.ts @@ -55,4 +55,52 @@ describe('Bytes', () => { expectEqual(blob(1, 2, 3), blob(1, 2, 3)); expectNotEqual(blob(1, 2, 3), blob(4, 5, 6)); }); + + it('fromJSON reconstructs the value from toJSON', () => { + const bytes = Bytes.fromUint8Array(new Uint8Array([0, 1, 2, 3, 4, 5])); + expect(() => { + Bytes.fromJSON(bytes.toJSON()); + }).to.not.throw; + expect(Bytes.fromJSON(bytes.toJSON()).isEqual(bytes)).to.be.true; + }); + + it('fromJSON parameter order does not matter', () => { + const type = 'firestore/bytes/1.0'; + const bytes = 'AA=='; + expect(() => { + Bytes.fromJSON({ bytes, type }); + }).to.not.throw; + expect(() => { + Bytes.fromJSON({ type, bytes }); + }).to.not.throw; + }); + + it('toJSON -> fromJSON bytes comparison', () => { + Object.keys(base64Mappings).forEach(base64Str => { + const bytesToSerialize = Bytes.fromBase64String(base64Str); + const deserializedBytes = Bytes.fromJSON(bytesToSerialize.toJSON()); + expectEqual(bytesToSerialize, deserializedBytes); + const expectedUint8Array = base64Mappings[base64Str]; + const actualUint8Array = deserializedBytes.toUint8Array(); + expect(actualUint8Array.length).to.equal(expectedUint8Array.length); + for (let i = 0; i < actualUint8Array.length; i++) { + expect(actualUint8Array[i]).to.equal(expectedUint8Array[i]); + } + }); + }); + + it('fromJSON misisng fields throws', () => { + expect(() => { + Bytes.fromJSON({ type: 'firestore/bytes/1.0' /* missing bytes data */ }); + }).to.throw; + expect(() => { + Bytes.fromJSON({ bytes: 'AA==' /* missing type */ }); + }).to.throw; + expect(() => { + Bytes.fromJSON({ type: 1, bytes: 'AA==' }); + }).to.throw; + expect(() => { + Bytes.fromJSON({ type: 'firestore/bytes/1.0', bytes: 1 }); + }).to.throw; + }); }); diff --git a/packages/firestore/test/unit/api/database.test.ts b/packages/firestore/test/unit/api/database.test.ts index 46e4c65f180..7f8ce10ffd7 100644 --- a/packages/firestore/test/unit/api/database.test.ts +++ b/packages/firestore/test/unit/api/database.test.ts @@ -15,10 +15,17 @@ * limitations under the License. */ +import { isNode } from '@firebase/util'; import { expect } from 'chai'; import { + DocumentReference, + DocumentSnapshot, + documentSnapshotFromJSON, + QuerySnapshot, + querySnapshotFromJSON, connectFirestoreEmulator, + loadBundle, refEqual, snapshotEqual, queryEqual @@ -29,12 +36,22 @@ import { collectionReference, documentReference, documentSnapshot, + firestore, newTestFirestore, query, querySnapshot } from '../../util/api_helpers'; import { keys } from '../../util/helpers'; +describe('Bundle', () => { + it('loadBundle does not throw with an empty bundle string)', async () => { + const db = newTestFirestore(); + expect(async () => { + await loadBundle(db, ''); + }).to.not.throw; + }); +}); + describe('CollectionReference', () => { it('support equality checking with isEqual()', () => { expect(refEqual(collectionReference('foo'), collectionReference('foo'))).to @@ -61,6 +78,151 @@ describe('DocumentReference', () => { it('JSON.stringify() does not throw', () => { JSON.stringify(documentReference('foo/bar')); }); + + it('toJSON() does not throw', () => { + expect(() => { + documentReference('foo/bar').toJSON(); + }).to.not.throw; + }); + + it('toJSON() includes correct JSON fields', () => { + const docRef = documentReference('foo/bar'); + const json = docRef.toJSON(); + expect(json).to.deep.equal({ + type: 'firestore/documentReference/1.0', + referencePath: 'foo/bar' + }); + }); + + it('fromJSON() throws with invalid data', () => { + const db = newTestFirestore(); + expect(() => { + DocumentReference.fromJSON(db, {}); + }).to.throw("JSON missing required field: 'type'"); + }); + + it('fromJSON() throws with missing type data', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + bundleSource: 'DocumentSnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'type'"); + }); + + it('fromJSON() throws with invalid type data', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: 1, + bundleSource: 'DocumentSnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON field 'type' must be a string"); + }); + + it('fromJSON() throws with missing bundleSource', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'bundleSource'"); + }); + + it('fromJSON() throws with invalid bundleSource type', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 1, + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON field 'bundleSource' must be a string"); + }); + + it('fromJSON() throws with invalid bundleSource value', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 'QuerySnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("Expected 'bundleSource' field to equal 'DocumentSnapshot'"); + }); + + it('fromJSON() throws with missing bundleName', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 'DocumentSnapshot', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'bundleName'"); + }); + + it('fromJSON() throws with invalid bundleName', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 'DocumentSnapshot', + bundleName: 1, + bundle: 'test bundle' + }); + }).to.throw("JSON field 'bundleName' must be a string"); + }); + + it('fromJSON() throws with missing bundle', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 'DocumentSnapshot', + bundleName: 'test name' + }); + }).to.throw("JSON missing required field: 'bundle'"); + }); + + it('fromJSON() throws with invalid bundle', () => { + const db = newTestFirestore(); + expect(() => { + documentSnapshotFromJSON(db, { + type: DocumentSnapshot._jsonSchemaVersion, + bundleSource: 'DocumentSnapshot', + bundleName: 'test name', + bundle: 1 + }); + }).to.throw("JSON field 'bundle' must be a string"); + }); + + it('fromJSON() does not throw', () => { + const db = newTestFirestore(); + const docRef = documentReference('foo/bar'); + const json = docRef.toJSON(); + expect(() => { + DocumentReference.fromJSON(db, json); + }).to.not.throw; + }); + + it('fromJSON() equals original docRef', () => { + const db = newTestFirestore(); + const docRef = documentReference('foo/bar'); + const json = docRef.toJSON(); + const deserializedDocRef = DocumentReference.fromJSON(db, json); + expect(docRef.id).to.equal(deserializedDocRef.id); + expect(docRef.path).to.equal(deserializedDocRef.path); + expect(docRef.toJSON()).to.deep.equal(deserializedDocRef.toJSON()); + }); }); describe('DocumentSnapshot', () => { @@ -107,6 +269,108 @@ describe('DocumentSnapshot', () => { it('JSON.stringify() does not throw', () => { JSON.stringify(documentSnapshot('foo/bar', { a: 1 }, true)); }); + + it('toJSON returns a bundle', () => { + const snapshotJson = documentSnapshot( + 'foo/bar', + { a: 1 }, + /*fromCache=*/ true + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle.length).to.be.greaterThan(0); + }); + + it('toJSON returns a bundle containing NOT_SUPPORTED in non-node environments', () => { + if (!isNode()) { + const snapshotJson = documentSnapshot( + 'foo/bar', + { a: 1 }, + /*fromCache=*/ true + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle).to.equal('NOT SUPPORTED'); + } + }); + + it('toJSON returns an empty bundle when there are no documents', () => { + if (isNode()) { + const snapshotJson = documentSnapshot( + 'foo/bar', + /*data=*/ null, + /*fromCache=*/ true + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle.length).to.equal(0); + } + }); + + it('toJSON throws when there are pending writes', () => { + expect(() => { + documentSnapshot( + 'foo/bar', + {}, + /*fromCache=*/ true, + /*hasPendingWrites=*/ true + ).toJSON(); + }).to.throw( + `DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. ` + + `Await waitForPendingWrites() before invoking toJSON().` + ); + }); + + it('fromJSON throws when parsing client-side toJSON result', () => { + if (!isNode()) { + const docSnap = documentSnapshot( + 'foo/bar', + { a: 1 }, + /*fromCache=*/ true + ); + expect(() => { + documentSnapshotFromJSON(docSnap._firestore, docSnap.toJSON()); + }).to.throw; + } + }); + + it('fromJSON parses toJSON result', () => { + if (isNode()) { + const docSnap = documentSnapshot( + 'foo/bar', + { a: 1 }, + /*fromCache=*/ true + ); + expect(() => { + documentSnapshotFromJSON(docSnap._firestore, docSnap.toJSON()); + }).to.not.throw; + } + }); + + it('fromJSON produces valid snapshot data.', () => { + if (isNode()) { + const docSnap = documentSnapshot( + 'foo/bar', + { a: 1 }, + /*fromCache=*/ true + ); + const db = firestore(); + const docSnapFromJSON = documentSnapshotFromJSON(db, docSnap.toJSON()); + expect(docSnapFromJSON).to.exist; + const data = docSnapFromJSON.data(); + expect(docSnapFromJSON).to.not.be.undefined; + expect(docSnapFromJSON).to.not.be.null; + if (data) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect((data as any).a).to.exist; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect((data as any).a).to.equal(1); + } + } + }); }); describe('Query', () => { @@ -229,6 +493,259 @@ describe('QuerySnapshot', () => { querySnapshot('foo', {}, { a: { a: 1 } }, keys(), false, false) ); }); + + it('toJSON returns a bundle', () => { + const snapshotJson = querySnapshot( + 'foo', + {}, + { a: { a: 1 } }, + keys(), // An empty set of mutaded document keys signifies that there are no pending writes. + false, + false + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle.length).to.be.greaterThan(0); + }); + + it('toJSON returns a bundle containing NOT_SUPPORTED in non-node environments', () => { + if (!isNode()) { + const snapshotJson = querySnapshot( + 'foo', + {}, + { a: { a: 1 } }, + keys(), // An empty set of mutaded document keys signifies that there are no pending writes. + false, + false + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle).to.equal('NOT SUPPORTED'); + } + }); + + it('toJSON returns a bundle when there are no documents', () => { + if (isNode()) { + const snapshotJson = querySnapshot( + 'foo', + {}, + {}, + keys(), + false, + false + ).toJSON(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const json = snapshotJson as any; + expect(json.bundle).to.exist; + expect(json.bundle.length).to.be.greaterThan(0); + } + }); + + it('toJSON throws when there are pending writes', () => { + expect(() => + querySnapshot( + 'foo', + {}, + { a: { a: 1 } }, + keys('foo/a'), // A non empty set of mutated keys signifies pending writes. + false, + false + ).toJSON() + ).to.throw( + `QuerySnapshot.toJSON() attempted to serialize a document with pending writes. ` + + `Await waitForPendingWrites() before invoking toJSON().` + ); + }); + + it('fromJSON() throws with invalid data', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, {}); + }).to.throw("JSON missing required field: 'type'"); + }); + + it('fromJSON() throws with missing type data', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + bundleSource: 'QuerySnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'type'"); + }); + + it('fromJSON() throws with invalid type data', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: 1, + bundleSource: 'QuerySnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON field 'type' must be a string"); + }); + + it('fromJSON() throws with missing bundle source data', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'bundleSource'"); + }); + + it('fromJSON() throws with invalid bundleSource type', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 1, + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("JSON field 'bundleSource' must be a string"); + }); + + it('fromJSON() throws with invalid bundleSource value', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 'DocumentSnapshot', + bundleName: 'test name', + bundle: 'test bundle' + }); + }).to.throw("Expected 'bundleSource' field to equal 'QuerySnapshot'"); + }); + + it('fromJSON() throws with missing bundleName', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 'QuerySnapshot', + bundle: 'test bundle' + }); + }).to.throw("JSON missing required field: 'bundleName'"); + }); + + it('fromJSON() throws with invalid bundleName', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 'QuerySnapshot', + bundleName: 1, + bundle: 'test bundle' + }); + }).to.throw("JSON field 'bundleName' must be a string"); + }); + + it('fromJSON() throws with missing bundle field', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 'QuerySnapshot', + bundleName: 'test name' + }); + }).to.throw("JSON missing required field: 'bundle'"); + }); + + it('fromJSON() throws with invalid bundle field', () => { + const db = newTestFirestore(); + expect(() => { + querySnapshotFromJSON(db, { + type: QuerySnapshot._jsonSchemaVersion, + bundleSource: 'QuerySnapshot', + bundleName: 'test name', + bundle: 1 + }); + }).to.throw("JSON field 'bundle' must be a string"); + }); + + it('fromJSON does not throw', () => { + if (isNode()) { + const snapshot = querySnapshot( + 'foo', + {}, + { + a: { a: 1 }, + b: { bar: 2 } + }, + keys(), // An empty set of mutaded document keys signifies that there are no pending writes. + false, + false + ); + const db = firestore(); + expect(() => { + querySnapshotFromJSON(db, snapshot.toJSON()); + }).to.not.throw; + } + }); + + it('fromJSON produces valid snapshot data', () => { + if (isNode()) { + const snapshot = querySnapshot( + 'foo', + {}, + { + a: { a: 1 }, + b: { bar: 2 } + }, + keys(), // An empty set of mutaded document keys signifies that there are no pending writes. + false, + false + ); + const db = firestore(); + const querySnap = querySnapshotFromJSON(db, snapshot.toJSON()); + expect(querySnap).to.exist; + if (querySnap !== undefined) { + const docs = querySnap.docs; + expect(docs).to.not.be.undefined; + expect(docs).to.not.be.null; + if (docs) { + expect(docs.length).to.equal(2); + if (docs.length === 2) { + let docData = docs[0].data(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let data = docData as any; + expect(data.a).to.exist; + expect(data.a).to.equal(1); + + docData = docs[1].data(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data = docData as any; + expect(data.bar).to.exist; + expect(data.bar).to.equal(2); + } + } + } + } + }); + + it('fromJSON throws when parsing client-side toJSON result', () => { + if (!isNode()) { + const querySnap = querySnapshot( + 'foo', + {}, + { a: { a: 1 } }, + keys(), // An empty set of mutaded document keys signifies that there are no pending writes. + false, + false + ); + const json = querySnap.toJSON(); + expect(() => { + querySnapshotFromJSON(querySnap._firestore, json); + }).to.throw; + } + }); }); describe('SnapshotMetadata', () => { diff --git a/packages/firestore/test/unit/api/geo_point.test.ts b/packages/firestore/test/unit/api/geo_point.test.ts index f2cdb4c27f5..dc744ceb63f 100644 --- a/packages/firestore/test/unit/api/geo_point.test.ts +++ b/packages/firestore/test/unit/api/geo_point.test.ts @@ -105,15 +105,96 @@ describe('GeoPoint', () => { it('serializes to JSON', () => { expect(new GeoPoint(1, 2).toJSON()).to.deep.equal({ latitude: 1, - longitude: 2 + longitude: 2, + 'type': GeoPoint._jsonSchemaVersion }); expect(new GeoPoint(0, 0).toJSON()).to.deep.equal({ latitude: 0, - longitude: 0 + longitude: 0, + 'type': GeoPoint._jsonSchemaVersion }); expect(new GeoPoint(90, 180).toJSON()).to.deep.equal({ latitude: 90, - longitude: 180 + longitude: 180, + 'type': GeoPoint._jsonSchemaVersion }); }); + it('fromJSON does not throw', () => { + const geoPoint = new GeoPoint(1, 2); + expect(() => { + GeoPoint.fromJSON(geoPoint.toJSON()); + }).to.not.throw; + }); + + it('fromJSON reconstructs seconds and nanoseconds', () => { + const geoPoint = new GeoPoint(1, 2); + const deserializedGeoPoint = GeoPoint.fromJSON(geoPoint.toJSON()); + expect(deserializedGeoPoint).to.exist; + expect(geoPoint.latitude).to.equal(deserializedGeoPoint.latitude); + expect(geoPoint.longitude).to.equal(deserializedGeoPoint.longitude); + }); + + it('toJSON -> fromJSON timestamp comparison', () => { + const geoPoint = new GeoPoint(1, 2); + const deserializedGeoPoint = GeoPoint.fromJSON(geoPoint.toJSON()); + expect(deserializedGeoPoint.isEqual(geoPoint)).to.be.true; + }); + + it('fromJSON parameter order does not matter', () => { + const type = 'firestore/geopoint/1.0'; + const latitude = 90; + const longitude = 180; + const control = new GeoPoint(90, 180); + expect(() => { + expect(GeoPoint.fromJSON({ latitude, longitude, type }).isEqual(control)) + .to.be.true; + }).to.not.throw; + expect(() => { + expect(GeoPoint.fromJSON({ longitude, type, latitude }).isEqual(control)) + .to.be.true; + }).to.not.throw; + expect(() => { + expect(GeoPoint.fromJSON({ type, latitude, longitude }).isEqual(control)) + .to.be.true; + }).to.not.throw; + expect(() => { + expect(GeoPoint.fromJSON({ latitude, type, longitude }).isEqual(control)) + .to.be.true; + }).to.not.throw; + }); + + it('fromJSON missing fields throws', () => { + const type = 'firestore/geopoint/1.0'; + const latitude = 90; + const longitude = 180; + + expect(() => { + GeoPoint.fromJSON({ type, latitude }); + }).to.throw; + expect(() => { + GeoPoint.fromJSON({ type, longitude }); + }).to.throw; + expect(() => { + GeoPoint.fromJSON({ latitude, longitude }); + }).to.throw; + }); + + it('fromJSON field errant field type throws', () => { + const type = 'firestore/geopoint/1.0'; + const latitude = 90; + const longitude = 180; + + expect(() => { + GeoPoint.fromJSON({ type, latitude, longitude: 'wrong' }); + }).to.throw; + expect(() => { + GeoPoint.fromJSON({ type, longitude, latitude: 'wrong' }); + }).to.throw; + expect(() => { + GeoPoint.fromJSON({ latitude, longitude, type: 1 }); + }).to.throw; + expect(() => { + GeoPoint.fromJSON({ latitude, longitude, type: 'firestore/wrong/1.0' }); + }).to.throw; + }); }); diff --git a/packages/firestore/test/unit/api/timestamp.test.ts b/packages/firestore/test/unit/api/timestamp.test.ts index ef883f33a92..81773520698 100644 --- a/packages/firestore/test/unit/api/timestamp.test.ts +++ b/packages/firestore/test/unit/api/timestamp.test.ts @@ -143,15 +143,101 @@ describe('Timestamp', () => { it('serializes to JSON', () => { expect(new Timestamp(123, 456).toJSON()).to.deep.equal({ seconds: 123, - nanoseconds: 456 + nanoseconds: 456, + type: 'firestore/timestamp/1.0' }); expect(new Timestamp(0, 0).toJSON()).to.deep.equal({ seconds: 0, - nanoseconds: 0 + nanoseconds: 0, + type: 'firestore/timestamp/1.0' }); expect(new Timestamp(-123, 456).toJSON()).to.deep.equal({ seconds: -123, - nanoseconds: 456 + nanoseconds: 456, + type: 'firestore/timestamp/1.0' }); }); + + it('fromJSON does not throw', () => { + const timestamp = new Timestamp(123, 456); + expect(() => { + Timestamp.fromJSON(timestamp.toJSON()); + }).to.not.throw; + }); + + it('fromJSON reconstructs seconds and nanoseconds', () => { + const timestamp = new Timestamp(123, 456); + const deserializedTimestamp = Timestamp.fromJSON(timestamp.toJSON()); + expect(deserializedTimestamp).to.exist; + expect(timestamp.nanoseconds).to.equal(deserializedTimestamp.nanoseconds); + expect(timestamp.seconds).to.equal(deserializedTimestamp.seconds); + }); + + it('toJSON -> fromJSON timestamp comparison', () => { + const timestamp = new Timestamp(123, 456); + const deserializedTimestamp = Timestamp.fromJSON(timestamp.toJSON()); + expect(deserializedTimestamp.isEqual(timestamp)).to.be.true; + }); + + it('fromJSON parameter order does not matter', () => { + const type = 'firestore/timestamp/1.0'; + const seconds = 123; + const nanoseconds = 456; + const control = new Timestamp(seconds, nanoseconds); + expect(() => { + expect( + Timestamp.fromJSON({ seconds, nanoseconds, type }).isEqual(control) + ).to.be.true; + }).to.not.throw; + expect(() => { + expect( + Timestamp.fromJSON({ nanoseconds, type, seconds }).isEqual(control) + ).to.be.true; + }).to.not.throw; + expect(() => { + expect( + Timestamp.fromJSON({ type, seconds, nanoseconds }).isEqual(control) + ).to.be.true; + }).to.not.throw; + expect(() => { + expect( + Timestamp.fromJSON({ seconds, type, nanoseconds }).isEqual(control) + ).to.be.true; + }).to.not.throw; + }); + + it('fromJSON missing fields throws', () => { + const type = 'firestore/timestamp/1.0'; + const seconds = 123; + const nanoseconds = 456; + + expect(() => { + Timestamp.fromJSON({ type, seconds }); + }).to.throw; + expect(() => { + Timestamp.fromJSON({ type, nanoseconds }); + }).to.throw; + expect(() => { + Timestamp.fromJSON({ seconds, nanoseconds }); + }).to.throw; + }); + + it('fromJSON field errant field type throws', () => { + const type = 'firestore/timestamp/1.0'; + const seconds = 123; + const nanoseconds = 456; + + expect(() => { + Timestamp.fromJSON({ type, seconds, nanoseconds: 'wrong' }); + }).to.throw; + expect(() => { + Timestamp.fromJSON({ type, nanoseconds, seconds: 'wrong' }); + }).to.throw; + expect(() => { + Timestamp.fromJSON({ seconds, nanoseconds, type: 1 }); + }).to.throw; + expect(() => { + Timestamp.fromJSON({ seconds, nanoseconds, type: 'firestore/wrong/1.0' }); + }).to.throw; + }); }); diff --git a/packages/firestore/test/unit/api/vector_value.test.ts b/packages/firestore/test/unit/api/vector_value.test.ts new file mode 100644 index 00000000000..c0944a64934 --- /dev/null +++ b/packages/firestore/test/unit/api/vector_value.test.ts @@ -0,0 +1,73 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; + +import { VectorValue } from '../../../src'; + +describe('VectorValue', () => { + it('fromJSON reconstructs the value from toJSON', () => { + const num: number[] = [1, 2, 3]; + const vectorValue = new VectorValue(num); + const json = vectorValue.toJSON(); + const parsedVectorValue = VectorValue.fromJSON(json); + expect(vectorValue.isEqual(parsedVectorValue)).to.be.true; + }); + + it('fromJSON parameter order does not matter', () => { + const type = VectorValue._jsonSchemaVersion; + const vectorValues = [1, 2, 3]; + const control = new VectorValue(vectorValues); + + expect(() => { + expect(VectorValue.fromJSON({ vectorValues, type }).isEqual(control)).to + .be.true; + }).to.not.throw; + expect(() => { + expect(VectorValue.fromJSON({ type, vectorValues }).isEqual(control)).to + .be.true; + }).to.not.throw; + }); + + it('fromJSON empty array does not throw', () => { + const type = VectorValue._jsonSchemaVersion; + const vectorValues = [1, 2, 3]; + expect(() => { + VectorValue.fromJSON({ type, vectorValues }); + }).to.not.throw; + }); + + it('fromJSON missing fields throws', () => { + const type = VectorValue._jsonSchemaVersion; + const vectorValues = [1, 2, 3]; + expect(() => { + VectorValue.fromJSON({ type /* missing data */ }); + }).to.throw; + expect(() => { + VectorValue.fromJSON({ vectorValues /* missing type */ }); + }).to.throw; + expect(() => { + VectorValue.fromJSON({ type: 1, vectorValues }); + }).to.throw; + expect(() => { + VectorValue.fromJSON({ type: 'firestore/bytes/1.0', vectorValues }); + }).to.throw; + expect(() => { + VectorValue.fromJSON({ type, vectorValues: 'not a number' }); + }); + }); +}); diff --git a/packages/firestore/test/unit/local/indexeddb_persistence.test.ts b/packages/firestore/test/unit/local/indexeddb_persistence.test.ts index 1240c977cee..9fa872101b1 100644 --- a/packages/firestore/test/unit/local/indexeddb_persistence.test.ts +++ b/packages/firestore/test/unit/local/indexeddb_persistence.test.ts @@ -316,10 +316,14 @@ describe('IndexedDbSchema: createOrUpgradeDb', () => { lastRemoteSnapshotVersion: { seconds: 1, nanoseconds: 1 }, targetCount: 1 }; + const timestamp = SnapshotVersion.min().toTimestamp(); const resetTargetGlobal: DbTargetGlobal = { highestTargetId: 0, highestListenSequenceNumber: 0, - lastRemoteSnapshotVersion: SnapshotVersion.min().toTimestamp(), + lastRemoteSnapshotVersion: { + seconds: timestamp.seconds, + nanoseconds: timestamp.nanoseconds + }, targetCount: 0 }; diff --git a/packages/firestore/test/util/api_helpers.ts b/packages/firestore/test/util/api_helpers.ts index 762b5258a29..d248c9213b5 100644 --- a/packages/firestore/test/util/api_helpers.ts +++ b/packages/firestore/test/util/api_helpers.ts @@ -79,8 +79,10 @@ export function documentReference(path: string): DocumentReference { export function documentSnapshot( path: string, data: JsonObject | null, - fromCache: boolean + fromCache: boolean, + hasPendingWrites?: boolean ): DocumentSnapshot { + hasPendingWrites = !!hasPendingWrites; const db = firestore(); const userDataWriter = new ExpUserDataWriter(db); if (data) { @@ -89,7 +91,7 @@ export function documentSnapshot( userDataWriter, key(path), doc(path, 1, data), - new SnapshotMetadata(/* hasPendingWrites= */ false, fromCache), + new SnapshotMetadata(hasPendingWrites, fromCache), /* converter= */ null ); } else { @@ -98,7 +100,7 @@ export function documentSnapshot( userDataWriter, key(path), null, - new SnapshotMetadata(/* hasPendingWrites= */ false, fromCache), + new SnapshotMetadata(hasPendingWrites, fromCache), /* converter= */ null ); } From 86155b3c8f3974f8d777232625108c14f924e035 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Mon, 23 Jun 2025 16:29:30 -0400 Subject: [PATCH 229/295] chore(Firestore) add changeset for PR #8926 (#9115) Add the missing changset for PR #8926. --- .changeset/moody-comics-speak.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/moody-comics-speak.md diff --git a/.changeset/moody-comics-speak.md b/.changeset/moody-comics-speak.md new file mode 100644 index 00000000000..9a178a6605b --- /dev/null +++ b/.changeset/moody-comics-speak.md @@ -0,0 +1,8 @@ +--- +'@firebase/firestore': minor +'firebase': minor +--- + +Added support for Firestore result types to be serialized with `toJSON` and then deserialized with `fromJSON` methods on the objects. + +Addeed support to resume `onSnapshot` listeners in the CSR phase based on serialized `DataSnapshot`s and `QuerySnapshot`s built in the SSR phase. From 3d44792f14f3df265162d06e2acdf3cad0c2ef86 Mon Sep 17 00:00:00 2001 From: Raymond Lam Date: Thu, 26 Jun 2025 10:19:40 -0700 Subject: [PATCH 230/295] Update Fireperf logging to use sendBeacon only if the payload is under the 64KB limit (#9120) * Update Fireperf logging to use sendBeacon only if the payload is under the 64KB limit for most browsers. - For the flush, attempt to use sendBeacon with a low number of events incase sendBeacon is also used by other libraries. * Add changeset and fix format * Add additional comments * Put max flush size behind remote config flag --- .changeset/nervous-needles-sit.md | 5 + .../services/remote_config_service.test.ts | 7 +- .../src/services/remote_config_service.ts | 10 ++ .../src/services/settings_service.ts | 4 + .../src/services/transport_service.test.ts | 152 +++++++++++++++++- .../src/services/transport_service.ts | 96 +++++++---- 6 files changed, 243 insertions(+), 31 deletions(-) create mode 100644 .changeset/nervous-needles-sit.md diff --git a/.changeset/nervous-needles-sit.md b/.changeset/nervous-needles-sit.md new file mode 100644 index 00000000000..77594e263b0 --- /dev/null +++ b/.changeset/nervous-needles-sit.md @@ -0,0 +1,5 @@ +--- +'@firebase/performance': patch +--- + +Fix bug where events are not sent if they exceed sendBeacon payload limit diff --git a/packages/performance/src/services/remote_config_service.test.ts b/packages/performance/src/services/remote_config_service.test.ts index 78f1b1b4462..49b8893140f 100644 --- a/packages/performance/src/services/remote_config_service.test.ts +++ b/packages/performance/src/services/remote_config_service.test.ts @@ -40,7 +40,8 @@ describe('Performance Monitoring > remote_config_service', () => { "fpr_log_endpoint_url":"https://firebaselogging.test.com",\ "fpr_log_transport_key":"pseudo-transport-key",\ "fpr_log_source":"2","fpr_vc_network_request_sampling_rate":"0.250000",\ - "fpr_vc_session_sampling_rate":"0.250000","fpr_vc_trace_sampling_rate":"0.500000"},\ + "fpr_vc_session_sampling_rate":"0.250000","fpr_vc_trace_sampling_rate":"0.500000", + "fpr_log_max_flush_size":"10"},\ "state":"UPDATE"}`; const PROJECT_ID = 'project1'; const APP_ID = '1:23r:web:fewq'; @@ -80,6 +81,7 @@ describe('Performance Monitoring > remote_config_service', () => { settingsService.loggingEnabled = false; settingsService.networkRequestsSamplingRate = 1; settingsService.tracesSamplingRate = 1; + settingsService.logMaxFlushSize = 40; } // parameterized beforeEach. Should be called at beginning of each test. @@ -150,6 +152,7 @@ describe('Performance Monitoring > remote_config_service', () => { expect(SettingsService.getInstance().tracesSamplingRate).to.equal( TRACE_SAMPLING_RATE ); + expect(SettingsService.getInstance().logMaxFlushSize).to.equal(10); }); it('does not call remote config if a valid config is in local storage', async () => { @@ -190,6 +193,7 @@ describe('Performance Monitoring > remote_config_service', () => { expect(SettingsService.getInstance().tracesSamplingRate).to.equal( TRACE_SAMPLING_RATE ); + expect(SettingsService.getInstance().logMaxFlushSize).to.equal(10); }); it('does not change the default config if call to RC fails', async () => { @@ -207,6 +211,7 @@ describe('Performance Monitoring > remote_config_service', () => { await getConfig(performanceController, IID); expect(SettingsService.getInstance().loggingEnabled).to.equal(false); + expect(SettingsService.getInstance().logMaxFlushSize).to.equal(40); }); it('uses secondary configs if the response does not have all the fields', async () => { diff --git a/packages/performance/src/services/remote_config_service.ts b/packages/performance/src/services/remote_config_service.ts index 13787e2b693..1641b3b953b 100644 --- a/packages/performance/src/services/remote_config_service.ts +++ b/packages/performance/src/services/remote_config_service.ts @@ -38,6 +38,7 @@ interface SecondaryConfig { transportKey?: string; tracesSamplingRate?: number; networkRequestsSamplingRate?: number; + logMaxFlushSize?: number; } // These values will be used if the remote config object is successfully @@ -56,6 +57,7 @@ interface RemoteConfigTemplate { fpr_vc_network_request_sampling_rate?: string; fpr_vc_trace_sampling_rate?: string; fpr_vc_session_sampling_rate?: string; + fpr_log_max_flush_size?: string; } /* eslint-enable camelcase */ @@ -221,6 +223,14 @@ function processConfig( settingsServiceInstance.tracesSamplingRate = DEFAULT_CONFIGS.tracesSamplingRate; } + + if (entries.fpr_log_max_flush_size) { + settingsServiceInstance.logMaxFlushSize = Number( + entries.fpr_log_max_flush_size + ); + } else if (DEFAULT_CONFIGS.logMaxFlushSize) { + settingsServiceInstance.logMaxFlushSize = DEFAULT_CONFIGS.logMaxFlushSize; + } // Set the per session trace and network logging flags. settingsServiceInstance.logTraceAfterSampling = shouldLogAfterSampling( settingsServiceInstance.tracesSamplingRate diff --git a/packages/performance/src/services/settings_service.ts b/packages/performance/src/services/settings_service.ts index 83e08bd53d5..dbaed32a537 100644 --- a/packages/performance/src/services/settings_service.ts +++ b/packages/performance/src/services/settings_service.ts @@ -54,6 +54,10 @@ export class SettingsService { // TTL of config retrieved from remote config in hours. configTimeToLive = 12; + // The max number of events to send during a flush. This number is kept low to since Chrome has a + // shared payload limit for all sendBeacon calls in the same nav context. + logMaxFlushSize = 40; + getFlTransportFullUrl(): string { return this.flTransportEndpointUrl.concat('?key=', this.transportKey); } diff --git a/packages/performance/src/services/transport_service.test.ts b/packages/performance/src/services/transport_service.test.ts index 124ce1f415b..4f46205958d 100644 --- a/packages/performance/src/services/transport_service.test.ts +++ b/packages/performance/src/services/transport_service.test.ts @@ -21,7 +21,8 @@ import sinonChai from 'sinon-chai'; import { transportHandler, setupTransportService, - resetTransportService + resetTransportService, + flushQueuedEvents } from './transport_service'; import { SettingsService } from './settings_service'; @@ -88,14 +89,15 @@ describe('Firebase Performance > transport_service', () => { expect(fetchStub).to.not.have.been.called; }); - it('sends up to the maximum event limit in one request', async () => { + it('sends up to the maximum event limit in one request if payload is under 64 KB', async () => { // Arrange const setting = SettingsService.getInstance(); const flTransportFullUrl = setting.flTransportEndpointUrl + '?key=' + setting.transportKey; // Act - // Generate 1020 events, which should be dispatched in two batches (1000 events and 20 events). + // Generate 1020 events with small payloads, which should be dispatched in two batches + // (1000 events and 20 events). for (let i = 0; i < 1020; i++) { testTransportHandler('event' + i); } @@ -134,6 +136,58 @@ describe('Firebase Performance > transport_service', () => { expect(fetchStub).to.not.have.been.called; }); + it('sends fetch if payload is above 64 KB', async () => { + // Arrange + const setting = SettingsService.getInstance(); + const flTransportFullUrl = + setting.flTransportEndpointUrl + '?key=' + setting.transportKey; + fetchStub.resolves( + new Response('{}', { + status: 200, + headers: { 'Content-type': 'application/json' } + }) + ); + + // Act + // Generate 1020 events with a large payload. The total size of the payload will be > 65 KB + const payload = 'a'.repeat(300); + for (let i = 0; i < 1020; i++) { + testTransportHandler(payload + i); + } + // Wait for first and second event dispatch to happen. + clock.tick(INITIAL_SEND_TIME_DELAY_MS); + // This is to resolve the floating promise chain in transport service. + await Promise.resolve().then().then().then(); + clock.tick(DEFAULT_SEND_INTERVAL_MS); + + // Assert + // Expects the first logRequest which contains first 1000 events. + const firstLogRequest = generateLogRequest('5501'); + for (let i = 0; i < MAX_EVENT_COUNT_PER_REQUEST; i++) { + firstLogRequest['log_event'].push({ + 'source_extension_json_proto3': payload + i, + 'event_time_ms': '1' + }); + } + expect(fetchStub).calledWith(flTransportFullUrl, { + method: 'POST', + body: JSON.stringify(firstLogRequest) + }); + // Expects the second logRequest which contains remaining 20 events; + const secondLogRequest = generateLogRequest('15501'); + for (let i = 0; i < 20; i++) { + secondLogRequest['log_event'].push({ + 'source_extension_json_proto3': + payload + (MAX_EVENT_COUNT_PER_REQUEST + i), + 'event_time_ms': '1' + }); + } + expect(sendBeaconStub).calledWith( + flTransportFullUrl, + JSON.stringify(secondLogRequest) + ); + }); + it('falls back to fetch if sendBeacon fails.', async () => { sendBeaconStub.returns(false); fetchStub.resolves( @@ -147,6 +201,98 @@ describe('Firebase Performance > transport_service', () => { expect(fetchStub).to.have.been.calledOnce; }); + it('flushes the queue with multiple sendBeacons in batches of 40', async () => { + // Arrange + const setting = SettingsService.getInstance(); + const flTransportFullUrl = + setting.flTransportEndpointUrl + '?key=' + setting.transportKey; + fetchStub.resolves( + new Response('{}', { + status: 200, + headers: { 'Content-type': 'application/json' } + }) + ); + + const payload = 'a'.repeat(300); + // Act + // Generate 80 events + for (let i = 0; i < 80; i++) { + testTransportHandler(payload + i); + } + + flushQueuedEvents(); + + // Assert + const firstLogRequest = generateLogRequest('1'); + const secondLogRequest = generateLogRequest('1'); + for (let i = 0; i < 40; i++) { + firstLogRequest['log_event'].push({ + 'source_extension_json_proto3': payload + (i + 40), + 'event_time_ms': '1' + }); + secondLogRequest['log_event'].push({ + 'source_extension_json_proto3': payload + i, + 'event_time_ms': '1' + }); + } + expect(sendBeaconStub).calledWith( + flTransportFullUrl, + JSON.stringify(firstLogRequest) + ); + expect(sendBeaconStub).calledWith( + flTransportFullUrl, + JSON.stringify(secondLogRequest) + ); + expect(fetchStub).to.not.have.been.called; + }); + + it('flushes the queue with fetch for sendBeacons that failed', async () => { + // Arrange + const setting = SettingsService.getInstance(); + const flTransportFullUrl = + setting.flTransportEndpointUrl + '?key=' + setting.transportKey; + fetchStub.resolves( + new Response('{}', { + status: 200, + headers: { 'Content-type': 'application/json' } + }) + ); + + const payload = 'a'.repeat(300); + // Act + // Generate 80 events + for (let i = 0; i < 80; i++) { + testTransportHandler(payload + i); + } + sendBeaconStub.onCall(0).returns(true); + sendBeaconStub.onCall(1).returns(false); + flushQueuedEvents(); + + // Assert + const firstLogRequest = generateLogRequest('1'); + const secondLogRequest = generateLogRequest('1'); + for (let i = 40; i < 80; i++) { + firstLogRequest['log_event'].push({ + 'source_extension_json_proto3': payload + i, + 'event_time_ms': '1' + }); + } + for (let i = 0; i < 40; i++) { + secondLogRequest['log_event'].push({ + 'source_extension_json_proto3': payload + i, + 'event_time_ms': '1' + }); + } + expect(sendBeaconStub).calledWith( + flTransportFullUrl, + JSON.stringify(firstLogRequest) + ); + expect(fetchStub).calledWith(flTransportFullUrl, { + method: 'POST', + body: JSON.stringify(secondLogRequest) + }); + }); + function generateLogRequest(requestTimeMs: string): any { return { 'request_time_ms': requestTimeMs, diff --git a/packages/performance/src/services/transport_service.ts b/packages/performance/src/services/transport_service.ts index 8577fd3a128..46c9930210a 100644 --- a/packages/performance/src/services/transport_service.ts +++ b/packages/performance/src/services/transport_service.ts @@ -24,6 +24,11 @@ const INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000; const MAX_EVENT_COUNT_PER_REQUEST = 1000; const DEFAULT_REMAINING_TRIES = 3; +// Most browsers have a max payload of 64KB for sendbeacon/keep alive payload. +const MAX_SEND_BEACON_PAYLOAD_SIZE = 65536; + +const TEXT_ENCODER = new TextEncoder(); + let remainingTries = DEFAULT_REMAINING_TRIES; interface BatchEvent { @@ -90,14 +95,31 @@ function dispatchQueueEvents(): void { // for next attempt. const staged = queue.splice(0, MAX_EVENT_COUNT_PER_REQUEST); + const data = buildPayload(staged); + + postToFlEndpoint(data) + .then(() => { + remainingTries = DEFAULT_REMAINING_TRIES; + }) + .catch(() => { + // If the request fails for some reason, add the events that were attempted + // back to the primary queue to retry later. + queue = [...staged, ...queue]; + remainingTries--; + consoleLogger.info(`Tries left: ${remainingTries}.`); + processQueue(DEFAULT_SEND_INTERVAL_MS); + }); +} + +function buildPayload(events: BatchEvent[]): string { /* eslint-disable camelcase */ // We will pass the JSON serialized event to the backend. - const log_event: Log[] = staged.map(evt => ({ + const log_event: Log[] = events.map(evt => ({ source_extension_json_proto3: evt.message, event_time_ms: String(evt.eventTime) })); - const data: TransportBatchLogFormat = { + const transportBatchLog: TransportBatchLogFormat = { request_time_ms: String(Date.now()), client_info: { client_type: 1, // 1 is JS @@ -108,32 +130,27 @@ function dispatchQueueEvents(): void { }; /* eslint-enable camelcase */ - postToFlEndpoint(data) - .then(() => { - remainingTries = DEFAULT_REMAINING_TRIES; - }) - .catch(() => { - // If the request fails for some reason, add the events that were attempted - // back to the primary queue to retry later. - queue = [...staged, ...queue]; - remainingTries--; - consoleLogger.info(`Tries left: ${remainingTries}.`); - processQueue(DEFAULT_SEND_INTERVAL_MS); - }); + return JSON.stringify(transportBatchLog); } -function postToFlEndpoint(data: TransportBatchLogFormat): Promise { +/** Sends to Firelog. Atempts to use sendBeacon otherwsise uses fetch. */ +function postToFlEndpoint(body: string): Promise { const flTransportFullUrl = SettingsService.getInstance().getFlTransportFullUrl(); - const body = JSON.stringify(data); - - return navigator.sendBeacon && navigator.sendBeacon(flTransportFullUrl, body) - ? Promise.resolve() - : fetch(flTransportFullUrl, { - method: 'POST', - body, - keepalive: true - }).then(); + const size = TEXT_ENCODER.encode(body).length; + + if ( + size <= MAX_SEND_BEACON_PAYLOAD_SIZE && + navigator.sendBeacon && + navigator.sendBeacon(flTransportFullUrl, body) + ) { + return Promise.resolve(); + } else { + return fetch(flTransportFullUrl, { + method: 'POST', + body + }); + } } function addToQueue(evt: BatchEvent): void { @@ -159,11 +176,36 @@ export function transportHandler( } /** - * Force flush the queued events. Useful at page unload time to ensure all - * events are uploaded. + * Force flush the queued events. Useful at page unload time to ensure all events are uploaded. + * Flush will attempt to use sendBeacon to send events async and defaults back to fetch as soon as a + * sendBeacon fails. Firefox */ export function flushQueuedEvents(): void { + const flTransportFullUrl = + SettingsService.getInstance().getFlTransportFullUrl(); + while (queue.length > 0) { - dispatchQueueEvents(); + // Send the last events first to prioritize page load traces + const staged = queue.splice(-SettingsService.getInstance().logMaxFlushSize); + const body = buildPayload(staged); + + if ( + navigator.sendBeacon && + navigator.sendBeacon(flTransportFullUrl, body) + ) { + continue; + } else { + queue = [...queue, ...staged]; + break; + } + } + if (queue.length > 0) { + const body = buildPayload(queue); + fetch(flTransportFullUrl, { + method: 'POST', + body + }).catch(() => { + consoleLogger.info(`Failed flushing queued events.`); + }); } } From 3c759f0c0c5e5e164a51d8b9c89655d54047bed0 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Mon, 30 Jun 2025 09:37:14 -0700 Subject: [PATCH 231/295] Version Packages (#9126) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/brave-boats-arrive.md | 7 --- .changeset/brown-pens-confess.md | 6 --- .changeset/giant-lamps-live.md | 5 -- .changeset/long-pets-sell.md | 5 -- .changeset/moody-comics-speak.md | 8 ---- .changeset/old-candles-confess.md | 5 -- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 10 ++++ packages/ai/package.json | 8 ++-- packages/analytics-compat/CHANGELOG.md | 9 ++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 11 +++++ packages/analytics/package.json | 10 ++-- packages/app-check-compat/CHANGELOG.md | 9 ++++ packages/app-check-compat/package.json | 10 ++-- packages/app-check/CHANGELOG.md | 8 ++++ packages/app-check/package.json | 8 ++-- packages/app-compat/CHANGELOG.md | 9 ++++ packages/app-compat/package.json | 8 ++-- packages/app/CHANGELOG.md | 10 ++++ packages/app/package.json | 6 +-- packages/auth-compat/CHANGELOG.md | 9 ++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 8 ++++ packages/auth/package.json | 8 ++-- packages/component/CHANGELOG.md | 7 +++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 8 ++++ packages/data-connect/package.json | 8 ++-- packages/database-compat/CHANGELOG.md | 10 ++++ packages/database-compat/package.json | 12 ++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 8 ++++ packages/database/package.json | 8 ++-- packages/firebase/CHANGELOG.md | 41 ++++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 9 ++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 16 +++++++ packages/firestore/package.json | 12 ++--- packages/functions-compat/CHANGELOG.md | 9 ++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 8 ++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 9 ++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 8 ++++ packages/installations/package.json | 8 ++-- packages/messaging-compat/CHANGELOG.md | 9 ++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 9 ++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 9 ++++ packages/performance-compat/package.json | 10 ++-- packages/performance/CHANGELOG.md | 9 ++++ packages/performance/package.json | 10 ++-- packages/remote-config-compat/CHANGELOG.md | 9 ++++ packages/remote-config-compat/package.json | 10 ++-- packages/remote-config/CHANGELOG.md | 11 +++++ packages/remote-config/package.json | 10 ++-- packages/storage-compat/CHANGELOG.md | 9 ++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 10 ++++ packages/storage/package.json | 10 ++-- packages/template/package.json | 2 +- packages/util/CHANGELOG.md | 6 +++ packages/util/package.json | 2 +- repo-scripts/size-analysis/package.json | 4 +- 71 files changed, 480 insertions(+), 212 deletions(-) delete mode 100644 .changeset/brave-boats-arrive.md delete mode 100644 .changeset/brown-pens-confess.md delete mode 100644 .changeset/giant-lamps-live.md delete mode 100644 .changeset/long-pets-sell.md delete mode 100644 .changeset/moody-comics-speak.md delete mode 100644 .changeset/old-candles-confess.md diff --git a/.changeset/brave-boats-arrive.md b/.changeset/brave-boats-arrive.md deleted file mode 100644 index 1e2f703ddb3..00000000000 --- a/.changeset/brave-boats-arrive.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@firebase/remote-config': patch -'@firebase/analytics': patch -'firebase': patch ---- - -Add rollup config to generate modular typings for google3 diff --git a/.changeset/brown-pens-confess.md b/.changeset/brown-pens-confess.md deleted file mode 100644 index 038b177796e..00000000000 --- a/.changeset/brown-pens-confess.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@firebase/storage": patch -"@firebase/util": patch ---- - -Fixed issue where Storage on Firebase Studio throws CORS errors. diff --git a/.changeset/giant-lamps-live.md b/.changeset/giant-lamps-live.md deleted file mode 100644 index f66c22deb86..00000000000 --- a/.changeset/giant-lamps-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/app': patch ---- - -Add "react-native" entry point to @firebase/app diff --git a/.changeset/long-pets-sell.md b/.changeset/long-pets-sell.md deleted file mode 100644 index d340f7da82c..00000000000 --- a/.changeset/long-pets-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/firestore': patch ---- - -Internal listener registration change for IndexedDB "versionchange" events. diff --git a/.changeset/moody-comics-speak.md b/.changeset/moody-comics-speak.md deleted file mode 100644 index 9a178a6605b..00000000000 --- a/.changeset/moody-comics-speak.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@firebase/firestore': minor -'firebase': minor ---- - -Added support for Firestore result types to be serialized with `toJSON` and then deserialized with `fromJSON` methods on the objects. - -Addeed support to resume `onSnapshot` listeners in the CSR phase based on serialized `DataSnapshot`s and `QuerySnapshot`s built in the SSR phase. diff --git a/.changeset/old-candles-confess.md b/.changeset/old-candles-confess.md deleted file mode 100644 index 6fbe742818f..00000000000 --- a/.changeset/old-candles-confess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Add deprecation label to `totalBillableCharacters`. `totalTokens` should be used instead. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index f7da859c705..106d7606644 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.13.1", - "@firebase/app-compat": "0.4.1", - "@firebase/analytics": "0.10.16", - "@firebase/analytics-compat": "0.2.22", - "@firebase/auth": "1.10.7", - "@firebase/auth-compat": "0.5.27", - "@firebase/functions": "0.12.8", - "@firebase/functions-compat": "0.3.25", - "@firebase/messaging": "0.12.21", - "@firebase/messaging-compat": "0.2.21", - "@firebase/performance": "0.7.6", - "@firebase/performance-compat": "0.2.19", - "@firebase/remote-config": "0.6.4", - "@firebase/remote-config-compat": "0.2.17" + "@firebase/app": "0.13.2", + "@firebase/app-compat": "0.4.2", + "@firebase/analytics": "0.10.17", + "@firebase/analytics-compat": "0.2.23", + "@firebase/auth": "1.10.8", + "@firebase/auth-compat": "0.5.28", + "@firebase/functions": "0.12.9", + "@firebase/functions-compat": "0.3.26", + "@firebase/messaging": "0.12.22", + "@firebase/messaging-compat": "0.2.22", + "@firebase/performance": "0.7.7", + "@firebase/performance-compat": "0.2.20", + "@firebase/remote-config": "0.6.5", + "@firebase/remote-config-compat": "0.2.18" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 903c182a5c0..04544d11eca 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.13.1", - "@firebase/firestore": "4.7.17" + "@firebase/app": "0.13.2", + "@firebase/firestore": "4.8.0" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 9c62c70ca5b..2b693ae5967 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.9.1", + "firebase": "11.10.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 874cdb40e69..ed7f17e28ba 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/ai +## 1.4.1 + +### Patch Changes + +- [`b97eab3`](https://github.com/firebase/firebase-js-sdk/commit/b97eab36a3553c906c35f4751a0b17c717178b13) [#9090](https://github.com/firebase/firebase-js-sdk/pull/9090) - Add deprecation label to `totalBillableCharacters`. `totalTokens` should be used instead. + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 1.4.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 468f166ad7e..9a2251543e4 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "1.4.0", + "version": "1.4.1", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -50,14 +50,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index ce440211b4a..aa82fdb15b2 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/analytics-compat +## 0.2.23 + +### Patch Changes + +- Updated dependencies [[`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5), [`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/analytics@0.10.17 + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.2.22 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index d126569486a..1e51c81fefa 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.22", + "version": "0.2.23", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.17", - "@firebase/analytics": "0.10.16", + "@firebase/component": "0.6.18", + "@firebase/analytics": "0.10.17", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 2507a977522..609d7b5572b 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/analytics +## 0.10.17 + +### Patch Changes + +- [`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5) [#9085](https://github.com/firebase/firebase-js-sdk/pull/9085) - Add rollup config to generate modular typings for google3 + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/installations@0.6.18 + ## 0.10.16 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 5d4c4d06735..b118e706316 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.16", + "version": "0.10.17", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.17", + "@firebase/installations": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index b5456ba7b69..60ace8bba2b 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-check-compat +## 0.3.26 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/app-check@0.10.1 + - @firebase/component@0.6.18 + ## 0.3.25 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 29ed9977205..ab20d3a585a 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.25", + "version": "0.3.26", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.10.0", + "@firebase/app-check": "0.10.1", "@firebase/app-check-types": "0.5.3", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 764c17928cb..5cc53b86a21 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/app-check +## 0.10.1 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.10.0 ### Minor Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index e52ff90dbc7..2c8e1e8e6e1 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.10.0", + "version": "0.10.1", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "@firebase/logger": "0.4.4", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index bc8b1b97982..dc9042844aa 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/app-compat +## 0.4.2 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83), [`bb57947`](https://github.com/firebase/firebase-js-sdk/commit/bb57947c942e44b39e5b0254324bee6bf665fd4e)]: + - @firebase/util@1.12.1 + - @firebase/app@0.13.2 + - @firebase/component@0.6.18 + ## 0.4.1 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 8dba6ff2ff6..6f7b7ccc706 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.4.1", + "version": "0.4.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.13.1", - "@firebase/util": "1.12.0", + "@firebase/app": "0.13.2", + "@firebase/util": "1.12.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index aa13db67c63..27dbe6b36da 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/app +## 0.13.2 + +### Patch Changes + +- [`bb57947`](https://github.com/firebase/firebase-js-sdk/commit/bb57947c942e44b39e5b0254324bee6bf665fd4e) [#9112](https://github.com/firebase/firebase-js-sdk/pull/9112) (fixes [#8988](https://github.com/firebase/firebase-js-sdk/issues/8988)) - Add "react-native" entry point to @firebase/app + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.13.1 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 3d6a0ca5dca..c11f5039310 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.13.1", + "version": "0.13.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,9 +39,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 4dfdf4ce661..6f214d7e71a 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/auth-compat +## 0.5.28 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/auth@1.10.8 + - @firebase/component@0.6.18 + ## 0.5.27 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index c27a8e1f31a..f681fa63538 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.27", + "version": "0.5.28", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.7", + "@firebase/auth": "1.10.8", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.17", - "@firebase/util": "1.12.0", + "@firebase/component": "0.6.18", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 5277c61cfa8..0fa8b449840 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/auth +## 1.10.8 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 1.10.7 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 9ec35cfaec2..c6411b4bd3b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.7", + "version": "1.10.8", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index f4e008fc2b1..02d07049690 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/component +## 0.6.18 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + ## 0.6.17 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index b95204050f3..941d80f00bc 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.17", + "version": "0.6.18", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index cb5e53a5c54..f650d447f5a 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 0.3.10 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.3.9 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 99b97e39f3a..7b5f7e2dc2d 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.9", + "version": "0.3.10", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index b15d780739a..6340490a2c8 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/database-compat +## 2.0.11 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/database@1.0.20 + - @firebase/database-types@1.0.15 + ## 2.0.10 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index c746b8dde07..1a5d6f79313 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.10", + "version": "2.0.11", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.19", - "@firebase/database-types": "1.0.14", + "@firebase/database": "1.0.20", + "@firebase/database-types": "1.0.15", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 316d77556a7..b3c5d5a1fda 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.15 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + ## 1.0.14 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 95866297115..89b1c615e33 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.14", + "version": "1.0.15", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.12.0" + "@firebase/util": "1.12.1" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 2c8060f7860..40e48bdee61 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Unreleased +## 1.0.20 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 1.0.19 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 54a549b9f68..cfc197da0e3 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.19", + "version": "1.0.20", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "peerDependencies": {}, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 7885817632d..67ebe4a8211 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,46 @@ # firebase +## 11.10.0 + +### Minor Changes + +- [`86155b3`](https://github.com/firebase/firebase-js-sdk/commit/86155b3c8f3974f8d777232625108c14f924e035) [#9115](https://github.com/firebase/firebase-js-sdk/pull/9115) - Added support for Firestore result types to be serialized with `toJSON` and then deserialized with `fromJSON` methods on the objects. + + Addeed support to resume `onSnapshot` listeners in the CSR phase based on serialized `DataSnapshot`s and `QuerySnapshot`s built in the SSR phase. + +### Patch Changes + +- [`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5) [#9085](https://github.com/firebase/firebase-js-sdk/pull/9085) - Add rollup config to generate modular typings for google3 + +- Updated dependencies [[`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5), [`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83), [`bb57947`](https://github.com/firebase/firebase-js-sdk/commit/bb57947c942e44b39e5b0254324bee6bf665fd4e), [`f73e08b`](https://github.com/firebase/firebase-js-sdk/commit/f73e08b212314547b39a10cd3e393f9e94776f21), [`86155b3`](https://github.com/firebase/firebase-js-sdk/commit/86155b3c8f3974f8d777232625108c14f924e035), [`b97eab3`](https://github.com/firebase/firebase-js-sdk/commit/b97eab36a3553c906c35f4751a0b17c717178b13)]: + - @firebase/remote-config@0.6.5 + - @firebase/analytics@0.10.17 + - @firebase/storage@0.13.14 + - @firebase/util@1.12.1 + - @firebase/app@0.13.2 + - @firebase/firestore@4.8.0 + - @firebase/ai@1.4.1 + - @firebase/remote-config-compat@0.2.18 + - @firebase/analytics-compat@0.2.23 + - @firebase/storage-compat@0.3.24 + - @firebase/app-check@0.10.1 + - @firebase/app-check-compat@0.3.26 + - @firebase/app-compat@0.4.2 + - @firebase/auth@1.10.8 + - @firebase/auth-compat@0.5.28 + - @firebase/data-connect@0.3.10 + - @firebase/database@1.0.20 + - @firebase/database-compat@2.0.11 + - @firebase/firestore-compat@0.3.53 + - @firebase/functions@0.12.9 + - @firebase/functions-compat@0.3.26 + - @firebase/installations@0.6.18 + - @firebase/installations-compat@0.2.18 + - @firebase/messaging@0.12.22 + - @firebase/messaging-compat@0.2.22 + - @firebase/performance@0.7.7 + - @firebase/performance-compat@0.2.20 + ## 11.9.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 4f785d15c8c..b31e5c6be11 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.9.1", + "version": "11.10.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -411,34 +411,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "1.4.0", - "@firebase/app": "0.13.1", - "@firebase/app-compat": "0.4.1", + "@firebase/ai": "1.4.1", + "@firebase/app": "0.13.2", + "@firebase/app-compat": "0.4.2", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.7", - "@firebase/auth-compat": "0.5.27", - "@firebase/data-connect": "0.3.9", - "@firebase/database": "1.0.19", - "@firebase/database-compat": "2.0.10", - "@firebase/firestore": "4.7.17", - "@firebase/firestore-compat": "0.3.52", - "@firebase/functions": "0.12.8", - "@firebase/functions-compat": "0.3.25", - "@firebase/installations": "0.6.17", - "@firebase/installations-compat": "0.2.17", - "@firebase/messaging": "0.12.21", - "@firebase/messaging-compat": "0.2.21", - "@firebase/storage": "0.13.13", - "@firebase/storage-compat": "0.3.23", - "@firebase/performance": "0.7.6", - "@firebase/performance-compat": "0.2.19", - "@firebase/remote-config": "0.6.4", - "@firebase/remote-config-compat": "0.2.17", - "@firebase/analytics": "0.10.16", - "@firebase/analytics-compat": "0.2.22", - "@firebase/app-check": "0.10.0", - "@firebase/app-check-compat": "0.3.25", - "@firebase/util": "1.12.0" + "@firebase/auth": "1.10.8", + "@firebase/auth-compat": "0.5.28", + "@firebase/data-connect": "0.3.10", + "@firebase/database": "1.0.20", + "@firebase/database-compat": "2.0.11", + "@firebase/firestore": "4.8.0", + "@firebase/firestore-compat": "0.3.53", + "@firebase/functions": "0.12.9", + "@firebase/functions-compat": "0.3.26", + "@firebase/installations": "0.6.18", + "@firebase/installations-compat": "0.2.18", + "@firebase/messaging": "0.12.22", + "@firebase/messaging-compat": "0.2.22", + "@firebase/storage": "0.13.14", + "@firebase/storage-compat": "0.3.24", + "@firebase/performance": "0.7.7", + "@firebase/performance-compat": "0.2.20", + "@firebase/remote-config": "0.6.5", + "@firebase/remote-config-compat": "0.2.18", + "@firebase/analytics": "0.10.17", + "@firebase/analytics-compat": "0.2.23", + "@firebase/app-check": "0.10.1", + "@firebase/app-check-compat": "0.3.26", + "@firebase/util": "1.12.1" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 264da74339b..88fd0400358 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore-compat +## 0.3.53 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83), [`f73e08b`](https://github.com/firebase/firebase-js-sdk/commit/f73e08b212314547b39a10cd3e393f9e94776f21), [`86155b3`](https://github.com/firebase/firebase-js-sdk/commit/86155b3c8f3974f8d777232625108c14f924e035)]: + - @firebase/util@1.12.1 + - @firebase/firestore@4.8.0 + - @firebase/component@0.6.18 + ## 0.3.52 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 4071cdb236f..81b0aede4ce 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.52", + "version": "0.3.53", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.17", - "@firebase/firestore": "4.7.17", - "@firebase/util": "1.12.0", + "@firebase/component": "0.6.18", + "@firebase/firestore": "4.8.0", + "@firebase/util": "1.12.1", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 3c73ea511d9..27571575bb7 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,21 @@ # @firebase/firestore +## 4.8.0 + +### Minor Changes + +- [`86155b3`](https://github.com/firebase/firebase-js-sdk/commit/86155b3c8f3974f8d777232625108c14f924e035) [#9115](https://github.com/firebase/firebase-js-sdk/pull/9115) - Added support for Firestore result types to be serialized with `toJSON` and then deserialized with `fromJSON` methods on the objects. + + Addeed support to resume `onSnapshot` listeners in the CSR phase based on serialized `DataSnapshot`s and `QuerySnapshot`s built in the SSR phase. + +### Patch Changes + +- [`f73e08b`](https://github.com/firebase/firebase-js-sdk/commit/f73e08b212314547b39a10cd3e393f9e94776f21) [#9087](https://github.com/firebase/firebase-js-sdk/pull/9087) - Internal listener registration change for IndexedDB "versionchange" events. + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 4.7.17 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 638b8914483..1c6bc39c06f 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.7.17", + "version": "4.8.0", "engines": { "node": ">=18.0.0" }, @@ -100,9 +100,9 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "@firebase/webchannel-wrapper": "1.0.3", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", @@ -112,9 +112,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.1", - "@firebase/app-compat": "0.4.1", - "@firebase/auth": "1.10.7", + "@firebase/app": "0.13.2", + "@firebase/app-compat": "0.4.2", + "@firebase/auth": "1.10.8", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index e2317dd8152..6dbe72a859e 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/functions-compat +## 0.3.26 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/functions@0.12.9 + ## 0.3.25 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 24a8efb46d8..2c261c8f82b 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.25", + "version": "0.3.26", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.17", - "@firebase/functions": "0.12.8", + "@firebase/component": "0.6.18", + "@firebase/functions": "0.12.9", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index dcad8633b23..11476ac51a2 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/functions +## 0.12.9 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.12.8 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 6354ed4dadb..e7ff5930fa6 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.8", + "version": "0.12.9", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 213a1ba641e..7cd161398dc 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/installations-compat +## 0.2.18 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/installations@0.6.18 + ## 0.2.17 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index cb5f6f730a6..b84a1bd2199 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.17", + "version": "0.2.18", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.17", + "@firebase/installations": "0.6.18", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index bb0e09f277f..de106423f5a 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/installations +## 0.6.18 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.6.17 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index a1d89e48321..949d8441e02 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.17", + "version": "0.6.18", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index b150f2f2939..90877b5971a 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging-compat +## 0.2.22 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/messaging@0.12.22 + ## 0.2.21 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index c536cbef067..1265e7171b4 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.21", + "version": "0.2.22", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.21", - "@firebase/component": "0.6.17", - "@firebase/util": "1.12.0", + "@firebase/messaging": "0.12.22", + "@firebase/component": "0.6.18", + "@firebase/util": "1.12.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", + "@firebase/app-compat": "0.4.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 8df2d983835..1ee115e3bef 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/messaging +## 0.12.22 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/installations@0.6.18 + ## 0.12.21 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 4419ad3acf4..19c096e398b 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.21", + "version": "0.12.22", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.17", + "@firebase/installations": "0.6.18", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 11b9eed3d2f..035716656aa 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance-compat +## 0.2.20 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/performance@0.7.7 + ## 0.2.19 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 0e84088a37d..32b4d19c8d7 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.19", + "version": "0.2.20", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.6", + "@firebase/performance": "0.7.7", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.1" + "@firebase/app-compat": "0.4.2" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index ce6d7e391e5..26865967e8d 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/performance +## 0.7.7 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/installations@0.6.18 + ## 0.7.6 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 27ff0073509..4cd59811127 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.6", + "version": "0.7.7", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ }, "dependencies": { "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.17", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/installations": "0.6.18", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 052bc765c9c..9a0a10835f2 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/remote-config-compat +## 0.2.18 + +### Patch Changes + +- Updated dependencies [[`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5), [`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/remote-config@0.6.5 + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.2.17 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 507bce652f3..da128fa1aa0 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.17", + "version": "0.2.18", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.4", + "@firebase/remote-config": "0.6.5", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.17", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.1" + "@firebase/app-compat": "0.4.2" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 529e0417e75..86c511af473 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/remote-config +## 0.6.5 + +### Patch Changes + +- [`13e6cce`](https://github.com/firebase/firebase-js-sdk/commit/13e6cce882d687e06c8d9bfb56895f8a77fc57b5) [#9085](https://github.com/firebase/firebase-js-sdk/pull/9085) - Add rollup config to generate modular typings for google3 + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + - @firebase/installations@0.6.18 + ## 0.6.4 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 43648d267d4..97c1fb27aa6 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.4", + "version": "0.6.5", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.17", + "@firebase/installations": "0.6.18", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 7988847b87b..51b414c9cd4 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/storage-compat +## 0.3.24 + +### Patch Changes + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/storage@0.13.14 + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.3.23 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index c5a31d6c6f0..e760b1051e3 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.23", + "version": "0.3.24", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.13", + "@firebase/storage": "0.13.14", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.1", - "@firebase/auth-compat": "0.5.27", + "@firebase/app-compat": "0.4.2", + "@firebase/auth-compat": "0.5.28", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index af1ec2bd2f0..b00edbc5e7c 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,15 @@ #Unreleased +## 0.13.14 + +### Patch Changes + +- [`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83) [#9111](https://github.com/firebase/firebase-js-sdk/pull/9111) - Fixed issue where Storage on Firebase Studio throws CORS errors. + +- Updated dependencies [[`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83)]: + - @firebase/util@1.12.1 + - @firebase/component@0.6.18 + ## 0.13.13 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index bb4a5004840..5a9d90a32ac 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.13", + "version": "0.13.14", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.12.0", - "@firebase/component": "0.6.17", + "@firebase/util": "1.12.1", + "@firebase/component": "0.6.18", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.1", - "@firebase/auth": "1.10.7", + "@firebase/app": "0.13.2", + "@firebase/auth": "1.10.8", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/package.json b/packages/template/package.json index 9274862e9d1..6f0578f5dfc 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index c208cce58db..d7ce221e231 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.12.1 + +### Patch Changes + +- [`42ac401`](https://github.com/firebase/firebase-js-sdk/commit/42ac4011787db6bb7a08f8c84f364ea86ea51e83) [#9111](https://github.com/firebase/firebase-js-sdk/pull/9111) - Fixed issue where Storage on Firebase Studio throws CORS errors. + ## 1.12.0 ### Minor Changes diff --git a/packages/util/package.json b/packages/util/package.json index 8a1ebb49dd5..c54612bee84 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.12.0", + "version": "1.12.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 5084ee78d04..294b07f507b 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,9 +20,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.1", + "@firebase/app": "0.13.2", "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.0", + "@firebase/util": "1.12.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "16.0.0", From 5d13166dc73bb2d3017e1ab7ab874ddf45cad61f Mon Sep 17 00:00:00 2001 From: mansisampat Date: Wed, 2 Jul 2025 10:05:24 +0530 Subject: [PATCH 232/295] Increase unit test coverage for facebook.ts to 100% (#9129) * Increase unit test coverage for facebook.ts to 100% --- .../auth/src/core/providers/facebook.test.ts | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/packages/auth/src/core/providers/facebook.test.ts b/packages/auth/src/core/providers/facebook.test.ts index 7f71d04cc94..30e42648404 100644 --- a/packages/auth/src/core/providers/facebook.test.ts +++ b/packages/auth/src/core/providers/facebook.test.ts @@ -35,6 +35,11 @@ describe('core/providers/facebook', () => { expect(cred.signInMethod).to.eq(SignInMethod.FACEBOOK); }); + it('generates Facebook provider', () => { + const provider = new FacebookAuthProvider(); + expect(provider.providerId).to.eq(ProviderId.FACEBOOK); + }); + it('credentialFromResult creates the cred from a tagged result', async () => { const auth = await testAuth(); const userCred = new UserCredentialImpl({ @@ -66,4 +71,65 @@ describe('core/providers/facebook', () => { expect(cred.providerId).to.eq(ProviderId.FACEBOOK); expect(cred.signInMethod).to.eq(SignInMethod.FACEBOOK); }); + + it('returns null when _tokenResponse is missing', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = {}; // no _tokenResponse + + const cred = FacebookAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); + + it('returns null when _tokenResponse is missing oauthAccessToken key', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = { + _tokenResponse: { + // intentionally missing oauthAccessToken + idToken: 'some-id-token', + oauthAccessToken: null + } + }; + + const cred = FacebookAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); + + it('returns null when FacebookAuthProvider.credential throws', () => { + // Temporarily stub credential method to throw + const original = FacebookAuthProvider.credential; + FacebookAuthProvider.credential = () => { + throw new Error('Simulated failure'); + }; + + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = { + _tokenResponse: { + oauthAccessToken: 'valid-token' + } + }; + + const cred = FacebookAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + + // Restore original method + FacebookAuthProvider.credential = original; + }); + + it('returns null when error.customData is undefined (falls back to empty object)', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + + // Don't set `customData` at all → fallback to {} + delete (error as any).customData; + + const cred = FacebookAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); }); From 247b92f9bf83ebec4321806839b36a35346c8e36 Mon Sep 17 00:00:00 2001 From: mansisampat Date: Wed, 2 Jul 2025 10:05:47 +0530 Subject: [PATCH 233/295] Increase unit test coverage for github.ts to 100% (#9130) * Increase unit test coverage for github.ts to 100% --- .../auth/src/core/providers/github.test.ts | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/packages/auth/src/core/providers/github.test.ts b/packages/auth/src/core/providers/github.test.ts index 9e7d0d73de8..2cb15a1be0d 100644 --- a/packages/auth/src/core/providers/github.test.ts +++ b/packages/auth/src/core/providers/github.test.ts @@ -35,6 +35,11 @@ describe('core/providers/github', () => { expect(cred.signInMethod).to.eq(SignInMethod.GITHUB); }); + it('generates Github provider', () => { + const provider = new GithubAuthProvider(); + expect(provider.providerId).to.eq(ProviderId.GITHUB); + }); + it('credentialFromResult creates the cred from a tagged result', async () => { const auth = await testAuth(); const userCred = new UserCredentialImpl({ @@ -66,4 +71,65 @@ describe('core/providers/github', () => { expect(cred.providerId).to.eq(ProviderId.GITHUB); expect(cred.signInMethod).to.eq(SignInMethod.GITHUB); }); + + it('returns null when _tokenResponse is missing', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = {}; // no _tokenResponse + + const cred = GithubAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); + + it('returns null when _tokenResponse is missing oauthAccessToken key', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = { + _tokenResponse: { + // intentionally missing oauthAccessToken + idToken: 'some-id-token', + oauthAccessToken: null + } + }; + + const cred = GithubAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); + + it('returns null when GithubAuthProvider.credential throws', () => { + // Temporarily stub credential method to throw + const original = GithubAuthProvider.credential; + GithubAuthProvider.credential = () => { + throw new Error('Simulated failure'); + }; + + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = { + _tokenResponse: { + oauthAccessToken: 'valid-token' + } + }; + + const cred = GithubAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + + // Restore original method + GithubAuthProvider.credential = original; + }); + + it('returns null when error.customData is undefined (falls back to empty object)', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + + // Don't set `customData` at all → fallback to {} + delete (error as any).customData; + + const cred = GithubAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); }); From 8072572f9869224db7e92da908482af61a07c7a2 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 2 Jul 2025 16:06:10 -0400 Subject: [PATCH 234/295] test: Use inline source maps for webpack test output (#9109) --- config/webpack.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/webpack.test.js b/config/webpack.test.js index d84ed2d209c..30e3985fe3d 100644 --- a/config/webpack.test.js +++ b/config/webpack.test.js @@ -28,7 +28,7 @@ const PLATFORM_RE = /^(.*)\/platform\/([^.\/]*)(\.ts)?$/; module.exports = { mode: 'development', - devtool: 'source-map', + devtool: 'inline-source-map', optimization: { runtimeChunk: false, splitChunks: false, From ab5c2a06ee1e146bf8ca94a67ce651c9428691f9 Mon Sep 17 00:00:00 2001 From: mansisampat Date: Thu, 3 Jul 2025 11:52:11 +0530 Subject: [PATCH 235/295] Increase unit test coverage for saml.ts to 100% (#9131) * Increase unit test coverage for saml.ts to 100% --- packages/auth/src/core/providers/saml.test.ts | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/packages/auth/src/core/providers/saml.test.ts b/packages/auth/src/core/providers/saml.test.ts index b2e714c7918..f4a5f3a187a 100644 --- a/packages/auth/src/core/providers/saml.test.ts +++ b/packages/auth/src/core/providers/saml.test.ts @@ -22,6 +22,7 @@ import { OperationType } from '../../model/enums'; import { TEST_ID_TOKEN_RESPONSE } from '../../../test/helpers/id_token_response'; import { testUser, testAuth } from '../../../test/helpers/mock_auth'; import { TaggedWithTokenResponse } from '../../model/id_token'; +import { SAMLAuthCredential } from '../credentials/saml'; import { AuthErrorCode } from '../errors'; import { UserCredentialImpl } from '../user/user_credential_impl'; import { _createError } from '../util/assert'; @@ -45,6 +46,17 @@ describe('core/providers/saml', () => { expect(cred.signInMethod).to.eq('saml.provider'); }); + it('generates SAML provider', () => { + const provider = new SAMLAuthProvider('saml.provider'); + expect(provider.providerId).to.eq('saml.provider'); + }); + + it('returns error for invalid SAML provdier', () => { + expect(() => { + new SAMLAuthProvider('provider'); + }).throw(/auth\/argument-error/); + }); + it('credentialFromResult returns null if provider ID not specified', async () => { const auth = await testAuth(); const userCred = new UserCredentialImpl({ @@ -73,4 +85,78 @@ describe('core/providers/saml', () => { expect(cred.providerId).to.eq('saml.provider'); expect(cred.signInMethod).to.eq('saml.provider'); }); + + it('credentialFromJSON returns SAML credential from valid object', () => { + const json = { + providerId: 'saml.provider', + signInMethod: 'saml.provider', + pendingToken: 'fake-pending-token' + }; + + const credential = SAMLAuthProvider.credentialFromJSON(json); + expect(credential.providerId).to.eq('saml.provider'); + expect(credential.signInMethod).to.eq('saml.provider'); + expect((credential as any).pendingToken).to.eq('fake-pending-token'); + }); + + it('returns null when _tokenResponse is missing (undefined)', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'test-app' + }); + + error.customData = {}; // _tokenResponse missing + const credential = SAMLAuthProvider.credentialFromError(error); + expect(credential).to.be.null; + }); + + it('returns null when _tokenResponse is missing oauthAccessToken key', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'foo' + }); + error.customData = { + _tokenResponse: { + // intentionally missing oauthAccessToken + idToken: 'some-id-token', + oauthAccessToken: null + } + }; + + const cred = SAMLAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + }); + + it('returns null if _create throws internally', () => { + const originalCreate = (SAMLAuthCredential as any)._create; + + (SAMLAuthCredential as any)._create = () => { + throw new Error('Simulated error'); + }; + + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'test-app' + }); + + error.customData = { + _tokenResponse: { + pendingToken: 'valid-token', + providerId: 'saml.my-provider' + } + }; + + const cred = SAMLAuthProvider.credentialFromError(error); + expect(cred).to.be.null; + + (SAMLAuthCredential as any)._create = originalCreate; + }); + + it('returns null when customData is undefined (falls back to empty object)', () => { + const error = _createError(AuthErrorCode.NEED_CONFIRMATION, { + appName: 'test-app' + }); + + delete (error as any).customData; + + const credential = SAMLAuthProvider.credentialFromError(error); + expect(credential).to.be.null; + }); }); From a029ce39ee1ea1f6f28e79a1733ad8e8ebedf4bb Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Mon, 7 Jul 2025 15:28:19 +0000 Subject: [PATCH 236/295] firestore: misc.ts: further improved performance of UTF-8 string comparison logic --- .changeset/twelve-walls-exist.md | 5 ++ packages/firestore/src/util/misc.ts | 88 ++++++++++++----------------- 2 files changed, 42 insertions(+), 51 deletions(-) create mode 100644 .changeset/twelve-walls-exist.md diff --git a/.changeset/twelve-walls-exist.md b/.changeset/twelve-walls-exist.md new file mode 100644 index 00000000000..887b2bc6895 --- /dev/null +++ b/.changeset/twelve-walls-exist.md @@ -0,0 +1,5 @@ +--- +'@firebase/firestore': patch +--- + +Further improved performance of UTF-8 string ordering logic, which had degraded in v11.3.0, was reverted in v11.3.1, and was re-introduced with some improvements in v11.5.0. diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index 42fa568835b..9de7cffb10b 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -16,7 +16,6 @@ */ import { randomBytes } from '../platform/random_bytes'; -import { newTextEncoder } from '../platform/text_serializer'; import { debugAssert } from './assert'; @@ -77,63 +76,50 @@ export interface Equatable { /** Compare strings in UTF-8 encoded byte order */ export function compareUtf8Strings(left: string, right: string): number { - let i = 0; - while (i < left.length && i < right.length) { - const leftCodePoint = left.codePointAt(i)!; - const rightCodePoint = right.codePointAt(i)!; - - if (leftCodePoint !== rightCodePoint) { - if (leftCodePoint < 128 && rightCodePoint < 128) { - // ASCII comparison - return primitiveComparator(leftCodePoint, rightCodePoint); - } else { - // Lazy instantiate TextEncoder - const encoder = newTextEncoder(); - - // UTF-8 encode the character at index i for byte comparison. - const leftBytes = encoder.encode(getUtf8SafeSubstring(left, i)); - const rightBytes = encoder.encode(getUtf8SafeSubstring(right, i)); - - const comp = compareByteArrays(leftBytes, rightBytes); - if (comp !== 0) { - return comp; - } else { - // EXTREMELY RARE CASE: Code points differ, but their UTF-8 byte - // representations are identical. This can happen with malformed input - // (invalid surrogate pairs). The backend also actively prevents invalid - // surrogates as INVALID_ARGUMENT errors, so we almost never receive - // invalid strings from backend. - // Fallback to code point comparison for graceful handling. - return primitiveComparator(leftCodePoint, rightCodePoint); - } - } + // Find the first differing character (a.k.a. "UTF-16 code unit") in the two strings and, + // if found, use that character to determine the relative ordering of the two strings as a + // whole. Comparing UTF-16 strings in UTF-8 byte order can be done simply and efficiently by + // comparing the UTF-16 code units (chars). This serendipitously works because of the way UTF-8 + // and UTF-16 happen to represent Unicode code points. + // + // After finding the first pair of differing characters, there are two cases: + // + // Case 1: Both characters are non-surrogates (code points less than or equal to 0xFFFF) or + // both are surrogates from a surrogate pair (that collectively represent code points greater + // than 0xFFFF). In this case their numeric order as UTF-16 code units is the same as the + // lexicographical order of their corresponding UTF-8 byte sequences. A direct comparison is + // sufficient. + // + // Case 2: One character is a surrogate and the other is not. In this case the surrogate- + // containing string is always ordered after the non-surrogate. This is because surrogates are + // used to represent code points greater than 0xFFFF which have 4-byte UTF-8 representations + // and are lexicographically greater than the 1, 2, or 3-byte representations of code points + // less than or equal to 0xFFFF. + const length = Math.min(left.length, right.length); + for (let i = 0; i < length; i++) { + const leftChar = left.charAt(i); + const rightChar = right.charAt(i); + if (leftChar !== rightChar) { + return isSurrogate(leftChar) === isSurrogate(rightChar) + ? primitiveComparator(leftChar, rightChar) + : isSurrogate(leftChar) + ? 1 + : -1; } - // Increment by 2 for surrogate pairs, 1 otherwise - i += leftCodePoint > 0xffff ? 2 : 1; } - // Compare lengths if all characters are equal + // Use the lengths of the strings to determine the overall comparison result since either the + // strings were equal or one is a prefix of the other. return primitiveComparator(left.length, right.length); } -function getUtf8SafeSubstring(str: string, index: number): string { - const firstCodePoint = str.codePointAt(index)!; - if (firstCodePoint > 0xffff) { - // It's a surrogate pair, return the whole pair - return str.substring(index, index + 2); - } else { - // It's a single code point, return it - return str.substring(index, index + 1); - } -} +const MIN_SURROGATE = 0xd800; +const MAX_SURROGATE = 0xdfff; -function compareByteArrays(left: Uint8Array, right: Uint8Array): number { - for (let i = 0; i < left.length && i < right.length; ++i) { - if (left[i] !== right[i]) { - return primitiveComparator(left[i], right[i]); - } - } - return primitiveComparator(left.length, right.length); +export function isSurrogate(s: string): boolean { + debugAssert(s.length === 1, `s.length == ${s.length}, but expected 1`); + const c = s.charCodeAt(0); + return c >= MIN_SURROGATE && c <= MAX_SURROGATE; } export interface Iterable { From ae976d02908a5a8913c5fcd4c0485fcf4b081fec Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 8 Jul 2025 14:25:28 -0700 Subject: [PATCH 237/295] fix(ai): typings for functionDeclaration.parameters. (#8948) --- .changeset/rotten-taxis-allow.md | 5 + common/api-review/ai.api.md | 7 +- common/api-review/vertexai.api.md | 955 --------------------- docs-devsite/_toc.yaml | 4 +- docs-devsite/ai.functiondeclaration.md | 4 +- docs-devsite/ai.md | 2 +- docs-devsite/ai.objectschemainterface.md | 43 - docs-devsite/ai.objectschemarequest.md | 45 + packages/ai/src/requests/schema-builder.ts | 5 +- packages/ai/src/types/requests.ts | 6 +- packages/ai/src/types/schema.ts | 14 +- 11 files changed, 74 insertions(+), 1016 deletions(-) create mode 100644 .changeset/rotten-taxis-allow.md delete mode 100644 common/api-review/vertexai.api.md delete mode 100644 docs-devsite/ai.objectschemainterface.md create mode 100644 docs-devsite/ai.objectschemarequest.md diff --git a/.changeset/rotten-taxis-allow.md b/.changeset/rotten-taxis-allow.md new file mode 100644 index 00000000000..dc7a7660164 --- /dev/null +++ b/.changeset/rotten-taxis-allow.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Fix typings for `functionDeclaration.parameters`. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index ab79447798f..2fec980a271 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -281,7 +281,7 @@ export interface FunctionCallPart { export interface FunctionDeclaration { description: string; name: string; - parameters?: ObjectSchemaInterface; + parameters?: ObjectSchema | ObjectSchemaRequest; } // @public @@ -703,9 +703,8 @@ export class ObjectSchema extends Schema { } // @public -export interface ObjectSchemaInterface extends SchemaInterface { - // (undocumented) - optionalProperties?: string[]; +export interface ObjectSchemaRequest extends SchemaRequest { + optionalProperties?: never; // (undocumented) type: SchemaType.OBJECT; } diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md deleted file mode 100644 index 42da114f9e9..00000000000 --- a/common/api-review/vertexai.api.md +++ /dev/null @@ -1,955 +0,0 @@ -## API Report File for "@firebase/vertexai" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; -import { FirebaseError } from '@firebase/util'; - -// @public -export interface AI { - app: FirebaseApp; - backend: Backend; - // @deprecated - location: string; -} - -// @public -export class AIError extends FirebaseError { - constructor(code: AIErrorCode, message: string, customErrorData?: CustomErrorData | undefined); - // (undocumented) - readonly code: AIErrorCode; - // (undocumented) - readonly customErrorData?: CustomErrorData | undefined; -} - -// @public -const enum AIErrorCode { - API_NOT_ENABLED = "api-not-enabled", - ERROR = "error", - FETCH_ERROR = "fetch-error", - INVALID_CONTENT = "invalid-content", - INVALID_SCHEMA = "invalid-schema", - NO_API_KEY = "no-api-key", - NO_APP_ID = "no-app-id", - NO_MODEL = "no-model", - NO_PROJECT_ID = "no-project-id", - PARSE_FAILED = "parse-failed", - REQUEST_ERROR = "request-error", - RESPONSE_ERROR = "response-error", - UNSUPPORTED = "unsupported" -} - -export { AIErrorCode } - -export { AIErrorCode as VertexAIErrorCode } - -// @public -export abstract class AIModel { - // @internal - protected constructor(ai: AI, modelName: string); - // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts - // - // @internal (undocumented) - protected _apiSettings: ApiSettings; - readonly model: string; - // @internal - static normalizeModelName(modelName: string, backendType: BackendType): string; - } - -// @public -export interface AIOptions { - backend: Backend; -} - -// @public -export class ArraySchema extends Schema { - constructor(schemaParams: SchemaParams, items: TypedSchema); - // (undocumented) - items: TypedSchema; - // @internal (undocumented) - toJSON(): SchemaRequest; -} - -// @public -export abstract class Backend { - protected constructor(type: BackendType); - readonly backendType: BackendType; -} - -// @public -export const BackendType: { - readonly VERTEX_AI: "VERTEX_AI"; - readonly GOOGLE_AI: "GOOGLE_AI"; -}; - -// @public -export type BackendType = (typeof BackendType)[keyof typeof BackendType]; - -// @public -export interface BaseParams { - // (undocumented) - generationConfig?: GenerationConfig; - // (undocumented) - safetySettings?: SafetySetting[]; -} - -// @public -export enum BlockReason { - BLOCKLIST = "BLOCKLIST", - OTHER = "OTHER", - PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - SAFETY = "SAFETY" -} - -// @public -export class BooleanSchema extends Schema { - constructor(schemaParams?: SchemaParams); -} - -// @public -export class ChatSession { - constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); - getHistory(): Promise; - // (undocumented) - model: string; - // (undocumented) - params?: StartChatParams | undefined; - // (undocumented) - requestOptions?: RequestOptions | undefined; - sendMessage(request: string | Array): Promise; - sendMessageStream(request: string | Array): Promise; - } - -// @public -export interface Citation { - // (undocumented) - endIndex?: number; - // (undocumented) - license?: string; - publicationDate?: Date_2; - // (undocumented) - startIndex?: number; - title?: string; - // (undocumented) - uri?: string; -} - -// @public -export interface CitationMetadata { - // (undocumented) - citations: Citation[]; -} - -// @public -export interface Content { - // (undocumented) - parts: Part[]; - // (undocumented) - role: Role; -} - -// @public -export interface CountTokensRequest { - // (undocumented) - contents: Content[]; - generationConfig?: GenerationConfig; - systemInstruction?: string | Part | Content; - tools?: Tool[]; -} - -// @public -export interface CountTokensResponse { - promptTokensDetails?: ModalityTokenCount[]; - totalBillableCharacters?: number; - totalTokens: number; -} - -// @public -export interface CustomErrorData { - errorDetails?: ErrorDetails[]; - response?: GenerateContentResponse; - status?: number; - statusText?: string; -} - -// @public -interface Date_2 { - // (undocumented) - day: number; - // (undocumented) - month: number; - // (undocumented) - year: number; -} - -export { Date_2 as Date } - -// @public -export interface EnhancedGenerateContentResponse extends GenerateContentResponse { - // (undocumented) - functionCalls: () => FunctionCall[] | undefined; - inlineDataParts: () => InlineDataPart[] | undefined; - text: () => string; -} - -// @public -export interface ErrorDetails { - // (undocumented) - '@type'?: string; - [key: string]: unknown; - domain?: string; - metadata?: Record; - reason?: string; -} - -// @public -export interface FileData { - // (undocumented) - fileUri: string; - // (undocumented) - mimeType: string; -} - -// @public -export interface FileDataPart { - // (undocumented) - fileData: FileData; - // (undocumented) - functionCall?: never; - // (undocumented) - functionResponse?: never; - // (undocumented) - inlineData?: never; - // (undocumented) - text?: never; -} - -// @public -export enum FinishReason { - BLOCKLIST = "BLOCKLIST", - MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", - MAX_TOKENS = "MAX_TOKENS", - OTHER = "OTHER", - PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - RECITATION = "RECITATION", - SAFETY = "SAFETY", - SPII = "SPII", - STOP = "STOP" -} - -// @public -export interface FunctionCall { - // (undocumented) - args: object; - // (undocumented) - name: string; -} - -// @public (undocumented) -export interface FunctionCallingConfig { - // (undocumented) - allowedFunctionNames?: string[]; - // (undocumented) - mode?: FunctionCallingMode; -} - -// @public (undocumented) -export enum FunctionCallingMode { - ANY = "ANY", - AUTO = "AUTO", - NONE = "NONE" -} - -// @public -export interface FunctionCallPart { - // (undocumented) - functionCall: FunctionCall; - // (undocumented) - functionResponse?: never; - // (undocumented) - inlineData?: never; - // (undocumented) - text?: never; -} - -// @public -export interface FunctionDeclaration { - description: string; - name: string; - parameters?: ObjectSchemaInterface; -} - -// @public -export interface FunctionDeclarationsTool { - functionDeclarations?: FunctionDeclaration[]; -} - -// @public -export interface FunctionResponse { - // (undocumented) - name: string; - // (undocumented) - response: object; -} - -// @public -export interface FunctionResponsePart { - // (undocumented) - functionCall?: never; - // (undocumented) - functionResponse: FunctionResponse; - // (undocumented) - inlineData?: never; - // (undocumented) - text?: never; -} - -// @public -export interface GenerateContentCandidate { - // (undocumented) - citationMetadata?: CitationMetadata; - // (undocumented) - content: Content; - // (undocumented) - finishMessage?: string; - // (undocumented) - finishReason?: FinishReason; - // (undocumented) - groundingMetadata?: GroundingMetadata; - // (undocumented) - index: number; - // (undocumented) - safetyRatings?: SafetyRating[]; -} - -// @public -export interface GenerateContentRequest extends BaseParams { - // (undocumented) - contents: Content[]; - // (undocumented) - systemInstruction?: string | Part | Content; - // (undocumented) - toolConfig?: ToolConfig; - // (undocumented) - tools?: Tool[]; -} - -// @public -export interface GenerateContentResponse { - // (undocumented) - candidates?: GenerateContentCandidate[]; - // (undocumented) - promptFeedback?: PromptFeedback; - // (undocumented) - usageMetadata?: UsageMetadata; -} - -// @public -export interface GenerateContentResult { - // (undocumented) - response: EnhancedGenerateContentResponse; -} - -// @public -export interface GenerateContentStreamResult { - // (undocumented) - response: Promise; - // (undocumented) - stream: AsyncGenerator; -} - -// @public -export interface GenerationConfig { - // (undocumented) - candidateCount?: number; - // (undocumented) - frequencyPenalty?: number; - // (undocumented) - maxOutputTokens?: number; - // (undocumented) - presencePenalty?: number; - responseMimeType?: string; - // @beta - responseModalities?: ResponseModality[]; - responseSchema?: TypedSchema | SchemaRequest; - // (undocumented) - stopSequences?: string[]; - // (undocumented) - temperature?: number; - // (undocumented) - topK?: number; - // (undocumented) - topP?: number; -} - -// @public -export interface GenerativeContentBlob { - data: string; - // (undocumented) - mimeType: string; -} - -// @public -export class GenerativeModel extends AIModel { - constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); - countTokens(request: CountTokensRequest | string | Array): Promise; - generateContent(request: GenerateContentRequest | string | Array): Promise; - generateContentStream(request: GenerateContentRequest | string | Array): Promise; - // (undocumented) - generationConfig: GenerationConfig; - // (undocumented) - requestOptions?: RequestOptions; - // (undocumented) - safetySettings: SafetySetting[]; - startChat(startChatParams?: StartChatParams): ChatSession; - // (undocumented) - systemInstruction?: Content; - // (undocumented) - toolConfig?: ToolConfig; - // (undocumented) - tools?: Tool[]; -} - -// @public -export function getAI(app?: FirebaseApp, options?: AIOptions): AI; - -// @public -export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; - -// @beta -export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; - -// @public -export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; - -// @public -export class GoogleAIBackend extends Backend { - constructor(); -} - -// Warning: (ae-internal-missing-underscore) The name "GoogleAICitationMetadata" should be prefixed with an underscore because the declaration is marked as @internal -// -// @internal (undocumented) -export interface GoogleAICitationMetadata { - // (undocumented) - citationSources: Citation[]; -} - -// Warning: (ae-internal-missing-underscore) The name "GoogleAICountTokensRequest" should be prefixed with an underscore because the declaration is marked as @internal -// -// @internal (undocumented) -export interface GoogleAICountTokensRequest { - // (undocumented) - generateContentRequest: { - model: string; - contents: Content[]; - systemInstruction?: string | Part | Content; - tools?: Tool[]; - generationConfig?: GenerationConfig; - }; -} - -// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentCandidate" should be prefixed with an underscore because the declaration is marked as @internal -// -// @internal (undocumented) -export interface GoogleAIGenerateContentCandidate { - // (undocumented) - citationMetadata?: GoogleAICitationMetadata; - // (undocumented) - content: Content; - // (undocumented) - finishMessage?: string; - // (undocumented) - finishReason?: FinishReason; - // (undocumented) - groundingMetadata?: GroundingMetadata; - // (undocumented) - index: number; - // (undocumented) - safetyRatings?: SafetyRating[]; -} - -// Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentResponse" should be prefixed with an underscore because the declaration is marked as @internal -// -// @internal (undocumented) -export interface GoogleAIGenerateContentResponse { - // (undocumented) - candidates?: GoogleAIGenerateContentCandidate[]; - // (undocumented) - promptFeedback?: PromptFeedback; - // (undocumented) - usageMetadata?: UsageMetadata; -} - -// @public @deprecated (undocumented) -export interface GroundingAttribution { - // (undocumented) - confidenceScore?: number; - // (undocumented) - retrievedContext?: RetrievedContextAttribution; - // (undocumented) - segment: Segment; - // (undocumented) - web?: WebAttribution; -} - -// @public -export interface GroundingMetadata { - // @deprecated (undocumented) - groundingAttributions: GroundingAttribution[]; - // (undocumented) - retrievalQueries?: string[]; - // (undocumented) - webSearchQueries?: string[]; -} - -// @public -export enum HarmBlockMethod { - PROBABILITY = "PROBABILITY", - SEVERITY = "SEVERITY" -} - -// @public -export enum HarmBlockThreshold { - BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", - BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", - BLOCK_NONE = "BLOCK_NONE", - BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" -} - -// @public -export enum HarmCategory { - // (undocumented) - HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", - // (undocumented) - HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", - // (undocumented) - HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", - // (undocumented) - HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT" -} - -// @public -export enum HarmProbability { - HIGH = "HIGH", - LOW = "LOW", - MEDIUM = "MEDIUM", - NEGLIGIBLE = "NEGLIGIBLE" -} - -// @public -export enum HarmSeverity { - HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", - HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", - HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", - HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", - HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED" -} - -// @beta -export enum ImagenAspectRatio { - LANDSCAPE_16x9 = "16:9", - LANDSCAPE_3x4 = "3:4", - PORTRAIT_4x3 = "4:3", - PORTRAIT_9x16 = "9:16", - SQUARE = "1:1" -} - -// @public -export interface ImagenGCSImage { - gcsURI: string; - mimeType: string; -} - -// @beta -export interface ImagenGenerationConfig { - addWatermark?: boolean; - aspectRatio?: ImagenAspectRatio; - imageFormat?: ImagenImageFormat; - negativePrompt?: string; - numberOfImages?: number; -} - -// @beta -export interface ImagenGenerationResponse { - filteredReason?: string; - images: T[]; -} - -// @beta -export class ImagenImageFormat { - compressionQuality?: number; - static jpeg(compressionQuality?: number): ImagenImageFormat; - mimeType: string; - static png(): ImagenImageFormat; -} - -// @beta -export interface ImagenInlineImage { - bytesBase64Encoded: string; - mimeType: string; -} - -// @beta -export class ImagenModel extends AIModel { - constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); - generateImages(prompt: string): Promise>; - // @internal - generateImagesGCS(prompt: string, gcsURI: string): Promise>; - generationConfig?: ImagenGenerationConfig; - // (undocumented) - requestOptions?: RequestOptions | undefined; - safetySettings?: ImagenSafetySettings; -} - -// @beta -export interface ImagenModelParams { - generationConfig?: ImagenGenerationConfig; - model: string; - safetySettings?: ImagenSafetySettings; -} - -// @beta -export enum ImagenPersonFilterLevel { - ALLOW_ADULT = "allow_adult", - ALLOW_ALL = "allow_all", - BLOCK_ALL = "dont_allow" -} - -// @beta -export enum ImagenSafetyFilterLevel { - BLOCK_LOW_AND_ABOVE = "block_low_and_above", - BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above", - BLOCK_NONE = "block_none", - BLOCK_ONLY_HIGH = "block_only_high" -} - -// @beta -export interface ImagenSafetySettings { - personFilterLevel?: ImagenPersonFilterLevel; - safetyFilterLevel?: ImagenSafetyFilterLevel; -} - -// @public -export interface InlineDataPart { - // (undocumented) - functionCall?: never; - // (undocumented) - functionResponse?: never; - // (undocumented) - inlineData: GenerativeContentBlob; - // (undocumented) - text?: never; - videoMetadata?: VideoMetadata; -} - -// @public -export class IntegerSchema extends Schema { - constructor(schemaParams?: SchemaParams); -} - -// @public -export enum Modality { - AUDIO = "AUDIO", - DOCUMENT = "DOCUMENT", - IMAGE = "IMAGE", - MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED", - TEXT = "TEXT", - VIDEO = "VIDEO" -} - -// @public -export interface ModalityTokenCount { - modality: Modality; - tokenCount: number; -} - -// @public -export interface ModelParams extends BaseParams { - // (undocumented) - model: string; - // (undocumented) - systemInstruction?: string | Part | Content; - // (undocumented) - toolConfig?: ToolConfig; - // (undocumented) - tools?: Tool[]; -} - -// @public -export class NumberSchema extends Schema { - constructor(schemaParams?: SchemaParams); -} - -// @public -export class ObjectSchema extends Schema { - constructor(schemaParams: SchemaParams, properties: { - [k: string]: TypedSchema; - }, optionalProperties?: string[]); - // (undocumented) - optionalProperties: string[]; - // (undocumented) - properties: { - [k: string]: TypedSchema; - }; - // @internal (undocumented) - toJSON(): SchemaRequest; -} - -// @public -export interface ObjectSchemaInterface extends SchemaInterface { - // (undocumented) - optionalProperties?: string[]; - // (undocumented) - type: SchemaType.OBJECT; -} - -// @public -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; - -// @public -export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; - -// @public -export interface PromptFeedback { - // (undocumented) - blockReason?: BlockReason; - blockReasonMessage?: string; - // (undocumented) - safetyRatings: SafetyRating[]; -} - -// @public -export interface RequestOptions { - baseUrl?: string; - timeout?: number; -} - -// @beta -export const ResponseModality: { - readonly TEXT: "TEXT"; - readonly IMAGE: "IMAGE"; -}; - -// @beta -export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; - -// @public (undocumented) -export interface RetrievedContextAttribution { - // (undocumented) - title: string; - // (undocumented) - uri: string; -} - -// @public -export type Role = (typeof POSSIBLE_ROLES)[number]; - -// @public -export interface SafetyRating { - // (undocumented) - blocked: boolean; - // (undocumented) - category: HarmCategory; - // (undocumented) - probability: HarmProbability; - probabilityScore: number; - severity: HarmSeverity; - severityScore: number; -} - -// @public -export interface SafetySetting { - // (undocumented) - category: HarmCategory; - method?: HarmBlockMethod; - // (undocumented) - threshold: HarmBlockThreshold; -} - -// @public -export abstract class Schema implements SchemaInterface { - constructor(schemaParams: SchemaInterface); - [key: string]: unknown; - // (undocumented) - static array(arrayParams: SchemaParams & { - items: Schema; - }): ArraySchema; - // (undocumented) - static boolean(booleanParams?: SchemaParams): BooleanSchema; - description?: string; - // (undocumented) - static enumString(stringParams: SchemaParams & { - enum: string[]; - }): StringSchema; - example?: unknown; - format?: string; - // (undocumented) - static integer(integerParams?: SchemaParams): IntegerSchema; - nullable: boolean; - // (undocumented) - static number(numberParams?: SchemaParams): NumberSchema; - // (undocumented) - static object(objectParams: SchemaParams & { - properties: { - [k: string]: Schema; - }; - optionalProperties?: string[]; - }): ObjectSchema; - // (undocumented) - static string(stringParams?: SchemaParams): StringSchema; - // @internal - toJSON(): SchemaRequest; - type: SchemaType; -} - -// @public -export interface SchemaInterface extends SchemaShared { - type: SchemaType; -} - -// @public -export interface SchemaParams extends SchemaShared { -} - -// @public -export interface SchemaRequest extends SchemaShared { - required?: string[]; - type: SchemaType; -} - -// @public -export interface SchemaShared { - // (undocumented) - [key: string]: unknown; - description?: string; - enum?: string[]; - example?: unknown; - format?: string; - items?: T; - nullable?: boolean; - properties?: { - [k: string]: T; - }; -} - -// @public -export enum SchemaType { - ARRAY = "array", - BOOLEAN = "boolean", - INTEGER = "integer", - NUMBER = "number", - OBJECT = "object", - STRING = "string" -} - -// @public (undocumented) -export interface Segment { - // (undocumented) - endIndex: number; - // (undocumented) - partIndex: number; - // (undocumented) - startIndex: number; -} - -// @public -export interface StartChatParams extends BaseParams { - // (undocumented) - history?: Content[]; - // (undocumented) - systemInstruction?: string | Part | Content; - // (undocumented) - toolConfig?: ToolConfig; - // (undocumented) - tools?: Tool[]; -} - -// @public -export class StringSchema extends Schema { - constructor(schemaParams?: SchemaParams, enumValues?: string[]); - // (undocumented) - enum?: string[]; - // @internal (undocumented) - toJSON(): SchemaRequest; -} - -// @public -export interface TextPart { - // (undocumented) - functionCall?: never; - // (undocumented) - functionResponse?: never; - // (undocumented) - inlineData?: never; - // (undocumented) - text: string; -} - -// @public -export type Tool = FunctionDeclarationsTool; - -// @public -export interface ToolConfig { - // (undocumented) - functionCallingConfig?: FunctionCallingConfig; -} - -// @public -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; - -// @public -export interface UsageMetadata { - // (undocumented) - candidatesTokenCount: number; - // (undocumented) - candidatesTokensDetails?: ModalityTokenCount[]; - // (undocumented) - promptTokenCount: number; - // (undocumented) - promptTokensDetails?: ModalityTokenCount[]; - // (undocumented) - totalTokenCount: number; -} - -// @public -export type VertexAI = AI; - -// @public -export class VertexAIBackend extends Backend { - constructor(location?: string); - readonly location: string; -} - -// @public -export const VertexAIError: typeof AIError; - -// @public -export const VertexAIModel: typeof AIModel; - -// @public -export interface VertexAIOptions { - // (undocumented) - location?: string; -} - -// @public -export interface VideoMetadata { - endOffset: string; - startOffset: string; -} - -// @public (undocumented) -export interface WebAttribution { - // (undocumented) - title: string; - // (undocumented) - uri: string; -} - - -``` diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index b77a6b5910e..548c5c05f54 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -108,8 +108,8 @@ toc: path: /docs/reference/js/ai.numberschema.md - title: ObjectSchema path: /docs/reference/js/ai.objectschema.md - - title: ObjectSchemaInterface - path: /docs/reference/js/ai.objectschemainterface.md + - title: ObjectSchemaRequest + path: /docs/reference/js/ai.objectschemarequest.md - title: PromptFeedback path: /docs/reference/js/ai.promptfeedback.md - title: RequestOptions diff --git a/docs-devsite/ai.functiondeclaration.md b/docs-devsite/ai.functiondeclaration.md index 2a87d67ed47..29632463e2b 100644 --- a/docs-devsite/ai.functiondeclaration.md +++ b/docs-devsite/ai.functiondeclaration.md @@ -24,7 +24,7 @@ export declare interface FunctionDeclaration | --- | --- | --- | | [description](./ai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | | [name](./ai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./ai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [parameters](./ai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchema](./ai.objectschema.md#objectschema_class) \| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description @@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format Signature: ```typescript -parameters?: ObjectSchemaInterface; +parameters?: ObjectSchema | ObjectSchemaRequest; ``` diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 286c8351fd7..ad749658b4e 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -106,7 +106,7 @@ The Firebase AI Web SDK. | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | | [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | -| [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class. | +| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) format when not using the [ObjectSchema](./ai.objectschema.md#objectschema_class) helper. | | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | diff --git a/docs-devsite/ai.objectschemainterface.md b/docs-devsite/ai.objectschemainterface.md deleted file mode 100644 index 15b1a97f40d..00000000000 --- a/docs-devsite/ai.objectschemainterface.md +++ /dev/null @@ -1,43 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ObjectSchemaInterface interface -Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class. - -Signature: - -```typescript -export interface ObjectSchemaInterface extends SchemaInterface -``` -Extends: [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [optionalProperties](./ai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | -| [type](./ai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) | | - -## ObjectSchemaInterface.optionalProperties - -Signature: - -```typescript -optionalProperties?: string[]; -``` - -## ObjectSchemaInterface.type - -Signature: - -```typescript -type: SchemaType.OBJECT; -``` diff --git a/docs-devsite/ai.objectschemarequest.md b/docs-devsite/ai.objectschemarequest.md new file mode 100644 index 00000000000..ccc554ab42f --- /dev/null +++ b/docs-devsite/ai.objectschemarequest.md @@ -0,0 +1,45 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchemaRequest interface +Interface for JSON parameters in [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) format when not using the [ObjectSchema](./ai.objectschema.md#objectschema_class) helper. + +Signature: + +```typescript +export interface ObjectSchemaRequest extends SchemaRequest +``` +Extends: [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [optionalProperties](./ai.objectschemarequest.md#objectschemarequestoptionalproperties) | never | This is not a property accepted in the final request to the backend, but is a client-side convenience property that is only usable by constructing a schema through the Schema.object() helper method. Populating this property will cause response errors if the object is not wrapped with Schema.object(). | +| [type](./ai.objectschemarequest.md#objectschemarequesttype) | [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) | | + +## ObjectSchemaRequest.optionalProperties + +This is not a property accepted in the final request to the backend, but is a client-side convenience property that is only usable by constructing a schema through the `Schema.object()` helper method. Populating this property will cause response errors if the object is not wrapped with `Schema.object()`. + +Signature: + +```typescript +optionalProperties?: never; +``` + +## ObjectSchemaRequest.type + +Signature: + +```typescript +type: SchemaType.OBJECT; +``` diff --git a/packages/ai/src/requests/schema-builder.ts b/packages/ai/src/requests/schema-builder.ts index 7d9ece462b3..593a29c2d19 100644 --- a/packages/ai/src/requests/schema-builder.ts +++ b/packages/ai/src/requests/schema-builder.ts @@ -21,8 +21,7 @@ import { SchemaInterface, SchemaType, SchemaParams, - SchemaRequest, - ObjectSchemaInterface + SchemaRequest } from '../types/schema'; /** @@ -292,7 +291,7 @@ export class ObjectSchema extends Schema { if (required.length > 0) { obj.required = required; } - delete (obj as ObjectSchemaInterface).optionalProperties; + delete obj.optionalProperties; return obj as SchemaRequest; } } diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 67f45095c2a..9100a5c70aa 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { TypedSchema } from '../requests/schema-builder'; +import { ObjectSchema, TypedSchema } from '../requests/schema-builder'; import { Content, Part } from './content'; import { FunctionCallingMode, @@ -24,7 +24,7 @@ import { HarmCategory, ResponseModality } from './enums'; -import { ObjectSchemaInterface, SchemaRequest } from './schema'; +import { ObjectSchemaRequest, SchemaRequest } from './schema'; /** * Base parameters for a number of methods. @@ -193,7 +193,7 @@ export declare interface FunctionDeclaration { * format. Reflects the Open API 3.03 Parameter Object. Parameter names are * case-sensitive. For a function with no parameters, this can be left unset. */ - parameters?: ObjectSchemaInterface; + parameters?: ObjectSchema | ObjectSchemaRequest; } /** diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index 3a6c0c7301b..e19c3a38b41 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -114,10 +114,18 @@ export interface SchemaInterface extends SchemaShared { } /** - * Interface for {@link ObjectSchema} class. + * Interface for JSON parameters in {@link SchemaType.OBJECT} format when + * not using the {@link ObjectSchema} helper. * @public */ -export interface ObjectSchemaInterface extends SchemaInterface { +export interface ObjectSchemaRequest extends SchemaRequest { type: SchemaType.OBJECT; - optionalProperties?: string[]; + /** + * This is not a property accepted in the final request to the backend, but is + * a client-side convenience property that is only usable by constructing + * a schema through the `Schema.object()` helper method. Populating this + * property will cause response errors if the object is not wrapped with + * `Schema.object()`. + */ + optionalProperties?: never; } From a4ccd254dd1ecb63aa010ca010ad50d4b8a8316a Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 9 Jul 2025 09:55:51 -0400 Subject: [PATCH 238/295] feat(ai): add support for grounding with google search (#9068) --- .changeset/five-kids-grow.md | 6 + common/api-review/ai.api.md | 46 +++++- docs-devsite/_toc.yaml | 12 ++ docs-devsite/ai.functiondeclaration.md | 2 +- docs-devsite/ai.functiondeclarationstool.md | 2 +- docs-devsite/ai.googlesearch.md | 21 +++ docs-devsite/ai.googlesearchtool.md | 39 +++++ docs-devsite/ai.groundingchunk.md | 35 ++++ docs-devsite/ai.groundingmetadata.md | 49 +++++- docs-devsite/ai.groundingsupport.md | 46 ++++++ docs-devsite/ai.md | 12 +- docs-devsite/ai.searchentrypoint.md | 48 ++++++ docs-devsite/ai.segment.md | 24 ++- docs-devsite/ai.webgroundingchunk.md | 61 +++++++ .../ai/integration/generate-content.test.ts | 40 +++++ .../ai/src/methods/generate-content.test.ts | 47 ++++++ packages/ai/src/requests/request.ts | 1 + packages/ai/src/requests/stream-reader.ts | 2 + packages/ai/src/types/requests.ts | 41 ++++- packages/ai/src/types/responses.ts | 154 +++++++++++++++++- 20 files changed, 660 insertions(+), 28 deletions(-) create mode 100644 .changeset/five-kids-grow.md create mode 100644 docs-devsite/ai.googlesearch.md create mode 100644 docs-devsite/ai.googlesearchtool.md create mode 100644 docs-devsite/ai.groundingchunk.md create mode 100644 docs-devsite/ai.groundingsupport.md create mode 100644 docs-devsite/ai.searchentrypoint.md create mode 100644 docs-devsite/ai.webgroundingchunk.md diff --git a/.changeset/five-kids-grow.md b/.changeset/five-kids-grow.md new file mode 100644 index 00000000000..4303518b6ff --- /dev/null +++ b/.changeset/five-kids-grow.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add support for Grounding with Google Search. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 2fec980a271..8e150132cac 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -486,6 +486,15 @@ export interface GoogleAIGenerateContentResponse { usageMetadata?: UsageMetadata; } +// @public +export interface GoogleSearch { +} + +// @public +export interface GoogleSearchTool { + googleSearch: GoogleSearch; +} + // @public @deprecated (undocumented) export interface GroundingAttribution { // (undocumented) @@ -498,16 +507,29 @@ export interface GroundingAttribution { web?: WebAttribution; } +// @public +export interface GroundingChunk { + web?: WebGroundingChunk; +} + // @public export interface GroundingMetadata { // @deprecated (undocumented) groundingAttributions: GroundingAttribution[]; - // (undocumented) + groundingChunks?: GroundingChunk[]; + groundingSupports?: GroundingSupport[]; + // @deprecated (undocumented) retrievalQueries?: string[]; - // (undocumented) + searchEntryPoint?: SearchEntrypoint; webSearchQueries?: string[]; } +// @public +export interface GroundingSupport { + groundingChunkIndices?: number[]; + segment?: Segment; +} + // @public export enum HarmBlockMethod { PROBABILITY = "PROBABILITY", @@ -857,14 +879,17 @@ export enum SchemaType { STRING = "string" } -// @public (undocumented) +// @public +export interface SearchEntrypoint { + renderedContent?: string; +} + +// @public export interface Segment { - // (undocumented) endIndex: number; - // (undocumented) partIndex: number; - // (undocumented) startIndex: number; + text: string; } // @public @@ -901,7 +926,7 @@ export interface TextPart { } // @public -export type Tool = FunctionDeclarationsTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool; // @public export interface ToolConfig { @@ -961,5 +986,12 @@ export interface WebAttribution { uri: string; } +// @public +export interface WebGroundingChunk { + domain?: string; + title?: string; + uri?: string; +} + ``` diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 548c5c05f54..90c3d840bfa 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -76,10 +76,18 @@ toc: path: /docs/reference/js/ai.generativemodel.md - title: GoogleAIBackend path: /docs/reference/js/ai.googleaibackend.md + - title: GoogleSearch + path: /docs/reference/js/ai.googlesearch.md + - title: GoogleSearchTool + path: /docs/reference/js/ai.googlesearchtool.md - title: GroundingAttribution path: /docs/reference/js/ai.groundingattribution.md + - title: GroundingChunk + path: /docs/reference/js/ai.groundingchunk.md - title: GroundingMetadata path: /docs/reference/js/ai.groundingmetadata.md + - title: GroundingSupport + path: /docs/reference/js/ai.groundingsupport.md - title: ImagenGCSImage path: /docs/reference/js/ai.imagengcsimage.md - title: ImagenGenerationConfig @@ -130,6 +138,8 @@ toc: path: /docs/reference/js/ai.schemarequest.md - title: SchemaShared path: /docs/reference/js/ai.schemashared.md + - title: SearchEntrypoint + path: /docs/reference/js/ai.searchentrypoint.md - title: Segment path: /docs/reference/js/ai.segment.md - title: StartChatParams @@ -150,6 +160,8 @@ toc: path: /docs/reference/js/ai.videometadata.md - title: WebAttribution path: /docs/reference/js/ai.webattribution.md + - title: WebGroundingChunk + path: /docs/reference/js/ai.webgroundingchunk.md - title: analytics path: /docs/reference/js/analytics.md section: diff --git a/docs-devsite/ai.functiondeclaration.md b/docs-devsite/ai.functiondeclaration.md index 29632463e2b..460c9792655 100644 --- a/docs-devsite/ai.functiondeclaration.md +++ b/docs-devsite/ai.functiondeclaration.md @@ -15,7 +15,7 @@ Structured representation of a function declaration as defined by the [OpenAPI 3 Signature: ```typescript -export declare interface FunctionDeclaration +export interface FunctionDeclaration ``` ## Properties diff --git a/docs-devsite/ai.functiondeclarationstool.md b/docs-devsite/ai.functiondeclarationstool.md index bde785d730b..d72d9db2f53 100644 --- a/docs-devsite/ai.functiondeclarationstool.md +++ b/docs-devsite/ai.functiondeclarationstool.md @@ -15,7 +15,7 @@ A `FunctionDeclarationsTool` is a piece of code that enables the system to inter Signature: ```typescript -export declare interface FunctionDeclarationsTool +export interface FunctionDeclarationsTool ``` ## Properties diff --git a/docs-devsite/ai.googlesearch.md b/docs-devsite/ai.googlesearch.md new file mode 100644 index 00000000000..78fdef51606 --- /dev/null +++ b/docs-devsite/ai.googlesearch.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GoogleSearch interface +Specifies the Google Search configuration. + +Currently, this is an empty object, but it's reserved for future configuration options. + +Signature: + +```typescript +export interface GoogleSearch +``` diff --git a/docs-devsite/ai.googlesearchtool.md b/docs-devsite/ai.googlesearchtool.md new file mode 100644 index 00000000000..4e446b0cdea --- /dev/null +++ b/docs-devsite/ai.googlesearchtool.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GoogleSearchTool interface +A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses. + +Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). + +Signature: + +```typescript +export interface GoogleSearchTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [googleSearch](./ai.googlesearchtool.md#googlesearchtoolgooglesearch) | [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | + +## GoogleSearchTool.googleSearch + +Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. + +When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). + +Signature: + +```typescript +googleSearch: GoogleSearch; +``` diff --git a/docs-devsite/ai.groundingchunk.md b/docs-devsite/ai.groundingchunk.md new file mode 100644 index 00000000000..2b84af29d8e --- /dev/null +++ b/docs-devsite/ai.groundingchunk.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GroundingChunk interface +Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. + +Signature: + +```typescript +export interface GroundingChunk +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [web](./ai.groundingchunk.md#groundingchunkweb) | [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | Contains details if the grounding chunk is from a web source. | + +## GroundingChunk.web + +Contains details if the grounding chunk is from a web source. + +Signature: + +```typescript +web?: WebGroundingChunk; +``` diff --git a/docs-devsite/ai.groundingmetadata.md b/docs-devsite/ai.groundingmetadata.md index 90994d9c01c..52c963eb581 100644 --- a/docs-devsite/ai.groundingmetadata.md +++ b/docs-devsite/ai.groundingmetadata.md @@ -10,7 +10,11 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GroundingMetadata interface -Metadata returned to client when grounding is enabled. +Metadata returned when grounding is enabled. + +Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)). + +Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). Signature: @@ -23,13 +27,17 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | | [groundingAttributions](./ai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface)\[\] | | +| [groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface)\[\] | A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. | +| [groundingSupports](./ai.groundingmetadata.md#groundingmetadatagroundingsupports) | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface)\[\] | A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the groundingChunks. | | [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. | +| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. | ## GroundingMetadata.groundingAttributions > Warning: This API is now obsolete. > +> Use [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) instead. > Signature: @@ -38,16 +46,53 @@ export interface GroundingMetadata groundingAttributions: GroundingAttribution[]; ``` +## GroundingMetadata.groundingChunks + +A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. + +Signature: + +```typescript +groundingChunks?: GroundingChunk[]; +``` + +## GroundingMetadata.groundingSupports + +A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the `groundingChunks`. + +Signature: + +```typescript +groundingSupports?: GroundingSupport[]; +``` + ## GroundingMetadata.retrievalQueries +> Warning: This API is now obsolete. +> +> Use [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) instead. +> + Signature: ```typescript retrievalQueries?: string[]; ``` +## GroundingMetadata.searchEntryPoint + +Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. + +Signature: + +```typescript +searchEntryPoint?: SearchEntrypoint; +``` + ## GroundingMetadata.webSearchQueries +A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. + Signature: ```typescript diff --git a/docs-devsite/ai.groundingsupport.md b/docs-devsite/ai.groundingsupport.md new file mode 100644 index 00000000000..67eb190497c --- /dev/null +++ b/docs-devsite/ai.groundingsupport.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GroundingSupport interface +Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. + +Signature: + +```typescript +export interface GroundingSupport +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [groundingChunkIndices](./ai.groundingsupport.md#groundingsupportgroundingchunkindices) | number\[\] | A list of indices that refer to specific [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects within the [GroundingMetadata.groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) array. These referenced chunks are the sources that support the claim made in the associated segment of the response. For example, an array [1, 3, 4] means that groundingChunks[1], groundingChunks[3], and groundingChunks[4] are the retrieved content supporting this part of the response. | +| [segment](./ai.groundingsupport.md#groundingsupportsegment) | [Segment](./ai.segment.md#segment_interface) | Specifies the segment of the model's response content that this grounding support pertains to. | + +## GroundingSupport.groundingChunkIndices + +A list of indices that refer to specific [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects within the [GroundingMetadata.groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) array. These referenced chunks are the sources that support the claim made in the associated `segment` of the response. For example, an array `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`, and `groundingChunks[4]` are the retrieved content supporting this part of the response. + +Signature: + +```typescript +groundingChunkIndices?: number[]; +``` + +## GroundingSupport.segment + +Specifies the segment of the model's response content that this grounding support pertains to. + +Signature: + +```typescript +segment?: Segment; +``` diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index ad749658b4e..0c57da2e154 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -95,8 +95,12 @@ The Firebase AI Web SDK. | [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | | [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. | +| [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface) | A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses.Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. | +| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | +| [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | | [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | | [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | @@ -116,7 +120,8 @@ The Firebase AI Web SDK. | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./ai.schema.md#schema_class) static methods to create specific [Schema](./ai.schema.md#schema_class) classes. | | [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./ai.schema.md#schema_class) params passed to backend requests. | | [SchemaShared](./ai.schemashared.md#schemashared_interface) | Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. | -| [Segment](./ai.segment.md#segment_interface) | | +| [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google search entry point. | +| [Segment](./ai.segment.md#segment_interface) | Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to. | | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). | | [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | @@ -124,6 +129,7 @@ The Firebase AI Web SDK. | [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. | | [WebAttribution](./ai.webattribution.md#webattribution_interface) | | +| [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | A grounding chunk from the web.Important: If using Grounding with Google Search, you are required to comply with the [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google Search". | ## Variables @@ -400,7 +406,7 @@ Defines a tool that model can call to access external knowledge. Signature: ```typescript -export declare type Tool = FunctionDeclarationsTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool; ``` ## TypedSchema diff --git a/docs-devsite/ai.searchentrypoint.md b/docs-devsite/ai.searchentrypoint.md new file mode 100644 index 00000000000..db35db06a49 --- /dev/null +++ b/docs-devsite/ai.searchentrypoint.md @@ -0,0 +1,48 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SearchEntrypoint interface +Google search entry point. + +Signature: + +```typescript +export interface SearchEntrypoint +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [renderedContent](./ai.searchentrypoint.md#searchentrypointrenderedcontent) | string | HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid undesired interaction with the rest of the page's CSS.To ensure proper rendering and prevent CSS conflicts, it is recommended to encapsulate this renderedContent within a shadow DOM when embedding it into a webpage. See [MDN: Using shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM). | + +## SearchEntrypoint.renderedContent + +HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid undesired interaction with the rest of the page's CSS. + +To ensure proper rendering and prevent CSS conflicts, it is recommended to encapsulate this `renderedContent` within a shadow DOM when embedding it into a webpage. See [MDN: Using shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM). + +Signature: + +```typescript +renderedContent?: string; +``` + +### Example + + +```javascript +const container = document.createElement('div'); +document.body.appendChild(container); +container.attachShadow({ mode: 'open' }).innerHTML = renderedContent; + +``` + diff --git a/docs-devsite/ai.segment.md b/docs-devsite/ai.segment.md index 69f4aaf8407..35db1be5e83 100644 --- a/docs-devsite/ai.segment.md +++ b/docs-devsite/ai.segment.md @@ -10,6 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # Segment interface +Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to. Signature: @@ -21,12 +22,15 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./ai.segment.md#segmentendindex) | number | | -| [partIndex](./ai.segment.md#segmentpartindex) | number | | -| [startIndex](./ai.segment.md#segmentstartindex) | number | | +| [endIndex](./ai.segment.md#segmentendindex) | number | The zero-based end index of the segment within the specified Part, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment. | +| [partIndex](./ai.segment.md#segmentpartindex) | number | The zero-based index of the [Part](./ai.md#part) object within the parts array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to. | +| [startIndex](./ai.segment.md#segmentstartindex) | number | The zero-based start index of the segment within the specified Part, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., Part.text). | +| [text](./ai.segment.md#segmenttext) | string | The text corresponding to the segment from the response. | ## Segment.endIndex +The zero-based end index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment. + Signature: ```typescript @@ -35,6 +39,8 @@ endIndex: number; ## Segment.partIndex +The zero-based index of the [Part](./ai.md#part) object within the `parts` array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to. + Signature: ```typescript @@ -43,8 +49,20 @@ partIndex: number; ## Segment.startIndex +The zero-based start index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., `Part.text`). + Signature: ```typescript startIndex: number; ``` + +## Segment.text + +The text corresponding to the segment from the response. + +Signature: + +```typescript +text: string; +``` diff --git a/docs-devsite/ai.webgroundingchunk.md b/docs-devsite/ai.webgroundingchunk.md new file mode 100644 index 00000000000..8d4c59f7e23 --- /dev/null +++ b/docs-devsite/ai.webgroundingchunk.md @@ -0,0 +1,61 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# WebGroundingChunk interface +A grounding chunk from the web. + +Important: If using Grounding with Google Search, you are required to comply with the [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google Search". + +Signature: + +```typescript +export interface WebGroundingChunk +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [domain](./ai.webgroundingchunk.md#webgroundingchunkdomain) | string | The domain of the original URI from which the content was retrieved.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be undefined. | +| [title](./ai.webgroundingchunk.md#webgroundingchunktitle) | string | The title of the retrieved web page. | +| [uri](./ai.webgroundingchunk.md#webgroundingchunkuri) | string | The URI of the retrieved web page. | + +## WebGroundingChunk.domain + +The domain of the original URI from which the content was retrieved. + +This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`. + +Signature: + +```typescript +domain?: string; +``` + +## WebGroundingChunk.title + +The title of the retrieved web page. + +Signature: + +```typescript +title?: string; +``` + +## WebGroundingChunk.uri + +The URI of the retrieved web page. + +Signature: + +```typescript +uri?: string; +``` diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts index 22e4b0a30ac..2c1340186b0 100644 --- a/packages/ai/integration/generate-content.test.ts +++ b/packages/ai/integration/generate-content.test.ts @@ -144,6 +144,46 @@ describe('Generate Content', () => { } }); + it('generateContent: google search grounding', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + tools: [{ googleSearch: {} }] + }); + + const result = await model.generateContent( + 'What is the speed of light in a vaccuum in meters per second?' + ); + const response = result.response; + const trimmedText = response.text().trim(); + const groundingMetadata = response.candidates?.[0].groundingMetadata; + expect(trimmedText).to.contain('299,792,458'); + expect(groundingMetadata).to.exist; + expect(groundingMetadata!.searchEntryPoint?.renderedContent).to.contain( + 'div' + ); + expect( + groundingMetadata!.groundingChunks + ).to.have.length.greaterThanOrEqual(1); + groundingMetadata!.groundingChunks!.forEach(groundingChunk => { + expect(groundingChunk.web).to.exist; + expect(groundingChunk.web!.uri).to.exist; + }); + expect( + groundingMetadata?.groundingSupports + ).to.have.length.greaterThanOrEqual(1); + groundingMetadata!.groundingSupports!.forEach(groundingSupport => { + expect( + groundingSupport.groundingChunkIndices + ).to.have.length.greaterThanOrEqual(1); + expect(groundingSupport.segment).to.exist; + expect(groundingSupport.segment?.endIndex).to.exist; + expect(groundingSupport.segment?.text).to.exist; + // Since partIndex and startIndex are commonly 0, they may be omitted from responses. + }); + }); + it('generateContentStream: text input, text output', async () => { const model = getGenerativeModel(testConfig.ai, { model: testConfig.model, diff --git a/packages/ai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts index 13250fd83dd..a5e4c0d1b57 100644 --- a/packages/ai/src/methods/generate-content.test.ts +++ b/packages/ai/src/methods/generate-content.test.ts @@ -193,6 +193,53 @@ describe('generateContent()', () => { match.any ); }); + it('google search grounding', async () => { + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-google-search-grounding.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams + ); + expect(result.response.text()).to.include('The temperature is 67°F (19°C)'); + const groundingMetadata = result.response.candidates?.[0].groundingMetadata; + expect(groundingMetadata).to.not.be.undefined; + expect(groundingMetadata!.searchEntryPoint?.renderedContent).to.contain( + 'div' + ); + expect(groundingMetadata!.groundingChunks?.length).to.equal(2); + expect(groundingMetadata!.groundingChunks?.[0].web?.uri).to.contain( + 'https://vertexaisearch.cloud.google.com' + ); + expect(groundingMetadata!.groundingChunks?.[0].web?.title).to.equal( + 'accuweather.com' + ); + expect(groundingMetadata!.groundingSupports?.length).to.equal(3); + expect( + groundingMetadata!.groundingSupports?.[0].groundingChunkIndices + ).to.deep.equal([0]); + expect(groundingMetadata!.groundingSupports?.[0].segment).to.deep.equal({ + endIndex: 56, + text: 'The current weather in London, United Kingdom is cloudy.' + }); + expect(groundingMetadata!.groundingSupports?.[0].segment?.partIndex).to.be + .undefined; + expect(groundingMetadata!.groundingSupports?.[0].segment?.startIndex).to.be + .undefined; + + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.GENERATE_CONTENT, + fakeApiSettings, + false, + match.any + ); + }); it('blocked prompt', async () => { const mockResponse = getMockResponse( 'vertexAI', diff --git a/packages/ai/src/requests/request.ts b/packages/ai/src/requests/request.ts index 31c5e9b8125..3fa0b33012f 100644 --- a/packages/ai/src/requests/request.ts +++ b/packages/ai/src/requests/request.ts @@ -185,6 +185,7 @@ export async function makeRequest( } if ( response.status === 403 && + errorDetails && errorDetails.some( (detail: ErrorDetails) => detail.reason === 'SERVICE_DISABLED' ) && diff --git a/packages/ai/src/requests/stream-reader.ts b/packages/ai/src/requests/stream-reader.ts index 543d1d02266..c3a35b1da4a 100644 --- a/packages/ai/src/requests/stream-reader.ts +++ b/packages/ai/src/requests/stream-reader.ts @@ -190,6 +190,8 @@ export function aggregateResponses( candidate.finishMessage; aggregatedResponse.candidates[i].safetyRatings = candidate.safetyRatings; + aggregatedResponse.candidates[i].groundingMetadata = + candidate.groundingMetadata; /** * Candidates should always have content and parts, but this handles diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 9100a5c70aa..b74992b839d 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -165,7 +165,7 @@ export interface RequestOptions { * Defines a tool that model can call to access external knowledge. * @public */ -export declare type Tool = FunctionDeclarationsTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool; /** * Structured representation of a function declaration as defined by the @@ -176,7 +176,7 @@ export declare type Tool = FunctionDeclarationsTool; * as a Tool by the model and executed by the client. * @public */ -export declare interface FunctionDeclaration { +export interface FunctionDeclaration { /** * The name of the function to call. Must start with a letter or an * underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with @@ -196,13 +196,48 @@ export declare interface FunctionDeclaration { parameters?: ObjectSchema | ObjectSchemaRequest; } +/** + * A tool that allows a Gemini model to connect to Google Search to access and incorporate + * up-to-date information from the web into its responses. + * + * Important: If using Grounding with Google Search, you are required to comply with the + * "Grounding with Google Search" usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API} + * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms} + * section within the Service Specific Terms). + * + * @public + */ +export interface GoogleSearchTool { + /** + * Specifies the Google Search configuration. + * Currently, this is an empty object, but it's reserved for future configuration options. + * Specifies the Google Search configuration. Currently, this is an empty object, but it's + * reserved for future configuration options. + * + * When using this feature, you are required to comply with the "Grounding with Google Search" + * usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API} + * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms} + * section within the Service Specific Terms). + */ + googleSearch: GoogleSearch; +} + +/** + * Specifies the Google Search configuration. + * + * @remarks Currently, this is an empty object, but it's reserved for future configuration options. + * + * @public + */ +export interface GoogleSearch {} + /** * A `FunctionDeclarationsTool` is a piece of code that enables the system to * interact with external systems to perform an action, or set of actions, * outside of knowledge and scope of the model. * @public */ -export declare interface FunctionDeclarationsTool { +export interface FunctionDeclarationsTool { /** * Optional. One or more function declarations * to be passed to the model along with the current user query. Model may diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index 8072e06fd02..5e2fa3b65ca 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -171,36 +171,174 @@ export interface Citation { } /** - * Metadata returned to client when grounding is enabled. + * Metadata returned when grounding is enabled. + * + * Currently, only Grounding with Google Search is supported (see {@link GoogleSearchTool}). + * + * Important: If using Grounding with Google Search, you are required to comply with the + * "Grounding with Google Search" usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API} + * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms} + * section within the Service Specific Terms). + * * @public */ export interface GroundingMetadata { + /** + * Google Search entry point for web searches. This contains an HTML/CSS snippet that must be + * embedded in an app to display a Google Search entry point for follow-up web searches related to + * a model's “Grounded Response”. + */ + searchEntryPoint?: SearchEntrypoint; + /** + * A list of {@link GroundingChunk} objects. Each chunk represents a piece of retrieved content + * (for example, from a web page). that the model used to ground its response. + */ + groundingChunks?: GroundingChunk[]; + /** + * A list of {@link GroundingSupport} objects. Each object details how specific segments of the + * model's response are supported by the `groundingChunks`. + */ + groundingSupports?: GroundingSupport[]; + /** + * A list of web search queries that the model performed to gather the grounding information. + * These can be used to allow users to explore the search results themselves. + */ webSearchQueries?: string[]; + /** + * @deprecated Use {@link GroundingSupport} instead. + */ retrievalQueries?: string[]; /** - * @deprecated + * @deprecated Use {@link GroundingChunk} instead. */ groundingAttributions: GroundingAttribution[]; } /** - * @deprecated + * Google search entry point. + * * @public */ -export interface GroundingAttribution { - segment: Segment; - confidenceScore?: number; - web?: WebAttribution; - retrievedContext?: RetrievedContextAttribution; +export interface SearchEntrypoint { + /** + * HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid + * undesired interaction with the rest of the page's CSS. + * + * To ensure proper rendering and prevent CSS conflicts, it is recommended + * to encapsulate this `renderedContent` within a shadow DOM when embedding it + * into a webpage. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM | MDN: Using shadow DOM}. + * + * @example + * ```javascript + * const container = document.createElement('div'); + * document.body.appendChild(container); + * container.attachShadow({ mode: 'open' }).innerHTML = renderedContent; + * ``` + */ + renderedContent?: string; +} + +/** + * Represents a chunk of retrieved data that supports a claim in the model's response. This is part + * of the grounding information provided when grounding is enabled. + * + * @public + */ +export interface GroundingChunk { + /** + * Contains details if the grounding chunk is from a web source. + */ + web?: WebGroundingChunk; } /** + * A grounding chunk from the web. + * + * Important: If using Grounding with Google Search, you are required to comply with the + * {@link https://cloud.google.com/terms/service-terms | Service Specific Terms} for "Grounding with Google Search". + * + * @public + */ +export interface WebGroundingChunk { + /** + * The URI of the retrieved web page. + */ + uri?: string; + /** + * The title of the retrieved web page. + */ + title?: string; + /** + * The domain of the original URI from which the content was retrieved. + * + * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property will be + * `undefined`. + */ + domain?: string; +} + +/** + * Provides information about how a specific segment of the model's response is supported by the + * retrieved grounding chunks. + * + * @public + */ +export interface GroundingSupport { + /** + * Specifies the segment of the model's response content that this grounding support pertains to. + */ + segment?: Segment; + /** + * A list of indices that refer to specific {@link GroundingChunk} objects within the + * {@link GroundingMetadata.groundingChunks} array. These referenced chunks + * are the sources that support the claim made in the associated `segment` of the response. + * For example, an array `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`, + * and `groundingChunks[4]` are the retrieved content supporting this part of the response. + */ + groundingChunkIndices?: number[]; +} + +/** + * Represents a specific segment within a {@link Content} object, often used to + * pinpoint the exact location of text or data that grounding information refers to. + * * @public */ export interface Segment { + /** + * The zero-based index of the {@link Part} object within the `parts` array + * of its parent {@link Content} object. This identifies which part of the + * content the segment belongs to. + */ partIndex: number; + /** + * The zero-based start index of the segment within the specified `Part`, + * measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the + * beginning of the part's content (e.g., `Part.text`). + */ startIndex: number; + /** + * The zero-based end index of the segment within the specified `Part`, + * measured in UTF-8 bytes. This offset is exclusive, meaning the character + * at this index is not included in the segment. + */ endIndex: number; + /** + * The text corresponding to the segment from the response. + */ + text: string; +} + +/** + * @deprecated + * @public + */ +export interface GroundingAttribution { + segment: Segment; + confidenceScore?: number; + web?: WebAttribution; + retrievedContext?: RetrievedContextAttribution; } /** From 91fa484b5a6081ad9c59d3b62416a2b5252b95a6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 9 Jul 2025 10:30:28 -0400 Subject: [PATCH 239/295] feat!(ai): Remove `vertexai` import alias (#9081) --- .changeset/late-beers-develop.md | 5 +++++ packages/firebase/package.json | 13 ------------- packages/firebase/vertexai/index.ts | 18 ------------------ packages/firebase/vertexai/package.json | 7 ------- 4 files changed, 5 insertions(+), 38 deletions(-) create mode 100644 .changeset/late-beers-develop.md delete mode 100644 packages/firebase/vertexai/index.ts delete mode 100644 packages/firebase/vertexai/package.json diff --git a/.changeset/late-beers-develop.md b/.changeset/late-beers-develop.md new file mode 100644 index 00000000000..55a8e0c072b --- /dev/null +++ b/.changeset/late-beers-develop.md @@ -0,0 +1,5 @@ +--- +'firebase': major +--- + +Remove `vertexai` import path diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 4f785d15c8c..20c37b3a4b7 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -239,18 +239,6 @@ }, "default": "./ai/dist/esm/index.esm.js" }, - "./vertexai": { - "types": "./ai/dist/ai/index.d.ts", - "node": { - "require": "./ai/dist/index.cjs.js", - "import": "./ai/dist/index.mjs" - }, - "browser": { - "require": "./ai/dist/index.cjs.js", - "import": "./ai/dist/esm/index.esm.js" - }, - "default": "./ai/dist/esm/index.esm.js" - }, "./compat/analytics": { "types": "./compat/analytics/dist/compat/analytics/index.d.ts", "node": { @@ -472,7 +460,6 @@ "messaging", "messaging/sw", "database", - "vertexai", "data-connect" ], "typings": "empty.d.ts" diff --git a/packages/firebase/vertexai/index.ts b/packages/firebase/vertexai/index.ts deleted file mode 100644 index 530f99162ed..00000000000 --- a/packages/firebase/vertexai/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2024 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. - */ - -export * from '@firebase/ai'; diff --git a/packages/firebase/vertexai/package.json b/packages/firebase/vertexai/package.json deleted file mode 100644 index 3da541949dc..00000000000 --- a/packages/firebase/vertexai/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "firebase/vertexai", - "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm.js", - "module": "dist/esm/index.esm.js", - "typings": "dist/ai/index.d.ts" -} From 47b154c75a7ea5f81851eda20de9222bd803bfef Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Wed, 9 Jul 2025 14:40:45 +0000 Subject: [PATCH 240/295] docs(firestore): add an example to the detailed comment in compareUtf8Strings() (#9154) --- packages/firestore/src/util/misc.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/firestore/src/util/misc.ts b/packages/firestore/src/util/misc.ts index 9de7cffb10b..f2fa04d1b43 100644 --- a/packages/firestore/src/util/misc.ts +++ b/packages/firestore/src/util/misc.ts @@ -95,6 +95,22 @@ export function compareUtf8Strings(left: string, right: string): number { // used to represent code points greater than 0xFFFF which have 4-byte UTF-8 representations // and are lexicographically greater than the 1, 2, or 3-byte representations of code points // less than or equal to 0xFFFF. + // + // An example of why Case 2 is required is comparing the following two Unicode code points: + // + // |-----------------------|------------|---------------------|-----------------| + // | Name | Code Point | UTF-8 Encoding | UTF-16 Encoding | + // |-----------------------|------------|---------------------|-----------------| + // | Replacement Character | U+FFFD | 0xEF 0xBF 0xBD | 0xFFFD | + // | Grinning Face | U+1F600 | 0xF0 0x9F 0x98 0x80 | 0xD83D 0xDE00 | + // |-----------------------|------------|---------------------|-----------------| + // + // A lexicographical comparison of the UTF-8 encodings of these code points would order + // "Replacement Character" _before_ "Grinning Face" because 0xEF is less than 0xF0. However, a + // direct comparison of the UTF-16 code units, as would be done in case 1, would erroneously + // produce the _opposite_ ordering, because 0xFFFD is _greater than_ 0xD83D. As it turns out, + // this relative ordering holds for all comparisons of UTF-16 code points requiring a surrogate + // pair with those that do not. const length = Math.min(left.length, right.length); for (let i = 0; i < length; i++) { const leftChar = left.charAt(i); From 6ab4e13a1665dab4be89ecc141b4584a5a6df569 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 9 Jul 2025 14:25:32 -0400 Subject: [PATCH 241/295] feat(ai): Add support for Thinking Budget (#9156) --- .changeset/hip-impalas-divide.md | 6 +++ common/api-review/ai.api.md | 7 +++ docs-devsite/_toc.yaml | 2 + docs-devsite/ai.generationconfig.md | 11 +++++ docs-devsite/ai.md | 1 + docs-devsite/ai.thinkingconfig.md | 43 +++++++++++++++++++ docs-devsite/ai.usagemetadata.md | 11 +++++ .../ai/integration/generate-content.test.ts | 4 ++ packages/ai/src/types/requests.ts | 29 +++++++++++++ packages/ai/src/types/responses.ts | 4 ++ 10 files changed, 118 insertions(+) create mode 100644 .changeset/hip-impalas-divide.md create mode 100644 docs-devsite/ai.thinkingconfig.md diff --git a/.changeset/hip-impalas-divide.md b/.changeset/hip-impalas-divide.md new file mode 100644 index 00000000000..49f7cb8836d --- /dev/null +++ b/.changeset/hip-impalas-divide.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add support for Thinking Budget. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 8e150132cac..ffd358e5d3e 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -381,6 +381,7 @@ export interface GenerationConfig { stopSequences?: string[]; // (undocumented) temperature?: number; + thinkingConfig?: ThinkingConfig; // (undocumented) topK?: number; // (undocumented) @@ -925,6 +926,11 @@ export interface TextPart { text: string; } +// @public +export interface ThinkingConfig { + thinkingBudget?: number; +} + // @public export type Tool = FunctionDeclarationsTool | GoogleSearchTool; @@ -947,6 +953,7 @@ export interface UsageMetadata { promptTokenCount: number; // (undocumented) promptTokensDetails?: ModalityTokenCount[]; + thoughtsTokenCount?: number; // (undocumented) totalTokenCount: number; } diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 90c3d840bfa..344fa784904 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -148,6 +148,8 @@ toc: path: /docs/reference/js/ai.stringschema.md - title: TextPart path: /docs/reference/js/ai.textpart.md + - title: ThinkingConfig + path: /docs/reference/js/ai.thinkingconfig.md - title: ToolConfig path: /docs/reference/js/ai.toolconfig.md - title: UsageMetadata diff --git a/docs-devsite/ai.generationconfig.md b/docs-devsite/ai.generationconfig.md index f9697a07454..e791bde9485 100644 --- a/docs-devsite/ai.generationconfig.md +++ b/docs-devsite/ai.generationconfig.md @@ -31,6 +31,7 @@ export interface GenerationConfig | [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
    Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | | [stopSequences](./ai.generationconfig.md#generationconfigstopsequences) | string\[\] | | | [temperature](./ai.generationconfig.md#generationconfigtemperature) | number | | +| [thinkingConfig](./ai.generationconfig.md#generationconfigthinkingconfig) | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models. | | [topK](./ai.generationconfig.md#generationconfigtopk) | number | | | [topP](./ai.generationconfig.md#generationconfigtopp) | number | | @@ -117,6 +118,16 @@ stopSequences?: string[]; temperature?: number; ``` +## GenerationConfig.thinkingConfig + +Configuration for "thinking" behavior of compatible Gemini models. + +Signature: + +```typescript +thinkingConfig?: ThinkingConfig; +``` + ## GenerationConfig.topK Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 0c57da2e154..96bb63e83ee 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -124,6 +124,7 @@ The Firebase AI Web SDK. | [Segment](./ai.segment.md#segment_interface) | Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to. | | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). | | [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | | [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | | [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | diff --git a/docs-devsite/ai.thinkingconfig.md b/docs-devsite/ai.thinkingconfig.md new file mode 100644 index 00000000000..ec348a20487 --- /dev/null +++ b/docs-devsite/ai.thinkingconfig.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ThinkingConfig interface +Configuration for "thinking" behavior of compatible Gemini models. + +Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. + +Signature: + +```typescript +export interface ThinkingConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [thinkingBudget](./ai.thinkingconfig.md#thinkingconfigthinkingbudget) | number | The thinking budget, in tokens.This parameter sets an upper limit on the number of tokens the model can use for its internal "thinking" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range. | + +## ThinkingConfig.thinkingBudget + +The thinking budget, in tokens. + +This parameter sets an upper limit on the number of tokens the model can use for its internal "thinking" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost. + +If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt. + +An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range. + +Signature: + +```typescript +thinkingBudget?: number; +``` diff --git a/docs-devsite/ai.usagemetadata.md b/docs-devsite/ai.usagemetadata.md index 4211fea72b4..954fcc6e530 100644 --- a/docs-devsite/ai.usagemetadata.md +++ b/docs-devsite/ai.usagemetadata.md @@ -26,6 +26,7 @@ export interface UsageMetadata | [candidatesTokensDetails](./ai.usagemetadata.md#usagemetadatacandidatestokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | | | [promptTokenCount](./ai.usagemetadata.md#usagemetadataprompttokencount) | number | | | [promptTokensDetails](./ai.usagemetadata.md#usagemetadataprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | | +| [thoughtsTokenCount](./ai.usagemetadata.md#usagemetadatathoughtstokencount) | number | The number of tokens used by the model's internal "thinking" process. | | [totalTokenCount](./ai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount @@ -60,6 +61,16 @@ promptTokenCount: number; promptTokensDetails?: ModalityTokenCount[]; ``` +## UsageMetadata.thoughtsTokenCount + +The number of tokens used by the model's internal "thinking" process. + +Signature: + +```typescript +thoughtsTokenCount?: number; +``` + ## UsageMetadata.totalTokenCount Signature: diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts index 2c1340186b0..0b83df38ecb 100644 --- a/packages/ai/integration/generate-content.test.ts +++ b/packages/ai/integration/generate-content.test.ts @@ -91,6 +91,10 @@ describe('Generate Content', () => { 2, TOKEN_COUNT_DELTA ); + expect(response.usageMetadata!.thoughtsTokenCount).to.be.closeTo( + 30, + TOKEN_COUNT_DELTA * 2 + ); expect(response.usageMetadata!.totalTokenCount).to.be.closeTo( 55, TOKEN_COUNT_DELTA * 2 diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index b74992b839d..be18fb16797 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -113,6 +113,10 @@ export interface GenerationConfig { * @beta */ responseModalities?: ResponseModality[]; + /** + * Configuration for "thinking" behavior of compatible Gemini models. + */ + thinkingConfig?: ThinkingConfig; } /** @@ -266,3 +270,28 @@ export interface FunctionCallingConfig { mode?: FunctionCallingMode; allowedFunctionNames?: string[]; } + +/** + * Configuration for "thinking" behavior of compatible Gemini models. + * + * Certain models utilize a thinking process before generating a response. This allows them to + * reason through complex problems and plan a more coherent and accurate answer. + * + * @public + */ +export interface ThinkingConfig { + /** + * The thinking budget, in tokens. + * + * This parameter sets an upper limit on the number of tokens the model can use for its internal + * "thinking" process. A higher budget may result in higher quality responses for complex tasks + * but can also increase latency and cost. + * + * If you don't specify a budget, the model will determine the appropriate amount + * of thinking based on the complexity of the prompt. + * + * An error will be thrown if you set a thinking budget for a model that does not support this + * feature or if the specified budget is not within the model's supported range. + */ + thinkingBudget?: number; +} diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index 5e2fa3b65ca..5fab203600d 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -92,6 +92,10 @@ export interface GenerateContentResponse { export interface UsageMetadata { promptTokenCount: number; candidatesTokenCount: number; + /** + * The number of tokens used by the model's internal "thinking" process. + */ + thoughtsTokenCount?: number; totalTokenCount: number; promptTokensDetails?: ModalityTokenCount[]; candidatesTokensDetails?: ModalityTokenCount[]; From ec5f37403d9ebe28d3d71a7789d59edfb12762df Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 9 Jul 2025 14:51:53 -0400 Subject: [PATCH 242/295] feat!(ai): remove `VertexAI` APIs (#9063) --- .changeset/thirty-eggs-laugh.md | 6 ++ common/api-review/ai.api.md | 24 +----- docs-devsite/_toc.yaml | 2 - docs-devsite/ai.md | 76 ----------------- docs-devsite/ai.vertexaioptions.md | 33 ------- packages/ai/src/api.ts | 57 +------------ .../ai/src/backwards-compatbility.test.ts | 85 ------------------- packages/ai/src/public-types.ts | 20 ----- 8 files changed, 9 insertions(+), 294 deletions(-) create mode 100644 .changeset/thirty-eggs-laugh.md delete mode 100644 docs-devsite/ai.vertexaioptions.md delete mode 100644 packages/ai/src/backwards-compatbility.test.ts diff --git a/.changeset/thirty-eggs-laugh.md b/.changeset/thirty-eggs-laugh.md new file mode 100644 index 00000000000..6a7611f5eb7 --- /dev/null +++ b/.changeset/thirty-eggs-laugh.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': major +'firebase': major +--- + +Remove `VertexAI` APIs. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index ffd358e5d3e..ba93f2765fb 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -27,7 +27,7 @@ export class AIError extends FirebaseError { } // @public -const enum AIErrorCode { +export const enum AIErrorCode { API_NOT_ENABLED = "api-not-enabled", ERROR = "error", FETCH_ERROR = "fetch-error", @@ -43,10 +43,6 @@ const enum AIErrorCode { UNSUPPORTED = "unsupported" } -export { AIErrorCode } - -export { AIErrorCode as VertexAIErrorCode } - // @public export abstract class AIModel { // @internal @@ -425,9 +421,6 @@ export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOpti // @beta export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; -// @public @deprecated (undocumented) -export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; - // @public export class GoogleAIBackend extends Backend { constructor(); @@ -958,27 +951,12 @@ export interface UsageMetadata { totalTokenCount: number; } -// @public @deprecated (undocumented) -export type VertexAI = AI; - // @public export class VertexAIBackend extends Backend { constructor(location?: string); readonly location: string; } -// @public @deprecated (undocumented) -export const VertexAIError: typeof AIError; - -// @public @deprecated (undocumented) -export const VertexAIModel: typeof AIModel; - -// @public -export interface VertexAIOptions { - // (undocumented) - location?: string; -} - // @public export interface VideoMetadata { endOffset: string; diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 344fa784904..495567e6092 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -156,8 +156,6 @@ toc: path: /docs/reference/js/ai.usagemetadata.md - title: VertexAIBackend path: /docs/reference/js/ai.vertexaibackend.md - - title: VertexAIOptions - path: /docs/reference/js/ai.vertexaioptions.md - title: VideoMetadata path: /docs/reference/js/ai.videometadata.md - title: WebAttribution diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 96bb63e83ee..2f695e88cf8 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -18,7 +18,6 @@ The Firebase AI Web SDK. | --- | --- | | function(app, ...) | | [getAI(app, options)](./ai.md#getai_a94a413) | Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | -| [getVertexAI(app, options)](./ai.md#getvertexai_04094cf) | | | function(ai, ...) | | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | | [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | @@ -127,7 +126,6 @@ The Firebase AI Web SDK. | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | | [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. | | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. | | [WebAttribution](./ai.webattribution.md#webattribution_interface) | | | [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | A grounding chunk from the web.Important: If using Grounding with Google Search, you are required to comply with the [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google Search". | @@ -139,8 +137,6 @@ The Firebase AI Web SDK. | [BackendType](./ai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.These values are assigned to the backendType property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | -| [VertexAIError](./ai.md#vertexaierror) | | -| [VertexAIModel](./ai.md#vertexaimodel) | | ## Type Aliases @@ -152,7 +148,6 @@ The Firebase AI Web SDK. | [Role](./ai.md#role) | Role is the producer of the content. | | [Tool](./ai.md#tool) | Defines a tool that model can call to access external knowledge. | | [TypedSchema](./ai.md#typedschema) | A type that includes all specific Schema types. | -| [VertexAI](./ai.md#vertexai) | | ## function(app, ...) @@ -205,32 +200,6 @@ const ai = getAI(app, { backend: new VertexAIBackend() }); ``` -### getVertexAI(app, options) {:#getvertexai_04094cf} - -> Warning: This API is now obsolete. -> -> Use the new [getAI()](./ai.md#getai_a94a413) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). -> -> Returns a [VertexAI](./ai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. -> - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options to configure the Vertex AI instance, including the location. | - -Returns: - -[VertexAI](./ai.md#vertexai) - ## function(ai, ...) ### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839} @@ -327,36 +296,6 @@ ResponseModality: { } ``` -## VertexAIError - -> Warning: This API is now obsolete. -> -> Use the new [AIError](./ai.aierror.md#aierror_class) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). -> -> Error class for the Firebase AI SDK. -> - -Signature: - -```typescript -VertexAIError: typeof AIError -``` - -## VertexAIModel - -> Warning: This API is now obsolete. -> -> Use the new [AIModel](./ai.aimodel.md#aimodel_class) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). -> -> Base class for Firebase AI model APIs. -> - -Signature: - -```typescript -VertexAIModel: typeof AIModel -``` - ## BackendType Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. @@ -420,21 +359,6 @@ A type that includes all specific Schema types. export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; ``` -## VertexAI - -> Warning: This API is now obsolete. -> -> Use the new [AI](./ai.ai.md#ai_interface) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). -> -> An instance of the Firebase AI SDK. -> - -Signature: - -```typescript -export type VertexAI = AI; -``` - ## AIErrorCode Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. diff --git a/docs-devsite/ai.vertexaioptions.md b/docs-devsite/ai.vertexaioptions.md deleted file mode 100644 index 311fa4785f7..00000000000 --- a/docs-devsite/ai.vertexaioptions.md +++ /dev/null @@ -1,33 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# VertexAIOptions interface -Options when initializing the Firebase AI SDK. - -Signature: - -```typescript -export interface VertexAIOptions -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [location](./ai.vertexaioptions.md#vertexaioptionslocation) | string | | - -## VertexAIOptions.location - -Signature: - -```typescript -location?: string; -``` diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index d2229c067fc..e9264262145 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -20,7 +20,7 @@ import { Provider } from '@firebase/component'; import { getModularInstance } from '@firebase/util'; import { AI_TYPE } from './constants'; import { AIService } from './service'; -import { AI, AIOptions, VertexAI, VertexAIOptions } from './public-types'; +import { AI, AIOptions } from './public-types'; import { ImagenModelParams, ModelParams, @@ -30,7 +30,7 @@ import { import { AIError } from './errors'; import { AIModel, GenerativeModel, ImagenModel } from './models'; import { encodeInstanceIdentifier } from './helpers'; -import { GoogleAIBackend, VertexAIBackend } from './backend'; +import { GoogleAIBackend } from './backend'; export { ChatSession } from './methods/chat-session'; export * from './requests/schema-builder'; @@ -38,65 +38,12 @@ export { ImagenImageFormat } from './requests/imagen-image-format'; export { AIModel, GenerativeModel, ImagenModel, AIError }; export { Backend, VertexAIBackend, GoogleAIBackend } from './backend'; -export { AIErrorCode as VertexAIErrorCode }; - -/** - * @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been - * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and - * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. - * - * Base class for Firebase AI model APIs. - * - * @public - */ -export const VertexAIModel = AIModel; - -/** - * @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been - * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and - * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. - * - * Error class for the Firebase AI SDK. - * - * @public - */ -export const VertexAIError = AIError; - declare module '@firebase/component' { interface NameServiceMapping { [AI_TYPE]: AIService; } } -/** - * @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been - * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and - * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. - * - * Returns a {@link VertexAI} instance for the given app, configured to use the - * Vertex AI Gemini API. This instance will be - * configured to use the Vertex AI Gemini API. - * - * @param app - The {@link @firebase/app#FirebaseApp} to use. - * @param options - Options to configure the Vertex AI instance, including the location. - * - * @public - */ -export function getVertexAI( - app: FirebaseApp = getApp(), - options?: VertexAIOptions -): VertexAI { - app = getModularInstance(app); - // Dependencies - const AIProvider: Provider<'AI'> = _getProvider(app, AI_TYPE); - - const backend = new VertexAIBackend(options?.location); - const identifier = encodeInstanceIdentifier(backend); - return AIProvider.getImmediate({ - identifier - }); -} - /** * Returns the default {@link AI} instance that is associated with the provided * {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new instance with the diff --git a/packages/ai/src/backwards-compatbility.test.ts b/packages/ai/src/backwards-compatbility.test.ts deleted file mode 100644 index 62463009b24..00000000000 --- a/packages/ai/src/backwards-compatbility.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @license - * Copyright 2025 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 { expect } from 'chai'; -import { - AIError, - AIModel, - GenerativeModel, - VertexAIError, - VertexAIErrorCode, - VertexAIModel, - getGenerativeModel, - getImagenModel -} from './api'; -import { AI, VertexAI, AIErrorCode } from './public-types'; -import { VertexAIBackend } from './backend'; - -function assertAssignable(): void {} - -const fakeAI: AI = { - app: { - name: 'DEFAULT', - automaticDataCollectionEnabled: true, - options: { - apiKey: 'key', - projectId: 'my-project', - appId: 'app-id' - } - }, - backend: new VertexAIBackend('us-central1'), - location: 'us-central1' -}; - -const fakeVertexAI: VertexAI = fakeAI; - -describe('backwards-compatible types', () => { - it('AI is backwards compatible with VertexAI', () => { - assertAssignable(); - }); - it('AIError is backwards compatible with VertexAIError', () => { - assertAssignable(); - const err = new VertexAIError(VertexAIErrorCode.ERROR, ''); - expect(err).instanceOf(AIError); - expect(err).instanceOf(VertexAIError); - }); - it('AIErrorCode is backwards compatible with VertexAIErrorCode', () => { - assertAssignable(); - const errCode = AIErrorCode.ERROR; - expect(errCode).to.equal(VertexAIErrorCode.ERROR); - }); - it('AIModel is backwards compatible with VertexAIModel', () => { - assertAssignable(); - - const model = new GenerativeModel(fakeAI, { model: 'model-name' }); - expect(model).to.be.instanceOf(AIModel); - expect(model).to.be.instanceOf(VertexAIModel); - }); -}); - -describe('backward-compatible functions', () => { - it('getGenerativeModel', () => { - const model = getGenerativeModel(fakeVertexAI, { model: 'model-name' }); - expect(model).to.be.instanceOf(AIModel); - expect(model).to.be.instanceOf(VertexAIModel); - }); - it('getImagenModel', () => { - const model = getImagenModel(fakeVertexAI, { model: 'model-name' }); - expect(model).to.be.instanceOf(AIModel); - expect(model).to.be.instanceOf(VertexAIModel); - }); -}); diff --git a/packages/ai/src/public-types.ts b/packages/ai/src/public-types.ts index 7a5b7dc3997..57812f20c1e 100644 --- a/packages/ai/src/public-types.ts +++ b/packages/ai/src/public-types.ts @@ -20,26 +20,6 @@ import { Backend } from './backend'; export * from './types'; -/** - * @deprecated Use the new {@link AI | AI} instead. The Vertex AI in Firebase SDK has been - * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and - * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. - * - * An instance of the Firebase AI SDK. - * - * @public - */ -export type VertexAI = AI; - -/** - * Options when initializing the Firebase AI SDK. - * - * @public - */ -export interface VertexAIOptions { - location?: string; -} - /** * An instance of the Firebase AI SDK. * From e59cd7da1f375ec89f237ceb684c9f450d65cd34 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 10 Jul 2025 16:14:41 -0700 Subject: [PATCH 243/295] fix!(ai): convert TS enums exports in Firebase AI into const variables (#9137) --- .changeset/shy-yaks-hammer.md | 6 + common/api-review/ai.api.md | 250 +++++---- docs-devsite/ai.md | 507 +++++++++++-------- docs-devsite/ai.objectschemarequest.md | 6 +- docs-devsite/ai.schema.md | 8 +- docs-devsite/ai.schemashared.md | 8 +- packages/ai/src/errors.ts | 2 +- packages/ai/src/requests/response-helpers.ts | 2 +- packages/ai/src/requests/schema-builder.ts | 6 +- packages/ai/src/types/enums.ts | 175 ++++--- packages/ai/src/types/error.ts | 37 +- packages/ai/src/types/imagen/requests.ts | 78 ++- packages/ai/src/types/imagen/responses.ts | 4 +- packages/ai/src/types/schema.ts | 38 +- 14 files changed, 694 insertions(+), 433 deletions(-) create mode 100644 .changeset/shy-yaks-hammer.md diff --git a/.changeset/shy-yaks-hammer.md b/.changeset/shy-yaks-hammer.md new file mode 100644 index 00000000000..47b4df179e5 --- /dev/null +++ b/.changeset/shy-yaks-hammer.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': major +'firebase': major +--- + +Convert TS enums exports in Firebase AI into const variables. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index ba93f2765fb..7c1e449689c 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -27,21 +27,24 @@ export class AIError extends FirebaseError { } // @public -export const enum AIErrorCode { - API_NOT_ENABLED = "api-not-enabled", - ERROR = "error", - FETCH_ERROR = "fetch-error", - INVALID_CONTENT = "invalid-content", - INVALID_SCHEMA = "invalid-schema", - NO_API_KEY = "no-api-key", - NO_APP_ID = "no-app-id", - NO_MODEL = "no-model", - NO_PROJECT_ID = "no-project-id", - PARSE_FAILED = "parse-failed", - REQUEST_ERROR = "request-error", - RESPONSE_ERROR = "response-error", - UNSUPPORTED = "unsupported" -} +export const AIErrorCode: { + readonly ERROR: "error"; + readonly REQUEST_ERROR: "request-error"; + readonly RESPONSE_ERROR: "response-error"; + readonly FETCH_ERROR: "fetch-error"; + readonly INVALID_CONTENT: "invalid-content"; + readonly API_NOT_ENABLED: "api-not-enabled"; + readonly INVALID_SCHEMA: "invalid-schema"; + readonly NO_API_KEY: "no-api-key"; + readonly NO_APP_ID: "no-app-id"; + readonly NO_MODEL: "no-model"; + readonly NO_PROJECT_ID: "no-project-id"; + readonly PARSE_FAILED: "parse-failed"; + readonly UNSUPPORTED: "unsupported"; +}; + +// @public +export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode]; // @public export abstract class AIModel { @@ -94,12 +97,15 @@ export interface BaseParams { } // @public -export enum BlockReason { - BLOCKLIST = "BLOCKLIST", - OTHER = "OTHER", - PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - SAFETY = "SAFETY" -} +export const BlockReason: { + readonly SAFETY: "SAFETY"; + readonly OTHER: "OTHER"; + readonly BLOCKLIST: "BLOCKLIST"; + readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT"; +}; + +// @public +export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason]; // @public export class BooleanSchema extends Schema { @@ -226,17 +232,20 @@ export interface FileDataPart { } // @public -export enum FinishReason { - BLOCKLIST = "BLOCKLIST", - MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", - MAX_TOKENS = "MAX_TOKENS", - OTHER = "OTHER", - PROHIBITED_CONTENT = "PROHIBITED_CONTENT", - RECITATION = "RECITATION", - SAFETY = "SAFETY", - SPII = "SPII", - STOP = "STOP" -} +export const FinishReason: { + readonly STOP: "STOP"; + readonly MAX_TOKENS: "MAX_TOKENS"; + readonly SAFETY: "SAFETY"; + readonly RECITATION: "RECITATION"; + readonly OTHER: "OTHER"; + readonly BLOCKLIST: "BLOCKLIST"; + readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT"; + readonly SPII: "SPII"; + readonly MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL"; +}; + +// @public +export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; // @public export interface FunctionCall { @@ -255,11 +264,14 @@ export interface FunctionCallingConfig { } // @public (undocumented) -export enum FunctionCallingMode { - ANY = "ANY", - AUTO = "AUTO", - NONE = "NONE" -} +export const FunctionCallingMode: { + readonly AUTO: "AUTO"; + readonly ANY: "ANY"; + readonly NONE: "NONE"; +}; + +// @public (undocumented) +export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode]; // @public export interface FunctionCallPart { @@ -525,57 +537,71 @@ export interface GroundingSupport { } // @public -export enum HarmBlockMethod { - PROBABILITY = "PROBABILITY", - SEVERITY = "SEVERITY" -} +export const HarmBlockMethod: { + readonly SEVERITY: "SEVERITY"; + readonly PROBABILITY: "PROBABILITY"; +}; // @public -export enum HarmBlockThreshold { - BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", - BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", - BLOCK_NONE = "BLOCK_NONE", - BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", - OFF = "OFF" -} +export type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod]; // @public -export enum HarmCategory { - // (undocumented) - HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", - // (undocumented) - HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", - // (undocumented) - HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", - // (undocumented) - HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT" -} +export const HarmBlockThreshold: { + readonly BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE"; + readonly BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE"; + readonly BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH"; + readonly BLOCK_NONE: "BLOCK_NONE"; + readonly OFF: "OFF"; +}; // @public -export enum HarmProbability { - HIGH = "HIGH", - LOW = "LOW", - MEDIUM = "MEDIUM", - NEGLIGIBLE = "NEGLIGIBLE" -} +export type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold]; // @public -export enum HarmSeverity { - HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", - HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", - HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", - HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", - HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED" -} +export const HarmCategory: { + readonly HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH"; + readonly HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT"; + readonly HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT"; + readonly HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT"; +}; + +// @public +export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory]; + +// @public +export const HarmProbability: { + readonly NEGLIGIBLE: "NEGLIGIBLE"; + readonly LOW: "LOW"; + readonly MEDIUM: "MEDIUM"; + readonly HIGH: "HIGH"; +}; + +// @public +export type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability]; + +// @public +export const HarmSeverity: { + readonly HARM_SEVERITY_NEGLIGIBLE: "HARM_SEVERITY_NEGLIGIBLE"; + readonly HARM_SEVERITY_LOW: "HARM_SEVERITY_LOW"; + readonly HARM_SEVERITY_MEDIUM: "HARM_SEVERITY_MEDIUM"; + readonly HARM_SEVERITY_HIGH: "HARM_SEVERITY_HIGH"; + readonly HARM_SEVERITY_UNSUPPORTED: "HARM_SEVERITY_UNSUPPORTED"; +}; + +// @public +export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; // @beta -export enum ImagenAspectRatio { - LANDSCAPE_16x9 = "16:9", - LANDSCAPE_3x4 = "3:4", - PORTRAIT_4x3 = "4:3", - PORTRAIT_9x16 = "9:16", - SQUARE = "1:1" -} +export const ImagenAspectRatio: { + readonly SQUARE: "1:1"; + readonly LANDSCAPE_3x4: "3:4"; + readonly PORTRAIT_4x3: "4:3"; + readonly LANDSCAPE_16x9: "16:9"; + readonly PORTRAIT_9x16: "9:16"; +}; + +// @beta +export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; // @public export interface ImagenGCSImage { @@ -632,19 +658,25 @@ export interface ImagenModelParams { } // @beta -export enum ImagenPersonFilterLevel { - ALLOW_ADULT = "allow_adult", - ALLOW_ALL = "allow_all", - BLOCK_ALL = "dont_allow" -} +export const ImagenPersonFilterLevel: { + readonly BLOCK_ALL: "dont_allow"; + readonly ALLOW_ADULT: "allow_adult"; + readonly ALLOW_ALL: "allow_all"; +}; // @beta -export enum ImagenSafetyFilterLevel { - BLOCK_LOW_AND_ABOVE = "block_low_and_above", - BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above", - BLOCK_NONE = "block_none", - BLOCK_ONLY_HIGH = "block_only_high" -} +export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; + +// @beta +export const ImagenSafetyFilterLevel: { + readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above"; + readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above"; + readonly BLOCK_ONLY_HIGH: "block_only_high"; + readonly BLOCK_NONE: "block_none"; +}; + +// @beta +export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; // @beta export interface ImagenSafetySettings { @@ -671,14 +703,17 @@ export class IntegerSchema extends Schema { } // @public -export enum Modality { - AUDIO = "AUDIO", - DOCUMENT = "DOCUMENT", - IMAGE = "IMAGE", - MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED", - TEXT = "TEXT", - VIDEO = "VIDEO" -} +export const Modality: { + readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED"; + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; + readonly VIDEO: "VIDEO"; + readonly AUDIO: "AUDIO"; + readonly DOCUMENT: "DOCUMENT"; +}; + +// @public +export type Modality = (typeof Modality)[keyof typeof Modality]; // @public export interface ModalityTokenCount { @@ -722,7 +757,7 @@ export class ObjectSchema extends Schema { export interface ObjectSchemaRequest extends SchemaRequest { optionalProperties?: never; // (undocumented) - type: SchemaType.OBJECT; + type: 'object'; } // @public @@ -864,14 +899,17 @@ export interface SchemaShared { } // @public -export enum SchemaType { - ARRAY = "array", - BOOLEAN = "boolean", - INTEGER = "integer", - NUMBER = "number", - OBJECT = "object", - STRING = "string" -} +export const SchemaType: { + readonly STRING: "string"; + readonly NUMBER: "number"; + readonly INTEGER: "integer"; + readonly BOOLEAN: "boolean"; + readonly ARRAY: "array"; + readonly OBJECT: "object"; +}; + +// @public +export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; // @public export interface SearchEntrypoint { diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 2f695e88cf8..2916c4d2729 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -43,25 +43,6 @@ The Firebase AI Web SDK. | [StringSchema](./ai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | | [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. | -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. | -| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./ai.md#functioncallingmode) | | -| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). | -| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | -| [Modality](./ai.md#modality) | Content part modality. | -| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | - ## Interfaces | Interface | Description | @@ -109,7 +90,7 @@ The Firebase AI Web SDK. | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | | [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | -| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) format when not using the [ObjectSchema](./ai.objectschema.md#objectschema_class) helper. | +| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of "object" when not using the Schema.object() helper. | | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | @@ -134,18 +115,46 @@ The Firebase AI Web SDK. | Variable | Description | | --- | --- | +| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. | | [BackendType](./ai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.These values are assigned to the backendType property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. | +| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./ai.md#functioncallingmode) | | +| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). | +| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [Modality](./ai.md#modality) | Content part modality. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | +| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | ## Type Aliases | Type Alias | Description | | --- | --- | +| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. | | [BackendType](./ai.md#backendtype) | Type alias representing valid backend types. It can be either 'VERTEX_AI' or 'GOOGLE_AI'. | +| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./ai.md#functioncallingmode) | | +| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). | +| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [Modality](./ai.md#modality) | Content part modality. | | [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [Role](./ai.md#role) | Role is the producer of the content. | +| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | | [Tool](./ai.md#tool) | Defines a tool that model can call to access external knowledge. | | [TypedSchema](./ai.md#typedschema) | A type that includes all specific Schema types. | @@ -255,6 +264,30 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r If the `apiKey` or `projectId` fields are missing in your Firebase config. +## AIErrorCode + +Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. + +Signature: + +```typescript +AIErrorCode: { + readonly ERROR: "error"; + readonly REQUEST_ERROR: "request-error"; + readonly RESPONSE_ERROR: "response-error"; + readonly FETCH_ERROR: "fetch-error"; + readonly INVALID_CONTENT: "invalid-content"; + readonly API_NOT_ENABLED: "api-not-enabled"; + readonly INVALID_SCHEMA: "invalid-schema"; + readonly NO_API_KEY: "no-api-key"; + readonly NO_APP_ID: "no-app-id"; + readonly NO_MODEL: "no-model"; + readonly NO_PROJECT_ID: "no-project-id"; + readonly PARSE_FAILED: "parse-failed"; + readonly UNSUPPORTED: "unsupported"; +} +``` + ## BackendType An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with. @@ -270,182 +303,298 @@ BackendType: { } ``` -## POSSIBLE\_ROLES +## BlockReason -Possible roles. +Reason that a prompt was blocked. Signature: ```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +BlockReason: { + readonly SAFETY: "SAFETY"; + readonly OTHER: "OTHER"; + readonly BLOCKLIST: "BLOCKLIST"; + readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT"; +} ``` -## ResponseModality +## FinishReason -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> +Reason that a candidate finished. + +Signature: + +```typescript +FinishReason: { + readonly STOP: "STOP"; + readonly MAX_TOKENS: "MAX_TOKENS"; + readonly SAFETY: "SAFETY"; + readonly RECITATION: "RECITATION"; + readonly OTHER: "OTHER"; + readonly BLOCKLIST: "BLOCKLIST"; + readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT"; + readonly SPII: "SPII"; + readonly MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL"; +} +``` + +## FunctionCallingMode -Generation modalities to be returned in generation responses. Signature: ```typescript -ResponseModality: { - readonly TEXT: "TEXT"; - readonly IMAGE: "IMAGE"; +FunctionCallingMode: { + readonly AUTO: "AUTO"; + readonly ANY: "ANY"; + readonly NONE: "NONE"; } ``` -## BackendType +## HarmBlockMethod -Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. +This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). Signature: ```typescript -export type BackendType = (typeof BackendType)[keyof typeof BackendType]; +HarmBlockMethod: { + readonly SEVERITY: "SEVERITY"; + readonly PROBABILITY: "PROBABILITY"; +} ``` -## Part +## HarmBlockThreshold -Content part - includes text, image/video, or function call/response part types. +Threshold above which a prompt or candidate will be blocked. Signature: ```typescript -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +HarmBlockThreshold: { + readonly BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE"; + readonly BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE"; + readonly BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH"; + readonly BLOCK_NONE: "BLOCK_NONE"; + readonly OFF: "OFF"; +} ``` -## ResponseModality +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +HarmCategory: { + readonly HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH"; + readonly HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT"; + readonly HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT"; + readonly HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT"; +} +``` + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +HarmProbability: { + readonly NEGLIGIBLE: "NEGLIGIBLE"; + readonly LOW: "LOW"; + readonly MEDIUM: "MEDIUM"; + readonly HIGH: "HIGH"; +} +``` + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +HarmSeverity: { + readonly HARM_SEVERITY_NEGLIGIBLE: "HARM_SEVERITY_NEGLIGIBLE"; + readonly HARM_SEVERITY_LOW: "HARM_SEVERITY_LOW"; + readonly HARM_SEVERITY_MEDIUM: "HARM_SEVERITY_MEDIUM"; + readonly HARM_SEVERITY_HIGH: "HARM_SEVERITY_HIGH"; + readonly HARM_SEVERITY_UNSUPPORTED: "HARM_SEVERITY_UNSUPPORTED"; +} +``` + +## ImagenAspectRatio > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -Generation modalities to be returned in generation responses. +Aspect ratios for Imagen images. + +To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). + +See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. Signature: ```typescript -export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; +ImagenAspectRatio: { + readonly SQUARE: "1:1"; + readonly LANDSCAPE_3x4: "3:4"; + readonly PORTRAIT_4x3: "4:3"; + readonly LANDSCAPE_16x9: "16:9"; + readonly PORTRAIT_9x16: "9:16"; +} ``` -## Role +## ImagenPersonFilterLevel -Role is the producer of the content. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling whether generation of images containing people or faces is allowed. + +See the personGeneration documentation for more details. Signature: ```typescript -export type Role = (typeof POSSIBLE_ROLES)[number]; +ImagenPersonFilterLevel: { + readonly BLOCK_ALL: "dont_allow"; + readonly ALLOW_ADULT: "allow_adult"; + readonly ALLOW_ALL: "allow_all"; +} ``` -## Tool +## ImagenSafetyFilterLevel -Defines a tool that model can call to access external knowledge. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A filter level controlling how aggressively to filter sensitive content. + +Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. Signature: ```typescript -export type Tool = FunctionDeclarationsTool | GoogleSearchTool; +ImagenSafetyFilterLevel: { + readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above"; + readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above"; + readonly BLOCK_ONLY_HIGH: "block_only_high"; + readonly BLOCK_NONE: "block_none"; +} ``` -## TypedSchema +## Modality -A type that includes all specific Schema types. +Content part modality. Signature: ```typescript -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +Modality: { + readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED"; + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; + readonly VIDEO: "VIDEO"; + readonly AUDIO: "AUDIO"; + readonly DOCUMENT: "DOCUMENT"; +} ``` -## AIErrorCode +## POSSIBLE\_ROLES -Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. +Possible roles. Signature: ```typescript -export declare const enum AIErrorCode +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] ``` -## Enumeration Members +## ResponseModality -| Member | Value | Description | -| --- | --- | --- | -| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_APP\_ID | "no-app-id" | An error occurred due to a missing Firebase app ID. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | -| UNSUPPORTED | "unsupported" | An error occurred due an attempt to use an unsupported feature. | +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> -## BlockReason +Generation modalities to be returned in generation responses. -Reason that a prompt was blocked. +Signature: + +```typescript +ResponseModality: { + readonly TEXT: "TEXT"; + readonly IMAGE: "IMAGE"; +} +``` + +## SchemaType + +Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) Signature: ```typescript -export declare enum BlockReason +SchemaType: { + readonly STRING: "string"; + readonly NUMBER: "number"; + readonly INTEGER: "integer"; + readonly BOOLEAN: "boolean"; + readonly ARRAY: "array"; + readonly OBJECT: "object"; +} ``` -## Enumeration Members +## AIErrorCode -| Member | Value | Description | -| --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | -| OTHER | "OTHER" | Content was blocked, but the reason is uncategorized. | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | -| SAFETY | "SAFETY" | Content was blocked by safety settings. | +Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. -## FinishReason +Signature: -Reason that a candidate finished. +```typescript +export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode]; +``` + +## BackendType + +Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. Signature: ```typescript -export declare enum FinishReason +export type BackendType = (typeof BackendType)[keyof typeof BackendType]; ``` -## Enumeration Members +## BlockReason + +Reason that a prompt was blocked. -| Member | Value | Description | -| --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | -| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | -| MAX\_TOKENS | "MAX_TOKENS" | The maximum number of tokens as specified in the request was reached. | -| OTHER | "OTHER" | Unknown reason. | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | -| RECITATION | "RECITATION" | The candidate content was flagged for recitation reasons. | -| SAFETY | "SAFETY" | The candidate content was flagged for safety reasons. | -| SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | -| STOP | "STOP" | Natural stop point of the model or provided stop sequence. | +Signature: -## FunctionCallingMode +```typescript +export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason]; +``` + +## FinishReason +Reason that a candidate finished. Signature: ```typescript -export declare enum FunctionCallingMode +export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; ``` -## Enumeration Members +## FunctionCallingMode -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | Model is constrained to always predicting a function call only. If allowed_function_names is set, the predicted function call will be limited to any one of allowed_function_names, else the predicted function call will be any one of the provided function_declarations. | -| AUTO | "AUTO" | Default model behavior; model decides to predict either a function call or a natural language response. | -| NONE | "NONE" | Model will not predict any function call. Model behavior is same as when not passing any function declarations. | +Signature: + +```typescript +export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode]; +``` ## HarmBlockMethod @@ -454,16 +603,9 @@ This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ Signature: ```typescript -export declare enum HarmBlockMethod +export type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| PROBABILITY | "PROBABILITY" | The harm block method uses the probability score. | -| SEVERITY | "SEVERITY" | The harm block method uses both probability and severity scores. | - ## HarmBlockThreshold Threshold above which a prompt or candidate will be blocked. @@ -471,19 +613,9 @@ Threshold above which a prompt or candidate will be blocked. Signature: ```typescript -export declare enum HarmBlockThreshold +export type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | Content with NEGLIGIBLE will be allowed. | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | -| BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | -| OFF | "OFF" | All content will be allowed. This is the same as BLOCK_NONE, but the metadata corresponding to the [HarmCategory](./ai.md#harmcategory) will not be present in the response. | - ## HarmCategory Harm categories that would cause prompts or candidates to be blocked. @@ -491,18 +623,9 @@ Harm categories that would cause prompts or candidates to be blocked. Signature: ```typescript -export declare enum HarmCategory +export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | - ## HarmProbability Probability that a prompt or candidate matches a harm category. @@ -510,18 +633,9 @@ Probability that a prompt or candidate matches a harm category. Signature: ```typescript -export declare enum HarmProbability +export type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HIGH | "HIGH" | Content has a high chance of being unsafe. | -| LOW | "LOW" | Content has a low chance of being unsafe. | -| MEDIUM | "MEDIUM" | Content has a medium chance of being unsafe. | -| NEGLIGIBLE | "NEGLIGIBLE" | Content has a negligible chance of being unsafe. | - ## HarmSeverity Harm severity levels. @@ -529,19 +643,9 @@ Harm severity levels. Signature: ```typescript -export declare enum HarmSeverity +export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | High level of harm severity. | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | Low level of harm severity. | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | Medium level of harm severity. | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | Negligible level of harm severity. | -| HARM\_SEVERITY\_UNSUPPORTED | "HARM_SEVERITY_UNSUPPORTED" | Harm severity is not supported. | - ## ImagenAspectRatio > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. @@ -556,19 +660,9 @@ See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-i Signature: ```typescript -export declare enum ImagenAspectRatio +export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| LANDSCAPE\_16x9 | "16:9" | (Public Preview) Landscape (16:9) aspect ratio. | -| LANDSCAPE\_3x4 | "3:4" | (Public Preview) Landscape (3:4) aspect ratio. | -| PORTRAIT\_4x3 | "4:3" | (Public Preview) Portrait (4:3) aspect ratio. | -| PORTRAIT\_9x16 | "9:16" | (Public Preview) Portrait (9:16) aspect ratio. | -| SQUARE | "1:1" | (Public Preview) Square (1:1) aspect ratio. | - ## ImagenPersonFilterLevel > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. @@ -581,17 +675,9 @@ See the pers Signature: ```typescript -export declare enum ImagenPersonFilterLevel +export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ALLOW\_ADULT | "allow_adult" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | -| ALLOW\_ALL | "allow_all" | (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. | -| BLOCK\_ALL | "dont_allow" | (Public Preview) Disallow generation of images containing people or faces; images of people are filtered out. | - ## ImagenSafetyFilterLevel > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. @@ -604,18 +690,9 @@ Text prompts provided as inputs and images (generated or uploaded) through Image Signature: ```typescript -export declare enum ImagenSafetyFilterLevel +export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; ``` -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "block_low_and_above" | (Public Preview) The most aggressive filtering level; most strict blocking. | -| BLOCK\_MEDIUM\_AND\_ABOVE | "block_medium_and_above" | (Public Preview) Blocks some sensitive prompts and responses. | -| BLOCK\_NONE | "block_none" | (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. | -| BLOCK\_ONLY\_HIGH | "block_only_high" | (Public Preview) Blocks few sensitive prompts and responses. | - ## Modality Content part modality. @@ -623,19 +700,41 @@ Content part modality. Signature: ```typescript -export declare enum Modality +export type Modality = (typeof Modality)[keyof typeof Modality]; ``` -## Enumeration Members +## Part -| Member | Value | Description | -| --- | --- | --- | -| AUDIO | "AUDIO" | Audio. | -| DOCUMENT | "DOCUMENT" | Document (for example, PDF). | -| IMAGE | "IMAGE" | Image. | -| MODALITY\_UNSPECIFIED | "MODALITY_UNSPECIFIED" | Unspecified modality. | -| TEXT | "TEXT" | Plain text. | -| VIDEO | "VIDEO" | Video. | +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## ResponseModality + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Generation modalities to be returned in generation responses. + +Signature: + +```typescript +export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export type Role = (typeof POSSIBLE_ROLES)[number]; +``` ## SchemaType @@ -644,17 +743,25 @@ Contains the list of OpenAPI data types as defined by the [OpenAPI specification Signature: ```typescript -export declare enum SchemaType +export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; ``` -## Enumeration Members +## Tool -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "array" | Array type. | -| BOOLEAN | "boolean" | Boolean type. | -| INTEGER | "integer" | Integer type. | -| NUMBER | "number" | Number type. | -| OBJECT | "object" | Object type. | -| STRING | "string" | String type. | +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export type Tool = FunctionDeclarationsTool | GoogleSearchTool; +``` +## TypedSchema + +A type that includes all specific Schema types. + +Signature: + +```typescript +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +``` diff --git a/docs-devsite/ai.objectschemarequest.md b/docs-devsite/ai.objectschemarequest.md index ccc554ab42f..bde646e0ac0 100644 --- a/docs-devsite/ai.objectschemarequest.md +++ b/docs-devsite/ai.objectschemarequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ObjectSchemaRequest interface -Interface for JSON parameters in [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) format when not using the [ObjectSchema](./ai.objectschema.md#objectschema_class) helper. +Interface for JSON parameters in a schema of "object" when not using the `Schema.object()` helper. Signature: @@ -24,7 +24,7 @@ export interface ObjectSchemaRequest extends SchemaRequest | Property | Type | Description | | --- | --- | --- | | [optionalProperties](./ai.objectschemarequest.md#objectschemarequestoptionalproperties) | never | This is not a property accepted in the final request to the backend, but is a client-side convenience property that is only usable by constructing a schema through the Schema.object() helper method. Populating this property will cause response errors if the object is not wrapped with Schema.object(). | -| [type](./ai.objectschemarequest.md#objectschemarequesttype) | [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) | | +| [type](./ai.objectschemarequest.md#objectschemarequesttype) | 'object' | | ## ObjectSchemaRequest.optionalProperties @@ -41,5 +41,5 @@ optionalProperties?: never; Signature: ```typescript -type: SchemaType.OBJECT; +type: 'object'; ``` diff --git a/docs-devsite/ai.schema.md b/docs-devsite/ai.schema.md index fa1225c91e5..6cc28c761b5 100644 --- a/docs-devsite/ai.schema.md +++ b/docs-devsite/ai.schema.md @@ -33,8 +33,8 @@ export declare abstract class Schema implements SchemaInterface | [example](./ai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | | [format](./ai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
    • for NUMBER type: "float", "double"
    • for INTEGER type: "int32", "int64"
    • for STRING type: "email", "byte", etc
    | | [items](./ai.schema.md#schemaitems) | | [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | Optional. The items of the property. | -| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | -| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | +| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | +| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | | [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | | [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). | @@ -108,7 +108,7 @@ items?: SchemaInterface; ## Schema.maxItems -The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). +The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`. Signature: @@ -118,7 +118,7 @@ maxItems?: number; ## Schema.minItems -The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). +The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`. Signature: diff --git a/docs-devsite/ai.schemashared.md b/docs-devsite/ai.schemashared.md index fb75fc50841..b68cb180144 100644 --- a/docs-devsite/ai.schemashared.md +++ b/docs-devsite/ai.schemashared.md @@ -28,9 +28,9 @@ export interface SchemaShared | [format](./ai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this must be either 'enum' or 'date-time', otherwise requests will fail. | | [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | | [maximum](./ai.schemashared.md#schemasharedmaximum) | number | The maximum value of a numeric type. | -| [maxItems](./ai.schemashared.md#schemasharedmaxitems) | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | +| [maxItems](./ai.schemashared.md#schemasharedmaxitems) | number | The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | | [minimum](./ai.schemashared.md#schemasharedminimum) | number | The minimum value of a numeric type. | -| [minItems](./ai.schemashared.md#schemasharedminitems) | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). | +| [minItems](./ai.schemashared.md#schemasharedminitems) | number | The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | | [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | | [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | | [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint suggesting the order in which the keys should appear in the generated JSON string. | @@ -98,7 +98,7 @@ maximum?: number; ## SchemaShared.maxItems -The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). +The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`. Signature: @@ -118,7 +118,7 @@ minimum?: number; ## SchemaShared.minItems -The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). +The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`. Signature: diff --git a/packages/ai/src/errors.ts b/packages/ai/src/errors.ts index 2e9787d0bf2..8190510d0d8 100644 --- a/packages/ai/src/errors.ts +++ b/packages/ai/src/errors.ts @@ -28,7 +28,7 @@ export class AIError extends FirebaseError { /** * Constructs a new instance of the `AIError` class. * - * @param code - The error code from {@link AIErrorCode}. + * @param code - The error code from {@link (AIErrorCode:type)}. * @param message - A human-readable message describing the error. * @param customErrorData - Optional error data. */ diff --git a/packages/ai/src/requests/response-helpers.ts b/packages/ai/src/requests/response-helpers.ts index 20678eeea68..2505b5c9276 100644 --- a/packages/ai/src/requests/response-helpers.ts +++ b/packages/ai/src/requests/response-helpers.ts @@ -229,7 +229,7 @@ const badFinishReasons = [FinishReason.RECITATION, FinishReason.SAFETY]; function hadBadFinishReason(candidate: GenerateContentCandidate): boolean { return ( !!candidate.finishReason && - badFinishReasons.includes(candidate.finishReason) + badFinishReasons.some(reason => reason === candidate.finishReason) ); } diff --git a/packages/ai/src/requests/schema-builder.ts b/packages/ai/src/requests/schema-builder.ts index 593a29c2d19..c0d53195f20 100644 --- a/packages/ai/src/requests/schema-builder.ts +++ b/packages/ai/src/requests/schema-builder.ts @@ -34,7 +34,7 @@ import { export abstract class Schema implements SchemaInterface { /** * Optional. The type of the property. {@link - * SchemaType}. + * (SchemaType:type)}. */ type: SchemaType; /** Optional. The format of the property. @@ -50,9 +50,9 @@ export abstract class Schema implements SchemaInterface { description?: string; /** Optional. The items of the property. */ items?: SchemaInterface; - /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */ minItems?: number; - /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */ maxItems?: number; /** Optional. Whether the property is nullable. Defaults to false. */ nullable: boolean; diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 47d654bbcd1..b5e4e60ab4f 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -31,229 +31,284 @@ export const POSSIBLE_ROLES = ['user', 'model', 'function', 'system'] as const; * Harm categories that would cause prompts or candidates to be blocked. * @public */ -export enum HarmCategory { - HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH', - HARM_CATEGORY_SEXUALLY_EXPLICIT = 'HARM_CATEGORY_SEXUALLY_EXPLICIT', - HARM_CATEGORY_HARASSMENT = 'HARM_CATEGORY_HARASSMENT', - HARM_CATEGORY_DANGEROUS_CONTENT = 'HARM_CATEGORY_DANGEROUS_CONTENT' -} +export const HarmCategory = { + HARM_CATEGORY_HATE_SPEECH: 'HARM_CATEGORY_HATE_SPEECH', + HARM_CATEGORY_SEXUALLY_EXPLICIT: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', + HARM_CATEGORY_HARASSMENT: 'HARM_CATEGORY_HARASSMENT', + HARM_CATEGORY_DANGEROUS_CONTENT: 'HARM_CATEGORY_DANGEROUS_CONTENT' +} as const; + +/** + * Harm categories that would cause prompts or candidates to be blocked. + * @public + */ +export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory]; /** * Threshold above which a prompt or candidate will be blocked. * @public */ -export enum HarmBlockThreshold { +export const HarmBlockThreshold = { /** * Content with `NEGLIGIBLE` will be allowed. */ - BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE', + BLOCK_LOW_AND_ABOVE: 'BLOCK_LOW_AND_ABOVE', /** * Content with `NEGLIGIBLE` and `LOW` will be allowed. */ - BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE', + BLOCK_MEDIUM_AND_ABOVE: 'BLOCK_MEDIUM_AND_ABOVE', /** * Content with `NEGLIGIBLE`, `LOW`, and `MEDIUM` will be allowed. */ - BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH', + BLOCK_ONLY_HIGH: 'BLOCK_ONLY_HIGH', /** * All content will be allowed. */ - BLOCK_NONE = 'BLOCK_NONE', + BLOCK_NONE: 'BLOCK_NONE', /** * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding * to the {@link HarmCategory} will not be present in the response. */ - OFF = 'OFF' -} + OFF: 'OFF' +} as const; + +/** + * Threshold above which a prompt or candidate will be blocked. + * @public + */ +export type HarmBlockThreshold = + (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold]; /** * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}). * * @public */ -export enum HarmBlockMethod { +export const HarmBlockMethod = { /** * The harm block method uses both probability and severity scores. */ - SEVERITY = 'SEVERITY', + SEVERITY: 'SEVERITY', /** * The harm block method uses the probability score. */ - PROBABILITY = 'PROBABILITY' -} + PROBABILITY: 'PROBABILITY' +} as const; + +/** + * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}). + * + * @public + */ +export type HarmBlockMethod = + (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod]; /** * Probability that a prompt or candidate matches a harm category. * @public */ -export enum HarmProbability { +export const HarmProbability = { /** * Content has a negligible chance of being unsafe. */ - NEGLIGIBLE = 'NEGLIGIBLE', + NEGLIGIBLE: 'NEGLIGIBLE', /** * Content has a low chance of being unsafe. */ - LOW = 'LOW', + LOW: 'LOW', /** * Content has a medium chance of being unsafe. */ - MEDIUM = 'MEDIUM', + MEDIUM: 'MEDIUM', /** * Content has a high chance of being unsafe. */ - HIGH = 'HIGH' -} + HIGH: 'HIGH' +} as const; + +/** + * Probability that a prompt or candidate matches a harm category. + * @public + */ +export type HarmProbability = + (typeof HarmProbability)[keyof typeof HarmProbability]; /** * Harm severity levels. * @public */ -export enum HarmSeverity { +export const HarmSeverity = { /** * Negligible level of harm severity. */ - HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE', + HARM_SEVERITY_NEGLIGIBLE: 'HARM_SEVERITY_NEGLIGIBLE', /** * Low level of harm severity. */ - HARM_SEVERITY_LOW = 'HARM_SEVERITY_LOW', + HARM_SEVERITY_LOW: 'HARM_SEVERITY_LOW', /** * Medium level of harm severity. */ - HARM_SEVERITY_MEDIUM = 'HARM_SEVERITY_MEDIUM', + HARM_SEVERITY_MEDIUM: 'HARM_SEVERITY_MEDIUM', /** * High level of harm severity. */ - HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH', + HARM_SEVERITY_HIGH: 'HARM_SEVERITY_HIGH', /** * Harm severity is not supported. * * @remarks * The GoogleAI backend does not support `HarmSeverity`, so this value is used as a fallback. */ - HARM_SEVERITY_UNSUPPORTED = 'HARM_SEVERITY_UNSUPPORTED' -} + HARM_SEVERITY_UNSUPPORTED: 'HARM_SEVERITY_UNSUPPORTED' +} as const; + +/** + * Harm severity levels. + * @public + */ +export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; /** * Reason that a prompt was blocked. * @public */ -export enum BlockReason { +export const BlockReason = { /** * Content was blocked by safety settings. */ - SAFETY = 'SAFETY', + SAFETY: 'SAFETY', /** * Content was blocked, but the reason is uncategorized. */ - OTHER = 'OTHER', + OTHER: 'OTHER', /** * Content was blocked because it contained terms from the terminology blocklist. */ - BLOCKLIST = 'BLOCKLIST', + BLOCKLIST: 'BLOCKLIST', /** * Content was blocked due to prohibited content. */ - PROHIBITED_CONTENT = 'PROHIBITED_CONTENT' -} + PROHIBITED_CONTENT: 'PROHIBITED_CONTENT' +} as const; + +/** + * Reason that a prompt was blocked. + * @public + */ +export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason]; /** * Reason that a candidate finished. * @public */ -export enum FinishReason { +export const FinishReason = { /** * Natural stop point of the model or provided stop sequence. */ - STOP = 'STOP', + STOP: 'STOP', /** * The maximum number of tokens as specified in the request was reached. */ - MAX_TOKENS = 'MAX_TOKENS', + MAX_TOKENS: 'MAX_TOKENS', /** * The candidate content was flagged for safety reasons. */ - SAFETY = 'SAFETY', + SAFETY: 'SAFETY', /** * The candidate content was flagged for recitation reasons. */ - RECITATION = 'RECITATION', + RECITATION: 'RECITATION', /** * Unknown reason. */ - OTHER = 'OTHER', + OTHER: 'OTHER', /** * The candidate content contained forbidden terms. */ - BLOCKLIST = 'BLOCKLIST', + BLOCKLIST: 'BLOCKLIST', /** * The candidate content potentially contained prohibited content. */ - PROHIBITED_CONTENT = 'PROHIBITED_CONTENT', + PROHIBITED_CONTENT: 'PROHIBITED_CONTENT', /** * The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). */ - SPII = 'SPII', + SPII: 'SPII', /** * The function call generated by the model was invalid. */ - MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL' -} + MALFORMED_FUNCTION_CALL: 'MALFORMED_FUNCTION_CALL' +} as const; + +/** + * Reason that a candidate finished. + * @public + */ +export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; /** * @public */ -export enum FunctionCallingMode { +export const FunctionCallingMode = { /** * Default model behavior; model decides to predict either a function call * or a natural language response. */ - AUTO = 'AUTO', + AUTO: 'AUTO', /** * Model is constrained to always predicting a function call only. * If `allowed_function_names` is set, the predicted function call will be * limited to any one of `allowed_function_names`, else the predicted * function call will be any one of the provided `function_declarations`. */ - ANY = 'ANY', + ANY: 'ANY', /** * Model will not predict any function call. Model behavior is same as when * not passing any function declarations. */ - NONE = 'NONE' -} + NONE: 'NONE' +} as const; + +export type FunctionCallingMode = + (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode]; /** * Content part modality. * @public */ -export enum Modality { +export const Modality = { /** * Unspecified modality. */ - MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED', + MODALITY_UNSPECIFIED: 'MODALITY_UNSPECIFIED', /** * Plain text. */ - TEXT = 'TEXT', + TEXT: 'TEXT', /** * Image. */ - IMAGE = 'IMAGE', + IMAGE: 'IMAGE', /** * Video. */ - VIDEO = 'VIDEO', + VIDEO: 'VIDEO', /** * Audio. */ - AUDIO = 'AUDIO', + AUDIO: 'AUDIO', /** * Document (for example, PDF). */ - DOCUMENT = 'DOCUMENT' -} + DOCUMENT: 'DOCUMENT' +} as const; + +/** + * Content part modality. + * @public + */ +export type Modality = (typeof Modality)[keyof typeof Modality]; /** * Generation modalities to be returned in generation responses. diff --git a/packages/ai/src/types/error.ts b/packages/ai/src/types/error.ts index 84a30f4e872..d6ed22e047c 100644 --- a/packages/ai/src/types/error.ts +++ b/packages/ai/src/types/error.ts @@ -62,43 +62,50 @@ export interface CustomErrorData { * * @public */ -export const enum AIErrorCode { +export const AIErrorCode = { /** A generic error occurred. */ - ERROR = 'error', + ERROR: 'error', /** An error occurred in a request. */ - REQUEST_ERROR = 'request-error', + REQUEST_ERROR: 'request-error', /** An error occurred in a response. */ - RESPONSE_ERROR = 'response-error', + RESPONSE_ERROR: 'response-error', /** An error occurred while performing a fetch. */ - FETCH_ERROR = 'fetch-error', + FETCH_ERROR: 'fetch-error', /** An error associated with a Content object. */ - INVALID_CONTENT = 'invalid-content', + INVALID_CONTENT: 'invalid-content', /** An error due to the Firebase API not being enabled in the Console. */ - API_NOT_ENABLED = 'api-not-enabled', + API_NOT_ENABLED: 'api-not-enabled', /** An error due to invalid Schema input. */ - INVALID_SCHEMA = 'invalid-schema', + INVALID_SCHEMA: 'invalid-schema', /** An error occurred due to a missing Firebase API key. */ - NO_API_KEY = 'no-api-key', + NO_API_KEY: 'no-api-key', /** An error occurred due to a missing Firebase app ID. */ - NO_APP_ID = 'no-app-id', + NO_APP_ID: 'no-app-id', /** An error occurred due to a model name not being specified during initialization. */ - NO_MODEL = 'no-model', + NO_MODEL: 'no-model', /** An error occurred due to a missing project ID. */ - NO_PROJECT_ID = 'no-project-id', + NO_PROJECT_ID: 'no-project-id', /** An error occurred while parsing. */ - PARSE_FAILED = 'parse-failed', + PARSE_FAILED: 'parse-failed', /** An error occurred due an attempt to use an unsupported feature. */ - UNSUPPORTED = 'unsupported' -} + UNSUPPORTED: 'unsupported' +} as const; + +/** + * Standardized error codes that {@link AIError} can have. + * + * @public + */ +export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode]; diff --git a/packages/ai/src/types/imagen/requests.ts b/packages/ai/src/types/imagen/requests.ts index 09bd3dedc9b..2818ab91fd5 100644 --- a/packages/ai/src/types/imagen/requests.ts +++ b/packages/ai/src/types/imagen/requests.ts @@ -73,7 +73,7 @@ export interface ImagenGenerationConfig { numberOfImages?: number; /** * The aspect ratio of the generated images. The default value is square 1:1. - * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio} + * Supported aspect ratios depend on the Imagen model, see {@link (ImagenAspectRatio:type)} * for more details. */ aspectRatio?: ImagenAspectRatio; @@ -110,27 +110,42 @@ export interface ImagenGenerationConfig { * * @beta */ -export enum ImagenSafetyFilterLevel { +export const ImagenSafetyFilterLevel = { /** * The most aggressive filtering level; most strict blocking. */ - BLOCK_LOW_AND_ABOVE = 'block_low_and_above', + BLOCK_LOW_AND_ABOVE: 'block_low_and_above', /** * Blocks some sensitive prompts and responses. */ - BLOCK_MEDIUM_AND_ABOVE = 'block_medium_and_above', + BLOCK_MEDIUM_AND_ABOVE: 'block_medium_and_above', /** * Blocks few sensitive prompts and responses. */ - BLOCK_ONLY_HIGH = 'block_only_high', + BLOCK_ONLY_HIGH: 'block_only_high', /** * The least aggressive filtering level; blocks very few sensitive prompts and responses. * * Access to this feature is restricted and may require your case to be reviewed and approved by * Cloud support. */ - BLOCK_NONE = 'block_none' -} + BLOCK_NONE: 'block_none' +} as const; + +/** + * A filter level controlling how aggressively to filter sensitive content. + * + * Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI + * are assessed against a list of safety filters, which include 'harmful categories' (for example, + * `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to + * filter out potentially harmful content from responses. See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} + * for more details. + * + * @beta + */ +export type ImagenSafetyFilterLevel = + (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; /** * A filter level controlling whether generation of images containing people or faces is allowed. @@ -140,11 +155,11 @@ export enum ImagenSafetyFilterLevel { * * @beta */ -export enum ImagenPersonFilterLevel { +export const ImagenPersonFilterLevel = { /** * Disallow generation of images containing people or faces; images of people are filtered out. */ - BLOCK_ALL = 'dont_allow', + BLOCK_ALL: 'dont_allow', /** * Allow generation of images containing adults only; images of children are filtered out. * @@ -152,7 +167,7 @@ export enum ImagenPersonFilterLevel { * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines} * for more details. */ - ALLOW_ADULT = 'allow_adult', + ALLOW_ADULT: 'allow_adult', /** * Allow generation of images containing adults only; images of children are filtered out. * @@ -160,8 +175,19 @@ export enum ImagenPersonFilterLevel { * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines} * for more details. */ - ALLOW_ALL = 'allow_all' -} + ALLOW_ALL: 'allow_all' +} as const; + +/** + * A filter level controlling whether generation of images containing people or faces is allowed. + * + * See the
    personGeneration + * documentation for more details. + * + * @beta + */ +export type ImagenPersonFilterLevel = + (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; /** * Settings for controlling the aggressiveness of filtering out sensitive content. @@ -194,25 +220,39 @@ export interface ImagenSafetySettings { * * @beta */ -export enum ImagenAspectRatio { +export const ImagenAspectRatio = { /** * Square (1:1) aspect ratio. */ - SQUARE = '1:1', + 'SQUARE': '1:1', /** * Landscape (3:4) aspect ratio. */ - LANDSCAPE_3x4 = '3:4', + 'LANDSCAPE_3x4': '3:4', /** * Portrait (4:3) aspect ratio. */ - PORTRAIT_4x3 = '4:3', + 'PORTRAIT_4x3': '4:3', /** * Landscape (16:9) aspect ratio. */ - LANDSCAPE_16x9 = '16:9', + 'LANDSCAPE_16x9': '16:9', /** * Portrait (9:16) aspect ratio. */ - PORTRAIT_9x16 = '9:16' -} + 'PORTRAIT_9x16': '9:16' +} as const; + +/** + * Aspect ratios for Imagen images. + * + * To specify an aspect ratio for generated images, set the `aspectRatio` property in your + * {@link ImagenGenerationConfig}. + * + * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * for more details and examples of the supported aspect ratios. + * + * @beta + */ +export type ImagenAspectRatio = + (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; diff --git a/packages/ai/src/types/imagen/responses.ts b/packages/ai/src/types/imagen/responses.ts index 4b093fd550f..4e4496e6b36 100644 --- a/packages/ai/src/types/imagen/responses.ts +++ b/packages/ai/src/types/imagen/responses.ts @@ -72,8 +72,8 @@ export interface ImagenGenerationResponse< * The reason that images were filtered out. This property will only be defined if one * or more images were filtered. * - * Images may be filtered out due to the {@link ImagenSafetyFilterLevel}, - * {@link ImagenPersonFilterLevel}, or filtering included in the model. + * Images may be filtered out due to the {@link (ImagenSafetyFilterLevel:type)}, + * {@link (ImagenPersonFilterLevel:type)}, or filtering included in the model. * The filter levels may be adjusted in your {@link ImagenSafetySettings}. * * See the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen | Responsible AI and usage guidelines for Imagen} diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index e19c3a38b41..3ba613f6f4c 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -21,20 +21,28 @@ * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification} * @public */ -export enum SchemaType { +export const SchemaType = { /** String type. */ - STRING = 'string', + STRING: 'string', /** Number type. */ - NUMBER = 'number', + NUMBER: 'number', /** Integer type. */ - INTEGER = 'integer', + INTEGER: 'integer', /** Boolean type. */ - BOOLEAN = 'boolean', + BOOLEAN: 'boolean', /** Array type. */ - ARRAY = 'array', + ARRAY: 'array', /** Object type. */ - OBJECT = 'object' -} + OBJECT: 'object' +} as const; + +/** + * Contains the list of OpenAPI data types + * as defined by the + * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification} + * @public + */ +export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; /** * Basic {@link Schema} properties shared across several Schema-related @@ -57,9 +65,9 @@ export interface SchemaShared { title?: string; /** Optional. The items of the property. */ items?: T; - /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */ minItems?: number; - /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */ + /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */ maxItems?: number; /** Optional. Map of `Schema` objects. */ properties?: { @@ -94,7 +102,7 @@ export interface SchemaParams extends SchemaShared {} export interface SchemaRequest extends SchemaShared { /** * The type of the property. {@link - * SchemaType}. + * (SchemaType:type)}. */ type: SchemaType; /** Optional. Array of required property. */ @@ -108,18 +116,18 @@ export interface SchemaRequest extends SchemaShared { export interface SchemaInterface extends SchemaShared { /** * The type of the property. {@link - * SchemaType}. + * (SchemaType:type)}. */ type: SchemaType; } /** - * Interface for JSON parameters in {@link SchemaType.OBJECT} format when - * not using the {@link ObjectSchema} helper. + * Interface for JSON parameters in a schema of {@link SchemaType} + * "object" when not using the `Schema.object()` helper. * @public */ export interface ObjectSchemaRequest extends SchemaRequest { - type: SchemaType.OBJECT; + type: 'object'; /** * This is not a property accepted in the final request to the backend, but is * a client-side convenience property that is only usable by constructing From f11b55294a04dfe6a1216c487b1af3a7e7d07196 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 11 Jul 2025 14:34:46 -0400 Subject: [PATCH 244/295] fix(firestore): revert fix for `undefined` document snapshot data after "clear site data" (#9162) This reverts https://github.com/firebase/firebase-js-sdk/pull/8871 because it had unexpected negative customer impacts (https://github.com/firebase/firebase-js-sdk/issues/9056) and caused CI failures. --- .changeset/heavy-ties-learn.md | 5 ++++ packages/firestore/src/local/simple_db.ts | 28 ----------------------- 2 files changed, 5 insertions(+), 28 deletions(-) create mode 100644 .changeset/heavy-ties-learn.md diff --git a/.changeset/heavy-ties-learn.md b/.changeset/heavy-ties-learn.md new file mode 100644 index 00000000000..a09da57be24 --- /dev/null +++ b/.changeset/heavy-ties-learn.md @@ -0,0 +1,5 @@ +--- +'@firebase/firestore': patch +--- + +Revert fix for issue where Firestore would produce `undefined` for document snapshot if "clear site data" button was pressed in the web browser. This fix was introduced in v11.6.1 but inadvertantly caused issues for some customers (https://github.com/firebase/firebase-js-sdk/issues/9056). diff --git a/packages/firestore/src/local/simple_db.ts b/packages/firestore/src/local/simple_db.ts index 1e315c5dae6..e284c3c46ee 100644 --- a/packages/firestore/src/local/simple_db.ts +++ b/packages/firestore/src/local/simple_db.ts @@ -160,7 +160,6 @@ export class SimpleDbTransaction { export class SimpleDb { private db?: IDBDatabase; private databaseDeletedListener?: DatabaseDeletedListener; - private lastClosedDbVersion: number | null = null; /** Deletes the specified database. */ static delete(name: string): Promise { @@ -349,24 +348,6 @@ export class SimpleDb { event.oldVersion ); const db = (event.target as IDBOpenDBRequest).result; - if ( - this.lastClosedDbVersion !== null && - this.lastClosedDbVersion !== event.oldVersion - ) { - // This thrown error will get passed to the `onerror` callback - // registered above, and will then be propagated correctly. - throw new Error( - `refusing to open IndexedDB database due to potential ` + - `corruption of the IndexedDB database data; this corruption ` + - `could be caused by clicking the "clear site data" button in ` + - `a web browser; try reloading the web page to re-initialize ` + - `the IndexedDB database: ` + - `lastClosedDbVersion=${this.lastClosedDbVersion}, ` + - `event.oldVersion=${event.oldVersion}, ` + - `event.newVersion=${event.newVersion}, ` + - `db.version=${db.version}` - ); - } this.schemaConverter .createOrUpgrade( db, @@ -382,15 +363,6 @@ export class SimpleDb { }); }; }); - - this.db.addEventListener( - 'close', - event => { - const db = event.target as IDBDatabase; - this.lastClosedDbVersion = db.version; - }, - { passive: true } - ); } this.db.addEventListener( From 2d720995d161cd750cd48062989e7cc6ab1c3c08 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 11 Jul 2025 17:27:17 -0700 Subject: [PATCH 245/295] build!: update build targets to ES2020 (#9101) --- config/.eslintrc.js | 2 +- config/tsconfig.base.json | 4 +- config/webpack.test.js | 11 +- integration/compat-interop/tsconfig.json | 2 +- package.json | 1 - packages/ai/package.json | 8 +- packages/ai/rollup.config.js | 10 +- packages/ai/src/index.node.ts | 2 +- packages/ai/src/index.ts | 2 +- packages/analytics-compat/package.json | 6 +- packages/analytics/package.json | 6 +- packages/analytics/rollup.config.js | 4 +- packages/analytics/src/index.ts | 2 +- packages/app-check-compat/package.json | 6 +- packages/app-check/package.json | 6 +- packages/app-compat/package.json | 6 +- packages/app/package.json | 6 +- packages/app/rollup.config.js | 4 +- packages/app/src/heartbeatService.test.ts | 6 +- packages/app/src/registerCoreComponents.ts | 2 +- packages/auth-compat/package.json | 8 +- packages/auth/api-extractor.json | 2 +- packages/auth/demo/rollup.config.js | 4 +- packages/auth/demo/src/worker/tsconfig.json | 4 +- packages/auth/internal/package.json | 6 +- packages/auth/package.json | 24 +- packages/auth/rollup.config.js | 24 +- packages/auth/src/core/auth/register.ts | 2 +- .../auth/web-extension/api-extractor.json | 6 +- packages/auth/web-extension/package.json | 6 +- packages/component/package.json | 6 +- packages/data-connect/package.json | 8 +- packages/data-connect/rollup.config.js | 8 +- packages/data-connect/src/register.ts | 2 +- packages/database-compat/package.json | 8 +- packages/database/package.json | 8 +- packages/database/rollup.config.js | 8 +- packages/database/src/register.ts | 2 +- packages/firestore-compat/package.json | 8 +- packages/firestore-compat/rollup.config.js | 14 +- packages/firestore/lite/package.json | 6 +- packages/firestore/package.json | 14 +- packages/firestore/rollup.config.debug.js | 6 +- packages/firestore/rollup.config.js | 14 +- packages/firestore/rollup.config.lite.js | 14 +- packages/firestore/rollup.shared.js | 10 +- packages/firestore/scripts/build-bundle.js | 2 +- packages/firestore/scripts/build-bundle.ts | 2 +- packages/firestore/src/register.ts | 2 +- packages/functions-compat/package.json | 10 +- packages/functions/package.json | 10 +- packages/functions/rollup.config.js | 4 +- packages/functions/src/config.ts | 2 +- packages/installations-compat/package.json | 6 +- packages/installations/package.json | 6 +- packages/installations/rollup.config.js | 4 +- packages/installations/src/index.ts | 2 +- packages/logger/package.json | 4 +- packages/messaging-compat/package.json | 6 +- packages/messaging-compat/tsconfig.json | 2 +- packages/messaging/package.json | 12 +- packages/messaging/rollup.config.js | 6 +- packages/messaging/src/helpers/register.ts | 2 +- packages/messaging/sw/package.json | 2 +- packages/messaging/tsconfig.json | 2 +- packages/performance-compat/package.json | 6 +- packages/performance-compat/rollup.config.js | 2 +- packages/performance/package.json | 6 +- packages/performance/rollup.config.js | 4 +- packages/performance/src/index.ts | 2 +- packages/remote-config-compat/package.json | 6 +- .../remote-config-compat/rollup.config.js | 2 +- packages/remote-config/package.json | 6 +- packages/remote-config/rollup.config.js | 4 +- packages/remote-config/src/register.ts | 2 +- packages/storage-compat/package.json | 6 +- packages/storage-compat/rollup.config.js | 2 +- packages/storage/package.json | 8 +- packages/storage/rollup.config.js | 10 +- packages/storage/src/index.ts | 2 +- packages/template/package.json | 8 +- packages/util/package.json | 8 +- packages/webchannel-wrapper/rollup.config.js | 6 +- .../changelog-generator/tsconfig.json | 2 +- repo-scripts/prune-dts/tsconfig.json | 2 +- repo-scripts/size-analysis/analysis-helper.ts | 7 +- repo-scripts/size-analysis/bundle/rollup.ts | 2 +- repo-scripts/size-analysis/bundle/webpack.ts | 2 +- repo-scripts/size-analysis/package.json | 26 +- repo-scripts/size-analysis/rollup.config.js | 4 +- repo-scripts/size-analysis/tsconfig.json | 2 +- scripts/docgen/docgen.ts | 4 +- scripts/tsconfig.json | 2 +- yarn.lock | 226 +----------------- 94 files changed, 274 insertions(+), 499 deletions(-) diff --git a/config/.eslintrc.js b/config/.eslintrc.js index 57243a3e2a4..8212432f841 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -31,7 +31,7 @@ module.exports = { 'unused-imports' ], 'parserOptions': { - 'ecmaVersion': 2017, + 'ecmaVersion': 2020, 'sourceType': 'module' }, 'overrides': [ diff --git a/config/tsconfig.base.json b/config/tsconfig.base.json index adbd2e44072..ce58a6d700b 100644 --- a/config/tsconfig.base.json +++ b/config/tsconfig.base.json @@ -6,7 +6,7 @@ "strict": true, "lib": [ "dom", - "es2017", + "es2020", "esnext.WeakRef", ], "module": "ES2015", @@ -14,7 +14,7 @@ "resolveJsonModule": true, "esModuleInterop": true, "sourceMap": true, - "target": "es2017", + "target": "es2020", "typeRoots": [ "../node_modules/@types" ], diff --git a/config/webpack.test.js b/config/webpack.test.js index 30e3985fe3d..cc739313779 100644 --- a/config/webpack.test.js +++ b/config/webpack.test.js @@ -44,7 +44,7 @@ module.exports = { options: { compilerOptions: { module: 'commonjs', - target: 'es2017', + target: 'es2020', downlevelIteration: true, resolveJsonModule: true } @@ -56,15 +56,6 @@ module.exports = { use: 'source-map-loader', enforce: 'pre' }, - { - test: /\.tsx?$/, - use: { - loader: 'istanbul-instrumenter-loader', - options: { esModules: true } - }, - enforce: 'post', - exclude: [/\.test\.ts$/, /\btest(ing)?\//] - }, { test: /\.js$/, include: [/node_modules\/chai-as-promised/], diff --git a/integration/compat-interop/tsconfig.json b/integration/compat-interop/tsconfig.json index 735f3df7fbd..c986fcaf8a7 100644 --- a/integration/compat-interop/tsconfig.json +++ b/integration/compat-interop/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "noImplicitAny": true, "outDir": "dist", - "target": "es2017", + "target": "es2020", "sourceMap": true, "esModuleInterop": true }, diff --git a/package.json b/package.json index 30b6b09a003..ce2c5847573 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,6 @@ "http-server": "14.1.1", "indexeddbshim": "10.1.0", "inquirer": "8.2.6", - "istanbul-instrumenter-loader": "3.0.1", "js-yaml": "4.1.0", "karma": "6.4.4", "karma-chrome-launcher": "3.2.0", diff --git a/packages/ai/package.json b/packages/ai/package.json index 9a2251543e4..d03f6dc332d 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -7,8 +7,8 @@ "node": ">=18.0.0" }, "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/ai-public.d.ts", @@ -18,9 +18,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/esm/index.esm2017.js" + "import": "./dist/esm/index.esm.js" }, - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/ai/rollup.config.js b/packages/ai/rollup.config.js index 3b155335898..7ebbff4f2f5 100644 --- a/packages/ai/rollup.config.js +++ b/packages/ai/rollup.config.js @@ -39,7 +39,7 @@ const buildPlugins = [ 'integration' ], compilerOptions: { - target: 'es2017' + target: 'es2020' } } }), @@ -57,7 +57,7 @@ const browserBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017), + ...generateBuildTargetReplaceConfig('esm', 2020), __PACKAGE_VERSION__: pkg.version }), emitModulePackageFile() @@ -74,7 +74,7 @@ const browserBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017), + ...generateBuildTargetReplaceConfig('cjs', 2020), __PACKAGE_VERSION__: pkg.version }) ], @@ -93,7 +93,7 @@ const nodeBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017) + ...generateBuildTargetReplaceConfig('esm', 2020) }) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -108,7 +108,7 @@ const nodeBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017) + ...generateBuildTargetReplaceConfig('cjs', 2020) }) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) diff --git a/packages/ai/src/index.node.ts b/packages/ai/src/index.node.ts index 1908e65b1cd..bb05fdcea45 100644 --- a/packages/ai/src/index.node.ts +++ b/packages/ai/src/index.node.ts @@ -55,7 +55,7 @@ function registerAI(): void { ); registerVersion(name, version, 'node'); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/ai/src/index.ts b/packages/ai/src/index.ts index 8451d68bbf0..6ad1f2e3f08 100644 --- a/packages/ai/src/index.ts +++ b/packages/ai/src/index.ts @@ -61,7 +61,7 @@ function registerAI(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 1e51c81fefa..ef13d21343e 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -4,13 +4,13 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/analytics/package.json b/packages/analytics/package.json index b118e706316..0627556deed 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -4,13 +4,13 @@ "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/analytics-public.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/analytics/rollup.config.js b/packages/analytics/rollup.config.js index 529858f147f..f119da4bd5f 100644 --- a/packages/analytics/rollup.config.js +++ b/packages/analytics/rollup.config.js @@ -53,7 +53,7 @@ const esmBuilds = [ external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ] } @@ -73,7 +73,7 @@ const cjsBuilds = [ external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ] } ]; diff --git a/packages/analytics/src/index.ts b/packages/analytics/src/index.ts index f79725db7bd..7fa2e8fa10b 100644 --- a/packages/analytics/src/index.ts +++ b/packages/analytics/src/index.ts @@ -66,7 +66,7 @@ function registerAnalytics(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); function internalFactory( diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index ab20d3a585a..eb2af822b52 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -4,13 +4,13 @@ "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 2c8e1e8e6e1..caea78cc3bc 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -4,13 +4,13 @@ "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/app-check-public.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 6f7b7ccc706..bed5553a39c 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -4,15 +4,15 @@ "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "lite": "dist/index.lite.js", "exports": { ".": { "types": "./dist/app-compat-public.d.ts", "require": "./dist/index.cjs.js", "lite": "./dist/index.lite.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/app/package.json b/packages/app/package.json index c11f5039310..7fbcff0bdcf 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -4,15 +4,15 @@ "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "react-native": "dist/index.cjs.js", "exports": { ".": { "types": "./dist/app-public.d.ts", "require": "./dist/index.cjs.js", "react-native": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/app/rollup.config.js b/packages/app/rollup.config.js index 8314734a746..0e916a43b26 100644 --- a/packages/app/rollup.config.js +++ b/packages/app/rollup.config.js @@ -54,7 +54,7 @@ const esmBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017), + ...generateBuildTargetReplaceConfig('esm', 2020), '__RUNTIME_ENV__': '' }), emitModulePackageFile() @@ -74,7 +74,7 @@ const cjsBuilds = [ plugins: [ ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017), + ...generateBuildTargetReplaceConfig('cjs', 2020), '__RUNTIME_ENV__': 'node' }) ] diff --git a/packages/app/src/heartbeatService.test.ts b/packages/app/src/heartbeatService.test.ts index 57f97ec7468..caebba457c3 100644 --- a/packages/app/src/heartbeatService.test.ts +++ b/packages/app/src/heartbeatService.test.ts @@ -149,8 +149,10 @@ describe('HeartbeatServiceImpl', () => { expect(emptyHeaders).to.equal(''); }); it(`triggerHeartbeat() doesn't throw even if code errors`, async () => { - //@ts-expect-error Ensure this doesn't match - heartbeatService._heartbeatsCache?.lastSentHeartbeatDate = 50; + if (heartbeatService._heartbeatsCache) { + //@ts-expect-error Ensure this doesn't match + heartbeatService._heartbeatsCache.lastSentHeartbeatDate = 50; + } //@ts-expect-error Ensure you can't .push() to this heartbeatService._heartbeatsCache.heartbeats = 50; const warnStub = stub(console, 'warn'); diff --git a/packages/app/src/registerCoreComponents.ts b/packages/app/src/registerCoreComponents.ts index f0141dbf155..f84445714f3 100644 --- a/packages/app/src/registerCoreComponents.ts +++ b/packages/app/src/registerCoreComponents.ts @@ -40,7 +40,7 @@ export function registerCoreComponents(variant?: string): void { // Register `app` package. registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); // Register platform SDK identifier (no version). registerVersion('fire-js', ''); diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index f681fa63538..c56195cf991 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -4,8 +4,8 @@ "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "exports": { ".": { "types": "./dist/auth-compat/index.d.ts", @@ -16,9 +16,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/auth/api-extractor.json b/packages/auth/api-extractor.json index f7279fcac15..8b44b43f4d1 100644 --- a/packages/auth/api-extractor.json +++ b/packages/auth/api-extractor.json @@ -1,6 +1,6 @@ { "extends": "../../config/api-extractor.json", - "mainEntryPointFilePath": "/dist/esm2017/index.d.ts", + "mainEntryPointFilePath": "/dist/esm/index.d.ts", "dtsRollup": { "enabled": true, "untrimmedFilePath": "/dist/.d.ts", diff --git a/packages/auth/demo/rollup.config.js b/packages/auth/demo/rollup.config.js index ce6a2893210..d71d9aa58e3 100644 --- a/packages/auth/demo/rollup.config.js +++ b/packages/auth/demo/rollup.config.js @@ -31,11 +31,11 @@ const workerPlugins = [ tsconfigOverride: { compilerOptions: { declaration: false, - target: 'es2017', + target: 'es2020', lib: [ // TODO: remove this 'dom', - 'es2017', + 'es2020', 'webworker' ] } diff --git a/packages/auth/demo/src/worker/tsconfig.json b/packages/auth/demo/src/worker/tsconfig.json index 1081b12233f..3d05a4350c7 100644 --- a/packages/auth/demo/src/worker/tsconfig.json +++ b/packages/auth/demo/src/worker/tsconfig.json @@ -2,9 +2,9 @@ "extends": "../../../config/tsconfig.base.json", "compilerOptions": { "outDir": "dist", - "target": "es2017", + "target": "es2020", "lib": [ - "es2017", + "es2020", "webworker" ] }, diff --git a/packages/auth/internal/package.json b/packages/auth/internal/package.json index 4ecfdccbd20..1a67791cfaf 100644 --- a/packages/auth/internal/package.json +++ b/packages/auth/internal/package.json @@ -2,9 +2,9 @@ "name": "@firebase/auth/internal", "description": "An internal version of the Auth SDK for use in the compatibility layer", "main": "../dist/node/internal.js", - "module": "../dist/esm2017/internal.js", - "browser": "../dist/esm2017/internal.js", - "typings": "../dist/esm2017/internal/index.d.ts", + "module": "../dist/esm/internal.js", + "browser": "../dist/esm/internal.js", + "typings": "../dist/esm/internal/index.d.ts", "private": true, "engines": { "node": ">=18.0.0" diff --git a/packages/auth/package.json b/packages/auth/package.json index c6411b4bd3b..4dc43b98ea3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -5,10 +5,10 @@ "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", "react-native": "dist/rn/index.js", - "browser": "dist/esm2017/index.js", - "module": "dist/esm2017/index.js", + "browser": "dist/esm/index.js", + "module": "dist/esm/index.js", "cordova": "dist/cordova/index.js", - "web-extension": "dist/web-extension-esm2017/index.js", + "web-extension": "dist/web-extension-esm/index.js", "webworker": "dist/index.webworker.js", "exports": { ".": { @@ -32,19 +32,19 @@ }, "browser": { "require": "./dist/browser-cjs/index.js", - "import": "./dist/esm2017/index.js" + "import": "./dist/esm/index.js" }, - "default": "./dist/esm2017/index.js" + "default": "./dist/esm/index.js" }, "./cordova": { "types": "./dist/cordova/auth-cordova-public.d.ts", "default": "./dist/cordova/index.js" }, "./web-extension": { - "types:": "./dist/web-extension-esm2017/auth-web-extension-public.d.ts", - "import": "./dist/web-extension-esm2017/index.js", + "types:": "./dist/web-extension-esm/auth-web-extension-public.d.ts", + "import": "./dist/web-extension-esm/index.js", "require": "./dist/web-extension-cjs/index.js", - "default": "./dist/web-extension-esm2017/index.js" + "default": "./dist/web-extension-esm/index.js" }, "./internal": { "types": "./dist/internal/index.d.ts", @@ -63,15 +63,15 @@ }, "browser": { "require": "./dist/browser-cjs/internal.js", - "import": "./dist/esm2017/internal.js" + "import": "./dist/esm/internal.js" }, "web-extension": { "types:": "./dist/web-extension-cjs/internal/index.d.ts", - "import": "./dist/web-extension-esm2017/internal.js", + "import": "./dist/web-extension-esm/internal.js", "require": "./dist/web-extension-cjs/internal.js", - "default": "./dist/web-extension-esm2017/internal.js" + "default": "./dist/web-extension-esm/internal.js" }, - "default": "./dist/esm2017/internal.js" + "default": "./dist/esm/internal.js" }, "./package.json": "./package.json" }, diff --git a/packages/auth/rollup.config.js b/packages/auth/rollup.config.js index 01ca456e0ac..bef5b696ca2 100644 --- a/packages/auth/rollup.config.js +++ b/packages/auth/rollup.config.js @@ -61,13 +61,13 @@ const browserBuilds = [ internal: 'internal/index.ts' }, output: { - dir: 'dist/esm2017', + dir: 'dist/esm', format: 'es', sourcemap: true }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, @@ -79,7 +79,7 @@ const browserBuilds = [ output: [{ dir: 'dist/browser-cjs', format: 'cjs', sourcemap: true }], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } @@ -92,13 +92,13 @@ const browserWebExtensionBuilds = [ internal: 'internal/index.ts' }, output: { - dir: 'dist/web-extension-esm2017', + dir: 'dist/web-extension-esm', format: 'es', sourcemap: true }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -111,7 +111,7 @@ const browserWebExtensionBuilds = [ output: [{ dir: 'dist/web-extension-cjs', format: 'cjs', sourcemap: true }], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } @@ -127,7 +127,7 @@ const nodeBuilds = [ plugins: [ nodeAliasPlugin, ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, @@ -140,7 +140,7 @@ const nodeBuilds = [ plugins: [ nodeAliasPlugin, ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -159,7 +159,7 @@ const cordovaBuild = { }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: id => [...deps, 'cordova'].some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -173,7 +173,7 @@ const rnBuild = { output: [{ dir: 'dist/rn', format: 'cjs', sourcemap: true }], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => [...deps, 'react-native'].some( @@ -200,12 +200,12 @@ const webWorkerBuild = { lib: [ // Remove dom after we figure out why navigator stuff doesn't exist 'dom', - 'es2017', + 'es2020', 'webworker' ] } }), - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }; diff --git a/packages/auth/src/core/auth/register.ts b/packages/auth/src/core/auth/register.ts index 9d0d6b4559d..4d7688e9804 100644 --- a/packages/auth/src/core/auth/register.ts +++ b/packages/auth/src/core/auth/register.ts @@ -130,6 +130,6 @@ export function registerAuth(clientPlatform: ClientPlatform): void { ); registerVersion(name, version, getVersionForPlatform(clientPlatform)); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/auth/web-extension/api-extractor.json b/packages/auth/web-extension/api-extractor.json index d12063c69b5..111018d32ad 100644 --- a/packages/auth/web-extension/api-extractor.json +++ b/packages/auth/web-extension/api-extractor.json @@ -1,13 +1,13 @@ { "extends": "../../../config/api-extractor.json", - "mainEntryPointFilePath": "/dist/web-extension-esm2017/index.web-extension.d.ts", + "mainEntryPointFilePath": "/dist/web-extension-esm/index.web-extension.d.ts", "apiReport": { "enabled": false }, "dtsRollup": { "enabled": true, - "untrimmedFilePath": "/dist/web-extension-esm2017/.d.ts", - "publicTrimmedFilePath": "/dist/web-extension-esm2017/-public.d.ts" + "untrimmedFilePath": "/dist/web-extension-esm/.d.ts", + "publicTrimmedFilePath": "/dist/web-extension-esm/-public.d.ts" }, "docModel": { "enabled": true, diff --git a/packages/auth/web-extension/package.json b/packages/auth/web-extension/package.json index f3882a4f1d0..2b1b9ec599a 100644 --- a/packages/auth/web-extension/package.json +++ b/packages/auth/web-extension/package.json @@ -2,7 +2,7 @@ "name": "@firebase/auth-web-extension", "description": "A Chrome-Manifest-v3-specific build of the Firebase Auth JS SDK", "main": "../dist/web-extension-cjs/index.js", - "browser": "../dist/web-extension-esm2017/index.js", - "module": "../dist/web-extension-esm2017/index.js", - "typings": "../dist/web-extension-esm2017/auth-web-extension-public.d.ts" + "browser": "../dist/web-extension-esm/index.js", + "module": "../dist/web-extension-esm/index.js", + "typings": "../dist/web-extension-esm/auth-web-extension-public.d.ts" } \ No newline at end of file diff --git a/packages/component/package.json b/packages/component/package.json index 941d80f00bc..9bc11a5784b 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -4,13 +4,13 @@ "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 7b5f7e2dc2d..ef169dfa5ff 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -4,8 +4,8 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "exports": { ".": { "types": "./dist/public.d.ts", @@ -15,9 +15,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/data-connect/rollup.config.js b/packages/data-connect/rollup.config.js index ab0119ca5d2..7b004c0a421 100644 --- a/packages/data-connect/rollup.config.js +++ b/packages/data-connect/rollup.config.js @@ -59,7 +59,7 @@ const browserBuilds = [ ], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], treeshake: { moduleSideEffects: false @@ -76,7 +76,7 @@ const browserBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], treeshake: { moduleSideEffects: false @@ -96,7 +96,7 @@ const nodeBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], treeshake: { moduleSideEffects: false @@ -113,7 +113,7 @@ const nodeBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ], treeshake: { diff --git a/packages/data-connect/src/register.ts b/packages/data-connect/src/register.ts index 53b44f4e43d..badebf2a29b 100644 --- a/packages/data-connect/src/register.ts +++ b/packages/data-connect/src/register.ts @@ -58,6 +58,6 @@ export function registerDataConnect(variant?: string): void { ).setMultipleInstances(true) ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 1a5d6f79313..01a42da2a20 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -4,8 +4,8 @@ "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "license": "Apache-2.0", "typings": "dist/database-compat/src/index.d.ts", "files": [ @@ -22,9 +22,9 @@ }, "browser": { "require": "./dist/index.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./standalone": { "types": "./dist/database-compat/src/index.standalone.d.ts", diff --git a/packages/database/package.json b/packages/database/package.json index cfc197da0e3..ce7811adfe4 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -4,8 +4,8 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "standalone": "dist/index.standalone.js", "exports": { ".": { @@ -17,9 +17,9 @@ "standalone": "./dist/index.standalone.js", "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/database/rollup.config.js b/packages/database/rollup.config.js index bdd6b8ae36c..165195229c9 100644 --- a/packages/database/rollup.config.js +++ b/packages/database/rollup.config.js @@ -59,7 +59,7 @@ const browserBuilds = [ ], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], treeshake: { moduleSideEffects: false @@ -78,7 +78,7 @@ const browserBuilds = [ ], plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], treeshake: { moduleSideEffects: false @@ -98,7 +98,7 @@ const nodeBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], treeshake: { moduleSideEffects: false @@ -115,7 +115,7 @@ const nodeBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ], treeshake: { diff --git a/packages/database/src/register.ts b/packages/database/src/register.ts index 9322368526b..c54f52b5a3e 100644 --- a/packages/database/src/register.ts +++ b/packages/database/src/register.ts @@ -47,6 +47,6 @@ export function registerDatabase(variant?: string): void { ).setMultipleInstances(true) ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 81b0aede4ce..7d446495832 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -5,8 +5,8 @@ "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "react-native": "dist/index.rn.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", @@ -17,9 +17,9 @@ "react-native": "./dist/index.rn.js", "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/firestore-compat/rollup.config.js b/packages/firestore-compat/rollup.config.js index c85af11225f..e265d3e31b7 100644 --- a/packages/firestore-compat/rollup.config.js +++ b/packages/firestore-compat/rollup.config.js @@ -25,12 +25,12 @@ const util = require('../firestore/rollup.shared'); const deps = Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies }); -const es2017Plugins = [ +const es2020Plugins = [ typescriptPlugin({ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } }, transformers: [util.removeAssertTransformer] @@ -46,7 +46,7 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017Plugins, + plugins: es2020Plugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -58,7 +58,7 @@ const browserBuilds = [ sourcemap: true } ], - plugins: es2017Plugins, + plugins: es2020Plugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -71,7 +71,7 @@ const nodeBuilds = [ format: 'cjs', sourcemap: true }, - plugins: es2017Plugins, + plugins: es2020Plugins, external: deps }, { @@ -81,7 +81,7 @@ const nodeBuilds = [ format: 'es', sourcemap: true }, - plugins: [...es2017Plugins, emitModulePackageFile()], + plugins: [...es2020Plugins, emitModulePackageFile()], external: deps } ]; @@ -94,7 +94,7 @@ const rnBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017Plugins, + plugins: es2020Plugins, external: deps } ]; diff --git a/packages/firestore/lite/package.json b/packages/firestore/lite/package.json index ef362535fdb..b5f50e4afa9 100644 --- a/packages/firestore/lite/package.json +++ b/packages/firestore/lite/package.json @@ -3,9 +3,9 @@ "description": "A lite version of the Firestore SDK", "main": "../dist/lite/index.node.cjs.js", "main-esm": "../dist/lite/index.node.mjs", - "module": "../dist/lite/index.browser.esm2017.js", - "browser": "../dist/lite/index.browser.esm2017.js", - "react-native": "../dist/lite/index.rn.esm2017.js", + "module": "../dist/lite/index.browser.esm.js", + "browser": "../dist/lite/index.browser.esm.js", + "react-native": "../dist/lite/index.rn.esm.js", "typings": "../dist/lite/index.d.ts", "private": true, "engines": { diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 1c6bc39c06f..519243487c2 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -70,9 +70,9 @@ "react-native": "./dist/index.rn.js", "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./lite": { "types": "./dist/lite/index.d.ts", @@ -80,20 +80,20 @@ "require": "./dist/lite/index.node.cjs.js", "import": "./dist/lite/index.node.mjs" }, - "react-native": "./dist/lite/index.rn.esm2017.js", + "react-native": "./dist/lite/index.rn.esm.js", "browser": { "require": "./dist/lite/index.cjs.js", - "import": "./dist/lite/index.browser.esm2017.js" + "import": "./dist/lite/index.browser.esm.js" }, - "default": "./dist/lite/index.browser.esm2017.js" + "default": "./dist/lite/index.browser.esm.js" }, "./package.json": "./package.json" }, "main": "dist/index.node.cjs.js", "main-esm": "dist/index.node.mjs", "react-native": "dist/index.rn.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "license": "Apache-2.0", "files": [ "dist", diff --git a/packages/firestore/rollup.config.debug.js b/packages/firestore/rollup.config.debug.js index a8823820d1d..10b2870e18b 100644 --- a/packages/firestore/rollup.config.debug.js +++ b/packages/firestore/rollup.config.debug.js @@ -25,9 +25,9 @@ import pkg from './package.json'; // This rollup configuration creates a single non-minified build for browser // testing. You can test code changes by running `yarn build:debug`. This -// creates the file "dist/index.esm2017.js" that you can use in your sample +// creates the file "dist/index.esm.js" that you can use in your sample // app as a replacement for -// "node_modules/@firebase/firestore/dist/index.esm2017.js". +// "node_modules/@firebase/firestore/dist/index.esm.js". const browserPlugins = function () { return [ @@ -35,7 +35,7 @@ const browserPlugins = function () { typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } }, cacheDir: tmp.dirSync(), diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index f9a29bef742..5fa616bca80 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -97,7 +97,7 @@ const allBuilds = [ cacheDir: tmp.dirSync() }), sourcemaps(), - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: util.resolveNodeExterns, treeshake: { @@ -114,7 +114,7 @@ const allBuilds = [ }, plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: util.resolveNodeExterns, treeshake: { @@ -137,7 +137,7 @@ const allBuilds = [ moduleSideEffects: false } }, - // Convert es2017 build to cjs + // Convert es2020 build to cjs { input: pkg['browser'], output: [ @@ -149,14 +149,14 @@ const allBuilds = [ ], plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: util.resolveBrowserExterns, treeshake: { moduleSideEffects: false } }, - // es2017 build with build target reporting + // es2020 build with build target reporting { input: pkg['browser'], output: [ @@ -168,7 +168,7 @@ const allBuilds = [ ], plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: util.resolveBrowserExterns, treeshake: { @@ -186,7 +186,7 @@ const allBuilds = [ plugins: [ alias(util.generateAliasConfig('rn')), ...browserPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: util.resolveBrowserExterns, treeshake: { diff --git a/packages/firestore/rollup.config.lite.js b/packages/firestore/rollup.config.lite.js index 9ff4d57a8d8..5ea2225f364 100644 --- a/packages/firestore/rollup.config.lite.js +++ b/packages/firestore/rollup.config.lite.js @@ -93,7 +93,7 @@ const allBuilds = [ }), json(), sourcemaps(), - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: util.resolveNodeExterns, treeshake: { @@ -110,7 +110,7 @@ const allBuilds = [ }, plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: util.resolveNodeExterns, treeshake: { @@ -140,7 +140,7 @@ const allBuilds = [ moduleSideEffects: false } }, - // Convert es2017 build to CJS + // Convert es2020 build to CJS { input: path.resolve('./lite', pkg.browser), output: [ @@ -152,14 +152,14 @@ const allBuilds = [ ], plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: util.resolveBrowserExterns, treeshake: { moduleSideEffects: false } }, - // Browser es2017 build + // Browser es2020 build { input: path.resolve('./lite', pkg.browser), output: [ @@ -171,7 +171,7 @@ const allBuilds = [ ], plugins: [ sourcemaps(), - replace(generateBuildTargetReplaceConfig('esm', 2017)) + replace(generateBuildTargetReplaceConfig('esm', 2020)) ], external: util.resolveBrowserExterns, treeshake: { @@ -190,7 +190,7 @@ const allBuilds = [ alias(util.generateAliasConfig('rn_lite')), ...browserPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017), + ...generateBuildTargetReplaceConfig('esm', 2020), '__RUNTIME_ENV__': 'rn' }) ], diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index 728f03df2fe..99adca9096e 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -33,8 +33,8 @@ const pkg = require('./package.json'); // This file contains shared utilities for Firestore's rollup builds. // Firestore is released in a number of different build configurations: -// - Browser builds that support persistence in ES2017 CJS and ESM formats. -// - In-memory Browser builds that support persistence in ES2017 CJS and ESM +// - Browser builds that support persistence in ES2020 CJS and ESM formats. +// - In-memory Browser builds that support persistence in ES2020 CJS and ESM // formats. // - A NodeJS build that supports persistence (to be used with an IndexedDb // shim) @@ -46,7 +46,7 @@ const pkg = require('./package.json'); // We use two different rollup pipelines to take advantage of tree shaking, // as Rollup does not support tree shaking for TypeScript classes transpiled // down to ES5 (see https://bit.ly/340P23U). The build pipeline in this file -// produces tree-shaken ES2017 builds that are consumed by the ES5 builds in +// produces tree-shaken ES2020 builds that are consumed by the ES5 builds in // `rollup.config.es.js`. // // All browser builds rely on Terser's property name mangling to reduce code @@ -240,7 +240,7 @@ exports.applyPrebuilt = function (name = 'prebuilt.js') { }); }; -exports.es2017Plugins = function (platform, mangled = false) { +exports.es2020Plugins = function (platform, mangled = false) { if (mangled) { return [ alias(generateAliasConfig(platform)), @@ -265,7 +265,7 @@ exports.es2017Plugins = function (platform, mangled = false) { } }; -exports.es2017PluginsCompat = function ( +exports.es2020PluginsCompat = function ( platform, pathTransformer, mangled = false diff --git a/packages/firestore/scripts/build-bundle.js b/packages/firestore/scripts/build-bundle.js index f8ba283a5a8..89153e74540 100644 --- a/packages/firestore/scripts/build-bundle.js +++ b/packages/firestore/scripts/build-bundle.js @@ -14,4 +14,4 @@ * 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. - */var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1] { typescriptPlugin({ tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } }, transformers: [util.removeAssertTransformer] diff --git a/packages/firestore/src/register.ts b/packages/firestore/src/register.ts index 82b450b3834..7ec6aae5c30 100644 --- a/packages/firestore/src/register.ts +++ b/packages/firestore/src/register.ts @@ -61,6 +61,6 @@ export function registerFirestore( ).setMultipleInstances(true) ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 2c261c8f82b..6fa6b8e45b2 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -4,20 +4,20 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "node": { "require": "./dist/index.cjs.js", - "import": "./dist/esm/index.esm2017.js" + "import": "./dist/esm/index.esm.js" }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/esm/index.esm2017.js" + "import": "./dist/esm/index.esm.js" }, - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/functions/package.json b/packages/functions/package.json index e7ff5930fa6..62a63f5ce38 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -4,20 +4,20 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/functions-public.d.ts", "node": { - "import": "./dist/esm/index.esm2017.js", + "import": "./dist/esm/index.esm.js", "require": "./dist/index.cjs.js" }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/esm/index.esm2017.js" + "import": "./dist/esm/index.esm.js" }, - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/functions/rollup.config.js b/packages/functions/rollup.config.js index 06899e7224c..797c263e3b8 100644 --- a/packages/functions/rollup.config.js +++ b/packages/functions/rollup.config.js @@ -49,7 +49,7 @@ const builds = [ external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ] }, @@ -63,7 +63,7 @@ const builds = [ external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ] } ]; diff --git a/packages/functions/src/config.ts b/packages/functions/src/config.ts index 8dfadb52b54..ab596a1cbc0 100644 --- a/packages/functions/src/config.ts +++ b/packages/functions/src/config.ts @@ -65,6 +65,6 @@ export function registerFunctions(variant?: string): void { ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index b84a1bd2199..6dab5586392 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -3,13 +3,13 @@ "version": "0.2.18", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "module": "dist/esm/index.esm2017.js", - "browser": "dist/esm/index.esm2017.js", + "module": "dist/esm/index.esm.js", + "browser": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/installations/package.json b/packages/installations/package.json index 949d8441e02..318843e1e1a 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -3,13 +3,13 @@ "version": "0.6.18", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "module": "dist/esm/index.esm2017.js", - "browser": "dist/esm/index.esm2017.js", + "module": "dist/esm/index.esm.js", + "browser": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/installations-public.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/installations/rollup.config.js b/packages/installations/rollup.config.js index bf2b61f73f0..694a1383787 100644 --- a/packages/installations/rollup.config.js +++ b/packages/installations/rollup.config.js @@ -46,7 +46,7 @@ const esmBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ] }; @@ -61,7 +61,7 @@ const cjsBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ] }; diff --git a/packages/installations/src/index.ts b/packages/installations/src/index.ts index 5a70ef10846..d56056ac189 100644 --- a/packages/installations/src/index.ts +++ b/packages/installations/src/index.ts @@ -31,5 +31,5 @@ export * from './interfaces/public-types'; registerInstallations(); registerVersion(name, version); -// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation +// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); diff --git a/packages/logger/package.json b/packages/logger/package.json index f8661d3fdf7..dd492c36915 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -4,12 +4,12 @@ "description": "A logger package for use in the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "module": "dist/esm/index.esm2017.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 1265e7171b4..517bd5a2304 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -5,13 +5,13 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/messaging-compat/tsconfig.json b/packages/messaging-compat/tsconfig.json index 90f9c26f657..4ec5372577b 100644 --- a/packages/messaging-compat/tsconfig.json +++ b/packages/messaging-compat/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", "noUnusedLocals": true, - "lib": ["dom", "es2017"], + "lib": ["dom", "es2020"], "downlevelIteration": true }, "exclude": ["dist/**/*"] diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 19c096e398b..7dd640fdb16 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -4,21 +4,21 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", - "sw": "dist/esm/index.sw.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", + "sw": "dist/esm/index.sw.esm.js", "sw-main": "dist/index.sw.cjs", "exports": { ".": { "types": "./dist/index-public.d.ts", "require": "./dist/index.cjs.js", - "module": "./dist/esm/index.esm2017.js", - "default": "./dist/esm/index.esm2017.js" + "module": "./dist/esm/index.esm.js", + "default": "./dist/esm/index.esm.js" }, "./sw": { "types": "./dist/sw/index-public.d.ts", "require": "./dist/index.sw.cjs", - "default": "./dist/esm/index.sw.esm2017.js" + "default": "./dist/esm/index.sw.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/messaging/rollup.config.js b/packages/messaging/rollup.config.js index 9342be135f2..0c51c683294 100644 --- a/packages/messaging/rollup.config.js +++ b/packages/messaging/rollup.config.js @@ -48,7 +48,7 @@ const esmBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -76,7 +76,7 @@ const cjsBuilds = [ }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, @@ -91,7 +91,7 @@ const cjsBuilds = [ output: { file: pkg['sw-main'], format: 'cjs', sourcemap: true }, plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } diff --git a/packages/messaging/src/helpers/register.ts b/packages/messaging/src/helpers/register.ts index ef28cd2edad..60f1dd0fe8c 100644 --- a/packages/messaging/src/helpers/register.ts +++ b/packages/messaging/src/helpers/register.ts @@ -104,7 +104,7 @@ export function registerMessagingInWindow(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/messaging/sw/package.json b/packages/messaging/sw/package.json index 472e37684bc..9a076664821 100644 --- a/packages/messaging/sw/package.json +++ b/packages/messaging/sw/package.json @@ -3,6 +3,6 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "../dist/index.sw.cjs", - "module": "../dist/esm/index.sw.esm2017.js", + "module": "../dist/esm/index.sw.esm.js", "typings": "../dist/src/index.sw.d.ts" } diff --git a/packages/messaging/tsconfig.json b/packages/messaging/tsconfig.json index 90f9c26f657..4ec5372577b 100644 --- a/packages/messaging/tsconfig.json +++ b/packages/messaging/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", "noUnusedLocals": true, - "lib": ["dom", "es2017"], + "lib": ["dom", "es2020"], "downlevelIteration": true }, "exclude": ["dist/**/*"] diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 32b4d19c8d7..9ce60ab51af 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -4,13 +4,13 @@ "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/performance-compat/rollup.config.js b/packages/performance-compat/rollup.config.js index e52495c401e..b96fe548483 100644 --- a/packages/performance-compat/rollup.config.js +++ b/packages/performance-compat/rollup.config.js @@ -30,7 +30,7 @@ const buildPlugins = [ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } } }), diff --git a/packages/performance/package.json b/packages/performance/package.json index 4cd59811127..4bf4f3e4c5d 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -4,13 +4,13 @@ "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/performance/rollup.config.js b/packages/performance/rollup.config.js index 006dcf54337..ef30405c02c 100644 --- a/packages/performance/rollup.config.js +++ b/packages/performance/rollup.config.js @@ -44,7 +44,7 @@ const esmBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ] }; @@ -59,7 +59,7 @@ const cjsBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ] }; diff --git a/packages/performance/src/index.ts b/packages/performance/src/index.ts index 4ccb499b368..7ccc73ee6e9 100644 --- a/packages/performance/src/index.ts +++ b/packages/performance/src/index.ts @@ -137,7 +137,7 @@ function registerPerformance(): void { new Component('performance', factory, ComponentType.PUBLIC) ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index da128fa1aa0..bf827f52c7f 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -4,13 +4,13 @@ "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/remote-config-compat/rollup.config.js b/packages/remote-config-compat/rollup.config.js index e52495c401e..b96fe548483 100644 --- a/packages/remote-config-compat/rollup.config.js +++ b/packages/remote-config-compat/rollup.config.js @@ -30,7 +30,7 @@ const buildPlugins = [ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } } }), diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 97c1fb27aa6..ef94a90c53b 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -4,13 +4,13 @@ "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/esm/index.esm2017.js", - "module": "dist/esm/index.esm2017.js", + "browser": "dist/esm/index.esm.js", + "module": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/remote-config-public.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/remote-config/rollup.config.js b/packages/remote-config/rollup.config.js index d8eb3abd315..8c7b834bf96 100644 --- a/packages/remote-config/rollup.config.js +++ b/packages/remote-config/rollup.config.js @@ -52,7 +52,7 @@ const esmBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), + replace(generateBuildTargetReplaceConfig('esm', 2020)), emitModulePackageFile() ] }; @@ -67,7 +67,7 @@ const cjsBuild = { external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ ...buildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 2017)) + replace(generateBuildTargetReplaceConfig('cjs', 2020)) ] }; diff --git a/packages/remote-config/src/register.ts b/packages/remote-config/src/register.ts index dda6cc544de..160e20219ce 100644 --- a/packages/remote-config/src/register.ts +++ b/packages/remote-config/src/register.ts @@ -51,7 +51,7 @@ export function registerRemoteConfig(): void { ); registerVersion(packageName, version); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(packageName, version, '__BUILD_TARGET__'); function remoteConfigFactory( diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index e760b1051e3..e50f685fde5 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -4,13 +4,13 @@ "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", - "browser": "./dist/esm/index.esm2017.js", - "module": "./dist/esm/index.esm2017.js", + "browser": "./dist/esm/index.esm.js", + "module": "./dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm2017.js" + "default": "./dist/esm/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/storage-compat/rollup.config.js b/packages/storage-compat/rollup.config.js index 59f6282bf5e..5e0753ffdb8 100644 --- a/packages/storage-compat/rollup.config.js +++ b/packages/storage-compat/rollup.config.js @@ -31,7 +31,7 @@ const buildPlugins = [ abortOnError: false, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } } }), diff --git a/packages/storage/package.json b/packages/storage/package.json index 5a9d90a32ac..c1d272207dd 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -4,8 +4,8 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "module": "dist/index.esm2017.js", - "browser": "dist/index.esm2017.js", + "module": "dist/index.esm.js", + "browser": "dist/index.esm.js", "exports": { ".": { "types": "./dist/storage-public.d.ts", @@ -15,9 +15,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/storage/rollup.config.js b/packages/storage/rollup.config.js index 4ce92722281..c16231aa476 100644 --- a/packages/storage/rollup.config.js +++ b/packages/storage/rollup.config.js @@ -65,7 +65,7 @@ const browserBuilds = [ alias(generateAliasConfig('browser')), ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017), + ...generateBuildTargetReplaceConfig('esm', 2020), '__RUNTIME_ENV__': '' }) ], @@ -85,7 +85,7 @@ const browserBuilds = [ alias(generateAliasConfig('browser')), ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017), + ...generateBuildTargetReplaceConfig('cjs', 2020), '__RUNTIME_ENV__': '' }) ], @@ -104,7 +104,7 @@ const browserBuilds = [ alias(generateAliasConfig('browser')), ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017), + ...generateBuildTargetReplaceConfig('cjs', 2020), '__RUNTIME_ENV__': '' }) ], @@ -127,7 +127,7 @@ const nodeBuilds = [ alias(generateAliasConfig('node')), ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 2017), + ...generateBuildTargetReplaceConfig('cjs', 2020), '__RUNTIME_ENV__': 'node' }) ], @@ -148,7 +148,7 @@ const nodeBuilds = [ alias(generateAliasConfig('node')), ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('esm', 2017), + ...generateBuildTargetReplaceConfig('esm', 2020), '__RUNTIME_ENV__': 'node' }), emitModulePackageFile() diff --git a/packages/storage/src/index.ts b/packages/storage/src/index.ts index 733a39c9ad8..c23acc0ec4c 100644 --- a/packages/storage/src/index.ts +++ b/packages/storage/src/index.ts @@ -70,7 +70,7 @@ function registerStorage(): void { ); //RUNTIME_ENV will be replaced during the compilation to "node" for nodejs and an empty string for browser registerVersion(name, version, '__RUNTIME_ENV__'); - // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation + // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/template/package.json b/packages/template/package.json index 6f0578f5dfc..70aa992a67e 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -5,8 +5,8 @@ "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "exports": { ".": { "types": "./dist/index.d.ts", @@ -16,9 +16,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/util/package.json b/packages/util/package.json index c54612bee84..0528ad84638 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -4,8 +4,8 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", + "browser": "dist/index.esm.js", + "module": "dist/index.esm.js", "exports": { ".": { "types": "./dist/util-public.d.ts", @@ -15,9 +15,9 @@ }, "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/index.esm.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/index.esm.js" }, "./package.json": "./package.json" }, diff --git a/packages/webchannel-wrapper/rollup.config.js b/packages/webchannel-wrapper/rollup.config.js index ae80c831396..18d7604133a 100644 --- a/packages/webchannel-wrapper/rollup.config.js +++ b/packages/webchannel-wrapper/rollup.config.js @@ -39,7 +39,7 @@ const buildPlugins = [ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017' + target: 'es2020' } } }), @@ -49,7 +49,7 @@ const buildPlugins = [ /** * ESM builds */ -const esm2017Builds = [ +const esmBuilds = [ { input: join(closureBlobsDir, 'webchannel_blob_es2018.js'), output: { @@ -70,4 +70,4 @@ const esm2017Builds = [ } ]; -export default esm2017Builds; +export default esmBuilds; diff --git a/repo-scripts/changelog-generator/tsconfig.json b/repo-scripts/changelog-generator/tsconfig.json index 38bdb7035e4..4d15389487e 100644 --- a/repo-scripts/changelog-generator/tsconfig.json +++ b/repo-scripts/changelog-generator/tsconfig.json @@ -9,6 +9,6 @@ "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, - "target": "es2017" + "target": "es2020" } } \ No newline at end of file diff --git a/repo-scripts/prune-dts/tsconfig.json b/repo-scripts/prune-dts/tsconfig.json index 14618a434b0..a4cb1ed68a0 100644 --- a/repo-scripts/prune-dts/tsconfig.json +++ b/repo-scripts/prune-dts/tsconfig.json @@ -5,7 +5,7 @@ "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, - "target": "es2017", + "target": "es2020", "esModuleInterop": true, "declaration": true, "strict": true, diff --git a/repo-scripts/size-analysis/analysis-helper.ts b/repo-scripts/size-analysis/analysis-helper.ts index 9507bfe253c..a21215c777d 100644 --- a/repo-scripts/size-analysis/analysis-helper.ts +++ b/repo-scripts/size-analysis/analysis-helper.ts @@ -86,7 +86,7 @@ export async function extractDependenciesAndSize( input, plugins: [ resolve({ - mainFields: ['esm2017', 'module', 'main'] + mainFields: ['module', 'main'] }), commonjs() ] @@ -499,16 +499,13 @@ export async function generateReportForModule( * @param pkgJson package.json of the module. * * This function implements a fallback of locating module's bundle file. - * It first looks at esm2017 field of package.json, then module field. Main + * It first looks at the module field. Main * field at the last. * */ function retrieveBundleFileLocation(pkgJson: { [key: string]: string; }): string { - if (pkgJson['esm2017']) { - return pkgJson['esm2017']; - } if (pkgJson['module']) { return pkgJson['module']; } diff --git a/repo-scripts/size-analysis/bundle/rollup.ts b/repo-scripts/size-analysis/bundle/rollup.ts index 272cd934d08..250ecd8da06 100644 --- a/repo-scripts/size-analysis/bundle/rollup.ts +++ b/repo-scripts/size-analysis/bundle/rollup.ts @@ -32,7 +32,7 @@ export async function bundleWithRollup( moduleDirectory?: string ): Promise { const resolveOptions: RollupNodeResolveOptions = { - mainFields: ['esm2017', 'module', 'main'] + mainFields: ['module', 'main'] }; if (moduleDirectory) { diff --git a/repo-scripts/size-analysis/bundle/webpack.ts b/repo-scripts/size-analysis/bundle/webpack.ts index 611212b26b9..4f0598733ac 100644 --- a/repo-scripts/size-analysis/bundle/webpack.ts +++ b/repo-scripts/size-analysis/bundle/webpack.ts @@ -36,7 +36,7 @@ export async function bundleWithWebpack( const outputFileName = 'o.js'; const resolveConfig: webpack.ResolveOptions = { - mainFields: ['esm2017', 'module', 'main'] + mainFields: ['module', 'main'] }; if (moduleDirectory) { diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 294b07f507b..ce4def7c26b 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -5,7 +5,7 @@ "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "esm2017": "dist/index.esm2017.js", + "module": "dist/index.esm.js", "files": [ "dist" ], @@ -19,29 +19,31 @@ "build": "rollup -c" }, "license": "Apache-2.0", - "devDependencies": { - "@firebase/app": "0.13.2", - "@firebase/logger": "0.4.4", + "dependencies": { "@firebase/util": "1.12.1", - "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "16.0.0", - "@rollup/plugin-virtual": "2.1.0", - "@types/webpack": "5.28.5", "child-process-promise": "2.2.1", "glob": "7.2.3", + "tmp": "0.2.3", "gzip-size": "6.0.0", "memfs": "3.5.3", + "terser": "5.37.0", + "@rollup/plugin-commonjs": "21.1.0", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-virtual": "2.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", - "terser": "5.37.0", - "tmp": "0.2.3", "typescript": "5.5.4", "webpack": "5.98.0", "webpack-virtual-modules": "0.6.2", "yargs": "17.7.2" }, + "devDependencies": { + "@firebase/app": "0.13.2", + "@firebase/logger": "0.4.4", + "@types/webpack": "5.28.5" + }, "repository": { "directory": "repo-scripts/size-analysis", "type": "git", @@ -59,4 +61,4 @@ "engines": { "node": ">=18.0.0" } -} +} \ No newline at end of file diff --git a/repo-scripts/size-analysis/rollup.config.js b/repo-scripts/size-analysis/rollup.config.js index 505596e3d2e..0be78dd920c 100644 --- a/repo-scripts/size-analysis/rollup.config.js +++ b/repo-scripts/size-analysis/rollup.config.js @@ -41,7 +41,7 @@ export default [ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017', + target: 'es2020', module: 'es2015' } } @@ -66,7 +66,7 @@ export default [ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017', + target: 'es2020', module: 'es2015' } } diff --git a/repo-scripts/size-analysis/tsconfig.json b/repo-scripts/size-analysis/tsconfig.json index 326e95a0fa6..acbfc91e7e5 100644 --- a/repo-scripts/size-analysis/tsconfig.json +++ b/repo-scripts/size-analysis/tsconfig.json @@ -5,7 +5,7 @@ "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, - "target": "es2017", + "target": "es2020", "esModuleInterop": true, "declaration": true, "strict": true diff --git a/scripts/docgen/docgen.ts b/scripts/docgen/docgen.ts index 811570decd1..af105ef65f6 100644 --- a/scripts/docgen/docgen.ts +++ b/scripts/docgen/docgen.ts @@ -194,8 +194,8 @@ async function generateDocs( 'utf8' ); const authApiConfigModified = authApiConfigOriginal.replace( - `"mainEntryPointFilePath": "/dist/esm2017/index.d.ts"`, - `"mainEntryPointFilePath": "/dist/esm2017/index.doc.d.ts"` + `"mainEntryPointFilePath": "/dist/esm/index.d.ts"`, + `"mainEntryPointFilePath": "/dist/esm/index.doc.d.ts"` ); try { diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 75f1741329a..5ff7e49ff96 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, - "target": "es2017", + "target": "es2020", "typeRoots": [ "../node_modules/@types" ], diff --git a/yarn.lock b/yarn.lock index 51ede769d03..fe69e44aead 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3767,16 +3767,6 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^5.0.0: - version "5.5.2" - resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw== - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -4415,29 +4405,6 @@ b4a@^1.6.4: resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g== - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-generator@^6.18.0: - version "6.26.1" - resolved "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - babel-loader@8.4.1: version "8.4.1" resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.4.1.tgz#6ccb75c66e62c3b144e1c5f2eaec5b8f6c08c675" @@ -4448,13 +4415,6 @@ babel-loader@8.4.1: make-dir "^3.1.0" schema-utils "^2.6.5" -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w== - dependencies: - babel-runtime "^6.22.0" - babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -4511,55 +4471,6 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" -babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.16.0: - version "6.26.0" - resolved "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg== - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.18.0, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA== - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.18.0, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g== - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - bach@^1.0.0: version "1.2.0" resolved "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" @@ -5479,11 +5390,6 @@ cmd-shim@^4.1.0: dependencies: mkdirp-infer-owner "^2.0.0" -co@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -5892,11 +5798,6 @@ core-js-compat@^3.40.0: dependencies: browserslist "^4.24.3" -core-js@^2.4.0: - version "2.6.12" - resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - core-util-is@1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -6138,7 +6039,7 @@ debug-fabulous@^1.0.0: memoizee "0.4.X" object-assign "4.X" -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -6405,13 +6306,6 @@ detect-file@^1.0.0: resolved "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q== -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A== - dependencies: - repeating "^2.0.0" - detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -7411,11 +7305,6 @@ fancy-log@^1.3.2, fancy-log@^1.3.3: parse-node-version "^1.0.0" time-stamp "^1.0.0" -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -8403,11 +8292,6 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - globalthis@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" @@ -9213,13 +9097,6 @@ interpret@^1.0.0, interpret@^1.4.0: resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" @@ -9425,11 +9302,6 @@ is-finalizationregistry@^1.1.0: dependencies: call-bound "^1.0.3" -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -9861,21 +9733,6 @@ isstream@~0.1.2: resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== -istanbul-instrumenter-loader@3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-3.0.1.tgz#9957bd59252b373fae5c52b7b5188e6fde2a0949" - integrity sha512-a5SPObZgS0jB/ixaKSMdn6n/gXSrK2S6q/UfRJBT3e6gQmVjwZROTODQsYW5ZNwOu78hG62Y3fWlebaVOL0C+w== - dependencies: - convert-source-map "^1.5.0" - istanbul-lib-instrument "^1.7.3" - loader-utils "^1.1.0" - schema-utils "^0.3.0" - -istanbul-lib-coverage@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" - integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== - istanbul-lib-coverage@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" @@ -9893,19 +9750,6 @@ istanbul-lib-hook@^3.0.0: dependencies: append-transform "^2.0.0" -istanbul-lib-instrument@^1.7.3: - version "1.10.2" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" - integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.18.0" - istanbul-lib-coverage "^1.2.1" - semver "^5.3.0" - istanbul-lib-instrument@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" @@ -10192,16 +10036,11 @@ jquery@^3.4.1: resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== - js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -10235,11 +10074,6 @@ jsbn@~0.1.0: resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA== - jsesc@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" @@ -10284,11 +10118,6 @@ json-ptr@^3.0.1: resolved "https://registry.npmjs.org/json-ptr/-/json-ptr-3.1.1.tgz#184c3d48db659fa9bbc1519f7db6f390ddffb659" integrity sha512-SiSJQ805W1sDUCD1+/t1/1BIrveq2Fe9HJqENxZmMCILmrPI7WhS/pePpIOx85v6/H2z1Vy7AI08GV2TzfXocg== -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -10325,7 +10154,7 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^1.0.1, json5@^1.0.2: +json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== @@ -10828,15 +10657,6 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^1.1.0: - version "1.4.2" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" - integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^1.0.1" - loader-utils@^2.0.0, loader-utils@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" @@ -11003,7 +10823,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@4.17.21, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0, lodash@~4.17.15, lodash@~4.17.21: +lodash@4.17.21, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.7.0, lodash@~4.17.15, lodash@~4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -11077,13 +10897,6 @@ long@^5.0.0: resolved "https://registry.npmjs.org/long/-/long-5.2.4.tgz#ee651d5c7c25901cfca5e67220ae9911695e99b2" integrity sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg== -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - loupe@^2.3.6: version "2.3.7" resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" @@ -13913,11 +13726,6 @@ regenerate@^1.4.2: resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - regenerator-runtime@^0.14.0: version "0.14.1" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" @@ -14027,13 +13835,6 @@ repeat-string@^1.6.1: resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A== - dependencies: - is-finite "^1.0.0" - replace-ext@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" @@ -14459,13 +14260,6 @@ sax@>=0.6.0: resolved "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== -schema-utils@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" - integrity sha512-QaVYBaD9U8scJw2EBWnCBY+LJ0AD+/2edTaigDs0XLDLBfJmSUK9KGqktg1rb32U3z4j/XwvFwHHH1YfbYFd7Q== - dependencies: - ajv "^5.0.0" - schema-utils@^2.6.5: version "2.7.1" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" @@ -15039,7 +14833,7 @@ source-map-url@^0.4.0: resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.6: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== @@ -15918,11 +15712,6 @@ to-absolute-glob@^2.0.0, to-absolute-glob@^2.0.2: is-absolute "^1.0.0" is-negated-glob "^1.0.0" -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og== - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -16013,11 +15802,6 @@ trim-newlines@^3.0.0: resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== - triple-beam@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" From d91169f061bf1dcbfe78a8c8a7f739677608fcb7 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Fri, 11 Jul 2025 20:50:00 -0400 Subject: [PATCH 246/295] (feat) initializeServerApp support for App Hosting auto init (#9151) Implement Auto Init for `initializeServerApp`. Auto init was previously implemented for `initializeApp` in #8483. This PR adds the same functionality to the `initializeServerApp` API surface. Fixes #8863 --- .changeset/thin-bikes-tan.md | 6 +++ common/api-review/app.api.md | 10 ++++- docs-devsite/app.md | 56 +++++++++++++++++++++++++- packages/app/src/api.ts | 76 ++++++++++++++++++++++++++++-------- packages/app/src/internal.ts | 28 ++++++++++++- 5 files changed, 153 insertions(+), 23 deletions(-) create mode 100644 .changeset/thin-bikes-tan.md diff --git a/.changeset/thin-bikes-tan.md b/.changeset/thin-bikes-tan.md new file mode 100644 index 00000000000..121b3208d52 --- /dev/null +++ b/.changeset/thin-bikes-tan.md @@ -0,0 +1,6 @@ +--- +'@firebase/app': minor +'firebase': minor +--- + +initializeServerApp now supports auto-initialization for Firebase App Hosting. diff --git a/common/api-review/app.api.md b/common/api-review/app.api.md index 4e93f1ae87f..c12089c1520 100644 --- a/common/api-review/app.api.md +++ b/common/api-review/app.api.md @@ -110,14 +110,20 @@ export function initializeApp(options: FirebaseOptions, config?: FirebaseAppSett export function initializeApp(): FirebaseApp; // @public -export function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp; +export function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp; + +// @public +export function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp; // @internal (undocumented) -export function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions): obj is FirebaseApp; +export function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp; // @internal (undocumented) export function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp; +// @internal (undocumented) +export function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings; + // @public export function onLog(logCallback: LogCallback | null, options?: LogOptions): void; diff --git a/docs-devsite/app.md b/docs-devsite/app.md index 9c3b322aaaf..0c9b2d03e4b 100644 --- a/docs-devsite/app.md +++ b/docs-devsite/app.md @@ -23,6 +23,8 @@ This package coordinates the communication between the different Firebase compon | function() | | [getApps()](./app.md#getapps) | A (read-only) array of all initialized apps. | | [initializeApp()](./app.md#initializeapp) | Creates and initializes a FirebaseApp instance. | +| function(config, ...) | +| [initializeServerApp(config)](./app.md#initializeserverapp_e7d0728) | Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance. | | function(libraryKeyOrName, ...) | | [registerVersion(libraryKeyOrName, version, variant)](./app.md#registerversion_f673248) | Registers a library's name and version for platform logging purposes. | | function(logCallback, ...) | @@ -116,6 +118,38 @@ export declare function initializeApp(): FirebaseApp; [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) +## function(config, ...) + +### initializeServerApp(config) {:#initializeserverapp_e7d0728} + +Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance. + +Signature: + +```typescript +export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional FirebaseServerApp settings. | + +Returns: + +[FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) + +The initialized `FirebaseServerApp`. + +#### Exceptions + +If invoked in an unsupported non-server environment such as a browser. + +If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support. + +If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project configuration required for auto-initialization. + ## function(libraryKeyOrName, ...) ### registerVersion(libraryKeyOrName, version, variant) {:#registerversion_f673248} @@ -260,6 +294,12 @@ export declare function initializeApp(options: FirebaseOptions, name?: string): The initialized app. +#### Exceptions + +If the optional `name` parameter is malformed or empty. + +If a `FirebaseApp` already exists with the same name but with a different configuration. + ### Example 1 @@ -312,6 +352,12 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) +#### Exceptions + +If [FirebaseAppSettings.name](./app.firebaseappsettings.md#firebaseappsettingsname) is defined but the value is malformed or empty. + +If a `FirebaseApp` already exists with the same name but with a different configuration. + ### initializeServerApp(options, config) {:#initializeserverapp_30ab697} Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance. @@ -323,7 +369,7 @@ See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_fi Signature: ```typescript -export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp; +export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp; ``` #### Parameters @@ -331,7 +377,7 @@ export declare function initializeServerApp(options: FirebaseOptions | FirebaseA | Parameter | Type | Description | | --- | --- | --- | | options | [FirebaseOptions](./app.firebaseoptions.md#firebaseoptions_interface) \| [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | Firebase.AppOptions to configure the app's services, or a a FirebaseApp instance which contains the AppOptions within. | -| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | FirebaseServerApp configuration. | +| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional FirebaseServerApp settings. | Returns: @@ -339,6 +385,12 @@ export declare function initializeServerApp(options: FirebaseOptions | FirebaseA The initialized `FirebaseServerApp`. +#### Exceptions + +If invoked in an unsupported non-server environment such as a browser. + +If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support. + ### Example diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index 9cba8ec6f50..6fd50060a6a 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -37,6 +37,7 @@ import { _apps, _components, _isFirebaseApp, + _isFirebaseServerAppSettings, _registerComponent, _serverApps } from './internal'; @@ -106,6 +107,10 @@ export const SDK_VERSION = version; * * @returns The initialized app. * + * @throws If the optional `name` parameter is malformed or empty. + * + * @throws If a `FirebaseApp` already exists with the same name but with a different configuration. + * * @public */ export function initializeApp( @@ -118,6 +123,9 @@ export function initializeApp( * @param options - Options to configure the app's services. * @param config - FirebaseApp Configuration * + * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty. + * + * @throws If a `FirebaseApp` already exists with the same name but with a different configuration. * @public */ export function initializeApp( @@ -220,41 +228,75 @@ export function initializeApp( * * @param options - `Firebase.AppOptions` to configure the app's services, or a * a `FirebaseApp` instance which contains the `AppOptions` within. - * @param config - `FirebaseServerApp` configuration. + * @param config - Optional `FirebaseServerApp` settings. * * @returns The initialized `FirebaseServerApp`. * + * @throws If invoked in an unsupported non-server environment such as a browser. + * + * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't + * provide Finalization Registry support. + * * @public */ export function initializeServerApp( options: FirebaseOptions | FirebaseApp, - config: FirebaseServerAppSettings + config?: FirebaseServerAppSettings ): FirebaseServerApp; +/** + * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance. + * + * @param config - Optional `FirebaseServerApp` settings. + * + * @returns The initialized `FirebaseServerApp`. + * + * @throws If invoked in an unsupported non-server environment such as a browser. + * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't + * provide Finalization Registry support. + * @throws If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project + * configuration required for auto-initialization. + * + * @public + */ export function initializeServerApp( - _options: FirebaseOptions | FirebaseApp, - _serverAppConfig: FirebaseServerAppSettings + config?: FirebaseServerAppSettings +): FirebaseServerApp; +export function initializeServerApp( + _options?: FirebaseApp | FirebaseServerAppSettings | FirebaseOptions, + _serverAppConfig: FirebaseServerAppSettings = {} ): FirebaseServerApp { if (isBrowser() && !isWebWorker()) { // FirebaseServerApp isn't designed to be run in browsers. throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT); } - if (_serverAppConfig.automaticDataCollectionEnabled === undefined) { - _serverAppConfig.automaticDataCollectionEnabled = true; + let firebaseOptions: FirebaseOptions | undefined; + let serverAppSettings: FirebaseServerAppSettings = _serverAppConfig || {}; + + if (_options) { + if (_isFirebaseApp(_options)) { + firebaseOptions = _options.options; + } else if (_isFirebaseServerAppSettings(_options)) { + serverAppSettings = _options; + } else { + firebaseOptions = _options; + } } - let appOptions: FirebaseOptions; - if (_isFirebaseApp(_options)) { - appOptions = _options.options; - } else { - appOptions = _options; + if (serverAppSettings.automaticDataCollectionEnabled === undefined) { + serverAppSettings.automaticDataCollectionEnabled = true; + } + + firebaseOptions ||= getDefaultAppConfig(); + if (!firebaseOptions) { + throw ERROR_FACTORY.create(AppError.NO_OPTIONS); } // Build an app name based on a hash of the configuration options. const nameObj = { - ..._serverAppConfig, - ...appOptions + ...serverAppSettings, + ...firebaseOptions }; // However, Do not mangle the name based on releaseOnDeref, since it will vary between the @@ -270,7 +312,7 @@ export function initializeServerApp( ); }; - if (_serverAppConfig.releaseOnDeref !== undefined) { + if (serverAppSettings.releaseOnDeref !== undefined) { if (typeof FinalizationRegistry === 'undefined') { throw ERROR_FACTORY.create( AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED, @@ -283,7 +325,7 @@ export function initializeServerApp( const existingApp = _serverApps.get(nameString) as FirebaseServerApp; if (existingApp) { (existingApp as FirebaseServerAppImpl).incRefCount( - _serverAppConfig.releaseOnDeref + serverAppSettings.releaseOnDeref ); return existingApp; } @@ -294,8 +336,8 @@ export function initializeServerApp( } const newApp = new FirebaseServerAppImpl( - appOptions, - _serverAppConfig, + firebaseOptions, + serverAppSettings, nameString, container ); diff --git a/packages/app/src/internal.ts b/packages/app/src/internal.ts index cbcdcb26501..422c941aba3 100644 --- a/packages/app/src/internal.ts +++ b/packages/app/src/internal.ts @@ -17,6 +17,8 @@ import { FirebaseApp, + FirebaseAppSettings, + FirebaseServerAppSettings, FirebaseOptions, FirebaseServerApp } from './public-types'; @@ -147,18 +149,40 @@ export function _removeServiceInstance( /** * - * @param obj - an object of type FirebaseApp or FirebaseOptions. + * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings. * * @returns true if the provide object is of type FirebaseApp. * * @internal */ export function _isFirebaseApp( - obj: FirebaseApp | FirebaseOptions + obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings ): obj is FirebaseApp { return (obj as FirebaseApp).options !== undefined; } +/** + * + * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings. + * + * @returns true if the provided object is of type FirebaseServerAppImpl. + * + * @internal + */ +export function _isFirebaseServerAppSettings( + obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings +): obj is FirebaseServerAppSettings { + if (_isFirebaseApp(obj)) { + return false; + } + return ( + 'authIdToken' in obj || + 'appCheckToken' in obj || + 'releaseOnDeref' in obj || + 'automaticDataCollectionEnabled' in obj + ); +} + /** * * @param obj - an object of type FirebaseApp. From cb19688bf3d339a46c4964cb30b6263af08526e6 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 14 Jul 2025 16:04:52 -0400 Subject: [PATCH 247/295] feat!(ai): Remove `GroundingAttribution` (#9079) --- .changeset/slimy-mirrors-nail.md | 6 +++ common/api-review/ai.api.md | 14 ------ docs-devsite/_toc.yaml | 2 - docs-devsite/ai.groundingattribution.md | 62 ------------------------- docs-devsite/ai.groundingmetadata.md | 14 ------ docs-devsite/ai.md | 1 - packages/ai/src/types/responses.ts | 15 ------ 7 files changed, 6 insertions(+), 108 deletions(-) create mode 100644 .changeset/slimy-mirrors-nail.md delete mode 100644 docs-devsite/ai.groundingattribution.md diff --git a/.changeset/slimy-mirrors-nail.md b/.changeset/slimy-mirrors-nail.md new file mode 100644 index 00000000000..56877ee8ba2 --- /dev/null +++ b/.changeset/slimy-mirrors-nail.md @@ -0,0 +1,6 @@ +--- +'firebase': major +'@firebase/ai': major +--- + +Remove GroundingAttribution diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 7c1e449689c..71f3871ccb9 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -501,18 +501,6 @@ export interface GoogleSearchTool { googleSearch: GoogleSearch; } -// @public @deprecated (undocumented) -export interface GroundingAttribution { - // (undocumented) - confidenceScore?: number; - // (undocumented) - retrievedContext?: RetrievedContextAttribution; - // (undocumented) - segment: Segment; - // (undocumented) - web?: WebAttribution; -} - // @public export interface GroundingChunk { web?: WebGroundingChunk; @@ -520,8 +508,6 @@ export interface GroundingChunk { // @public export interface GroundingMetadata { - // @deprecated (undocumented) - groundingAttributions: GroundingAttribution[]; groundingChunks?: GroundingChunk[]; groundingSupports?: GroundingSupport[]; // @deprecated (undocumented) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 495567e6092..e2486c01d75 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -80,8 +80,6 @@ toc: path: /docs/reference/js/ai.googlesearch.md - title: GoogleSearchTool path: /docs/reference/js/ai.googlesearchtool.md - - title: GroundingAttribution - path: /docs/reference/js/ai.groundingattribution.md - title: GroundingChunk path: /docs/reference/js/ai.groundingchunk.md - title: GroundingMetadata diff --git a/docs-devsite/ai.groundingattribution.md b/docs-devsite/ai.groundingattribution.md deleted file mode 100644 index a0895550bf1..00000000000 --- a/docs-devsite/ai.groundingattribution.md +++ /dev/null @@ -1,62 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GroundingAttribution interface -> Warning: This API is now obsolete. -> -> - -Signature: - -```typescript -export interface GroundingAttribution -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [confidenceScore](./ai.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./ai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./ai.groundingattribution.md#groundingattributionsegment) | [Segment](./ai.segment.md#segment_interface) | | -| [web](./ai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./ai.webattribution.md#webattribution_interface) | | - -## GroundingAttribution.confidenceScore - -Signature: - -```typescript -confidenceScore?: number; -``` - -## GroundingAttribution.retrievedContext - -Signature: - -```typescript -retrievedContext?: RetrievedContextAttribution; -``` - -## GroundingAttribution.segment - -Signature: - -```typescript -segment: Segment; -``` - -## GroundingAttribution.web - -Signature: - -```typescript -web?: WebAttribution; -``` diff --git a/docs-devsite/ai.groundingmetadata.md b/docs-devsite/ai.groundingmetadata.md index 52c963eb581..a9605aaf1dd 100644 --- a/docs-devsite/ai.groundingmetadata.md +++ b/docs-devsite/ai.groundingmetadata.md @@ -26,26 +26,12 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./ai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface)\[\] | | | [groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface)\[\] | A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. | | [groundingSupports](./ai.groundingmetadata.md#groundingmetadatagroundingsupports) | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface)\[\] | A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the groundingChunks. | | [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | | [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. | | [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. | -## GroundingMetadata.groundingAttributions - -> Warning: This API is now obsolete. -> -> Use [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) instead. -> - -Signature: - -```typescript -groundingAttributions: GroundingAttribution[]; -``` - ## GroundingMetadata.groundingChunks A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 2916c4d2729..5d4d23ebcb5 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -77,7 +77,6 @@ The Firebase AI Web SDK. | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | | [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. | | [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface) | A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses.Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | -| [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface) | | | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. | | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index 5fab203600d..f85c8034e00 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -212,10 +212,6 @@ export interface GroundingMetadata { * @deprecated Use {@link GroundingSupport} instead. */ retrievalQueries?: string[]; - /** - * @deprecated Use {@link GroundingChunk} instead. - */ - groundingAttributions: GroundingAttribution[]; } /** @@ -334,17 +330,6 @@ export interface Segment { text: string; } -/** - * @deprecated - * @public - */ -export interface GroundingAttribution { - segment: Segment; - confidenceScore?: number; - web?: WebAttribution; - retrievedContext?: RetrievedContextAttribution; -} - /** * @public */ From 5200f7bb777cf2260dcd396fbd19ac6cc7cb44c4 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 14 Jul 2025 16:56:30 -0400 Subject: [PATCH 248/295] feat!(ai): add support for `anyOf` schemas (#9042) --- .changeset/healthy-moons-type.md | 6 + common/api-review/ai.api.md | 24 +- docs-devsite/_toc.yaml | 2 + docs-devsite/ai.anyofschema.md | 58 +++++ docs-devsite/ai.generationconfig.md | 4 +- docs-devsite/ai.md | 3 +- docs-devsite/ai.schema.md | 27 +- docs-devsite/ai.schemainterface.md | 6 +- docs-devsite/ai.schemarequest.md | 6 +- docs-devsite/ai.schemashared.md | 11 + .../ai/src/requests/schema-builder.test.ts | 236 ++++++++++++++---- packages/ai/src/requests/schema-builder.ts | 62 ++++- packages/ai/src/types/requests.ts | 2 +- packages/ai/src/types/schema.ts | 18 +- 14 files changed, 394 insertions(+), 71 deletions(-) create mode 100644 .changeset/healthy-moons-type.md create mode 100644 docs-devsite/ai.anyofschema.md diff --git a/.changeset/healthy-moons-type.md b/.changeset/healthy-moons-type.md new file mode 100644 index 00000000000..1f38000ceda --- /dev/null +++ b/.changeset/healthy-moons-type.md @@ -0,0 +1,6 @@ +--- +'firebase': major +'@firebase/ai': major +--- + +Add support for `anyOf` schemas diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 71f3871ccb9..199b97b10a9 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -64,6 +64,17 @@ export interface AIOptions { backend: Backend; } +// @public +export class AnyOfSchema extends Schema { + constructor(schemaParams: SchemaParams & { + anyOf: TypedSchema[]; + }); + // (undocumented) + anyOf: TypedSchema[]; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + // @public export class ArraySchema extends Schema { constructor(schemaParams: SchemaParams, items: TypedSchema); @@ -814,6 +825,10 @@ export abstract class Schema implements SchemaInterface { constructor(schemaParams: SchemaInterface); [key: string]: unknown; // (undocumented) + static anyOf(anyOfParams: SchemaParams & { + anyOf: TypedSchema[]; + }): AnyOfSchema; + // (undocumented) static array(arrayParams: SchemaParams & { items: Schema; }): ArraySchema; @@ -845,12 +860,12 @@ export abstract class Schema implements SchemaInterface { static string(stringParams?: SchemaParams): StringSchema; // @internal toJSON(): SchemaRequest; - type: SchemaType; + type?: SchemaType; } // @public export interface SchemaInterface extends SchemaShared { - type: SchemaType; + type?: SchemaType; } // @public @@ -860,13 +875,14 @@ export interface SchemaParams extends SchemaShared { // @public export interface SchemaRequest extends SchemaShared { required?: string[]; - type: SchemaType; + type?: SchemaType; } // @public export interface SchemaShared { // (undocumented) [key: string]: unknown; + anyOf?: T[]; description?: string; enum?: string[]; example?: unknown; @@ -958,7 +974,7 @@ export interface ToolConfig { } // @public -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema; // @public export interface UsageMetadata { diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index e2486c01d75..6d548ffd8d6 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -12,6 +12,8 @@ toc: path: /docs/reference/js/ai.aimodel.md - title: AIOptions path: /docs/reference/js/ai.aioptions.md + - title: AnyOfSchema + path: /docs/reference/js/ai.anyofschema.md - title: ArraySchema path: /docs/reference/js/ai.arrayschema.md - title: Backend diff --git a/docs-devsite/ai.anyofschema.md b/docs-devsite/ai.anyofschema.md new file mode 100644 index 00000000000..6fc0fbc60a1 --- /dev/null +++ b/docs-devsite/ai.anyofschema.md @@ -0,0 +1,58 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AnyOfSchema class +Schema class representing a value that can conform to any of the provided sub-schemas. This is useful when a field can accept multiple distinct types or structures. + +Signature: + +```typescript +export declare class AnyOfSchema extends Schema +``` +Extends: [Schema](./ai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./ai.anyofschema.md#anyofschemaconstructor) | | Constructs a new instance of the AnyOfSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [anyOf](./ai.anyofschema.md#anyofschemaanyof) | | [TypedSchema](./ai.md#typedschema)\[\] | | + +## AnyOfSchema.(constructor) + +Constructs a new instance of the `AnyOfSchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams & { + anyOf: TypedSchema[]; + }); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { anyOf: [TypedSchema](./ai.md#typedschema)\[\]; } | | + +## AnyOfSchema.anyOf + +Signature: + +```typescript +anyOf: TypedSchema[]; +``` diff --git a/docs-devsite/ai.generationconfig.md b/docs-devsite/ai.generationconfig.md index e791bde9485..7330b8e6993 100644 --- a/docs-devsite/ai.generationconfig.md +++ b/docs-devsite/ai.generationconfig.md @@ -28,7 +28,7 @@ export interface GenerationConfig | [presencePenalty](./ai.generationconfig.md#generationconfigpresencepenalty) | number | | | [responseMimeType](./ai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | | [responseModalities](./ai.generationconfig.md#generationconfigresponsemodalities) | [ResponseModality](./ai.md#responsemodality)\[\] | (Public Preview) Generation modalities to be returned in generation responses. | -| [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
    Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
    Note: This only applies when the specified responseMimeType supports a schema; currently this is limited to application/json and text/x.enum. | | [stopSequences](./ai.generationconfig.md#generationconfigstopsequences) | string\[\] | | | [temperature](./ai.generationconfig.md#generationconfigtemperature) | number | | | [thinkingConfig](./ai.generationconfig.md#generationconfigthinkingconfig) | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models. | @@ -94,7 +94,7 @@ responseModalities?: ResponseModality[]; ## GenerationConfig.responseSchema -Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
    Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
    Note: This only applies when the specified `responseMimeType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 5d4d23ebcb5..950a89e94ad 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -28,6 +28,7 @@ The Firebase AI Web SDK. | --- | --- | | [AIError](./ai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. | | [AIModel](./ai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.Instances of this class are associated with a specific Firebase AI [Backend](./ai.backend.md#backend_class) and provide methods for interacting with the configured generative model. | +| [AnyOfSchema](./ai.anyofschema.md#anyofschema_class) | Schema class representing a value that can conform to any of the provided sub-schemas. This is useful when a field can accept multiple distinct types or structures. | | [ArraySchema](./ai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | | [Backend](./ai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. | | [BooleanSchema](./ai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | @@ -762,5 +763,5 @@ A type that includes all specific Schema types. Signature: ```typescript -export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema; ``` diff --git a/docs-devsite/ai.schema.md b/docs-devsite/ai.schema.md index 6cc28c761b5..a6301259080 100644 --- a/docs-devsite/ai.schema.md +++ b/docs-devsite/ai.schema.md @@ -36,12 +36,13 @@ export declare abstract class Schema implements SchemaInterface | [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | | [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array. | | [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | -| [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). | +| [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. This can only be undefined when using anyOf schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). | ## Methods | Method | Modifiers | Description | | --- | --- | --- | +| [anyOf(anyOfParams)](./ai.schema.md#schemaanyof) | static | | | [array(arrayParams)](./ai.schema.md#schemaarray) | static | | | [boolean(booleanParams)](./ai.schema.md#schemaboolean) | static | | | [enumString(stringParams)](./ai.schema.md#schemaenumstring) | static | | @@ -138,14 +139,34 @@ nullable: boolean; ## Schema.type -Optional. The type of the property. [SchemaType](./ai.md#schematype). +Optional. The type of the property. This can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). Signature: ```typescript -type: SchemaType; +type?: SchemaType; ``` +## Schema.anyOf() + +Signature: + +```typescript +static anyOf(anyOfParams: SchemaParams & { + anyOf: TypedSchema[]; + }): AnyOfSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| anyOfParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { anyOf: [TypedSchema](./ai.md#typedschema)\[\]; } | | + +Returns: + +[AnyOfSchema](./ai.anyofschema.md#anyofschema_class) + ## Schema.array() Signature: diff --git a/docs-devsite/ai.schemainterface.md b/docs-devsite/ai.schemainterface.md index 6dd33e69e18..91429914ab7 100644 --- a/docs-devsite/ai.schemainterface.md +++ b/docs-devsite/ai.schemainterface.md @@ -23,14 +23,14 @@ export interface SchemaInterface extends SchemaShared | Property | Type | Description | | --- | --- | --- | -| [type](./ai.schemainterface.md#schemainterfacetype) | [SchemaType](./ai.md#schematype) | The type of the property. [SchemaType](./ai.md#schematype). | +| [type](./ai.schemainterface.md#schemainterfacetype) | [SchemaType](./ai.md#schematype) | The type of the property. this can only be undefined when using anyof schemas, which do not have an explicit type in the [OpenAPI Specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). | ## SchemaInterface.type -The type of the property. [SchemaType](./ai.md#schematype). +The type of the property. this can only be undefined when using `anyof` schemas, which do not have an explicit type in the [OpenAPI Specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). Signature: ```typescript -type: SchemaType; +type?: SchemaType; ``` diff --git a/docs-devsite/ai.schemarequest.md b/docs-devsite/ai.schemarequest.md index e71d24a6b1a..1eeb76fd8d1 100644 --- a/docs-devsite/ai.schemarequest.md +++ b/docs-devsite/ai.schemarequest.md @@ -24,7 +24,7 @@ export interface SchemaRequest extends SchemaShared | Property | Type | Description | | --- | --- | --- | | [required](./ai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | -| [type](./ai.schemarequest.md#schemarequesttype) | [SchemaType](./ai.md#schematype) | The type of the property. [SchemaType](./ai.md#schematype). | +| [type](./ai.schemarequest.md#schemarequesttype) | [SchemaType](./ai.md#schematype) | The type of the property. this can only be undefined when using anyOf schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). | ## SchemaRequest.required @@ -38,10 +38,10 @@ required?: string[]; ## SchemaRequest.type -The type of the property. [SchemaType](./ai.md#schematype). +The type of the property. this can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). Signature: ```typescript -type: SchemaType; +type?: SchemaType; ``` diff --git a/docs-devsite/ai.schemashared.md b/docs-devsite/ai.schemashared.md index b68cb180144..205d33ed3dd 100644 --- a/docs-devsite/ai.schemashared.md +++ b/docs-devsite/ai.schemashared.md @@ -22,6 +22,7 @@ export interface SchemaShared | Property | Type | Description | | --- | --- | --- | +| [anyOf](./ai.schemashared.md#schemasharedanyof) | T\[\] | An array of [Schema](./ai.schema.md#schema_class). The generated data must be valid against any of the schemas listed in this array. This allows specifying multiple possible structures or types for a single field. | | [description](./ai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | | [enum](./ai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | | [example](./ai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | @@ -36,6 +37,16 @@ export interface SchemaShared | [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint suggesting the order in which the keys should appear in the generated JSON string. | | [title](./ai.schemashared.md#schemasharedtitle) | string | The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field. | +## SchemaShared.anyOf + +An array of [Schema](./ai.schema.md#schema_class). The generated data must be valid against any of the schemas listed in this array. This allows specifying multiple possible structures or types for a single field. + +Signature: + +```typescript +anyOf?: T[]; +``` + ## SchemaShared.description Optional. The description of the property. diff --git a/packages/ai/src/requests/schema-builder.test.ts b/packages/ai/src/requests/schema-builder.test.ts index 27de1076c5f..e4d000a4c13 100644 --- a/packages/ai/src/requests/schema-builder.test.ts +++ b/packages/ai/src/requests/schema-builder.test.ts @@ -15,10 +15,16 @@ * limitations under the License. */ +import { AIError } from '../errors'; import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; -import { Schema } from './schema-builder'; -import { AIErrorCode } from '../types'; +import { + AnyOfSchema, + NumberSchema, + Schema, + StringSchema +} from './schema-builder'; +import { AIErrorCode, SchemaType } from '../types'; use(sinonChai); @@ -442,56 +448,200 @@ describe('Schema builder', () => { population: Schema.integer({ nullable: true }) }, optionalProperties: ['cat'] - }); + }) as any; // Cast to any to bypass TypedSchema check for testing purposes + expect(() => schema.toJSON()).to.throw( + AIError, + /Property "cat" specified in "optionalProperties" does not exist./ + ); + // Check the error code as well expect(() => schema.toJSON()).to.throw(AIErrorCode.INVALID_SCHEMA); }); - it('builds schema with minimum and maximum for integer', () => { - const schema = Schema.integer({ minimum: 5, maximum: 10, title: 'Rating' }); - expect(schema.toJSON()).to.eql({ - type: 'integer', - nullable: false, - minimum: 5, - maximum: 10, - title: 'Rating' + + describe('AnyOfSchema', () => { + it('builds an anyOf schema with basic types using Schema.anyOf()', () => { + const schema: AnyOfSchema = Schema.anyOf({ + anyOf: [Schema.string(), Schema.number()] + }); + + expect(schema).to.be.instanceOf(AnyOfSchema); + expect(schema.type).to.be.undefined; + expect(schema.nullable).to.be.false; // Default from SchemaParams + expect(schema.anyOf).to.be.an('array').with.lengthOf(2); + expect(schema.anyOf[0]).to.be.instanceOf(StringSchema); + expect(schema.anyOf[1]).to.be.instanceOf(NumberSchema); + + expect(schema.toJSON()).to.eql({ + type: undefined, + anyOf: [ + { type: 'string', nullable: false }, + { type: 'number', nullable: false } + ], + nullable: false + }); }); - }); - it('builds schema with minimum and maximum for number', () => { - const schema = Schema.number({ - minimum: 1.5, - maximum: 9.9, - title: 'Measurement' + it('builds an anyOf schema with complex types and options', () => { + const schema = Schema.anyOf({ + description: 'Can be a string or a detailed object', + nullable: true, + anyOf: [ + Schema.string({ description: 'A simple string' }), + Schema.object({ + properties: { + id: Schema.integer(), + name: Schema.string() + }, + description: 'A detailed object', + nullable: false // Explicitly set for the object schema itself + }) + ] + }); + + expect(schema.description).to.equal( + 'Can be a string or a detailed object' + ); + expect(schema.nullable).to.be.true; + expect(schema.anyOf).to.be.an('array').with.lengthOf(2); + + expect(schema.toJSON()).to.eql({ + type: undefined, + description: 'Can be a string or a detailed object', + nullable: true, + anyOf: [ + { type: 'string', description: 'A simple string', nullable: false }, + { + type: 'object', + description: 'A detailed object', + properties: { + id: { type: 'integer', nullable: false }, + name: { type: 'string', nullable: false } + }, + required: ['id', 'name'], + nullable: false + } + ] + }); }); - expect(schema.toJSON()).to.eql({ - type: 'number', - nullable: false, - minimum: 1.5, - maximum: 9.9, - title: 'Measurement' + + it('correctly overrides type to undefined even if type is passed in params', () => { + const schema = Schema.anyOf({ + type: SchemaType.STRING, + anyOf: [Schema.string(), Schema.number()] + }); + expect(schema.toJSON().type).to.be.undefined; + expect(schema.toJSON()).to.eql({ + type: undefined, // Explicitly undefined for anyOf + anyOf: [ + { type: 'string', nullable: false }, + { type: 'number', nullable: false } + ], + nullable: false // Default from SchemaParams + }); + }); + + it('toJSON() correctly serializes nested complex schemas within anyOf', () => { + const schema = Schema.anyOf({ + anyOf: [ + Schema.object({ + properties: { name: Schema.string() }, + optionalProperties: ['name'] + }), + Schema.array({ items: Schema.integer() }) + ] + }); + expect(schema.toJSON()).to.eql({ + type: undefined, + anyOf: [ + { + type: 'object', + properties: { name: { type: 'string', nullable: false } }, + nullable: false + }, + { + type: 'array', + items: { type: 'integer', nullable: false }, + nullable: false + } + ], + nullable: false + }); + }); + + it('throws an error if the anyOf array is empty', () => { + expect(() => Schema.anyOf({ anyOf: [] })).to.throw( + AIErrorCode.INVALID_SCHEMA + ); }); }); - it('builds object schema with propertyOrdering', () => { - const schema = Schema.object({ - title: 'User Data', - properties: { - name: Schema.string(), - age: Schema.integer(), - email: Schema.string() - }, - propertyOrdering: ['name', 'email', 'age'] + describe('ObjectSchema toJSON() optionalProperties edge cases', () => { + it('handles empty optionalProperties array (all properties required)', () => { + const schema = Schema.object({ + properties: { a: Schema.string(), b: Schema.integer() }, + optionalProperties: [] + }); + expect(schema.toJSON().required).to.deep.equal(['a', 'b']); }); - expect(schema.toJSON()).to.eql({ - type: 'object', - nullable: false, - title: 'User Data', - properties: { - name: { type: 'string', nullable: false }, - age: { type: 'integer', nullable: false }, - email: { type: 'string', nullable: false } - }, - required: ['name', 'age', 'email'], - propertyOrdering: ['name', 'email', 'age'] + + it('handles all properties being optional (empty required array)', () => { + const schema = Schema.object({ + properties: { a: Schema.string(), b: Schema.integer() }, + optionalProperties: ['a', 'b'] + }); + expect(schema.toJSON().required).to.be.undefined; // or empty array, depending on implementation + }); + it('builds schema with minimum and maximum for integer', () => { + const schema = Schema.integer({ + minimum: 5, + maximum: 10, + title: 'Rating' + }); + expect(schema.toJSON()).to.eql({ + type: 'integer', + nullable: false, + minimum: 5, + maximum: 10, + title: 'Rating' + }); + }); + + it('builds schema with minimum and maximum for number', () => { + const schema = Schema.number({ + minimum: 1.5, + maximum: 9.9, + title: 'Measurement' + }); + expect(schema.toJSON()).to.eql({ + type: 'number', + nullable: false, + minimum: 1.5, + maximum: 9.9, + title: 'Measurement' + }); + }); + + it('builds object schema with propertyOrdering', () => { + const schema = Schema.object({ + title: 'User Data', + properties: { + name: Schema.string(), + age: Schema.integer(), + email: Schema.string() + }, + propertyOrdering: ['name', 'email', 'age'] + }); + expect(schema.toJSON()).to.eql({ + type: 'object', + nullable: false, + title: 'User Data', + properties: { + name: { type: 'string', nullable: false }, + age: { type: 'integer', nullable: false }, + email: { type: 'string', nullable: false } + }, + required: ['name', 'age', 'email'], + propertyOrdering: ['name', 'email', 'age'] + }); }); }); }); diff --git a/packages/ai/src/requests/schema-builder.ts b/packages/ai/src/requests/schema-builder.ts index c0d53195f20..c3b7d29a820 100644 --- a/packages/ai/src/requests/schema-builder.ts +++ b/packages/ai/src/requests/schema-builder.ts @@ -33,10 +33,11 @@ import { */ export abstract class Schema implements SchemaInterface { /** - * Optional. The type of the property. {@link - * (SchemaType:type)}. + * Optional. The type of the property. + * This can only be undefined when using `anyOf` schemas, which do not have an + * explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification}. */ - type: SchemaType; + type?: SchemaType; /** Optional. The format of the property. * Supported formats:
    *
      @@ -65,12 +66,22 @@ export abstract class Schema implements SchemaInterface { [key: string]: unknown; constructor(schemaParams: SchemaInterface) { + // TODO(dlarocque): Enforce this with union types + if (!schemaParams.type && !schemaParams.anyOf) { + throw new AIError( + AIErrorCode.INVALID_SCHEMA, + "A schema must have either a 'type' or an 'anyOf' array of sub-schemas." + ); + } // eslint-disable-next-line guard-for-in for (const paramKey in schemaParams) { this[paramKey] = schemaParams[paramKey]; } // Ensure these are explicitly set to avoid TS errors. this.type = schemaParams.type; + this.format = schemaParams.hasOwnProperty('format') + ? schemaParams.format + : undefined; this.nullable = schemaParams.hasOwnProperty('nullable') ? !!schemaParams.nullable : false; @@ -82,7 +93,7 @@ export abstract class Schema implements SchemaInterface { * @internal */ toJSON(): SchemaRequest { - const obj: { type: SchemaType; [key: string]: unknown } = { + const obj: { type?: SchemaType; [key: string]: unknown } = { type: this.type }; for (const prop in this) { @@ -138,6 +149,12 @@ export abstract class Schema implements SchemaInterface { static boolean(booleanParams?: SchemaParams): BooleanSchema { return new BooleanSchema(booleanParams); } + + static anyOf( + anyOfParams: SchemaParams & { anyOf: TypedSchema[] } + ): AnyOfSchema { + return new AnyOfSchema(anyOfParams); + } } /** @@ -150,7 +167,8 @@ export type TypedSchema = | StringSchema | BooleanSchema | ObjectSchema - | ArraySchema; + | ArraySchema + | AnyOfSchema; /** * Schema class for "integer" types. @@ -295,3 +313,37 @@ export class ObjectSchema extends Schema { return obj as SchemaRequest; } } + +/** + * Schema class representing a value that can conform to any of the provided sub-schemas. This is + * useful when a field can accept multiple distinct types or structures. + * @public + */ +export class AnyOfSchema extends Schema { + anyOf: TypedSchema[]; // Re-define field to narrow to required type + constructor(schemaParams: SchemaParams & { anyOf: TypedSchema[] }) { + if (schemaParams.anyOf.length === 0) { + throw new AIError( + AIErrorCode.INVALID_SCHEMA, + "The 'anyOf' array must not be empty." + ); + } + super({ + ...schemaParams, + type: undefined // anyOf schemas do not have an explicit type + }); + this.anyOf = schemaParams.anyOf; + } + + /** + * @internal + */ + toJSON(): SchemaRequest { + const obj = super.toJSON(); + // Ensure the 'anyOf' property contains serialized SchemaRequest objects. + if (this.anyOf && Array.isArray(this.anyOf)) { + obj.anyOf = (this.anyOf as TypedSchema[]).map(s => s.toJSON()); + } + return obj; + } +} diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index be18fb16797..e68f3af161d 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -99,7 +99,7 @@ export interface GenerationConfig { * value can be a class generated with a {@link Schema} static method * like `Schema.string()` or `Schema.object()` or it can be a plain * JS object matching the {@link SchemaRequest} interface. - *
      Note: This only applies when the specified `responseMIMEType` supports a schema; currently + *
      Note: This only applies when the specified `responseMimeType` supports a schema; currently * this is limited to `application/json` and `text/x.enum`. */ responseSchema?: TypedSchema | SchemaRequest; diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index 3ba613f6f4c..f8c91168bf2 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -50,6 +50,12 @@ export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; * @public */ export interface SchemaShared { + /** + * An array of {@link Schema}. The generated data must be valid against any of the schemas + * listed in this array. This allows specifying multiple possible structures or types for a + * single field. + */ + anyOf?: T[]; /** Optional. The format of the property. * When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or * `'date-time'`, otherwise requests will fail. @@ -101,10 +107,10 @@ export interface SchemaParams extends SchemaShared {} */ export interface SchemaRequest extends SchemaShared { /** - * The type of the property. {@link - * (SchemaType:type)}. + * The type of the property. this can only be undefined when using `anyOf` schemas, + * which do not have an explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification }. */ - type: SchemaType; + type?: SchemaType; /** Optional. Array of required property. */ required?: string[]; } @@ -115,10 +121,10 @@ export interface SchemaRequest extends SchemaShared { */ export interface SchemaInterface extends SchemaShared { /** - * The type of the property. {@link - * (SchemaType:type)}. + * The type of the property. this can only be undefined when using `anyof` schemas, + * which do not have an explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI Specification}. */ - type: SchemaType; + type?: SchemaType; } /** From 25b60fdaabe910e1538684a3c490b0900fb5f113 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 15 Jul 2025 09:48:06 -0700 Subject: [PATCH 249/295] chore!: update engines.node to minimum of 20 (#9128) --- .changeset/wet-parrots-grab.md | 24 +++++++++++++++++++ .github/workflows/canary-deploy.yml | 2 +- .github/workflows/check-changeset.yml | 2 +- .github/workflows/check-docs.yml | 2 +- .github/workflows/check-pkg-paths.yml | 2 +- .github/workflows/deploy-config.yml | 2 +- .github/workflows/e2e-test.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/lint.yml | 2 +- .../workflows/prerelease-manual-deploy.yml | 2 +- .github/workflows/release-prod.yml | 2 +- .github/workflows/release-staging.yml | 2 +- .github/workflows/test-all.yml | 10 ++++---- .github/workflows/test-changed-auth.yml | 6 ++--- .../test-changed-fcm-integration.yml | 2 +- .../test-changed-firestore-integration.yml | 2 +- .github/workflows/test-changed-firestore.yml | 16 ++++++------- .github/workflows/test-changed-misc.yml | 2 +- .github/workflows/test-changed.yml | 6 ++--- config/functions/package.json | 2 +- .../js/default-connector/package.json | 2 +- e2e/smoke-tests/package.json | 2 +- integration/compat-interop/package.json | 2 +- integration/compat-typings/package.json | 2 +- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- package.json | 2 +- packages/ai/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/package.json | 2 +- packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/internal/package.json | 2 +- packages/auth/package.json | 2 +- packages/component/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firestore-compat/package.json | 2 +- packages/firestore/lite/package.json | 2 +- packages/firestore/package.json | 2 +- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/logger/package.json | 2 +- packages/rules-unit-testing/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/util/package.json | 2 +- repo-scripts/api-documenter/package.json | 2 +- repo-scripts/changelog-generator/package.json | 2 +- repo-scripts/prune-dts/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 52 files changed, 90 insertions(+), 66 deletions(-) create mode 100644 .changeset/wet-parrots-grab.md diff --git a/.changeset/wet-parrots-grab.md b/.changeset/wet-parrots-grab.md new file mode 100644 index 00000000000..f67d6325e0f --- /dev/null +++ b/.changeset/wet-parrots-grab.md @@ -0,0 +1,24 @@ +--- +'@firebase/rules-unit-testing': minor +'@firebase/app-check-compat': minor +'@firebase/firestore-compat': minor +'@firebase/functions-compat': minor +'@firebase/database-compat': minor +'@firebase/storage-compat': minor +'@firebase/auth-compat': minor +'@firebase/app-compat': minor +'@firebase/app-check': minor +'@firebase/component': minor +'@firebase/firestore': minor +'@firebase/functions': minor +'@firebase/database': minor +'@firebase/storage': minor +'@firebase/logger': minor +'@firebase/auth': minor +'@firebase/util': minor +'@firebase/app': minor +'@firebase/ai': minor +'firebase': major +--- + +Update node "engines" version to a minimum of Node 20. diff --git a/.github/workflows/canary-deploy.yml b/.github/workflows/canary-deploy.yml index 4b4cce63761..0d93ceefad8 100644 --- a/.github/workflows/canary-deploy.yml +++ b/.github/workflows/canary-deploy.yml @@ -31,7 +31,7 @@ jobs: with: # Canary release script requires git history and tags. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index b3df2555c76..26eb962887f 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -37,7 +37,7 @@ jobs: with: # This makes Actions fetch all Git history so check_changeset script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index 4afd97a131f..2e57efd0adf 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -27,7 +27,7 @@ jobs: with: # get all history for the diff fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/check-pkg-paths.yml b/.github/workflows/check-pkg-paths.yml index 96dfc6f6556..c7ae3c0c133 100644 --- a/.github/workflows/check-pkg-paths.yml +++ b/.github/workflows/check-pkg-paths.yml @@ -27,7 +27,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/deploy-config.yml b/.github/workflows/deploy-config.yml index 0c3604e4704..c6e32689e1d 100644 --- a/.github/workflows/deploy-config.yml +++ b/.github/workflows/deploy-config.yml @@ -35,7 +35,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index fbf43beada1..f9ac06ab9c0 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@master with: node-version: 22.10.0 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index f0bbd672fc3..ef232d9ddf5 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -31,7 +31,7 @@ jobs: with: # get all history for the diff fetch-depth: 0 - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3ae2ae0a074..c922f9c6a67 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index 73e82f11943..cf85836d997 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -34,7 +34,7 @@ jobs: with: # Canary release script requires git history and tags. fetch-depth: 0 - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index c89c7934db6..253ae95120f 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -32,7 +32,7 @@ jobs: contents: write steps: - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index e75ee4e703d..52aafa9273f 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -47,7 +47,7 @@ jobs: # Block this workflow if run on a non-release branch. if: github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch') steps: - - name: Set up node (20) + - name: Set up node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index dd74d2437e4..02c3ab0326f 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -40,7 +40,7 @@ jobs: run: | npx @puppeteer/browsers install chrome@stable - uses: actions/checkout@v4 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -79,7 +79,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -126,7 +126,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -166,7 +166,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -209,7 +209,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index b72c7cd9e2d..2ae77916492 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -56,7 +56,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -81,7 +81,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -105,7 +105,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed-fcm-integration.yml b/.github/workflows/test-changed-fcm-integration.yml index ff6023274a4..2fb6f9b890b 100644 --- a/.github/workflows/test-changed-fcm-integration.yml +++ b/.github/workflows/test-changed-fcm-integration.yml @@ -38,7 +38,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index 6841bdd47d6..b894e70e1ec 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -70,7 +70,7 @@ jobs: rm -f "$output_file" continue-on-error: true - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 46d36059d14..feb5eb0f672 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -37,7 +37,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -84,7 +84,7 @@ jobs: needs: build if: ${{ needs.build.outputs.changed == 'true'}} steps: - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -112,7 +112,7 @@ jobs: needs: build if: ${{ needs.build.outputs.changed == 'true'}} steps: - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -142,7 +142,7 @@ jobs: needs: build if: ${{ github.event_name != 'pull_request' }} steps: - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -175,7 +175,7 @@ jobs: steps: - name: install Firefox stable run: npx @puppeteer/browsers install firefox@stable - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -209,7 +209,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -227,7 +227,7 @@ jobs: needs: build if: ${{ needs.build.outputs.changed == 'true'}} steps: - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -264,7 +264,7 @@ jobs: name: build.tar.gz - name: Unzip build artifact run: tar xf build.tar.gz - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed-misc.yml b/.github/workflows/test-changed-misc.yml index ebcb2d1d366..52abe5ddddb 100644 --- a/.github/workflows/test-changed-misc.yml +++ b/.github/workflows/test-changed-misc.yml @@ -31,7 +31,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 948267aa9e7..5a0f18600f0 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -31,7 +31,7 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 @@ -84,7 +84,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Node (20) + - name: Set up Node (22) uses: actions/setup-node@v4 with: node-version: 22.10.0 diff --git a/config/functions/package.json b/config/functions/package.json index 9a032e8bb95..4b823c3de04 100644 --- a/config/functions/package.json +++ b/config/functions/package.json @@ -8,6 +8,6 @@ }, "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/package.json b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json index d0c9852ce3e..e9b57fa0a38 100644 --- a/e2e/data-connect/dataconnect-generated/js/default-connector/package.json +++ b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json @@ -5,7 +5,7 @@ "description": "Generated SDK For default", "license": "Apache-2.0", "engines": { - "node": " >=18.0" + "node": " >=22.0.0" }, "typings": "index.d.ts", "module": "esm/index.esm.js", diff --git a/e2e/smoke-tests/package.json b/e2e/smoke-tests/package.json index ca33e7f696f..c957f018b5a 100644 --- a/e2e/smoke-tests/package.json +++ b/e2e/smoke-tests/package.json @@ -35,6 +35,6 @@ "webpack-dev-server": "5.2.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 106d7606644..487b8a397c5 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -27,6 +27,6 @@ "typescript": "5.5.4" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/integration/compat-typings/package.json b/integration/compat-typings/package.json index 45ed087a0d7..6ad4d2e1298 100644 --- a/integration/compat-typings/package.json +++ b/integration/compat-typings/package.json @@ -13,6 +13,6 @@ "typescript": "5.5.4" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 04544d11eca..da44bf771d3 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -26,6 +26,6 @@ "webpack-stream": "7.0.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 2b693ae5967..2c5ecc94483 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -18,6 +18,6 @@ "selenium-assistant": "6.1.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/package.json b/package.json index ce2c5847573..39455ef1161 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "homepage": "https://github.com/firebase/firebase-js-sdk", "keywords": [ diff --git a/packages/ai/package.json b/packages/ai/package.json index d03f6dc332d..152cd5b65f9 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -4,7 +4,7 @@ "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm.js", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index eb2af822b52..136a9163f58 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -67,6 +67,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/app-check/package.json b/packages/app-check/package.json index caea78cc3bc..1791b1acce9 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -68,6 +68,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index bed5553a39c..7d7a15e795b 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -66,6 +66,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/app/package.json b/packages/app/package.json index 7fbcff0bdcf..f33b77f286b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -70,6 +70,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index c56195cf991..f3f3284f55b 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -81,6 +81,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/auth/internal/package.json b/packages/auth/internal/package.json index 1a67791cfaf..5ec4fb3721a 100644 --- a/packages/auth/internal/package.json +++ b/packages/auth/internal/package.json @@ -7,6 +7,6 @@ "typings": "../dist/esm/internal/index.d.ts", "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/auth/package.json b/packages/auth/package.json index 4dc43b98ea3..ec7547e6326 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -160,6 +160,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/component/package.json b/packages/component/package.json index 9bc11a5784b..28bb0bf8d06 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -56,6 +56,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 01a42da2a20..16b274bafd1 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -69,6 +69,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/database/package.json b/packages/database/package.json index ce7811adfe4..3a9fc826ca0 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -78,6 +78,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 7d446495832..dd8fac6acfc 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -74,6 +74,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/firestore/lite/package.json b/packages/firestore/lite/package.json index b5f50e4afa9..5744f1d65d6 100644 --- a/packages/firestore/lite/package.json +++ b/packages/firestore/lite/package.json @@ -9,6 +9,6 @@ "typings": "../dist/lite/index.d.ts", "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 519243487c2..3ab29d190d9 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -2,7 +2,7 @@ "name": "@firebase/firestore", "version": "4.8.0", "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 6fa6b8e45b2..01e115a0c0a 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -75,6 +75,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/functions/package.json b/packages/functions/package.json index 62a63f5ce38..51c84cc8d74 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -79,6 +79,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/logger/package.json b/packages/logger/package.json index dd492c36915..9cb277feb79 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -55,6 +55,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index 033e4f752bc..57b6388b80c 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -20,7 +20,7 @@ "./package.json": "./package.json" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "files": [ "dist" diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index e50f685fde5..89a4231703d 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -63,6 +63,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/storage/package.json b/packages/storage/package.json index c1d272207dd..dfb4d1ff746 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -72,6 +72,6 @@ }, "typings": "dist/src/index.d.ts", "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/util/package.json b/packages/util/package.json index 0528ad84638..3586bea8580 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -68,6 +68,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/repo-scripts/api-documenter/package.json b/repo-scripts/api-documenter/package.json index 585890922a1..6305cbf9372 100644 --- a/repo-scripts/api-documenter/package.json +++ b/repo-scripts/api-documenter/package.json @@ -37,6 +37,6 @@ "mocha-chai-jest-snapshot": "1.1.6" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 961620142a0..8b3acaade05 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -40,6 +40,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/repo-scripts/prune-dts/package.json b/repo-scripts/prune-dts/package.json index 7a0890b00e2..e94519863a2 100644 --- a/repo-scripts/prune-dts/package.json +++ b/repo-scripts/prune-dts/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "description": "A script to prune non-exported types from a d.ts.", "author": "Firebase (https://firebase.google.com/)", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index ce4def7c26b..b184643ceea 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -59,6 +59,6 @@ "reportDir": "./coverage/node" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } \ No newline at end of file From a9be6757fe95d7f08b4d6aa92cf892dfce35195a Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 15 Jul 2025 09:49:00 -0700 Subject: [PATCH 250/295] fix(ci): Update e2e tests to import from ai instead of vertexai (#9164) --- e2e/smoke-tests/tests/modular.test.ts | 8 ++------ e2e/smoke-tests/tsconfig.json | 7 +++++++ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 e2e/smoke-tests/tsconfig.json diff --git a/e2e/smoke-tests/tests/modular.test.ts b/e2e/smoke-tests/tests/modular.test.ts index c6cd0b88c8e..c8f6afe779d 100644 --- a/e2e/smoke-tests/tests/modular.test.ts +++ b/e2e/smoke-tests/tests/modular.test.ts @@ -86,13 +86,9 @@ import { StorageReference, deleteObject } from 'firebase/storage'; -import { - getGenerativeModel, - getAI, - AI, - VertexAIBackend -} from 'firebase/vertexai'; +import { getGenerativeModel, getAI, AI, VertexAIBackend } from 'firebase/ai'; import { getDataConnect, DataConnect } from 'firebase/data-connect'; +// @ts-ignore import { config, testAccount } from '../firebase-config'; import 'jest'; diff --git a/e2e/smoke-tests/tsconfig.json b/e2e/smoke-tests/tsconfig.json new file mode 100644 index 00000000000..c09f694edf7 --- /dev/null +++ b/e2e/smoke-tests/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../config/tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "typeRoots": ["./node_modules/@types"] + } +} From f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 15 Jul 2025 17:48:09 -0700 Subject: [PATCH 251/295] chore: Add missing changeset for 9101 (#9167) --- .changeset/sour-pants-pump.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .changeset/sour-pants-pump.md diff --git a/.changeset/sour-pants-pump.md b/.changeset/sour-pants-pump.md new file mode 100644 index 00000000000..fe4122c23ef --- /dev/null +++ b/.changeset/sour-pants-pump.md @@ -0,0 +1,35 @@ +--- +'@firebase/installations-compat': patch +'@firebase/remote-config-compat': patch +'@firebase/performance-compat': patch +'@firebase/webchannel-wrapper': patch +'@firebase/analytics-compat': patch +'@firebase/app-check-compat': patch +'@firebase/firestore-compat': patch +'@firebase/functions-compat': patch +'@firebase/messaging-compat': patch +'@firebase/database-compat': patch +'@firebase/storage-compat': patch +'@firebase/installations': patch +'@firebase/remote-config': patch +'@firebase/data-connect': patch +'@firebase/auth-compat': patch +'@firebase/performance': patch +'@firebase/app-compat': patch +'@firebase/analytics': patch +'@firebase/app-check': patch +'@firebase/component': patch +'@firebase/firestore': patch +'@firebase/functions': patch +'@firebase/messaging': patch +'@firebase/database': patch +'@firebase/template': patch +'@firebase/storage': patch +'@firebase/logger': patch +'@firebase/auth': patch +'@firebase/util': patch +'@firebase/app': patch +'@firebase/ai': patch +--- + +Set build targets to ES2020. From 9771bffadbc464890150dd7dd1a9a0fe2df60bf0 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 16 Jul 2025 12:02:38 -0600 Subject: [PATCH 252/295] Revert "firestore: minor refactor of listener registration of "versionchange" indexedb events (#9087) (#9168) * Revert "firestore: minor refactor of listener registration of "versionchange" indexedb events (#9087)" This reverts commit f73e08b212314547b39a10cd3e393f9e94776f21. * Create hungry-icons-dream.md --- .changeset/hungry-icons-dream.md | 5 +++ .../firestore/src/core/firestore_client.ts | 22 +++-------- .../src/local/indexeddb_persistence.ts | 29 +++++--------- packages/firestore/src/local/persistence.ts | 18 ++------- packages/firestore/src/local/simple_db.ts | 39 +++++++------------ .../test/unit/specs/spec_test_runner.ts | 10 +---- 6 files changed, 38 insertions(+), 85 deletions(-) create mode 100644 .changeset/hungry-icons-dream.md diff --git a/.changeset/hungry-icons-dream.md b/.changeset/hungry-icons-dream.md new file mode 100644 index 00000000000..29137c772fd --- /dev/null +++ b/.changeset/hungry-icons-dream.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Fixed a regression where the SDK did not re-connect to IndexedDb after disconnect (#9087) diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index d04f37a3d7b..39bb8dd4eba 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -231,23 +231,11 @@ export async function setOfflineComponentProvider( } }); - offlineComponentProvider.persistence.setDatabaseDeletedListener(() => { - logWarn('Terminating Firestore due to IndexedDb database deletion'); - client - .terminate() - .then(() => { - logDebug( - 'Terminating Firestore due to IndexedDb database deletion ' + - 'completed successfully' - ); - }) - .catch(error => { - logWarn( - 'Terminating Firestore due to IndexedDb database deletion failed', - error - ); - }); - }); + // When a user calls clearPersistence() in one client, all other clients + // need to be terminated to allow the delete to succeed. + offlineComponentProvider.persistence.setDatabaseDeletedListener(() => + client.terminate() + ); client._offlineComponents = offlineComponentProvider; } diff --git a/packages/firestore/src/local/indexeddb_persistence.ts b/packages/firestore/src/local/indexeddb_persistence.ts index 0ec2baabfe4..57c26ea5baa 100644 --- a/packages/firestore/src/local/indexeddb_persistence.ts +++ b/packages/firestore/src/local/indexeddb_persistence.ts @@ -58,11 +58,7 @@ import { IndexedDbTargetCache } from './indexeddb_target_cache'; import { getStore, IndexedDbTransaction } from './indexeddb_transaction'; import { LocalSerializer } from './local_serializer'; import { LruParams } from './lru_garbage_collector'; -import { - DatabaseDeletedListener, - Persistence, - PrimaryStateListener -} from './persistence'; +import { Persistence, PrimaryStateListener } from './persistence'; import { PersistencePromise } from './persistence_promise'; import { PersistenceTransaction, @@ -328,25 +324,20 @@ export class IndexedDbPersistence implements Persistence { } /** - * Registers a listener that gets called when the underlying database receives - * an event indicating that it either has been deleted or is pending deletion - * and must be closed. - * - * For example, this callback will be called in the case that multi-tab - * IndexedDB persistence is in use and another tab calls - * clearIndexedDbPersistence(). In that case, this Firestore instance must - * close its IndexedDB connection in order to allow the deletion initiated by - * the other tab to proceed. - * - * This method may only be called once; subsequent invocations will result in - * an exception, refusing to supersede the previously-registered listener. + * Registers a listener that gets called when the database receives a + * version change event indicating that it has deleted. * * PORTING NOTE: This is only used for Web multi-tab. */ setDatabaseDeletedListener( - databaseDeletedListener: DatabaseDeletedListener + databaseDeletedListener: () => Promise ): void { - this.simpleDb.setDatabaseDeletedListener(databaseDeletedListener); + this.simpleDb.setVersionChangeListener(async event => { + // Check if an attempt is made to delete IndexedDB. + if (event.newVersion === null) { + await databaseDeletedListener(); + } + }); } /** diff --git a/packages/firestore/src/local/persistence.ts b/packages/firestore/src/local/persistence.ts index 113efe7b7d3..b014a6479ac 100644 --- a/packages/firestore/src/local/persistence.ts +++ b/packages/firestore/src/local/persistence.ts @@ -98,8 +98,6 @@ export interface ReferenceDelegate { ): PersistencePromise; } -export type DatabaseDeletedListener = () => void; - /** * Persistence is the lowest-level shared interface to persistent storage in * Firestore. @@ -153,23 +151,13 @@ export interface Persistence { shutdown(): Promise; /** - * Registers a listener that gets called when the underlying database receives - * an event indicating that it either has been deleted or is pending deletion - * and must be closed. - * - * For example, this callback will be called in the case that multi-tab - * IndexedDB persistence is in use and another tab calls - * clearIndexedDbPersistence(). In that case, this Firestore instance must - * close its IndexedDB connection in order to allow the deletion initiated by - * the other tab to proceed. - * - * This method may only be called once; subsequent invocations will result in - * an exception, refusing to supersede the previously-registered listener. + * Registers a listener that gets called when the database receives a + * version change event indicating that it has deleted. * * PORTING NOTE: This is only used for Web multi-tab. */ setDatabaseDeletedListener( - databaseDeletedListener: DatabaseDeletedListener + databaseDeletedListener: () => Promise ): void; /** diff --git a/packages/firestore/src/local/simple_db.ts b/packages/firestore/src/local/simple_db.ts index e284c3c46ee..1958d853690 100644 --- a/packages/firestore/src/local/simple_db.ts +++ b/packages/firestore/src/local/simple_db.ts @@ -19,10 +19,9 @@ import { getGlobal, getUA, isIndexedDBAvailable } from '@firebase/util'; import { debugAssert } from '../util/assert'; import { Code, FirestoreError } from '../util/error'; -import { logDebug, logError, logWarn } from '../util/log'; +import { logDebug, logError } from '../util/log'; import { Deferred } from '../util/promise'; -import { DatabaseDeletedListener } from './persistence'; import { PersistencePromise } from './persistence_promise'; // References to `indexedDB` are guarded by SimpleDb.isAvailable() and getGlobal() @@ -159,7 +158,8 @@ export class SimpleDbTransaction { */ export class SimpleDb { private db?: IDBDatabase; - private databaseDeletedListener?: DatabaseDeletedListener; + private lastClosedDbVersion: number | null = null; + private versionchangelistener?: (event: IDBVersionChangeEvent) => void; /** Deletes the specified database. */ static delete(name: string): Promise { @@ -365,35 +365,22 @@ export class SimpleDb { }); } - this.db.addEventListener( - 'versionchange', - event => { - // Notify the listener if another tab attempted to delete the IndexedDb - // database, such as by calling clearIndexedDbPersistence(). - if (event.newVersion === null) { - logWarn( - `Received "versionchange" event with newVersion===null; ` + - 'notifying the registered DatabaseDeletedListener, if any' - ); - this.databaseDeletedListener?.(); - } - }, - { passive: true } - ); + if (this.versionchangelistener) { + this.db.onversionchange = event => this.versionchangelistener!(event); + } return this.db; } - setDatabaseDeletedListener( - databaseDeletedListener: DatabaseDeletedListener + setVersionChangeListener( + versionChangeListener: (event: IDBVersionChangeEvent) => void ): void { - if (this.databaseDeletedListener) { - throw new Error( - 'setDatabaseDeletedListener() may only be called once, ' + - 'and it has already been called' - ); + this.versionchangelistener = versionChangeListener; + if (this.db) { + this.db.onversionchange = (event: IDBVersionChangeEvent) => { + return versionChangeListener(event); + }; } - this.databaseDeletedListener = databaseDeletedListener; } async runTransaction( diff --git a/packages/firestore/test/unit/specs/spec_test_runner.ts b/packages/firestore/test/unit/specs/spec_test_runner.ts index daa513edb68..51d2229b8a1 100644 --- a/packages/firestore/test/unit/specs/spec_test_runner.ts +++ b/packages/firestore/test/unit/specs/spec_test_runner.ts @@ -365,14 +365,8 @@ abstract class TestRunner { this.eventManager.onLastRemoteStoreUnlisten = triggerRemoteStoreUnlisten.bind(null, this.syncEngine); - this.persistence.setDatabaseDeletedListener(() => { - this.shutdown().catch(error => { - console.warn( - 'WARNING: this.shutdown() failed in callback ' + - 'specified to persistence.setDatabaseDeletedListener', - error - ); - }); + await this.persistence.setDatabaseDeletedListener(async () => { + await this.shutdown(); }); this.started = true; From 5748005852dea3f1dca418588efc5da9adf18c0c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 17 Jul 2025 10:15:16 -0700 Subject: [PATCH 253/295] docs: fix doc typos found by g3 presubmit (#9166) --- docs-devsite/ai.groundingmetadata.md | 4 ++-- docs-devsite/ai.md | 8 ++++---- docs-devsite/app.md | 2 +- packages/ai/src/types/imagen/requests.ts | 4 ++-- packages/ai/src/types/responses.ts | 2 +- packages/app/src/api.ts | 2 +- packages/firestore/src/local/indexeddb_persistence.ts | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs-devsite/ai.groundingmetadata.md b/docs-devsite/ai.groundingmetadata.md index a9605aaf1dd..3eaa42bfed3 100644 --- a/docs-devsite/ai.groundingmetadata.md +++ b/docs-devsite/ai.groundingmetadata.md @@ -29,7 +29,7 @@ export interface GroundingMetadata | [groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface)\[\] | A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. | | [groundingSupports](./ai.groundingmetadata.md#groundingmetadatagroundingsupports) | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface)\[\] | A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the groundingChunks. | | [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. | +| [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's "Grounded Response". | | [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. | ## GroundingMetadata.groundingChunks @@ -67,7 +67,7 @@ retrievalQueries?: string[]; ## GroundingMetadata.searchEntryPoint -Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. +Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's "Grounded Response". Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 950a89e94ad..9900b3ecccc 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -125,7 +125,7 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [Modality](./ai.md#modality) | Content part modality. | @@ -147,7 +147,7 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [Modality](./ai.md#modality) | Content part modality. | @@ -435,7 +435,7 @@ Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). -See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. +See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. Signature: @@ -655,7 +655,7 @@ Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). -See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. +See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. Signature: diff --git a/docs-devsite/app.md b/docs-devsite/app.md index 0c9b2d03e4b..3306d5fc5d9 100644 --- a/docs-devsite/app.md +++ b/docs-devsite/app.md @@ -148,7 +148,7 @@ If invoked in an unsupported non-server environment such as a browser. If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support. -If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project configuration required for auto-initialization. +If the `FIREBASE_OPTIONS` environment variable does not contain a valid project configuration required for auto-initialization. ## function(libraryKeyOrName, ...) diff --git a/packages/ai/src/types/imagen/requests.ts b/packages/ai/src/types/imagen/requests.ts index 2818ab91fd5..47d1afe3b01 100644 --- a/packages/ai/src/types/imagen/requests.ts +++ b/packages/ai/src/types/imagen/requests.ts @@ -215,7 +215,7 @@ export interface ImagenSafetySettings { * To specify an aspect ratio for generated images, set the `aspectRatio` property in your * {@link ImagenGenerationConfig}. * - * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * * @beta @@ -249,7 +249,7 @@ export const ImagenAspectRatio = { * To specify an aspect ratio for generated images, set the `aspectRatio` property in your * {@link ImagenGenerationConfig}. * - * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } + * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * * @beta diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index f85c8034e00..323699e646b 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -190,7 +190,7 @@ export interface GroundingMetadata { /** * Google Search entry point for web searches. This contains an HTML/CSS snippet that must be * embedded in an app to display a Google Search entry point for follow-up web searches related to - * a model's “Grounded Response”. + * a model's "Grounded Response". */ searchEntryPoint?: SearchEntrypoint; /** diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index 6fd50060a6a..af9b401b57d 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -254,7 +254,7 @@ export function initializeServerApp( * @throws If invoked in an unsupported non-server environment such as a browser. * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't * provide Finalization Registry support. - * @throws If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project + * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project * configuration required for auto-initialization. * * @public diff --git a/packages/firestore/src/local/indexeddb_persistence.ts b/packages/firestore/src/local/indexeddb_persistence.ts index 57c26ea5baa..8db4ac25d03 100644 --- a/packages/firestore/src/local/indexeddb_persistence.ts +++ b/packages/firestore/src/local/indexeddb_persistence.ts @@ -127,11 +127,11 @@ export const MAIN_DATABASE = 'main'; * `enablePersistence()` with `{synchronizeTabs:true}`. * * In multi-tab mode, if multiple clients are active at the same time, the SDK - * will designate one client as the “primary client”. An effort is made to pick + * will designate one client as the "primary client". An effort is made to pick * a visible, network-connected and active client, and this client is * responsible for letting other clients know about its presence. The primary * client writes a unique client-generated identifier (the client ID) to - * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to + * IndexedDb’s "owner" store every 4 seconds. If the primary client fails to * update this entry, another client can acquire the lease and take over as * primary. * From 52c85796fdb07562e692d48a8f651d07eff12572 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 17 Jul 2025 13:50:44 -0700 Subject: [PATCH 254/295] Version Packages (#9165) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/five-kids-grow.md | 6 --- .changeset/healthy-moons-type.md | 6 --- .changeset/heavy-ties-learn.md | 5 -- .changeset/hip-impalas-divide.md | 6 --- .changeset/hungry-icons-dream.md | 5 -- .changeset/late-beers-develop.md | 5 -- .changeset/nervous-needles-sit.md | 5 -- .changeset/rotten-taxis-allow.md | 5 -- .changeset/shy-yaks-hammer.md | 6 --- .changeset/slimy-mirrors-nail.md | 6 --- .changeset/sour-pants-pump.md | 35 -------------- .changeset/thin-bikes-tan.md | 6 --- .changeset/thirty-eggs-laugh.md | 6 --- .changeset/twelve-walls-exist.md | 5 -- .changeset/wet-parrots-grab.md | 24 ---------- integration/compat-interop/package.json | 28 +++++------ integration/firestore/package.json | 4 +- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 31 ++++++++++++ packages/ai/package.json | 10 ++-- packages/analytics-compat/CHANGELOG.md | 11 +++++ packages/analytics-compat/package.json | 10 ++-- packages/analytics/CHANGELOG.md | 12 +++++ packages/analytics/package.json | 12 ++--- packages/app-check-compat/CHANGELOG.md | 16 +++++++ packages/app-check-compat/package.json | 12 ++--- packages/app-check/CHANGELOG.md | 15 ++++++ packages/app-check/package.json | 10 ++-- packages/app-compat/CHANGELOG.md | 16 +++++++ packages/app-compat/package.json | 10 ++-- packages/app/CHANGELOG.md | 17 +++++++ packages/app/package.json | 8 ++-- packages/auth-compat/CHANGELOG.md | 15 ++++++ packages/auth-compat/package.json | 10 ++-- packages/auth/CHANGELOG.md | 15 ++++++ packages/auth/package.json | 10 ++-- packages/component/CHANGELOG.md | 13 +++++ packages/component/package.json | 4 +- packages/data-connect/CHANGELOG.md | 11 +++++ packages/data-connect/package.json | 10 ++-- packages/database-compat/CHANGELOG.md | 17 +++++++ packages/database-compat/package.json | 14 +++--- packages/database-types/CHANGELOG.md | 7 +++ packages/database-types/package.json | 4 +- packages/database/CHANGELOG.md | 15 ++++++ packages/database/package.json | 10 ++-- packages/firebase/CHANGELOG.md | 55 +++++++++++++++++++++ packages/firebase/package.json | 56 +++++++++++----------- packages/firestore-compat/CHANGELOG.md | 15 ++++++ packages/firestore-compat/package.json | 10 ++-- packages/firestore/CHANGELOG.md | 22 +++++++++ packages/firestore/package.json | 16 +++---- packages/functions-compat/CHANGELOG.md | 15 ++++++ packages/functions-compat/package.json | 10 ++-- packages/functions/CHANGELOG.md | 14 ++++++ packages/functions/package.json | 8 ++-- packages/installations-compat/CHANGELOG.md | 11 +++++ packages/installations-compat/package.json | 10 ++-- packages/installations/CHANGELOG.md | 10 ++++ packages/installations/package.json | 8 ++-- packages/logger/CHANGELOG.md | 10 ++++ packages/logger/package.json | 2 +- packages/messaging-compat/CHANGELOG.md | 11 +++++ packages/messaging-compat/package.json | 10 ++-- packages/messaging/CHANGELOG.md | 11 +++++ packages/messaging/package.json | 10 ++-- packages/performance-compat/CHANGELOG.md | 12 +++++ packages/performance-compat/package.json | 12 ++--- packages/performance/CHANGELOG.md | 14 ++++++ packages/performance/package.json | 12 ++--- packages/remote-config-compat/CHANGELOG.md | 12 +++++ packages/remote-config-compat/package.json | 12 ++--- packages/remote-config/CHANGELOG.md | 12 +++++ packages/remote-config/package.json | 12 ++--- packages/rules-unit-testing/CHANGELOG.md | 11 +++++ packages/rules-unit-testing/package.json | 4 +- packages/storage-compat/CHANGELOG.md | 15 ++++++ packages/storage-compat/package.json | 12 ++--- packages/storage/CHANGELOG.md | 14 ++++++ packages/storage/package.json | 10 ++-- packages/template/CHANGELOG.md | 6 +++ packages/template/package.json | 4 +- packages/util/CHANGELOG.md | 10 ++++ packages/util/package.json | 2 +- packages/webchannel-wrapper/CHANGELOG.md | 6 +++ packages/webchannel-wrapper/package.json | 2 +- repo-scripts/size-analysis/package.json | 6 +-- 87 files changed, 695 insertions(+), 329 deletions(-) delete mode 100644 .changeset/five-kids-grow.md delete mode 100644 .changeset/healthy-moons-type.md delete mode 100644 .changeset/heavy-ties-learn.md delete mode 100644 .changeset/hip-impalas-divide.md delete mode 100644 .changeset/hungry-icons-dream.md delete mode 100644 .changeset/late-beers-develop.md delete mode 100644 .changeset/nervous-needles-sit.md delete mode 100644 .changeset/rotten-taxis-allow.md delete mode 100644 .changeset/shy-yaks-hammer.md delete mode 100644 .changeset/slimy-mirrors-nail.md delete mode 100644 .changeset/sour-pants-pump.md delete mode 100644 .changeset/thin-bikes-tan.md delete mode 100644 .changeset/thirty-eggs-laugh.md delete mode 100644 .changeset/twelve-walls-exist.md delete mode 100644 .changeset/wet-parrots-grab.md diff --git a/.changeset/five-kids-grow.md b/.changeset/five-kids-grow.md deleted file mode 100644 index 4303518b6ff..00000000000 --- a/.changeset/five-kids-grow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for Grounding with Google Search. diff --git a/.changeset/healthy-moons-type.md b/.changeset/healthy-moons-type.md deleted file mode 100644 index 1f38000ceda..00000000000 --- a/.changeset/healthy-moons-type.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': major -'@firebase/ai': major ---- - -Add support for `anyOf` schemas diff --git a/.changeset/heavy-ties-learn.md b/.changeset/heavy-ties-learn.md deleted file mode 100644 index a09da57be24..00000000000 --- a/.changeset/heavy-ties-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/firestore': patch ---- - -Revert fix for issue where Firestore would produce `undefined` for document snapshot if "clear site data" button was pressed in the web browser. This fix was introduced in v11.6.1 but inadvertantly caused issues for some customers (https://github.com/firebase/firebase-js-sdk/issues/9056). diff --git a/.changeset/hip-impalas-divide.md b/.changeset/hip-impalas-divide.md deleted file mode 100644 index 49f7cb8836d..00000000000 --- a/.changeset/hip-impalas-divide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for Thinking Budget. diff --git a/.changeset/hungry-icons-dream.md b/.changeset/hungry-icons-dream.md deleted file mode 100644 index 29137c772fd..00000000000 --- a/.changeset/hungry-icons-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/firestore": patch ---- - -Fixed a regression where the SDK did not re-connect to IndexedDb after disconnect (#9087) diff --git a/.changeset/late-beers-develop.md b/.changeset/late-beers-develop.md deleted file mode 100644 index 55a8e0c072b..00000000000 --- a/.changeset/late-beers-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'firebase': major ---- - -Remove `vertexai` import path diff --git a/.changeset/nervous-needles-sit.md b/.changeset/nervous-needles-sit.md deleted file mode 100644 index 77594e263b0..00000000000 --- a/.changeset/nervous-needles-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/performance': patch ---- - -Fix bug where events are not sent if they exceed sendBeacon payload limit diff --git a/.changeset/rotten-taxis-allow.md b/.changeset/rotten-taxis-allow.md deleted file mode 100644 index dc7a7660164..00000000000 --- a/.changeset/rotten-taxis-allow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Fix typings for `functionDeclaration.parameters`. diff --git a/.changeset/shy-yaks-hammer.md b/.changeset/shy-yaks-hammer.md deleted file mode 100644 index 47b4df179e5..00000000000 --- a/.changeset/shy-yaks-hammer.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': major -'firebase': major ---- - -Convert TS enums exports in Firebase AI into const variables. diff --git a/.changeset/slimy-mirrors-nail.md b/.changeset/slimy-mirrors-nail.md deleted file mode 100644 index 56877ee8ba2..00000000000 --- a/.changeset/slimy-mirrors-nail.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': major -'@firebase/ai': major ---- - -Remove GroundingAttribution diff --git a/.changeset/sour-pants-pump.md b/.changeset/sour-pants-pump.md deleted file mode 100644 index fe4122c23ef..00000000000 --- a/.changeset/sour-pants-pump.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -'@firebase/installations-compat': patch -'@firebase/remote-config-compat': patch -'@firebase/performance-compat': patch -'@firebase/webchannel-wrapper': patch -'@firebase/analytics-compat': patch -'@firebase/app-check-compat': patch -'@firebase/firestore-compat': patch -'@firebase/functions-compat': patch -'@firebase/messaging-compat': patch -'@firebase/database-compat': patch -'@firebase/storage-compat': patch -'@firebase/installations': patch -'@firebase/remote-config': patch -'@firebase/data-connect': patch -'@firebase/auth-compat': patch -'@firebase/performance': patch -'@firebase/app-compat': patch -'@firebase/analytics': patch -'@firebase/app-check': patch -'@firebase/component': patch -'@firebase/firestore': patch -'@firebase/functions': patch -'@firebase/messaging': patch -'@firebase/database': patch -'@firebase/template': patch -'@firebase/storage': patch -'@firebase/logger': patch -'@firebase/auth': patch -'@firebase/util': patch -'@firebase/app': patch -'@firebase/ai': patch ---- - -Set build targets to ES2020. diff --git a/.changeset/thin-bikes-tan.md b/.changeset/thin-bikes-tan.md deleted file mode 100644 index 121b3208d52..00000000000 --- a/.changeset/thin-bikes-tan.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/app': minor -'firebase': minor ---- - -initializeServerApp now supports auto-initialization for Firebase App Hosting. diff --git a/.changeset/thirty-eggs-laugh.md b/.changeset/thirty-eggs-laugh.md deleted file mode 100644 index 6a7611f5eb7..00000000000 --- a/.changeset/thirty-eggs-laugh.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': major -'firebase': major ---- - -Remove `VertexAI` APIs. diff --git a/.changeset/twelve-walls-exist.md b/.changeset/twelve-walls-exist.md deleted file mode 100644 index 887b2bc6895..00000000000 --- a/.changeset/twelve-walls-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/firestore': patch ---- - -Further improved performance of UTF-8 string ordering logic, which had degraded in v11.3.0, was reverted in v11.3.1, and was re-introduced with some improvements in v11.5.0. diff --git a/.changeset/wet-parrots-grab.md b/.changeset/wet-parrots-grab.md deleted file mode 100644 index f67d6325e0f..00000000000 --- a/.changeset/wet-parrots-grab.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -'@firebase/rules-unit-testing': minor -'@firebase/app-check-compat': minor -'@firebase/firestore-compat': minor -'@firebase/functions-compat': minor -'@firebase/database-compat': minor -'@firebase/storage-compat': minor -'@firebase/auth-compat': minor -'@firebase/app-compat': minor -'@firebase/app-check': minor -'@firebase/component': minor -'@firebase/firestore': minor -'@firebase/functions': minor -'@firebase/database': minor -'@firebase/storage': minor -'@firebase/logger': minor -'@firebase/auth': minor -'@firebase/util': minor -'@firebase/app': minor -'@firebase/ai': minor -'firebase': major ---- - -Update node "engines" version to a minimum of Node 20. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 487b8a397c5..9f51db4741e 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,20 +8,20 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.13.2", - "@firebase/app-compat": "0.4.2", - "@firebase/analytics": "0.10.17", - "@firebase/analytics-compat": "0.2.23", - "@firebase/auth": "1.10.8", - "@firebase/auth-compat": "0.5.28", - "@firebase/functions": "0.12.9", - "@firebase/functions-compat": "0.3.26", - "@firebase/messaging": "0.12.22", - "@firebase/messaging-compat": "0.2.22", - "@firebase/performance": "0.7.7", - "@firebase/performance-compat": "0.2.20", - "@firebase/remote-config": "0.6.5", - "@firebase/remote-config-compat": "0.2.18" + "@firebase/app": "0.14.0", + "@firebase/app-compat": "0.5.0", + "@firebase/analytics": "0.10.18", + "@firebase/analytics-compat": "0.2.24", + "@firebase/auth": "1.11.0", + "@firebase/auth-compat": "0.6.0", + "@firebase/functions": "0.13.0", + "@firebase/functions-compat": "0.4.0", + "@firebase/messaging": "0.12.23", + "@firebase/messaging-compat": "0.2.23", + "@firebase/performance": "0.7.8", + "@firebase/performance-compat": "0.2.21", + "@firebase/remote-config": "0.6.6", + "@firebase/remote-config-compat": "0.2.19" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index da44bf771d3..0999db1409d 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.13.2", - "@firebase/firestore": "4.8.0" + "@firebase/app": "0.14.0", + "@firebase/firestore": "4.9.0" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 2c5ecc94483..b8e9b5e65a9 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "11.10.0", + "firebase": "12.0.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index ed7f17e28ba..c73afc3cc7b 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,36 @@ # @firebase/ai +## 2.0.0 + +### Major Changes + +- [`5200f7b`](https://github.com/firebase/firebase-js-sdk/commit/5200f7bb777cf2260dcd396fbd19ac6cc7cb44c4) [#9042](https://github.com/firebase/firebase-js-sdk/pull/9042) - Add support for `anyOf` schemas + +- [`e59cd7d`](https://github.com/firebase/firebase-js-sdk/commit/e59cd7da1f375ec89f237ceb684c9f450d65cd34) [#9137](https://github.com/firebase/firebase-js-sdk/pull/9137) - Convert TS enums exports in Firebase AI into const variables. + +- [`cb19688`](https://github.com/firebase/firebase-js-sdk/commit/cb19688bf3d339a46c4964cb30b6263af08526e6) [#9079](https://github.com/firebase/firebase-js-sdk/pull/9079) - Remove GroundingAttribution + +- [`ec5f374`](https://github.com/firebase/firebase-js-sdk/commit/ec5f37403d9ebe28d3d71a7789d59edfb12762df) [#9063](https://github.com/firebase/firebase-js-sdk/pull/9063) - Remove `VertexAI` APIs. + +### Minor Changes + +- [`a4ccd25`](https://github.com/firebase/firebase-js-sdk/commit/a4ccd254dd1ecb63aa010ca010ad50d4b8a8316a) [#9068](https://github.com/firebase/firebase-js-sdk/pull/9068) - Add support for Grounding with Google Search. + +- [`6ab4e13`](https://github.com/firebase/firebase-js-sdk/commit/6ab4e13a1665dab4be89ecc141b4584a5a6df569) [#9156](https://github.com/firebase/firebase-js-sdk/pull/9156) - Add support for Thinking Budget. + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`ae976d0`](https://github.com/firebase/firebase-js-sdk/commit/ae976d02908a5a8913c5fcd4c0485fcf4b081fec) [#8948](https://github.com/firebase/firebase-js-sdk/pull/8948) (fixes [#8944](https://github.com/firebase/firebase-js-sdk/issues/8944)) - Fix typings for `functionDeclaration.parameters`. + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 1.4.1 ### Patch Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 152cd5b65f9..97186afb1e1 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "1.4.1", + "version": "2.0.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -50,14 +50,14 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.3", - "@firebase/component": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index aa82fdb15b2..f2d4d39b618 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/analytics-compat +## 0.2.24 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/analytics@0.10.18 + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.2.23 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ef13d21343e..ac5ea4e77a5 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.23", + "version": "0.2.24", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -52,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.18", - "@firebase/analytics": "0.10.17", + "@firebase/component": "0.7.0", + "@firebase/analytics": "0.10.18", "@firebase/analytics-types": "0.8.3", - "@firebase/util": "1.12.1", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 609d7b5572b..ccb9017314a 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/analytics +## 0.10.18 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/installations@0.6.19 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.10.17 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 0627556deed..8c7a23f6577 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.17", + "version": "0.10.18", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,15 +39,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/installations": "0.6.19", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 60ace8bba2b..8d8cca1a8d3 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,21 @@ # @firebase/app-check-compat +## 0.4.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/app-check@0.11.0 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.3.26 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 136a9163f58..e16cfe22ed6 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.26", + "version": "0.4.0", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -34,16 +34,16 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.10.1", + "@firebase/app-check": "0.11.0", "@firebase/app-check-types": "0.5.3", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 5cc53b86a21..e28884ed1b4 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/app-check +## 0.11.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.10.1 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 1791b1acce9..3635fc9bcf2 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-check", - "version": "0.10.1", + "version": "0.11.0", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,14 +37,14 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", - "@firebase/logger": "0.4.4", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index dc9042844aa..4f765e43d97 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,21 @@ # @firebase/app-compat +## 0.5.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`d91169f`](https://github.com/firebase/firebase-js-sdk/commit/d91169f061bf1dcbfe78a8c8a7f739677608fcb7), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + - @firebase/app@0.14.0 + ## 0.4.2 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 7d7a15e795b..c19146f41c7 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.4.2", + "version": "0.5.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.13.2", - "@firebase/util": "1.12.1", - "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.18", + "@firebase/app": "0.14.0", + "@firebase/util": "1.13.0", + "@firebase/logger": "0.5.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "devDependencies": { diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 27dbe6b36da..bfc5f0ac55b 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,22 @@ # @firebase/app +## 0.14.0 + +### Minor Changes + +- [`d91169f`](https://github.com/firebase/firebase-js-sdk/commit/d91169f061bf1dcbfe78a8c8a7f739677608fcb7) [#9151](https://github.com/firebase/firebase-js-sdk/pull/9151) (fixes [#8863](https://github.com/firebase/firebase-js-sdk/issues/8863)) - initializeServerApp now supports auto-initialization for Firebase App Hosting. + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.13.2 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index f33b77f286b..14576b7be2e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.13.2", + "version": "0.14.0", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -39,9 +39,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.12.1", - "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/logger": "0.5.0", + "@firebase/component": "0.7.0", "idb": "7.1.1", "tslib": "^2.1.0" }, diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 6f214d7e71a..401045ee12a 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/auth-compat +## 0.6.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/auth@1.11.0 + - @firebase/util@1.13.0 + ## 0.5.28 ### Patch Changes diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index f3f3284f55b..06b7cd07880 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth-compat", - "version": "0.5.28", + "version": "0.6.0", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,15 +49,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.10.8", + "@firebase/auth": "1.11.0", "@firebase/auth-types": "0.13.0", - "@firebase/component": "0.6.18", - "@firebase/util": "1.12.1", + "@firebase/component": "0.7.0", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 0fa8b449840..6439b542480 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/auth +## 1.11.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 1.10.8 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index ec7547e6326..35bf105de92 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.10.8", + "version": "1.11.0", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -124,14 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 02d07049690..b300eb047d9 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/component +## 0.7.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/util@1.13.0 + ## 0.6.18 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index 28bb0bf8d06..2b475f12177 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/component", - "version": "0.6.18", + "version": "0.7.0", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -31,7 +31,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.12.1", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index f650d447f5a..c62138b4d24 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,5 +1,16 @@ ## Unreleased +## 0.3.11 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.3.10 ### Patch Changes diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index ef169dfa5ff..0c6a4acbba2 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/data-connect", - "version": "0.3.10", + "version": "0.3.11", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -49,13 +49,13 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.4", - "@firebase/component": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index 6340490a2c8..9a4ec4fef66 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,22 @@ # @firebase/database-compat +## 2.1.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/database@1.1.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + - @firebase/database-types@1.0.16 + ## 2.0.11 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 16b274bafd1..8840022b659 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-compat", - "version": "2.0.11", + "version": "2.1.0", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", @@ -49,15 +49,15 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.20", - "@firebase/database-types": "1.0.15", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/database": "1.1.0", + "@firebase/database-types": "1.0.16", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index b3c5d5a1fda..d175477dcd6 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.16 + +### Patch Changes + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/util@1.13.0 + ## 1.0.15 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 89b1c615e33..b63337a0612 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.15", + "version": "1.0.16", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.3", - "@firebase/util": "1.12.1" + "@firebase/util": "1.13.0" }, "repository": { "directory": "packages/database-types", diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index 40e48bdee61..860266ce7a0 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,20 @@ # Unreleased +## 1.1.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 1.0.20 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 3a9fc826ca0..c6feef61f8d 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database", - "version": "1.0.20", + "version": "1.1.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -48,16 +48,16 @@ "license": "Apache-2.0", "peerDependencies": {}, "dependencies": { - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "@firebase/app-check-interop-types": "0.3.3", "@firebase/auth-interop-types": "0.2.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 67ebe4a8211..927f51f5b65 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,60 @@ # firebase +## 12.0.0 + +### Major Changes + +- [`5200f7b`](https://github.com/firebase/firebase-js-sdk/commit/5200f7bb777cf2260dcd396fbd19ac6cc7cb44c4) [#9042](https://github.com/firebase/firebase-js-sdk/pull/9042) - Add support for `anyOf` schemas + +- [`91fa484`](https://github.com/firebase/firebase-js-sdk/commit/91fa484b5a6081ad9c59d3b62416a2b5252b95a6) [#9081](https://github.com/firebase/firebase-js-sdk/pull/9081) - Remove `vertexai` import path + +- [`e59cd7d`](https://github.com/firebase/firebase-js-sdk/commit/e59cd7da1f375ec89f237ceb684c9f450d65cd34) [#9137](https://github.com/firebase/firebase-js-sdk/pull/9137) - Convert TS enums exports in Firebase AI into const variables. + +- [`cb19688`](https://github.com/firebase/firebase-js-sdk/commit/cb19688bf3d339a46c4964cb30b6263af08526e6) [#9079](https://github.com/firebase/firebase-js-sdk/pull/9079) - Remove GroundingAttribution + +- [`ec5f374`](https://github.com/firebase/firebase-js-sdk/commit/ec5f37403d9ebe28d3d71a7789d59edfb12762df) [#9063](https://github.com/firebase/firebase-js-sdk/pull/9063) - Remove `VertexAI` APIs. + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Minor Changes + +- [`a4ccd25`](https://github.com/firebase/firebase-js-sdk/commit/a4ccd254dd1ecb63aa010ca010ad50d4b8a8316a) [#9068](https://github.com/firebase/firebase-js-sdk/pull/9068) - Add support for Grounding with Google Search. + +- [`6ab4e13`](https://github.com/firebase/firebase-js-sdk/commit/6ab4e13a1665dab4be89ecc141b4584a5a6df569) [#9156](https://github.com/firebase/firebase-js-sdk/pull/9156) - Add support for Thinking Budget. + +- [`d91169f`](https://github.com/firebase/firebase-js-sdk/commit/d91169f061bf1dcbfe78a8c8a7f739677608fcb7) [#9151](https://github.com/firebase/firebase-js-sdk/pull/9151) (fixes [#8863](https://github.com/firebase/firebase-js-sdk/issues/8863)) - initializeServerApp now supports auto-initialization for Firebase App Hosting. + +### Patch Changes + +- Updated dependencies [[`a4ccd25`](https://github.com/firebase/firebase-js-sdk/commit/a4ccd254dd1ecb63aa010ca010ad50d4b8a8316a), [`5200f7b`](https://github.com/firebase/firebase-js-sdk/commit/5200f7bb777cf2260dcd396fbd19ac6cc7cb44c4), [`f11b552`](https://github.com/firebase/firebase-js-sdk/commit/f11b55294a04dfe6a1216c487b1af3a7e7d07196), [`6ab4e13`](https://github.com/firebase/firebase-js-sdk/commit/6ab4e13a1665dab4be89ecc141b4584a5a6df569), [`9771bff`](https://github.com/firebase/firebase-js-sdk/commit/9771bffadbc464890150dd7dd1a9a0fe2df60bf0), [`3d44792`](https://github.com/firebase/firebase-js-sdk/commit/3d44792f14f3df265162d06e2acdf3cad0c2ef86), [`ae976d0`](https://github.com/firebase/firebase-js-sdk/commit/ae976d02908a5a8913c5fcd4c0485fcf4b081fec), [`e59cd7d`](https://github.com/firebase/firebase-js-sdk/commit/e59cd7da1f375ec89f237ceb684c9f450d65cd34), [`cb19688`](https://github.com/firebase/firebase-js-sdk/commit/cb19688bf3d339a46c4964cb30b6263af08526e6), [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`d91169f`](https://github.com/firebase/firebase-js-sdk/commit/d91169f061bf1dcbfe78a8c8a7f739677608fcb7), [`ec5f374`](https://github.com/firebase/firebase-js-sdk/commit/ec5f37403d9ebe28d3d71a7789d59edfb12762df), [`a029ce3`](https://github.com/firebase/firebase-js-sdk/commit/a029ce39ee1ea1f6f28e79a1733ad8e8ebedf4bb), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/ai@2.0.0 + - @firebase/firestore@4.9.0 + - @firebase/performance@0.7.8 + - @firebase/installations-compat@0.2.19 + - @firebase/remote-config-compat@0.2.19 + - @firebase/performance-compat@0.2.21 + - @firebase/analytics-compat@0.2.24 + - @firebase/app-check-compat@0.4.0 + - @firebase/firestore-compat@0.4.0 + - @firebase/functions-compat@0.4.0 + - @firebase/messaging-compat@0.2.23 + - @firebase/database-compat@2.1.0 + - @firebase/storage-compat@0.4.0 + - @firebase/installations@0.6.19 + - @firebase/remote-config@0.6.6 + - @firebase/data-connect@0.3.11 + - @firebase/auth-compat@0.6.0 + - @firebase/app-compat@0.5.0 + - @firebase/analytics@0.10.18 + - @firebase/app-check@0.11.0 + - @firebase/functions@0.13.0 + - @firebase/messaging@0.12.23 + - @firebase/database@1.1.0 + - @firebase/storage@0.14.0 + - @firebase/auth@1.11.0 + - @firebase/util@1.13.0 + - @firebase/app@0.14.0 + ## 11.10.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index ef57d830656..ceb20a7c42f 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "11.10.0", + "version": "12.0.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "1.4.1", - "@firebase/app": "0.13.2", - "@firebase/app-compat": "0.4.2", + "@firebase/ai": "2.0.0", + "@firebase/app": "0.14.0", + "@firebase/app-compat": "0.5.0", "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.10.8", - "@firebase/auth-compat": "0.5.28", - "@firebase/data-connect": "0.3.10", - "@firebase/database": "1.0.20", - "@firebase/database-compat": "2.0.11", - "@firebase/firestore": "4.8.0", - "@firebase/firestore-compat": "0.3.53", - "@firebase/functions": "0.12.9", - "@firebase/functions-compat": "0.3.26", - "@firebase/installations": "0.6.18", - "@firebase/installations-compat": "0.2.18", - "@firebase/messaging": "0.12.22", - "@firebase/messaging-compat": "0.2.22", - "@firebase/storage": "0.13.14", - "@firebase/storage-compat": "0.3.24", - "@firebase/performance": "0.7.7", - "@firebase/performance-compat": "0.2.20", - "@firebase/remote-config": "0.6.5", - "@firebase/remote-config-compat": "0.2.18", - "@firebase/analytics": "0.10.17", - "@firebase/analytics-compat": "0.2.23", - "@firebase/app-check": "0.10.1", - "@firebase/app-check-compat": "0.3.26", - "@firebase/util": "1.12.1" + "@firebase/auth": "1.11.0", + "@firebase/auth-compat": "0.6.0", + "@firebase/data-connect": "0.3.11", + "@firebase/database": "1.1.0", + "@firebase/database-compat": "2.1.0", + "@firebase/firestore": "4.9.0", + "@firebase/firestore-compat": "0.4.0", + "@firebase/functions": "0.13.0", + "@firebase/functions-compat": "0.4.0", + "@firebase/installations": "0.6.19", + "@firebase/installations-compat": "0.2.19", + "@firebase/messaging": "0.12.23", + "@firebase/messaging-compat": "0.2.23", + "@firebase/storage": "0.14.0", + "@firebase/storage-compat": "0.4.0", + "@firebase/performance": "0.7.8", + "@firebase/performance-compat": "0.2.21", + "@firebase/remote-config": "0.6.6", + "@firebase/remote-config-compat": "0.2.19", + "@firebase/analytics": "0.10.18", + "@firebase/analytics-compat": "0.2.24", + "@firebase/app-check": "0.11.0", + "@firebase/app-check-compat": "0.4.0", + "@firebase/util": "1.13.0" }, "devDependencies": { "rollup": "2.79.2", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 88fd0400358..f7672f1620e 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/firestore-compat +## 0.4.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f11b552`](https://github.com/firebase/firebase-js-sdk/commit/f11b55294a04dfe6a1216c487b1af3a7e7d07196), [`9771bff`](https://github.com/firebase/firebase-js-sdk/commit/9771bffadbc464890150dd7dd1a9a0fe2df60bf0), [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`a029ce3`](https://github.com/firebase/firebase-js-sdk/commit/a029ce39ee1ea1f6f28e79a1733ad8e8ebedf4bb), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/firestore@4.9.0 + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.3.53 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index dd8fac6acfc..2c3e72a7416 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.53", + "version": "0.4.0", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.18", - "@firebase/firestore": "4.8.0", - "@firebase/util": "1.12.1", + "@firebase/component": "0.7.0", + "@firebase/firestore": "4.9.0", + "@firebase/util": "1.13.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 27571575bb7..3be572036fa 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,27 @@ # @firebase/firestore +## 4.9.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f11b552`](https://github.com/firebase/firebase-js-sdk/commit/f11b55294a04dfe6a1216c487b1af3a7e7d07196) [#9162](https://github.com/firebase/firebase-js-sdk/pull/9162) - Revert fix for issue where Firestore would produce `undefined` for document snapshot if "clear site data" button was pressed in the web browser. This fix was introduced in v11.6.1 but inadvertantly caused issues for some customers (https://github.com/firebase/firebase-js-sdk/issues/9056). + +- [`9771bff`](https://github.com/firebase/firebase-js-sdk/commit/9771bffadbc464890150dd7dd1a9a0fe2df60bf0) [#9168](https://github.com/firebase/firebase-js-sdk/pull/9168) - Fixed a regression where the SDK did not re-connect to IndexedDb after disconnect (#9087) + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- [`a029ce3`](https://github.com/firebase/firebase-js-sdk/commit/a029ce39ee1ea1f6f28e79a1733ad8e8ebedf4bb) [#9143](https://github.com/firebase/firebase-js-sdk/pull/9143) - Further improved performance of UTF-8 string ordering logic, which had degraded in v11.3.0, was reverted in v11.3.1, and was re-introduced with some improvements in v11.5.0. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/webchannel-wrapper@1.0.4 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 4.8.0 ### Minor Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 3ab29d190d9..38c3182aaf1 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.8.0", + "version": "4.9.0", "engines": { "node": ">=20.0.0" }, @@ -100,10 +100,10 @@ "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/webchannel-wrapper": "1.0.3", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/webchannel-wrapper": "1.0.4", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0" @@ -112,9 +112,9 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.2", - "@firebase/app-compat": "0.4.2", - "@firebase/auth": "1.10.8", + "@firebase/app": "0.14.0", + "@firebase/app-compat": "0.5.0", + "@firebase/auth": "1.11.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", "@types/eslint": "7.29.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 6dbe72a859e..10cd5a207e4 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/functions-compat +## 0.4.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/functions@0.13.0 + - @firebase/util@1.13.0 + ## 0.3.26 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 01e115a0c0a..bfdc3a25ce1 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.3.26", + "version": "0.4.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -62,10 +62,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.18", - "@firebase/functions": "0.12.9", + "@firebase/component": "0.7.0", + "@firebase/functions": "0.13.0", "@firebase/functions-types": "0.6.3", - "@firebase/util": "1.12.1", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index 11476ac51a2..545d124f9d5 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,19 @@ # @firebase/functions +## 0.13.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.12.9 ### Patch Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 51c84cc8d74..22daca97531 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.12.9", + "version": "0.13.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -65,11 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.18", + "@firebase/component": "0.7.0", "@firebase/messaging-interop-types": "0.2.3", "@firebase/auth-interop-types": "0.2.4", "@firebase/app-check-interop-types": "0.3.3", - "@firebase/util": "1.12.1", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index 7cd161398dc..d9e0fad1ef3 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/installations-compat +## 0.2.19 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/installations@0.6.19 + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.2.18 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 6dab5586392..3651d208145 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations-compat", - "version": "0.2.18", + "version": "0.2.19", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm.js", @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -57,10 +57,10 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.18", + "@firebase/installations": "0.6.19", "@firebase/installations-types": "0.5.3", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index de106423f5a..39cbde19a17 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/installations +## 0.6.19 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.6.18 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index 318843e1e1a..b7275babf12 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/installations", - "version": "0.6.18", + "version": "0.6.19", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm.js", @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", @@ -62,8 +62,8 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index 502b8d93945..78b740f4c6c 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/logger +## 0.5.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + ## 0.4.4 ### Patch Changes diff --git a/packages/logger/package.json b/packages/logger/package.json index 9cb277feb79..f44fa21d524 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/logger", - "version": "0.4.4", + "version": "0.5.0", "description": "A logger package for use in the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index 90877b5971a..98946c9d228 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/messaging-compat +## 0.2.23 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/messaging@0.12.23 + - @firebase/util@1.13.0 + ## 0.2.22 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 517bd5a2304..6dfac06d6b0 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.22", + "version": "0.2.23", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", @@ -38,13 +38,13 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.22", - "@firebase/component": "0.6.18", - "@firebase/util": "1.12.1", + "@firebase/messaging": "0.12.23", + "@firebase/component": "0.7.0", + "@firebase/util": "1.13.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", + "@firebase/app-compat": "0.5.0", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index 1ee115e3bef..6fe74948992 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/messaging +## 0.12.23 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/installations@0.6.19 + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.12.22 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 7dd640fdb16..5d3a9d24115 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.22", + "version": "0.12.23", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -52,15 +52,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.18", + "@firebase/installations": "0.6.19", "@firebase/messaging-interop-types": "0.2.3", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 035716656aa..2455f102d40 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/performance-compat +## 0.2.21 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`3d44792`](https://github.com/firebase/firebase-js-sdk/commit/3d44792f14f3df265162d06e2acdf3cad0c2ef86), [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/performance@0.7.8 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.2.20 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 9ce60ab51af..a24011702dc 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.20", + "version": "0.2.21", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.7", + "@firebase/performance": "0.7.8", "@firebase/performance-types": "0.2.3", - "@firebase/util": "1.12.1", - "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/logger": "0.5.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.2" + "@firebase/app-compat": "0.5.0" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index 26865967e8d..a92149650df 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,19 @@ # @firebase/performance +## 0.7.8 + +### Patch Changes + +- [`3d44792`](https://github.com/firebase/firebase-js-sdk/commit/3d44792f14f3df265162d06e2acdf3cad0c2ef86) [#9120](https://github.com/firebase/firebase-js-sdk/pull/9120) (fixes [#9067](https://github.com/firebase/firebase-js-sdk/issues/9067)) - Fix bug where events are not sent if they exceed sendBeacon payload limit + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/installations@0.6.19 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.7.7 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index 4bf4f3e4c5d..b909694ac58 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.7", + "version": "0.7.8", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,16 +38,16 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/logger": "0.4.4", - "@firebase/installations": "0.6.18", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/logger": "0.5.0", + "@firebase/installations": "0.6.19", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0", "web-vitals": "^4.2.4" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 9a0a10835f2..032b2fd59c0 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/remote-config-compat +## 0.2.19 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/remote-config@0.6.6 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.2.18 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index bf827f52c7f..ca9de2b8e06 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.18", + "version": "0.2.19", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.5", + "@firebase/remote-config": "0.6.6", "@firebase/remote-config-types": "0.4.0", - "@firebase/util": "1.12.1", - "@firebase/logger": "0.4.4", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/logger": "0.5.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "devDependencies": { @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.4.2" + "@firebase/app-compat": "0.5.0" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 86c511af473..55443c14bbf 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/remote-config +## 0.6.6 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/installations@0.6.19 + - @firebase/component@0.7.0 + - @firebase/logger@0.5.0 + - @firebase/util@1.13.0 + ## 0.6.5 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index ef94a90c53b..556302d773c 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.5", + "version": "0.6.6", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -40,15 +40,15 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.18", - "@firebase/logger": "0.4.4", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/installations": "0.6.19", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/rules-unit-testing/CHANGELOG.md b/packages/rules-unit-testing/CHANGELOG.md index dbdb276a1d8..6eaa82e889a 100644 --- a/packages/rules-unit-testing/CHANGELOG.md +++ b/packages/rules-unit-testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/rules-unit-testing +## 5.0.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- Updated dependencies [[`a4ccd25`](https://github.com/firebase/firebase-js-sdk/commit/a4ccd254dd1ecb63aa010ca010ad50d4b8a8316a), [`5200f7b`](https://github.com/firebase/firebase-js-sdk/commit/5200f7bb777cf2260dcd396fbd19ac6cc7cb44c4), [`6ab4e13`](https://github.com/firebase/firebase-js-sdk/commit/6ab4e13a1665dab4be89ecc141b4584a5a6df569), [`91fa484`](https://github.com/firebase/firebase-js-sdk/commit/91fa484b5a6081ad9c59d3b62416a2b5252b95a6), [`e59cd7d`](https://github.com/firebase/firebase-js-sdk/commit/e59cd7da1f375ec89f237ceb684c9f450d65cd34), [`cb19688`](https://github.com/firebase/firebase-js-sdk/commit/cb19688bf3d339a46c4964cb30b6263af08526e6), [`d91169f`](https://github.com/firebase/firebase-js-sdk/commit/d91169f061bf1dcbfe78a8c8a7f739677608fcb7), [`ec5f374`](https://github.com/firebase/firebase-js-sdk/commit/ec5f37403d9ebe28d3d71a7789d59edfb12762df), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - firebase@12.0.0 + ## 4.0.1 ### Patch Changes diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index 57b6388b80c..68657c9cac8 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/rules-unit-testing", - "version": "4.0.1", + "version": "5.0.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -43,7 +43,7 @@ "rollup-plugin-typescript2": "0.36.0" }, "peerDependencies": { - "firebase": "^11.0.0" + "firebase": "^12.0.0" }, "repository": { "directory": "packages/rules-unit-testing", diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index 51b414c9cd4..ec3d3308432 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/storage-compat +## 0.4.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/storage@0.14.0 + - @firebase/util@1.13.0 + ## 0.3.24 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 89a4231703d..51cf60f31e5 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage-compat", - "version": "0.3.24", + "version": "0.4.0", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", @@ -37,15 +37,15 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.14", + "@firebase/storage": "0.14.0", "@firebase/storage-types": "0.8.3", - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.4.2", - "@firebase/auth-compat": "0.5.28", + "@firebase/app-compat": "0.5.0", + "@firebase/auth-compat": "0.6.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index b00edbc5e7c..a8d7d80f3fd 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,19 @@ #Unreleased +## 0.14.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + +- Updated dependencies [[`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9), [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113)]: + - @firebase/component@0.7.0 + - @firebase/util@1.13.0 + ## 0.13.14 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index dfb4d1ff746..75b32f3d3d5 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/storage", - "version": "0.13.14", + "version": "0.14.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -46,16 +46,16 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.12.1", - "@firebase/component": "0.6.18", + "@firebase/util": "1.13.0", + "@firebase/component": "0.7.0", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.13.2", - "@firebase/auth": "1.10.8", + "@firebase/app": "0.14.0", + "@firebase/auth": "1.11.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/template/CHANGELOG.md b/packages/template/CHANGELOG.md index 564baf12f32..d0c317e841e 100644 --- a/packages/template/CHANGELOG.md +++ b/packages/template/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/template +## 0.2.7 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + ## 0.2.6 ### Patch Changes diff --git a/packages/template/package.json b/packages/template/package.json index 70aa992a67e..5a7631207b2 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/template", - "version": "0.2.6", + "version": "0.2.7", "private": true, "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.13.2", + "@firebase/app": "0.14.0", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index d7ce221e231..38660ea5f50 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/util +## 1.13.0 + +### Minor Changes + +- [`25b60fd`](https://github.com/firebase/firebase-js-sdk/commit/25b60fdaabe910e1538684a3c490b0900fb5f113) [#9128](https://github.com/firebase/firebase-js-sdk/pull/9128) - Update node "engines" version to a minimum of Node 20. + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + ## 1.12.1 ### Patch Changes diff --git a/packages/util/package.json b/packages/util/package.json index 3586bea8580..8c44efc4924 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/util", - "version": "1.12.1", + "version": "1.13.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", diff --git a/packages/webchannel-wrapper/CHANGELOG.md b/packages/webchannel-wrapper/CHANGELOG.md index 789b6d26f7e..6c93950e82f 100644 --- a/packages/webchannel-wrapper/CHANGELOG.md +++ b/packages/webchannel-wrapper/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/webchannel-wrapper +## 1.0.4 + +### Patch Changes + +- [`f18b25f`](https://github.com/firebase/firebase-js-sdk/commit/f18b25f73a05a696b6a9ed45702a84cc9dd5c6d9) [#9167](https://github.com/firebase/firebase-js-sdk/pull/9167) - Set build targets to ES2020. + ## 1.0.3 ### Patch Changes diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index 07b6385ed07..0ce6504b387 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/webchannel-wrapper", - "version": "1.0.3", + "version": "1.0.4", "description": "A wrapper of the webchannel packages from closure-library for use outside of a closure compiled application", "author": "Firebase (https://firebase.google.com/)", "main": "empty.js", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index b184643ceea..74e7daaf4fc 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -20,7 +20,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.12.1", + "@firebase/util": "1.13.0", "child-process-promise": "2.2.1", "glob": "7.2.3", "tmp": "0.2.3", @@ -40,8 +40,8 @@ "yargs": "17.7.2" }, "devDependencies": { - "@firebase/app": "0.13.2", - "@firebase/logger": "0.4.4", + "@firebase/app": "0.14.0", + "@firebase/logger": "0.5.0", "@types/webpack": "5.28.5" }, "repository": { From a4897a621e99f270ddf6821d587fcddd3a0c5cd1 Mon Sep 17 00:00:00 2001 From: Raymond Lam Date: Tue, 22 Jul 2025 11:53:46 -0700 Subject: [PATCH 255/295] Fixes a bug where the out-of-the-box core web vital metrics would throw an error when the target element name exceeds the max length of a custom attribute value. (#9178) --- .changeset/strong-avocados-prove.md | 5 +++ .../performance/src/resources/trace.test.ts | 33 +++++++++++++++++++ packages/performance/src/resources/trace.ts | 10 +++++- .../performance/src/utils/attributes_utils.ts | 2 +- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .changeset/strong-avocados-prove.md diff --git a/.changeset/strong-avocados-prove.md b/.changeset/strong-avocados-prove.md new file mode 100644 index 00000000000..78fc4028d3b --- /dev/null +++ b/.changeset/strong-avocados-prove.md @@ -0,0 +1,5 @@ +--- +'@firebase/performance': patch +--- + +Fixed errors thrown when capturing long target element names for the out-of-the-box metrics. diff --git a/packages/performance/src/resources/trace.test.ts b/packages/performance/src/resources/trace.test.ts index 5742a6815b5..92deef7e0a1 100644 --- a/packages/performance/src/resources/trace.test.ts +++ b/packages/performance/src/resources/trace.test.ts @@ -306,4 +306,37 @@ describe('Firebase Performance > trace', () => { expect(trace.getAttribute('stage')).to.equal('beginning'); }); }); + + describe('#addWebVitalMetric', () => { + it('has correctly scaled metric', () => { + Trace.addWebVitalMetric(trace, 'metric', 'attributeName', { + value: 0.5, + elementAttribution: 'test' + }); + + expect(trace.getMetric('metric') === 500); + }); + + it('has correct attribute', () => { + Trace.addWebVitalMetric(trace, 'metric', 'attributeName', { + value: 0.5, + elementAttribution: 'test' + }); + + expect(trace.getAttribute('attributeName') === 'test'); + }); + + it('correctly truncates long attribute names', () => { + Trace.addWebVitalMetric(trace, 'metric', 'attributeName', { + value: 0.5, + elementAttribution: + 'html>body>main>p>button.my_button_class.really_long_class_name_that_is_above_100_characters.another_long_class_name' + }); + + expect( + trace.getAttribute('attributeName') === + 'html>body>main>p>button.my_button_class.really_long_class_name_that_is_above_100_characters.another_' + ); + }); + }); }); diff --git a/packages/performance/src/resources/trace.ts b/packages/performance/src/resources/trace.ts index d6657f14ba6..ecc94472929 100644 --- a/packages/performance/src/resources/trace.ts +++ b/packages/performance/src/resources/trace.ts @@ -34,6 +34,7 @@ import { Api } from '../services/api_service'; import { logTrace, flushLogs } from '../services/perf_logger'; import { ERROR_FACTORY, ErrorCode } from '../utils/errors'; import { + MAX_ATTRIBUTE_VALUE_LENGTH, isValidCustomAttributeName, isValidCustomAttributeValue } from '../utils/attributes_utils'; @@ -382,7 +383,14 @@ export class Trace implements PerformanceTrace { if (metric) { trace.putMetric(metricKey, Math.floor(metric.value * 1000)); if (metric.elementAttribution) { - trace.putAttribute(attributeKey, metric.elementAttribution); + if (metric.elementAttribution.length > MAX_ATTRIBUTE_VALUE_LENGTH) { + trace.putAttribute( + attributeKey, + metric.elementAttribution.substring(0, MAX_ATTRIBUTE_VALUE_LENGTH) + ); + } else { + trace.putAttribute(attributeKey, metric.elementAttribution); + } } } } diff --git a/packages/performance/src/utils/attributes_utils.ts b/packages/performance/src/utils/attributes_utils.ts index 81bb2234bfe..6306b4b9e48 100644 --- a/packages/performance/src/utils/attributes_utils.ts +++ b/packages/performance/src/utils/attributes_utils.ts @@ -70,7 +70,7 @@ interface NavigatorWithConnection extends Navigator { const RESERVED_ATTRIBUTE_PREFIXES = ['firebase_', 'google_', 'ga_']; const ATTRIBUTE_FORMAT_REGEX = new RegExp('^[a-zA-Z]\\w*$'); const MAX_ATTRIBUTE_NAME_LENGTH = 40; -const MAX_ATTRIBUTE_VALUE_LENGTH = 100; +export const MAX_ATTRIBUTE_VALUE_LENGTH = 100; export function getServiceWorkerStatus(): ServiceWorkerStatus { const navigator = Api.getInstance().navigator; From b9209dc910500ffce22b7427407a60a2355f3189 Mon Sep 17 00:00:00 2001 From: Nicole <103509584+nicole0707@users.noreply.github.com> Date: Wed, 30 Jul 2025 03:40:18 +1000 Subject: [PATCH 256/295] fix(app-check): Prevent redundant exchangeToken calls in debug mode (#9187) --- .../app-check/.changeset/chatty-laws-sleep.md | 5 ++++ packages/app-check/src/internal-api.test.ts | 25 +++++++++++++++++++ packages/app-check/src/internal-api.ts | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 packages/app-check/.changeset/chatty-laws-sleep.md diff --git a/packages/app-check/.changeset/chatty-laws-sleep.md b/packages/app-check/.changeset/chatty-laws-sleep.md new file mode 100644 index 00000000000..634ba952c67 --- /dev/null +++ b/packages/app-check/.changeset/chatty-laws-sleep.md @@ -0,0 +1,5 @@ +--- +'@firebase/app-check': patch +--- + +Prevent redundant exchangeToken calls in debug mode diff --git a/packages/app-check/src/internal-api.test.ts b/packages/app-check/src/internal-api.test.ts index 5d6b88f1c32..ce89430a15b 100644 --- a/packages/app-check/src/internal-api.test.ts +++ b/packages/app-check/src/internal-api.test.ts @@ -630,6 +630,31 @@ describe('internal api', () => { expect(token).to.deep.equal({ token: fakeRecaptchaAppCheckToken.token }); }); + it('exchanges debug token only once if debug mode with no cached token', async () => { + const exchangeTokenStub: SinonStub = stub( + client, + 'exchangeToken' + ).returns(Promise.resolve(fakeRecaptchaAppCheckToken)); + const debugState = getDebugState(); + debugState.enabled = true; + debugState.token = new Deferred(); + debugState.token.resolve('my-debug-token'); + const appCheck = initializeAppCheck(app, { + provider: new ReCaptchaV3Provider(FAKE_SITE_KEY) + }); + const appCheckService = appCheck as AppCheckService; + const [token1, token2] = await Promise.all([ + getToken(appCheckService), + getToken(appCheckService) + ]); + expect(exchangeTokenStub.args[0][0].body['debug_token']).to.equal( + 'my-debug-token' + ); + expect(token1).to.deep.equal({ token: fakeRecaptchaAppCheckToken.token }); + expect(token2).to.deep.equal({ token: fakeRecaptchaAppCheckToken.token }); + expect(exchangeTokenStub).to.be.calledOnce; + }); + it('throttles for a period less than 1d on 503', async () => { // More detailed check of exponential backoff in providers.test.ts const appCheck = initializeAppCheck(app, { diff --git a/packages/app-check/src/internal-api.ts b/packages/app-check/src/internal-api.ts index eddf043c843..158c723a057 100644 --- a/packages/app-check/src/internal-api.ts +++ b/packages/app-check/src/internal-api.ts @@ -118,10 +118,11 @@ export async function getToken( */ if (isDebugMode()) { try { + const debugToken = await getDebugToken(); // Avoid making another call to the exchange endpoint if one is in flight. if (!state.exchangeTokenPromise) { state.exchangeTokenPromise = exchangeToken( - getExchangeDebugTokenRequest(app, await getDebugToken()), + getExchangeDebugTokenRequest(app, debugToken), appCheck.heartbeatServiceProvider ).finally(() => { // Clear promise when settled - either resolved or rejected. From 4923537713b4e616f7963ec04b7eb09aaf584b72 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 31 Jul 2025 11:23:25 -0400 Subject: [PATCH 257/295] Update BrowsersList DB (#9188) --- yarn.lock | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/yarn.lock b/yarn.lock index fe69e44aead..540d7bc7171 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5021,9 +5021,9 @@ camelcase@^6.0.0, camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001688: - version "1.0.30001695" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz#39dfedd8f94851132795fdf9b79d29659ad9c4d4" - integrity sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw== + version "1.0.30001731" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz" + integrity sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg== caseless@~0.12.0: version "0.12.0" @@ -15139,7 +15139,7 @@ string-argv@~0.3.1: resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15157,15 +15157,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -15229,7 +15220,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15250,13 +15241,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -16929,7 +16913,7 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16963,15 +16947,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From e25317f9f3c58305bc093e4f2e676690feb16db0 Mon Sep 17 00:00:00 2001 From: gsiddh <92327772+gsiddh@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:17:23 -0700 Subject: [PATCH 258/295] Firebase AI Hybrid Inference Implementation (#9029) Co-authored-by: Daniel La Rocque Co-authored-by: Erik Eldridge Co-authored-by: Christina Holland --- .changeset/purple-chairs-wait.md | 6 + common/api-review/ai.api.md | 99 ++- docs-devsite/_toc.yaml | 18 + docs-devsite/ai.chatsession.md | 5 +- docs-devsite/ai.chromeadapter.md | 94 +++ docs-devsite/ai.generativemodel.md | 5 +- docs-devsite/ai.hybridparams.md | 57 ++ docs-devsite/ai.imagengcsimage.md | 13 +- .../ai.languagemodelcreatecoreoptions.md | 51 ++ docs-devsite/ai.languagemodelcreateoptions.md | 43 + docs-devsite/ai.languagemodelexpected.md | 42 + docs-devsite/ai.languagemodelmessage.md | 42 + .../ai.languagemodelmessagecontent.md | 42 + docs-devsite/ai.languagemodelpromptoptions.md | 33 + docs-devsite/ai.md | 85 +- docs-devsite/ai.modelparams.md | 2 +- docs-devsite/ai.objectschemarequest.md | 2 +- docs-devsite/ai.ondeviceparams.md | 42 + docs-devsite/ai.requestoptions.md | 2 +- packages/ai/src/api.test.ts | 17 +- packages/ai/src/api.ts | 31 +- packages/ai/src/constants.ts | 5 + packages/ai/src/methods/chat-session.test.ts | 27 +- packages/ai/src/methods/chat-session.ts | 4 + .../ai/src/methods/chrome-adapter.test.ts | 776 ++++++++++++++++++ packages/ai/src/methods/chrome-adapter.ts | 372 +++++++++ packages/ai/src/methods/count-tokens.test.ts | 52 +- packages/ai/src/methods/count-tokens.ts | 17 +- .../ai/src/methods/generate-content.test.ts | 31 +- packages/ai/src/methods/generate-content.ts | 53 +- .../ai/src/models/generative-model.test.ts | 208 +++-- packages/ai/src/models/generative-model.ts | 14 +- packages/ai/src/types/chrome-adapter.ts | 59 ++ packages/ai/src/types/enums.ts | 23 +- packages/ai/src/types/imagen/responses.ts | 1 + packages/ai/src/types/index.ts | 12 + packages/ai/src/types/language-model.ts | 143 ++++ packages/ai/src/types/requests.ts | 36 + packages/ai/src/types/schema.ts | 2 +- 39 files changed, 2444 insertions(+), 122 deletions(-) create mode 100644 .changeset/purple-chairs-wait.md create mode 100644 docs-devsite/ai.chromeadapter.md create mode 100644 docs-devsite/ai.hybridparams.md create mode 100644 docs-devsite/ai.languagemodelcreatecoreoptions.md create mode 100644 docs-devsite/ai.languagemodelcreateoptions.md create mode 100644 docs-devsite/ai.languagemodelexpected.md create mode 100644 docs-devsite/ai.languagemodelmessage.md create mode 100644 docs-devsite/ai.languagemodelmessagecontent.md create mode 100644 docs-devsite/ai.languagemodelpromptoptions.md create mode 100644 docs-devsite/ai.ondeviceparams.md create mode 100644 packages/ai/src/methods/chrome-adapter.test.ts create mode 100644 packages/ai/src/methods/chrome-adapter.ts create mode 100644 packages/ai/src/types/chrome-adapter.ts create mode 100644 packages/ai/src/types/language-model.ts diff --git a/.changeset/purple-chairs-wait.md b/.changeset/purple-chairs-wait.md new file mode 100644 index 00000000000..e29595537cd --- /dev/null +++ b/.changeset/purple-chairs-wait.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': minor +'firebase': minor +--- + +Add hybrid inference options to the Firebase AI SDK. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 199b97b10a9..e0eac35996a 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -125,7 +125,7 @@ export class BooleanSchema extends Schema { // @public export class ChatSession { - constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); + constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); getHistory(): Promise; // (undocumented) model: string; @@ -137,6 +137,15 @@ export class ChatSession { sendMessageStream(request: string | Array): Promise; } +// @public +export interface ChromeAdapter { + // @internal (undocumented) + countTokens(request: CountTokensRequest): Promise; + generateContent(request: GenerateContentRequest): Promise; + generateContentStream(request: GenerateContentRequest): Promise; + isAvailable(request: GenerateContentRequest): Promise; +} + // @public export interface Citation { // (undocumented) @@ -416,7 +425,7 @@ export interface GenerativeContentBlob { // @public export class GenerativeModel extends AIModel { - constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); + constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined); countTokens(request: CountTokensRequest | string | Array): Promise; generateContent(request: GenerateContentRequest | string | Array): Promise; generateContentStream(request: GenerateContentRequest | string | Array): Promise; @@ -439,7 +448,7 @@ export class GenerativeModel extends AIModel { export function getAI(app?: FirebaseApp, options?: AIOptions): AI; // @public -export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel; // @beta export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; @@ -588,6 +597,13 @@ export const HarmSeverity: { // @public export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; +// @public +export interface HybridParams { + inCloudParams?: ModelParams; + mode: InferenceMode; + onDeviceParams?: OnDeviceParams; +} + // @beta export const ImagenAspectRatio: { readonly SQUARE: "1:1"; @@ -600,7 +616,7 @@ export const ImagenAspectRatio: { // @beta export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; -// @public +// @beta export interface ImagenGCSImage { gcsURI: string; mimeType: string; @@ -681,6 +697,16 @@ export interface ImagenSafetySettings { safetyFilterLevel?: ImagenSafetyFilterLevel; } +// @public +export const InferenceMode: { + readonly PREFER_ON_DEVICE: "prefer_on_device"; + readonly ONLY_ON_DEVICE: "only_on_device"; + readonly ONLY_IN_CLOUD: "only_in_cloud"; +}; + +// @public +export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; + // @public export interface InlineDataPart { // (undocumented) @@ -699,6 +725,63 @@ export class IntegerSchema extends Schema { constructor(schemaParams?: SchemaParams); } +// @public +export interface LanguageModelCreateCoreOptions { + // (undocumented) + expectedInputs?: LanguageModelExpected[]; + // (undocumented) + temperature?: number; + // (undocumented) + topK?: number; +} + +// @public +export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions { + // (undocumented) + initialPrompts?: LanguageModelMessage[]; + // (undocumented) + signal?: AbortSignal; +} + +// @public +export interface LanguageModelExpected { + // (undocumented) + languages?: string[]; + // (undocumented) + type: LanguageModelMessageType; +} + +// @public +export interface LanguageModelMessage { + // (undocumented) + content: LanguageModelMessageContent[]; + // (undocumented) + role: LanguageModelMessageRole; +} + +// @public +export interface LanguageModelMessageContent { + // (undocumented) + type: LanguageModelMessageType; + // (undocumented) + value: LanguageModelMessageContentValue; +} + +// @public +export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string; + +// @public +export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; + +// @public +export type LanguageModelMessageType = 'text' | 'image' | 'audio'; + +// @public +export interface LanguageModelPromptOptions { + // (undocumented) + responseConstraint?: object; +} + // @public export const Modality: { readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED"; @@ -757,6 +840,14 @@ export interface ObjectSchemaRequest extends SchemaRequest { type: 'object'; } +// @public +export interface OnDeviceParams { + // (undocumented) + createOptions?: LanguageModelCreateOptions; + // (undocumented) + promptOptions?: LanguageModelPromptOptions; +} + // @public export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 6d548ffd8d6..da7c2500894 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -24,6 +24,8 @@ toc: path: /docs/reference/js/ai.booleanschema.md - title: ChatSession path: /docs/reference/js/ai.chatsession.md + - title: ChromeAdapter + path: /docs/reference/js/ai.chromeadapter.md - title: Citation path: /docs/reference/js/ai.citation.md - title: CitationMetadata @@ -88,6 +90,8 @@ toc: path: /docs/reference/js/ai.groundingmetadata.md - title: GroundingSupport path: /docs/reference/js/ai.groundingsupport.md + - title: HybridParams + path: /docs/reference/js/ai.hybridparams.md - title: ImagenGCSImage path: /docs/reference/js/ai.imagengcsimage.md - title: ImagenGenerationConfig @@ -108,6 +112,18 @@ toc: path: /docs/reference/js/ai.inlinedatapart.md - title: IntegerSchema path: /docs/reference/js/ai.integerschema.md + - title: LanguageModelCreateCoreOptions + path: /docs/reference/js/ai.languagemodelcreatecoreoptions.md + - title: LanguageModelCreateOptions + path: /docs/reference/js/ai.languagemodelcreateoptions.md + - title: LanguageModelExpected + path: /docs/reference/js/ai.languagemodelexpected.md + - title: LanguageModelMessage + path: /docs/reference/js/ai.languagemodelmessage.md + - title: LanguageModelMessageContent + path: /docs/reference/js/ai.languagemodelmessagecontent.md + - title: LanguageModelPromptOptions + path: /docs/reference/js/ai.languagemodelpromptoptions.md - title: ModalityTokenCount path: /docs/reference/js/ai.modalitytokencount.md - title: ModelParams @@ -118,6 +134,8 @@ toc: path: /docs/reference/js/ai.objectschema.md - title: ObjectSchemaRequest path: /docs/reference/js/ai.objectschemarequest.md + - title: OnDeviceParams + path: /docs/reference/js/ai.ondeviceparams.md - title: PromptFeedback path: /docs/reference/js/ai.promptfeedback.md - title: RequestOptions diff --git a/docs-devsite/ai.chatsession.md b/docs-devsite/ai.chatsession.md index 1d6e403b6a8..4e4358898a5 100644 --- a/docs-devsite/ai.chatsession.md +++ b/docs-devsite/ai.chatsession.md @@ -22,7 +22,7 @@ export declare class ChatSession | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | +| [(constructor)(apiSettings, model, chromeAdapter, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | ## Properties @@ -47,7 +47,7 @@ Constructs a new instance of the `ChatSession` class Signature: ```typescript -constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); +constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); ``` #### Parameters @@ -56,6 +56,7 @@ constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | | --- | --- | --- | | apiSettings | ApiSettings | | | model | string | | +| chromeAdapter | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) \| undefined | | | params | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) \| undefined | | | requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | | diff --git a/docs-devsite/ai.chromeadapter.md b/docs-devsite/ai.chromeadapter.md new file mode 100644 index 00000000000..f497312c609 --- /dev/null +++ b/docs-devsite/ai.chromeadapter.md @@ -0,0 +1,94 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ChromeAdapter interface +(EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible. + +These methods should not be called directly by the user. + +Signature: + +```typescript +export interface ChromeAdapter +``` + +## Methods + +| Method | Description | +| --- | --- | +| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference.

      This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.

      | +| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference.

      This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.

      | +| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. | + +## ChromeAdapter.generateContent() + +Generates content using on-device inference. + +

      This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.

      + +Signature: + +```typescript +generateContent(request: GenerateContentRequest): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | a standard Firebase AI [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | + +Returns: + +Promise<Response> + +## ChromeAdapter.generateContentStream() + +Generates a content stream using on-device inference. + +

      This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.

      + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | a standard Firebase AI [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | + +Returns: + +Promise<Response> + +## ChromeAdapter.isAvailable() + +Checks if the on-device model is capable of handling a given request. + +Signature: + +```typescript +isAvailable(request: GenerateContentRequest): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | A potential request to be passed to the model. | + +Returns: + +Promise<boolean> + diff --git a/docs-devsite/ai.generativemodel.md b/docs-devsite/ai.generativemodel.md index d91cf80e881..323fcfe9d76 100644 --- a/docs-devsite/ai.generativemodel.md +++ b/docs-devsite/ai.generativemodel.md @@ -23,7 +23,7 @@ export declare class GenerativeModel extends AIModel | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(ai, modelParams, requestOptions)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | +| [(constructor)(ai, modelParams, requestOptions, chromeAdapter)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | ## Properties @@ -52,7 +52,7 @@ Constructs a new instance of the `GenerativeModel` class Signature: ```typescript -constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); +constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined); ``` #### Parameters @@ -62,6 +62,7 @@ constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions); | ai | [AI](./ai.ai.md#ai_interface) | | | modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | | | requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | | +| chromeAdapter | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) \| undefined | | ## GenerativeModel.generationConfig diff --git a/docs-devsite/ai.hybridparams.md b/docs-devsite/ai.hybridparams.md new file mode 100644 index 00000000000..baf568217d3 --- /dev/null +++ b/docs-devsite/ai.hybridparams.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# HybridParams interface +(EXPERIMENTAL) Configures hybrid inference. + +Signature: + +```typescript +export interface HybridParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. | +| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. | +| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | Optional. Specifies advanced params for on-device inference. | + +## HybridParams.inCloudParams + +Optional. Specifies advanced params for in-cloud inference. + +Signature: + +```typescript +inCloudParams?: ModelParams; +``` + +## HybridParams.mode + +Specifies on-device or in-cloud inference. Defaults to prefer on-device. + +Signature: + +```typescript +mode: InferenceMode; +``` + +## HybridParams.onDeviceParams + +Optional. Specifies advanced params for on-device inference. + +Signature: + +```typescript +onDeviceParams?: OnDeviceParams; +``` diff --git a/docs-devsite/ai.imagengcsimage.md b/docs-devsite/ai.imagengcsimage.md index cd11d8ee354..ec51c714e0f 100644 --- a/docs-devsite/ai.imagengcsimage.md +++ b/docs-devsite/ai.imagengcsimage.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGCSImage interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. This feature is not available yet. @@ -24,11 +27,14 @@ export interface ImagenGCSImage | Property | Type | Description | | --- | --- | --- | -| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | -| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | (Public Preview) The URI of the file stored in a Cloud Storage for Firebase bucket. | +| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenGCSImage.gcsURI +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The URI of the file stored in a Cloud Storage for Firebase bucket. Signature: @@ -43,6 +49,9 @@ gcsURI: string; ## ImagenGCSImage.mimeType +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The MIME type of the image; either `"image/png"` or `"image/jpeg"`. To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). diff --git a/docs-devsite/ai.languagemodelcreatecoreoptions.md b/docs-devsite/ai.languagemodelcreatecoreoptions.md new file mode 100644 index 00000000000..3b221933034 --- /dev/null +++ b/docs-devsite/ai.languagemodelcreatecoreoptions.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelCreateCoreOptions interface +(EXPERIMENTAL) Configures the creation of an on-device language model session. + +Signature: + +```typescript +export interface LanguageModelCreateCoreOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)\[\] | | +| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | | +| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | | + +## LanguageModelCreateCoreOptions.expectedInputs + +Signature: + +```typescript +expectedInputs?: LanguageModelExpected[]; +``` + +## LanguageModelCreateCoreOptions.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## LanguageModelCreateCoreOptions.topK + +Signature: + +```typescript +topK?: number; +``` diff --git a/docs-devsite/ai.languagemodelcreateoptions.md b/docs-devsite/ai.languagemodelcreateoptions.md new file mode 100644 index 00000000000..5d2ec9c69ad --- /dev/null +++ b/docs-devsite/ai.languagemodelcreateoptions.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelCreateOptions interface +(EXPERIMENTAL) Configures the creation of an on-device language model session. + +Signature: + +```typescript +export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions +``` +Extends: [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)\[\] | | +| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | | + +## LanguageModelCreateOptions.initialPrompts + +Signature: + +```typescript +initialPrompts?: LanguageModelMessage[]; +``` + +## LanguageModelCreateOptions.signal + +Signature: + +```typescript +signal?: AbortSignal; +``` diff --git a/docs-devsite/ai.languagemodelexpected.md b/docs-devsite/ai.languagemodelexpected.md new file mode 100644 index 00000000000..d27e718e1eb --- /dev/null +++ b/docs-devsite/ai.languagemodelexpected.md @@ -0,0 +1,42 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelExpected interface +(EXPERIMENTAL) Options for the expected inputs for an on-device language model. + +Signature: + +```typescript +export interface LanguageModelExpected +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | | +| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | | + +## LanguageModelExpected.languages + +Signature: + +```typescript +languages?: string[]; +``` + +## LanguageModelExpected.type + +Signature: + +```typescript +type: LanguageModelMessageType; +``` diff --git a/docs-devsite/ai.languagemodelmessage.md b/docs-devsite/ai.languagemodelmessage.md new file mode 100644 index 00000000000..228a31c8521 --- /dev/null +++ b/docs-devsite/ai.languagemodelmessage.md @@ -0,0 +1,42 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelMessage interface +(EXPERIMENTAL) An on-device language model message. + +Signature: + +```typescript +export interface LanguageModelMessage +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)\[\] | | +| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | | + +## LanguageModelMessage.content + +Signature: + +```typescript +content: LanguageModelMessageContent[]; +``` + +## LanguageModelMessage.role + +Signature: + +```typescript +role: LanguageModelMessageRole; +``` diff --git a/docs-devsite/ai.languagemodelmessagecontent.md b/docs-devsite/ai.languagemodelmessagecontent.md new file mode 100644 index 00000000000..71d2ce9919b --- /dev/null +++ b/docs-devsite/ai.languagemodelmessagecontent.md @@ -0,0 +1,42 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelMessageContent interface +(EXPERIMENTAL) An on-device language model content object. + +Signature: + +```typescript +export interface LanguageModelMessageContent +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | | +| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | | + +## LanguageModelMessageContent.type + +Signature: + +```typescript +type: LanguageModelMessageType; +``` + +## LanguageModelMessageContent.value + +Signature: + +```typescript +value: LanguageModelMessageContentValue; +``` diff --git a/docs-devsite/ai.languagemodelpromptoptions.md b/docs-devsite/ai.languagemodelpromptoptions.md new file mode 100644 index 00000000000..35a22c3d1a6 --- /dev/null +++ b/docs-devsite/ai.languagemodelpromptoptions.md @@ -0,0 +1,33 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LanguageModelPromptOptions interface +(EXPERIMENTAL) Options for an on-device language model prompt. + +Signature: + +```typescript +export interface LanguageModelPromptOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | | + +## LanguageModelPromptOptions.responseConstraint + +Signature: + +```typescript +responseConstraint?: object; +``` diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 9900b3ecccc..29b3f73f86e 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -19,7 +19,7 @@ The Firebase AI Web SDK. | function(app, ...) | | [getAI(app, options)](./ai.md#getai_a94a413) | Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | | function(ai, ...) | -| [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | +| [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | | [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | ## Classes @@ -51,6 +51,7 @@ The Firebase AI Web SDK. | [AI](./ai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./ai.md#getai_a94a413). | | [AIOptions](./ai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | | [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | | [Citation](./ai.citation.md#citation_interface) | A single citation. | | [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). | | [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. | @@ -81,18 +82,26 @@ The Firebase AI Web SDK. | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. | | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | -| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | +| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (EXPERIMENTAL) Configures hybrid inference. | +| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | (Public Preview) An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | | [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | | [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (EXPERIMENTAL) Configures the creation of an on-device language model session. | +| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (EXPERIMENTAL) Configures the creation of an on-device language model session. | +| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | (EXPERIMENTAL) Options for the expected inputs for an on-device language model. | +| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | (EXPERIMENTAL) An on-device language model message. | +| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | (EXPERIMENTAL) An on-device language model content object. | +| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (EXPERIMENTAL) Options for an on-device language model prompt. | | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | -| [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | -| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of "object" when not using the Schema.object() helper. | +| [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | +| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the Schema.object() helper. | +| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (EXPERIMENTAL) Encapsulates configuration for on-device inference. | | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). | +| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | | [SafetyRating](./ai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface) | | [SafetySetting](./ai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | @@ -128,6 +137,7 @@ The Firebase AI Web SDK. | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | | [Modality](./ai.md#modality) | Content part modality. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | @@ -150,6 +160,10 @@ The Firebase AI Web SDK. | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (EXPERIMENTAL) Content formats that can be provided as on-device message content. | +| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (EXPERIMENTAL) Allowable roles for on-device language model usage. | +| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (EXPERIMENTAL) Allowable types for on-device language model messages. | | [Modality](./ai.md#modality) | Content part modality. | | [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | @@ -211,14 +225,14 @@ const ai = getAI(app, { backend: new VertexAIBackend() }); ## function(ai, ...) -### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839} +### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_c63f46a} Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. Signature: ```typescript -export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel; ``` #### Parameters @@ -226,7 +240,7 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, req | Parameter | Type | Description | | --- | --- | --- | | ai | [AI](./ai.ai.md#ai_interface) | | -| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | | +| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) \| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | | | requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | | Returns: @@ -488,6 +502,20 @@ ImagenSafetyFilterLevel: { } ``` +## InferenceMode + +(EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. + +Signature: + +```typescript +InferenceMode: { + readonly PREFER_ON_DEVICE: "prefer_on_device"; + readonly ONLY_ON_DEVICE: "only_on_device"; + readonly ONLY_IN_CLOUD: "only_in_cloud"; +} +``` + ## Modality Content part modality. @@ -590,6 +618,7 @@ export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; ## FunctionCallingMode + Signature: ```typescript @@ -693,6 +722,46 @@ Text prompts provided as inputs and images (generated or uploaded) through Image export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; ``` +## InferenceMode + +(EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. + +Signature: + +```typescript +export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; +``` + +## LanguageModelMessageContentValue + +(EXPERIMENTAL) Content formats that can be provided as on-device message content. + +Signature: + +```typescript +export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string; +``` + +## LanguageModelMessageRole + +(EXPERIMENTAL) Allowable roles for on-device language model usage. + +Signature: + +```typescript +export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; +``` + +## LanguageModelMessageType + +(EXPERIMENTAL) Allowable types for on-device language model messages. + +Signature: + +```typescript +export type LanguageModelMessageType = 'text' | 'image' | 'audio'; +``` + ## Modality Content part modality. diff --git a/docs-devsite/ai.modelparams.md b/docs-devsite/ai.modelparams.md index a92b2e9035d..a5722e7d69d 100644 --- a/docs-devsite/ai.modelparams.md +++ b/docs-devsite/ai.modelparams.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). +Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). Signature: diff --git a/docs-devsite/ai.objectschemarequest.md b/docs-devsite/ai.objectschemarequest.md index bde646e0ac0..267e2d43345 100644 --- a/docs-devsite/ai.objectschemarequest.md +++ b/docs-devsite/ai.objectschemarequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ObjectSchemaRequest interface -Interface for JSON parameters in a schema of "object" when not using the `Schema.object()` helper. +Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the `Schema.object()` helper. Signature: diff --git a/docs-devsite/ai.ondeviceparams.md b/docs-devsite/ai.ondeviceparams.md new file mode 100644 index 00000000000..bce68ff8174 --- /dev/null +++ b/docs-devsite/ai.ondeviceparams.md @@ -0,0 +1,42 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# OnDeviceParams interface +(EXPERIMENTAL) Encapsulates configuration for on-device inference. + +Signature: + +```typescript +export interface OnDeviceParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | | +| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | | + +## OnDeviceParams.createOptions + +Signature: + +```typescript +createOptions?: LanguageModelCreateOptions; +``` + +## OnDeviceParams.promptOptions + +Signature: + +```typescript +promptOptions?: LanguageModelPromptOptions; +``` diff --git a/docs-devsite/ai.requestoptions.md b/docs-devsite/ai.requestoptions.md index 73aa03c1d25..8178ef5b696 100644 --- a/docs-devsite/ai.requestoptions.md +++ b/docs-devsite/ai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). +Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). Signature: diff --git a/packages/ai/src/api.test.ts b/packages/ai/src/api.test.ts index 27237b4edd3..76a9b4523c2 100644 --- a/packages/ai/src/api.test.ts +++ b/packages/ai/src/api.test.ts @@ -21,7 +21,7 @@ import { expect } from 'chai'; import { AI } from './public-types'; import { GenerativeModel } from './models/generative-model'; import { VertexAIBackend } from './backend'; -import { AI_TYPE } from './constants'; +import { AI_TYPE, DEFAULT_HYBRID_IN_CLOUD_MODEL } from './constants'; const fakeAI: AI = { app: { @@ -102,6 +102,21 @@ describe('Top level API', () => { expect(genModel).to.be.an.instanceOf(GenerativeModel); expect(genModel.model).to.equal('publishers/google/models/my-model'); }); + it('getGenerativeModel with HybridParams sets a default model', () => { + const genModel = getGenerativeModel(fakeAI, { + mode: 'only_on_device' + }); + expect(genModel.model).to.equal( + `publishers/google/models/${DEFAULT_HYBRID_IN_CLOUD_MODEL}` + ); + }); + it('getGenerativeModel with HybridParams honors a model override', () => { + const genModel = getGenerativeModel(fakeAI, { + mode: 'prefer_on_device', + inCloudParams: { model: 'my-model' } + }); + expect(genModel.model).to.equal('publishers/google/models/my-model'); + }); it('getImagenModel throws if no model is provided', () => { try { getImagenModel(fakeAI, {} as ImagenModelParams); diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index e9264262145..62c7c27f07a 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -18,11 +18,12 @@ import { FirebaseApp, getApp, _getProvider } from '@firebase/app'; import { Provider } from '@firebase/component'; import { getModularInstance } from '@firebase/util'; -import { AI_TYPE } from './constants'; +import { AI_TYPE, DEFAULT_HYBRID_IN_CLOUD_MODEL } from './constants'; import { AIService } from './service'; import { AI, AIOptions } from './public-types'; import { ImagenModelParams, + HybridParams, ModelParams, RequestOptions, AIErrorCode @@ -31,6 +32,8 @@ import { AIError } from './errors'; import { AIModel, GenerativeModel, ImagenModel } from './models'; import { encodeInstanceIdentifier } from './helpers'; import { GoogleAIBackend } from './backend'; +import { ChromeAdapterImpl } from './methods/chrome-adapter'; +import { LanguageModel } from './types/language-model'; export { ChatSession } from './methods/chat-session'; export * from './requests/schema-builder'; @@ -94,16 +97,36 @@ export function getAI( */ export function getGenerativeModel( ai: AI, - modelParams: ModelParams, + modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions ): GenerativeModel { - if (!modelParams.model) { + // Uses the existence of HybridParams.mode to clarify the type of the modelParams input. + const hybridParams = modelParams as HybridParams; + let inCloudParams: ModelParams; + if (hybridParams.mode) { + inCloudParams = hybridParams.inCloudParams || { + model: DEFAULT_HYBRID_IN_CLOUD_MODEL + }; + } else { + inCloudParams = modelParams as ModelParams; + } + + if (!inCloudParams.model) { throw new AIError( AIErrorCode.NO_MODEL, `Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })` ); } - return new GenerativeModel(ai, modelParams, requestOptions); + let chromeAdapter: ChromeAdapterImpl | undefined; + // Do not initialize a ChromeAdapter if we are not in hybrid mode. + if (typeof window !== 'undefined' && hybridParams.mode) { + chromeAdapter = new ChromeAdapterImpl( + window.LanguageModel as LanguageModel, + hybridParams.mode, + hybridParams.onDeviceParams + ); + } + return new GenerativeModel(ai, inCloudParams, requestOptions, chromeAdapter); } /** diff --git a/packages/ai/src/constants.ts b/packages/ai/src/constants.ts index cb54567735a..b6bd8e220ad 100644 --- a/packages/ai/src/constants.ts +++ b/packages/ai/src/constants.ts @@ -30,3 +30,8 @@ export const PACKAGE_VERSION = version; export const LANGUAGE_TAG = 'gl-js'; export const DEFAULT_FETCH_TIMEOUT_MS = 180 * 1000; + +/** + * Defines the name of the default in-cloud model to use for hybrid inference. + */ +export const DEFAULT_HYBRID_IN_CLOUD_MODEL = 'gemini-2.0-flash-lite'; diff --git a/packages/ai/src/methods/chat-session.test.ts b/packages/ai/src/methods/chat-session.test.ts index 0564aa84ed6..f523672f5e2 100644 --- a/packages/ai/src/methods/chat-session.test.ts +++ b/packages/ai/src/methods/chat-session.test.ts @@ -20,10 +20,11 @@ import { match, restore, stub, useFakeTimers } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import * as generateContentMethods from './generate-content'; -import { GenerateContentStreamResult } from '../types'; +import { GenerateContentStreamResult, InferenceMode } from '../types'; import { ChatSession } from './chat-session'; import { ApiSettings } from '../types/internal'; import { VertexAIBackend } from '../backend'; +import { ChromeAdapterImpl } from './chrome-adapter'; use(sinonChai); use(chaiAsPromised); @@ -36,6 +37,12 @@ const fakeApiSettings: ApiSettings = { backend: new VertexAIBackend() }; +const fakeChromeAdapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.PREFER_ON_DEVICE +); + describe('ChatSession', () => { afterEach(() => { restore(); @@ -46,7 +53,11 @@ describe('ChatSession', () => { generateContentMethods, 'generateContent' ).rejects('generateContent failed'); - const chatSession = new ChatSession(fakeApiSettings, 'a-model'); + const chatSession = new ChatSession( + fakeApiSettings, + 'a-model', + fakeChromeAdapter + ); await expect(chatSession.sendMessage('hello')).to.be.rejected; expect(generateContentStub).to.be.calledWith( fakeApiSettings, @@ -63,7 +74,11 @@ describe('ChatSession', () => { generateContentMethods, 'generateContentStream' ).rejects('generateContentStream failed'); - const chatSession = new ChatSession(fakeApiSettings, 'a-model'); + const chatSession = new ChatSession( + fakeApiSettings, + 'a-model', + fakeChromeAdapter + ); await expect(chatSession.sendMessageStream('hello')).to.be.rejected; expect(generateContentStreamStub).to.be.calledWith( fakeApiSettings, @@ -82,7 +97,11 @@ describe('ChatSession', () => { generateContentMethods, 'generateContentStream' ).resolves({} as unknown as GenerateContentStreamResult); - const chatSession = new ChatSession(fakeApiSettings, 'a-model'); + const chatSession = new ChatSession( + fakeApiSettings, + 'a-model', + fakeChromeAdapter + ); await chatSession.sendMessageStream('hello'); expect(generateContentStreamStub).to.be.calledWith( fakeApiSettings, diff --git a/packages/ai/src/methods/chat-session.ts b/packages/ai/src/methods/chat-session.ts index 60794001e37..dac16430b7a 100644 --- a/packages/ai/src/methods/chat-session.ts +++ b/packages/ai/src/methods/chat-session.ts @@ -30,6 +30,7 @@ import { validateChatHistory } from './chat-session-helpers'; import { generateContent, generateContentStream } from './generate-content'; import { ApiSettings } from '../types/internal'; import { logger } from '../logger'; +import { ChromeAdapter } from '../types/chrome-adapter'; /** * Do not log a message for this error. @@ -50,6 +51,7 @@ export class ChatSession { constructor( apiSettings: ApiSettings, public model: string, + private chromeAdapter?: ChromeAdapter, public params?: StartChatParams, public requestOptions?: RequestOptions ) { @@ -95,6 +97,7 @@ export class ChatSession { this._apiSettings, this.model, generateContentRequest, + this.chromeAdapter, this.requestOptions ) ) @@ -146,6 +149,7 @@ export class ChatSession { this._apiSettings, this.model, generateContentRequest, + this.chromeAdapter, this.requestOptions ); diff --git a/packages/ai/src/methods/chrome-adapter.test.ts b/packages/ai/src/methods/chrome-adapter.test.ts new file mode 100644 index 00000000000..83610f3dcd6 --- /dev/null +++ b/packages/ai/src/methods/chrome-adapter.test.ts @@ -0,0 +1,776 @@ +/** + * @license + * Copyright 2025 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 { AIError } from '../errors'; +import { expect, use } from 'chai'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { ChromeAdapterImpl } from './chrome-adapter'; +import { + Availability, + LanguageModel, + LanguageModelCreateOptions, + LanguageModelMessage +} from '../types/language-model'; +import { match, stub } from 'sinon'; +import { GenerateContentRequest, AIErrorCode, InferenceMode } from '../types'; +import { Schema } from '../api'; + +use(sinonChai); +use(chaiAsPromised); + +/** + * Converts the ReadableStream from response.body to an array of strings. + */ +async function toStringArray( + stream: ReadableStream +): Promise { + const decoder = new TextDecoder(); + const actual = []; + const reader = stream.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + actual.push(decoder.decode(value)); + } + return actual; +} + +describe('ChromeAdapter', () => { + describe('constructor', () => { + it('sets image as expected input type by default', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.AVAILABLE) + } as LanguageModel; + const availabilityStub = stub( + languageModelProvider, + 'availability' + ).resolves(Availability.AVAILABLE); + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + await adapter.isAvailable({ + contents: [ + { + role: 'user', + parts: [{ text: 'hi' }] + } + ] + }); + expect(availabilityStub).to.have.been.calledWith({ + expectedInputs: [{ type: 'image' }] + }); + }); + it('honors explicitly set expected inputs', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.AVAILABLE) + } as LanguageModel; + const availabilityStub = stub( + languageModelProvider, + 'availability' + ).resolves(Availability.AVAILABLE); + const createOptions = { + // Explicitly sets expected inputs. + expectedInputs: [{ type: 'text' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { + createOptions + } + ); + await adapter.isAvailable({ + contents: [ + { + role: 'user', + parts: [{ text: 'hi' }] + } + ] + }); + expect(availabilityStub).to.have.been.calledWith(createOptions); + }); + }); + describe('isAvailable', () => { + it('returns false if mode is only cloud', async () => { + const adapter = new ChromeAdapterImpl( + {} as LanguageModel, + InferenceMode.ONLY_IN_CLOUD + ); + expect( + await adapter.isAvailable({ + contents: [] + }) + ).to.be.false; + }); + it('returns true if mode is only on device and is available', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.AVAILABLE + } as LanguageModel, + InferenceMode.ONLY_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [] + }) + ).to.be.true; + }); + it('throws if mode is only on device and is unavailable', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.UNAVAILABLE + } as LanguageModel, + InferenceMode.ONLY_ON_DEVICE + ); + await expect( + adapter.isAvailable({ + contents: [] + }) + ).to.be.rejected; + }); + it('returns true after waiting for download if mode is only on device', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.DOWNLOADING, + create: ({}: LanguageModelCreateOptions) => + Promise.resolve({} as LanguageModel) + } as LanguageModel, + InferenceMode.ONLY_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [] + }) + ).to.be.true; + }); + it('returns false if LanguageModel API is undefined', async () => { + const adapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.PREFER_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [] + }) + ).to.be.false; + }); + it('returns false if request contents empty', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.AVAILABLE + } as LanguageModel, + InferenceMode.PREFER_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [] + }) + ).to.be.false; + }); + it('returns false if request content has "function" role', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.AVAILABLE + } as LanguageModel, + InferenceMode.PREFER_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [ + { + role: 'function', + parts: [] + } + ] + }) + ).to.be.false; + }); + it('returns true if request has image with supported mime type', async () => { + const adapter = new ChromeAdapterImpl( + { + availability: async () => Availability.AVAILABLE + } as LanguageModel, + InferenceMode.PREFER_ON_DEVICE + ); + for (const mimeType of ChromeAdapterImpl.SUPPORTED_MIME_TYPES) { + expect( + await adapter.isAvailable({ + contents: [ + { + role: 'user', + parts: [ + { + inlineData: { + mimeType, + data: '' + } + } + ] + } + ] + }) + ).to.be.true; + } + }); + it('returns true if model is readily available', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.AVAILABLE) + } as LanguageModel; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [ + { + role: 'user', + parts: [ + { text: 'describe this image' }, + { inlineData: { mimeType: 'image/jpeg', data: 'asd' } } + ] + } + ] + }) + ).to.be.true; + }); + it('returns false and triggers download when model is available after download', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.DOWNLOADABLE), + create: () => Promise.resolve({}) + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + {} as LanguageModel + ); + const createOptions = { + expectedInputs: [{ type: 'image' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { createOptions } + ); + expect( + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }) + ).to.be.false; + expect(createStub).to.have.been.calledOnceWith(createOptions); + }); + it('avoids redundant downloads', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.DOWNLOADABLE), + create: () => Promise.resolve({}) + } as LanguageModel; + const downloadPromise = new Promise(() => { + /* never resolves */ + }); + const createStub = stub(languageModelProvider, 'create').returns( + downloadPromise + ); + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }); + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }); + expect(createStub).to.have.been.calledOnce; + }); + it('clears state when download completes', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.DOWNLOADABLE), + create: () => Promise.resolve({}) + } as LanguageModel; + let resolveDownload; + const downloadPromise = new Promise(resolveCallback => { + resolveDownload = resolveCallback; + }); + const createStub = stub(languageModelProvider, 'create').returns( + downloadPromise + ); + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }); + resolveDownload!(); + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }); + expect(createStub).to.have.been.calledTwice; + }); + it('returns false when model is never available', async () => { + const languageModelProvider = { + availability: () => Promise.resolve(Availability.UNAVAILABLE), + create: () => Promise.resolve({}) + } as LanguageModel; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + expect( + await adapter.isAvailable({ + contents: [{ role: 'user', parts: [{ text: 'hi' }] }] + }) + ).to.be.false; + }); + }); + describe('generateContent', () => { + it('throws if Chrome API is undefined', async () => { + const adapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.ONLY_ON_DEVICE + ); + await expect( + adapter.generateContent({ + contents: [] + }) + ) + .to.eventually.be.rejectedWith( + AIError, + 'Chrome AI requested for unsupported browser version.' + ) + .and.have.property('code', AIErrorCode.UNSUPPORTED); + }); + it('generates content', async () => { + const languageModelProvider = { + create: () => Promise.resolve({}) + } as LanguageModel; + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + prompt: (p: LanguageModelMessage[]) => Promise.resolve('') + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + languageModel + ); + const promptOutput = 'hi'; + const promptStub = stub(languageModel, 'prompt').resolves(promptOutput); + const createOptions = { + systemPrompt: 'be yourself', + expectedInputs: [{ type: 'image' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { createOptions } + ); + const request = { + contents: [{ role: 'user', parts: [{ text: 'anything' }] }] + } as GenerateContentRequest; + const response = await adapter.generateContent(request); + // Asserts initialization params are proxied. + expect(createStub).to.have.been.calledOnceWith(createOptions); + // Asserts Vertex input type is mapped to Chrome type. + expect(promptStub).to.have.been.calledOnceWith([ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ]); + // Asserts expected output. + expect(await response.json()).to.deep.equal({ + candidates: [ + { + content: { + parts: [{ text: promptOutput }] + } + } + ] + }); + }); + it('generates content using image type input', async () => { + const languageModelProvider = { + create: () => Promise.resolve({}) + } as LanguageModel; + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + prompt: (p: LanguageModelMessage[]) => Promise.resolve('') + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + languageModel + ); + const promptOutput = 'hi'; + const promptStub = stub(languageModel, 'prompt').resolves(promptOutput); + const createOptions = { + systemPrompt: 'be yourself', + expectedInputs: [{ type: 'image' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { createOptions } + ); + const request = { + contents: [ + { + role: 'user', + parts: [ + { text: 'anything' }, + { + inlineData: { + data: sampleBase64EncodedImage, + mimeType: 'image/jpeg' + } + } + ] + } + ] + } as GenerateContentRequest; + const response = await adapter.generateContent(request); + // Asserts initialization params are proxied. + expect(createStub).to.have.been.calledOnceWith(createOptions); + // Asserts Vertex input type is mapped to Chrome type. + expect(promptStub).to.have.been.calledOnceWith([ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + }, + { + type: 'image', + value: match.instanceOf(ImageBitmap) + } + ] + } + ]); + // Asserts expected output. + expect(await response.json()).to.deep.equal({ + candidates: [ + { + content: { + parts: [{ text: promptOutput }] + } + } + ] + }); + }); + it('honors prompt options', async () => { + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + prompt: (p: LanguageModelMessage[]) => Promise.resolve('') + } as LanguageModel; + const languageModelProvider = { + create: () => Promise.resolve(languageModel) + } as LanguageModel; + const promptOutput = '{}'; + const promptStub = stub(languageModel, 'prompt').resolves(promptOutput); + const promptOptions = { + responseConstraint: Schema.object({ + properties: {} + }) + }; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { promptOptions } + ); + const request = { + contents: [{ role: 'user', parts: [{ text: 'anything' }] }] + } as GenerateContentRequest; + await adapter.generateContent(request); + expect(promptStub).to.have.been.calledOnceWith( + [ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ], + promptOptions + ); + }); + it('normalizes roles', async () => { + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + prompt: (p: LanguageModelMessage[]) => Promise.resolve('unused') + } as LanguageModel; + const promptStub = stub(languageModel, 'prompt').resolves('unused'); + const languageModelProvider = { + create: () => Promise.resolve(languageModel) + } as LanguageModel; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + const request = { + contents: [{ role: 'model', parts: [{ text: 'unused' }] }] + } as GenerateContentRequest; + await adapter.generateContent(request); + expect(promptStub).to.have.been.calledOnceWith([ + { + // Asserts Vertex's "model" role normalized to Chrome's "assistant" role. + role: 'assistant', + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ]); + }); + }); + describe('countTokens', () => { + it('counts tokens is not yet available', async () => { + const inputText = 'first'; + // setting up stubs + const languageModelProvider = { + create: () => Promise.resolve({}) + } as LanguageModel; + const languageModel = { + measureInputUsage: _i => Promise.resolve(123) + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + languageModel + ); + + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + + const countTokenRequest = { + contents: [{ role: 'user', parts: [{ text: inputText }] }] + } as GenerateContentRequest; + + try { + await adapter.countTokens(countTokenRequest); + } catch (e) { + // the call to countToken should be rejected with Error + expect((e as AIError).code).to.equal(AIErrorCode.REQUEST_ERROR); + expect((e as AIError).message).includes('not yet available'); + } + + // Asserts that no language model was initialized + expect(createStub).not.called; + }); + }); + describe('generateContentStream', () => { + it('generates content stream', async () => { + const languageModelProvider = { + create: () => Promise.resolve({}) + } as LanguageModel; + const languageModel = { + promptStreaming: _i => new ReadableStream() + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + languageModel + ); + const part = 'hi'; + const promptStub = stub(languageModel, 'promptStreaming').returns( + new ReadableStream({ + start(controller) { + controller.enqueue([part]); + controller.close(); + } + }) + ); + const createOptions = { + expectedInputs: [{ type: 'image' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { createOptions } + ); + const request = { + contents: [{ role: 'user', parts: [{ text: 'anything' }] }] + } as GenerateContentRequest; + const response = await adapter.generateContentStream(request); + expect(createStub).to.have.been.calledOnceWith(createOptions); + expect(promptStub).to.have.been.calledOnceWith([ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ]); + const actual = await toStringArray(response.body!); + expect(actual).to.deep.equal([ + `data: {"candidates":[{"content":{"role":"model","parts":[{"text":["${part}"]}]}}]}\n\n` + ]); + }); + it('generates content stream with image input', async () => { + const languageModelProvider = { + create: () => Promise.resolve({}) + } as LanguageModel; + const languageModel = { + promptStreaming: _i => new ReadableStream() + } as LanguageModel; + const createStub = stub(languageModelProvider, 'create').resolves( + languageModel + ); + const part = 'hi'; + const promptStub = stub(languageModel, 'promptStreaming').returns( + new ReadableStream({ + start(controller) { + controller.enqueue([part]); + controller.close(); + } + }) + ); + const createOptions = { + expectedInputs: [{ type: 'image' }] + } as LanguageModelCreateOptions; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { createOptions } + ); + const request = { + contents: [ + { + role: 'user', + parts: [ + { text: 'anything' }, + { + inlineData: { + data: sampleBase64EncodedImage, + mimeType: 'image/jpeg' + } + } + ] + } + ] + } as GenerateContentRequest; + const response = await adapter.generateContentStream(request); + expect(createStub).to.have.been.calledOnceWith(createOptions); + expect(promptStub).to.have.been.calledOnceWith([ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + }, + { + type: 'image', + value: match.instanceOf(ImageBitmap) + } + ] + } + ]); + const actual = await toStringArray(response.body!); + expect(actual).to.deep.equal([ + `data: {"candidates":[{"content":{"role":"model","parts":[{"text":["${part}"]}]}}]}\n\n` + ]); + }); + it('honors prompt options', async () => { + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + promptStreaming: p => new ReadableStream() + } as LanguageModel; + const languageModelProvider = { + create: () => Promise.resolve(languageModel) + } as LanguageModel; + const promptStub = stub(languageModel, 'promptStreaming').returns( + new ReadableStream() + ); + const promptOptions = { + responseConstraint: Schema.object({ + properties: {} + }) + }; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE, + { promptOptions } + ); + const request = { + contents: [{ role: 'user', parts: [{ text: 'anything' }] }] + } as GenerateContentRequest; + await adapter.generateContentStream(request); + expect(promptStub).to.have.been.calledOnceWith( + [ + { + role: request.contents[0].role, + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ], + promptOptions + ); + }); + it('normalizes roles', async () => { + const languageModel = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + promptStreaming: p => new ReadableStream() + } as LanguageModel; + const promptStub = stub(languageModel, 'promptStreaming').returns( + new ReadableStream() + ); + const languageModelProvider = { + create: () => Promise.resolve(languageModel) + } as LanguageModel; + const adapter = new ChromeAdapterImpl( + languageModelProvider, + InferenceMode.PREFER_ON_DEVICE + ); + const request = { + contents: [{ role: 'model', parts: [{ text: 'unused' }] }] + } as GenerateContentRequest; + await adapter.generateContentStream(request); + expect(promptStub).to.have.been.calledOnceWith([ + { + // Asserts Vertex's "model" role normalized to Chrome's "assistant" role. + role: 'assistant', + content: [ + { + type: 'text', + value: request.contents[0].parts[0].text + } + ] + } + ]); + }); + }); +}); + +// TODO: Move to using image from test-utils. +const sampleBase64EncodedImage = + '/9j/4QDeRXhpZgAASUkqAAgAAAAGABIBAwABAAAAAQAAABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAgAAABMCAwABAAAAAQAAAGmHBAABAAAAZgAAAAAAAABIAAAAAQAAAEgAAAABAAAABwAAkAcABAAAADAyMTABkQcABAAAAAECAwCGkgcAFgAAAMAAAAAAoAcABAAAADAxMDABoAMAAQAAAP//AAACoAQAAQAAAMgAAAADoAQAAQAAACwBAAAAAAAAQVNDSUkAAABQaWNzdW0gSUQ6IDM5MP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/CABEIASwAyAMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBAUGB//EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/9oADAMBAAIQAxAAAAHfA7ZFFgBQAAUUBQFBFABSUBQBQBZQUiqC7wAoigooQKACgCigKIoAosIKSigABWBdZAUAUAUQUUUAFIBQAWAFAUVFABSKoLqAKAKAKJVt4BvrFLAqKooArHgoQAoKiqDyKKoaiqhSqhCqgLFKHKdBiZmbodX5n2MbWHkdZS2kWhUBQIVUBwgUucv8Oad7nUzey3vPO5q4UrlOEWjzT0vhssDpea9Gy03BsqooKhCgCgCgHIcd0fN5DnuWHseY0Ureh+ZelLIqFq+f+gQJ5f6V5r6pE4i2ioDhCFVAVWrCiBxvJdlzFzVc56GjFoy4/a8d2q2TmpN3V1OF2MWp1/NrL0hzinRnO5Sdwc+L0Jz5HQLzyy9AYQYmDrZfXkyxVs5m4yVt3F0/M7l1YotpQnScdumqsFSb0yElm4zf5hjvV56bOtteViXq3ecRMbJgG+L4tzGqNyTDJNqMx5rfSHGRdpAcidPqLyFbuBeWrdmyONg7TJTBTrqZg3b6GGzbSzILYW8uSuF2hPG9l6uFdbPQRxzU8M2Lc62fpUJZNGC5TXAseNuVc2abO0pSKUsjdI+OdNoTzYc3fIANzF1LVTalK9KU72e1coa1TOqe3naA8inKGZ0QV5ZGzSywKWVrSAUROTjuno8lSLQbFq5kNrXsYAvQu5xmW9y18l0tjmrFu8ZM66C0nLabEsPGrT3xOlnIyXjkzC8tSxh2zRbWlsVNZtY6a9SKq1ZCd0rLHS17SPlgUtvpvatrVetlYJJZRpNcOOfmRaEN+s3Vctl0qCWs+PLljs19iWw+RdZEcU1VBFVUR6Kr5a6rplEzvnH5krF9Y33LnNFkqWIynAqZ3Zno3U03xO1mVY1HrGDxgOREpURkjiMXDUXOlsVpjRIJ0RXhix3KbUuzn6DLla6nK1RwFAKKK+GNsuigXReXW6mpRS2yWu6Zgr64Rq90abqclllYVJiJxIrAkI1JXRvJZoJJqUcY1yzmrvLnMLJX1QngWQrF9hTW01IZmwlt1F5bWtMTPruLc+fYltSVo83SKpnX/8QALRAAAQQCAQMDBAIBBQAAAAAAAQACAwQREgUQExQgITAVIjEyI0AkJTM0QXD/2gAIAQEAAQUC/wDH5Z2wu/scrHmBjg+P0hzXf0pGCSPjpnwT2bDa0LOWe6dEgCW06yYIWwRf0uVrbNdf79Grg2ZeUrxkMsco+CFleP4uRuyQvPITOjdyLzS4yy+Znqts7dtcbSZOgAB8V6Yw1nlziCE39obclR8EzZ4YrUM7vRy2PLVBpbT+Plv+Nn0RPZU42jJpc9HIwOhtqk8yU/j5dxMq+1YbrVaH2eUd/lsDpJG516zRMnjLSHRt0i+PlYss613Fli5OLBhOkwv1ShNG4PlDIqdzyunjd/l/k5NwFWu0dw/gMLlXhfFyHLD+SpGZbTq8GIR3Y7NCGKvRrd9fT5F4VgLxboXZ5ALXkgs8mFZt3I5vIvLzLYXnzL6lhfVYwvq9dfVqy5IEpzTG93618me0P9S5T96GPNQDWm+f8HifZuVlZWVlZXJnPILKysoytXsuUe0y27LHxzS92Y/ca72xzmWOW1cMcklSSKIMkbIzzYNrs8b6dO1HXYLsBaHAqS0yOTKyvLb37crZOQm5Bkcw5GFykuyqZ81iJ0mru9JgJ8bmHoGly1ds+KSNMikkXZsAduVo+5HKBwmW5mFzy5z70r43WJXEyuKz9ywjs8wzSQPdkuwUAcch/u9InavA0s2maqnMYpC1rmtjAV1zvHpVi1hiiQghz4cC8SsnUqxX0+svDrix9KgzLxeHHiiG/SX4+lyI8ZMFLVmgFz9nY2UELioNnqSRz5KEa/6AUpe0Miyrf8Dadnug6uQwOjgSyKye+WyIbAEgLuRoSxORwVLU2tTyOfJj2QlkY3ua8dGN0MhO2LmkK3bkgn7Ykjk4+KQ14BXj67YNkydqtE/VahagLVqwFo3f0PHlwe4NOSWRrh7agqxUEyZmGF9+IKG/G53Q7YPfaou9amEzV+wAI9BkY0k5PWtHOwy1d3V4zC38oKaq6WQfiw+FrIIqxXutiPRlfatWLVi0YvZTU4bDnVV4zkKpRrvUbS1F3tG4hbhbhbhS2WxtmmM0nHt0gysrZZWfR7rPXKysrZbFblblbruFZ990Nc7BCYpsxXdXcWy2WyysrPXuxrvMK7sa1ytF212120RqMZGFhY6BAoFArZZWVlZWfTC1zi+0c15y9+q1WgT4F33KOUl+0a7jMtfl2PTn4K+S0xPDoIe2srKyrE2vSGPuP7LF22/EEFq5dtybDlMAYMrZbLdOsgJ7t3KJj4xn4crK2QkKDgfTnpMThmNU1jXMbNogc/DlZWVno1+FsAvz6H5x0/KhZ7/GR0wgPd7tjD1x0f8Auoxs/wCHCwtemOuUx4ag8FZHV8bcqu33+LKysArt5WpWq1WOmShIQnSZBTBs4eyz1z8AKygvZaharC1RYsdQcESLcL8rJWVn0Z6gdG9MrKys9CAUWLtuWvUEhCRbDp7rZbLKCCygvx6s9AUCisBYRCPTKyUPQ0ooOKBK/8QAIhEAAwACAgIBBQAAAAAAAAAAAAEREBIgIQIwURMiMUBQ/9oACAEDAQE/Af5k9E9yWITC9S7RCCIQhCEGuyEcPFMTYrCYsxTrDYmVQTKhPouPJ9GyNj6iG7mEIRkZGPxZGR8aTofiRkZGM6OjY/OahNFp38lZWX5NkXxPtxuzZlNjZm5ubmxc01RqakIak4XhSl9NJxf6cJxvNCxCelMp/8QAIhEAAwACAgIBBQAAAAAAAAAAAAERECASMAIhIjFAQVBx/9oACAECAQE/Af1d6LumXZs5MTLhn51pR5WlKUulz5JLFLrR/XH8ITEIQhCCHld3IbRUesez2Px0jI8PERxIz5HyPZxRxWkIQmvI5FLil6Z137C9NJ2XFL0MhD//xAA2EAABAwEFBQcDBAEFAAAAAAABAAIRIQMQEjFBEyAiMlEEMDNSYXGRQIGhIzRCklAUQ1Nwcv/aAAgBAQAGPwL/AKfYHfyMfUttf+M1TXNyIpvHCQY+icw5OEI9ktdKBbR3sAmjZDZkxnW6TQI2HZK+a00CDG/Ri3Zm3mjonWNtGMZOTJgCdTCIaS8+ixOOCyCDLMU7sWVnQxJKaHEyMy2kqWyLSYxJwtHS5u/atiOK5z7USGmIQAHdktMONAsTnEn1WQKnojgjCdE21FAUW2b5I3aHStzZ1r3jP/d5uDbV1XyWgKzrAy3Xn+L+IXWTj5e8s2aRN2SOhVm1woXLDo1oQazmOSGLOK7hY9shYdckxvQDvGWvQxuMeBiIOSbNjs36kpjvKZXihSHhOfnhE0TuDDHrdaECGMdLu9w6khYncrBiKlBozJhWTHiHAqyd6Qms+VJsmfCwhh9k97C8EDqn/quZHlVO2Wi4e2OVO2KnamrxbIr/AGimi0OA9GL9qFXsZVeyPVezWirY2qq20H2Wbv6qy+E5hzFEFZgecKwI1Vh91bOGmV1B6K1Vr9t9vsN3mCqAm7N7SOjdE0NqQZTrTrc1ztCrJ4PC3VWDcQnF+FbvLhzfhYmmicMfKuF04skQ+eI6LFtBms0xhNXH4v2MVWIHhELCDiGvoqHWE6rWwadUHTJb5dQuE16ojaEjOt0OEX0ErDBk6IF7YnqjgYTGcLw3wpwOj2WqqFTNE4qnOViJWCaR0VXnKKKr/wAKTfJMlTEjVsolZXNoAIzRuBmEHWwaGnJzRRbTZ8PnCLZaGn0WS5KrCLM1WK0xD0OS8Jhn0RH+nZ/VeC1eC1eEFyflYHWsTkAuZ/yoZaf2Xij7hTtW/YLnb+Vzs+VLsvRybaEV6SjhENu2kNwN8yfbFoMcrf4p1o9pwikTQIl1nXQkXVXCGhYiYJ8rl+4tGTlAR5nR/IthQVS4j4WztHEnQlgVLX5YtFUwvFHyqWjflcy2r3WZZ5SjifiAyXpdha8hvRCGzwprA0kzWEABT3XCQPcKpCwsIy6IY/xRTjeD7ysAM+u5ov07LaHoVithx9JyvoB8LIfCyU7Ie+60sPG3MXHEeEZIVr7qoaUDQP6obR0x0CptPhBhDhN9Ci9xDoya0IutHusmt/iFBIXDakey8QlZ31c0fdTuY2wAeqxC0OI5yoxk+l+MWpb6XfrAV0WOyAprcOAn23ch8LLcxPxfK4XfKzCqVkhxqhquMrNZrNTzegWM0U6uP00rJThF2ar3WfdSPo5mAFDcuqwu3JYYN3EQAuZRKw4e+e3QhYYWI825hGt0aLJZd5kslxKBu5IuN2hnvc+4gIzdzQVhNfX6CqpuZX0VR39d83D6ckG7F/kafT0/xf8A/8QAKhABAAIBAwMDBAIDAQAAAAAAAQARITFBURBhcSCBkTChscHR8EBQ4fH/2gAIAQEAAT8h/wAiv8iof60/24fSvm0naH+R2aUdppQR8PVerRTWafXUA+lrvlRRsJt2f+xcK5o6rMHN0LZb9Fagaq0EyEPYezzAGwavL67l+jb1sex1ucH2lNKQvo1+4DXUq1qO8JQuOPmZPNWNPbllNUa93l+m+Nx3niXqZkfLEtIvwwS75Bt1qXL9H43mjIKjs5hxLIxhtWEwAKAMH07uBuNpYwtVXCGs7xLQcmZjdZmpBJoLnaFJ1hXpOcFSE2YaxxFP5/qcz+iXToFmTpK7yt+RC1GWVyrPaHXZjILVX8kNe0A+l+w+psg/PfTViLG0CD8QCO8wRgYDiC7aYcs8evd6Brtt3jBCFweZUJVb7fUI7W74YEcS8LFVhJzjk4dy8SodQh3BdmyEXRzd7TFspRGYByYeUzF14jPPEuXLly5cuX1voJWze2sQ9Q9zg+amaprCQ2IEoCSuY63Ir4MUahd+BmIVIZuUJECnsXWXLxBDX26+XmU6Xz/7B6iXK05n8hGGqPmbfyP/ACbwnQ2SxsPmU6p4Z+gVlGn8XL6L7f8AJtJ7Q/KUi17sMo5YxypaCW4JWPpGGnmOw2v8iFmYsfKLYjkdZeDFDDg0nxh+YLPL+3rAovb+8vPUvzA65saxNfuiJo4RLXF13F2lmFXuvaKkPabIc4ZYEFrumMtNnH9E5U7Xd/MEFXvNB7FuMe0c02mB3mVhstCBhU0/pNAtCaNTXRMJW6svWpfUs6vbSB84N+NZSDuiCsttdle72mPNFBy4gHLLvAbbzAzStbf3M1+rqfeaZZioic9GqZcBKxw6mYehtWyxgJ6A0l8UrYI2w+TpmbVfCc8e01A7G4Am8NmW9XzxHqqqOF68w02AWwwaR0UXXYymRduZhOHzFc3L8ydyHa660DiXiJbc7qbQ68TJeQN5lUp3IxjxlldJXAGhvzGQDjQla/mO1nlbX8SpaWtplxI3wfuMXhYM1gea6UwzwhqIoFb6IX3dfboerh4s/c7Ku7jYbcZBKfAP4hEIvg/xCqWcYJrnusF0L2ilrPtY/UeCdwsCgzQq1kzPaNZXE8vB0QuFCtP2R/SzWKmP5lZq66aINj8zdH3JY2L3b/EUWNVZT7SgKpYEv6iCaNkipsd5QBFfMK7/ADLhKuriEWio7PmWrwcAzdF4xALHlbKs4Z1wsK+kLuRnGtlWvBMmobbEsBvLa4Ra2bGWPmIdgfeWyhbQxMealG6ViFVJbmACj/e8MOBdG1M5KoWzlPfQP2TdqXYgVMbhBCOIfJjqCjWwEDunsDxEaxiLGc+YGofiC6/tph0fEbq08FzOOphG5asjVVFSkYRPapngwWxcu0vBdTFabfWF2AxjqRcMdpCHIuhjHRaq1shjR+YLyRaBfeDFw3B95hI3XGcc98n5iGQXeCM9ykB5sGtyXMwjvSacC9j0UgA0epLcxoY1vwIuGsVEyJgECgfuUxBo3SqX0bqmOle5Fwz9XSSp7y5TclPW+DjyysaQ2D7yoIZQUVASNWtGaMDyJZG1bMueKBkF4emONKdQe8fmlpZKmGwDaCjdRVzyl+r5RZctlwODPeW5l5eWnej0a07kyste7Cuz4iOp+IbRXiF0fvmcLfaBgGB59RCuYRi1grWpmq3zACxuMsW4ipmHSFCF5eEAxPoFO6HfPOX6g+h0Hr241UgcciUSu9EJR2iYsUkpMCjTWLHiCiA7Cd0TDl5ljaUzMJfQMGEBfQvMZ3mqnuQnZf4ej09wdMswMrA4BbDfiY6VK6VAgQ6e2d5Ei4qWqn5s+itCbuWLqhlWkq2LKEXLOty5cvqlICFMPQZcHouVl00QXXQwuRGdtTZDAmnruX12bcwwxnnJGlohhFSuj0Ybtvo6KU/mKNxw06XL6X6UuLMxjxEbIUS+eOldNT7zpWodT1r8S0So9Fsy1mBrWLawbfpjeawPRVbNOteu6hB2RJpKbpkjKiWOgWj0pKSXuUpKCg6bJfRcuX1GX0CxLzOdyKnhMtou0sa9L5JmoXcg2sE0PQOcoy+lstCp7dIO81QWXhJAJh0Zhme2lG0EaxxLeickGmHRljeW3gYGMiJWUqDT0rLS24nU3GkrAgLhBQ5orOopHhhHWKMs/9oADAMBAAIAAwAAABASIMVBgAVIggAJsGy6fNBiyj4Y5ptsnyTbFtvCz9pNNPGuqMCNo42YQIEExL6CRYMEGT8YCBzUGdVEHKQHraFgCRaW/wDNpnycuGNdceiyLtY4mcgOiOu29EEGuHlAnRrvBwEb0uqOJE43dRwqzkz2egbGwwUOslkwzPIcsSwSNhRUkWEw1v62L+JMcNPr2AmjywACL2YgqfCuq0/Cz+/jqnaGEcefx1OE4WV4cia8oyMQ8U8lMsIgsWO//8QAHREAAwACAwEBAAAAAAAAAAAAAAERECEgMVFBMP/aAAgBAwEBPxBc1+a/BIhCcITMI8QhCYQhCEJkvMQmYQhMwSNeZGhNUhCEIQb2JLs6VO48HoK5+AEVawVlRxOosomXwd8GnZFXhBRoo6jcWhEUOTSFpEsbUKcC6hquh+Q9qiTHo2Gy+i7hlYQVKEyMkG6xMadEsQVNWsKSdaxKa3svsSIaTUmSLsaJEyxoR7dxN2w294KG1dcCJhIQvQkXwVG3IpKLNtFFEf038E3ME6JsbQ4LKEhtzEIQgmkJBlpkEt46D4xkZcREF0PMJiix8T5k1yH+A//EAB4RAAMBAQADAQEBAAAAAAAAAAABERAhIDFBMFFh/9oACAECAQE/EPwf5PaPLlKXwo8u0pSlHxtGUpcdGmMo/RWlC6rOhZS5zhwLrp0UmC+CpFGXTp0aFzo0Khvgvd8QpR+8Uo8UY3hhO7WUKvQfs9qhB/Q1cMLofRRZwoyLzYIjmNwtyoqx5BNoX9YkbbejnwfUEgxiqXWPwCf4cfBQoKFzOCBKesbMOHCLwvBFnCFFE4bIRBUylKUqIyEEGxKimUpcjwmijeLKUuVFHlekUospdpk/Fii0nkmn/8QAJhABAAICAgICAgIDAQAAAAAAAQARITFBURBhcYGRobHBINHw4f/aAAgBAQABPxDweDX+J4P8jfk14NeVQJUNf4G/J4NeKleKh4JQyvDDwHipXivFQJUJUrxUrxUDuVK8ceArxUJUqVA8HioeK8VAzKglSoVUqVDLKhiV4rzUCoFwxKlSpXgPBAuVK8VKrwF+K8VApm5UCV4rxmVCVA81KlngPAY8V4qV1L8DfCB7N8RCCVTnDfgMeK8G5UJXgPJhh5NeefBszFrbCQytzUeUao/D74+vBr/AgAyf4TDfk8BC0HvMPJrzz5Du/sDX4afqAmGh09Z6tZ8y6HhnL0DxVZuAzNHW4FtX6iIo7J/LlggsaQei6lY9npH/AFNo2ptfvweTUuoeUhnWfias6ur9zmvJvwbOtJ6ixUpjK35UfuXT0sbc6a5cGnnUL5mcCXrzLchY3eC3HuH3Uh0/D9mofTOTtN9iw35PBr/Ac8U7vqA+qD5uBejEvV1kHSBKE5R22G1rFxXpUFJYPmYeA58heEtci8c45jURYWjAr6YsPtTBr6p1QtXvZiUhnAA9EqG/BL8GvF+HPAhZtt/Ep6IEFjWWXZEyZxhjcAsIVY6kJuM7G4jJYFaxpL6xBJXdgs7L3DZCXPuskrndJk1KfdVNat1CRLa/LF/QQxLhuX4PA/4VRxeHLBSZcWf99S27qvcugnIGo2dXu2sS82b2g/GU/MunLN0XKR9RXnZipcJeTeMnCR4FO+1/In8VEYLeinvEoIwVXoGXnxcJcGpfi/Fy21LB7I/QfuXRjHXqK8gK5zKKcge5qpOkLtH81MXGMwG1V9/qBRMNPJuMY1SJ6Zg5lwzDEepTJTCOyvUSXhBnJM/khigpQ1Qv9+L8DDEuGZcuXLmJy595j8JEMc8nuC1NlOYZQwYgoYo0vrHxDJYqMeAChgzKA1gouBzr1iKCjyip+TcPydMB03LYrV5B7uOogpwsP/EaDsTkPzzK6RwxgYYzbLC2ZleUPuA7/crA3mse/AtMIMvwuKgIR/JSndEl3GvmUJdIWrx7blVdY7bq36i1x4YU2iJHJpkW20V/ZNdWx0Fv1REywUgayt8QlCxGmUPVal73duXYUnWY+VQ5Vkvp1Ag0hWzxDsCsXKtreYa0/wDbifph/wDkpH0qKek5slT+CIaofwlXT1a/9MP+GH5h/wB0PqaXb0oftGVjP1D/ALmeGP0e9zIIYbq2kjuNCnKUn9MAvw3aQZgIXxSv8XKN2Iv0f+yWSW7IOyCu8DX+CATBIHSMWMyI3ofUAs5L8mJc6D+IMN6h7ePz/cKYvEpSSoVxhPc7rmPMHW38zcW1eWqOWAiW1MVH4jixHSNPq63CEMEwbVAtddYleJbjRl+6qUt1UOMD8x6hdbNH3OdTEKNn3uYnWIotw22VL6i1l282Y3BCipGSWhRzahznsOD76iAbC4lVV25rqG3MRWFkeviCur66Mct/MICcbEf7V7ghVYEpzTpqFMewB7H7lg2lxHBUByqDApdpbLOHlsg7m7CgEPbvqc3VboZs7UcmYEolD8gcGV/UE4ubQVrDspUiXl23DrBwRa6lX2IrB2HTqLvOkKi3pemJetOKgvvC7GOIgruagHj22wp4akoviWsDVT8BmYYyWD9LnBBXAfoYpCBtFdrgibPAo/mGxbGKaEFBQIhVs1BrbVCoYrPUGI40OBqpS3BgF9lwUjdg5be4fSpbgAbN6lmQ2Jw5hzC5q1qIuyH3/uYsKtqcFEDqLQa8BadkDjGVt7gxY52EBmfsodOLYW6TiLZmtcnpllt3zKfRULQeUNkDIQVQ9Ff5lSnC/dWRunxDrAWE/T/CKLUlTl81iG04NeTdNFhBjiqVjdUX+Suos14DB3m7/UOlfVaPshiMBuGIXw1mWaer/wCkSLT+T/2Jf936ilV+I/7iREraYdFtsuA2+RGbJMKx8lJYIdJ/YV/UCVpV0n+iYILiy/qU5FqApirNIF6v1dxZbfwGYPzAryVXA85iHAPqGrsbZbeqMsKUJysHNv7I/FtkKAdFZwOIWOYw1Zsbz+IgC2um/lhhRL7yfqGKZ7xXaBmJzVNxbsY+KgZZbSfOFX3AboByDpRcx0HPYk/gIWAGjp9wJXC+oGmdIVbhE/uPyjmUfUb9WRDCBz+3CRAtrtSX6iStHACJ00uQJG30oN/zKAObBH5ghoDQbNAZh0hYGwesRpxTYNn3M8XUvGTdAbhRDqWQ5RfxLD8hS2NZ0IWX0ypT1Yqgdo3KBm0HyWMsIkDDQv7QutMrDgjS9trKAWqfiVhQ0OEdVHLE4pVKutai4IfbcRaHwVMBT9kIKi7Mv43KuOoPkbgk66BXXANRgEnuq/qUdpdmQ/1HgPoCBsd/B+poNfRSMQzT7Vxof3CgoFBxqV1DBEmURG919Ra5zFyNa+O4EC9qA4O+YLAIWyXNPMVlScBr5qcc8llH2wMABLUvYO/cGGRtbVwVnqYQBQ1/lg49ExPtDEHJvqC8nyxGE4ZV9wS4xFo6tbFUaFKj1/b+ojAGFMH1RhzbxQv7shIe6Av4JyvmEsVZAvISkembc1pl36c0Hmqz+5VygUUjd0R6OEhZTwJxHTZzQpPUpWRUKrftCMsCANFcymG0C8uqmp7kBXsgC3pZW4zFwW+kJkYmEfZbK8MpBpD8za0H5LYpgE5HmLL4S6a/E4AHRiLberLAAIU3doNi6JaY16Kl3gMYQQpHqXCTGK7iiHAEfctwAMl1ACDZGZIjAHhP9gmxYd0uZuDgbf8AyJllcAPVzMwCAqjBDDZgm385nymeL8C93FMbMMoyZIXZLu/zBTUZr2mXdxLcTNsaNvzO1Ms51/cA1T5ifvUIfUIUCO6GYMBDWH8SyIsutf4gQfGEPKHVDNpOYIr0gO7gJRge4B5I+k+5R4RBU1OiEBXdSdBaaYgwASymJ0xOmNu0DxLy8HMxgR5IdcC4IhiA9koep6SYdwzbCrCJ8qWgo3cHRiW6i1t8uplil/Gm+EDlhl7+IQriMAIlZgIkN1wwlhiFNqmbEbag5Z+WVoNtRWRiYR/HxADMInphBTljsbtmU1Z/gbzMPSuJWSeADDBlpK9R844ZlatMdyuLdW9S1tSrb3KFEVL9Eq0s0bgUsaYAOAPipUv1LmagX4Lwxu4kjlTQJqPVKbt6jpQ8BuZKUtrtcE6f3BHMwzcvFNF7iaBOiwmzwsOjqWBytSlBIVYSImoGtQTiAMqnDiEA6geoV4hhglzidqIWLEpFPq4I5H7lBiHJntZbuDhMI21AlSVV7uN2K5gwnXtqV7OxsqN3aLINwxATklvqX8RQiHuNdXFDzHOdDEsiibDDMuKdysqyYxKoqwgiWhZDUs7auJaGZbGLNcNRmwMZ4mIAqoKcwvLy3uWlstiyyDpAe40mHDcNKMM4mrBo9Rql+0o0V4q6xLhQY9w1j6eBRspuziNNtwcwblPH35CF9ZnqSnZHWZbiUjAm7j7cIfkQo4s4nLrTcUFojCAm0WJlBumAvA0YCENztcMQS5Y+BCDbCzczZgiXYl6wgbC/MM1MTBZNUS1kgJOBItSqTRheZaluO2c2/Ex/A6gOYM4Z8LlvH4wctYPgKMrrNz0kaSFfBcQMbTjNkVebSsAZEYVpqUXFUIMTOEVEzSZaSS9QXSoEwwdZSWPNSnWYcxGiy1hd7QEtxE6VC8oBhFOZbOXuCXgQz1JRZhEsa8GAimGoqB4BcGhixA8DEQc3Fc1LW7gsweg3Lo024ah5Q0wDmHMZ3IicQl3RmGShHATpwWJEjhZUcytCWLOYRDCktgtnuAFhmYO5vRP/2Q=='; diff --git a/packages/ai/src/methods/chrome-adapter.ts b/packages/ai/src/methods/chrome-adapter.ts new file mode 100644 index 00000000000..4dea4170c0d --- /dev/null +++ b/packages/ai/src/methods/chrome-adapter.ts @@ -0,0 +1,372 @@ +/** + * @license + * Copyright 2025 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 { AIError } from '../errors'; +import { logger } from '../logger'; +import { + CountTokensRequest, + GenerateContentRequest, + InferenceMode, + Part, + AIErrorCode, + OnDeviceParams, + Content, + Role +} from '../types'; +import { ChromeAdapter } from '../types/chrome-adapter'; +import { + Availability, + LanguageModel, + LanguageModelMessage, + LanguageModelMessageContent, + LanguageModelMessageRole +} from '../types/language-model'; + +/** + * Defines an inference "backend" that uses Chrome's on-device model, + * and encapsulates logic for detecting when on-device inference is + * possible. + */ +export class ChromeAdapterImpl implements ChromeAdapter { + // Visible for testing + static SUPPORTED_MIME_TYPES = ['image/jpeg', 'image/png']; + private isDownloading = false; + private downloadPromise: Promise | undefined; + private oldSession: LanguageModel | undefined; + constructor( + private languageModelProvider: LanguageModel, + private mode: InferenceMode, + private onDeviceParams: OnDeviceParams = { + createOptions: { + // Defaults to support image inputs for convenience. + expectedInputs: [{ type: 'image' }] + } + } + ) {} + + /** + * Checks if a given request can be made on-device. + * + *
        Encapsulates a few concerns: + *
      1. the mode
      2. + *
      3. API existence
      4. + *
      5. prompt formatting
      6. + *
      7. model availability, including triggering download if necessary
      8. + *
      + * + *

      Pros: callers needn't be concerned with details of on-device availability.

      + *

      Cons: this method spans a few concerns and splits request validation from usage. + * If instance variables weren't already part of the API, we could consider a better + * separation of concerns.

      + */ + async isAvailable(request: GenerateContentRequest): Promise { + if (!this.mode) { + logger.debug( + `On-device inference unavailable because mode is undefined.` + ); + return false; + } + if (this.mode === InferenceMode.ONLY_IN_CLOUD) { + logger.debug( + `On-device inference unavailable because mode is "only_in_cloud".` + ); + return false; + } + + // Triggers out-of-band download so model will eventually become available. + const availability = await this.downloadIfAvailable(); + + if (this.mode === InferenceMode.ONLY_ON_DEVICE) { + // If it will never be available due to API inavailability, throw. + if (availability === Availability.UNAVAILABLE) { + throw new AIError( + AIErrorCode.API_NOT_ENABLED, + 'Local LanguageModel API not available in this environment.' + ); + } else if ( + availability === Availability.DOWNLOADABLE || + availability === Availability.DOWNLOADING + ) { + // TODO(chholland): Better user experience during download - progress? + logger.debug(`Waiting for download of LanguageModel to complete.`); + await this.downloadPromise; + return true; + } + return true; + } + + // Applies prefer_on_device logic. + if (availability !== Availability.AVAILABLE) { + logger.debug( + `On-device inference unavailable because availability is "${availability}".` + ); + return false; + } + if (!ChromeAdapterImpl.isOnDeviceRequest(request)) { + logger.debug( + `On-device inference unavailable because request is incompatible.` + ); + return false; + } + + return true; + } + + /** + * Generates content on device. + * + *

      This is comparable to {@link GenerativeModel.generateContent} for generating content in + * Cloud.

      + * @param request - a standard Firebase AI {@link GenerateContentRequest} + * @returns {@link Response}, so we can reuse common response formatting. + */ + async generateContent(request: GenerateContentRequest): Promise { + const session = await this.createSession(); + const contents = await Promise.all( + request.contents.map(ChromeAdapterImpl.toLanguageModelMessage) + ); + const text = await session.prompt( + contents, + this.onDeviceParams.promptOptions + ); + return ChromeAdapterImpl.toResponse(text); + } + + /** + * Generates content stream on device. + * + *

      This is comparable to {@link GenerativeModel.generateContentStream} for generating content in + * Cloud.

      + * @param request - a standard Firebase AI {@link GenerateContentRequest} + * @returns {@link Response}, so we can reuse common response formatting. + */ + async generateContentStream( + request: GenerateContentRequest + ): Promise { + const session = await this.createSession(); + const contents = await Promise.all( + request.contents.map(ChromeAdapterImpl.toLanguageModelMessage) + ); + const stream = session.promptStreaming( + contents, + this.onDeviceParams.promptOptions + ); + return ChromeAdapterImpl.toStreamResponse(stream); + } + + async countTokens(_request: CountTokensRequest): Promise { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'Count Tokens is not yet available for on-device model.' + ); + } + + /** + * Asserts inference for the given request can be performed by an on-device model. + */ + private static isOnDeviceRequest(request: GenerateContentRequest): boolean { + // Returns false if the prompt is empty. + if (request.contents.length === 0) { + logger.debug('Empty prompt rejected for on-device inference.'); + return false; + } + + for (const content of request.contents) { + if (content.role === 'function') { + logger.debug(`"Function" role rejected for on-device inference.`); + return false; + } + + // Returns false if request contains an image with an unsupported mime type. + for (const part of content.parts) { + if ( + part.inlineData && + ChromeAdapterImpl.SUPPORTED_MIME_TYPES.indexOf( + part.inlineData.mimeType + ) === -1 + ) { + logger.debug( + `Unsupported mime type "${part.inlineData.mimeType}" rejected for on-device inference.` + ); + return false; + } + } + } + + return true; + } + + /** + * Encapsulates logic to get availability and download a model if one is downloadable. + */ + private async downloadIfAvailable(): Promise { + const availability = await this.languageModelProvider?.availability( + this.onDeviceParams.createOptions + ); + + if (availability === Availability.DOWNLOADABLE) { + this.download(); + } + + return availability; + } + + /** + * Triggers out-of-band download of an on-device model. + * + *

      Chrome only downloads models as needed. Chrome knows a model is needed when code calls + * LanguageModel.create.

      + * + *

      Since Chrome manages the download, the SDK can only avoid redundant download requests by + * tracking if a download has previously been requested.

      + */ + private download(): void { + if (this.isDownloading) { + return; + } + this.isDownloading = true; + this.downloadPromise = this.languageModelProvider + ?.create(this.onDeviceParams.createOptions) + .finally(() => { + this.isDownloading = false; + }); + } + + /** + * Converts Firebase AI {@link Content} object to a Chrome {@link LanguageModelMessage} object. + */ + private static async toLanguageModelMessage( + content: Content + ): Promise { + const languageModelMessageContents = await Promise.all( + content.parts.map(ChromeAdapterImpl.toLanguageModelMessageContent) + ); + return { + role: ChromeAdapterImpl.toLanguageModelMessageRole(content.role), + content: languageModelMessageContents + }; + } + + /** + * Converts a Firebase AI Part object to a Chrome LanguageModelMessageContent object. + */ + private static async toLanguageModelMessageContent( + part: Part + ): Promise { + if (part.text) { + return { + type: 'text', + value: part.text + }; + } else if (part.inlineData) { + const formattedImageContent = await fetch( + `data:${part.inlineData.mimeType};base64,${part.inlineData.data}` + ); + const imageBlob = await formattedImageContent.blob(); + const imageBitmap = await createImageBitmap(imageBlob); + return { + type: 'image', + value: imageBitmap + }; + } + throw new AIError( + AIErrorCode.REQUEST_ERROR, + `Processing of this Part type is not currently supported.` + ); + } + + /** + * Converts a Firebase AI {@link Role} string to a {@link LanguageModelMessageRole} string. + */ + private static toLanguageModelMessageRole( + role: Role + ): LanguageModelMessageRole { + // Assumes 'function' rule has been filtered by isOnDeviceRequest + return role === 'model' ? 'assistant' : 'user'; + } + + /** + * Abstracts Chrome session creation. + * + *

      Chrome uses a multi-turn session for all inference. Firebase AI uses single-turn for all + * inference. To map the Firebase AI API to Chrome's API, the SDK creates a new session for all + * inference.

      + * + *

      Chrome will remove a model from memory if it's no longer in use, so this method ensures a + * new session is created before an old session is destroyed.

      + */ + private async createSession(): Promise { + if (!this.languageModelProvider) { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'Chrome AI requested for unsupported browser version.' + ); + } + const newSession = await this.languageModelProvider.create( + this.onDeviceParams.createOptions + ); + if (this.oldSession) { + this.oldSession.destroy(); + } + // Holds session reference, so model isn't unloaded from memory. + this.oldSession = newSession; + return newSession; + } + + /** + * Formats string returned by Chrome as a {@link Response} returned by Firebase AI. + */ + private static toResponse(text: string): Response { + return { + json: async () => ({ + candidates: [ + { + content: { + parts: [{ text }] + } + } + ] + }) + } as Response; + } + + /** + * Formats string stream returned by Chrome as SSE returned by Firebase AI. + */ + private static toStreamResponse(stream: ReadableStream): Response { + const encoder = new TextEncoder(); + return { + body: stream.pipeThrough( + new TransformStream({ + transform(chunk, controller) { + const json = JSON.stringify({ + candidates: [ + { + content: { + role: 'model', + parts: [{ text: chunk }] + } + } + ] + }); + controller.enqueue(encoder.encode(`data: ${json}\n\n`)); + } + }) + ) + } as Response; + } +} diff --git a/packages/ai/src/methods/count-tokens.test.ts b/packages/ai/src/methods/count-tokens.test.ts index 7e04ddb3561..56985b4d54e 100644 --- a/packages/ai/src/methods/count-tokens.test.ts +++ b/packages/ai/src/methods/count-tokens.test.ts @@ -22,11 +22,12 @@ import chaiAsPromised from 'chai-as-promised'; import { getMockResponse } from '../../test-utils/mock-response'; import * as request from '../requests/request'; import { countTokens } from './count-tokens'; -import { CountTokensRequest } from '../types'; +import { CountTokensRequest, InferenceMode } from '../types'; import { ApiSettings } from '../types/internal'; import { Task } from '../requests/request'; import { mapCountTokensRequest } from '../googleai-mappers'; import { GoogleAIBackend, VertexAIBackend } from '../backend'; +import { ChromeAdapterImpl } from './chrome-adapter'; use(sinonChai); use(chaiAsPromised); @@ -51,6 +52,12 @@ const fakeRequestParams: CountTokensRequest = { contents: [{ parts: [{ text: 'hello' }], role: 'user' }] }; +const fakeChromeAdapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.PREFER_ON_DEVICE +); + describe('countTokens()', () => { afterEach(() => { restore(); @@ -66,7 +73,8 @@ describe('countTokens()', () => { const result = await countTokens( fakeApiSettings, 'model', - fakeRequestParams + fakeRequestParams, + fakeChromeAdapter ); expect(result.totalTokens).to.equal(6); expect(result.totalBillableCharacters).to.equal(16); @@ -92,7 +100,8 @@ describe('countTokens()', () => { const result = await countTokens( fakeApiSettings, 'model', - fakeRequestParams + fakeRequestParams, + fakeChromeAdapter ); expect(result.totalTokens).to.equal(1837); expect(result.totalBillableCharacters).to.equal(117); @@ -120,7 +129,8 @@ describe('countTokens()', () => { const result = await countTokens( fakeApiSettings, 'model', - fakeRequestParams + fakeRequestParams, + fakeChromeAdapter ); expect(result.totalTokens).to.equal(258); expect(result).to.not.have.property('totalBillableCharacters'); @@ -146,7 +156,12 @@ describe('countTokens()', () => { json: mockResponse.json } as Response); await expect( - countTokens(fakeApiSettings, 'model', fakeRequestParams) + countTokens( + fakeApiSettings, + 'model', + fakeRequestParams, + fakeChromeAdapter + ) ).to.be.rejectedWith(/404.*not found/); expect(mockFetch).to.be.called; }); @@ -164,7 +179,12 @@ describe('countTokens()', () => { it('maps request to GoogleAI format', async () => { makeRequestStub.resolves({ ok: true, json: () => {} } as Response); // Unused - await countTokens(fakeGoogleAIApiSettings, 'model', fakeRequestParams); + await countTokens( + fakeGoogleAIApiSettings, + 'model', + fakeRequestParams, + fakeChromeAdapter + ); expect(makeRequestStub).to.be.calledWith( 'model', @@ -176,4 +196,24 @@ describe('countTokens()', () => { ); }); }); + it('on-device', async () => { + const chromeAdapter = fakeChromeAdapter; + const isAvailableStub = stub(chromeAdapter, 'isAvailable').resolves(true); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-total-tokens.json' + ); + const countTokensStub = stub(chromeAdapter, 'countTokens').resolves( + mockResponse as Response + ); + const result = await countTokens( + fakeApiSettings, + 'model', + fakeRequestParams, + chromeAdapter + ); + expect(result.totalTokens).eq(6); + expect(isAvailableStub).to.be.called; + expect(countTokensStub).to.be.calledWith(fakeRequestParams); + }); }); diff --git a/packages/ai/src/methods/count-tokens.ts b/packages/ai/src/methods/count-tokens.ts index b1e60e3a182..00dde84ab48 100644 --- a/packages/ai/src/methods/count-tokens.ts +++ b/packages/ai/src/methods/count-tokens.ts @@ -24,8 +24,9 @@ import { Task, makeRequest } from '../requests/request'; import { ApiSettings } from '../types/internal'; import * as GoogleAIMapper from '../googleai-mappers'; import { BackendType } from '../public-types'; +import { ChromeAdapter } from '../types/chrome-adapter'; -export async function countTokens( +export async function countTokensOnCloud( apiSettings: ApiSettings, model: string, params: CountTokensRequest, @@ -48,3 +49,17 @@ export async function countTokens( ); return response.json(); } + +export async function countTokens( + apiSettings: ApiSettings, + model: string, + params: CountTokensRequest, + chromeAdapter?: ChromeAdapter, + requestOptions?: RequestOptions +): Promise { + if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { + return (await chromeAdapter.countTokens(params)).json(); + } + + return countTokensOnCloud(apiSettings, model, params, requestOptions); +} diff --git a/packages/ai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts index a5e4c0d1b57..19c0761949a 100644 --- a/packages/ai/src/methods/generate-content.test.ts +++ b/packages/ai/src/methods/generate-content.test.ts @@ -27,17 +27,25 @@ import { GenerateContentRequest, HarmBlockMethod, HarmBlockThreshold, - HarmCategory + HarmCategory, + InferenceMode } from '../types'; import { ApiSettings } from '../types/internal'; import { Task } from '../requests/request'; import { AIError } from '../api'; import { mapGenerateContentRequest } from '../googleai-mappers'; import { GoogleAIBackend, VertexAIBackend } from '../backend'; +import { ChromeAdapterImpl } from './chrome-adapter'; use(sinonChai); use(chaiAsPromised); +const fakeChromeAdapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.PREFER_ON_DEVICE +); + const fakeApiSettings: ApiSettings = { apiKey: 'key', project: 'my-project', @@ -422,4 +430,25 @@ describe('generateContent()', () => { ); }); }); + // TODO: define a similar test for generateContentStream + it('on-device', async () => { + const chromeAdapter = fakeChromeAdapter; + const isAvailableStub = stub(chromeAdapter, 'isAvailable').resolves(true); + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-basic-reply-short.json' + ); + const generateContentStub = stub(chromeAdapter, 'generateContent').resolves( + mockResponse as Response + ); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams, + chromeAdapter + ); + expect(result.response.text()).to.include('Mountain View, California'); + expect(isAvailableStub).to.be.called; + expect(generateContentStub).to.be.calledWith(fakeRequestParams); + }); }); diff --git a/packages/ai/src/methods/generate-content.ts b/packages/ai/src/methods/generate-content.ts index 5f7902f5954..2c1c383641f 100644 --- a/packages/ai/src/methods/generate-content.ts +++ b/packages/ai/src/methods/generate-content.ts @@ -28,17 +28,18 @@ import { processStream } from '../requests/stream-reader'; import { ApiSettings } from '../types/internal'; import * as GoogleAIMapper from '../googleai-mappers'; import { BackendType } from '../public-types'; +import { ChromeAdapter } from '../types/chrome-adapter'; -export async function generateContentStream( +async function generateContentStreamOnCloud( apiSettings: ApiSettings, model: string, params: GenerateContentRequest, requestOptions?: RequestOptions -): Promise { +): Promise { if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { params = GoogleAIMapper.mapGenerateContentRequest(params); } - const response = await makeRequest( + return makeRequest( model, Task.STREAM_GENERATE_CONTENT, apiSettings, @@ -46,19 +47,39 @@ export async function generateContentStream( JSON.stringify(params), requestOptions ); +} + +export async function generateContentStream( + apiSettings: ApiSettings, + model: string, + params: GenerateContentRequest, + chromeAdapter?: ChromeAdapter, + requestOptions?: RequestOptions +): Promise { + let response; + if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { + response = await chromeAdapter.generateContentStream(params); + } else { + response = await generateContentStreamOnCloud( + apiSettings, + model, + params, + requestOptions + ); + } return processStream(response, apiSettings); // TODO: Map streaming responses } -export async function generateContent( +async function generateContentOnCloud( apiSettings: ApiSettings, model: string, params: GenerateContentRequest, requestOptions?: RequestOptions -): Promise { +): Promise { if (apiSettings.backend.backendType === BackendType.GOOGLE_AI) { params = GoogleAIMapper.mapGenerateContentRequest(params); } - const response = await makeRequest( + return makeRequest( model, Task.GENERATE_CONTENT, apiSettings, @@ -66,6 +87,26 @@ export async function generateContent( JSON.stringify(params), requestOptions ); +} + +export async function generateContent( + apiSettings: ApiSettings, + model: string, + params: GenerateContentRequest, + chromeAdapter?: ChromeAdapter, + requestOptions?: RequestOptions +): Promise { + let response; + if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { + response = await chromeAdapter.generateContent(params); + } else { + response = await generateContentOnCloud( + apiSettings, + model, + params, + requestOptions + ); + } const generateContentResponse = await processGenerateContentResponse( response, apiSettings diff --git a/packages/ai/src/models/generative-model.test.ts b/packages/ai/src/models/generative-model.test.ts index d055b82b1be..68f1565b26a 100644 --- a/packages/ai/src/models/generative-model.test.ts +++ b/packages/ai/src/models/generative-model.test.ts @@ -16,12 +16,13 @@ */ import { use, expect } from 'chai'; import { GenerativeModel } from './generative-model'; -import { FunctionCallingMode, AI } from '../public-types'; +import { FunctionCallingMode, AI, InferenceMode } from '../public-types'; import * as request from '../requests/request'; import { match, restore, stub } from 'sinon'; import { getMockResponse } from '../../test-utils/mock-response'; import sinonChai from 'sinon-chai'; import { VertexAIBackend } from '../backend'; +import { ChromeAdapterImpl } from '../methods/chrome-adapter'; use(sinonChai); @@ -39,23 +40,36 @@ const fakeAI: AI = { location: 'us-central1' }; +const fakeChromeAdapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.PREFER_ON_DEVICE +); + describe('GenerativeModel', () => { it('passes params through to generateContent', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - tools: [ - { - functionDeclarations: [ - { - name: 'myfunc', - description: 'mydesc' - } - ] - } - ], - toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + tools: [ + { + functionDeclarations: [ + { + name: 'myfunc', + description: 'mydesc' + } + ] + } + ], + toolConfig: { + functionCallingConfig: { mode: FunctionCallingMode.NONE } + }, + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } + }, + {}, + fakeChromeAdapter + ); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE @@ -86,10 +100,15 @@ describe('GenerativeModel', () => { restore(); }); it('passes text-only systemInstruction through to generateContent', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - systemInstruction: 'be friendly' - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + systemInstruction: 'be friendly' + }, + {}, + fakeChromeAdapter + ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( 'vertexAI', @@ -112,21 +131,28 @@ describe('GenerativeModel', () => { restore(); }); it('generateContent overrides model values', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - tools: [ - { - functionDeclarations: [ - { - name: 'myfunc', - description: 'mydesc' - } - ] - } - ], - toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + tools: [ + { + functionDeclarations: [ + { + name: 'myfunc', + description: 'mydesc' + } + ] + } + ], + toolConfig: { + functionCallingConfig: { mode: FunctionCallingMode.NONE } + }, + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } + }, + {}, + fakeChromeAdapter + ); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE @@ -168,12 +194,17 @@ describe('GenerativeModel', () => { restore(); }); it('passes base model params through to ChatSession when there are no startChatParams', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - generationConfig: { - topK: 1 - } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + generationConfig: { + topK: 1 + } + }, + {}, + fakeChromeAdapter + ); const chatSession = genModel.startChat(); expect(chatSession.params?.generationConfig).to.deep.equal({ topK: 1 @@ -181,12 +212,17 @@ describe('GenerativeModel', () => { restore(); }); it('overrides base model params with startChatParams', () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - generationConfig: { - topK: 1 - } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + generationConfig: { + topK: 1 + } + }, + {}, + fakeChromeAdapter + ); const chatSession = genModel.startChat({ generationConfig: { topK: 2 @@ -197,17 +233,24 @@ describe('GenerativeModel', () => { }); }); it('passes params through to chat.sendMessage', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - tools: [ - { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } - ], - toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, - generationConfig: { - topK: 1 - } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + tools: [ + { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } + ], + toolConfig: { + functionCallingConfig: { mode: FunctionCallingMode.NONE } + }, + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, + generationConfig: { + topK: 1 + } + }, + {}, + fakeChromeAdapter + ); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE @@ -239,10 +282,15 @@ describe('GenerativeModel', () => { restore(); }); it('passes text-only systemInstruction through to chat.sendMessage', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - systemInstruction: 'be friendly' - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + systemInstruction: 'be friendly' + }, + {}, + fakeChromeAdapter + ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); const mockResponse = getMockResponse( 'vertexAI', @@ -265,17 +313,24 @@ describe('GenerativeModel', () => { restore(); }); it('startChat overrides model values', async () => { - const genModel = new GenerativeModel(fakeAI, { - model: 'my-model', - tools: [ - { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } - ], - toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, - systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, - generationConfig: { - responseMimeType: 'image/jpeg' - } - }); + const genModel = new GenerativeModel( + fakeAI, + { + model: 'my-model', + tools: [ + { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } + ], + toolConfig: { + functionCallingConfig: { mode: FunctionCallingMode.NONE } + }, + systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] }, + generationConfig: { + responseMimeType: 'image/jpeg' + } + }, + {}, + fakeChromeAdapter + ); expect(genModel.tools?.length).to.equal(1); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE @@ -325,7 +380,12 @@ describe('GenerativeModel', () => { restore(); }); it('calls countTokens', async () => { - const genModel = new GenerativeModel(fakeAI, { model: 'my-model' }); + const genModel = new GenerativeModel( + fakeAI, + { model: 'my-model' }, + {}, + fakeChromeAdapter + ); const mockResponse = getMockResponse( 'vertexAI', 'unary-success-total-tokens.json' diff --git a/packages/ai/src/models/generative-model.ts b/packages/ai/src/models/generative-model.ts index b09a9290aa4..ffce645eeb1 100644 --- a/packages/ai/src/models/generative-model.ts +++ b/packages/ai/src/models/generative-model.ts @@ -43,6 +43,7 @@ import { } from '../requests/request-helpers'; import { AI } from '../public-types'; import { AIModel } from './ai-model'; +import { ChromeAdapter } from '../types/chrome-adapter'; /** * Class for generative model APIs. @@ -59,7 +60,8 @@ export class GenerativeModel extends AIModel { constructor( ai: AI, modelParams: ModelParams, - requestOptions?: RequestOptions + requestOptions?: RequestOptions, + private chromeAdapter?: ChromeAdapter ) { super(ai, modelParams.model); this.generationConfig = modelParams.generationConfig || {}; @@ -91,6 +93,7 @@ export class GenerativeModel extends AIModel { systemInstruction: this.systemInstruction, ...formattedParams }, + this.chromeAdapter, this.requestOptions ); } @@ -116,6 +119,7 @@ export class GenerativeModel extends AIModel { systemInstruction: this.systemInstruction, ...formattedParams }, + this.chromeAdapter, this.requestOptions ); } @@ -128,6 +132,7 @@ export class GenerativeModel extends AIModel { return new ChatSession( this._apiSettings, this.model, + this.chromeAdapter, { tools: this.tools, toolConfig: this.toolConfig, @@ -152,6 +157,11 @@ export class GenerativeModel extends AIModel { request: CountTokensRequest | string | Array ): Promise { const formattedParams = formatGenerateContentInput(request); - return countTokens(this._apiSettings, this.model, formattedParams); + return countTokens( + this._apiSettings, + this.model, + formattedParams, + this.chromeAdapter + ); } } diff --git a/packages/ai/src/types/chrome-adapter.ts b/packages/ai/src/types/chrome-adapter.ts new file mode 100644 index 00000000000..77c52eb9391 --- /dev/null +++ b/packages/ai/src/types/chrome-adapter.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2025 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 { CountTokensRequest, GenerateContentRequest } from './requests'; + +/** + * (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, + * and encapsulates logic for detecting when on-device inference is + * possible. + * + * These methods should not be called directly by the user. + * + * @public + */ +export interface ChromeAdapter { + /** + * Checks if the on-device model is capable of handling a given + * request. + * @param request - A potential request to be passed to the model. + */ + isAvailable(request: GenerateContentRequest): Promise; + + /** + * Generates content using on-device inference. + * + *

      This is comparable to {@link GenerativeModel.generateContent} for generating + * content using in-cloud inference.

      + * @param request - a standard Firebase AI {@link GenerateContentRequest} + */ + generateContent(request: GenerateContentRequest): Promise; + + /** + * Generates a content stream using on-device inference. + * + *

      This is comparable to {@link GenerativeModel.generateContentStream} for generating + * a content stream using in-cloud inference.

      + * @param request - a standard Firebase AI {@link GenerateContentRequest} + */ + generateContentStream(request: GenerateContentRequest): Promise; + + /** + * @internal + */ + countTokens(request: CountTokensRequest): Promise; +} diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index b5e4e60ab4f..956be64ba75 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -67,7 +67,7 @@ export const HarmBlockThreshold = { BLOCK_NONE: 'BLOCK_NONE', /** * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding - * to the {@link HarmCategory} will not be present in the response. + * to the {@link (HarmCategory:type)} will not be present in the response. */ OFF: 'OFF' } as const; @@ -270,6 +270,9 @@ export const FunctionCallingMode = { NONE: 'NONE' } as const; +/** + * @public + */ export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode]; @@ -335,3 +338,21 @@ export const ResponseModality = { */ export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; + +/** + * (EXPERIMENTAL) + * Determines whether inference happens on-device or in-cloud. + * @public + */ +export const InferenceMode = { + 'PREFER_ON_DEVICE': 'prefer_on_device', + 'ONLY_ON_DEVICE': 'only_on_device', + 'ONLY_IN_CLOUD': 'only_in_cloud' +} as const; + +/** + * (EXPERIMENTAL) + * Determines whether inference happens on-device or in-cloud. + * @public + */ +export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; diff --git a/packages/ai/src/types/imagen/responses.ts b/packages/ai/src/types/imagen/responses.ts index 4e4496e6b36..be99ab104bf 100644 --- a/packages/ai/src/types/imagen/responses.ts +++ b/packages/ai/src/types/imagen/responses.ts @@ -37,6 +37,7 @@ export interface ImagenInlineImage { * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. * * This feature is not available yet. + * @beta */ export interface ImagenGCSImage { /** diff --git a/packages/ai/src/types/index.ts b/packages/ai/src/types/index.ts index 01f3e7a701a..2dfe73040ae 100644 --- a/packages/ai/src/types/index.ts +++ b/packages/ai/src/types/index.ts @@ -23,3 +23,15 @@ export * from './error'; export * from './schema'; export * from './imagen'; export * from './googleai'; +export { + LanguageModelCreateOptions, + LanguageModelCreateCoreOptions, + LanguageModelExpected, + LanguageModelMessage, + LanguageModelMessageContent, + LanguageModelMessageContentValue, + LanguageModelMessageRole, + LanguageModelMessageType, + LanguageModelPromptOptions +} from './language-model'; +export * from './chrome-adapter'; diff --git a/packages/ai/src/types/language-model.ts b/packages/ai/src/types/language-model.ts new file mode 100644 index 00000000000..4157e6d05e6 --- /dev/null +++ b/packages/ai/src/types/language-model.ts @@ -0,0 +1,143 @@ +/** + * @license + * Copyright 2025 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. + */ +/** + * The subset of the Prompt API + * (see {@link https://github.com/webmachinelearning/prompt-api#full-api-surface-in-web-idl } + * required for hybrid functionality. + * + * @internal + */ +export interface LanguageModel extends EventTarget { + create(options?: LanguageModelCreateOptions): Promise; + availability(options?: LanguageModelCreateCoreOptions): Promise; + prompt( + input: LanguageModelPrompt, + options?: LanguageModelPromptOptions + ): Promise; + promptStreaming( + input: LanguageModelPrompt, + options?: LanguageModelPromptOptions + ): ReadableStream; + measureInputUsage( + input: LanguageModelPrompt, + options?: LanguageModelPromptOptions + ): Promise; + destroy(): undefined; +} + +/** + * @internal + */ +export enum Availability { + 'UNAVAILABLE' = 'unavailable', + 'DOWNLOADABLE' = 'downloadable', + 'DOWNLOADING' = 'downloading', + 'AVAILABLE' = 'available' +} + +/** + * (EXPERIMENTAL) + * Configures the creation of an on-device language model session. + * @public + */ +export interface LanguageModelCreateCoreOptions { + topK?: number; + temperature?: number; + expectedInputs?: LanguageModelExpected[]; +} + +/** + * (EXPERIMENTAL) + * Configures the creation of an on-device language model session. + * @public + */ +export interface LanguageModelCreateOptions + extends LanguageModelCreateCoreOptions { + signal?: AbortSignal; + initialPrompts?: LanguageModelMessage[]; +} + +/** + * (EXPERIMENTAL) + * Options for an on-device language model prompt. + * @public + */ +export interface LanguageModelPromptOptions { + responseConstraint?: object; + // TODO: Restore AbortSignal once the API is defined. +} + +/** + * (EXPERIMENTAL) + * Options for the expected inputs for an on-device language model. + * @public + */ export interface LanguageModelExpected { + type: LanguageModelMessageType; + languages?: string[]; +} + +/** + * (EXPERIMENTAL) + * An on-device language model prompt. + * @public + */ +export type LanguageModelPrompt = LanguageModelMessage[]; + +/** + * (EXPERIMENTAL) + * An on-device language model message. + * @public + */ +export interface LanguageModelMessage { + role: LanguageModelMessageRole; + content: LanguageModelMessageContent[]; +} + +/** + * (EXPERIMENTAL) + * An on-device language model content object. + * @public + */ +export interface LanguageModelMessageContent { + type: LanguageModelMessageType; + value: LanguageModelMessageContentValue; +} + +/** + * (EXPERIMENTAL) + * Allowable roles for on-device language model usage. + * @public + */ +export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; + +/** + * (EXPERIMENTAL) + * Allowable types for on-device language model messages. + * @public + */ +export type LanguageModelMessageType = 'text' | 'image' | 'audio'; + +/** + * (EXPERIMENTAL) + * Content formats that can be provided as on-device message content. + * @public + */ +export type LanguageModelMessageContentValue = + | ImageBitmapSource + | AudioBuffer + | BufferSource + | string; diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index e68f3af161d..b1bde0bc290 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -17,11 +17,16 @@ import { ObjectSchema, TypedSchema } from '../requests/schema-builder'; import { Content, Part } from './content'; +import { + LanguageModelCreateOptions, + LanguageModelPromptOptions +} from './language-model'; import { FunctionCallingMode, HarmBlockMethod, HarmBlockThreshold, HarmCategory, + InferenceMode, ResponseModality } from './enums'; import { ObjectSchemaRequest, SchemaRequest } from './schema'; @@ -271,6 +276,37 @@ export interface FunctionCallingConfig { allowedFunctionNames?: string[]; } +/** + * (EXPERIMENTAL) + * Encapsulates configuration for on-device inference. + * + * @public + */ +export interface OnDeviceParams { + createOptions?: LanguageModelCreateOptions; + promptOptions?: LanguageModelPromptOptions; +} + +/** + * (EXPERIMENTAL) + * Configures hybrid inference. + * @public + */ +export interface HybridParams { + /** + * Specifies on-device or in-cloud inference. Defaults to prefer on-device. + */ + mode: InferenceMode; + /** + * Optional. Specifies advanced params for on-device inference. + */ + onDeviceParams?: OnDeviceParams; + /** + * Optional. Specifies advanced params for in-cloud inference. + */ + inCloudParams?: ModelParams; +} + /** * Configuration for "thinking" behavior of compatible Gemini models. * diff --git a/packages/ai/src/types/schema.ts b/packages/ai/src/types/schema.ts index f8c91168bf2..8068ce62a91 100644 --- a/packages/ai/src/types/schema.ts +++ b/packages/ai/src/types/schema.ts @@ -128,7 +128,7 @@ export interface SchemaInterface extends SchemaShared { } /** - * Interface for JSON parameters in a schema of {@link SchemaType} + * Interface for JSON parameters in a schema of {@link (SchemaType:type)} * "object" when not using the `Schema.object()` helper. * @public */ From 44d8d742f13883dafd73507133ce9a5411ec3878 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 7 Aug 2025 13:54:50 -0700 Subject: [PATCH 259/295] Version Packages (#9195) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/purple-chairs-wait.md | 6 ------ .changeset/strong-avocados-prove.md | 5 ----- integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 6 ++++++ packages/ai/package.json | 4 ++-- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 15 +++++++++++++++ packages/firebase/package.json | 12 ++++++------ packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 4 ++-- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/CHANGELOG.md | 7 +++++++ packages/performance-compat/package.json | 6 +++--- packages/performance/CHANGELOG.md | 6 ++++++ packages/performance/package.json | 4 ++-- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 40 files changed, 93 insertions(+), 57 deletions(-) delete mode 100644 .changeset/purple-chairs-wait.md delete mode 100644 .changeset/strong-avocados-prove.md diff --git a/.changeset/purple-chairs-wait.md b/.changeset/purple-chairs-wait.md deleted file mode 100644 index e29595537cd..00000000000 --- a/.changeset/purple-chairs-wait.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': minor -'firebase': minor ---- - -Add hybrid inference options to the Firebase AI SDK. diff --git a/.changeset/strong-avocados-prove.md b/.changeset/strong-avocados-prove.md deleted file mode 100644 index 78fc4028d3b..00000000000 --- a/.changeset/strong-avocados-prove.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/performance': patch ---- - -Fixed errors thrown when capturing long target element names for the out-of-the-box metrics. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 9f51db4741e..898feed3504 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.14.0", - "@firebase/app-compat": "0.5.0", + "@firebase/app": "0.14.1", + "@firebase/app-compat": "0.5.1", "@firebase/analytics": "0.10.18", "@firebase/analytics-compat": "0.2.24", "@firebase/auth": "1.11.0", @@ -18,8 +18,8 @@ "@firebase/functions-compat": "0.4.0", "@firebase/messaging": "0.12.23", "@firebase/messaging-compat": "0.2.23", - "@firebase/performance": "0.7.8", - "@firebase/performance-compat": "0.2.21", + "@firebase/performance": "0.7.9", + "@firebase/performance-compat": "0.2.22", "@firebase/remote-config": "0.6.6", "@firebase/remote-config-compat": "0.2.19" }, diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 0999db1409d..e3c67784ed6 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,7 +14,7 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@firebase/firestore": "4.9.0" }, "devDependencies": { diff --git a/integration/messaging/package.json b/integration/messaging/package.json index b8e9b5e65a9..df8ac647379 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "12.0.0", + "firebase": "12.1.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index c73afc3cc7b..60a789a970f 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/ai +## 2.1.0 + +### Minor Changes + +- [`e25317f`](https://github.com/firebase/firebase-js-sdk/commit/e25317f9f3c58305bc093e4f2e676690feb16db0) [#9029](https://github.com/firebase/firebase-js-sdk/pull/9029) - Add hybrid inference options to the Firebase AI SDK. + ## 2.0.0 ### Major Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 97186afb1e1..8000ec4e99d 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "2.0.0", + "version": "2.1.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ac5ea4e77a5..a4648a4ef32 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 8c7a23f6577..afc5c620bb8 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index e16cfe22ed6..4272d7abae3 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 3635fc9bcf2..349621cbc23 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 4f765e43d97..f02992ba304 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.5.1 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.14.1 + ## 0.5.0 ### Minor Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index c19146f41c7..95abb2209ae 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.5.0", + "version": "0.5.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", "@firebase/component": "0.7.0", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index bfc5f0ac55b..9b0c5ca6c50 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.14.1 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.14.0 ### Minor Changes diff --git a/packages/app/package.json b/packages/app/package.json index 14576b7be2e..783f4360fbe 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.14.0", + "version": "0.14.1", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 06b7cd07880..14e0aa922d9 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 35bf105de92..1240ba038a2 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 0c6a4acbba2..974449423f4 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 8840022b659..b8f8831f4a1 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index c6feef61f8d..62321919b96 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 927f51f5b65..bc13cba61c5 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,20 @@ # firebase +## 12.1.0 + +### Minor Changes + +- [`e25317f`](https://github.com/firebase/firebase-js-sdk/commit/e25317f9f3c58305bc093e4f2e676690feb16db0) [#9029](https://github.com/firebase/firebase-js-sdk/pull/9029) - Add hybrid inference options to the Firebase AI SDK. + +### Patch Changes + +- Updated dependencies [[`e25317f`](https://github.com/firebase/firebase-js-sdk/commit/e25317f9f3c58305bc093e4f2e676690feb16db0), [`a4897a6`](https://github.com/firebase/firebase-js-sdk/commit/a4897a621e99f270ddf6821d587fcddd3a0c5cd1)]: + - @firebase/app@0.14.1 + - @firebase/ai@2.1.0 + - @firebase/performance@0.7.9 + - @firebase/app-compat@0.5.1 + - @firebase/performance-compat@0.2.22 + ## 12.0.0 ### Major Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index ceb20a7c42f..8fefaf727da 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "12.0.0", + "version": "12.1.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,9 +399,9 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "2.0.0", - "@firebase/app": "0.14.0", - "@firebase/app-compat": "0.5.0", + "@firebase/ai": "2.1.0", + "@firebase/app": "0.14.1", + "@firebase/app-compat": "0.5.1", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", @@ -418,8 +418,8 @@ "@firebase/messaging-compat": "0.2.23", "@firebase/storage": "0.14.0", "@firebase/storage-compat": "0.4.0", - "@firebase/performance": "0.7.8", - "@firebase/performance-compat": "0.2.21", + "@firebase/performance": "0.7.9", + "@firebase/performance-compat": "0.2.22", "@firebase/remote-config": "0.6.6", "@firebase/remote-config-compat": "0.2.19", "@firebase/analytics": "0.10.18", diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 2c3e72a7416..66c3a91b752 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -53,7 +53,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 38c3182aaf1..8d95f3bbaf9 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -112,8 +112,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.0", - "@firebase/app-compat": "0.5.0", + "@firebase/app": "0.14.1", + "@firebase/app-compat": "0.5.1", "@firebase/auth": "1.11.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index bfdc3a25ce1..c4799b9b289 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 22daca97531..2bb085c4f5d 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 3651d208145..0e25a2ddb65 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index b7275babf12..d093dc93469 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 6dfac06d6b0..00590078b53 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 5d3a9d24115..99e2bebd20d 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 2455f102d40..032e5fd54a7 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/performance-compat +## 0.2.22 + +### Patch Changes + +- Updated dependencies [[`a4897a6`](https://github.com/firebase/firebase-js-sdk/commit/a4897a621e99f270ddf6821d587fcddd3a0c5cd1)]: + - @firebase/performance@0.7.9 + ## 0.2.21 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index a24011702dc..3afbec6ded6 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance-compat", - "version": "0.2.21", + "version": "0.2.22", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -38,7 +38,7 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.7.8", + "@firebase/performance": "0.7.9", "@firebase/performance-types": "0.2.3", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.0" + "@firebase/app-compat": "0.5.1" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index a92149650df..e55f9b69e07 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/performance +## 0.7.9 + +### Patch Changes + +- [`a4897a6`](https://github.com/firebase/firebase-js-sdk/commit/a4897a621e99f270ddf6821d587fcddd3a0c5cd1) [#9178](https://github.com/firebase/firebase-js-sdk/pull/9178) (fixes [#9136](https://github.com/firebase/firebase-js-sdk/issues/9136)) - Fixed errors thrown when capturing long target element names for the out-of-the-box metrics. + ## 0.7.8 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index b909694ac58..20a15732db1 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/performance", - "version": "0.7.8", + "version": "0.7.9", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index ca9de2b8e06..835e1dffe78 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.0" + "@firebase/app-compat": "0.5.1" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 556302d773c..89fd56baee0 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 51cf60f31e5..0cda2ee6e00 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.0", + "@firebase/app-compat": "0.5.1", "@firebase/auth-compat": "0.6.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 75b32f3d3d5..2e71e120414 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@firebase/auth": "1.11.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index 5a7631207b2..a61412f89e9 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 74e7daaf4fc..f3103efd235 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -40,7 +40,7 @@ "yargs": "17.7.2" }, "devDependencies": { - "@firebase/app": "0.14.0", + "@firebase/app": "0.14.1", "@firebase/logger": "0.5.0", "@types/webpack": "5.28.5" }, From cc605e72813162b117a5bc75d7549f99ff98e4c3 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 8 Aug 2025 12:59:26 -0700 Subject: [PATCH 260/295] Backfill fixes for hybrid docs (#9197) --- docs-devsite/ai.chromeadapter.md | 8 ++--- docs-devsite/ai.requestoptions.md | 4 +-- packages/ai/src/methods/chrome-adapter.ts | 44 ++++++++++++----------- packages/ai/src/types/chrome-adapter.ts | 10 +++--- packages/ai/src/types/requests.ts | 5 ++- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/docs-devsite/ai.chromeadapter.md b/docs-devsite/ai.chromeadapter.md index f497312c609..e9207614992 100644 --- a/docs-devsite/ai.chromeadapter.md +++ b/docs-devsite/ai.chromeadapter.md @@ -24,15 +24,15 @@ export interface ChromeAdapter | Method | Description | | --- | --- | -| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference.

      This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.

      | -| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference.

      This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.

      | +| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference. | +| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference. | | [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. | ## ChromeAdapter.generateContent() Generates content using on-device inference. -

      This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.

      +This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference. Signature: @@ -54,7 +54,7 @@ Promise<Response> Generates a content stream using on-device inference. -

      This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.

      +This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference. Signature: diff --git a/docs-devsite/ai.requestoptions.md b/docs-devsite/ai.requestoptions.md index 8178ef5b696..c04230fcd62 100644 --- a/docs-devsite/ai.requestoptions.md +++ b/docs-devsite/ai.requestoptions.md @@ -22,12 +22,12 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | +| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com, which is the [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (used regardless of your chosen Gemini API provider). | | [timeout](./ai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | ## RequestOptions.baseUrl -Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com +Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com, which is the [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (used regardless of your chosen Gemini API provider). Signature: diff --git a/packages/ai/src/methods/chrome-adapter.ts b/packages/ai/src/methods/chrome-adapter.ts index 4dea4170c0d..8fc4b23e665 100644 --- a/packages/ai/src/methods/chrome-adapter.ts +++ b/packages/ai/src/methods/chrome-adapter.ts @@ -61,17 +61,17 @@ export class ChromeAdapterImpl implements ChromeAdapter { /** * Checks if a given request can be made on-device. * - *
        Encapsulates a few concerns: - *
      1. the mode
      2. - *
      3. API existence
      4. - *
      5. prompt formatting
      6. - *
      7. model availability, including triggering download if necessary
      8. - *
      + * Encapsulates a few concerns: + * the mode + * API existence + * prompt formatting + * model availability, including triggering download if necessary * - *

      Pros: callers needn't be concerned with details of on-device availability.

      - *

      Cons: this method spans a few concerns and splits request validation from usage. + * + * Pros: callers needn't be concerned with details of on-device availability.

      + * Cons: this method spans a few concerns and splits request validation from usage. * If instance variables weren't already part of the API, we could consider a better - * separation of concerns.

      + * separation of concerns. */ async isAvailable(request: GenerateContentRequest): Promise { if (!this.mode) { @@ -129,8 +129,9 @@ export class ChromeAdapterImpl implements ChromeAdapter { /** * Generates content on device. * - *

      This is comparable to {@link GenerativeModel.generateContent} for generating content in - * Cloud.

      + * @remarks + * This is comparable to {@link GenerativeModel.generateContent} for generating content in + * Cloud. * @param request - a standard Firebase AI {@link GenerateContentRequest} * @returns {@link Response}, so we can reuse common response formatting. */ @@ -149,8 +150,9 @@ export class ChromeAdapterImpl implements ChromeAdapter { /** * Generates content stream on device. * - *

      This is comparable to {@link GenerativeModel.generateContentStream} for generating content in - * Cloud.

      + * @remarks + * This is comparable to {@link GenerativeModel.generateContentStream} for generating content in + * Cloud. * @param request - a standard Firebase AI {@link GenerateContentRequest} * @returns {@link Response}, so we can reuse common response formatting. */ @@ -228,11 +230,11 @@ export class ChromeAdapterImpl implements ChromeAdapter { /** * Triggers out-of-band download of an on-device model. * - *

      Chrome only downloads models as needed. Chrome knows a model is needed when code calls - * LanguageModel.create.

      + * Chrome only downloads models as needed. Chrome knows a model is needed when code calls + * LanguageModel.create. * - *

      Since Chrome manages the download, the SDK can only avoid redundant download requests by - * tracking if a download has previously been requested.

      + * Since Chrome manages the download, the SDK can only avoid redundant download requests by + * tracking if a download has previously been requested. */ private download(): void { if (this.isDownloading) { @@ -302,12 +304,12 @@ export class ChromeAdapterImpl implements ChromeAdapter { /** * Abstracts Chrome session creation. * - *

      Chrome uses a multi-turn session for all inference. Firebase AI uses single-turn for all + * Chrome uses a multi-turn session for all inference. Firebase AI uses single-turn for all * inference. To map the Firebase AI API to Chrome's API, the SDK creates a new session for all - * inference.

      + * inference. * - *

      Chrome will remove a model from memory if it's no longer in use, so this method ensures a - * new session is created before an old session is destroyed.

      + * Chrome will remove a model from memory if it's no longer in use, so this method ensures a + * new session is created before an old session is destroyed. */ private async createSession(): Promise { if (!this.languageModelProvider) { diff --git a/packages/ai/src/types/chrome-adapter.ts b/packages/ai/src/types/chrome-adapter.ts index 77c52eb9391..9ec0dc2a0ab 100644 --- a/packages/ai/src/types/chrome-adapter.ts +++ b/packages/ai/src/types/chrome-adapter.ts @@ -37,8 +37,9 @@ export interface ChromeAdapter { /** * Generates content using on-device inference. * - *

      This is comparable to {@link GenerativeModel.generateContent} for generating - * content using in-cloud inference.

      + * @remarks + * This is comparable to {@link GenerativeModel.generateContent} for generating + * content using in-cloud inference. * @param request - a standard Firebase AI {@link GenerateContentRequest} */ generateContent(request: GenerateContentRequest): Promise; @@ -46,8 +47,9 @@ export interface ChromeAdapter { /** * Generates a content stream using on-device inference. * - *

      This is comparable to {@link GenerativeModel.generateContentStream} for generating - * a content stream using in-cloud inference.

      + * @remarks + * This is comparable to {@link GenerativeModel.generateContentStream} for generating + * a content stream using in-cloud inference. * @param request - a standard Firebase AI {@link GenerateContentRequest} */ generateContentStream(request: GenerateContentRequest): Promise; diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index b1bde0bc290..ce18710192e 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -165,7 +165,10 @@ export interface RequestOptions { */ timeout?: number; /** - * Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com + * Base url for endpoint. Defaults to + * https://firebasevertexai.googleapis.com, which is the + * {@link https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_ | Firebase AI Logic API} + * (used regardless of your chosen Gemini API provider). */ baseUrl?: string; } From 5501791d0bd665c1c7d4fcd786053a46ceff208c Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 13 Aug 2025 15:56:21 -0700 Subject: [PATCH 261/295] Fix Firebase Functions Emulator usage on Firebase Studio (#9204) * Used valid path for pingserver * Added test * Create three-balloons-collect.md * Fixed fromUrl * Removed only * Fixed typings --- .changeset/three-balloons-collect.md | 5 + packages/functions/src/callable.test.ts | 133 +++++++++++++++++++++++- packages/functions/src/service.ts | 29 +++++- 3 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 .changeset/three-balloons-collect.md diff --git a/.changeset/three-balloons-collect.md b/.changeset/three-balloons-collect.md new file mode 100644 index 00000000000..5978b3a28ab --- /dev/null +++ b/.changeset/three-balloons-collect.md @@ -0,0 +1,5 @@ +--- +"@firebase/functions": patch +--- + +Fixed issue where Firebase Functions SDK caused CORS errors when connected to emulators in Firebase Studio diff --git a/packages/functions/src/callable.test.ts b/packages/functions/src/callable.test.ts index b969304c89e..724efc39c92 100644 --- a/packages/functions/src/callable.test.ts +++ b/packages/functions/src/callable.test.ts @@ -37,7 +37,11 @@ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { makeFakeApp, createTestService } from '../test/utils'; -import { FunctionsService, httpsCallable } from './service'; +import { + FunctionsService, + httpsCallable, + httpsCallableFromURL +} from './service'; import { FUNCTIONS_TYPE } from './constants'; import { FunctionsError } from './error'; @@ -523,9 +527,136 @@ describe('Firebase Functions > Stream', () => { const [_, options] = mockFetch.firstCall.args; expect(options.headers['Authorization']).to.equal('Bearer auth-token'); expect(options.headers['Content-Type']).to.equal('application/json'); + expect(options.credentials).to.equal(undefined); expect(options.headers['Accept']).to.equal('text/event-stream'); }); + it('calls cloud workstations with credentials', async () => { + const authMock: FirebaseAuthInternal = { + getToken: async () => ({ accessToken: 'auth-token' }) + } as unknown as FirebaseAuthInternal; + const authProvider = new Provider( + 'auth-internal', + new ComponentContainer('test') + ); + authProvider.setComponent( + new Component('auth-internal', () => authMock, ComponentType.PRIVATE) + ); + const appCheckMock: FirebaseAppCheckInternal = { + getToken: async () => ({ token: 'app-check-token' }) + } as unknown as FirebaseAppCheckInternal; + const appCheckProvider = new Provider( + 'app-check-internal', + new ComponentContainer('test') + ); + appCheckProvider.setComponent( + new Component( + 'app-check-internal', + () => appCheckMock, + ComponentType.PRIVATE + ) + ); + + const functions = createTestService( + app, + region, + authProvider, + undefined, + appCheckProvider + ); + functions.emulatorOrigin = 'test.cloudworkstations.dev'; + const mockFetch = sinon.stub(functions, 'fetchImpl' as any); + + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode('data: {"result":"Success"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallable, string, string>( + functions, + 'stream' + ); + await func.stream({}); + + expect(mockFetch.calledOnce).to.be.true; + const [_, options] = mockFetch.firstCall.args; + expect(options.credentials).to.equal('include'); + }); + + it('calls streamFromURL cloud workstations with credentials', async () => { + const authMock: FirebaseAuthInternal = { + getToken: async () => ({ accessToken: 'auth-token' }) + } as unknown as FirebaseAuthInternal; + const authProvider = new Provider( + 'auth-internal', + new ComponentContainer('test') + ); + authProvider.setComponent( + new Component('auth-internal', () => authMock, ComponentType.PRIVATE) + ); + const appCheckMock: FirebaseAppCheckInternal = { + getToken: async () => ({ token: 'app-check-token' }) + } as unknown as FirebaseAppCheckInternal; + const appCheckProvider = new Provider( + 'app-check-internal', + new ComponentContainer('test') + ); + appCheckProvider.setComponent( + new Component( + 'app-check-internal', + () => appCheckMock, + ComponentType.PRIVATE + ) + ); + + const functions = createTestService( + app, + region, + authProvider, + undefined, + appCheckProvider + ); + functions.emulatorOrigin = 'test.cloudworkstations.dev'; + const mockFetch = sinon.stub(functions, 'fetchImpl' as any); + + const mockResponse = new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode('data: {"result":"Success"}\n') + ); + controller.close(); + } + }); + + mockFetch.resolves({ + body: mockResponse, + headers: new Headers({ 'Content-Type': 'text/event-stream' }), + status: 200, + statusText: 'OK' + } as Response); + + const func = httpsCallableFromURL, string, string>( + functions, + 'stream' + ); + await func.stream({}); + + expect(mockFetch.calledOnce).to.be.true; + const [_, options] = mockFetch.firstCall.args; + expect(options.credentials).to.equal('include'); + }); + it('aborts during initial fetch', async () => { const controller = new AbortController(); diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index 57504a4c7a4..6e2eddda3a2 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -185,7 +185,7 @@ export function connectFunctionsEmulator( }://${host}:${port}`; // Workaround to get cookies in Firebase Studio if (useSsl) { - void pingServer(functionsInstance.emulatorOrigin); + void pingServer(functionsInstance.emulatorOrigin + '/backends'); updateEmulatorBanner('Functions', true); } } @@ -245,18 +245,29 @@ export function httpsCallableFromURL< return callable as HttpsCallable; } +function getCredentials( + functionsInstance: FunctionsService +): 'include' | undefined { + return functionsInstance.emulatorOrigin && + isCloudWorkstation(functionsInstance.emulatorOrigin) + ? 'include' + : undefined; +} + /** * Does an HTTP POST and returns the completed response. * @param url The url to post to. * @param body The JSON body of the post. * @param headers The HTTP headers to include in the request. + * @param functionsInstance functions instance that is calling postJSON * @return A Promise that will succeed when the request finishes. */ async function postJSON( url: string, body: unknown, headers: { [key: string]: string }, - fetchImpl: typeof fetch + fetchImpl: typeof fetch, + functionsInstance: FunctionsService ): Promise { headers['Content-Type'] = 'application/json'; @@ -265,7 +276,8 @@ async function postJSON( response = await fetchImpl(url, { method: 'POST', body: JSON.stringify(body), - headers + headers, + credentials: getCredentials(functionsInstance) }); } catch (e) { // This could be an unhandled error on the backend, or it could be a @@ -353,7 +365,13 @@ async function callAtURL( const failAfterHandle = failAfter(timeout); const response = await Promise.race([ - postJSON(url, body, headers, functionsInstance.fetchImpl), + postJSON( + url, + body, + headers, + functionsInstance.fetchImpl, + functionsInstance + ), failAfterHandle.promise, functionsInstance.cancelAllRequests ]); @@ -439,7 +457,8 @@ async function streamAtURL( method: 'POST', body: JSON.stringify(body), headers, - signal: options?.signal + signal: options?.signal, + credentials: getCredentials(functionsInstance) }); } catch (e) { if (e instanceof Error && e.name === 'AbortError') { From 2058432e6c8e809d5b695e31fde582e94f1349c5 Mon Sep 17 00:00:00 2001 From: cherylEnkidu <96084918+cherylEnkidu@users.noreply.github.com> Date: Tue, 19 Aug 2025 04:08:25 +0800 Subject: [PATCH 262/295] fix(firestore): fix empty message reject inside transaction body (#9177) --- .changeset/spotty-bananas-fry.md | 5 +++++ packages/firestore/src/core/transaction_runner.ts | 4 ++-- .../test/integration/api/transactions.test.ts | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .changeset/spotty-bananas-fry.md diff --git a/.changeset/spotty-bananas-fry.md b/.changeset/spotty-bananas-fry.md new file mode 100644 index 00000000000..dec4b44dfb7 --- /dev/null +++ b/.changeset/spotty-bananas-fry.md @@ -0,0 +1,5 @@ +--- +'@firebase/firestore': patch +--- + +Fixed a bug where a rejected promise with an empty message in a transaction would cause a timeout. diff --git a/packages/firestore/src/core/transaction_runner.ts b/packages/firestore/src/core/transaction_runner.ts index d9e679321b5..5b2fc5819f7 100644 --- a/packages/firestore/src/core/transaction_runner.ts +++ b/packages/firestore/src/core/transaction_runner.ts @@ -112,8 +112,8 @@ export class TransactionRunner { } } - private isRetryableTransactionError(error: Error): boolean { - if (error.name === 'FirebaseError') { + private isRetryableTransactionError(error: Error | undefined): boolean { + if (error?.name === 'FirebaseError') { // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and // non-matching document versions with ABORTED. These errors should be retried. const code = (error as FirestoreError).code; diff --git a/packages/firestore/test/integration/api/transactions.test.ts b/packages/firestore/test/integration/api/transactions.test.ts index a4d30677a92..0decd1e5fca 100644 --- a/packages/firestore/test/integration/api/transactions.test.ts +++ b/packages/firestore/test/integration/api/transactions.test.ts @@ -593,6 +593,19 @@ apiDescribe('Database transactions', persistence => { } ); + it('runTransaction with empty message reject inside', () => { + return withTestDb(persistence, async db => { + try { + await runTransaction(db, () => { + return Promise.reject(); + }); + expect.fail('transaction should fail'); + } catch (err) { + expect(err).to.be.undefined; + } + }); + }); + describe('must return a promise:', () => { const noop = (): void => { /* -_- */ From 02280d747863445fa1c21dfda01030412a6cecff Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 20 Aug 2025 09:15:12 -0700 Subject: [PATCH 263/295] Add limitedUseToken option to AI SDK (#9201) --- .changeset/nasty-rings-drop.md | 6 ++ common/api-review/ai.api.md | 19 +++++- docs-devsite/ai.ai.md | 11 +++ docs-devsite/ai.aioptions.md | 17 ++++- docs-devsite/ai.md | 23 +++++++ packages/ai/src/api.test.ts | 39 ++++++++++- packages/ai/src/api.ts | 19 ++++-- packages/ai/src/index.ts | 50 ++++++++------ packages/ai/src/models/ai-model.test.ts | 48 +++++++++++++ packages/ai/src/models/ai-model.ts | 11 ++- packages/ai/src/public-types.ts | 11 ++- packages/ai/src/service.ts | 11 ++- .../test-utils/get-fake-firebase-services.ts | 67 +++++++++++++++++++ 13 files changed, 293 insertions(+), 39 deletions(-) create mode 100644 .changeset/nasty-rings-drop.md create mode 100644 packages/ai/test-utils/get-fake-firebase-services.ts diff --git a/.changeset/nasty-rings-drop.md b/.changeset/nasty-rings-drop.md new file mode 100644 index 00000000000..7755dced9f1 --- /dev/null +++ b/.changeset/nasty-rings-drop.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': minor +'firebase': minor +--- + +Add App Check limited use token option to `getAI()`. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index e0eac35996a..5f10f453308 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -4,10 +4,18 @@ ```ts +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { ComponentContainer } from '@firebase/component'; import { FirebaseApp } from '@firebase/app'; +import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; +import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; import { FirebaseError } from '@firebase/util'; +import { _FirebaseService } from '@firebase/app'; +import { InstanceFactoryOptions } from '@firebase/component'; +import { Provider } from '@firebase/component'; // @public export interface AI { @@ -15,6 +23,7 @@ export interface AI { backend: Backend; // @deprecated (undocumented) location: string; + options?: AIOptions; } // @public @@ -53,7 +62,7 @@ export abstract class AIModel { // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts // // @internal (undocumented) - protected _apiSettings: ApiSettings; + _apiSettings: ApiSettings; readonly model: string; // @internal static normalizeModelName(modelName: string, backendType: BackendType): string; @@ -61,7 +70,8 @@ export abstract class AIModel { // @public export interface AIOptions { - backend: Backend; + backend?: Backend; + useLimitedUseAppCheckTokens?: boolean; } // @public @@ -229,6 +239,11 @@ export interface ErrorDetails { reason?: string; } +// Warning: (ae-forgotten-export) The symbol "AIService" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function factory(container: ComponentContainer, { instanceIdentifier }: InstanceFactoryOptions): AIService; + // @public export interface FileData { // (undocumented) diff --git a/docs-devsite/ai.ai.md b/docs-devsite/ai.ai.md index d4127ffb7e8..d7aafb6a5b5 100644 --- a/docs-devsite/ai.ai.md +++ b/docs-devsite/ai.ai.md @@ -27,6 +27,7 @@ export interface AI | [app](./ai.ai.md#aiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./ai.ai.md#ai_interface) instance is associated with. | | [backend](./ai.ai.md#aibackend) | [Backend](./ai.backend.md#backend_class) | A [Backend](./ai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) or the Vertex AI Gemini API (using [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). | | [location](./ai.ai.md#ailocation) | string | | +| [options](./ai.ai.md#aioptions) | [AIOptions](./ai.aioptions.md#aioptions_interface) | Options applied to this [AI](./ai.ai.md#ai_interface) instance. | ## AI.app @@ -62,3 +63,13 @@ backend: Backend; ```typescript location: string; ``` + +## AI.options + +Options applied to this [AI](./ai.ai.md#ai_interface) instance. + +Signature: + +```typescript +options?: AIOptions; +``` diff --git a/docs-devsite/ai.aioptions.md b/docs-devsite/ai.aioptions.md index a092046900b..a5b326ef004 100644 --- a/docs-devsite/ai.aioptions.md +++ b/docs-devsite/ai.aioptions.md @@ -22,14 +22,25 @@ export interface AIOptions | Property | Type | Description | | --- | --- | --- | -| [backend](./ai.aioptions.md#aioptionsbackend) | [Backend](./ai.backend.md#backend_class) | The backend configuration to use for the AI service instance. | +| [backend](./ai.aioptions.md#aioptionsbackend) | [Backend](./ai.backend.md#backend_class) | The backend configuration to use for the AI service instance. Defaults to the Gemini Developer API backend ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). | +| [useLimitedUseAppCheckTokens](./ai.aioptions.md#aioptionsuselimiteduseappchecktokens) | boolean | Whether to use App Check limited use tokens. Defaults to false. | ## AIOptions.backend -The backend configuration to use for the AI service instance. +The backend configuration to use for the AI service instance. Defaults to the Gemini Developer API backend ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). Signature: ```typescript -backend: Backend; +backend?: Backend; +``` + +## AIOptions.useLimitedUseAppCheckTokens + +Whether to use App Check limited use tokens. Defaults to false. + +Signature: + +```typescript +useLimitedUseAppCheckTokens?: boolean; ``` diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 29b3f73f86e..3c7669204a1 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -21,6 +21,8 @@ The Firebase AI Web SDK. | function(ai, ...) | | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | | [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| function(container, ...) | +| [factory(container, { instanceIdentifier })](./ai.md#factory_6581aeb) | | ## Classes @@ -278,6 +280,27 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r If the `apiKey` or `projectId` fields are missing in your Firebase config. +## function(container, ...) + +### factory(container, { instanceIdentifier }) {:#factory_6581aeb} + +Signature: + +```typescript +export declare function factory(container: ComponentContainer, { instanceIdentifier }: InstanceFactoryOptions): AIService; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| container | ComponentContainer | | +| { instanceIdentifier } | InstanceFactoryOptions | | + +Returns: + +AIService + ## AIErrorCode Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. diff --git a/packages/ai/src/api.test.ts b/packages/ai/src/api.test.ts index 76a9b4523c2..55d2eaa4ad3 100644 --- a/packages/ai/src/api.test.ts +++ b/packages/ai/src/api.test.ts @@ -16,11 +16,12 @@ */ import { ImagenModelParams, ModelParams, AIErrorCode } from './types'; import { AIError } from './errors'; -import { ImagenModel, getGenerativeModel, getImagenModel } from './api'; +import { getAI, ImagenModel, getGenerativeModel, getImagenModel } from './api'; import { expect } from 'chai'; import { AI } from './public-types'; import { GenerativeModel } from './models/generative-model'; -import { VertexAIBackend } from './backend'; +import { GoogleAIBackend, VertexAIBackend } from './backend'; +import { getFullApp } from '../test-utils/get-fake-firebase-services'; import { AI_TYPE, DEFAULT_HYBRID_IN_CLOUD_MODEL } from './constants'; const fakeAI: AI = { @@ -38,6 +39,40 @@ const fakeAI: AI = { }; describe('Top level API', () => { + describe('getAI()', () => { + it('works without options', () => { + const ai = getAI(getFullApp()); + expect(ai.backend).to.be.instanceOf(GoogleAIBackend); + }); + it('works with options: no backend, limited use token', () => { + const ai = getAI(getFullApp(), { useLimitedUseAppCheckTokens: true }); + expect(ai.backend).to.be.instanceOf(GoogleAIBackend); + expect(ai.options?.useLimitedUseAppCheckTokens).to.be.true; + }); + it('works with options: backend specified, limited use token', () => { + const ai = getAI(getFullApp(), { + backend: new VertexAIBackend('us-central1'), + useLimitedUseAppCheckTokens: true + }); + expect(ai.backend).to.be.instanceOf(VertexAIBackend); + expect(ai.options?.useLimitedUseAppCheckTokens).to.be.true; + }); + it('works with options: appCheck option is falsy', () => { + const ai = getAI(getFullApp(), { + backend: new VertexAIBackend('us-central1'), + useLimitedUseAppCheckTokens: undefined + }); + expect(ai.backend).to.be.instanceOf(VertexAIBackend); + expect(ai.options?.useLimitedUseAppCheckTokens).to.be.false; + }); + it('works with options: backend specified only', () => { + const ai = getAI(getFullApp(), { + backend: new VertexAIBackend('us-central1') + }); + expect(ai.backend).to.be.instanceOf(VertexAIBackend); + expect(ai.options?.useLimitedUseAppCheckTokens).to.be.false; + }); + }); it('getGenerativeModel throws if no model is provided', () => { try { getGenerativeModel(fakeAI, {} as ModelParams); diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index 62c7c27f07a..26d2904150d 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -75,18 +75,25 @@ declare module '@firebase/component' { * * @public */ -export function getAI( - app: FirebaseApp = getApp(), - options: AIOptions = { backend: new GoogleAIBackend() } -): AI { +export function getAI(app: FirebaseApp = getApp(), options?: AIOptions): AI { app = getModularInstance(app); // Dependencies const AIProvider: Provider<'AI'> = _getProvider(app, AI_TYPE); - const identifier = encodeInstanceIdentifier(options.backend); - return AIProvider.getImmediate({ + const backend = options?.backend ?? new GoogleAIBackend(); + + const finalOptions: Omit = { + useLimitedUseAppCheckTokens: options?.useLimitedUseAppCheckTokens ?? false + }; + + const identifier = encodeInstanceIdentifier(backend); + const aiInstance = AIProvider.getImmediate({ identifier }); + + aiInstance.options = finalOptions; + + return aiInstance; } /** diff --git a/packages/ai/src/index.ts b/packages/ai/src/index.ts index 6ad1f2e3f08..8ac9db61b6d 100644 --- a/packages/ai/src/index.ts +++ b/packages/ai/src/index.ts @@ -24,7 +24,12 @@ import { registerVersion, _registerComponent } from '@firebase/app'; import { AIService } from './service'; import { AI_TYPE } from './constants'; -import { Component, ComponentType } from '@firebase/component'; +import { + Component, + ComponentContainer, + ComponentType, + InstanceFactoryOptions +} from '@firebase/component'; import { name, version } from '../package.json'; import { decodeInstanceIdentifier } from './helpers'; import { AIError } from './api'; @@ -36,28 +41,31 @@ declare global { } } -function registerAI(): void { - _registerComponent( - new Component( - AI_TYPE, - (container, { instanceIdentifier }) => { - if (!instanceIdentifier) { - throw new AIError( - AIErrorCode.ERROR, - 'AIService instance identifier is undefined.' - ); - } +export function factory( + container: ComponentContainer, + { instanceIdentifier }: InstanceFactoryOptions +): AIService { + if (!instanceIdentifier) { + throw new AIError( + AIErrorCode.ERROR, + 'AIService instance identifier is undefined.' + ); + } - const backend = decodeInstanceIdentifier(instanceIdentifier); + const backend = decodeInstanceIdentifier(instanceIdentifier); - // getImmediate for FirebaseApp will always succeed - const app = container.getProvider('app').getImmediate(); - const auth = container.getProvider('auth-internal'); - const appCheckProvider = container.getProvider('app-check-internal'); - return new AIService(app, backend, auth, appCheckProvider); - }, - ComponentType.PUBLIC - ).setMultipleInstances(true) + // getImmediate for FirebaseApp will always succeed + const app = container.getProvider('app').getImmediate(); + const auth = container.getProvider('auth-internal'); + const appCheckProvider = container.getProvider('app-check-internal'); + return new AIService(app, backend, auth, appCheckProvider); +} + +function registerAI(): void { + _registerComponent( + new Component(AI_TYPE, factory, ComponentType.PUBLIC).setMultipleInstances( + true + ) ); registerVersion(name, version); diff --git a/packages/ai/src/models/ai-model.test.ts b/packages/ai/src/models/ai-model.test.ts index 4f23fe9d06f..2e8f8998c58 100644 --- a/packages/ai/src/models/ai-model.test.ts +++ b/packages/ai/src/models/ai-model.test.ts @@ -17,9 +17,11 @@ import { use, expect } from 'chai'; import { AI, AIErrorCode } from '../public-types'; import sinonChai from 'sinon-chai'; +import { stub } from 'sinon'; import { AIModel } from './ai-model'; import { AIError } from '../errors'; import { VertexAIBackend } from '../backend'; +import { AIService } from '../service'; use(sinonChai); @@ -67,6 +69,52 @@ describe('AIModel', () => { const testModel = new TestModel(fakeAI, 'tunedModels/my-model'); expect(testModel.model).to.equal('tunedModels/my-model'); }); + it('calls regular app check token when option is set', async () => { + const getTokenStub = stub().resolves(); + const getLimitedUseTokenStub = stub().resolves(); + const testModel = new TestModel( + //@ts-ignore + { + ...fakeAI, + options: { useLimitedUseAppCheckTokens: false }, + appCheck: { + getToken: getTokenStub, + getLimitedUseToken: getLimitedUseTokenStub + } + } as AIService, + 'models/my-model' + ); + if (testModel._apiSettings?.getAppCheckToken) { + await testModel._apiSettings.getAppCheckToken(); + } + expect(getTokenStub).to.be.called; + expect(getLimitedUseTokenStub).to.not.be.called; + getTokenStub.reset(); + getLimitedUseTokenStub.reset(); + }); + it('calls limited use token when option is set', async () => { + const getTokenStub = stub().resolves(); + const getLimitedUseTokenStub = stub().resolves(); + const testModel = new TestModel( + //@ts-ignore + { + ...fakeAI, + options: { useLimitedUseAppCheckTokens: true }, + appCheck: { + getToken: getTokenStub, + getLimitedUseToken: getLimitedUseTokenStub + } + } as AIService, + 'models/my-model' + ); + if (testModel._apiSettings?.getAppCheckToken) { + await testModel._apiSettings.getAppCheckToken(); + } + expect(getTokenStub).to.not.be.called; + expect(getLimitedUseTokenStub).to.be.called; + getTokenStub.reset(); + getLimitedUseTokenStub.reset(); + }); it('throws if not passed an api key', () => { const fakeAI: AI = { app: { diff --git a/packages/ai/src/models/ai-model.ts b/packages/ai/src/models/ai-model.ts index 084dbe329cc..3fe202d5eb2 100644 --- a/packages/ai/src/models/ai-model.ts +++ b/packages/ai/src/models/ai-model.ts @@ -39,7 +39,7 @@ export abstract class AIModel { /** * @internal */ - protected _apiSettings: ApiSettings; + _apiSettings: ApiSettings; /** * Constructs a new instance of the {@link AIModel} class. @@ -90,8 +90,13 @@ export abstract class AIModel { return Promise.resolve({ token }); }; } else if ((ai as AIService).appCheck) { - this._apiSettings.getAppCheckToken = () => - (ai as AIService).appCheck!.getToken(); + if (ai.options?.useLimitedUseAppCheckTokens) { + this._apiSettings.getAppCheckToken = () => + (ai as AIService).appCheck!.getLimitedUseToken(); + } else { + this._apiSettings.getAppCheckToken = () => + (ai as AIService).appCheck!.getToken(); + } } if ((ai as AIService).auth) { diff --git a/packages/ai/src/public-types.ts b/packages/ai/src/public-types.ts index 57812f20c1e..fff41251a01 100644 --- a/packages/ai/src/public-types.ts +++ b/packages/ai/src/public-types.ts @@ -38,6 +38,10 @@ export interface AI { * Vertex AI Gemini API (using {@link VertexAIBackend}). */ backend: Backend; + /** + * Options applied to this {@link AI} instance. + */ + options?: AIOptions; /** * @deprecated use `AI.backend.location` instead. * @@ -90,6 +94,11 @@ export type BackendType = (typeof BackendType)[keyof typeof BackendType]; export interface AIOptions { /** * The backend configuration to use for the AI service instance. + * Defaults to the Gemini Developer API backend ({@link GoogleAIBackend}). */ - backend: Backend; + backend?: Backend; + /** + * Whether to use App Check limited use tokens. Defaults to false. + */ + useLimitedUseAppCheckTokens?: boolean; } diff --git a/packages/ai/src/service.ts b/packages/ai/src/service.ts index 006cc45a94e..c5c9d9a036d 100644 --- a/packages/ai/src/service.ts +++ b/packages/ai/src/service.ts @@ -16,7 +16,7 @@ */ import { FirebaseApp, _FirebaseService } from '@firebase/app'; -import { AI } from './public-types'; +import { AI, AIOptions } from './public-types'; import { AppCheckInternalComponentName, FirebaseAppCheckInternal @@ -31,6 +31,7 @@ import { Backend, VertexAIBackend } from './backend'; export class AIService implements AI, _FirebaseService { auth: FirebaseAuthInternal | null; appCheck: FirebaseAppCheckInternal | null; + _options?: Omit; location: string; // This is here for backwards-compatibility constructor( @@ -54,4 +55,12 @@ export class AIService implements AI, _FirebaseService { _delete(): Promise { return Promise.resolve(); } + + set options(optionsToSet: AIOptions) { + this._options = optionsToSet; + } + + get options(): AIOptions | undefined { + return this._options; + } } diff --git a/packages/ai/test-utils/get-fake-firebase-services.ts b/packages/ai/test-utils/get-fake-firebase-services.ts new file mode 100644 index 00000000000..20ae7fb70be --- /dev/null +++ b/packages/ai/test-utils/get-fake-firebase-services.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2025 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 { + FirebaseApp, + initializeApp, + _registerComponent, + _addOrOverwriteComponent +} from '@firebase/app'; +import { Component, ComponentType } from '@firebase/component'; +import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; +import { AI_TYPE } from '../src/constants'; +import { factory } from '../src'; + +const fakeConfig = { + projectId: 'projectId', + authDomain: 'authDomain', + messagingSenderId: 'messagingSenderId', + databaseURL: 'databaseUrl', + storageBucket: 'storageBucket' +}; + +export function getFullApp(fakeAppParams?: { + appId?: string; + apiKey?: string; +}): FirebaseApp { + _registerComponent(new Component(AI_TYPE, factory, ComponentType.PUBLIC)); + _registerComponent( + new Component( + 'app-check-internal', + () => { + return {} as FirebaseAppCheckInternal; + }, + ComponentType.PUBLIC + ) + ); + const app = initializeApp({ ...fakeConfig, ...fakeAppParams }); + _addOrOverwriteComponent( + app, + //@ts-ignore + new Component( + 'heartbeat', + // @ts-ignore + () => { + return { + triggerHeartbeat: () => {} + }; + }, + ComponentType.PUBLIC + ) + ); + return app; +} From 9b63cd60efcd02b64b0d37f81affb3eabf70f9eb Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 20 Aug 2025 12:19:25 -0400 Subject: [PATCH 264/295] [Firebase AI] Add thought summary and signature support (#9192) --- .changeset/brave-llamas-impress.md | 6 + common/api-review/ai.api.md | 23 +++- .../ai.enhancedgeneratecontentresponse.md | 23 +++- docs-devsite/ai.filedatapart.md | 9 ++ docs-devsite/ai.functioncallpart.md | 9 ++ docs-devsite/ai.functionresponsepart.md | 9 ++ docs-devsite/ai.inlinedatapart.md | 9 ++ docs-devsite/ai.textpart.md | 9 ++ docs-devsite/ai.thinkingconfig.md | 13 ++ .../src/methods/chat-session-helpers.test.ts | 60 ++++++++- .../ai/src/methods/chat-session-helpers.ts | 12 +- packages/ai/src/methods/chat-session.test.ts | 49 ++++++- .../ai/src/requests/response-helpers.test.ts | 31 +++++ packages/ai/src/requests/response-helpers.ts | 127 +++++++++--------- packages/ai/src/types/content.ts | 25 ++++ packages/ai/src/types/requests.ts | 10 ++ packages/ai/src/types/responses.ts | 27 +++- 17 files changed, 372 insertions(+), 79 deletions(-) create mode 100644 .changeset/brave-llamas-impress.md diff --git a/.changeset/brave-llamas-impress.md b/.changeset/brave-llamas-impress.md new file mode 100644 index 00000000000..61d8f87ff41 --- /dev/null +++ b/.changeset/brave-llamas-impress.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': minor +'firebase': minor +--- + +Add `thoughtSummary()` convenience method to `EnhancedGenerateContentResponse`. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 5f10f453308..9210a76f20d 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -223,10 +223,10 @@ export { Date_2 as Date } // @public export interface EnhancedGenerateContentResponse extends GenerateContentResponse { - // (undocumented) functionCalls: () => FunctionCall[] | undefined; inlineDataParts: () => InlineDataPart[] | undefined; text: () => string; + thoughtSummary: () => string | undefined; } // @public @@ -264,6 +264,10 @@ export interface FileDataPart { inlineData?: never; // (undocumented) text?: never; + // (undocumented) + thought?: boolean; + // @internal (undocumented) + thoughtSignature?: never; } // @public @@ -318,6 +322,10 @@ export interface FunctionCallPart { inlineData?: never; // (undocumented) text?: never; + // (undocumented) + thought?: boolean; + // @internal (undocumented) + thoughtSignature?: never; } // @public @@ -350,6 +358,10 @@ export interface FunctionResponsePart { inlineData?: never; // (undocumented) text?: never; + // (undocumented) + thought?: boolean; + // @internal (undocumented) + thoughtSignature?: never; } // @public @@ -732,6 +744,10 @@ export interface InlineDataPart { inlineData: GenerativeContentBlob; // (undocumented) text?: never; + // (undocumented) + thought?: boolean; + // @internal (undocumented) + thoughtSignature?: never; videoMetadata?: VideoMetadata; } @@ -1063,10 +1079,15 @@ export interface TextPart { inlineData?: never; // (undocumented) text: string; + // (undocumented) + thought?: boolean; + // @internal (undocumented) + thoughtSignature?: string; } // @public export interface ThinkingConfig { + includeThoughts?: boolean; thinkingBudget?: number; } diff --git a/docs-devsite/ai.enhancedgeneratecontentresponse.md b/docs-devsite/ai.enhancedgeneratecontentresponse.md index 330dc10f322..9e947add0cb 100644 --- a/docs-devsite/ai.enhancedgeneratecontentresponse.md +++ b/docs-devsite/ai.enhancedgeneratecontentresponse.md @@ -23,12 +23,15 @@ export interface EnhancedGenerateContentResponse extends GenerateContentResponse | Property | Type | Description | | --- | --- | --- | -| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () => [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)\[\] \| undefined | Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. | +| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\] \| undefined | Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | +| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () => [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)\[\] \| undefined | Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | | [text](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | +| [thoughtSummary](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsethoughtsummary) | () => string \| undefined | Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their thought property set to true from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | ## EnhancedGenerateContentResponse.functionCalls +Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). + Signature: ```typescript @@ -37,7 +40,7 @@ functionCalls: () => FunctionCall[] | undefined; ## EnhancedGenerateContentResponse.inlineDataParts -Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate. +Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -54,3 +57,17 @@ Returns the text string from the response, if available. Throws if the prompt or ```typescript text: () => string; ``` + +## EnhancedGenerateContentResponse.thoughtSummary + +Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their `thought` property set to `true` from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). + +Thought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy. + +Thoughts will only be included if [ThinkingConfig.includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) is set to `true`. + +Signature: + +```typescript +thoughtSummary: () => string | undefined; +``` diff --git a/docs-devsite/ai.filedatapart.md b/docs-devsite/ai.filedatapart.md index 65cb9dc00ef..2b5179319f7 100644 --- a/docs-devsite/ai.filedatapart.md +++ b/docs-devsite/ai.filedatapart.md @@ -27,6 +27,7 @@ export interface FileDataPart | [functionResponse](./ai.filedatapart.md#filedatapartfunctionresponse) | never | | | [inlineData](./ai.filedatapart.md#filedatapartinlinedata) | never | | | [text](./ai.filedatapart.md#filedataparttext) | never | | +| [thought](./ai.filedatapart.md#filedatapartthought) | boolean | | ## FileDataPart.fileData @@ -67,3 +68,11 @@ inlineData?: never; ```typescript text?: never; ``` + +## FileDataPart.thought + +Signature: + +```typescript +thought?: boolean; +``` diff --git a/docs-devsite/ai.functioncallpart.md b/docs-devsite/ai.functioncallpart.md index b16e58f80a6..3f07c5d0d74 100644 --- a/docs-devsite/ai.functioncallpart.md +++ b/docs-devsite/ai.functioncallpart.md @@ -26,6 +26,7 @@ export interface FunctionCallPart | [functionResponse](./ai.functioncallpart.md#functioncallpartfunctionresponse) | never | | | [inlineData](./ai.functioncallpart.md#functioncallpartinlinedata) | never | | | [text](./ai.functioncallpart.md#functioncallparttext) | never | | +| [thought](./ai.functioncallpart.md#functioncallpartthought) | boolean | | ## FunctionCallPart.functionCall @@ -58,3 +59,11 @@ inlineData?: never; ```typescript text?: never; ``` + +## FunctionCallPart.thought + +Signature: + +```typescript +thought?: boolean; +``` diff --git a/docs-devsite/ai.functionresponsepart.md b/docs-devsite/ai.functionresponsepart.md index 9c80258f43f..4e8c9ea5724 100644 --- a/docs-devsite/ai.functionresponsepart.md +++ b/docs-devsite/ai.functionresponsepart.md @@ -26,6 +26,7 @@ export interface FunctionResponsePart | [functionResponse](./ai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) | | | [inlineData](./ai.functionresponsepart.md#functionresponsepartinlinedata) | never | | | [text](./ai.functionresponsepart.md#functionresponseparttext) | never | | +| [thought](./ai.functionresponsepart.md#functionresponsepartthought) | boolean | | ## FunctionResponsePart.functionCall @@ -58,3 +59,11 @@ inlineData?: never; ```typescript text?: never; ``` + +## FunctionResponsePart.thought + +Signature: + +```typescript +thought?: boolean; +``` diff --git a/docs-devsite/ai.inlinedatapart.md b/docs-devsite/ai.inlinedatapart.md index 0dd68edda68..c9ead9d061d 100644 --- a/docs-devsite/ai.inlinedatapart.md +++ b/docs-devsite/ai.inlinedatapart.md @@ -26,6 +26,7 @@ export interface InlineDataPart | [functionResponse](./ai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | | [inlineData](./ai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | | | [text](./ai.inlinedatapart.md#inlinedataparttext) | never | | +| [thought](./ai.inlinedatapart.md#inlinedatapartthought) | boolean | | | [videoMetadata](./ai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall @@ -60,6 +61,14 @@ inlineData: GenerativeContentBlob; text?: never; ``` +## InlineDataPart.thought + +Signature: + +```typescript +thought?: boolean; +``` + ## InlineDataPart.videoMetadata Applicable if `inlineData` is a video. diff --git a/docs-devsite/ai.textpart.md b/docs-devsite/ai.textpart.md index 2057d95d32e..2466f9cca8f 100644 --- a/docs-devsite/ai.textpart.md +++ b/docs-devsite/ai.textpart.md @@ -26,6 +26,7 @@ export interface TextPart | [functionResponse](./ai.textpart.md#textpartfunctionresponse) | never | | | [inlineData](./ai.textpart.md#textpartinlinedata) | never | | | [text](./ai.textpart.md#textparttext) | string | | +| [thought](./ai.textpart.md#textpartthought) | boolean | | ## TextPart.functionCall @@ -58,3 +59,11 @@ inlineData?: never; ```typescript text: string; ``` + +## TextPart.thought + +Signature: + +```typescript +thought?: boolean; +``` diff --git a/docs-devsite/ai.thinkingconfig.md b/docs-devsite/ai.thinkingconfig.md index ec348a20487..1ddc1626f48 100644 --- a/docs-devsite/ai.thinkingconfig.md +++ b/docs-devsite/ai.thinkingconfig.md @@ -24,8 +24,21 @@ export interface ThinkingConfig | Property | Type | Description | | --- | --- | --- | +| [includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) | boolean | Whether to include "thought summaries" in the model's response. | | [thinkingBudget](./ai.thinkingconfig.md#thinkingconfigthinkingbudget) | number | The thinking budget, in tokens.This parameter sets an upper limit on the number of tokens the model can use for its internal "thinking" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range. | +## ThinkingConfig.includeThoughts + +Whether to include "thought summaries" in the model's response. + +Thought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy. + +Signature: + +```typescript +includeThoughts?: boolean; +``` + ## ThinkingConfig.thinkingBudget The thinking budget, in tokens. diff --git a/packages/ai/src/methods/chat-session-helpers.test.ts b/packages/ai/src/methods/chat-session-helpers.test.ts index feab9fc3b05..e64f3e84e2d 100644 --- a/packages/ai/src/methods/chat-session-helpers.test.ts +++ b/packages/ai/src/methods/chat-session-helpers.test.ts @@ -22,7 +22,11 @@ import { FirebaseError } from '@firebase/util'; describe('chat-session-helpers', () => { describe('validateChatHistory', () => { - const TCS: Array<{ history: Content[]; isValid: boolean }> = [ + const TCS: Array<{ + history: Content[]; + isValid: boolean; + errorShouldInclude?: string; + }> = [ { history: [{ role: 'user', parts: [{ text: 'hi' }] }], isValid: true @@ -99,19 +103,23 @@ describe('chat-session-helpers', () => { { //@ts-expect-error history: [{ role: 'user', parts: '' }], + errorShouldInclude: `array of Parts`, isValid: false }, { //@ts-expect-error history: [{ role: 'user' }], + errorShouldInclude: `array of Parts`, isValid: false }, { history: [{ role: 'user', parts: [] }], + errorShouldInclude: `at least one part`, isValid: false }, { history: [{ role: 'model', parts: [{ text: 'hi' }] }], + errorShouldInclude: `model`, isValid: false }, { @@ -125,6 +133,7 @@ describe('chat-session-helpers', () => { ] } ], + errorShouldInclude: `function`, isValid: false }, { @@ -132,6 +141,7 @@ describe('chat-session-helpers', () => { { role: 'user', parts: [{ text: 'hi' }] }, { role: 'user', parts: [{ text: 'hi' }] } ], + errorShouldInclude: `can't follow 'user'`, isValid: false }, { @@ -140,6 +150,45 @@ describe('chat-session-helpers', () => { { role: 'model', parts: [{ text: 'hi' }] }, { role: 'model', parts: [{ text: 'hi' }] } ], + errorShouldInclude: `can't follow 'model'`, + isValid: false + }, + { + history: [ + { role: 'user', parts: [{ text: 'hi' }] }, + { + role: 'model', + parts: [ + { text: 'hi' }, + { + text: 'thought about hi', + thought: true, + thoughtSignature: 'thought signature' + } + ] + } + ], + isValid: true + }, + { + history: [ + { + role: 'user', + parts: [{ text: 'hi', thought: true, thoughtSignature: 'sig' }] + }, + { + role: 'model', + parts: [ + { text: 'hi' }, + { + text: 'thought about hi', + thought: true, + thoughtSignature: 'thought signature' + } + ] + } + ], + errorShouldInclude: 'thought', isValid: false } ]; @@ -149,7 +198,14 @@ describe('chat-session-helpers', () => { if (tc.isValid) { expect(fn).to.not.throw(); } else { - expect(fn).to.throw(FirebaseError); + try { + fn(); + } catch (e) { + expect(e).to.be.instanceOf(FirebaseError); + if (e instanceof FirebaseError && tc.errorShouldInclude) { + expect(e.message).to.include(tc.errorShouldInclude); + } + } } }); }); diff --git a/packages/ai/src/methods/chat-session-helpers.ts b/packages/ai/src/methods/chat-session-helpers.ts index 1bb0e2798f2..709f616f3c0 100644 --- a/packages/ai/src/methods/chat-session-helpers.ts +++ b/packages/ai/src/methods/chat-session-helpers.ts @@ -24,13 +24,15 @@ const VALID_PART_FIELDS: Array = [ 'text', 'inlineData', 'functionCall', - 'functionResponse' + 'functionResponse', + 'thought', + 'thoughtSignature' ]; const VALID_PARTS_PER_ROLE: { [key in Role]: Array } = { user: ['text', 'inlineData'], function: ['functionResponse'], - model: ['text', 'functionCall'], + model: ['text', 'functionCall', 'thought', 'thoughtSignature'], // System instructions shouldn't be in history anyway. system: ['text'] }; @@ -65,7 +67,7 @@ export function validateChatHistory(history: Content[]): void { if (!Array.isArray(parts)) { throw new AIError( AIErrorCode.INVALID_CONTENT, - `Content should have 'parts' but property with an array of Parts` + `Content should have 'parts' property with an array of Parts` ); } @@ -80,7 +82,9 @@ export function validateChatHistory(history: Content[]): void { text: 0, inlineData: 0, functionCall: 0, - functionResponse: 0 + functionResponse: 0, + thought: 0, + thoughtSignature: 0 }; for (const part of parts) { diff --git a/packages/ai/src/methods/chat-session.test.ts b/packages/ai/src/methods/chat-session.test.ts index f523672f5e2..e92aa057af1 100644 --- a/packages/ai/src/methods/chat-session.test.ts +++ b/packages/ai/src/methods/chat-session.test.ts @@ -20,7 +20,7 @@ import { match, restore, stub, useFakeTimers } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import * as generateContentMethods from './generate-content'; -import { GenerateContentStreamResult, InferenceMode } from '../types'; +import { Content, GenerateContentStreamResult, InferenceMode } from '../types'; import { ChatSession } from './chat-session'; import { ApiSettings } from '../types/internal'; import { VertexAIBackend } from '../backend'; @@ -65,6 +65,53 @@ describe('ChatSession', () => { match.any ); }); + it('adds message and response to history', async () => { + const fakeContent: Content = { + role: 'model', + parts: [ + { text: 'hi' }, + { + text: 'thought about hi', + thoughtSignature: 'thought signature' + } + ] + }; + const fakeResponse = { + candidates: [ + { + index: 1, + content: fakeContent + } + ] + }; + const generateContentStub = stub( + generateContentMethods, + 'generateContent' + ).resolves({ + // @ts-ignore + response: fakeResponse + }); + const chatSession = new ChatSession(fakeApiSettings, 'a-model'); + const result = await chatSession.sendMessage('hello'); + // @ts-ignore + expect(result.response).to.equal(fakeResponse); + // Test: stores history correctly? + const history = await chatSession.getHistory(); + expect(history[0].role).to.equal('user'); + expect(history[0].parts[0].text).to.equal('hello'); + expect(history[1]).to.deep.equal(fakeResponse.candidates[0].content); + // Test: sends history correctly? + await chatSession.sendMessage('hello 2'); + expect(generateContentStub.args[1][2].contents[0].parts[0].text).to.equal( + 'hello' + ); + expect(generateContentStub.args[1][2].contents[1]).to.deep.equal( + fakeResponse.candidates[0].content + ); + expect(generateContentStub.args[1][2].contents[2].parts[0].text).to.equal( + 'hello 2' + ); + }); }); describe('sendMessageStream()', () => { it('generateContentStream errors should be catchable', async () => { diff --git a/packages/ai/src/requests/response-helpers.test.ts b/packages/ai/src/requests/response-helpers.test.ts index 97dd2f9fe30..8583ca9a733 100644 --- a/packages/ai/src/requests/response-helpers.test.ts +++ b/packages/ai/src/requests/response-helpers.test.ts @@ -48,6 +48,21 @@ const fakeResponseText: GenerateContentResponse = { ] }; +const fakeResponseThoughts: GenerateContentResponse = { + candidates: [ + { + index: 0, + content: { + role: 'model', + parts: [ + { text: 'Some text' }, + { text: 'and some thoughts', thought: true } + ] + } + } + ] +}; + const functionCallPart1 = { functionCall: { name: 'find_theaters', @@ -188,6 +203,7 @@ describe('response-helpers methods', () => { expect(enhancedResponse.text()).to.equal('Some text and some more text'); expect(enhancedResponse.functionCalls()).to.be.undefined; expect(enhancedResponse.inlineDataParts()).to.be.undefined; + expect(enhancedResponse.thoughtSummary()).to.be.undefined; }); it('good response functionCall', async () => { const enhancedResponse = addHelpers(fakeResponseFunctionCall); @@ -196,6 +212,7 @@ describe('response-helpers methods', () => { functionCallPart1.functionCall ]); expect(enhancedResponse.inlineDataParts()).to.be.undefined; + expect(enhancedResponse.thoughtSummary()).to.be.undefined; }); it('good response functionCalls', async () => { const enhancedResponse = addHelpers(fakeResponseFunctionCalls); @@ -205,6 +222,7 @@ describe('response-helpers methods', () => { functionCallPart2.functionCall ]); expect(enhancedResponse.inlineDataParts()).to.be.undefined; + expect(enhancedResponse.thoughtSummary()).to.be.undefined; }); it('good response text/functionCall', async () => { const enhancedResponse = addHelpers(fakeResponseMixed1); @@ -213,6 +231,7 @@ describe('response-helpers methods', () => { ]); expect(enhancedResponse.text()).to.equal('some text'); expect(enhancedResponse.inlineDataParts()).to.be.undefined; + expect(enhancedResponse.thoughtSummary()).to.be.undefined; }); it('good response functionCall/text', async () => { const enhancedResponse = addHelpers(fakeResponseMixed2); @@ -221,6 +240,7 @@ describe('response-helpers methods', () => { ]); expect(enhancedResponse.text()).to.equal('some text'); expect(enhancedResponse.inlineDataParts()).to.be.undefined; + expect(enhancedResponse.thoughtSummary()).to.be.undefined; }); it('good response text/functionCall/text', async () => { const enhancedResponse = addHelpers(fakeResponseMixed3); @@ -228,17 +248,20 @@ describe('response-helpers methods', () => { functionCallPart1.functionCall ]); expect(enhancedResponse.text()).to.equal('some text and more text'); + expect(enhancedResponse.thoughtSummary()).to.be.undefined; expect(enhancedResponse.inlineDataParts()).to.be.undefined; }); it('bad response safety', async () => { const enhancedResponse = addHelpers(badFakeResponse); expect(enhancedResponse.text).to.throw('SAFETY'); + expect(enhancedResponse.thoughtSummary).to.throw('SAFETY'); expect(enhancedResponse.functionCalls).to.throw('SAFETY'); expect(enhancedResponse.inlineDataParts).to.throw('SAFETY'); }); it('good response inlineData', async () => { const enhancedResponse = addHelpers(fakeResponseInlineData); expect(enhancedResponse.text()).to.equal(''); + expect(enhancedResponse.thoughtSummary()).to.be.undefined; expect(enhancedResponse.functionCalls()).to.be.undefined; expect(enhancedResponse.inlineDataParts()).to.deep.equal([ inlineDataPart1, @@ -248,11 +271,19 @@ describe('response-helpers methods', () => { it('good response text/inlineData', async () => { const enhancedResponse = addHelpers(fakeResponseTextAndInlineData); expect(enhancedResponse.text()).to.equal('Describe this:'); + expect(enhancedResponse.thoughtSummary()).to.be.undefined; expect(enhancedResponse.functionCalls()).to.be.undefined; expect(enhancedResponse.inlineDataParts()).to.deep.equal([ inlineDataPart1 ]); }); + it('good response text/thought', async () => { + const enhancedResponse = addHelpers(fakeResponseThoughts); + expect(enhancedResponse.text()).to.equal('Some text'); + expect(enhancedResponse.thoughtSummary()).to.equal('and some thoughts'); + expect(enhancedResponse.functionCalls()).to.be.undefined; + expect(enhancedResponse.inlineDataParts()).to.be.undefined; + }); }); describe('getBlockString', () => { it('has no promptFeedback or bad finishReason', async () => { diff --git a/packages/ai/src/requests/response-helpers.ts b/packages/ai/src/requests/response-helpers.ts index 2505b5c9276..16d55613487 100644 --- a/packages/ai/src/requests/response-helpers.ts +++ b/packages/ai/src/requests/response-helpers.ts @@ -24,12 +24,43 @@ import { ImagenGCSImage, ImagenInlineImage, AIErrorCode, - InlineDataPart + InlineDataPart, + Part } from '../types'; import { AIError } from '../errors'; import { logger } from '../logger'; import { ImagenResponseInternal } from '../types/internal'; +/** + * Check that at least one candidate exists and does not have a bad + * finish reason. Warns if multiple candidates exist. + */ +function hasValidCandidates(response: GenerateContentResponse): boolean { + if (response.candidates && response.candidates.length > 0) { + if (response.candidates.length > 1) { + logger.warn( + `This response had ${response.candidates.length} ` + + `candidates. Returning text from the first candidate only. ` + + `Access response.candidates directly to use the other candidates.` + ); + } + if (hadBadFinishReason(response.candidates[0])) { + throw new AIError( + AIErrorCode.RESPONSE_ERROR, + `Response error: ${formatBlockErrorMessage( + response + )}. Response body stored in error.response`, + { + response + } + ); + } + return true; + } else { + return false; + } +} + /** * Creates an EnhancedGenerateContentResponse object that has helper functions and * other modifications that improve usability. @@ -59,26 +90,8 @@ export function addHelpers( response: GenerateContentResponse ): EnhancedGenerateContentResponse { (response as EnhancedGenerateContentResponse).text = () => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - logger.warn( - `This response had ${response.candidates.length} ` + - `candidates. Returning text from the first candidate only. ` + - `Access response.candidates directly to use the other candidates.` - ); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new AIError( - AIErrorCode.RESPONSE_ERROR, - `Response error: ${formatBlockErrorMessage( - response - )}. Response body stored in error.response`, - { - response - } - ); - } - return getText(response); + if (hasValidCandidates(response)) { + return getText(response, part => !part.thought); } else if (response.promptFeedback) { throw new AIError( AIErrorCode.RESPONSE_ERROR, @@ -90,28 +103,25 @@ export function addHelpers( } return ''; }; + (response as EnhancedGenerateContentResponse).thoughtSummary = () => { + if (hasValidCandidates(response)) { + const result = getText(response, part => !!part.thought); + return result === '' ? undefined : result; + } else if (response.promptFeedback) { + throw new AIError( + AIErrorCode.RESPONSE_ERROR, + `Thought summary not available. ${formatBlockErrorMessage(response)}`, + { + response + } + ); + } + return undefined; + }; (response as EnhancedGenerateContentResponse).inlineDataParts = (): | InlineDataPart[] | undefined => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - logger.warn( - `This response had ${response.candidates.length} ` + - `candidates. Returning data from the first candidate only. ` + - `Access response.candidates directly to use the other candidates.` - ); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new AIError( - AIErrorCode.RESPONSE_ERROR, - `Response error: ${formatBlockErrorMessage( - response - )}. Response body stored in error.response`, - { - response - } - ); - } + if (hasValidCandidates(response)) { return getInlineDataParts(response); } else if (response.promptFeedback) { throw new AIError( @@ -125,25 +135,7 @@ export function addHelpers( return undefined; }; (response as EnhancedGenerateContentResponse).functionCalls = () => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - logger.warn( - `This response had ${response.candidates.length} ` + - `candidates. Returning function calls from the first candidate only. ` + - `Access response.candidates directly to use the other candidates.` - ); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new AIError( - AIErrorCode.RESPONSE_ERROR, - `Response error: ${formatBlockErrorMessage( - response - )}. Response body stored in error.response`, - { - response - } - ); - } + if (hasValidCandidates(response)) { return getFunctionCalls(response); } else if (response.promptFeedback) { throw new AIError( @@ -160,13 +152,20 @@ export function addHelpers( } /** - * Returns all text found in all parts of first candidate. + * Returns all text from the first candidate's parts, filtering by whether + * `partFilter()` returns true. + * + * @param response - The `GenerateContentResponse` from which to extract text. + * @param partFilter - Only return `Part`s for which this returns true */ -export function getText(response: GenerateContentResponse): string { +export function getText( + response: GenerateContentResponse, + partFilter: (part: Part) => boolean +): string { const textStrings = []; if (response.candidates?.[0].content?.parts) { for (const part of response.candidates?.[0].content?.parts) { - if (part.text) { + if (part.text && partFilter(part)) { textStrings.push(part.text); } } @@ -179,7 +178,7 @@ export function getText(response: GenerateContentResponse): string { } /** - * Returns {@link FunctionCall}s associated with first candidate. + * Returns every {@link FunctionCall} associated with first candidate. */ export function getFunctionCalls( response: GenerateContentResponse @@ -200,7 +199,7 @@ export function getFunctionCalls( } /** - * Returns {@link InlineDataPart}s in the first candidate if present. + * Returns every {@link InlineDataPart} in the first candidate if present. * * @internal */ diff --git a/packages/ai/src/types/content.ts b/packages/ai/src/types/content.ts index ad2906671e4..a08af95086c 100644 --- a/packages/ai/src/types/content.ts +++ b/packages/ai/src/types/content.ts @@ -47,6 +47,11 @@ export interface TextPart { inlineData?: never; functionCall?: never; functionResponse?: never; + thought?: boolean; + /** + * @internal + */ + thoughtSignature?: string; } /** @@ -62,6 +67,11 @@ export interface InlineDataPart { * Applicable if `inlineData` is a video. */ videoMetadata?: VideoMetadata; + thought?: boolean; + /** + * @internal + */ + thoughtSignature?: never; } /** @@ -90,6 +100,11 @@ export interface FunctionCallPart { inlineData?: never; functionCall: FunctionCall; functionResponse?: never; + thought?: boolean; + /** + * @internal + */ + thoughtSignature?: never; } /** @@ -101,6 +116,11 @@ export interface FunctionResponsePart { inlineData?: never; functionCall?: never; functionResponse: FunctionResponse; + thought?: boolean; + /** + * @internal + */ + thoughtSignature?: never; } /** @@ -113,6 +133,11 @@ export interface FileDataPart { functionCall?: never; functionResponse?: never; fileData: FileData; + thought?: boolean; + /** + * @internal + */ + thoughtSignature?: never; } /** diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index ce18710192e..93921c6f14e 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -333,4 +333,14 @@ export interface ThinkingConfig { * feature or if the specified budget is not within the model's supported range. */ thinkingBudget?: number; + + /** + * Whether to include "thought summaries" in the model's response. + * + * @remarks + * Thought summaries provide a brief overview of the model's internal thinking process, + * offering insight into how it arrived at the final answer. This can be useful for + * debugging, understanding the model's reasoning, and verifying its accuracy. + */ + includeThoughts?: boolean; } diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index 323699e646b..d9b76155a3a 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -60,15 +60,34 @@ export interface EnhancedGenerateContentResponse */ text: () => string; /** - * Aggregates and returns all {@link InlineDataPart}s from the {@link GenerateContentResponse}'s - * first candidate. - * - * @returns An array of {@link InlineDataPart}s containing data from the response, if available. + * Aggregates and returns every {@link InlineDataPart} from the first candidate of + * {@link GenerateContentResponse}. * * @throws If the prompt or candidate was blocked. */ inlineDataParts: () => InlineDataPart[] | undefined; + /** + * Aggregates and returns every {@link FunctionCall} from the first candidate of + * {@link GenerateContentResponse}. + * + * @throws If the prompt or candidate was blocked. + */ functionCalls: () => FunctionCall[] | undefined; + /** + * Aggregates and returns every {@link TextPart} with their `thought` property set + * to `true` from the first candidate of {@link GenerateContentResponse}. + * + * @throws If the prompt or candidate was blocked. + * + * @remarks + * Thought summaries provide a brief overview of the model's internal thinking process, + * offering insight into how it arrived at the final answer. This can be useful for + * debugging, understanding the model's reasoning, and verifying its accuracy. + * + * Thoughts will only be included if {@link ThinkingConfig.includeThoughts} is + * set to `true`. + */ + thoughtSummary: () => string | undefined; } /** From 84b8bed35b69e4713fe8f677803cb06625525a61 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 21 Aug 2025 13:14:24 -0400 Subject: [PATCH 265/295] fix(ai): Only include unexpected `prediction` element in error message (#9222) * fix(ai): Only include unexpected prediction element in error message. If the `responseJson` from the Predict request has an image, the entire image base64 will be included in the error message. This can make the error message >400kB (!!), which could cause performance issues in apps. I ran into this when testing https://github.com/firebase/firebase-js-sdk/pull/9216, since the `safetyAttributes` would be included in a response and trigger this error, but the `predictions` array in `responseJson` would have images. I noticed that when the sample app rendered the `error.message`, it began running into serious performance issues. --- .changeset/calm-guests-pump.md | 5 +++++ packages/ai/src/requests/response-helpers.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/calm-guests-pump.md diff --git a/.changeset/calm-guests-pump.md b/.changeset/calm-guests-pump.md new file mode 100644 index 00000000000..da46e234f77 --- /dev/null +++ b/.changeset/calm-guests-pump.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Fixed an issue where `AIError` messages were too long after including an entire response body. diff --git a/packages/ai/src/requests/response-helpers.ts b/packages/ai/src/requests/response-helpers.ts index 16d55613487..5015d8ccff9 100644 --- a/packages/ai/src/requests/response-helpers.ts +++ b/packages/ai/src/requests/response-helpers.ts @@ -298,9 +298,9 @@ export async function handlePredictResponse< } else { throw new AIError( AIErrorCode.RESPONSE_ERROR, - `Predictions array in response has missing properties. Response: ${JSON.stringify( - responseJson - )}` + `Unexpected element in 'predictions' array in response: '${JSON.stringify( + prediction + )}'` ); } } From c5f08a9bc5da0d2b0207802c972d53724ccef055 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 21 Aug 2025 13:14:42 -0400 Subject: [PATCH 266/295] fix(ai): Add `'includeSafetyAttributes'` to Predict request payloads (#9216) --- .changeset/good-cooks-deliver.md | 5 +++++ packages/ai/src/requests/request-helpers.test.ts | 2 ++ packages/ai/src/requests/request-helpers.ts | 3 ++- packages/ai/src/requests/response-helpers.ts | 2 ++ packages/ai/src/types/imagen/internal.ts | 10 ++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .changeset/good-cooks-deliver.md diff --git a/.changeset/good-cooks-deliver.md b/.changeset/good-cooks-deliver.md new file mode 100644 index 00000000000..739a42f8574 --- /dev/null +++ b/.changeset/good-cooks-deliver.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Add 'includeSafetyAttributes' field to Predict request payloads. diff --git a/packages/ai/src/requests/request-helpers.test.ts b/packages/ai/src/requests/request-helpers.test.ts index d8337850925..993b0f1d3ae 100644 --- a/packages/ai/src/requests/request-helpers.test.ts +++ b/packages/ai/src/requests/request-helpers.test.ts @@ -214,6 +214,7 @@ describe('request formatting methods', () => { expect(body.instances[0].prompt).to.equal(prompt); expect(body.parameters.sampleCount).to.equal(1); expect(body.parameters.includeRaiReason).to.be.true; + expect(body.parameters.includeSafetyAttributes).to.be.true; // Parameters without default values should be undefined expect(body.parameters.storageUri).to.be.undefined; @@ -258,6 +259,7 @@ describe('request formatting methods', () => { personGeneration: safetySettings.personFilterLevel, aspectRatio, includeRaiReason: true, + includeSafetyAttributes: true, storageUri: undefined }); }); diff --git a/packages/ai/src/requests/request-helpers.ts b/packages/ai/src/requests/request-helpers.ts index c4cc1a20acc..ee80142481b 100644 --- a/packages/ai/src/requests/request-helpers.ts +++ b/packages/ai/src/requests/request-helpers.ts @@ -156,7 +156,8 @@ export function createPredictRequestBody( addWatermark, safetyFilterLevel, personGeneration: personFilterLevel, - includeRaiReason: true + includeRaiReason: true, + includeSafetyAttributes: true } }; return body; diff --git a/packages/ai/src/requests/response-helpers.ts b/packages/ai/src/requests/response-helpers.ts index 5015d8ccff9..930bfabb2ae 100644 --- a/packages/ai/src/requests/response-helpers.ts +++ b/packages/ai/src/requests/response-helpers.ts @@ -295,6 +295,8 @@ export async function handlePredictResponse< mimeType: prediction.mimeType, gcsURI: prediction.gcsUri } as T); + } else if (prediction.safetyAttributes) { + // Ignore safetyAttributes "prediction" to avoid throwing an error below. } else { throw new AIError( AIErrorCode.RESPONSE_ERROR, diff --git a/packages/ai/src/types/imagen/internal.ts b/packages/ai/src/types/imagen/internal.ts index 02a8a55e01c..1a34eb18f56 100644 --- a/packages/ai/src/types/imagen/internal.ts +++ b/packages/ai/src/types/imagen/internal.ts @@ -61,6 +61,14 @@ export interface ImagenResponseInternal { * The reason why the image was filtered. */ raiFilteredReason?: string; + /** + * The safety attributes. + * + * This type is currently unused in the SDK. It is sent back because our requests set + * `includeSafetyAttributes`. This property is currently only used to avoid throwing an error + * when encountering this unsupported prediction type. + */ + safetyAttributes?: unknown; }>; } @@ -84,6 +92,7 @@ export interface ImagenResponseInternal { * "personGeneration": "allow_all", * "sampleCount": 2, * "includeRaiReason": true, + * "includeSafetyAttributes": true, * "aspectRatio": "9:16" * } * } @@ -111,6 +120,7 @@ export interface PredictRequestBody { safetyFilterLevel?: string; personGeneration?: string; // Maps to personFilterLevel includeRaiReason: boolean; + includeSafetyAttributes: boolean; }; } From cbef6c6e5b752c316104f9c834e0fe21b75c3ef1 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 26 Aug 2025 09:26:34 -0700 Subject: [PATCH 267/295] fix(ai): keep window-specific code out of Node bundle (#9225) --- .changeset/unlucky-goats-teach.md | 5 ++++ packages/ai/package.json | 2 ++ packages/ai/src/api.ts | 22 ++++++++--------- packages/ai/src/index.ts | 13 ++++++++-- ...test.ts => chrome-adapter-browser.test.ts} | 16 ++++++++++++- packages/ai/src/methods/chrome-adapter.ts | 24 ++++++++++++++++--- packages/ai/src/service.ts | 10 ++++++-- packages/ai/test-utils/convert-mocks.ts | 4 ++-- packages/ai/test-utils/mock-response.ts | 1 + packages/ai/test-utils/types.d.ts | 18 ++++++++++++++ 10 files changed, 94 insertions(+), 21 deletions(-) create mode 100644 .changeset/unlucky-goats-teach.md rename packages/ai/src/methods/{chrome-adapter.test.ts => chrome-adapter-browser.test.ts} (98%) create mode 100644 packages/ai/test-utils/types.d.ts diff --git a/.changeset/unlucky-goats-teach.md b/.changeset/unlucky-goats-teach.md new file mode 100644 index 00000000000..5e4bc68dc03 --- /dev/null +++ b/.changeset/unlucky-goats-teach.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Exclude ChromeAdapterImpl code from Node entry point. diff --git a/packages/ai/package.json b/packages/ai/package.json index 8000ec4e99d..a1fb8eefa20 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -39,7 +39,9 @@ "test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test", "test:skip-clone": "karma start", "test:browser": "yarn testsetup && karma start", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha --require ts-node/register --require src/index.node.ts 'src/**/!(*-browser)*.test.ts' --config ../../config/mocharc.node.js", "test:integration": "karma start --integration", + "test:integration:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha integration/**/*.test.ts --config ../../config/mocharc.node.js", "api-report": "api-extractor run --local --verbose", "typings:public": "node ../../scripts/build/use_typings.js ./dist/ai-public.d.ts", "trusted-type-check": "tsec -p tsconfig.json --noEmit" diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index 26d2904150d..2cb8e670277 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -32,8 +32,6 @@ import { AIError } from './errors'; import { AIModel, GenerativeModel, ImagenModel } from './models'; import { encodeInstanceIdentifier } from './helpers'; import { GoogleAIBackend } from './backend'; -import { ChromeAdapterImpl } from './methods/chrome-adapter'; -import { LanguageModel } from './types/language-model'; export { ChatSession } from './methods/chat-session'; export * from './requests/schema-builder'; @@ -124,15 +122,17 @@ export function getGenerativeModel( `Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })` ); } - let chromeAdapter: ChromeAdapterImpl | undefined; - // Do not initialize a ChromeAdapter if we are not in hybrid mode. - if (typeof window !== 'undefined' && hybridParams.mode) { - chromeAdapter = new ChromeAdapterImpl( - window.LanguageModel as LanguageModel, - hybridParams.mode, - hybridParams.onDeviceParams - ); - } + + /** + * An AIService registered by index.node.ts will not have a + * chromeAdapterFactory() method. + */ + const chromeAdapter = (ai as AIService).chromeAdapterFactory?.( + hybridParams.mode, + typeof window === 'undefined' ? undefined : window, + hybridParams.onDeviceParams + ); + return new GenerativeModel(ai, inCloudParams, requestOptions, chromeAdapter); } diff --git a/packages/ai/src/index.ts b/packages/ai/src/index.ts index 8ac9db61b6d..7758c316674 100644 --- a/packages/ai/src/index.ts +++ b/packages/ai/src/index.ts @@ -34,10 +34,12 @@ import { name, version } from '../package.json'; import { decodeInstanceIdentifier } from './helpers'; import { AIError } from './api'; import { AIErrorCode } from './types'; +import { chromeAdapterFactory } from './methods/chrome-adapter'; +import { LanguageModel } from './types/language-model'; declare global { interface Window { - [key: string]: unknown; + LanguageModel: LanguageModel; } } @@ -58,7 +60,14 @@ export function factory( const app = container.getProvider('app').getImmediate(); const auth = container.getProvider('auth-internal'); const appCheckProvider = container.getProvider('app-check-internal'); - return new AIService(app, backend, auth, appCheckProvider); + + return new AIService( + app, + backend, + auth, + appCheckProvider, + chromeAdapterFactory + ); } function registerAI(): void { diff --git a/packages/ai/src/methods/chrome-adapter.test.ts b/packages/ai/src/methods/chrome-adapter-browser.test.ts similarity index 98% rename from packages/ai/src/methods/chrome-adapter.test.ts rename to packages/ai/src/methods/chrome-adapter-browser.test.ts index 83610f3dcd6..5d5b2344ab6 100644 --- a/packages/ai/src/methods/chrome-adapter.test.ts +++ b/packages/ai/src/methods/chrome-adapter-browser.test.ts @@ -19,7 +19,7 @@ import { AIError } from '../errors'; import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; -import { ChromeAdapterImpl } from './chrome-adapter'; +import { chromeAdapterFactory, ChromeAdapterImpl } from './chrome-adapter'; import { Availability, LanguageModel, @@ -771,6 +771,20 @@ describe('ChromeAdapter', () => { }); }); +describe('chromeAdapterFactory', () => { + it('creates a populated ChromeAdapterImpl', () => { + const fakeLanguageModel = {} as LanguageModel; + const adapter = chromeAdapterFactory( + InferenceMode.PREFER_ON_DEVICE, + { LanguageModel: fakeLanguageModel } as Window, + { createOptions: {} } + ); + expect(adapter?.languageModelProvider).to.equal(fakeLanguageModel); + expect(adapter?.mode).to.equal(InferenceMode.PREFER_ON_DEVICE); + expect(adapter?.onDeviceParams.createOptions).to.exist; + }); +}); + // TODO: Move to using image from test-utils. const sampleBase64EncodedImage = '/9j/4QDeRXhpZgAASUkqAAgAAAAGABIBAwABAAAAAQAAABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAgAAABMCAwABAAAAAQAAAGmHBAABAAAAZgAAAAAAAABIAAAAAQAAAEgAAAABAAAABwAAkAcABAAAADAyMTABkQcABAAAAAECAwCGkgcAFgAAAMAAAAAAoAcABAAAADAxMDABoAMAAQAAAP//AAACoAQAAQAAAMgAAAADoAQAAQAAACwBAAAAAAAAQVNDSUkAAABQaWNzdW0gSUQ6IDM5MP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/CABEIASwAyAMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBAUGB//EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/9oADAMBAAIQAxAAAAHfA7ZFFgBQAAUUBQFBFABSUBQBQBZQUiqC7wAoigooQKACgCigKIoAosIKSigABWBdZAUAUAUQUUUAFIBQAWAFAUVFABSKoLqAKAKAKJVt4BvrFLAqKooArHgoQAoKiqDyKKoaiqhSqhCqgLFKHKdBiZmbodX5n2MbWHkdZS2kWhUBQIVUBwgUucv8Oad7nUzey3vPO5q4UrlOEWjzT0vhssDpea9Gy03BsqooKhCgCgCgHIcd0fN5DnuWHseY0Ureh+ZelLIqFq+f+gQJ5f6V5r6pE4i2ioDhCFVAVWrCiBxvJdlzFzVc56GjFoy4/a8d2q2TmpN3V1OF2MWp1/NrL0hzinRnO5Sdwc+L0Jz5HQLzyy9AYQYmDrZfXkyxVs5m4yVt3F0/M7l1YotpQnScdumqsFSb0yElm4zf5hjvV56bOtteViXq3ecRMbJgG+L4tzGqNyTDJNqMx5rfSHGRdpAcidPqLyFbuBeWrdmyONg7TJTBTrqZg3b6GGzbSzILYW8uSuF2hPG9l6uFdbPQRxzU8M2Lc62fpUJZNGC5TXAseNuVc2abO0pSKUsjdI+OdNoTzYc3fIANzF1LVTalK9KU72e1coa1TOqe3naA8inKGZ0QV5ZGzSywKWVrSAUROTjuno8lSLQbFq5kNrXsYAvQu5xmW9y18l0tjmrFu8ZM66C0nLabEsPGrT3xOlnIyXjkzC8tSxh2zRbWlsVNZtY6a9SKq1ZCd0rLHS17SPlgUtvpvatrVetlYJJZRpNcOOfmRaEN+s3Vctl0qCWs+PLljs19iWw+RdZEcU1VBFVUR6Kr5a6rplEzvnH5krF9Y33LnNFkqWIynAqZ3Zno3U03xO1mVY1HrGDxgOREpURkjiMXDUXOlsVpjRIJ0RXhix3KbUuzn6DLla6nK1RwFAKKK+GNsuigXReXW6mpRS2yWu6Zgr64Rq90abqclllYVJiJxIrAkI1JXRvJZoJJqUcY1yzmrvLnMLJX1QngWQrF9hTW01IZmwlt1F5bWtMTPruLc+fYltSVo83SKpnX/8QALRAAAQQCAQMDBAIBBQAAAAAAAQACAwQREgUQExQgITAVIjEyI0AkJTM0QXD/2gAIAQEAAQUC/wDH5Z2wu/scrHmBjg+P0hzXf0pGCSPjpnwT2bDa0LOWe6dEgCW06yYIWwRf0uVrbNdf79Grg2ZeUrxkMsco+CFleP4uRuyQvPITOjdyLzS4yy+Znqts7dtcbSZOgAB8V6Yw1nlziCE39obclR8EzZ4YrUM7vRy2PLVBpbT+Plv+Nn0RPZU42jJpc9HIwOhtqk8yU/j5dxMq+1YbrVaH2eUd/lsDpJG516zRMnjLSHRt0i+PlYss613Fli5OLBhOkwv1ShNG4PlDIqdzyunjd/l/k5NwFWu0dw/gMLlXhfFyHLD+SpGZbTq8GIR3Y7NCGKvRrd9fT5F4VgLxboXZ5ALXkgs8mFZt3I5vIvLzLYXnzL6lhfVYwvq9dfVqy5IEpzTG93618me0P9S5T96GPNQDWm+f8HifZuVlZWVlZXJnPILKysoytXsuUe0y27LHxzS92Y/ca72xzmWOW1cMcklSSKIMkbIzzYNrs8b6dO1HXYLsBaHAqS0yOTKyvLb37crZOQm5Bkcw5GFykuyqZ81iJ0mru9JgJ8bmHoGly1ds+KSNMikkXZsAduVo+5HKBwmW5mFzy5z70r43WJXEyuKz9ywjs8wzSQPdkuwUAcch/u9InavA0s2maqnMYpC1rmtjAV1zvHpVi1hiiQghz4cC8SsnUqxX0+svDrix9KgzLxeHHiiG/SX4+lyI8ZMFLVmgFz9nY2UELioNnqSRz5KEa/6AUpe0Miyrf8Dadnug6uQwOjgSyKye+WyIbAEgLuRoSxORwVLU2tTyOfJj2QlkY3ua8dGN0MhO2LmkK3bkgn7Ykjk4+KQ14BXj67YNkydqtE/VahagLVqwFo3f0PHlwe4NOSWRrh7agqxUEyZmGF9+IKG/G53Q7YPfaou9amEzV+wAI9BkY0k5PWtHOwy1d3V4zC38oKaq6WQfiw+FrIIqxXutiPRlfatWLVi0YvZTU4bDnVV4zkKpRrvUbS1F3tG4hbhbhbhS2WxtmmM0nHt0gysrZZWfR7rPXKysrZbFblblbruFZ990Nc7BCYpsxXdXcWy2WyysrPXuxrvMK7sa1ytF212120RqMZGFhY6BAoFArZZWVlZWfTC1zi+0c15y9+q1WgT4F33KOUl+0a7jMtfl2PTn4K+S0xPDoIe2srKyrE2vSGPuP7LF22/EEFq5dtybDlMAYMrZbLdOsgJ7t3KJj4xn4crK2QkKDgfTnpMThmNU1jXMbNogc/DlZWVno1+FsAvz6H5x0/KhZ7/GR0wgPd7tjD1x0f8Auoxs/wCHCwtemOuUx4ag8FZHV8bcqu33+LKysArt5WpWq1WOmShIQnSZBTBs4eyz1z8AKygvZaharC1RYsdQcESLcL8rJWVn0Z6gdG9MrKys9CAUWLtuWvUEhCRbDp7rZbLKCCygvx6s9AUCisBYRCPTKyUPQ0ooOKBK/8QAIhEAAwACAgIBBQAAAAAAAAAAAAEREBIgIQIwURMiMUBQ/9oACAEDAQE/Af5k9E9yWITC9S7RCCIQhCEGuyEcPFMTYrCYsxTrDYmVQTKhPouPJ9GyNj6iG7mEIRkZGPxZGR8aTofiRkZGM6OjY/OahNFp38lZWX5NkXxPtxuzZlNjZm5ubmxc01RqakIak4XhSl9NJxf6cJxvNCxCelMp/8QAIhEAAwACAgIBBQAAAAAAAAAAAAERECASMAIhIjFAQVBx/9oACAECAQE/Af1d6LumXZs5MTLhn51pR5WlKUulz5JLFLrR/XH8ITEIQhCCHld3IbRUesez2Px0jI8PERxIz5HyPZxRxWkIQmvI5FLil6Z137C9NJ2XFL0MhD//xAA2EAABAwEFBQcDBAEFAAAAAAABAAIRIQMQEjFBEyAiMlEEMDNSYXGRQIGhIzRCklAUQ1Nwcv/aAAgBAQAGPwL/AKfYHfyMfUttf+M1TXNyIpvHCQY+icw5OEI9ktdKBbR3sAmjZDZkxnW6TQI2HZK+a00CDG/Ri3Zm3mjonWNtGMZOTJgCdTCIaS8+ixOOCyCDLMU7sWVnQxJKaHEyMy2kqWyLSYxJwtHS5u/atiOK5z7USGmIQAHdktMONAsTnEn1WQKnojgjCdE21FAUW2b5I3aHStzZ1r3jP/d5uDbV1XyWgKzrAy3Xn+L+IXWTj5e8s2aRN2SOhVm1woXLDo1oQazmOSGLOK7hY9shYdckxvQDvGWvQxuMeBiIOSbNjs36kpjvKZXihSHhOfnhE0TuDDHrdaECGMdLu9w6khYncrBiKlBozJhWTHiHAqyd6Qms+VJsmfCwhh9k97C8EDqn/quZHlVO2Wi4e2OVO2KnamrxbIr/AGimi0OA9GL9qFXsZVeyPVezWirY2qq20H2Wbv6qy+E5hzFEFZgecKwI1Vh91bOGmV1B6K1Vr9t9vsN3mCqAm7N7SOjdE0NqQZTrTrc1ztCrJ4PC3VWDcQnF+FbvLhzfhYmmicMfKuF04skQ+eI6LFtBms0xhNXH4v2MVWIHhELCDiGvoqHWE6rWwadUHTJb5dQuE16ojaEjOt0OEX0ErDBk6IF7YnqjgYTGcLw3wpwOj2WqqFTNE4qnOViJWCaR0VXnKKKr/wAKTfJMlTEjVsolZXNoAIzRuBmEHWwaGnJzRRbTZ8PnCLZaGn0WS5KrCLM1WK0xD0OS8Jhn0RH+nZ/VeC1eC1eEFyflYHWsTkAuZ/yoZaf2Xij7hTtW/YLnb+Vzs+VLsvRybaEV6SjhENu2kNwN8yfbFoMcrf4p1o9pwikTQIl1nXQkXVXCGhYiYJ8rl+4tGTlAR5nR/IthQVS4j4WztHEnQlgVLX5YtFUwvFHyqWjflcy2r3WZZ5SjifiAyXpdha8hvRCGzwprA0kzWEABT3XCQPcKpCwsIy6IY/xRTjeD7ysAM+u5ov07LaHoVithx9JyvoB8LIfCyU7Ie+60sPG3MXHEeEZIVr7qoaUDQP6obR0x0CptPhBhDhN9Ci9xDoya0IutHusmt/iFBIXDakey8QlZ31c0fdTuY2wAeqxC0OI5yoxk+l+MWpb6XfrAV0WOyAprcOAn23ch8LLcxPxfK4XfKzCqVkhxqhquMrNZrNTzegWM0U6uP00rJThF2ar3WfdSPo5mAFDcuqwu3JYYN3EQAuZRKw4e+e3QhYYWI825hGt0aLJZd5kslxKBu5IuN2hnvc+4gIzdzQVhNfX6CqpuZX0VR39d83D6ckG7F/kafT0/xf8A/8QAKhABAAIBAwMDBAIDAQAAAAAAAQARITFBURBhcSCBkTChscHR8EBQ4fH/2gAIAQEAAT8h/wAiv8iof60/24fSvm0naH+R2aUdppQR8PVerRTWafXUA+lrvlRRsJt2f+xcK5o6rMHN0LZb9Fagaq0EyEPYezzAGwavL67l+jb1sex1ucH2lNKQvo1+4DXUq1qO8JQuOPmZPNWNPbllNUa93l+m+Nx3niXqZkfLEtIvwwS75Bt1qXL9H43mjIKjs5hxLIxhtWEwAKAMH07uBuNpYwtVXCGs7xLQcmZjdZmpBJoLnaFJ1hXpOcFSE2YaxxFP5/qcz+iXToFmTpK7yt+RC1GWVyrPaHXZjILVX8kNe0A+l+w+psg/PfTViLG0CD8QCO8wRgYDiC7aYcs8evd6Brtt3jBCFweZUJVb7fUI7W74YEcS8LFVhJzjk4dy8SodQh3BdmyEXRzd7TFspRGYByYeUzF14jPPEuXLly5cuX1voJWze2sQ9Q9zg+amaprCQ2IEoCSuY63Ir4MUahd+BmIVIZuUJECnsXWXLxBDX26+XmU6Xz/7B6iXK05n8hGGqPmbfyP/ACbwnQ2SxsPmU6p4Z+gVlGn8XL6L7f8AJtJ7Q/KUi17sMo5YxypaCW4JWPpGGnmOw2v8iFmYsfKLYjkdZeDFDDg0nxh+YLPL+3rAovb+8vPUvzA65saxNfuiJo4RLXF13F2lmFXuvaKkPabIc4ZYEFrumMtNnH9E5U7Xd/MEFXvNB7FuMe0c02mB3mVhstCBhU0/pNAtCaNTXRMJW6svWpfUs6vbSB84N+NZSDuiCsttdle72mPNFBy4gHLLvAbbzAzStbf3M1+rqfeaZZioic9GqZcBKxw6mYehtWyxgJ6A0l8UrYI2w+TpmbVfCc8e01A7G4Am8NmW9XzxHqqqOF68w02AWwwaR0UXXYymRduZhOHzFc3L8ydyHa660DiXiJbc7qbQ68TJeQN5lUp3IxjxlldJXAGhvzGQDjQla/mO1nlbX8SpaWtplxI3wfuMXhYM1gea6UwzwhqIoFb6IX3dfboerh4s/c7Ku7jYbcZBKfAP4hEIvg/xCqWcYJrnusF0L2ilrPtY/UeCdwsCgzQq1kzPaNZXE8vB0QuFCtP2R/SzWKmP5lZq66aINj8zdH3JY2L3b/EUWNVZT7SgKpYEv6iCaNkipsd5QBFfMK7/ADLhKuriEWio7PmWrwcAzdF4xALHlbKs4Z1wsK+kLuRnGtlWvBMmobbEsBvLa4Ra2bGWPmIdgfeWyhbQxMealG6ViFVJbmACj/e8MOBdG1M5KoWzlPfQP2TdqXYgVMbhBCOIfJjqCjWwEDunsDxEaxiLGc+YGofiC6/tph0fEbq08FzOOphG5asjVVFSkYRPapngwWxcu0vBdTFabfWF2AxjqRcMdpCHIuhjHRaq1shjR+YLyRaBfeDFw3B95hI3XGcc98n5iGQXeCM9ykB5sGtyXMwjvSacC9j0UgA0epLcxoY1vwIuGsVEyJgECgfuUxBo3SqX0bqmOle5Fwz9XSSp7y5TclPW+DjyysaQ2D7yoIZQUVASNWtGaMDyJZG1bMueKBkF4emONKdQe8fmlpZKmGwDaCjdRVzyl+r5RZctlwODPeW5l5eWnej0a07kyste7Cuz4iOp+IbRXiF0fvmcLfaBgGB59RCuYRi1grWpmq3zACxuMsW4ipmHSFCF5eEAxPoFO6HfPOX6g+h0Hr241UgcciUSu9EJR2iYsUkpMCjTWLHiCiA7Cd0TDl5ljaUzMJfQMGEBfQvMZ3mqnuQnZf4ej09wdMswMrA4BbDfiY6VK6VAgQ6e2d5Ei4qWqn5s+itCbuWLqhlWkq2LKEXLOty5cvqlICFMPQZcHouVl00QXXQwuRGdtTZDAmnruX12bcwwxnnJGlohhFSuj0Ybtvo6KU/mKNxw06XL6X6UuLMxjxEbIUS+eOldNT7zpWodT1r8S0So9Fsy1mBrWLawbfpjeawPRVbNOteu6hB2RJpKbpkjKiWOgWj0pKSXuUpKCg6bJfRcuX1GX0CxLzOdyKnhMtou0sa9L5JmoXcg2sE0PQOcoy+lstCp7dIO81QWXhJAJh0Zhme2lG0EaxxLeickGmHRljeW3gYGMiJWUqDT0rLS24nU3GkrAgLhBQ5orOopHhhHWKMs/9oADAMBAAIAAwAAABASIMVBgAVIggAJsGy6fNBiyj4Y5ptsnyTbFtvCz9pNNPGuqMCNo42YQIEExL6CRYMEGT8YCBzUGdVEHKQHraFgCRaW/wDNpnycuGNdceiyLtY4mcgOiOu29EEGuHlAnRrvBwEb0uqOJE43dRwqzkz2egbGwwUOslkwzPIcsSwSNhRUkWEw1v62L+JMcNPr2AmjywACL2YgqfCuq0/Cz+/jqnaGEcefx1OE4WV4cia8oyMQ8U8lMsIgsWO//8QAHREAAwACAwEBAAAAAAAAAAAAAAERECEgMVFBMP/aAAgBAwEBPxBc1+a/BIhCcITMI8QhCYQhCEJkvMQmYQhMwSNeZGhNUhCEIQb2JLs6VO48HoK5+AEVawVlRxOosomXwd8GnZFXhBRoo6jcWhEUOTSFpEsbUKcC6hquh+Q9qiTHo2Gy+i7hlYQVKEyMkG6xMadEsQVNWsKSdaxKa3svsSIaTUmSLsaJEyxoR7dxN2w294KG1dcCJhIQvQkXwVG3IpKLNtFFEf038E3ME6JsbQ4LKEhtzEIQgmkJBlpkEt46D4xkZcREF0PMJiix8T5k1yH+A//EAB4RAAMBAQADAQEBAAAAAAAAAAABERAhIDFBMFFh/9oACAECAQE/EPwf5PaPLlKXwo8u0pSlHxtGUpcdGmMo/RWlC6rOhZS5zhwLrp0UmC+CpFGXTp0aFzo0Khvgvd8QpR+8Uo8UY3hhO7WUKvQfs9qhB/Q1cMLofRRZwoyLzYIjmNwtyoqx5BNoX9YkbbejnwfUEgxiqXWPwCf4cfBQoKFzOCBKesbMOHCLwvBFnCFFE4bIRBUylKUqIyEEGxKimUpcjwmijeLKUuVFHlekUospdpk/Fii0nkmn/8QAJhABAAICAgICAgIDAQAAAAAAAQARITFBURBhcYGRobHBINHw4f/aAAgBAQABPxDweDX+J4P8jfk14NeVQJUNf4G/J4NeKleKh4JQyvDDwHipXivFQJUJUrxUrxUDuVK8ceArxUJUqVA8HioeK8VAzKglSoVUqVDLKhiV4rzUCoFwxKlSpXgPBAuVK8VKrwF+K8VApm5UCV4rxmVCVA81KlngPAY8V4qV1L8DfCB7N8RCCVTnDfgMeK8G5UJXgPJhh5NeefBszFrbCQytzUeUao/D74+vBr/AgAyf4TDfk8BC0HvMPJrzz5Du/sDX4afqAmGh09Z6tZ8y6HhnL0DxVZuAzNHW4FtX6iIo7J/LlggsaQei6lY9npH/AFNo2ptfvweTUuoeUhnWfias6ur9zmvJvwbOtJ6ixUpjK35UfuXT0sbc6a5cGnnUL5mcCXrzLchY3eC3HuH3Uh0/D9mofTOTtN9iw35PBr/Ac8U7vqA+qD5uBejEvV1kHSBKE5R22G1rFxXpUFJYPmYeA58heEtci8c45jURYWjAr6YsPtTBr6p1QtXvZiUhnAA9EqG/BL8GvF+HPAhZtt/Ep6IEFjWWXZEyZxhjcAsIVY6kJuM7G4jJYFaxpL6xBJXdgs7L3DZCXPuskrndJk1KfdVNat1CRLa/LF/QQxLhuX4PA/4VRxeHLBSZcWf99S27qvcugnIGo2dXu2sS82b2g/GU/MunLN0XKR9RXnZipcJeTeMnCR4FO+1/In8VEYLeinvEoIwVXoGXnxcJcGpfi/Fy21LB7I/QfuXRjHXqK8gK5zKKcge5qpOkLtH81MXGMwG1V9/qBRMNPJuMY1SJ6Zg5lwzDEepTJTCOyvUSXhBnJM/khigpQ1Qv9+L8DDEuGZcuXLmJy595j8JEMc8nuC1NlOYZQwYgoYo0vrHxDJYqMeAChgzKA1gouBzr1iKCjyip+TcPydMB03LYrV5B7uOogpwsP/EaDsTkPzzK6RwxgYYzbLC2ZleUPuA7/crA3mse/AtMIMvwuKgIR/JSndEl3GvmUJdIWrx7blVdY7bq36i1x4YU2iJHJpkW20V/ZNdWx0Fv1REywUgayt8QlCxGmUPVal73duXYUnWY+VQ5Vkvp1Ag0hWzxDsCsXKtreYa0/wDbifph/wDkpH0qKek5slT+CIaofwlXT1a/9MP+GH5h/wB0PqaXb0oftGVjP1D/ALmeGP0e9zIIYbq2kjuNCnKUn9MAvw3aQZgIXxSv8XKN2Iv0f+yWSW7IOyCu8DX+CATBIHSMWMyI3ofUAs5L8mJc6D+IMN6h7ePz/cKYvEpSSoVxhPc7rmPMHW38zcW1eWqOWAiW1MVH4jixHSNPq63CEMEwbVAtddYleJbjRl+6qUt1UOMD8x6hdbNH3OdTEKNn3uYnWIotw22VL6i1l282Y3BCipGSWhRzahznsOD76iAbC4lVV25rqG3MRWFkeviCur66Mct/MICcbEf7V7ghVYEpzTpqFMewB7H7lg2lxHBUByqDApdpbLOHlsg7m7CgEPbvqc3VboZs7UcmYEolD8gcGV/UE4ubQVrDspUiXl23DrBwRa6lX2IrB2HTqLvOkKi3pemJetOKgvvC7GOIgruagHj22wp4akoviWsDVT8BmYYyWD9LnBBXAfoYpCBtFdrgibPAo/mGxbGKaEFBQIhVs1BrbVCoYrPUGI40OBqpS3BgF9lwUjdg5be4fSpbgAbN6lmQ2Jw5hzC5q1qIuyH3/uYsKtqcFEDqLQa8BadkDjGVt7gxY52EBmfsodOLYW6TiLZmtcnpllt3zKfRULQeUNkDIQVQ9Ff5lSnC/dWRunxDrAWE/T/CKLUlTl81iG04NeTdNFhBjiqVjdUX+Suos14DB3m7/UOlfVaPshiMBuGIXw1mWaer/wCkSLT+T/2Jf936ilV+I/7iREraYdFtsuA2+RGbJMKx8lJYIdJ/YV/UCVpV0n+iYILiy/qU5FqApirNIF6v1dxZbfwGYPzAryVXA85iHAPqGrsbZbeqMsKUJysHNv7I/FtkKAdFZwOIWOYw1Zsbz+IgC2um/lhhRL7yfqGKZ7xXaBmJzVNxbsY+KgZZbSfOFX3AboByDpRcx0HPYk/gIWAGjp9wJXC+oGmdIVbhE/uPyjmUfUb9WRDCBz+3CRAtrtSX6iStHACJ00uQJG30oN/zKAObBH5ghoDQbNAZh0hYGwesRpxTYNn3M8XUvGTdAbhRDqWQ5RfxLD8hS2NZ0IWX0ypT1Yqgdo3KBm0HyWMsIkDDQv7QutMrDgjS9trKAWqfiVhQ0OEdVHLE4pVKutai4IfbcRaHwVMBT9kIKi7Mv43KuOoPkbgk66BXXANRgEnuq/qUdpdmQ/1HgPoCBsd/B+poNfRSMQzT7Vxof3CgoFBxqV1DBEmURG919Ra5zFyNa+O4EC9qA4O+YLAIWyXNPMVlScBr5qcc8llH2wMABLUvYO/cGGRtbVwVnqYQBQ1/lg49ExPtDEHJvqC8nyxGE4ZV9wS4xFo6tbFUaFKj1/b+ojAGFMH1RhzbxQv7shIe6Av4JyvmEsVZAvISkembc1pl36c0Hmqz+5VygUUjd0R6OEhZTwJxHTZzQpPUpWRUKrftCMsCANFcymG0C8uqmp7kBXsgC3pZW4zFwW+kJkYmEfZbK8MpBpD8za0H5LYpgE5HmLL4S6a/E4AHRiLberLAAIU3doNi6JaY16Kl3gMYQQpHqXCTGK7iiHAEfctwAMl1ACDZGZIjAHhP9gmxYd0uZuDgbf8AyJllcAPVzMwCAqjBDDZgm385nymeL8C93FMbMMoyZIXZLu/zBTUZr2mXdxLcTNsaNvzO1Ms51/cA1T5ifvUIfUIUCO6GYMBDWH8SyIsutf4gQfGEPKHVDNpOYIr0gO7gJRge4B5I+k+5R4RBU1OiEBXdSdBaaYgwASymJ0xOmNu0DxLy8HMxgR5IdcC4IhiA9koep6SYdwzbCrCJ8qWgo3cHRiW6i1t8uplil/Gm+EDlhl7+IQriMAIlZgIkN1wwlhiFNqmbEbag5Z+WVoNtRWRiYR/HxADMInphBTljsbtmU1Z/gbzMPSuJWSeADDBlpK9R844ZlatMdyuLdW9S1tSrb3KFEVL9Eq0s0bgUsaYAOAPipUv1LmagX4Lwxu4kjlTQJqPVKbt6jpQ8BuZKUtrtcE6f3BHMwzcvFNF7iaBOiwmzwsOjqWBytSlBIVYSImoGtQTiAMqnDiEA6geoV4hhglzidqIWLEpFPq4I5H7lBiHJntZbuDhMI21AlSVV7uN2K5gwnXtqV7OxsqN3aLINwxATklvqX8RQiHuNdXFDzHOdDEsiibDDMuKdysqyYxKoqwgiWhZDUs7auJaGZbGLNcNRmwMZ4mIAqoKcwvLy3uWlstiyyDpAe40mHDcNKMM4mrBo9Rql+0o0V4q6xLhQY9w1j6eBRspuziNNtwcwblPH35CF9ZnqSnZHWZbiUjAm7j7cIfkQo4s4nLrTcUFojCAm0WJlBumAvA0YCENztcMQS5Y+BCDbCzczZgiXYl6wgbC/MM1MTBZNUS1kgJOBItSqTRheZaluO2c2/Ex/A6gOYM4Z8LlvH4wctYPgKMrrNz0kaSFfBcQMbTjNkVebSsAZEYVpqUXFUIMTOEVEzSZaSS9QXSoEwwdZSWPNSnWYcxGiy1hd7QEtxE6VC8oBhFOZbOXuCXgQz1JRZhEsa8GAimGoqB4BcGhixA8DEQc3Fc1LW7gsweg3Lo024ah5Q0wDmHMZ3IicQl3RmGShHATpwWJEjhZUcytCWLOYRDCktgtnuAFhmYO5vRP/2Q=='; diff --git a/packages/ai/src/methods/chrome-adapter.ts b/packages/ai/src/methods/chrome-adapter.ts index 8fc4b23e665..a0ab509e335 100644 --- a/packages/ai/src/methods/chrome-adapter.ts +++ b/packages/ai/src/methods/chrome-adapter.ts @@ -48,9 +48,9 @@ export class ChromeAdapterImpl implements ChromeAdapter { private downloadPromise: Promise | undefined; private oldSession: LanguageModel | undefined; constructor( - private languageModelProvider: LanguageModel, - private mode: InferenceMode, - private onDeviceParams: OnDeviceParams = { + public languageModelProvider: LanguageModel, + public mode: InferenceMode, + public onDeviceParams: OnDeviceParams = { createOptions: { // Defaults to support image inputs for convenience. expectedInputs: [{ type: 'image' }] @@ -372,3 +372,21 @@ export class ChromeAdapterImpl implements ChromeAdapter { } as Response; } } + +/** + * Creates a ChromeAdapterImpl on demand. + */ +export function chromeAdapterFactory( + mode: InferenceMode, + window?: Window, + params?: OnDeviceParams +): ChromeAdapterImpl | undefined { + // Do not initialize a ChromeAdapter if we are not in hybrid mode. + if (typeof window !== 'undefined' && mode) { + return new ChromeAdapterImpl( + (window as Window).LanguageModel as LanguageModel, + mode, + params + ); + } +} diff --git a/packages/ai/src/service.ts b/packages/ai/src/service.ts index c5c9d9a036d..0beb8dda1c3 100644 --- a/packages/ai/src/service.ts +++ b/packages/ai/src/service.ts @@ -16,7 +16,7 @@ */ import { FirebaseApp, _FirebaseService } from '@firebase/app'; -import { AI, AIOptions } from './public-types'; +import { AI, AIOptions, InferenceMode, OnDeviceParams } from './public-types'; import { AppCheckInternalComponentName, FirebaseAppCheckInternal @@ -27,6 +27,7 @@ import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { Backend, VertexAIBackend } from './backend'; +import { ChromeAdapterImpl } from './methods/chrome-adapter'; export class AIService implements AI, _FirebaseService { auth: FirebaseAuthInternal | null; @@ -38,7 +39,12 @@ export class AIService implements AI, _FirebaseService { public app: FirebaseApp, public backend: Backend, authProvider?: Provider, - appCheckProvider?: Provider + appCheckProvider?: Provider, + public chromeAdapterFactory?: ( + mode: InferenceMode, + window?: Window, + params?: OnDeviceParams + ) => ChromeAdapterImpl | undefined ) { const appCheck = appCheckProvider?.getImmediate({ optional: true }); const auth = authProvider?.getImmediate({ optional: true }); diff --git a/packages/ai/test-utils/convert-mocks.ts b/packages/ai/test-utils/convert-mocks.ts index 4bac70d1d10..34233a73ace 100644 --- a/packages/ai/test-utils/convert-mocks.ts +++ b/packages/ai/test-utils/convert-mocks.ts @@ -19,6 +19,8 @@ const { readdirSync, readFileSync, writeFileSync } = require('node:fs'); const { join } = require('node:path'); +type BackendName = import('./types').BackendName; // Import type without triggering ES module detection + const MOCK_RESPONSES_DIR_PATH = join( __dirname, 'vertexai-sdk-test-data', @@ -26,8 +28,6 @@ const MOCK_RESPONSES_DIR_PATH = join( ); const MOCK_LOOKUP_OUTPUT_PATH = join(__dirname, 'mocks-lookup.ts'); -type BackendName = 'vertexAI' | 'googleAI'; - const mockDirs: Record = { vertexAI: join(MOCK_RESPONSES_DIR_PATH, 'vertexai'), googleAI: join(MOCK_RESPONSES_DIR_PATH, 'googleai') diff --git a/packages/ai/test-utils/mock-response.ts b/packages/ai/test-utils/mock-response.ts index 5128ddabe74..4963bcbb193 100644 --- a/packages/ai/test-utils/mock-response.ts +++ b/packages/ai/test-utils/mock-response.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { BackendName } from './types'; import { vertexAIMocksLookup, googleAIMocksLookup } from './mocks-lookup'; const mockSetMaps: Record> = { diff --git a/packages/ai/test-utils/types.d.ts b/packages/ai/test-utils/types.d.ts new file mode 100644 index 00000000000..00b99eef55a --- /dev/null +++ b/packages/ai/test-utils/types.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 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. + */ + +export type BackendName = 'vertexAI' | 'googleAI'; From 984086b0b1bd607d3aac4cbb8400bc61416e2959 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 27 Aug 2025 10:01:36 -0400 Subject: [PATCH 268/295] feat(ai): add support for the Live API (#9224) --- .changeset/blue-pets-sin.md | 6 + common/api-review/ai.api.md | 125 +++++ docs-devsite/_toc.yaml | 24 + .../ai.audioconversationcontroller.md | 41 ++ docs-devsite/ai.functioncall.md | 13 + docs-devsite/ai.functionresponse.md | 13 + docs-devsite/ai.livegenerationconfig.md | 139 +++++ docs-devsite/ai.livegenerativemodel.md | 109 ++++ docs-devsite/ai.livemodelparams.md | 87 +++ docs-devsite/ai.liveservercontent.md | 81 +++ docs-devsite/ai.liveservertoolcall.md | 53 ++ .../ai.liveservertoolcallcancellation.md | 53 ++ docs-devsite/ai.livesession.md | 190 +++++++ docs-devsite/ai.md | 149 ++++++ docs-devsite/ai.prebuiltvoiceconfig.md | 43 ++ docs-devsite/ai.speechconfig.md | 41 ++ .../ai.startaudioconversationoptions.md | 41 ++ docs-devsite/ai.voiceconfig.md | 41 ++ packages/ai/integration/constants.ts | 25 + packages/ai/integration/live.test.ts | 327 ++++++++++++ .../ai/integration/sample-data/hello-audio.ts | 19 + packages/ai/src/api.test.ts | 67 ++- packages/ai/src/api.ts | 45 +- packages/ai/src/constants.ts | 2 +- .../src/methods/live-session-helpers.test.ts | 356 +++++++++++++ .../ai/src/methods/live-session-helpers.ts | 497 ++++++++++++++++++ packages/ai/src/methods/live-session.test.ts | 294 +++++++++++ packages/ai/src/methods/live-session.ts | 234 +++++++++ packages/ai/src/models/index.ts | 1 + .../src/models/live-generative-model.test.ts | 171 ++++++ .../ai/src/models/live-generative-model.ts | 125 +++++ packages/ai/src/requests/request.ts | 27 +- packages/ai/src/types/content.ts | 17 + packages/ai/src/types/enums.ts | 7 +- packages/ai/src/types/error.ts | 3 + packages/ai/src/types/live-responses.ts | 59 +++ packages/ai/src/types/requests.ts | 100 ++++ packages/ai/src/types/responses.ts | 70 +++ packages/ai/src/websocket.test.ts | 269 ++++++++++ packages/ai/src/websocket.ts | 241 +++++++++ .../ai/test-utils/{types.d.ts => types.ts} | 0 41 files changed, 4197 insertions(+), 8 deletions(-) create mode 100644 .changeset/blue-pets-sin.md create mode 100644 docs-devsite/ai.audioconversationcontroller.md create mode 100644 docs-devsite/ai.livegenerationconfig.md create mode 100644 docs-devsite/ai.livegenerativemodel.md create mode 100644 docs-devsite/ai.livemodelparams.md create mode 100644 docs-devsite/ai.liveservercontent.md create mode 100644 docs-devsite/ai.liveservertoolcall.md create mode 100644 docs-devsite/ai.liveservertoolcallcancellation.md create mode 100644 docs-devsite/ai.livesession.md create mode 100644 docs-devsite/ai.prebuiltvoiceconfig.md create mode 100644 docs-devsite/ai.speechconfig.md create mode 100644 docs-devsite/ai.startaudioconversationoptions.md create mode 100644 docs-devsite/ai.voiceconfig.md create mode 100644 packages/ai/integration/live.test.ts create mode 100644 packages/ai/integration/sample-data/hello-audio.ts create mode 100644 packages/ai/src/methods/live-session-helpers.test.ts create mode 100644 packages/ai/src/methods/live-session-helpers.ts create mode 100644 packages/ai/src/methods/live-session.test.ts create mode 100644 packages/ai/src/methods/live-session.ts create mode 100644 packages/ai/src/models/live-generative-model.test.ts create mode 100644 packages/ai/src/models/live-generative-model.ts create mode 100644 packages/ai/src/types/live-responses.ts create mode 100644 packages/ai/src/websocket.test.ts create mode 100644 packages/ai/src/websocket.ts rename packages/ai/test-utils/{types.d.ts => types.ts} (100%) diff --git a/.changeset/blue-pets-sin.md b/.changeset/blue-pets-sin.md new file mode 100644 index 00000000000..6e27789956c --- /dev/null +++ b/.changeset/blue-pets-sin.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Add support for the Gemini Live API. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 9210a76f20d..6d70313a3af 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -41,6 +41,7 @@ export const AIErrorCode: { readonly REQUEST_ERROR: "request-error"; readonly RESPONSE_ERROR: "response-error"; readonly FETCH_ERROR: "fetch-error"; + readonly SESSION_CLOSED: "session-closed"; readonly INVALID_CONTENT: "invalid-content"; readonly API_NOT_ENABLED: "api-not-enabled"; readonly INVALID_SCHEMA: "invalid-schema"; @@ -94,6 +95,11 @@ export class ArraySchema extends Schema { toJSON(): SchemaRequest; } +// @beta +export interface AudioConversationController { + stop: () => Promise; +} + // @public export abstract class Backend { protected constructor(type: BackendType); @@ -290,6 +296,7 @@ export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; export interface FunctionCall { // (undocumented) args: object; + id?: string; // (undocumented) name: string; } @@ -342,6 +349,7 @@ export interface FunctionDeclarationsTool { // @public export interface FunctionResponse { + id?: string; // (undocumented) name: string; // (undocumented) @@ -480,6 +488,9 @@ export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridPara // @beta export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; +// @beta +export function getLiveGenerativeModel(ai: AI, modelParams: LiveModelParams): LiveGenerativeModel; + // @public export class GoogleAIBackend extends Backend { constructor(); @@ -813,6 +824,96 @@ export interface LanguageModelPromptOptions { responseConstraint?: object; } +// @beta +export interface LiveGenerationConfig { + frequencyPenalty?: number; + maxOutputTokens?: number; + presencePenalty?: number; + responseModalities?: ResponseModality[]; + speechConfig?: SpeechConfig; + temperature?: number; + topK?: number; + topP?: number; +} + +// @beta +export class LiveGenerativeModel extends AIModel { + // Warning: (ae-forgotten-export) The symbol "WebSocketHandler" needs to be exported by the entry point index.d.ts + // + // @internal + constructor(ai: AI, modelParams: LiveModelParams, + _webSocketHandler: WebSocketHandler); + connect(): Promise; + // (undocumented) + generationConfig: LiveGenerationConfig; + // (undocumented) + systemInstruction?: Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; + } + +// @beta +export interface LiveModelParams { + // (undocumented) + generationConfig?: LiveGenerationConfig; + // (undocumented) + model: string; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @beta +export const LiveResponseType: { + SERVER_CONTENT: string; + TOOL_CALL: string; + TOOL_CALL_CANCELLATION: string; +}; + +// @beta +export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveResponseType]; + +// @beta +export interface LiveServerContent { + interrupted?: boolean; + modelTurn?: Content; + turnComplete?: boolean; + // (undocumented) + type: 'serverContent'; +} + +// @beta +export interface LiveServerToolCall { + functionCalls: FunctionCall[]; + // (undocumented) + type: 'toolCall'; +} + +// @beta +export interface LiveServerToolCallCancellation { + functionIds: string[]; + // (undocumented) + type: 'toolCallCancellation'; +} + +// @beta +export class LiveSession { + // @internal + constructor(webSocketHandler: WebSocketHandler, serverMessages: AsyncGenerator); + close(): Promise; + inConversation: boolean; + isClosed: boolean; + receive(): AsyncGenerator; + send(request: string | Array, turnComplete?: boolean): Promise; + sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise; + sendMediaStream(mediaChunkStream: ReadableStream): Promise; + } + // @public export const Modality: { readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED"; @@ -885,6 +986,11 @@ export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionRespon // @public export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; +// @beta +export interface PrebuiltVoiceConfig { + voiceName?: string; +} + // @public export interface PromptFeedback { // (undocumented) @@ -904,6 +1010,7 @@ export interface RequestOptions { export const ResponseModality: { readonly TEXT: "TEXT"; readonly IMAGE: "IMAGE"; + readonly AUDIO: "AUDIO"; }; // @beta @@ -1048,6 +1155,19 @@ export interface Segment { text: string; } +// @beta +export interface SpeechConfig { + voiceConfig?: VoiceConfig; +} + +// @beta +export function startAudioConversation(liveSession: LiveSession, options?: StartAudioConversationOptions): Promise; + +// @beta +export interface StartAudioConversationOptions { + functionCallingHandler?: (functionCalls: LiveServerToolCall['functionCalls']) => Promise; +} + // @public export interface StartChatParams extends BaseParams { // (undocumented) @@ -1130,6 +1250,11 @@ export interface VideoMetadata { startOffset: string; } +// @beta +export interface VoiceConfig { + prebuiltVoiceConfig?: PrebuiltVoiceConfig; +} + // @public (undocumented) export interface WebAttribution { // (undocumented) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index da7c2500894..9161f501aa3 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -16,6 +16,8 @@ toc: path: /docs/reference/js/ai.anyofschema.md - title: ArraySchema path: /docs/reference/js/ai.arrayschema.md + - title: AudioConversationController + path: /docs/reference/js/ai.audioconversationcontroller.md - title: Backend path: /docs/reference/js/ai.backend.md - title: BaseParams @@ -124,6 +126,20 @@ toc: path: /docs/reference/js/ai.languagemodelmessagecontent.md - title: LanguageModelPromptOptions path: /docs/reference/js/ai.languagemodelpromptoptions.md + - title: LiveGenerationConfig + path: /docs/reference/js/ai.livegenerationconfig.md + - title: LiveGenerativeModel + path: /docs/reference/js/ai.livegenerativemodel.md + - title: LiveModelParams + path: /docs/reference/js/ai.livemodelparams.md + - title: LiveServerContent + path: /docs/reference/js/ai.liveservercontent.md + - title: LiveServerToolCall + path: /docs/reference/js/ai.liveservertoolcall.md + - title: LiveServerToolCallCancellation + path: /docs/reference/js/ai.liveservertoolcallcancellation.md + - title: LiveSession + path: /docs/reference/js/ai.livesession.md - title: ModalityTokenCount path: /docs/reference/js/ai.modalitytokencount.md - title: ModelParams @@ -136,6 +152,8 @@ toc: path: /docs/reference/js/ai.objectschemarequest.md - title: OnDeviceParams path: /docs/reference/js/ai.ondeviceparams.md + - title: PrebuiltVoiceConfig + path: /docs/reference/js/ai.prebuiltvoiceconfig.md - title: PromptFeedback path: /docs/reference/js/ai.promptfeedback.md - title: RequestOptions @@ -160,6 +178,10 @@ toc: path: /docs/reference/js/ai.searchentrypoint.md - title: Segment path: /docs/reference/js/ai.segment.md + - title: SpeechConfig + path: /docs/reference/js/ai.speechconfig.md + - title: StartAudioConversationOptions + path: /docs/reference/js/ai.startaudioconversationoptions.md - title: StartChatParams path: /docs/reference/js/ai.startchatparams.md - title: StringSchema @@ -176,6 +198,8 @@ toc: path: /docs/reference/js/ai.vertexaibackend.md - title: VideoMetadata path: /docs/reference/js/ai.videometadata.md + - title: VoiceConfig + path: /docs/reference/js/ai.voiceconfig.md - title: WebAttribution path: /docs/reference/js/ai.webattribution.md - title: WebGroundingChunk diff --git a/docs-devsite/ai.audioconversationcontroller.md b/docs-devsite/ai.audioconversationcontroller.md new file mode 100644 index 00000000000..18820a2fe55 --- /dev/null +++ b/docs-devsite/ai.audioconversationcontroller.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AudioConversationController interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A controller for managing an active audio conversation. + +Signature: + +```typescript +export interface AudioConversationController +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [stop](./ai.audioconversationcontroller.md#audioconversationcontrollerstop) | () => Promise<void> | (Public Preview) Stops the audio conversation, closes the microphone connection, and cleans up resources. Returns a promise that resolves when cleanup is complete. | + +## AudioConversationController.stop + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Stops the audio conversation, closes the microphone connection, and cleans up resources. Returns a promise that resolves when cleanup is complete. + +Signature: + +```typescript +stop: () => Promise; +``` diff --git a/docs-devsite/ai.functioncall.md b/docs-devsite/ai.functioncall.md index 1c789784fe1..b0bb2424a10 100644 --- a/docs-devsite/ai.functioncall.md +++ b/docs-devsite/ai.functioncall.md @@ -23,6 +23,7 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | | [args](./ai.functioncall.md#functioncallargs) | object | | +| [id](./ai.functioncall.md#functioncallid) | string | The id of the function call. This must be sent back in the associated [FunctionResponse](./ai.functionresponse.md#functionresponse_interface). | | [name](./ai.functioncall.md#functioncallname) | string | | ## FunctionCall.args @@ -33,6 +34,18 @@ export interface FunctionCall args: object; ``` +## FunctionCall.id + +The id of the function call. This must be sent back in the associated [FunctionResponse](./ai.functionresponse.md#functionresponse_interface). + +This property is only supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`. + +Signature: + +```typescript +id?: string; +``` + ## FunctionCall.name Signature: diff --git a/docs-devsite/ai.functionresponse.md b/docs-devsite/ai.functionresponse.md index e0838cf515a..980d964f703 100644 --- a/docs-devsite/ai.functionresponse.md +++ b/docs-devsite/ai.functionresponse.md @@ -22,9 +22,22 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | +| [id](./ai.functionresponse.md#functionresponseid) | string | The id of the [FunctionCall](./ai.functioncall.md#functioncall_interface). | | [name](./ai.functionresponse.md#functionresponsename) | string | | | [response](./ai.functionresponse.md#functionresponseresponse) | object | | +## FunctionResponse.id + +The id of the [FunctionCall](./ai.functioncall.md#functioncall_interface). + +This property is only supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`. + +Signature: + +```typescript +id?: string; +``` + ## FunctionResponse.name Signature: diff --git a/docs-devsite/ai.livegenerationconfig.md b/docs-devsite/ai.livegenerationconfig.md new file mode 100644 index 00000000000..1a920afa1e7 --- /dev/null +++ b/docs-devsite/ai.livegenerationconfig.md @@ -0,0 +1,139 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveGenerationConfig interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation. + +Signature: + +```typescript +export interface LiveGenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [frequencyPenalty](./ai.livegenerationconfig.md#livegenerationconfigfrequencypenalty) | number | (Public Preview) Frequency penalties. | +| [maxOutputTokens](./ai.livegenerationconfig.md#livegenerationconfigmaxoutputtokens) | number | (Public Preview) Specifies the maximum number of tokens that can be generated in the response. The number of tokens per word varies depending on the language outputted. Is unbounded by default. | +| [presencePenalty](./ai.livegenerationconfig.md#livegenerationconfigpresencepenalty) | number | (Public Preview) Positive penalties. | +| [responseModalities](./ai.livegenerationconfig.md#livegenerationconfigresponsemodalities) | [ResponseModality](./ai.md#responsemodality)\[\] | (Public Preview) The modalities of the response. | +| [speechConfig](./ai.livegenerationconfig.md#livegenerationconfigspeechconfig) | [SpeechConfig](./ai.speechconfig.md#speechconfig_interface) | (Public Preview) Configuration for speech synthesis. | +| [temperature](./ai.livegenerationconfig.md#livegenerationconfigtemperature) | number | (Public Preview) Controls the degree of randomness in token selection. A temperature value of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible. | +| [topK](./ai.livegenerationconfig.md#livegenerationconfigtopk) | number | (Public Preview) Changes how the model selects token for output. A topK value of 1 means the select token is the most probable among all tokens in the model's vocabulary, while a topK value 3 means that the next token is selected from among the 3 most probably using probabilities sampled. Tokens are then further filtered with the highest selected temperature sampling. Defaults to 40 if unspecified. | +| [topP](./ai.livegenerationconfig.md#livegenerationconfigtopp) | number | (Public Preview) Changes how the model selects tokens for output. Tokens are selected from the most to least probable until the sum of their probabilities equals the topP value. For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1 respectively and the topP value is 0.5, then the model will select either A or B as the next token by using the temperature and exclude C as a candidate. Defaults to 0.95 if unset. | + +## LiveGenerationConfig.frequencyPenalty + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Frequency penalties. + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## LiveGenerationConfig.maxOutputTokens + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Specifies the maximum number of tokens that can be generated in the response. The number of tokens per word varies depending on the language outputted. Is unbounded by default. + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## LiveGenerationConfig.presencePenalty + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Positive penalties. + +Signature: + +```typescript +presencePenalty?: number; +``` + +## LiveGenerationConfig.responseModalities + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The modalities of the response. + +Signature: + +```typescript +responseModalities?: ResponseModality[]; +``` + +## LiveGenerationConfig.speechConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration for speech synthesis. + +Signature: + +```typescript +speechConfig?: SpeechConfig; +``` + +## LiveGenerationConfig.temperature + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Controls the degree of randomness in token selection. A `temperature` value of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible. + +Signature: + +```typescript +temperature?: number; +``` + +## LiveGenerationConfig.topK + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Changes how the model selects token for output. A `topK` value of 1 means the select token is the most probable among all tokens in the model's vocabulary, while a `topK` value 3 means that the next token is selected from among the 3 most probably using probabilities sampled. Tokens are then further filtered with the highest selected `temperature` sampling. Defaults to 40 if unspecified. + +Signature: + +```typescript +topK?: number; +``` + +## LiveGenerationConfig.topP + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Changes how the model selects tokens for output. Tokens are selected from the most to least probable until the sum of their probabilities equals the `topP` value. For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1 respectively and the `topP` value is 0.5, then the model will select either A or B as the next token by using the `temperature` and exclude C as a candidate. Defaults to 0.95 if unset. + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/ai.livegenerativemodel.md b/docs-devsite/ai.livegenerativemodel.md new file mode 100644 index 00000000000..7c52cad1a33 --- /dev/null +++ b/docs-devsite/ai.livegenerativemodel.md @@ -0,0 +1,109 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveGenerativeModel class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini. + +This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LiveGenerativeModel` class. + +Signature: + +```typescript +export declare class LiveGenerativeModel extends AIModel +``` +Extends: [AIModel](./ai.aimodel.md#aimodel_class) + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./ai.livegenerativemodel.md#livegenerativemodelgenerationconfig) | | [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) | +| [systemInstruction](./ai.livegenerativemodel.md#livegenerativemodelsysteminstruction) | | [Content](./ai.content.md#content_interface) | (Public Preview) | +| [toolConfig](./ai.livegenerativemodel.md#livegenerativemodeltoolconfig) | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | (Public Preview) | +| [tools](./ai.livegenerativemodel.md#livegenerativemodeltools) | | [Tool](./ai.md#tool)\[\] | (Public Preview) | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect) | | (Public Preview) Starts a [LiveSession](./ai.livesession.md#livesession_class). | + +## LiveGenerativeModel.generationConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +generationConfig: LiveGenerationConfig; +``` + +## LiveGenerativeModel.systemInstruction + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## LiveGenerativeModel.toolConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## LiveGenerativeModel.tools + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +tools?: Tool[]; +``` + +## LiveGenerativeModel.connect() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Starts a [LiveSession](./ai.livesession.md#livesession_class). + +Signature: + +```typescript +connect(): Promise; +``` +Returns: + +Promise<[LiveSession](./ai.livesession.md#livesession_class)> + +A [LiveSession](./ai.livesession.md#livesession_class). + +#### Exceptions + +If the connection failed to be established with the server. + diff --git a/docs-devsite/ai.livemodelparams.md b/docs-devsite/ai.livemodelparams.md new file mode 100644 index 00000000000..fddca4f0e14 --- /dev/null +++ b/docs-devsite/ai.livemodelparams.md @@ -0,0 +1,87 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveModelParams interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Params passed to [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). + +Signature: + +```typescript +export interface LiveModelParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [generationConfig](./ai.livemodelparams.md#livemodelparamsgenerationconfig) | [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) | +| [model](./ai.livemodelparams.md#livemodelparamsmodel) | string | (Public Preview) | +| [systemInstruction](./ai.livemodelparams.md#livemodelparamssysteminstruction) | string \| [Part](./ai.md#part) \| [Content](./ai.content.md#content_interface) | (Public Preview) | +| [toolConfig](./ai.livemodelparams.md#livemodelparamstoolconfig) | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | (Public Preview) | +| [tools](./ai.livemodelparams.md#livemodelparamstools) | [Tool](./ai.md#tool)\[\] | (Public Preview) | + +## LiveModelParams.generationConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +generationConfig?: LiveGenerationConfig; +``` + +## LiveModelParams.model + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +model: string; +``` + +## LiveModelParams.systemInstruction + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +systemInstruction?: string | Part | Content; +``` + +## LiveModelParams.toolConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## LiveModelParams.tools + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +tools?: Tool[]; +``` diff --git a/docs-devsite/ai.liveservercontent.md b/docs-devsite/ai.liveservercontent.md new file mode 100644 index 00000000000..f9c3ca1de79 --- /dev/null +++ b/docs-devsite/ai.liveservercontent.md @@ -0,0 +1,81 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveServerContent interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An incremental content update from the model. + +Signature: + +```typescript +export interface LiveServerContent +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [interrupted](./ai.liveservercontent.md#liveservercontentinterrupted) | boolean | (Public Preview) Indicates whether the model was interrupted by the client. An interruption occurs when the client sends a message before the model finishes it's turn. This is undefined if the model was not interrupted. | +| [modelTurn](./ai.liveservercontent.md#liveservercontentmodelturn) | [Content](./ai.content.md#content_interface) | (Public Preview) The content that the model has generated as part of the current conversation with the user. | +| [turnComplete](./ai.liveservercontent.md#liveservercontentturncomplete) | boolean | (Public Preview) Indicates whether the turn is complete. This is undefined if the turn is not complete. | +| [type](./ai.liveservercontent.md#liveservercontenttype) | 'serverContent' | (Public Preview) | + +## LiveServerContent.interrupted + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Indicates whether the model was interrupted by the client. An interruption occurs when the client sends a message before the model finishes it's turn. This is `undefined` if the model was not interrupted. + +Signature: + +```typescript +interrupted?: boolean; +``` + +## LiveServerContent.modelTurn + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The content that the model has generated as part of the current conversation with the user. + +Signature: + +```typescript +modelTurn?: Content; +``` + +## LiveServerContent.turnComplete + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Indicates whether the turn is complete. This is `undefined` if the turn is not complete. + +Signature: + +```typescript +turnComplete?: boolean; +``` + +## LiveServerContent.type + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +type: 'serverContent'; +``` diff --git a/docs-devsite/ai.liveservertoolcall.md b/docs-devsite/ai.liveservertoolcall.md new file mode 100644 index 00000000000..51ef6bb5d4b --- /dev/null +++ b/docs-devsite/ai.liveservertoolcall.md @@ -0,0 +1,53 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveServerToolCall interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A request from the model for the client to execute one or more functions. + +Signature: + +```typescript +export interface LiveServerToolCall +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionCalls](./ai.liveservertoolcall.md#liveservertoolcallfunctioncalls) | [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\] | (Public Preview) An array of function calls to run. | +| [type](./ai.liveservertoolcall.md#liveservertoolcalltype) | 'toolCall' | (Public Preview) | + +## LiveServerToolCall.functionCalls + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An array of function calls to run. + +Signature: + +```typescript +functionCalls: FunctionCall[]; +``` + +## LiveServerToolCall.type + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +type: 'toolCall'; +``` diff --git a/docs-devsite/ai.liveservertoolcallcancellation.md b/docs-devsite/ai.liveservertoolcallcancellation.md new file mode 100644 index 00000000000..2e9a63a81e7 --- /dev/null +++ b/docs-devsite/ai.liveservertoolcallcancellation.md @@ -0,0 +1,53 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveServerToolCallCancellation interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Notification to cancel a previous function call triggered by [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface). + +Signature: + +```typescript +export interface LiveServerToolCallCancellation +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionIds](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellationfunctionids) | string\[\] | (Public Preview) IDs of function calls that were cancelled. These refer to the id property of a [FunctionCall](./ai.functioncall.md#functioncall_interface). | +| [type](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellationtype) | 'toolCallCancellation' | (Public Preview) | + +## LiveServerToolCallCancellation.functionIds + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +IDs of function calls that were cancelled. These refer to the `id` property of a [FunctionCall](./ai.functioncall.md#functioncall_interface). + +Signature: + +```typescript +functionIds: string[]; +``` + +## LiveServerToolCallCancellation.type + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +type: 'toolCallCancellation'; +``` diff --git a/docs-devsite/ai.livesession.md b/docs-devsite/ai.livesession.md new file mode 100644 index 00000000000..6ae2cde711c --- /dev/null +++ b/docs-devsite/ai.livesession.md @@ -0,0 +1,190 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# LiveSession class +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Represents an active, real-time, bidirectional conversation with the model. + +This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect). + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LiveSession` class. + +Signature: + +```typescript +export declare class LiveSession +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [inConversation](./ai.livesession.md#livesessioninconversation) | | boolean | (Public Preview) Indicates whether this Live session is being controlled by an AudioConversationController. | +| [isClosed](./ai.livesession.md#livesessionisclosed) | | boolean | (Public Preview) Indicates whether this Live session is closed. | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [close()](./ai.livesession.md#livesessionclose) | | (Public Preview) Closes this session. All methods on this session will throw an error once this resolves. | +| [receive()](./ai.livesession.md#livesessionreceive) | | (Public Preview) Yields messages received from the server. This can only be used by one consumer at a time. | +| [send(request, turnComplete)](./ai.livesession.md#livesessionsend) | | (Public Preview) Sends content to the server. | +| [sendMediaChunks(mediaChunks)](./ai.livesession.md#livesessionsendmediachunks) | | (Public Preview) Sends realtime input to the server. | +| [sendMediaStream(mediaChunkStream)](./ai.livesession.md#livesessionsendmediastream) | | (Public Preview) Sends a stream of [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface). | + +## LiveSession.inConversation + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Indicates whether this Live session is being controlled by an `AudioConversationController`. + +Signature: + +```typescript +inConversation: boolean; +``` + +## LiveSession.isClosed + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Indicates whether this Live session is closed. + +Signature: + +```typescript +isClosed: boolean; +``` + +## LiveSession.close() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Closes this session. All methods on this session will throw an error once this resolves. + +Signature: + +```typescript +close(): Promise; +``` +Returns: + +Promise<void> + +## LiveSession.receive() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Yields messages received from the server. This can only be used by one consumer at a time. + +Signature: + +```typescript +receive(): AsyncGenerator; +``` +Returns: + +AsyncGenerator<[LiveServerContent](./ai.liveservercontent.md#liveservercontent_interface) \| [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface) \| [LiveServerToolCallCancellation](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellation_interface)> + +An `AsyncGenerator` that yields server messages as they arrive. + +#### Exceptions + +If the session is already closed, or if we receive a response that we don't support. + +## LiveSession.send() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Sends content to the server. + +Signature: + +```typescript +send(request: string | Array, turnComplete?: boolean): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./ai.md#part)> | The message to send to the model. | +| turnComplete | boolean | Indicates if the turn is complete. Defaults to false. | + +Returns: + +Promise<void> + +#### Exceptions + +If this session has been closed. + +## LiveSession.sendMediaChunks() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Sends realtime input to the server. + +Signature: + +```typescript +sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| mediaChunks | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface)\[\] | The media chunks to send. | + +Returns: + +Promise<void> + +#### Exceptions + +If this session has been closed. + +## LiveSession.sendMediaStream() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Sends a stream of [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface). + +Signature: + +```typescript +sendMediaStream(mediaChunkStream: ReadableStream): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| mediaChunkStream | ReadableStream<[GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface)> | The stream of [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) to send. | + +Returns: + +Promise<void> + +#### Exceptions + +If this session has been closed. + diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 3c7669204a1..c40d37d895e 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -21,8 +21,11 @@ The Firebase AI Web SDK. | function(ai, ...) | | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | | [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| [getLiveGenerativeModel(ai, modelParams)](./ai.md#getlivegenerativemodel_f2099ac) | (Public Preview) Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.The Live API is only supported in modern browser windows and Node >= 22. | | function(container, ...) | | [factory(container, { instanceIdentifier })](./ai.md#factory_6581aeb) | | +| function(liveSession, ...) | +| [startAudioConversation(liveSession, options)](./ai.md#startaudioconversation_01c8e7f) | (Public Preview) Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. | ## Classes @@ -40,6 +43,8 @@ The Firebase AI Web SDK. | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | | [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./ai.integerschema.md#integerschema_class) | Schema class for "integer" types. | +| [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) | (Public Preview) Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). | +| [LiveSession](./ai.livesession.md#livesession_class) | (Public Preview) Represents an active, real-time, bidirectional conversation with the model.This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect). | | [NumberSchema](./ai.numberschema.md#numberschema_class) | Schema class for "number" types. | | [ObjectSchema](./ai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | | [Schema](./ai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | @@ -52,6 +57,7 @@ The Firebase AI Web SDK. | --- | --- | | [AI](./ai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./ai.md#getai_a94a413). | | [AIOptions](./ai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | +| [AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface) | (Public Preview) A controller for managing an active audio conversation. | | [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | | [Citation](./ai.citation.md#citation_interface) | A single citation. | @@ -98,10 +104,16 @@ The Firebase AI Web SDK. | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | (EXPERIMENTAL) An on-device language model message. | | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | (EXPERIMENTAL) An on-device language model content object. | | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (EXPERIMENTAL) Options for an on-device language model prompt. | +| [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation. | +| [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | (Public Preview) Params passed to [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). | +| [LiveServerContent](./ai.liveservercontent.md#liveservercontent_interface) | (Public Preview) An incremental content update from the model. | +| [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface) | (Public Preview) A request from the model for the client to execute one or more functions. | +| [LiveServerToolCallCancellation](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellation_interface) | (Public Preview) Notification to cancel a previous function call triggered by [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface). | | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | | [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | | [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the Schema.object() helper. | | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (EXPERIMENTAL) Encapsulates configuration for on-device inference. | +| [PrebuiltVoiceConfig](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfig_interface) | (Public Preview) Configuration for a pre-built voice. | | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | @@ -113,12 +125,15 @@ The Firebase AI Web SDK. | [SchemaShared](./ai.schemashared.md#schemashared_interface) | Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. | | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google search entry point. | | [Segment](./ai.segment.md#segment_interface) | Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to. | +| [SpeechConfig](./ai.speechconfig.md#speechconfig_interface) | (Public Preview) Configures speech synthesis. | +| [StartAudioConversationOptions](./ai.startaudioconversationoptions.md#startaudioconversationoptions_interface) | (Public Preview) Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f). | | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). | | [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | | [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. | +| [VoiceConfig](./ai.voiceconfig.md#voiceconfig_interface) | (Public Preview) Configuration for the voice to used in speech synthesis. | | [WebAttribution](./ai.webattribution.md#webattribution_interface) | | | [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | A grounding chunk from the web.Important: If using Grounding with Google Search, you are required to comply with the [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google Search". | @@ -140,6 +155,7 @@ The Firebase AI Web SDK. | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | | [Modality](./ai.md#modality) | Content part modality. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | @@ -166,6 +182,7 @@ The Firebase AI Web SDK. | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (EXPERIMENTAL) Content formats that can be provided as on-device message content. | | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (EXPERIMENTAL) Allowable roles for on-device language model usage. | | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (EXPERIMENTAL) Allowable types for on-device language model messages. | +| [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. | | [Modality](./ai.md#modality) | Content part modality. | | [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | @@ -280,6 +297,36 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r If the `apiKey` or `projectId` fields are missing in your Firebase config. +### getLiveGenerativeModel(ai, modelParams) {:#getlivegenerativemodel_f2099ac} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication. + +The Live API is only supported in modern browser windows and Node >= 22. + +Signature: + +```typescript +export declare function getLiveGenerativeModel(ai: AI, modelParams: LiveModelParams): LiveGenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| ai | [AI](./ai.ai.md#ai_interface) | An [AI](./ai.ai.md#ai_interface) instance. | +| modelParams | [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | Parameters to use when setting up a [LiveSession](./ai.livesession.md#livesession_class). | + +Returns: + +[LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) + +#### Exceptions + +If the `apiKey` or `projectId` fields are missing in your Firebase config. + ## function(container, ...) ### factory(container, { instanceIdentifier }) {:#factory_6581aeb} @@ -301,6 +348,76 @@ export declare function factory(container: ComponentContainer, { instanceIdentif AIService +## function(liveSession, ...) + +### startAudioConversation(liveSession, options) {:#startaudioconversation_01c8e7f} + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. + +Important: This function must be called in response to a user gesture (for example, a button click) to comply with [browser autoplay policies](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Best_practices#autoplay_policy). + +Signature: + +```typescript +export declare function startAudioConversation(liveSession: LiveSession, options?: StartAudioConversationOptions): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| liveSession | [LiveSession](./ai.livesession.md#livesession_class) | An active [LiveSession](./ai.livesession.md#livesession_class) instance. | +| options | [StartAudioConversationOptions](./ai.startaudioconversationoptions.md#startaudioconversationoptions_interface) | Configuration options for the audio conversation. | + +Returns: + +Promise<[AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface)> + +A `Promise` that resolves with an [AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface). + +#### Exceptions + +`AIError` if the environment does not support required Web APIs (`UNSUPPORTED`), if a conversation is already active (`REQUEST_ERROR`), the session is closed (`SESSION_CLOSED`), or if an unexpected initialization error occurs (`ERROR`). + +`DOMException` Thrown by `navigator.mediaDevices.getUserMedia()` if issues occur with microphone access, such as permissions being denied (`NotAllowedError`) or no compatible hardware being found (`NotFoundError`). See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions) for a full list of exceptions. + +### Example + + +```javascript +const liveSession = await model.connect(); +let conversationController; + +// This function must be called from within a click handler. +async function startConversation() { + try { + conversationController = await startAudioConversation(liveSession); + } catch (e) { + // Handle AI-specific errors + if (e instanceof AIError) { + console.error("AI Error:", e.message); + } + // Handle microphone permission and hardware errors + else if (e instanceof DOMException) { + console.error("Microphone Error:", e.message); + } + // Handle other unexpected errors + else { + console.error("An unexpected error occurred:", e); + } + } +} + +// Later, to stop the conversation: +// if (conversationController) { +// await conversationController.stop(); +// } + +``` + ## AIErrorCode Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. @@ -313,6 +430,7 @@ AIErrorCode: { readonly REQUEST_ERROR: "request-error"; readonly RESPONSE_ERROR: "response-error"; readonly FETCH_ERROR: "fetch-error"; + readonly SESSION_CLOSED: "session-closed"; readonly INVALID_CONTENT: "invalid-content"; readonly API_NOT_ENABLED: "api-not-enabled"; readonly INVALID_SCHEMA: "invalid-schema"; @@ -539,6 +657,23 @@ InferenceMode: { } ``` +## LiveResponseType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). + +Signature: + +```typescript +LiveResponseType: { + SERVER_CONTENT: string; + TOOL_CALL: string; + TOOL_CALL_CANCELLATION: string; +} +``` + ## Modality Content part modality. @@ -579,6 +714,7 @@ Generation modalities to be returned in generation responses. ResponseModality: { readonly TEXT: "TEXT"; readonly IMAGE: "IMAGE"; + readonly AUDIO: "AUDIO"; } ``` @@ -785,6 +921,19 @@ export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; export type LanguageModelMessageType = 'text' | 'image' | 'audio'; ``` +## LiveResponseType + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. + +Signature: + +```typescript +export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveResponseType]; +``` + ## Modality Content part modality. diff --git a/docs-devsite/ai.prebuiltvoiceconfig.md b/docs-devsite/ai.prebuiltvoiceconfig.md new file mode 100644 index 00000000000..8627ae184b3 --- /dev/null +++ b/docs-devsite/ai.prebuiltvoiceconfig.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# PrebuiltVoiceConfig interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration for a pre-built voice. + +Signature: + +```typescript +export interface PrebuiltVoiceConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [voiceName](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfigvoicename) | string | (Public Preview) The voice name to use for speech synthesis.For a full list of names and demos of what each voice sounds like, see [Chirp 3: HD Voices](https://cloud.google.com/text-to-speech/docs/chirp3-hd). | + +## PrebuiltVoiceConfig.voiceName + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The voice name to use for speech synthesis. + +For a full list of names and demos of what each voice sounds like, see [Chirp 3: HD Voices](https://cloud.google.com/text-to-speech/docs/chirp3-hd). + +Signature: + +```typescript +voiceName?: string; +``` diff --git a/docs-devsite/ai.speechconfig.md b/docs-devsite/ai.speechconfig.md new file mode 100644 index 00000000000..95c63964974 --- /dev/null +++ b/docs-devsite/ai.speechconfig.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SpeechConfig interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures speech synthesis. + +Signature: + +```typescript +export interface SpeechConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [voiceConfig](./ai.speechconfig.md#speechconfigvoiceconfig) | [VoiceConfig](./ai.voiceconfig.md#voiceconfig_interface) | (Public Preview) Configures the voice to be used in speech synthesis. | + +## SpeechConfig.voiceConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures the voice to be used in speech synthesis. + +Signature: + +```typescript +voiceConfig?: VoiceConfig; +``` diff --git a/docs-devsite/ai.startaudioconversationoptions.md b/docs-devsite/ai.startaudioconversationoptions.md new file mode 100644 index 00000000000..08e91d2c7b5 --- /dev/null +++ b/docs-devsite/ai.startaudioconversationoptions.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StartAudioConversationOptions interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f). + +Signature: + +```typescript +export interface StartAudioConversationOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionCallingHandler](./ai.startaudioconversationoptions.md#startaudioconversationoptionsfunctioncallinghandler) | (functionCalls: [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface)\['functionCalls'\]) => Promise<[Part](./ai.md#part)> | (Public Preview) An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a Part, which will then be sent back to the model. | + +## StartAudioConversationOptions.functionCallingHandler + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a `Part`, which will then be sent back to the model. + +Signature: + +```typescript +functionCallingHandler?: (functionCalls: LiveServerToolCall['functionCalls']) => Promise; +``` diff --git a/docs-devsite/ai.voiceconfig.md b/docs-devsite/ai.voiceconfig.md new file mode 100644 index 00000000000..b22ac7e104c --- /dev/null +++ b/docs-devsite/ai.voiceconfig.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# VoiceConfig interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configuration for the voice to used in speech synthesis. + +Signature: + +```typescript +export interface VoiceConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [prebuiltVoiceConfig](./ai.voiceconfig.md#voiceconfigprebuiltvoiceconfig) | [PrebuiltVoiceConfig](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfig_interface) | (Public Preview) Configures the voice using a pre-built voice configuration. | + +## VoiceConfig.prebuiltVoiceConfig + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures the voice using a pre-built voice configuration. + +Signature: + +```typescript +prebuiltVoiceConfig?: PrebuiltVoiceConfig; +``` diff --git a/packages/ai/integration/constants.ts b/packages/ai/integration/constants.ts index 1adfa4f47a0..f4a74e75039 100644 --- a/packages/ai/integration/constants.ts +++ b/packages/ai/integration/constants.ts @@ -54,6 +54,12 @@ const backendNames: Map = new Map([ const modelNames: readonly string[] = ['gemini-2.0-flash', 'gemini-2.5-flash']; +// The Live API requires a different set of models, and they're different for each backend. +const liveModelNames: Map = new Map([ + [BackendType.GOOGLE_AI, ['gemini-live-2.5-flash-preview']], + [BackendType.VERTEX_AI, ['gemini-2.0-flash-exp']] +]); + /** * Array of test configurations that is iterated over to get full coverage * of backends and models. Contains all combinations of backends and models. @@ -69,6 +75,25 @@ export const testConfigs: readonly TestConfig[] = backends.flatMap(backend => { }); }); +/** + * Test configurations used for the Live API integration tests. + */ +export const liveTestConfigs: readonly TestConfig[] = backends.flatMap( + backend => { + const testConfigs: TestConfig[] = []; + liveModelNames.get(backend.backendType)!.forEach(modelName => { + const ai = getAI(app, { backend }); + testConfigs.push({ + ai, + model: modelName, + toString: () => formatConfigAsString({ ai, model: modelName }) + }); + }); + + return testConfigs; + } +); + export const TINY_IMG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII='; export const IMAGE_MIME_TYPE = 'image/png'; diff --git a/packages/ai/integration/live.test.ts b/packages/ai/integration/live.test.ts new file mode 100644 index 00000000000..caa18970ab7 --- /dev/null +++ b/packages/ai/integration/live.test.ts @@ -0,0 +1,327 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import { + BackendType, + getLiveGenerativeModel, + LiveGenerationConfig, + LiveServerContent, + LiveServerToolCall, + LiveServerToolCallCancellation, + ResponseModality +} from '../src'; +import { liveTestConfigs } from './constants'; +import { HELLO_AUDIO_PCM_BASE64 } from './sample-data/hello-audio'; + +// A helper function to consume the generator and collect text parts from one turn. +async function nextTurnText( + stream: AsyncGenerator< + LiveServerContent | LiveServerToolCall | LiveServerToolCallCancellation + > +): Promise { + let text = ''; + // We don't use `for await...of` on the generator, because that would automatically close the generator. + // We want to keep the generator open so that we can pass it to this function again to get the + // next turn's text. + let result = await stream.next(); + while (!result.done) { + const chunk = result.value as + | LiveServerContent + | LiveServerToolCall + | LiveServerToolCallCancellation; + switch (chunk.type) { + case 'serverContent': + if (chunk.turnComplete) { + return text; + } + + const parts = chunk.modelTurn?.parts; + if (parts) { + parts.forEach(part => { + if (part.text) { + text += part.text; + } else { + throw Error(`Expected TextPart but got ${JSON.stringify(part)}`); + } + }); + } + break; + default: + throw new Error(`Unexpected chunk type '${(chunk as any).type}'`); + } + + result = await stream.next(); + } + + return text; +} + +describe('Live', function () { + this.timeout(20000); + + const textLiveGenerationConfig: LiveGenerationConfig = { + responseModalities: [ResponseModality.TEXT], + temperature: 0, + topP: 0 + }; + + liveTestConfigs.forEach(testConfig => { + if (testConfig.ai.backend.backendType === BackendType.VERTEX_AI) { + return; + } + describe(`${testConfig.toString()}`, () => { + describe('Live', () => { + it('should connect, send a message, receive a response, and close', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: textLiveGenerationConfig + }); + + const session = await model.connect(); + const responsePromise = nextTurnText(session.receive()); + await session.send( + 'Where is Google headquarters located? Answer with the city name only.' + ); + const responseText = await responsePromise; + expect(responseText).to.exist; + expect(responseText).to.include('Mountain View'); + await session.close(); + }); + it('should handle multiple messages in a session', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: textLiveGenerationConfig + }); + const session = await model.connect(); + const generator = session.receive(); + + await session.send( + 'Where is Google headquarters located? Answer with the city name only.' + ); + + const responsePromise1 = nextTurnText(generator); + const responseText1 = await responsePromise1; // Wait for the turn to complete + expect(responseText1).to.include('Mountain View'); + + await session.send( + 'What state is that in? Answer with the state name only.' + ); + + const responsePromise2 = nextTurnText(generator); + const responseText2 = await responsePromise2; // Wait for the second turn to complete + expect(responseText2).to.include('California'); + + await session.close(); + }); + + it('close() should be idempotent and terminate the stream', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model + }); + const session = await model.connect(); + const generator = session.receive(); + + // Start consuming but don't wait for it to finish yet + const consumptionPromise = (async () => { + // This loop should terminate cleanly when close() is called + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for await (const _ of generator) { + } + })(); + + await session.close(); + + // Calling it again should not throw an error + await session.close(); + + // Should resolve without timing out + await consumptionPromise; + }); + }); + + describe('sendMediaChunks()', () => { + it('should send a single audio chunk and receive a response', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: textLiveGenerationConfig + }); + const session = await model.connect(); + const responsePromise = nextTurnText(session.receive()); + + await session.sendMediaChunks([ + { + data: HELLO_AUDIO_PCM_BASE64, // "Hey, can you hear me?" + mimeType: 'audio/pcm' + } + ]); + + const responseText = await responsePromise; + expect(responseText).to.include('Yes'); + + await session.close(); + }); + + it('should send multiple audio chunks in a single batch call', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: textLiveGenerationConfig + }); + const session = await model.connect(); + const responsePromise = nextTurnText(session.receive()); + + // TODO (dlarocque): Pass two PCM files with different audio, and validate that the model + // heard both. + await session.sendMediaChunks([ + { data: HELLO_AUDIO_PCM_BASE64, mimeType: 'audio/pcm' }, + { data: HELLO_AUDIO_PCM_BASE64, mimeType: 'audio/pcm' } + ]); + + const responseText = await responsePromise; + expect(responseText).to.include('Yes'); + + await session.close(); + }); + }); + + describe('sendMediaStream()', () => { + it('should consume a stream with multiple chunks and receive a response', async () => { + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: textLiveGenerationConfig + }); + const session = await model.connect(); + const responsePromise = nextTurnText(session.receive()); + + // TODO (dlarocque): Pass two PCM files with different audio, and validate that the model + // heard both. + const testStream = new ReadableStream({ + start(controller) { + controller.enqueue({ + data: HELLO_AUDIO_PCM_BASE64, + mimeType: 'audio/pcm' + }); + controller.enqueue({ + data: HELLO_AUDIO_PCM_BASE64, + mimeType: 'audio/pcm' + }); + controller.close(); + } + }); + + await session.sendMediaStream(testStream); + const responseText = await responsePromise; + expect(responseText).to.include('Yes'); + + await session.close(); + }); + }); + + /** + * These tests are currently very unreliable. Their behavior seems to change frequently. + * Skipping them for now. + */ + /* + describe('function calling', () => { + // When this tests runs against the Google AI backend, the first message we get back + // has an `executableCode` part, and then + it('should trigger a function call', async () => { + const tool: FunctionDeclarationsTool = { + functionDeclarations: [ + { + name: 'fetchWeather', + description: + 'Get the weather conditions for a specific city on a specific date.', + parameters: Schema.object({ + properties: { + location: Schema.string({ + description: 'The city of the location' + }), + date: Schema.string({ + description: 'The date to fetch weather for.' + }) + } + }) + } + ] + }; + const model = getLiveGenerativeModel(testConfig.ai, { + model: testConfig.model, + tools: [tool], + generationConfig: textLiveGenerationConfig + }); + const session = await model.connect(); + const generator = session.receive(); + + const streamPromise = new Promise(async resolve => { + let text = ''; + let turnNum = 0; + for await (const chunk of generator) { + console.log('chunk', JSON.stringify(chunk)) + switch (chunk.type) { + case 'serverContent': + if (chunk.turnComplete) { + // Vertex AI only: + // For some unknown reason, the model's first turn will not be a toolCall, but + // will instead be an executableCode part in Google AI, and a groundingMetadata in Vertex AI. + // Let's skip this unexpected first message, waiting until the second turn to resolve with the text. This will definitely break if/when + // that bug is fixed. + if (turnNum === 0) { + turnNum = 1; + } else { + return resolve(text); + } + } else { + const parts = chunk.modelTurn?.parts; + if (parts) { + text += parts.flatMap(part => part.text).join(''); + } + } + break; + case 'toolCall': + // Send a fake function response + const functionResponse: FunctionResponsePart = { + functionResponse: { + id: chunk.functionCalls[0].id, // Only defined in Google AI + name: chunk.functionCalls[0].name, + response: { degrees: '22' } + } + }; + console.log('sending', JSON.stringify(functionResponse)) + await session.send([functionResponse]); + break; + case 'toolCallCancellation': + throw Error('Unexpected tool call cancellation'); + default: + throw Error('Unexpected chunk type'); + } + } + }); + + // Send a message that should trigger a function call to fetchWeather + await session.send('Whats the weather on June 15, 2025 in Toronto?'); + + const finalResponseText = await streamPromise; + expect(finalResponseText).to.include('22'); // Should include the result of our function call + + await session.close(); + }); + }); + */ + }); + }); +}); diff --git a/packages/ai/integration/sample-data/hello-audio.ts b/packages/ai/integration/sample-data/hello-audio.ts new file mode 100644 index 00000000000..7c3b8f2f693 --- /dev/null +++ b/packages/ai/integration/sample-data/hello-audio.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2025 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. + */ + +export const HELLO_AUDIO_PCM_BASE64 = + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAP//AAAAAAAAAQABAAEAAQAAAAAAAAD///7//v8AAAIAAgAAAP7/AgAKAAcA7P+1/3r/Xf9x/67/8v8dACgAIAAZABgAGwAZABIADQAKAAkACAAGAAYACAALAAsACQAJAAsADwATABUAFQATABIAEAARABIAFAAVABMAEAANAAsACwALAAoACgAKAAoACgAKAAoACQAJAAkACAAIAAgACAAIAAgACAAHAAcABwAHAAYABgAGAAYABQAFAAUABQAFAAUABAAEAAQAAwADAAMAAwADAAMAAgACAAIAAgABAAEAAQAAAAAAAAAAAAAAAAAAAAAA/////////////////v/+//7//v/+//7//v/+//7//v/+//7//f/9//3//f/9//3//f/9//3//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z/+//7//v//P/8//v/+//7//v/+//7//v/+//7//v/+//8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//z//P/8//3//f/9//3//f/9//z//P/8//z//P/8//3//f/9//3//f/9//3//f/9//3//f/9//3//v/+//7//v/+//7//v/+//7//v/+//7//v/+//7//v////////////////////7//v//////////////////////AAAAAAAA///9//3/AAADAAQAAQD9//r//P8BAAUABAAAAP3//P///wEAAQAAAP//AAACAAIAAgABAAEAAQABAAEAAQAAAAAAAQABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgABAAEAAQACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////8AAP///////////////////////////////wAAAAD///////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAA//////////////////8AAAAAAAD///////////////////////////////////////////7//v//////////////////////////////////////AAAAAAAAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgABAAEAAQABAAAAAAAAAAAAAAD//wAA//////7//v/+//7//f/9//z//f/9//3//f/9//z//P/7//z//P/8//z//P/8//z/+//6//r/+v/6//r/+v/6//n/+f/5//n/+f/5//n/+f/5//n/+P/3//f/9//3//j/+P/3//f/9v/2//f/+f/5//n/+v/7//v//f/9////AQABAAIABAADAAMABQAHAAgACQALAAwADAAMAAsACgAKAAkACwAMAAsACgAJAAkABwAFAAUABgAHAAUABQAFAAQABAACAAQABQACAAEAAQACAAIAAAABAAMAAgACAAMABgAEAAIAAwAEAAIAAQADAAYABQAEAAUABgAIAAYAAwAJAAwACgAJAA4AEAARABAADwAUABgAFQAUABwAHAAVABQAFwAWABEADwASABEACwAHAAYABQAGAAcACgAPABAADgANAA4ADgARABIAFgAaABsAGQAVABEAEwAXABgAFAATABcAEQAIAAoADwAMAAYAAgAAAAAA/v/7//v/+P/4//7/AAD3//D/8f/0//D/7v/1//r/9//z//X/+P/z/+v/7f/v/+z/6f/q/+3/7v/u/+r/5f/l/+f/6v/w//D/6P/p/+r/5f/m/+z/7f/p/+f/5P/f/+b/7f/w//L/7P/m/+7/9f/3//7/BAABAPr/+P/8/wEAAgADAAYABAD9//v///8GAAkAAwAAAAAA+P/x//b/9//0//T/+/8AAPr/9//+/wIA/f/2//r/AQD+//3/CwAYABMADwANAAoAEQAZABAACQALAA4AEQANAAEA/v8FAAMAAQAFAAAA9//u/+b/5//p/+L/4v/n/9v/zv/O/8//zf/O/9X/4f/m/9v/1//b/9//5P/m/+b/1//R/9T/3v/m/+P/2//O/8j/xf/B/9H/4//h/+v/8f/y//T/+/8MAAoABgAFAP7/EQAWAA8AJQAzACoANAA+AC0AHQATABsAKQAjABYAHQAWAAsAFwAkADUAPQAzACsAHwAMAAkAIAArACYAGgAIAAkADQAPABsALwA0ACsAKgArABwAGQAdABgAFAAHAO7/7f/v/+v/6f/3/+r/yf/I/8//yP/G/77/uP/H/8b/0f/Z/9T/1f/L/8D/zf/Q/83/2P/b/9j/2//i/9n/4v/u/97/4P/k/9j/9f/7/9v/6v/6//H/CQAnACoAEQAHABgAJAApACkAKAA4AEUAOgA1ACgAFwAQABoAAQDl/93/0f/C/8P/uf+1/6n/lf+V/7D/s/+2/+L/6f/U//P/+P/n//j/9//x/wUADQAUACIAJwAnACUAIAAeADgASABOAGYAYgBUAEcAMAAvADcANAA0ADkAQQBIAEEAPwBMAGUAZABXAF4AYwBdAFMAVQBoAHcAdQBnAFIAWwBtAGgASwA9AE0AUQBFAEIAQgBMAGAAYAA8ACcAHwAaABkAFAAPAP//+f8OAA0ADAAOAAEAFAA6ADYADQAUABgA+v/r/+D/3P/H/7P/q/+t/6b/lv+O/4r/h/+C/4X/hP+X/6v/r/+w/7X/vP/G/9r/7//x//P/7P/v/wQABQAAAAsAHAAiACgANwBLAFUAQgBHAGEAXABTAHoAmgCYAIkAegB5AIYAfgB+AJMAmACDAIEAgQBmAEAASgBXAFAARQBXAGAAUQA6AD4AXwBoAFMAQQA4ACIADwAaACQAKQAAAOL/8//w/97/5f/h/8n/wf++/8P/yP+w/6z/t/+j/4n/iv91/1v/YP9w/27/aP9I/zv/Sv9T/1b/WP9i/2D/cP9o/2D/af9g/13/a/+A/6D/sf+r/6z/p/+i/6T/sv+2/6f/nf+e/5f/mf+S/5T/of+c/5//rP+8/8L/v//R/97/7f8JABYACwAPABcAIgAbAAQAAwAXABEABgD1//D//P/v/+X/5f/o//P/9f/k/9P/1//N/8L/vf+4/7b/pv+C/3b/if+Q/5H/o/+m/5b/pP8PAMAAjwFQAtsCBAO5AksC3wFjAf4A0QCkAHcARwD2/4z/Mv/f/oj+Kf78/fj9Iv5P/kv+Mv4k/hD+Df4V/h/+NP5q/qL+qv6o/rf+5/45/4D/tP/T/wQAVAClANsA4wDZANsAxgCsALAAsACpAJ8AgQBKAOT/eP86/zX/TP98/7j/6v8KAD8AcQCgANAA8gDkANEAwgCwAK4AkgBhAEQALAAwAFEAagCFALEAxwDiAAYBMgFnAZsBzwHnAfYB8wHQAcQB2gEEAkQCYgJIAjACFwL9AdIBngGPAYIBXgFLAUYBMgEQAdAAnAB3AF8AOwAIAOH/0//I/73/of+G/3X/Zv9e/zT/7f7C/p/+fv6I/q3+uv7A/sv+3P7r/t3+yf7Z/uv+4v7Y/s7+0f7c/tn+7f71/vn+Dv8a/yv/Mf8d/w//AP/v/v3+Fv8s/0v/dP+k/9P/8v8mAFkAiQCsAMAAwAC2AJcAfgBnAEYAMgAbABkAEwAsADwARABXAGoAfgCMAI4AowCqAJoAhwB7AHkAbwBhAFMAWQBzAJIAsQDAAMMAyADOANwA5ADPALUAlwCGAH8AXQA3ABIA/f/l/8L/pf+K/1P/Kv8i/w7/8v7p/v3+E/8V/x//N/88/z7/Rf9U/1v/XP9n/3H/Zv9H/zv/Rv9V/1D/Sf9U/1j/YP9o/2//hf+P/5j/qv+0/7n/x//Z/9z/1v/O/8T/sf+k/6X/sv/M/9n/3//f/+r/3//f/wYATgCiAAABbgG6AdAByAGiAWMBJQHqAMkArwB/AFQAKQDs/6j/cv9F/x///v7p/vD++P7f/sX+uP6l/qr+vf7D/tH+4P7w/g3/HP8n/zf/O/9A/z3/Tf9p/5D/yf/8/w8ADQAIAA4AGQAKAAkAHgAnABUA/v/8/9//tv+l/7P/yv/j/wAAGAAtAC4AQABfAHIAjACxAMkA2wDjANsAyQC0AKcArQC4AMQA0gDmAA0BIwFEAW0BkgHBAdkB5AHrAd8B3AHjAdwB2wHpAf0B+gHfAb8BlwFzAVMBOAEbAQgB8ADTALgAoABzAEUAHgANAPz/1f/G/7//tP+k/4L/bf94/3f/bP9b/0H/N/8s/xn/Iv83/zr/N/84/yT/Av///gn/FP8e/yH/Lv85/0b/Tf9K/1D/Wv9b/1n/Y/9q/2L/W/9k/3D/bf90/4T/nv+9/+D/AQAeAD0AWwCHAK0AwgDMAMwAvwCpAJkAkwCiAKIAnQCnAK0AmgCSAKAAtgC9ALYAxADYAOQA3ADQAMUAswCcAJYAmQCaAJ4ApQCuAKkAmQCNAJsAowCbAIwAhQBzAFMALwAHANr/uv+v/5X/c/9N/yz/CP/f/sj+vv67/rT+s/7C/tX+3v7i/vT+C/8a/yL/Kv8r/xn/Cv8H/wb/Cf8K/wn/Bf8J//3+7P7t/u3+7v7h/sn+vf7L/u3+J/87/yj/JP9H/27/c/9y/3v/kP+f/5r/of+5/93/6//T/7v/zP/s/+b/2v/k/+r//v8JAPz/9//4/+//5f/v//L/8f/3//P/6P/r//X//f8RABsAGQAjACkAKQAzADcARQBRAFcAVwBWAGIAawBxAGwAXgBQAEAALAAdAA8A9v/y/+7/5v/m/+r/5v/m/+L/1f/d//X/+f///w4AGAAjAEAAWwBWAE0AVwBiAHUAewBqAGQAbQBnAGMAawBfAFMATwBNAEgATgBIADkAMAApACAAIQAhABcAGgAiACQAHAAdACYAKAAkABwAHgAkAC8ALwAoACgANgBDAEYARwBLAEkAOgAwADEAMwAkABgAHAAlADIAOwBEAFgAXgBRAEcARQBGAEYASQBEADgALQAvADUALgAiACQAIAAaAAsA+f/z/+f/3//k//D/8//s/+n/6//q/+b/3v/s/wUADgAYACcAMgAqABQAEAAbACoAPABJAFEAWABfAGUAVwBGAD8AQwBNAFAAWQBiAFgARAAzADoAQgA9AEIASwBKAD0AMgA3AD4AQQBDAEQATABeAGQAaABlAFYASQBJAEcASABRAFIARAAuACMAEgALABIAJwA9AEAAQQBRAHQAqQACAVwBoQHIAeQB3gGsAYABWQExAf8A1wC1AI0ARQDt/6v/dP80/+3+wv68/rn+pf6S/oL+df5e/lL+Wv5r/n7+if6L/of+jP6Z/rb+2P71/hb/SP93/6z/5P8BAAoAGwApACgAFQAJABgAIgAdABIAAQDj/7z/nf+h/6j/nf+t/9X/8f/y//v/GQA3AEQAQABIAE8ASQA+ACwAFgAGAAcADwAZABsAHwA8AFEAZQB2AIIAlQCqAMEA2ADmAO8AAQESAS0BTQFhAXkBhQF8AXEBZQFQATQBHQEAAeQAxgCsAI0AbABFACIAAQDd/7f/jP9l/z7/H/8M//v+6f7X/sj+rf6R/n3+bf5Z/kz+SP5I/kn+Sv5D/jv+Pv48/jP+Iv4S/hr+NP4+/kb+Vv5p/nf+gf6X/rX+zP7Y/t7+5P7m/vX+EP81/2L/iP+x/83/5/8BABwANQBLAGQAgACUAJ4AnwCmAKcApwChAKYAsgC/AMYAzgDWANsA5ADnAPcABgEWASIBHQERAQoBDAEPAQ4BEQEeATIBQAE+AT4BPwE1ASgBHQEYARAB/QDpANEAswCQAHEAVQA4ABgA+f/Y/7T/kf9u/0j/KP8L//3+8/7t/ur+5/7m/vH+/v4T/yj/LP8w/zX/N/89/0b/UP9a/1r/UP9K/0r/TP9Q/1b/ZP9r/2z/cP96/4f/mf+i/6j/t//F/8z/1//l/+z/7f/y//v/BgAZADQASQBRAFUAXABkAHYAlQCyAMUAzQDQANwA8AACAREBHgEgARsBDQH7AO4A4wDkAPUABQEJAQcBAAH5AO0A5QDpAO8A6gDnAOIA0wDKAM0A1wDgAN0A0gDPAMIAogCFAHIAYABJADkAIQAFAOX/1P/Y/9n/zf/D/77/uP+x/7T/v//C/8D/u//A/8j/zf/N/8b/wv/J/9T/3v/j/+j/8P/y/+b/w/+Z/5//+v+hAGIBJALhAjID+gKAAhECvwFvAU8BSQEwAQkB5gDFAIUAPgDp/4n/Vv9h/5j/v//C/7L/jv9n/1P/V/9a/2X/f/+C/1v/Gv/b/tz+AP8d/xn/DP8l/1//of/D/7f/jv90/23/bP9b/0//c/+j/57/Sv/M/mH+JP4c/kf+i/7G/vb+Fv8r/z7/Xv+C/57/oP+R/4r/ff91/1r/L/8T/xb/K/8+/1X/bv+K/6f/yP/u/xwATACDAL4A7QAOARkBDwEAAQ4BPgFoAYQBngGqAZgBfwFwAWwBbwFsAWgBZwFuAXUBbgFPASgBCAHvAN4AxgCqAJIAhgB+AHYAawBSACQA8v/C/53/fP9i/1L/Tf9N/0f/QP8+/zb/GP/3/tz+yP6y/qD+mv6f/qH+nf6V/o3+iv6O/p/+rv6x/qz+nv6P/oD+c/5n/mX+Z/5t/oP+qv7X/gj/P/98/7j/2//u/+z/5P/S/8D/rf+T/4T/hf+S/5//vv/r/xQANABVAHUAkgCfAKgArwCtAKkAqACkAKYAqgCjAKQAtwDKANYA4wDoAOMA4QDtAPgA9QDlAM0AtQCeAIAAYQBBABkA8P/b/8L/qP+V/4H/aP9L/0H/Rv9N/1P/X/90/4r/l/+h/6z/qf+a/5T/kf9//2X/V/9T/1T/W/9p/3H/d/9//4v/mf+U/4r/jP+V/6D/sP+4/7P/pP+Y/5v/o/+g/53/m/+b/5//ov+r/7X/tv+3/8L/zP/c//T/BAAHABIAKAA+AE4AWgBsAHMAeQCAAIMAfABoAGMAaAB1AH8AfwB9AG4AXQBZAFUARwA9AEMAUgBbAGQAbQCBAIwAlAClALAAugDBAMUAuACYAHgAZgBhAGQAagBtAGcAYQBdAE8AQQA6AEMAWwBsAHwAiwCPAI8AlACRAIEAcgBhAFgAUQBHADgAKgAkACIAKAAwADYANAAuACgAJAAjACUALQAqACYAKwA/AFQAYQBsAHwAkQCdAJoAmACcAKIAoQClALYAuwC7ALkAvgC9AK8AoACWAJMAgwBtAFMANQAVAAMA/v/6//3///8NABwAGgAbAA4A/f/t/+D/2//L/8D/uP+y/63/qP+n/67/tf+t/6T/n/+d/5n/nv+o/67/tv++/8j/0//a/+b/8v/w/+n/6//x//f/AAAGACMAPABJAFMAWQBoAHoAkACfAK4AvADIANUA3gDhANcA0gDKAMQAxwC7AK0AqACnAJwAkAB5AFwAUgBTAFIAQgA2AB8ACAD9//T/9////wYADAAQAAYA+f/0//H/9//9//j/8v/v//P/6//W/8X/rf+c/47/hP98/3v/f/94/2//Yv9O/0D/Nf8v/zX/OP87/0X/Vv9e/2T/ZP9i/1v/VP9c/2X/af9o/2T/ZP9m/2P/Xf9a/0//T/9X/1X/Tf9O/1z/Z/9t/3H/d/94/4H/lP+n/7H/tv/C/9H/5v/7/wkAFgAoADUAOwBAAD8AOQA3ADsAPQA4ADEALwArACwALAAgAA0ABAAEAAkAFwAkAC0ALwAtAC0ALAAlACQALQAtACoAKwAvACcAJQAsADcAPwBBAEsARgA7ADcANwA4ACoAHQAWABEAAQD0/97/xv+7/7T/rv+n/6X/pP+h/53/n/+d/5j/kv+V/53/rf+8/77/wf/A/8L/w//I/87/0//Y/9n/1f/G/7//vP+5/7f/tP+4/7n/sP+t/63/sP+x/7v/wf/H/9L/0//S/9T/2P/i/+r/9f/3//r/BwATABcADwADAPj/7//p/9//5f/1/woAFwAcABYAFAAiACcAKgAzAEAARABDAEkAUQBgAGYAaQBxAHsAgwCSAJkAnACeAJwAkQCKAJAAjgCFAH4AeAByAGwAYABTAEMAPAA4ADYAKAAVAAEA6P/O/73/tP+l/5T/i/95/2v/YP9R/0j/T/9R/1P/W/9R/0z/SP9U/1//af9z/3j/fv9+/4f/jf+Q/5P/nv+k/6P/rf+7/83/1P/a/9n/2//j//H/AAAQAB0AIAAhAB4AHwAaACIAKgAvADMANQAzAD8ARwBSAGEAbQCAAIoAjwCbAKQApQCiAJ0AlgCTAIcAfAB8AHgAdgB3AHIAbwBfAFgAVABQAE4AUgBQAE0AUwBSAEQANAAqAC0ALwA0AC0AJgAXABUAFwAPAAUAAAAFAAEABAADAAYADwAXABUADwATABAABwD7//D/2//N/8X/xv/D/7v/u/+u/6r/q/+t/7j/vP/F/9L/4P/z/wEADgAYAB0AHwAtAC8ALwA8AEcATABCAEQAVABmAG8AcwBtAGEAWQBTAFMAWQBfAF4AUwBAADkAPABFAEgAVQBeAGwAdQB6AH0AhQCHAIsAhgCFAHsAeQB6AHYAewB5AHYAawBeAFwAVQBRAE0ARgA5AEEASQBMAE0ATgBRAFIARQBCADMANAAwACcAHwAPAAgA/P/v/+X/3v/i/+j/5P/e/9H/zf/Q/9L/0v/G/8D/vP+5/7P/tP/B/8L/wf+8/7r/xv/H/9f/1f/c/9T/0P/V/87/5P/w//v/DAAaACEAJQAyADYAOQA2ADQAOQAvADUANwA4ADwAPAA7ACwAJwAuAC8AIAAgACUAIQAYAAsA+v/v/+r/4P/c/9D/yf/F/77/uf+o/63/r/+e/6v/wf++/7P/of+S/43/iP+A/3n/bv9k/2X/V/9C/y//Kf9E/0j/UP9G/zf/Ov8m/y//M/85/0L/V/9e/1D/WP9T/0v/Q/8+/yj/Lv81/zr/Of9O/0j/QP9y/6L/bP8hAMQAbQBOAFAAdwBGADkAVQBOAE0ARQBuAFwAZgBvAGQAUgBLAFQAOQBHAFEAWQA4ACIAFAD2//f/9v8EABoAFgDt/9P/4v/0/woACgAaAAgAAwASABsAGQAMABQAAwAfABwACgDz/+b/1v+l/4H/Yv9U/1P/Yv+P/6z/rf+m/6//uv/H/9r/3P/d/+f/4//d/+X/4v/S/8z/xv/C/9H/7v8IACAAOQBBADQAPQBUAGMAcQCCAI0AgQBlAF0AagB5AJwAqgCUAIMAhwB6AH0AdQB6AI4AjQCGAI0AjACBAHgAZQBcAFMAUQBQAFAARQAzABAABQAGAP7/9f/q/9L/tf+t/5//kP+P/5H/lf+m/7T/wP+s/5r/lf+V/5//o/+p/6n/r/+0/7n/vf/C/9D/2v/w//H/6//j/+P/3//O/8r/xP+3/7r/wv/N/+b/8P/5/wYAIQA1AEcATwBAACsAJwAsADEAPgA5AEMATwBaAGsAdgB6AH0AfwCJAHoAhwCbAJkApQCiAJoAiQB9AH0AdwB/AIoAkACPAIIAewCFAIgAnACmAKoApgCnAKsAjQBpAF8AXQBTAE8APAAWAAAA5v/P/8j/r/+v/7P/q/+i/6D/lP+D/37/ef98/3v/fP99/4r/kP+S/5L/hv90/3X/jf+b/6P/s/+2/7n/yP/M/8j/0P/P/9H/2v/i/+f/+v8JAAkACQASAAMAAwAGABAAGQAZAB8AEQASABwAKQA3ADgAMQA3ADkAQAA7ADoAPgA7AD4APABHAFAAVQBYAGIAZgBoAGQAZgBkAFwASQBDACoAKgBGAEoASABJAEYAMQAwAEAALgA+AFUAUwBHAD0AQQA1ADsAMgAfABkAIgAgABMA/////wIA9P/t/+P/zP/D/8//vP+5/7//w/+t/5z/lv+b/5L/iP+Q/5f/q/+0/6n/p/+z/7L/q/+W/4//lP+b/6j/mv+q/63/sP++/7L/uP+i/67/pf+X/5v/nf+r/7j/yf/U//L/9v/8//j/8f/0/+//6v/m/+T/+P8HABIACwAbABQAEwADAAsABwADAPn/6//e/9P/0f/L/8L/uf+r/5//nf+d/6X/rf+5/8H/u/+5/7r/q/+s/6r/nP+H/37/eP+E/5n/iv+Z/53/l/+f/6n/qf+3/8f/0P/G/73/u//B/8L/1f/i/+j/+v/u/wYAHwAoAD0ASwBHAEwAYABtAGcAdQB2AG0AhwCfAKEAqwCzAK4AqQCcAJgAhgB2AH0AcABwAGgAXAA4AEYAQQAtAEYAOgA1AEsAPQAfACIAHAAQABkAHwAWABcAIQASAAEA4P/F/77/qf+e/6X/mv+d/5v/mf+U/3//e/95/2f/Zv9Y/2X/ev94/4L/jP+a/63/wP/F/+D/9v/7/////f8CAPj/AgD8/wEAEwAEAP3/AAAAAAcA+f/0//z/FAAYACUAJQA1AF0AYQBmAIQAhgCRAIsAkgCNAI8AoACmAK8AsQCzAK0AmgCPAJMAjQCEAHcAaQB7AHQAdABuAGIAVQBSAFsARQA/ADkAMgArABEAEgAQAAkABAD+//7/BgD3/+n/3f/P/8//zf/Y/9b/2f/h/9P/zP/K/9L/w/+8/73/s/+z/7H/pv+n/5P/oP+c/6D/qf+p/6T/q/+5/6L/nf+o/6L/pf+z/77/1P/i/+H/6v/j/+L/5P/m/+T/5P/v//7/+P8VABwAMwBBAD8AQQA/AD8AQQBGAEoATQBZAGsAbQB5AH0AhgCGAI4AfgB0AHUAYwBkAGQAXwBYAFsAQQBDADcAMgAtACYAKwAeAB8AHQAWAAMA7P/s/+b/6//g/+j/2v/d/9T/wP+4/7H/rf+U/4L/ef9u/2f/Xv9e/2r/fv+G/4j/g/+K/5P/fv+G/5T/j/+S/5X/pf+f/5n/nf+V/4j/gv+I/5f/l/+h/5//of+v/6D/mv+q/8H/0//X/9f/3//p/+3/+v8AAAoACQAQABAAEgAeACgAKwAwAD4ANAAxADIANAAsAC8AMQAxACUAMgAqADYAPAA7ADIALgAoACsAJQAqAC0AMQA5AD4AQQA5ADkAQQBRAEYAPQA+ADcAJAAXABQAFQASAB0AEAALABMADgAYABwAIQAVABEADwADAPr//v/x/+7/5//Y/9z/1//R/83/2v/o/9//7f/Y/+L/6P/a/+j/2//h/9f/0P/W/9j/1f/D/73/tf+//7//x//K/73/y//H/83/zP/Q/+H/1v/q//D/+v/3/wEADgAGAPr/BgAUABcAJwAxADUALgBJAFoAaABzAHQAdgBtAGsAcQB3AHgAdwB+AIoAfwCEAJAAmQCSAJEAfQBiAGwAcgB4AHYAcgBvAGMAXwBmAGUAXABUAEQAOwAkABwAHgAWAAoA8P/e/9f/0f/L/8b/w/+8/7L/tf+t/73/x//G/8D/xP/E/9j/3//h/+X/5f/n/+3/5//j/9r/1v/R/87/0P/W/9P/2v/R/9P/1P/W/9//5v/p/+L/3v/c/+H/4f/t/+7/7P8CABsAKAA6AE8AUABcAGEAYgBpAGMAaQBbAGIAcQBeAHEAaABuAGkAUABLAEIAOwA4ADoAJgAgAAQA///4/+f/5P/X/9j/xv/K/8P/wf+//7P/rv+k/53/ov+k/5r/lv+b/5T/g/+B/4n/fP+F/3//gP94/4j/dv+I/5X/iP+Y/5//p/+z/7v/w//d/+r/8f8FAPn/+//5/+//7f8AAPP/BQAHAAUAFwAPABAAFAAVABoAFQAgAB8AJwAgADYAHAAhAB4AEwAsABgAFQAXABIAGAAfACAAIAAmACIALAAuABcAEgASABEAEgAQAAgABwD4/+z/6//r/9//4f/U/8//yv/O/8H/yP/K/83/0f/M/9D/0P/W/9X/xv+8/8T/y//T/+D/7P/n//D/7//3/+//6v/h/+D/3f/p//D/8//+//z/+v////X/7P/k/9r/4//q//P/+/8DAAoA/f8JAAkADAATABAAEAADAP7/9//4//r/BwAUAB4ADwAIAA0AAwAQABcAHQAfABoAGQAfACAAMQA1AEIARQBEAD8AQABMAF0AUwBdAFQATAA/ADwALwAcAAkACgAAAOz/8v/6//X/7//v//b/5//T/83/yf+//7r/t/+o/7r/v/+2/7f/xf/A/7T/sv+9/8n/yP/C/8r/uv/B/8b/wv+6/7//wf+x/7P/uf+5/8D/vv+4/8H/u//Q/7r/vv/E/8b/y//X/+7/DQAmACoAVgBoAGsAeAByAHUAdQBoAHUAhgCEAIcAjQCRAIgAkACEAIYAfwB1AGUAVgBJAEkARAA9ACwAMAAuAC8AMwBDADsAQgBCADkAOgA5ADcANgBCAEcAQwBCAD4ARAAzACUAJAA2ACsAQAAyACYAJAAJAP3/DAAJAAkACQD6/+r/9P/1/+z/7v/o/+r/+v/2/wQAAQAQABoAIwAqACsAKwAxACoAJQAgABEADgAHAPz//P8IAA8AEQD7//b/6f/f/+P/1//a/8X/yf+3/8f/wf+9/7f/sf+5/7D/vP+u/7b/q/+r/7f/sf+m/53/rP+d/53/of+v/67/qv/A/8P/0//r////DgAMAB0AKAA3ADAAOgA1ADsAOwA1AB4AJwAmAB8AGwAJAAAA///o/+//8f8FAA4ADgATAPr/7//6//X/9P/m/+f/5//f/+f/1v/Y/9//4//l/+//9P/4//f/6//6//b/9//0//f/7f/l/9j/2P/e/8P/vf+3/7j/tP+8/7T/xv+x/67/o/+k/6n/sP+v/7X/rP+2/73/xP/B/77/yv/N/9P/2P/3//r//f8BAP//CwAVABcAIQApACwANgA0AD8ARQBAAEIARwBBADUAOgBBADsAPABKAFAASQBKAFQAVABUAGIAZgBeAFwAXABLAE8ARwBTAEwAOAAsADIALQAoADgAKQAuADEAKgA2ACsAMAArACMAKgApACcAMwAkAB4ADgASAAYA+/8BAAAAGQAHAAsACwADAPz/CwD9//f/7//Y/9X/1v/T/8j/0P/W/8v/5v/h//T/AAAIABcAEwAMABMAFwD8/woA/v/9//z/AAD9/+P/AADy/+7/+f////7/+v8MAAUABwANABQAGwAcADEAKQA5AEwATgBPAE0AXABNAFwAaABcAGAAVgBhAF0AUwBIADwAQQAvACsAKgAoACEAIgAhABgAHQATACUAHwAdAB4AGAAbABAACwAKAAIABQD0//7/+//+//b/+P/x/9j/3//U/93/zP/N/8z/u//P/77/vf+0/7b/s/+m/6P/lP+M/5H/i/+E/37/hv+O/47/nv+V/4j/mf+j/5v/m/+Y/5L/oP+h/5v/h/+T/53/p/+p/67/o/+j/8P/vf+m/6X/p/+i/6X/rP+c/6b/tv/B/8f/0f/P/9X/6v/j/+j/9v/w/+H/3P/c/9X/zf/S/9//0//W/9L/wv++/87/uP++/8f/z//e/+7/AAD5////+v/7/+//8v8HAAEA+/8GAA0ABwAJABkAHAAQABgAHQAwACoALQA4ACwAQgA+AD8ALgA1ADQAJQAXABcAEQAFABYAHQAVABwAFAATAA8ABgANAAAA/P8AAAAA+f/9/wsABQAAAAUABQAMAA4ADgALABkAEAAaAAgACwAPACEAGQAYACUAFwAbABYADQANAAgAAwD3/+3/8P/x/+T/4//Z/+T/6f/0/wAABwAWABcAHQAcABcAGwAfABUAGgAbABEABwACAAgAEQAOABIAKgAmACsAJwApACkAIQASAPf//v8BAAYACwAQAAgAAwAKAAIAAwD9//b/EgAJAAwAFAAbAB4AJAAmACcALQAXAC8AKwApADgAPgA8AEUAXwBZAHgAawB2AGgAZgBiAGcAbQBnAFwAYwBkAGYAXwBdAGEAZgBQAFcAUABfAF0AcQB4AHsAfgB4AHsAYQBqAGQAVgBfAFUAUABVAFcATABbAFYAWwBgAFYAYgBPAFAAUQBOADwAMQAYABUADAD9/xAA+v/2/+L/3//J/8b/0f/C/8f/uv+8/7b/tP+1/8P/1f/Y/9j/0P/R/9n/0P/A/73/y//F/8j/wv/D/7//yv/I/8f/xf/P/8n/zf/G/7//0P/I/9L/1//K/7T/qf+m/6H/nf+V/5v/oP+r/6z/q/+7/6n/sP/B/7v/w//S/9b/3v/q/+T/5P/e/9X/zP/I/7z/sP+w/7D/tP+q/6n/rf/J/8z/zf/X/9r/3//u/+r/3v/s/+v/7P/d/+P/4f/i/9v/z//C/7b/v/+0/7r/zv/J/8//2f/Y/93/1f/Y/93/6v/g/+z/7//x//X/8v////j/+P/y//3/8f///wYA+v/x//L//P/9/+n/9//6/wAADwAFAAcADAAMAB4ALAA3ADoAKgAoACUAHAANAA4AFQAVABAA///0/+7/CwATAA4ABgDy//f/HAAyABwACgAGABUAKQAWABgAEAAXADAALAAmACcAPgBGAEcAWQBlAGcAdgCKAIUAjACTAJMAiwCDAIYAhwCNAIYAgwB4AGsAdQBvAFQAOwAtACAAHQAlACAAGAAZABMABQD1/+v/5//Z/9H/2f/e/+X/3//l/+r/5P/0/+//3//Z/97/6//u//H/7//t/+v/7P/z/+7/7f/p/+P/2f/d/9z/3//h/93/1P/b/93/1P/c/9r/0f/K/8D/uf+3/6//qP+s/7z/xf/S/8j/yv/M/8T/vf/C/8v/0v/d/+3/8v/+/wgACgANABYACwAMAAkACAARABoAGQAbACAAIQAmACIAKgApAB0AIAAqACkAOQA5ADQAOwBFAD4AQwA+AEEAUwBSAE8AVQBgAGkAagBvAGcAZgB2AHMAZABUAEsAVQBJADkALwAhABUAEQANAAMAEQAMAA0A///0//j/5P/X/9r/0f/E/7z/qP+o/6n/qP+e/6r/sP+1/6//uf/F/7n/u/+5/7b/t/++/8f/xv+6/7v/u/+4/8X/wf+4/7X/yP/Q/9D/1v/V/+f/4//z//H/5f/6/wgAEAAkABMADwADAPn/9f/r/+r/6//h/9H/0f/S/9r/2P/Z/9//2f/X/9f/1P/O/9b/3v/i/+b/4v/q/+z/6f/g/+j/8v/0/+z/8//z//n/AAD+//j/+/8EAAIADgARABQAJAAtADQANwA8AD8AQgBGAFEATgBIAEIAPwBIAEIAQQA9ADAAKQAoACEAJQAiACMAHwAWABMADAAFAAkA//8AAPT/5v/v/+//7P/x//j//P////j/AwAGAAkADwAPAAgAFAANAA0ADAAGAP3/+P/w/+3/6f/k/+3/5//l/+H/3//Z/9P/7f/1//7/AAAJAAkACwANAP//+P8DAA0AEAARABEAGAAcAB4AJAAfACgANwA7ADsARABQAEAAOQAuAB8AEwD7//T/8f/m/+3/6f/j/9r/y//J/8j/2P/Y/+P/8P/w//X/8//6//r/9P/3//X/+P/4/+//7f/w//P/8P/0//L/6f/d/9L/zv/D/73/wP/N/9H/3v/h/+L/8f/r/+r/7v/0////CQAOABAAEgAiAB8ALwA5AEUASQBFAFEATgBGAFcAXgBfAF8AaABvAGkAaABZAFAAQAA7ADMAMwA9ADgAPAAwABwAHQATABAADAANAA0AEAAYACEAKwAsACcAEgAJAAAA/v/3//T/7f/g/9n/zf/H/7f/q/+h/6H/kP+C/37/gf+A/3j/hf+K/5v/nf+j/6z/sv+6/7P/uP+u/67/sv+0/7T/uv+6/8H/vv+8/8T/wf/J/83/zf/I/8b/yP/N/8r/w//L/8j/yf/X/9z/7f/v/+v/7//w/+7/6//x//b//f8GAA0AHAAfABkADAALAAoACwASAAkACAAIAAcABwAYABUAIgAxACsALgArACEAIAAiAB8AFgAGAPz/8v/x//b/9v/5//T/6//0//f///8GAAcAEAAbACAAFwARAAUACQAJAAMAAAD5//r//f/2/+//8//3/wMADgAJABEAFAAaABUACwAEAAIA+//+//3/+f/5//3/BAADAAgACQAWACAAIgAaAA4ADgANABMAEQAcACQAMQAtACsAKQApADYAPAA6AEMASwBUAF4AWQBWAFYAWwBXAFIASwBRAE0ARgBGADkAPgA+AEAAPwBDAD8AMQAsAC8ALQAvADYANwA7ADYANwA4ADkAPQA3ACIAGwAbAA4ADQAIAAMA9//n/93/4v/b/9D/0//F/8P/wv/O/+X/7v/x//b/9v/+/wIADwAXAB4AHQAgACgAQQBBAEsAUQBVAF0AWABaAFIAXQBcAFoARgBKAEYAQAA6ADEAKwAlABoABQD7//H/7v/v/+3/6v/n/+7/7P/i/9b/1//J/8f/tv+x/7D/ov+g/6H/of+h/6H/nf+e/53/mP+P/4n/f/93/3n/c/9h/2P/Y/9r/3n/h/+F/4H/jf+J/43/lv+Q/5T/l/+Z/6n/v//K/9j/3P/d//X/AwAWAB0AJwArAC4AMQAkACYALwAuACgAJwAdACUAIwAfADEAMgArADQAMwAqACQAKwAmACcAJwAiAC0AKAAjAC8ALAAiACIAGwASAP7/9//v/+H/5v/j/+X/2P/l/+r/zv/e/9X/1v/S/9X/zP/D/8P/yP/R/8//2P/I/9T/1//c/+r/1f/u/9z/1v/a/9r/1f/v/+n/6//t//P/9//x//f//v/6//T/AwAFAAkAAwD8/wQA+f/6/wIADgAEAAcAAgAKABgABwAXABMAFwAYABkAJgArADUAMwA3AEEAQABJAEkAQAA7ADQAQQBBAEIARgA3ADUALAAoACMAIAAbABgAGQANAAoAEgAZABYAGAAcAB8AEQAHAPr/AQAIAAgACAD7//T/6v/g/9T/1f/h/9b/1P/U/9P/xv+9/8X/u/+1/6n/oP+h/6T/pf+t/7H/wP/E/8v/xP++/8X/xf/P/8T/0P/h/+X/7/8BAA8AEQAVABYAGwAbACIAKAAyAD8ARgBJAE0AVQBLAEYAQgBRAGIAYQBxAHEAdQB2AHAAcABxAHMAYwBaAFwAYgBaAFcASQA7AC8AIgAaAAUA9f/q/+H/0f/O/8H/tv+y/7r/tP+3/7j/sP+s/6P/of+X/4//iP+L/4j/g/+G/3T/a/9y/3H/cP9y/3X/ff+B/4D/e/+B/4H/ef9y/3z/gf+L/4//lf+h/6z/u//B/9P/1v/i/+r/8P8AABwAKQAxAEMASABSAFMAWABiAF0AWQBVAFoAVQBSAFAASwBWAE4ARgBMAEkAUABNAEMAPgBBAEEAPwBEAEgAPwA0ACoAHQAZABkAGwAfAA8ADQD+//T/8//t/+v/6v/u/+z/7//u//v/AwAJAAIACAAPABYAHgAsADoAQwBOAGIAbgB6AIgAmgCtALMAtwDAALsAuwCtAK0ArACwALkAwgDJAL4AsQCoAJ0AlwCIAH8AggB4AHcAbwBzAHsAcgBnAGEAZABjAGcAaABMAEAALQATAAkA8//v/9D/zP+7/6r/mf+G/27/Y/9a/1z/Vf9R/0j/Rv9S/17/af9r/37/gP+M/5H/mP+u/7H/uv/D/8f/x//L/8z/1f/c/9r/2v/g/+7/7f/5//n/+v////X/+v/0/+3/7v/3//b/9/8FABcAIwAoACwAKAAtACUAIwAaABoAKQAlAC0ALQA2ADYAMgA3ADsANAAtACEAGAAIAP3//v/4//r////6//v/BgD8//f/+//6//z/+P/+/wAA+P/2//P/6v/o/+D/3P/a/8//xf/A/8L/z//S/9n/1f/N/8v/xf/D/8X/w/+7/7T/wv/N/87/0P/P/9H/zv/K/8X/xv/J/8j/xf/E/8L/yP/S/9H/2P/a/+z/9f/0/+//5//t/+n/5v/l/9P/0f/P/9H/1f/T/8v/wP/B/8T/v/+0/6//o/+r/63/tv+q/6r/sv+v/7H/p/+o/6P/mv+g/6n/q/+l/57/oP+h/57/pP+f/5T/l/+d/6L/pf+g/7L/tP/C/8n/yP/O/83/1v/W/9f/0v/V/9//2//O/9D/4v/m/+3/6f/v//D/8v/2//v/AAAHAA8AFAAhAC4AOgBDAEYAPwA6AEYATABNAFIAVQBgAFoAVgBgAGkAbABlAFgAUwBdAGQAawBzAHwAhQCRAI8AlgCJAIoAjQB/AHYAbgBwAHMAhACFAHIAagBgAEsALAAcABMAAgD2//f/8v/9/wEABAAHAAcABgAJABAAGwAbABQAEAAUABcAFAAYABoAKAA1AD4ANwA1ADgALQArAC0AMQA4AEEASwBGAD4AQgA+ADgAOQA1ADUALAAqACQAKAAvADEALAAnACIAGwAfACIAHwAZABEAEQAPAAcAEgARABIAEAAPABUAGgAaABoAHQAkACkAMgA5AD8AQQA9AEMAOwBDAEwATwBQAEUATABFAEIATABGAE4AWQBZAGAAWwBlAGsAcwB1AG0AZgBeAFwASQAzACUAKgAyABYA/v/9//X/9//r/9n/2f/g/+H/5f/e/9z/5f/n/+P/2f/U/+P/5v/r//j/9v///wMACwAJAAkAFwAaABEADwAQAAcAFwALAP3/AAADAAYACQD///v/+P/x//D/3f/V/9L/wf+6/6j/lP+V/4//hP97/3X/cP9j/1X/Tf9E/1T/YP9d/1//X/9n/3b/eP9y/3L/dP90/3z/d/9v/33/hv+M/4z/j/+R/4r/j/+W/5j/nv+t/7L/pf+e/57/mv+l/6z/tP+2/7n/s/+z/7j/wP/E/77/wP+8/7L/sP+0/7f/uf+2/7b/rv+l/6H/nv+s/6j/qf+p/6//rP+l/6L/pf+5/8b/3f/q//P/9v/0/+f/5P/n//L/+f/x//z/7v/t/+3/8/8QAAsAGgAcAAcACQDs//L/7f/a/+//+P/f//D/7f/m/9//z//r/+P/7v/z//b/9P/z//H/3v/q//D/7//g/9//4v/R/9n/2P/i/+f/9v/w//X/+v/0/wAAFAAsAEEAWgBoAGoAbQBnAGUAdAByAHwAjACTAJ4AowCpALAAsAC1ALYAvwDIAMwAzgDFAMIAuQCtAKgAngCmAKUAmwCQAIQAfABrAGwAbwB3AHgAdgByAGYAWABQAEQAMwBBAEQARQA+ADgANgAkACIAHAAbACIAHwAhACMAKQApABcAHwAbAAQA///r/+X/2//R/9z/3f/j/+j/4f/e/+f/4v/u//r/9/8DAAkAAgAIABIAGwAvACIAHAAoAA4AEAACAPb/+P/8/////f8AAAEADAAGADAADgAdADgAFgA/AEEAIQA8ACoANgBFADgASQBHADgAXwBbAE0AdgBVAGcAeABcAHQAZQBAAGQAOwAvAD0ALQA0ADcAHQA1ABwAIgAtABMAIgApAAcAGgAUAPL/CwD2/9n/3f/K/8v/x/++/77/rv+v/6b/nf+T/5X/hv+M/4//ff+K/4f/hP+H/4n/hv+B/4X/d/+B/4b/iP+d/57/nP+d/6r/sP+v/7X/w/+3/7v/1P/Q/8v/0v/S/9T/0v/L/8j/z//R/9T/2f/c/+T/5//q//n/+f/5/wQABgAiABgAIgAnACUAFwAhAA8ADQAEAAMA9f////L/7v/r/+b/2//p/+L/3f/a/9z/yv/I/7//tP+u/6L/pP+b/43/jP+K/4n/lP+Q/5z/pP+s/6r/qP+m/6r/rP+s/7b/wP/K/9n/3//Z/9r/7v/w//j/AgAEAAAACgARABIAEAAjABkAGQAeAB0AGQAaABcADAAJABsAJAAoAC4AOQAqADYANgAyAEYATABaAGAAYQBjAGMAZgB2AHcAhACLAIAAfgB+AHoAfwBwAGAAWgBSAEsASwBBAEAAQgA6AC8AMAAlACEAJQAhABoAEAAJAAQABAAAAAQAAAD9//n/9f/p/+b/5f/u/wAACAAIAAUA+//n/9b/0f/H/8X/vP+7/7L/r/+r/5v/mP+Q/47/if+B/4D/iv+M/5D/kv+L/47/nP+e/6r/o/+p/63/sf+q/7D/vv+7/9D/4f/7/xwAMQBSAGMAcgB9AIEAdQBhAFIAUABEAD8ATABUAFMATABJACYAJQAqACYASwBSAGYAdwB7AG8AWwBXAE0AQgA8AEoAQgBCAD4AMgA3ADAAMgArADIALAApADMAMAAxACMAEgAOAAgACgAWAA4AAgD8/+X/yP++/77/vv/B/9f/6//4//j/+v/7/+z/9f/5//3/AAD9//j/2v/Q/8v/w//K/8r/z//k/+7/7f/y//f/9v///wAAAQATACMAKgAWABUACgD4//f/7//u/+b/4v/W/8//tv+x/6H/qP+k/6n/vf+7/73/u/+2/6z/rv+//77/w//K/8n/z//J/8X/1P/W/9r/0f/I/8r/uf++/8j/4P/l/+b/6P/i/+H/4//t//v/+f8EABMAEwAXABoAGAAaABQAEwAeABcAHQAkACIAKAAZAB8ALAAuADgAPgA4ADsAPwBHAEsAUgBfAG4AbwBsAGYAXwBhAFgATABLAEkAUABVAEkASQBOAEUAOAA9ADkAOgA3AD8AOgAoACEACAADAAMA//8AAAYABAADAAYABgD6/+v/4P/d/87/yf/C/67/p/+e/5D/iv+H/4T/if+J/47/hf+E/4f/hf+R/5j/nf+j/6X/rP+1/8L/xv/N/9P/3v/k/+T/5f/p/+3/9v/3//r////6//z/9f/y//T//f/9//v/AQD+/wUAAQD+//7/AQABAAQAAQD9/wEAAQAIAAQA/v/8//r//v8DAP//AwAAAP7/AwAPABgAHAAaACAAHgAYABcAEQAWAAgAHwAaABcAKQAeACcANAAmADkAOwA0AEQAQAAzADcAOwA7AD8ARQBEAFAAUABNAEsAQQA4ACEAHAASAA8AFwAVAA0AAwD7//v/8P/p/+T/5P/m/+X/6//t//X/9v/9//3/8v/r/+b/3v/a/9n/1P/Q/9H/zv++/7r/wf+3/7T/sv+o/6T/pf+m/6r/t/+4/73/xf/N/9b/0//a/+b/4v/j/+P/5v/u//T/AwAFABMAFgAWACYAKQAtACsALgAsACoAQQBOAFcAZwBvAG4AeAB/AIQAhwCEAHsAdwB7AIAAfwB7AGwAYwBnAGUAWQBTAEgARQBFAEIARwBFAEsAUwBVAF4AYQBiAGoAcgBvAGYAYwBlAGYAaABnAGAAWgBeAFwAXgBeAFMATwBDADIAJgAmACEAHgAjABoAHAAXABIAGAAUABQACwADAA0ADQAUABYADQADAP7//v/2//L/4v/a/9H/xf+7/7H/sv+s/53/n/+i/6D/oP+W/43/jv+N/5P/mP+m/7H/tv++/7//vf+8/7j/tP+t/6r/q/+v/6z/r/++/73/vv/C/9D/1v/W/+P/9P8FABAAGAAeACoALgA9AEkARQBUAFgAWABeAE0AQgAvABwADgDr/9v/4//V/77/uv+v/6X/nf+s/67/q/+//9P/x//D/8b/zf/V/8z/0P/J/9n/4f/i/+T/5f/s/+b/4v/n/+P/4//V/9n/4//c/9j/yf/A/8H/of+W/4b/dv95/2D/Wv9M/0H/Tf9U/2L/ev+M/5z/qv+z/77/0v/c/9v/3f/M/9L/2v/Q/9P/0f/U/9T/1v/e//H/AQACAA0AEwAhADUAQQBdAGQAaABrAFwAVQBcAF0AWABfAF8AYQBWAEoAPQA5ADAALAAsABcADwAYAAcA9//s/+v/+P/8/+r/4v/a/87/1f++/6f/q/+t/8X/3v/b/9n/2v/C/7//xf/D/9f/2P/P/9D/zf/Y/9X/2v/k/+P/2f/b/9X/0P/d/9v/6v/s/+z/6v/b/+D/8f/3//b//f////r/AwAhADkARQBRAGgAcABzAHYAeABzAGwAWABQAE8ARgBJAEkAOAAvABsADAAPAAwADQAXAAsA9v/v/+7/7f/p/+H/2f/N/8H/tv+w/63/qv+x/77/xf/F/8v/z//K/8z/xv+9/7b/v//H/9D/1v/d/+r/9v/y/+j/5P/d/9n/3f/h/+X/6f/q/+b/5v/o/+T/1v/V/9j/2//Y/9n/0//S/8v/vP+9/7L/q/+u/6//uv/H/8f/x//O/8v/yf/W/+D/8P/5////BwACAAQADQAbACgANgA7AEIARgBOAGIAcAB/AIcAkQCfAKoAvgDVAN4A6wACAQYBGAEmAS8BMAExAToBMwEuASsBKgEuASwBKQEnASUBFwEOAQ0BCgEFAQ0BGQEJAQAB+QDhAMsAwwDAALUApgCgAJQAgABmAFIASwBGADMAMAAuACEAJwAwAC0AIQATAAwACgD+//T/7f/Z/9D/0P/K/8//0//Q/9P/zP+9/7T/r/+s/7H/tP+8/8P/wf+5/6n/o/+q/7r/tf+z/7n/vv/M/8z/y//E/8X/w//B/7//sv+w/7P/q/+u/6f/qf+s/7P/wP/M/97/6v/9/woADAAOAA8AEgAOAAcAAAD1//v/BAAOAB0AHwAhABcADgD///H/+f/5/+//3//a/93/0v/P/8f/t/+q/6L/nP+f/5P/jv+P/4//k/+X/5H/iv+M/47/kv+K/4L/iP+H/4T/f/+I/4//k/+N/4j/j/+L/5H/o/+p/63/vP/H/8r/zP/Y/9L/0//Y/9z/3v/t/wMAEQARABYAGQAXACIAIgAtACsAKQAhABEAAQAAAPb/6//n/9v/1P/Q/7//vv+8/7P/pv+g/5b/j/+P/4f/gv98/3D/bP94/3//hP+J/4n/j/+J/6f/wf/T//X/9f/y/+L/xP+j/5L/hv95/3T/YP9X/0L/Mv82/x//EP8T/yT/Nf9T/2T/fv+R/5v/ov+q/8H/3f8EABYAJwAnADgAQgBSAFQAUgBfAGUAcAB1AG4AYwBRAEEAHwAHAPn/8v8BAAIAAwD9/+n/3f/a/+H/9P8EACAAIQArAD4AOgA9ADEAMgAoAB8AKwAkAB4AKgAgACMAKwAvAEkAbgCIAKQArQC6AMgAxQDOANoA6QALASUBIQEiASEBGwEVARABCwECAfAA6ADYALsAowCJAHUAYQBRADwAJAARAAMA7v/f/9H/wP+2/6j/kP96/2b/WP9b/1z/Vv9d/2D/Xf9e/2H/a/92/3//hf+G/4P/i/+B/4P/hf+A/4D/iv+V/53/nf+b/5v/oP+p/6//qf+j/6r/sf++/8j/yP/J/8//2P/d/+r/9/8IABkAHAAmACYAKQA3ADgAPQA3AD0APgA5ADoAPgBCAD8APAA0ADcANwA8ADkAPwBIAEYAQQBIAEsAQgBEAEIARABQAFYAWQBRAEsASABFAEYAOQAxACkAIwAXAAsA+v/o/+D/w/+p/5z/hf99/3T/cP92/3H/cf9x/3j/hf+S/5X/mP+Q/5T/o/+x/7P/rv+v/6z/ov+X/5X/mP+W/5//r/+5/8j/1f/k/+z/9P8IABAAEwAeACsAKgA5AEAATABNAFAAWgBUAFkAVgBTAFMAUwBVAFkAVwBXAFYAUgBSAFIAWwBdAFkAXwBqAG4AdgB5AIUAjwCSAJsAowClAKYApwC0ALsAuQDJAMwAyADJAMQAxQDHAMQAwQDDAL0AwgC5ALAAtgC4ALgAswCnAJYAiwCLAH8AbQBpAFgASQBGAEEAQAA9AD0APwA2ACwAJAAfABwAFAAFAP7/9P/u//D/6v/o/+b/2//Y/97/2v/e/9n/yP/J/8X/tf+9/7j/sP+m/6P/oP+X/5r/mP+c/63/rf+0/7v/yf/Z/97/3v/X/8z/x//I/9X/3//k/+b/5//n/9z/2f/f/+L/6f/s//L/+P8AAAgACQAHAAUACAAIABEAGgAhACMAKwAkABIADgAKAAYABwAJAAYABgAFAAQA/P/1//X/8//x//D/7f/u//L//f/7//n/+/8FAA8AEwAhABMAHQAbADIATgBqAIsAoQCjAJ0AiwB4AF8AOgAeAAgA8f/R/7b/m/+L/2b/Rf8y/yX/Hf8f/yr/K/8e/xn/BP8B//3+D/8U/x3/Kv8t/zD/HP8Y/w7/EP8X/yL/Lf86/0v/Y/9k/2b/Xv9N/zX/Nv9A/0v/Vf9Y/1X/Uv9M/0X/Q/9G/2L/cP99/5T/r//D/8v/0P/Q/8z/z//T/9j/4P/m/+D/1v/U/9z/6P8JACUAQgBSAGAAcQCDAJAAqgDAANAA3ADgAOkA8wAEARcBIQEgASIBKAEjASMBHQEYARoBGgEPAQAB6gDeANIAxwC5AKcAnACLAHYAYgBRADwALAAdABAAAgD1/+7/3P/M/77/vf+9/7//zP/V/9L/zf/A/63/nv+X/5r/ov+W/4j/hv9+/3X/cP9u/3D/af9l/2H/XP9S/07/Rv9E/0j/Vv9V/2H/cf93/3n/gP+F/5H/nv+k/6f/rP+j/57/nv+Y/5b/kv+V/5n/nf+k/6//t/+//83/2f/o//f///8KAAoAFwAbADAAPQBPAGEAZwB0AIMAkQCcAKEAnQCiAKUApwCvAKkAnACaAJQAlgCQAIoAgABwAHEAXwBHADsAKwAjAB4AFQAYAA0ADQANAAkADgATAAoACgAHAAEA+v/v/+L/1//J/7v/vP+8/77/xf/U/9r/3f/k/+//9f/7//j/9f/t/+z/5//i/9b/zP/L/9H/0//Q/9H/zv/U/+H/5//s//H//P8FAAIAAQD8//7////+//n/9//5/////P/4//z/+/8KAAoACAASABMAKwA0AEMAUwBfAGkAawB2AHYAfACIAI0AigCNAJEAkQCUAJgAmQCRAJQAkwCKAIYAeQBqAFgARwA+AD0AQAA6ADoAMwA2ADYANwAvACkAHAAOAAIA9//r/+H/3P/U/93/3P/a/9//2f/T/9P/0P/X/9z/5v/h/+f/8v/6//j/+P/3/+3/8P/2////DQASABgAIwAkACIAIgAfABsAFQATAAsACgAOABAAFgAXABkAGQAnACsALgA4ADgANwA1AC8AMQAnABsAFgABAPH/6v/q//L/8v/0//j/BgANABMAHQAsADwARgBIAEoAUQBUAGYAbwBwAHoAeQB+AIYAjwCaAJ4ArACzALkAvgCrAJ4AiwBjAEoAKQAMAP7/5P/O/7X/nf+W/5L/i/+W/57/oP+p/6n/ov+x/7z/v//N/83/0P/d/9H/xP+3/7v/sf+t/67/s/+z/73/v/+5/7P/q/+k/57/o/+f/6T/q/+y/7H/qf+s/63/tv+8/8L/1P/b/+L/6f/v/+3/+P8QABkAIQAjACQAJQAbAB4AGAARABQAHgAuAEAARQBJAFUAVwBkAG0AbQCBAIkAiQCNAIsAlACaAJsAkwCPAI4AigCEAH0AfwBoAGAAUwA6ACYAEAADAPH/4P/X/8r/yv+6/6v/pP+X/4f/ef9z/23/bf9n/17/T/9B/zz/Nf8x/yr/I/8f/yL/JP8j/yL/KP8r/zD/Lf8s/yf/I/8c/xj/G/8V/xb/If8q/zf/O/9H/0z/U/9s/3b/i/+h/63/u//G/8r/2v/p/+//9P/6//7//v/8//X//P/5////AAD8//r/+v/3/+3/7P/u/+r/7//v/+z/7f/0//z/+/8BAAMAAAD9/wkAAgD7/wUAAgAJABUAEQAMAAwACgAFAPv/9P/n/+D/4v/Y/83/1P/U/93/3v/h/9v/z//N/8P/wv/F/8P/vP+3/7v/uv+y/6r/qf+h/5X/k/+Q/5L/j/+O/4b/e/93/2z/Yf9e/1v/W/9W/1H/Vf9b/2f/cP99/4v/lf+V/5v/pP+s/7n/wf/H/9b/3//m//H/BAARAB8AKQAuADYARQBTAGcAegCHAJQAnwCtALcAvwDIANEAzgDVAOEA6QDrAO8A7gDpAOIA4gDfANMAywDHAMEAvQC9ALEApwClAKkArACvALQAtQCxALIArACnAKEAmgCXAJQAkACNAJAAigCFAIgAhwCHAIAAggB5AG8AaABlAGoAbgBvAHQAcwBsAGoAZQBhAFoAVABWAFEATQBGAEkARQBAAEIARQBDAEgAWgBaAFEATABNAEsASgBeAGsAcgB8AIYAkACYAKYApQCkAKgAqgCqAKgAogCVAJEAkACOAI4AkwCWAJMAlQCaAJoAkACMAIAAdABkAFMAPAAoAB8ADAD4/+b/1f/T/9H/yf/G/8P/wf+3/7T/sv+y/7H/qP+g/5j/l/+Y/53/nv+h/6f/pf+r/7f/xf/N/9T/1//T/9f/3//0//f/9//+/woAFwAbABoAHAAeABwAFQATABAADAAMAAUA+f/z/+j/2//T/8H/u/+7/7//wv+3/7H/r/+s/6//sf+w/7D/q/+p/6L/nP+c/5L/g/9+/3j/c/9v/2n/af9r/2j/af9v/2v/bv9v/33/h/+O/5b/nP+g/6L/rP+5/8L/wP+4/7n/tP+u/6f/rv+w/6//t/+6/8D/vP+7/8X/zv/U/9j/2v/Y/83/w/++/7z/vP+x/6r/of+c/5r/m/+V/4v/hP9//33/ef96/3r/gP+M/5D/lf+f/6v/uP/D/8v/1P/b/+f/8f8AAA0AHwAkACIAIgAjACYAJwAoACwAJwArACoAMQBFAE8AUQBRAE4ARwBGAEcAQwA5ADAAKAAiABoAHAAYABEADAAKAAUAAwD9//f/9v8EABMAFwAcAB0AHwAcABgADQD8//H/8P/u/+f/5//m/+D/1f/X/9b/1//W/9P/0P/G/7//vv+6/7L/rv+q/63/q/+t/6n/oP+f/6T/qP+s/7b/u//C/8L/xv/M/9f/6f/1//j/CQASAAoADgASABcAJgA7AEQASABTAFoAWgBhAGIAWgBSAFIASgA8ADcANwA4AC4AIQAcABgAEQAEAPb/7P/r/+3/6P/f/9L/zP/I/8f/vP+x/6T/oP+j/57/n/+l/7H/uP+3/77/vP++/8T/w/+8/7P/t/+6/7v/wv/C/8X/yP/L/9D/3f/k/+r/+P/+/wcACQAVAB8AGgAXABMAGgAjACgAMAA1ADYANwAzAC8ALwAtACkAKAA2AEEASgBKAEgASwBGAEAAPwA+AD8ASQBQAFwAaAByAHEAZgBaAFQAUwBbAGMAcAB5AHEAdABuAGQAXgBgAGMAZQBmAGQAYABOADsAOwA3ADgANAAyADAAJgA1AD4AQAA9AD8ASQBQAFwAWgBRAFAASABHAEYAPABCAEcAUQBLAEAAMwAjACYAKAAvADQANwBEADcAKQApAC0AMwAzADYAOwA/AD8AMwAsABoAFAAXABEAFQAVABMADwAFAP7/9//v/+f/5//t/+L/4//i/9n/1//T/9f/1f/O/9T/3f/m/+v/7v/v/+f/6//k/+////8FABYAGAAUABQAIAArACkALQAuACwAOABKAGYAdQB8AIQAgwCJAIYAjACOAI0AkQCEAHkAeQB2AHcAcQBhAFQATABHAEQASgBPAEQAPQA1ADAAJwAiAB8AEQAGAPj/+v8FAA0AEwAKAAsABQD//wMA/v/7//r/9f/r/9z/0//G/8j/zP/P/9L/yv/K/87/0P/c/+H/7P/z/wAACAAKABUAGgAeAB0AGQAaABcAFQAWABAAAwD2/+n/3P/U/9D/0P/R/83/yP/E/8L/wv/C/7n/sP+k/57/pP+h/5//oP+h/5b/kP+Q/5D/if+K/4j/gv+G/4T/gv+F/4r/k/+h/7D/tv+8/8j/z//O/83/zv/S/9T/3P/s//n/AQAKABcAGwAfACAAJQArADEAPAA3ADgANQAqACQAHgAXAA4AAQD2/+j/2P/M/8L/uP+0/6z/of+e/57/nf+Z/5v/lv+S/5j/o/+l/6T/pP+h/5f/hP97/3v/c/9u/2v/av9n/2P/Wv9Y/1P/T/9W/1L/Vf9c/2X/av9w/3b/e/+D/47/lP+a/6H/of+k/6X/qP+u/7X/t/+9/8X/xv/I/87/zf/J/7//wP/A/73/v//D/77/vf/A/7//xP/K/8r/1f/e/97/5v/k/+X/7f/w//3/AwAHABEAFgAaACEAKgA0ADcAOAA8AEIARwBQAFkAXABaAFgAUwBcAGsAbAB1AHcAewCDAI0AjwCHAJAAlgCcAKAAnwCbAJ0AnQCSAIYAgQCAAH8AfQByAGEAXQBgAFwAWABVAFEASwBDAEMAQwBEAEwATQBIAEgAQQAzACsALgAxACoAKAAgABsAFQASABYAEgAMAAkABwD+//P/6//q/+n/3//d/+f/5P/h/9v/0P/E/7z/vf/C/8z/1v/b/9r/4v/m/+j/7//3/wAAAwAIABUAGQAiACYAKAAyAEAATABRAFcAWgBiAHAAhgCKAJIAmwCbAJcAmwChAKQAogCjAKYAngCcAJsAnwCjAKUAogCgAKcAoQCcAJkAjwCJAIYAgwB6AHkAeQBzAGoAXQBYAE8ARgBBADoANgA7AEQAQgBEAEcATgBWAFgAYQBmAHMAegB7AH4AfwCHAIgAiQCHAHcAcABsAGoAZQBeAFgASgBCAD0APAA3ACwAKAArAC0AJwAjACAAHgAZAAYA+//2/+//5f/d/8r/uP+k/4//if+A/3b/df9u/2j/Y/9c/1v/XP9a/1v/Xf9i/2n/Zf9j/2X/X/9e/1z/Wv9k/2r/Z/9k/1r/Wf9j/2f/Zf9f/2j/a/9p/2j/W/9V/0z/RP9C/03/VP9X/1T/Xf9m/2r/c/+D/43/kv+h/6L/pv+s/67/tv+7/8X/zv/S/+P/6//v//T//f8EAAAAAAABAPj/6v/j/+D/3//d/+T/5//u//P/+P/4//j/+f/3//D/7//z//b/AQAEAAEAAAD7//j/7v/k/93/1//U/9n/3P/a/+H/5P/W/9L/2f/U/9L/0P/U/9P/1f/e/+D/3f/g/+H/5//t/+z/7v/u/+j/6//r/+X/5v/s//H/9P/4//n/9f/3//f/+//7//X/+v/6//T/8f/t/+f/2v/X/9P/y//J/8X/vf+2/7P/u//E/8v/zf/K/8v/xf/H/8f/w/++/8P/zP/Q/9L/y//G/8r/3f/k/+P/5//t/+f/3f/Y/9P/3//x//f/7P/k/+3/6//n//L/8v8BABUADgAHAPf/8P/p/+D/1/++/6L/kf+D/3X/fP9+/3f/cv+D/5z/tP/S//f/IgBUAIQAqADNAPAAFgE6AWUBggGdAcEB5AEAAhwCOAJKAmMCcAKJAp0CswLGAswC0wLRAssCzgLAArACoQKGAmsCPwIRAvEBzwGmAYwBXAEtAQIByQCuAIUATQAiAPr/yv+S/3H/Uf81/xT/7P7E/p/+cP5S/jP+DP7t/df9qv2D/WT9O/0e/Qb94/yy/JT8f/x2/GH8Sfwu/Cf8MPw6/EH8U/xj/H/8nfy0/OL8Cf0y/Vn9iP2s/dD9+P0d/i/+Q/5f/ob+pP6+/tz+8/4L/yj/Qf9U/3r/f/9o/1b/K/8Y/0L/Yv99/4P/WP8r/x3/Gf8i/zP/Qv9W/1j/Xv92/57/uf/e/xQAGwAlAFoAiAC0AN8ABgE7AXMBqQHRAQICJAJOAnkCowLIAukCDAMWAzIDRQNDAzQDNgM5Az8DRQNGAzsDNQMcA/0C3wLEAqcCiAJcAiICAALRAa4BeAFFAQ4B5gDVAMUAtQCfAJ4AgABnAEcAJAAFANv/xf+b/3H/UP81/yn/FP/+/v7+CP8A/8f+dP5D/jP+WP6D/q7+u/6T/m7+R/48/lr+qv78/ir/NP8y/0n/iP/d/yQAYwDBAAwBTwGMAcQBCwJOApkCuwLZAjMDZgOAA5YDlgOWA5IDjAOGA4EDcwNsA2kDWwMxAxgDDgPyAtACsgKMAmYCUgJAAjQCNAIqAg4C9AHeAcQBsgGYAXIBSgEyAToBUQFxAYcBhQGGAXYBYQFIATIBHAEBAewAwwCgAIUAagA/AB4ABwDo/7n/hf9W/x3//f75/gb/IP8m/x3/E//+/sj+rP6o/qf+t/67/pz+i/6T/pX+mP6Z/pD+fv52/nL+bP5t/nT+f/6N/ov+hv6N/of+fP5v/lL+VP5F/iz+JP4Z/hb+Hf4f/jn+Pv46/jD+Mf4//jT+M/5A/mL+if6j/qf+xf7P/sr+1f7o/u3+9P79/u3+EP8M/xn/Kv8+/zH/Mf8u/yr/NP81/0f/Rv9e/17/W/9b/1b/P/8n/y7/G/8O//v+9v7n/ur+4f7G/sL+q/6o/qP+lf6N/oL+jP58/mP+U/5J/kf+Nf46/kD+Nf4y/ij+B/4F/vf9+/0D/gj+Bf7x/fn9/P0D/v/97/3w/fD95P3d/df94f3v/fT9+f0C/g7+Ef4V/hb+Cv4E/v39//0K/hL+Jf4u/jX+P/5N/l7+ef6G/o/+p/6y/rb+3P7w/gX/Jf8o/zf/O/89/z3/Wv93/4H/l/+o/7X/z//j//T/DgASACUANQA+AEcAQgBHAGAAaQBvAIQAkgCbALYAwwC3AMYA3gDsAAEBCgEPARUBHQEqATABOQFGAVwBZgFoAWYBZgF8AZABpQG2AboBtgG4AbQBmgGLAYQBZQFZAVUBTQEzATMBLAEbAQ8BBwEEAfsA9ADtAOgA1ADRANkAyQC5AL0ArwCqAKIAoQChAJcAjgCGAI0AlQCdAKkAowCoALQAvQDKANwA4wDcAOQA8gAEARMBHwEkAS4BOwFEAVQBVwFdAW0BbQFwAXQBZwFwAWcBaQFwAWwBbwFpAWQBYgFuAX0BggGGAZIBlQGaAaEBngGnAbMBrQG7AcgByQHJAcABzQHeAd4B2wHhAeAB6QEFAv4B/wEQAh0CKAI8AkICRQJVAlUCWgJYAl0CYQJhAm4CcwJxAmoCZgJUAkUCQwJBAjMCKAIVAvoB5wHPAbcBpgGMAWwBWQFFASwBGQECAeIA1QC9AKoAjgBwAFoAQQAzAB4AEQABAPn/8//f/9H/vv+u/6P/kv95/2f/Uv84/y7/IP8T/wv/+/7m/sn+rf6c/o3+kv6O/or+mv6h/p3+n/6c/qb+of6p/rT+tf7D/s3+zv7O/tD+yf7J/sj+xv7H/sr+1f7V/tf+3v7l/u3+8/7//g3/Fv8e/zH/SP9V/2b/cf9//4D/gP+A/3j/fP93/23/bv96/3b/cP9h/1L/SP9D/zL/K/8k/w//CP8G//f+3v7U/tL+1P7M/r3+xv7F/rv+vP7E/sH+w/7B/sv+0P7K/sj+y/7C/rv+w/7J/tX+0/7N/s7+xP64/rD+pv6b/pT+hv5x/mj+Yf5a/l3+Wf5Z/lb+Sv5G/kT+N/4w/i/+JP4X/gr+//3t/eH90/3N/c390P3J/cn91v3k/en97/37/QT+Df4b/ir+Ov5F/ln+aP54/oj+lP6m/rD+vf7U/t/+6f7v/vX++P4C/xP/GP8h/yj/Lv8//z//R/9K/1D/Vf9h/27/df+D/47/lP+V/6P/s//D/8n/z//c/9//5P/3/wkAGAAxAEIASwBQAFgAXwBrAIEAjQCRAIwAnACtALYAvQC9AMYAzwDcAOIA6QD6APEA7wDwAPEA7wDdANgA0QDGAL0AtQCmAJkAkwCMAHoAbgBzAHUAdwBuAG4AawBiAGUAYgBXAFEAVwBeAGMAZABlAG0AdAB9AIoAkQCXAKUAqgCoAKwAsQCwALEAsgC0ALMAuQDGANMA3QDiAOcA7QD4AAMBCAERARcBDwENAQIB+gD4APoABQELAQoBAwH+APMA7gDyAPQA6QDkAOUA3gDRAMIAvgC8ALkAuQC+AMIAwgDBAL8AtACwALUAuwDJANIA3QDoAPIA9wD4APsABwESARcBIQEnATIBOQEyATQBOgFBAUsBTwFYAWYBbQFyAXoBeQFxAXABbwFdAU0BVQFiAVgBTAFQAUwBRwFLAU0BSQFGAUQBRwFIAT4BQQE+ATABJAEYAQ0B/gDqANkAyACyAJ0AlQCDAHwAfAByAGYAWABTAEoAQgBBAD8AOwAuACIAHgASAAMAAAD7//f/9v/2/+3/5f/i/+P/7f/p/+T/3P/U/9b/1v/Y/9j/1P/S/9v/6v/w//L/8v/6//z///8LABAAGwAeABgAGgAeABoAHAAbACAAJAAgACQAHQAWABMACgAJAAMA8//r/+j/5f/d/87/wf+w/6j/pP+e/5T/h/+B/37/ev9z/27/cf9t/2L/Xv9c/1f/Uf9O/0T/O/8y/x7/F/8S/wf//f7v/uf+4/7d/s3+xv7F/sb+yf7J/sn+x/7H/sP+v/7F/sb+z/7Q/sr+wf67/r/+v/6+/rj+sf66/sH+xf7D/sT+yP7B/sL+xP7A/r3+wv7D/rr+u/69/sL+zP7N/tP+1P7O/tX+3v7c/tz+2f7Z/uH+5/7t/v7+Dv8l/zX/Q/9f/3b/hv+c/7f/x//V/+r/9/8BAAgACwAXAB4AJAAyAD0APgA0ADkAPAAwACwAKgAmACYAIAAiACgAIQAeABwAEwAQAA0ADQAMAAsADQAPAA4AEAAUABUAGAAPAAwADgAGAAQAAwACAAQACwANAAsAAADw/+v/5//b/9j/0v/H/8T/uP+0/7P/r/+w/7X/tP+r/67/rv+t/6n/n/+P/4P/gf98/4T/f/+D/4j/h/+U/5n/pv+w/7X/w//N/9H/zP/W/97/3v/j/+///v8FABIAJwAzAD0ATABgAHcAjQCdAK0AvADGANIA1QDdAOYA8AD4APgAAAH8AAMBAwH5APwA/gAAAf0A+wDxAPMA9wD/AAIB9gD1APIA7gDuAOgA4gDbANQAzgDJAMcAxAC5ALoArgCiAKIAowCjAKQAqAClAJ8AnwCfAJoAmgCgAKYArQC3ALsAtwC1AKsAoACTAJIAlwCSAI4AhAB/AHYAbQBoAGYAbABqAGsAZgBSAEgASABQAFgAXQBbAFcAUABEADsAMwAoAB8AEAAJAAYA/f/2//P/7v/p/+f/5v/u//D/6f/t/+v/6f/q/+P/3P/T/9X/5P/s//X///8IABoAJwAxADYANwBGAFIAWgBdAGMAYQBgAFoAVgBaAGMAaABxAHQAdAB2AHQAbwBhAFwAWgBYAF0AXgBZAFQAUgBPAE8ATwBGAD4AOwA4AC4AJgAmACAAGQAQAAoACgAOAAsACAD8//P/9v/4//f/+//3//f/9f/t//D/6v/h/93/2P/T/87/x/+9/6v/nv+R/4P/e/9//4L/ev91/3P/cP9t/3P/c/91/4D/gf99/33/eP90/3L/a/9s/23/cP9x/2j/Zf9k/2T/aP9k/2v/c/95/4H/ef+A/3j/eP95/4D/k/+V/57/lv+b/6n/o/+o/6T/pv+m/6P/pv+i/6P/o/+g/6L/o/+m/7b/vv/M/9b/5P/s//L//f8CAAIA+v/0//T/8f/x/+v/5v/f/9f/3P/c/+D/5v/m/+H/1//X/9H/3P/j/+r/6f/q/+7/7f/q/+j/8P/s/+T/3v/W/87/vv+3/6v/pP+s/7X/tP+t/6z/sP+p/6b/o/+q/7T/uf/G/8f/z//V/9H/1P/L/9T/1P/g/+T/6f/r/+n/+P/6//n/+P8CABMAGwAlACUAKQArAB8AHAAbABgAGwASAAwABgACAAAA/P/8//3/+//7//z//v8DAAcAAAD5//f/+f/8//v//P/9/wYABwAIAA0AEAAVAB8AIwAuAC8AMwA2ADQANwA+AEcATABVAGUAdAB/AIAAfQB4AH0AewB1AHkAcgBvAGYAYgBjAF0AVwBXAFgAVgBbAFkATABBAEEARABDAEMARgBFAEMAQgBAAEQASgBMAFIAUABOAFIASwBFAEgASABMAEcAQwA9ADIALgAnACIAFwAQAAgA///3//X/8//q/+P/4v/g/93/2v/f/+j/5//m/9//1//U/8r/wv/B/7b/sP+x/7D/r/+2/7n/uv/D/87/1v/f/+r/9v/+/wMAEAAPAA0AFAAVABUAGAAWABkAIgAuADYAOQA7ADwAQAA/AEQAQwBBAD0AOAA8ADoAMQAsACYAHAAJAAIA+//u/+P/3P/Y/9v/3f/j/+P/3v/c/9v/3//f/97/3//b/93/1P/H/8P/wv+9/7j/s/+1/7D/rv+2/8L/yP/G/9D/3P/k/+v/8f/6//z//P8BAAgADQALAAsACgAEAP7//f/8//P/8P/q/+j/6v/d/9j/0P/M/8v/xf/B/7T/qv+p/6z/tP+x/7D/uf+5/7f/wP/E/8n/y//Q/9f/1v/O/8j/zf/R/8n/wf++/7X/r/+r/6n/rf+u/6//t//B/8b/wf+//8f/yP/N/9L/1f/a/9n/1v/Y/93/5//x//r/AAACAAgADAASABQAEwAVABsAHAAWABUAEAAMAAoABAABAPr/9f/2//H/5f/e/+H/5//w//j/AQAIAA8AEQAUABcAGAAhACsANgA8AEQASQBVAFUAVQBbAGEAcwB7AIYAkgCZAKUAqACpAKYApgCoAKgAtQDBAMkAywDJAMEAuQC3ALIArQClAJ0AlQCEAHkAawBhAFMATABOAEwASgBAADsANwAvACwALAAvAC8ALgAqACcAIgAhACEAIAAfACAAKQAtADUANAA1ADoAPQAzACgAIgAUAAwABAABAPv/8//x/+X/3//b/9f/3//j/+v/8f/0//r/AwAJAA8AEgAUABMAFQAhACgAMQA2ADgAOwA/AD8APwA/AD0APwBHAEkAQAA4AC8AKAAgABcAEAAIAAMA///6/+//5f/f/9T/zP/K/8f/xv/M/9D/0v/S/9b/1v/S/9X/0v/M/8L/t/+y/6v/rv+y/7j/vP/C/8v/y//N/9L/0//O/8r/xv/C/7//vf/C/8f/y//M/8f/w//C/8T/xv/D/8H/wf/B/8D/w//A/7z/uP+y/7L/rv+0/7z/vf+9/7X/qv+o/6T/m/+P/4j/iP+K/4v/h/+H/4r/hf+F/4T/gf+D/4f/iv+N/5H/nP+j/6z/sf+4/77/xP/O/9n/6v/7/wgAEAAWACEAKgAuADIANwA2ADoAOwA4ACsAGwAWABEADwAKAAQAAQD3/+r/5f/g/+T/4//d/9z/1P/Y/9b/0//Q/83/x//F/8n/yP/H/8H/wf/F/8n/1P/C/9P/6//9/w0ACQATABMAGwAmACQAJAAmACwALwAqAC0AMAAzADEAJAAgABoAFwAVAA4ACwABAPz/9v/y//P/6f/o/+n/7P/z//3/CAAHAAQAAwD9//j/+v/4/+z/2v/S/9r/5//q/+H/1P/U/+H/7/8AAAAA/v/9/wYAIQA6AEcAPQAyADoAVQB2AIsAiQB+AIYAlgClAKUAnQCVAIkAewBwAGYAXgBWAEwATwBQAFAAUwBXAFIASgBIAEkASABFADQAIgAkAC8ALAAhABAACQAPABIADAAAAPv/+v/3//T/8P/u/+7/8v/8/wcAEwAeACMAIQAhACMAJwAiABwADQD///z/+//6//v/9v/5/wIADAARABIAFQAYAB8AKgAxADYAOgA9AD4AQABEAE0AWQBdAFcAVQBbAGYAawBlAGMAZABoAGsAYwBbAF0AXgBhAGIAWQBHAD0AMwApACEAHQAeACEAKwAyADMAKgAYAA4ABQD5//L/7P/h/83/xv/Y/+//8//Z/83/2v/l/+b/2f/I/8X/zf/F/6//ov+a/5j/k/+J/4L/hP+J/5L/nP+j/67/tv+1/7n/vP+3/7L/r/+1/7j/s/+v/6n/pP+p/7P/tv+5/8T/x//D/8L/yf/S/9X/1P/R/9n/4P/h/+T/5//w//b/8//q/+n/7P/t/+3/6//w//H/8v/0//P/7//o/+v/7//x//L/9P///wwAFwAaABkAGgAcABwAFAAGAPz//P////n/8P/w//f/+//+////AAABAAEAAgAIAA0ADgAPABEADgAQABIAHAAkACgAKwAnABwAEwAPAAkA/v/x/+n/6v/u//L/9P/1//L/8f/t/+b/4//g/+H/6P/u/+7/8P/4//7/AgAIAA8AGQAjACwAKgAlACEAHwAeABgAEgATABMAEgAPAA4ADQAKAAoACwANAA8AEwATABMAGQAaABgAGgAgACMAIAAnAC4ALwAyADEANgA7ADkAMAAlACAAIgAoACgAJgAfABUADAADAAAAAgACAAIA/P/6//j/8f/q/+T/4//Y/8z/xv++/7b/qf+g/5r/kf+J/4P/gf+E/4f/i/+R/57/pP+n/6z/sf+3/7//x//K/9D/0v/U/9f/2f/X/9P/z//K/8n/zP/V/9r/3//h/9v/2P/X/9X/1//d/+P/4//i/+P/4v/g/9z/1P/T/9L/1v/c/+P/7f/4//z//f8DAAIAAwAGAAMABwAMAAoADAAMAAwADAABAPn/+//+/wAA/v/5//f/+/8AAAEA/////wIABgAQABoAIQArADAAMwA3ADwARABMAEkAPwA5ADYAOwBCAEIAQABDAEUASgBMAEwAUABUAFUAVQBWAFkAYABfAFUATwBXAGQAaQBfAFQAWwBnAF8ARwA3AD8AUQBRADgAIAAcACMAGwAGAPv/+f/2/+7/4v/Z/9P/z//L/8r/zf/V/9f/0v/K/8b/zP/W/9T/zP/M/8f/vv+6/7v/u/+z/6z/qv+z/7z/vf+8/8X/1P/o//L/8P/w//b///8EABMAJAArACcAIwApADMAOAAzADEANwA4ADIAKgAkACQAIAAbAB4AHQAdABwAFQAOAA8ADAAMAAoAAAD2//T/9//5//f/9//9/wIACAAQABYAGgAfACwAOQA/AEYATQBNAFAAVgBdAGQAZwBpAGoAagBrAHEAcQBlAFYASQBAADkAMAAtACcAKAApACIAHgAgACkAKgAnACMAHwAZABEADAACAPv/8//m/9v/0f/J/8b/wP+1/6z/qP+g/5X/kP+Q/5P/j/+L/43/lP+c/6L/qP+x/77/wv/G/8z/0v/W/9L/zP/M/8v/zP/K/8b/wf/A/8L/vf+5/7j/uf+6/7z/v/++/77/u/+3/7b/tf+1/7n/vf/C/8P/yf/S/9b/0v/G/8D/wv/C/8L/x//M/9P/2f/Z/9v/5P/z/wQAFAAnADoATQBiAGYAYwBhAFgAVABVAFQAUQBPAE4ATgBIAEoATABNAE0ARwBGAEoASwBJAD8ANQA5AD0ANgAuACgAJAAgABwAGQAaAB0AIAAfABgAFgATABUAHQAjAC8ANgAzAC0AKgAbABYADwAJAA0ACQAHAAUACwAQAA0AEgARAA8ACgACAAQACAALABAADwACAPT/3//S/8f/wf/F/8n/zf/H/73/t/+v/6T/l/+T/5f/pf+v/67/sP+t/6z/rv+0/7r/wv/H/9D/3f/n//D/9v/2//P/8P/3//7/BgASACEALQAsACsAJgAmAC0AMwA+AFAAXgBrAHUAcgB0AHEAYQBaAE8ARgBGAEcAQwA5ADAAJgAdABgAEgAJAP7//f/4/+v/6v/l/9//5f/m/9r/4P/g/9X/1v/R/8b/xP+7/7H/rP+u/7f/w//L/83/0P/Q/8//z//V/+T/6//x//f/AgALAAsABwAHAAoADQASABgAFgAWABoAGwAaABAACwAMAAkACQAYACUAKgArAC8ALAAoACsALgAxADAAKgAmACAAHQAXAA8ADQAIAA0AHAAdABwAFgAQAAgA/v/1/+P/4f/c/9b/2P/V/9X/2P/W/8f/xf/M/8f/wv+4/7X/sv+t/63/pf+a/5f/nv+s/7v/xf/O/9f/2P/a/9//4f/f/+D/7P/1//j/8P/i/9j/0P/I/8H/wf/F/87/1P/V/9v/5f/t//L/8//2//3/AwALAA4AEQAZABsAHgAiACEAJgArAC8AMAAyADYANgA6AEAAQQA8ADkANwA3ADkAMwAtACsAGwAIAPX/6P/k/9r/1f/P/8P/vf+0/63/rv+z/7T/tf+z/63/qf+r/7D/sP+x/7j/wf/G/8f/zf/U/93/6//7/wYADQAWACAALAA2ADgAQgBOAE8AVQBZAF4AZQBjAFgASQBFAEgASwBLAEgARgBIAEUAQQBAADsAOAA+AD4ANAAwACkAJAAjABoAEwANAAQA/v/6//L/6//u/+3/5P/c/9H/zf/L/8v/0P/N/9H/0P/O/9X/zv/O/9P/1f/W/9D/zv/R/9j/3f/k/+r/6//t/+3/6//u//L/9f/2//n//f8EAA8AFwAeACAAJQAlACYALwAwACoAIgAhACQAIwAhAB8AJwAmACcAJwAgACcALwAyADMANgA6ADgAMQAkACEAJgAmACcALQA0ADcANQAvACUAKQAuAC4AKgAlACMAIAAeABoADgAJAAgACwAQABAAFgAWABYAGAAWABYAEgATABUAGQAZABgAGgAkACoAHwAeABsAHQAmACYAJgApADEAMgAwACoAJQAnACgAJAAoACkAIgAmACsAKwA1ADkAQABKAE4AUQBUAFYAVQBZAF4AYgBfAFwAUQBFADoAMQAmAB4AHAAWABEADQALAAkACAAKABEAEAANAAoA///0/+//5f/g/+P/4f/i/+H/3f/e/+X/5f/e/9z/2P/X/9f/zf/I/87/0f/S/9n/2f/S/87/xv+8/67/qv+l/5//n/+e/6P/p/+r/7D/tv+5/7r/uv/E/9D/2v/p//P/AQACAPb/+f/2//n/9P/s/+D/1P/H/7//xv+9/8H/oP+u/7f/tv+2/6D/of+u/6T/p/+T/5T/jv+O/43/g/+N/47/kv+e/5v/o/+t/67/rP+s/7r/tP+8/83/0//j/+//8P8BAAgAEQAJABEAIwAjAB0AGAAUABsAJAAZABEAFAAXABoAHAAbABEAFAASABIAEQANAAoACwARABcAFQAXACIAIgAlACIAHgAhACMAIgAcACQAKAAmACkAJQAlACMAHAAUAA8ABQD8/+n/5f/k/+D/5P/h/9X/2v/k/+f/5v/l/+T/8f/0/+z/5v/j/+H/3//c/9f/2f/j/+b/6f/s//n/AQAGAA8AEQAgACcALQA4ADsANQApACYAJgAlACQAHgAdACUAJgAmACoAKQApAB4AFgAUABQAFAASABAAEAARABAACgAIAAsACAAMAAcAAwABAAAACAAKAAoABQADAAoADQALAA8AEgASABAAFgAdACEAHgAhAB4AJAAjACcAMAAuADAAOQA6AD4APgBDAEUARwBOAFAAVQBkAG4AfgCEAIkAjgCOAI4AhQCGAH4AdwBxAGYAXABXAEMAPAA0ACwAJgAjABwADgAFAAMA/v/o//H/5f/e/+f/1f/O/9H/zf/O/8H/wf+4/7X/qf+n/5f/kf96/2//Y/9h/2n/ZP9w/3r/cP98/37/kv+V/6H/qP+6/8v/zf/P/9T/2P/k/+L/7P/w/+z///8HAAsADAAOABwAJAAlADAAKQBDADMAZwBGADAAXgAuAEsALAAvADoAKwBEACoAMwAyACkAMgAWABoAHgAFABUAAADy/wUA+v/5/+P/8P/m/9v/9v/c/+j/8f/9/wIAEgAaAAwAIgAmADcANQBBAEEATgBhAE0AVwBjAFgAWgBGAEUAQQBCADoANQAxACMAJgAhAAgACADt/9z/zP+7/63/n/+Y/5r/kf+K/3b/df9k/0f/Sf82/z3/Qv8w/y7/K/8j/xv/Jf8p/y//Lf80/0P/Sv9a/1T/ZP9r/3T/bv9u/4H/ev+B/4L/hP+P/4v/i/+O/4n/mv+p/7H/xf/Q/93/2v/k/+7/8f8BAAUAFAAXABEAGwAaABgAHQAUABkAJAAqAC0AMgA3ADIAMgAyADAAMgAwACkALgA0ADQANwBAAE4ASQBCAEIAOwA2ADUAOQBCAEoAWQBiAGsAbgByAH0AgQCKAIkAhwCLAIsAjACGAIEAggB9AHgAeAB4AGwAZQBcAF0AZQBsAG8AcQBzAGoAYgBdAF0AawBtAGIAZABeAFoAUgBKAEAAOgA4ADMANAAsADEAMQAiACIAIQAbABkAGQAdABMAFwAWABYAEAARAA8ABQABAAgACwAOABMACwAFAAEABQD9////BAAGAAgACAAMAA0AEQAUABQAFAAVABMAGQAiACAAHwAmACUAHQAPAAsACgAIAAwACAAFAAkACgAJAAoADQAKAAwAEgAcACQAIgAmACcALAAuACUAIwAjACMAGgAbACAAJQAnACoALwA4AEEAQABFAEgARwBBADgANQA3AEQARgBJAEsARABBADwAPwBAAD4AMAAoACgAJQAsACoAJAAnACAAGgAUAAkAAwD6//P/7P/g/9f/0//Q/87/y//K/8j/wv+//7f/uf+4/7P/tf+0/7P/uf/A/8z/1v/e/+f/6v/l/9v/1f/S/8r/vP+v/6X/l/+I/3z/dP9r/2//cv9u/2n/Yv9n/27/bv9y/3n/fP93/3X/bv9h/1//XP9V/1H/VP9f/2X/Y/9g/1n/U/9J/0H/Qv9M/1X/VP9Y/2L/a/92/3f/gf+P/5r/rf+2/8L/y//Y/+P/6v/3/wAACwAaACYAMAA4AD8ARwBJAEwATwBLAEsAUQBYAF8AaQBwAHQAfQCFAI8AlQCcAJ4ApQCrAK4AtACyAKwApQCaAI4AgwB4AHQAbQBlAFcATwBKAD8AOAApACIAGgALAP7/8P/j/9n/z//L/8n/xf/E/8D/uf+2/7P/tP+w/6f/of+d/57/pv+p/6T/oP+c/5v/nf+l/6r/sv/C/87/2f/f/+H/4v/h/+T/6f/t//X/BAAOABMAGAAfACgANABAAEkATwBWAFQAVQBOAEkARwA2ADEAKQAfABcAEwAJAPv/8f/s/+z/6//t/+z/8f/1//n//v8GABEAGgAiACsAMwA9AEoASgBMAE8AUQBRAFAAUABSAFYAUQBNAE4AUABTAFUAUQBLAEQAPQA4ADMAKQAeABIADQAMAAoABgD///f/8f/m/9r/0P/J/8X/w//D/8L/vv+9/73/t/+w/6b/of+n/7D/t/++/8b/zv/U/9r/3v/e/+D/3v/d/93/2//d/+L/4v/j/+L/3//Z/9X/0v/U/9j/1f/U/9P/0v/V/9b/1//X/9z/4//p/+n/6P/q/+//9f/7/wIABwANABQAHwAjAB8AFQAQABQAGwAgACMAJwAuAC4ALAAoACcAJwAsADMANwA3ADAALAApACMAHgAcABYAEAAQABUAHQAfACEAJgAoACgAJwAmACQAKAApACgAJgAkAB8AGwAbABoAGQAQAAwADQANAA8AEQARABIAFAASABEAFwAfACUAIwAjACUAJQAmACQAJwApACoAKwAtADUAOgA+AD8ARgBNAFAASwBFAEMAPgA4ADEAMAAtACcAHAAXABYAFQATABAADwAMAAoACgANAA0ADwAHAAIA/f/7//v/9v/z/+//7//u/+z/6f/x//r/AAD///j/9f/5//3//f8AAAYACAAIAAYABQAEAP///v/+//7/+f/w/+n/5v/k/93/2f/V/9L/0v/R/9P/0P/O/83/y//N/8v/y//L/9H/1//Z/9n/2P/a/9v/3v/b/9v/3v/g/+f/9P8AAAsAGAAjACoALQAqACgAJQAiAB8AIwAjACEAKAAxADYAPwBCAEQARgBLAE8AVQBeAGYAaABmAF4AVABIAD0AMQAnACQAHQAQAAEA9f/v/+b/1f/E/7//wf/F/8X/wv/D/8f/y//Q/9D/1P/b/93/3f/Z/9n/1f/R/9H/0f/N/8r/vv+4/7H/rP+k/53/nv+d/6L/pf+p/6z/q/+u/7H/sv+4/7//w//I/83/3P/p//D/+v/+/wIABQAEAAAA+f/2//X/8f/y//X/8f/u/+7/8P/u//H/9//4//n/9v/3//b/+P///wMA/v/3/+3/4//f/93/3//i/+P/4v/l/+f/6P/p/+f/5v/k/+H/3f/e/+D/6P/u//P/+v///wIAAwAHAAkACwAHAAUABgABAPz/+f/2//n/+//8/wMACgAUAB4AIwAkACYAKQApACYAIAAgAB4AHwAdABgADgAHAP///P/8//f/8f/w//D/8v/2/wIAEgAZAB0AIQAsADMAOAA0ADIAKgAfABMABAD+//b/7//k/9r/0f/I/8T/xP/H/83/zv/O/9H/2f/f/+L/6P/s//L/9P/z//T/8//t/+f/4//f/+D/4P/m//H//f8EAAwAEwAaACAAJQAwADsARwBUAFwAZABmAGQAZQBnAGMAXQBbAFsAWQBTAE8ASgBIAEIAQQBBAEIAQwBDAEQAQgBCAEMAQAA5AC8AKgApACgAJgAhAB0AGwAaABoAGAAXABYAGQAYABEADQAGAAQABgAJAAsAEwAeACMAIgAiACcAJwAkAB4AGgAXABMADAAEAP7/+//2/+//6f/i/9v/3P/f/97/3//f/+L/5P/o/+3/8v/w/+n/5P/k/+T/4f/g/+T/4f/d/9j/2v/e/+X/7P/1//z/BwAVACIALwA5AEUAUwBgAGkAbwBzAHgAeAB3AHcAegB8AHoAcQBpAGMAWgBVAEwARABAADwAOAAzAC0AJgAcABEADgAOAAgACAAIAAAA9P/q/+H/1v/R/8n/wP+8/7X/sP+u/6//t/++/8L/wP/A/8D/v//F/8b/yP/J/8j/wf+3/7L/s/+0/7L/sP+p/6H/oP+e/5L/iP9+/3n/cv9y/3b/eP+A/4v/mP+i/6b/rf+1/73/wf/A/7f/o/+V/5D/lP+h/6j/o/+k/6P/nP+e/6b/vP/T/9//3f/b/+P/6v/y/wAAEgAkAC0AMwA1ADAAMAAtACEAFQATABAABgD3/+j/0f/B/7P/qv+w/7X/tP+r/6H/n/+o/7v/yv/M/8n/wv/D/9H/2P/W/9j/2//f/+T/6//z//H/8f/u/+f/6//2//v/9/8BABcAJwAzADoAPAA8AEUASwBHAEcAUABVAFAARwBHAEUAQQA+ADoANwA5AEEARgBNAFQAUgBLAFAAWgBfAGgAbwBrAGcAYABaAE4ASwBSAFMAUwBRAE0ATwBUAFIATwBPAEoARwBPAEMANwAuACkAMAA3ADsANwA5AD4AQQA7ADIALgApACMAHQALAAcACwAMABQAGQARAAUACAAMAAwADQAJAAsAEAACAPz//P/2//H/9//5//j//P//////+P/v/+z/7P/p/+n/7P/f/83/1//b/9b/2f/d/9z/4v/x//X/9/8CABAAFgAaACEAHwAMAAoAHQAgACAAHgAFAOf/5//w/+T/1f/b/9r/1f/Z/9z/1//R/87/1P/P/8r/wv/D/8f/y//S/9H/zv/L/8z/yf/P/9T/1v/Z/9r/2P/Y/9b/zf/G/8z/2f/n//P/+v/9/wsAEwAUACMALgAyAC4AMQA7AD4APgBGAEgARgA/ADIAJgAhACcAKwAlACIAFwAUAB8AKAAyAC4AKAAjAB0AHwAgABwAFAALAP///v/9//b/6f/j/+z/9f/3//D/6P/n/+X/4f/f/9v/2P/X/9T/0v/Y/+b/5P/f/+f/7v/z//n//P/9//v/+v/+/wgACwAPAAwABAAEAAUABgAJAA4ADQAMAAoABAAAAAQACQAOABYAGwAcAB0AIAAhACQAIgAZAA4ABQD8//v/+f/3//7////4//n//f8EAAoAEQAXABkAHwAjACkAMAAxACMAFwAQAA0ADgAUAB8ALwAuAC0AKwAoACQAIgAiACwAMgArABkADgAPAAYAAwAIAA0AEAAUABkAHwApACYAHQAZAA4ABwD+//j//f8HAAwABAD4//H/8P/t/+D/1P/U/9T/1v/X/97/4P/a/9//6P/m/+H/3P/j//L/9v/0//D/5//o/+z/7v/t/+j/6//m/+L/8P/0//P/9f/t/+3/9f/6//r/9f/z//D/6v/b/8j/yP/C/7D/oP+W/5X/jf+I/4z/l/+S/4T/if+d/6n/rv+v/7r/xv+4/6v/tv/C/83/zf/C/7z/vv/D/73/xP/P/87/w/+//8L/yP/L/9X/3//X/9X/0P/T/+D/7f/x/+j/4f/f/+H/4v/j/+P/4v/e/9r/2v/d/97/2//Y/9T/1v/Y/9H/z//M/8//zv/E/8D/vv/B/7//vv/E/8j/yf/O/9n/4f/l//L//P///wUACgASAB0ALAA9AEIARQBGAEAAQgBFAFEAUgBLAFMAWQBYAFgAXgBpAGUAXQBbAF8AWwBaAFkAVABUAFUAVgBOAEEANAAzADYAOAA2ACwAIQAWABQADwAJAAAA+P/2//L/7P/l/+P/4f/j/+T/3//m/+D/0v/K/8L/xP/B/7z/vP/C/8D/sv+p/6j/qP+w/7T/t/+//8D/zv/a/+T/9P/2//X/+v8CAAgADQAhACYAHwAoAC8APABCAEEAQwBKAFEAUwBbAGQAeACWAJAAiwCiAK0AsACxALwA0QDRAMsA1QDhAN8A1ADeAOUA4gDdAMoAwQDDALkArgCpAKUApACTAH8AhQCFAGsAWQBiAGEAUQBCADYANAAtABEABQAHAP//BQAFAAIADwASAAIAAgAKABEAEgATAB8ALQAvACMAIAAdABgAHgAbABsAKgArACIAGgAZABUAEQAMAAoABAD5/+//7f/u/+X/2v/O/8H/s/+p/6f/p/+n/6n/sf+t/6D/nP+Y/5r/p/+r/6//v//I/87/zf/N/9X/3//f/9b/0//P/8v/z//T/9b/2f/Y/9n/3P/Z/93/4P/c/9v/3f/c/+L/5P/k/+P/3//c/+D/4f/g/+b/8v/2//n/+f/5//X/7P/n/+b/3f/Z/9z/2f/a/97/3//c/9X/zf/C/7T/p/+Y/5n/nf+Z/4v/f/99/3n/bf9o/2X/Zv9o/2z/bv9u/27/cP90/3T/eP91/3f/gP+G/4n/jP+O/47/lP+b/6T/pv+h/53/nv+e/6X/q/+s/7P/u//C/83/1f/U/9f/4//p//H/+P8BAAgABwAFAAgACQAKAAsACQAIAAEA8v/s/+f/4v/b/9X/0f/Q/9L/1P/U/9f/3P/b/9T/z//L/9H/2//b/9z/2//d/9z/4//l/+n/8P/t/+f/4f/W/9T/zv/G/8X/w/+8/7n/uP+3/7D/rf+t/6z/qP+i/6T/p/+r/7v/yv/N/8//0//R/9j/3v/k/+3/9f/7//z/AgAPAB0AJQAsADAALAAwADAALQApACkAKgAvADIAMQA0AD8ASABUAGQAbQB2AH0AggCQAJ4AogCxAMAAxgDMANEA2gDkAOoA8gD4APoA+QD3APMA9ADyAOoA6ADnAOIA4ADgAN0A3ADXANAAzQDLAMQAwQDCAL8AuACsAJ8AkwCKAIkAhgCDAIEAegBxAG4AagBjAFgAUQBDADUALgAmACMAHwAbABcAEgANAPr/5//f/+D/3v/X/9H/zv/K/8r/0f/R/8v/v//A/7j/sv+4/73/zf/V/9v/4f/m//L/+v/+/wkAGAAhACMALAA2ADQALgAsACwALgAtAC0ALwA1ADoAOwA5ADoAPQA+ADwAPAA9AD8APQA2ADUAMwA6AEEARgBOAFEAVQBgAGIAXwBgAGMAZgBgAFcATQBDAEEANgApACAAGwAWABAAAQDv/+3/7f/l/93/1P/J/77/sv+j/5r/kv+I/4T/f/+C/4f/iP+N/47/jf+H/3//gP+C/33/e/96/3//hP+K/47/i/+I/4X/hP+D/3v/cP9v/2j/Yf9h/17/Vv9S/1H/T/9W/13/Yv9m/2z/d/+D/5P/oP+r/7D/s/+2/7r/wf/H/83/1P/X/9j/0v/M/83/0//Y/9X/1f/Y/9f/2f/Y/9P/0v/b/+P/4P/h/+L/2//U/87/wv+3/7f/vv/E/8X/w//A/8H/yv/N/87/3P/m//P/+f/+/wsAFAAVABgAHAAYABMAEwARAA4ABwD6//H/7P/p/+f/4//b/87/vP+v/6j/p/+n/6j/qP+r/7H/uP/D/8r/zP/N/8z/x//B/7r/tf+1/7P/rP+o/6r/sv+9/8X/yP/Q/9//6P/y//3/BgAMAAsACQAJAAsADgAWAB8AKAAyAD8ASQBQAFYAWgBiAGUAZwBlAGUAZABcAFYAVQBTAEsAQQA4AC8AJwAiABsACwD///r/9P/x/+z/5P/g/+T/6//l/9//4P/k/+D/2//a/+D/6v/2//n/9v/9/wQAEQAZACIAMQA6ADsAPAA9AD4AQgBFAEYARgBJAFAAVABPAEgASABNAE8ASgA/ADkAPgBGAE0ATwBOAEsAQwBCAEUATgBRAE8ASgBAADUAKwAuADgAPwBIAE4AUQBZAGAAbAB0AHwAggCDAIIAgQCEAIwAlQCXAJMAiwCHAIEAfAB6AHkAfAB9AHcAdAB1AHEAaABfAFsAVgBRAE0AQAA2ADUALwAfABcAGgAZAA8ABwAFAAIAAwAFAAoADgAYAB8AGgAcACUAJgApADAANwA3ADgAOgA7AD0ANgAwACoAJQAgABQACgABAPf/7P/e/9L/y//L/8v/y//N/8v/yv/K/8n/x//F/73/vP+7/7X/sv+5/7//vf+4/7H/r/+w/7P/t/+0/7X/tv/A/9H/1P/V/9j/2//b/9f/1v/e/+P/5//l/+X/5//h/9b/0v/b/+L/5//0/wAAAwAAAAIABQANABMADQAQABEAFwAaAB0AIAAaAA8ABAAAAPj/8P/m/97/1v/L/8H/uv+4/7n/uv+2/7f/tP+v/7H/tP+z/7H/tP+3/7X/sv+v/6//rv+r/6//sP+w/63/p/+l/6j/qP+o/6//rP+k/53/of+m/6j/qf+n/6T/pf+m/6T/o/+d/5X/h/9+/37/ef93/3v/gP+F/43/l/+f/67/v//E/83/3f/s//j/AgAFAAQACwAQABMAGAAaABwAIQAiAB4AHwAgACIAKAAwADgAPQBDAFAAXQBkAGgAZABlAGoAcQB9AIUAiwCGAHwAdABzAG0AZQBkAFcASgBCADIAJAAZABEAEQAPAAwABAAEAAsAEwAaABgADwAKAAwACgARABMABwAIAAwADwANAAIA9//3//z/AgADAAAA+//5/wEACAAPAAkA+f/z//z/BQAAAPz/+v/y/+7/8v/u/+f/3v/d/93/1//R/8n/zv/Q/8z/w/+y/7D/t//B/7//t/+u/6f/kv+S/5X/nP+y/7z/yP/Y//H/9v/6/wIABAAXACIAMgAkABgAKQBOAFUASQAqAB4AIQAgACwAKgArACYAIQAZAAMA2v/K//v/NwBDACMAGwAcAEUAYgB1AMMAywCGAEIASAB/AKQAhAByAJwAkABkAFUAXgBOADoAMQBPAIgAYAAyABwA5P/T/83/2f8GABIA7P/a/+n/9P/n////GgADANH/kv+c/8j/4f/h/9r/1/+j/4b/nf/c//n/EgAPAAMAEQAiACwAKQAcABgA+f/8/zQASgAeAAAAFQA6AFYAXQBKACwADADk/+H/CQAvAEkAXwB8AI8AhABdAD4AQgBdAHoAhQBrAF4ATAAQAAgALgA8ACEADwD4/wQAGQASABUAQQBFACcA6P/5/0QAVgAJAKP/qv/f/+T/0//2/8z/bv+N/wMANAAsAOb/Yv9s/xIAWgAXANj/1P/y/w0AKgA6AP3/xf/U/yEAVwBMAAMAr/+Y/9j/EAD6/+b/7P/t/+3/CwAYAO3/tf+5/wUAOAD9/8v/tv/E/9//8v/g/8//5P8FAAsAJwAEAOj/BADW/6X/IgC1AIQARAAHAJ7/iv/B/yoAyADKANX/cf/R/wcArv8wAFcAgv9c/8H/6v/X/3j/fP+g/6b/yv94/0D/Vf9a/4b/yP/D/8b/m/9c/zv/ff/l/9j/1/+b/2j/q/+3/9P/2//Q/7b/af+r/7r/gf+U/73/nv+q/8r/0v/O/+H/tP9k/4z/sv8DACwA+f/Y/+3/DAAFAP7/BADT/8j/HABGAE8ALwA3AFYAaABCAB0AZABvAEQANQAUAGQApQCDAEcAUAB1AHsAjQCVAI8AfwBsAHQApQDSALUAdABvAKkAiwBMAFMAYwBiAF4AOgA/ADMALgAKAAkAAQD8/+3/zf+f/8D/5f/O/9T/tv+C/4b/q//O/7v/bP9S/4//lf+I/3T/ev+n/6f/j/+p/7b/pP+a/6v/0f/2//H/3P/b//r/4v/R/wgADQDw/+f/7v/3/ycAKQAQAPr/MQBIACgAFQA8ACsACQDp/ykA+/8YAEcALgDm//f/NgBLAHgAhgArAAYAGABgAM4AgwBSACQAOABZAJYAyACNAGIAUwBJAGoAlwB2AD4AVACNAIEATAAVABkAJAAUABEALAAwABEA+P///wQADQD+//H/AQDR/7b/2P8DANz/tf/x//P/s/+k/8z/4f/s/+X/1v/N/6//r/+i/5//qv+P/5P/nv+W/4r/hP+p/6j/qv/G/9z/0/+X/8v/BwDw/wcACQDo/wMAOgBPABkAJQAdABkALgBAAGUAUAAHAPf/CQD8/xkARAAFALT/1/8CABUA9v/q//X/AwDe/+X/GgAeAP//5f/P/wEAFQD0//v//v/Y//b/IADt/9r/9f/I/63/zv/y/+z/rP+s/+v/0f/J/+H/2P/G/8H/uv/d//P/xP+e/5D/0f/w/9//2//A/+P/8//2/+P/zv8IABcA+f///+D/4v/0/+P/5P/1//b/1v/o/xgALQA5ABUA9v8YAA8AFAAQACoARwARAOb/CQBSADUA/P/E/+n/IAACAGEAj/+H/xoAWP+Y/3wAIwAoAMv/V/45/jMAWgBx/0ECwgDh/1YAhf/P/nIA7//o/YMBEgFiAc4Bqv8g//L/pf8AACACQQEuARQBGACGAF4APAB7//4AbwFgAXAB6AD1/4v/MQBL/24AHgH9AEEAkQC0/zr/rv+B/ysAxgDxANv/zv+s/yj/OP88/2H/FwCiAP3/t/+w/6P+sf6f/+v/eADgAOz/vP/S/z7/kf/6//3/jQDCAF8AagAbAHz/fP/I/0EAsQCFAFYA1v+3/wMAo/8kAJUAZABlAFwAPgDX/7r/pf/M/6IA5wBtACkAg//F/+//4v8XAEIAQgAzACEABQCX/1L/aP+b/zsAYwAoAM7/Wf9F/2T/yv/Y/xgAGQDD/9f/x//J/7P/qP/y/93/DgBWAAgA1v+e/5v/6P9GAGgAPgAgAOH/uP/B/8P/zv/q//7/+v/r/+b/0v96/4v/jP/B//3/FgAoAPj/z/+d/7X/1//0/ysAJQDz/+H/6P/0//7/6f8FAB0AFgBBAFoAFADY//L/RABsAHkAaQBIAEAAXwB3AIMAbgBeAGMAegCjAIYAWgBBADoAVABbAHYAWAAsAA8AAAABABoAKwAWAAoA3f/r/wwAAADl/9j/1v+5/8b/4f/m/8v/wf+y/6j/yf/l//j/8v+2/6//1v/v/9n/3v/9/wUA6//i//D/7f/j/9f/7P8LABEACgDp/+T/2//f/8L/0P/x/+f///8KAPX/+v/3/9L/yv/z/wMA3f/X/8//tP/f//T/6P/4//X/2//2////AgAXACYAGQAHABsAIgAZADoAOAA6ADYAMgBfAFcASgAhAAoAIwAlACQABgDz/wIA/P/e/93/7P/o/97/1P/M/7n/0f/i/8L/rP+4/+n/4v/S/8z/2v/v/7v/tv/l//b/6P/T/9z/1P/U/83/0P/l/9X/uv/J/9T/2//a/9b/1//K/+L/AgD6//r/DQACAPf/+/8hABoABQD+/xQAGwAXACEAHgAfAB4AEgAWACIAIwAaABAAEgAiAAwABwAPAP7/9P/q/+b/7v/j/87/x//c/+D/z/+l/6n/w//H/7X/q/+2/7r/o/+c/6L/rP+1/67/tv++/7L/tf/G/8b/0//T/83/5P8EAPn/8f8FAAAAFAA8ACIACgA3AEAANwBaAGMAZAB/AJIAmgClAKEAkQCWAKsAtQCgAJYAgAB5AIsAlQCbAKYAqQCXAIAAfQCxAKkAggBfAFUAgACGAIYAagBQAD4APwAzAEoAbAAnADAAKQDh/woAFAAGABYAzf+2/+b/8v/4/wMA6v/J/9j//f87ACIA4v/Y/+f/6//9/wIA5v/u/83/tP/R/+D/z//C/6//sf/O/83/2//c/9P/sf+b/8P/1//M/8v/r/+T/57/pv+6/8H/uP/A/7b/u//T/9H/xv/A/87/3f/q/9j/xf/L/8v/1P/o/+n/+f8DAP3/8v/n//L//f/g/9j/DQAnAAkA//8DAAMAAgABAPr/+f/u/wUA8//p/+X/2P/o/+X/yv/W/83/s/+t/6b/if+U/53/l/+J/3r/jv+W/5n/n/+O/4//nP+u/7r/1P/H/7j/wv+3/8//4f/k/+X/AwAeABUAGAAfACMAJgAuADUAMQAuADkAQgBKAEoASgBIADoASgBOAD0AOABQAEsANAA2AC0AIAAjADYAMgAqAB0AOQA8AB8AKwAsADwASgA5ADcAUQBoAFkAWwBaAFIAcAB5AHIAdwB6AIYAhAB4AIgAqACiAIIAeABwAHgAbQBYAFgAaQB6AHQAbwBkAFMAcgBpAFAAWwBaAFMATwBeAGQAYwA9ADcANgA2AD4AHQAiACsAFAAgACwAKAAVAPz/0f/O/9L/wf+x/6f/qv+e/5L/kf+n/6b/pP+Y/5n/p/+i/63/rv+e/7H/sP+y/8v/0v/e/+f/3P/e/+//6P/9/woA/f/3//v/CQALABAA/f/2/wAA9P/r/9//0//s/+7/2P/X/9f/0//b/93/1//Q/8D/xP/S/9P/z//K/77/xv/Z/9n/1P/M/8L/xv+9/7n/wv/K/8P/uP+9/7//vv+9/8H/1v/K/8v/zP/A/8v/xP+//73/2v/i/+X/5f/i/+z/8f/o/97/8P/5/+z/9f///xIAFQALAB8AKwAjAC0AOgA0AD8AVwBTAE4AVwA7AC8ANwAhAPv/9//9//v/7//Z/9f/xv+//7f/tP+2/7T/y//O/7v/zP/g/9z/y//b/+D/zv/X//L/CAADAPP/AgACAAwAEwANABwAIAApAE8ASwBHAEUAKwBCADIANwAwABYANQApACYAEwAjACkAEQAQAAwAJwAXAP3/9//1//n/8P/w/9n/tP+1/8//1f/R/9T/1P/R/9H/yf/N/9j/4//m/9z/4v8GAAwA8P/t/wAABwD///v/CQALAPD/8P/n/+f/8//3//X/4v/v/wcAAgD1//L/AAAPABQAGwAXABkAIwArACkAIgApADgAPAA0AEAAUwBGAEAASgBPAFgAWgBTAEkASgBGAEEAPwBEAEAAOQA4AEAASQBFAEQAQQBFAFIATQA7ACwAIgAwAD8ANgAdABgAKwAeAA8AGAAVAAEAAwAPACAAKgAoAD4ATgBSAFQARQA2ADwAXQBvAHgAegCAAHsAagBmAGsAegBwAE4ATABFADQAKAAVAAMA/f/3/9b/z//I/7f/qP+b/6r/v/+0/6X/ov+g/7P/vf+y/7z/wv+u/7L/wf/E/8T/u/+8/77/q/+g/5X/nP+p/77/xv+6/6v/qv+y/6//uf/O/9z/0P/I/9H/4f/b/+T/9f/r/+b/5v/2/wIABQAHAAIA/f/3//j/8v/k/+L/5v/k/97/5P/g/9r/0//P/9X/zf/M/8b/xv+l/5r/pv+h/5z/nP+f/5X/nf+w/7b/uf+6/7z/yv/b/+z/7//u//D/7//n/+T/6P/p/+X/2v/h//3/7//W/9T/2f/R/9L/6v/0/+3/5P/v/+z/5//g/9j/1P/T/9D/2f/Z/8b/uf+7/8H/vv+4/7n/wf/H/7r/uf+5/6b/qf+r/7L/sv+u/6//rP+t/6n/tv/K/8v/vv+//8j/zf/l/wgAEAAeABwAJQA2AEEATABSAEYAPgBMAF0AXwBcAFcAUwBMAF4AcQBoAGMAaQB0AGwAZgBhAE0ATQBYAHAAewB9AHsAagB0AGgAYABrAGIAZgBiAGAAVABAAEIANwAmACgAMAAxACMAGwAlACEALwA4AC8ANAAsADEANwA0AEMAUwBWAFgAWABeAGUAWABcAFkAWgBjAGAAVwBBADsANgAkABsAFQAxADQAHgAdABMAGQAoADAAPABHAE4ARABQAFwAXQBmAGAAWABNAEcATABNAEIAOgBAAFEAUQBOAEoAOAA2ADsANgA4AD0ANgBKAEwAOwA7ADQALgAfACYAJwAUAP7///8FAPP/8v/m/9P/w/+4/8L/zf+//67/nP+h/43/l/+U/4b/cP9c/37/c/9u/3L/fP+D/3L/kP9+/2r/i/+U/67/zf/W/7//zP/e/9b////z/+r/9//z//X/DgAPAPb/+f/m//7/FAABABcAEQAMACEANwAmACIANwA9AEoAWwBbAE0ALgAfACEAOwAmADEAMQANAAoA9v/8//7/8v/j/9j/1//v/xUADQDa/7v/q//E/9P/vv+o/4H/bP9+/5b/jf+U/3D/af/a/6v/af+n/3b/Wf+E/6D/qP+y/5r/jv+1/7n/xP/X/6j/vP/O/9n/6//W/8P/DQDU/6L/BwACAOj/9P8CAOH/2v/c/+P/7v/l/w8A///y/9L/3v/v/+H/9f/r//r/5P/O/+P/3f/l//j/8v/E/7X/1//z/wgA9/8BAN7/5f/y/wYAEwAMACYAHgAYACAAKAA9AC8AMABEAFMAaABtAHYAdQBwAIIAggB4AHUAgQCQAJIAmgCMAIQAgwCQAJQAdABsAFwAWQBSAEEAMwAMAAcAAAAEAOr/uP+m/5n/rP+m/6f/jv96/3H/if+a/4f/cv9d/2z/df9y/4v/cv9a/2L/bf+P/3n/hv+L/4v/j/+j/67/sf+4/6v/wP/M/8r/tv+8/83/yP/Y/9P/w/+s/6z/0f/5/xsAHAAMAPX/7P8OADIATQBFADAAHAApAFsAbwBkAEMAIAA+AGUAlACQAFsAQwA5AGgAkACRAHQAaABuAJsAqwCxAKwAewBxAIgAnAClAJgAiwCDAJMAmgCzAJ0AfQCCAJMAqgC6AKkAngCRAJgAnACbAKIAiwB6AHYAfQBoAHMAdABQAEQAMgBZACoAAwDp/9r/4f/N/9z/1f/B/6L/m/+Q/4j/fv+L/7H/s/+V/4z/iv+I/5P/qv/G/7H/pv+U/6n/vP/x/w8A8P+//7r/3v/p//n/FAAIAN//4f8VADwAGAAOAAwAKwA9AFgAXgAzABwAKABKAFYAWQBUAEYAXwB2AIMAegBQAEQAXQBwAHAAZABLADMAOABnAG0AUgAlABwAHwAdADYAPgAsAPz//P8LADYAOAATABsABQArAD8AKgAjAOb/5v///wQAIADw/9j/1v/l/+v/w//I/7r/qP+v/87/0/+0/5b/i/+o/67/jf+X/43/mv+k/8X/7v/h/7r/uf/W/9H/1f+1/6L/kf+U/6D/nf9y/2r/eP/L//T/9//f/8P/3P8KADwALAAbAPn/5//0/wkAKgAYAPD/BgALAEgAWgBhAGUAQQBCAEIAaABuAG8AUwBSAFsAUABLADUAWwBeAEgATQA1ADkAIAAkAEkALgAIAOb/9v8OAAgA/f///9v/v//A/8j/3f+l/5z/sv+3/8H/lP9i/zb/M/9N/4H/k/9r/0v/D/8l/0v/YP9L/wz/EP8V/1L/av9v/1r/Pv9O/27/oP+s/7X/lP9r/2v/bf+V/5r/gv9x/1L/a/+K/5T/kf90/4P/kv+w/9L/sf+n/7T/0P/w/9n/+//9/+z/BgAdAEIAIwAhAC8AYgA+AFIAVQAgAEUATwCgAJwAggCOAJMAowCtALEAvADvANwA5ADRAPcA+gDRAPAA9wAFAd0AwADbAN8A0QDMAOYA3ADEAKcA3QDvAKMAnACgALIAkQB1AJYAcQBKAFsAhwByADMAEwAPAA4AIQBKAEIAKgAiABkAMAAoADgAOwA3ADIAJQAlACAAIwAqAC8AIQAiAA0A8f/N/7v/zP+n/57/jP9t/0P/KP8k/xr/G/8q/y//Jf8M//n+7P4D/xX/Kf8q/+f+wv7F/r/+1P7L/vf+8v6o/ov+dP6A/nf+nf6z/nn+SP4i/lH+V/5q/lj+OP5C/kz+kP6t/s/+y/60/tL+Fv89/yv/Yv90/zv/Ff9G/9T/AwAaACcA9/8VAD0AsQDPAOoA9gDpABUBbAG5AWgBNgH4AEIBogHVARkCwgGtAX8B4AFYAlgCTQJBAloCHQJzAvECIwPLAoUCxAKlAo0C3gIVA+gCnQKaAtkC2gKnArICjAKFApYClgK/AnMCOgI8AksCNgIJAt4BlwFXAS8BYwFXARwB+gC8ALIAmwCdAG8AQgA1ACoAMAASAAQAsv+J/4n/d/+C/13/OP8M/+L+2v7X/tb+4P7W/rT+jv5T/lH+Sf5L/jz+E/4B/sz9nP2R/XH9Sv0r/Qr9Bf3w/M38rfyN/GP8WPwr/BD86Pvz+y/8JPxM/FL8Kvzo+xL8ffyq/Iz8jPyU/I78Bv2X/YD9MP0E/UX9x/39/UT+9P0B/kX+j/4B/zT/P//k/tv+gf8wAJ4AzQCmAH8AZQDKAGABkgGVAWsBSwF1AdwBWgK3AmMCKAJpAowCvwIMAzEDggMOA0MD7wMTBCkEwgOiA9ID/gM3BHMEKwQxBHkESAR2BHoEwgTvBIIEkgSoBJUEnwSsBKAEZAT5A7wDoQN5A3kDSgMBA64CaAI4AukBqQFVATAB4gCdAHcAVAAKAKf/cv9Y/y//4/7D/oT+Lf7y/cr9zf2a/UX9/PzF/MP8sfyG/Dn8//vd++H7+vu7+677UPsF+/368/r7+sz6u/qB+n/6hPrF+oD6N/pI+mL60frd+s36U/oF+qX6W/vE+8H7U/vi+tv6cfuG/C79Yf02/ST9Bf2w/Nz8wP3j/uf+Lv4s/oD+I/8eAKwApQC+/87/iABlARYChwIFAoIBUAH6AQoD0gKeApIC7gLUA/ADuAOpAycDggP7A1cEoQQ5BGsEpgScBBoFbwWvBaUFjQXRBTYGSgaEBrEGoAaeBnMGXQZ8Bj0GQQb9BYYFiQVxBZUFSgWmBCsE9QPVAwYE0QN8A98CMAJNAmkCZALvAVkBvwBlADwANwA2AND/Wv/p/uD+0/61/m7+5/3g/df9Bf7Z/XX9ZP1G/Vb9LP37/Lj8Z/xS/Jb8oPxV/O77ivtY+3b7k/uK+0H73vrY+ur6+voL++X6vPqT+i76n/oA+wX7afvF+pz6ovpd+kn7i/t4+0b7UPss/Fz8v/sl+5H7v/xc/Wj9SP3l/Gj9Pv75/n7/aP9C/1H/XP+GADABaQFkAYgA7QBFARgCTAPYAmACQAJLAm4DCwQZBCgEqAP7A2YEuwQCBQIFQwWcBdEFNAaBBp8GGQcbBw4HBgeuBu8GcQeLB5gH/QaJBlIGKAaFBjgGxAVKBSEFOAXQBDYEsgNvAzwDHQPzAosC2gFSAQgB8AAXAbgAWQDi/zP/Hv/v/vj+5P6P/kX+6v2n/bD9m/2e/T79nfy4/H38dPwz/DD8Lvyi+077bvuD+1/7QfvK+mr6UvqO+qv6cfoM+vH5y/nW+f352Pm3+X/5Y/mI+dX5GfoH+tL5uvmr+ab53flu+rL6+Pom+2z7xfuJ+/L64fqU+7T86fz6/Nn8jfwY/e392P6Z/kf+vf5X/9f/XADvAO4AoQCaAH0BywH6AQcCkwIpAykDvwOdA6EDawPLA68EjgSdBO0ELAV6BecFnQY8B/4GPwc4B0UHSweaB3EIOAgJCLcHQwfWBn8GzAbmBpoGHAbeBawFhwV5BUwF1wT2A7ID0APGA30DEAOtAmACKQIEAtABMgGrAIMAfgBXAN3/W/8F/5r+wf7L/oj+DP60/XT9Xf1R/U/9av27/D78/vvh++P7ivtP+xP7yvqh+qj6o/qS+lb6LvoB+s75Cfox+k76Fvrj+c/57vn5+e/5P/p++nf6U/p2+qD6vfrm+o/7uvse+3T7PPyb/Br8wfvM/Lb8v/yd/dX9HP5V/cT9yP6g/mn/1f+9/0//+P5VAHcBYwEXAQMBKgFlAZEB3wLAAyYD+wL5AhUDtwNvBFsF+ATGA8YDlgSdBVAGjAaNBhkGXwaJB2wIOAiHBz4HTQfqB4MIzggACOAGoga4BgYH7AavBoIGvQV3BWEFWQX5BGgE+gO2A5oDPQMHA7kChwJtAjoC4QFvAesAyQDBAKgAVwALABkA8/9f//H+o/7V/gT/Jv/e/jf+t/1w/YT9tv2X/SD9qfwd/KH7qfv++xb8v/s9+xP7wfqL+tb6Bfvw+rD6ovqv+mr6MPpm+lr6Rfpx+oL6ffr6+fL5t/kZ+Rf6JvoX+l36avli+cv5Qvqw+hH7Nvus+qD6J/s8/Mj8rvyS/B78Jvzi/OD9yv6m/kP++v0M/pv/cgCeADoAdf/N/z0BRQICAgYCngHTAYMCOwPrA/8DZwOpA/wDmwT3BMcEnQTaBLgFkQaHB/EH2gexBl0GEAc1CFoJFgkECAQHYgbfBvEHLQhiB/sFGQUeBXEF4QWuBdUEuwMzAxcDMQPwAnwCVQI3Ak0CFQLdAUQB5wApAVABQQHRAJsAagDq/wMASgCeADUAiP/u/nv+x/6M/7D/0v7J/Tv9f/22/TD+zP2t/Mv7wPtW/Mn8T/yZ+wT7sPrn+jH7NvvH+lD6Jvpc+nH6Rvr9+dL55/k4+mz6v/kf+fv4XPmT+TT5Gvnh+Pv4AflL+Wv5ifmX+br5Fvr4+qr7IvsK++j6HPys/BH9eP3G/Lb8If20/kn/kP4g/pX+Mf+0/x8B0QAuAKr/2gAQAvMBGgIYAnwC3QIJBPoEqAScA4YDLgQmBbIF4AWuBqoGNwc2CEUI1wfjBgsIJgmRCYAJRgmvCLgH7QejCBYJJQh3B/cGbAZxBssGEwc+Bh0FegRIBPYDoQOyAz4DuAI3AmgCJwJgASsBWQFQAeIAqQBaAPX/pv/V/zsA9/+2/0X/D/8O/wv/If/H/oD+Ov4w/vL93f1z/V/9JP3J/Jn8Vfw8/Pf77/v9+/P7pPuD+2n7aPty+yf7/frP+v36LvsL+w37zvp1+iX6PvqG+nv6Ufom+iD6w/lv+XT5DvqG+sD6ZvpU+nn6iPrX+q/7Q/wt/BP81/sc/NL74/wP/lT+9P3d/JH9Av4f/9X/4/+i/zL/nv9AADgBhQHEAZUBagHJAZgCuQPSA1oDLwOzAzAEywTKBKAEMAQwBCMF3AX4BoQHYgdoBqAFqwZJCDcJ7ghHCD8H6gYeBz8I5gj0B8cG2AUhBnAGhgZcBrEF1gQ+BDoEEAS+AwoD3QLbArwC4gKpAvABGgEiAbIB9QF+AQoBjwANAAMAOADRAHAA6P9t/3H/u//F/5X/C/+0/pL+uv7U/nv+v/1P/R79CP0q/Qf9zvxI/NT73Pv1+x786vu2+0b77/rj+u76CPsS++762/q++oP6g/pJ+kr6X/pK+iL6dfkI+RP5RPmF+Sz5ovjW+Nb4IPmj+cP5LfqO+Y/59/oP+3n7O/u++2n8v/sb/G/8Gf1n/RD+Cf49/gT+hP63/2L/FwC8/zQARQA5ABUBUgFoAWcB6QHAAv4CdQK8AvACowMSBEgEkAQhBHgEjQXtBvAHqweBBgIGwwaYCL8JSwlxCIAHCAeDB8gIKgmvB9IFxwWHBgQHyQb+BRMF3gOrA3cErwRzA48CQAKIAr8CigJ9AqYBLwE/AdQBsAEfAdwA1ACmAIsAwgCVACgA8f9AAC8A7f95/6b/hv8K//b+af5d/vn9wf2+/VP9FP3P/LP8x/yT/Bz83fvZ+yD8D/y4+3n7UPtl+8P7rvuH+0v7EftY+1v7Sfv1+o76dfp1+pv6bfrt+ZP5jfnJ+f/5tfnr+d/5qfnp+Sn6sPrT+dv5x/oH/Hb8FvzB+2L7HfzK/K/+k/4w/pv9iP2H/nP/TwA5ANL/hP9mAMcAdwHuAfkBOgLIAfUBdAI2A4QDzQO3A9ADCQT5A4UEBAW4BT0GuQbMB/kHGweIBukG3gimCZAJEQlSCKMH5gc3CS8KjgnFB0sHRgduB98HCAi8B0gGJQUMBVQFvwRsBFcEGQSoA+sCIAOyAjECFAIuAlcCpwE6ASAB0QDGACYBXAEyAVgAFwAgABYAUwD5/+7/sP82/9P+Yv4e/gn+5f3B/Wb9zfwn/Aj8Ffwv/A/8h/sJ+5/6qPrh+uX6w/pY+vT5+/la+mL6P/r4+cv5f/l1+aj57Pm4+T35I/n6+Fz5a/lT+TD5//gs+UT5Ufmw+c75Z/n3+SL6efrQ+nP6L/s/+577uPyb/B79L/1v/bb93P3m/kEATgDf/3f/Rf+ZAGMBcwI/AokBBAEbAT0CTQPUA/MCUQIIAo0CigP9AzwEqQNYA30DFQTOBIQFDgYIB8YGGwbPBWQGQQifCH8INAi5BzIHYgc2CCgJVwgqB4wGegYLB/EGwQYrBjAFWQT3AxUEAwR2A6kCdAIaAukBpQFdAUcB/QDzAOwA6gCRAEYA0f9GAJ8AnwBgAPH/NQDs/+7/DQAKAPH/f/9M/yL/y/5l/iD+y/3Z/Yb9/vyK/AT89vvT+837ovsZ+1v6LfpM+qj6vvpx+jT6EPog+k36mfq1+oT6HPrz+Qf6TPpq+mT6OPrU+ab5yPkI+uf5y/lq+Vf5R/m8+TD6FPrY+Wn54fmA+gb7LPsx+xb7pvsI/PX8yP2W/bP9if0G/kX/gf+BANf/xP8qAKYAtgEyAvQB2AGdAdoBMgMWA5kDAwO3AisDZAM5BDsE7gOdA5kDDgTBBB8FawWhBUkG9AaqBrsGhwaJB0AIugiwCFsI6QerB1MIGQliCVQIWAfNBvYGUQd1Bz4HTQYaBV4EjwS2BGYEoAMHA68CLgIYAhEC0QFnAQAB2QD8ANEAYwA1ACUAaQB5AHMAOAAMAN7/+P8tACIA9/9k/1v/Lf9B/1T/BP9Z/tL9rP3v/Q7+j/0u/X78bvxL/Fv8fPw5/NX7X/s++3j7q/uk+3/7Pfsi+wr7EPtS+0/7N/sJ+wL7Ffs6+zn77vrZ+uj6Jvvw+rj6ivqW+rH6yfrt+tH6zvqC+pr69PqY+777jPsB+zj74vvd/Kr9Qv3u/Jf8vf1t/m3/5f+y/03/Sf8GAPMAwgHjAR8CYgFyAekBgQJgA00DUQPkAmECawJJAwUEjAQSBPYC3QLeAtwDnwTYBKQE7AMJBNgEigVXBr8GGAagBZ0FdQbKB60HeAfvBqoG6wYoB50HcgemBhEGSAZ/Bp4GtgUDBaAEfQSBBEME0QPKAhYC8gE3Ag4CswECAS4Asv+x/x0AUgApAIP/Cf/G/u7+Y//E/7X/L/+7/nL+o/7z/kT/PP+//lP+5f0R/gv+Bf69/Xv9Cv29/KX8fvxd/AX8A/y0+6T7R/vy+uP65foH++z64fqc+nP6Tvp7+rT6oPqE+j76ZvqE+r76vfq6+rX6pPrM+tf6/fry+vj66fr8+jb7SvtI+zf7Wvur+737tPvi+0D8l/z0/Oz8YP2c/bX92/00/jD/+/+x/wn/cv/t/xUBNwGiAVwBrgCuAIsBCQMXA1gCdQHBAScC2wIrAzQDqgLFAVICGgPVA5sDwQK0Aq4CMgOwAywE3QO3A6IDGQTUBMQEigVPBW4FiAWtBYUGvAbQBrIGvwZxBq4GmAbxBv8GUAZGBswFCwbhBYsFUwXTBEYErwOpAz8DFwM8AucBkwEtARQBjABjAP//pP9u/4P/hf9x/wn/vf4o/2n/eP8a//X+B//9/h3/R/94/yH/zP56/sv+/f7D/mT+8v3N/bz9wf2y/WT93/yL/Er8Zfw8/Pz7yfuQ+3D7YvtM+zf7HfsD+wz7APsF+/r6CPsf+037SPtS+3v7Wfua+5f7t/u2+4H7lPuf++37Bfzr+8f7qPvF+yX8UPxj/D38+ftS/KX8I/1b/VL9hv2E/ez9Wv6z/nz+rv4C/8//gQBhAI0AgQD8AJoB8gEmAksC7wFDAuECPgOuA+YC/wImA0QDtQO1A8UDbQNgA30DLAQCBNoDjgNuA/EDzAMBBPED7gPWAw0EJwRsBGcESQQpBe8EAAWUBH0EOgVVBbUFrgVjBeoE6QQfBfoFEAZ7BQMFaASRBLwE4ATkBDYEUAPUAs4C3gLQAh0CpwEcAZYApQBCAAwAkv8L/+3+uf6P/l/+EP76/Qr+/f0a/vr9yf3H/c/9Q/51/k3+EP74/Sr+Wf5t/mL+PP76/dr9/v0f/hz+uP15/VP9O/0e/fD8zPyg/Hb8S/w4/A/88/u/+6n7w/u9+6r7iPt1+3P7g/uW+7P7p/uM+6X7yfsD/AL8CvwY/Cv8Qfxk/HL8kPyA/Ir8uPy7/M78qPyt/M/87fwA/Rv9I/1A/WT9hf0J/jf+YP5I/nX+Bf91/+b/IgAfAAAAKgCxAIwB2gGsAbEBpAEMAjcCqwIfAxADiQJVAqQCMwNzAzkDMQPaAocCkALZAjcDKQPRAoUCewJ1AsIC8QIFA/oCkAKTAr0CDANRA2EDaQNjAzEDQAN6A7YD2QPAA+ED8APWA7EDxAMNBCcEHQTyA9QDjgNuA7YD9wPcA2UD6QK9AqYCzQLdAqwCHwJsAQwBDQEiAQgBkQDi/1T/CP///gD/zv54/vD9of2T/a79w/2T/Vj9If0z/TT9WP1Y/W/9g/16/Yf9kP3A/eP9CP4b/hH+4P3h/Qb+Lv5G/jn+Gv7t/bv9q/20/cD9o/1g/RD96fzo/PD8/fzb/Kj8avxW/Hr8s/zC/L78qfyn/LH83PwR/Tz9Q/0//UP9bP2X/cT9Af4i/ir+Jv42/m3+jP7G/un+A/8f/wv/JP9i/5f/tv/V/+L/7P/6/yoAYACPAJEAuwD8AAsBEQEVAVwBtQHIAQ8CFgIDAhQCGwJ7ArcCzALyAs4CtALtAt4CCgMiA+wC+QKqAqMC2wLaAvYC3wKMAmsCTwJNAocCeQKBAloCLwIWAhICMwJTAkgCHgIPAggCHAIxAjYCRAIsAv0B4AEAAgcC8wHRAbgBoQGgAa0BqwGjAYUBWQFKAVwBXAFHASgBBgH4APIA7gDxAO4A2QCmAJAAoACnAJ4AeQBfAFkAWwBeAGMAUgBGAC0AIAAgAAQA8P/c/7z/sf+Y/2z/UP8z/x7/FP8R/+3+uf6g/qH+mv6W/pj+ev5Q/jf+Qf5M/lb+TP4l/gr+A/4I/g3+DP4Y/hb+Cf75/QP+Gv4n/j3+Sv4y/hj+JP4+/l7+a/5h/k/+P/5C/lL+Vv54/n3+Xf5Q/lv+a/5w/nv+e/5o/lr+ZP51/oX+kv6H/oj+mf6h/p7+vv7b/tn+4f7l/uv+4v7u/g3/H/8y/yn/Iv8v/1D/Y/97/5n/oP+Z/5f/l/+G/67/2v/K/73/qP+Y/6r/zv/u//L/4P/W/9v/7v8dADwARAAyAB8AKQBFAFoAZgBpAGMAZgBvAJAAqwC2AMAAzgDeAOMA6wAEAQ4BCQEFAQkBDQEPAQ0BCQEWASABIgEjASsBLwE2ATgBPAFGAUMBPwFCAU8BVAFTAUcBPQEwASEBKAEvASEBDwH7AOcA4wDfAN8A1wDIAMMAtwCsAK4AtQC3ALsAvADBAMAAxgDLAMQAvwC5ALcAsQCwAKoAoACTAIIAbgBiAFsATABDADQAKwAsACIAIQAhABkAEwAPAAoAEwAMAAQA/v/s/+T/4f/X/8j/uv+v/57/mv+j/57/lv+X/4f/fv+I/5z/p/+v/6X/kP+O/6T/tP+5/8H/tv+0/8j/2//z/wYADAAKAAMACAATABUADgAEAPL/7P/m/+L/3f/b/9b/0P/S/83/0f/I/7n/sf+j/5f/lv+R/4v/hf+F/4n/hf+C/3n/cP93/37/h/+J/4T/if+G/5H/lP+W/5j/mf+j/7D/vP/B/8P/tP+w/7j/yf/K/8r/yf/F/9P/4f/5//X/8//y/+j/3//c/9v/4//s/+H/3f/Y/9r/0//K/8f/v/+0/7L/uv/H/9j/4//l/+T/6v/0/wcAGAAgACgAOQBKAFcAYwBnAG0AcQBrAHEAcwByAHkAcwBrAHgAiACZAKgAsQC1AL4AzQDLAMQAuQCmAJ4AngCZAI8AfgBzAHUAcwBuAGUAXABaAF8AXABeAF4AXABVAEoAQwBAAEYAOwA3ADoANgAzAC8AIgARAAwAAwD3/+7/5v/f/97/3//S/8v/y//J/8T/xP+7/6f/l/+R/43/f/+B/4H/df9u/2n/Y/9k/2n/aP9s/2n/a/9v/3L/dv+H/4//jv+X/5z/nP+Z/6D/qP+u/6//s/+2/7z/w//I/8n/1f/i/+r/+P8GAAoAHAAsACwAKwAhABUADwAMAAkAAgABAPj/8P/t/+v/7v/r//D/8//2//L/7P/y/+3/7//y//P/9v/3//f/9P/x/+v/5//i/+D/4f/d/+X/6f/l/+3/+f/8/wQADgAUABwAIAAjACMAIgAfABgAFwATABwAIQAjACsAIAAPAAYA+f/y//v/+//1/wAAAQD6//X/7P/p//H/8P/x////AQABAAoADQANABIAFQAZACIAKQAqAC0AOgA6AD0AOgA7AEIAQwBQAGAAYQBkAFsAVgBjAFIAQQBCAEEAOAA1AD8AOgBAAEcASQBIAEMAPAA+AEUARQBBAEAAOgAyADUAMgAoABIAHwApAA8AIQBBACIAFAAmABsABgAVAAwA9/8JAP3/9f/4//z/8P/x/+v/1f/T/8f/yP/D/77/wv++/6//sf+1/7D/pv+i/5n/lf+F/3r/b/9b/1z/Yv9a/0r/Uf9Y/1//c/97/33/hv+N/5L/lP+T/5T/m/+m/6j/rP+1/8D/y//V/9//6v/5/wMACwAYACcALwAqADAANQA/AEkASQBDAEYAUQBcAGgAaABlAGYAagBpAG8AcABtAGsAZwBdAFwAYABjAGMAWQBSAEsAPwA1AC8AKgAqACsALQAxADAALgAxAC8AMgA4AD8AQgA5ADQANQAwACQAGQAJAAAA9f/p/+v/7f/s/+z/8v/3//n/9//y//P/8f/q/+D/1P/U/83/0f/Z/97/6//z/+//+P/4//n/+v/7//n/9//5//j//f8AAAIACAATABAAEgAVABUAHAAhABsAHQAkACYALwA6AEUAUwBTAFMAVwBWAFMARwBBADUAIgAdABYAEQAFAPz/9//1//P/7v/s/+z/7P/u/+//6f/m/+P/3P/c/+D/5f/x//X/8v/z//b/9P/3//r/8v/2//z/+v/z//z/+v/0/+7/5//k/+L/3P/g/+X/5//o/+z/9//+/wEAAAAAAAEAAAD//wIA+f/p/9v/yv+//7X/pv+h/6L/qv+u/6n/qP+m/6b/oP+S/47/iv9+/4H/gv+L/5P/mv+k/7D/uv+//8T/zf/O/9D/1f/R/8v/wv/H/8z/zf/Y/9T/zv/K/8j/0v/b/+T/5//y//7/AQAJAA0AFQAiACoALwA7AD4ARABGAE8AWwBoAG8AbwB4AHgAdwCEAIUAigCRAI0AjwCOAIQAhACJAIkAjQCOAI4AjgCOAIYAgAB9AHIAaQBgAFoATgBEAEIAPgA0ACkAIwAbAA8A/v/w/+f/5P/r//j/7v/g/9P/wf/E/83/z//N/8D/tf+x/7P/wv/K/8r/uf+t/67/q/+3/8n/0f/U/9L/y//d/+r/6P/3////AgAIAAgAFgAnADoAJAAhAfkBNwFf/zz+Q/5g/30A2ABMAFL/nf6s/tv/xQDhAPwAYgD+/h7+0/4sAAABeQA1/3z+n/6I//IA0AEiAcH/2/4//00AJwHqADkA///6/2sAegCAAO//wgBjAccAUwDy/wkAjQD1ADIAKv+w/hf/tP9lAGAAmf/K/mD+9f7b/zEArP+l/hf+fP5A/7T/uf9l//H+lf4C/6X/KwAIAHr/Q/+N/8X/BABKAOb/bv+L//f/RgBsAEwAFwASAAsAEABZALcAgAAqAGAAVwA0AHIAfgBEAKMAsACQAAsAEQCdAPUAuACvADcAAgBcALgACAEsAawA6/8tALYA0QD+AO8ArAAVAG4ASAEyAcoAkQCCAGsAzQAVAZ0BVgG3ADwA1wCZAQ4CygHsACoAcwDbAPkA7wBwAAIAJwCh/6z/NwA+AOn/j/8x/z7/R/+p/wcASf8C/w3/Nv9H/7z/FAD6/47/jv8yAG4ATADu/+X/ZgDdAJsAwwAmAff/VP+r/1wAnQBGACr/0f4q/wn/HP+F/+/+Gv7w/XD+9P4d/5j+Iv5b/qL+7P6D/6r/R/9I/53/TQCjAI8AUgDvAH8BxQB3ACsATQC7ACIB0gCNANQAMQDa/3sA0gAbACIA8v9V/4r/Tf84/5EAMABD/rX9M/5a/1QADwDB/t/+uf53/hAArACj/+j+Pv9k/yMA7AB5AML/S/9P/08AFAFMAIr/4f4U/zEAdQBPAM7/Lv+2/pr/owBBAMf/Uv8Z/6H/cADfAIUAnv/p/i3/JADzAOEA4//a/lX//P9kAE0Amf86/2v/nf+2/+z/IgDW/6r/4v/z/wIAcABZAAkAHwDh/+T/jQCgALYAZACm/9X/TwABAeQAGgDL//z/bQCHAJYAogDSALoAIgDs/yYAfACdAGgAUwBVABkA6v/4/4QA2wB8AEAA2v/k/1wArgDpAN4AGgC9/+j/SQC0ALIAbADy/5D/c/8jAFcAJgCL/+P+1P59//b/g/8n/wT/QP86/zr/Mf81/7j/gP+H/4z/h/9b/53/AgAWAPD/mv/e/63/AwBhAIAALgDJ/7v/3v9cADIAVwD//9D/0f/l/yUACwDV/6v/qv+k/+3/pv+P/9z/q/9z/3b/lv9i/6L/sv/2/7z/W/9//5L/JQBOACEAwv///8z/MgCdADAAfQA0ALAAmAB6AHcAdwC4AMwACgGVAHQAWgCiAN0AtQDLADYA9P8MAFsAxwCPACQA6//H/xIAegCQAHMA9f+d/97/VAB2AKgAJAD7/y4AcADfAPcAswB3AH8AtQA/ARgB3wCxAIkAKQFRAR4B7wDPAMQAFgE5AWYBNwGVAIIApwAdAT8B0wB8AFYAYQDAANkA6wDOAF4AQQCjAP0AMAHeAGQAogCgAOUANwHrAAUByACSAOoACwH3ANwAcwBuANwAtAB+ADQAXABqAFEAUwD//9P/rv/F/wYAEADC/2//Pv9e/7T/vP+v/yn/5P7O/hv/f/9D/wT/cv5J/qH+8v75/on+CP7l/Rv+Nf5d/gr+t/1Z/Vv9qv2k/af9Q/3i/Mr88fww/TX9uPyQ/IH8fPz4/On80/yv/K/8Hf2Z/Xb9d/09/X39H/4H/jb+L/5t/oX+gv7B/h//Lf82/4//e//m/w8AAAAjADgAnQCyAN4AyADuAAQBQwGcAaMBggF4AYsBqQEbAuYBcwLoAnICGgLcASoC5AJQAzIDFwONAgwCdgL9AuYDvgPTAh8CCAKOAhQDUgP1AooCmgF6AR4CkwLSAusBcQFGAV0BtwEEAv8BvwFlATwB0gEwAmECDALxAYAC0wI6A0UDZwOQA8YD4QN2BLAEiQRbBFgEEAUXBQ4FsAQ+BDYEFwRRBGcE5wMgA3sCIAJ+AlEC0wEoASwAyf9i/2z/R/+X/q/9I/3P/ML8oPwp/Of7RvsS+/763/rW+pP6Tvom+j76Ofox+uT53fn2+dP5svlT+Sf5QvlQ+VX5J/ni+Mz4qfjg+DX5J/n1+LL45vgv+Yf5qPm5+c35APpg+qD6A/su+1r7j/v7+2f8vvwC/QX9V/2o/Vr+o/66/v3+Hf85/5j/8v9oAMAAZACRAJcAxAA5AXsBzAGxAW4BXQH2ASUCaALBApUCpgJgArACSANuA2QDNQMwA3ADuAOvA9QDBAQZBBIE+QMsBHUE0wSrBJoEfgRYBKUEgQTNBOEEiQRIBOgD8AMuBF8ECgTwA7ADawO4A8UDQARiBN0DxAMJBKAEIQUDBQgFiwWsBbsFKAZaBtgGzgZ1Bs8GAgcLBxkH7wbjBqgGIwY+Bj0GuQVOBZIEDgTHAy4DuAIhAjMBfQDz/7H/bP+k/sP9I/21/Jf8ffwp/Jv74/qd+rP64/rY+nn6Ffq5+Zz56Pk8+j761Ply+W/5mfms+bf5oflg+RX5+fgt+V/5OvkH+ff4EPlD+Tv5RPk++Tz5afmc+ef55/nB+eT5U/q1+vv6Jvtp+5H7oPsX/MD8KP0y/T79d/37/Ub+iv7k/jr/av8b/07/2P9eAKYAXQCgALcAzQD8AGYBywHKAc0BsQG/Ad4BDQKJAqYCsQKqAncCgwLFAlkDpgN4AzgD9AJMA3QDuAMLBOwDxgNyA78DDAQNBO0D0wPhA9gD7wO1A5sDpQOaA6gDpAOCA0gDCQP7AjUDMAP3AtwCsQKNAnICigK6ArwCiQKJAsMC2ALoAhQDPgNlA2cDhgPFA9cD0wPaA/oDFgQUBO4DzwPOA6cDfANTAxED2gJmAgQCzQGPATUBtwBIANn/b/8H/6b+R/7k/X79NP33/M78n/xR/BT87/vU+6X7gPt1+1j7TPtC+0/7Rvs2+1H7UPtW+2D7aPtc+1X7Pfsl+yv7EfsF++z62PrV+s36zfrF+sT6svqu+qz6rvqu+qr6ufrF+tb65Pry+g77K/tS+2z7ivu5+9v7DPw1/Hz8rvzm/Av9SP2S/cL9FP5E/oj+uv7y/ir/b/+y//H/LwBhAKYA3gAwAYIBvgEAAiECWQKKArkC/AIfA2EDegOhA8UD3wMTBB4EPgRTBGEEdAR9BIgEmgSoBKIEoQR+BHMEVgQ+BE0EHgQYBNwDyQOgA30DXgMsAx8D6wK/ApcCbAJcAkACJgIaAg0C/AHzAfcBAAIPAhACNwJQAn0CiQK0AuwCFQNnA5ID0QP6AxsEVQSFBLUE7AQJBS0FNgU4BTgFRwU5BRwFAwXTBJ8EXQQVBN0DmQM7A+QCbgL+AZQBIAHHAFcA6f90/wD/nf5A/t79cP0a/b78bPwW/Mf7iPtI+xj72/qe+nf6VPo0+h/6Bfr8+eL5vPms+Zn5lPmM+Yb5kPmL+Zz5rfnJ+eL59fkg+kP6dfqk+tT6Cfsv+2T7kfvH+/z7N/xl/JL8wfwF/T79dP2p/ef9Gv5Q/nr+uf7u/gf/N/9h/57/yv/r/yQAUwB2AKIAuwDtABIBNAFZAXEBkgG8AcQB1AHXAdwB7AH6AR8CJAIkAg8CZQJiAh4CcgKoApwClwKrAu4C1wK7AuYCCQMOA/QC8QIZA/YC7gL+AgsD/QLOAt0CzQLEAq4CvQK8AqcCmQKIAokChwKRApwCoQKZAqACmQKoAr8C2QLxAuoCIAM+A1UDjwO3A/ID7gMCBCcEMAQ0BBgELQQZBPgD3gO+A6QDawMmA/UCrAJ6AjoC1AGPATYB5gCIACwA5f+E/zD/1/6V/kT+8/2t/Wn9Hv3T/IT8Pvz3+7T7cfsn+/H6qvp6+kP6Ffrw+bn5ovmD+Xv5bfle+Vn5S/lD+UT5TPlR+Wb5ffmO+aX5uPnU+fb5KPpT+nv6qvrj+hv7U/uY+9j7GvxQ/Ir8zPz//Db9aP2X/b394/3//Sb+Tv5x/qX+w/72/hv/Kf9Y/3P/rP/k/wcAOgBeAIgAswDWAAcBLQFZAXcBnQHLAfIBHQJBAmoCjAKZAsUC0wICAycDOwNrA28DiwOeA58DyQPPA+YD9wP3AxoEFAQwBCgEIwQpBB8EFwT+A+8D0wO8A6ADhQN9A3MDagNqA10DaQNlA28DbQN6A5kDogOqA8ED1QMABAQEJwRIBGkEfwR+BI8EogSwBMQEvgSsBJUEcgRXBDAEGwTxA7sDdQMzA/kCowJlAhgCzwF+ASEB0QCEAEEA6v+X/1b/Dv/W/oD+Pv4R/tn9n/1h/UL9Ev3O/JP8Wfwr/Az81fuh+3z7Vfs6+wr78vrP+rT6mPqJ+oP6d/p1+m/6d/qB+n/6jfqk+r/6z/ri+gb7IftC+177fPuh+7372vsE/CX8Svxr/JT8vPzf/An9Kv1M/Wz9jv2q/dP98/0U/ib+Qv5x/n3+of63/s7+8f4J/zX/Yv+C/7n/zv/3/zQAYgCWALsA5gAYASsBXwF1AaUBxwHaARMCJgJiAnkCkALBAs4C+QL8AhMDQgNKA3EDaAN9A4wDewOLA4YDoAOqA5oDoAOkA6oDrwOiA5cDhwN+A2oDbgN6A4ADlQOOA5wDrAO3A7cDvwPOA+4DAgQaBDEERQReBHIEcgSBBIwEiASIBIQEmASKBGEEOgQOBNwDoQNYAxwD3AKNAjcC8gGqAWkBDwGvAGoAFADB/2X/Cf/E/m7+H/7d/aP9dv0x/fD8yfyj/IP8Svwc/Pj7zPuk+2z7TPsz+wj73Pqz+qv6mPp5+mb6XPpa+kL6IPoi+iD6Ivof+hj6Kfov+kD6Tfpr+o/6p/q9+tv6Cfsy+177f/u7++b7Cfwo/E/8gPyg/MH83fwD/Sn9Rf1s/Zn9xf3y/RH+Pf5q/pL+uf7X/g7/Ov9j/5r/vv/8/ykAUwCGAKkA5gAaAUsBdwGhAdsBAwI3AmAChQK3AsoC7gINAzADUgNYA3IDhwOUA5gDogO1A7sDvQO5A7kDzAPMA9cD2wPsA+8D6gPiA9YD2QPFA8cDvAOzA6wDmAOHA4wDmAOtA7YDsQOuA68DrQO7A80D2AP2A/QDBwQJBB4ESwRRBGIEYARfBGwEUARWBEsENgQbBN4DxgOYA28DOwPvAscCdQIuAuYBkAFcAfwArwBXABkA1v92/zP/7f6z/nn+Pf4n/v/92P2r/Xb9Yf1A/RT95vzH/Lb8l/xy/FL8O/wi/Pf7zvu1+5/7evtQ+zn7Kfsa+/v64/rW+s36xfq0+rT6y/rT+s763Prn+vn66frt+gT7K/s/+zz7Vvt7+5z7sPvS+x38T/xt/Hb8n/zY/Af9Kf1P/Yf9n/2k/b/9AP5J/mH+Xf6H/rr+7f4T/0f/iP+P/7P/GACwAOIAkQCDAMgAXgGjAWIBSQFUAawB5gHzARUCGwIoAikCOgJTAlwCdQJnApACmgKfAo0CjQLJAuwCBwPdAsoCzgLmAhIDNQM1AywDEwMDAzIDWwNoA00DQQNlA6oDwwO/A7gDqgPqAysEUgQ7BB0EIgRQBI8ErgTZBMgEwAS7BMUE+AQOBQEFtgSSBIcEiQRgBPsDsAN+A1QD9gKOAjQC9gGtATwB4ACRAEMA3P9x/1L/Sv/6/nH++f0E/jD+If6Q/ST9HP0v/VH9K/0m/QX9pPyA/JD86/zT/Fv8Afz2+zX8H/zf+6/7nfuI+z77F/sc+xT78PrB+sb61frE+of6gvrR+v/6/vq8+sb6+von+zL7OPti+3L7rfvN++L73/sN/Dr8YPxt/Hf8ofy3/OT8Iv07/S/9MP1f/Zr9wv3J/eD9B/4I/jP+a/6f/r3+sf7o/kv/lf+d/7P/6f9MAJsAygDUAOwAGAF0Ae0BHAImAgECMQKkAgcDMQMjAzoDSwN0A58D4AMZBCIEGgQnBD4EcwSRBJkEoASjBMAEpgR+BIEEkwTSBK4EgQRhBEgEZgSBBLAEswRuBD4ESgSzBP4EBAXpBJsEngTZBC8FbAU3BSkFLQVPBWYFbAV1BUsFEgXeBMMEoARCBOsDtgOMAzcDswJBAt0BjQE9AegAlAARAJb/Tv8n//f+p/53/mD+/f14/Vb9z/1K/s/96fx9/Nf8UP1e/UH9+vyg/Ev8YfwV/Xn9Lf1n/M374vss/Hn8YvzZ+0f79Pon+2H7WPsd+9r6xvqv+sn6+/r++t76p/rG+hL7Gvv4+u36Nvt4+337evt7+5D7nfvK+xL8G/wJ/Oj7BPxH/GP8rPzR/OT82/za/Cv9h/3M/er98v0N/v79NP6g/gr/Xv8u/yH/R/+V/xsAZQCxANcAvQDYAP8AhwEAAiUCQgL3AUkCgALiAkADFwOFA3MDkwOIA3wD2gPgAw8EzwPNA8oDugPsA+ADEAQUBNgDuQOVA8UD/QMEBNIDhwNzA4kD5wNLBFYELATAA+ADXQTeBCYF+QTIBHIEjATmBGAFrAVKBQIFqAS+BBQFVAVQBcEENwTWA/ED0QOfA1MD6AJmAsUBbgE7AQ8BkAAlALr/VP/t/oj+Vv4n/gn+0v27/VT92PyY/On8l/2h/ST9c/xM/Iv8y/wc/Qr92vxU/Pr7LfyZ/Af95fxj/Nb7l/vd+yH8Hfy/+1H7Ivvv+vD6Bfsl+/b6i/pi+oj64PrZ+pj6bvqD+sr68PoF+/X6A/sB+zL7fPu4++X7vPuh+7H7//tq/GT8Svwb/Fv8pvzc/Ab9B/0g/Qr9Jv2a/Qv+J/7p/b79PP7L/i//If8H/yX/b/8CAF0A0ADmAOIA4wAAAacBYgLGAq0CTgI+AsQCVQPzAxgE5gOJA2QDzANVBPEExwSjBDcE+gNNBHEE8wToBKIEQQTwAxgEVASkBKYEhAQ9BOMD6gMKBEAEcQRmBGcEPgQxBHIEngTeBNsEAAUoBSkFPQU5BXgFiAVpBWIFdgWrBY8FUQUHBfEE7gTABJYEJAS0A0kD8wLJApcCQALbAVQBwQBYACQAGwDF/1L/1/6M/k/+I/5g/mH+Gv5z/RH9Vv28/Sr+9P15/fj83vxX/bX9B/7E/Tb9qfxp/Mz8Pv1g/ff8N/yj+4f70/sK/PT7kvsg+9v6tvrV+hv7MPsG+6j6dfqQ+rb64fre+sb6uPrO+gL7Ifs4+1X7W/tU+2z72vsy/Dn8C/wC/DH8Wfyc/MD83/zo/MX8wPzP/BT9cP2T/Y79fv2E/Z798/1W/qj+4P7P/vr+Nf+K//j/MgBtAJIAyAA7AaIBzgHTAfkBMQJ2Ar8C+AJUAz8DRgN4A6MD9wMiBEMEOgQ8BFsEiwRtBEAEcgS3BNAEvgR6BFoEWgQ7BIAEbgRuBEAE9wPHA68D6gPZA+EDmAPDAwAE2wPsA94DNgRGBEgEXgRvBJEEcgSYBHcEmwTbBAEF2QR1BIEEmwSEBEMEPQQrBMgDNAPfArYCeAIsAsYBVAHWAHcALADC/2L/LP/6/qP+Ov4d/hP+6f2Z/ZL9xv2j/Wf9I/1f/Z79tP2Q/UT9LP1I/Y/9gP1Z/U79P/0M/a78qPzH/KT8PPzZ+7L7v/u6+337F/vJ+rj6o/qC+mf6gPqD+jn6CPoP+k76ZPpG+jn6TPpz+o/6t/rD+uD6+PoO+yX7Qfuf+9f7x/uc+7j7Bfww/Ef8dPy3/Lj8wvzs/B79V/19/an9uP2+/RD+av6a/qH+x/4w/2P/uf/t/zwAcQBwAMUADgGsAf8BAQLvAdUBawLgAkQDdwNSA4ADYgOtAwsEVARxBBkEDATqA10ErwSzBJoEDQQZBBwESwSNBLcEigQ8BBsEMwR0BGMEUgQzBPID4QMPBC0EEQT3A54DkQNiA28DswOQA5MDfwN/A4EDhQO8A7sDxwOfA88D7gPqAxwEEwQeBPsD2APtA/wD7APMA5sDSwMeA90CuAKDAioC4AGWAVMBGAH0AKEAYgAXAMz/oP9D/xb/6f7G/o7+Xf43/jT+Vv41/hv+zP2l/aL9nP2s/Yr9bf0c/fz80/zS/Mf8j/xk/PX70Pum+477a/sn+xT73/q7+qT6q/qw+pL6ffpi+on6ufrY+tD6pvrG+gT7OvtM+2j7jPus+8H70PsY/Dr8QfwY/A78O/x0/Lv8ufzK/MP85/ww/TT9ef2f/d797f3v/Uv+kf7d/t3+6f47/33/8f/b/+T/HgBlANwA7wBRAX0BhwGhAbUBLwJ/As4C2gKlAsMC9QJBAzoDCgMUAwkDKgNVA4gDowNZAx4DCQNgA8ED6AO6A2QDcgOZA8wDwQODA3ADQgM+A1sDiwOlA1UDEgPEAuICLQNoA3UDBwPzAt4C5AL+AgIDMQMCA/MC/QIVAzYDNwM8AwAD1AL4Ak8DhwN6A1MDVAMsAzIDXAOCA50DawNsAz4DIwMcAxEDDAObAnYCVgI7Ah4CzgGTAQQBqABcAEIAGADK/5D/CP+q/lL+J/78/a39iP01/fv8wvyp/IL8MPz4+8/7vPuQ+237T/so+xT79vre+rb6nvq5+sb6nPps+lH6QPos+iP6OvpN+lv6avpr+mX6cPqv+sj6yPro+jH7a/t++6n72/sF/AX8Nfx+/KP88/wG/Sj9Qf1r/c393P0K/iv+a/6c/rr+8P4j/03/Zv96/5L/sv/p/xIAAwAbAEkApwDoAMkA3wDNAOYADwE1AYsBlgGkAW8BVgF+Aa4B4wHWAeMBFwJKAnsCfQJxAk0COgJEAnwCxwLsAuYCvwKfAqcCxQLAAskCyALgAv0C9AL+At4C1QLbAuMC/gIMAyUDJgMrAxkDDgP4AtQCywLWAtoC4QLJAtACvwKZAp4CjAKvApoCvALFAq0CpAJvAnYCcgKsAtYC2wLFAqUClwKAArICvwLsAuUC4ALbAtYC7wLkAtUCgwJ/AmsCeAJ/AkQCSwIYAvQB6QHFAcMBlAFNARcB5wDCAKAAXwAWAN7/pv9n/0L/+v7c/qL+Uv5B/gT+5f2y/Un9Kf0B/d78tPxu/FX8MPz/+9L7wPuo+4X7V/sV+wj7+vr2+uX6pPqU+on6mfqn+rn6zPrI+rn6lvqd+rP64PoA+wL79vrw+vP6DPs6+177kvum+8T78Psc/Fz8hPyT/LD83vwl/X39s/3n/Qv+F/49/m3+xf4b/1D/Wv+I/6D/x/8DAA0ATgB3AJkA0wD8AFgBgwFWAWgBlwHYAQACIgJJAmYCWgI+AoQClgLQAgQD6gIeAx4DGgNIA18DvwP/A7oDYwMyA18D4AMnBBEE2QOPA2QDsAO/A+wDvwNCAw8D0gI7A2YDLAO9AkYCTwJxAtcC4QLNAmECGQI5Aj4CjAJtAiwC+gHtAUcCWAI+AvwB4QHWAR0CPgJMAkIC3QHEAaoB7AE5AjIC6gF5AVQBhAHbAeQBvAGAAVoBbAFzAW0BgwF4AU8BPwEKASQBJwEUASAB8gAWARQBEwEDAfQA+wDnAAwBCgELAeQAjQCKAIMApwDPAMQAoQBGABMACwAcAC0AFADZ/3f/Jf8R//v+DP/d/pb+VP4E/v/94v29/YT9Nf3//Lv8tPyP/G78GPyz+5j7fvug+5j7UPsW+9/6/PoL+xT7Cvvz+s76sPqv+rT6t/qy+qb6nvqq+tz6+vrq+sb6wPru+jL7Wvtv+2n7efuN+6n74vsN/Eb8dfyR/NL8Af1L/ZP9tv3Q/fX9R/6U/qz+0/4Q/23/s//J/9X/CgBoALUAwgDaAA0BRwFvAbgB/wEDAioC6QHhARACeAI3Aw8DxwJdAlsCtgI5A5UDigNqA7sCmwLdAm0D8wOiA1ADBAMbA0cDYwM7A1IDiwOTA6YDfAN7A0QDOgNmA+wDJQT1A1QDtQLSAhIDmQPJA5oDLwOiAowCegLkAi0DOAPiAjcCEwIfAkYCSgIkAt4BnQGxAXsBiwF7ATEBJgH6ADcBbQFcATMBvAC2ACABxAEDAsIBWQECAQYBhQERAlMCBAKYASkBCAFfAb8BHwK/AXYBDwHTABABLAFQAegAzQDEAJoAgABUADoA8P8KAAMAEwADAKv/Z////gj/Yf9w/0L/zv5f/j7+KP5N/m3+Uf7j/Vz9Kv0+/XT9Tv0D/cD8gvxm/Gz8dfxJ/AL8qPuF+6H70/u7+1378Prs+hr7YfuW+2P7E/vB+rz6A/tf+5v7fvst+8/65vpU+9L7C/zf+577j/uq++37O/xA/EX8TPyL/Kv8yvzu/Aj9Rv1m/cr9Ev4u/mT+Uv5y/vD+bv+v/47/ef+N//b/XgCbAOUAIAFIAVYBeQGpAfYBEAJoAsQC7QIMA90CsAK5AiQDkQPuA7wDVQPzArUCQwO8AzgE5AM0A4oCSQLKArED3wRzBDcD4wG0AeQCJgTeBC8EuwKtAaQBiALBA3oE7wNPAiYBKQF3Aq0DyQMmA90BRQF0AQ4C7QICA6ECuQFLAcoBkwIkA50C5wGEAekBuAL6ArMCLQLlAZMB4gF1AsICtQKmAQ8BDwHLAX4CUQKaAe0AwwDKAEYBhwGBATwBqwBhAFYAvgAlARQBmQBHAD8AawCsANcA3ACKAFMAPwCVABABKQEIAVgAUQCKAMsAKgH+AKkAIADM/8//BgAdAN3/Wf/T/pX+df53/lX+A/6v/YD9Iv3a/Jr8VPxN/Cf8EPzZ+3H7HPvZ+sz6FPsk+9v6hfo/+jD6Nvpg+oj6gfpZ+jv6P/pY+o76n/qR+oz6lvq6+s/6Dvsa+wn7G/tD+3T70vsE/P/79fsQ/E78lvzo/Cj9Pv1T/WT9of0T/oX+tf7F/tf+5P4J/0P/0f8JAOf/3/8AAHQA4QAaASQBBAEDAWQBDQKNAqECPALxAQoChAIEA2YDdwM8Ay0DGANAA4gD4AMUBLIDTwMwA3MD6QMxBBwEuQN9AyMDIwM+A38DygOTA08DFwPOAtMC9QI0AycDNgPaAmUCPwJhAtMCCAMGA5kC+gGgAfkBSgLNAt4CTwLXAX8BuQEyAqgC3wKaAvUBoQGoAfsBrQK0AoMC/wGuAdIBLgKCAooCdwJIAlMCQQJQApEC4wLgAqwChwJkApQCjQLjAt4C6wL2AqoCjQKNAp4CsQLJAnUCIwLxAdkB5wGeAZIBWgEFAbUASwAuAAoA7f9Z/+3+pP5O/vv9mP1Y/Qn9vfxw/Cn8/vvO+5f7QfsA+8L6n/qK+nP6Vvop+uz5wvmc+Zb5p/mY+Wr5Ovks+TT5LPlE+Vb5ffl9+Uj5WvmP+Q36PfpN+jz6R/qK+sf6Gftu+4b7iPud+5L75vtU/LT8Jv0L/Qr9Gf0r/Z39Gv6s/hH//f7D/tb+Ef+D/8n/6f8aADMAUAB8AL8APwFvAY8BPAFGAdMBlwIGA+gC3QL+AmYDTANLA7kDBgRUBGEEWgRkBFsE9QMDBFQEhwR9BBYE4gPXA94DJQRlBCgE/QOmA1EDZgN9A7cDuAOAAyoD8gIHAxwD7QLkAvgC3gK8AowCsgLaAgMD/AL3AvwC1wLgAh0DnQNEBFIEOgQqBAQEUgSdBP0EFwXDBHgEXQSQBNEEAwXMBKsEMQTuA+4DGQQxBL8DcgPeApYCRwITAtwBWwEAAYEADgCg/0z/5/6b/jX+vv1c/Q39y/xA/Af82PvF+5f7Z/sR+576Yfof+hj6B/r7+b/5UvkP+dr41fgA+RP5+vjH+Jb4e/iL+Mj4GPkv+SD5Kfk4+V35nfm4+QT6Tvpg+mH6YPrC+kP7d/uY+4j7kvv7+zf8nfzD/N38DP0H/Xf9uv0L/lf+OP4j/mL+u/4r/4f/3v8SADMALQBgAPYARgGfAZ0BvAENAjMCWgLkAgcDAgPuArYCPwN6A9sDCATyA+sD0wOvA9UD9gP7A0IEtAPQA5wDGQRnBEkERQT0AzME2wO+A6oD3wMIBNwDsQOdA4oDQQMpA/wCiQOMA9wDNARSBKoEdASaBLcE4AQhBXoFjgWCBTQFIAVxBXUFoQWJBasFZAXoBKMEngTLBIsESATYA2cDvgIrAtsBwAGLAQ4BkgDy/3n//P7E/pP+GP6h/Rr9vfxd/Cv8GvwJ/Lj7aPsp+wP78vrX+sP6qfp/+kH6GfoO+gX65vm++aj5jPlv+VL5VvlA+Vb5U/l1+Yr5ivmD+W35a/l7+cj5Cfpz+oP6pvri+ij7Rfs7+2L7sfst/Fr8j/yn/KP8yvzf/HL94f0L/kb+Jv5j/p3+tf5a/3v/of/G/6f/CgADACcAwQD6AHgBJQE6AY4BuAEvAvUBPgJvAn0C6AK/Av8CEwMQA48DpQP3AyEE5AP2A7MDtwMnBCcEjQRRBE4ETwQkBIUEnwTGBNUE+gSdBRwGdgaaBpwGkgZkBlMGvQZcB8sHlAcCB6gGQQYHBuEF5wUuBu0FjAXuBIIETQT9A9YDngNhAwQDhAIpAtUBkAE/Ad4AdAABAMr/jv9F/xL/sv5+/jP+7f3C/Zr9jP1l/Rv96fyf/Hn8Q/wZ/Az82/uu+2j7Q/sP++j63vrC+qv6hvqC+pL6YvpC+i/6SPqB+o36qfrJ+t361PrQ+t76EvtW+1n7UPsh+zP7Svto+6D7nfvB+9L7wPvL++X7+Psj/Cn8VfyU/Nj8Iv04/VT9Y/1t/Zf94P2D/s/+K/9m/3P/mP8l/1D/yf+WAI0BcQF1AS4BIAE5ATcBAAKRAh8DCwO4AvoC6AI+A0wDhQMlBEgEkwSGBJcE7wQXBXkFxgUnBq8G/QYYBxwH+QY8B2gHowffBw8IMwgHCK8HUQc2B0AHKwccB+UGuwZsBtQFcwXkBJoENgS/A4QDIwPgAnQC1gFFAdEAkQBlADAA8P+x/4T/Lf/M/m/+Lv4W/vv93v3e/eP9vv1d/eD8jvx5/Kb8q/yQ/GT8APyM+xD73Prq+hL79PrB+n/6PPoO+uL58/kR+jf6Mvo0+h/6Jfos+jj6b/pn+n/6ifq1+uD6zfq1+q36pfq6+tL6//oh+xf7JfsD+0P7bvuy+/T7GPxB/F38x/zx/Dr9Tv2N/cr98/1U/qf+Hv+L/7P/8/8uAEIAtgDXAFcBAwIYAp0CngLiAvkCAwNqA64DOwRGBFgElwRhBLsEwAQZBfcFYAZ7B8cHzgfPByQHtAfiB2MI/Aj2CDsJqQgLCLoHVQeEB1UHUQdwByIHxAbbBTgFxwQ6BAwEnANnAxgDnAJNArABWgHyAIYAQADG/8T/r/+D/1P/6P6w/pH+VP5o/o/+1P78/sv+0/7W/gf/Dv/P/oP+E/7u/bD9w/3H/cL9uf1J/df8aPwj/EH8OvxU/Hv8afw9/M37cPtJ+yP7J/sr+0z7W/s5+yL76/rL+pH6Vfpk+lz6h/qD+nX6ZvoN+u35v/nP+Rj6SvqU+pX6YfpA+hH6Nfpj+qP6Hvt5+7f7t/ua+5f7tfv3+5X8U/0M/ob+d/51/n3+tv46/9H/lQBqAQYCSAJPAisCSgK6AikD6QNsBBoFegVgBVgFRQW2BQgGiAZeB3sIsAn6CccJWAkgCTkJSgm/CXgK6wrtCjkKVgnRCDQIBwjqByUIjghxCAoIIwc1BmwFrwRNBBYEHwQIBKkDDQNJApUB/gCEAFIAQQArAAYAqf82/7f+RP7z/eL97P0k/ln+fP5i/hb+zf3A/Q/+Zv6h/pD+SP7W/WX9K/1G/Yv9zf23/XL9IP3P/JX8ZfyG/Lf86fz0/Lb8gvwd/Nz7mfuA+5H7ifuR+3j7UPsL+8X6i/pU+hz66/nS+dX50/mt+Xv5NfkU+e/49vgd+UD5avle+Tj5HfkW+Xj53Pk2+k76S/qJ+rf6IPtc+8z7g/zH/O78Ff1X/S/+g/7j/hb/q/85AIcAHwFeAQwCNgJbAucCYQMcBHwEtAQBBRUFXAWqBQsGDQcuCIoJXQr9CawJKwlQCZIJyAnGCmgLpgvFCq0JCQmDCCoI/wdLCOwI6whYCG8HawZ+BX8E/wPaA8EDxANcAwcDTwJlAcMAJQDq/5v/iv+m/5D/S//H/mb+Hv7R/cf9/f17/tX+yv6z/mD+I/7N/bv9P/4T/5f/ev+V/sz9M/37/Dv9vf2c/vn+vP7u/Sr9zfyp/ND8H/2f/ej9wP1I/b/8U/wR/Nv71vvg++r7+/vD+4b7GPvA+nT6K/r4+dj58/kH+vX5yvme+Xb5Svkf+Q75MPlT+Yr5n/nS+dH56vkG+hL6cvpt+tr6NPt++/f79/tQ/HD8s/wV/Y39O/67/hL/Uv+e/x0AvAAkAbcB5gF8AuICVQPUAxgEvAQKBYgFPAZZB8sIbwl6CRIJAQlACVwJjgktCvAKWwvSCgQKfAn6CI4IFQg4CLYI0ghqCJEHwwbaBdYEGASzA7EDuAOgA3cDAANEAoIB1ABvAC0AIgBTAFsALwC6/0z/6/6S/nD+jf7q/kT/Z/9x/yb/zv6B/m7+q/65/u/+H/9n/2f/9v6W/kj+Mf4L/hP+WP6z/sD+Z/78/bn9jP1x/Wv9j/3m/Qn+AP6v/U394fxl/Az8v/u0+8H7wvus+1f74vpa+tv5jflx+Yr5rfm6+bT5hvk7+ej4nvia+MD4G/ls+bP52/mo+Xr5O/lq+bX5NPqn+hP7jfux+wz8Pvxo/OD8Ev30/Z3+QP/N/wYAggC/ACQBmQEoArwCPAOmA0cEwwQ5BX0FwQWXBqoHBwm9Cd8JrQl5CX0JSQmLCSgK9go8C6oK9Ql1CewIVwjNB+kHVghsCBUIaAekBrsFrwTzA4cDawNIAywD7wJiApkBxwAPAG7/+P7i/hP/O/8V/6v+cP4R/qf9T/1B/aT98P0e/jb+Nv4a/rf9Yf1S/W/91P0x/nT+gf5G/jP+B/75/cL90P0N/kH+Uf4//lj+cP4+/tn9mf2i/cb9y/3d/Q/+K/4C/nT9+vyk/Hn8ZPxi/Gr8Y/w1/Mn7SPu0+mL6PPpT+nX6kvqQ+mD6F/qw+Y/5lvnc+Rz6Tfp3+pT6e/pV+k36Tfqi+t36XPvC+xH8VPyU/Mf8GP1b/dT9Vf6//lv/yf94AMYA+QAzAXcBDwKFAhADkgNABKkEHQWRBWEGmAd2CBIJAAnrCNYI2ggNCV0J5Al6CqUKTAq2CfwIiQj9B7IHsQfaBxYIwgcQBzkGSAVvBLQDMgMOAxkDCgPHAmoCxwEPAVoAp/9A/x7/Rf+F/57/l/9j/xf/sP4//hf+Lv58/tf+Ff8+/zH/Cf+v/nX+Rv5P/p3+4P5D/2P/dP8l/7n+UP4N/hr+Nv5w/rD+7P7o/sv+gP4s/t79tv3D/e79Ov5j/lz+F/6b/fv8b/wJ/Nz72vv9+wz87PuR+/r6cfr1+ab5nPnA+d756/nc+a/5cvky+Sj5KPlc+Yf5w/nu+e/58fn5+Tb6kPr4+lH7ovsI/HX8yfwo/Zj9Cf5x/tn+Wf/n/3YA0ABCAagBKgKVAvkChQP9A5AENgUOBhwH3gd5CJoIegh+CG0IpwjvCFEJ8wlJClQK/gl+CRYJegj2B7oHsAfBB6EHYAfTBjUGZwWKBOoDUQP+As8CwwLDAnsC/wF6AdUALgCN/zf/L/8u/z3/R/9l/1r/Ef/F/nf+Sf4p/iT+Kv5S/nf+f/5+/lT+IP7c/cL9y/3s/Sj+Tf5v/mj+Q/4I/tX9uP2y/dn9BP42/m7+hP57/kX+Av7M/aP9nf18/XH9Y/0q/eb8jvw8/O/7qvuB+1b7J/sB+9T6rfp9+mH6W/pH+jb67/m1+Zf5k/m9+fT5Mfpb+nv6ePpp+mP6fvqu+ur6PPug+x38gfzb/Cv9bf2+/Qv+Xv7P/kH/zP9ZAM4ANgGMAe8BNQKGAusCZwMSBNcEuQWCBigHlAe4B8kHwge/B+AHEAhvCNAIHwlDCRcJ6AiXCCMIrAdWByoH9Aa3BmgGBwaTBQEFXATMA0MDyAJnAicC8AG1AXUBGgG+AE0A3P+T/1j/Of8g/xj/J/8o/y//Gv8J/wb/9P7u/uL+4v7r/gD/Kv9Q/4D/kP9//0//D//4/uj+8v4L/zT/V/9W/1b/Qf8r/xH/Af8G//v+Cf8B/+7+3P7B/pv+a/4//gb+vv2E/V79Sf0w/RP95vyh/GL8HPzg+7L7lPt9+2n7Tvs1+wz72/q1+pr6p/qs+rj6vPrJ+uX6+foM+0H7h/u8+/D7KPxl/JX84/w8/af9Df5z/tX+H/9v/7X/BQBgALsABAFXAacBBQJlAssCRgO/AzsEqAQGBUMFcgWoBd0FGQY9BnwGtQbdBv0GCgcaBxsHAAfbBrMGggZKBgAGwgWHBUYF/ASgBEYE7gOXAzwD/gK5AnICJALQAXQBEQHIAIMASwAWAPP/0P+v/33/Tf81/yT/Fv8K/xX/Fv8M/wD/AP8B//H+5v7g/tv+2P7V/sv+xf7C/tH+xP62/rP+w/7G/qX+l/6O/oL+e/5g/lz+Vv5Q/kL+I/4K/vL9zv2d/YH9Xf1J/TL9Ef37/N78u/yV/GP8O/wR/Or7x/uj+437Z/s/+xP7/Pr3+u765/ro+uT67frs+vD6Dfsq+2H7lPvO+wH8OPx6/Lj8/PxC/Z395P06/pH+7f5X/7z/MgCpAB0BmwETApICDwOCA+4DYgThBEIFpwUPBoIG8gZJB48HygcECCsIKggvCDcILwgYCOIHngdqBygH1QZwBhEGrgVCBdYEYwT9A5YDJwO0AkYC9gGiAUYB8wCiAGIADAC0/23/Mf8M/9f+mv52/lX+O/4O/ur94P3W/bf9kP2E/X39df1l/Uz9WP1Y/WP9Vv1J/Vf9T/1U/TH9Hf0r/TD9Ov01/T79XP1V/U39QP04/Uv9Uv1U/Vb9bP13/Wn9Xf1X/WT9Yv1Y/UP9Kf0e/Q/9+fzp/PD88PzP/LP8o/yk/KT8l/ya/LH8xvzh/Pr8E/0z/WH9mP2+/ez9Of6Y/vf+S/+0/yMAkgAKAWoB2QFKArQCGgN+A+gDUgTEBCgFfQXOBQsGTAZ8BpMGtgbZBu0G5wbOBrQGsAaFBkYGGQbsBbAFVQXyBKkEVQQGBMADZgMXA7wCdgIyAt0BmQFQAQwBzwCBAEoAIQDy/87/uv+y/5L/Xf8p//H+zv6S/lP+U/5a/lP+If4G/gP++P3V/aj9p/2j/ZL9ZP07/Uf9Yf1f/T/9GP0b/RD97vzV/On8D/0Q/Qv99Pzv/AH9+/zk/NT85fz4/OH81PzI/ND84/zJ/Mb8y/zT/NT8y/zK/MX8xvzM/Lj8rfzA/N383/zr/BT9OP1f/XH9o/3n/R3+bv6u/v7+Vv++/z4ArwAZAYEB4gFHAqkCHQOMAwQEfQTPBBkFZQW5BfMF/AUZBkIGUgZOBikGLQYjBvcFxQVyBToF7ASZBDoE3QOeA1wDCAOpAlgCDAK3AWkBJgHnAK4AeAA+APz/0v/H/6n/fv9T/yH///7B/oD+fv6M/oP+Q/4i/hr+Af7Z/aH9mf2S/YP9Uv0Z/SP9LP0Y/fT81Pzs/Or83Pzb/PL8IP0f/Sn9If0u/VP9YP1g/WH9i/2j/Zj9lP2q/cr9yv29/br9r/2z/aT9kP2M/YL9k/2J/Xr9bP10/Yb9dP1+/Zj9qv2+/d79Av4x/mz+qP7k/iD/d//R/z0AoQARAY0B7QFRArkCHwODA+kDXQTQBCIFZQWqBfEFHwY2BlIGcgaBBnsGagZJBjAGBAbJBYMFNgXwBIgEJATTA5ADPQPjApQCQALzAasBVgEMAcYAhgBOABEA3f+z/43/Y/88/xP/4P6x/qL+lv6J/mT+R/46/hz+8v3H/cH9vf2q/Y/9df1v/Wf9SP0j/Q79Df0C/e385vz3/A39Df0E/Qn9JP07/Tv9QP1M/WL9dP17/Y39of3C/c79xP3I/d398v3z/fX9/v0G/g7+EP4D/v79A/4J/gT+CP4Q/hv+Mf48/mf+nf7T/gn/MP9q/7T/9/9IAIsA5gBMAZ4B+gFKAqkCCANeA7oDHwSHBM8EAwU9BXEFqAW5BckF5gX7BfsF0QW7BawFiQVaBRkF4QSbBD8E4QOMA0IDCAOzAlkCAQKvAV0BCwG/AHMALwD+/8L/k/+D/3D/Uf8a/+7+z/6c/mT+VP5f/mn+P/4W/gr+8P3X/ab9kf2N/XD9W/01/SP9M/0u/RD94vzT/Mf8rvya/KH8wvzI/MP8rfyu/L78yvzL/Nv8+PwX/SL9Fv0x/Vf9af1q/WL9ef2E/YT9fv1z/Yr9nP2l/Z39rf3J/d394/3j/Qz+O/5d/n/+rf70/iT/Uv+T/+D/QgCVAPEAUAGqAQkCVQKrAvQCUAO9AxcEegTGBBEFXQWfBdkF7AUKBiQGIQYLBvAF6wXjBboFjgVMBRcFzQRxBCkE4wOiA00D5gKPAjsC8AGgAUkBBwG/AIMATwAOANL/nf9z/0T/B//N/qL+kf56/lT+Ov4l/hL+6v3D/av9m/2L/XL9UP06/R79CP3j/L38rPyY/H/8YvxW/FL8S/xA/Cb8I/wz/EH8Pvw6/D78Uvxf/GL8d/yU/LP8xfzJ/Nb87PwE/RD9Gf0q/UD9WP1m/X39o/3E/dj94/0D/jf+Xv6I/rn+7f4l/17/pf/0/0UAoQDzAEQBnQH5AV8CtwIQA2kDvgMUBGEEwAQeBWEFngXZBQsGKgY7BlEGXwZVBkkGLwYTBv8FzwWSBUgFAAWvBFIE9gOWA0QD5wKNAicCzAGGATwB7QCqAHQAUAAgAOj/wf+t/6z/bv9B/1H/Lf8F/9X+uf60/rf+fv5Q/iz+Z/5x/kD+BP6O/TL92vzH/N78H/0G/ZP8Dfyp+0H78Pq1+r76+voq+zr7MfsC+7j6cvo2+jL6f/oC+2X7kfus+6r7iPtr+5z7C/yW/Ar9df3h/RX+Jv4X/jj+lf4W/7D/QgDOACsBcgGrAegBTgLIAlwDDASnBA0FFQX0BAQFNgWTBfgFTwZ0BmEGFwa/BaAFowWqBZkFdQU+BfoEhgQpBN8DiQM7A+4CvgKJAlYCEQKgATAB3QC3AKAAjQB/AF8AMgAOAAgAVQCOAHkAKAD5/ywAPAAoAC8ARwAiALn/f/+a/7T/ov9g/x3/6v69/r/+tv6v/oH+N/7x/bX9qv21/cL9lf1V/T/9Of0V/fv89fzg/Kz8ivyM/Iv8fvxO/Dr8L/wd/A/8IPw1/B789Pvh+/b7Evwt/F38cfxw/Hj8rPwE/Tv9fP2//QL+Pf6J/hX/g//Y/y0AegDUAEYB5AGkAhYDTANlA6MDGwSXBAkFTQVfBT8FMQVUBYIFtwWsBXcFOQUGBQUFCwXwBLwEZgQZBNEDqQOaA2MDEwOgAk4CIAIEAvoBygF6ARIBrQCKAJUAjwBQANv/g/9w/37/lP+W/2X/CP/C/q7+zv70/uj+uP5w/jz+MP4q/hj+8f24/YL9bP1i/Uv9Jf3t/L78mPyI/H38WPw2/Bf8APwB/Ab8//vz+9374fv++w/8Dvz1++L75PsB/Cv8Svxr/Gf8evyu/Or8Qv1f/Wz9mf3T/WL+pv69/vX+Lv+B/97/PgCoAOcA8QApAcYBcALgAv8CDwNYA8sDVgTBBNsEywS/BNkEKwV7BZwFawUMBeAE+AQiBRgF4ASZBFMEHgQCBAkE1gNtAxID1QLEApoCYAIbAt0BrAF/AYABTwH+AKoAdACSAIgAWAAFALj/jf+M/6v/r/+F/zb//v4A/wn/9v7B/nj+P/4O/v/99f3P/YH9Kv0G/QT9/vzq/LX8gfxc/FD8WvxI/C/8CPzk+9z7+vsa/Bj8Dfz0++n7/fsd/EH8XPxa/Fb8aPyp/PL8Gf09/YX9z/3l/SP+gP75/jH/Pv+j//7/PgCAAPIAigHEAdQBJwKmAg8DdQPIA/kDEwREBL0ELwVWBWoFggWABYcFvAUBBvwFlgVgBXAFbAVJBRgF5wScBEEEDgT7A8oDbAMDA68CZwI4AhsC4wF7AQ8ByQCjAIYAZAAvAN//kv9t/2z/WP8l/+f+sf6M/nj+d/5t/kj+J/4W/g3+8/3T/ar9f/1n/Vv9Xv1C/QL9yPyp/Jn8nfyY/Hj8Q/wV/BL8EPwI/Pz77fvZ+7r7rvuv+8j76PsI/Cf8Ifw//F38f/zQ/Cj9eP2b/Zf91v1I/qr+CP8+/4P/qf+//xEAcQDGAPUAFQFPAaQB4QEqAn8CwgLyAgcDPwN9A8YDCQQ3BEkEWwRpBH8EpwS7BMoEsQSNBIUEfQR9BFoEIgT2A8MDmwNpAzAD6gKcAlUCDwLCAWkBHwHwAMEAiAA8APL/uv+K/2X/Tv8p//7+0v6j/p/+iP5p/lf+WP5q/mn+Yf5J/jb+LP4m/jP+Jv4B/sv9qP2Y/ZH9hP1c/Sn99/zS/K38jfxr/Ef8Nfwk/Ab83vvA+8T77vsb/CP8JPwb/CH8SPyW/OP8C/0U/Rz9X/29/Qz+XP6q/uj+Cf8n/5v/EwBjAK0A6AA2AXEBsgEzApwC5gIrA3YDvgP0Ay0EewTKBPUEDgUoBToFRwVZBXsFigVyBUgFIgUEBfIE2QSyBHIEIgTnA60DeQNAAwkDzgJ9AiACxAGIAVsBQwEHAZkAPAD4/+n/z/+a/1z/+v6w/qD+r/6z/n/+Pv4f/gH+8/37/fT91P2V/Wn9Zf1R/Tr9If37/N78s/yI/Gz8PPwl/BD89Pvj+9j71fu4+5P7lvvF++77Cfwl/Cn8Gvwj/HX80Pz2/O38BP01/Xz96v08/mj+hv6//jn/kP/R/w4ANACGAPIAYgHEAeIBCQJOApgCDwNmA6EDvwPTAxkEbASjBMoE2ATdBPIEDAUvBTgFDwXtBOgE6gTjBLsEkARcBCUECATiA60DYQMOA7cCcAIqAuoBpAE9Ad0AiwBDAAUA3/+k/1z/Df/L/q3+hv5b/jX+Bv7g/cP9u/2z/Zb9fv1q/VH9SP1C/TX9Jf0G/ff86vzV/MD8qPyO/Gn8R/wo/CD8Jfwv/Cb8+fvZ++P7D/w5/FL8V/xC/ED8Zvy9/Ab9CP0R/Sf9bf29/Rn+f/6m/sL+zv4t/6H/8P8+AHMA0gAUAUQBqAHyATYCcwKtAggDPQNsA7AD8AMzBFUEZQSDBKcE1gQJBSMFHgUNBfQE+wQuBS4FHwXmBJsEigRyBGIENATsA5YDNgP2AscCoAJKAvIBrQFhARoBuwBzAD4A9f+3/3P/OP8L/9D+p/6I/mf+Nf7//eb93/3X/dP9yf2r/YP9aP1e/Vj9N/0E/eH8zfy9/Kf8h/xl/D78FvwQ/Cb8NfwL/Nb75vsb/Eb8XPxg/FX8Uvxv/LT8Df0i/R79Qf12/eT9O/5u/rT+2P4U/3z/u/8VAD4AYwDEAPMARQGfAdoBHwJWAqkCGgNZA3wDqQPlAzIEegSgBL8E3QT7BDAFUAVuBVkFNgVABU8FZAVTBSMF6ASrBIMEYwQ+BP4DngM2A9kCjQJLAvkBmQEyAckAawAWAMj/f/84/9/+f/4p/uj9vf2e/Yj9Zf06/Q39/vwD/fv88fzG/Jr8hvyL/J/8ovyQ/Gv8Ofwn/Cv8JfwZ/Pr71Puy+7T70fvb+7X7hPuF+7j77/sE/AX89vvz+zD8kvz6/AX94fz4/D79xf0x/n/+rf6w/vL+Y/8DAG0AkwCrANYAOgGXAe8BMAJRAoMCwgIfA3MDnAO/A+IDJARwBJ0EsQS8BOwEMwVgBVwFPAUlBRcFNQVjBVoFKgXZBKIEmASCBF8EGQS3A04D9wK6AoECLAK9AVEB7ACYAEgAAwC9/1//A/+w/m7+O/4F/tD9jv1V/SD9/vzu/Nn8wfyg/If8dPxd/Ej8Q/w6/Cb8Dvzw+9/71fu/+6T7fftg+2n7gPuX+337Rvs9+2z7yvv6+wL82Puw+/b7Yfze/An96fzk/Bb9qP08/q3+zP7u/in/gf8WAIAA3wAIATUBoAH3AVACnQLaAhEDRAOEA7sD5QMABDQEgwTFBOcE+AT9BCQFZwWLBZwFfwViBWEFZAVzBXEFTAUIBcUEmQSGBGQEFATTA4IDKQPbApkCWwL+AY8BIQHIAIAARgAKAL//b/8d/9P+oP6C/lX+JP7z/cb9rv2P/XX9af1Q/Tf9Fv35/On82vzO/L78ovyI/Gn8WPxK/Dr8KPwY/Bj8KPw7/DX8C/z3+wv8Uvx9/G38YPxJ/GL8rfwD/Uj9Iv0X/Vb9sf09/oX+wP7n/vT+Sv+s/xIAUACCALQA5QAwAYEB5gEmAlwCmALaAi4DaQOqA/YDRQRwBIwEogSnBNIEDAU5BTwFKgUaBR8FHwUvBTwFCwXVBJ0EdwRqBEwEFwTPA20DEQPMAosCSgLzAZABNQHbAI4ARgD3/53/Vf8M/8f+k/5Z/iL+8f29/Zv9cf1R/Tb9If0V/QH97vzW/ML8v/y2/KP8hvxn/ET8JvwX/BL89fvN+6/7uPva+9n7wfuq+7n78/sz/En8RPw//Ev8nPz2/GD9ef1H/Yf9yP1e/s3+2P4j/yn/aP/4/20AyQDxAAcBSQGtAfMBQwJ5AowCxALsAjUDcgN+A64D3wMPBEQEWgRoBIQEmgS3BM4EyQSuBKMEnASoBL4EpQR+BEkEFgQMBPgD1QOoA1UDAAPBAooCVQITArEBTAHoAJAATAAHALj/WP/7/q7+ev5T/iv+B/7W/an9i/1x/Wj9aP1Y/Tb9Ff32/On82fzS/MX8r/yX/Ib8dPxq/F78PPwq/BT8Gfwx/Cr8EPzl+9j7Bvwx/En8NfwR/BH8Q/yw/A/9Mv0T/RT9cP3l/Wz+qv7c/vz+Dv+S/w4AeAC0ALUABgE8AYkB7wEfAlMCZwKVAuACHQNcA48DvQPZA+ID/QMZBC8ERARkBHcEcwR1BH4EgwR9BHUEdQRVBCUEBATrA8wDmwNoAygD1wKCAj8CEALdAZIBOQHiAJ0AZQA2AAcAxf9u/yL/5f64/pD+Xf4p/vD9wf2q/aH9l/19/WX9T/04/R39Av36/Nv8uPyc/IX8dfxZ/ET8NPwl/A/8B/wO/BL8Cfzl+9/7/Psr/Fv8Y/x5/IX8ify4/Pv8Vf1h/U79kf3q/Uj+k/7Q/if/Qf9s/+f/UQC1ANYADQFoAaAB7AE9AoYCsALUAvgCKgNdA4YD0QP/AxAEKgRDBHIEmwTFBN4ExgSnBKcEwATCBK8ElwRrBDMEBwT3A90DogNfAykD7QKrAmcCKQLbAYIBOwECAb8AYAAWAOX/uP9+/zP///7K/oj+Vv4z/gj+zv2h/YP9ef15/Wv9YP1M/Tj9Of0//UP9Jf3//Oz83vzM/Lr8r/yn/JX8gPx7/IH8f/x4/Gj8Rfw//Fn8jPyy/KL8pfyj/Nr8Sv2V/cf9zf3t/TX+jf7+/lb/ev+K/6n/DgB9ALoA9wASAUgBhwHCARgCTQJ5Aq8C0gIHA0ADXQN/A6sDygPwA/cD9gMSBCkERQRTBD4EJwQUBBMEJgQpBBEE7APAA6cDmwOGA14DKQPkAqgCfQJLAh0C4AGZAUoBAwHGAIgASQAFAL3/dv89/wv/0/6i/nP+Q/4T/u/90P2u/ZT9i/2J/Xf9Y/1Z/Uz9Tf1H/Tr9NP0f/Rf9Dv3+/PL83vzQ/L38rPyu/Ln8wvyy/J78h/yE/KT8y/z5/Pv84Pzk/Av9Yv2W/b39zf3K/fr9SP64/gD/M/9g/4j/1v8dAHwAwQDhABYBPQGAAcEB/wE9AlYCeQKkAtQC/QIoA1QDYwN+A48DtAPaA9MD3gPjA9kD4QPgA+sD8APSA8QDtwOeA4EDXAM3Aw0D4QK8AqACZwInAv4BygGdAWYBIgHfAJ4AXgAsAAMAyf+M/03/Gf/0/sz+qP6T/nf+U/5D/jT+Hv4M/vf96P3b/cL9uP2s/Zf9hv1w/V39RP0r/Rb9Af3n/Mj8uvyx/KT8rfyt/Kb8jvx7/JH8r/y7/Ln8tvyy/L787fwp/V39a/1y/az97v04/on+uP7u/h3/WP+//wIAPgB+AJsA2AAiAVoBjgGlAcwBEAJGAmMCjgKnArkC4QIMA0EDSAMuA08DfAOZA68DrAOkA5sDjgOhA7YDmgNyA10DSgNEAy4DDQPqArgCjgJ5AlICIALyAbwBkAFcASIB8wC7AIAAUAAhAPP/w/+O/13/NP8R//D+0v6q/of+cf5e/lX+Tv42/hv+Cf4A/vb97/3g/dD9wP2m/Zj9hP14/WX9T/01/R39Gf0R/RH9C/34/N/8zvzc/P78Hv0o/SD9Ff0T/TP9gv3H/dj93f3q/SX+fP7B/gj/M/80/2D/sv/+/0IAWABzALIA2AAMAUkBXwGAAasB3AEvAlMCUQJnAnsCowLYAuYC8QLmAuICAgMqA0UDRwNAAzIDOQNHA14DawNbA0sDQQNGA0cDOQMaA/ACxgKoApQCewJOAiIC/QHcAbMBfQFIAQ8B4AC3AJUAcABCABAA5f/F/6j/iv9p/0T/HP8G//X+3f7A/p3+fv5j/kv+Lv4V/vn94P3L/av9kv2B/W79Wf1H/TH9FP34/N/81fzO/Lz8rfyT/Hn8ZPxq/Ij8oPyk/Jv8m/yp/OL8Cv0n/UH9Uf2G/b39+f07/nH+lv68/vf+M/9r/5T/1f8cAFIAiQCuANAA7AAhAWIBlwHFAeQBFAI5AmUCogLMAuoC+wIIAyoDSQNVA2YDbANnA2wDdgOHA4ADbwNoA1oDTQNAAy0DCwP0At8CxwKiAnACSQIXAu0BygGjAW4BNAH3AL8AjwBeADIA///I/5P/X/8//yD//v7n/sb+sv6f/oz+hP50/mf+WP5E/jD+I/4d/hL+Bf73/e/94P3N/cf9xv3C/b79s/2j/Y39aP1T/VP9Rv1A/Tf9L/0p/Rb9Jf1K/Vv9X/1w/Yb9m/2s/dT9D/4e/jH+W/59/qz+xP75/kf/ZP+c/9P/+f8wAEQAfADDANcAEQE3AU8BgAGQAcAB+QEDAisCOwI+Al8CcgKQAq0CqAK3AskCyALfAvwC/gIFA/sC9QIAA/MC9AL1AuUC4QLRAsECuAKoApQCfQJkAjwCGALzAdEBrgGIAW0BSAEgAfgAywCmAIUAZQA9ABMA7P/G/5//hv9l/0j/I/8D/+7+1v7E/rn+qv6e/o/+cf5h/ln+Sf4z/iT+Fv4N/vT94v3Z/cH9t/2q/ZH9hv17/XL9a/1f/Vn9YP1g/WH9Xf1M/Un9Uf1s/Yv9lv2h/bD9uv3c/Qz+Pv50/pL+sf7m/iD/Xf+Q/7//7/8QADQAZwCOALkA0ADiAAMBGQFEAWcBeQGPAZUBsgHOAdsB6QHlAfYBCQIXAikCLgI4AjYCRwJbAmsCeQJ1AnECaQJnAm4CZwJcAlACPgI0AioCGAIHAu4B2QHRAbwBnQF+AVwBRgExAQ0B7wDLAKcAggBYADQAFADw/9D/sf+R/3z/af9U/zf/F/8B//D+4v7Q/rz+rf6W/oL+ev50/nL+av5h/lv+Tv5I/kT+Pf46/jH+Kf4l/hr+Ev4N/gX+Af78/fL95/3S/cb9y/3K/dz96v30/QD+AP4Q/iL+NP5K/mT+eP50/nL+hv6j/sf+4f76/g//G/8w/07/bf+N/6j/wP/f//n/BQAdAEEAagCGAJkAqgC5AMkA2gAAARoBIwEyATYBUAFpAXUBjAGjAbcBygHRAeMB8gH8AQoCGAIoAjMCOgI+AkMCRAJDAkYCRQJGAj0CNQIuAiQCHQIWAgsCAALsAd0BzgG/AbMBlwGBAW8BTwEtAQsB8QDYALQAlwB+AGUATAAqAAYA7v/a/8r/v/+t/6b/mv+N/4L/dP9p/17/Uf9A/zb/I/8L//f+5f7a/sr+s/6o/pf+gv51/mH+TP44/if+IP4T/gj+/f3z/ef94/3g/eP96P3x/QL+Cf4O/hL+G/4j/i7+P/5C/kf+Uv5V/mb+d/6J/qj+uP7Q/uv+CP8s/0r/Yf95/5H/qP+7/8n/3f8EAB4ALgBKAFsAfgCbALUA4QD3AAQBGAExAU8BdAGEAaEBwwHYAfcBEQI3AlwCZAJvAoACkQKbAp8CnAKUAooChAKAAnECYgJZAk4CSAI+AikCEwL7AewB3AHKAbYBmwGAAWYBQgEkAQgB6wDKAJ8AggBjAD0AGgAEAO//3v/N/7f/rf+m/5n/kf+K/4j/ff9m/1f/UP9J/zz/LP8a/w3/9v7k/uD+4P7f/tj+0/7M/sH+uf6x/qX+mv6W/pD+jP6B/nX+af5e/lr+Wf5W/k/+R/5A/j3+OP4x/ir+J/4j/iX+Kv4r/jX+M/4x/jv+R/5Z/mv+ff6I/pr+sv7H/tH+2P7j/ub+9f4H/xr/KP83/03/Yf+E/6n/yf/g/wAAIwBPAGgAeQCSAK4AzQDnAPQABAEJAQ0BGwEkATkBPgE/AUIBSgFcAWgBcQF4AXoBcAFvAW0BYwFYAVIBUQFRAU4BVQFSAUwBQwE6ATEBJgEgARUBDwEKAf8A8wDmAM0AsAChAJgAhwByAGoAZQBfAFUAPAAkABIADQARAAkA9v/o/+H/1//B/7X/uP+7/7//tP+u/6z/q/+t/6v/qf+l/6f/pf+j/67/s/+5/7b/rv+q/6z/nf+Q/6L/q/+k/5r/lP+Y/5v/j/+L/5H/k/+j/7D/o/+Z/5r/jv9//2//W/9j/2b/Tv9F/0//TP9A/zT/N/9K/0f/SP9U/1r/W/9l/3P/d/+B/5P/nf+q/7v/wv/Q/93/5//2/wQAEAAaACoAMQA3ADwASwBZAFsAXABaAFcAVABTAFAARQBJAFMAXQBnAGcAZwBgAFQAUQBVAFgAWABaAGMAaABwAHEAbQBuAHQAfQCCAIkAjwCPAJAAkQCXAJcAkgCRAJsAnQCmALYAxQDHAMYAwgC/AL0AugCvAKIAmwCXAJQAjgCEAHgAbwBpAF8AVgBMAD8ANAAvADIALgAvAC0AJQAiABsADgAIAAUA/f/0//D/7//p/9//2P/R/8v/yv/K/8b/xf/I/8z/yv/A/7X/qv+b/4//h/+G/4P/fP92/3X/dv9z/3P/d/98/33/h/+S/5v/oP+n/7L/wP/M/9X/3//g/+b/7v/w//H/7f/h/9j/0//M/8X/vv+5/7j/tP+z/7X/tf+0/7b/t/+0/7D/rP+n/6L/nv+c/5b/jv+F/3v/cv9v/3n/hP+M/5P/lv+g/6n/sf+6/8P/yf/R/93/6v/x//P/8P/2//v//P/7//r/+//6//T/9f/5//z//v8EAAYAAAD//wUABwANABYAHAAWABAAEQANAAYA/P/0/+7/6P/q/+//8//4//v/+//7/wAABAAKABcAJQAqADAAOwA/AD4AQABAAEAAQQBKAFIATwBKAEcARwBKAE4AUgBYAGAAagBrAHEAfACKAJoApQCrALAAvwDNANUA3wDhAN0A2ADUAM8AxwDEAL4AuQCzAKoAngCVAI4AhAB+AHgAbgBhAF0AWgBNAEIAQQA9ADgAMgAtACYAIgAfABYADQAEAPf/6//e/87/xf+9/63/o/+j/6b/pf+k/57/lf+O/4T/ev97/4H/if+I/4r/mP+m/7D/vP/M/9n/5f/x//n//f/+/wEAAgAJABIAEwASABMAFAAYABUAEQAPABEAEQAJAAMAAAD7//j/+P8BAAoADwAWABsAIAAkACQAJAAmACoALgAvACsALQArACgAJQAlACgAJAAkACEAHgAXABEADgAJAAEA+P/1//T/+P/5//r///8GAAoADAAOAAsAAQDz/+T/1//P/8z/x//B/7//vP+5/7P/rP+j/5v/lf+L/4r/jf+Q/43/iP+A/3n/dP9u/2f/Yf9d/1j/UP9K/0X/Qv87/zf/Nv81/zH/L/8w/yf/I/8p/zH/Ov9I/1T/Yf9s/3P/eP+G/5n/pv+o/67/t/+5/7n/tf+2/7T/rv+q/6v/sf+6/8T/z//Y/93/2v/Y/9v/5f/w//3/DAAYACIALAA0AD0ARgBOAFYAXwBnAHIAggCKAI8AlACbAKQArAC1ALgAuAC1ALYAsQCrAKYAogCfAJsAnACYAJEAkACVAJcAlQCQAIoAhAB8AG8AXwBPAEQAOgAuACYAGwAOAAYAAQD//wAAAAD//wEAAAD7//H/6f/j/9//2f/T/9P/1f/Z/9//4//j/+D/2v/Y/9T/0P/M/8z/yP/D/7z/s/+q/6D/m/+V/5L/kf+S/5X/lv+Y/5z/nf+l/7D/uP+7/77/x//N/9D/2P/l//P//P///wYAEgAeACYALgA9AEsAUwBVAF0AbAB0AHgAegB8AIAAggCBAH4AfAB2AHAAbQBpAGAAVABJAD4ALwAjAB0AGwAXABcAGgAeAB0AFwAVABgAHQAfACgAMQA6AEIARQBJAEsASABGAEYAPwA6ADYALgAkABsAGQAUAAwA/P/s/9//1v/Q/8r/w/+7/6//m/+G/3n/cf9t/2v/aP9p/23/bP9u/3X/gv+L/47/kf+Y/6D/of+l/63/uv/J/9f/6v/4/wQACgALABAAHgAtADoARQBOAFwAagB0AHsAhQCKAI0AlACWAI8AjACOAJEAkQCPAI8AjACFAIAAfQB1AG0AaABnAGgAagBtAGsAZQBaAEsAQQA/AD8AOQA0ADAAKgAjACAAHgAZAA4ABQABAPn/6v/b/9T/yv+9/7P/sv+w/6f/ov+h/6T/qP+r/6v/rP+q/6P/n/+o/7r/v/+//8H/xP/F/8r/z//Y/+D/3P/X/9P/0f/O/9H/0f/M/8n/xf/G/87/1f/X/9X/0P/P/9H/0f/X/+T/8//3//X/9/8AAAYABgAIAA4ACwAGAAEA//8DAP//9P/s/+P/3//e/+P/7P/x//L/8v/0//b/+//+/wIABgAKAAgACAAQABkAJAAlAB8AFwAUABAACgAEAP7/+P/y/+v/5//i/9//3f/f/+H/3f/c/93/4P/i/+j/7P/x//f/AAAMABgAIwAoACoAKAAlABwAEwAXACEAIwAiACEAIQAlACgAIAAXAA8ACQAIAAsADwAPABIAEwARABMAGQAoADQAPwBKAFUAWgBXAE4ARQBFAE0AVwBbAF0AYQBiAF8AWgBYAFYAWQBaAFcAWwBXAFAASQA8AC8AIgAWAAoAAAD4//X/9v/3//n/8//l/9r/0//R/87/yf/A/77/wf/E/8P/vP+6/7j/sv+v/7D/tP+z/6//r/+v/7D/sv+4/73/wf+//7r/t/+w/6n/ov+e/5//pv+q/7D/uP/C/8f/xP/D/8T/xv/H/8j/zf/S/9b/2v/g/+r/7//x//P/9v/5//z/AgAGAAMAAAD+/wcACgAKAAsAEAATABAADgAPABEAEQATABEADwAKAAUABAADAAMACgAQABUAHQAnACsALgA0ADEAMwA1AD0ARgBPAFkAZgBzAHUAdAB1AHkAcQBoAGYAYQBTAEQAPAAzACYAGwAZABMACwAFAAAA+f/t/97/1P/R/8j/uP+s/6H/mv+U/5j/n/+g/6P/rP+0/7f/tv+w/6r/pv+j/6H/n/+e/57/oP+i/6n/rv+z/73/xv/J/8v/0f/X/9b/1//a/+T/8P/4/wIABAAFAAsADQAMABAADQAHAAIA/v/+//j/7v/o/+b/7f/0//v///8BAAEA/v/7//b/8f/u/+z/7v/w//T//v8NAB0AJgAoADAAPQBFAEIAQwBIAE8ATgBPAE8ATgBLAEoATwBWAFEAQwA7ADkAPAA4ADUAOwBEAEUAQgA9ADwAQABAAD0AOgAyACkALAAqACMAGgAOAAYAAAD6//r/BQACAAQABAAAAPr/9f/s/+n/5f/c/9X/x/+8/63/ov+j/6P/nP+R/4n/iv+G/4H/ff9x/2v/aP9j/2P/a/91/4L/hP+E/4v/jf+M/4f/hP+E/4P/hP+N/5r/pP+y/7v/wP/I/9D/4v/t//b/BAASABsAJgAqAC4AOQBBAEUAPwBBAD4APgBCAEQARAA/AEkAWgBjAG0AdgB7AIIAjACNAI4AkgCMAIgAhACHAIgAhwCJAIYAhwCHAIUAfQB3AHgAdgB6AIMAgQB/AHkAawBWAEQAPAA3ADsAOwA6ADsANwA2ADIAKAAlACMAHAAdABwAIgApACsAKAAoACQAGwAYAA8ACQAFAAUABQD+//X/8//0/+z/1/+//8H/wf+7/7L/rv+u/6v/qv+x/7n/vf/C/8P/xv/K/8T/vf+9/7v/u/+8/8H/y//P/9T/1f/Z/+L/5//w/wkAHAAmACwAMQA5AEAAQQBCADwAQQBMAFEAUwBVAFsAVwBRAFEAVABYAFYAVQBTAFMAWgBXAFwAYABgAFwAUgBNADsAKQAeABYABQDz/+j/6v/o/+n/7P/u//T/9f/z//L/8//w//T/9f/1//f/7P/m/+f/3//Q/8j/uf+s/6j/ov+g/5T/kf+N/4L/gf+D/4X/kv+Z/5n/of+n/6f/o/+t/7n/vv+//8v/0//O/9H/1f/N/7v/v//E/83/yf/O/9T/1v/m/+n/6//u//P/7f/p/+z/8f/x//r/CgAGAP///f/8//b/7//x//D/9v/3//L/8f8GABkAGQAaABoAIQAsADEAMgAvADYAOQA3AC0AKgAnACgAKgAdABcADwAGAPv/+P/3//r/8//u//b/+f8EAAMABwAAAPH/5//e/9T/0//a/9H/yP/E/7n/uf/B/77/xP/L/8X/wv/D/83/1P/V/9n/2v/g/+r/7P/0//j//v8GAAIA//8BAAQAAAD+/wEABwARABIAEgAaABwAHgAgACQALwAwACwAMQA3ADAAKwAnACcAIgAcABkAEwAUABAAEgAXAB0AIwAoADAANQA+AEAAOwA2ADMANAA1ADYALwAoACwAJAANAP7/9P/r/9b/xP++/6//qP+e/53/pf+k/6P/pP+q/6//qf+o/7T/uv+3/7H/s/+6/8X/yP/J/9P/3f/k/+n/7//5/wUADgAaACsANwBJAFEAUgBeAF4AYgBhAFUAVQBZAF4AXgBfAGUAZQBmAF4AWABZAFkATwBFAD4AOwA8AC8AJwAbABAAAwD3//T/8f/y/+z/5v/g/93/1P/Y/9//4v/i/93/2f/X/9T/2P/g/+P/8f/v/+n/9P/x/+b/5P/n/+3/7P/j/+P/6v/j/9//2v/a/9f/1v/e/+P/8f8EAAUACgAKAA0AEgAJAPn/7f/p/+T/3f/e/+T/3//T/8//z//K/8T/w//B/8T/yf/N/8//1P/Z/9j/1v/S/9X/2//e/9v/4P/e/9f/1v/T/9r/4//t//L//f8JABQAGwAgABkAEAAZABwAHwAhACYAJwAgABUACAAGAAkADAAKAA4AFQAaABQAGgAVABQADwAJAAwABwAJABAAEQAaAB8AIAAiACoAMgAtACoALwAmABgAGQAfAB0AFgAUABEADgAOAAwACAAGAAcABwAAAAsAGQAiAC0AKgAoACIAJwAuAC8AMgA4ADoAMQAqACMAJAAiAB8AFwABAPD/5f/b/9n/1P/T/9X/1P/V/+L/7f/7/wMAAgAOABgAFwAVABYAHAAaABYAGwAiAB8AGwARAAQABQALAAoABwD9//r//f8DAAMACAAfACgAJAAgACoALAAlACAAHAAdABsAFwASABIAFQATAA8AFQAaABAABwAAAPn/8//4//z/9v/8/wMAAwD9//z///8AAPL/7P/v//f//f/v/+b/6f/x/+//7P/q//X/9v/z//L/9/8CAAwAFgAQAAwADQAOAAsABgD/////+//u/+v/3P/Q/9D/w//A/8P/uv+z/6z/p/+r/6b/p/+v/6//r/+9/8H/xv/Z/9P/2f/p/+z/8v8AAAwAIAAkACoAOAA+AEUARgBJAFQAXABZAFUATwBLAEoASgBCADUALwArACcAIQAoADUAMAAuACEAGQAeACUAIgAsADYALgAvAC4ALQAvADMAMAAxACwAJAAhACIAJQAaABkAGQAaABcAEAAPAAwABAD+//n/8v/o/+j/6//n/+f/3//m/+j/2v/Q/9D/1P/W/8z/w//I/8n/wP+8/7b/t/+0/6j/o/+n/7X/v//G/8v/1f/U/8r/yP/I/7//vP+5/7n/tf+7/7//vP/G/8X/wv/C/8X/3f/q/+3/8v/7//z//f/y//L/AQAHAAgABQAHABEAMAApADAAMgAOAOX/6P/s/8j/zf/p/+D/2/8BABIAFgAjABoACwD//wcADgALABEAEgABAPL/7//q/+//8f/3//X/6v/k/9j/0v+7/6z/pf+c/5L/lP+m/7X/vv+9/8X/yv/B/7//x//R/9r/5P/x/wMAHgAiACsAOgBDAE0ATgBfAGsAbwBvAG4AewB6AHEAYwBbAFoAUABMAFcAXgBaAFQASABFAFQATgBCAEAAPwA2ACcAHgAeACIAEQAMAAcACAADAOf/1v/W/9r/zP/L/9D/zf/E/7r/rv+r/6j/m/+b/6L/p/+o/7T/vv++/8b/1v/g/+L/4f/c/9f/3P/p/+3/9//w/+r/+P/7/wUACAARABYAEQAUAB4AKQAxADIALgArADEASgBMAFwAYQBtAGoAeQCBAIUAkgCOAJoAmQCfAKUAowCdAJgAkwCPAJAAhwB+AHMAeQCAAH0AdwByAHMAcQB1AGMAVQBWAEwARQA1ADUAPAA7ACcAIAAUABUADAACAP3//P/5/+r/5f/d/9P/yv/E/7H/sf+p/6f/pf+Y/5L/if+B/3T/cf94/33/c/9u/2b/aP9q/27/c/94/3//d/93/3T/e/9+/3b/cv90/3P/b/9x/3b/fv+H/5P/m/+p/7X/wf/D/87/1//Y/93/7f/4//z/9f/v//7/AgD9//n/AQABAPb/8P/y//P/9P/y//P/AAANAAwACwAOABIAFQAQABcAEwATAAYADQATABEAEAAOAAkACQALAAMACgD7////EAATABgAFQAMAAwABwABAAkAAAACAP3//P/2//P/7P/v/+//3v/h/+3//f///wEA9/8BAAkAAgD8//f/+P/1//b/+f/7//X/8v/0//b/AAAJAAsACwALABAADwAJAAAAAAACAPz/8f/p/+j/7P/j/9T/zP/G/8j/uv++/7z/wv/C/8n/z//Q/9X/3P/d/9r/2P/V/9//4//t/+//AAAHAAgABwAIAA4AEQAZACQALwA0ADMALwAlACUAIwApACwAIQAmACgAKAApACgAKgAcABsAJAApADkAPgBAAEQASwBLAE0AVwBWAFsAWABaAFwAXABZAE0AUgBLAEUAOAAvACsALAAzAC8AMAAsAC4AJAAiAC0ANAA5ADkAPQA2ADEAKwAxADEAMQAzADIAKQApAC0AMQAyADEALwAqACoAJgAbACQAHQAbABsABwAFAAMA/f/x/+X/2//c/9z/1//U/9P/0f/N/8X/wP+6/73/zP/W/+L/6P/y//b//f8EAA0AJQA2ADoAMgA0ADUAMwA1AD8ASgBZAGAAYABuAGgAbgBoAGsAZwBqAGYAYwByAG0AbgBlAFwAWABOAEIAOAAzACgAIwAXABMABQAKAAMA8//g/9T/0v/N/87/zP/R/8f/xv+8/7n/tv+m/5z/mf+X/5L/lf+Z/6r/rP+k/6H/oP+k/6j/tP/A/8//0f/T/8f/w//A/7z/wf/C/8//yv/S/9b/3v/e/9j/2//Y/9f/3//k/+X/6//u/+X/3//i/+T/5f/k/+H/3v/e/9//2//X/9//3//g/9P/1f/S/8//y//E/8n/xv/E/8X/w//B/7//wf/K/9T/1//V/9j/2v/d/+D/5P/o//D/9P/u/+r/5//l/+H/4//e/93/2//i/+n/6v/u/+X/4P/i/+H/3v/T/83/zP/O/8n/v//E/8L/uv+p/6D/qP+w/7z/uv/I/9n/zP/H/8v/zP/R/9T/0v/S/8//zf/G/8b/zP/Y/8//0P/b/+L/7P/o/+z/+P8EAAkAFAAfACYANwA2ADoAPQBHAEoATgBhAGwAbwBsAG8AbwB1AG0AZABoAF4AYABbAFsAagB0AHcAeQBzAGYAXABRAD8AMwAfABUACgD6/+T/zv/P/8b/w/+5/7P/wP/A/8D/vv/D/9H/2v/Y/9r/7v/5/wEAAgADAA0AEQADAPn/+f/4//n/9P/8/woAEwAOABYAHgAcACUAJQAgACIAFQATABcAEAALAPz/8//v//P/8f/u/+L/3P/Z/8//zP/P/9L/1f/P/77/vf/H/83/x//I/8b/wf+2/7j/yv/Z/97/2f/e/+P/9v/7//7/CgAOABoAJQA/AFAAYABqAH0AiACLAJkAowCtALUAugDEAMEAwADFAMAAwwC+AMkAywDEALwAsgCyAKkAqgCgAJUAjACDAHQAXgBPAEoARQA7ADUAMQAtACwAHwAUABQAFQAaABsAGwAZABIADwAPAAsACAAAAAYABAACAAsADwAXABUAFQAOAA4ACwATABkAEgASABMAGQAcACIAHgAfABgADQAUABMAEQAaABAACAD//+//9v/0/+3/7P/e/9P/0f/P/87/zf+//7H/qv+g/5X/lP+I/4H/ff94/3b/ef9+/4X/j/+J/5X/nP+b/63/vP+//8v/0P/K/9r/3P/V/9r/4//r//b/8f/y//7/AgALAB0ALAA/AE0ASQBCADcANwA/AEUAPwA0ACsALgAtACoAIwAhABkACQD///f/+/8CAAIA8f/l/9r/xP+//7T/qP+a/4f/gP+D/4j/gf+B/3b/ff99/33/gP95/3v/c/9t/2j/a/9n/2n/c/9z/2v/dP92/27/cf9x/3j/f/+E/4P/k/+m/6j/uf/C/8r/0f/Y/97/5f/x//f/+v8AAAkABgAIAAcAAwALAAoAEQAdACgALAAmADEAPgA5AD0AQgBCAE8AUwBbAF8AYABWAEoASQBNAEMANQAtADUAPwBHAD8ALQAqACUAGgAOAPv/9f/s/+P/5f/h/9//2P/W/8//zv/V/9f/3v/V/9n/2//r//D/+P/7//b//P/8/wkACwAaACYAIgAeABUAFwAaABYAGAAcACMAHQAaABsAHAAmADAAKwAnACMAKgAvADEALwAlACkAHAAZACUANAA+AEAAQgA3ADcANgBDAEkATABSAFQARwBMAFUAVQBZAEsAQgA2ADwANwAwACkAIwAoACEAHgAXABUAGAAWABMA///9//L/4//m/9P/2f/f/+X/5v/Y/9H/xP/C/8n/1f/V/9T/1v/R/8v/yv/L/9H/4v/e/+L/5v/w//n/DAAVAB8AHAAaAB8AHgAnABoAGAAZABcAEwASABQADgAHAPr/9P/w//T/7//h/9z/1//j/9v/0v/R/9X/0//V/8//2//y//z/BQALABUAFAAfABsAGgAiAB8AKQA4AD8ATABTAFYAZQBiAGkAbABxAH8AgwCHAIMAfAB8AH8AfwCCAHsAeACCAHoAcQBnAFkAWABMAEMAQgAyACMAEwAFAP3/9P/n/+P/5v/m/+n/4v/S/87/w/+5/6z/p/+j/6T/ov+b/6b/uf/J/9D/yv/H/8r/zv/b/+f/6v/v//b/AgAOABUAJgAoADgASABWAFgAXQBuAHgAegBxAHEAaQBeAFsAVwBTAE0AQwAyAB4AHgAYAA0A+v/p/+f/7f/v/+r/7P/u/+f/2f/f/+v/7v/q/+D/3P/a/9n/1v/W/9f/0//E/7v/u/++/7n/s/+r/7L/tv+v/6r/r/+7/7v/s/+x/7n/wv/G/77/uf+1/7f/tf+4/8L/uv+y/6b/qP+q/7H/qP+m/6H/lv+S/5b/nv+i/5r/k/+c/6X/of+j/63/t/+8/7//x//K/8b/xf/H/8j/0v/X/9v/3f/V/8z/zP/N/8P/yv/S/9X/3f/d/9r/3f/W/9X/4f/f/+T/2f/W/9b/0v/N/8n/xP+9/7T/qP+k/6L/o/+Z/5D/gP97/3T/cP9r/23/c/9x/4D/hf+N/4//k/+V/5r/nP+a/5z/o/+x/7f/wv/I/9D/1v/d/+3/9P/y//j/BgAPAB8ALQAwADYASQBRAGAAbwB9AHwAdgB5AIUAhQCLAJQAmACVAIkAiwCGAJAAlQCUAJIAgwBzAHAAbgB0AHgAdQBwAGIAWQBYAFUAVgBOAE8AVABLAEQANwA2ADcAMQAnACIAIgAmACoALQA3ADwAOAA2AD0AQABHAEwATgBVAEwAPgBBAEwAVABaAFIAVwBcAGIAZQBmAGcAbAByAHAAcwB4AHcAeACAAIAAfQBwAGoAbgBvAHgAagBqAGgAZgBxAGwAdgBtAHMAcwBwAHcAdAB5AHkAdwB5AHQAeQB2AHUAgAB+AIUAiACIAIIAfgB4AHAAdgBpAFsAWABQAE8ARgBAAD0AOwA3ADMALgA4ADwAMQAmABcACAAGAP3//f/y/+b/4f/W/8v/wv+2/7P/tP+y/7D/s/+9/8j/0v/U/9P/1v/W/9r/3//o/+//8//6//r////7//b/5P/Z/9j/2P/i/9//1v/W/9L/y//F/77/wf/B/77/u//B/7z/s/+s/6P/p/+p/5z/j/+R/5L/k/+P/4v/hf95/3P/b/90/3H/cf9v/2//bv9o/2T/YP9m/2X/Xf9b/1//a/9u/3T/gv+H/5P/lP+T/5n/qv+z/7j/u/+9/73/uf+w/6n/qf+j/57/l/+H/3//df9w/23/Y/9W/0n/Rf9F/0b/Sf9O/0b/Rv9F/0X/RP88/zn/Nf85/zb/Nf85/z7/Qv9J/03/Xf9m/3P/d/98/4T/h/+Y/6T/sv+5/7b/vf/C/8X/xf/P/9v/6P/y//T/7//r/+//7v/u//L/+f///wwADAAOABIAGgAhACMAIgAjACQAIwAuADIAOQBAADcANQA1ADQAMAAvADAAOgBIAEsATABJAEkARgA9ADYANgAvACkAMAAwADUANAAwADgAPAA8ADYALQAzAC8AKgAtADUAQABDAEsAWQBoAHEAfACJAJEAlACQAJIAkgCNAIIAhQCGAIQAiACCAIUAhwCCAIEAfgB+AIMAgQB7AHwAdgBvAGYAWABPAEgARQBIAEcASQBJAEUARwBJAEkASgBMAEkAQQA6ADwAOwA5ADwAQgBJAFAAUQBVAF4AZgBsAHIAcAB1AIAAhQCMAIoAiACLAJEAngCdAJQAlACSAI4AjwCOAI4AiQCEAIgAiACEAH4AdgByAGMAUwBSAFoAZgBZAEgASwBNAEoANQAjAB0AHgAXAAUA/v/4//n//v/z//L/+f/4/+r/3P/W/8z/wv+4/7j/xv/O/8X/v//H/87/0P/S/9r/4//q//D/9P8BAAQAAgAGAAMA/v/5//f/+f8AAAEABwAQABIAFwAaAB4AIQApADEAOwBFAEwAVQBcAFwAXgBiAGIAXgBYAE4APAAqAB0AFQASAAsA+v/n/+L/4//i/9//4f/h/9n/0P/M/8z/v/+r/6P/m/+N/4L/ef9y/23/aP9g/1b/Uv9R/0r/Rv9D/z//N/85/zv/Mv8w/zT/Of86/z3/RP9J/0//W/9o/3D/f/+S/5z/oP+m/63/sv+2/7v/wf/O/97/5P/j/+T/6//x//f/+//8//3/9//u//H//P8CAAUACAAQABoAHgAcAB0AHwAlACMAHgAeABsAGQAWABYAEQAHAAQA9v/p/+P/3v/W/8z/xv/A/7r/uP+5/77/vv+6/7f/tv+3/7v/u/+7/7n/t/+5/7X/tf+8/8v/1P/V/9//5//v//f/9//6//v/+//9//n/8v/p/97/1f/T/9X/1v/T/8//zP/S/8//xf/C/8L/v/+9/7j/sf+w/67/r/+y/7b/vP/C/8b/xP/G/87/0//T/9b/3v/o/+//+f///wEAAgADAAgADwAbACUAKQApACgAKgAqACsALQAzADsANAArACcAJQAkACgALgAwADcAQQBGAEcASQBLAE4AVABhAGkAaQBmAGgAZgBiAGMAYgBhAGYAbQBxAHUAdQBuAGUAXgBYAFIATABHAD4ANQAoABwAFAAMAAUA///9/wIABgAGAAUABAACAP3/+P/2//T/8f/p/+L/5P/p/+7/8v/4/wEABwAKAA4ADwAOAA4AEQAVABUAFQAZABkAFQAPAAgA///3//L/6//o/+v/8v/3/wAACAAPABIAEwAUABQAFQAXABkAHgApADAALQArADAAOAA8AD8AQwBHAEcARAA/AD4AQgBHAEcAQgA+AD0ANgAtACkAKAAoACUAIgAjACAAHAAcAB4AIQAiACAAGwAVABIAEgAPAA0AEAAbACkALwAsACYAJQAgABgAEwALAAUA/v/2/+3/4f/V/8v/xv+7/6z/ov+b/5T/jf+H/4b/g/99/3j/dv93/3f/cf9u/27/bf9t/3X/hv+d/7T/y//i//X/CAAcACwAQABbAHEAeAB8AIUAigCHAIQAhwCIAIkAjACIAHwAdgBzAGoAXwBaAFMARwA9ADwAPAAyACUAGgAZABwAGgAZABgAGwAdAB0AGQAYAB4AJQAqAC0AMAArACMAIAAeAB8AIAAgACUAKQAoACMAGAAOAAgAAgD5/+//5//g/97/3f/W/87/zf/I/8D/uf+7/77/wv/H/8f/x//H/8X/w//G/8X/v/++/8f/z//Q/9P/2f/j/+f/5v/s//j/BAAMABAAFQAYAB0AJAAsADMANwA8ADoAOAA1ADUANQAvACcAIAAaAA0A/f/z/+3/6P/j/93/2P/Q/8T/uf+y/7D/tP+3/77/yv/T/9b/1f/R/9D/1P/Y/9b/z//M/87/yv/A/7z/wf/G/8X/wv/B/8L/xf/H/8X/wf/B/8D/vP+2/7X/s/+w/6f/nf+V/5D/jf+K/4P/gf+B/3//fP96/3j/c/9t/2j/Zv9l/2j/aP9q/2//cP9u/27/b/9v/2z/bP9w/3r/hv+P/57/sf+//8v/1//g/+z/+f8CAAcADQAVACAALAA4AEMASwBPAE8ASgBLAFMAVwBVAFAASgBEAD4AOAAvACQAGgASAAoABQAFAAQAAAAAAAAA/P/w/+b/5P/q/+z/5v/d/9X/0v/S/9L/1P/b/+H/5P/p//L/+f/9/wYADwAZACUAMAA1ADgAPAA/AD4AOQA0ADAALgApACQAJQAlACAAHwAfAB0AFwARAAoABgAEAP//+f/4/wQAFAAaABUAEAAbACwAOAA7AEEASgBVAFsAWABUAFEAVwBfAGUAaQBuAHoAggCJAI8AmgCqALoAwgC/AL4AwAC/AMAAxADHAMEAwwDKAM4AzgDKAMUAwwDGAMoAzQDPAM8AygC+ALQArwCsAKcAnwCWAJIAjgCGAH4AcgBrAGQAWQBPAEQAOgAzADMANgA3ADYANAAyACwAKAApACkAIgAdAB4AIAAhACAAHQAYABUAEwAOAAUA+//0/+v/4P/Y/9v/2//V/8r/vv+z/63/qf+k/53/lv+X/5v/ov+n/6j/qf+p/6f/oP+d/6H/o/+j/6j/tf/F/9T/4f/r//H/+P/9////AAACAAQACQANAA0ACwAJAAgABgADAP///f////n/8f/u/+7/7P/n/+D/0//H/7//tf+s/6j/p/+o/6b/pv+o/6z/tP+3/7D/qv+o/6T/mf+V/5v/pv+z/8D/yf/N/8//0v/U/9b/2v/c/9f/1v/a/93/3//i/+T/3f/L/7r/rP+d/47/fv9s/1z/Tv9D/z//Qf89/zf/Mf8o/yH/Hf8d/x//If8k/yr/MP8z/zr/Sf9Y/2P/cv+C/4r/kP+Y/5//pv+o/6j/s//A/8j/y//S/9r/3v/j/+n/7f/v//L/8//0//b/9v/0//j/AgAJAAwACwAIAAAA+//6//v//f/+//3//f8FAA8AEgARABMAGwAgACQAJwAmACsAMwA1ADUAOAA/AEcASwBRAFUAWABdAGMAbgB7AH0AegBzAGwAaQBmAGYAaABkAFsAVQBRAFEAUABKAEYARgBDAD4APQA6ADkAOwA+AD4APQA6ADkANgAxACwAJwAhABkADQADAP7//f/9//r/8//v/+//7v/u/+z/6P/o//H/+v8CAAoAEAAQAAsADgAUABYAGQAfACcALQA0ADIALQAqACwALwAyADAAKwAoACYAJgAiABoAFgAbACMAJgAkACQAIgAjACcAKwAoACQAIQAbABYAEwATABUAGgAdAB8AHAAXABYAGgAjACsALgAsACYAHQAWABEADQAHAAMAAQD9//n/+P/x/+n/4v/b/9T/y//J/8r/yf/I/8f/xf/G/8j/x//H/8X/w//C/8P/xv/J/9P/4f/s/+//8P/z//b/+f/6/wMABwAGAAcABwADAP////8CAAcADQARABMAGgAjACoAMAA2ADwAQAA+ADsAOAA1ADYAOgA7ADsAQgBMAFEAUQBPAE8AVQBgAGUAZABiAGUAZABeAFoAWQBWAFYAVgBTAFIAUABJAEEAOwA0ACsAKwAsACMAFQAQAAwACwAIAAUAAwAAAAAAAQAAAP7//f/3/+7/6P/i/97/2v/Y/9X/zP/G/8n/0P/P/8v/xv/B/7j/rf+o/6f/qv+2/8H/xP/C/8z/2v/h/+X/6v/t/+//9P/8/wIAAwD+//j/8//1//z/AwAEAAYADAASABcAGAAVAAwAAAD2/+X/1f/N/8j/wf/A/8T/wv/A/7//v/+8/7v/v//B/7//uP+1/7j/u//A/8j/0//e/+X/5//p/+7/9v/8/wEABgAJAA8AGwApADEAOAA/AEcASABCADgAMwA0ADQALgApACkAJAAdABkAGAATAA4ABgD8//b/8//u/+f/4P/Z/9L/zP/I/8X/w//D/8b/zf/N/8X/w//F/8X/w//B/7z/t/+z/7D/rf+n/6H/nf+f/6D/nf+a/5n/mP+V/5P/j/+I/37/d/93/37/g/+F/4f/if+M/4//k/+Y/6H/rf+8/8j/1//q//r/CgAbACcALgA2AEEASABSAGAAbgB5AH8AgQB9AHsAfAB6AHYAdABxAGgAYwBhAF8AYQBnAGcAZABjAGIAXQBUAEkAQQA5AC0AHwARAAcA/v/w/+L/2P/W/9v/3//i/+H/3//e/97/3f/a/9r/4P/n/+v/8f/3//j/+/8FABAAFgAeACkAMgA3ADcALgAnACQAIAAZABIADgAPAA4ACAACAP7/+f/2//H/7P/k/+H/3//X/8v/xf/E/8b/yf/L/8j/xv/L/8//0f/U/9j/3P/f/+T/6//u//L/+f/7//7/AwAJAAwACAAAAAAABQAKAA0AEQAWAB4AJQAoACYAJAAnADMAOQA3ADQANQA4ADQAKgAcABAABwADAAAA/v8AAAEA/v/3/+3/4v/c/9v/3P/g/+H/3f/V/9H/0v/Z/+D/5v/x//r//v8BAAYACgAKAAUAAgAEAAcACQATACMAMAA0ADkAPgBBAEIARQBIAEcASwBPAE0AQgA6ADoAOwA7AD0AQAA8ADYAMAApACUAJAAnACoAKgAoACkALQAvAC8AMgA2ADgAOQA8AD8AQAA9ADYALQAnACMAHwAfACIAIAAdABsAGwAfACcALQAuAC8ANAA0ADAALwAvACwAIgAXABAACwADAPr/9P/v/+r/6f/m/97/0f/H/77/s/+q/6v/sP+z/7X/uf++/8P/xP/H/8//2f/e/93/3f/c/9f/1v/b/+H/5v/s//D/8//5/wMADgAUABYAFgAVAA8ADAARABgAGwAYABQAEQASABYAFgAVABAACgAEAP///P/4//j/9v/y/+//7f/n/93/1P/K/7//sf+k/5r/k/+L/4H/d/9y/3P/df94/37/gf+C/4L/g/+F/4f/iP+J/43/kf+N/4f/hv+I/4n/iv+N/5P/n/+q/67/rv+s/6n/qP+r/6//s/+6/7z/v//E/8f/yP/G/8j/zP/R/9j/4v/v//j///8HABAAHQApAC8AMwA0ADIAKgAlACEAHAAXABgAHAAcABkAFQAMAAMA/P/1/+z/3//S/8r/xP+//7z/uf+8/8H/wf+8/7j/t/+6/8T/z//W/9v/4P/l//D//P8GAA8AGgAjACkAKwAsAC8ANgBBAEgATgBTAFwAZgBvAHgAhACSAJ0AoACfAKEAqgCuAK4ArQCnAJwAjwCEAHwAdQBtAGQAXQBYAFcAVwBXAFMASgBBAD0ANQAoAB4AGwAZABYAFAAUABUAFwAWABEADAAIAAcACAAOABMAGAAeACMAJgAoAC4ALgArACsALQAxADcAOwA8ADsAOQAzAC4AJgAhAB8AHwAcABgAFAAQABIAEwATABAACQAHAAoADgALAAUAAgACAAAA+v/1//b//v8HAAoACgALAAsADAAPABQAHwAvADsARABQAF8AcACAAIwAlACdAKcAtAC5ALgAuwDDAMUAvwC8AL0AvgC+ALsAugC5ALcAswCtAKUAmwCOAH4AbgBkAFoAUABDADgAMAAsACUAGgAQAAsACgAGAP7/8P/f/9H/w/+1/6T/mP+P/4P/dv9r/2H/Vf9P/0j/Qf83/y3/J/8q/zD/NP85/0H/Rf9J/1H/Vv9V/1P/Vf9a/2P/av9u/3H/d/94/3X/dP9y/3H/cP9w/3H/cP9y/3j/e/9+/4X/kf+h/6//vP/D/8n/zv/Q/9P/1f/Q/8r/xf/F/8T/wv/I/9L/3P/g/+T/6v/w//j/AwAQACIAMwA+AEUARQBFAEcAQwA8ADUAMwAvACMAFwAOAAkAAQD1/+f/2P/N/8L/uf+0/7H/rP+q/6r/r/+z/7f/uv+7/73/xP/K/87/y//D/73/wv/I/83/0f/V/9r/3v/j/+f/5v/f/9b/0P/R/9P/0P/M/8n/yP/I/8f/wf+8/7P/qv+h/5r/j/+G/4D/ff98/33/gP+D/4r/lf+b/6b/t//G/8//0//X/9j/3v/o//L/+P/9/wAAAgAKABQAIQAuADkAQABBAEEAQABBAEMAQwBBAEUATABTAFYAWQBbAFgAVwBUAFMAVwBcAGIAZQBkAGAAXgBeAGEAZQBtAHMAeACBAIYAjQCSAJMAkACOAIsAhAB5AHAAbABqAGgAYQBZAFMATwBQAFIAUwBVAFQAVABZAFwAXgBdAF4AYgBhAGAAXQBbAFoAVABMAEQAPAAzAC0AKQAmACUAJgArADEAMwAwACsAJgAlACkALAArACkALgA7AEsAXQBtAHgAfAB/AIEAhQCEAIIAgAB6AHcAfQCCAH8AegB2AHMAbgBlAF8AXwBjAGMAXgBaAFMASwBLAE4ASgBDADoAMAAoACEAGgAWABcAFgAUABIAEAAOABAADgADAPP/5P/a/87/xP++/7r/uf/A/8n/y//H/8D/u/+5/7T/rf+q/6j/pv+d/5H/gv9u/1z/UP9K/0f/SP9L/03/UP9V/1f/V/9W/1b/Wv9c/1//Y/9q/3b/hP+Q/6D/rv+4/8H/yP/Q/93/6P/v//H/8//2//f/9//2//L/8v/2//3/BAANABcAGgAeACYALwA5AEEASQBTAFsAXgBdAFsAVwBTAE8ATQBHAD8AOAAyACwAJwAfABMABQD9//X/6f/f/9n/1f/N/8T/vv+6/7P/pv+a/5P/kP+N/4f/fv93/3P/c/9y/27/Z/9h/17/Xv9g/2X/Zf9i/2P/a/98/4n/j/+X/6P/rf+0/7z/yP/V/9r/2//d/+D/4f/e/9j/1f/V/9T/0P/L/8v/z//U/9z/5v/x//j/+f/9/wUADQANAAsACAAKAAsADgAQABEAGAAdACMAKgAwADUANQAxAC4ALgAwADYAOwBAAEAAPwA/AEAAQgBFAEgASABHAEcATABTAFkAXQBfAF8AXQBaAFgAWABcAGEAYgBeAFkAVQBSAFAATwBSAFMAUABNAEoASwBRAFQAUgBOAEkAPwA0ACkAHwAYABAADAANABMAHgAkACcAKgApACkAJgAkACEAHgAXAA0ABQABAPv/7//m/+T/6P/r/+//8f/u/+r/6//v//j/+//5//r//f8HABEAFgAaABoAHgAmADAAOgBDAEgATQBRAFUAVgBWAE8AQgA5ADgAPgBCAEIARABHAEQAPgA8ADcAMAAsACUAGQAIAPf/6P/a/8z/wP+3/63/oP+X/5P/j/+N/4z/kP+W/5z/ov+n/6z/sf+6/8P/yf/P/9T/1v/Z/97/5//x//b/+/8CAAsAEwAWABkAGwAcABwAHQAgACAAGgAWABkAHQAcABcAFgAeACUAIwAWAAwACgAKAAQA+P/p/9//1//K/8D/u/+7/7T/q/+i/6D/p/+w/7f/u/++/7//vP+1/7L/uv/F/8v/0P/X/9//5P/q//T/+////wIADAAVABcAFgAZABkAFwASAAsABQABAAAA///7//H/6v/p/+v/5v/h/+D/4f/m/+b/5f/k/+T/4//h/97/3P/c/9n/1P/T/9T/2v/e/+X/6v/t//L/9f/5//v/+v/+/wMABwAKABAAFwAbACAAKAAvADIANQA1ADUANgA3ADYANQA2ADgAOwA7ADkANQAuACwAKwAsACwALQAoACAAGgAYABcAEgAJAAQABwAJAAQA///6//n/+P/3//r///8DAAQABAADAAEA/v8AAAQADAASABUAFgAcACIAJwAnACQAJgArADEANwA+AEUATQBQAFMAVgBbAF4AWwBZAFoAWABSAEsASQBLAEcAPQAzACkAHAASAAgA/f/1//T/8//u/+b/4f/h/+P/5f/l/9//1v/T/9T/0//R/9D/zf/K/8f/xP/A/7j/sf+r/6j/pP+k/6j/r/+z/7b/uP+4/7b/t/+7/8H/xP/B/8H/w//G/8f/yf/P/9T/2f/h/+b/6v/t//P/9//2//f/AAALAA8ADgAPABYAIQApADAANgA9AEIAQwBFAEcARQBAADoAOgA9AD8AOAAuACkAJwAmAB4AEQACAPn/8//x/+3/5P/b/9L/yP+9/7f/tP+0/7D/sP+1/7r/uf+4/7j/uv+9/7z/vf/E/8n/zf/K/8X/xP/E/8P/xP/L/9X/4P/q/+7/6//k/+H/3P/V/8z/w/+//77/u/+4/7j/vf/C/8L/xP/G/8b/x//D/8D/vv+9/77/xf/O/9T/1//Y/9n/3f/p/+//7f/o/+X/5v/n/+n/6P/p/+3/8f/3//v//f/8//7/AQD///v/8//u/+//9f/3//X/9P/3//r//P8BAAgAEAASABIAFQAdACoAMgAzADUAPABCAEYARwBGAEoAUgBaAGAAaABuAHMAdABrAGkAbABwAHUAegB6AHgAeAB3AG0AYwBfAGEAZgBoAG4AcwB7AIAAewBzAGoAYwBhAFwATwBFAEQASABMAE4AUABSAFMAWABdAFsAXQBpAG8AdQB6AHYAfwCEAHoAcgBsAGgAYwBbAFIATgBJAD4ANgA6ADcALgAiABwAJgAlABMACgAHABIAFQAEAP7/BAALABcAGAAVABYAFQATABIAFwAVAA8ACAD7/+7/3v/L/8X/wP+4/67/of+c/5j/iP+B/3//hf+O/47/iv+Q/5L/jf+Q/5f/mf+U/5D/lf+h/6b/n/+e/6j/sP+z/7X/uf/F/9r/4//m/+P/8P/9//3//f8AAA4AKQAlABQAEQAXAB8AFwD5/+r/+/8LAAQAAQAKAAcABQANAAkACAALAP3/+/8GAPr/6//h/+r//v/1/+D/0//P/9H/xP+9/7j/s/+4/6n/n/+i/5//n/+U/4j/hf96/3v/gP9y/2z/af9m/2j/av9i/1r/W/9k/2f/Zf9i/13/YP9e/2D/Z/9u/3X/eP93/3z/ff95/4P/jf+U/53/qv+1/73/vf+6/8P/1v/j/93/3f/5/xoAJAAFAOv/BQAkADIAHwD7/xIASAAzABcAJAAtAEQASQAtADwAWwBqAGAAYABoAGYAaAB/AIcAbwBXAHQAiwCGAIcAXwBcAKEAtAB9AGcAagB7ALQAggBWAHwAhACtAJIAUQBPAGoAkgB5AEcAPwBCAIgAhABKAFIAYwCOAIgAaAB0AEwATwBwAEwALgApACcALwAyAAgA3P/q/wMA8f/q//b/7//6/wsAEQACAOH/2//y/+//2//J/9L/7v8EAAYA7v/2/xsAMgAmABQAEAAIABEAJQAlABoAFwAhACMAJgAqABEAJQBLAEMALgAoAC8AMAA1AC4AHgAuAEUASABMAFIAXgBpAHIAigCHAHoAggCLAIsAiQCDAIMAgwB+AH4AgACLAJgAnQChAJcAiwB6AG8AagBgAFIASAA+ADoANgAlAAkA/f/+//X/5f/O/8D/tv+n/5T/ff9x/2b/V/9G/zX/Mv8y/yn/Jv8f/xb/FP8K/wX/A/8L/xX/H/8n/y7/MP8v/zf/Q/9X/2v/fP+K/5v/qf+s/6r/tP/J/9f/4f/s//7/DgAeACYAKQAuAC8AKgAtADAAMgAzADIANQAxACUAHgAcABMADgAHAP//+P/w/+f/5//m/+X/5v/k/9r/1P/W/9P/zv/E/7z/vP+2/7D/rP+n/6v/rf+s/6//uv+9/7f/uf+8/8L/zf/Z/+D/5v/n/+D/4//t//3/CwAIAAUACwAJAAEA//8EABIAHQAQAP3/BQAGAPv/8//s//f/CgAHAP7/CQARABUAEgAGAAoAEwAPAAoADAASAAwABQAAAAYADQD9//r/BAD+//r/8//6/wYAAgAMABAACwARABcAEwANAAsADgAXACEAHwAiACkAKAAyADoAOABCAFEASgBIAFEAVgBVAFMAVgBZAFgAWQBeAFsATQA+AEAAQwBFAEIANwA7AEQASABFAEsATgBPAFUAVABNAEIAQgA/AEUASwBCADUAJwAmAB0AFgAUAAkA///3/+n/4v/j/+T/6f/m/+T/5f/k/+z/7//u/+r/6//w//b/AAAEAAgACwADAPr/+//4//j///8JAA0AGQAZABIAJgAkAAoABQANAAkACwAkAC8ALwAtACkAFwABABEARgBGABoAFgAjAA4AGABCAGIAhwCcAJQAZQBQAFwAYQBwAIEAngCqAK4AqwCYAJgAoACaAJoAmQCQAJQAgAB0AG0AaABkAFQAVwBIADYAJAAYAA8A9v/B/8P/x/+t/5T/Z/9l/2T/S/9E/zv/Qf85/xT/Ev///vT+8/7p/vj+3f7o/v3+Dv8j/w3/Ef8i/yr/OP8w/zv/TP9k/2L/b/9r/2v/e/+D/3D/av96/5L/qf+5/6f/oP+x/8P/wP+s/7n/2//i/+j/5P/l/+n/4//u/+z/7P/j/+3/CAATAB0AFwAnAD4ARQBPAGUAeAB+AIMAhQCKAJIAmwCUAI4AlQCMAIMAigCNAIoAfQCDAIMAgwB7AG4AbQBrAF8ASgBCAD8AOgAsAC0ALAAgABIACwAGAP//9//6//z/9v/y//D/7v/m/+f/4f/W/83/wP+6/7z/yP/N/8j/yf/L/9L/4P/g/9v/1f/W/9H/0f/V/9L/1f/Y/+b/5v/c/93/4P/q//X///8HAAUABQABAP7/BAAFAAMAAQD8//v/AgALABAAEAANAA8ACgADAP3/AwATABoAHgAXABIAEwAYABwAHAAiACAAIgAjACAAHwAdACAAHwAdACMAJgAeACMAKAAmACwAJwAhACIALwBGAEgARwBGADoAOgBOAFgAWQBxAHQAKwCb/5b/8/8KADcAewC3AG8AOwBFABEA5//4/zIAIwAFACwAdwCxAGwABADN/9//8v/s/+//6P/4/wcAGQAGAOr/0v+u/5r/l/+9/8P/uv/I/9z/5//P/73/t/+t/6n/u//b/9n/1P/J/8r/3v/g/8T/kP97/5f/qP/K//v/FAARAAYAAgDw/+T/4P/m/+//8v8EAC4ATgA4ABIABgADAAIAAQAGAAoABwAIAAwAAgDz/+3/6f/k/+7/9v/4//3/AwAKAAUA+f/8/wMA+//3/wMAFQAYAA8ABQAGAAkABwD6/+z/6P/r/+7//P8GAAgADgAVABoAGgASABQAHQAbABkAGgAsADIAMAAyACgAIgAVABsAIwAmACkAJgArADAANwA0ACoALgA5ADwAPQBJAEwATQBLAEQASwBUAEwASABEAEMAPgA1ADwAPwBDAEQARABKAEwAUQBTAE0ARQBDAEEAPgA/AEQATABGADYAIAATAAYA9//t/97/0//H/7v/q/+Z/5D/kf+W/5f/mv+e/57/mP+R/47/i/+Q/5f/m/+c/5//ov+h/5r/kf+R/5D/lv+l/7H/s/+2/8T/yP/B/8H/xP/H/8T/wv/D/8P/xP++/7f/tv+1/7f/u//C/7//vv/H/8v/yf/G/8b/z//b/+D/5P/t//T/AwAVAB0AIQArADoARwBKAEwAVQBVAFcAWwBUAFgAYABkAGgAdQCDAIQAggCGAJIAnACgAKEAngCcAJoAlgCOAIMAeQB1AG8AXgBRAEYAOwArACEAFgADAO//5f/d/83/vv+3/7X/sP+o/6T/pP+g/5z/lv+U/5b/lf+X/5b/kv+P/5D/jv+O/5P/lP+V/53/ov+h/5f/mf+a/5r/lP+M/5D/lf+Z/5//pv+u/7f/vP+7/7n/xP/L/83/zf/O/87/z//R/9P/1v/R/9L/2P/d/+D/3P/Y/9n/3//q//T/AgANABUAGgAaACMAKQAxADUAMgAxADgAPQA/AEUASABNAFIAVABaAFUATABDADoANAAtAC0ALAAmABgACgAIAAsADQAQAB0AJQAjACEAKgAyADEAMAAxADkAQABJAFAAUQBGADwAOAA3ADcANgAzADEAMwA0AC4ALAAuACoAKgAnABsAEwAUABoAHwAgACYAKQAtACwAIwAlACoAMAAyAC0AKAAmACMAJAAjACUAJgAmACUAIgAgABwAGgAdABcAEgASABIADwAGAPz/9f/s/9j/x/++/7L/qf+k/5v/lv+Y/5T/k/+Q/4X/hf+I/5D/lv+f/6z/t//D/8r/0P/Y/9//5f/q/+//9v8BAAoAEQAdACsANQBFAEwATwBXAF8AXwBaAFAASgBQAFAAUQBUAFUAXQBeAF0AXgBgAGIAWABRAFEAUwBWAFIASAA6ADgAQQBLAEwATABJAEgARAA4ADMAKAApACQAFwAVAA8ADwALAAcA/f8EABQABAANAAsA+P/6/woAHwAaAAwAAwAAAAYABQD0/+D/7P/K/7z/xf/G/7v/of+j/6f/r/+h/6P/s/+//7//tf/C/8n/xv+6/7f/tf+u/6T/nf+l/5//kP+Q/5P/lv+g/6n/uf/H/8n/w//I/9j/4v/j/97/4v/s//j/AwARACQAJAAhACUAKgAlACkAKwAjACIAGQAUABUAEAAJAAAA/v/3/+//5//j/+L/5v/u//H/8P/t/+z/5v/n/+v/+P8HAAkACgAQABcAFQAYACAAFAASABAAFgAVAAcACwAJABAACQD9//f/8P/k/9r/3f/Z/9r/2P/V/9L/1f/a/9n/2v/Y/+L/3f/R/87/z//U/9j/3v/g/+r/6v/m/+D/2v/g/8v/3//v/+r/8P/b/93/zf+8/8P/tP+1/7b/uP+9/77/w//L/8z/v//G/9T/2//z/wgAAwACAPz/+P/1/9z/2P/W/9D/0//U/9b/2f/T/9X/4//g/93/5f/j/+r/7//z////BAAEAAUAAAD5/wYACwALAAwACgABAO7/+P/3//r///8DAA8AAwAHAAcAAAAIABAAGQAlADYAQwBSAFgAVwBhAGUAbwB8AI0AlwCbAJ8ApgCsAKgAqACmAKEAoQClAKwAsQCwAKUAogCaAIoAhQCEAIMAfAB1AGsAXQBNAD4AMAAnACcAIgAbABkAEgAKAAMA+//w/+T/3//g/+P/5f/p/+v/6P/e/9n/3f/h/+D/4P/i/+P/5//n/+b/6f/l/+P/5//o/+r/5//m/+3/9f8BAA0AGAAnAC0AMAA5AEEASQBMAEkAQQA4AC0AJQAjACUAIAAfACIAIAAhACAAGwATAAsABAD+//z/8//x/+//7f/o/+T/5P/n/+v/8f/3//j/+P/+/wYACwAHAAIA/f/3//H/7f/t/+r/4f/d/9n/2P/T/8z/yf/F/8b/xf+//7b/p/+c/5b/jf+I/4X/gP96/3f/cP9n/2D/Yf9e/13/Yv9l/2v/dP99/4n/lP+c/6j/sf++/83/2v/n//D//P8HAAwADAAOAA4ACwAUAB4AJQAoACcAIgAdABkAEgAIAAUABQACAP///v/7//n/+P/9//7////8//X/8//u/+j/4//d/9//4v/p//H/8f/4//7/AAD///7//P/7/wAAAAAAAAAAAQACAAMACQAMAAcAAwAEAAQABwALAAkADAAZACIAJgAnACgAKwAyADcANwA0ADAAMAA0ADcANAArAB8AGAASAA8ADQAKAAsACgAMAAwADgARABEAFQAVAA4ACwAOAA8ADgAQAA4ACgAGAP//9//u/+b/3v/V/9D/zv/L/8P/t/+n/5r/mf+W/5L/j/+P/5H/lv+X/5P/lv+Z/5z/oP+n/7X/w//P/9r/5P/x/wkAHgAuADkARABTAGAAawB0AH0AgwCEAIUAgQB9AHsAdABqAGIAYwBjAF8AXQBfAF0AVwBOAEcAQwBDAEMAQQA6AC8AKQAlACYALAAxADIANwA7AD0ARABOAFoAXgBfAF0AXABYAFIATwBKAEcAQQA4ACsAIAAWABIACgAAAPr//P/+/wIABgAGAAcACQAEAP3/9//2////BgAFAAMAAwACAAgACQACAPn/8P/q/+P/1//J/8L/vP+4/7r/v/+//77/vv++/7//v//A/73/vf++/7z/uP+2/7n/u/+5/7v/v//A/7//vP+7/7j/s/+4/8P/0f/W/9T/0v/V/9//7P/1//7/DQAgAC8ANQA6AD0APwBBAD4AOwA7ADwAPQA8ADoAPQBBAEEAPwA3ACoAIgAfABwAHAAfACIAKQAuADQANgA3ADQAKQAgAB8AJAAlACAAHQAcABsAGwAaABcAEQAIAP//+//3//f/+P/0/+3/4//b/9b/1P/Q/8r/xf/A/7n/sP+o/6H/mP+R/4n/hv+J/4n/iP+A/3X/bf9o/2X/Zf9m/2X/Zf9n/2r/bv9u/27/bv9x/3r/hf+N/5j/o/+o/6v/sP+2/7n/uP+1/7j/vv/I/9D/1f/X/9P/zv/H/8T/yP/W/+T/6//u//L/9P/1//X/+f8BAAwAGAAhACoANQBAAEgAUABWAFsAXgBfAGQAaQBwAHYAfwCFAIcAhAB9AHsAewB/AIAAgwCHAIYAfwB3AHMAcwBzAG4AYwBYAEwAQgA6ADMALgApACAAEwAIAP//9//t/+H/1v/O/8b/wP+9/77/w//J/8//1v/e/+j/8f/3//z/AQAHAAgACAALAAwABwAGAAcABAD///7/BwARABgAHQAfACEAIwAmACUAJQAqADIAOAA8AEEASABSAFwAZQBuAHYAeQB5AHcAcwB1AHkAfACDAIwAjQCKAIYAhACAAHwAeAB0AG8AZwBhAF4AXABYAFUAUwBSAE4ASQBEAEIAQAA7ADQALQAkABUABQD3/+n/2P/K/8H/vP+5/7T/rv+p/6j/pP+b/5P/jP+E/37/ff9+/4P/jP+Y/6j/uf/E/87/2P/j/+f/7P/0//3/AwAJAAsACwALAAUAAAD8//r/8f/o/97/1//V/9b/2P/X/87/xv/C/73/uP+0/7P/tP+3/7j/t/+2/7H/rv+n/6D/lv+L/4P/fP95/3r/fP99/4b/kf+b/6H/rP+7/83/3v/w/wUAFQAhAC4AOgBAAEEAPwA+AEEAQAA7ADUAMwAwACsAIAAVAAoAAQD2/+f/2//T/87/zv/T/9j/2P/Z/9v/2v/Y/9r/3f/i/+v/9v/+/wIABQAOABcAHQAhACcAKgArACoAKgAuADEAMwA1AD4ARgBOAFAAUQBSAFIAVABXAFwAYgBqAHQAegB2AGwAZQBhAF0AVgBNAEEAOAAvACUAHQAaABgAEgALAAUAAQD9//j/8v/q/+H/1f/K/8P/wf/C/8X/yf/I/8j/yv/R/9f/3f/i/+r/8v/3//j/8f/t/+3/9P/7//7/AQD///z/+v/5//j/+P/3//P/9f/7//7/+v/0/+3/5P/X/8r/wf++/77/vv/A/8P/zP/c/+z/9v/6//r/+v/3//b/8//z//f/9v/2//j/+v/8/wEABAAGAAsAEwAYABoAGQAWABkAIQAkACAAIAAmACwAMQAwACsAJgAgABoAEgAMAAYAAgAAAPz/9f/y//P/8v/x//f///8JABIAFwAZABsAGwAcABsAGgAZABUAEwASAA0ADQAOAAwABQABAAcADQAVAB0AHwAgAB4AGQAWABEADQALAAwADgAKAAMAAAAAAPn/7v/k/97/2P/T/9L/1P/T/8//z//O/9D/1P/a/9//3//b/9n/0//L/8X/xP/I/8f/xv/G/8n/z//R/9D/zf/M/9P/3f/k/+X/6P/w//f/+P/8/////v/3//T//P8JABMAFQANAAQA/P/2//H/6//q/+3/8v/1//j//f8CAAUABAAFAAkAEAAaACcAMAA1ADkAOgA7ADsAPAA/AEUAUABaAF4AZQBwAHQAbgBnAGMAYwBlAGcAYgBYAFEASwBBADIAIgAYABUAFQATAA4ABgD9//T/7v/n/97/1f/S/8//zv/Q/87/yP++/7L/qP+k/6X/qP+o/6j/qP+k/6D/nP+b/6D/pP+m/6j/rf+y/7T/sv+x/7T/uP++/8L/xP/I/8v/0P/X/9v/3v/k/+r/7f/u//H/8f/w/+7/6P/h/9b/z//M/8n/yf/K/87/1f/c/+X/9P8AAAwAGwAsAD0ATABdAG0AfQCQAKIArgC4AMYA0QDZANwA3gDgAOIA3wDbANkA1wDVANEAygDCALkAsACkAJYAjQCDAHQAZQBUAD4AJgAOAPn/5v/Z/9D/zf/F/7v/sv+t/6r/pP+h/6H/of+f/57/nP+Z/5b/lv+X/5X/kP+N/4//jP+G/4T/hP+A/3v/d/92/3f/ef9//4T/iv+V/6D/p/+r/7P/uv++/8P/yv/P/83/yf/G/8T/wP+//8P/yv/P/9T/1v/W/9P/0//R/87/zv/T/93/7P/7/wcADwAUABwAJwAxAD0ASABMAEoAQwA+ADsANwAyAC4ALQAvADMAOAA5ADYAOQBBAEUARABDAEAAOgAyACcAIAAXAA4ABwD+//T/7f/s/+7/6//l/+L/4f/f/9r/1v/W/9P/zf/H/8T/wv+7/7P/rf+q/6r/rf+y/7X/uP+7/77/vv+7/7r/vf/C/8H/wf/E/83/1v/c/+L/5f/n/+3/9v/8//3/AAAJABcAJwA0ADwAQgBEAEQARQBEAD8AOgA4ADsAQwBMAFAAVABYAFsAWwBZAFcAVgBUAFIAUABNAFAAVgBdAFoAVABPAEsARgBBAD8APgBAAEMARQBIAE0AUQBPAEsARwBFAEUAQwA/ADoAMwAqAB4AFgATABIAFgAcAB8AIgAjACAAHgAcABgAEwARAA8ADwAKAAYABgACAPr/8//t/+r/5f/i/+D/4v/i/+P/4v/d/9T/x/+8/7L/q/+n/6T/ov+d/5j/kf+Q/5L/lP+U/5X/mf+e/6L/pv+u/7f/v//F/8//1v/b/+D/6P/v//H/9P/5//3/AwAOABQAFwAaAB4AIgAhAB0AHQAhAB4AFwASABIAEwAVABkAHAAiACkALQAwADMANQAzADMAOQA9AD4APAA3ADMANQA9AEEAQwBBAD8APgA/AD0AOQA4ADoAPgBHAE4AUwBQAEoARwBGAEIAOwAyACgAHgASAAgA/v/1//D/7v/o/97/1//R/8r/v/+z/6f/n/+c/5b/j/+I/4P/fv95/3b/df96/4D/iv+V/57/pP+n/6n/rP+u/6z/p/+o/6//u//E/8r/0P/V/9//6//y//f/+v/+/wIABAAFAAcACgAOABQAFwAYABcAFQAWABkAGAAWABQAFgAZABsAGAAQAAkACAALABAAEAANAAkABwAFAAAA+P/0//f//v8EAAsAFgAdACEAJQAsADEAMwA1ADUAMgAvACsAKQAkAB8AGwASAAoABwAIAAoACAAGAAYABQAAAP7//f/7//j/9P/u/+j/5v/q//P//f8JABQAHQAeABQABwD///n/+f/5//b/8f/r/+j/5f/k/+X/5f/i/9//3f/g/+b/7P/w//P/7//q/+T/4P/f/+H/5P/n/+j/4//f/+P/6//z//v/BAAMABIAEwATABQAFQAQAAgAAgABAAUABwAHAAcABQD+//b/8v/x//D/7f/s/+3/6//r/+r/5v/e/9b/zf/E/77/vv++/8H/xf/M/9f/4v/t//X//P8GABUAIwAuADgARABOAFMAUgBSAFAATgBPAFIAVABVAFUAUABGADwANgA1ADIALQAqACcAJwAoACkAKwAsAC4ALwAuAC4ALgAsACYAIQAiACAAGAAQAAwADAAQABEADgALAAsAEQAUABEADgAOAAsABAD7//f/9v/4//f/8v/r/+X/3//d/9//5P/p/+z/8P/1//v/AQAKABAAFAAaAB4AIwAmACoALgAsACkAJQAiABsAEQAMAAcAAwD///r/9//z/+3/6//q/+7/9P/0//X/+P/6//v/+v/6//7/CAASABcAGgAaABwAIQAnACoALgAxADIAMAAoACEAGwAWABMAFQAaAB4AHgAYAA8ADAAPABIAEQAMAAYA///1/+z/4//Y/8//zv/N/8b/v/+8/7r/t/+2/63/pP+h/6j/r/+x/7H/tP+4/7r/tf+y/7L/tf+4/7n/v//G/8v/yv/E/73/uP+0/7H/r/+x/7T/uf++/8H/xv/O/9X/2P/Z/9n/3P/j/+n/7P/t/+//8//6/wUADQAVABoAHAAgABsAGAAYABYAFQARAAwABwAHAAwAEQAVABYAFwAZABwAIQAmADEANwA5ADcANAAwACwAJAAeABwAHQAgACMAJgAjAB0AGQAXABgAGQAYABcAFQAUABEAEgASABMAGAAeACUALgA4ADwAOgA2ADMAMAAsACsALAAvADEAMQAvACkAJQAlACcAKgAqACcAJwAlACAAGwAVAA4ACQAJAAwACgAFAP//+f/z/+3/7v/y//L/8//z//D/6//p/+v/7f/r/+r/6//u//L/8v/u/+j/3f/O/8H/s/+o/6H/pf+u/7L/tP+2/7j/tv+x/6//tP+9/8P/x//N/9X/3v/h/+L/5f/l/+P/4v/h/+D/3P/T/8z/xf/B/8P/yf/O/9P/2v/j/+r/7//0//7/BwAPABUAHAAgACAAIAAiACYAKAAoACkALQAyADcAPwBEAEIAPgA+AD8AOgAyACkAIQAdABgADQAGAAUACAAIAAQA/v/3/+7/4v/a/9P/z//N/87/z//N/8n/xv/D/8L/wv/G/9D/3P/m//L/+/8GAAwADQAQABEAEQARAA8ACgAIAAYABAAAAPr/9v/0/+z/4//b/9b/0v/N/8b/wP+5/7H/rf+r/6z/s/+9/8f/0f/a/97/4P/h/+D/4//m/+7/+/8IABIAHgAmADEAPQBFAEsAVABeAGcAbgBzAHkAggCMAJQAngCjAKQApgCpAKsAqgCiAJcAjACDAHwAcwBqAGEAWgBWAFYAVABSAEwASABGAEQAQQA8ADgAMwAxADAAMwAzACsAHwAbAB8AIwAhAB8AHwAeABoAFgATABEAEgATABUAGgAdAB0AHwAjACUAJQAhABsAFgAVABMACwAEAP//+f/v/+P/2//W/9L/z//O/9P/2f/c/+D/6f/y//b/8//t/+r/7P/w//T/9//1/+7/5//o/+j/5//n/+r/7v/1//v////+//r/8v/s/+j/5f/i/+P/5P/j/+H/3//g/+X/7f/3/wUAFgAiACgAJwAjACEAIgAkAB8AFgASABEADwAJAAIA+//2/+7/5v/e/9f/z//G/7//tf+q/5//mf+T/47/iP+E/4T/g/+A/3v/ev+A/4b/hv+D/4D/f/+B/4X/iP+N/5X/n/+k/6r/sf+2/7v/vv++/73/u/+7/73/wf/I/9D/1//b/+D/4//l/+T/4f/d/9j/0//N/8b/vP+z/6z/pP+a/5P/kP+U/5r/of+n/6//tv+//8T/yv/P/9L/1f/W/9X/1f/Z/+L/7v/5/wYAEwAgACoAMQA4AD4AQgBCAD8AOwA7AD8ARABLAFMAWwBmAHAAdwB6AHwAfAB5AHEAYwBTAEgAPwA0AC0ALAAqACcAIQAbABkAGAAYABUAEQALAAgABQAEAAgADQATABYAFwAWABYAFQARAA4ACwAJAAgABQAAAP3/+/8AAAUACgARABYAGAAaAB0AJwAzADwAPgA9ADkAMgAtACcAJAAlACQAJAAkACcAJgAiAB4AGQAYABkAHQAiACkALQAsACgAIgAiACQAJAAmACkALwA2ADsAPwBCAEQAQgA/ADwAOwA8AD4AQQBAAEIARQBFAEMAQABAAEEAPQAzACUAFwALAAEA+v/0/+7/5//f/9f/z//G/8H/vP+6/8D/yP/P/9X/2//h/+f/7v/2//j/9P/s/+b/6P/s//H/+P8AAAYACQAHAAAA+P/3//v/AAAIAAwADQAQABMAFAARAA0ADgAOAA8AFQAgACoALwAsAC0AMAAwAC4AKgAoACUAJgApACsAMgA4AEAASQBOAFQAWgBgAGMAZgBlAGQAYgBkAGkAcQB3AHcAcABnAF0AVgBOAEEANwAsACAAFQAOAAkAAgD7//H/5f/Y/83/xf+9/7P/rf+s/6z/q/+k/5r/jf+G/4H/ff9z/2z/av9t/2v/ZP9e/1z/WP9U/1H/Uv9W/1z/Yv9q/3P/dv94/3v/ff+D/4r/k/+b/6D/pf+p/6//t//A/8f/y//T/9z/6P/3/wUAEgAWABYAFwAWABUAFAAcACMAJgAeABQACwAHAAQAAgD+//3//v/6//D/5//l/+P/3v/Z/9P/0P/V/97/5P/m/+f/5P/f/93/3P/a/9P/zf/K/8r/yP/C/7z/t/+0/7b/vv/I/87/z//P/9H/1//c/+L/6v/v//T/9P/y/+3/6v/o/+n/5//j/93/3P/e/+D/4f/i/+b/6P/r//D/9P/9/wUAEAAcACEAJgAuADgAPwBCAEQARgBGAEUARABFAEkARgBAADoAMgAuACwAMgA1ADUAOABAAEUARgBDAEUASwBPAFIAUgBXAFwAXQBeAFsAWABbAF4AYwBrAHcAhACMAJEAkQCOAIsAhQCAAHwAdQBuAGgAYQBZAFEATgBOAEwARwBAADYALAAdAAwA///5//j/9//z/+3/5//g/97/4P/l/+j/6v/w//L/9f/4//n/+f/6//v//f/7//r/9//1//X/8v/x//H/8v/2//r//P/8//z/+P/x/+n/4//f/9z/2P/V/9L/z//N/8//0//U/9X/2f/e/+D/4v/n/+j/6f/r/+//9v/9/wMABwAKABIAHAAlACsALgAzADwARABEAEIAQgBDAEQARQBGAEkASQBDADsALwAfAA8ABAD7//H/6v/l/+X/5f/l/+b/5P/i/+T/5P/h/+H/5v/r/+v/6f/l/+D/2//U/8//z//R/8//zf/H/8P/wP+7/7b/sv+v/6n/ov+b/5f/kv+M/4j/hv+F/4f/if+J/4X/gv9+/37/gP+B/4L/gP+B/4j/jP+Q/5b/of+y/8P/zf/P/9H/1//b/9//4f/i/+f/7P/t//D/7v/r/+f/4f/f/97/3//i/+f/7f/x/+//6P/l/+j/8f/9/woAEgAdACoAMgA4AD4ASABQAFQAVgBcAGMAaABoAGMAXQBbAFoAVwBSAE4ATgBNAEsASABFADwALgAiABsAFAAJAP//9//x/+r/3//U/8//zv/M/8b/v/+8/7v/uv+6/7r/uP+4/7f/uP+5/7v/wP/G/8r/zv/S/9f/3P/e/+H/5P/m/+f/6f/y//z/AwAIAAsADgASABQAFQAUABQAFwAeACIAIAAaABcAFgATAAcA/v/+/wMABAADAAcACwAOABAAFAAZABoAGQAaABwAHAAYABYAGQAeACUALQA3AEYAVgBjAG4AeQCBAIkAkwCcAKAAnwCeAJ4AngCgAKIAoQCjAKQAoACbAJYAkwCPAIkAgQB2AGsAXwBTAE0ASQBEAEAAOgAxACgAIQAfACEAJAAkACIAHAAUAA0ACgAHAAcAAwD6/+//6P/g/9T/xv+7/7T/r/+w/7X/vf/E/87/3P/n/+//8f/0//n/AAAKABYAHAAeACIAJgAoACoALQAvADIANgA1ADMANQA4ADsAOQA2ADAAKgAnACQAIQAbABAACQAEAAMA///4//D/5v/c/9L/y//F/7//u/+2/7L/sP+y/7X/t/+2/7X/tf+1/7j/uP+1/7T/tf+3/7b/tP+0/7P/rv+p/6b/ov+g/6D/n/+k/6v/rf+q/6b/pv+p/6//tf+3/7b/s/+y/7H/sP+x/7X/tf+z/6//rv+u/6z/rf+r/6f/p/+n/6P/of+i/6D/nf+Y/5b/lv+b/6H/qP+y/7v/xP/L/9P/3f/q//f/AAAGAAkAFQAcABsAFwAUABYAEwAKAAMAAQAEAAUABgAFAAIA+//4//v/AQAGAAMA///9/wEABQAHAAkACwAOABcAHwAhACUALgA3AD0AQgBCAD0ANgAxACwAKAAoACUAIgAiACYAJgAeABgAEwAYABwAIgArADMAPwBCAEYASgBPAFMAVQBbAFkAVgBUAFIAUgBTAE4ATwBUAFMAUQBNAEwASQBAADMAKQAoACoAKwAmACIAHgAXAAwAAAD+/wMACQAJAAcACQAMAAsAAQD+/wUAEAAWABAACQAOABcAJQAvADQANAA8AEYASQBDAEEARgBKAEsASgBEAEIARgBMAFEATgBKAE8AVQBOAEUAQgBCAEAAMwAuADIANgAuACoAKgAmACIAFAANAAsAEAAOAAUA/f/2//j/7P/c/8r/v//B/7T/of+V/5f/pf+u/6L/jv+W/6f/qf+m/6P/q/+6/8X/wf+3/73/y//Y/9n/0P/O/9H/3v/Z/8j/yP/Q/+L/5v/d/+P/9f/8////8//n//L/AgAIAAEA9v///woAGAANAOj/4f/Y/+D/3v/F/77/s//E/8T/of+J/3T/jv+d/6D/jf9k/3n/n/+t/6X/ev9z/5D/q/+h/1X/O/9l/4T/nP+H/zf/X//R/9T/vv+t/4T/1P80ANz/mv/H/8f/6P8KALP/jv8JABIA2//f/7z/8P8lAOP/4f+x/+T/RgDd/9b/CQDo/z0ALgDX//H/IwA2AAoADgD8/wIAawD9/+b/KQDh/04ANQDp/zcALQBCADsAEAAWAAIAJAAOAAcAJgArAEgAPwBEAEYAIQBCADkAHwBEACQABQAjACMAAQACAPT/7/8UABYA8P/4/xIAGwAiABUA+v8RACsAFQD6//T///8eACYADgACABMAKwAvACUACQAMACkAKQARAAYADgAbABcAEgAFAAoAHAAmACcAIgAsADQANAA3AC0AMgBMAFQAVABYAGQAegCGAIMAhACKAIsAkQCKAIoAoAC9ALgAsQCtAKEAuAC/AIYAnACqAIoA0ACqAEsAYwCIAGMARQA8AB4ARwBsAAAA+v8tACsASgAAANv/LgAzACgAAAC//yEAPgAbAPT/8v9AAFAAVwAUAPf/ZwBOAD4AIADk/1kARQAcAB0A8/8XACQA8v/Q/7f/+P/n/9b/7P/7/wcAxP+h/97//f8hAMb/Xf+T//r/BwCs/0z/af/M/xAAtf9M/3D/4P8hAOD/cv93/8P/8//I/2X/T/+b/97/wf96/3X/q//l/9f/mv+l/9D/2f/L/6n/qf/E/9X/1//M/9b/5f/p/+b/1v/g/+n/1//X/9X/zv/K/8f/xv/A/7v/uP++/8n/0P/K/7r/uf/S/9j/u/+L/23/bf9w/2f/Yf95/6b/xP/A/63/r/+9/8T/0f/i//X/AwD8/+D/1f/m//X/9v/z//f/FQA3ADUAHwAXACEALQAsAB8AGgAtAC4AIwAQAP7/CgAXAAYA+v8DAA0AFAAeACIAKQAyACkAFwAJAP3/5//c/9v/1v/k//f/AwAPACcAPwA+ADQAOQBJAE4AOgAuADMAPQA5ACkAKQAyADMALgAmACQAJQAsADAAGwD1/+P/5f/a/9f/7v/z/wUAIQAUAAIA/f/7//n/8v/t/+z/9f/9//f/9f/v//H/7v/d/9f/0f/e/+r/6P/+/xYAGgAaACIAMgA7AEgAWgBtAHkAcwBrAHQAhQB8AHQAgACCAGkAYQBmAEwAOgBDAD0AQQBeAF0AUgBMAEMAOwA6ACkAFgAIAP//+//2/+//2P/R/8z/z//P/8P/uv+t/6f/qP+Y/43/k/+U/5//qf+r/6//v//J/9b/5v/w//D/7f/y//j/AQARABIACgAAAAcADgACAAQACgAZAB0ACgD6//T/+f/1//D/5v/a/9P/2P/W/83/0f/X/9n/5f/Z/83/y//E/8v/0//a/9z/7P/2//D/5v/m/+3/9v/r//D/8//t//X//P/2/+7/7v/q/+X/0//I/9L/2v/P/8v/z//N/7P/nf+e/5v/m/+Y/6H/rv+5/9T/5P/o/+f/5f/x//3/CwAcACIALQBBAFcAWABYAF0AYwBtAGwAZwBqAHoAggCKAIwAigCBAHsAcwBzAGkAYABeAFIASQBLAF4AagBkAF4AUwBNADYAIAAcAB4AFAAYACAAFQAUABkAGAAPAA4ABgD+//7//P/y/+v/4//l/+n/7v/o/93/6v/i/9D/zP/D/8H/vf+2/7P/sv+2/8H/tf+k/6H/nv+f/47/dP9u/3H/c/+D/4//jv+Q/53/r/+s/67/uf/C/9H/2f/R/9D/1v/h/+7//v8FAAwAEwATAAcA/f/y//n/CAATACAAIgAqACwAOwBHAEIAUQBYAGAAbwB6AIAAhACHAJAAkACGAHsAewCEAIQAiACFAHQAZgBZAFQAVgBSAEUAQwA8ACMAIwAbABEADgAMABgAEwAQAA4AAgAWACsAMgAaAAEA7//c/9r/zf/E/87/xP+2/77/wP/B/8L/vv+1/6v/sf+8/6//oP+m/6f/q/+e/43/j/+R/5f/lf+S/5L/jP+T/6D/mf+W/5L/iv9//4H/iv+W/6L/nv+q/6f/p/+7/8b/xf/Y//r/+P8KADEAOwBDAEUABgDX/7H/kf+m/9r/GABbAFwARAApAOz/yf/M/+f/7/8eAEoASgBiAHQAagBcACcABgDz/+3/HAAuAEMAPwBQAGUAeACRALsA3gAJAQkB3ACsAHgAVAA8ADwAHgD5/+T/z//N/7f/vv/P/9//AwAWACwAKgAlAB4AFgD3/7X/iv9l/0v/SP9K/2X/gf+e/8n/5f/3/w0ABAD6//r/4P/C/63/qP+s/63/tf+9/8n/2//0//n/AQAVABgAGQAeABkABADw/+P/6v/q/9b/yP++/8L/0f/Y/9z/7P8JABkAOABGAEUAPgAuACwABQDm/9T/0v/s/wMAEwAUAB0AIAAbABAAEgAkAEMAVwBeAF0AYABzAIUAkgCRAHgAawBRADkAIgAMABIAJQAyAEMAWQBrAHQAhgCSAIgAfgCBAHUAcgBlAEwAOQAiAA0A7v/R/8//2f/3/x0ANgBBAFMAaAB0AHQAawBfADkAFgD7//H/7f/n/+j/9/8EAA4AJwA7AFcAdQB7AGUAVQBHACkAAgDu/9//0P/K/8H/wv/H/73/s/+0/7P/rv+o/6H/r/+4/7f/qP+o/7L/rP+z/63/p/+y/7X/u//L/+j/AgArAFEAVwBdAGMAXQBjAGwAawBwAHUAgQB4AHgAcABoAGEAXgBXAE4ATgBRAFgAWgBSADsAJwAPAPT/4f/X/8f/t/+x/63/pf+e/5T/kf+c/6P/o/+n/6r/r/+3/7v/tP+p/53/mf+l/6n/pf+o/7H/rf+n/6z/rf+r/63/pf+e/5n/qP+n/6P/s/+9/7r/vP/A/7f/tv+4/8L/1P/U/9n/5f/o/+7/9P/2////DQAYACUANgAvADYAPgBAADwAMAA3AC4AHgAeABgAAwD3/wEA8f/l/+f/5v/Q/+n/CgAPAPj/u/+7/7j/i/9X/0j/S/9W/3P/m//Q//j//P8LABIA///z//T/2f/T//D/CgD1//L////7/97/6f8dADIAFgAKAC0AJADq/83/3P/E/43/ZP+i/7//ev9g/6n/7//o/+T/7f/k/8r/gf8j/wn/Df/2/tf+Av8p/yL/F/87/2b/e/+O/5f/uv/k/+L/4v8sAGYAcACBAKUAvwC7AKMAiQDYABEBHgE+AVkBFgHHAI4AdQBJANr/y//n/z0AmQDYABEBOgEzASMBAwH1AMsAtgCjAJEAbABaADkACwD5//P/AQAZAB4AGQAcABoAGQAKACIAPQASAN3/7P8QACAAEwAfADQAGAASAGEAlACNAGMAYwBmABwA0/+G/13/Lv/9/uf++P70/hn/EP8q/5r/+f8QAEAAfABWAAoA1P/X/7L/0P/6/0MAmwDDAKUAgACQAF0AMQBXAHkASwAmADkASgA1AC8ARgBbADgAbQCOAHYAfQBtAEIACwAKAPz/7/80ADAA9P/7/xEAEgAOABEADwDu/9T/HwA5AB8AGAD2/8v/i/+1/xsAKQBEADUAQABCAHMA4ADqAPIALQEXAQMB1ACsAMYAjgAqAC4AOAArAEgAGAB2AKwAUQBrAKIAMQAtAGYAOADZ/7n/yv+i/5r/zP+9/5b/g/9H/yn/9v7q/gH/yf7K/sj+3v4i/zD/J/8F/+f+8P7t/hH/cf94/4T/kf9n/z7/T/94/5P/Yf+C/8X/x/+Y/47/kf+b/7r/uP+n/63/wv/k//j/6f8gAD0AJwD6//H/BwD6//n/4v/V/9j/zP8DAAQADQAcAA0ADwBQAFMAZwApAPf/BgD3//r//P8DAP//AgAFAAkACQAFAAEA/v/7//n/+v/5//3/AAABAAIABgAHAAcABgAHAAkACAAHAAsACwALAA4ADgAOAA0ACwAJAAYAAwABAAAA//8AAAIAAgAEAAYABwAHAAgACAAHAAUAAwAAAP7//P/6//n/+f/4//j/+P/5//r//P/+/wAAAQACAAMAAwACAAEA///+//7//f/9////AQAGAAoADQASABUAFgAXABYAFAARAA4ACwAIAAUABAADAAMAAwADAAQABAAEAAMAAgAAAP7//P/6//j/9//2//T/9P/1//X/9f/1//b/9//5//v//f///wEAAgADAAQABAADAAMAAwACAAIAAwAEAAYACQALAA4AEAARABIAEQAPAA0ACQAHAAQAAQD///7//v//////AAABAAIAAgABAAEAAAD///7//f/8//z/+//7//z//P/9//3//v///wAAAQACAAQABAAEAAMAAwADAAIAAQABAAAAAAAAAAEAAQACAAQABAAFAAUABgAGAAUABQAFAAMAAwAEAAIAAgACAAIAAgABAAAAAAD///3//v/+//7//v///wEAAwAFAAQAAQD9//3//P///wEABAD6//3/BwACAAUA/P///wEA/f/9/wIA/v8FAAMAAAD///3/AQD+////AwACAP3/+f8BAAQAAgD///7/AQADAAEAAQAAAP//AwADAP///v8CAAIA///+/wAAAQAAAAAAAQAAAAAAAQAAAAAAAAA='; diff --git a/packages/ai/src/api.test.ts b/packages/ai/src/api.test.ts index 55d2eaa4ad3..65ecbbdcba8 100644 --- a/packages/ai/src/api.test.ts +++ b/packages/ai/src/api.test.ts @@ -16,7 +16,14 @@ */ import { ImagenModelParams, ModelParams, AIErrorCode } from './types'; import { AIError } from './errors'; -import { getAI, ImagenModel, getGenerativeModel, getImagenModel } from './api'; +import { + getAI, + ImagenModel, + LiveGenerativeModel, + getGenerativeModel, + getImagenModel, + getLiveGenerativeModel +} from './api'; import { expect } from 'chai'; import { AI } from './public-types'; import { GenerativeModel } from './models/generative-model'; @@ -216,4 +223,62 @@ describe('Top level API', () => { expect(genModel).to.be.an.instanceOf(ImagenModel); expect(genModel.model).to.equal('publishers/google/models/my-model'); }); + + it('getLiveGenerativeModel throws if no apiKey is provided', () => { + const fakeVertexNoApiKey = { + ...fakeAI, + app: { options: { projectId: 'my-project', appId: 'my-appid' } } + } as AI; + try { + getLiveGenerativeModel(fakeVertexNoApiKey, { model: 'my-model' }); + } catch (e) { + expect((e as AIError).code).includes(AIErrorCode.NO_API_KEY); + expect((e as AIError).message).equals( + `AI: The "apiKey" field is empty in the local ` + + `Firebase config. Firebase AI requires this field to` + + ` contain a valid API key. (${AI_TYPE}/${AIErrorCode.NO_API_KEY})` + ); + } + }); + it('getLiveGenerativeModel throws if no projectId is provided', () => { + const fakeVertexNoProject = { + ...fakeAI, + app: { options: { apiKey: 'my-key', appId: 'my-appid' } } + } as AI; + try { + getLiveGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); + } catch (e) { + expect((e as AIError).code).includes(AIErrorCode.NO_PROJECT_ID); + expect((e as AIError).message).equals( + `AI: The "projectId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid project ID. (${AI_TYPE}/${AIErrorCode.NO_PROJECT_ID})` + ); + } + }); + it('getLiveGenerativeModel throws if no appId is provided', () => { + const fakeVertexNoProject = { + ...fakeAI, + app: { options: { apiKey: 'my-key', projectId: 'my-project' } } + } as AI; + try { + getLiveGenerativeModel(fakeVertexNoProject, { model: 'my-model' }); + } catch (e) { + expect((e as AIError).code).includes(AIErrorCode.NO_APP_ID); + expect((e as AIError).message).equals( + `AI: The "appId" field is empty in the local` + + ` Firebase config. Firebase AI requires this field ` + + `to contain a valid app ID. (${AI_TYPE}/${AIErrorCode.NO_APP_ID})` + ); + } + }); + it('getLiveGenerativeModel gets a LiveGenerativeModel', () => { + const liveGenerativeModel = getLiveGenerativeModel(fakeAI, { + model: 'my-model' + }); + expect(liveGenerativeModel).to.be.an.instanceOf(LiveGenerativeModel); + expect(liveGenerativeModel.model).to.equal( + 'publishers/google/models/my-model' + ); + }); }); diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index 2cb8e670277..fc789f303a4 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -26,18 +26,31 @@ import { HybridParams, ModelParams, RequestOptions, - AIErrorCode + AIErrorCode, + LiveModelParams } from './types'; import { AIError } from './errors'; -import { AIModel, GenerativeModel, ImagenModel } from './models'; +import { + AIModel, + GenerativeModel, + LiveGenerativeModel, + ImagenModel +} from './models'; import { encodeInstanceIdentifier } from './helpers'; import { GoogleAIBackend } from './backend'; +import { WebSocketHandlerImpl } from './websocket'; export { ChatSession } from './methods/chat-session'; +export { LiveSession } from './methods/live-session'; export * from './requests/schema-builder'; export { ImagenImageFormat } from './requests/imagen-image-format'; -export { AIModel, GenerativeModel, ImagenModel, AIError }; +export { AIModel, GenerativeModel, LiveGenerativeModel, ImagenModel, AIError }; export { Backend, VertexAIBackend, GoogleAIBackend } from './backend'; +export { + startAudioConversation, + AudioConversationController, + StartAudioConversationOptions +} from './methods/live-session-helpers'; declare module '@firebase/component' { interface NameServiceMapping { @@ -163,3 +176,29 @@ export function getImagenModel( } return new ImagenModel(ai, modelParams, requestOptions); } + +/** + * Returns a {@link LiveGenerativeModel} class for real-time, bidirectional communication. + * + * The Live API is only supported in modern browser windows and Node >= 22. + * + * @param ai - An {@link AI} instance. + * @param modelParams - Parameters to use when setting up a {@link LiveSession}. + * @throws If the `apiKey` or `projectId` fields are missing in your + * Firebase config. + * + * @beta + */ +export function getLiveGenerativeModel( + ai: AI, + modelParams: LiveModelParams +): LiveGenerativeModel { + if (!modelParams.model) { + throw new AIError( + AIErrorCode.NO_MODEL, + `Must provide a model name for getLiveGenerativeModel. Example: getLiveGenerativeModel(ai, { model: 'my-model-name' })` + ); + } + const webSocketHandler = new WebSocketHandlerImpl(); + return new LiveGenerativeModel(ai, modelParams, webSocketHandler); +} diff --git a/packages/ai/src/constants.ts b/packages/ai/src/constants.ts index b6bd8e220ad..82482527f3b 100644 --- a/packages/ai/src/constants.ts +++ b/packages/ai/src/constants.ts @@ -21,7 +21,7 @@ export const AI_TYPE = 'AI'; export const DEFAULT_LOCATION = 'us-central1'; -export const DEFAULT_BASE_URL = 'https://firebasevertexai.googleapis.com'; +export const DEFAULT_DOMAIN = 'firebasevertexai.googleapis.com'; export const DEFAULT_API_VERSION = 'v1beta'; diff --git a/packages/ai/src/methods/live-session-helpers.test.ts b/packages/ai/src/methods/live-session-helpers.test.ts new file mode 100644 index 00000000000..d7d1e2aabbf --- /dev/null +++ b/packages/ai/src/methods/live-session-helpers.test.ts @@ -0,0 +1,356 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import sinon, { SinonFakeTimers, SinonStub, SinonStubbedInstance } from 'sinon'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { AIError } from '../errors'; +import { startAudioConversation } from './live-session-helpers'; +import { LiveServerContent, LiveServerToolCall, Part } from '../types'; +import { logger } from '../logger'; +import { isNode } from '@firebase/util'; + +use(sinonChai); +use(chaiAsPromised); + +// A mock message generator to simulate receiving messages from the server. +class MockMessageGenerator { + private resolvers: Array<(result: IteratorResult) => void> = []; + isDone = false; + + next(): Promise> { + return new Promise(resolve => this.resolvers.push(resolve)); + } + + simulateMessage(message: any): void { + const resolver = this.resolvers.shift(); + if (resolver) { + resolver({ value: message, done: false }); + } + } + + endStream(): void { + if (this.isDone) { + return; + } + this.isDone = true; + this.resolvers.forEach(resolve => + resolve({ value: undefined, done: true }) + ); + this.resolvers = []; + } +} + +// A mock LiveSession to intercept calls to the server. +class MockLiveSession { + isClosed = false; + inConversation = false; + send = sinon.stub(); + sendMediaChunks = sinon.stub(); + messageGenerator = new MockMessageGenerator(); + receive = (): MockMessageGenerator => this.messageGenerator; +} + +// Stubs and mocks for Web APIs used by the helpers. +let mockAudioContext: SinonStubbedInstance; +let mockMediaStream: SinonStubbedInstance; +let getUserMediaStub: SinonStub; +let mockWorkletNode: SinonStubbedInstance; +let mockSourceNode: SinonStubbedInstance; +let mockAudioBufferSource: any; + +function setupGlobalMocks(): void { + // Mock AudioWorkletNode + mockWorkletNode = { + port: { + postMessage: sinon.stub(), + onmessage: null + }, + connect: sinon.stub(), + disconnect: sinon.stub() + } as any; + sinon.stub(global, 'AudioWorkletNode').returns(mockWorkletNode); + + // Mock AudioContext + mockAudioBufferSource = { + connect: sinon.stub(), + start: sinon.stub(), + stop: sinon.stub(), + onended: null, + buffer: { duration: 0.5 } // Mock duration for scheduling + }; + mockSourceNode = { + connect: sinon.stub(), + disconnect: sinon.stub() + } as any; + mockAudioContext = { + resume: sinon.stub().resolves(), + close: sinon.stub().resolves(), + createBuffer: sinon.stub().returns({ + getChannelData: sinon.stub().returns(new Float32Array(1)) + } as any), + createBufferSource: sinon.stub().returns(mockAudioBufferSource), + createMediaStreamSource: sinon.stub().returns(mockSourceNode), + audioWorklet: { + addModule: sinon.stub().resolves() + }, + state: 'suspended' as AudioContextState, + currentTime: 0 + } as any; + sinon.stub(global, 'AudioContext').returns(mockAudioContext); + + // Mock other globals + sinon.stub(global, 'Blob').returns({} as Blob); + sinon.stub(URL, 'createObjectURL').returns('blob:http://localhost/fake-url'); + + // Mock getUserMedia + mockMediaStream = { + getTracks: sinon.stub().returns([{ stop: sinon.stub() } as any]) + } as any; + getUserMediaStub = sinon.stub().resolves(mockMediaStream); + if (typeof navigator === 'undefined') { + (global as any).navigator = { + mediaDevices: { getUserMedia: getUserMediaStub } + }; + } else { + if (!navigator.mediaDevices) { + (navigator as any).mediaDevices = {}; + } + sinon + .stub(navigator.mediaDevices, 'getUserMedia') + .callsFake(getUserMediaStub); + } +} + +describe('Audio Conversation Helpers', () => { + let clock: SinonFakeTimers; + + if (isNode()) { + return; + } + + beforeEach(() => { + clock = sinon.useFakeTimers(); + setupGlobalMocks(); + }); + + afterEach(() => { + sinon.restore(); + clock.restore(); + }); + + describe('startAudioConversation', () => { + let liveSession: MockLiveSession; + beforeEach(() => { + liveSession = new MockLiveSession(); + }); + + it('should throw if the session is closed.', async () => { + liveSession.isClosed = true; + await expect( + startAudioConversation(liveSession as any) + ).to.be.rejectedWith(AIError, /on a closed LiveSession/); + }); + + it('should throw if a conversation is in progress.', async () => { + liveSession.inConversation = true; + await expect( + startAudioConversation(liveSession as any) + ).to.be.rejectedWith(AIError, /is already in progress/); + }); + + it('should throw if APIs are not supported.', async () => { + (global as any).AudioWorkletNode = undefined; // Simulate lack of support + await expect( + startAudioConversation(liveSession as any) + ).to.be.rejectedWith(AIError, /not supported in this environment/); + }); + + it('should throw if microphone permissions are denied.', async () => { + getUserMediaStub.rejects( + new DOMException('Permission denied', 'NotAllowedError') + ); + await expect( + startAudioConversation(liveSession as any) + ).to.be.rejectedWith(DOMException, /Permission denied/); + }); + + it('should return a controller with a stop method on success.', async () => { + const controller = await startAudioConversation(liveSession as any); + expect(controller).to.have.property('stop').that.is.a('function'); + // Ensure it doesn't throw during cleanup + await expect(controller.stop()).to.be.fulfilled; + }); + }); + + describe('AudioConversationRunner', () => { + let liveSession: MockLiveSession; + let warnStub: SinonStub; + + beforeEach(() => { + liveSession = new MockLiveSession(); + warnStub = sinon.stub(logger, 'warn'); + }); + + afterEach(() => { + warnStub.restore(); + }); + + it('should send processed audio chunks received from the worklet.', async () => { + const controller = await startAudioConversation(liveSession as any); + expect(mockWorkletNode.port.onmessage).to.be.a('function'); + + // Simulate the worklet sending a message + const fakeAudioData = new Int16Array(128); + mockWorkletNode.port.onmessage!({ data: fakeAudioData } as MessageEvent); + + await clock.tickAsync(1); + + expect(liveSession.sendMediaChunks).to.have.been.calledOnce; + const [sentChunk] = liveSession.sendMediaChunks.getCall(0).args[0]; + expect(sentChunk.mimeType).to.equal('audio/pcm'); + expect(sentChunk.data).to.be.a('string'); + await controller.stop(); + }); + + it('should queue and play audio from a serverContent message.', async () => { + const controller = await startAudioConversation(liveSession as any); + const serverMessage: LiveServerContent = { + type: 'serverContent', + modelTurn: { + role: 'model', + parts: [ + { inlineData: { mimeType: 'audio/pcm', data: '1111222233334444' } } + ] // base64 for dummy data + } + }; + + liveSession.messageGenerator.simulateMessage(serverMessage); + await clock.tickAsync(1); // allow message processing + + expect(mockAudioContext.createBuffer).to.have.been.calledOnce; + expect(mockAudioBufferSource.start).to.have.been.calledOnce; + await controller.stop(); + }); + + it('should call function handler and send result on toolCall message.', async () => { + const handlerStub = sinon.stub().resolves({ + functionResponse: { name: 'get_weather', response: { temp: '72F' } } + } as Part); + const controller = await startAudioConversation(liveSession as any, { + functionCallingHandler: handlerStub + }); + + const toolCallMessage: LiveServerToolCall = { + type: 'toolCall', + functionCalls: [{ name: 'get_weather', args: { location: 'LA' } }] + }; + + liveSession.messageGenerator.simulateMessage(toolCallMessage); + await clock.tickAsync(1); + + expect(handlerStub).to.have.been.calledOnceWith( + toolCallMessage.functionCalls + ); + expect(liveSession.send).to.have.been.calledOnceWith([ + { functionResponse: { name: 'get_weather', response: { temp: '72F' } } } + ]); + await controller.stop(); + }); + + it('should clear queue and stop sources on an interruption message.', async () => { + const controller = await startAudioConversation(liveSession as any); + + // 1. Enqueue some audio that is "playing" + const playingMessage: LiveServerContent = { + type: 'serverContent', + modelTurn: { + parts: [ + { inlineData: { mimeType: 'audio/pcm', data: '1111222233334444' } } + ], + role: 'model' + } + }; + liveSession.messageGenerator.simulateMessage(playingMessage); + await clock.tickAsync(1); + expect(mockAudioBufferSource.start).to.have.been.calledOnce; + + // 2. Enqueue another chunk that is now scheduled + liveSession.messageGenerator.simulateMessage(playingMessage); + await clock.tickAsync(1); + expect(mockAudioBufferSource.start).to.have.been.calledTwice; + + // 3. Send interruption message + const interruptionMessage: LiveServerContent = { + type: 'serverContent', + interrupted: true + }; + liveSession.messageGenerator.simulateMessage(interruptionMessage); + await clock.tickAsync(1); + + // Assert that all scheduled sources were stopped. + expect(mockAudioBufferSource.stop).to.have.been.calledTwice; + + // 4. Send new audio post-interruption + const newMessage: LiveServerContent = { + type: 'serverContent', + modelTurn: { + parts: [ + { inlineData: { mimeType: 'audio/pcm', data: '1111222233334444' } } + ], + role: 'model' + } + }; + liveSession.messageGenerator.simulateMessage(newMessage); + await clock.tickAsync(1); + + // Assert a new source was created and started (total of 3 starts) + expect(mockAudioBufferSource.start).to.have.been.calledThrice; + + await controller.stop(); + }); + + it('should warn if no function handler is provided for a toolCall message.', async () => { + const controller = await startAudioConversation(liveSession as any); + liveSession.messageGenerator.simulateMessage({ + type: 'toolCall', + functionCalls: [{ name: 'test' }] + }); + await clock.tickAsync(1); + + expect(warnStub).to.have.been.calledWithMatch( + /functionCallingHandler is undefined/ + ); + await controller.stop(); + }); + + it('stop() should call cleanup and release all resources.', async () => { + const controller = await startAudioConversation(liveSession as any); + + // Need to spy on the internal runner's cleanup method. This is a bit tricky. + // We can't do it directly. Instead, we'll just check the mock results. + await controller.stop(); + + expect(mockWorkletNode.disconnect).to.have.been.calledOnce; + expect(mockSourceNode.disconnect).to.have.been.calledOnce; + expect(mockMediaStream.getTracks()[0].stop).to.have.been.calledOnce; + expect(mockAudioContext.close).to.have.been.calledOnce; + expect(liveSession.inConversation).to.be.false; + }); + }); +}); diff --git a/packages/ai/src/methods/live-session-helpers.ts b/packages/ai/src/methods/live-session-helpers.ts new file mode 100644 index 00000000000..e52715de36e --- /dev/null +++ b/packages/ai/src/methods/live-session-helpers.ts @@ -0,0 +1,497 @@ +/** + * @license + * Copyright 2025 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 { AIError } from '../errors'; +import { logger } from '../logger'; +import { + AIErrorCode, + GenerativeContentBlob, + LiveServerContent, + LiveServerToolCall, + Part +} from '../types'; +import { LiveSession } from './live-session'; +import { Deferred } from '@firebase/util'; + +const SERVER_INPUT_SAMPLE_RATE = 16_000; +const SERVER_OUTPUT_SAMPLE_RATE = 24_000; + +const AUDIO_PROCESSOR_NAME = 'audio-processor'; + +/** + * The JS for an `AudioWorkletProcessor`. + * This processor is responsible for taking raw audio from the microphone, + * converting it to the required 16-bit 16kHz PCM, and posting it back to the main thread. + * + * See: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor + * + * It is defined as a string here so that it can be converted into a `Blob` + * and loaded at runtime. + */ +const audioProcessorWorkletString = ` + class AudioProcessor extends AudioWorkletProcessor { + constructor(options) { + super(); + this.targetSampleRate = options.processorOptions.targetSampleRate; + // 'sampleRate' is a global variable available inside the AudioWorkletGlobalScope, + // representing the native sample rate of the AudioContext. + this.inputSampleRate = sampleRate; + } + + /** + * This method is called by the browser's audio engine for each block of audio data. + * Input is a single input, with a single channel (input[0][0]). + */ + process(inputs) { + const input = inputs[0]; + if (input && input.length > 0 && input[0].length > 0) { + const pcmData = input[0]; // Float32Array of raw audio samples. + + // Simple linear interpolation for resampling. + const resampled = new Float32Array(Math.round(pcmData.length * this.targetSampleRate / this.inputSampleRate)); + const ratio = pcmData.length / resampled.length; + for (let i = 0; i < resampled.length; i++) { + resampled[i] = pcmData[Math.floor(i * ratio)]; + } + + // Convert Float32 (-1, 1) samples to Int16 (-32768, 32767) + const resampledInt16 = new Int16Array(resampled.length); + for (let i = 0; i < resampled.length; i++) { + const sample = Math.max(-1, Math.min(1, resampled[i])); + if (sample < 0) { + resampledInt16[i] = sample * 32768; + } else { + resampledInt16[i] = sample * 32767; + } + } + + this.port.postMessage(resampledInt16); + } + // Return true to keep the processor alive and processing the next audio block. + return true; + } + } + + // Register the processor with a name that can be used to instantiate it from the main thread. + registerProcessor('${AUDIO_PROCESSOR_NAME}', AudioProcessor); +`; + +/** + * A controller for managing an active audio conversation. + * + * @beta + */ +export interface AudioConversationController { + /** + * Stops the audio conversation, closes the microphone connection, and + * cleans up resources. Returns a promise that resolves when cleanup is complete. + */ + stop: () => Promise; +} + +/** + * Options for {@link startAudioConversation}. + * + * @beta + */ +export interface StartAudioConversationOptions { + /** + * An async handler that is called when the model requests a function to be executed. + * The handler should perform the function call and return the result as a `Part`, + * which will then be sent back to the model. + */ + functionCallingHandler?: ( + functionCalls: LiveServerToolCall['functionCalls'] + ) => Promise; +} + +/** + * Dependencies needed by the {@link AudioConversationRunner}. + * + * @internal + */ +interface RunnerDependencies { + audioContext: AudioContext; + mediaStream: MediaStream; + sourceNode: MediaStreamAudioSourceNode; + workletNode: AudioWorkletNode; +} + +/** + * Encapsulates the core logic of an audio conversation. + * + * @internal + */ +export class AudioConversationRunner { + /** A flag to indicate if the conversation has been stopped. */ + private isStopped = false; + /** A deferred that contains a promise that is resolved when stop() is called, to unblock the receive loop. */ + private readonly stopDeferred = new Deferred(); + /** A promise that tracks the lifecycle of the main `runReceiveLoop`. */ + private readonly receiveLoopPromise: Promise; + + /** A FIFO queue of 24kHz, 16-bit PCM audio chunks received from the server. */ + private readonly playbackQueue: ArrayBuffer[] = []; + /** Tracks scheduled audio sources. Used to cancel scheduled audio when the model is interrupted. */ + private scheduledSources: AudioBufferSourceNode[] = []; + /** A high-precision timeline pointer for scheduling gapless audio playback. */ + private nextStartTime = 0; + /** A mutex to prevent the playback processing loop from running multiple times concurrently. */ + private isPlaybackLoopRunning = false; + + constructor( + private readonly liveSession: LiveSession, + private readonly options: StartAudioConversationOptions, + private readonly deps: RunnerDependencies + ) { + this.liveSession.inConversation = true; + + // Start listening for messages from the server. + this.receiveLoopPromise = this.runReceiveLoop().finally(() => + this.cleanup() + ); + + // Set up the handler for receiving processed audio data from the worklet. + // Message data has been resampled to 16kHz 16-bit PCM. + this.deps.workletNode.port.onmessage = event => { + if (this.isStopped) { + return; + } + + const pcm16 = event.data as Int16Array; + const base64 = btoa( + String.fromCharCode.apply( + null, + Array.from(new Uint8Array(pcm16.buffer)) + ) + ); + + const chunk: GenerativeContentBlob = { + mimeType: 'audio/pcm', + data: base64 + }; + void this.liveSession.sendMediaChunks([chunk]); + }; + } + + /** + * Stops the conversation and unblocks the main receive loop. + */ + async stop(): Promise { + if (this.isStopped) { + return; + } + this.isStopped = true; + this.stopDeferred.resolve(); // Unblock the receive loop + await this.receiveLoopPromise; // Wait for the loop and cleanup to finish + } + + /** + * Cleans up all audio resources (nodes, stream tracks, context) and marks the + * session as no longer in a conversation. + */ + private cleanup(): void { + this.interruptPlayback(); // Ensure all audio is stopped on final cleanup. + this.deps.workletNode.port.onmessage = null; + this.deps.workletNode.disconnect(); + this.deps.sourceNode.disconnect(); + this.deps.mediaStream.getTracks().forEach(track => track.stop()); + if (this.deps.audioContext.state !== 'closed') { + void this.deps.audioContext.close(); + } + this.liveSession.inConversation = false; + } + + /** + * Adds audio data to the queue and ensures the playback loop is running. + */ + private enqueueAndPlay(audioData: ArrayBuffer): void { + this.playbackQueue.push(audioData); + // Will no-op if it's already running. + void this.processPlaybackQueue(); + } + + /** + * Stops all current and pending audio playback and clears the queue. This is + * called when the server indicates the model's speech was interrupted with + * `LiveServerContent.modelTurn.interrupted`. + */ + private interruptPlayback(): void { + // Stop all sources that have been scheduled. The onended event will fire for each, + // which will clean up the scheduledSources array. + [...this.scheduledSources].forEach(source => source.stop(0)); + + // Clear the internal buffer of unprocessed audio chunks. + this.playbackQueue.length = 0; + + // Reset the playback clock to start fresh. + this.nextStartTime = this.deps.audioContext.currentTime; + } + + /** + * Processes the playback queue in a loop, scheduling each chunk in a gapless sequence. + */ + private async processPlaybackQueue(): Promise { + if (this.isPlaybackLoopRunning) { + return; + } + this.isPlaybackLoopRunning = true; + + while (this.playbackQueue.length > 0 && !this.isStopped) { + const pcmRawBuffer = this.playbackQueue.shift()!; + try { + const pcm16 = new Int16Array(pcmRawBuffer); + const frameCount = pcm16.length; + + const audioBuffer = this.deps.audioContext.createBuffer( + 1, + frameCount, + SERVER_OUTPUT_SAMPLE_RATE + ); + + // Convert 16-bit PCM to 32-bit PCM, required by the Web Audio API. + const channelData = audioBuffer.getChannelData(0); + for (let i = 0; i < frameCount; i++) { + channelData[i] = pcm16[i] / 32768; // Normalize to Float32 range [-1.0, 1.0] + } + + const source = this.deps.audioContext.createBufferSource(); + source.buffer = audioBuffer; + source.connect(this.deps.audioContext.destination); + + // Track the source and set up a handler to remove it from tracking when it finishes. + this.scheduledSources.push(source); + source.onended = () => { + this.scheduledSources = this.scheduledSources.filter( + s => s !== source + ); + }; + + // To prevent gaps, schedule the next chunk to start either now (if we're catching up) + // or exactly when the previous chunk is scheduled to end. + this.nextStartTime = Math.max( + this.deps.audioContext.currentTime, + this.nextStartTime + ); + source.start(this.nextStartTime); + + // Update the schedule for the *next* chunk. + this.nextStartTime += audioBuffer.duration; + } catch (e) { + logger.error('Error playing audio:', e); + } + } + + this.isPlaybackLoopRunning = false; + } + + /** + * The main loop that listens for and processes messages from the server. + */ + private async runReceiveLoop(): Promise { + const messageGenerator = this.liveSession.receive(); + while (!this.isStopped) { + const result = await Promise.race([ + messageGenerator.next(), + this.stopDeferred.promise + ]); + + if (this.isStopped || !result || result.done) { + break; + } + + const message = result.value; + if (message.type === 'serverContent') { + const serverContent = message as LiveServerContent; + if (serverContent.interrupted) { + this.interruptPlayback(); + } + + const audioPart = serverContent.modelTurn?.parts.find(part => + part.inlineData?.mimeType.startsWith('audio/') + ); + if (audioPart?.inlineData) { + const audioData = Uint8Array.from( + atob(audioPart.inlineData.data), + c => c.charCodeAt(0) + ).buffer; + this.enqueueAndPlay(audioData); + } + } else if (message.type === 'toolCall') { + if (!this.options.functionCallingHandler) { + logger.warn( + 'Received tool call message, but StartAudioConversationOptions.functionCallingHandler is undefined. Ignoring tool call.' + ); + } else { + try { + const resultPart = await this.options.functionCallingHandler( + message.functionCalls + ); + if (!this.isStopped) { + void this.liveSession.send([resultPart]); + } + } catch (e) { + throw new AIError( + AIErrorCode.ERROR, + `Function calling handler failed: ${(e as Error).message}` + ); + } + } + } + } + } +} + +/** + * Starts a real-time, bidirectional audio conversation with the model. This helper function manages + * the complexities of microphone access, audio recording, playback, and interruptions. + * + * @remarks Important: This function must be called in response to a user gesture + * (for example, a button click) to comply with {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Best_practices#autoplay_policy | browser autoplay policies}. + * + * @example + * ```javascript + * const liveSession = await model.connect(); + * let conversationController; + * + * // This function must be called from within a click handler. + * async function startConversation() { + * try { + * conversationController = await startAudioConversation(liveSession); + * } catch (e) { + * // Handle AI-specific errors + * if (e instanceof AIError) { + * console.error("AI Error:", e.message); + * } + * // Handle microphone permission and hardware errors + * else if (e instanceof DOMException) { + * console.error("Microphone Error:", e.message); + * } + * // Handle other unexpected errors + * else { + * console.error("An unexpected error occurred:", e); + * } + * } + * } + * + * // Later, to stop the conversation: + * // if (conversationController) { + * // await conversationController.stop(); + * // } + * ``` + * + * @param liveSession - An active {@link LiveSession} instance. + * @param options - Configuration options for the audio conversation. + * @returns A `Promise` that resolves with an {@link AudioConversationController}. + * @throws `AIError` if the environment does not support required Web APIs (`UNSUPPORTED`), if a conversation is already active (`REQUEST_ERROR`), the session is closed (`SESSION_CLOSED`), or if an unexpected initialization error occurs (`ERROR`). + * @throws `DOMException` Thrown by `navigator.mediaDevices.getUserMedia()` if issues occur with microphone access, such as permissions being denied (`NotAllowedError`) or no compatible hardware being found (`NotFoundError`). See the {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions | MDN documentation} for a full list of exceptions. + * + * @beta + */ +export async function startAudioConversation( + liveSession: LiveSession, + options: StartAudioConversationOptions = {} +): Promise { + if (liveSession.isClosed) { + throw new AIError( + AIErrorCode.SESSION_CLOSED, + 'Cannot start audio conversation on a closed LiveSession.' + ); + } + + if (liveSession.inConversation) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'An audio conversation is already in progress for this session.' + ); + } + + // Check for necessary Web API support. + if ( + typeof AudioWorkletNode === 'undefined' || + typeof AudioContext === 'undefined' || + typeof navigator === 'undefined' || + !navigator.mediaDevices + ) { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'Audio conversation is not supported in this environment. It requires the Web Audio API and AudioWorklet support.' + ); + } + + let audioContext: AudioContext | undefined; + try { + // 1. Set up the audio context. This must be in response to a user gesture. + // See: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Best_practices#autoplay_policy + audioContext = new AudioContext(); + if (audioContext.state === 'suspended') { + await audioContext.resume(); + } + + // 2. Prompt for microphone access and get the media stream. + // This can throw a variety of permission or hardware-related errors. + const mediaStream = await navigator.mediaDevices.getUserMedia({ + audio: true + }); + + // 3. Load the AudioWorklet processor. + // See: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet + const workletBlob = new Blob([audioProcessorWorkletString], { + type: 'application/javascript' + }); + const workletURL = URL.createObjectURL(workletBlob); + await audioContext.audioWorklet.addModule(workletURL); + + // 4. Create the audio graph: Microphone -> Source Node -> Worklet Node + const sourceNode = audioContext.createMediaStreamSource(mediaStream); + const workletNode = new AudioWorkletNode( + audioContext, + AUDIO_PROCESSOR_NAME, + { + processorOptions: { targetSampleRate: SERVER_INPUT_SAMPLE_RATE } + } + ); + sourceNode.connect(workletNode); + + // 5. Instantiate and return the runner which manages the conversation. + const runner = new AudioConversationRunner(liveSession, options, { + audioContext, + mediaStream, + sourceNode, + workletNode + }); + + return { stop: () => runner.stop() }; + } catch (e) { + // Ensure the audio context is closed on any setup error. + if (audioContext && audioContext.state !== 'closed') { + void audioContext.close(); + } + + // Re-throw specific, known error types directly. The user may want to handle `DOMException` + // errors differently (for example, if permission to access audio device was denied). + if (e instanceof AIError || e instanceof DOMException) { + throw e; + } + + // Wrap any other unexpected errors in a standard AIError. + throw new AIError( + AIErrorCode.ERROR, + `Failed to initialize audio recording: ${(e as Error).message}` + ); + } +} diff --git a/packages/ai/src/methods/live-session.test.ts b/packages/ai/src/methods/live-session.test.ts new file mode 100644 index 00000000000..7db9daaebe6 --- /dev/null +++ b/packages/ai/src/methods/live-session.test.ts @@ -0,0 +1,294 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import { spy, stub } from 'sinon'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { + LiveResponseType, + LiveServerContent, + LiveServerToolCall, + LiveServerToolCallCancellation +} from '../types'; +import { LiveSession } from './live-session'; +import { WebSocketHandler } from '../websocket'; +import { AIError } from '../errors'; +import { logger } from '../logger'; + +use(sinonChai); +use(chaiAsPromised); + +class MockWebSocketHandler implements WebSocketHandler { + connect = stub().resolves(); + send = spy(); + close = stub().resolves(); + + private messageQueue: unknown[] = []; + private streamClosed = false; + private listenerPromiseResolver: (() => void) | null = null; + + async *listen(): AsyncGenerator { + while (!this.streamClosed) { + if (this.messageQueue.length > 0) { + yield this.messageQueue.shift(); + } else { + // Wait until a new message is pushed or the stream is ended. + await new Promise(resolve => { + this.listenerPromiseResolver = resolve; + }); + } + } + } + + simulateServerMessage(message: object): void { + this.messageQueue.push(message); + if (this.listenerPromiseResolver) { + // listener is waiting for our message + this.listenerPromiseResolver(); + this.listenerPromiseResolver = null; + } + } + + endStream(): void { + this.streamClosed = true; + if (this.listenerPromiseResolver) { + this.listenerPromiseResolver(); + this.listenerPromiseResolver = null; + } + } +} + +describe('LiveSession', () => { + let mockHandler: MockWebSocketHandler; + let session: LiveSession; + let serverMessagesGenerator: AsyncGenerator; + + beforeEach(() => { + mockHandler = new MockWebSocketHandler(); + serverMessagesGenerator = mockHandler.listen(); + session = new LiveSession(mockHandler, serverMessagesGenerator); + }); + + describe('send()', () => { + it('should format and send a valid text message', async () => { + await session.send('Hello there'); + expect(mockHandler.send).to.have.been.calledOnce; + const sentData = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(sentData).to.deep.equal({ + clientContent: { + turns: [{ role: 'user', parts: [{ text: 'Hello there' }] }], + turnComplete: true + } + }); + }); + + it('should format and send a message with an array of Parts', async () => { + const parts = [ + { text: 'Part 1' }, + { inlineData: { mimeType: 'image/png', data: 'base64==' } } + ]; + await session.send(parts); + expect(mockHandler.send).to.have.been.calledOnce; + const sentData = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(sentData.clientContent.turns[0].parts).to.deep.equal(parts); + }); + }); + + describe('sendMediaChunks()', () => { + it('should send a correctly formatted realtimeInput message', async () => { + const chunks = [{ data: 'base64', mimeType: 'audio/webm' }]; + await session.sendMediaChunks(chunks); + expect(mockHandler.send).to.have.been.calledOnce; + const sentData = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(sentData).to.deep.equal({ + realtimeInput: { mediaChunks: chunks } + }); + }); + }); + + describe('sendMediaStream()', () => { + it('should send multiple chunks from a stream', async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue({ data: 'chunk1', mimeType: 'audio/webm' }); + controller.enqueue({ data: 'chunk2', mimeType: 'audio/webm' }); + controller.close(); + } + }); + + await session.sendMediaStream(stream); + + expect(mockHandler.send).to.have.been.calledTwice; + const firstCall = JSON.parse(mockHandler.send.getCall(0).args[0]); + const secondCall = JSON.parse(mockHandler.send.getCall(1).args[0]); + expect(firstCall.realtimeInput.mediaChunks[0].data).to.equal('chunk1'); + expect(secondCall.realtimeInput.mediaChunks[0].data).to.equal('chunk2'); + }); + + it('should re-throw an AIError if the stream reader throws', async () => { + const errorStream = new ReadableStream({ + pull(controller) { + controller.error(new Error('Stream failed!')); + } + }); + await expect(session.sendMediaStream(errorStream)).to.be.rejectedWith( + AIError, + /Stream failed!/ + ); + }); + }); + + describe('receive()', () => { + it('should correctly parse and transform all server message types', async () => { + const receivePromise = (async () => { + const responses = []; + for await (const response of session.receive()) { + responses.push(response); + } + return responses; + })(); + + mockHandler.simulateServerMessage({ + serverContent: { modelTurn: { parts: [{ text: 'response 1' }] } } + }); + mockHandler.simulateServerMessage({ + toolCall: { functionCalls: [{ name: 'test_func' }] } + }); + mockHandler.simulateServerMessage({ + toolCallCancellation: { functionIds: ['123'] } + }); + mockHandler.simulateServerMessage({ + serverContent: { turnComplete: true } + }); + await new Promise(r => setTimeout(() => r(), 10)); // Wait for the listener to process messages + mockHandler.endStream(); + + const responses = await receivePromise; + expect(responses).to.have.lengthOf(4); + expect(responses[0]).to.deep.equal({ + type: LiveResponseType.SERVER_CONTENT, + modelTurn: { parts: [{ text: 'response 1' }] } + } as LiveServerContent); + expect(responses[1]).to.deep.equal({ + type: LiveResponseType.TOOL_CALL, + functionCalls: [{ name: 'test_func' }] + } as LiveServerToolCall); + expect(responses[2]).to.deep.equal({ + type: LiveResponseType.TOOL_CALL_CANCELLATION, + functionIds: ['123'] + } as LiveServerToolCallCancellation); + }); + + it('should log a warning and skip messages that are not objects', async () => { + const loggerStub = stub(logger, 'warn'); + const receivePromise = (async () => { + const responses = []; + for await (const response of session.receive()) { + responses.push(response); + } + return responses; + })(); + + mockHandler.simulateServerMessage(null as any); + mockHandler.simulateServerMessage('not an object' as any); + await new Promise(r => setTimeout(() => r(), 10)); // Wait for the listener to process messages + mockHandler.endStream(); + + const responses = await receivePromise; + expect(responses).to.be.empty; + expect(loggerStub).to.have.been.calledTwice; + expect(loggerStub).to.have.been.calledWithMatch( + /Received an invalid message/ + ); + + loggerStub.restore(); + }); + + it('should log a warning and skip objects of unknown type', async () => { + const loggerStub = stub(logger, 'warn'); + const receivePromise = (async () => { + const responses = []; + for await (const response of session.receive()) { + responses.push(response); + } + return responses; + })(); + + mockHandler.simulateServerMessage({ unknownType: { data: 'test' } }); + await new Promise(r => setTimeout(() => r(), 10)); // Wait for the listener to process messages + mockHandler.endStream(); + + const responses = await receivePromise; + expect(responses).to.be.empty; + expect(loggerStub).to.have.been.calledOnce; + expect(loggerStub).to.have.been.calledWithMatch( + /Received an unknown message type/ + ); + + loggerStub.restore(); + }); + }); + + describe('close()', () => { + it('should call the handler, set the isClosed flag, and be idempotent', async () => { + expect(session.isClosed).to.be.false; + await session.close(); + expect(mockHandler.close).to.have.been.calledOnce; + expect(session.isClosed).to.be.true; + + // Call again to test idempotency + await session.close(); + expect(mockHandler.close).to.have.been.calledOnce; // Should not be called again + }); + + it('should terminate an active receive() loop', async () => { + const received: unknown[] = []; + const receivePromise = (async () => { + for await (const msg of session.receive()) { + received.push(msg); + } + })(); + + mockHandler.simulateServerMessage({ + serverContent: { modelTurn: { parts: [{ text: 'one' }] } } + }); + // Allow the first message to be processed + await new Promise(r => setTimeout(r, 10)); + expect(received).to.have.lengthOf(1); + + await session.close(); + mockHandler.endStream(); // End the mock stream + + await receivePromise; // This should now resolve + + // No more messages should have been processed + expect(received).to.have.lengthOf(1); + }); + + it('methods should throw after session is closed', async () => { + await session.close(); + await expect(session.send('test')).to.be.rejectedWith(AIError, /closed/); + await expect(session.sendMediaChunks([])).to.be.rejectedWith( + AIError, + /closed/ + ); + const generator = session.receive(); + await expect(generator.next()).to.be.rejectedWith(AIError, /closed/); + }); + }); +}); diff --git a/packages/ai/src/methods/live-session.ts b/packages/ai/src/methods/live-session.ts new file mode 100644 index 00000000000..11e5346adc0 --- /dev/null +++ b/packages/ai/src/methods/live-session.ts @@ -0,0 +1,234 @@ +/** + * @license + * Copyright 2025 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 { + AIErrorCode, + GenerativeContentBlob, + LiveResponseType, + LiveServerContent, + LiveServerToolCall, + LiveServerToolCallCancellation, + Part +} from '../public-types'; +import { formatNewContent } from '../requests/request-helpers'; +import { AIError } from '../errors'; +import { WebSocketHandler } from '../websocket'; +import { logger } from '../logger'; +import { + _LiveClientContent, + _LiveClientRealtimeInput +} from '../types/live-responses'; + +/** + * Represents an active, real-time, bidirectional conversation with the model. + * + * This class should only be instantiated by calling {@link LiveGenerativeModel.connect}. + * + * @beta + */ +export class LiveSession { + /** + * Indicates whether this Live session is closed. + * + * @beta + */ + isClosed = false; + /** + * Indicates whether this Live session is being controlled by an `AudioConversationController`. + * + * @beta + */ + inConversation = false; + + /** + * @internal + */ + constructor( + private webSocketHandler: WebSocketHandler, + private serverMessages: AsyncGenerator + ) {} + + /** + * Sends content to the server. + * + * @param request - The message to send to the model. + * @param turnComplete - Indicates if the turn is complete. Defaults to false. + * @throws If this session has been closed. + * + * @beta + */ + async send( + request: string | Array, + turnComplete = true + ): Promise { + if (this.isClosed) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'This LiveSession has been closed and cannot be used.' + ); + } + + const newContent = formatNewContent(request); + + const message: _LiveClientContent = { + clientContent: { + turns: [newContent], + turnComplete + } + }; + this.webSocketHandler.send(JSON.stringify(message)); + } + + /** + * Sends realtime input to the server. + * + * @param mediaChunks - The media chunks to send. + * @throws If this session has been closed. + * + * @beta + */ + async sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise { + if (this.isClosed) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'This LiveSession has been closed and cannot be used.' + ); + } + + // The backend does not support sending more than one mediaChunk in one message. + // Work around this limitation by sending mediaChunks in separate messages. + mediaChunks.forEach(mediaChunk => { + const message: _LiveClientRealtimeInput = { + realtimeInput: { mediaChunks: [mediaChunk] } + }; + this.webSocketHandler.send(JSON.stringify(message)); + }); + } + + /** + * Sends a stream of {@link GenerativeContentBlob}. + * + * @param mediaChunkStream - The stream of {@link GenerativeContentBlob} to send. + * @throws If this session has been closed. + * + * @beta + */ + async sendMediaStream( + mediaChunkStream: ReadableStream + ): Promise { + if (this.isClosed) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'This LiveSession has been closed and cannot be used.' + ); + } + + const reader = mediaChunkStream.getReader(); + while (true) { + try { + const { done, value } = await reader.read(); + + if (done) { + break; + } else if (!value) { + throw new Error('Missing chunk in reader, but reader is not done.'); + } + + await this.sendMediaChunks([value]); + } catch (e) { + // Re-throw any errors that occur during stream consumption or sending. + const message = + e instanceof Error ? e.message : 'Error processing media stream.'; + throw new AIError(AIErrorCode.REQUEST_ERROR, message); + } + } + } + + /** + * Yields messages received from the server. + * This can only be used by one consumer at a time. + * + * @returns An `AsyncGenerator` that yields server messages as they arrive. + * @throws If the session is already closed, or if we receive a response that we don't support. + * + * @beta + */ + async *receive(): AsyncGenerator< + LiveServerContent | LiveServerToolCall | LiveServerToolCallCancellation + > { + if (this.isClosed) { + throw new AIError( + AIErrorCode.SESSION_CLOSED, + 'Cannot read from a Live session that is closed. Try starting a new Live session.' + ); + } + for await (const message of this.serverMessages) { + if (message && typeof message === 'object') { + if (LiveResponseType.SERVER_CONTENT in message) { + yield { + type: 'serverContent', + ...(message as { serverContent: Omit }) + .serverContent + } as LiveServerContent; + } else if (LiveResponseType.TOOL_CALL in message) { + yield { + type: 'toolCall', + ...(message as { toolCall: Omit }) + .toolCall + } as LiveServerToolCall; + } else if (LiveResponseType.TOOL_CALL_CANCELLATION in message) { + yield { + type: 'toolCallCancellation', + ...( + message as { + toolCallCancellation: Omit< + LiveServerToolCallCancellation, + 'type' + >; + } + ).toolCallCancellation + } as LiveServerToolCallCancellation; + } else { + logger.warn( + `Received an unknown message type from the server: ${JSON.stringify( + message + )}` + ); + } + } else { + logger.warn( + `Received an invalid message from the server: ${JSON.stringify( + message + )}` + ); + } + } + } + + /** + * Closes this session. + * All methods on this session will throw an error once this resolves. + * + * @beta + */ + async close(): Promise { + if (!this.isClosed) { + this.isClosed = true; + await this.webSocketHandler.close(1000, 'Client closed session.'); + } + } +} diff --git a/packages/ai/src/models/index.ts b/packages/ai/src/models/index.ts index cb694a5360b..5d2492d6784 100644 --- a/packages/ai/src/models/index.ts +++ b/packages/ai/src/models/index.ts @@ -17,4 +17,5 @@ export * from './ai-model'; export * from './generative-model'; +export * from './live-generative-model'; export * from './imagen-model'; diff --git a/packages/ai/src/models/live-generative-model.test.ts b/packages/ai/src/models/live-generative-model.test.ts new file mode 100644 index 00000000000..495f340b846 --- /dev/null +++ b/packages/ai/src/models/live-generative-model.test.ts @@ -0,0 +1,171 @@ +/** + * @license + * Copyright 2025 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 { use, expect } from 'chai'; +import sinon, { SinonFakeTimers, stub } from 'sinon'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { AI } from '../public-types'; +import { LiveSession } from '../methods/live-session'; +import { WebSocketHandler } from '../websocket'; +import { GoogleAIBackend } from '../backend'; +import { LiveGenerativeModel } from './live-generative-model'; +import { AIError } from '../errors'; + +use(sinonChai); +use(chaiAsPromised); + +// A controllable mock for the WebSocketHandler interface +class MockWebSocketHandler implements WebSocketHandler { + connect = stub().resolves(); + send = stub(); + close = stub().resolves(); + + private serverMessages: unknown[] = []; + private generatorController: { + resolve: () => void; + promise: Promise; + } | null = null; + + async *listen(): AsyncGenerator { + while (true) { + if (this.serverMessages.length > 0) { + yield this.serverMessages.shift(); + } else { + const promise = new Promise(resolve => { + this.generatorController = { resolve, promise: null! }; + }); + await promise; + } + } + } + + // Test method to simulate a message from the server + simulateServerMessage(message: object): void { + this.serverMessages.push(message); + if (this.generatorController) { + this.generatorController.resolve(); + this.generatorController = null; + } + } +} + +const fakeAI: AI = { + app: { + name: 'DEFAULT', + automaticDataCollectionEnabled: true, + options: { + apiKey: 'key', + projectId: 'my-project', + appId: 'my-appid' + } + }, + backend: new GoogleAIBackend(), + location: 'us-central1' +}; + +describe('LiveGenerativeModel', () => { + let mockHandler: MockWebSocketHandler; + let clock: SinonFakeTimers; + + beforeEach(() => { + mockHandler = new MockWebSocketHandler(); + clock = sinon.useFakeTimers(); + }); + + afterEach(() => { + sinon.restore(); + clock.restore(); + }); + + it('connect() should call handler.connect and send setup message', async () => { + const model = new LiveGenerativeModel( + fakeAI, + { model: 'my-model' }, + mockHandler + ); + const connectPromise = model.connect(); + + // Ensure connect was called before simulating server response + expect(mockHandler.connect).to.have.been.calledOnce; + + // Wait for the setup message to be sent + await clock.runAllAsync(); + + expect(mockHandler.send).to.have.been.calledOnce; + const setupMessage = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(setupMessage.setup.model).to.include('my-model'); + + // Simulate successful handshake and resolve the promise + mockHandler.simulateServerMessage({ setupComplete: true }); + const session = await connectPromise; + expect(session).to.be.an.instanceOf(LiveSession); + await session.close(); + }); + + it('connect() should throw if handshake fails', async () => { + const model = new LiveGenerativeModel( + fakeAI, + { model: 'my-model' }, + mockHandler + ); + const connectPromise = model.connect(); + + // Wait for setup message + await clock.runAllAsync(); + + // Simulate a failed handshake + mockHandler.simulateServerMessage({ error: 'handshake failed' }); + await expect(connectPromise).to.be.rejectedWith( + AIError, + /Server connection handshake failed/ + ); + }); + + it('connect() should pass through connection errors', async () => { + mockHandler.connect.rejects(new Error('Connection refused')); + const model = new LiveGenerativeModel( + fakeAI, + { model: 'my-model' }, + mockHandler + ); + await expect(model.connect()).to.be.rejectedWith('Connection refused'); + }); + + it('connect() should pass through setup parameters correctly', async () => { + const model = new LiveGenerativeModel( + fakeAI, + { + model: 'gemini-pro', + generationConfig: { temperature: 0.8 }, + systemInstruction: { role: 'system', parts: [{ text: 'Be a pirate' }] } + }, + mockHandler + ); + const connectPromise = model.connect(); + + // Wait for setup message + await clock.runAllAsync(); + + const sentData = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(sentData.setup.generationConfig).to.deep.equal({ temperature: 0.8 }); + expect(sentData.setup.systemInstruction.parts[0].text).to.equal( + 'Be a pirate' + ); + mockHandler.simulateServerMessage({ setupComplete: true }); + await connectPromise; + }); +}); diff --git a/packages/ai/src/models/live-generative-model.ts b/packages/ai/src/models/live-generative-model.ts new file mode 100644 index 00000000000..251df095202 --- /dev/null +++ b/packages/ai/src/models/live-generative-model.ts @@ -0,0 +1,125 @@ +/** + * @license + * Copyright 2025 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 { AIModel } from './ai-model'; +import { LiveSession } from '../methods/live-session'; +import { AIError } from '../errors'; +import { + AI, + AIErrorCode, + BackendType, + Content, + LiveGenerationConfig, + LiveModelParams, + Tool, + ToolConfig +} from '../public-types'; +import { WebSocketHandler } from '../websocket'; +import { WebSocketUrl } from '../requests/request'; +import { formatSystemInstruction } from '../requests/request-helpers'; +import { _LiveClientSetup } from '../types/live-responses'; + +/** + * Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal + * interactions with Gemini. + * + * This class should only be instantiated with {@link getLiveGenerativeModel}. + * + * @beta + */ +export class LiveGenerativeModel extends AIModel { + generationConfig: LiveGenerationConfig; + tools?: Tool[]; + toolConfig?: ToolConfig; + systemInstruction?: Content; + + /** + * @internal + */ + constructor( + ai: AI, + modelParams: LiveModelParams, + /** + * @internal + */ + private _webSocketHandler: WebSocketHandler + ) { + super(ai, modelParams.model); + this.generationConfig = modelParams.generationConfig || {}; + this.tools = modelParams.tools; + this.toolConfig = modelParams.toolConfig; + this.systemInstruction = formatSystemInstruction( + modelParams.systemInstruction + ); + } + + /** + * Starts a {@link LiveSession}. + * + * @returns A {@link LiveSession}. + * @throws If the connection failed to be established with the server. + * + * @beta + */ + async connect(): Promise { + const url = new WebSocketUrl(this._apiSettings); + await this._webSocketHandler.connect(url.toString()); + + let fullModelPath: string; + if (this._apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + fullModelPath = `projects/${this._apiSettings.project}/${this.model}`; + } else { + fullModelPath = `projects/${this._apiSettings.project}/locations/${this._apiSettings.location}/${this.model}`; + } + + const setupMessage: _LiveClientSetup = { + setup: { + model: fullModelPath, + generationConfig: this.generationConfig, + tools: this.tools, + toolConfig: this.toolConfig, + systemInstruction: this.systemInstruction + } + }; + + try { + // Begin listening for server messages, and begin the handshake by sending the 'setupMessage' + const serverMessages = this._webSocketHandler.listen(); + this._webSocketHandler.send(JSON.stringify(setupMessage)); + + // Verify we received the handshake response 'setupComplete' + const firstMessage = (await serverMessages.next()).value; + if ( + !firstMessage || + !(typeof firstMessage === 'object') || + !('setupComplete' in firstMessage) + ) { + await this._webSocketHandler.close(1011, 'Handshake failure'); + throw new AIError( + AIErrorCode.RESPONSE_ERROR, + 'Server connection handshake failed. The server did not respond with a setupComplete message.' + ); + } + + return new LiveSession(this._webSocketHandler, serverMessages); + } catch (e) { + // Ensure connection is closed on any setup error + await this._webSocketHandler.close(); + throw e; + } + } +} diff --git a/packages/ai/src/requests/request.ts b/packages/ai/src/requests/request.ts index 3fa0b33012f..90195b4b788 100644 --- a/packages/ai/src/requests/request.ts +++ b/packages/ai/src/requests/request.ts @@ -20,13 +20,14 @@ import { AIError } from '../errors'; import { ApiSettings } from '../types/internal'; import { DEFAULT_API_VERSION, - DEFAULT_BASE_URL, + DEFAULT_DOMAIN, DEFAULT_FETCH_TIMEOUT_MS, LANGUAGE_TAG, PACKAGE_VERSION } from '../constants'; import { logger } from '../logger'; import { GoogleAIBackend, VertexAIBackend } from '../backend'; +import { BackendType } from '../public-types'; export enum Task { GENERATE_CONTENT = 'generateContent', @@ -51,7 +52,7 @@ export class RequestUrl { } private get baseUrl(): string { - return this.requestOptions?.baseUrl || DEFAULT_BASE_URL; + return this.requestOptions?.baseUrl || `https://${DEFAULT_DOMAIN}`; } private get apiVersion(): string { @@ -81,6 +82,28 @@ export class RequestUrl { } } +export class WebSocketUrl { + constructor(public apiSettings: ApiSettings) {} + toString(): string { + const url = new URL(`wss://${DEFAULT_DOMAIN}`); + url.pathname = this.pathname; + + const queryParams = new URLSearchParams(); + queryParams.set('key', this.apiSettings.apiKey); + url.search = queryParams.toString(); + + return url.toString(); + } + + private get pathname(): string { + if (this.apiSettings.backend.backendType === BackendType.GOOGLE_AI) { + return 'ws/google.firebase.vertexai.v1beta.GenerativeService/BidiGenerateContent'; + } else { + return `ws/google.firebase.vertexai.v1beta.LlmBidiService/BidiGenerateContent/locations/${this.apiSettings.location}`; + } + } +} + /** * Log language and "fire/version" to x-goog-api-client */ diff --git a/packages/ai/src/types/content.ts b/packages/ai/src/types/content.ts index a08af95086c..bd8ccf1ef10 100644 --- a/packages/ai/src/types/content.ts +++ b/packages/ai/src/types/content.ts @@ -147,6 +147,15 @@ export interface FileDataPart { * @public */ export interface FunctionCall { + /** + * The id of the function call. This must be sent back in the associated {@link FunctionResponse}. + * + * + * @remarks This property is only supported in the Gemini Developer API ({@link GoogleAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property will be + * `undefined`. + */ + id?: string; name: string; args: object; } @@ -161,6 +170,14 @@ export interface FunctionCall { * @public */ export interface FunctionResponse { + /** + * The id of the {@link FunctionCall}. + * + * @remarks This property is only supported in the Gemini Developer API ({@link GoogleAIBackend}). + * When using the Gemini Developer API ({@link GoogleAIBackend}), this property will be + * `undefined`. + */ + id?: string; name: string; response: object; } diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 956be64ba75..701cd4a695d 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -328,7 +328,12 @@ export const ResponseModality = { * Image. * @beta */ - IMAGE: 'IMAGE' + IMAGE: 'IMAGE', + /** + * Audio. + * @beta + */ + AUDIO: 'AUDIO' } as const; /** diff --git a/packages/ai/src/types/error.ts b/packages/ai/src/types/error.ts index d6ed22e047c..a230f683f37 100644 --- a/packages/ai/src/types/error.ts +++ b/packages/ai/src/types/error.ts @@ -75,6 +75,9 @@ export const AIErrorCode = { /** An error occurred while performing a fetch. */ FETCH_ERROR: 'fetch-error', + /** An error occurred because an operation was attempted on a closed session. */ + SESSION_CLOSED: 'session-closed', + /** An error associated with a Content object. */ INVALID_CONTENT: 'invalid-content', diff --git a/packages/ai/src/types/live-responses.ts b/packages/ai/src/types/live-responses.ts new file mode 100644 index 00000000000..66170f1a5ab --- /dev/null +++ b/packages/ai/src/types/live-responses.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2025 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 { Content, GenerativeContentBlob, Part } from './content'; +import { LiveGenerationConfig, Tool, ToolConfig } from './requests'; + +/** + * User input that is sent to the model. + * + * @internal + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface _LiveClientContent { + clientContent: { + turns: [Content]; + turnComplete: boolean; + }; +} + +/** + * User input that is sent to the model in real time. + * + * @internal + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface _LiveClientRealtimeInput { + realtimeInput: { + mediaChunks: GenerativeContentBlob[]; + }; +} +/** + * The first message in a Live session, used to configure generation options. + * + * @internal + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface _LiveClientSetup { + setup: { + model: string; + generationConfig?: LiveGenerationConfig; + tools?: Tool[]; + toolConfig?: ToolConfig; + systemInstruction?: string | Part | Content; + }; +} diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 93921c6f14e..21ccce8bd11 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -51,6 +51,17 @@ export interface ModelParams extends BaseParams { systemInstruction?: string | Part | Content; } +/** + * Params passed to {@link getLiveGenerativeModel}. + * @beta + */ +export interface LiveModelParams { + model: string; + generationConfig?: LiveGenerationConfig; + tools?: Tool[]; + toolConfig?: ToolConfig; + systemInstruction?: string | Part | Content; +} /** * Request sent through {@link GenerativeModel.generateContent} * @public @@ -124,6 +135,57 @@ export interface GenerationConfig { thinkingConfig?: ThinkingConfig; } +/** + * Configuration parameters used by {@link LiveGenerativeModel} to control live content generation. + * + * @beta + */ +export interface LiveGenerationConfig { + /** + * Configuration for speech synthesis. + */ + speechConfig?: SpeechConfig; + /** + * Specifies the maximum number of tokens that can be generated in the response. The number of + * tokens per word varies depending on the language outputted. Is unbounded by default. + */ + maxOutputTokens?: number; + /** + * Controls the degree of randomness in token selection. A `temperature` value of 0 means that the highest + * probability tokens are always selected. In this case, responses for a given prompt are mostly + * deterministic, but a small amount of variation is still possible. + */ + temperature?: number; + /** + * Changes how the model selects tokens for output. Tokens are + * selected from the most to least probable until the sum of their probabilities equals the `topP` + * value. For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1 respectively + * and the `topP` value is 0.5, then the model will select either A or B as the next token by using + * the `temperature` and exclude C as a candidate. Defaults to 0.95 if unset. + */ + topP?: number; + /** + * Changes how the model selects token for output. A `topK` value of 1 means the select token is + * the most probable among all tokens in the model's vocabulary, while a `topK` value 3 means that + * the next token is selected from among the 3 most probably using probabilities sampled. Tokens + * are then further filtered with the highest selected `temperature` sampling. Defaults to 40 + * if unspecified. + */ + topK?: number; + /** + * Positive penalties. + */ + presencePenalty?: number; + /** + * Frequency penalties. + */ + frequencyPenalty?: number; + /** + * The modalities of the response. + */ + responseModalities?: ResponseModality[]; +} + /** * Params for {@link GenerativeModel.startChat}. * @public @@ -344,3 +406,41 @@ export interface ThinkingConfig { */ includeThoughts?: boolean; } + +/** + * Configuration for a pre-built voice. + * + * @beta + */ +export interface PrebuiltVoiceConfig { + /** + * The voice name to use for speech synthesis. + * + * For a full list of names and demos of what each voice sounds like, see {@link https://cloud.google.com/text-to-speech/docs/chirp3-hd | Chirp 3: HD Voices}. + */ + voiceName?: string; +} + +/** + * Configuration for the voice to used in speech synthesis. + * + * @beta + */ +export interface VoiceConfig { + /** + * Configures the voice using a pre-built voice configuration. + */ + prebuiltVoiceConfig?: PrebuiltVoiceConfig; +} + +/** + * Configures speech synthesis. + * + * @beta + */ +export interface SpeechConfig { + /** + * Configures the voice to be used in speech synthesis. + */ + voiceConfig?: VoiceConfig; +} diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index d9b76155a3a..4a01e79a77c 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -427,3 +427,73 @@ export interface CountTokensResponse { */ promptTokensDetails?: ModalityTokenCount[]; } + +/** + * An incremental content update from the model. + * + * @beta + */ +export interface LiveServerContent { + type: 'serverContent'; + /** + * The content that the model has generated as part of the current conversation with the user. + */ + modelTurn?: Content; + /** + * Indicates whether the turn is complete. This is `undefined` if the turn is not complete. + */ + turnComplete?: boolean; + /** + * Indicates whether the model was interrupted by the client. An interruption occurs when + * the client sends a message before the model finishes it's turn. This is `undefined` if the + * model was not interrupted. + */ + interrupted?: boolean; +} + +/** + * A request from the model for the client to execute one or more functions. + * + * @beta + */ +export interface LiveServerToolCall { + type: 'toolCall'; + /** + * An array of function calls to run. + */ + functionCalls: FunctionCall[]; +} + +/** + * Notification to cancel a previous function call triggered by {@link LiveServerToolCall}. + * + * @beta + */ +export interface LiveServerToolCallCancellation { + type: 'toolCallCancellation'; + /** + * IDs of function calls that were cancelled. These refer to the `id` property of a {@link FunctionCall}. + */ + functionIds: string[]; +} + +/** + * The types of responses that can be returned by {@link LiveSession.receive}. + * + * @beta + */ +export const LiveResponseType = { + SERVER_CONTENT: 'serverContent', + TOOL_CALL: 'toolCall', + TOOL_CALL_CANCELLATION: 'toolCallCancellation' +}; + +/** + * The types of responses that can be returned by {@link LiveSession.receive}. + * This is a property on all messages that can be used for type narrowing. This property is not + * returned by the server, it is assigned to a server message object once it's parsed. + * + * @beta + */ +export type LiveResponseType = + (typeof LiveResponseType)[keyof typeof LiveResponseType]; diff --git a/packages/ai/src/websocket.test.ts b/packages/ai/src/websocket.test.ts new file mode 100644 index 00000000000..6d8f08282e7 --- /dev/null +++ b/packages/ai/src/websocket.test.ts @@ -0,0 +1,269 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import sinon, { SinonFakeTimers, SinonStub } from 'sinon'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { WebSocketHandlerImpl } from './websocket'; +import { AIError } from './errors'; + +use(sinonChai); +use(chaiAsPromised); + +class MockWebSocket { + static CONNECTING = 0; + static OPEN = 1; + static CLOSING = 2; + static CLOSED = 3; + + readyState: number = MockWebSocket.CONNECTING; + sentMessages: Array = []; + url: string; + private listeners: Map> = new Map(); + + constructor(url: string) { + this.url = url; + } + + send(data: string | ArrayBuffer): void { + if (this.readyState !== MockWebSocket.OPEN) { + throw new Error('WebSocket is not in OPEN state'); + } + this.sentMessages.push(data); + } + + close(): void { + if ( + this.readyState === MockWebSocket.CLOSED || + this.readyState === MockWebSocket.CLOSING + ) { + return; + } + this.readyState = MockWebSocket.CLOSING; + setTimeout(() => { + this.readyState = MockWebSocket.CLOSED; + this.dispatchEvent(new Event('close')); + }, 10); + } + + addEventListener(type: string, listener: EventListener): void { + if (!this.listeners.has(type)) { + this.listeners.set(type, new Set()); + } + this.listeners.get(type)!.add(listener); + } + + removeEventListener(type: string, listener: EventListener): void { + this.listeners.get(type)?.delete(listener); + } + + dispatchEvent(event: Event): void { + this.listeners.get(event.type)?.forEach(listener => listener(event)); + } + + triggerOpen(): void { + this.readyState = MockWebSocket.OPEN; + this.dispatchEvent(new Event('open')); + } + + triggerMessage(data: any): void { + this.dispatchEvent(new MessageEvent('message', { data })); + } + + triggerError(): void { + this.dispatchEvent(new Event('error')); + } +} + +describe('WebSocketHandlerImpl', () => { + let handler: WebSocketHandlerImpl; + let mockWebSocket: MockWebSocket; + let clock: SinonFakeTimers; + let webSocketStub: SinonStub; + + beforeEach(() => { + webSocketStub = sinon + .stub(globalThis, 'WebSocket') + .callsFake((url: string) => { + mockWebSocket = new MockWebSocket(url); + return mockWebSocket as any; + }); + clock = sinon.useFakeTimers(); + handler = new WebSocketHandlerImpl(); + }); + + afterEach(() => { + sinon.restore(); + clock.restore(); + }); + + describe('connect()', () => { + it('should resolve on open event', async () => { + const connectPromise = handler.connect('ws://test-url'); + expect(webSocketStub).to.have.been.calledWith('ws://test-url'); + + await clock.tickAsync(1); + mockWebSocket.triggerOpen(); + + await expect(connectPromise).to.be.fulfilled; + }); + + it('should reject on error event', async () => { + const connectPromise = handler.connect('ws://test-url'); + await clock.tickAsync(1); + mockWebSocket.triggerError(); + + await expect(connectPromise).to.be.rejectedWith( + AIError, + /Error event raised on WebSocket/ + ); + }); + }); + + describe('listen()', () => { + beforeEach(async () => { + const connectPromise = handler.connect('ws://test'); + mockWebSocket.triggerOpen(); + await connectPromise; + }); + + it('should yield multiple messages as they arrive', async () => { + const generator = handler.listen(); + + const received: unknown[] = []; + const listenPromise = (async () => { + for await (const msg of generator) { + received.push(msg); + } + })(); + + // Use tickAsync to allow the consumer to start listening + await clock.tickAsync(1); + mockWebSocket.triggerMessage(new Blob([JSON.stringify({ foo: 1 })])); + + await clock.tickAsync(10); + mockWebSocket.triggerMessage(new Blob([JSON.stringify({ foo: 2 })])); + + await clock.tickAsync(5); + mockWebSocket.close(); + await clock.runAllAsync(); // Let timers finish + + await listenPromise; // Wait for the consumer to finish + + expect(received).to.deep.equal([ + { + foo: 1 + }, + { + foo: 2 + } + ]); + }); + + it('should buffer messages that arrive before the consumer calls .next()', async () => { + const generator = handler.listen(); + + // Create a promise that will consume the generator in a separate async context + const received: unknown[] = []; + const consumptionPromise = (async () => { + for await (const message of generator) { + received.push(message); + } + })(); + + await clock.tickAsync(1); + + mockWebSocket.triggerMessage(new Blob([JSON.stringify({ foo: 1 })])); + mockWebSocket.triggerMessage(new Blob([JSON.stringify({ foo: 2 })])); + + await clock.tickAsync(1); + mockWebSocket.close(); + await clock.runAllAsync(); + + await consumptionPromise; + + expect(received).to.deep.equal([ + { + foo: 1 + }, + { + foo: 2 + } + ]); + }); + }); + + describe('close()', () => { + it('should be idempotent and not throw if called multiple times', async () => { + const connectPromise = handler.connect('ws://test'); + mockWebSocket.triggerOpen(); + await connectPromise; + + const closePromise1 = handler.close(); + await clock.runAllAsync(); + await closePromise1; + + await expect(handler.close()).to.be.fulfilled; + }); + + it('should wait for the onclose event before resolving', async () => { + const connectPromise = handler.connect('ws://test'); + mockWebSocket.triggerOpen(); + await connectPromise; + + let closed = false; + const closePromise = handler.close().then(() => { + closed = true; + }); + + // The promise should not have resolved yet + await clock.tickAsync(5); + expect(closed).to.be.false; + + // Now, let the mock's setTimeout for closing run, which triggers onclose + await clock.tickAsync(10); + + await expect(closePromise).to.be.fulfilled; + expect(closed).to.be.true; + }); + }); + + describe('Interaction between listen() and close()', () => { + it('should allow close() to take precedence and resolve correctly, while also terminating the listener', async () => { + const connectPromise = handler.connect('ws://test'); + mockWebSocket.triggerOpen(); + await connectPromise; + + const generator = handler.listen(); + const listenPromise = (async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for await (const _ of generator) { + } + })(); + + const closePromise = handler.close(); + + await clock.runAllAsync(); + + await expect(closePromise).to.be.fulfilled; + await expect(listenPromise).to.be.fulfilled; + + expect(mockWebSocket.readyState).to.equal(MockWebSocket.CLOSED); + }); + }); +}); diff --git a/packages/ai/src/websocket.ts b/packages/ai/src/websocket.ts new file mode 100644 index 00000000000..fa34f2d48c3 --- /dev/null +++ b/packages/ai/src/websocket.ts @@ -0,0 +1,241 @@ +/** + * @license + * Copyright 2025 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 { AIError } from './errors'; +import { logger } from './logger'; +import { AIErrorCode } from './types'; + +/** + * A standardized interface for interacting with a WebSocket connection. + * This abstraction allows the SDK to use the appropriate WebSocket implementation + * for the current JS environment (Browser vs. Node) without + * changing the core logic of the `LiveSession`. + * @internal + */ + +export interface WebSocketHandler { + /** + * Establishes a connection to the given URL. + * + * @param url The WebSocket URL (e.g., wss://...). + * @returns A promise that resolves on successful connection or rejects on failure. + */ + connect(url: string): Promise; + + /** + * Sends data over the WebSocket. + * + * @param data The string or binary data to send. + */ + send(data: string | ArrayBuffer): void; + + /** + * Returns an async generator that yields parsed JSON objects from the server. + * The yielded type is `unknown` because the handler cannot guarantee the shape of the data. + * The consumer is responsible for type validation. + * The generator terminates when the connection is closed. + * + * @returns A generator that allows consumers to pull messages using a `for await...of` loop. + */ + listen(): AsyncGenerator; + + /** + * Closes the WebSocket connection. + * + * @param code - A numeric status code explaining why the connection is closing. + * @param reason - A human-readable string explaining why the connection is closing. + */ + close(code?: number, reason?: string): Promise; +} + +/** + * A wrapper for the native `WebSocket` available in both Browsers and Node >= 22. + * + * @internal + */ +export class WebSocketHandlerImpl implements WebSocketHandler { + private ws?: WebSocket; + + constructor() { + if (typeof WebSocket === 'undefined') { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'The WebSocket API is not available in this environment. ' + + 'The "Live" feature is not supported here. It is supported in ' + + 'modern browser windows, Web Workers with WebSocket support, and Node >= 22.' + ); + } + } + + connect(url: string): Promise { + return new Promise((resolve, reject) => { + this.ws = new WebSocket(url); + this.ws.binaryType = 'blob'; // Only important to set in Node + this.ws.addEventListener('open', () => resolve(), { once: true }); + this.ws.addEventListener( + 'error', + () => + reject( + new AIError( + AIErrorCode.FETCH_ERROR, + `Error event raised on WebSocket` + ) + ), + { once: true } + ); + this.ws!.addEventListener('close', (closeEvent: CloseEvent) => { + if (closeEvent.reason) { + logger.warn( + `WebSocket connection closed by server. Reason: '${closeEvent.reason}'` + ); + } + }); + }); + } + + send(data: string | ArrayBuffer): void { + if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { + throw new AIError(AIErrorCode.REQUEST_ERROR, 'WebSocket is not open.'); + } + this.ws.send(data); + } + + async *listen(): AsyncGenerator { + if (!this.ws) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'WebSocket is not connected.' + ); + } + + const messageQueue: unknown[] = []; + const errorQueue: Error[] = []; + let resolvePromise: (() => void) | null = null; + let isClosed = false; + + const messageListener = async (event: MessageEvent): Promise => { + let data: string; + if (event.data instanceof Blob) { + data = await event.data.text(); + } else if (typeof event.data === 'string') { + data = event.data; + } else { + errorQueue.push( + new AIError( + AIErrorCode.PARSE_FAILED, + `Failed to parse WebSocket response. Expected data to be a Blob or string, but was ${typeof event.data}.` + ) + ); + if (resolvePromise) { + resolvePromise(); + resolvePromise = null; + } + return; + } + + try { + const obj = JSON.parse(data) as unknown; + messageQueue.push(obj); + } catch (e) { + const err = e as Error; + errorQueue.push( + new AIError( + AIErrorCode.PARSE_FAILED, + `Error parsing WebSocket message to JSON: ${err.message}` + ) + ); + } + + if (resolvePromise) { + resolvePromise(); + resolvePromise = null; + } + }; + + const errorListener = (): void => { + errorQueue.push( + new AIError(AIErrorCode.FETCH_ERROR, 'WebSocket connection error.') + ); + if (resolvePromise) { + resolvePromise(); + resolvePromise = null; + } + }; + + const closeListener = (event: CloseEvent): void => { + if (event.reason) { + logger.warn( + `WebSocket connection closed by the server with reason: ${event.reason}` + ); + } + isClosed = true; + if (resolvePromise) { + resolvePromise(); + resolvePromise = null; + } + // Clean up listeners to prevent memory leaks + this.ws?.removeEventListener('message', messageListener); + this.ws?.removeEventListener('close', closeListener); + this.ws?.removeEventListener('error', errorListener); + }; + + this.ws.addEventListener('message', messageListener); + this.ws.addEventListener('close', closeListener); + this.ws.addEventListener('error', errorListener); + + while (!isClosed) { + if (errorQueue.length > 0) { + const error = errorQueue.shift()!; + throw error; + } + if (messageQueue.length > 0) { + yield messageQueue.shift()!; + } else { + await new Promise(resolve => { + resolvePromise = resolve; + }); + } + } + + // If the loop terminated because isClosed is true, check for any final errors + if (errorQueue.length > 0) { + const error = errorQueue.shift()!; + throw error; + } + } + + close(code?: number, reason?: string): Promise { + return new Promise(resolve => { + if (!this.ws) { + return resolve(); + } + + this.ws.addEventListener('close', () => resolve(), { once: true }); + // Calling 'close' during these states results in an error. + if ( + this.ws.readyState === WebSocket.CLOSED || + this.ws.readyState === WebSocket.CONNECTING + ) { + return resolve(); + } + + if (this.ws.readyState !== WebSocket.CLOSING) { + this.ws.close(code, reason); + } + }); + } +} diff --git a/packages/ai/test-utils/types.d.ts b/packages/ai/test-utils/types.ts similarity index 100% rename from packages/ai/test-utils/types.d.ts rename to packages/ai/test-utils/types.ts From f2ecae7df6f1bf8e7304498c8f1b23d40f60b1ab Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 28 Aug 2025 08:40:23 -0700 Subject: [PATCH 269/295] Version Packages (#9230) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/blue-pets-sin.md | 6 ------ .changeset/brave-llamas-impress.md | 6 ------ .changeset/calm-guests-pump.md | 5 ----- .changeset/good-cooks-deliver.md | 5 ----- .changeset/nasty-rings-drop.md | 6 ------ .changeset/spotty-bananas-fry.md | 5 ----- .changeset/three-balloons-collect.md | 5 ----- .changeset/unlucky-goats-teach.md | 5 ----- integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 18 ++++++++++++++++++ packages/ai/package.json | 4 ++-- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 21 +++++++++++++++++++++ packages/firebase/package.json | 16 ++++++++-------- packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 6 +++--- packages/firestore/CHANGELOG.md | 6 ++++++ packages/firestore/package.json | 6 +++--- packages/functions-compat/CHANGELOG.md | 7 +++++++ packages/functions-compat/package.json | 6 +++--- packages/functions/CHANGELOG.md | 6 ++++++ packages/functions/package.json | 4 ++-- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 48 files changed, 130 insertions(+), 95 deletions(-) delete mode 100644 .changeset/blue-pets-sin.md delete mode 100644 .changeset/brave-llamas-impress.md delete mode 100644 .changeset/calm-guests-pump.md delete mode 100644 .changeset/good-cooks-deliver.md delete mode 100644 .changeset/nasty-rings-drop.md delete mode 100644 .changeset/spotty-bananas-fry.md delete mode 100644 .changeset/three-balloons-collect.md delete mode 100644 .changeset/unlucky-goats-teach.md diff --git a/.changeset/blue-pets-sin.md b/.changeset/blue-pets-sin.md deleted file mode 100644 index 6e27789956c..00000000000 --- a/.changeset/blue-pets-sin.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Add support for the Gemini Live API. diff --git a/.changeset/brave-llamas-impress.md b/.changeset/brave-llamas-impress.md deleted file mode 100644 index 61d8f87ff41..00000000000 --- a/.changeset/brave-llamas-impress.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': minor -'firebase': minor ---- - -Add `thoughtSummary()` convenience method to `EnhancedGenerateContentResponse`. diff --git a/.changeset/calm-guests-pump.md b/.changeset/calm-guests-pump.md deleted file mode 100644 index da46e234f77..00000000000 --- a/.changeset/calm-guests-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Fixed an issue where `AIError` messages were too long after including an entire response body. diff --git a/.changeset/good-cooks-deliver.md b/.changeset/good-cooks-deliver.md deleted file mode 100644 index 739a42f8574..00000000000 --- a/.changeset/good-cooks-deliver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Add 'includeSafetyAttributes' field to Predict request payloads. diff --git a/.changeset/nasty-rings-drop.md b/.changeset/nasty-rings-drop.md deleted file mode 100644 index 7755dced9f1..00000000000 --- a/.changeset/nasty-rings-drop.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': minor -'firebase': minor ---- - -Add App Check limited use token option to `getAI()`. diff --git a/.changeset/spotty-bananas-fry.md b/.changeset/spotty-bananas-fry.md deleted file mode 100644 index dec4b44dfb7..00000000000 --- a/.changeset/spotty-bananas-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/firestore': patch ---- - -Fixed a bug where a rejected promise with an empty message in a transaction would cause a timeout. diff --git a/.changeset/three-balloons-collect.md b/.changeset/three-balloons-collect.md deleted file mode 100644 index 5978b3a28ab..00000000000 --- a/.changeset/three-balloons-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/functions": patch ---- - -Fixed issue where Firebase Functions SDK caused CORS errors when connected to emulators in Firebase Studio diff --git a/.changeset/unlucky-goats-teach.md b/.changeset/unlucky-goats-teach.md deleted file mode 100644 index 5e4bc68dc03..00000000000 --- a/.changeset/unlucky-goats-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Exclude ChromeAdapterImpl code from Node entry point. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 898feed3504..43918524893 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,14 +8,14 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.14.1", - "@firebase/app-compat": "0.5.1", + "@firebase/app": "0.14.2", + "@firebase/app-compat": "0.5.2", "@firebase/analytics": "0.10.18", "@firebase/analytics-compat": "0.2.24", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", - "@firebase/functions": "0.13.0", - "@firebase/functions-compat": "0.4.0", + "@firebase/functions": "0.13.1", + "@firebase/functions-compat": "0.4.1", "@firebase/messaging": "0.12.23", "@firebase/messaging-compat": "0.2.23", "@firebase/performance": "0.7.9", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index e3c67784ed6..9b5b2411e6a 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.14.1", - "@firebase/firestore": "4.9.0" + "@firebase/app": "0.14.2", + "@firebase/firestore": "4.9.1" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index df8ac647379..89207a3a789 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "12.1.0", + "firebase": "12.2.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 60a789a970f..e00fc1b45f1 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,23 @@ # @firebase/ai +## 2.2.0 + +### Minor Changes + +- [`984086b`](https://github.com/firebase/firebase-js-sdk/commit/984086b0b1bd607d3aac4cbb8400bc61416e2959) [#9224](https://github.com/firebase/firebase-js-sdk/pull/9224) - Add support for the Gemini Live API. + +- [`9b63cd6`](https://github.com/firebase/firebase-js-sdk/commit/9b63cd60efcd02b64b0d37f81affb3eabf70f9eb) [#9192](https://github.com/firebase/firebase-js-sdk/pull/9192) - Add `thoughtSummary()` convenience method to `EnhancedGenerateContentResponse`. + +- [`02280d7`](https://github.com/firebase/firebase-js-sdk/commit/02280d747863445fa1c21dfda01030412a6cecff) [#9201](https://github.com/firebase/firebase-js-sdk/pull/9201) - Add App Check limited use token option to `getAI()`. + +### Patch Changes + +- [`84b8bed`](https://github.com/firebase/firebase-js-sdk/commit/84b8bed35b69e4713fe8f677803cb06625525a61) [#9222](https://github.com/firebase/firebase-js-sdk/pull/9222) - Fixed an issue where `AIError` messages were too long after including an entire response body. + +- [`c5f08a9`](https://github.com/firebase/firebase-js-sdk/commit/c5f08a9bc5da0d2b0207802c972d53724ccef055) [#9216](https://github.com/firebase/firebase-js-sdk/pull/9216) - Add 'includeSafetyAttributes' field to Predict request payloads. + +- [`cbef6c6`](https://github.com/firebase/firebase-js-sdk/commit/cbef6c6e5b752c316104f9c834e0fe21b75c3ef1) [#9225](https://github.com/firebase/firebase-js-sdk/pull/9225) - Exclude ChromeAdapterImpl code from Node entry point. + ## 2.1.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index a1fb8eefa20..dc586a0eb6c 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "2.1.0", + "version": "2.2.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -59,7 +59,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index a4648a4ef32..ce4241b8080 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index afc5c620bb8..f4e35751e58 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 4272d7abae3..fd07d8ffebc 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 349621cbc23..2bfeb8d01cb 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index f02992ba304..d9251a873c2 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.5.2 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.14.2 + ## 0.5.1 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 95abb2209ae..505a04a3536 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.5.1", + "version": "0.5.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", "@firebase/component": "0.7.0", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 9b0c5ca6c50..57891db7332 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.14.2 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.14.1 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 783f4360fbe..8228e2d4477 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.14.1", + "version": "0.14.2", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 14e0aa922d9..fbb2e443b64 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 1240ba038a2..2fe122d762c 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 974449423f4..44493b03eb2 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index b8f8831f4a1..d9cce7ef390 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 62321919b96..54bac8ce5fc 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index bc13cba61c5..e84d8ff2aab 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,26 @@ # firebase +## 12.2.0 + +### Minor Changes + +- [`984086b`](https://github.com/firebase/firebase-js-sdk/commit/984086b0b1bd607d3aac4cbb8400bc61416e2959) [#9224](https://github.com/firebase/firebase-js-sdk/pull/9224) - Add support for the Gemini Live API. + +- [`9b63cd6`](https://github.com/firebase/firebase-js-sdk/commit/9b63cd60efcd02b64b0d37f81affb3eabf70f9eb) [#9192](https://github.com/firebase/firebase-js-sdk/pull/9192) - Add `thoughtSummary()` convenience method to `EnhancedGenerateContentResponse`. + +- [`02280d7`](https://github.com/firebase/firebase-js-sdk/commit/02280d747863445fa1c21dfda01030412a6cecff) [#9201](https://github.com/firebase/firebase-js-sdk/pull/9201) - Add App Check limited use token option to `getAI()`. + +### Patch Changes + +- Updated dependencies [[`984086b`](https://github.com/firebase/firebase-js-sdk/commit/984086b0b1bd607d3aac4cbb8400bc61416e2959), [`9b63cd6`](https://github.com/firebase/firebase-js-sdk/commit/9b63cd60efcd02b64b0d37f81affb3eabf70f9eb), [`84b8bed`](https://github.com/firebase/firebase-js-sdk/commit/84b8bed35b69e4713fe8f677803cb06625525a61), [`c5f08a9`](https://github.com/firebase/firebase-js-sdk/commit/c5f08a9bc5da0d2b0207802c972d53724ccef055), [`02280d7`](https://github.com/firebase/firebase-js-sdk/commit/02280d747863445fa1c21dfda01030412a6cecff), [`2058432`](https://github.com/firebase/firebase-js-sdk/commit/2058432e6c8e809d5b695e31fde582e94f1349c5), [`5501791`](https://github.com/firebase/firebase-js-sdk/commit/5501791d0bd665c1c7d4fcd786053a46ceff208c), [`cbef6c6`](https://github.com/firebase/firebase-js-sdk/commit/cbef6c6e5b752c316104f9c834e0fe21b75c3ef1)]: + - @firebase/ai@2.2.0 + - @firebase/app@0.14.2 + - @firebase/firestore@4.9.1 + - @firebase/functions@0.13.1 + - @firebase/app-compat@0.5.2 + - @firebase/firestore-compat@0.4.1 + - @firebase/functions-compat@0.4.1 + ## 12.1.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 8fefaf727da..af58c841a71 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "12.1.0", + "version": "12.2.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,19 +399,19 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "2.1.0", - "@firebase/app": "0.14.1", - "@firebase/app-compat": "0.5.1", + "@firebase/ai": "2.2.0", + "@firebase/app": "0.14.2", + "@firebase/app-compat": "0.5.2", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", "@firebase/data-connect": "0.3.11", "@firebase/database": "1.1.0", "@firebase/database-compat": "2.1.0", - "@firebase/firestore": "4.9.0", - "@firebase/firestore-compat": "0.4.0", - "@firebase/functions": "0.13.0", - "@firebase/functions-compat": "0.4.0", + "@firebase/firestore": "4.9.1", + "@firebase/firestore-compat": "0.4.1", + "@firebase/functions": "0.13.1", + "@firebase/functions-compat": "0.4.1", "@firebase/installations": "0.6.19", "@firebase/installations-compat": "0.2.19", "@firebase/messaging": "0.12.23", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index f7672f1620e..4345e2b808c 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`2058432`](https://github.com/firebase/firebase-js-sdk/commit/2058432e6c8e809d5b695e31fde582e94f1349c5)]: + - @firebase/firestore@4.9.1 + ## 0.4.0 ### Minor Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 66c3a91b752..3ae7c8bb6d0 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.4.0", + "version": "0.4.1", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.7.0", - "@firebase/firestore": "4.9.0", + "@firebase/firestore": "4.9.1", "@firebase/util": "1.13.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 3be572036fa..47ab4e61c30 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/firestore +## 4.9.1 + +### Patch Changes + +- [`2058432`](https://github.com/firebase/firebase-js-sdk/commit/2058432e6c8e809d5b695e31fde582e94f1349c5) [#9177](https://github.com/firebase/firebase-js-sdk/pull/9177) (fixes [#9147](https://github.com/firebase/firebase-js-sdk/issues/9147)) - Fixed a bug where a rejected promise with an empty message in a transaction would cause a timeout. + ## 4.9.0 ### Minor Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 8d95f3bbaf9..625a51020ca 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.9.0", + "version": "4.9.1", "engines": { "node": ">=20.0.0" }, @@ -112,8 +112,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.1", - "@firebase/app-compat": "0.5.1", + "@firebase/app": "0.14.2", + "@firebase/app-compat": "0.5.2", "@firebase/auth": "1.11.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 10cd5a207e4..81ea4679642 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/functions-compat +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`5501791`](https://github.com/firebase/firebase-js-sdk/commit/5501791d0bd665c1c7d4fcd786053a46ceff208c)]: + - @firebase/functions@0.13.1 + ## 0.4.0 ### Minor Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index c4799b9b289..55c31dc9bd6 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions-compat", - "version": "0.4.0", + "version": "0.4.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -63,7 +63,7 @@ "typings": "dist/src/index.d.ts", "dependencies": { "@firebase/component": "0.7.0", - "@firebase/functions": "0.13.0", + "@firebase/functions": "0.13.1", "@firebase/functions-types": "0.6.3", "@firebase/util": "1.13.0", "tslib": "^2.1.0" diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index 545d124f9d5..8b98d691f20 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/functions +## 0.13.1 + +### Patch Changes + +- [`5501791`](https://github.com/firebase/firebase-js-sdk/commit/5501791d0bd665c1c7d4fcd786053a46ceff208c) [#9204](https://github.com/firebase/firebase-js-sdk/pull/9204) - Fixed issue where Firebase Functions SDK caused CORS errors when connected to emulators in Firebase Studio + ## 0.13.0 ### Minor Changes diff --git a/packages/functions/package.json b/packages/functions/package.json index 2bb085c4f5d..c3e20894a8b 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/functions", - "version": "0.13.0", + "version": "0.13.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 0e25a2ddb65..5102c37fcd5 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index d093dc93469..a5ef2efd243 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 00590078b53..1dfe8021e48 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 99e2bebd20d..74438811c69 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 3afbec6ded6..27bac29090e 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.1" + "@firebase/app-compat": "0.5.2" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index 20a15732db1..e6d69780279 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 835e1dffe78..9d24228c146 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.1" + "@firebase/app-compat": "0.5.2" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 89fd56baee0..2ac97aab639 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 0cda2ee6e00..42b24581777 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.1", + "@firebase/app-compat": "0.5.2", "@firebase/auth-compat": "0.6.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 2e71e120414..8f9d1c9182e 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "@firebase/auth": "1.11.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index a61412f89e9..89e3cc1a515 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index f3103efd235..70b42ce4501 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -40,7 +40,7 @@ "yargs": "17.7.2" }, "devDependencies": { - "@firebase/app": "0.14.1", + "@firebase/app": "0.14.2", "@firebase/logger": "0.5.0", "@types/webpack": "5.28.5" }, From 095c098de1e4399f3fb2993edae45060b2a8c6d0 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 28 Aug 2025 16:59:01 -0700 Subject: [PATCH 270/295] remove accidental factory export (#9232) --- .changeset/stupid-files-reflect.md | 5 +++++ common/api-review/ai.api.md | 13 ------------- docs-devsite/ai.md | 23 ----------------------- packages/ai/src/index.ts | 2 +- 4 files changed, 6 insertions(+), 37 deletions(-) create mode 100644 .changeset/stupid-files-reflect.md diff --git a/.changeset/stupid-files-reflect.md b/.changeset/stupid-files-reflect.md new file mode 100644 index 00000000000..b164d4b6317 --- /dev/null +++ b/.changeset/stupid-files-reflect.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Remove accidental `factory` export. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 6d70313a3af..5a8e5df6ab9 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -4,18 +4,10 @@ ```ts -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; -import { ComponentContainer } from '@firebase/component'; import { FirebaseApp } from '@firebase/app'; -import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; -import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; import { FirebaseError } from '@firebase/util'; -import { _FirebaseService } from '@firebase/app'; -import { InstanceFactoryOptions } from '@firebase/component'; -import { Provider } from '@firebase/component'; // @public export interface AI { @@ -245,11 +237,6 @@ export interface ErrorDetails { reason?: string; } -// Warning: (ae-forgotten-export) The symbol "AIService" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export function factory(container: ComponentContainer, { instanceIdentifier }: InstanceFactoryOptions): AIService; - // @public export interface FileData { // (undocumented) diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index c40d37d895e..d70b381d6fe 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -22,8 +22,6 @@ The Firebase AI Web SDK. | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | | [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | | [getLiveGenerativeModel(ai, modelParams)](./ai.md#getlivegenerativemodel_f2099ac) | (Public Preview) Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.The Live API is only supported in modern browser windows and Node >= 22. | -| function(container, ...) | -| [factory(container, { instanceIdentifier })](./ai.md#factory_6581aeb) | | | function(liveSession, ...) | | [startAudioConversation(liveSession, options)](./ai.md#startaudioconversation_01c8e7f) | (Public Preview) Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. | @@ -327,27 +325,6 @@ export declare function getLiveGenerativeModel(ai: AI, modelParams: LiveModelPar If the `apiKey` or `projectId` fields are missing in your Firebase config. -## function(container, ...) - -### factory(container, { instanceIdentifier }) {:#factory_6581aeb} - -Signature: - -```typescript -export declare function factory(container: ComponentContainer, { instanceIdentifier }: InstanceFactoryOptions): AIService; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| container | ComponentContainer | | -| { instanceIdentifier } | InstanceFactoryOptions | | - -Returns: - -AIService - ## function(liveSession, ...) ### startAudioConversation(liveSession, options) {:#startaudioconversation_01c8e7f} diff --git a/packages/ai/src/index.ts b/packages/ai/src/index.ts index 7758c316674..4df73974ef1 100644 --- a/packages/ai/src/index.ts +++ b/packages/ai/src/index.ts @@ -43,7 +43,7 @@ declare global { } } -export function factory( +function factory( container: ComponentContainer, { instanceIdentifier }: InstanceFactoryOptions ): AIService { From 4d834deb2c37c28ad3b551c76aea57f03af369b2 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 28 Aug 2025 17:22:07 -0700 Subject: [PATCH 271/295] Version Packages (#9233) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/stupid-files-reflect.md | 5 ----- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 6 ++++++ packages/ai/package.json | 2 +- packages/firebase/CHANGELOG.md | 7 +++++++ packages/firebase/package.json | 4 ++-- 6 files changed, 17 insertions(+), 9 deletions(-) delete mode 100644 .changeset/stupid-files-reflect.md diff --git a/.changeset/stupid-files-reflect.md b/.changeset/stupid-files-reflect.md deleted file mode 100644 index b164d4b6317..00000000000 --- a/.changeset/stupid-files-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Remove accidental `factory` export. diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 89207a3a789..6a93c1bc284 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "12.2.0", + "firebase": "12.2.1", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index e00fc1b45f1..0d08218a4d4 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/ai +## 2.2.1 + +### Patch Changes + +- [`095c098`](https://github.com/firebase/firebase-js-sdk/commit/095c098de1e4399f3fb2993edae45060b2a8c6d0) [#9232](https://github.com/firebase/firebase-js-sdk/pull/9232) (fixes [#9231](https://github.com/firebase/firebase-js-sdk/issues/9231)) - Remove accidental `factory` export. + ## 2.2.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index dc586a0eb6c..b05f5f44f79 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "2.2.0", + "version": "2.2.1", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index e84d8ff2aab..29f2617cb46 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,12 @@ # firebase +## 12.2.1 + +### Patch Changes + +- Updated dependencies [[`095c098`](https://github.com/firebase/firebase-js-sdk/commit/095c098de1e4399f3fb2993edae45060b2a8c6d0)]: + - @firebase/ai@2.2.1 + ## 12.2.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index af58c841a71..9ab3f71fa11 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "12.2.0", + "version": "12.2.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,7 +399,7 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "2.2.0", + "@firebase/ai": "2.2.1", "@firebase/app": "0.14.2", "@firebase/app-compat": "0.5.2", "@firebase/app-types": "0.9.3", From a4848b401f6e8da16b0d0fdbfd064e8d68566555 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 2 Sep 2025 10:03:16 -0700 Subject: [PATCH 272/295] fix(ai): Fix test script broken by #9232 (#9235) --- .changeset/heavy-teachers-enjoy.md | 5 ++ packages/ai/package.json | 3 +- packages/ai/src/factory-browser.ts | 53 +++++++++++++++++++ packages/ai/src/index.ts | 40 +------------- .../test-utils/get-fake-firebase-services.ts | 8 ++- 5 files changed, 68 insertions(+), 41 deletions(-) create mode 100644 .changeset/heavy-teachers-enjoy.md create mode 100644 packages/ai/src/factory-browser.ts diff --git a/.changeset/heavy-teachers-enjoy.md b/.changeset/heavy-teachers-enjoy.md new file mode 100644 index 00000000000..a5cf0820429 --- /dev/null +++ b/.changeset/heavy-teachers-enjoy.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Refactor component registration. diff --git a/packages/ai/package.json b/packages/ai/package.json index b05f5f44f79..5b219d1bf94 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -35,7 +35,7 @@ "dev": "rollup -c -w", "update-responses": "../../scripts/update_vertexai_responses.sh", "testsetup": "yarn update-responses && yarn ts-node ./test-utils/convert-mocks.ts", - "test": "run-p --npm-path npm lint test:browser", + "test": "run-p --npm-path npm lint type-check test:browser", "test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test", "test:skip-clone": "karma start", "test:browser": "yarn testsetup && karma start", @@ -44,6 +44,7 @@ "test:integration:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha integration/**/*.test.ts --config ../../config/mocharc.node.js", "api-report": "api-extractor run --local --verbose", "typings:public": "node ../../scripts/build/use_typings.js ./dist/ai-public.d.ts", + "type-check": "yarn tsc --noEmit", "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "peerDependencies": { diff --git a/packages/ai/src/factory-browser.ts b/packages/ai/src/factory-browser.ts new file mode 100644 index 00000000000..98b91812397 --- /dev/null +++ b/packages/ai/src/factory-browser.ts @@ -0,0 +1,53 @@ +/** + * @license + * Copyright 2025 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 { + ComponentContainer, + InstanceFactoryOptions +} from '@firebase/component'; +import { AIError } from './errors'; +import { decodeInstanceIdentifier } from './helpers'; +import { chromeAdapterFactory } from './methods/chrome-adapter'; +import { AIService } from './service'; +import { AIErrorCode } from './types'; + +export function factory( + container: ComponentContainer, + { instanceIdentifier }: InstanceFactoryOptions +): AIService { + if (!instanceIdentifier) { + throw new AIError( + AIErrorCode.ERROR, + 'AIService instance identifier is undefined.' + ); + } + + const backend = decodeInstanceIdentifier(instanceIdentifier); + + // getImmediate for FirebaseApp will always succeed + const app = container.getProvider('app').getImmediate(); + const auth = container.getProvider('auth-internal'); + const appCheckProvider = container.getProvider('app-check-internal'); + + return new AIService( + app, + backend, + auth, + appCheckProvider, + chromeAdapterFactory + ); +} diff --git a/packages/ai/src/index.ts b/packages/ai/src/index.ts index 4df73974ef1..9d787c832dd 100644 --- a/packages/ai/src/index.ts +++ b/packages/ai/src/index.ts @@ -22,20 +22,11 @@ */ import { registerVersion, _registerComponent } from '@firebase/app'; -import { AIService } from './service'; import { AI_TYPE } from './constants'; -import { - Component, - ComponentContainer, - ComponentType, - InstanceFactoryOptions -} from '@firebase/component'; +import { Component, ComponentType } from '@firebase/component'; import { name, version } from '../package.json'; -import { decodeInstanceIdentifier } from './helpers'; -import { AIError } from './api'; -import { AIErrorCode } from './types'; -import { chromeAdapterFactory } from './methods/chrome-adapter'; import { LanguageModel } from './types/language-model'; +import { factory } from './factory-browser'; declare global { interface Window { @@ -43,33 +34,6 @@ declare global { } } -function factory( - container: ComponentContainer, - { instanceIdentifier }: InstanceFactoryOptions -): AIService { - if (!instanceIdentifier) { - throw new AIError( - AIErrorCode.ERROR, - 'AIService instance identifier is undefined.' - ); - } - - const backend = decodeInstanceIdentifier(instanceIdentifier); - - // getImmediate for FirebaseApp will always succeed - const app = container.getProvider('app').getImmediate(); - const auth = container.getProvider('auth-internal'); - const appCheckProvider = container.getProvider('app-check-internal'); - - return new AIService( - app, - backend, - auth, - appCheckProvider, - chromeAdapterFactory - ); -} - function registerAI(): void { _registerComponent( new Component(AI_TYPE, factory, ComponentType.PUBLIC).setMultipleInstances( diff --git a/packages/ai/test-utils/get-fake-firebase-services.ts b/packages/ai/test-utils/get-fake-firebase-services.ts index 20ae7fb70be..63789c1a00e 100644 --- a/packages/ai/test-utils/get-fake-firebase-services.ts +++ b/packages/ai/test-utils/get-fake-firebase-services.ts @@ -24,7 +24,7 @@ import { import { Component, ComponentType } from '@firebase/component'; import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; import { AI_TYPE } from '../src/constants'; -import { factory } from '../src'; +import { factory } from '../src/factory-browser'; const fakeConfig = { projectId: 'projectId', @@ -38,7 +38,11 @@ export function getFullApp(fakeAppParams?: { appId?: string; apiKey?: string; }): FirebaseApp { - _registerComponent(new Component(AI_TYPE, factory, ComponentType.PUBLIC)); + _registerComponent( + new Component(AI_TYPE, factory, ComponentType.PUBLIC).setMultipleInstances( + true + ) + ); _registerComponent( new Component( 'app-check-internal', From 55f3f83a7f2ed444f9880e1284f37c667532d13b Mon Sep 17 00:00:00 2001 From: Daymon <17409137+daymxn@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:08:50 -0500 Subject: [PATCH 273/295] Update CHANGELOG.md (#9237) --- packages/ai/CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 0d08218a4d4..f6aeba8f6f6 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -14,7 +14,12 @@ - [`9b63cd6`](https://github.com/firebase/firebase-js-sdk/commit/9b63cd60efcd02b64b0d37f81affb3eabf70f9eb) [#9192](https://github.com/firebase/firebase-js-sdk/pull/9192) - Add `thoughtSummary()` convenience method to `EnhancedGenerateContentResponse`. -- [`02280d7`](https://github.com/firebase/firebase-js-sdk/commit/02280d747863445fa1c21dfda01030412a6cecff) [#9201](https://github.com/firebase/firebase-js-sdk/pull/9201) - Add App Check limited use token option to `getAI()`. +- [`02280d7`](https://github.com/firebase/firebase-js-sdk/commit/02280d747863445fa1c21dfda01030412a6cecff) [#9201](https://github.com/firebase/firebase-js-sdk/pull/9201) - Add support for limited-use tokens with Firebase App Check. + These limited-use tokens are required for an upcoming optional feature called + _replay protection_. We recommend + [enabling the usage of limited-use tokens](https://firebase.google.com/docs/ai-logic/app-check) + now so that when replay protection becomes available, you can enable it sooner + because more of your users will be on versions of your app that send limited-use tokens. ### Patch Changes From 06ab5c4f9b84085068381f6dff5e03b1b7cf4b2c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 9 Sep 2025 11:14:16 -0700 Subject: [PATCH 274/295] feat(ai): Add prefer_in_cloud option for inference mode (#9236) Co-authored-by: Daniel La Rocque Co-authored-by: rachelsaunders <52258509+rachelsaunders@users.noreply.github.com> --- .changeset/feat-prefer-in-cloud.md | 6 + common/api-review/ai.api.md | 1 + docs-devsite/ai.md | 3 + packages/ai/src/methods/count-tokens.test.ts | 26 +- packages/ai/src/methods/count-tokens.ts | 16 +- packages/ai/src/methods/generate-content.ts | 36 +- .../ai/src/models/generative-model.test.ts | 313 +++++++++++++++++- .../ai/src/requests/hybrid-helpers.test.ts | 187 +++++++++++ packages/ai/src/requests/hybrid-helpers.ts | 88 +++++ packages/ai/src/types/enums.ts | 21 +- 10 files changed, 650 insertions(+), 47 deletions(-) create mode 100644 .changeset/feat-prefer-in-cloud.md create mode 100644 packages/ai/src/requests/hybrid-helpers.test.ts create mode 100644 packages/ai/src/requests/hybrid-helpers.ts diff --git a/.changeset/feat-prefer-in-cloud.md b/.changeset/feat-prefer-in-cloud.md new file mode 100644 index 00000000000..90f859c2da8 --- /dev/null +++ b/.changeset/feat-prefer-in-cloud.md @@ -0,0 +1,6 @@ +--- +"@firebase/ai": minor +"firebase": minor +--- + +Added a new `InferenceMode` option for the hybrid on-device capability: `prefer_in_cloud`. When this mode is selected, the SDK will attempt to use a cloud-hosted model first. If the call to the cloud-hosted model fails with a network-related error, the SDK will fall back to the on-device model, if it's available. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 5a8e5df6ab9..43a10169cfa 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -727,6 +727,7 @@ export const InferenceMode: { readonly PREFER_ON_DEVICE: "prefer_on_device"; readonly ONLY_ON_DEVICE: "only_on_device"; readonly ONLY_IN_CLOUD: "only_in_cloud"; + readonly PREFER_IN_CLOUD: "prefer_in_cloud"; }; // @public diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index d70b381d6fe..d94c31155de 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -624,6 +624,8 @@ ImagenSafetyFilterLevel: { (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. +PREFER\_ON\_DEVICE: Attempt to make inference calls using an on-device model. If on-device inference is not available, the SDK will fall back to using a cloud-hosted model.
      ONLY\_ON\_DEVICE: Only attempt to make inference calls using an on-device model. The SDK will not fall back to a cloud-hosted model. If on-device inference is not available, inference methods will throw.
      ONLY\_IN\_CLOUD: Only attempt to make inference calls using a cloud-hosted model. The SDK will not fall back to an on-device model.
      PREFER\_IN\_CLOUD: Attempt to make inference calls to a cloud-hosted model. If not available, the SDK will fall back to an on-device model. + Signature: ```typescript @@ -631,6 +633,7 @@ InferenceMode: { readonly PREFER_ON_DEVICE: "prefer_on_device"; readonly ONLY_ON_DEVICE: "only_on_device"; readonly ONLY_IN_CLOUD: "only_in_cloud"; + readonly PREFER_IN_CLOUD: "prefer_in_cloud"; } ``` diff --git a/packages/ai/src/methods/count-tokens.test.ts b/packages/ai/src/methods/count-tokens.test.ts index 56985b4d54e..aabf06a841a 100644 --- a/packages/ai/src/methods/count-tokens.test.ts +++ b/packages/ai/src/methods/count-tokens.test.ts @@ -196,24 +196,16 @@ describe('countTokens()', () => { ); }); }); - it('on-device', async () => { - const chromeAdapter = fakeChromeAdapter; - const isAvailableStub = stub(chromeAdapter, 'isAvailable').resolves(true); - const mockResponse = getMockResponse( - 'vertexAI', - 'unary-success-total-tokens.json' - ); - const countTokensStub = stub(chromeAdapter, 'countTokens').resolves( - mockResponse as Response + it('throws if mode is ONLY_ON_DEVICE', async () => { + const chromeAdapter = new ChromeAdapterImpl( + // @ts-expect-error + undefined, + InferenceMode.ONLY_ON_DEVICE ); - const result = await countTokens( - fakeApiSettings, - 'model', - fakeRequestParams, - chromeAdapter + await expect( + countTokens(fakeApiSettings, 'model', fakeRequestParams, chromeAdapter) + ).to.be.rejectedWith( + /countTokens\(\) is not supported for on-device models/ ); - expect(result.totalTokens).eq(6); - expect(isAvailableStub).to.be.called; - expect(countTokensStub).to.be.calledWith(fakeRequestParams); }); }); diff --git a/packages/ai/src/methods/count-tokens.ts b/packages/ai/src/methods/count-tokens.ts index 00dde84ab48..ecd86a82912 100644 --- a/packages/ai/src/methods/count-tokens.ts +++ b/packages/ai/src/methods/count-tokens.ts @@ -15,16 +15,20 @@ * limitations under the License. */ +import { AIError } from '../errors'; import { CountTokensRequest, CountTokensResponse, - RequestOptions + InferenceMode, + RequestOptions, + AIErrorCode } from '../types'; import { Task, makeRequest } from '../requests/request'; import { ApiSettings } from '../types/internal'; import * as GoogleAIMapper from '../googleai-mappers'; import { BackendType } from '../public-types'; import { ChromeAdapter } from '../types/chrome-adapter'; +import { ChromeAdapterImpl } from './chrome-adapter'; export async function countTokensOnCloud( apiSettings: ApiSettings, @@ -57,9 +61,13 @@ export async function countTokens( chromeAdapter?: ChromeAdapter, requestOptions?: RequestOptions ): Promise { - if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { - return (await chromeAdapter.countTokens(params)).json(); + if ( + (chromeAdapter as ChromeAdapterImpl)?.mode === InferenceMode.ONLY_ON_DEVICE + ) { + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'countTokens() is not supported for on-device models.' + ); } - return countTokensOnCloud(apiSettings, model, params, requestOptions); } diff --git a/packages/ai/src/methods/generate-content.ts b/packages/ai/src/methods/generate-content.ts index 2c1c383641f..0e65b479343 100644 --- a/packages/ai/src/methods/generate-content.ts +++ b/packages/ai/src/methods/generate-content.ts @@ -29,6 +29,7 @@ import { ApiSettings } from '../types/internal'; import * as GoogleAIMapper from '../googleai-mappers'; import { BackendType } from '../public-types'; import { ChromeAdapter } from '../types/chrome-adapter'; +import { callCloudOrDevice } from '../requests/hybrid-helpers'; async function generateContentStreamOnCloud( apiSettings: ApiSettings, @@ -56,17 +57,13 @@ export async function generateContentStream( chromeAdapter?: ChromeAdapter, requestOptions?: RequestOptions ): Promise { - let response; - if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { - response = await chromeAdapter.generateContentStream(params); - } else { - response = await generateContentStreamOnCloud( - apiSettings, - model, - params, - requestOptions - ); - } + const response = await callCloudOrDevice( + params, + chromeAdapter, + () => chromeAdapter!.generateContentStream(params), + () => + generateContentStreamOnCloud(apiSettings, model, params, requestOptions) + ); return processStream(response, apiSettings); // TODO: Map streaming responses } @@ -96,17 +93,12 @@ export async function generateContent( chromeAdapter?: ChromeAdapter, requestOptions?: RequestOptions ): Promise { - let response; - if (chromeAdapter && (await chromeAdapter.isAvailable(params))) { - response = await chromeAdapter.generateContent(params); - } else { - response = await generateContentOnCloud( - apiSettings, - model, - params, - requestOptions - ); - } + const response = await callCloudOrDevice( + params, + chromeAdapter, + () => chromeAdapter!.generateContent(params), + () => generateContentOnCloud(apiSettings, model, params, requestOptions) + ); const generateContentResponse = await processGenerateContentResponse( response, apiSettings diff --git a/packages/ai/src/models/generative-model.test.ts b/packages/ai/src/models/generative-model.test.ts index 68f1565b26a..9c5074b8eb3 100644 --- a/packages/ai/src/models/generative-model.test.ts +++ b/packages/ai/src/models/generative-model.test.ts @@ -16,15 +16,26 @@ */ import { use, expect } from 'chai'; import { GenerativeModel } from './generative-model'; -import { FunctionCallingMode, AI, InferenceMode } from '../public-types'; +import { + FunctionCallingMode, + AI, + InferenceMode, + AIErrorCode +} from '../public-types'; import * as request from '../requests/request'; -import { match, restore, stub } from 'sinon'; -import { getMockResponse } from '../../test-utils/mock-response'; +import { SinonStub, match, restore, stub } from 'sinon'; +import { + getMockResponse, + getMockResponseStreaming +} from '../../test-utils/mock-response'; import sinonChai from 'sinon-chai'; import { VertexAIBackend } from '../backend'; import { ChromeAdapterImpl } from '../methods/chrome-adapter'; +import { AIError } from '../errors'; +import chaiAsPromised from 'chai-as-promised'; use(sinonChai); +use(chaiAsPromised); const fakeAI: AI = { app: { @@ -406,3 +417,299 @@ describe('GenerativeModel', () => { restore(); }); }); + +describe('GenerativeModel dispatch logic', () => { + let makeRequestStub: SinonStub; + let mockChromeAdapter: ChromeAdapterImpl; + + function stubMakeRequest(stream?: boolean): void { + if (stream) { + makeRequestStub = stub(request, 'makeRequest').resolves( + getMockResponseStreaming( + 'vertexAI', + 'unary-success-basic-reply-short.json' + ) as Response + ); + } else { + makeRequestStub = stub(request, 'makeRequest').resolves( + getMockResponse( + 'vertexAI', + 'unary-success-basic-reply-short.json' + ) as Response + ); + } + } + + beforeEach(() => { + // @ts-ignore + mockChromeAdapter = { + isAvailable: stub(), + generateContent: stub().resolves(new Response(JSON.stringify({}))), + generateContentStream: stub().resolves( + new Response(new ReadableStream()) + ), + countTokens: stub().resolves(new Response(JSON.stringify({}))), + mode: InferenceMode.PREFER_ON_DEVICE + }; + }); + + afterEach(() => { + restore(); + }); + + describe('PREFER_ON_DEVICE', () => { + beforeEach(() => { + mockChromeAdapter.mode = InferenceMode.PREFER_ON_DEVICE; + }); + it('should use on-device for generateContent when available', async () => { + stubMakeRequest(); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(mockChromeAdapter.generateContent).to.have.been.calledOnce; + expect(makeRequestStub).to.not.have.been.called; + }); + it('should use cloud for generateContent when on-device is not available', async () => { + stubMakeRequest(); + (mockChromeAdapter.isAvailable as SinonStub).resolves(false); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(mockChromeAdapter.generateContent).to.not.have.been.called; + expect(makeRequestStub).to.have.been.calledOnce; + }); + it('should use on-device for generateContentStream when available', async () => { + stubMakeRequest(true); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(mockChromeAdapter.generateContentStream).to.have.been.calledOnce; + expect(makeRequestStub).to.not.have.been.called; + }); + it('should use cloud for generateContentStream when on-device is not available', async () => { + stubMakeRequest(true); + (mockChromeAdapter.isAvailable as SinonStub).resolves(false); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(mockChromeAdapter.generateContentStream).to.not.have.been.called; + expect(makeRequestStub).to.have.been.calledOnce; + }); + it('should use cloud for countTokens', async () => { + stubMakeRequest(); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.countTokens('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + }); + }); + + describe('ONLY_ON_DEVICE', () => { + beforeEach(() => { + mockChromeAdapter.mode = InferenceMode.ONLY_ON_DEVICE; + }); + it('should use on-device for generateContent when available', async () => { + stubMakeRequest(); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(mockChromeAdapter.generateContent).to.have.been.calledOnce; + expect(makeRequestStub).to.not.have.been.called; + }); + it('generateContent should throw when on-device is not available', async () => { + stubMakeRequest(); + (mockChromeAdapter.isAvailable as SinonStub).resolves(false); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await expect(model.generateContent('hello')).to.be.rejectedWith( + /on-device model is not available/ + ); + expect(mockChromeAdapter.generateContent).to.not.have.been.called; + expect(makeRequestStub).to.not.have.been.called; + }); + it('should use on-device for generateContentStream when available', async () => { + stubMakeRequest(true); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(mockChromeAdapter.generateContentStream).to.have.been.calledOnce; + expect(makeRequestStub).to.not.have.been.called; + }); + it('generateContentStream should throw when on-device is not available', async () => { + stubMakeRequest(true); + (mockChromeAdapter.isAvailable as SinonStub).resolves(false); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await expect(model.generateContentStream('hello')).to.be.rejectedWith( + /on-device model is not available/ + ); + expect(mockChromeAdapter.generateContent).to.not.have.been.called; + expect(makeRequestStub).to.not.have.been.called; + }); + it('should always throw for countTokens', async () => { + stubMakeRequest(); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await expect(model.countTokens('hello')).to.be.rejectedWith(AIError); + expect(makeRequestStub).to.not.have.been.called; + }); + }); + + describe('ONLY_IN_CLOUD', () => { + beforeEach(() => { + mockChromeAdapter.mode = InferenceMode.ONLY_IN_CLOUD; + }); + it('should use cloud for generateContent even when on-device is available', async () => { + stubMakeRequest(); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContent).to.not.have.been.called; + }); + it('should use cloud for generateContentStream even when on-device is available', async () => { + stubMakeRequest(true); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContentStream).to.not.have.been.called; + }); + it('should always use cloud for countTokens', async () => { + stubMakeRequest(); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.countTokens('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + }); + }); + + describe('PREFER_IN_CLOUD', () => { + beforeEach(() => { + mockChromeAdapter.mode = InferenceMode.PREFER_IN_CLOUD; + }); + it('should use cloud for generateContent when available', async () => { + stubMakeRequest(); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContent).to.not.have.been.called; + }); + it('should fall back to on-device for generateContent if cloud fails', async () => { + makeRequestStub.rejects( + new AIError(AIErrorCode.FETCH_ERROR, 'Network error') + ); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContent('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContent).to.have.been.calledOnce; + }); + it('should use cloud for generateContentStream when available', async () => { + stubMakeRequest(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContentStream).to.not.have.been.called; + }); + it('should fall back to on-device for generateContentStream if cloud fails', async () => { + makeRequestStub.rejects( + new AIError(AIErrorCode.FETCH_ERROR, 'Network error') + ); + (mockChromeAdapter.isAvailable as SinonStub).resolves(true); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.generateContentStream('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + expect(mockChromeAdapter.generateContentStream).to.have.been.calledOnce; + }); + it('should use cloud for countTokens', async () => { + stubMakeRequest(); + const model = new GenerativeModel( + fakeAI, + { model: 'model' }, + {}, + mockChromeAdapter + ); + await model.countTokens('hello'); + expect(makeRequestStub).to.have.been.calledOnce; + }); + }); +}); diff --git a/packages/ai/src/requests/hybrid-helpers.test.ts b/packages/ai/src/requests/hybrid-helpers.test.ts new file mode 100644 index 00000000000..a758f34ad21 --- /dev/null +++ b/packages/ai/src/requests/hybrid-helpers.test.ts @@ -0,0 +1,187 @@ +/** + * @license + * Copyright 2025 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 { use, expect } from 'chai'; +import { SinonStub, SinonStubbedInstance, restore, stub } from 'sinon'; +import { callCloudOrDevice } from './hybrid-helpers'; +import { GenerateContentRequest, InferenceMode, AIErrorCode } from '../types'; +import { AIError } from '../errors'; +import sinonChai from 'sinon-chai'; +import chaiAsPromised from 'chai-as-promised'; +import { ChromeAdapterImpl } from '../methods/chrome-adapter'; + +use(sinonChai); +use(chaiAsPromised); + +describe('callCloudOrDevice', () => { + let chromeAdapter: SinonStubbedInstance; + let onDeviceCall: SinonStub; + let inCloudCall: SinonStub; + let request: GenerateContentRequest; + + beforeEach(() => { + // @ts-ignore + chromeAdapter = { + mode: InferenceMode.PREFER_ON_DEVICE, + isAvailable: stub(), + generateContent: stub(), + generateContentStream: stub(), + countTokens: stub() + }; + onDeviceCall = stub().resolves('on-device-response'); + inCloudCall = stub().resolves('in-cloud-response'); + request = { contents: [] }; + }); + + afterEach(() => { + restore(); + }); + + it('should call inCloudCall if chromeAdapter is undefined', async () => { + const result = await callCloudOrDevice( + request, + undefined, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('in-cloud-response'); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.not.have.been.called; + }); + + describe('PREFER_ON_DEVICE mode', () => { + beforeEach(() => { + chromeAdapter.mode = InferenceMode.PREFER_ON_DEVICE; + }); + + it('should call onDeviceCall if available', async () => { + chromeAdapter.isAvailable.resolves(true); + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('on-device-response'); + expect(onDeviceCall).to.have.been.calledOnce; + expect(inCloudCall).to.not.have.been.called; + }); + + it('should call inCloudCall if not available', async () => { + chromeAdapter.isAvailable.resolves(false); + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('in-cloud-response'); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.not.have.been.called; + }); + }); + + describe('ONLY_ON_DEVICE mode', () => { + beforeEach(() => { + chromeAdapter.mode = InferenceMode.ONLY_ON_DEVICE; + }); + + it('should call onDeviceCall if available', async () => { + chromeAdapter.isAvailable.resolves(true); + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('on-device-response'); + expect(onDeviceCall).to.have.been.calledOnce; + expect(inCloudCall).to.not.have.been.called; + }); + + it('should throw if not available', async () => { + chromeAdapter.isAvailable.resolves(false); + await expect( + callCloudOrDevice(request, chromeAdapter, onDeviceCall, inCloudCall) + ).to.be.rejectedWith(/on-device model is not available/); + expect(inCloudCall).to.not.have.been.called; + expect(onDeviceCall).to.not.have.been.called; + }); + }); + + describe('ONLY_IN_CLOUD mode', () => { + beforeEach(() => { + chromeAdapter.mode = InferenceMode.ONLY_IN_CLOUD; + }); + + it('should call inCloudCall even if on-device is available', async () => { + chromeAdapter.isAvailable.resolves(true); + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('in-cloud-response'); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.not.have.been.called; + }); + }); + + describe('PREFER_IN_CLOUD mode', () => { + beforeEach(() => { + chromeAdapter.mode = InferenceMode.PREFER_IN_CLOUD; + }); + + it('should call inCloudCall first', async () => { + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('in-cloud-response'); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.not.have.been.called; + }); + + it('should fall back to onDeviceCall if inCloudCall fails with AIErrorCode.FETCH_ERROR', async () => { + inCloudCall.rejects( + new AIError(AIErrorCode.FETCH_ERROR, 'Network error') + ); + const result = await callCloudOrDevice( + request, + chromeAdapter, + onDeviceCall, + inCloudCall + ); + expect(result).to.equal('on-device-response'); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.have.been.calledOnce; + }); + + it('should re-throw other errors from inCloudCall', async () => { + const error = new AIError(AIErrorCode.RESPONSE_ERROR, 'safety problem'); + inCloudCall.rejects(error); + await expect( + callCloudOrDevice(request, chromeAdapter, onDeviceCall, inCloudCall) + ).to.be.rejectedWith(error); + expect(inCloudCall).to.have.been.calledOnce; + expect(onDeviceCall).to.not.have.been.called; + }); + }); +}); diff --git a/packages/ai/src/requests/hybrid-helpers.ts b/packages/ai/src/requests/hybrid-helpers.ts new file mode 100644 index 00000000000..3140594c00e --- /dev/null +++ b/packages/ai/src/requests/hybrid-helpers.ts @@ -0,0 +1,88 @@ +/** + * @license + * Copyright 2025 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 { AIError } from '../errors'; +import { + GenerateContentRequest, + InferenceMode, + AIErrorCode, + ChromeAdapter +} from '../types'; +import { ChromeAdapterImpl } from '../methods/chrome-adapter'; + +const errorsCausingFallback: AIErrorCode[] = [ + // most network errors + AIErrorCode.FETCH_ERROR, + // fallback code for all other errors in makeRequest + AIErrorCode.ERROR, + // error due to API not being enabled in project + AIErrorCode.API_NOT_ENABLED +]; + +/** + * Dispatches a request to the appropriate backend (on-device or in-cloud) + * based on the inference mode. + * + * @param request - The request to be sent. + * @param chromeAdapter - The on-device model adapter. + * @param onDeviceCall - The function to call for on-device inference. + * @param inCloudCall - The function to call for in-cloud inference. + * @returns The response from the backend. + */ +export async function callCloudOrDevice( + request: GenerateContentRequest, + chromeAdapter: ChromeAdapter | undefined, + onDeviceCall: () => Promise, + inCloudCall: () => Promise +): Promise { + if (!chromeAdapter) { + return inCloudCall(); + } + switch ((chromeAdapter as ChromeAdapterImpl).mode) { + case InferenceMode.ONLY_ON_DEVICE: + if (await chromeAdapter.isAvailable(request)) { + return onDeviceCall(); + } + throw new AIError( + AIErrorCode.UNSUPPORTED, + 'Inference mode is ONLY_ON_DEVICE, but an on-device model is not available.' + ); + case InferenceMode.ONLY_IN_CLOUD: + return inCloudCall(); + case InferenceMode.PREFER_IN_CLOUD: + try { + return await inCloudCall(); + } catch (e) { + if (e instanceof AIError && errorsCausingFallback.includes(e.code)) { + return onDeviceCall(); + } + throw e; + } + case InferenceMode.PREFER_ON_DEVICE: + if (await chromeAdapter.isAvailable(request)) { + return onDeviceCall(); + } + return inCloudCall(); + default: + throw new AIError( + AIErrorCode.ERROR, + `Unexpected infererence mode: ${ + (chromeAdapter as ChromeAdapterImpl).mode + }` + ); + } +} diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 701cd4a695d..de70d325157 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -347,17 +347,36 @@ export type ResponseModality = /** * (EXPERIMENTAL) * Determines whether inference happens on-device or in-cloud. + * + * @remarks + * PREFER_ON_DEVICE: Attempt to make inference calls using an + * on-device model. If on-device inference is not available, the SDK + * will fall back to using a cloud-hosted model. + *
      + * ONLY_ON_DEVICE: Only attempt to make inference calls using an + * on-device model. The SDK will not fall back to a cloud-hosted model. + * If on-device inference is not available, inference methods will throw. + *
      + * ONLY_IN_CLOUD: Only attempt to make inference calls using a + * cloud-hosted model. The SDK will not fall back to an on-device model. + *
      + * PREFER_IN_CLOUD: Attempt to make inference calls to a + * cloud-hosted model. If not available, the SDK will fall back to an + * on-device model. + * * @public */ export const InferenceMode = { 'PREFER_ON_DEVICE': 'prefer_on_device', 'ONLY_ON_DEVICE': 'only_on_device', - 'ONLY_IN_CLOUD': 'only_in_cloud' + 'ONLY_IN_CLOUD': 'only_in_cloud', + 'PREFER_IN_CLOUD': 'prefer_in_cloud' } as const; /** * (EXPERIMENTAL) * Determines whether inference happens on-device or in-cloud. + * * @public */ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; From 120a30838da50f5ade4f634e97c34cbfcaff41ba Mon Sep 17 00:00:00 2001 From: Tushar Khandelwal <64364243+tusharkhandelwal8@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:43:55 +0530 Subject: [PATCH 275/295] Remote Config Realtime for Web (#9221) --- .changeset/lemon-baboons-lick.md | 7 + common/api-review/remote-config.api.md | 23 + docs-devsite/_toc.yaml | 4 + docs-devsite/remote-config.configupdate.md | 39 + .../remote-config.configupdateobserver.md | 59 ++ docs-devsite/remote-config.fetchresponse.md | 11 + docs-devsite/remote-config.md | 52 + packages/remote-config/src/api.ts | 40 +- .../remote-config/src/client/eventEmitter.ts | 104 ++ .../src/client/realtime_handler.ts | 715 ++++++++++++++ .../src/client/remote_config_fetch_client.ts | 16 +- .../remote-config/src/client/rest_client.ts | 6 +- .../src/client/visibility_monitor.ts | 86 ++ packages/remote-config/src/errors.ts | 20 +- packages/remote-config/src/public_types.ts | 68 +- packages/remote-config/src/register.ts | 17 +- packages/remote-config/src/remote_config.ts | 7 +- packages/remote-config/src/storage/storage.ts | 32 +- packages/remote-config/test/api.test.ts | 113 ++- .../test/client/realtime_handler.test.ts | 911 ++++++++++++++++++ .../test/client/rest_client.test.ts | 21 +- .../remote-config/test/remote_config.test.ts | 50 +- 22 files changed, 2378 insertions(+), 23 deletions(-) create mode 100644 .changeset/lemon-baboons-lick.md create mode 100644 docs-devsite/remote-config.configupdate.md create mode 100644 docs-devsite/remote-config.configupdateobserver.md create mode 100644 packages/remote-config/src/client/eventEmitter.ts create mode 100644 packages/remote-config/src/client/realtime_handler.ts create mode 100644 packages/remote-config/src/client/visibility_monitor.ts create mode 100644 packages/remote-config/test/client/realtime_handler.test.ts diff --git a/.changeset/lemon-baboons-lick.md b/.changeset/lemon-baboons-lick.md new file mode 100644 index 00000000000..3414d4c9bde --- /dev/null +++ b/.changeset/lemon-baboons-lick.md @@ -0,0 +1,7 @@ +--- +'@firebase/remote-config': minor +'firebase': minor +'@firebase/remote-config-types': minor +--- + +Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling. diff --git a/common/api-review/remote-config.api.md b/common/api-review/remote-config.api.md index 213335929dd..a9f5131e0bf 100644 --- a/common/api-review/remote-config.api.md +++ b/common/api-review/remote-config.api.md @@ -5,10 +5,23 @@ ```ts import { FirebaseApp } from '@firebase/app'; +import { FirebaseError } from '@firebase/app'; // @public export function activate(remoteConfig: RemoteConfig): Promise; +// @public +export interface ConfigUpdate { + getUpdatedKeys(): Set; +} + +// @public +export interface ConfigUpdateObserver { + complete: () => void; + error: (error: FirebaseError) => void; + next: (configUpdate: ConfigUpdate) => void; +} + // @public export interface CustomSignals { // (undocumented) @@ -29,11 +42,15 @@ export interface FetchResponse { config?: FirebaseRemoteConfigObject; eTag?: string; status: number; + templateVersion?: number; } // @public export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; +// @public +export type FetchType = 'BASE' | 'REALTIME'; + // @public export interface FirebaseRemoteConfigObject { // (undocumented) @@ -64,6 +81,9 @@ export function isSupported(): Promise; // @public export type LogLevel = 'debug' | 'error' | 'silent'; +// @public +export function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe; + // @public export interface RemoteConfig { app: FirebaseApp; @@ -93,6 +113,9 @@ export function setCustomSignals(remoteConfig: RemoteConfig, customSignals: Cust // @public export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void; +// @public +export type Unsubscribe = () => void; + // @public export interface Value { asBoolean(): boolean; diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 9161f501aa3..379be5dd29d 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -631,6 +631,10 @@ toc: - title: remote-config path: /docs/reference/js/remote-config.md section: + - title: ConfigUpdate + path: /docs/reference/js/remote-config.configupdate.md + - title: ConfigUpdateObserver + path: /docs/reference/js/remote-config.configupdateobserver.md - title: CustomSignals path: /docs/reference/js/remote-config.customsignals.md - title: FetchResponse diff --git a/docs-devsite/remote-config.configupdate.md b/docs-devsite/remote-config.configupdate.md new file mode 100644 index 00000000000..231c8b1eb1f --- /dev/null +++ b/docs-devsite/remote-config.configupdate.md @@ -0,0 +1,39 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ConfigUpdate interface +Contains information about which keys have been updated. + +Signature: + +```typescript +export interface ConfigUpdate +``` + +## Methods + +| Method | Description | +| --- | --- | +| [getUpdatedKeys()](./remote-config.configupdate.md#configupdategetupdatedkeys) | Parameter keys whose values have been updated from the currently activated values. Includes keys that are added, deleted, or whose value, value source, or metadata has changed. | + +## ConfigUpdate.getUpdatedKeys() + +Parameter keys whose values have been updated from the currently activated values. Includes keys that are added, deleted, or whose value, value source, or metadata has changed. + +Signature: + +```typescript +getUpdatedKeys(): Set; +``` +Returns: + +Set<string> + diff --git a/docs-devsite/remote-config.configupdateobserver.md b/docs-devsite/remote-config.configupdateobserver.md new file mode 100644 index 00000000000..93f9154bb91 --- /dev/null +++ b/docs-devsite/remote-config.configupdateobserver.md @@ -0,0 +1,59 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ConfigUpdateObserver interface +Observer interface for receiving real-time Remote Config update notifications. + +NOTE: Although an `complete` callback can be provided, it will never be called because the ConfigUpdate stream is never-ending. + +Signature: + +```typescript +export interface ConfigUpdateObserver +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [complete](./remote-config.configupdateobserver.md#configupdateobservercomplete) | () => void | Called when the stream is gracefully terminated. | +| [error](./remote-config.configupdateobserver.md#configupdateobservererror) | (error: [FirebaseError](./util.firebaseerror.md#firebaseerror_class)) => void | Called if an error occurs during the stream. | +| [next](./remote-config.configupdateobserver.md#configupdateobservernext) | (configUpdate: [ConfigUpdate](./remote-config.configupdate.md#configupdate_interface)) => void | Called when a new ConfigUpdate is available. | + +## ConfigUpdateObserver.complete + +Called when the stream is gracefully terminated. + +Signature: + +```typescript +complete: () => void; +``` + +## ConfigUpdateObserver.error + +Called if an error occurs during the stream. + +Signature: + +```typescript +error: (error: FirebaseError) => void; +``` + +## ConfigUpdateObserver.next + +Called when a new ConfigUpdate is available. + +Signature: + +```typescript +next: (configUpdate: ConfigUpdate) => void; +``` diff --git a/docs-devsite/remote-config.fetchresponse.md b/docs-devsite/remote-config.fetchresponse.md index 414188e72bb..1955dd47492 100644 --- a/docs-devsite/remote-config.fetchresponse.md +++ b/docs-devsite/remote-config.fetchresponse.md @@ -27,6 +27,7 @@ export interface FetchResponse | [config](./remote-config.fetchresponse.md#fetchresponseconfig) | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines the map of parameters returned as "entries" in the fetch response body.

      Only defined for 200 responses. | | [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value.

      Only defined for 200 and 304 responses. | | [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without.

      The Remote Config client is modeled after the native Fetch interface, so HTTP status is first-class.

      Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. | +| [templateVersion](./remote-config.fetchresponse.md#fetchresponsetemplateversion) | number | The version number of the config template fetched from the server. | ## FetchResponse.config @@ -65,3 +66,13 @@ The HTTP status, which is useful for differentiating success responses with data ```typescript status: number; ``` + +## FetchResponse.templateVersion + +The version number of the config template fetched from the server. + +Signature: + +```typescript +templateVersion?: number; +``` diff --git a/docs-devsite/remote-config.md b/docs-devsite/remote-config.md index 58d23cfd647..c9f803abf16 100644 --- a/docs-devsite/remote-config.md +++ b/docs-devsite/remote-config.md @@ -28,6 +28,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | [getNumber(remoteConfig, key)](./remote-config.md#getnumber_476c09f) | Gets the value for the given key as a number.Convenience method for calling remoteConfig.getValue(key).asNumber(). | | [getString(remoteConfig, key)](./remote-config.md#getstring_476c09f) | Gets the value for the given key as a string. Convenience method for calling remoteConfig.getValue(key).asString(). | | [getValue(remoteConfig, key)](./remote-config.md#getvalue_476c09f) | Gets the [Value](./remote-config.value.md#value_interface) for the given key. | +| [onConfigUpdate(remoteConfig, observer)](./remote-config.md#onconfigupdate_8b13b26) | Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available. | | [setCustomSignals(remoteConfig, customSignals)](./remote-config.md#setcustomsignals_aeeb95e) | Sets the custom signals for the app instance. | | [setLogLevel(remoteConfig, logLevel)](./remote-config.md#setloglevel_039a45b) | Defines the log level to use. | | function() | @@ -37,6 +38,8 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | Interface | Description | | --- | --- | +| [ConfigUpdate](./remote-config.configupdate.md#configupdate_interface) | Contains information about which keys have been updated. | +| [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) | Observer interface for receiving real-time Remote Config update notifications.NOTE: Although an complete callback can be provided, it will never be called because the ConfigUpdate stream is never-ending. | | [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.

      The values in CustomSignals must be one of the following types:

      • string
      • number
      • null
      | | [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Defines a successful response (200 or 304).

      Modeled after the native Response interface, but simplified for Remote Config's use case. | | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines a self-descriptive reference for config key-value pairs. | @@ -50,7 +53,9 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm | Type Alias | Description | | --- | --- | | [FetchStatus](./remote-config.md#fetchstatus) | Summarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.

      • "no-fetch-yet" indicates the [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) instance has not yet attempted to fetch config, or that SDK initialization is incomplete.
      • "success" indicates the last attempt succeeded.
      • "failure" indicates the last attempt failed.
      • "throttle" indicates the last attempt was rate-limited.
      | +| [FetchType](./remote-config.md#fetchtype) | Indicates the type of fetch request.
      • "BASE" indicates a standard fetch request.
      • "REALTIME" indicates a fetch request triggered by a real-time update.
      | | [LogLevel](./remote-config.md#loglevel) | Defines levels of Remote Config logging. | +| [Unsubscribe](./remote-config.md#unsubscribe) | A function that unsubscribes from a real-time event stream. | | [ValueSource](./remote-config.md#valuesource) | Indicates the source of a value.
      • "static" indicates the value was defined by a static constant.
      • "default" indicates the value was defined by default config.
      • "remote" indicates the value was defined by fetched config.
      | ## function(app, ...) @@ -282,6 +287,31 @@ export declare function getValue(remoteConfig: RemoteConfig, key: string): Value The value for the given key. +### onConfigUpdate(remoteConfig, observer) {:#onconfigupdate_8b13b26} + +Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available. + +If a connection to the Remote Config backend is not already open, calling this method will open it. Multiple listeners can be added by calling this method again, but subsequent calls re-use the same connection to the backend. + +Signature: + +```typescript +export declare function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| remoteConfig | [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) instance. | +| observer | [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) | The [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) to be notified of config updates. | + +Returns: + +[Unsubscribe](./remote-config.md#unsubscribe) + +An [Unsubscribe](./remote-config.md#unsubscribe) function to remove the listener. + ### setCustomSignals(remoteConfig, customSignals) {:#setcustomsignals_aeeb95e} Sets the custom signals for the app instance. @@ -355,6 +385,18 @@ Summarizes the outcome of the last attempt to fetch config from the Firebase Rem export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; ``` +## FetchType + +Indicates the type of fetch request. + +
      • "BASE" indicates a standard fetch request.
      • "REALTIME" indicates a fetch request triggered by a real-time update.
      + +Signature: + +```typescript +export type FetchType = 'BASE' | 'REALTIME'; +``` + ## LogLevel Defines levels of Remote Config logging. @@ -365,6 +407,16 @@ Defines levels of Remote Config logging. export type LogLevel = 'debug' | 'error' | 'silent'; ``` +## Unsubscribe + +A function that unsubscribes from a real-time event stream. + +Signature: + +```typescript +export type Unsubscribe = () => void; +``` + ## ValueSource Indicates the source of a value. diff --git a/packages/remote-config/src/api.ts b/packages/remote-config/src/api.ts index 1431864edd5..62dc2697a64 100644 --- a/packages/remote-config/src/api.ts +++ b/packages/remote-config/src/api.ts @@ -22,7 +22,9 @@ import { LogLevel as RemoteConfigLogLevel, RemoteConfig, Value, - RemoteConfigOptions + RemoteConfigOptions, + ConfigUpdateObserver, + Unsubscribe } from './public_types'; import { RemoteConfigAbortSignal } from './client/remote_config_fetch_client'; import { @@ -66,6 +68,9 @@ export function getRemoteConfig( rc._initializePromise = Promise.all([ rc._storage.setLastSuccessfulFetchResponse(options.initialFetchResponse), rc._storage.setActiveConfigEtag(options.initialFetchResponse?.eTag || ''), + rc._storage.setActiveConfigTemplateVersion( + options.initialFetchResponse.templateVersion || 0 + ), rc._storageCache.setLastSuccessfulFetchTimestampMillis(Date.now()), rc._storageCache.setLastFetchStatus('success'), rc._storageCache.setActiveConfig( @@ -98,6 +103,7 @@ export async function activate(remoteConfig: RemoteConfig): Promise { !lastSuccessfulFetchResponse || !lastSuccessfulFetchResponse.config || !lastSuccessfulFetchResponse.eTag || + !lastSuccessfulFetchResponse.templateVersion || lastSuccessfulFetchResponse.eTag === activeConfigEtag ) { // Either there is no successful fetched config, or is the same as current active @@ -106,7 +112,10 @@ export async function activate(remoteConfig: RemoteConfig): Promise { } await Promise.all([ rc._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config), - rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag) + rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag), + rc._storage.setActiveConfigTemplateVersion( + lastSuccessfulFetchResponse.templateVersion + ) ]); return true; } @@ -351,3 +360,30 @@ export async function setCustomSignals( ); } } + +// TODO: Add public document for the Remote Config Realtime API guide on the Web Platform. +/** + * Starts listening for real-time config updates from the Remote Config backend and automatically + * fetches updates from the Remote Config backend when they are available. + * + * @remarks + * If a connection to the Remote Config backend is not already open, calling this method will + * open it. Multiple listeners can be added by calling this method again, but subsequent calls + * re-use the same connection to the backend. + * + * @param remoteConfig - The {@link RemoteConfig} instance. + * @param observer - The {@link ConfigUpdateObserver} to be notified of config updates. + * @returns An {@link Unsubscribe} function to remove the listener. + * + * @public + */ +export function onConfigUpdate( + remoteConfig: RemoteConfig, + observer: ConfigUpdateObserver +): Unsubscribe { + const rc = getModularInstance(remoteConfig) as RemoteConfigImpl; + rc._realtimeHandler.addObserver(observer); + return () => { + rc._realtimeHandler.removeObserver(observer); + }; +} diff --git a/packages/remote-config/src/client/eventEmitter.ts b/packages/remote-config/src/client/eventEmitter.ts new file mode 100644 index 00000000000..10e2201ba2b --- /dev/null +++ b/packages/remote-config/src/client/eventEmitter.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2025 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 { assert } from '@firebase/util'; + +// TODO: Consolidate the Visibility monitoring API code into a shared utility function in firebase/util to be used by both packages/database and packages/remote-config. +/** + * Base class to be used if you want to emit events. Call the constructor with + * the set of allowed event names. + */ +export abstract class EventEmitter { + private listeners_: { + [eventType: string]: Array<{ + callback(...args: unknown[]): void; + context: unknown; + }>; + } = {}; + + constructor(private allowedEvents_: string[]) { + assert( + Array.isArray(allowedEvents_) && allowedEvents_.length > 0, + 'Requires a non-empty array' + ); + } + + /** + * To be overridden by derived classes in order to fire an initial event when + * somebody subscribes for data. + * + * @returns {Array.<*>} Array of parameters to trigger initial event with. + */ + abstract getInitialEvent(eventType: string): unknown[]; + + /** + * To be called by derived classes to trigger events. + */ + protected trigger(eventType: string, ...varArgs: unknown[]): void { + if (Array.isArray(this.listeners_[eventType])) { + // Clone the list, since callbacks could add/remove listeners. + const listeners = [...this.listeners_[eventType]]; + + for (let i = 0; i < listeners.length; i++) { + listeners[i].callback.apply(listeners[i].context, varArgs); + } + } + } + + on( + eventType: string, + callback: (a: unknown) => void, + context: unknown + ): void { + this.validateEventType_(eventType); + this.listeners_[eventType] = this.listeners_[eventType] || []; + this.listeners_[eventType].push({ callback, context }); + + const eventData = this.getInitialEvent(eventType); + if (eventData) { + //@ts-ignore + callback.apply(context, eventData); + } + } + + off( + eventType: string, + callback: (a: unknown) => void, + context: unknown + ): void { + this.validateEventType_(eventType); + const listeners = this.listeners_[eventType] || []; + for (let i = 0; i < listeners.length; i++) { + if ( + listeners[i].callback === callback && + (!context || context === listeners[i].context) + ) { + listeners.splice(i, 1); + return; + } + } + } + + private validateEventType_(eventType: string): void { + assert( + this.allowedEvents_.find(et => { + return et === eventType; + }), + 'Unknown event: ' + eventType + ); + } +} diff --git a/packages/remote-config/src/client/realtime_handler.ts b/packages/remote-config/src/client/realtime_handler.ts new file mode 100644 index 00000000000..2ed244b5bd4 --- /dev/null +++ b/packages/remote-config/src/client/realtime_handler.ts @@ -0,0 +1,715 @@ +/** + * @license + * Copyright 2025 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 { _FirebaseInstallationsInternal } from '@firebase/installations'; +import { Logger } from '@firebase/logger'; +import { + ConfigUpdate, + ConfigUpdateObserver, + FetchResponse, + FirebaseRemoteConfigObject +} from '../public_types'; +import { calculateBackoffMillis, FirebaseError } from '@firebase/util'; +import { ERROR_FACTORY, ErrorCode } from '../errors'; +import { Storage } from '../storage/storage'; +import { VisibilityMonitor } from './visibility_monitor'; +import { StorageCache } from '../storage/storage_cache'; +import { + FetchRequest, + RemoteConfigAbortSignal +} from './remote_config_fetch_client'; +import { CachingClient } from './caching_client'; + +const API_KEY_HEADER = 'X-Goog-Api-Key'; +const INSTALLATIONS_AUTH_TOKEN_HEADER = 'X-Goog-Firebase-Installations-Auth'; +const ORIGINAL_RETRIES = 8; +const MAXIMUM_FETCH_ATTEMPTS = 3; +const NO_BACKOFF_TIME_IN_MILLIS = -1; +const NO_FAILED_REALTIME_STREAMS = 0; +const REALTIME_DISABLED_KEY = 'featureDisabled'; +const REALTIME_RETRY_INTERVAL = 'retryIntervalSeconds'; +const TEMPLATE_VERSION_KEY = 'latestTemplateVersionNumber'; + +export class RealtimeHandler { + constructor( + private readonly firebaseInstallations: _FirebaseInstallationsInternal, + private readonly storage: Storage, + private readonly sdkVersion: string, + private readonly namespace: string, + private readonly projectId: string, + private readonly apiKey: string, + private readonly appId: string, + private readonly logger: Logger, + private readonly storageCache: StorageCache, + private readonly cachingClient: CachingClient + ) { + void this.setRetriesRemaining(); + void VisibilityMonitor.getInstance().on( + 'visible', + this.onVisibilityChange, + this + ); + } + + private observers: Set = + new Set(); + private isConnectionActive: boolean = false; + private isRealtimeDisabled: boolean = false; + private controller?: AbortController; + private reader: ReadableStreamDefaultReader | undefined; + private httpRetriesRemaining: number = ORIGINAL_RETRIES; + private isInBackground: boolean = false; + private readonly decoder = new TextDecoder('utf-8'); + private isClosingConnection: boolean = false; + + private async setRetriesRemaining(): Promise { + // Retrieve number of remaining retries from last session. The minimum retry count being one. + const metadata = await this.storage.getRealtimeBackoffMetadata(); + const numFailedStreams = metadata?.numFailedStreams || 0; + this.httpRetriesRemaining = Math.max( + ORIGINAL_RETRIES - numFailedStreams, + 1 + ); + } + + private propagateError = (e: FirebaseError): void => + this.observers.forEach(o => o.error?.(e)); + + /** + * Increment the number of failed stream attempts, increase the backoff duration, set the backoff + * end time to "backoff duration" after `lastFailedStreamTime` and persist the new + * values to storage metadata. + */ + private async updateBackoffMetadataWithLastFailedStreamConnectionTime( + lastFailedStreamTime: Date + ): Promise { + const numFailedStreams = + ((await this.storage.getRealtimeBackoffMetadata())?.numFailedStreams || + 0) + 1; + const backoffMillis = calculateBackoffMillis(numFailedStreams, 60000, 2); + await this.storage.setRealtimeBackoffMetadata({ + backoffEndTimeMillis: new Date( + lastFailedStreamTime.getTime() + backoffMillis + ), + numFailedStreams + }); + } + + /** + * Increase the backoff duration with a new end time based on Retry Interval. + */ + private async updateBackoffMetadataWithRetryInterval( + retryIntervalSeconds: number + ): Promise { + const currentTime = Date.now(); + const backoffDurationInMillis = retryIntervalSeconds * 1000; + const backoffEndTime = new Date(currentTime + backoffDurationInMillis); + const numFailedStreams = 0; + await this.storage.setRealtimeBackoffMetadata({ + backoffEndTimeMillis: backoffEndTime, + numFailedStreams + }); + await this.retryHttpConnectionWhenBackoffEnds(); + } + + /** + * HTTP status code that the Realtime client should retry on. + */ + private isStatusCodeRetryable = (statusCode?: number): boolean => { + const retryableStatusCodes = [ + 408, // Request Timeout + 429, // Too Many Requests + 502, // Bad Gateway + 503, // Service Unavailable + 504 // Gateway Timeout + ]; + return !statusCode || retryableStatusCodes.includes(statusCode); + }; + + /** + * Closes the realtime HTTP connection. + * Note: This method is designed to be called only once at a time. + * If a call is already in progress, subsequent calls will be ignored. + */ + private async closeRealtimeHttpConnection(): Promise { + if (this.isClosingConnection) { + return; + } + this.isClosingConnection = true; + + try { + if (this.reader) { + await this.reader.cancel(); + } + } catch (e) { + // The network connection was lost, so cancel() failed. + // This is expected in a disconnected state, so we can safely ignore the error. + this.logger.debug('Failed to cancel the reader, connection was lost.'); + } finally { + this.reader = undefined; + } + + if (this.controller) { + await this.controller.abort(); + this.controller = undefined; + } + + this.isClosingConnection = false; + } + + private async resetRealtimeBackoff(): Promise { + await this.storage.setRealtimeBackoffMetadata({ + backoffEndTimeMillis: new Date(-1), + numFailedStreams: 0 + }); + } + + private resetRetryCount(): void { + this.httpRetriesRemaining = ORIGINAL_RETRIES; + } + + /** + * Assembles the request headers and body and executes the fetch request to + * establish the real-time streaming connection. This is the "worker" method + * that performs the actual network communication. + */ + private async establishRealtimeConnection( + url: URL, + installationId: string, + installationTokenResult: string, + signal: AbortSignal + ): Promise { + const eTagValue = await this.storage.getActiveConfigEtag(); + const lastKnownVersionNumber = + await this.storage.getActiveConfigTemplateVersion(); + + const headers = { + [API_KEY_HEADER]: this.apiKey, + [INSTALLATIONS_AUTH_TOKEN_HEADER]: installationTokenResult, + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'If-None-Match': eTagValue || '*', + 'Content-Encoding': 'gzip' + }; + + const requestBody = { + project: this.projectId, + namespace: this.namespace, + lastKnownVersionNumber, + appId: this.appId, + sdkVersion: this.sdkVersion, + appInstanceId: installationId + }; + + const response = await fetch(url, { + method: 'POST', + headers, + body: JSON.stringify(requestBody), + signal + }); + return response; + } + + private getRealtimeUrl(): URL { + const urlBase = + window.FIREBASE_REMOTE_CONFIG_URL_BASE || + 'https://firebaseremoteconfigrealtime.googleapis.com'; + + const urlString = `${urlBase}/v1/projects/${this.projectId}/namespaces/${this.namespace}:streamFetchInvalidations?key=${this.apiKey}`; + return new URL(urlString); + } + + private async createRealtimeConnection(): Promise { + const [installationId, installationTokenResult] = await Promise.all([ + this.firebaseInstallations.getId(), + this.firebaseInstallations.getToken(false) + ]); + this.controller = new AbortController(); + const url = this.getRealtimeUrl(); + const realtimeConnection = await this.establishRealtimeConnection( + url, + installationId, + installationTokenResult, + this.controller.signal + ); + return realtimeConnection; + } + + /** + * Retries HTTP stream connection asyncly in random time intervals. + */ + private async retryHttpConnectionWhenBackoffEnds(): Promise { + let backoffMetadata = await this.storage.getRealtimeBackoffMetadata(); + if (!backoffMetadata) { + backoffMetadata = { + backoffEndTimeMillis: new Date(NO_BACKOFF_TIME_IN_MILLIS), + numFailedStreams: NO_FAILED_REALTIME_STREAMS + }; + } + const backoffEndTime = new Date( + backoffMetadata.backoffEndTimeMillis + ).getTime(); + const currentTime = Date.now(); + const retryMillis = Math.max(0, backoffEndTime - currentTime); + await this.makeRealtimeHttpConnection(retryMillis); + } + + private setIsHttpConnectionRunning(connectionRunning: boolean): void { + this.isConnectionActive = connectionRunning; + } + + /** + * Combines the check and set operations to prevent multiple asynchronous + * calls from redundantly starting an HTTP connection. This ensures that + * only one attempt is made at a time. + */ + private checkAndSetHttpConnectionFlagIfNotRunning(): boolean { + const canMakeConnection = this.canEstablishStreamConnection(); + if (canMakeConnection) { + this.setIsHttpConnectionRunning(true); + } + return canMakeConnection; + } + + private fetchResponseIsUpToDate( + fetchResponse: FetchResponse, + lastKnownVersion: number + ): boolean { + // If there is a config, make sure its version is >= the last known version. + if (fetchResponse.config != null && fetchResponse.templateVersion) { + return fetchResponse.templateVersion >= lastKnownVersion; + } + // If there isn't a config, return true if the fetch was successful and backend had no update. + // Else, it returned an out of date config. + return this.storageCache.getLastFetchStatus() === 'success'; + } + + private parseAndValidateConfigUpdateMessage(message: string): string { + const left = message.indexOf('{'); + const right = message.indexOf('}', left); + + if (left < 0 || right < 0) { + return ''; + } + return left >= right ? '' : message.substring(left, right + 1); + } + + private isEventListenersEmpty(): boolean { + return this.observers.size === 0; + } + + private getRandomInt(max: number): number { + return Math.floor(Math.random() * max); + } + + private executeAllListenerCallbacks(configUpdate: ConfigUpdate): void { + this.observers.forEach(observer => observer.next(configUpdate)); + } + + /** + * Compares two configuration objects and returns a set of keys that have changed. + * A key is considered changed if it's new, removed, or has a different value. + */ + private getChangedParams( + newConfig: FirebaseRemoteConfigObject, + oldConfig: FirebaseRemoteConfigObject + ): Set { + const changedKeys = new Set(); + const newKeys = new Set(Object.keys(newConfig || {})); + const oldKeys = new Set(Object.keys(oldConfig || {})); + + for (const key of newKeys) { + if (!oldKeys.has(key) || newConfig[key] !== oldConfig[key]) { + changedKeys.add(key); + } + } + + for (const key of oldKeys) { + if (!newKeys.has(key)) { + changedKeys.add(key); + } + } + + return changedKeys; + } + + private async fetchLatestConfig( + remainingAttempts: number, + targetVersion: number + ): Promise { + const remainingAttemptsAfterFetch = remainingAttempts - 1; + const currentAttempt = MAXIMUM_FETCH_ATTEMPTS - remainingAttemptsAfterFetch; + const customSignals = this.storageCache.getCustomSignals(); + if (customSignals) { + this.logger.debug( + `Fetching config with custom signals: ${JSON.stringify(customSignals)}` + ); + } + const abortSignal = new RemoteConfigAbortSignal(); + try { + const fetchRequest: FetchRequest = { + cacheMaxAgeMillis: 0, + signal: abortSignal, + customSignals, + fetchType: 'REALTIME', + fetchAttempt: currentAttempt + }; + + const fetchResponse: FetchResponse = await this.cachingClient.fetch( + fetchRequest + ); + let activatedConfigs = await this.storage.getActiveConfig(); + + if (!this.fetchResponseIsUpToDate(fetchResponse, targetVersion)) { + this.logger.debug( + "Fetched template version is the same as SDK's current version." + + ' Retrying fetch.' + ); + // Continue fetching until template version number is greater than current. + await this.autoFetch(remainingAttemptsAfterFetch, targetVersion); + return; + } + + if (fetchResponse.config == null) { + this.logger.debug( + 'The fetch succeeded, but the backend had no updates.' + ); + return; + } + + if (activatedConfigs == null) { + activatedConfigs = {}; + } + + const updatedKeys = this.getChangedParams( + fetchResponse.config, + activatedConfigs + ); + + if (updatedKeys.size === 0) { + this.logger.debug('Config was fetched, but no params changed.'); + return; + } + + const configUpdate: ConfigUpdate = { + getUpdatedKeys(): Set { + return new Set(updatedKeys); + } + }; + this.executeAllListenerCallbacks(configUpdate); + } catch (e: unknown) { + const errorMessage = e instanceof Error ? e.message : String(e); + const error = ERROR_FACTORY.create(ErrorCode.CONFIG_UPDATE_NOT_FETCHED, { + originalErrorMessage: `Failed to auto-fetch config update: ${errorMessage}` + }); + this.propagateError(error); + } + } + + private async autoFetch( + remainingAttempts: number, + targetVersion: number + ): Promise { + if (remainingAttempts === 0) { + const error = ERROR_FACTORY.create(ErrorCode.CONFIG_UPDATE_NOT_FETCHED, { + originalErrorMessage: + 'Unable to fetch the latest version of the template.' + }); + this.propagateError(error); + return; + } + + const timeTillFetchSeconds = this.getRandomInt(4); + const timeTillFetchInMiliseconds = timeTillFetchSeconds * 1000; + + await new Promise(resolve => + setTimeout(resolve, timeTillFetchInMiliseconds) + ); + await this.fetchLatestConfig(remainingAttempts, targetVersion); + } + + /** + * Processes a stream of real-time messages for configuration updates. + * This method reassembles fragmented messages, validates and parses the JSON, + * and automatically fetches a new config if a newer template version is available. + * It also handles server-specified retry intervals and propagates errors for + * invalid messages or when real-time updates are disabled. + */ + private async handleNotifications( + reader: ReadableStreamDefaultReader + ): Promise { + let partialConfigUpdateMessage: string; + let currentConfigUpdateMessage = ''; + + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + + partialConfigUpdateMessage = this.decoder.decode(value, { stream: true }); + currentConfigUpdateMessage += partialConfigUpdateMessage; + + if (partialConfigUpdateMessage.includes('}')) { + currentConfigUpdateMessage = this.parseAndValidateConfigUpdateMessage( + currentConfigUpdateMessage + ); + + if (currentConfigUpdateMessage.length === 0) { + continue; + } + + try { + const jsonObject = JSON.parse(currentConfigUpdateMessage); + + if (this.isEventListenersEmpty()) { + break; + } + + if ( + REALTIME_DISABLED_KEY in jsonObject && + jsonObject[REALTIME_DISABLED_KEY] === true + ) { + const error = ERROR_FACTORY.create( + ErrorCode.CONFIG_UPDATE_UNAVAILABLE, + { + originalErrorMessage: + 'The server is temporarily unavailable. Try again in a few minutes.' + } + ); + this.propagateError(error); + break; + } + + if (TEMPLATE_VERSION_KEY in jsonObject) { + const oldTemplateVersion = + await this.storage.getActiveConfigTemplateVersion(); + const targetTemplateVersion = Number( + jsonObject[TEMPLATE_VERSION_KEY] + ); + if ( + oldTemplateVersion && + targetTemplateVersion > oldTemplateVersion + ) { + await this.autoFetch( + MAXIMUM_FETCH_ATTEMPTS, + targetTemplateVersion + ); + } + } + + // This field in the response indicates that the realtime request should retry after the + // specified interval to establish a long-lived connection. This interval extends the + // backoff duration without affecting the number of retries, so it will not enter an + // exponential backoff state. + if (REALTIME_RETRY_INTERVAL in jsonObject) { + const retryIntervalSeconds = Number( + jsonObject[REALTIME_RETRY_INTERVAL] + ); + await this.updateBackoffMetadataWithRetryInterval( + retryIntervalSeconds + ); + } + } catch (e: unknown) { + this.logger.debug('Unable to parse latest config update message.', e); + const errorMessage = e instanceof Error ? e.message : String(e); + this.propagateError( + ERROR_FACTORY.create(ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID, { + originalErrorMessage: errorMessage + }) + ); + } + currentConfigUpdateMessage = ''; + } + } + } + + private async listenForNotifications( + reader: ReadableStreamDefaultReader + ): Promise { + try { + await this.handleNotifications(reader); + } catch (e) { + // If the real-time connection is at an unexpected lifecycle state when the app is + // backgrounded, it's expected closing the connection will throw an exception. + if (!this.isInBackground) { + // Otherwise, the real-time server connection was closed due to a transient issue. + this.logger.debug( + 'Real-time connection was closed due to an exception.' + ); + } + } + } + + /** + * Open the real-time connection, begin listening for updates, and auto-fetch when an update is + * received. + * + * If the connection is successful, this method will block on its thread while it reads the + * chunk-encoded HTTP body. When the connection closes, it attempts to reestablish the stream. + */ + private async prepareAndBeginRealtimeHttpStream(): Promise { + if (!this.checkAndSetHttpConnectionFlagIfNotRunning()) { + return; + } + + let backoffMetadata = await this.storage.getRealtimeBackoffMetadata(); + if (!backoffMetadata) { + backoffMetadata = { + backoffEndTimeMillis: new Date(NO_BACKOFF_TIME_IN_MILLIS), + numFailedStreams: NO_FAILED_REALTIME_STREAMS + }; + } + const backoffEndTime = backoffMetadata.backoffEndTimeMillis.getTime(); + if (Date.now() < backoffEndTime) { + await this.retryHttpConnectionWhenBackoffEnds(); + return; + } + + let response: Response | undefined; + let responseCode: number | undefined; + try { + response = await this.createRealtimeConnection(); + responseCode = response.status; + if (response.ok && response.body) { + this.resetRetryCount(); + await this.resetRealtimeBackoff(); + const reader = response.body.getReader(); + this.reader = reader; + // Start listening for realtime notifications. + await this.listenForNotifications(reader); + } + } catch (error) { + if (this.isInBackground) { + // It's possible the app was backgrounded while the connection was open, which + // threw an exception trying to read the response. No real error here, so treat + // this as a success, even if we haven't read a 200 response code yet. + this.resetRetryCount(); + } else { + //there might have been a transient error so the client will retry the connection. + this.logger.debug( + 'Exception connecting to real-time RC backend. Retrying the connection...:', + error + ); + } + } finally { + // Close HTTP connection and associated streams. + await this.closeRealtimeHttpConnection(); + this.setIsHttpConnectionRunning(false); + + // Update backoff metadata if the connection failed in the foreground. + const connectionFailed = + !this.isInBackground && + (responseCode === undefined || + this.isStatusCodeRetryable(responseCode)); + + if (connectionFailed) { + await this.updateBackoffMetadataWithLastFailedStreamConnectionTime( + new Date() + ); + } + // If responseCode is null then no connection was made to server and the SDK should still retry. + if (connectionFailed || response?.ok) { + await this.retryHttpConnectionWhenBackoffEnds(); + } else { + const errorMessage = `Unable to connect to the server. HTTP status code: ${responseCode}`; + const firebaseError = ERROR_FACTORY.create( + ErrorCode.CONFIG_UPDATE_STREAM_ERROR, + { + originalErrorMessage: errorMessage + } + ); + this.propagateError(firebaseError); + } + } + } + + /** + * Checks whether connection can be made or not based on some conditions + * @returns booelean + */ + private canEstablishStreamConnection(): boolean { + const hasActiveListeners = this.observers.size > 0; + const isNotDisabled = !this.isRealtimeDisabled; + const isNoConnectionActive = !this.isConnectionActive; + const inForeground = !this.isInBackground; + return ( + hasActiveListeners && + isNotDisabled && + isNoConnectionActive && + inForeground + ); + } + + private async makeRealtimeHttpConnection(delayMillis: number): Promise { + if (!this.canEstablishStreamConnection()) { + return; + } + if (this.httpRetriesRemaining > 0) { + this.httpRetriesRemaining--; + await new Promise(resolve => setTimeout(resolve, delayMillis)); + void this.prepareAndBeginRealtimeHttpStream(); + } else if (!this.isInBackground) { + const error = ERROR_FACTORY.create(ErrorCode.CONFIG_UPDATE_STREAM_ERROR, { + originalErrorMessage: + 'Unable to connect to the server. Check your connection and try again.' + }); + this.propagateError(error); + } + } + + private async beginRealtime(): Promise { + if (this.observers.size > 0) { + await this.makeRealtimeHttpConnection(0); + } + } + + /** + * Adds an observer to the realtime updates. + * @param observer The observer to add. + */ + addObserver(observer: ConfigUpdateObserver): void { + this.observers.add(observer); + void this.beginRealtime(); + } + + /** + * Removes an observer from the realtime updates. + * @param observer The observer to remove. + */ + removeObserver(observer: ConfigUpdateObserver): void { + if (this.observers.has(observer)) { + this.observers.delete(observer); + } + } + + /** + * Handles changes to the application's visibility state, managing the real-time connection. + * + * When the application is moved to the background, this method closes the existing + * real-time connection to save resources. When the application returns to the + * foreground, it attempts to re-establish the connection. + */ + private async onVisibilityChange(visible: unknown): Promise { + this.isInBackground = !visible; + if (!visible) { + await this.closeRealtimeHttpConnection(); + } else if (visible) { + await this.beginRealtime(); + } + } +} diff --git a/packages/remote-config/src/client/remote_config_fetch_client.ts b/packages/remote-config/src/client/remote_config_fetch_client.ts index 359bb7c0409..ddc1ba4279c 100644 --- a/packages/remote-config/src/client/remote_config_fetch_client.ts +++ b/packages/remote-config/src/client/remote_config_fetch_client.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { CustomSignals, FetchResponse } from '../public_types'; +import { CustomSignals, FetchResponse, FetchType } from '../public_types'; /** * Defines a client, as in https://en.wikipedia.org/wiki/Client%E2%80%93server_model, for the @@ -100,4 +100,18 @@ export interface FetchRequest { *

      Optional in case no custom signals are set for the instance. */ customSignals?: CustomSignals; + + /** + * The type of fetch to perform, such as a regular fetch or a real-time fetch. + * + * Optional as not all fetch requests need to be distinguished. + */ + fetchType?: FetchType; + + /** + * The number of fetch attempts made so far for this request. + * + * Optional as not all fetch requests are part of a retry series. + */ + fetchAttempt?: number; } diff --git a/packages/remote-config/src/client/rest_client.ts b/packages/remote-config/src/client/rest_client.ts index 57f55f53d88..42b0cab27c6 100644 --- a/packages/remote-config/src/client/rest_client.ts +++ b/packages/remote-config/src/client/rest_client.ts @@ -88,6 +88,8 @@ export class RestClient implements RemoteConfigFetchClient { // Deviates from pure decorator by not passing max-age header since we don't currently have // service behavior using that header. 'If-None-Match': request.eTag || '*' + // TODO: Add this header once CORS error is fixed internally. + //'X-Firebase-RC-Fetch-Type': `${fetchType}/${fetchAttempt}` }; const requestBody: FetchRequestBody = { @@ -140,6 +142,7 @@ export class RestClient implements RemoteConfigFetchClient { let config: FirebaseRemoteConfigObject | undefined; let state: string | undefined; + let templateVersion: number | undefined; // JSON parsing throws SyntaxError if the response body isn't a JSON string. // Requesting application/json and checking for a 200 ensures there's JSON data. @@ -154,6 +157,7 @@ export class RestClient implements RemoteConfigFetchClient { } config = responseBody['entries']; state = responseBody['state']; + templateVersion = responseBody['templateVersion']; } // Normalizes based on legacy state. @@ -176,6 +180,6 @@ export class RestClient implements RemoteConfigFetchClient { }); } - return { status, eTag: responseEtag, config }; + return { status, eTag: responseEtag, config, templateVersion }; } } diff --git a/packages/remote-config/src/client/visibility_monitor.ts b/packages/remote-config/src/client/visibility_monitor.ts new file mode 100644 index 00000000000..27028e3eeca --- /dev/null +++ b/packages/remote-config/src/client/visibility_monitor.ts @@ -0,0 +1,86 @@ +/** + * @license + * Copyright 2025 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 { assert } from '@firebase/util'; + +import { EventEmitter } from './eventEmitter'; + +declare const document: Document; + +// TODO: Consolidate the Visibility monitoring API code into a shared utility function in firebase/util to be used by both packages/database and packages/remote-config. +export class VisibilityMonitor extends EventEmitter { + private visible_: boolean; + + static getInstance(): VisibilityMonitor { + return new VisibilityMonitor(); + } + + constructor() { + super(['visible']); + let hidden: string; + let visibilityChange: string; + if ( + typeof document !== 'undefined' && + typeof document.addEventListener !== 'undefined' + ) { + if (typeof document['hidden'] !== 'undefined') { + // Opera 12.10 and Firefox 18 and later support + visibilityChange = 'visibilitychange'; + hidden = 'hidden'; + } // @ts-ignore + else if (typeof document['mozHidden'] !== 'undefined') { + visibilityChange = 'mozvisibilitychange'; + hidden = 'mozHidden'; + } // @ts-ignore + else if (typeof document['msHidden'] !== 'undefined') { + visibilityChange = 'msvisibilitychange'; + hidden = 'msHidden'; + } // @ts-ignore + else if (typeof document['webkitHidden'] !== 'undefined') { + visibilityChange = 'webkitvisibilitychange'; + hidden = 'webkitHidden'; + } + } + + // Initially, we always assume we are visible. This ensures that in browsers + // without page visibility support or in cases where we are never visible + // (e.g. chrome extension), we act as if we are visible, i.e. don't delay + // reconnects + this.visible_ = true; + + // @ts-ignore + if (visibilityChange) { + document.addEventListener( + visibilityChange, + () => { + // @ts-ignore + const visible = !document[hidden]; + if (visible !== this.visible_) { + this.visible_ = visible; + this.trigger('visible', visible); + } + }, + false + ); + } + } + + getInitialEvent(eventType: string): boolean[] { + assert(eventType === 'visible', 'Unknown event type: ' + eventType); + return [this.visible_]; + } +} diff --git a/packages/remote-config/src/errors.ts b/packages/remote-config/src/errors.ts index 446bd2c6e7a..dea9f43e922 100644 --- a/packages/remote-config/src/errors.ts +++ b/packages/remote-config/src/errors.ts @@ -33,7 +33,11 @@ export const enum ErrorCode { FETCH_PARSE = 'fetch-client-parse', FETCH_STATUS = 'fetch-status', INDEXED_DB_UNAVAILABLE = 'indexed-db-unavailable', - CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS = 'custom-signal-max-allowed-signals' + CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS = 'custom-signal-max-allowed-signals', + CONFIG_UPDATE_STREAM_ERROR = 'stream-error', + CONFIG_UPDATE_UNAVAILABLE = 'realtime-unavailable', + CONFIG_UPDATE_MESSAGE_INVALID = 'update-message-invalid', + CONFIG_UPDATE_NOT_FETCHED = 'update-not-fetched' } const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = { @@ -72,7 +76,15 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = { [ErrorCode.INDEXED_DB_UNAVAILABLE]: 'Indexed DB is not supported by current browser', [ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS]: - 'Setting more than {$maxSignals} custom signals is not supported.' + 'Setting more than {$maxSignals} custom signals is not supported.', + [ErrorCode.CONFIG_UPDATE_STREAM_ERROR]: + 'The stream was not able to connect to the backend: {$originalErrorMessage}.', + [ErrorCode.CONFIG_UPDATE_UNAVAILABLE]: + 'The Realtime service is unavailable: {$originalErrorMessage}', + [ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID]: + 'The stream invalidation message was unparsable: {$originalErrorMessage}', + [ErrorCode.CONFIG_UPDATE_NOT_FETCHED]: + 'Unable to fetch the latest config: {$originalErrorMessage}' }; // Note this is effectively a type system binding a code to params. This approach overlaps with the @@ -92,6 +104,10 @@ interface ErrorParams { [ErrorCode.FETCH_PARSE]: { originalErrorMessage: string }; [ErrorCode.FETCH_STATUS]: { httpStatus: number }; [ErrorCode.CUSTOM_SIGNAL_MAX_ALLOWED_SIGNALS]: { maxSignals: number }; + [ErrorCode.CONFIG_UPDATE_STREAM_ERROR]: { originalErrorMessage: string }; + [ErrorCode.CONFIG_UPDATE_UNAVAILABLE]: { originalErrorMessage: string }; + [ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID]: { originalErrorMessage: string }; + [ErrorCode.CONFIG_UPDATE_NOT_FETCHED]: { originalErrorMessage: string }; } export const ERROR_FACTORY = new ErrorFactory( diff --git a/packages/remote-config/src/public_types.ts b/packages/remote-config/src/public_types.ts index 927bc84ca10..964726a51f4 100644 --- a/packages/remote-config/src/public_types.ts +++ b/packages/remote-config/src/public_types.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { FirebaseApp } from '@firebase/app'; +import { FirebaseApp, FirebaseError } from '@firebase/app'; /** * The Firebase Remote Config service interface. @@ -52,6 +52,8 @@ export interface RemoteConfig { /** * Defines a self-descriptive reference for config key-value pairs. + * + * @public */ export interface FirebaseRemoteConfigObject { [key: string]: string; @@ -62,6 +64,8 @@ export interface FirebaseRemoteConfigObject { * *

      Modeled after the native `Response` interface, but simplified for Remote Config's * use case. + * + * @public */ export interface FetchResponse { /** @@ -90,6 +94,11 @@ export interface FetchResponse { */ config?: FirebaseRemoteConfigObject; + /** + * The version number of the config template fetched from the server. + */ + templateVersion?: number; + // Note: we're not extracting experiment metadata until // ABT and Analytics have Web SDKs. } @@ -212,6 +221,63 @@ export interface CustomSignals { [key: string]: string | number | null; } +/** + * Contains information about which keys have been updated. + * + * @public + */ +export interface ConfigUpdate { + /** + * Parameter keys whose values have been updated from the currently activated values. + * Includes keys that are added, deleted, or whose value, value source, or metadata has changed. + */ + getUpdatedKeys(): Set; +} + +/** + * Observer interface for receiving real-time Remote Config update notifications. + * + * NOTE: Although an `complete` callback can be provided, it will + * never be called because the ConfigUpdate stream is never-ending. + * + * @public + */ +export interface ConfigUpdateObserver { + /** + * Called when a new ConfigUpdate is available. + */ + next: (configUpdate: ConfigUpdate) => void; + + /** + * Called if an error occurs during the stream. + */ + error: (error: FirebaseError) => void; + + /** + * Called when the stream is gracefully terminated. + */ + complete: () => void; +} + +/** + * A function that unsubscribes from a real-time event stream. + * + * @public + */ +export type Unsubscribe = () => void; + +/** + * Indicates the type of fetch request. + * + *

        + *
      • "BASE" indicates a standard fetch request.
      • + *
      • "REALTIME" indicates a fetch request triggered by a real-time update.
      • + *
      + * + * @public + */ +export type FetchType = 'BASE' | 'REALTIME'; + declare module '@firebase/component' { interface NameServiceMapping { 'remote-config': RemoteConfig; diff --git a/packages/remote-config/src/register.ts b/packages/remote-config/src/register.ts index 160e20219ce..eade371ca89 100644 --- a/packages/remote-config/src/register.ts +++ b/packages/remote-config/src/register.ts @@ -37,6 +37,7 @@ import { ErrorCode, ERROR_FACTORY } from './errors'; import { RemoteConfig as RemoteConfigImpl } from './remote_config'; import { IndexedDbStorage, InMemoryStorage } from './storage/storage'; import { StorageCache } from './storage/storage_cache'; +import { RealtimeHandler } from './client/realtime_handler'; // This needs to be in the same file that calls `getProvider()` on the component // or it will get tree-shaken out. import '@firebase/installations'; @@ -107,12 +108,26 @@ export function registerRemoteConfig(): void { logger ); + const realtimeHandler = new RealtimeHandler( + installations, + storage, + SDK_VERSION, + namespace, + projectId, + apiKey, + appId, + logger, + storageCache, + cachingClient + ); + const remoteConfigInstance = new RemoteConfigImpl( app, cachingClient, storageCache, storage, - logger + logger, + realtimeHandler ); // Starts warming cache. diff --git a/packages/remote-config/src/remote_config.ts b/packages/remote-config/src/remote_config.ts index bd2db66d0b3..bd32c938304 100644 --- a/packages/remote-config/src/remote_config.ts +++ b/packages/remote-config/src/remote_config.ts @@ -25,6 +25,7 @@ import { StorageCache } from './storage/storage_cache'; import { RemoteConfigFetchClient } from './client/remote_config_fetch_client'; import { Storage } from './storage/storage'; import { Logger } from '@firebase/logger'; +import { RealtimeHandler } from './client/realtime_handler'; const DEFAULT_FETCH_TIMEOUT_MILLIS = 60 * 1000; // One minute const DEFAULT_CACHE_MAX_AGE_MILLIS = 12 * 60 * 60 * 1000; // Twelve hours. @@ -83,6 +84,10 @@ export class RemoteConfig implements RemoteConfigType { /** * @internal */ - readonly _logger: Logger + readonly _logger: Logger, + /** + * @internal + */ + readonly _realtimeHandler: RealtimeHandler ) {} } diff --git a/packages/remote-config/src/storage/storage.ts b/packages/remote-config/src/storage/storage.ts index f03ff41377b..bd262d29968 100644 --- a/packages/remote-config/src/storage/storage.ts +++ b/packages/remote-config/src/storage/storage.ts @@ -56,6 +56,13 @@ export interface ThrottleMetadata { throttleEndTimeMillis: number; } +export interface RealtimeBackoffMetadata { + // The number of consecutive connection streams that have failed. + numFailedStreams: number; + // The Date until which the client should wait before attempting any new real-time connections. + backoffEndTimeMillis: Date; +} + /** * Provides type-safety for the "key" field used by {@link APP_NAMESPACE_STORE}. * @@ -69,7 +76,9 @@ type ProjectNamespaceKeyFieldValue = | 'last_successful_fetch_response' | 'settings' | 'throttle_metadata' - | 'custom_signals'; + | 'custom_signals' + | 'realtime_backoff_metadata' + | 'last_known_template_version'; // Visible for testing. export function openDatabase(): Promise { @@ -178,6 +187,27 @@ export abstract class Storage { abstract get(key: ProjectNamespaceKeyFieldValue): Promise; abstract set(key: ProjectNamespaceKeyFieldValue, value: T): Promise; abstract delete(key: ProjectNamespaceKeyFieldValue): Promise; + + getRealtimeBackoffMetadata(): Promise { + return this.get('realtime_backoff_metadata'); + } + + setRealtimeBackoffMetadata( + realtimeMetadata: RealtimeBackoffMetadata + ): Promise { + return this.set( + 'realtime_backoff_metadata', + realtimeMetadata + ); + } + + getActiveConfigTemplateVersion(): Promise { + return this.get('last_known_template_version'); + } + + setActiveConfigTemplateVersion(version: number): Promise { + return this.set('last_known_template_version', version); + } } export class IndexedDbStorage extends Storage { diff --git a/packages/remote-config/test/api.test.ts b/packages/remote-config/test/api.test.ts index b1fe658ebae..f38b4ca0bee 100644 --- a/packages/remote-config/test/api.test.ts +++ b/packages/remote-config/test/api.test.ts @@ -17,11 +17,13 @@ import { expect } from 'chai'; import { + ConfigUpdateObserver, ensureInitialized, fetchAndActivate, FetchResponse, getRemoteConfig, - getString + getString, + onConfigUpdate } from '../src'; import '../test/setup'; import { @@ -34,6 +36,8 @@ import * as sinon from 'sinon'; import { Component, ComponentType } from '@firebase/component'; import { FirebaseInstallations } from '@firebase/installations-types'; import { openDatabase, APP_NAMESPACE_STORE } from '../src/storage/storage'; +import { ERROR_FACTORY, ErrorCode } from '../src/errors'; +import { RemoteConfig as RemoteConfigImpl } from '../src/remote_config'; const fakeFirebaseConfig = { apiKey: 'api-key', @@ -45,6 +49,12 @@ const fakeFirebaseConfig = { appId: '1:111:web:a1234' }; +const mockObserver = { + next: sinon.stub(), + error: sinon.stub(), + complete: sinon.stub() +}; + async function clearDatabase(): Promise { const db = await openDatabase(); db.transaction([APP_NAMESPACE_STORE], 'readwrite') @@ -57,7 +67,8 @@ describe('Remote Config API', () => { const STUB_FETCH_RESPONSE: FetchResponse = { status: 200, eTag: 'asdf', - config: { 'foobar': 'hello world' } + config: { 'foobar': 'hello world' }, + templateVersion: 1 }; let fetchStub: sinon.SinonStub; @@ -94,7 +105,8 @@ describe('Remote Config API', () => { json: () => Promise.resolve({ entries: response.config, - state: 'OK' + state: 'OK', + templateVersion: response.templateVersion }) } as Response) ); @@ -149,4 +161,99 @@ describe('Remote Config API', () => { await ensureInitialized(rc); expect(getString(rc, 'foobar')).to.equal('hello world'); }); + + describe('onConfigUpdate', () => { + let capturedObserver: ConfigUpdateObserver | undefined; + let rc: RemoteConfigImpl; + let addObserverStub: sinon.SinonStub; + let removeObserverStub: sinon.SinonStub; + + beforeEach(() => { + rc = getRemoteConfig(app) as RemoteConfigImpl; + + addObserverStub = sinon + .stub(rc._realtimeHandler, 'addObserver') + .resolves(); + removeObserverStub = sinon + .stub(rc._realtimeHandler, 'removeObserver') + .resolves(); + + addObserverStub.callsFake(async (observer: ConfigUpdateObserver) => { + capturedObserver = observer; + }); + }); + + afterEach(() => { + capturedObserver = undefined; + addObserverStub.restore(); + removeObserverStub.restore(); + }); + + it('should call addObserver on the internal realtimeHandler', async () => { + await onConfigUpdate(rc, mockObserver); + expect(addObserverStub).to.have.been.calledOnce; + expect(addObserverStub).to.have.been.calledWith(mockObserver); + }); + + it('should return an unsubscribe function', async () => { + const unsubscribe = await onConfigUpdate(rc, mockObserver); + expect(unsubscribe).to.be.a('function'); + }); + + it('returned unsubscribe function should call removeObserver', async () => { + const unsubscribe = await onConfigUpdate(rc, mockObserver); + + unsubscribe(); + expect(removeObserverStub).to.have.been.calledOnce; + expect(removeObserverStub).to.have.been.calledWith(mockObserver); + }); + + it('observer.next should be called when realtimeHandler propagates an update', async () => { + await onConfigUpdate(rc, mockObserver); + + if (capturedObserver && capturedObserver.next) { + const mockConfigUpdate = { getUpdatedKeys: () => new Set(['new_key']) }; + capturedObserver.next(mockConfigUpdate); + } else { + expect.fail('Observer was not captured or next method is missing.'); + } + + expect(mockObserver.next).to.have.been.calledOnce; + expect(mockObserver.next).to.have.been.calledWithMatch({ + getUpdatedKeys: sinon.match.func + }); + expect( + mockObserver.next.getCall(0).args[0].getUpdatedKeys() + ).to.deep.equal(new Set(['new_key'])); + }); + + it('observer.error should be called when realtimeHandler propagates an error', async () => { + await onConfigUpdate(rc, mockObserver); + + if (capturedObserver && capturedObserver.error) { + const expectedOriginalErrorMessage = 'Realtime stream error'; + const mockError = ERROR_FACTORY.create( + ErrorCode.CONFIG_UPDATE_STREAM_ERROR, + { + originalErrorMessage: expectedOriginalErrorMessage + } + ); + capturedObserver.error(mockError); + } else { + expect.fail('Observer was not captured or error method is missing.'); + } + + expect(mockObserver.error).to.have.been.calledOnce; + const receivedError = mockObserver.error.getCall(0).args[0]; + + expect(receivedError.message).to.equal( + 'Remote Config: The stream was not able to connect to the backend: Realtime stream error. (remoteconfig/stream-error).' + ); + expect(receivedError).to.have.nested.property( + 'customData.originalErrorMessage', + 'Realtime stream error' + ); + expect((receivedError as any).code).to.equal('remoteconfig/stream-error'); + }); + }); }); diff --git a/packages/remote-config/test/client/realtime_handler.test.ts b/packages/remote-config/test/client/realtime_handler.test.ts new file mode 100644 index 00000000000..fbdbe982b8b --- /dev/null +++ b/packages/remote-config/test/client/realtime_handler.test.ts @@ -0,0 +1,911 @@ +/** + * @license + * Copyright 2025 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 { expect, use } from 'chai'; +import * as sinon from 'sinon'; +import sinonChai from 'sinon-chai'; +import { RealtimeHandler } from '../../src/client/realtime_handler'; +import { _FirebaseInstallationsInternal } from '@firebase/installations'; +import { Logger } from '@firebase/logger'; +import { Storage } from '../../src/storage/storage'; +import { StorageCache } from '../../src/storage/storage_cache'; +import { CachingClient } from '../../src/client/caching_client'; +import { ConfigUpdateObserver, FetchResponse } from '../../src/public_types'; +import { ErrorCode } from '../../src/errors'; +import { VisibilityMonitor } from '../../src/client/visibility_monitor'; + +use(sinonChai); + +const FAKE_APP_ID = '1:123456789:web:abcdef'; +const INSTALLATION_ID_STRING = 'installation-id-123'; +const INSTALLATION_AUTH_TOKEN_STRING = 'installation-auth-token-456'; +const PROJECT_NUMBER = '123456789'; +const API_KEY = 'api-key-123'; +const FAKE_NOW = 1234567890; +const ORIGINAL_RETRIES = 8; +const MAXIMUM_FETCH_ATTEMPTS = 3; + +const DUMMY_FETCH_RESPONSE: FetchResponse = { + status: 200, + config: { testKey: 'test_value' }, + eTag: 'etag-2', + templateVersion: 2 +}; + +// Helper to create a mock ReadableStream from a string array. +function createMockReadableStream( + chunks: string[] = [] +): ReadableStream { + const encoder = new TextEncoder(); + return new ReadableStream({ + start(controller) { + for (const chunk of chunks) { + controller.enqueue(encoder.encode(chunk)); + } + controller.close(); + } + }); +} + +function createStreamingMockReader( + chunks: string[] +): ReadableStreamDefaultReader { + const stream = createMockReadableStream(chunks); + const reader = stream.getReader(); + const originalRead = reader.read; + sinon.stub(reader, 'read').callsFake(originalRead.bind(reader)); + return reader; +} + +describe('RealtimeHandler', () => { + let mockFetch: sinon.SinonStub; + let mockInstallations: sinon.SinonStubbedInstance<_FirebaseInstallationsInternal>; + let mockStorage: sinon.SinonStubbedInstance; + let mockStorageCache: sinon.SinonStubbedInstance; + let mockCachingClient: sinon.SinonStubbedInstance; + let mockLogger: sinon.SinonStubbedInstance; + let realtime: RealtimeHandler; + let clock: sinon.SinonFakeTimers; + let visibilityMonitorOnStub: sinon.SinonStub; + + beforeEach(async () => { + mockFetch = sinon.stub(window, 'fetch'); + mockInstallations = { + getId: sinon.stub().resolves(INSTALLATION_ID_STRING), + getToken: sinon.stub().resolves(INSTALLATION_AUTH_TOKEN_STRING) + } as any; + + mockLogger = sinon.createStubInstance(Logger); + + mockStorage = { + getRealtimeBackoffMetadata: sinon.stub().resolves(undefined), + setRealtimeBackoffMetadata: sinon.stub().resolves(), + getActiveConfigEtag: sinon.stub().resolves('etag-1'), + getActiveConfigTemplateVersion: sinon.stub().resolves(1), + getActiveConfig: sinon.stub().resolves({}), + + getLastFetchStatus: sinon.stub(), + setLastFetchStatus: sinon.stub(), + getLastSuccessfulFetchTimestampMillis: sinon.stub(), + setLastSuccessfulFetchTimestampMillis: sinon.stub(), + getLastSuccessfulFetchResponse: sinon.stub(), + setLastSuccessfulFetchResponse: sinon.stub(), + setActiveConfig: sinon.stub(), + setActiveConfigEtag: sinon.stub(), + getThrottleMetadata: sinon.stub(), + setThrottleMetadata: sinon.stub(), + deleteThrottleMetadata: sinon.stub(), + getCustomSignals: sinon.stub(), + setCustomSignals: sinon.stub(), + setActiveConfigTemplateVersion: sinon.stub() + } as sinon.SinonStubbedInstance; + + mockStorageCache = sinon.createStubInstance(StorageCache); + mockStorageCache.getLastFetchStatus.returns('success'); + mockStorageCache.getCustomSignals.returns(undefined); + + mockCachingClient = sinon.createStubInstance(CachingClient); + mockCachingClient.fetch.resolves(DUMMY_FETCH_RESPONSE); + + visibilityMonitorOnStub = sinon.stub(); + sinon.stub(VisibilityMonitor, 'getInstance').returns({ + on: visibilityMonitorOnStub + } as any); + + clock = sinon.useFakeTimers(FAKE_NOW); + + realtime = new RealtimeHandler( + mockInstallations, + mockStorage as any, + 'sdk-version', + 'namespace', + PROJECT_NUMBER, + API_KEY, + FAKE_APP_ID, + mockLogger as any, + mockStorageCache as any, + mockCachingClient as any + ); + }); + + afterEach(() => { + sinon.restore(); + clock.restore(); + }); + + describe('constructor', () => { + it('should initialize with default retries if no backoff metadata in storage', async () => { + await clock.runAllAsync(); + expect((realtime as any).httpRetriesRemaining).to.equal(ORIGINAL_RETRIES); + }); + + it('should set retries remaining from storage if available', async () => { + mockStorage.getRealtimeBackoffMetadata.resolves({ + backoffEndTimeMillis: new Date(FAKE_NOW - 1000), // In the past, so no backoff + numFailedStreams: 3 + }); + + realtime = new RealtimeHandler( + mockInstallations, + mockStorage as any, + 'sdk-version', + 'namespace', + PROJECT_NUMBER, + API_KEY, + FAKE_APP_ID, + mockLogger as any, + mockStorageCache as any, + mockCachingClient as any + ); + await clock.runAllAsync(); + expect((realtime as any).httpRetriesRemaining).to.equal( + ORIGINAL_RETRIES - 3 + ); + }); + }); + + describe('getRealtimeUrl', () => { + it('should construct the correct URL', () => { + const url = (realtime as any).getRealtimeUrl(); + expect(url.toString()).to.equal( + `https://firebaseremoteconfigrealtime.googleapis.com/v1/projects/${PROJECT_NUMBER}/namespaces/namespace:streamFetchInvalidations?key=${API_KEY}` + ); + }); + + it('should use the URL base from window if it exists', () => { + (window as any).FIREBASE_REMOTE_CONFIG_URL_BASE = + 'https://test.googleapis.com'; + const url = (realtime as any).getRealtimeUrl(); + expect(url.toString()).to.equal( + `https://test.googleapis.com/v1/projects/${PROJECT_NUMBER}/namespaces/namespace:streamFetchInvalidations?key=${API_KEY}` + ); + delete (window as any).FIREBASE_REMOTE_CONFIG_URL_BASE; + }); + }); + + describe('isStatusCodeRetryable', () => { + it('should return true for retryable status codes', () => { + const retryableCodes = [408, 429, 502, 503, 504]; + retryableCodes.forEach(code => { + expect((realtime as any).isStatusCodeRetryable(code)).to.be.true; + }); + }); + + it('should return true for undefined status code', () => { + expect((realtime as any).isStatusCodeRetryable(undefined)).to.be.true; + }); + + it('should return false for non-retryable status codes', () => { + // This is a sample of non-retryable codes for testing purposes. + const nonRetryableCodes = [200, 304, 400, 401, 403]; + nonRetryableCodes.forEach(code => { + expect((realtime as any).isStatusCodeRetryable(code)).to.be.false; + }); + }); + }); + + describe('updateBackoffMetadataWithLastFailedStreamConnectionTime', () => { + it('should increment numFailedStreams and set backoffEndTimeMillis', async () => { + const spy = mockStorage.setRealtimeBackoffMetadata; + const lastFailedTime = new Date(FAKE_NOW); + + await ( + realtime as any + ).updateBackoffMetadataWithLastFailedStreamConnectionTime(lastFailedTime); + + expect(spy).to.have.been.calledOnce; + const metadata = spy.getCall(0).args[0]; + expect(metadata.numFailedStreams).to.equal(1); + expect(metadata.backoffEndTimeMillis.getTime()).to.be.greaterThan( + lastFailedTime.getTime() + ); + }); + }); + + describe('updateBackoffMetadataWithRetryInterval', () => { + it('should set backoffEndTimeMillis based on provided retryIntervalSeconds and then retry connection', async () => { + const setMetadataSpy = mockStorage.setRealtimeBackoffMetadata; + const retryHttpConnectionSpy = sinon.spy( + realtime as any, + 'retryHttpConnectionWhenBackoffEnds' + ); + const retryInterval = 10; + + await (realtime as any).updateBackoffMetadataWithRetryInterval( + retryInterval + ); + + expect(setMetadataSpy).to.have.been.calledOnce; + const metadata = setMetadataSpy.getCall(0).args[0]; + expect(metadata.backoffEndTimeMillis.getTime()).to.be.closeTo( + FAKE_NOW + retryInterval * 1000, + 100 + ); + expect(retryHttpConnectionSpy).to.have.been.calledOnce; + }); + }); + + describe('closeRealtimeHttpConnection', () => { + let mockController: sinon.SinonStubbedInstance; + let mockReader: sinon.SinonStubbedInstance< + ReadableStreamDefaultReader + >; + + beforeEach(() => { + mockController = sinon.createStubInstance(AbortController); + mockReader = sinon.createStubInstance(ReadableStreamDefaultReader); + (realtime as any).controller = mockController; + (realtime as any).reader = mockReader; + }); + + it('should abort controller and cancel reader', async () => { + await (realtime as any).closeRealtimeHttpConnection(); + expect(mockController.abort).to.have.been.calledOnce; + expect(mockReader.cancel).to.have.been.calledOnce; + expect((realtime as any).controller).to.be.undefined; + expect((realtime as any).reader).to.be.undefined; + }); + + it('should handle reader cancellation failure gracefully', async () => { + mockReader.cancel.rejects(new Error('test error')); + await (realtime as any).closeRealtimeHttpConnection(); + expect(mockLogger.debug).to.have.been.calledWith( + 'Failed to cancel the reader, connection was lost.' + ); + // Should still clear reader + expect((realtime as any).reader).to.be.undefined; + }); + + it('should handle being called when reader is already undefined', async () => { + (realtime as any).reader = undefined; + await (realtime as any).closeRealtimeHttpConnection(); + expect(mockController.abort).to.have.been.calledOnce; + expect((realtime as any).controller).to.be.undefined; + }); + + it('should handle being called when controller is already undefined', async () => { + (realtime as any).controller = undefined; + await (realtime as any).closeRealtimeHttpConnection(); + expect(mockReader.cancel).to.have.been.calledOnce; + expect((realtime as any).reader).to.be.undefined; + }); + }); + + describe('resetRealtimeBackoff', () => { + it('should reset backoff metadata in storage', async () => { + const spy = mockStorage.setRealtimeBackoffMetadata; + await (realtime as any).resetRealtimeBackoff(); + expect(spy).to.have.been.calledOnce; + const metadata = spy.getCall(0).args[0]; + expect(metadata.numFailedStreams).to.equal(0); + expect(metadata.backoffEndTimeMillis.getTime()).to.equal(-1); + }); + }); + + describe('establishRealtimeConnection', () => { + it('should send correct headers and body for realtime connection', async () => { + mockStorage.getActiveConfigEtag.resolves('current-etag'); + mockStorage.getActiveConfigTemplateVersion.resolves(10); + + const url = new URL('https://example.com/stream'); + const signal = new AbortController().signal; + + await (realtime as any).establishRealtimeConnection( + url, + INSTALLATION_ID_STRING, + INSTALLATION_AUTH_TOKEN_STRING, + signal + ); + + expect(mockFetch).to.have.been.calledOnce; + const [fetchUrl, fetchOptions] = mockFetch.getCall(0).args; + expect(fetchUrl).to.equal(url); + expect(fetchOptions.method).to.equal('POST'); + expect(fetchOptions.headers).to.deep.include({ + 'X-Goog-Api-Key': API_KEY, + 'X-Goog-Firebase-Installations-Auth': INSTALLATION_AUTH_TOKEN_STRING, + 'Content-Type': 'application/json', + Accept: 'application/json', + 'If-None-Match': 'current-etag', + 'Content-Encoding': 'gzip' + }); + const body = JSON.parse(fetchOptions.body as string); + expect(body).to.deep.equal({ + project: PROJECT_NUMBER, + namespace: 'namespace', + lastKnownVersionNumber: 10, + appId: FAKE_APP_ID, + sdkVersion: 'sdk-version', + appInstanceId: INSTALLATION_ID_STRING + }); + }); + }); + + describe('retryHttpConnectionWhenBackoffEnds', () => { + let makeRealtimeHttpConnectionSpy: sinon.SinonSpy; + + beforeEach(() => { + makeRealtimeHttpConnectionSpy = sinon.spy( + realtime as any, + 'makeRealtimeHttpConnection' + ); + }); + + it('should call makeRealtimeHttpConnection with 0 delay if no backoff metadata', async () => { + mockStorage.getRealtimeBackoffMetadata.resolves(undefined); + await (realtime as any).retryHttpConnectionWhenBackoffEnds(); + expect(makeRealtimeHttpConnectionSpy).to.have.been.calledWith(0); + }); + + it('should call makeRealtimeHttpConnection with calculated delay if backoff metadata exists', async () => { + mockStorage.getRealtimeBackoffMetadata.resolves({ + // 5 seconds in the future + backoffEndTimeMillis: new Date(FAKE_NOW + 5000), + numFailedStreams: 1 + }); + await (realtime as any).retryHttpConnectionWhenBackoffEnds(); + expect(makeRealtimeHttpConnectionSpy).to.have.been.calledOnce; + const delay = makeRealtimeHttpConnectionSpy.getCall(0).args[0]; + expect(delay).to.be.closeTo(5000, 100); + }); + }); + + describe('fetchResponseIsUpToDate', () => { + it('should return true if templateVersion is greater or equal', () => { + const fetchResponse: FetchResponse = { + config: { k: 'v' }, + templateVersion: 5, + status: 200, + eTag: 'e' + }; + const result = (realtime as any).fetchResponseIsUpToDate( + fetchResponse, + 5 + ); + expect(result).to.be.true; + }); + + it('should return false if templateVersion is smaller', () => { + const fetchResponse: FetchResponse = { + config: { k: 'v' }, + templateVersion: 4, + status: 200, + eTag: 'e' + }; + const result = (realtime as any).fetchResponseIsUpToDate( + fetchResponse, + 5 + ); + expect(result).to.be.false; + }); + + it('should return true if no config and lastFetchStatus is success', () => { + const fetchResponse: FetchResponse = { + config: undefined, + templateVersion: undefined, + status: 304, + eTag: 'e' + }; + mockStorageCache.getLastFetchStatus.returns('success'); + const result = (realtime as any).fetchResponseIsUpToDate( + fetchResponse, + 5 + ); + expect(result).to.be.true; + }); + + it('should return false if no config and lastFetchStatus is not success', () => { + const fetchResponse: FetchResponse = { + config: undefined, + templateVersion: undefined, + status: 304, + eTag: 'e' + }; + mockStorageCache.getLastFetchStatus.returns('throttle'); // Or any other non-'success' status + const result = (realtime as any).fetchResponseIsUpToDate( + fetchResponse, + 5 + ); + expect(result).to.be.false; + }); + }); + + describe('fetchLatestConfig', () => { + let autoFetchSpy: sinon.SinonSpy; + let executeAllListenerCallbacksSpy: sinon.SinonSpy; + + beforeEach(() => { + autoFetchSpy = sinon.spy(realtime as any, 'autoFetch'); + executeAllListenerCallbacksSpy = sinon.spy( + realtime as any, + 'executeAllListenerCallbacks' + ); + mockStorage.getActiveConfig.resolves({ existingKey: 'value' }); + mockStorage.getActiveConfigTemplateVersion.resolves(1); + }); + + afterEach(() => { + autoFetchSpy.restore(); + executeAllListenerCallbacksSpy.restore(); + }); + + it('should fetch, identify changed keys, and notify observers', async () => { + mockCachingClient.fetch.resolves({ + config: { existingKey: 'new_value', newKey: 'value' }, + templateVersion: 2, + status: 200, + eTag: 'e' + }); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + + expect(mockCachingClient.fetch).to.have.been.calledOnce; + expect(executeAllListenerCallbacksSpy).to.have.been.calledOnce; + const configUpdate = executeAllListenerCallbacksSpy.getCall(0).args[0]; + expect(configUpdate.getUpdatedKeys()).to.deep.equal( + new Set(['existingKey', 'newKey']) + ); + }); + + it('should retry with autoFetch if fetched version is not up-to-date', async () => { + autoFetchSpy.restore(); + const autoFetchStub = sinon.stub(realtime as any, 'autoFetch'); + + mockCachingClient.fetch.resolves({ + config: { k: 'v' }, + templateVersion: 1, + status: 200, + eTag: 'e' + }); + mockStorage.getActiveConfigTemplateVersion.resolves(0); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + + expect(mockCachingClient.fetch).to.have.been.calledOnce; + expect(autoFetchStub).to.have.been.calledOnceWith( + MAXIMUM_FETCH_ATTEMPTS - 1, + 2 + ); + }); + + it('should not notify if no keys have changed', async () => { + mockCachingClient.fetch.resolves({ + config: { existingKey: 'value' }, + templateVersion: 2, + status: 200, + eTag: 'e' + }); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + + expect(executeAllListenerCallbacksSpy).not.to.have.been.called; + }); + + it('should propagate error on fetch failure', async () => { + const testError = new Error('Network failed'); + mockCachingClient.fetch.rejects(testError); + const propagateErrorSpy = sinon.spy(realtime as any, 'propagateError'); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + + expect(propagateErrorSpy).to.have.been.calledOnce; + const error = propagateErrorSpy.getCall(0).args[0]; + expect(error.code).to.include(ErrorCode.CONFIG_UPDATE_NOT_FETCHED); + }); + + it('should include custom signals in fetch request', async () => { + mockStorageCache.getCustomSignals.returns({ signal1: 'value1' }); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + expect(mockLogger.debug).to.have.been.calledWith( + `Fetching config with custom signals: {"signal1":"value1"}` + ); + }); + + it('should handle null activatedConfigs gracefully', async () => { + mockCachingClient.fetch.resolves({ + config: { newKey: 'value' }, + templateVersion: 2, + status: 200, + eTag: 'e' + }); + mockStorage.getActiveConfig.resolves(null as any); + + await (realtime as any).fetchLatestConfig(MAXIMUM_FETCH_ATTEMPTS, 2); + + expect(executeAllListenerCallbacksSpy).to.have.been.calledOnce; + const configUpdate = executeAllListenerCallbacksSpy.getCall(0).args[0]; + expect(configUpdate.getUpdatedKeys()).to.deep.equal(new Set(['newKey'])); + }); + }); + + describe('autoFetch', () => { + let fetchLatestConfigStub: sinon.SinonStub; + let propagateErrorSpy: sinon.SinonSpy; + + beforeEach(() => { + fetchLatestConfigStub = sinon.stub(realtime as any, 'fetchLatestConfig'); + propagateErrorSpy = sinon.spy(realtime as any, 'propagateError'); + }); + + afterEach(() => { + fetchLatestConfigStub.restore(); + propagateErrorSpy.restore(); + }); + + it('should call fetchLatestConfig after a random delay', async () => { + (realtime as any).autoFetch(MAXIMUM_FETCH_ATTEMPTS, 10); + await clock.runAllAsync(); + + expect(fetchLatestConfigStub).to.have.been.calledOnceWith( + MAXIMUM_FETCH_ATTEMPTS, + 10 + ); + }); + + it('should propagate an error if remaining attempts is zero', async () => { + await (realtime as any).autoFetch(0, 10); + expect(propagateErrorSpy).to.have.been.calledOnce; + const error = propagateErrorSpy.getCall(0).args[0]; + expect(error.code).to.include(ErrorCode.CONFIG_UPDATE_NOT_FETCHED); + expect(fetchLatestConfigStub).not.to.have.been.called; + }); + }); + + describe('handleNotifications', () => { + let mockReader: ReadableStreamDefaultReader; + let autoFetchSpy: sinon.SinonSpy; + let executeAllListenerCallbacksSpy: sinon.SinonSpy; + let propagateErrorSpy: sinon.SinonSpy; + + beforeEach(() => { + autoFetchSpy = sinon.spy(realtime as any, 'autoFetch'); + executeAllListenerCallbacksSpy = sinon.spy( + realtime as any, + 'executeAllListenerCallbacks' + ); + propagateErrorSpy = sinon.spy(realtime as any, 'propagateError'); + (realtime as any).observers.add({}); + }); + + afterEach(() => { + autoFetchSpy.restore(); + executeAllListenerCallbacksSpy.restore(); + propagateErrorSpy.restore(); + }); + + it('should set backoff metadata if REALTIME_RETRY_INTERVAL is present', async () => { + const updateBackoffStub = sinon + .stub(realtime as any, 'updateBackoffMetadataWithRetryInterval') + .resolves(); + + mockReader = createStreamingMockReader(['{"retryIntervalSeconds": 60}']); + + await (realtime as any).handleNotifications(mockReader); + + expect(updateBackoffStub).to.have.been.calledOnceWith(60); + }); + + it('should propagate error on invalid JSON', async () => { + mockReader = createStreamingMockReader(['{invalid_json}']); + + await (realtime as any).handleNotifications(mockReader); + + expect(propagateErrorSpy).to.have.been.calledOnce; + const error = propagateErrorSpy.getCall(0).args[0]; + expect(error.code).to.include(ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID); + }); + + it('should break if event listeners become empty during handling', async () => { + autoFetchSpy.restore(); + + mockReader = createStreamingMockReader([ + '{"latestTemplateVersionNumber": 10}' + ]); + mockStorage.getActiveConfigTemplateVersion.resolves(5); + mockCachingClient.fetch.resolves({ + config: { k: 'v' }, + templateVersion: 10, + status: 200, + eTag: 'e' + }); + + const observer = (realtime as any).observers.values().next().value; + const originalJsonParse = JSON.parse; + JSON.parse = (text: string) => { + (realtime as any).observers.delete(observer); + return originalJsonParse(text); + }; + + await (realtime as any).handleNotifications(mockReader); + + expect(mockReader.read).to.have.been.calledOnce; + + JSON.parse = originalJsonParse; + }); + }); + + describe('beginRealtimeHttpStream', () => { + let createRealtimeConnectionSpy: sinon.SinonStub; + let listenForNotificationsSpy: sinon.SinonSpy; + let closeRealtimeHttpConnectionSpy: sinon.SinonSpy; + let retryHttpConnectionWhenBackoffEndsSpy: sinon.SinonStub; + let updateBackoffMetadataWithLastFailedStreamConnectionTimeSpy: sinon.SinonSpy; + let propagateErrorSpy: sinon.SinonSpy; + let checkAndSetHttpConnectionFlagIfNotRunningSpy: sinon.SinonStub; + + beforeEach(() => { + createRealtimeConnectionSpy = sinon.stub( + realtime as any, + 'createRealtimeConnection' + ); + listenForNotificationsSpy = sinon.spy( + realtime as any, + 'listenForNotifications' + ); + closeRealtimeHttpConnectionSpy = sinon.spy( + realtime as any, + 'closeRealtimeHttpConnection' + ); + + retryHttpConnectionWhenBackoffEndsSpy = sinon + .stub(realtime as any, 'retryHttpConnectionWhenBackoffEnds') + .resolves(); + updateBackoffMetadataWithLastFailedStreamConnectionTimeSpy = sinon.spy( + realtime as any, + 'updateBackoffMetadataWithLastFailedStreamConnectionTime' + ); + propagateErrorSpy = sinon.spy(realtime as any, 'propagateError'); + checkAndSetHttpConnectionFlagIfNotRunningSpy = sinon + .stub(realtime as any, 'checkAndSetHttpConnectionFlagIfNotRunning') + .returns(true); + + createRealtimeConnectionSpy.resolves( + new Response(createMockReadableStream(), { status: 200 }) + ); + + mockStorage.getRealtimeBackoffMetadata.resolves({ + backoffEndTimeMillis: new Date(-1), + numFailedStreams: 0 + }); + (realtime as any).httpRetriesRemaining = ORIGINAL_RETRIES; + }); + + afterEach(() => { + retryHttpConnectionWhenBackoffEndsSpy.restore(); + }); + + it('should successfully establish and handle a connection', async () => { + const resetRealtimeBackoffSpy = sinon.spy( + realtime as any, + 'resetRealtimeBackoff' + ); + (realtime as any).observers.add({}); + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(createRealtimeConnectionSpy).to.have.been.calledOnce; + expect(listenForNotificationsSpy).to.have.been.calledOnce; + expect(resetRealtimeBackoffSpy).to.have.been.calledOnce; + expect(closeRealtimeHttpConnectionSpy).to.have.been.calledOnce; + expect(retryHttpConnectionWhenBackoffEndsSpy).to.have.been.calledOnce; + }); + + it('should return early if connection flag cannot be set', async () => { + checkAndSetHttpConnectionFlagIfNotRunningSpy.returns(false); + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + expect(createRealtimeConnectionSpy).not.to.have.been.called; + }); + + it('should retry if currently in backoff period', async () => { + mockStorage.getRealtimeBackoffMetadata.resolves({ + backoffEndTimeMillis: new Date(FAKE_NOW + 1000), + numFailedStreams: 1 + }); + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + expect(retryHttpConnectionWhenBackoffEndsSpy).to.have.been.calledOnce; + expect(createRealtimeConnectionSpy).not.to.have.been.called; + }); + + it('should update backoff metadata on connection failure in foreground', async () => { + (realtime as any).httpRetriesRemaining = 1; + + createRealtimeConnectionSpy.resolves(new Response(null, { status: 502 })); + (realtime as any).observers.add({}); + + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(updateBackoffMetadataWithLastFailedStreamConnectionTimeSpy).to.have + .been.calledOnce; + expect(retryHttpConnectionWhenBackoffEndsSpy).to.have.been.calledOnce; + }); + + it('should NOT schedule a retry on connection failure in background', async () => { + (realtime as any).isInBackground = true; + + (realtime as any).observers.add({}); + + createRealtimeConnectionSpy.resolves(new Response(null, { status: 503 })); + + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(updateBackoffMetadataWithLastFailedStreamConnectionTimeSpy).not.to + .have.been.called; + + expect(retryHttpConnectionWhenBackoffEndsSpy).not.to.have.been.called; + }); + + it('should propagate CONFIG_UPDATE_STREAM_ERROR if connection fails non-retryably', async () => { + (realtime as any).httpRetriesRemaining = 1; + createRealtimeConnectionSpy.resolves(new Response(null, { status: 400 })); + (realtime as any).observers.add({}); + + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(retryHttpConnectionWhenBackoffEndsSpy).not.to.have.been.called; + expect(propagateErrorSpy).to.have.been.calledOnce; + }); + + it('should not propagate error if connection fails non-retryably in background', async () => { + (realtime as any).httpRetriesRemaining = 1; + createRealtimeConnectionSpy.resolves(new Response(null, { status: 400 })); + (realtime as any).observers.add({}); + (realtime as any).isInBackground = true; + + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(propagateErrorSpy).to.have.been.calledOnce; + }); + + it('should propagate CONFIG_UPDATE_STREAM_ERROR if retries are exhausted', async () => { + (realtime as any).httpRetriesRemaining = 0; + (realtime as any).observers.add({}); + await (realtime as any).makeRealtimeHttpConnection(0); + + expect(propagateErrorSpy).to.have.been.calledOnce; + const error = propagateErrorSpy.getCall(0).args[0]; + expect(error.code).to.include(ErrorCode.CONFIG_UPDATE_STREAM_ERROR); + }); + + it('should handle rejection from createRealtimeConnection', async () => { + const testError = new Error('Connection refused'); + createRealtimeConnectionSpy.rejects(testError); + (realtime as any).observers.add({}); + + await (realtime as any).prepareAndBeginRealtimeHttpStream(); + + expect(updateBackoffMetadataWithLastFailedStreamConnectionTimeSpy).to.have + .been.calledOnce; + expect(retryHttpConnectionWhenBackoffEndsSpy).to.have.been.calledOnce; + }); + }); + + describe('canEstablishStreamConnection', () => { + it('returns true if all conditions are met', () => { + (realtime as any).observers.add({}); + (realtime as any).isRealtimeDisabled = false; + (realtime as any).isConnectionActive = false; + (realtime as any).isInBackground = false; + expect((realtime as any).canEstablishStreamConnection()).to.be.true; + }); + + it('returns false if there are no observers', () => { + (realtime as any).observers.clear(); + expect((realtime as any).canEstablishStreamConnection()).to.be.false; + }); + + it('returns false if realtime is disabled', () => { + (realtime as any).observers.add({}); + (realtime as any).isRealtimeDisabled = true; + expect((realtime as any).canEstablishStreamConnection()).to.be.false; + }); + + it('returns false if a connection is already active', () => { + (realtime as any).observers.add({}); + (realtime as any).isConnectionActive = true; + expect((realtime as any).canEstablishStreamConnection()).to.be.false; + }); + + it('returns false if app is in background', () => { + (realtime as any).observers.add({}); + (realtime as any).isInBackground = true; + expect((realtime as any).canEstablishStreamConnection()).to.be.false; + }); + }); + + describe('addObserver/removeObserver', () => { + let beginRealtimeStub: sinon.SinonStub; + const observer: ConfigUpdateObserver = { + next: () => {}, + error: () => {}, + complete: () => {} + }; + + beforeEach(() => { + beginRealtimeStub = sinon + .stub(realtime as any, 'beginRealtime') + .resolves(); + }); + + afterEach(() => { + beginRealtimeStub.restore(); + }); + + it('addObserver should add an observer and start the realtime connection', async () => { + await realtime.addObserver(observer); + expect((realtime as any).observers.has(observer)).to.be.true; + + expect(beginRealtimeStub).to.have.been.calledOnce; + }); + + it('removeObserver should remove an observer', () => { + (realtime as any).observers.add(observer); + realtime.removeObserver(observer); + expect((realtime as any).observers.has(observer)).to.be.false; + }); + }); + describe('onVisibilityChange', () => { + let closeConnectionSpy: sinon.SinonSpy; + let beginRealtimeSpy: sinon.SinonSpy; + + beforeEach(() => { + closeConnectionSpy = sinon.spy( + realtime as any, + 'closeRealtimeHttpConnection' + ); + beginRealtimeSpy = sinon.spy(realtime as any, 'beginRealtime'); + }); + + afterEach(() => { + closeConnectionSpy.restore(); + beginRealtimeSpy.restore(); + }); + + it('should close connection when app goes to background', async () => { + await (realtime as any).onVisibilityChange(false); + expect((realtime as any).isInBackground).to.be.true; + expect(closeConnectionSpy).to.have.been.calledOnce; + expect(beginRealtimeSpy).not.to.have.been.called; + }); + + it('should start connection when app comes to foreground', async () => { + await (realtime as any).onVisibilityChange(true); + expect((realtime as any).isInBackground).to.be.false; + expect(closeConnectionSpy).not.to.have.been.called; + expect(beginRealtimeSpy).to.have.been.calledOnce; + }); + }); +}); diff --git a/packages/remote-config/test/client/rest_client.test.ts b/packages/remote-config/test/client/rest_client.test.ts index 96a6cde8454..bda6fbce01a 100644 --- a/packages/remote-config/test/client/rest_client.test.ts +++ b/packages/remote-config/test/client/rest_client.test.ts @@ -26,6 +26,7 @@ import { FetchRequest, RemoteConfigAbortSignal } from '../../src/client/remote_config_fetch_client'; +import { Storage } from '../../src/storage/storage'; const DEFAULT_REQUEST: FetchRequest = { cacheMaxAgeMillis: 1, @@ -34,6 +35,7 @@ const DEFAULT_REQUEST: FetchRequest = { describe('RestClient', () => { const firebaseInstallations = {} as FirebaseInstallations; + const storage = {} as Storage; let client: RestClient; beforeEach(() => { @@ -51,6 +53,7 @@ describe('RestClient', () => { firebaseInstallations.getToken = sinon .stub() .returns(Promise.resolve('fis-token')); + storage.setActiveConfigTemplateVersion = sinon.stub(); }); describe('fetch', () => { @@ -74,7 +77,8 @@ describe('RestClient', () => { status: 200, eTag: 'etag', state: 'UPDATE', - entries: { color: 'sparkling' } + entries: { color: 'sparkling' }, + templateVersion: 1 }; fetchStub.returns( @@ -85,7 +89,8 @@ describe('RestClient', () => { json: () => Promise.resolve({ entries: expectedResponse.entries, - state: expectedResponse.state + state: expectedResponse.state, + templateVersion: expectedResponse.templateVersion }) } as Response) ); @@ -95,7 +100,8 @@ describe('RestClient', () => { expect(response).to.deep.eq({ status: expectedResponse.status, eTag: expectedResponse.eTag, - config: expectedResponse.entries + config: expectedResponse.entries, + templateVersion: expectedResponse.templateVersion }); }); @@ -184,7 +190,8 @@ describe('RestClient', () => { expect(response).to.deep.eq({ status: 304, eTag: 'response-etag', - config: undefined + config: undefined, + templateVersion: undefined }); }); @@ -222,7 +229,8 @@ describe('RestClient', () => { expect(response).to.deep.eq({ status: 304, eTag: 'etag', - config: undefined + config: undefined, + templateVersion: undefined }); }); @@ -239,7 +247,8 @@ describe('RestClient', () => { await expect(client.fetch(DEFAULT_REQUEST)).to.eventually.be.deep.eq({ status: 200, eTag: 'etag', - config: {} + config: {}, + templateVersion: undefined }); } }); diff --git a/packages/remote-config/test/remote_config.test.ts b/packages/remote-config/test/remote_config.test.ts index 8010f54f26d..1cc6b62717e 100644 --- a/packages/remote-config/test/remote_config.test.ts +++ b/packages/remote-config/test/remote_config.test.ts @@ -46,6 +46,7 @@ import { import * as api from '../src/api'; import { fetchAndActivate } from '../src'; import { restore } from 'sinon'; +import { RealtimeHandler } from '../src/client/realtime_handler'; describe('RemoteConfig', () => { const ACTIVE_CONFIG = { @@ -67,6 +68,7 @@ describe('RemoteConfig', () => { let storageCache: StorageCache; let storage: Storage; let logger: Logger; + let realtimeHandler: RealtimeHandler; let rc: RemoteConfigType; let getActiveConfigStub: sinon.SinonStub; @@ -79,12 +81,20 @@ describe('RemoteConfig', () => { client = {} as RemoteConfigFetchClient; storageCache = {} as StorageCache; storage = {} as Storage; + realtimeHandler = {} as RealtimeHandler; logger = new Logger('package-name'); getActiveConfigStub = sinon.stub().returns(undefined); storageCache.getActiveConfig = getActiveConfigStub; loggerDebugSpy = sinon.spy(logger, 'debug'); loggerLogLevelSpy = sinon.spy(logger, 'logLevel', ['set']); - rc = new RemoteConfig(app, client, storageCache, storage, logger); + rc = new RemoteConfig( + app, + client, + storageCache, + storage, + logger, + realtimeHandler + ); }); afterEach(() => { @@ -380,39 +390,56 @@ describe('RemoteConfig', () => { const ETAG = 'etag'; const CONFIG = { key: 'val' }; const NEW_ETAG = 'new_etag'; + const TEMPLATE_VERSION = 1; let getLastSuccessfulFetchResponseStub: sinon.SinonStub; let getActiveConfigEtagStub: sinon.SinonStub; + let getActiveConfigTemplateVersionStub: sinon.SinonStub; let setActiveConfigEtagStub: sinon.SinonStub; let setActiveConfigStub: sinon.SinonStub; + let setActiveConfigTemplateVersionStub: sinon.SinonStub; beforeEach(() => { getLastSuccessfulFetchResponseStub = sinon.stub(); getActiveConfigEtagStub = sinon.stub(); + getActiveConfigTemplateVersionStub = sinon.stub(); setActiveConfigEtagStub = sinon.stub(); setActiveConfigStub = sinon.stub(); + setActiveConfigTemplateVersionStub = sinon.stub(); storage.getLastSuccessfulFetchResponse = getLastSuccessfulFetchResponseStub; storage.getActiveConfigEtag = getActiveConfigEtagStub; + storage.getActiveConfigTemplateVersion = + getActiveConfigTemplateVersionStub; storage.setActiveConfigEtag = setActiveConfigEtagStub; storageCache.setActiveConfig = setActiveConfigStub; + storage.setActiveConfigTemplateVersion = + setActiveConfigTemplateVersionStub; }); it('does not activate if last successful fetch response is undefined', async () => { getLastSuccessfulFetchResponseStub.returns(Promise.resolve()); getActiveConfigEtagStub.returns(Promise.resolve(ETAG)); + getActiveConfigTemplateVersionStub.returns( + Promise.resolve(TEMPLATE_VERSION) + ); const activateResponse = await activate(rc); expect(activateResponse).to.be.false; expect(storage.setActiveConfigEtag).to.not.have.been.called; expect(storageCache.setActiveConfig).to.not.have.been.called; + expect(storage.setActiveConfigTemplateVersion).to.not.have.been.called; }); it('does not activate if fetched and active etags are the same', async () => { getLastSuccessfulFetchResponseStub.returns( - Promise.resolve({ config: {}, etag: ETAG }) + Promise.resolve({ + config: {}, + eTag: ETAG, + templateVersion: TEMPLATE_VERSION + }) ); getActiveConfigEtagStub.returns(Promise.resolve(ETAG)); @@ -421,11 +448,16 @@ describe('RemoteConfig', () => { expect(activateResponse).to.be.false; expect(storage.setActiveConfigEtag).to.not.have.been.called; expect(storageCache.setActiveConfig).to.not.have.been.called; + expect(storage.setActiveConfigTemplateVersion).to.not.have.been.called; }); it('activates if fetched and active etags are different', async () => { getLastSuccessfulFetchResponseStub.returns( - Promise.resolve({ config: CONFIG, eTag: NEW_ETAG }) + Promise.resolve({ + config: CONFIG, + eTag: NEW_ETAG, + templateVersion: TEMPLATE_VERSION + }) ); getActiveConfigEtagStub.returns(Promise.resolve(ETAG)); @@ -434,11 +466,18 @@ describe('RemoteConfig', () => { expect(activateResponse).to.be.true; expect(storage.setActiveConfigEtag).to.have.been.calledWith(NEW_ETAG); expect(storageCache.setActiveConfig).to.have.been.calledWith(CONFIG); + expect(storage.setActiveConfigTemplateVersion).to.have.been.calledWith( + TEMPLATE_VERSION + ); }); it('activates if fetched is defined but active config is not', async () => { getLastSuccessfulFetchResponseStub.returns( - Promise.resolve({ config: CONFIG, eTag: NEW_ETAG }) + Promise.resolve({ + config: CONFIG, + eTag: NEW_ETAG, + templateVersion: TEMPLATE_VERSION + }) ); getActiveConfigEtagStub.returns(Promise.resolve()); @@ -447,6 +486,9 @@ describe('RemoteConfig', () => { expect(activateResponse).to.be.true; expect(storage.setActiveConfigEtag).to.have.been.calledWith(NEW_ETAG); expect(storageCache.setActiveConfig).to.have.been.calledWith(CONFIG); + expect(storage.setActiveConfigTemplateVersion).to.have.been.calledWith( + TEMPLATE_VERSION + ); }); }); From 9b8ab02c543785226fafec056d39be7cf7ee03d1 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 15 Sep 2025 09:05:58 -0700 Subject: [PATCH 276/295] feat(ai): Add code execution (#9249) --- .changeset/lucky-socks-roll.md | 6 + common/api-review/ai.api.md | 105 +++++++++++++++++- docs-devsite/_toc.yaml | 10 ++ docs-devsite/ai.codeexecutionresult.md | 46 ++++++++ docs-devsite/ai.codeexecutionresultpart.md | 96 ++++++++++++++++ docs-devsite/ai.codeexecutiontool.md | 35 ++++++ docs-devsite/ai.executablecode.md | 46 ++++++++ docs-devsite/ai.executablecodepart.md | 96 ++++++++++++++++ docs-devsite/ai.filedatapart.md | 18 +++ docs-devsite/ai.functioncallpart.md | 18 +++ docs-devsite/ai.functionresponsepart.md | 18 +++ docs-devsite/ai.googlesearchtool.md | 4 +- docs-devsite/ai.inlinedatapart.md | 18 +++ docs-devsite/ai.md | 61 +++++++++- docs-devsite/ai.textpart.md | 18 +++ .../ai/integration/generate-content.test.ts | 28 +++++ .../ai/src/methods/chat-session-helpers.ts | 4 +- .../ai/src/methods/generate-content.test.ts | 23 +++- .../ai/src/models/generative-model.test.ts | 28 ++++- packages/ai/src/types/content.ts | 89 ++++++++++++++- packages/ai/src/types/enums.ts | 36 ++++++ packages/ai/src/types/requests.ts | 20 +++- 22 files changed, 804 insertions(+), 19 deletions(-) create mode 100644 .changeset/lucky-socks-roll.md create mode 100644 docs-devsite/ai.codeexecutionresult.md create mode 100644 docs-devsite/ai.codeexecutionresultpart.md create mode 100644 docs-devsite/ai.codeexecutiontool.md create mode 100644 docs-devsite/ai.executablecode.md create mode 100644 docs-devsite/ai.executablecodepart.md diff --git a/.changeset/lucky-socks-roll.md b/.changeset/lucky-socks-roll.md new file mode 100644 index 00000000000..8b9d9a19e97 --- /dev/null +++ b/.changeset/lucky-socks-roll.md @@ -0,0 +1,6 @@ +--- +'@firebase/ai': minor +'firebase': minor +--- + +Added Code Execution feature. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 43a10169cfa..c1b570a7e05 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -174,6 +174,39 @@ export interface CitationMetadata { citations: Citation[]; } +// @public +export interface CodeExecutionResult { + outcome?: Outcome; + output?: string; +} + +// @public +export interface CodeExecutionResultPart { + // (undocumented) + codeExecutionResult?: CodeExecutionResult; + // (undocumented) + executableCode?: never; + // (undocumented) + fileData: never; + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; + // (undocumented) + thought?: never; + // @internal (undocumented) + thoughtSignature?: never; +} + +// @public +export interface CodeExecutionTool { + codeExecution: {}; +} + // @public export interface Content { // (undocumented) @@ -237,6 +270,34 @@ export interface ErrorDetails { reason?: string; } +// @public +export interface ExecutableCode { + code?: string; + language?: Language; +} + +// @public +export interface ExecutableCodePart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: ExecutableCode; + // (undocumented) + fileData: never; + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; + // (undocumented) + thought?: never; + // @internal (undocumented) + thoughtSignature?: never; +} + // @public export interface FileData { // (undocumented) @@ -247,6 +308,10 @@ export interface FileData { // @public export interface FileDataPart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: never; // (undocumented) fileData: FileData; // (undocumented) @@ -308,6 +373,10 @@ export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof Func // @public export interface FunctionCallPart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: never; // (undocumented) functionCall: FunctionCall; // (undocumented) @@ -345,6 +414,10 @@ export interface FunctionResponse { // @public export interface FunctionResponsePart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: never; // (undocumented) functionCall?: never; // (undocumented) @@ -735,6 +808,10 @@ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; // @public export interface InlineDataPart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: never; // (undocumented) functionCall?: never; // (undocumented) @@ -755,6 +832,15 @@ export class IntegerSchema extends Schema { constructor(schemaParams?: SchemaParams); } +// @public +export const Language: { + UNSPECIFIED: string; + PYTHON: string; +}; + +// @public +export type Language = (typeof Language)[keyof typeof Language]; + // @public export interface LanguageModelCreateCoreOptions { // (undocumented) @@ -969,7 +1055,18 @@ export interface OnDeviceParams { } // @public -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +export const Outcome: { + UNSPECIFIED: string; + OK: string; + FAILED: string; + DEADLINE_EXCEEDED: string; +}; + +// @public +export type Outcome = (typeof Outcome)[keyof typeof Outcome]; + +// @public +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart; // @public export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; @@ -1179,6 +1276,10 @@ export class StringSchema extends Schema { // @public export interface TextPart { + // (undocumented) + codeExecutionResult?: never; + // (undocumented) + executableCode?: never; // (undocumented) functionCall?: never; // (undocumented) @@ -1200,7 +1301,7 @@ export interface ThinkingConfig { } // @public -export type Tool = FunctionDeclarationsTool | GoogleSearchTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool; // @public export interface ToolConfig { diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 379be5dd29d..364d5b992c9 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -32,6 +32,12 @@ toc: path: /docs/reference/js/ai.citation.md - title: CitationMetadata path: /docs/reference/js/ai.citationmetadata.md + - title: CodeExecutionResult + path: /docs/reference/js/ai.codeexecutionresult.md + - title: CodeExecutionResultPart + path: /docs/reference/js/ai.codeexecutionresultpart.md + - title: CodeExecutionTool + path: /docs/reference/js/ai.codeexecutiontool.md - title: Content path: /docs/reference/js/ai.content.md - title: CountTokensRequest @@ -46,6 +52,10 @@ toc: path: /docs/reference/js/ai.enhancedgeneratecontentresponse.md - title: ErrorDetails path: /docs/reference/js/ai.errordetails.md + - title: ExecutableCode + path: /docs/reference/js/ai.executablecode.md + - title: ExecutableCodePart + path: /docs/reference/js/ai.executablecodepart.md - title: FileData path: /docs/reference/js/ai.filedata.md - title: FileDataPart diff --git a/docs-devsite/ai.codeexecutionresult.md b/docs-devsite/ai.codeexecutionresult.md new file mode 100644 index 00000000000..d0be155c4e6 --- /dev/null +++ b/docs-devsite/ai.codeexecutionresult.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CodeExecutionResult interface +The results of code execution run by the model. + +Signature: + +```typescript +export interface CodeExecutionResult +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | The result of the code execution. | +| [output](./ai.codeexecutionresult.md#codeexecutionresultoutput) | string | The output from the code execution, or an error message if it failed. | + +## CodeExecutionResult.outcome + +The result of the code execution. + +Signature: + +```typescript +outcome?: Outcome; +``` + +## CodeExecutionResult.output + +The output from the code execution, or an error message if it failed. + +Signature: + +```typescript +output?: string; +``` diff --git a/docs-devsite/ai.codeexecutionresultpart.md b/docs-devsite/ai.codeexecutionresultpart.md new file mode 100644 index 00000000000..6142a3ec79f --- /dev/null +++ b/docs-devsite/ai.codeexecutionresultpart.md @@ -0,0 +1,96 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CodeExecutionResultPart interface +Represents the code execution result from the model. + +Signature: + +```typescript +export interface CodeExecutionResultPart +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [codeExecutionResult](./ai.codeexecutionresultpart.md#codeexecutionresultpartcodeexecutionresult) | [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | | +| [executableCode](./ai.codeexecutionresultpart.md#codeexecutionresultpartexecutablecode) | never | | +| [fileData](./ai.codeexecutionresultpart.md#codeexecutionresultpartfiledata) | never | | +| [functionCall](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctioncall) | never | | +| [functionResponse](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctionresponse) | never | | +| [inlineData](./ai.codeexecutionresultpart.md#codeexecutionresultpartinlinedata) | never | | +| [text](./ai.codeexecutionresultpart.md#codeexecutionresultparttext) | never | | +| [thought](./ai.codeexecutionresultpart.md#codeexecutionresultpartthought) | never | | + +## CodeExecutionResultPart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: CodeExecutionResult; +``` + +## CodeExecutionResultPart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + +## CodeExecutionResultPart.fileData + +Signature: + +```typescript +fileData: never; +``` + +## CodeExecutionResultPart.functionCall + +Signature: + +```typescript +functionCall?: never; +``` + +## CodeExecutionResultPart.functionResponse + +Signature: + +```typescript +functionResponse?: never; +``` + +## CodeExecutionResultPart.inlineData + +Signature: + +```typescript +inlineData?: never; +``` + +## CodeExecutionResultPart.text + +Signature: + +```typescript +text?: never; +``` + +## CodeExecutionResultPart.thought + +Signature: + +```typescript +thought?: never; +``` diff --git a/docs-devsite/ai.codeexecutiontool.md b/docs-devsite/ai.codeexecutiontool.md new file mode 100644 index 00000000000..34a4715ac63 --- /dev/null +++ b/docs-devsite/ai.codeexecutiontool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CodeExecutionTool interface +A tool that enables the model to use code execution. + +Signature: + +```typescript +export interface CodeExecutionTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. | + +## CodeExecutionTool.codeExecution + +Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. + +Signature: + +```typescript +codeExecution: {}; +``` diff --git a/docs-devsite/ai.executablecode.md b/docs-devsite/ai.executablecode.md new file mode 100644 index 00000000000..bab79bacc50 --- /dev/null +++ b/docs-devsite/ai.executablecode.md @@ -0,0 +1,46 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ExecutableCode interface +An interface for executable code returned by the model. + +Signature: + +```typescript +export interface ExecutableCode +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [code](./ai.executablecode.md#executablecodecode) | string | The source code to be executed. | +| [language](./ai.executablecode.md#executablecodelanguage) | [Language](./ai.md#language) | The programming language of the code. | + +## ExecutableCode.code + +The source code to be executed. + +Signature: + +```typescript +code?: string; +``` + +## ExecutableCode.language + +The programming language of the code. + +Signature: + +```typescript +language?: Language; +``` diff --git a/docs-devsite/ai.executablecodepart.md b/docs-devsite/ai.executablecodepart.md new file mode 100644 index 00000000000..99c6bf05987 --- /dev/null +++ b/docs-devsite/ai.executablecodepart.md @@ -0,0 +1,96 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ExecutableCodePart interface +Represents the code that is executed by the model. + +Signature: + +```typescript +export interface ExecutableCodePart +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [codeExecutionResult](./ai.executablecodepart.md#executablecodepartcodeexecutionresult) | never | | +| [executableCode](./ai.executablecodepart.md#executablecodepartexecutablecode) | [ExecutableCode](./ai.executablecode.md#executablecode_interface) | | +| [fileData](./ai.executablecodepart.md#executablecodepartfiledata) | never | | +| [functionCall](./ai.executablecodepart.md#executablecodepartfunctioncall) | never | | +| [functionResponse](./ai.executablecodepart.md#executablecodepartfunctionresponse) | never | | +| [inlineData](./ai.executablecodepart.md#executablecodepartinlinedata) | never | | +| [text](./ai.executablecodepart.md#executablecodeparttext) | never | | +| [thought](./ai.executablecodepart.md#executablecodepartthought) | never | | + +## ExecutableCodePart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## ExecutableCodePart.executableCode + +Signature: + +```typescript +executableCode?: ExecutableCode; +``` + +## ExecutableCodePart.fileData + +Signature: + +```typescript +fileData: never; +``` + +## ExecutableCodePart.functionCall + +Signature: + +```typescript +functionCall?: never; +``` + +## ExecutableCodePart.functionResponse + +Signature: + +```typescript +functionResponse?: never; +``` + +## ExecutableCodePart.inlineData + +Signature: + +```typescript +inlineData?: never; +``` + +## ExecutableCodePart.text + +Signature: + +```typescript +text?: never; +``` + +## ExecutableCodePart.thought + +Signature: + +```typescript +thought?: never; +``` diff --git a/docs-devsite/ai.filedatapart.md b/docs-devsite/ai.filedatapart.md index 2b5179319f7..f031988a993 100644 --- a/docs-devsite/ai.filedatapart.md +++ b/docs-devsite/ai.filedatapart.md @@ -22,6 +22,8 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | +| [codeExecutionResult](./ai.filedatapart.md#filedatapartcodeexecutionresult) | never | | +| [executableCode](./ai.filedatapart.md#filedatapartexecutablecode) | never | | | [fileData](./ai.filedatapart.md#filedatapartfiledata) | [FileData](./ai.filedata.md#filedata_interface) | | | [functionCall](./ai.filedatapart.md#filedatapartfunctioncall) | never | | | [functionResponse](./ai.filedatapart.md#filedatapartfunctionresponse) | never | | @@ -29,6 +31,22 @@ export interface FileDataPart | [text](./ai.filedatapart.md#filedataparttext) | never | | | [thought](./ai.filedatapart.md#filedatapartthought) | boolean | | +## FileDataPart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## FileDataPart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + ## FileDataPart.fileData Signature: diff --git a/docs-devsite/ai.functioncallpart.md b/docs-devsite/ai.functioncallpart.md index 3f07c5d0d74..cb9d8b89cf2 100644 --- a/docs-devsite/ai.functioncallpart.md +++ b/docs-devsite/ai.functioncallpart.md @@ -22,12 +22,30 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | +| [codeExecutionResult](./ai.functioncallpart.md#functioncallpartcodeexecutionresult) | never | | +| [executableCode](./ai.functioncallpart.md#functioncallpartexecutablecode) | never | | | [functionCall](./ai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./ai.functioncall.md#functioncall_interface) | | | [functionResponse](./ai.functioncallpart.md#functioncallpartfunctionresponse) | never | | | [inlineData](./ai.functioncallpart.md#functioncallpartinlinedata) | never | | | [text](./ai.functioncallpart.md#functioncallparttext) | never | | | [thought](./ai.functioncallpart.md#functioncallpartthought) | boolean | | +## FunctionCallPart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## FunctionCallPart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + ## FunctionCallPart.functionCall Signature: diff --git a/docs-devsite/ai.functionresponsepart.md b/docs-devsite/ai.functionresponsepart.md index 4e8c9ea5724..2d80e1706a3 100644 --- a/docs-devsite/ai.functionresponsepart.md +++ b/docs-devsite/ai.functionresponsepart.md @@ -22,12 +22,30 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | +| [codeExecutionResult](./ai.functionresponsepart.md#functionresponsepartcodeexecutionresult) | never | | +| [executableCode](./ai.functionresponsepart.md#functionresponsepartexecutablecode) | never | | | [functionCall](./ai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | | [functionResponse](./ai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) | | | [inlineData](./ai.functionresponsepart.md#functionresponsepartinlinedata) | never | | | [text](./ai.functionresponsepart.md#functionresponseparttext) | never | | | [thought](./ai.functionresponsepart.md#functionresponsepartthought) | boolean | | +## FunctionResponsePart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## FunctionResponsePart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + ## FunctionResponsePart.functionCall Signature: diff --git a/docs-devsite/ai.googlesearchtool.md b/docs-devsite/ai.googlesearchtool.md index 4e446b0cdea..ef29ccbdaa0 100644 --- a/docs-devsite/ai.googlesearchtool.md +++ b/docs-devsite/ai.googlesearchtool.md @@ -24,11 +24,11 @@ export interface GoogleSearchTool | Property | Type | Description | | --- | --- | --- | -| [googleSearch](./ai.googlesearchtool.md#googlesearchtoolgooglesearch) | [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | +| [googleSearch](./ai.googlesearchtool.md#googlesearchtoolgooglesearch) | [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | ## GoogleSearchTool.googleSearch -Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. +Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). diff --git a/docs-devsite/ai.inlinedatapart.md b/docs-devsite/ai.inlinedatapart.md index c9ead9d061d..a3d581861e7 100644 --- a/docs-devsite/ai.inlinedatapart.md +++ b/docs-devsite/ai.inlinedatapart.md @@ -22,6 +22,8 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | +| [codeExecutionResult](./ai.inlinedatapart.md#inlinedatapartcodeexecutionresult) | never | | +| [executableCode](./ai.inlinedatapart.md#inlinedatapartexecutablecode) | never | | | [functionCall](./ai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | | [functionResponse](./ai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | | [inlineData](./ai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | | @@ -29,6 +31,22 @@ export interface InlineDataPart | [thought](./ai.inlinedatapart.md#inlinedatapartthought) | boolean | | | [videoMetadata](./ai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +## InlineDataPart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## InlineDataPart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + ## InlineDataPart.functionCall Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index d94c31155de..e4e382256b3 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -60,6 +60,9 @@ The Firebase AI Web SDK. | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | | [Citation](./ai.citation.md#citation_interface) | A single citation. | | [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | The results of code execution run by the model. | +| [CodeExecutionResultPart](./ai.codeexecutionresultpart.md#codeexecutionresultpart_interface) | Represents the code execution result from the model. | +| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | A tool that enables the model to use code execution. | | [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. | | [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) | | [CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens). | @@ -67,6 +70,8 @@ The Firebase AI Web SDK. | [Date\_2](./ai.date_2.md#date_2_interface) | Protobuf google.type.Date | | [EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | | [ErrorDetails](./ai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [ExecutableCode](./ai.executablecode.md#executablecode_interface) | An interface for executable code returned by the model. | +| [ExecutableCodePart](./ai.executablecodepart.md#executablecodepart_interface) | Represents the code that is executed by the model. | | [FileData](./ai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | | [FileDataPart](./ai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./ai.filedata.md#filedata_interface) | | [FunctionCall](./ai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./ai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | @@ -153,8 +158,10 @@ The Firebase AI Web SDK. | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [Language](./ai.md#language) | The programming language of the code. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | | [Modality](./ai.md#modality) | Content part modality. | +| [Outcome](./ai.md#outcome) | Represents the result of the code execution. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | @@ -177,11 +184,13 @@ The Firebase AI Web SDK. | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [Language](./ai.md#language) | The programming language of the code. | | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (EXPERIMENTAL) Content formats that can be provided as on-device message content. | | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (EXPERIMENTAL) Allowable roles for on-device language model usage. | | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (EXPERIMENTAL) Allowable types for on-device language model messages. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. | | [Modality](./ai.md#modality) | Content part modality. | +| [Outcome](./ai.md#outcome) | Represents the result of the code execution. | | [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [Role](./ai.md#role) | Role is the producer of the content. | @@ -637,6 +646,19 @@ InferenceMode: { } ``` +## Language + +The programming language of the code. + +Signature: + +```typescript +Language: { + UNSPECIFIED: string; + PYTHON: string; +} +``` + ## LiveResponseType > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. @@ -671,6 +693,21 @@ Modality: { } ``` +## Outcome + +Represents the result of the code execution. + +Signature: + +```typescript +Outcome: { + UNSPECIFIED: string; + OK: string; + FAILED: string; + DEADLINE_EXCEEDED: string; +} +``` + ## POSSIBLE\_ROLES Possible roles. @@ -871,6 +908,16 @@ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; ``` +## Language + +The programming language of the code. + +Signature: + +```typescript +export type Language = (typeof Language)[keyof typeof Language]; +``` + ## LanguageModelMessageContentValue (EXPERIMENTAL) Content formats that can be provided as on-device message content. @@ -924,6 +971,16 @@ Content part modality. export type Modality = (typeof Modality)[keyof typeof Modality]; ``` +## Outcome + +Represents the result of the code execution. + +Signature: + +```typescript +export type Outcome = (typeof Outcome)[keyof typeof Outcome]; +``` + ## Part Content part - includes text, image/video, or function call/response part types. @@ -931,7 +988,7 @@ Content part - includes text, image/video, or function call/response part types. Signature: ```typescript -export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart; ``` ## ResponseModality @@ -974,7 +1031,7 @@ Defines a tool that model can call to access external knowledge. Signature: ```typescript -export type Tool = FunctionDeclarationsTool | GoogleSearchTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool; ``` ## TypedSchema diff --git a/docs-devsite/ai.textpart.md b/docs-devsite/ai.textpart.md index 2466f9cca8f..22236b37d7d 100644 --- a/docs-devsite/ai.textpart.md +++ b/docs-devsite/ai.textpart.md @@ -22,12 +22,30 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | +| [codeExecutionResult](./ai.textpart.md#textpartcodeexecutionresult) | never | | +| [executableCode](./ai.textpart.md#textpartexecutablecode) | never | | | [functionCall](./ai.textpart.md#textpartfunctioncall) | never | | | [functionResponse](./ai.textpart.md#textpartfunctionresponse) | never | | | [inlineData](./ai.textpart.md#textpartinlinedata) | never | | | [text](./ai.textpart.md#textparttext) | string | | | [thought](./ai.textpart.md#textpartthought) | boolean | | +## TextPart.codeExecutionResult + +Signature: + +```typescript +codeExecutionResult?: never; +``` + +## TextPart.executableCode + +Signature: + +```typescript +executableCode?: never; +``` + ## TextPart.functionCall Signature: diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts index 0b83df38ecb..a827a447d90 100644 --- a/packages/ai/integration/generate-content.test.ts +++ b/packages/ai/integration/generate-content.test.ts @@ -21,7 +21,9 @@ import { GenerationConfig, HarmBlockThreshold, HarmCategory, + Language, Modality, + Outcome, SafetySetting, getGenerativeModel } from '../src'; @@ -188,6 +190,32 @@ describe('Generate Content', () => { }); }); + it('generateContent: code execution', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + tools: [{ codeExecution: {} }] + }); + const prompt = + 'What is the sum of the first 50 prime numbers? ' + + 'Generate and run code for the calculation, and make sure you get all 50.'; + + const result = await model.generateContent(prompt); + const parts = result.response.candidates?.[0].content.parts; + expect( + parts?.some(part => part.executableCode?.language === Language.PYTHON) + ).to.be.true; + expect( + parts?.some(part => part.codeExecutionResult?.outcome === Outcome.OK) + ).to.be.true; + // Expect these to be truthy (!= null) + expect(parts?.some(part => part.executableCode?.code != null)).to.be + .true; + expect(parts?.some(part => part.codeExecutionResult?.output != null)).to + .be.true; + }); + it('generateContentStream: text input, text output', async () => { const model = getGenerativeModel(testConfig.ai, { model: testConfig.model, diff --git a/packages/ai/src/methods/chat-session-helpers.ts b/packages/ai/src/methods/chat-session-helpers.ts index 709f616f3c0..3c0c58b7bf5 100644 --- a/packages/ai/src/methods/chat-session-helpers.ts +++ b/packages/ai/src/methods/chat-session-helpers.ts @@ -84,7 +84,9 @@ export function validateChatHistory(history: Content[]): void { functionCall: 0, functionResponse: 0, thought: 0, - thoughtSignature: 0 + thoughtSignature: 0, + executableCode: 0, + codeExecutionResult: 0 }; for (const part of parts) { diff --git a/packages/ai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts index 19c0761949a..3bb396ac6d8 100644 --- a/packages/ai/src/methods/generate-content.test.ts +++ b/packages/ai/src/methods/generate-content.test.ts @@ -28,7 +28,9 @@ import { HarmBlockMethod, HarmBlockThreshold, HarmCategory, - InferenceMode + InferenceMode, + Language, + Outcome } from '../types'; import { ApiSettings } from '../types/internal'; import { Task } from '../requests/request'; @@ -248,6 +250,25 @@ describe('generateContent()', () => { match.any ); }); + it('codeExecution', async () => { + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-code-execution.json' + ); + stub(request, 'makeRequest').resolves(mockResponse as Response); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams + ); + const parts = result.response.candidates?.[0].content.parts; + expect( + parts?.some(part => part.codeExecutionResult?.outcome === Outcome.OK) + ).to.be.true; + expect( + parts?.some(part => part.executableCode?.language === Language.PYTHON) + ).to.be.true; + }); it('blocked prompt', async () => { const mockResponse = getMockResponse( 'vertexAI', diff --git a/packages/ai/src/models/generative-model.test.ts b/packages/ai/src/models/generative-model.test.ts index 9c5074b8eb3..bcd78d746d4 100644 --- a/packages/ai/src/models/generative-model.test.ts +++ b/packages/ai/src/models/generative-model.test.ts @@ -71,7 +71,9 @@ describe('GenerativeModel', () => { description: 'mydesc' } ] - } + }, + { googleSearch: {} }, + { codeExecution: {} } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } @@ -81,7 +83,7 @@ describe('GenerativeModel', () => { {}, fakeChromeAdapter ); - expect(genModel.tools?.length).to.equal(1); + expect(genModel.tools?.length).to.equal(3); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); @@ -102,6 +104,8 @@ describe('GenerativeModel', () => { match((value: string) => { return ( value.includes('myfunc') && + value.includes('googleSearch') && + value.includes('codeExecution') && value.includes(FunctionCallingMode.NONE) && value.includes('be friendly') ); @@ -183,7 +187,9 @@ describe('GenerativeModel', () => { functionDeclarations: [ { name: 'otherfunc', description: 'otherdesc' } ] - } + }, + { googleSearch: {} }, + { codeExecution: {} } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } }, systemInstruction: { role: 'system', parts: [{ text: 'be formal' }] } @@ -196,6 +202,8 @@ describe('GenerativeModel', () => { match((value: string) => { return ( value.includes('otherfunc') && + value.includes('googleSearch') && + value.includes('codeExecution') && value.includes(FunctionCallingMode.AUTO) && value.includes('be formal') ); @@ -249,7 +257,9 @@ describe('GenerativeModel', () => { { model: 'my-model', tools: [ - { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } + { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] }, + { googleSearch: {} }, + { codeExecution: {} } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } @@ -262,7 +272,7 @@ describe('GenerativeModel', () => { {}, fakeChromeAdapter ); - expect(genModel.tools?.length).to.equal(1); + expect(genModel.tools?.length).to.equal(3); expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); @@ -283,6 +293,8 @@ describe('GenerativeModel', () => { match((value: string) => { return ( value.includes('myfunc') && + value.includes('googleSearch') && + value.includes('codeExecution') && value.includes(FunctionCallingMode.NONE) && value.includes('be friendly') && value.includes('topK') @@ -361,7 +373,9 @@ describe('GenerativeModel', () => { functionDeclarations: [ { name: 'otherfunc', description: 'otherdesc' } ] - } + }, + { googleSearch: {} }, + { codeExecution: {} } ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } @@ -380,6 +394,8 @@ describe('GenerativeModel', () => { match((value: string) => { return ( value.includes('otherfunc') && + value.includes('googleSearch') && + value.includes('codeExecution') && value.includes(FunctionCallingMode.AUTO) && value.includes('be formal') && value.includes('image/png') && diff --git a/packages/ai/src/types/content.ts b/packages/ai/src/types/content.ts index bd8ccf1ef10..b51dcd9c69f 100644 --- a/packages/ai/src/types/content.ts +++ b/packages/ai/src/types/content.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Role } from './enums'; +import { Language, Outcome, Role } from './enums'; /** * Content type for both prompts and response candidates. @@ -36,7 +36,9 @@ export type Part = | InlineDataPart | FunctionCallPart | FunctionResponsePart - | FileDataPart; + | FileDataPart + | ExecutableCodePart + | CodeExecutionResultPart; /** * Content part interface if the part represents a text string. @@ -52,6 +54,8 @@ export interface TextPart { * @internal */ thoughtSignature?: string; + executableCode?: never; + codeExecutionResult?: never; } /** @@ -72,6 +76,8 @@ export interface InlineDataPart { * @internal */ thoughtSignature?: never; + executableCode?: never; + codeExecutionResult?: never; } /** @@ -105,6 +111,8 @@ export interface FunctionCallPart { * @internal */ thoughtSignature?: never; + executableCode?: never; + codeExecutionResult?: never; } /** @@ -121,6 +129,8 @@ export interface FunctionResponsePart { * @internal */ thoughtSignature?: never; + executableCode?: never; + codeExecutionResult?: never; } /** @@ -138,6 +148,81 @@ export interface FileDataPart { * @internal */ thoughtSignature?: never; + executableCode?: never; + codeExecutionResult?: never; +} + +/** + * Represents the code that is executed by the model. + * + * @public + */ +export interface ExecutableCodePart { + text?: never; + inlineData?: never; + functionCall?: never; + functionResponse?: never; + fileData: never; + thought?: never; + /** + * @internal + */ + thoughtSignature?: never; + executableCode?: ExecutableCode; + codeExecutionResult?: never; +} + +/** + * Represents the code execution result from the model. + * + * @public + */ +export interface CodeExecutionResultPart { + text?: never; + inlineData?: never; + functionCall?: never; + functionResponse?: never; + fileData: never; + thought?: never; + /** + * @internal + */ + thoughtSignature?: never; + executableCode?: never; + codeExecutionResult?: CodeExecutionResult; +} + +/** + * An interface for executable code returned by the model. + * + * @public + */ +export interface ExecutableCode { + /** + * The programming language of the code. + */ + language?: Language; + /** + * The source code to be executed. + */ + code?: string; +} + +/** + * The results of code execution run by the model. + * + * @public + */ +export interface CodeExecutionResult { + /** + * The result of the code execution. + */ + outcome?: Outcome; + /** + * The output from the code execution, or an error message + * if it failed. + */ + output?: string; } /** diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index de70d325157..177dde296b7 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -380,3 +380,39 @@ export const InferenceMode = { * @public */ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; + +/** + * Represents the result of the code execution. + * + * @public + */ +export const Outcome = { + UNSPECIFIED: 'OUTCOME_UNSPECIFIED', + OK: 'OUTCOME_OK', + FAILED: 'OUTCOME_FAILED', + DEADLINE_EXCEEDED: 'OUTCOME_DEADLINE_EXCEEDED' +}; + +/** + * Represents the result of the code execution. + * + * @public + */ +export type Outcome = (typeof Outcome)[keyof typeof Outcome]; + +/** + * The programming language of the code. + * + * @public + */ +export const Language = { + UNSPECIFIED: 'LANGUAGE_UNSPECIFIED', + PYTHON: 'PYTHON' +}; + +/** + * The programming language of the code. + * + * @public + */ +export type Language = (typeof Language)[keyof typeof Language]; diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 21ccce8bd11..0ce87d0c8da 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -239,7 +239,10 @@ export interface RequestOptions { * Defines a tool that model can call to access external knowledge. * @public */ -export type Tool = FunctionDeclarationsTool | GoogleSearchTool; +export type Tool = + | FunctionDeclarationsTool + | GoogleSearchTool + | CodeExecutionTool; /** * Structured representation of a function declaration as defined by the @@ -285,8 +288,6 @@ export interface GoogleSearchTool { /** * Specifies the Google Search configuration. * Currently, this is an empty object, but it's reserved for future configuration options. - * Specifies the Google Search configuration. Currently, this is an empty object, but it's - * reserved for future configuration options. * * When using this feature, you are required to comply with the "Grounding with Google Search" * usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API} @@ -296,6 +297,19 @@ export interface GoogleSearchTool { googleSearch: GoogleSearch; } +/** + * A tool that enables the model to use code execution. + * + * @public + */ +export interface CodeExecutionTool { + /** + * Specifies the Google Search configuration. + * Currently, this is an empty object, but it's reserved for future configuration options. + */ + codeExecution: {}; +} + /** * Specifies the Google Search configuration. * From 43276b0414ea5a73e8d8f7e3b80275d8b910102f Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Tue, 16 Sep 2025 15:07:28 -0600 Subject: [PATCH 277/295] chore(firestore): Update closure-net dependency to the latest release (#9242) * Update closure-net dependency to the latest release (6f48f578d3e80fe7a85e530a5d95b9351433d135) --- .changeset/tiny-doors-talk.md | 5 ++++ packages/webchannel-wrapper/package.json | 2 +- yarn.lock | 35 ++++++++++++++++++++---- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .changeset/tiny-doors-talk.md diff --git a/.changeset/tiny-doors-talk.md b/.changeset/tiny-doors-talk.md new file mode 100644 index 00000000000..683f9c28d90 --- /dev/null +++ b/.changeset/tiny-doors-talk.md @@ -0,0 +1,5 @@ +--- +"@firebase/webchannel-wrapper": patch +"@firebase/firestore": patch +--- +Increased the buffering-proxy detection timeout to minimize the false-positive rate. Updating WebChannel to ignore duplicate messages received from the server. Fix for https://github.com/firebase/firebase-js-sdk/issues/8250. diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index 0ce6504b387..8d02520a362 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -31,7 +31,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "closure-net": "git+https://github.com/google/closure-net.git#0412666", + "closure-net": "git+https://github.com/google/closure-net.git#6f48f578d3e80fe7a85e530a5d95b9351433d135", "@rollup/plugin-commonjs": "21.1.0", "rollup": "2.79.2", "rollup-plugin-copy": "3.5.0", diff --git a/yarn.lock b/yarn.lock index 540d7bc7171..213ecd4d2c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5379,9 +5379,9 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -"closure-net@git+https://github.com/google/closure-net.git#0412666": +"closure-net@git+https://github.com/google/closure-net.git#6f48f578d3e80fe7a85e530a5d95b9351433d135": version "0.0.0" - resolved "git+https://github.com/google/closure-net.git#0412666e8f29b8ae69decb1fdc7ead635a5cf43e" + resolved "git+https://github.com/google/closure-net.git#6f48f578d3e80fe7a85e530a5d95b9351433d135" cmd-shim@^4.1.0: version "4.1.0" @@ -15139,7 +15139,7 @@ string-argv@~0.3.1: resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15157,6 +15157,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -15220,7 +15229,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15241,6 +15250,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -16913,7 +16929,7 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16947,6 +16963,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From c1237662e6851936d2dd6017ab4bc7f0aa5112fd Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 17 Sep 2025 09:08:18 -0700 Subject: [PATCH 278/295] Change documentation tags for hybrid inference from EXPERIMENTAL to public preview (#9253) --- .changeset/selfish-elephants-sniff.md | 5 ++ common/api-review/ai.api.md | 32 ++++++----- docs-devsite/ai.chromeadapter.md | 20 +++++-- docs-devsite/ai.hybridparams.md | 20 +++++-- .../ai.languagemodelcreatecoreoptions.md | 20 +++++-- docs-devsite/ai.languagemodelcreateoptions.md | 15 ++++-- docs-devsite/ai.languagemodelexpected.md | 15 ++++-- docs-devsite/ai.languagemodelmessage.md | 15 ++++-- .../ai.languagemodelmessagecontent.md | 15 ++++-- docs-devsite/ai.languagemodelpromptoptions.md | 10 +++- docs-devsite/ai.md | 53 ++++++++++++------- docs-devsite/ai.ondeviceparams.md | 15 ++++-- packages/ai/src/types/chrome-adapter.ts | 4 +- packages/ai/src/types/enums.ts | 6 +-- packages/ai/src/types/language-model.ts | 30 ++++------- packages/ai/src/types/requests.ts | 6 +-- 16 files changed, 189 insertions(+), 92 deletions(-) create mode 100644 .changeset/selfish-elephants-sniff.md diff --git a/.changeset/selfish-elephants-sniff.md b/.changeset/selfish-elephants-sniff.md new file mode 100644 index 00000000000..dc791fbb9b8 --- /dev/null +++ b/.changeset/selfish-elephants-sniff.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Change documentation tags for hybrid inference from "EXPERIMENTAL" to "public preview". diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index c1b570a7e05..d4c3c1ad507 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -133,6 +133,7 @@ export class BooleanSchema extends Schema { // @public export class ChatSession { + // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); getHistory(): Promise; // (undocumented) @@ -145,7 +146,7 @@ export class ChatSession { sendMessageStream(request: string | Array): Promise; } -// @public +// @beta export interface ChromeAdapter { // @internal (undocumented) countTokens(request: CountTokensRequest): Promise; @@ -520,6 +521,7 @@ export interface GenerativeContentBlob { // @public export class GenerativeModel extends AIModel { + // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined); countTokens(request: CountTokensRequest | string | Array): Promise; generateContent(request: GenerateContentRequest | string | Array): Promise; @@ -542,6 +544,8 @@ export class GenerativeModel extends AIModel { // @public export function getAI(app?: FirebaseApp, options?: AIOptions): AI; +// Warning: (ae-incompatible-release-tags) The symbol "getGenerativeModel" is marked as @public, but its signature references "HybridParams" which is marked as @beta +// // @public export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel; @@ -695,7 +699,7 @@ export const HarmSeverity: { // @public export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; -// @public +// @beta export interface HybridParams { inCloudParams?: ModelParams; mode: InferenceMode; @@ -795,7 +799,7 @@ export interface ImagenSafetySettings { safetyFilterLevel?: ImagenSafetyFilterLevel; } -// @public +// @beta export const InferenceMode: { readonly PREFER_ON_DEVICE: "prefer_on_device"; readonly ONLY_ON_DEVICE: "only_on_device"; @@ -803,7 +807,7 @@ export const InferenceMode: { readonly PREFER_IN_CLOUD: "prefer_in_cloud"; }; -// @public +// @beta export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; // @public @@ -841,7 +845,7 @@ export const Language: { // @public export type Language = (typeof Language)[keyof typeof Language]; -// @public +// @beta export interface LanguageModelCreateCoreOptions { // (undocumented) expectedInputs?: LanguageModelExpected[]; @@ -851,7 +855,7 @@ export interface LanguageModelCreateCoreOptions { topK?: number; } -// @public +// @beta export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions { // (undocumented) initialPrompts?: LanguageModelMessage[]; @@ -859,7 +863,7 @@ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptio signal?: AbortSignal; } -// @public +// @beta export interface LanguageModelExpected { // (undocumented) languages?: string[]; @@ -867,7 +871,7 @@ export interface LanguageModelExpected { type: LanguageModelMessageType; } -// @public +// @beta export interface LanguageModelMessage { // (undocumented) content: LanguageModelMessageContent[]; @@ -875,7 +879,7 @@ export interface LanguageModelMessage { role: LanguageModelMessageRole; } -// @public +// @beta export interface LanguageModelMessageContent { // (undocumented) type: LanguageModelMessageType; @@ -883,16 +887,16 @@ export interface LanguageModelMessageContent { value: LanguageModelMessageContentValue; } -// @public +// @beta export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string; -// @public +// @beta export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; -// @public +// @beta export type LanguageModelMessageType = 'text' | 'image' | 'audio'; -// @public +// @beta export interface LanguageModelPromptOptions { // (undocumented) responseConstraint?: object; @@ -1046,7 +1050,7 @@ export interface ObjectSchemaRequest extends SchemaRequest { type: 'object'; } -// @public +// @beta export interface OnDeviceParams { // (undocumented) createOptions?: LanguageModelCreateOptions; diff --git a/docs-devsite/ai.chromeadapter.md b/docs-devsite/ai.chromeadapter.md index e9207614992..e9a7a512503 100644 --- a/docs-devsite/ai.chromeadapter.md +++ b/docs-devsite/ai.chromeadapter.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ChromeAdapter interface -(EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible. These methods should not be called directly by the user. @@ -24,12 +27,15 @@ export interface ChromeAdapter | Method | Description | | --- | --- | -| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference. | -| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference. | -| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. | +| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | (Public Preview) Generates content using on-device inference. | +| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | (Public Preview) Generates a content stream using on-device inference. | +| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | (Public Preview) Checks if the on-device model is capable of handling a given request. | ## ChromeAdapter.generateContent() +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Generates content using on-device inference. This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference. @@ -52,6 +58,9 @@ Promise<Response> ## ChromeAdapter.generateContentStream() +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Generates a content stream using on-device inference. This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference. @@ -74,6 +83,9 @@ Promise<Response> ## ChromeAdapter.isAvailable() +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Checks if the on-device model is capable of handling a given request. Signature: diff --git a/docs-devsite/ai.hybridparams.md b/docs-devsite/ai.hybridparams.md index baf568217d3..558b54abf8d 100644 --- a/docs-devsite/ai.hybridparams.md +++ b/docs-devsite/ai.hybridparams.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # HybridParams interface -(EXPERIMENTAL) Configures hybrid inference. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures hybrid inference. Signature: @@ -22,12 +25,15 @@ export interface HybridParams | Property | Type | Description | | --- | --- | --- | -| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. | -| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. | -| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | Optional. Specifies advanced params for on-device inference. | +| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | (Public Preview) Optional. Specifies advanced params for in-cloud inference. | +| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Specifies on-device or in-cloud inference. Defaults to prefer on-device. | +| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (Public Preview) Optional. Specifies advanced params for on-device inference. | ## HybridParams.inCloudParams +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Optional. Specifies advanced params for in-cloud inference. Signature: @@ -38,6 +44,9 @@ inCloudParams?: ModelParams; ## HybridParams.mode +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Specifies on-device or in-cloud inference. Defaults to prefer on-device. Signature: @@ -48,6 +57,9 @@ mode: InferenceMode; ## HybridParams.onDeviceParams +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Optional. Specifies advanced params for on-device inference. Signature: diff --git a/docs-devsite/ai.languagemodelcreatecoreoptions.md b/docs-devsite/ai.languagemodelcreatecoreoptions.md index 3b221933034..299d5d10603 100644 --- a/docs-devsite/ai.languagemodelcreatecoreoptions.md +++ b/docs-devsite/ai.languagemodelcreatecoreoptions.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelCreateCoreOptions interface -(EXPERIMENTAL) Configures the creation of an on-device language model session. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures the creation of an on-device language model session. Signature: @@ -22,12 +25,15 @@ export interface LanguageModelCreateCoreOptions | Property | Type | Description | | --- | --- | --- | -| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)\[\] | | -| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | | -| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | | +| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)\[\] | (Public Preview) | +| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | (Public Preview) | +| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | (Public Preview) | ## LanguageModelCreateCoreOptions.expectedInputs +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -36,6 +42,9 @@ expectedInputs?: LanguageModelExpected[]; ## LanguageModelCreateCoreOptions.temperature +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -44,6 +53,9 @@ temperature?: number; ## LanguageModelCreateCoreOptions.topK +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.languagemodelcreateoptions.md b/docs-devsite/ai.languagemodelcreateoptions.md index 5d2ec9c69ad..5949722d7e3 100644 --- a/docs-devsite/ai.languagemodelcreateoptions.md +++ b/docs-devsite/ai.languagemodelcreateoptions.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelCreateOptions interface -(EXPERIMENTAL) Configures the creation of an on-device language model session. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Configures the creation of an on-device language model session. Signature: @@ -23,11 +26,14 @@ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptio | Property | Type | Description | | --- | --- | --- | -| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)\[\] | | -| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | | +| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)\[\] | (Public Preview) | +| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | (Public Preview) | ## LanguageModelCreateOptions.initialPrompts +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -36,6 +42,9 @@ initialPrompts?: LanguageModelMessage[]; ## LanguageModelCreateOptions.signal +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.languagemodelexpected.md b/docs-devsite/ai.languagemodelexpected.md index d27e718e1eb..1afe4f86cc0 100644 --- a/docs-devsite/ai.languagemodelexpected.md +++ b/docs-devsite/ai.languagemodelexpected.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelExpected interface -(EXPERIMENTAL) Options for the expected inputs for an on-device language model. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Options for the expected inputs for an on-device language model. Signature: @@ -22,11 +25,14 @@ export interface LanguageModelExpected | Property | Type | Description | | --- | --- | --- | -| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | | -| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | | +| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | (Public Preview) | +| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) | ## LanguageModelExpected.languages +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -35,6 +41,9 @@ languages?: string[]; ## LanguageModelExpected.type +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.languagemodelmessage.md b/docs-devsite/ai.languagemodelmessage.md index 228a31c8521..5f133e458bc 100644 --- a/docs-devsite/ai.languagemodelmessage.md +++ b/docs-devsite/ai.languagemodelmessage.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelMessage interface -(EXPERIMENTAL) An on-device language model message. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An on-device language model message. Signature: @@ -22,11 +25,14 @@ export interface LanguageModelMessage | Property | Type | Description | | --- | --- | --- | -| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)\[\] | | -| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | | +| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)\[\] | (Public Preview) | +| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (Public Preview) | ## LanguageModelMessage.content +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -35,6 +41,9 @@ content: LanguageModelMessageContent[]; ## LanguageModelMessage.role +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.languagemodelmessagecontent.md b/docs-devsite/ai.languagemodelmessagecontent.md index 71d2ce9919b..0545882c983 100644 --- a/docs-devsite/ai.languagemodelmessagecontent.md +++ b/docs-devsite/ai.languagemodelmessagecontent.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelMessageContent interface -(EXPERIMENTAL) An on-device language model content object. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +An on-device language model content object. Signature: @@ -22,11 +25,14 @@ export interface LanguageModelMessageContent | Property | Type | Description | | --- | --- | --- | -| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | | -| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | | +| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) | +| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) | ## LanguageModelMessageContent.type +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -35,6 +41,9 @@ type: LanguageModelMessageType; ## LanguageModelMessageContent.value +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.languagemodelpromptoptions.md b/docs-devsite/ai.languagemodelpromptoptions.md index 35a22c3d1a6..d681fdec94f 100644 --- a/docs-devsite/ai.languagemodelpromptoptions.md +++ b/docs-devsite/ai.languagemodelpromptoptions.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # LanguageModelPromptOptions interface -(EXPERIMENTAL) Options for an on-device language model prompt. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Options for an on-device language model prompt. Signature: @@ -22,10 +25,13 @@ export interface LanguageModelPromptOptions | Property | Type | Description | | --- | --- | --- | -| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | | +| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | (Public Preview) | ## LanguageModelPromptOptions.responseConstraint +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index e4e382256b3..78d82d23800 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -57,7 +57,7 @@ The Firebase AI Web SDK. | [AIOptions](./ai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). | | [AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface) | (Public Preview) A controller for managing an active audio conversation. | | [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | +| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (Public Preview) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | | [Citation](./ai.citation.md#citation_interface) | A single citation. | | [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). | | [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | The results of code execution run by the model. | @@ -93,7 +93,7 @@ The Firebase AI Web SDK. | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. | | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | -| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (EXPERIMENTAL) Configures hybrid inference. | +| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (Public Preview) Configures hybrid inference. | | [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | (Public Preview) An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | | [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | @@ -101,12 +101,12 @@ The Firebase AI Web SDK. | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (EXPERIMENTAL) Configures the creation of an on-device language model session. | -| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (EXPERIMENTAL) Configures the creation of an on-device language model session. | -| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | (EXPERIMENTAL) Options for the expected inputs for an on-device language model. | -| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | (EXPERIMENTAL) An on-device language model message. | -| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | (EXPERIMENTAL) An on-device language model content object. | -| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (EXPERIMENTAL) Options for an on-device language model prompt. | +| [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | +| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | +| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | (Public Preview) Options for the expected inputs for an on-device language model. | +| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | (Public Preview) An on-device language model message. | +| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | (Public Preview) An on-device language model content object. | +| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (Public Preview) Options for an on-device language model prompt. | | [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation. | | [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | (Public Preview) Params passed to [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). | | [LiveServerContent](./ai.liveservercontent.md#liveservercontent_interface) | (Public Preview) An incremental content update from the model. | @@ -115,7 +115,7 @@ The Firebase AI Web SDK. | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. | | [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | | [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the Schema.object() helper. | -| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (EXPERIMENTAL) Encapsulates configuration for on-device inference. | +| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (Public Preview) Encapsulates configuration for on-device inference. | | [PrebuiltVoiceConfig](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfig_interface) | (Public Preview) Configuration for a pre-built voice. | | [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). | @@ -157,7 +157,7 @@ The Firebase AI Web SDK. | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | -| [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | The programming language of the code. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | | [Modality](./ai.md#modality) | Content part modality. | @@ -183,11 +183,11 @@ The Firebase AI Web SDK. | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | -| [InferenceMode](./ai.md#inferencemode) | (EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. | +| [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | The programming language of the code. | -| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (EXPERIMENTAL) Content formats that can be provided as on-device message content. | -| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (EXPERIMENTAL) Allowable roles for on-device language model usage. | -| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (EXPERIMENTAL) Allowable types for on-device language model messages. | +| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) Content formats that can be provided as on-device message content. | +| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (Public Preview) Allowable roles for on-device language model usage. | +| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) Allowable types for on-device language model messages. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. | | [Modality](./ai.md#modality) | Content part modality. | | [Outcome](./ai.md#outcome) | Represents the result of the code execution. | @@ -631,7 +631,10 @@ ImagenSafetyFilterLevel: { ## InferenceMode -(EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Determines whether inference happens on-device or in-cloud. PREFER\_ON\_DEVICE: Attempt to make inference calls using an on-device model. If on-device inference is not available, the SDK will fall back to using a cloud-hosted model.
      ONLY\_ON\_DEVICE: Only attempt to make inference calls using an on-device model. The SDK will not fall back to a cloud-hosted model. If on-device inference is not available, inference methods will throw.
      ONLY\_IN\_CLOUD: Only attempt to make inference calls using a cloud-hosted model. The SDK will not fall back to an on-device model.
      PREFER\_IN\_CLOUD: Attempt to make inference calls to a cloud-hosted model. If not available, the SDK will fall back to an on-device model. @@ -900,7 +903,10 @@ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typ ## InferenceMode -(EXPERIMENTAL) Determines whether inference happens on-device or in-cloud. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Determines whether inference happens on-device or in-cloud. Signature: @@ -920,7 +926,10 @@ export type Language = (typeof Language)[keyof typeof Language]; ## LanguageModelMessageContentValue -(EXPERIMENTAL) Content formats that can be provided as on-device message content. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Content formats that can be provided as on-device message content. Signature: @@ -930,7 +939,10 @@ export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | ## LanguageModelMessageRole -(EXPERIMENTAL) Allowable roles for on-device language model usage. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Allowable roles for on-device language model usage. Signature: @@ -940,7 +952,10 @@ export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; ## LanguageModelMessageType -(EXPERIMENTAL) Allowable types for on-device language model messages. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Allowable types for on-device language model messages. Signature: diff --git a/docs-devsite/ai.ondeviceparams.md b/docs-devsite/ai.ondeviceparams.md index bce68ff8174..363427149f9 100644 --- a/docs-devsite/ai.ondeviceparams.md +++ b/docs-devsite/ai.ondeviceparams.md @@ -10,7 +10,10 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # OnDeviceParams interface -(EXPERIMENTAL) Encapsulates configuration for on-device inference. +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Encapsulates configuration for on-device inference. Signature: @@ -22,11 +25,14 @@ export interface OnDeviceParams | Property | Type | Description | | --- | --- | --- | -| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | | -| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | | +| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) | +| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (Public Preview) | ## OnDeviceParams.createOptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -35,6 +41,9 @@ createOptions?: LanguageModelCreateOptions; ## OnDeviceParams.promptOptions +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/packages/ai/src/types/chrome-adapter.ts b/packages/ai/src/types/chrome-adapter.ts index 9ec0dc2a0ab..fc33325217f 100644 --- a/packages/ai/src/types/chrome-adapter.ts +++ b/packages/ai/src/types/chrome-adapter.ts @@ -18,13 +18,13 @@ import { CountTokensRequest, GenerateContentRequest } from './requests'; /** - * (EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, + * Defines an inference "backend" that uses Chrome's on-device model, * and encapsulates logic for detecting when on-device inference is * possible. * * These methods should not be called directly by the user. * - * @public + * @beta */ export interface ChromeAdapter { /** diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 177dde296b7..997df1265b0 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -345,7 +345,6 @@ export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality]; /** - * (EXPERIMENTAL) * Determines whether inference happens on-device or in-cloud. * * @remarks @@ -364,7 +363,7 @@ export type ResponseModality = * cloud-hosted model. If not available, the SDK will fall back to an * on-device model. * - * @public + * @beta */ export const InferenceMode = { 'PREFER_ON_DEVICE': 'prefer_on_device', @@ -374,10 +373,9 @@ export const InferenceMode = { } as const; /** - * (EXPERIMENTAL) * Determines whether inference happens on-device or in-cloud. * - * @public + * @beta */ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; diff --git a/packages/ai/src/types/language-model.ts b/packages/ai/src/types/language-model.ts index 4157e6d05e6..9ac4c7202e1 100644 --- a/packages/ai/src/types/language-model.ts +++ b/packages/ai/src/types/language-model.ts @@ -50,9 +50,8 @@ export enum Availability { } /** - * (EXPERIMENTAL) * Configures the creation of an on-device language model session. - * @public + * @beta */ export interface LanguageModelCreateCoreOptions { topK?: number; @@ -61,9 +60,8 @@ export interface LanguageModelCreateCoreOptions { } /** - * (EXPERIMENTAL) * Configures the creation of an on-device language model session. - * @public + * @beta */ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions { @@ -72,9 +70,8 @@ export interface LanguageModelCreateOptions } /** - * (EXPERIMENTAL) * Options for an on-device language model prompt. - * @public + * @beta */ export interface LanguageModelPromptOptions { responseConstraint?: object; @@ -82,25 +79,22 @@ export interface LanguageModelPromptOptions { } /** - * (EXPERIMENTAL) * Options for the expected inputs for an on-device language model. - * @public + * @beta */ export interface LanguageModelExpected { type: LanguageModelMessageType; languages?: string[]; } /** - * (EXPERIMENTAL) * An on-device language model prompt. - * @public + * @beta */ export type LanguageModelPrompt = LanguageModelMessage[]; /** - * (EXPERIMENTAL) * An on-device language model message. - * @public + * @beta */ export interface LanguageModelMessage { role: LanguageModelMessageRole; @@ -108,9 +102,8 @@ export interface LanguageModelMessage { } /** - * (EXPERIMENTAL) * An on-device language model content object. - * @public + * @beta */ export interface LanguageModelMessageContent { type: LanguageModelMessageType; @@ -118,23 +111,20 @@ export interface LanguageModelMessageContent { } /** - * (EXPERIMENTAL) * Allowable roles for on-device language model usage. - * @public + * @beta */ export type LanguageModelMessageRole = 'system' | 'user' | 'assistant'; /** - * (EXPERIMENTAL) * Allowable types for on-device language model messages. - * @public + * @beta */ export type LanguageModelMessageType = 'text' | 'image' | 'audio'; /** - * (EXPERIMENTAL) * Content formats that can be provided as on-device message content. - * @public + * @beta */ export type LanguageModelMessageContentValue = | ImageBitmapSource diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 0ce87d0c8da..eea03e55fe4 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -356,10 +356,9 @@ export interface FunctionCallingConfig { } /** - * (EXPERIMENTAL) * Encapsulates configuration for on-device inference. * - * @public + * @beta */ export interface OnDeviceParams { createOptions?: LanguageModelCreateOptions; @@ -367,9 +366,8 @@ export interface OnDeviceParams { } /** - * (EXPERIMENTAL) * Configures hybrid inference. - * @public + * @beta */ export interface HybridParams { /** From 6ab71fa0b3257ca556546a504e18fa4edbbd32cb Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 18 Sep 2025 11:33:58 -0700 Subject: [PATCH 279/295] docs: Fix docgen script to clean out package temp folders first (#9250) --- scripts/docgen/docgen.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/docgen/docgen.ts b/scripts/docgen/docgen.ts index af105ef65f6..26045f84711 100644 --- a/scripts/docgen/docgen.ts +++ b/scripts/docgen/docgen.ts @@ -198,7 +198,19 @@ async function generateDocs( `"mainEntryPointFilePath": "/dist/esm/index.doc.d.ts"` ); + /** + * Exclude compat as this script is only for modular docgen. + */ + const packageDirectories = ( + await mapWorkspaceToPackages([`${projectRoot}/packages/*`]) + ).filter(path => fs.existsSync(path) && !path.includes('-compat')); + try { + console.log(`Deleting old temp directories in each package.`); + for (const dir of packageDirectories) { + fs.rmSync(join(dir, 'temp'), { recursive: true, force: true }); + } + fs.writeFileSync( `${projectRoot}/packages/auth/api-extractor.json`, authApiConfigModified @@ -247,13 +259,9 @@ async function generateDocs( fs.mkdirSync(tmpDir); - // TODO: Throw error if path doesn't exist once all packages add markdown support. - const apiJsonDirectories = ( - await mapWorkspaceToPackages([`${projectRoot}/packages/*`]) - ) - .map(path => `${path}/temp`) + const apiJsonDirectories = packageDirectories + .map(path => join(path, 'temp')) .filter(path => fs.existsSync(path)); - for (const dir of apiJsonDirectories) { const paths = await new Promise(resolve => glob(`${dir}/*.api.json`, (err, paths) => { From 8d3211bb99502448d5f03e8f920a09cbebc2e643 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 18 Sep 2025 15:58:18 -0700 Subject: [PATCH 280/295] Version Packages (#9258) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/feat-prefer-in-cloud.md | 6 ------ .changeset/heavy-teachers-enjoy.md | 5 ----- .changeset/lemon-baboons-lick.md | 7 ------- .changeset/lucky-socks-roll.md | 6 ------ .changeset/selfish-elephants-sniff.md | 5 ----- .changeset/tiny-doors-talk.md | 5 ----- integration/compat-interop/package.json | 8 ++++---- integration/firestore/package.json | 4 ++-- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 14 ++++++++++++++ packages/ai/package.json | 4 ++-- packages/analytics-compat/package.json | 2 +- packages/analytics/package.json | 2 +- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 +++++++ packages/app-compat/package.json | 4 ++-- packages/app/CHANGELOG.md | 6 ++++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 21 +++++++++++++++++++++ packages/firebase/package.json | 16 ++++++++-------- packages/firestore-compat/CHANGELOG.md | 7 +++++++ packages/firestore-compat/package.json | 6 +++--- packages/firestore/CHANGELOG.md | 9 +++++++++ packages/firestore/package.json | 8 ++++---- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/CHANGELOG.md | 8 ++++++++ packages/remote-config-compat/package.json | 8 ++++---- packages/remote-config-types/CHANGELOG.md | 6 ++++++ packages/remote-config-types/package.json | 2 +- packages/remote-config/CHANGELOG.md | 6 ++++++ packages/remote-config/package.json | 4 ++-- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- packages/webchannel-wrapper/CHANGELOG.md | 6 ++++++ packages/webchannel-wrapper/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 50 files changed, 146 insertions(+), 90 deletions(-) delete mode 100644 .changeset/feat-prefer-in-cloud.md delete mode 100644 .changeset/heavy-teachers-enjoy.md delete mode 100644 .changeset/lemon-baboons-lick.md delete mode 100644 .changeset/lucky-socks-roll.md delete mode 100644 .changeset/selfish-elephants-sniff.md delete mode 100644 .changeset/tiny-doors-talk.md diff --git a/.changeset/feat-prefer-in-cloud.md b/.changeset/feat-prefer-in-cloud.md deleted file mode 100644 index 90f859c2da8..00000000000 --- a/.changeset/feat-prefer-in-cloud.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@firebase/ai": minor -"firebase": minor ---- - -Added a new `InferenceMode` option for the hybrid on-device capability: `prefer_in_cloud`. When this mode is selected, the SDK will attempt to use a cloud-hosted model first. If the call to the cloud-hosted model fails with a network-related error, the SDK will fall back to the on-device model, if it's available. diff --git a/.changeset/heavy-teachers-enjoy.md b/.changeset/heavy-teachers-enjoy.md deleted file mode 100644 index a5cf0820429..00000000000 --- a/.changeset/heavy-teachers-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Refactor component registration. diff --git a/.changeset/lemon-baboons-lick.md b/.changeset/lemon-baboons-lick.md deleted file mode 100644 index 3414d4c9bde..00000000000 --- a/.changeset/lemon-baboons-lick.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@firebase/remote-config': minor -'firebase': minor -'@firebase/remote-config-types': minor ---- - -Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling. diff --git a/.changeset/lucky-socks-roll.md b/.changeset/lucky-socks-roll.md deleted file mode 100644 index 8b9d9a19e97..00000000000 --- a/.changeset/lucky-socks-roll.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/ai': minor -'firebase': minor ---- - -Added Code Execution feature. diff --git a/.changeset/selfish-elephants-sniff.md b/.changeset/selfish-elephants-sniff.md deleted file mode 100644 index dc791fbb9b8..00000000000 --- a/.changeset/selfish-elephants-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Change documentation tags for hybrid inference from "EXPERIMENTAL" to "public preview". diff --git a/.changeset/tiny-doors-talk.md b/.changeset/tiny-doors-talk.md deleted file mode 100644 index 683f9c28d90..00000000000 --- a/.changeset/tiny-doors-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/webchannel-wrapper": patch -"@firebase/firestore": patch ---- -Increased the buffering-proxy detection timeout to minimize the false-positive rate. Updating WebChannel to ignore duplicate messages received from the server. Fix for https://github.com/firebase/firebase-js-sdk/issues/8250. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 43918524893..d578466418a 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,8 +8,8 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.14.2", - "@firebase/app-compat": "0.5.2", + "@firebase/app": "0.14.3", + "@firebase/app-compat": "0.5.3", "@firebase/analytics": "0.10.18", "@firebase/analytics-compat": "0.2.24", "@firebase/auth": "1.11.0", @@ -20,8 +20,8 @@ "@firebase/messaging-compat": "0.2.23", "@firebase/performance": "0.7.9", "@firebase/performance-compat": "0.2.22", - "@firebase/remote-config": "0.6.6", - "@firebase/remote-config-compat": "0.2.19" + "@firebase/remote-config": "0.7.0", + "@firebase/remote-config-compat": "0.2.20" }, "devDependencies": { "typescript": "5.5.4" diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 9b5b2411e6a..73fc72ec219 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.14.2", - "@firebase/firestore": "4.9.1" + "@firebase/app": "0.14.3", + "@firebase/firestore": "4.9.2" }, "devDependencies": { "@types/mocha": "9.1.1", diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 6a93c1bc284..704d2530a62 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "12.2.1", + "firebase": "12.3.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index f6aeba8f6f6..7679505f722 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,19 @@ # @firebase/ai +## 2.3.0 + +### Minor Changes + +- [`06ab5c4`](https://github.com/firebase/firebase-js-sdk/commit/06ab5c4f9b84085068381f6dff5e03b1b7cf4b2c) [#9236](https://github.com/firebase/firebase-js-sdk/pull/9236) - Added a new `InferenceMode` option for the hybrid on-device capability: `prefer_in_cloud`. When this mode is selected, the SDK will attempt to use a cloud-hosted model first. If the call to the cloud-hosted model fails with a network-related error, the SDK will fall back to the on-device model, if it's available. + +- [`9b8ab02`](https://github.com/firebase/firebase-js-sdk/commit/9b8ab02c543785226fafec056d39be7cf7ee03d1) [#9249](https://github.com/firebase/firebase-js-sdk/pull/9249) - Added Code Execution feature. + +### Patch Changes + +- [`a4848b4`](https://github.com/firebase/firebase-js-sdk/commit/a4848b401f6e8da16b0d0fdbfd064e8d68566555) [#9235](https://github.com/firebase/firebase-js-sdk/pull/9235) - Refactor component registration. + +- [`c123766`](https://github.com/firebase/firebase-js-sdk/commit/c1237662e6851936d2dd6017ab4bc7f0aa5112fd) [#9253](https://github.com/firebase/firebase-js-sdk/pull/9253) - Change documentation tags for hybrid inference from "EXPERIMENTAL" to "public preview". + ## 2.2.1 ### Patch Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 5b219d1bf94..b36081aa8f0 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "2.2.1", + "version": "2.3.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -60,7 +60,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index ce4241b8080..c978d3653cf 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index f4e35751e58..c8d359102f0 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index fd07d8ffebc..d2b13f78d39 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index 2bfeb8d01cb..a0e03d895cd 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index d9251a873c2..adcd3b62a59 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.5.3 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.14.3 + ## 0.5.2 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 505a04a3536..a27c1627811 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.5.2", + "version": "0.5.3", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", "@firebase/component": "0.7.0", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 57891db7332..5e283b1bef0 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.14.3 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.14.2 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 8228e2d4477..9d9d9d3d89e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.14.2", + "version": "0.14.3", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index fbb2e443b64..83f02a17be4 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 2fe122d762c..9a49314e2c1 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 44493b03eb2..29459b94f4e 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index d9cce7ef390..3c4460524be 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 54bac8ce5fc..305c42aac23 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index 29f2617cb46..c21448da4f8 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,26 @@ # firebase +## 12.3.0 + +### Minor Changes + +- [`06ab5c4`](https://github.com/firebase/firebase-js-sdk/commit/06ab5c4f9b84085068381f6dff5e03b1b7cf4b2c) [#9236](https://github.com/firebase/firebase-js-sdk/pull/9236) - Added a new `InferenceMode` option for the hybrid on-device capability: `prefer_in_cloud`. When this mode is selected, the SDK will attempt to use a cloud-hosted model first. If the call to the cloud-hosted model fails with a network-related error, the SDK will fall back to the on-device model, if it's available. + +- [`120a308`](https://github.com/firebase/firebase-js-sdk/commit/120a30838da50f5ade4f634e97c34cbfcaff41ba) [#9221](https://github.com/firebase/firebase-js-sdk/pull/9221) - Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling. + +- [`9b8ab02`](https://github.com/firebase/firebase-js-sdk/commit/9b8ab02c543785226fafec056d39be7cf7ee03d1) [#9249](https://github.com/firebase/firebase-js-sdk/pull/9249) - Added Code Execution feature. + +### Patch Changes + +- Updated dependencies [[`06ab5c4`](https://github.com/firebase/firebase-js-sdk/commit/06ab5c4f9b84085068381f6dff5e03b1b7cf4b2c), [`a4848b4`](https://github.com/firebase/firebase-js-sdk/commit/a4848b401f6e8da16b0d0fdbfd064e8d68566555), [`120a308`](https://github.com/firebase/firebase-js-sdk/commit/120a30838da50f5ade4f634e97c34cbfcaff41ba), [`9b8ab02`](https://github.com/firebase/firebase-js-sdk/commit/9b8ab02c543785226fafec056d39be7cf7ee03d1), [`c123766`](https://github.com/firebase/firebase-js-sdk/commit/c1237662e6851936d2dd6017ab4bc7f0aa5112fd), [`43276b0`](https://github.com/firebase/firebase-js-sdk/commit/43276b0414ea5a73e8d8f7e3b80275d8b910102f)]: + - @firebase/app@0.14.3 + - @firebase/ai@2.3.0 + - @firebase/remote-config@0.7.0 + - @firebase/firestore@4.9.2 + - @firebase/app-compat@0.5.3 + - @firebase/remote-config-compat@0.2.20 + - @firebase/firestore-compat@0.4.2 + ## 12.2.1 ### Patch Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 9ab3f71fa11..7d4ab8682ac 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "12.2.1", + "version": "12.3.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,17 +399,17 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "2.2.1", - "@firebase/app": "0.14.2", - "@firebase/app-compat": "0.5.2", + "@firebase/ai": "2.3.0", + "@firebase/app": "0.14.3", + "@firebase/app-compat": "0.5.3", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", "@firebase/data-connect": "0.3.11", "@firebase/database": "1.1.0", "@firebase/database-compat": "2.1.0", - "@firebase/firestore": "4.9.1", - "@firebase/firestore-compat": "0.4.1", + "@firebase/firestore": "4.9.2", + "@firebase/firestore-compat": "0.4.2", "@firebase/functions": "0.13.1", "@firebase/functions-compat": "0.4.1", "@firebase/installations": "0.6.19", @@ -420,8 +420,8 @@ "@firebase/storage-compat": "0.4.0", "@firebase/performance": "0.7.9", "@firebase/performance-compat": "0.2.22", - "@firebase/remote-config": "0.6.6", - "@firebase/remote-config-compat": "0.2.19", + "@firebase/remote-config": "0.7.0", + "@firebase/remote-config-compat": "0.2.20", "@firebase/analytics": "0.10.18", "@firebase/analytics-compat": "0.2.24", "@firebase/app-check": "0.11.0", diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index 4345e2b808c..e5a1aa19d6e 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/firestore-compat +## 0.4.2 + +### Patch Changes + +- Updated dependencies [[`43276b0`](https://github.com/firebase/firebase-js-sdk/commit/43276b0414ea5a73e8d8f7e3b80275d8b910102f)]: + - @firebase/firestore@4.9.2 + ## 0.4.1 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 3ae7c8bb6d0..0787c21f397 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore-compat", - "version": "0.4.1", + "version": "0.4.2", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", @@ -47,13 +47,13 @@ }, "dependencies": { "@firebase/component": "0.7.0", - "@firebase/firestore": "4.9.1", + "@firebase/firestore": "4.9.2", "@firebase/util": "1.13.0", "@firebase/firestore-types": "3.0.3", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 47ab4e61c30..b3d1f6d4626 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/firestore +## 4.9.2 + +### Patch Changes + +- [`43276b0`](https://github.com/firebase/firebase-js-sdk/commit/43276b0414ea5a73e8d8f7e3b80275d8b910102f) [#9242](https://github.com/firebase/firebase-js-sdk/pull/9242) - Increased the buffering-proxy detection timeout to minimize the false-positive rate. Updating WebChannel to ignore duplicate messages received from the server. Fix for https://github.com/firebase/firebase-js-sdk/issues/8250. + +- Updated dependencies [[`43276b0`](https://github.com/firebase/firebase-js-sdk/commit/43276b0414ea5a73e8d8f7e3b80275d8b910102f)]: + - @firebase/webchannel-wrapper@1.0.5 + ## 4.9.1 ### Patch Changes diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 625a51020ca..4001c19fe8c 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/firestore", - "version": "4.9.1", + "version": "4.9.2", "engines": { "node": ">=20.0.0" }, @@ -103,7 +103,7 @@ "@firebase/component": "0.7.0", "@firebase/logger": "0.5.0", "@firebase/util": "1.13.0", - "@firebase/webchannel-wrapper": "1.0.4", + "@firebase/webchannel-wrapper": "1.0.5", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0" @@ -112,8 +112,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.2", - "@firebase/app-compat": "0.5.2", + "@firebase/app": "0.14.3", + "@firebase/app-compat": "0.5.3", "@firebase/auth": "1.11.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 55c31dc9bd6..fd5b482bb66 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index c3e20894a8b..6099275f6cf 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 5102c37fcd5..058f690f237 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index a5ef2efd243..a1b5db5bdce 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 1dfe8021e48..643e1bd73e9 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 74438811c69..4d475ebadfa 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 27bac29090e..32c041916e2 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.2" + "@firebase/app-compat": "0.5.3" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index e6d69780279..cfbd414c0a4 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index 032b2fd59c0..08cd52e62d0 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,13 @@ # @firebase/remote-config-compat +## 0.2.20 + +### Patch Changes + +- Updated dependencies [[`120a308`](https://github.com/firebase/firebase-js-sdk/commit/120a30838da50f5ade4f634e97c34cbfcaff41ba)]: + - @firebase/remote-config@0.7.0 + - @firebase/remote-config-types@0.5.0 + ## 0.2.19 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 9d24228c146..b733ab07582 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.19", + "version": "0.2.20", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,8 +37,8 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.6.6", - "@firebase/remote-config-types": "0.4.0", + "@firebase/remote-config": "0.7.0", + "@firebase/remote-config-types": "0.5.0", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", "@firebase/component": "0.7.0", @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.2" + "@firebase/app-compat": "0.5.3" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config-types/CHANGELOG.md b/packages/remote-config-types/CHANGELOG.md index d4b52e801e8..ef86acb1e08 100644 --- a/packages/remote-config-types/CHANGELOG.md +++ b/packages/remote-config-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/remote-config-types +## 0.5.0 + +### Minor Changes + +- [`120a308`](https://github.com/firebase/firebase-js-sdk/commit/120a30838da50f5ade4f634e97c34cbfcaff41ba) [#9221](https://github.com/firebase/firebase-js-sdk/pull/9221) - Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling. + ## 0.4.0 ### Minor Changes diff --git a/packages/remote-config-types/package.json b/packages/remote-config-types/package.json index 7de29a27043..ec02d236ec9 100644 --- a/packages/remote-config-types/package.json +++ b/packages/remote-config-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config-types", - "version": "0.4.0", + "version": "0.5.0", "description": "@firebase/remote-config Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index 55443c14bbf..fcf552b0e3e 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/remote-config +## 0.7.0 + +### Minor Changes + +- [`120a308`](https://github.com/firebase/firebase-js-sdk/commit/120a30838da50f5ade4f634e97c34cbfcaff41ba) [#9221](https://github.com/firebase/firebase-js-sdk/pull/9221) - Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling. + ## 0.6.6 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 2ac97aab639..963b23acdcc 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/remote-config", - "version": "0.6.6", + "version": "0.7.0", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 42b24581777..cf86443967c 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.2", + "@firebase/app-compat": "0.5.3", "@firebase/auth-compat": "0.6.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 8f9d1c9182e..6248ead4f5c 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "@firebase/auth": "1.11.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index 89e3cc1a515..6ef9c2d81be 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/webchannel-wrapper/CHANGELOG.md b/packages/webchannel-wrapper/CHANGELOG.md index 6c93950e82f..e415fdd90bc 100644 --- a/packages/webchannel-wrapper/CHANGELOG.md +++ b/packages/webchannel-wrapper/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/webchannel-wrapper +## 1.0.5 + +### Patch Changes + +- [`43276b0`](https://github.com/firebase/firebase-js-sdk/commit/43276b0414ea5a73e8d8f7e3b80275d8b910102f) [#9242](https://github.com/firebase/firebase-js-sdk/pull/9242) - Increased the buffering-proxy detection timeout to minimize the false-positive rate. Updating WebChannel to ignore duplicate messages received from the server. Fix for https://github.com/firebase/firebase-js-sdk/issues/8250. + ## 1.0.4 ### Patch Changes diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index 8d02520a362..bddf3cec8ed 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/webchannel-wrapper", - "version": "1.0.4", + "version": "1.0.5", "description": "A wrapper of the webchannel packages from closure-library for use outside of a closure compiled application", "author": "Firebase (https://firebase.google.com/)", "main": "empty.js", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 70b42ce4501..dd71cc9a378 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -40,7 +40,7 @@ "yargs": "17.7.2" }, "devDependencies": { - "@firebase/app": "0.14.2", + "@firebase/app": "0.14.3", "@firebase/logger": "0.5.0", "@types/webpack": "5.28.5" }, From 1bcf83d7f0640dff67c20939fb9af7bae6a941e0 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 24 Sep 2025 09:02:27 -0700 Subject: [PATCH 281/295] Expose setUserProperties from internal analytics instance (#9263) --- .changeset/young-timers-jump.md | 6 ++++++ packages/analytics-interop-types/index.d.ts | 4 ++++ packages/analytics/src/index.ts | 10 +++++++--- .../src/testing/fakes/firebase-dependencies.ts | 3 ++- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 .changeset/young-timers-jump.md diff --git a/.changeset/young-timers-jump.md b/.changeset/young-timers-jump.md new file mode 100644 index 00000000000..2c572813ae8 --- /dev/null +++ b/.changeset/young-timers-jump.md @@ -0,0 +1,6 @@ +--- +'@firebase/analytics-interop-types': patch +'@firebase/analytics': patch +--- + +Expose `setUserProperties` on internal Analytics instance. diff --git a/packages/analytics-interop-types/index.d.ts b/packages/analytics-interop-types/index.d.ts index b3e2fb0fe07..6cb6936147b 100644 --- a/packages/analytics-interop-types/index.d.ts +++ b/packages/analytics-interop-types/index.d.ts @@ -29,6 +29,10 @@ export interface FirebaseAnalyticsInternal { eventParams?: { [key: string]: unknown }, options?: AnalyticsCallOptions ): void; + setUserProperties: ( + properties: { [key: string]: unknown }, + options?: AnalyticsCallOptions + ) => void; } export interface AnalyticsCallOptions { diff --git a/packages/analytics/src/index.ts b/packages/analytics/src/index.ts index 7fa2e8fa10b..6017aed21b0 100644 --- a/packages/analytics/src/index.ts +++ b/packages/analytics/src/index.ts @@ -33,9 +33,9 @@ import { InstanceFactoryOptions } from '@firebase/component'; import { ERROR_FACTORY, AnalyticsError } from './errors'; -import { logEvent } from './api'; +import { logEvent, setUserProperties } from './api'; import { name, version } from '../package.json'; -import { AnalyticsCallOptions } from './public-types'; +import { AnalyticsCallOptions, CustomParams } from './public-types'; import '@firebase/installations'; declare global { @@ -79,7 +79,11 @@ function registerAnalytics(): void { eventName: string, eventParams?: { [key: string]: unknown }, options?: AnalyticsCallOptions - ) => logEvent(analytics, eventName, eventParams, options) + ) => logEvent(analytics, eventName, eventParams, options), + setUserProperties: ( + properties: CustomParams, + options?: AnalyticsCallOptions + ) => setUserProperties(analytics, properties, options) }; } catch (e) { throw ERROR_FACTORY.create(AnalyticsError.INTEROP_COMPONENT_REG_FAILED, { diff --git a/packages/messaging/src/testing/fakes/firebase-dependencies.ts b/packages/messaging/src/testing/fakes/firebase-dependencies.ts index 8fd3b219f33..ccb40f276ed 100644 --- a/packages/messaging/src/testing/fakes/firebase-dependencies.ts +++ b/packages/messaging/src/testing/fakes/firebase-dependencies.ts @@ -68,7 +68,8 @@ export function getFakeInstallations(): _FirebaseInstallationsInternal { export function getFakeAnalyticsProvider(): Provider { const analytics: FirebaseAnalyticsInternal = { - logEvent() {} + logEvent() {}, + setUserProperties() {} }; return { From 0ffcb26af7c597820370fab1223da330728bbb36 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 25 Sep 2025 10:53:07 -0400 Subject: [PATCH 282/295] feat(ai): add support for URL context (#9254) --- .changeset/poor-rings-admire.md | 6 + common/api-review/ai.api.md | 44 +++++- docs-devsite/_toc.yaml | 8 + docs-devsite/ai.generatecontentcandidate.md | 9 ++ docs-devsite/ai.md | 44 +++++- docs-devsite/ai.urlcontext.md | 22 +++ docs-devsite/ai.urlcontextmetadata.md | 41 ++++++ docs-devsite/ai.urlcontexttool.md | 41 ++++++ docs-devsite/ai.urlmetadata.md | 55 +++++++ docs-devsite/ai.usagemetadata.md | 22 +++ .../ai/integration/generate-content.test.ts | 139 +++++++++++++++++- packages/ai/src/googleai-mappers.ts | 3 +- .../ai/src/methods/generate-content.test.ts | 51 +++++++ packages/ai/src/requests/stream-reader.ts | 16 +- packages/ai/src/types/googleai.ts | 4 +- packages/ai/src/types/requests.ts | 24 ++- packages/ai/src/types/responses.ts | 97 ++++++++++++ 17 files changed, 615 insertions(+), 11 deletions(-) create mode 100644 .changeset/poor-rings-admire.md create mode 100644 docs-devsite/ai.urlcontext.md create mode 100644 docs-devsite/ai.urlcontextmetadata.md create mode 100644 docs-devsite/ai.urlcontexttool.md create mode 100644 docs-devsite/ai.urlmetadata.md diff --git a/.changeset/poor-rings-admire.md b/.changeset/poor-rings-admire.md new file mode 100644 index 00000000000..1b63c0138d0 --- /dev/null +++ b/.changeset/poor-rings-admire.md @@ -0,0 +1,6 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Added support for the URL context tool, which allows the model to access content from provided public web URLs to inform and enhance its responses. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d4c3c1ad507..9a9fba59597 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -449,6 +449,10 @@ export interface GenerateContentCandidate { index: number; // (undocumented) safetyRatings?: SafetyRating[]; + // Warning: (ae-incompatible-release-tags) The symbol "urlContextMetadata" is marked as @public, but its signature references "URLContextMetadata" which is marked as @beta + // + // (undocumented) + urlContextMetadata?: URLContextMetadata; } // @public @@ -600,6 +604,8 @@ export interface GoogleAIGenerateContentCandidate { index: number; // (undocumented) safetyRatings?: SafetyRating[]; + // (undocumented) + urlContextMetadata?: URLContextMetadata; } // Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentResponse" should be prefixed with an underscore because the declaration is marked as @internal @@ -1304,8 +1310,10 @@ export interface ThinkingConfig { thinkingBudget?: number; } +// Warning: (ae-incompatible-release-tags) The symbol "Tool" is marked as @public, but its signature references "URLContextTool" which is marked as @beta +// // @public -export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool | URLContextTool; // @public export interface ToolConfig { @@ -1316,6 +1324,38 @@ export interface ToolConfig { // @public export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema; +// @beta +export interface URLContext { +} + +// @beta +export interface URLContextMetadata { + urlMetadata: URLMetadata[]; +} + +// @beta +export interface URLContextTool { + urlContext: URLContext; +} + +// @beta +export interface URLMetadata { + retrievedUrl?: string; + urlRetrievalStatus?: URLRetrievalStatus; +} + +// @beta +export const URLRetrievalStatus: { + URL_RETRIEVAL_STATUS_UNSPECIFIED: string; + URL_RETRIEVAL_STATUS_SUCCESS: string; + URL_RETRIEVAL_STATUS_ERROR: string; + URL_RETRIEVAL_STATUS_PAYWALL: string; + URL_RETRIEVAL_STATUS_UNSAFE: string; +}; + +// @beta +export type URLRetrievalStatus = (typeof URLRetrievalStatus)[keyof typeof URLRetrievalStatus]; + // @public export interface UsageMetadata { // (undocumented) @@ -1327,6 +1367,8 @@ export interface UsageMetadata { // (undocumented) promptTokensDetails?: ModalityTokenCount[]; thoughtsTokenCount?: number; + toolUsePromptTokenCount?: number; + toolUsePromptTokensDetails?: ModalityTokenCount[]; // (undocumented) totalTokenCount: number; } diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 364d5b992c9..04d65f6c333 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -202,6 +202,14 @@ toc: path: /docs/reference/js/ai.thinkingconfig.md - title: ToolConfig path: /docs/reference/js/ai.toolconfig.md + - title: URLContext + path: /docs/reference/js/ai.urlcontext.md + - title: URLContextMetadata + path: /docs/reference/js/ai.urlcontextmetadata.md + - title: URLContextTool + path: /docs/reference/js/ai.urlcontexttool.md + - title: URLMetadata + path: /docs/reference/js/ai.urlmetadata.md - title: UsageMetadata path: /docs/reference/js/ai.usagemetadata.md - title: VertexAIBackend diff --git a/docs-devsite/ai.generatecontentcandidate.md b/docs-devsite/ai.generatecontentcandidate.md index ca0383549a7..1691442ecfa 100644 --- a/docs-devsite/ai.generatecontentcandidate.md +++ b/docs-devsite/ai.generatecontentcandidate.md @@ -29,6 +29,7 @@ export interface GenerateContentCandidate | [groundingMetadata](./ai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | | | [index](./ai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | | [safetyRatings](./ai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./ai.safetyrating.md#safetyrating_interface)\[\] | | +| [urlContextMetadata](./ai.generatecontentcandidate.md#generatecontentcandidateurlcontextmetadata) | [URLContextMetadata](./ai.urlcontextmetadata.md#urlcontextmetadata_interface) | | ## GenerateContentCandidate.citationMetadata @@ -85,3 +86,11 @@ index: number; ```typescript safetyRatings?: SafetyRating[]; ``` + +## GenerateContentCandidate.urlContextMetadata + +Signature: + +```typescript +urlContextMetadata?: URLContextMetadata; +``` diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index 78d82d23800..b2e793e6120 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -134,6 +134,10 @@ The Firebase AI Web SDK. | [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [URLContext](./ai.urlcontext.md#urlcontext_interface) | (Public Preview) Specifies the URL Context configuration. | +| [URLContextMetadata](./ai.urlcontextmetadata.md#urlcontextmetadata_interface) | (Public Preview) Metadata related to [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface). | +| [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) | (Public Preview) A tool that allows you to provide additional context to the models in the form of public web URLs. By including URLs in your request, the Gemini model will access the content from those pages to inform and enhance its response. | +| [URLMetadata](./ai.urlmetadata.md#urlmetadata_interface) | (Public Preview) Metadata for a single URL retrieved by the [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) tool. | | [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). | | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. | | [VoiceConfig](./ai.voiceconfig.md#voiceconfig_interface) | (Public Preview) Configuration for the voice to used in speech synthesis. | @@ -165,6 +169,7 @@ The Firebase AI Web SDK. | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | +| [URLRetrievalStatus](./ai.md#urlretrievalstatus) | (Public Preview) The status of a URL retrieval. | ## Type Aliases @@ -197,6 +202,7 @@ The Firebase AI Web SDK. | [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | | [Tool](./ai.md#tool) | Defines a tool that model can call to access external knowledge. | | [TypedSchema](./ai.md#typedschema) | A type that includes all specific Schema types. | +| [URLRetrievalStatus](./ai.md#urlretrievalstatus) | (Public Preview) The status of a URL retrieval. | ## function(app, ...) @@ -755,6 +761,27 @@ SchemaType: { } ``` +## URLRetrievalStatus + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The status of a URL retrieval. + +URL\_RETRIEVAL\_STATUS\_UNSPECIFIED: Unspecified retrieval status.
      URL\_RETRIEVAL\_STATUS\_SUCCESS: The URL retrieval was successful.
      URL\_RETRIEVAL\_STATUS\_ERROR: The URL retrieval failed.
      URL\_RETRIEVAL\_STATUS\_PAYWALL: The URL retrieval failed because the content is behind a paywall.
      URL\_RETRIEVAL\_STATUS\_UNSAFE: The URL retrieval failed because the content is unsafe.
      + +Signature: + +```typescript +URLRetrievalStatus: { + URL_RETRIEVAL_STATUS_UNSPECIFIED: string; + URL_RETRIEVAL_STATUS_SUCCESS: string; + URL_RETRIEVAL_STATUS_ERROR: string; + URL_RETRIEVAL_STATUS_PAYWALL: string; + URL_RETRIEVAL_STATUS_UNSAFE: string; +} +``` + ## AIErrorCode Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. @@ -1046,7 +1073,7 @@ Defines a tool that model can call to access external knowledge. Signature: ```typescript -export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool; +export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool | URLContextTool; ``` ## TypedSchema @@ -1058,3 +1085,18 @@ A type that includes all specific Schema types. ```typescript export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema; ``` + +## URLRetrievalStatus + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The status of a URL retrieval. + +URL\_RETRIEVAL\_STATUS\_UNSPECIFIED: Unspecified retrieval status.
      URL\_RETRIEVAL\_STATUS\_SUCCESS: The URL retrieval was successful.
      URL\_RETRIEVAL\_STATUS\_ERROR: The URL retrieval failed.
      URL\_RETRIEVAL\_STATUS\_PAYWALL: The URL retrieval failed because the content is behind a paywall.
      URL\_RETRIEVAL\_STATUS\_UNSAFE: The URL retrieval failed because the content is unsafe.
      + +Signature: + +```typescript +export type URLRetrievalStatus = (typeof URLRetrievalStatus)[keyof typeof URLRetrievalStatus]; +``` diff --git a/docs-devsite/ai.urlcontext.md b/docs-devsite/ai.urlcontext.md new file mode 100644 index 00000000000..435d278e4d1 --- /dev/null +++ b/docs-devsite/ai.urlcontext.md @@ -0,0 +1,22 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# URLContext interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Specifies the URL Context configuration. + +Signature: + +```typescript +export interface URLContext +``` diff --git a/docs-devsite/ai.urlcontextmetadata.md b/docs-devsite/ai.urlcontextmetadata.md new file mode 100644 index 00000000000..bc260b997ad --- /dev/null +++ b/docs-devsite/ai.urlcontextmetadata.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# URLContextMetadata interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Metadata related to [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface). + +Signature: + +```typescript +export interface URLContextMetadata +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [urlMetadata](./ai.urlcontextmetadata.md#urlcontextmetadataurlmetadata) | [URLMetadata](./ai.urlmetadata.md#urlmetadata_interface)\[\] | (Public Preview) List of URL metadata used to provide context to the Gemini model. | + +## URLContextMetadata.urlMetadata + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +List of URL metadata used to provide context to the Gemini model. + +Signature: + +```typescript +urlMetadata: URLMetadata[]; +``` diff --git a/docs-devsite/ai.urlcontexttool.md b/docs-devsite/ai.urlcontexttool.md new file mode 100644 index 00000000000..6ecc2a323c1 --- /dev/null +++ b/docs-devsite/ai.urlcontexttool.md @@ -0,0 +1,41 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# URLContextTool interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +A tool that allows you to provide additional context to the models in the form of public web URLs. By including URLs in your request, the Gemini model will access the content from those pages to inform and enhance its response. + +Signature: + +```typescript +export interface URLContextTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [urlContext](./ai.urlcontexttool.md#urlcontexttoolurlcontext) | [URLContext](./ai.urlcontext.md#urlcontext_interface) | (Public Preview) Specifies the URL Context configuration. | + +## URLContextTool.urlContext + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Specifies the URL Context configuration. + +Signature: + +```typescript +urlContext: URLContext; +``` diff --git a/docs-devsite/ai.urlmetadata.md b/docs-devsite/ai.urlmetadata.md new file mode 100644 index 00000000000..3cbd27632d0 --- /dev/null +++ b/docs-devsite/ai.urlmetadata.md @@ -0,0 +1,55 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# URLMetadata interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Metadata for a single URL retrieved by the [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) tool. + +Signature: + +```typescript +export interface URLMetadata +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [retrievedUrl](./ai.urlmetadata.md#urlmetadataretrievedurl) | string | (Public Preview) The retrieved URL. | +| [urlRetrievalStatus](./ai.urlmetadata.md#urlmetadataurlretrievalstatus) | [URLRetrievalStatus](./ai.md#urlretrievalstatus) | (Public Preview) The status of the URL retrieval. | + +## URLMetadata.retrievedUrl + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The retrieved URL. + +Signature: + +```typescript +retrievedUrl?: string; +``` + +## URLMetadata.urlRetrievalStatus + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The status of the URL retrieval. + +Signature: + +```typescript +urlRetrievalStatus?: URLRetrievalStatus; +``` diff --git a/docs-devsite/ai.usagemetadata.md b/docs-devsite/ai.usagemetadata.md index 954fcc6e530..bf45610f4a1 100644 --- a/docs-devsite/ai.usagemetadata.md +++ b/docs-devsite/ai.usagemetadata.md @@ -27,6 +27,8 @@ export interface UsageMetadata | [promptTokenCount](./ai.usagemetadata.md#usagemetadataprompttokencount) | number | | | [promptTokensDetails](./ai.usagemetadata.md#usagemetadataprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | | | [thoughtsTokenCount](./ai.usagemetadata.md#usagemetadatathoughtstokencount) | number | The number of tokens used by the model's internal "thinking" process. | +| [toolUsePromptTokenCount](./ai.usagemetadata.md#usagemetadatatooluseprompttokencount) | number | The number of tokens used by tools. | +| [toolUsePromptTokensDetails](./ai.usagemetadata.md#usagemetadatatooluseprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\[\] | A list of tokens used by tools, broken down by modality. | | [totalTokenCount](./ai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount @@ -71,6 +73,26 @@ The number of tokens used by the model's internal "thinking" process. thoughtsTokenCount?: number; ``` +## UsageMetadata.toolUsePromptTokenCount + +The number of tokens used by tools. + +Signature: + +```typescript +toolUsePromptTokenCount?: number; +``` + +## UsageMetadata.toolUsePromptTokensDetails + +A list of tokens used by tools, broken down by modality. + +Signature: + +```typescript +toolUsePromptTokensDetails?: ModalityTokenCount[]; +``` + ## UsageMetadata.totalTokenCount Signature: diff --git a/packages/ai/integration/generate-content.test.ts b/packages/ai/integration/generate-content.test.ts index a827a447d90..ffb1ecca698 100644 --- a/packages/ai/integration/generate-content.test.ts +++ b/packages/ai/integration/generate-content.test.ts @@ -17,6 +17,7 @@ import { expect } from 'chai'; import { + BackendType, Content, GenerationConfig, HarmBlockThreshold, @@ -25,11 +26,13 @@ import { Modality, Outcome, SafetySetting, + URLRetrievalStatus, getGenerativeModel } from '../src'; import { testConfigs, TOKEN_COUNT_DELTA } from './constants'; -describe('Generate Content', () => { +describe('Generate Content', function () { + this.timeout(20_000); testConfigs.forEach(testConfig => { describe(`${testConfig.toString()}`, () => { const commonGenerationConfig: GenerationConfig = { @@ -41,19 +44,19 @@ describe('Generate Content', () => { const commonSafetySettings: SafetySetting[] = [ { category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + threshold: HarmBlockThreshold.BLOCK_NONE }, { category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + threshold: HarmBlockThreshold.BLOCK_NONE }, { category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + threshold: HarmBlockThreshold.BLOCK_NONE }, { category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + threshold: HarmBlockThreshold.BLOCK_NONE } ]; @@ -190,6 +193,132 @@ describe('Generate Content', () => { }); }); + describe('URL Context', async () => { + // URL Context is not supported in Google AI for gemini-2.0-flash + if ( + testConfig.ai.backend.backendType === BackendType.GOOGLE_AI && + testConfig.model === 'gemini-2.0-flash' + ) { + return; + } + + it('generateContent: url context', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + tools: [{ urlContext: {} }] + }); + + const result = await model.generateContent( + 'Summarize this website https://berkshirehathaway.com' + ); + const response = result.response; + const urlContextMetadata = + response.candidates?.[0].urlContextMetadata; + expect(urlContextMetadata?.urlMetadata).to.exist; + expect( + urlContextMetadata?.urlMetadata.length + ).to.be.greaterThanOrEqual(1); + expect(urlContextMetadata?.urlMetadata[0].retrievedUrl).to.exist; + expect(urlContextMetadata?.urlMetadata[0].retrievedUrl).to.equal( + 'https://berkshirehathaway.com' + ); + expect( + urlContextMetadata?.urlMetadata[0].urlRetrievalStatus + ).to.equal(URLRetrievalStatus.URL_RETRIEVAL_STATUS_SUCCESS); + + const usageMetadata = response.usageMetadata; + expect(usageMetadata).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.be.greaterThan(0); + }); + + it('generateContent: url context and google search grounding', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + tools: [{ urlContext: {} }, { googleSearch: {} }] + }); + + const result = await model.generateContent( + 'According to https://info.cern.ch/hypertext/WWW/TheProject.html, what is the WorldWideWeb? Search the web for other definitions.' + ); + const response = result.response; + const trimmedText = response.text().trim(); + const urlContextMetadata = + response.candidates?.[0].urlContextMetadata; + const groundingMetadata = response.candidates?.[0].groundingMetadata; + expect(trimmedText).to.contain( + 'hypermedia information retrieval initiative' + ); + expect(urlContextMetadata?.urlMetadata).to.exist; + expect( + urlContextMetadata?.urlMetadata.length + ).to.be.greaterThanOrEqual(1); + expect(urlContextMetadata?.urlMetadata[0].retrievedUrl).to.exist; + expect(urlContextMetadata?.urlMetadata[0].retrievedUrl).to.equal( + 'https://info.cern.ch/hypertext/WWW/TheProject.html' + ); + expect( + urlContextMetadata?.urlMetadata[0].urlRetrievalStatus + ).to.equal(URLRetrievalStatus.URL_RETRIEVAL_STATUS_SUCCESS); + expect(groundingMetadata).to.exist; + expect(groundingMetadata?.groundingChunks).to.exist; + expect( + groundingMetadata?.groundingChunks!.length + ).to.be.greaterThanOrEqual(1); + expect( + groundingMetadata?.groundingSupports!.length + ).to.be.greaterThanOrEqual(1); + + const usageMetadata = response.usageMetadata; + expect(usageMetadata).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.be.greaterThan(0); + }); + + it('generateContent: url context and google search grounding without URLs in prompt', async () => { + const model = getGenerativeModel(testConfig.ai, { + model: testConfig.model, + generationConfig: commonGenerationConfig, + safetySettings: commonSafetySettings, + tools: [{ urlContext: {} }, { googleSearch: {} }] + }); + + const result = await model.generateContent( + 'Recommend 3 books for beginners to read to learn more about the latest advancements in Quantum Computing.' + ); + const response = result.response; + const urlContextMetadata = + response.candidates?.[0].urlContextMetadata; + const groundingMetadata = response.candidates?.[0].groundingMetadata; + if (testConfig.ai.backend.backendType === BackendType.GOOGLE_AI) { + expect(urlContextMetadata?.urlMetadata).to.exist; + expect( + urlContextMetadata?.urlMetadata.length + ).to.be.greaterThanOrEqual(1); + expect(urlContextMetadata?.urlMetadata[0].retrievedUrl).to.exist; + expect( + urlContextMetadata?.urlMetadata[0].urlRetrievalStatus + ).to.equal(URLRetrievalStatus.URL_RETRIEVAL_STATUS_SUCCESS); + expect(groundingMetadata).to.exist; + expect(groundingMetadata?.groundingChunks).to.exist; + + const usageMetadata = response.usageMetadata; + expect(usageMetadata).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.exist; + expect(usageMetadata?.toolUsePromptTokenCount).to.be.greaterThan(0); + } else { + // URL Context does not integrate with Google Search Grounding in Vertex AI + expect(urlContextMetadata?.urlMetadata).to.not.exist; + expect(groundingMetadata).to.exist; + expect(groundingMetadata?.groundingChunks).to.exist; + } + }); + }); + it('generateContent: code execution', async () => { const model = getGenerativeModel(testConfig.ai, { model: testConfig.model, diff --git a/packages/ai/src/googleai-mappers.ts b/packages/ai/src/googleai-mappers.ts index 23c238c1e3b..b3e4206f33c 100644 --- a/packages/ai/src/googleai-mappers.ts +++ b/packages/ai/src/googleai-mappers.ts @@ -193,7 +193,8 @@ export function mapGenerateContentCandidates( finishMessage: candidate.finishMessage, safetyRatings: mappedSafetyRatings, citationMetadata, - groundingMetadata: candidate.groundingMetadata + groundingMetadata: candidate.groundingMetadata, + urlContextMetadata: candidate.urlContextMetadata }; mappedCandidates.push(mappedCandidate); }); diff --git a/packages/ai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts index 3bb396ac6d8..f75c87e4dd9 100644 --- a/packages/ai/src/methods/generate-content.test.ts +++ b/packages/ai/src/methods/generate-content.test.ts @@ -249,6 +249,57 @@ describe('generateContent()', () => { false, match.any ); + + it('url context', async () => { + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-url-context.json' + ); + const makeRequestStub = stub(request, 'makeRequest').resolves( + mockResponse as Response + ); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams + ); + expect(result.response.text()).to.include( + 'The temperature is 67°F (19°C)' + ); + const groundingMetadata = + result.response.candidates?.[0].groundingMetadata; + expect(groundingMetadata).to.not.be.undefined; + expect(groundingMetadata!.searchEntryPoint?.renderedContent).to.contain( + 'div' + ); + expect(groundingMetadata!.groundingChunks?.length).to.equal(2); + expect(groundingMetadata!.groundingChunks?.[0].web?.uri).to.contain( + 'https://vertexaisearch.cloud.google.com' + ); + expect(groundingMetadata!.groundingChunks?.[0].web?.title).to.equal( + 'accuweather.com' + ); + expect(groundingMetadata!.groundingSupports?.length).to.equal(3); + expect( + groundingMetadata!.groundingSupports?.[0].groundingChunkIndices + ).to.deep.equal([0]); + expect(groundingMetadata!.groundingSupports?.[0].segment).to.deep.equal({ + endIndex: 56, + text: 'The current weather in London, United Kingdom is cloudy.' + }); + expect(groundingMetadata!.groundingSupports?.[0].segment?.partIndex).to.be + .undefined; + expect(groundingMetadata!.groundingSupports?.[0].segment?.startIndex).to + .be.undefined; + + expect(makeRequestStub).to.be.calledWith( + 'model', + Task.GENERATE_CONTENT, + fakeApiSettings, + false, + match.any + ); + }); }); it('codeExecution', async () => { const mockResponse = getMockResponse( diff --git a/packages/ai/src/requests/stream-reader.ts b/packages/ai/src/requests/stream-reader.ts index c3a35b1da4a..3b205efabf2 100644 --- a/packages/ai/src/requests/stream-reader.ts +++ b/packages/ai/src/requests/stream-reader.ts @@ -28,7 +28,7 @@ import { createEnhancedContentResponse } from './response-helpers'; import * as GoogleAIMapper from '../googleai-mappers'; import { GoogleAIGenerateContentResponse } from '../types/googleai'; import { ApiSettings } from '../types/internal'; -import { BackendType } from '../public-types'; +import { BackendType, URLContextMetadata } from '../public-types'; const responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; @@ -193,6 +193,20 @@ export function aggregateResponses( aggregatedResponse.candidates[i].groundingMetadata = candidate.groundingMetadata; + // The urlContextMetadata object is defined in the first chunk of the response stream. + // In all subsequent chunks, the urlContextMetadata object will be undefined. We need to + // make sure that we don't overwrite the first value urlContextMetadata object with undefined. + // FIXME: What happens if we receive a second, valid urlContextMetadata object? + const urlContextMetadata = candidate.urlContextMetadata as unknown; + if ( + typeof urlContextMetadata === 'object' && + urlContextMetadata !== null && + Object.keys(urlContextMetadata).length > 0 + ) { + aggregatedResponse.candidates[i].urlContextMetadata = + urlContextMetadata as URLContextMetadata; + } + /** * Candidates should always have content and parts, but this handles * possible malformed responses. diff --git a/packages/ai/src/types/googleai.ts b/packages/ai/src/types/googleai.ts index 38c27b3fe8b..eb282b094fc 100644 --- a/packages/ai/src/types/googleai.ts +++ b/packages/ai/src/types/googleai.ts @@ -23,7 +23,8 @@ import { GroundingMetadata, PromptFeedback, SafetyRating, - UsageMetadata + UsageMetadata, + URLContextMetadata } from '../public-types'; import { Content, Part } from './content'; @@ -60,6 +61,7 @@ export interface GoogleAIGenerateContentCandidate { safetyRatings?: SafetyRating[]; citationMetadata?: GoogleAICitationMetadata; groundingMetadata?: GroundingMetadata; + urlContextMetadata?: URLContextMetadata; } /** diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index eea03e55fe4..359be9c32c9 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -242,7 +242,8 @@ export interface RequestOptions { export type Tool = | FunctionDeclarationsTool | GoogleSearchTool - | CodeExecutionTool; + | CodeExecutionTool + | URLContextTool; /** * Structured representation of a function declaration as defined by the @@ -319,6 +320,27 @@ export interface CodeExecutionTool { */ export interface GoogleSearch {} +/** + * A tool that allows you to provide additional context to the models in the form of public web + * URLs. By including URLs in your request, the Gemini model will access the content from those + * pages to inform and enhance its response. + * + * @beta + */ +export interface URLContextTool { + /** + * Specifies the URL Context configuration. + */ + urlContext: URLContext; +} + +/** + * Specifies the URL Context configuration. + * + * @beta + */ +export interface URLContext {} + /** * A `FunctionDeclarationsTool` is a piece of code that enables the system to * interact with external systems to perform an action, or set of actions, diff --git a/packages/ai/src/types/responses.ts b/packages/ai/src/types/responses.ts index 4a01e79a77c..8b8e1351675 100644 --- a/packages/ai/src/types/responses.ts +++ b/packages/ai/src/types/responses.ts @@ -116,8 +116,16 @@ export interface UsageMetadata { */ thoughtsTokenCount?: number; totalTokenCount: number; + /** + * The number of tokens used by tools. + */ + toolUsePromptTokenCount?: number; promptTokensDetails?: ModalityTokenCount[]; candidatesTokensDetails?: ModalityTokenCount[]; + /** + * A list of tokens used by tools, broken down by modality. + */ + toolUsePromptTokensDetails?: ModalityTokenCount[]; } /** @@ -160,6 +168,7 @@ export interface GenerateContentCandidate { safetyRatings?: SafetyRating[]; citationMetadata?: CitationMetadata; groundingMetadata?: GroundingMetadata; + urlContextMetadata?: URLContextMetadata; } /** @@ -349,6 +358,94 @@ export interface Segment { text: string; } +/** + * Metadata related to {@link URLContextTool}. + * + * @beta + */ +export interface URLContextMetadata { + /** + * List of URL metadata used to provide context to the Gemini model. + */ + urlMetadata: URLMetadata[]; +} + +/** + * Metadata for a single URL retrieved by the {@link URLContextTool} tool. + * + * @beta + */ +export interface URLMetadata { + /** + * The retrieved URL. + */ + retrievedUrl?: string; + /** + * The status of the URL retrieval. + */ + urlRetrievalStatus?: URLRetrievalStatus; +} + +/** + * The status of a URL retrieval. + * + * @remarks + * URL_RETRIEVAL_STATUS_UNSPECIFIED: Unspecified retrieval status. + *
      + * URL_RETRIEVAL_STATUS_SUCCESS: The URL retrieval was successful. + *
      + * URL_RETRIEVAL_STATUS_ERROR: The URL retrieval failed. + *
      + * URL_RETRIEVAL_STATUS_PAYWALL: The URL retrieval failed because the content is behind a paywall. + *
      + * URL_RETRIEVAL_STATUS_UNSAFE: The URL retrieval failed because the content is unsafe. + *
      + * + * @beta + */ +export const URLRetrievalStatus = { + /** + * Unspecified retrieval status. + */ + URL_RETRIEVAL_STATUS_UNSPECIFIED: 'URL_RETRIEVAL_STATUS_UNSPECIFIED', + /** + * The URL retrieval was successful. + */ + URL_RETRIEVAL_STATUS_SUCCESS: 'URL_RETRIEVAL_STATUS_SUCCESS', + /** + * The URL retrieval failed. + */ + URL_RETRIEVAL_STATUS_ERROR: 'URL_RETRIEVAL_STATUS_ERROR', + /** + * The URL retrieval failed because the content is behind a paywall. + */ + URL_RETRIEVAL_STATUS_PAYWALL: 'URL_RETRIEVAL_STATUS_PAYWALL', + /** + * The URL retrieval failed because the content is unsafe. + */ + URL_RETRIEVAL_STATUS_UNSAFE: 'URL_RETRIEVAL_STATUS_UNSAFE' +}; + +/** + * The status of a URL retrieval. + * + * @remarks + * URL_RETRIEVAL_STATUS_UNSPECIFIED: Unspecified retrieval status. + *
      + * URL_RETRIEVAL_STATUS_SUCCESS: The URL retrieval was successful. + *
      + * URL_RETRIEVAL_STATUS_ERROR: The URL retrieval failed. + *
      + * URL_RETRIEVAL_STATUS_PAYWALL: The URL retrieval failed because the content is behind a paywall. + *
      + * URL_RETRIEVAL_STATUS_UNSAFE: The URL retrieval failed because the content is unsafe. + *
      + * + * @beta + */ +export type URLRetrievalStatus = + (typeof URLRetrievalStatus)[keyof typeof URLRetrievalStatus]; + /** * @public */ From 7a7634f79c4cb0d9389747068b39a7968b5628a0 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 25 Sep 2025 11:32:34 -0700 Subject: [PATCH 283/295] docs(ai): tag code execution with "beta" tag (public preview) (#9274) --- .changeset/tender-meals-clap.md | 5 +++ common/api-review/ai.api.md | 22 ++++++----- docs-devsite/ai.codeexecutionresult.md | 13 ++++++- docs-devsite/ai.codeexecutionresultpart.md | 43 ++++++++++++++++++---- docs-devsite/ai.codeexecutiontool.md | 8 +++- docs-devsite/ai.executablecode.md | 13 ++++++- docs-devsite/ai.executablecodepart.md | 43 ++++++++++++++++++---- docs-devsite/ai.md | 30 ++++++++++----- packages/ai/src/types/content.ts | 8 ++-- packages/ai/src/types/enums.ts | 8 ++-- packages/ai/src/types/requests.ts | 2 +- 11 files changed, 147 insertions(+), 48 deletions(-) create mode 100644 .changeset/tender-meals-clap.md diff --git a/.changeset/tender-meals-clap.md b/.changeset/tender-meals-clap.md new file mode 100644 index 00000000000..44509f4f489 --- /dev/null +++ b/.changeset/tender-meals-clap.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Tag code execution with beta tag (public preview). diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index 9a9fba59597..cf02485b222 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -175,13 +175,13 @@ export interface CitationMetadata { citations: Citation[]; } -// @public +// @beta export interface CodeExecutionResult { outcome?: Outcome; output?: string; } -// @public +// @beta export interface CodeExecutionResultPart { // (undocumented) codeExecutionResult?: CodeExecutionResult; @@ -203,7 +203,7 @@ export interface CodeExecutionResultPart { thoughtSignature?: never; } -// @public +// @beta export interface CodeExecutionTool { codeExecution: {}; } @@ -271,13 +271,13 @@ export interface ErrorDetails { reason?: string; } -// @public +// @beta export interface ExecutableCode { code?: string; language?: Language; } -// @public +// @beta export interface ExecutableCodePart { // (undocumented) codeExecutionResult?: never; @@ -842,13 +842,13 @@ export class IntegerSchema extends Schema { constructor(schemaParams?: SchemaParams); } -// @public +// @beta export const Language: { UNSPECIFIED: string; PYTHON: string; }; -// @public +// @beta export type Language = (typeof Language)[keyof typeof Language]; // @beta @@ -1064,7 +1064,7 @@ export interface OnDeviceParams { promptOptions?: LanguageModelPromptOptions; } -// @public +// @beta export const Outcome: { UNSPECIFIED: string; OK: string; @@ -1072,9 +1072,12 @@ export const Outcome: { DEADLINE_EXCEEDED: string; }; -// @public +// @beta export type Outcome = (typeof Outcome)[keyof typeof Outcome]; +// Warning: (ae-incompatible-release-tags) The symbol "Part" is marked as @public, but its signature references "ExecutableCodePart" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "Part" is marked as @public, but its signature references "CodeExecutionResultPart" which is marked as @beta +// // @public export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart; @@ -1310,6 +1313,7 @@ export interface ThinkingConfig { thinkingBudget?: number; } +// Warning: (ae-incompatible-release-tags) The symbol "Tool" is marked as @public, but its signature references "CodeExecutionTool" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "Tool" is marked as @public, but its signature references "URLContextTool" which is marked as @beta // // @public diff --git a/docs-devsite/ai.codeexecutionresult.md b/docs-devsite/ai.codeexecutionresult.md index d0be155c4e6..d9d937ecad6 100644 --- a/docs-devsite/ai.codeexecutionresult.md +++ b/docs-devsite/ai.codeexecutionresult.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CodeExecutionResult interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The results of code execution run by the model. Signature: @@ -22,11 +25,14 @@ export interface CodeExecutionResult | Property | Type | Description | | --- | --- | --- | -| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | The result of the code execution. | -| [output](./ai.codeexecutionresult.md#codeexecutionresultoutput) | string | The output from the code execution, or an error message if it failed. | +| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | (Public Preview) The result of the code execution. | +| [output](./ai.codeexecutionresult.md#codeexecutionresultoutput) | string | (Public Preview) The output from the code execution, or an error message if it failed. | ## CodeExecutionResult.outcome +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The result of the code execution. Signature: @@ -37,6 +43,9 @@ outcome?: Outcome; ## CodeExecutionResult.output +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The output from the code execution, or an error message if it failed. Signature: diff --git a/docs-devsite/ai.codeexecutionresultpart.md b/docs-devsite/ai.codeexecutionresultpart.md index 6142a3ec79f..19364c5a7b7 100644 --- a/docs-devsite/ai.codeexecutionresultpart.md +++ b/docs-devsite/ai.codeexecutionresultpart.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CodeExecutionResultPart interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Represents the code execution result from the model. Signature: @@ -22,17 +25,20 @@ export interface CodeExecutionResultPart | Property | Type | Description | | --- | --- | --- | -| [codeExecutionResult](./ai.codeexecutionresultpart.md#codeexecutionresultpartcodeexecutionresult) | [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | | -| [executableCode](./ai.codeexecutionresultpart.md#codeexecutionresultpartexecutablecode) | never | | -| [fileData](./ai.codeexecutionresultpart.md#codeexecutionresultpartfiledata) | never | | -| [functionCall](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctioncall) | never | | -| [functionResponse](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctionresponse) | never | | -| [inlineData](./ai.codeexecutionresultpart.md#codeexecutionresultpartinlinedata) | never | | -| [text](./ai.codeexecutionresultpart.md#codeexecutionresultparttext) | never | | -| [thought](./ai.codeexecutionresultpart.md#codeexecutionresultpartthought) | never | | +| [codeExecutionResult](./ai.codeexecutionresultpart.md#codeexecutionresultpartcodeexecutionresult) | [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | (Public Preview) | +| [executableCode](./ai.codeexecutionresultpart.md#codeexecutionresultpartexecutablecode) | never | (Public Preview) | +| [fileData](./ai.codeexecutionresultpart.md#codeexecutionresultpartfiledata) | never | (Public Preview) | +| [functionCall](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctioncall) | never | (Public Preview) | +| [functionResponse](./ai.codeexecutionresultpart.md#codeexecutionresultpartfunctionresponse) | never | (Public Preview) | +| [inlineData](./ai.codeexecutionresultpart.md#codeexecutionresultpartinlinedata) | never | (Public Preview) | +| [text](./ai.codeexecutionresultpart.md#codeexecutionresultparttext) | never | (Public Preview) | +| [thought](./ai.codeexecutionresultpart.md#codeexecutionresultpartthought) | never | (Public Preview) | ## CodeExecutionResultPart.codeExecutionResult +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -41,6 +47,9 @@ codeExecutionResult?: CodeExecutionResult; ## CodeExecutionResultPart.executableCode +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -49,6 +58,9 @@ executableCode?: never; ## CodeExecutionResultPart.fileData +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -57,6 +69,9 @@ fileData: never; ## CodeExecutionResultPart.functionCall +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -65,6 +80,9 @@ functionCall?: never; ## CodeExecutionResultPart.functionResponse +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -73,6 +91,9 @@ functionResponse?: never; ## CodeExecutionResultPart.inlineData +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -81,6 +102,9 @@ inlineData?: never; ## CodeExecutionResultPart.text +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -89,6 +113,9 @@ text?: never; ## CodeExecutionResultPart.thought +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.codeexecutiontool.md b/docs-devsite/ai.codeexecutiontool.md index 34a4715ac63..68a1e133d7b 100644 --- a/docs-devsite/ai.codeexecutiontool.md +++ b/docs-devsite/ai.codeexecutiontool.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CodeExecutionTool interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + A tool that enables the model to use code execution. Signature: @@ -22,10 +25,13 @@ export interface CodeExecutionTool | Property | Type | Description | | --- | --- | --- | -| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. | +| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | (Public Preview) Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. | ## CodeExecutionTool.codeExecution +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. Signature: diff --git a/docs-devsite/ai.executablecode.md b/docs-devsite/ai.executablecode.md index bab79bacc50..c2dfa09cd77 100644 --- a/docs-devsite/ai.executablecode.md +++ b/docs-devsite/ai.executablecode.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ExecutableCode interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + An interface for executable code returned by the model. Signature: @@ -22,11 +25,14 @@ export interface ExecutableCode | Property | Type | Description | | --- | --- | --- | -| [code](./ai.executablecode.md#executablecodecode) | string | The source code to be executed. | -| [language](./ai.executablecode.md#executablecodelanguage) | [Language](./ai.md#language) | The programming language of the code. | +| [code](./ai.executablecode.md#executablecodecode) | string | (Public Preview) The source code to be executed. | +| [language](./ai.executablecode.md#executablecodelanguage) | [Language](./ai.md#language) | (Public Preview) The programming language of the code. | ## ExecutableCode.code +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The source code to be executed. Signature: @@ -37,6 +43,9 @@ code?: string; ## ExecutableCode.language +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The programming language of the code. Signature: diff --git a/docs-devsite/ai.executablecodepart.md b/docs-devsite/ai.executablecodepart.md index 99c6bf05987..cac32c132ed 100644 --- a/docs-devsite/ai.executablecodepart.md +++ b/docs-devsite/ai.executablecodepart.md @@ -10,6 +10,9 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ExecutableCodePart interface +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Represents the code that is executed by the model. Signature: @@ -22,17 +25,20 @@ export interface ExecutableCodePart | Property | Type | Description | | --- | --- | --- | -| [codeExecutionResult](./ai.executablecodepart.md#executablecodepartcodeexecutionresult) | never | | -| [executableCode](./ai.executablecodepart.md#executablecodepartexecutablecode) | [ExecutableCode](./ai.executablecode.md#executablecode_interface) | | -| [fileData](./ai.executablecodepart.md#executablecodepartfiledata) | never | | -| [functionCall](./ai.executablecodepart.md#executablecodepartfunctioncall) | never | | -| [functionResponse](./ai.executablecodepart.md#executablecodepartfunctionresponse) | never | | -| [inlineData](./ai.executablecodepart.md#executablecodepartinlinedata) | never | | -| [text](./ai.executablecodepart.md#executablecodeparttext) | never | | -| [thought](./ai.executablecodepart.md#executablecodepartthought) | never | | +| [codeExecutionResult](./ai.executablecodepart.md#executablecodepartcodeexecutionresult) | never | (Public Preview) | +| [executableCode](./ai.executablecodepart.md#executablecodepartexecutablecode) | [ExecutableCode](./ai.executablecode.md#executablecode_interface) | (Public Preview) | +| [fileData](./ai.executablecodepart.md#executablecodepartfiledata) | never | (Public Preview) | +| [functionCall](./ai.executablecodepart.md#executablecodepartfunctioncall) | never | (Public Preview) | +| [functionResponse](./ai.executablecodepart.md#executablecodepartfunctionresponse) | never | (Public Preview) | +| [inlineData](./ai.executablecodepart.md#executablecodepartinlinedata) | never | (Public Preview) | +| [text](./ai.executablecodepart.md#executablecodeparttext) | never | (Public Preview) | +| [thought](./ai.executablecodepart.md#executablecodepartthought) | never | (Public Preview) | ## ExecutableCodePart.codeExecutionResult +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -41,6 +47,9 @@ codeExecutionResult?: never; ## ExecutableCodePart.executableCode +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -49,6 +58,9 @@ executableCode?: ExecutableCode; ## ExecutableCodePart.fileData +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -57,6 +69,9 @@ fileData: never; ## ExecutableCodePart.functionCall +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -65,6 +80,9 @@ functionCall?: never; ## ExecutableCodePart.functionResponse +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -73,6 +91,9 @@ functionResponse?: never; ## ExecutableCodePart.inlineData +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -81,6 +102,9 @@ inlineData?: never; ## ExecutableCodePart.text +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript @@ -89,6 +113,9 @@ text?: never; ## ExecutableCodePart.thought +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Signature: ```typescript diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index b2e793e6120..c6e8fa365f7 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -60,9 +60,9 @@ The Firebase AI Web SDK. | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (Public Preview) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. | | [Citation](./ai.citation.md#citation_interface) | A single citation. | | [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | The results of code execution run by the model. | -| [CodeExecutionResultPart](./ai.codeexecutionresultpart.md#codeexecutionresultpart_interface) | Represents the code execution result from the model. | -| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | A tool that enables the model to use code execution. | +| [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | (Public Preview) The results of code execution run by the model. | +| [CodeExecutionResultPart](./ai.codeexecutionresultpart.md#codeexecutionresultpart_interface) | (Public Preview) Represents the code execution result from the model. | +| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | (Public Preview) A tool that enables the model to use code execution. | | [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. | | [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) | | [CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens). | @@ -70,8 +70,8 @@ The Firebase AI Web SDK. | [Date\_2](./ai.date_2.md#date_2_interface) | Protobuf google.type.Date | | [EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | | [ErrorDetails](./ai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [ExecutableCode](./ai.executablecode.md#executablecode_interface) | An interface for executable code returned by the model. | -| [ExecutableCodePart](./ai.executablecodepart.md#executablecodepart_interface) | Represents the code that is executed by the model. | +| [ExecutableCode](./ai.executablecode.md#executablecode_interface) | (Public Preview) An interface for executable code returned by the model. | +| [ExecutableCodePart](./ai.executablecodepart.md#executablecodepart_interface) | (Public Preview) Represents the code that is executed by the model. | | [FileData](./ai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | | [FileDataPart](./ai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./ai.filedata.md#filedata_interface) | | [FunctionCall](./ai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./ai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | @@ -162,10 +162,10 @@ The Firebase AI Web SDK. | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | -| [Language](./ai.md#language) | The programming language of the code. | +| [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | | [Modality](./ai.md#modality) | Content part modality. | -| [Outcome](./ai.md#outcome) | Represents the result of the code execution. | +| [Outcome](./ai.md#outcome) | (Public Preview) Represents the result of the code execution. | | [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | @@ -189,13 +189,13 @@ The Firebase AI Web SDK. | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | -| [Language](./ai.md#language) | The programming language of the code. | +| [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) Content formats that can be provided as on-device message content. | | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (Public Preview) Allowable roles for on-device language model usage. | | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) Allowable types for on-device language model messages. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. | | [Modality](./ai.md#modality) | Content part modality. | -| [Outcome](./ai.md#outcome) | Represents the result of the code execution. | +| [Outcome](./ai.md#outcome) | (Public Preview) Represents the result of the code execution. | | [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. | | [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. | | [Role](./ai.md#role) | Role is the producer of the content. | @@ -657,6 +657,9 @@ InferenceMode: { ## Language +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The programming language of the code. Signature: @@ -704,6 +707,9 @@ Modality: { ## Outcome +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Represents the result of the code execution. Signature: @@ -943,6 +949,9 @@ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; ## Language +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + The programming language of the code. Signature: @@ -1015,6 +1024,9 @@ export type Modality = (typeof Modality)[keyof typeof Modality]; ## Outcome +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + Represents the result of the code execution. Signature: diff --git a/packages/ai/src/types/content.ts b/packages/ai/src/types/content.ts index b51dcd9c69f..401a8cfb1a8 100644 --- a/packages/ai/src/types/content.ts +++ b/packages/ai/src/types/content.ts @@ -155,7 +155,7 @@ export interface FileDataPart { /** * Represents the code that is executed by the model. * - * @public + * @beta */ export interface ExecutableCodePart { text?: never; @@ -175,7 +175,7 @@ export interface ExecutableCodePart { /** * Represents the code execution result from the model. * - * @public + * @beta */ export interface CodeExecutionResultPart { text?: never; @@ -195,7 +195,7 @@ export interface CodeExecutionResultPart { /** * An interface for executable code returned by the model. * - * @public + * @beta */ export interface ExecutableCode { /** @@ -211,7 +211,7 @@ export interface ExecutableCode { /** * The results of code execution run by the model. * - * @public + * @beta */ export interface CodeExecutionResult { /** diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 997df1265b0..cd7029df3b0 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -382,7 +382,7 @@ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode]; /** * Represents the result of the code execution. * - * @public + * @beta */ export const Outcome = { UNSPECIFIED: 'OUTCOME_UNSPECIFIED', @@ -394,14 +394,14 @@ export const Outcome = { /** * Represents the result of the code execution. * - * @public + * @beta */ export type Outcome = (typeof Outcome)[keyof typeof Outcome]; /** * The programming language of the code. * - * @public + * @beta */ export const Language = { UNSPECIFIED: 'LANGUAGE_UNSPECIFIED', @@ -411,6 +411,6 @@ export const Language = { /** * The programming language of the code. * - * @public + * @beta */ export type Language = (typeof Language)[keyof typeof Language]; diff --git a/packages/ai/src/types/requests.ts b/packages/ai/src/types/requests.ts index 359be9c32c9..1e5fa367420 100644 --- a/packages/ai/src/types/requests.ts +++ b/packages/ai/src/types/requests.ts @@ -301,7 +301,7 @@ export interface GoogleSearchTool { /** * A tool that enables the model to use code execution. * - * @public + * @beta */ export interface CodeExecutionTool { /** From ea8512812b994e5de081cb55a951b627fa0183b3 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 29 Sep 2025 10:44:30 -0700 Subject: [PATCH 284/295] fix(ai): Handle empty parts when streaming (#9262) --- .changeset/poor-cobras-dream.md | 5 ++ packages/ai/src/googleai-mappers.ts | 2 +- .../ai/src/methods/generate-content.test.ts | 16 +++++++ .../ai/src/requests/stream-reader.test.ts | 14 ++++++ packages/ai/src/requests/stream-reader.ts | 46 ++++++++++--------- 5 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 .changeset/poor-cobras-dream.md diff --git a/.changeset/poor-cobras-dream.md b/.changeset/poor-cobras-dream.md new file mode 100644 index 00000000000..3ff9e7bc7bd --- /dev/null +++ b/.changeset/poor-cobras-dream.md @@ -0,0 +1,5 @@ +--- +'@firebase/ai': patch +--- + +Updated SDK to handle empty parts when streaming. diff --git a/packages/ai/src/googleai-mappers.ts b/packages/ai/src/googleai-mappers.ts index b3e4206f33c..c6656c8318d 100644 --- a/packages/ai/src/googleai-mappers.ts +++ b/packages/ai/src/googleai-mappers.ts @@ -176,7 +176,7 @@ export function mapGenerateContentCandidates( // Throw early since developers may send a long video as input and only expect to pay // for inference on a small portion of the video. if ( - candidate.content?.parts.some( + candidate.content?.parts?.some( part => (part as InlineDataPart)?.videoMetadata ) ) { diff --git a/packages/ai/src/methods/generate-content.test.ts b/packages/ai/src/methods/generate-content.test.ts index f75c87e4dd9..40dc7c7b36e 100644 --- a/packages/ai/src/methods/generate-content.test.ts +++ b/packages/ai/src/methods/generate-content.test.ts @@ -386,6 +386,22 @@ describe('generateContent()', () => { match.any ); }); + it('empty part', async () => { + const mockResponse = getMockResponse( + 'vertexAI', + 'unary-success-empty-part.json' + ); + stub(request, 'makeRequest').resolves(mockResponse as Response); + const result = await generateContent( + fakeApiSettings, + 'model', + fakeRequestParams + ); + expect(result.response.text()).to.include( + 'I can certainly help you with that!' + ); + expect(result.response.inlineDataParts()?.length).to.equal(1); + }); it('unknown enum - should ignore', async () => { const mockResponse = getMockResponse( 'vertexAI', diff --git a/packages/ai/src/requests/stream-reader.test.ts b/packages/ai/src/requests/stream-reader.test.ts index f0298082f68..2e50bbb3d3e 100644 --- a/packages/ai/src/requests/stream-reader.test.ts +++ b/packages/ai/src/requests/stream-reader.test.ts @@ -194,6 +194,20 @@ describe('processStream', () => { expect(response.text()).to.equal(''); } }); + it('handles empty parts', async () => { + const fakeResponse = getMockResponseStreaming( + 'googleAI', + 'streaming-success-empty-parts.txt' + ); + + const result = processStream(fakeResponse as Response, fakeApiSettings); + for await (const response of result.stream) { + expect(response.candidates?.[0].content.parts.length).to.be.at.least(1); + } + + const aggregatedResponse = await result.response; + expect(aggregatedResponse.candidates?.[0].content.parts.length).to.equal(6); + }); it('unknown enum - should ignore', async () => { const fakeResponse = getMockResponseStreaming( 'vertexAI', diff --git a/packages/ai/src/requests/stream-reader.ts b/packages/ai/src/requests/stream-reader.ts index 3b205efabf2..042c052fa82 100644 --- a/packages/ai/src/requests/stream-reader.ts +++ b/packages/ai/src/requests/stream-reader.ts @@ -100,6 +100,17 @@ async function* generateResponseSequence( enhancedResponse = createEnhancedContentResponse(value); } + const firstCandidate = enhancedResponse.candidates?.[0]; + // Don't yield a response with no useful data for the developer. + if ( + !firstCandidate?.content?.parts && + !firstCandidate?.finishReason && + !firstCandidate?.citationMetadata && + !firstCandidate?.urlContextMetadata + ) { + continue; + } + yield enhancedResponse; } } @@ -211,37 +222,30 @@ export function aggregateResponses( * Candidates should always have content and parts, but this handles * possible malformed responses. */ - if (candidate.content && candidate.content.parts) { + if (candidate.content) { + // Skip a candidate without parts. + if (!candidate.content.parts) { + continue; + } if (!aggregatedResponse.candidates[i].content) { aggregatedResponse.candidates[i].content = { role: candidate.content.role || 'user', parts: [] }; } - const newPart: Partial = {}; for (const part of candidate.content.parts) { - if (part.text !== undefined) { - // The backend can send empty text parts. If these are sent back - // (e.g. in chat history), the backend will respond with an error. - // To prevent this, ignore empty text parts. - if (part.text === '') { - continue; - } - newPart.text = part.text; - } - if (part.functionCall) { - newPart.functionCall = part.functionCall; + const newPart: Part = { ...part }; + // The backend can send empty text parts. If these are sent back + // (e.g. in chat history), the backend will respond with an error. + // To prevent this, ignore empty text parts. + if (part.text === '') { + continue; } - if (Object.keys(newPart).length === 0) { - throw new AIError( - AIErrorCode.INVALID_CONTENT, - 'Part should have at least one property, but there are none. This is likely caused ' + - 'by a malformed response from the backend.' + if (Object.keys(newPart).length > 0) { + aggregatedResponse.candidates[i].content.parts.push( + newPart as Part ); } - aggregatedResponse.candidates[i].content.parts.push( - newPart as Part - ); } } } From 0bb2fe636c456628feabd10387673f4980c7ba9e Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Mon, 29 Sep 2025 14:03:05 -0400 Subject: [PATCH 285/295] feat(ai): Add method to send function responses in a live session (#9272) --- .changeset/lazy-donuts-agree.md | 9 ++++++ common/api-review/ai.api.md | 3 +- docs-devsite/ai.livesession.md | 28 +++++++++++++++++ .../ai.startaudioconversationoptions.md | 4 +-- .../src/methods/live-session-helpers.test.ts | 24 ++++++++++----- .../ai/src/methods/live-session-helpers.ts | 14 ++++----- packages/ai/src/methods/live-session.test.ts | 30 +++++++++++++++++++ packages/ai/src/methods/live-session.ts | 30 ++++++++++++++++++- packages/ai/src/types/live-responses.ts | 18 ++++++++++- 9 files changed, 141 insertions(+), 19 deletions(-) create mode 100644 .changeset/lazy-donuts-agree.md diff --git a/.changeset/lazy-donuts-agree.md b/.changeset/lazy-donuts-agree.md new file mode 100644 index 00000000000..f2baca4dcab --- /dev/null +++ b/.changeset/lazy-donuts-agree.md @@ -0,0 +1,9 @@ +--- +'firebase': minor +'@firebase/ai': minor +--- + +Added a `sendFunctionResponses` method to `LiveSession`, allowing function responses to be sent during realtime sessions. +Fixed an issue where function responses during audio conversations caused the WebSocket connection to close. See [GitHub Issue #9264](https://github.com/firebase/firebase-js-sdk/issues/9264). + - **Breaking Change**: Changed the `functionCallingHandler` property in `StartAudioConversationOptions` so that it now must return a `Promise`. + This breaking change is allowed in a minor release since the Live API is in Public Preview. diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index cf02485b222..d3c43d906fd 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -994,6 +994,7 @@ export class LiveSession { isClosed: boolean; receive(): AsyncGenerator; send(request: string | Array, turnComplete?: boolean): Promise; + sendFunctionResponses(functionResponses: FunctionResponse[]): Promise; sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise; sendMediaStream(mediaChunkStream: ReadableStream): Promise; } @@ -1263,7 +1264,7 @@ export function startAudioConversation(liveSession: LiveSession, options?: Start // @beta export interface StartAudioConversationOptions { - functionCallingHandler?: (functionCalls: LiveServerToolCall['functionCalls']) => Promise; + functionCallingHandler?: (functionCalls: FunctionCall[]) => Promise; } // @public diff --git a/docs-devsite/ai.livesession.md b/docs-devsite/ai.livesession.md index 6ae2cde711c..558c5eb3bd6 100644 --- a/docs-devsite/ai.livesession.md +++ b/docs-devsite/ai.livesession.md @@ -39,6 +39,7 @@ export declare class LiveSession | [close()](./ai.livesession.md#livesessionclose) | | (Public Preview) Closes this session. All methods on this session will throw an error once this resolves. | | [receive()](./ai.livesession.md#livesessionreceive) | | (Public Preview) Yields messages received from the server. This can only be used by one consumer at a time. | | [send(request, turnComplete)](./ai.livesession.md#livesessionsend) | | (Public Preview) Sends content to the server. | +| [sendFunctionResponses(functionResponses)](./ai.livesession.md#livesessionsendfunctionresponses) | | (Public Preview) Sends function responses to the server. | | [sendMediaChunks(mediaChunks)](./ai.livesession.md#livesessionsendmediachunks) | | (Public Preview) Sends realtime input to the server. | | [sendMediaStream(mediaChunkStream)](./ai.livesession.md#livesessionsendmediastream) | | (Public Preview) Sends a stream of [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface). | @@ -134,6 +135,33 @@ Promise<void> If this session has been closed. +## LiveSession.sendFunctionResponses() + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Sends function responses to the server. + +Signature: + +```typescript +sendFunctionResponses(functionResponses: FunctionResponse[]): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| functionResponses | [FunctionResponse](./ai.functionresponse.md#functionresponse_interface)\[\] | The function responses to send. | + +Returns: + +Promise<void> + +#### Exceptions + +If this session has been closed. + ## LiveSession.sendMediaChunks() > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. diff --git a/docs-devsite/ai.startaudioconversationoptions.md b/docs-devsite/ai.startaudioconversationoptions.md index 08e91d2c7b5..827cc0b129b 100644 --- a/docs-devsite/ai.startaudioconversationoptions.md +++ b/docs-devsite/ai.startaudioconversationoptions.md @@ -25,7 +25,7 @@ export interface StartAudioConversationOptions | Property | Type | Description | | --- | --- | --- | -| [functionCallingHandler](./ai.startaudioconversationoptions.md#startaudioconversationoptionsfunctioncallinghandler) | (functionCalls: [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface)\['functionCalls'\]) => Promise<[Part](./ai.md#part)> | (Public Preview) An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a Part, which will then be sent back to the model. | +| [functionCallingHandler](./ai.startaudioconversationoptions.md#startaudioconversationoptionsfunctioncallinghandler) | (functionCalls: [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\]) => Promise<[FunctionResponse](./ai.functionresponse.md#functionresponse_interface)> | (Public Preview) An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a Part, which will then be sent back to the model. | ## StartAudioConversationOptions.functionCallingHandler @@ -37,5 +37,5 @@ An async handler that is called when the model requests a function to be execute Signature: ```typescript -functionCallingHandler?: (functionCalls: LiveServerToolCall['functionCalls']) => Promise; +functionCallingHandler?: (functionCalls: FunctionCall[]) => Promise; ``` diff --git a/packages/ai/src/methods/live-session-helpers.test.ts b/packages/ai/src/methods/live-session-helpers.test.ts index d7d1e2aabbf..cad0475b358 100644 --- a/packages/ai/src/methods/live-session-helpers.test.ts +++ b/packages/ai/src/methods/live-session-helpers.test.ts @@ -21,7 +21,11 @@ import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import { AIError } from '../errors'; import { startAudioConversation } from './live-session-helpers'; -import { LiveServerContent, LiveServerToolCall, Part } from '../types'; +import { + FunctionResponse, + LiveServerContent, + LiveServerToolCall +} from '../types'; import { logger } from '../logger'; import { isNode } from '@firebase/util'; @@ -62,6 +66,7 @@ class MockLiveSession { inConversation = false; send = sinon.stub(); sendMediaChunks = sinon.stub(); + sendFunctionResponses = sinon.stub(); messageGenerator = new MockMessageGenerator(); receive = (): MockMessageGenerator => this.messageGenerator; } @@ -249,16 +254,21 @@ describe('Audio Conversation Helpers', () => { }); it('should call function handler and send result on toolCall message.', async () => { - const handlerStub = sinon.stub().resolves({ - functionResponse: { name: 'get_weather', response: { temp: '72F' } } - } as Part); + const functionResponse: FunctionResponse = { + id: '1', + name: 'get_weather', + response: { temp: '72F' } + }; + const handlerStub = sinon.stub().resolves(functionResponse); const controller = await startAudioConversation(liveSession as any, { functionCallingHandler: handlerStub }); const toolCallMessage: LiveServerToolCall = { type: 'toolCall', - functionCalls: [{ name: 'get_weather', args: { location: 'LA' } }] + functionCalls: [ + { id: '1', name: 'get_weather', args: { location: 'LA' } } + ] }; liveSession.messageGenerator.simulateMessage(toolCallMessage); @@ -267,8 +277,8 @@ describe('Audio Conversation Helpers', () => { expect(handlerStub).to.have.been.calledOnceWith( toolCallMessage.functionCalls ); - expect(liveSession.send).to.have.been.calledOnceWith([ - { functionResponse: { name: 'get_weather', response: { temp: '72F' } } } + expect(liveSession.sendFunctionResponses).to.have.been.calledOnceWith([ + functionResponse ]); await controller.stop(); }); diff --git a/packages/ai/src/methods/live-session-helpers.ts b/packages/ai/src/methods/live-session-helpers.ts index e52715de36e..b3907d6219b 100644 --- a/packages/ai/src/methods/live-session-helpers.ts +++ b/packages/ai/src/methods/live-session-helpers.ts @@ -19,10 +19,10 @@ import { AIError } from '../errors'; import { logger } from '../logger'; import { AIErrorCode, + FunctionCall, + FunctionResponse, GenerativeContentBlob, - LiveServerContent, - LiveServerToolCall, - Part + LiveServerContent } from '../types'; import { LiveSession } from './live-session'; import { Deferred } from '@firebase/util'; @@ -115,8 +115,8 @@ export interface StartAudioConversationOptions { * which will then be sent back to the model. */ functionCallingHandler?: ( - functionCalls: LiveServerToolCall['functionCalls'] - ) => Promise; + functionCalls: FunctionCall[] + ) => Promise; } /** @@ -338,11 +338,11 @@ export class AudioConversationRunner { ); } else { try { - const resultPart = await this.options.functionCallingHandler( + const functionResponse = await this.options.functionCallingHandler( message.functionCalls ); if (!this.isStopped) { - void this.liveSession.send([resultPart]); + void this.liveSession.sendFunctionResponses([functionResponse]); } } catch (e) { throw new AIError( diff --git a/packages/ai/src/methods/live-session.test.ts b/packages/ai/src/methods/live-session.test.ts index 7db9daaebe6..7454b1208c9 100644 --- a/packages/ai/src/methods/live-session.test.ts +++ b/packages/ai/src/methods/live-session.test.ts @@ -20,6 +20,7 @@ import { spy, stub } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import { + FunctionResponse, LiveResponseType, LiveServerContent, LiveServerToolCall, @@ -153,6 +154,35 @@ describe('LiveSession', () => { }); }); + describe('sendFunctionResponses()', () => { + it('should send all function responses', async () => { + const functionResponses: FunctionResponse[] = [ + { + id: 'function-call-1', + name: 'function-name', + response: { + result: 'foo' + } + }, + { + id: 'function-call-2', + name: 'function-name-2', + response: { + result: 'bar' + } + } + ]; + await session.sendFunctionResponses(functionResponses); + expect(mockHandler.send).to.have.been.calledOnce; + const sentData = JSON.parse(mockHandler.send.getCall(0).args[0]); + expect(sentData).to.deep.equal({ + toolResponse: { + functionResponses + } + }); + }); + }); + describe('receive()', () => { it('should correctly parse and transform all server message types', async () => { const receivePromise = (async () => { diff --git a/packages/ai/src/methods/live-session.ts b/packages/ai/src/methods/live-session.ts index 11e5346adc0..92d325e2f0d 100644 --- a/packages/ai/src/methods/live-session.ts +++ b/packages/ai/src/methods/live-session.ts @@ -17,6 +17,7 @@ import { AIErrorCode, + FunctionResponse, GenerativeContentBlob, LiveResponseType, LiveServerContent, @@ -30,7 +31,8 @@ import { WebSocketHandler } from '../websocket'; import { logger } from '../logger'; import { _LiveClientContent, - _LiveClientRealtimeInput + _LiveClientRealtimeInput, + _LiveClientToolResponse } from '../types/live-responses'; /** @@ -119,6 +121,32 @@ export class LiveSession { }); } + /** + * Sends function responses to the server. + * + * @param functionResponses - The function responses to send. + * @throws If this session has been closed. + * + * @beta + */ + async sendFunctionResponses( + functionResponses: FunctionResponse[] + ): Promise { + if (this.isClosed) { + throw new AIError( + AIErrorCode.REQUEST_ERROR, + 'This LiveSession has been closed and cannot be used.' + ); + } + + const message: _LiveClientToolResponse = { + toolResponse: { + functionResponses + } + }; + this.webSocketHandler.send(JSON.stringify(message)); + } + /** * Sends a stream of {@link GenerativeContentBlob}. * diff --git a/packages/ai/src/types/live-responses.ts b/packages/ai/src/types/live-responses.ts index 66170f1a5ab..d1870fa109f 100644 --- a/packages/ai/src/types/live-responses.ts +++ b/packages/ai/src/types/live-responses.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { Content, GenerativeContentBlob, Part } from './content'; +import { + Content, + FunctionResponse, + GenerativeContentBlob, + Part +} from './content'; import { LiveGenerationConfig, Tool, ToolConfig } from './requests'; /** @@ -42,6 +47,17 @@ export interface _LiveClientRealtimeInput { mediaChunks: GenerativeContentBlob[]; }; } + +/** + * Function responses that are sent to the model in real time. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface _LiveClientToolResponse { + toolResponse: { + functionResponses: FunctionResponse[]; + }; +} + /** * The first message in a Live session, used to configure generation options. * From ccbf7ba36fa9b10c100296489f8be265c8f83e41 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 29 Sep 2025 11:53:23 -0700 Subject: [PATCH 286/295] Update ai model name used for e2e tests (#9282) --- e2e/smoke-tests/sample-apps/modular.js | 2 +- e2e/smoke-tests/tests/modular.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/smoke-tests/sample-apps/modular.js b/e2e/smoke-tests/sample-apps/modular.js index 2d66b752081..20ff0ce7bd2 100644 --- a/e2e/smoke-tests/sample-apps/modular.js +++ b/e2e/smoke-tests/sample-apps/modular.js @@ -313,7 +313,7 @@ function callPerformance(app) { async function callAI(app) { console.log('[AI] start'); const ai = getAI(app, { backend: new VertexAIBackend() }); - const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' }); + const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' }); const result = await model.countTokens('abcdefg'); console.log(`[AI] counted tokens: ${result.totalTokens}`); } diff --git a/e2e/smoke-tests/tests/modular.test.ts b/e2e/smoke-tests/tests/modular.test.ts index c8f6afe779d..536a271ca5e 100644 --- a/e2e/smoke-tests/tests/modular.test.ts +++ b/e2e/smoke-tests/tests/modular.test.ts @@ -314,8 +314,8 @@ describe('MODULAR', () => { ai = getAI(app, { backend: new VertexAIBackend() }); }); it('getGenerativeModel() and countTokens()', async () => { - const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' }); - expect(model.model).toMatch(/gemini-1.5-flash$/); + const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' }); + expect(model.model).toMatch(/gemini-2.5-flash$/); const result = await model.countTokens('abcdefg'); expect(result.totalTokens).toBeTruthy; }); From 2596dd1b5072298da8814844a312681174fc2dca Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 7 Oct 2025 09:39:49 -0400 Subject: [PATCH 287/295] docs(ai): promote gemini developer api and imagen to GA (#9255) --- .changeset/hungry-tables-exercise.md | 6 +++ .changeset/loud-tigers-compare.md | 6 +++ common/api-review/ai.api.md | 30 +++++------ docs-devsite/ai.imagengcsimage.md | 13 +---- docs-devsite/ai.imagengenerationconfig.md | 28 ++-------- docs-devsite/ai.imagengenerationresponse.md | 13 +---- docs-devsite/ai.imagenimageformat.md | 23 ++------- docs-devsite/ai.imageninlineimage.md | 13 +---- docs-devsite/ai.imagenmodel.md | 28 ++-------- docs-devsite/ai.imagenmodelparams.md | 18 ++----- docs-devsite/ai.imagensafetysettings.md | 13 +---- docs-devsite/ai.md | 51 ++++++------------- packages/ai/src/api.ts | 2 +- packages/ai/src/models/imagen-model.ts | 4 +- .../ai/src/requests/imagen-image-format.ts | 6 +-- packages/ai/src/types/imagen/requests.ts | 18 +++---- packages/ai/src/types/imagen/responses.ts | 6 +-- 17 files changed, 85 insertions(+), 193 deletions(-) create mode 100644 .changeset/hungry-tables-exercise.md create mode 100644 .changeset/loud-tigers-compare.md diff --git a/.changeset/hungry-tables-exercise.md b/.changeset/hungry-tables-exercise.md new file mode 100644 index 00000000000..81f326b4f4a --- /dev/null +++ b/.changeset/hungry-tables-exercise.md @@ -0,0 +1,6 @@ +--- +'firebase': patch +'@firebase/ai': patch +--- + +Imagen Generation is now Generally Available (GA). diff --git a/.changeset/loud-tigers-compare.md b/.changeset/loud-tigers-compare.md new file mode 100644 index 00000000000..cd4e5412311 --- /dev/null +++ b/.changeset/loud-tigers-compare.md @@ -0,0 +1,6 @@ +--- +'firebase': patch +'@firebase/ai': patch +--- + +The Gemini Developer API is now Generally Available (GA). diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d3c43d906fd..debea0a8549 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -553,7 +553,7 @@ export function getAI(app?: FirebaseApp, options?: AIOptions): AI; // @public export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel; -// @beta +// @public export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; // @beta @@ -712,7 +712,7 @@ export interface HybridParams { onDeviceParams?: OnDeviceParams; } -// @beta +// @public export const ImagenAspectRatio: { readonly SQUARE: "1:1"; readonly LANDSCAPE_3x4: "3:4"; @@ -721,16 +721,16 @@ export const ImagenAspectRatio: { readonly PORTRAIT_9x16: "9:16"; }; -// @beta +// @public export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; -// @beta +// @public export interface ImagenGCSImage { gcsURI: string; mimeType: string; } -// @beta +// @public export interface ImagenGenerationConfig { addWatermark?: boolean; aspectRatio?: ImagenAspectRatio; @@ -739,13 +739,13 @@ export interface ImagenGenerationConfig { numberOfImages?: number; } -// @beta +// @public export interface ImagenGenerationResponse { filteredReason?: string; images: T[]; } -// @beta +// @public export class ImagenImageFormat { compressionQuality?: number; static jpeg(compressionQuality?: number): ImagenImageFormat; @@ -753,13 +753,13 @@ export class ImagenImageFormat { static png(): ImagenImageFormat; } -// @beta +// @public export interface ImagenInlineImage { bytesBase64Encoded: string; mimeType: string; } -// @beta +// @public export class ImagenModel extends AIModel { constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); generateImages(prompt: string): Promise>; @@ -771,24 +771,24 @@ export class ImagenModel extends AIModel { safetySettings?: ImagenSafetySettings; } -// @beta +// @public export interface ImagenModelParams { generationConfig?: ImagenGenerationConfig; model: string; safetySettings?: ImagenSafetySettings; } -// @beta +// @public export const ImagenPersonFilterLevel: { readonly BLOCK_ALL: "dont_allow"; readonly ALLOW_ADULT: "allow_adult"; readonly ALLOW_ALL: "allow_all"; }; -// @beta +// @public export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; -// @beta +// @public export const ImagenSafetyFilterLevel: { readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above"; readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above"; @@ -796,10 +796,10 @@ export const ImagenSafetyFilterLevel: { readonly BLOCK_NONE: "block_none"; }; -// @beta +// @public export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; -// @beta +// @public export interface ImagenSafetySettings { personFilterLevel?: ImagenPersonFilterLevel; safetyFilterLevel?: ImagenSafetyFilterLevel; diff --git a/docs-devsite/ai.imagengcsimage.md b/docs-devsite/ai.imagengcsimage.md index ec51c714e0f..cd11d8ee354 100644 --- a/docs-devsite/ai.imagengcsimage.md +++ b/docs-devsite/ai.imagengcsimage.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGCSImage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. This feature is not available yet. @@ -27,14 +24,11 @@ export interface ImagenGCSImage | Property | Type | Description | | --- | --- | --- | -| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | (Public Preview) The URI of the file stored in a Cloud Storage for Firebase bucket. | -| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | +| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenGCSImage.gcsURI -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The URI of the file stored in a Cloud Storage for Firebase bucket. Signature: @@ -49,9 +43,6 @@ gcsURI: string; ## ImagenGCSImage.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type of the image; either `"image/png"` or `"image/jpeg"`. To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). diff --git a/docs-devsite/ai.imagengenerationconfig.md b/docs-devsite/ai.imagengenerationconfig.md index d4f32a7e5a3..55579045777 100644 --- a/docs-devsite/ai.imagengenerationconfig.md +++ b/docs-devsite/ai.imagengenerationconfig.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGenerationConfig interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Configuration options for generating images with Imagen. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. @@ -27,17 +24,14 @@ export interface ImagenGenerationConfig | Property | Type | Description | | --- | --- | --- | -| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | -| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. | -| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. | -| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | -| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | +| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | +| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. | +| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. | +| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | +| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | ## ImagenGenerationConfig.addWatermark -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Whether to add an invisible watermark to generated images. If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to `false`, watermarking will be disabled. @@ -54,9 +48,6 @@ addWatermark?: boolean; ## ImagenGenerationConfig.aspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. Signature: @@ -67,9 +58,6 @@ aspectRatio?: ImagenAspectRatio; ## ImagenGenerationConfig.imageFormat -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The image format of the generated images. The default is PNG. See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. @@ -82,9 +70,6 @@ imageFormat?: ImagenImageFormat; ## ImagenGenerationConfig.negativePrompt -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A description of what should be omitted from the generated images. Support for negative prompts depends on the Imagen model. @@ -101,9 +86,6 @@ negativePrompt?: string; ## ImagenGenerationConfig.numberOfImages -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The number of images to generate. The default value is 1. The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. diff --git a/docs-devsite/ai.imagengenerationresponse.md b/docs-devsite/ai.imagengenerationresponse.md index 54b0ac9b1a9..033c966f099 100644 --- a/docs-devsite/ai.imagengenerationresponse.md +++ b/docs-devsite/ai.imagengenerationresponse.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGenerationResponse interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The response from a request to generate images with Imagen. Signature: @@ -25,14 +22,11 @@ export interface ImagenGenerationResponse(Public Preview) The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | -| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | +| [filteredReason](./ai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | +| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | ## ImagenGenerationResponse.filteredReason -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The reason that images were filtered out. This property will only be defined if one or more images were filtered. Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface). @@ -47,9 +41,6 @@ filteredReason?: string; ## ImagenGenerationResponse.images -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The images generated by Imagen. The number of images generated may be fewer than the number requested if one or more were filtered out; see `filteredReason`. diff --git a/docs-devsite/ai.imagenimageformat.md b/docs-devsite/ai.imagenimageformat.md index bd0bdf1baa7..df22d8266f7 100644 --- a/docs-devsite/ai.imagenimageformat.md +++ b/docs-devsite/ai.imagenimageformat.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenImageFormat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Defines the image format for images generated by Imagen. Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). @@ -27,21 +24,18 @@ export declare class ImagenImageFormat | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). | -| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. | +| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | The level of compression (a number between 0 and 100). | +| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | The MIME type. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | -| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | +| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static | Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | +| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static | Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | ## ImagenImageFormat.compressionQuality -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The level of compression (a number between 0 and 100). Signature: @@ -52,9 +46,6 @@ compressionQuality?: number; ## ImagenImageFormat.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type. Signature: @@ -65,9 +56,6 @@ mimeType: string; ## ImagenImageFormat.jpeg() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. Signature: @@ -90,9 +78,6 @@ An [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) object ## ImagenImageFormat.png() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. Signature: diff --git a/docs-devsite/ai.imageninlineimage.md b/docs-devsite/ai.imageninlineimage.md index 4bb81cac55d..b2b541e301f 100644 --- a/docs-devsite/ai.imageninlineimage.md +++ b/docs-devsite/ai.imageninlineimage.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenInlineImage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - An image generated by Imagen, represented as inline data. Signature: @@ -25,14 +22,11 @@ export interface ImagenInlineImage | Property | Type | Description | | --- | --- | --- | -| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | -| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | The base64-encoded image data. | +| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenInlineImage.bytesBase64Encoded -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The base64-encoded image data. Signature: @@ -43,9 +37,6 @@ bytesBase64Encoded: string; ## ImagenInlineImage.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type of the image; either `"image/png"` or `"image/jpeg"`. To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). diff --git a/docs-devsite/ai.imagenmodel.md b/docs-devsite/ai.imagenmodel.md index 911971e0988..68375972cbb 100644 --- a/docs-devsite/ai.imagenmodel.md +++ b/docs-devsite/ai.imagenmodel.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenModel class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Class for Imagen model APIs. This class provides methods for generating images using the Imagen model. @@ -28,27 +25,24 @@ export declare class ImagenModel extends AIModel | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. | +| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. | -| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) | -| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. | +| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | The Imagen generation configuration. | +| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | | +| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering inappropriate content. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. | +| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. | ## ImagenModel.(constructor) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. Signature: @@ -71,9 +65,6 @@ If the `apiKey` or `projectId` fields are missing in your Firebase config. ## ImagenModel.generationConfig -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The Imagen generation configuration. Signature: @@ -84,9 +75,6 @@ generationConfig?: ImagenGenerationConfig; ## ImagenModel.requestOptions -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Signature: ```typescript @@ -95,9 +83,6 @@ requestOptions?: RequestOptions | undefined; ## ImagenModel.safetySettings -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Safety settings for filtering inappropriate content. Signature: @@ -108,9 +93,6 @@ safetySettings?: ImagenSafetySettings; ## ImagenModel.generateImages() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Generates images using the Imagen model and returns them as base64-encoded strings. If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty. diff --git a/docs-devsite/ai.imagenmodelparams.md b/docs-devsite/ai.imagenmodelparams.md index a63345b64e6..6d7566bc4d5 100644 --- a/docs-devsite/ai.imagenmodelparams.md +++ b/docs-devsite/ai.imagenmodelparams.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenModelParams interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). Signature: @@ -25,15 +22,12 @@ export interface ImagenModelParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. | -| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | -| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. | +| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen. | +| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | +| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering potentially inappropriate content. | ## ImagenModelParams.generationConfig -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Configuration options for generating images with Imagen. Signature: @@ -44,9 +38,6 @@ generationConfig?: ImagenGenerationConfig; ## ImagenModelParams.model -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The Imagen model to use for generating images. For example: `imagen-3.0-generate-002`. Only Imagen 3 models (named `imagen-3.0-*`) are supported. @@ -61,9 +52,6 @@ model: string; ## ImagenModelParams.safetySettings -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Safety settings for filtering potentially inappropriate content. Signature: diff --git a/docs-devsite/ai.imagensafetysettings.md b/docs-devsite/ai.imagensafetysettings.md index 366e615d243..bc71f116d48 100644 --- a/docs-devsite/ai.imagensafetysettings.md +++ b/docs-devsite/ai.imagensafetysettings.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenSafetySettings interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Settings for controlling the aggressiveness of filtering out sensitive content. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. @@ -27,14 +24,11 @@ export interface ImagenSafetySettings | Property | Type | Description | | --- | --- | --- | -| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. | -| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. | +| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed. | +| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressive to filter out sensitive content from generated images. | ## ImagenSafetySettings.personFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. Signature: @@ -45,9 +39,6 @@ personFilterLevel?: ImagenPersonFilterLevel; ## ImagenSafetySettings.safetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressive to filter out sensitive content from generated images. Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index c6e8fa365f7..db6148ee88c 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -20,7 +20,7 @@ The Firebase AI Web SDK. | [getAI(app, options)](./ai.md#getai_a94a413) | Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | | function(ai, ...) | | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | -| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | | [getLiveGenerativeModel(ai, modelParams)](./ai.md#getlivegenerativemodel_f2099ac) | (Public Preview) Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.The Live API is only supported in modern browser windows and Node >= 22. | | function(liveSession, ...) | | [startAudioConversation(liveSession, options)](./ai.md#startaudioconversation_01c8e7f) | (Public Preview) Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. | @@ -38,8 +38,8 @@ The Firebase AI Web SDK. | [ChatSession](./ai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | | [GenerativeModel](./ai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | | [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Gemini Developer API as the backend. | -| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | -| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | +| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | +| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./ai.integerschema.md#integerschema_class) | Schema class for "integer" types. | | [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) | (Public Preview) Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). | | [LiveSession](./ai.livesession.md#livesession_class) | (Public Preview) Represents an active, real-time, bidirectional conversation with the model.This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect). | @@ -94,12 +94,12 @@ The Firebase AI Web SDK. | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | | [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (Public Preview) Configures hybrid inference. | -| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | (Public Preview) An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | -| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | -| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | -| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | -| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | -| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | +| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | +| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | +| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | The response from a request to generate images with Imagen. | +| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | An image generated by Imagen, represented as inline data. | +| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | +| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | @@ -158,9 +158,9 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | @@ -185,9 +185,9 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) Content formats that can be provided as on-device message content. | @@ -281,9 +281,6 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | Hy ### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645} -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. Only Imagen 3 models (named `imagen-3.0-*`) are supported. @@ -575,9 +572,6 @@ HarmSeverity: { ## ImagenAspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). @@ -598,9 +592,6 @@ ImagenAspectRatio: { ## ImagenPersonFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. See the personGeneration documentation for more details. @@ -617,9 +608,6 @@ ImagenPersonFilterLevel: { ## ImagenSafetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressively to filter sensitive content. Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. @@ -889,9 +877,6 @@ export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; ## ImagenAspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). @@ -906,9 +891,6 @@ export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAs ## ImagenPersonFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. See the personGeneration documentation for more details. @@ -921,9 +903,6 @@ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typ ## ImagenSafetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressively to filter sensitive content. Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index fc789f303a4..6e56aea793c 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -161,7 +161,7 @@ export function getGenerativeModel( * @throws If the `apiKey` or `projectId` fields are missing in your * Firebase config. * - * @beta + * @public */ export function getImagenModel( ai: AI, diff --git a/packages/ai/src/models/imagen-model.ts b/packages/ai/src/models/imagen-model.ts index 3c76a1c721c..a41a03f25cf 100644 --- a/packages/ai/src/models/imagen-model.ts +++ b/packages/ai/src/models/imagen-model.ts @@ -50,7 +50,7 @@ import { AIModel } from './ai-model'; * } * ``` * - * @beta + * @public */ export class ImagenModel extends AIModel { /** @@ -99,7 +99,7 @@ export class ImagenModel extends AIModel { * returned object will have a `filteredReason` property. * If all images are filtered, the `images` array will be empty. * - * @beta + * @public */ async generateImages( prompt: string diff --git a/packages/ai/src/requests/imagen-image-format.ts b/packages/ai/src/requests/imagen-image-format.ts index b9690a7d39b..e07d4cec818 100644 --- a/packages/ai/src/requests/imagen-image-format.ts +++ b/packages/ai/src/requests/imagen-image-format.ts @@ -32,7 +32,7 @@ import { logger } from '../logger'; * } * ``` * - * @beta + * @public */ export class ImagenImageFormat { /** @@ -54,7 +54,7 @@ export class ImagenImageFormat { * @param compressionQuality - The level of compression (a number between 0 and 100). * @returns An {@link ImagenImageFormat} object for a JPEG image. * - * @beta + * @public */ static jpeg(compressionQuality?: number): ImagenImageFormat { if ( @@ -73,7 +73,7 @@ export class ImagenImageFormat { * * @returns An {@link ImagenImageFormat} object for a PNG image. * - * @beta + * @public */ static png(): ImagenImageFormat { return { mimeType: 'image/png' }; diff --git a/packages/ai/src/types/imagen/requests.ts b/packages/ai/src/types/imagen/requests.ts index 47d1afe3b01..4cd59342948 100644 --- a/packages/ai/src/types/imagen/requests.ts +++ b/packages/ai/src/types/imagen/requests.ts @@ -20,7 +20,7 @@ import { ImagenImageFormat } from '../../requests/imagen-image-format'; /** * Parameters for configuring an {@link ImagenModel}. * - * @beta + * @public */ export interface ImagenModelParams { /** @@ -49,7 +49,7 @@ export interface ImagenModelParams { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images-imagen | documentation} for * more details. * - * @beta + * @public */ export interface ImagenGenerationConfig { /** @@ -108,7 +108,7 @@ export interface ImagenGenerationConfig { * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} * for more details. * - * @beta + * @public */ export const ImagenSafetyFilterLevel = { /** @@ -142,7 +142,7 @@ export const ImagenSafetyFilterLevel = { * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} * for more details. * - * @beta + * @public */ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; @@ -153,7 +153,7 @@ export type ImagenSafetyFilterLevel = * See the personGeneration * documentation for more details. * - * @beta + * @public */ export const ImagenPersonFilterLevel = { /** @@ -184,7 +184,7 @@ export const ImagenPersonFilterLevel = { * See the personGeneration * documentation for more details. * - * @beta + * @public */ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; @@ -195,7 +195,7 @@ export type ImagenPersonFilterLevel = * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details. * - * @beta + * @public */ export interface ImagenSafetySettings { /** @@ -218,7 +218,7 @@ export interface ImagenSafetySettings { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * - * @beta + * @public */ export const ImagenAspectRatio = { /** @@ -252,7 +252,7 @@ export const ImagenAspectRatio = { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * - * @beta + * @public */ export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; diff --git a/packages/ai/src/types/imagen/responses.ts b/packages/ai/src/types/imagen/responses.ts index be99ab104bf..b0985ea6043 100644 --- a/packages/ai/src/types/imagen/responses.ts +++ b/packages/ai/src/types/imagen/responses.ts @@ -18,7 +18,7 @@ /** * An image generated by Imagen, represented as inline data. * - * @beta + * @public */ export interface ImagenInlineImage { /** @@ -37,7 +37,7 @@ export interface ImagenInlineImage { * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. * * This feature is not available yet. - * @beta + * @public */ export interface ImagenGCSImage { /** @@ -57,7 +57,7 @@ export interface ImagenGCSImage { /** * The response from a request to generate images with Imagen. * - * @beta + * @public */ export interface ImagenGenerationResponse< T extends ImagenInlineImage | ImagenGCSImage From c407cb95288d025c8df334ee797193de4d9063c1 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:44:12 -0600 Subject: [PATCH 288/295] Implementing features from API audit and node backport (#9284) --- .../firestore-lite-pipelines.api.md | 1133 ++-- common/api-review/firestore-pipelines.api.md | 1390 +++-- .../firestore/lite/pipelines/pipelines.ts | 90 +- packages/firestore/package.json | 25 +- packages/firestore/rollup.config.js | 4 +- packages/firestore/rollup.config.lite.js | 8 +- packages/firestore/src/api/pipeline_impl.ts | 118 +- packages/firestore/src/api/snapshot.ts | 6 +- packages/firestore/src/api_pipelines.ts | 107 +- .../firestore/src/core/firestore_client.ts | 4 +- packages/firestore/src/core/options_util.ts | 95 + packages/firestore/src/core/pipeline-util.ts | 48 +- .../firestore/src/core/structured_pipeline.ts | 67 + .../firestore/src/lite-api/expressions.ts | 4535 ++++++++++------- .../firestore/src/lite-api/pipeline-result.ts | 34 +- .../firestore/src/lite-api/pipeline-source.ts | 201 +- packages/firestore/src/lite-api/pipeline.ts | 1059 +++- .../firestore/src/lite-api/pipeline_impl.ts | 39 +- .../src/lite-api/pipeline_options.ts | 78 + packages/firestore/src/lite-api/query.ts | 3 +- packages/firestore/src/lite-api/reference.ts | 6 + packages/firestore/src/lite-api/snapshot.ts | 24 +- packages/firestore/src/lite-api/stage.ts | 604 ++- .../firestore/src/lite-api/stage_options.ts | 297 ++ .../src/lite-api/user_data_reader.ts | 8 + .../src/platform/rn_lite/snapshot_to_json.ts | 7 + packages/firestore/src/remote/datastore.ts | 23 +- packages/firestore/src/remote/serializer.ts | 6 - .../firestore/src/util/input_validation.ts | 3 +- packages/firestore/src/util/pipeline_util.ts | 132 + packages/firestore/src/util/types.ts | 19 + .../test/integration/api/pipeline.test.ts | 2198 ++++++-- .../integration/api/query_to_pipeline.test.ts | 2 +- packages/firestore/test/lite/pipeline.test.ts | 539 +- .../test/unit/api/pipeline_impl.test.ts | 202 + .../test/unit/core/options_util.test.ts | 224 + .../unit/core/structured_pipeline.test.ts | 187 + .../bundle-definitions/firestore.json | 6 +- yarn.lock | 251 +- 39 files changed, 9126 insertions(+), 4656 deletions(-) create mode 100644 packages/firestore/src/core/options_util.ts create mode 100644 packages/firestore/src/core/structured_pipeline.ts create mode 100644 packages/firestore/src/lite-api/pipeline_options.ts create mode 100644 packages/firestore/src/lite-api/stage_options.ts create mode 100644 packages/firestore/src/util/pipeline_util.ts create mode 100644 packages/firestore/test/unit/api/pipeline_impl.test.ts create mode 100644 packages/firestore/test/unit/core/options_util.test.ts create mode 100644 packages/firestore/test/unit/core/structured_pipeline.test.ts diff --git a/common/api-review/firestore-lite-pipelines.api.md b/common/api-review/firestore-lite-pipelines.api.md index 28746295ae5..37882d2eb50 100644 --- a/common/api-review/firestore-lite-pipelines.api.md +++ b/common/api-review/firestore-lite-pipelines.api.md @@ -7,301 +7,224 @@ import { FirebaseApp } from '@firebase/app'; // @beta -export function add(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function add(first: Expression, second: Expression | unknown): FunctionExpression; // @beta -export function add(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function add(fieldName: string, second: Expression | unknown): FunctionExpression; -// @beta (undocumented) -export class AddFields implements Stage { - constructor(fields: Map); - // (undocumented) - name: string; -} - -// @beta (undocumented) -export class Aggregate implements Stage { - constructor(accumulators: Map, groups: Map); - // (undocumented) - name: string; -} +// @public +export type AddFieldsStageOptions = StageOptions & { + fields: Selectable[]; +}; // @beta export class AggregateFunction { - constructor(name: string, params: Expr[]); - as(name: string): AggregateWithAlias; + constructor(name: string, params: Expression[]); + as(name: string): AliasedAggregate; // (undocumented) - exprType: ExprType; + exprType: ExpressionType; } +// @public +export type AggregateStageOptions = StageOptions & { + accumulators: AliasedAggregate[]; + groups?: Array; +}; + // @beta -export class AggregateWithAlias { - constructor(aggregate: AggregateFunction, alias: string); +export class AliasedAggregate { + constructor(aggregate: AggregateFunction, alias: string, _methodName: string | undefined); // (undocumented) readonly aggregate: AggregateFunction; // (undocumented) readonly alias: string; } -// @beta -export function and(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; - -// @beta -export function array(elements: unknown[]): FunctionExpr; - -// @beta -export function arrayConcat(firstArray: Expr, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; +// @beta (undocumented) +export class AliasedExpression implements Selectable { + constructor(expr: Expression, alias: string, _methodName: string | undefined); + // (undocumented) + readonly alias: string; + // (undocumented) + readonly expr: Expression; + // (undocumented) + exprType: ExpressionType; + // (undocumented) + selectable: true; +} // @beta -export function arrayConcat(firstArrayField: string, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; +export function and(first: BooleanExpression, second: BooleanExpression, ...more: BooleanExpression[]): BooleanExpression; // @beta -export function arrayContains(array: Expr, element: Expr): FunctionExpr; +export function array(elements: unknown[]): FunctionExpression; // @beta -export function arrayContains(array: Expr, element: unknown): FunctionExpr; +export function arrayConcat(firstArray: Expression, secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; // @beta -export function arrayContains(fieldName: string, element: Expr): FunctionExpr; +export function arrayConcat(firstArrayField: string, secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; // @beta -export function arrayContains(fieldName: string, element: unknown): BooleanExpr; +export function arrayContains(array: Expression, element: Expression): FunctionExpression; // @beta -export function arrayContainsAll(array: Expr, values: Array): BooleanExpr; +export function arrayContains(array: Expression, element: unknown): FunctionExpression; // @beta -export function arrayContainsAll(fieldName: string, values: Array): BooleanExpr; +export function arrayContains(fieldName: string, element: Expression): FunctionExpression; // @beta -export function arrayContainsAll(array: Expr, arrayExpression: Expr): BooleanExpr; +export function arrayContains(fieldName: string, element: unknown): BooleanExpression; // @beta -export function arrayContainsAll(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function arrayContainsAll(array: Expression, values: Array): BooleanExpression; // @beta -export function arrayContainsAny(array: Expr, values: Array): BooleanExpr; +export function arrayContainsAll(fieldName: string, values: Array): BooleanExpression; // @beta -export function arrayContainsAny(fieldName: string, values: Array): BooleanExpr; +export function arrayContainsAll(array: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; +export function arrayContainsAll(fieldName: string, arrayExpression: Expression): BooleanExpression; // @beta -export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; +export function arrayContainsAny(array: Expression, values: Array): BooleanExpression; // @beta -export function arrayLength(array: Expr): FunctionExpr; +export function arrayContainsAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function arrayOffset(arrayField: string, offset: number): FunctionExpr; +export function arrayContainsAny(array: Expression, values: Expression): BooleanExpression; // @beta -export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; +export function arrayContainsAny(fieldName: string, values: Expression): BooleanExpression; // @beta -export function arrayOffset(arrayExpression: Expr, offset: number): FunctionExpr; +export function arrayLength(fieldName: string): FunctionExpression; // @beta -export function arrayOffset(arrayExpression: Expr, offsetExpr: Expr): FunctionExpr; +export function arrayLength(array: Expression): FunctionExpression; // @beta -export function ascending(expr: Expr): Ordering; +export function ascending(expr: Expression): Ordering; // @beta export function ascending(fieldName: string): Ordering; // @beta -export function avg(expression: Expr): AggregateFunction; - -// @beta -export function avg(fieldName: string): AggregateFunction; - -// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts -// -// @beta -export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; - -// @beta -export function bitAnd(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitAnd(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; - -// @beta -export function bitLeftShift(field: string, y: number): FunctionExpr; - -// @beta -export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; - -// @beta -export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; - -// @beta -export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; - -// @beta -export function bitNot(field: string): FunctionExpr; - -// @beta -export function bitNot(bitsValueExpression: Expr): FunctionExpr; - -// @beta -export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; - -// @beta -export function bitOr(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitOr(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; - -// @beta -export function bitRightShift(field: string, y: number): FunctionExpr; +export function average(expression: Expression): AggregateFunction; // @beta -export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; +export function average(fieldName: string): AggregateFunction; // @beta -export function bitRightShift(xValue: Expr, y: number): FunctionExpr; - -// @beta -export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; - -// @beta -export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; - -// @beta -export function bitXor(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitXor(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; - -// @beta -export class BooleanExpr extends FunctionExpr { +export class BooleanExpression extends FunctionExpression { + conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression; countIf(): AggregateFunction; // (undocumented) filterable: true; - not(): BooleanExpr; + ifError(catchValue: BooleanExpression): BooleanExpression; + not(): BooleanExpression; } // @beta -export function byteLength(expr: Expr): FunctionExpr; +export function byteLength(expr: Expression): FunctionExpression; // @beta -export function byteLength(fieldName: string): FunctionExpr; +export function byteLength(fieldName: string): FunctionExpression; // @beta -export function charLength(fieldName: string): FunctionExpr; +export function charLength(fieldName: string): FunctionExpression; // @beta -export function charLength(stringExpression: Expr): FunctionExpr; +export function charLength(stringExpression: Expression): FunctionExpression; -// @beta (undocumented) -export class CollectionGroupSource implements Stage { - constructor(collectionId: string); - // (undocumented) - name: string; -} - -// @beta (undocumented) -export class CollectionSource implements Stage { - constructor(collectionPath: string); - // (undocumented) - name: string; -} +// @public +export type CollectionGroupStageOptions = StageOptions & { + collectionId: string; + forceIndex?: string; +}; -// @beta -export function cond(condition: BooleanExpr, thenExpr: Expr, elseExpr: Expr): FunctionExpr; +// @public +export type CollectionStageOptions = StageOptions & { + collection: string | Query; + forceIndex?: string; +}; // @beta -export class Constant extends Expr { - // (undocumented) - readonly exprType: ExprType; - } +export function conditional(condition: BooleanExpression, thenExpr: Expression, elseExpr: Expression): FunctionExpression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: number): Constant; +export function constant(value: number): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: string): Constant; +export function constant(value: string): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta // // @public -export function constant(value: boolean): Constant; +export function constant(value: boolean): BooleanExpression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: null): Constant; +export function constant(value: null): Expression; // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: GeoPoint): Constant; +export function constant(value: GeoPoint): Expression; // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Timestamp): Constant; +export function constant(value: Timestamp): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Date): Constant; +export function constant(value: Date): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Bytes): Constant; +export function constant(value: Bytes): Expression; // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: DocumentReference): Constant; +export function constant(value: DocumentReference): Expression; // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: VectorValue): Constant; - -// Warning: (ae-incompatible-release-tags) The symbol "constantVector" is marked as @public, but its signature references "Constant" which is marked as @beta -// -// @public -export function constantVector(value: number[] | VectorValue): Constant; +export function constant(value: VectorValue): Expression; // @beta -export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function cosineDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function cosineDistance(vectorExpression: Expr, vector: number[] | Expr): FunctionExpr; +export function cosineDistance(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function cosineDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function cosineDistance(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; // @beta -export function count(expression: Expr): AggregateFunction; +export function count(expression: Expression): AggregateFunction; // Warning: (ae-incompatible-release-tags) The symbol "count" is marked as @public, but its signature references "AggregateFunction" which is marked as @beta // @@ -312,384 +235,373 @@ export function count(fieldName: string): AggregateFunction; export function countAll(): AggregateFunction; // @beta -export function countIf(booleanExpr: BooleanExpr): AggregateFunction; +export function countIf(booleanExpr: BooleanExpression): AggregateFunction; -// @beta -export function currentContext(): FunctionExpr; - -// @beta (undocumented) -export class DatabaseSource implements Stage { - // (undocumented) - name: string; -} +// @public +export type DatabaseStageOptions = StageOptions & {}; // @beta -export function descending(expr: Expr): Ordering; +export function descending(expr: Expression): Ordering; // @beta export function descending(fieldName: string): Ordering; -// @beta (undocumented) -export class Distinct implements Stage { - constructor(groups: Map); - // (undocumented) - name: string; -} +// @public +export type DistinctStageOptions = StageOptions & { + groups: Array; +}; // @beta -export function divide(left: Expr, right: Expr): FunctionExpr; +export function divide(left: Expression, right: Expression): FunctionExpression; // @beta -export function divide(expression: Expr, value: unknown): FunctionExpr; +export function divide(expression: Expression, value: unknown): FunctionExpression; // @beta -export function divide(fieldName: string, expressions: Expr): FunctionExpr; +export function divide(fieldName: string, expressions: Expression): FunctionExpression; // @beta -export function divide(fieldName: string, value: unknown): FunctionExpr; +export function divide(fieldName: string, value: unknown): FunctionExpression; // @beta -export function documentId(documentPath: string | DocumentReference): FunctionExpr; +export function documentId(documentPath: string | DocumentReference): FunctionExpression; // @beta -export function documentId(documentPathExpr: Expr): FunctionExpr; +export function documentId(documentPathExpr: Expression): FunctionExpression; -// @beta (undocumented) -export class DocumentsSource implements Stage { - constructor(docPaths: string[]); - // (undocumented) - name: string; - // (undocumented) - static of(refs: Array): DocumentsSource; -} +// @public +export type DocumentsStageOptions = StageOptions & { + docs: Array; +}; // @beta -export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function dotProduct(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function dotProduct(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function dotProduct(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function dotProduct(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function dotProduct(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; // @beta -export function endsWith(fieldName: string, suffix: string): BooleanExpr; +export function endsWith(fieldName: string, suffix: string): BooleanExpression; // @beta -export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; +export function endsWith(fieldName: string, suffix: Expression): BooleanExpression; // @beta -export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; +export function endsWith(stringExpression: Expression, suffix: string): BooleanExpression; // @beta -export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; +export function endsWith(stringExpression: Expression, suffix: Expression): BooleanExpression; // @beta -export function eq(left: Expr, right: Expr): BooleanExpr; +export function equal(left: Expression, right: Expression): BooleanExpression; // @beta -export function eq(expression: Expr, value: unknown): BooleanExpr; +export function equal(expression: Expression, value: unknown): BooleanExpression; // @beta -export function eq(fieldName: string, expression: Expr): BooleanExpr; +export function equal(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function eq(fieldName: string, value: unknown): BooleanExpr; +export function equal(fieldName: string, value: unknown): BooleanExpression; // @beta -export function eqAny(expression: Expr, values: Array): BooleanExpr; +export function equalAny(expression: Expression, values: Array): BooleanExpression; // @beta -export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; +export function equalAny(expression: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function eqAny(fieldName: string, values: Array): BooleanExpr; +export function equalAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function equalAny(fieldName: string, arrayExpression: Expression): BooleanExpression; // @beta -export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function euclideanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function euclideanDistance(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function euclideanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function euclideanDistance(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function euclideanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function euclideanDistance(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; +// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "Pipeline" which is marked as @beta +// // @public export function execute(pipeline: Pipeline): Promise; // @beta -export function exists(value: Expr): BooleanExpr; +export function exists(value: Expression): BooleanExpression; // @beta -export function exists(fieldName: string): BooleanExpr; +export function exists(fieldName: string): BooleanExpression; // @beta -export abstract class Expr { - add(second: Expr | unknown, ...others: Array): FunctionExpr; +export abstract class Expression { + abs(): FunctionExpression; + /* Excluded from this release type: _readUserData */ + add(second: Expression | unknown): FunctionExpression; + /* Excluded from this release type: _readUserData */ + arrayConcat(secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; + /* Excluded from this release type: _readUserData */ + arrayContains(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayConcat(secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; + arrayContains(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContains(expression: Expr): BooleanExpr; + arrayContainsAll(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContains(value: unknown): BooleanExpr; + arrayContainsAll(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAll(values: Array): BooleanExpr; + arrayContainsAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAll(arrayExpression: Expr): BooleanExpr; + arrayContainsAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAny(values: Array): BooleanExpr; + arrayGet(offset: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAny(arrayExpression: Expr): BooleanExpr; + arrayGet(offsetExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayLength(): FunctionExpr; + arrayLength(): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayOffset(offset: number): FunctionExpr; + arrayReverse(): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayOffset(offsetExpr: Expr): FunctionExpr; + arraySum(): FunctionExpression; /* Excluded from this release type: _readUserData */ - as(name: string): ExprWithAlias; + as(name: string): AliasedExpression; /* Excluded from this release type: _readUserData */ ascending(): Ordering; /* Excluded from this release type: _readUserData */ - avg(): AggregateFunction; + average(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitAnd(otherBits: number | Bytes): FunctionExpr; + byteLength(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitAnd(bitsExpression: Expr): FunctionExpr; + ceil(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitLeftShift(y: number): FunctionExpr; + charLength(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitLeftShift(numberExpr: Expr): FunctionExpr; + collectionId(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitNot(): FunctionExpr; + concat(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitOr(otherBits: number | Bytes): FunctionExpr; + cosineDistance(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitOr(bitsExpression: Expr): FunctionExpr; + cosineDistance(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitRightShift(y: number): FunctionExpr; + count(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitRightShift(numberExpr: Expr): FunctionExpr; + countDistinct(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitXor(otherBits: number | Bytes): FunctionExpr; + descending(): Ordering; /* Excluded from this release type: _readUserData */ - bitXor(bitsExpression: Expr): FunctionExpr; + divide(divisor: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - byteLength(): FunctionExpr; + divide(divisor: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - charLength(): FunctionExpr; + documentId(): FunctionExpression; /* Excluded from this release type: _readUserData */ - cosineDistance(vectorExpression: Expr): FunctionExpr; + dotProduct(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - cosineDistance(vector: VectorValue | number[]): FunctionExpr; + dotProduct(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - count(): AggregateFunction; + endsWith(suffix: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - descending(): Ordering; + endsWith(suffix: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - divide(other: Expr): FunctionExpr; + equal(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - divide(other: unknown): FunctionExpr; + equal(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - documentId(): FunctionExpr; + equalAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - dotProduct(vectorExpression: Expr): FunctionExpr; + equalAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - dotProduct(vector: VectorValue | number[]): FunctionExpr; + euclideanDistance(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - endsWith(suffix: string): BooleanExpr; + euclideanDistance(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - endsWith(suffix: Expr): BooleanExpr; + exists(): BooleanExpression; /* Excluded from this release type: _readUserData */ - eq(expression: Expr): BooleanExpr; + exp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - eq(value: unknown): BooleanExpr; + // (undocumented) + abstract readonly expressionType: ExpressionType; /* Excluded from this release type: _readUserData */ - eqAny(values: Array): BooleanExpr; + floor(): FunctionExpression; /* Excluded from this release type: _readUserData */ - eqAny(arrayExpression: Expr): BooleanExpr; + greaterThan(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - euclideanDistance(vectorExpression: Expr): FunctionExpr; + greaterThan(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - euclideanDistance(vector: VectorValue | number[]): FunctionExpr; + greaterThanOrEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - exists(): BooleanExpr; + greaterThanOrEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - // (undocumented) - abstract readonly exprType: ExprType; + ifAbsent(elseValue: unknown): Expression; /* Excluded from this release type: _readUserData */ - gt(expression: Expr): BooleanExpr; + ifAbsent(elseExpression: unknown): Expression; /* Excluded from this release type: _readUserData */ - gt(value: unknown): BooleanExpr; + ifError(catchExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - gte(expression: Expr): BooleanExpr; + ifError(catchValue: unknown): FunctionExpression; /* Excluded from this release type: _readUserData */ - gte(value: unknown): BooleanExpr; + isAbsent(): BooleanExpression; /* Excluded from this release type: _readUserData */ - ifError(catchExpr: Expr): FunctionExpr; + isError(): BooleanExpression; /* Excluded from this release type: _readUserData */ - ifError(catchValue: unknown): FunctionExpr; + isNan(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isAbsent(): BooleanExpr; + isNotNan(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isError(): BooleanExpr; + isNotNull(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isNan(): BooleanExpr; + isNull(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isNotNan(): BooleanExpr; + join(delimiterExpression: Expression): Expression; /* Excluded from this release type: _readUserData */ - isNotNull(): BooleanExpr; + join(delimiter: string): Expression; /* Excluded from this release type: _readUserData */ - isNull(): BooleanExpr; + length(): FunctionExpression; /* Excluded from this release type: _readUserData */ - like(pattern: string): FunctionExpr; + lessThan(experession: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - like(pattern: Expr): FunctionExpr; + lessThan(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - logicalMaximum(second: Expr | unknown, ...others: Array): FunctionExpr; + lessThanOrEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - logicalMinimum(second: Expr | unknown, ...others: Array): FunctionExpr; + lessThanOrEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - lt(experession: Expr): BooleanExpr; + like(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - lt(value: unknown): BooleanExpr; + like(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - lte(expression: Expr): BooleanExpr; + ln(): FunctionExpression; /* Excluded from this release type: _readUserData */ - lte(value: unknown): BooleanExpr; + log10(): FunctionExpression; /* Excluded from this release type: _readUserData */ - manhattanDistance(vector: VectorValue | number[]): FunctionExpr; + logicalMaximum(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - manhattanDistance(vectorExpression: Expr): FunctionExpr; + logicalMinimum(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapGet(subfield: string): FunctionExpr; + mapGet(subfield: string): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapMerge(secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; + mapMerge(secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapRemove(key: string): FunctionExpr; + mapRemove(key: string): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapRemove(keyExpr: Expr): FunctionExpr; + mapRemove(keyExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ maximum(): AggregateFunction; /* Excluded from this release type: _readUserData */ minimum(): AggregateFunction; /* Excluded from this release type: _readUserData */ - mod(expression: Expr): FunctionExpr; + mod(expression: Expression): FunctionExpression; + /* Excluded from this release type: _readUserData */ + mod(value: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - mod(value: unknown): FunctionExpr; + multiply(second: Expression | number): FunctionExpression; /* Excluded from this release type: _readUserData */ - multiply(second: Expr | unknown, ...others: Array): FunctionExpr; + notEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - neq(expression: Expr): BooleanExpr; + notEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - neq(value: unknown): BooleanExpr; + notEqualAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - notEqAny(values: Array): BooleanExpr; + notEqualAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - notEqAny(arrayExpression: Expr): BooleanExpr; + pow(exponent: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - regexContains(pattern: string): BooleanExpr; + pow(exponent: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - regexContains(pattern: Expr): BooleanExpr; + regexContains(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - regexMatch(pattern: string): BooleanExpr; + regexContains(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - regexMatch(pattern: Expr): BooleanExpr; + regexMatch(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - replaceAll(find: string, replace: string): FunctionExpr; + regexMatch(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - replaceAll(find: Expr, replace: Expr): FunctionExpr; + reverse(): FunctionExpression; /* Excluded from this release type: _readUserData */ - replaceFirst(find: string, replace: string): FunctionExpr; + round(): FunctionExpression; /* Excluded from this release type: _readUserData */ - replaceFirst(find: Expr, replace: Expr): FunctionExpr; + round(decimalPlaces: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - reverse(): FunctionExpr; + round(decimalPlaces: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - startsWith(prefix: string): BooleanExpr; + sqrt(): FunctionExpression; /* Excluded from this release type: _readUserData */ - startsWith(prefix: Expr): BooleanExpr; + startsWith(prefix: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - strConcat(secondString: Expr | string, ...otherStrings: Array): FunctionExpr; + startsWith(prefix: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - strContains(substring: string): BooleanExpr; + stringConcat(secondString: Expression | string, ...otherStrings: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - strContains(expr: Expr): BooleanExpr; + stringContains(substring: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - substr(position: number, length?: number): FunctionExpr; + stringContains(expr: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - substr(position: Expr, length?: Expr): FunctionExpr; + stringReverse(): FunctionExpression; /* Excluded from this release type: _readUserData */ - subtract(other: Expr): FunctionExpr; + substring(position: number, length?: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - subtract(other: unknown): FunctionExpr; + substring(position: Expression, length?: Expression): FunctionExpression; + /* Excluded from this release type: _readUserData */ + subtract(subtrahend: Expression): FunctionExpression; + /* Excluded from this release type: _readUserData */ + subtract(subtrahend: number): FunctionExpression; /* Excluded from this release type: _readUserData */ sum(): AggregateFunction; /* Excluded from this release type: _readUserData */ - timestampAdd(unit: Expr, amount: Expr): FunctionExpr; + timestampAdd(unit: Expression, amount: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampSub(unit: Expr, amount: Expr): FunctionExpr; + timestampSubtract(unit: Expression, amount: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + timestampSubtract(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixMicros(): FunctionExpr; + timestampToUnixMicros(): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixMillis(): FunctionExpr; + timestampToUnixMillis(): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixSeconds(): FunctionExpr; + timestampToUnixSeconds(): FunctionExpression; /* Excluded from this release type: _readUserData */ - toLower(): FunctionExpr; + toLower(): FunctionExpression; /* Excluded from this release type: _readUserData */ - toUpper(): FunctionExpr; + toUpper(): FunctionExpression; /* Excluded from this release type: _readUserData */ - trim(): FunctionExpr; + trim(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixMicrosToTimestamp(): FunctionExpr; + unixMicrosToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixMillisToTimestamp(): FunctionExpr; + unixMillisToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixSecondsToTimestamp(): FunctionExpr; + unixSecondsToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - vectorLength(): FunctionExpr; + vectorLength(): FunctionExpression; } // @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExprs' | 'ExprWithAlias'; - -// @beta (undocumented) -export class ExprWithAlias implements Selectable { - constructor(expr: Expr, alias: string); - // (undocumented) - readonly alias: string; - // (undocumented) - readonly expr: Expr; - // (undocumented) - exprType: ExprType; - // (undocumented) - selectable: true; -} +export type ExpressionType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExpressions' | 'AliasedExpression'; // @beta -export class Field extends Expr implements Selectable { +export class Field extends Expression implements Selectable { // (undocumented) get alias(): string; // (undocumented) - get expr(): Expr; + get expr(): Expression; // (undocumented) - readonly exprType: ExprType; + readonly expressionType: ExpressionType; // (undocumented) - fieldName(): string; + get fieldName(): string; // (undocumented) selectable: true; } @@ -705,334 +617,315 @@ export function field(name: string): Field; // @public (undocumented) export function field(path: FieldPath): Field; -// @beta (undocumented) -export class FindNearest implements Stage { - // (undocumented) - name: string; -} - -// @beta (undocumented) -export interface FindNearestOptions { - // (undocumented) - distanceField?: string; - // (undocumented) - distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; - // (undocumented) +// @public +export type FindNearestStageOptions = StageOptions & { field: Field | string; - // (undocumented) - limit?: number; - // (undocumented) vectorValue: VectorValue | number[]; -} + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + limit?: number; + distanceField?: string; +}; // @beta -export class FunctionExpr extends Expr { - constructor(name: string, params: Expr[]); +export class FunctionExpression extends Expression { + constructor(name: string, params: Expression[]); + constructor(name: string, params: Expression[], _methodName: string | undefined); // (undocumented) - readonly exprType: ExprType; + readonly expressionType: ExpressionType; } -// @beta (undocumented) -export class GenericStage implements Stage { - // (undocumented) - name: string; - } - -// @beta -export function gt(left: Expr, right: Expr): BooleanExpr; - // @beta -export function gt(expression: Expr, value: unknown): BooleanExpr; +export function greaterThan(left: Expression, right: Expression): BooleanExpression; // @beta -export function gt(fieldName: string, expression: Expr): BooleanExpr; +export function greaterThan(expression: Expression, value: unknown): BooleanExpression; // @beta -export function gt(fieldName: string, value: unknown): BooleanExpr; +export function greaterThan(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function gte(left: Expr, right: Expr): BooleanExpr; +export function greaterThan(fieldName: string, value: unknown): BooleanExpression; // @beta -export function gte(expression: Expr, value: unknown): BooleanExpr; +export function greaterThanOrEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function gte(fieldName: string, value: Expr): BooleanExpr; +export function greaterThanOrEqual(expression: Expression, value: unknown): BooleanExpression; // @beta -export function gte(fieldName: string, value: unknown): BooleanExpr; +export function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression; // @beta -export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; +export function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression; // @beta -export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; +export function ifError(tryExpr: BooleanExpression, catchExpr: BooleanExpression): BooleanExpression; // @beta -export function isAbsent(value: Expr): BooleanExpr; +export function ifError(tryExpr: Expression, catchExpr: Expression): FunctionExpression; // @beta -export function isAbsent(field: string): BooleanExpr; +export function ifError(tryExpr: Expression, catchValue: unknown): FunctionExpression; // @beta -export function isError(value: Expr): BooleanExpr; +export function isAbsent(value: Expression): BooleanExpression; // @beta -export function isNan(value: Expr): BooleanExpr; +export function isAbsent(field: string): BooleanExpression; // @beta -export function isNan(fieldName: string): BooleanExpr; +export function isError(value: Expression): BooleanExpression; // @beta -export function isNotNan(value: Expr): BooleanExpr; +export function isNan(value: Expression): BooleanExpression; // @beta -export function isNotNan(value: string): BooleanExpr; +export function isNan(fieldName: string): BooleanExpression; // @beta -export function isNotNull(value: Expr): BooleanExpr; +export function isNotNan(value: Expression): BooleanExpression; // @beta -export function isNotNull(value: string): BooleanExpr; +export function isNotNan(value: string): BooleanExpression; // @beta -export function isNull(value: Expr): BooleanExpr; +export function isNotNull(value: Expression): BooleanExpression; // @beta -export function isNull(value: string): BooleanExpr; +export function isNotNull(value: string): BooleanExpression; // @beta -export function like(fieldName: string, pattern: string): BooleanExpr; +export function isNull(value: Expression): BooleanExpression; // @beta -export function like(fieldName: string, pattern: Expr): BooleanExpr; +export function isNull(value: string): BooleanExpression; // @beta -export function like(stringExpression: Expr, pattern: string): BooleanExpr; +export function lessThan(left: Expression, right: Expression): BooleanExpression; // @beta -export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; - -// @beta (undocumented) -export class Limit implements Stage { - constructor(limit: number, convertedFromLimitTolast?: boolean); - // (undocumented) - readonly convertedFromLimitTolast: boolean; - // (undocumented) - readonly limit: number; - // (undocumented) - name: string; -} +export function lessThan(expression: Expression, value: unknown): BooleanExpression; // @beta -export function logicalMaximum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function logicalMaximum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(fieldName: string, value: unknown): BooleanExpression; // @beta -export function logicalMinimum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThanOrEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function logicalMinimum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThanOrEqual(expression: Expression, value: unknown): BooleanExpression; -// @beta -export function lt(left: Expr, right: Expr): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "lessThanOrEqual" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lessThanOrEqual" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta +// +// @public +export function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function lt(expression: Expr, value: unknown): BooleanExpr; +export function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression; // @beta -export function lt(fieldName: string, expression: Expr): BooleanExpr; +export function like(fieldName: string, pattern: string): BooleanExpression; // @beta -export function lt(fieldName: string, value: unknown): BooleanExpr; +export function like(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function lte(left: Expr, right: Expr): BooleanExpr; +export function like(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function lte(expression: Expr, value: unknown): BooleanExpr; +export function like(stringExpression: Expression, pattern: Expression): BooleanExpression; -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta -// // @public -export function lte(fieldName: string, expression: Expr): BooleanExpr; - -// @beta -export function lte(fieldName: string, value: unknown): BooleanExpr; +export type LimitStageOptions = StageOptions & { + limit: number; +}; // @beta -export function manhattanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function logicalMaximum(first: Expression, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function logicalMinimum(first: Expression, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function logicalMinimum(fieldName: string, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function map(elements: Record): FunctionExpr; +export function map(elements: Record): FunctionExpression; // @beta -export function mapGet(fieldName: string, subField: string): FunctionExpr; +export function mapGet(fieldName: string, subField: string): FunctionExpression; // @beta -export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; +export function mapGet(mapExpression: Expression, subField: string): FunctionExpression; // @beta -export function mapMerge(mapField: string, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; +export function mapMerge(mapField: string, secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; // @beta -export function mapMerge(firstMap: Record | Expr, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; +export function mapMerge(firstMap: Record | Expression, secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; // @beta -export function mapRemove(mapField: string, key: string): FunctionExpr; +export function mapRemove(mapField: string, key: string): FunctionExpression; // @beta -export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; +export function mapRemove(mapExpr: Expression, key: string): FunctionExpression; // @beta -export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; +export function mapRemove(mapField: string, keyExpr: Expression): FunctionExpression; // @beta -export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; +export function mapRemove(mapExpr: Expression, keyExpr: Expression): FunctionExpression; // @beta -export function maximum(expression: Expr): AggregateFunction; +export function maximum(expression: Expression): AggregateFunction; // @beta export function maximum(fieldName: string): AggregateFunction; // @beta -export function minimum(expression: Expr): AggregateFunction; +export function minimum(expression: Expression): AggregateFunction; // @beta export function minimum(fieldName: string): AggregateFunction; // @beta -export function mod(left: Expr, right: Expr): FunctionExpr; +export function mod(left: Expression, right: Expression): FunctionExpression; // @beta -export function mod(expression: Expr, value: unknown): FunctionExpr; +export function mod(expression: Expression, value: unknown): FunctionExpression; // @beta -export function mod(fieldName: string, expression: Expr): FunctionExpr; +export function mod(fieldName: string, expression: Expression): FunctionExpression; // @beta -export function mod(fieldName: string, value: unknown): FunctionExpr; +export function mod(fieldName: string, value: unknown): FunctionExpression; // @beta -export function multiply(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function multiply(first: Expression, second: Expression | unknown): FunctionExpression; // @beta -export function multiply(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function multiply(fieldName: string, second: Expression | unknown): FunctionExpression; // @beta -export function neq(left: Expr, right: Expr): BooleanExpr; +export function not(booleanExpr: BooleanExpression): BooleanExpression; // @beta -export function neq(expression: Expr, value: unknown): BooleanExpr; +export function notEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function neq(fieldName: string, expression: Expr): BooleanExpr; +export function notEqual(expression: Expression, value: unknown): BooleanExpression; // @beta -export function neq(fieldName: string, value: unknown): BooleanExpr; +export function notEqual(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function not(booleanExpr: BooleanExpr): BooleanExpr; +export function notEqual(fieldName: string, value: unknown): BooleanExpression; // @beta -export function notEqAny(element: Expr, values: Array): BooleanExpr; +export function notEqualAny(element: Expression, values: Array): BooleanExpression; // @beta -export function notEqAny(fieldName: string, values: Array): BooleanExpr; +export function notEqualAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; +export function notEqualAny(element: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function notEqualAny(fieldName: string, arrayExpression: Expression): BooleanExpression; -// @beta (undocumented) -export class Offset implements Stage { - constructor(offset: number); - // (undocumented) - name: string; - } +// @public +export type OffsetStageOptions = StageOptions & { + offset: number; +}; + +// @public +export type OneOf = { + [K in keyof T]: Pick & { + [P in Exclude]?: undefined; + }; +}[keyof T]; // @beta -export function or(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; +export function or(first: BooleanExpression, second: BooleanExpression, ...more: BooleanExpression[]): BooleanExpression; // @beta export class Ordering { - constructor(expr: Expr, direction: 'ascending' | 'descending'); + constructor(expr: Expression, direction: 'ascending' | 'descending', _methodName: string | undefined); // (undocumented) readonly direction: 'ascending' | 'descending'; // (undocumented) - readonly expr: Expr; + readonly expr: Expression; } -// @public +// @beta export class Pipeline { /* Excluded from this release type: _db */ - // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta - aggregate(accumulator: AggregateWithAlias, ...additionalAccumulators: AggregateWithAlias[]): Pipeline; + addFields(options: AddFieldsStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ - aggregate(options: { - accumulators: AggregateWithAlias[]; - groups?: Array; - }): Pipeline; + aggregate(accumulator: AliasedAggregate, ...additionalAccumulators: AliasedAggregate[]): Pipeline; + /* Excluded from this release type: _userDataWriter */ + aggregate(options: AggregateStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(group: string | Selectable, ...additionalGroups: Array): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta - // - // (undocumented) - findNearest(options: FindNearestOptions): Pipeline; + distinct(options: DistinctStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ - genericStage(name: string, params: unknown[]): Pipeline; + findNearest(options: FindNearestStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ limit(limit: number): Pipeline; /* Excluded from this release type: _userDataWriter */ + limit(options: LimitStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ offset(offset: number): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "removeFields" is marked as @public, but its signature references "Field" which is marked as @beta + offset(options: OffsetStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ + rawStage(name: string, params: unknown[], options?: { + [key: string]: Expression | unknown; + }): Pipeline; + /* Excluded from this release type: _userDataWriter */ removeFields(fieldValue: Field | string, ...additionalFields: Array): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "replaceWith" is marked as @public, but its signature references "Field" which is marked as @beta - replaceWith(fieldValue: Field | string): Pipeline; + removeFields(options: RemoveFieldsStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ + replaceWith(fieldName: string): Pipeline; + /* Excluded from this release type: _userDataWriter */ + replaceWith(expr: Expression): Pipeline; + /* Excluded from this release type: _userDataWriter */ + replaceWith(options: ReplaceWithStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ sample(documents: number): Pipeline; /* Excluded from this release type: _userDataWriter */ - sample(options: { - percentage: number; - } | { - documents: number; - }): Pipeline; + sample(options: SampleStageOptions): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(selection: Selectable | string, ...additionalSelections: Array): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta + select(options: SelectStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; /* Excluded from this release type: _userDataWriter */ + sort(options: SortStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ union(other: Pipeline): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "unnest" is marked as @public, but its signature references "Selectable" which is marked as @beta + union(options: UnionStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ unnest(selectable: Selectable, indexField?: string): Pipeline; /* Excluded from this release type: _userDataWriter */ - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta - where(condition: BooleanExpr): Pipeline; + unnest(options: UnnestStageOptions): Pipeline; + /* Excluded from this release type: _userDataWriter */ + where(condition: BooleanExpression): Pipeline; + /* Excluded from this release type: _userDataWriter */ + where(options: WhereStageOptions): Pipeline; } // Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts @@ -1043,7 +936,7 @@ export class PipelineResult { /* Excluded from this release type: _fields */ /* Excluded from this release type: __constructor */ get createTime(): Timestamp | undefined; - data(): AppModelType | undefined; + data(): AppModelType; get(fieldPath: string | FieldPath | Field): any; get id(): string | undefined; get ref(): DocumentReference | undefined; @@ -1052,263 +945,263 @@ export class PipelineResult { // @public (undocumented) export class PipelineSnapshot { + // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "Pipeline" which is marked as @beta // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "PipelineResult" which is marked as @beta constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp); get executionTime(): Timestamp; - get pipeline(): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "results" is marked as @public, but its signature references "PipelineResult" which is marked as @beta get results(): PipelineResult[]; } // @beta export class PipelineSource { - collection(collectionPath: string): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ - // Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts - collection(collectionReference: Query): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + collection(collection: string | Query): PipelineType; + collection(options: CollectionStageOptions): PipelineType; collectionGroup(collectionId: string): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + collectionGroup(options: CollectionGroupStageOptions): PipelineType; createFrom(query: Query): Pipeline; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ database(): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + database(options: DatabaseStageOptions): PipelineType; documents(docs: Array): PipelineType; -} - -// @beta -export function rand(): FunctionExpr; - -// @beta -export function regexContains(fieldName: string, pattern: string): BooleanExpr; - -// @beta -export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; - -// @beta -export function regexContains(stringExpression: Expr, pattern: string): BooleanExpr; - -// @beta -export function regexContains(stringExpression: Expr, pattern: Expr): BooleanExpr; + documents(options: DocumentsStageOptions): PipelineType; + } // @beta -export function regexMatch(fieldName: string, pattern: string): BooleanExpr; +export function regexContains(fieldName: string, pattern: string): BooleanExpression; // @beta -export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; +export function regexContains(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function regexMatch(stringExpression: Expr, pattern: string): BooleanExpr; +export function regexContains(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; +export function regexContains(stringExpression: Expression, pattern: Expression): BooleanExpression; // @beta -export function replaceAll(value: Expr, find: string, replace: string): FunctionExpr; +export function regexMatch(fieldName: string, pattern: string): BooleanExpression; // @beta -export function replaceAll(value: Expr, find: Expr, replace: Expr): FunctionExpr; +export function regexMatch(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function replaceAll(fieldName: string, find: string, replace: string): FunctionExpr; +export function regexMatch(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function replaceFirst(value: Expr, find: string, replace: string): FunctionExpr; +export function regexMatch(stringExpression: Expression, pattern: Expression): BooleanExpression; -// @beta -export function replaceFirst(value: Expr, find: Expr, replace: Expr): FunctionExpr; +// @public +export type RemoveFieldsStageOptions = StageOptions & { + fields: Array; +}; -// @beta -export function replaceFirst(fieldName: string, find: string, replace: string): FunctionExpr; +// @public +export type ReplaceWithStageOptions = StageOptions & { + map: Expression | string; +}; // @beta -export function reverse(stringExpression: Expr): FunctionExpr; +export function reverse(stringExpression: Expression): FunctionExpression; // @beta -export function reverse(field: string): FunctionExpr; +export function reverse(field: string): FunctionExpression; -// @beta (undocumented) -export class Select implements Stage { - constructor(projections: Map); - // (undocumented) - name: string; - } +// @public +export type SampleStageOptions = StageOptions & OneOf<{ + percentage: number; + documents: number; +}>; // @beta export interface Selectable { - // (undocumented) - readonly alias: string; - // (undocumented) - readonly expr: Expr; // (undocumented) selectable: true; } -// @beta (undocumented) -export class Sort implements Stage { - constructor(orders: Ordering[]); - // (undocumented) - name: string; - } +// @public +export type SelectStageOptions = StageOptions & { + selections: Array; +}; -// @beta (undocumented) -export interface Stage { - // (undocumented) - name: string; +// @public +export type SortStageOptions = StageOptions & { + orderings: Ordering[]; +}; + +// @public +export interface StageOptions { + rawOptions?: { + [name: string]: unknown; + }; } // @beta -export function startsWith(fieldName: string, prefix: string): BooleanExpr; +export function startsWith(fieldName: string, prefix: string): BooleanExpression; // @beta -export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; +export function startsWith(fieldName: string, prefix: Expression): BooleanExpression; // @beta -export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; +export function startsWith(stringExpression: Expression, prefix: string): BooleanExpression; // @beta -export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; +export function startsWith(stringExpression: Expression, prefix: Expression): BooleanExpression; // @beta -export function strConcat(fieldName: string, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; +export function stringConcat(fieldName: string, secondString: Expression | string, ...otherStrings: Array): FunctionExpression; // @beta -export function strConcat(firstString: Expr, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; +export function stringConcat(firstString: Expression, secondString: Expression | string, ...otherStrings: Array): FunctionExpression; // @beta -export function strContains(fieldName: string, substring: string): BooleanExpr; +export function stringContains(fieldName: string, substring: string): BooleanExpression; // @beta -export function strContains(fieldName: string, substring: Expr): BooleanExpr; +export function stringContains(fieldName: string, substring: Expression): BooleanExpression; // @beta -export function strContains(stringExpression: Expr, substring: string): BooleanExpr; +export function stringContains(stringExpression: Expression, substring: string): BooleanExpression; // @beta -export function strContains(stringExpression: Expr, substring: Expr): BooleanExpr; +export function stringContains(stringExpression: Expression, substring: Expression): BooleanExpression; // @beta -export function substr(field: string, position: number, length?: number): FunctionExpr; +export function substring(field: string, position: number, length?: number): FunctionExpression; // @beta -export function substr(input: Expr, position: number, length?: number): FunctionExpr; +export function substring(input: Expression, position: number, length?: number): FunctionExpression; // @beta -export function substr(field: string, position: Expr, length?: Expr): FunctionExpr; +export function substring(field: string, position: Expression, length?: Expression): FunctionExpression; // @beta -export function substr(input: Expr, position: Expr, length?: Expr): FunctionExpr; +export function substring(input: Expression, position: Expression, length?: Expression): FunctionExpression; // @beta -export function subtract(left: Expr, right: Expr): FunctionExpr; +export function subtract(left: Expression, right: Expression): FunctionExpression; // @beta -export function subtract(expression: Expr, value: unknown): FunctionExpr; +export function subtract(expression: Expression, value: unknown): FunctionExpression; // @beta -export function subtract(fieldName: string, expression: Expr): FunctionExpr; +export function subtract(fieldName: string, expression: Expression): FunctionExpression; // @beta -export function subtract(fieldName: string, value: unknown): FunctionExpr; +export function subtract(fieldName: string, value: unknown): FunctionExpression; // @beta -export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; +export function timestampAdd(timestamp: Expression, unit: Expression, amount: Expression): FunctionExpression; // @beta -export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampAdd(timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; +export function timestampSubtract(timestamp: Expression, unit: Expression, amount: Expression): FunctionExpression; // @beta -export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampSubtract(timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampSub(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampSubtract(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampToUnixMicros(expr: Expr): FunctionExpr; +export function timestampToUnixMicros(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixMicros(fieldName: string): FunctionExpr; +export function timestampToUnixMicros(fieldName: string): FunctionExpression; // @beta -export function timestampToUnixMillis(expr: Expr): FunctionExpr; +export function timestampToUnixMillis(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixMillis(fieldName: string): FunctionExpr; +export function timestampToUnixMillis(fieldName: string): FunctionExpression; // @beta -export function timestampToUnixSeconds(expr: Expr): FunctionExpr; +export function timestampToUnixSeconds(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixSeconds(fieldName: string): FunctionExpr; +export function timestampToUnixSeconds(fieldName: string): FunctionExpression; // @beta -export function toLower(fieldName: string): FunctionExpr; +export function toLower(fieldName: string): FunctionExpression; // @beta -export function toLower(stringExpression: Expr): FunctionExpr; +export function toLower(stringExpression: Expression): FunctionExpression; // @beta -export function toUpper(fieldName: string): FunctionExpr; +export function toUpper(fieldName: string): FunctionExpression; // @beta -export function toUpper(stringExpression: Expr): FunctionExpr; +export function toUpper(stringExpression: Expression): FunctionExpression; // @beta -export function trim(fieldName: string): FunctionExpr; +export function trim(fieldName: string): FunctionExpression; // @beta -export function trim(stringExpression: Expr): FunctionExpr; +export function trim(stringExpression: Expression): FunctionExpression; + +// @public +export type UnionStageOptions = StageOptions & { + other: Pipeline; +}; // @beta -export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; +export function unixMicrosToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; +export function unixMicrosToTimestamp(fieldName: string): FunctionExpression; // @beta -export function unixMillisToTimestamp(expr: Expr): FunctionExpr; +export function unixMillisToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixMillisToTimestamp(fieldName: string): FunctionExpr; +export function unixMillisToTimestamp(fieldName: string): FunctionExpression; // @beta -export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; +export function unixSecondsToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; +export function unixSecondsToTimestamp(fieldName: string): FunctionExpression; + +// @public +export type UnnestStageOptions = StageOptions & { + selectable: Selectable; + indexField?: string; +}; // @beta -export function vectorLength(vectorExpression: Expr): FunctionExpr; +export function vectorLength(vectorExpression: Expression): FunctionExpression; // @beta -export function vectorLength(fieldName: string): FunctionExpr; +export function vectorLength(fieldName: string): FunctionExpression; -// @beta (undocumented) -export class Where implements Stage { - constructor(condition: BooleanExpr); - // (undocumented) - name: string; -} +// @public +export type WhereStageOptions = StageOptions & { + condition: BooleanExpression; +}; // @beta -export function xor(first: BooleanExpr, second: BooleanExpr, ...additionalConditions: BooleanExpr[]): BooleanExpr; +export function xor(first: BooleanExpression, second: BooleanExpression, ...additionalConditions: BooleanExpression[]): BooleanExpression; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:4613:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:4614:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:55:5 - (ae-incompatible-release-tags) The symbol "fields" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:92:5 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AliasedAggregate" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:97:5 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:606:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:862:5 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:2871:5 - (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5095:5 - (ae-incompatible-release-tags) The symbol "fields" is marked as @public, but its signature references "Field" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5105:5 - (ae-incompatible-release-tags) The symbol "map" is marked as @public, but its signature references "Expression" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5175:5 - (ae-incompatible-release-tags) The symbol "selections" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5185:5 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5734:5 - (ae-incompatible-release-tags) The symbol "other" is marked as @public, but its signature references "Pipeline" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5834:5 - (ae-incompatible-release-tags) The symbol "selectable" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/pipelines.d.ts:5876:5 - (ae-incompatible-release-tags) The symbol "condition" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta // (No @packageDocumentation comment for this package) diff --git a/common/api-review/firestore-pipelines.api.md b/common/api-review/firestore-pipelines.api.md index baedbf6b08a..add73ae322f 100644 --- a/common/api-review/firestore-pipelines.api.md +++ b/common/api-review/firestore-pipelines.api.md @@ -6,297 +6,313 @@ import { FirebaseApp } from '@firebase/app'; +// Warning: (ae-incompatible-release-tags) The symbol "abs" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "abs" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function abs(expr: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "abs" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function abs(fieldName: string): FunctionExpression; + // @beta -export function add(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function add(first: Expression, second: Expression | unknown): FunctionExpression; // @beta -export function add(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function add(fieldName: string, second: Expression | unknown): FunctionExpression; // @beta (undocumented) -export class AddFields implements Stage { - constructor(fields: Map); - // (undocumented) - name: string; -} +export class AddFields extends Stage { + constructor(fields: Map, options: StageOptions); + } + +// @public +export type AddFieldsStageOptions = StageOptions & { + fields: Selectable[]; +}; // @beta (undocumented) -export class Aggregate implements Stage { - constructor(accumulators: Map, groups: Map); - // (undocumented) - name: string; -} +export class Aggregate extends Stage { + constructor(groups: Map, accumulators: Map, options: StageOptions); + } // @beta export class AggregateFunction { - constructor(name: string, params: Expr[]); - as(name: string): AggregateWithAlias; + constructor(name: string, params: Expression[]); + as(name: string): AliasedAggregate; // (undocumented) - exprType: ExprType; + exprType: ExpressionType; } +// @public +export type AggregateStageOptions = StageOptions & { + accumulators: AliasedAggregate[]; + groups?: Array; +}; + // @beta -export class AggregateWithAlias { - constructor(aggregate: AggregateFunction, alias: string); +export class AliasedAggregate { + constructor(aggregate: AggregateFunction, alias: string, _methodName: string | undefined); // (undocumented) readonly aggregate: AggregateFunction; // (undocumented) readonly alias: string; } -// @beta -export function and(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; - -// @beta -export function array(elements: unknown[]): FunctionExpr; - -// @beta -export function arrayConcat(firstArray: Expr, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; +// @beta (undocumented) +export class AliasedExpression implements Selectable { + constructor(expr: Expression, alias: string, _methodName: string | undefined); + // (undocumented) + readonly alias: string; + // (undocumented) + readonly expr: Expression; + // (undocumented) + exprType: ExpressionType; + // (undocumented) + selectable: true; +} // @beta -export function arrayConcat(firstArrayField: string, secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; +export function and(first: BooleanExpression, second: BooleanExpression, ...more: BooleanExpression[]): BooleanExpression; // @beta -export function arrayContains(array: Expr, element: Expr): FunctionExpr; +export function array(elements: unknown[]): FunctionExpression; // @beta -export function arrayContains(array: Expr, element: unknown): FunctionExpr; +export function arrayConcat(firstArray: Expression, secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; // @beta -export function arrayContains(fieldName: string, element: Expr): FunctionExpr; +export function arrayConcat(firstArrayField: string, secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; // @beta -export function arrayContains(fieldName: string, element: unknown): BooleanExpr; +export function arrayContains(array: Expression, element: Expression): FunctionExpression; // @beta -export function arrayContainsAll(array: Expr, values: Array): BooleanExpr; +export function arrayContains(array: Expression, element: unknown): FunctionExpression; // @beta -export function arrayContainsAll(fieldName: string, values: Array): BooleanExpr; +export function arrayContains(fieldName: string, element: Expression): FunctionExpression; // @beta -export function arrayContainsAll(array: Expr, arrayExpression: Expr): BooleanExpr; +export function arrayContains(fieldName: string, element: unknown): BooleanExpression; // @beta -export function arrayContainsAll(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function arrayContainsAll(array: Expression, values: Array): BooleanExpression; // @beta -export function arrayContainsAny(array: Expr, values: Array): BooleanExpr; +export function arrayContainsAll(fieldName: string, values: Array): BooleanExpression; // @beta -export function arrayContainsAny(fieldName: string, values: Array): BooleanExpr; +export function arrayContainsAll(array: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; +export function arrayContainsAll(fieldName: string, arrayExpression: Expression): BooleanExpression; // @beta -export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; +export function arrayContainsAny(array: Expression, values: Array): BooleanExpression; // @beta -export function arrayLength(array: Expr): FunctionExpr; +export function arrayContainsAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function arrayOffset(arrayField: string, offset: number): FunctionExpr; +export function arrayContainsAny(array: Expression, values: Expression): BooleanExpression; // @beta -export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; +export function arrayContainsAny(fieldName: string, values: Expression): BooleanExpression; // @beta -export function arrayOffset(arrayExpression: Expr, offset: number): FunctionExpr; +export function arrayGet(arrayField: string, offset: number): FunctionExpression; // @beta -export function arrayOffset(arrayExpression: Expr, offsetExpr: Expr): FunctionExpr; +export function arrayGet(arrayField: string, offsetExpr: Expression): FunctionExpression; // @beta -export function ascending(expr: Expr): Ordering; +export function arrayGet(arrayExpression: Expression, offset: number): FunctionExpression; // @beta -export function ascending(fieldName: string): Ordering; +export function arrayGet(arrayExpression: Expression, offsetExpr: Expression): FunctionExpression; // @beta -export function avg(expression: Expr): AggregateFunction; +export function arrayLength(fieldName: string): FunctionExpression; // @beta -export function avg(fieldName: string): AggregateFunction; +export function arrayLength(array: Expression): FunctionExpression; -// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "arraySum" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta // -// @beta -export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; - -// @beta -export function bitAnd(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; - -// @beta -export function bitAnd(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; - -// @beta -export function bitLeftShift(field: string, y: number): FunctionExpr; - -// @beta -export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; - -// @beta -export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; - -// @beta -export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; - -// @beta -export function bitNot(field: string): FunctionExpr; - -// @beta -export function bitNot(bitsValueExpression: Expr): FunctionExpr; - -// @beta -export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; +// @public +export function arraySum(fieldName: string): FunctionExpression; -// @beta -export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "arraySum" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "arraySum" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function arraySum(expression: Expression): FunctionExpression; // @beta -export function bitOr(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; +export function ascending(expr: Expression): Ordering; // @beta -export function bitOr(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; +export function ascending(fieldName: string): Ordering; // @beta -export function bitRightShift(field: string, y: number): FunctionExpr; +export function average(expression: Expression): AggregateFunction; // @beta -export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; +export function average(fieldName: string): AggregateFunction; // @beta -export function bitRightShift(xValue: Expr, y: number): FunctionExpr; +export class BooleanExpression extends FunctionExpression { + conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression; + countIf(): AggregateFunction; + // (undocumented) + filterable: true; + ifError(catchValue: BooleanExpression): BooleanExpression; + not(): BooleanExpression; +} // @beta -export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; +export function byteLength(expr: Expression): FunctionExpression; // @beta -export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; +export function byteLength(fieldName: string): FunctionExpression; -// @beta -export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ceil" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function ceil(fieldName: string): FunctionExpression; -// @beta -export function bitXor(bitsExpression: Expr, otherBits: number | Bytes): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ceil" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "ceil" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function ceil(expression: Expression): FunctionExpression; // @beta -export function bitXor(bitsExpression: Expr, otherBitsExpression: Expr): FunctionExpr; +export function charLength(fieldName: string): FunctionExpression; // @beta -export class BooleanExpr extends FunctionExpr { - countIf(): AggregateFunction; - // (undocumented) - filterable: true; - not(): BooleanExpr; -} +export function charLength(stringExpression: Expression): FunctionExpression; -// @beta -export function byteLength(expr: Expr): FunctionExpr; +// @beta (undocumented) +export class CollectionGroupSource extends Stage { + constructor(collectionId: string, options: StageOptions); + } -// @beta -export function byteLength(fieldName: string): FunctionExpr; +// @public +export type CollectionGroupStageOptions = StageOptions & { + collectionId: string; + forceIndex?: string; +}; -// @beta -export function charLength(fieldName: string): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "collectionId" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function collectionId(fieldName: string): FunctionExpression; -// @beta -export function charLength(stringExpression: Expr): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "collectionId" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "collectionId" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function collectionId(expression: Expression): FunctionExpression; // @beta (undocumented) -export class CollectionGroupSource implements Stage { - constructor(collectionId: string); - // (undocumented) - name: string; -} +export class CollectionSource extends Stage { + constructor(collection: string, options: StageOptions); + } -// @beta (undocumented) -export class CollectionSource implements Stage { - constructor(collectionPath: string); - // (undocumented) - name: string; -} +// @public +export type CollectionStageOptions = StageOptions & { + collection: string | Query; + forceIndex?: string; +}; -// @beta -export function cond(condition: BooleanExpr, thenExpr: Expr, elseExpr: Expr): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "concat" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "concat" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function concat(first: Expression, second: Expression | unknown, ...others: Array): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "concat" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "concat" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function concat(fieldName: string, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export class Constant extends Expr { - // (undocumented) - readonly exprType: ExprType; - } +export function conditional(condition: BooleanExpression, thenExpr: Expression, elseExpr: Expression): FunctionExpression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: number): Constant; +export function constant(value: number): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: string): Constant; +export function constant(value: string): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta // // @public -export function constant(value: boolean): Constant; +export function constant(value: boolean): BooleanExpression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: null): Constant; +export function constant(value: null): Expression; // Warning: (ae-forgotten-export) The symbol "GeoPoint" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: GeoPoint): Constant; +export function constant(value: GeoPoint): Expression; // Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Timestamp): Constant; +export function constant(value: Timestamp): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Date): Constant; +export function constant(value: Date): Expression; -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-forgotten-export) The symbol "Bytes" needs to be exported by the entry point pipelines.d.ts +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: Bytes): Constant; +export function constant(value: Bytes): Expression; // Warning: (ae-forgotten-export) The symbol "DocumentReference" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: DocumentReference): Constant; +export function constant(value: DocumentReference): Expression; // Warning: (ae-forgotten-export) The symbol "VectorValue" needs to be exported by the entry point pipelines.d.ts -// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Constant" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "constant" is marked as @public, but its signature references "Expression" which is marked as @beta // // @public -export function constant(value: VectorValue): Constant; +export function constant(value: VectorValue): Expression; // @beta -export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function cosineDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function cosineDistance(vectorExpression: Expr, vector: number[] | Expr): FunctionExpr; +export function cosineDistance(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function cosineDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function cosineDistance(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; // @beta -export function count(expression: Expr): AggregateFunction; +export function count(expression: Expression): AggregateFunction; // Warning: (ae-incompatible-release-tags) The symbol "count" is marked as @public, but its signature references "AggregateFunction" which is marked as @beta // @@ -306,385 +322,414 @@ export function count(fieldName: string): AggregateFunction; // @beta export function countAll(): AggregateFunction; +// Warning: (ae-incompatible-release-tags) The symbol "countDistinct" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "countDistinct" is marked as @public, but its signature references "AggregateFunction" which is marked as @beta +// +// @public +export function countDistinct(expr: Expression | string): AggregateFunction; + // @beta -export function countIf(booleanExpr: BooleanExpr): AggregateFunction; +export function countIf(booleanExpr: BooleanExpression): AggregateFunction; // @beta -export function currentContext(): FunctionExpr; +export function currentTimestamp(): FunctionExpression; // @beta (undocumented) -export class DatabaseSource implements Stage { - // (undocumented) - name: string; +export class DatabaseSource extends Stage { } +// @public +export type DatabaseStageOptions = StageOptions & {}; + // @beta -export function descending(expr: Expr): Ordering; +export function descending(expr: Expression): Ordering; // @beta export function descending(fieldName: string): Ordering; // @beta (undocumented) -export class Distinct implements Stage { - constructor(groups: Map); - // (undocumented) - name: string; -} +export class Distinct extends Stage { + constructor(groups: Map, options: StageOptions); + } + +// @public +export type DistinctStageOptions = StageOptions & { + groups: Array; +}; // @beta -export function divide(left: Expr, right: Expr): FunctionExpr; +export function divide(left: Expression, right: Expression): FunctionExpression; // @beta -export function divide(expression: Expr, value: unknown): FunctionExpr; +export function divide(expression: Expression, value: unknown): FunctionExpression; // @beta -export function divide(fieldName: string, expressions: Expr): FunctionExpr; +export function divide(fieldName: string, expressions: Expression): FunctionExpression; // @beta -export function divide(fieldName: string, value: unknown): FunctionExpr; +export function divide(fieldName: string, value: unknown): FunctionExpression; // @beta -export function documentId(documentPath: string | DocumentReference): FunctionExpr; +export function documentId(documentPath: string | DocumentReference): FunctionExpression; // @beta -export function documentId(documentPathExpr: Expr): FunctionExpr; +export function documentId(documentPathExpr: Expression): FunctionExpression; // @beta (undocumented) -export class DocumentsSource implements Stage { - constructor(docPaths: string[]); - // (undocumented) - name: string; - // (undocumented) - static of(refs: Array): DocumentsSource; -} +export class DocumentsSource extends Stage { + constructor(docPaths: string[], options: StageOptions); + } + +// @public +export type DocumentsStageOptions = StageOptions & { + docs: Array; +}; // @beta -export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function dotProduct(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function dotProduct(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function dotProduct(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function dotProduct(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function dotProduct(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; // @beta -export function endsWith(fieldName: string, suffix: string): BooleanExpr; +export function endsWith(fieldName: string, suffix: string): BooleanExpression; // @beta -export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; +export function endsWith(fieldName: string, suffix: Expression): BooleanExpression; // @beta -export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; +export function endsWith(stringExpression: Expression, suffix: string): BooleanExpression; // @beta -export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; +export function endsWith(stringExpression: Expression, suffix: Expression): BooleanExpression; // @beta -export function eq(left: Expr, right: Expr): BooleanExpr; +export function equal(left: Expression, right: Expression): BooleanExpression; // @beta -export function eq(expression: Expr, value: unknown): BooleanExpr; +export function equal(expression: Expression, value: unknown): BooleanExpression; // @beta -export function eq(fieldName: string, expression: Expr): BooleanExpr; +export function equal(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function eq(fieldName: string, value: unknown): BooleanExpr; +export function equal(fieldName: string, value: unknown): BooleanExpression; // @beta -export function eqAny(expression: Expr, values: Array): BooleanExpr; +export function equalAny(expression: Expression, values: Array): BooleanExpression; // @beta -export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; +export function equalAny(expression: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function eqAny(fieldName: string, values: Array): BooleanExpr; +export function equalAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function equalAny(fieldName: string, arrayExpression: Expression): BooleanExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "error" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function error(message: string): Expression; // @beta -export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function euclideanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression; // @beta -export function euclideanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function euclideanDistance(fieldName: string, vectorExpression: Expression): FunctionExpression; // @beta -export function euclideanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function euclideanDistance(vectorExpression: Expression, vector: number[] | VectorValue): FunctionExpression; // @beta -export function euclideanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function euclideanDistance(vectorExpression: Expression, otherVectorExpression: Expression): FunctionExpression; // @public export function execute(pipeline: Pipeline): Promise; +// @public (undocumented) +export function execute(options: PipelineExecuteOptions): Promise; + // @beta -export function exists(value: Expr): BooleanExpr; +export function exists(value: Expression): BooleanExpression; // @beta -export function exists(fieldName: string): BooleanExpr; +export function exists(fieldName: string): BooleanExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "exp" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "exp" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function exp(expression: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "exp" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function exp(fieldName: string): FunctionExpression; // @beta -export abstract class Expr { - add(second: Expr | unknown, ...others: Array): FunctionExpr; +export abstract class Expression { + abs(): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayConcat(secondArray: Expr | unknown[], ...otherArrays: Array): FunctionExpr; + add(second: Expression | unknown): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayContains(expression: Expr): BooleanExpr; + arrayConcat(secondArray: Expression | unknown[], ...otherArrays: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayContains(value: unknown): BooleanExpr; + arrayContains(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAll(values: Array): BooleanExpr; + arrayContains(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAll(arrayExpression: Expr): BooleanExpr; + arrayContainsAll(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAny(values: Array): BooleanExpr; + arrayContainsAll(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayContainsAny(arrayExpression: Expr): BooleanExpr; + arrayContainsAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayLength(): FunctionExpr; + arrayContainsAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - arrayOffset(offset: number): FunctionExpr; + arrayGet(offset: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - arrayOffset(offsetExpr: Expr): FunctionExpr; + arrayGet(offsetExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - as(name: string): ExprWithAlias; + arrayLength(): FunctionExpression; + /* Excluded from this release type: _readUserData */ + arrayReverse(): FunctionExpression; + /* Excluded from this release type: _readUserData */ + arraySum(): FunctionExpression; + /* Excluded from this release type: _readUserData */ + as(name: string): AliasedExpression; /* Excluded from this release type: _readUserData */ ascending(): Ordering; /* Excluded from this release type: _readUserData */ - avg(): AggregateFunction; + average(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitAnd(otherBits: number | Bytes): FunctionExpr; + byteLength(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitAnd(bitsExpression: Expr): FunctionExpr; + ceil(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitLeftShift(y: number): FunctionExpr; + charLength(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitLeftShift(numberExpr: Expr): FunctionExpr; + collectionId(): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitNot(): FunctionExpr; + concat(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitOr(otherBits: number | Bytes): FunctionExpr; + cosineDistance(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitOr(bitsExpression: Expr): FunctionExpr; + cosineDistance(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - bitRightShift(y: number): FunctionExpr; + count(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitRightShift(numberExpr: Expr): FunctionExpr; + countDistinct(): AggregateFunction; /* Excluded from this release type: _readUserData */ - bitXor(otherBits: number | Bytes): FunctionExpr; + descending(): Ordering; /* Excluded from this release type: _readUserData */ - bitXor(bitsExpression: Expr): FunctionExpr; + divide(divisor: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - byteLength(): FunctionExpr; + divide(divisor: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - charLength(): FunctionExpr; + documentId(): FunctionExpression; /* Excluded from this release type: _readUserData */ - cosineDistance(vectorExpression: Expr): FunctionExpr; + dotProduct(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - cosineDistance(vector: VectorValue | number[]): FunctionExpr; + dotProduct(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - count(): AggregateFunction; + endsWith(suffix: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - descending(): Ordering; + endsWith(suffix: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - divide(other: Expr): FunctionExpr; + equal(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - divide(other: unknown): FunctionExpr; + equal(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - documentId(): FunctionExpr; + equalAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - dotProduct(vectorExpression: Expr): FunctionExpr; + equalAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - dotProduct(vector: VectorValue | number[]): FunctionExpr; + euclideanDistance(vectorExpression: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - endsWith(suffix: string): BooleanExpr; + euclideanDistance(vector: VectorValue | number[]): FunctionExpression; /* Excluded from this release type: _readUserData */ - endsWith(suffix: Expr): BooleanExpr; + exists(): BooleanExpression; /* Excluded from this release type: _readUserData */ - eq(expression: Expr): BooleanExpr; + exp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - eq(value: unknown): BooleanExpr; + // (undocumented) + abstract readonly expressionType: ExpressionType; /* Excluded from this release type: _readUserData */ - eqAny(values: Array): BooleanExpr; + floor(): FunctionExpression; /* Excluded from this release type: _readUserData */ - eqAny(arrayExpression: Expr): BooleanExpr; + greaterThan(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - euclideanDistance(vectorExpression: Expr): FunctionExpr; + greaterThan(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - euclideanDistance(vector: VectorValue | number[]): FunctionExpr; + greaterThanOrEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - exists(): BooleanExpr; + greaterThanOrEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - // (undocumented) - abstract readonly exprType: ExprType; + ifAbsent(elseValue: unknown): Expression; /* Excluded from this release type: _readUserData */ - gt(expression: Expr): BooleanExpr; + ifAbsent(elseExpression: unknown): Expression; /* Excluded from this release type: _readUserData */ - gt(value: unknown): BooleanExpr; + ifError(catchExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - gte(expression: Expr): BooleanExpr; + ifError(catchValue: unknown): FunctionExpression; /* Excluded from this release type: _readUserData */ - gte(value: unknown): BooleanExpr; + isAbsent(): BooleanExpression; /* Excluded from this release type: _readUserData */ - ifError(catchExpr: Expr): FunctionExpr; + isError(): BooleanExpression; /* Excluded from this release type: _readUserData */ - ifError(catchValue: unknown): FunctionExpr; + isNan(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isAbsent(): BooleanExpr; + isNotNan(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isError(): BooleanExpr; + isNotNull(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isNan(): BooleanExpr; + isNull(): BooleanExpression; /* Excluded from this release type: _readUserData */ - isNotNan(): BooleanExpr; + join(delimiterExpression: Expression): Expression; /* Excluded from this release type: _readUserData */ - isNotNull(): BooleanExpr; + join(delimiter: string): Expression; /* Excluded from this release type: _readUserData */ - isNull(): BooleanExpr; + length(): FunctionExpression; /* Excluded from this release type: _readUserData */ - like(pattern: string): FunctionExpr; + lessThan(experession: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - like(pattern: Expr): FunctionExpr; + lessThan(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - logicalMaximum(second: Expr | unknown, ...others: Array): FunctionExpr; + lessThanOrEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - logicalMinimum(second: Expr | unknown, ...others: Array): FunctionExpr; + lessThanOrEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - lt(experession: Expr): BooleanExpr; + like(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - lt(value: unknown): BooleanExpr; + like(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - lte(expression: Expr): BooleanExpr; + ln(): FunctionExpression; /* Excluded from this release type: _readUserData */ - lte(value: unknown): BooleanExpr; + log10(): FunctionExpression; /* Excluded from this release type: _readUserData */ - manhattanDistance(vector: VectorValue | number[]): FunctionExpr; + logicalMaximum(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - manhattanDistance(vectorExpression: Expr): FunctionExpr; + logicalMinimum(second: Expression | unknown, ...others: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapGet(subfield: string): FunctionExpr; + mapGet(subfield: string): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapMerge(secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; + mapMerge(secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapRemove(key: string): FunctionExpr; + mapRemove(key: string): FunctionExpression; /* Excluded from this release type: _readUserData */ - mapRemove(keyExpr: Expr): FunctionExpr; + mapRemove(keyExpr: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ maximum(): AggregateFunction; /* Excluded from this release type: _readUserData */ minimum(): AggregateFunction; /* Excluded from this release type: _readUserData */ - mod(expression: Expr): FunctionExpr; + mod(expression: Expression): FunctionExpression; + /* Excluded from this release type: _readUserData */ + mod(value: number): FunctionExpression; + /* Excluded from this release type: _readUserData */ + multiply(second: Expression | number): FunctionExpression; /* Excluded from this release type: _readUserData */ - mod(value: unknown): FunctionExpr; + notEqual(expression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - multiply(second: Expr | unknown, ...others: Array): FunctionExpr; + notEqual(value: unknown): BooleanExpression; /* Excluded from this release type: _readUserData */ - neq(expression: Expr): BooleanExpr; + notEqualAny(values: Array): BooleanExpression; /* Excluded from this release type: _readUserData */ - neq(value: unknown): BooleanExpr; + notEqualAny(arrayExpression: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - notEqAny(values: Array): BooleanExpr; + pow(exponent: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - notEqAny(arrayExpression: Expr): BooleanExpr; + pow(exponent: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - regexContains(pattern: string): BooleanExpr; + regexContains(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - regexContains(pattern: Expr): BooleanExpr; + regexContains(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - regexMatch(pattern: string): BooleanExpr; + regexMatch(pattern: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - regexMatch(pattern: Expr): BooleanExpr; + regexMatch(pattern: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - replaceAll(find: string, replace: string): FunctionExpr; + reverse(): FunctionExpression; /* Excluded from this release type: _readUserData */ - replaceAll(find: Expr, replace: Expr): FunctionExpr; + round(): FunctionExpression; /* Excluded from this release type: _readUserData */ - replaceFirst(find: string, replace: string): FunctionExpr; + round(decimalPlaces: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - replaceFirst(find: Expr, replace: Expr): FunctionExpr; + round(decimalPlaces: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - reverse(): FunctionExpr; + sqrt(): FunctionExpression; /* Excluded from this release type: _readUserData */ - startsWith(prefix: string): BooleanExpr; + startsWith(prefix: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - startsWith(prefix: Expr): BooleanExpr; + startsWith(prefix: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - strConcat(secondString: Expr | string, ...otherStrings: Array): FunctionExpr; + stringConcat(secondString: Expression | string, ...otherStrings: Array): FunctionExpression; /* Excluded from this release type: _readUserData */ - strContains(substring: string): BooleanExpr; + stringContains(substring: string): BooleanExpression; /* Excluded from this release type: _readUserData */ - strContains(expr: Expr): BooleanExpr; + stringContains(expr: Expression): BooleanExpression; /* Excluded from this release type: _readUserData */ - substr(position: number, length?: number): FunctionExpr; + stringReverse(): FunctionExpression; /* Excluded from this release type: _readUserData */ - substr(position: Expr, length?: Expr): FunctionExpr; + substring(position: number, length?: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - subtract(other: Expr): FunctionExpr; + substring(position: Expression, length?: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - subtract(other: unknown): FunctionExpr; + subtract(subtrahend: Expression): FunctionExpression; + /* Excluded from this release type: _readUserData */ + subtract(subtrahend: number): FunctionExpression; /* Excluded from this release type: _readUserData */ sum(): AggregateFunction; /* Excluded from this release type: _readUserData */ - timestampAdd(unit: Expr, amount: Expr): FunctionExpr; + timestampAdd(unit: Expression, amount: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampSub(unit: Expr, amount: Expr): FunctionExpr; + timestampSubtract(unit: Expression, amount: Expression): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampSub(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; + timestampSubtract(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixMicros(): FunctionExpr; + timestampToUnixMicros(): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixMillis(): FunctionExpr; + timestampToUnixMillis(): FunctionExpression; /* Excluded from this release type: _readUserData */ - timestampToUnixSeconds(): FunctionExpr; + timestampToUnixSeconds(): FunctionExpression; /* Excluded from this release type: _readUserData */ - toLower(): FunctionExpr; + toLower(): FunctionExpression; /* Excluded from this release type: _readUserData */ - toUpper(): FunctionExpr; + toUpper(): FunctionExpression; /* Excluded from this release type: _readUserData */ - trim(): FunctionExpr; + trim(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixMicrosToTimestamp(): FunctionExpr; + unixMicrosToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixMillisToTimestamp(): FunctionExpr; + unixMillisToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - unixSecondsToTimestamp(): FunctionExpr; + unixSecondsToTimestamp(): FunctionExpression; /* Excluded from this release type: _readUserData */ - vectorLength(): FunctionExpr; + vectorLength(): FunctionExpression; } // @beta -export type ExprType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExprs' | 'ExprWithAlias'; - -// @beta (undocumented) -export class ExprWithAlias implements Selectable { - constructor(expr: Expr, alias: string); - // (undocumented) - readonly alias: string; - // (undocumented) - readonly expr: Expr; - // (undocumented) - exprType: ExprType; - // (undocumented) - selectable: true; -} +export type ExpressionType = 'Field' | 'Constant' | 'Function' | 'AggregateFunction' | 'ListOfExpressions' | 'AliasedExpression'; // @beta -export class Field extends Expr implements Selectable { +export class Field extends Expression implements Selectable { // (undocumented) get alias(): string; // (undocumented) - get expr(): Expr; + get expr(): Expression; // (undocumented) - readonly exprType: ExprType; + readonly expressionType: ExpressionType; // (undocumented) - fieldName(): string; + get fieldName(): string; // (undocumented) selectable: true; } @@ -701,316 +746,438 @@ export function field(name: string): Field; export function field(path: FieldPath): Field; // @beta (undocumented) -export class FindNearest implements Stage { - // (undocumented) - name: string; -} +export class FindNearest extends Stage { + constructor(vectorValue: Expression, field: Field, distanceMeasure: 'euclidean' | 'cosine' | 'dot_product', options: StageOptions); + } -// @beta (undocumented) -export interface FindNearestOptions { - // (undocumented) - distanceField?: string; - // (undocumented) - distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; - // (undocumented) +// @public +export type FindNearestStageOptions = StageOptions & { field: Field | string; - // (undocumented) - limit?: number; - // (undocumented) vectorValue: VectorValue | number[]; -} + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + limit?: number; + distanceField?: string; +}; -// @beta -export class FunctionExpr extends Expr { - constructor(name: string, params: Expr[]); - // (undocumented) - readonly exprType: ExprType; - } +// Warning: (ae-incompatible-release-tags) The symbol "floor" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "floor" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function floor(expr: Expression): FunctionExpression; -// @beta (undocumented) -export class GenericStage implements Stage { +// Warning: (ae-incompatible-release-tags) The symbol "floor" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function floor(fieldName: string): FunctionExpression; + +// @beta +export class FunctionExpression extends Expression { + constructor(name: string, params: Expression[]); + constructor(name: string, params: Expression[], _methodName: string | undefined); // (undocumented) - name: string; + readonly expressionType: ExpressionType; } // @beta -export function gt(left: Expr, right: Expr): BooleanExpr; +export function greaterThan(left: Expression, right: Expression): BooleanExpression; // @beta -export function gt(expression: Expr, value: unknown): BooleanExpr; +export function greaterThan(expression: Expression, value: unknown): BooleanExpression; // @beta -export function gt(fieldName: string, expression: Expr): BooleanExpr; +export function greaterThan(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function gt(fieldName: string, value: unknown): BooleanExpr; +export function greaterThan(fieldName: string, value: unknown): BooleanExpression; // @beta -export function gte(left: Expr, right: Expr): BooleanExpr; +export function greaterThanOrEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function gte(expression: Expr, value: unknown): BooleanExpr; +export function greaterThanOrEqual(expression: Expression, value: unknown): BooleanExpression; // @beta -export function gte(fieldName: string, value: Expr): BooleanExpr; +export function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression; // @beta -export function gte(fieldName: string, value: unknown): BooleanExpr; +export function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression; -// @beta -export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ifAbsent" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function ifAbsent(ifExpr: Expression, elseExpr: Expression): Expression; -// @beta -export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ifAbsent" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function ifAbsent(ifExpr: Expression, elseValue: unknown): Expression; -// @beta -export function isAbsent(value: Expr): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ifAbsent" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function ifAbsent(ifFieldName: string, elseExpr: Expression): Expression; + +// Warning: (ae-incompatible-release-tags) The symbol "ifAbsent" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function ifAbsent(ifFieldName: string | Expression, elseValue: Expression | unknown): Expression; // @beta -export function isAbsent(field: string): BooleanExpr; +export function ifError(tryExpr: BooleanExpression, catchExpr: BooleanExpression): BooleanExpression; // @beta -export function isError(value: Expr): BooleanExpr; +export function ifError(tryExpr: Expression, catchExpr: Expression): FunctionExpression; // @beta -export function isNan(value: Expr): BooleanExpr; +export function ifError(tryExpr: Expression, catchValue: unknown): FunctionExpression; // @beta -export function isNan(fieldName: string): BooleanExpr; +export function isAbsent(value: Expression): BooleanExpression; // @beta -export function isNotNan(value: Expr): BooleanExpr; +export function isAbsent(field: string): BooleanExpression; // @beta -export function isNotNan(value: string): BooleanExpr; +export function isError(value: Expression): BooleanExpression; // @beta -export function isNotNull(value: Expr): BooleanExpr; +export function isNan(value: Expression): BooleanExpression; // @beta -export function isNotNull(value: string): BooleanExpr; +export function isNan(fieldName: string): BooleanExpression; // @beta -export function isNull(value: Expr): BooleanExpr; +export function isNotNan(value: Expression): BooleanExpression; // @beta -export function isNull(value: string): BooleanExpr; +export function isNotNan(value: string): BooleanExpression; // @beta -export function like(fieldName: string, pattern: string): BooleanExpr; +export function isNotNull(value: Expression): BooleanExpression; // @beta -export function like(fieldName: string, pattern: Expr): BooleanExpr; +export function isNotNull(value: string): BooleanExpression; // @beta -export function like(stringExpression: Expr, pattern: string): BooleanExpr; +export function isNull(value: Expression): BooleanExpression; // @beta -export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; +export function isNull(value: string): BooleanExpression; -// @beta (undocumented) -export class Limit implements Stage { - constructor(limit: number, convertedFromLimitTolast?: boolean); - // (undocumented) - readonly convertedFromLimitTolast: boolean; - // (undocumented) - readonly limit: number; - // (undocumented) - name: string; -} +// Warning: (ae-incompatible-release-tags) The symbol "join" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function join(arrayFieldName: string, delimiter: string): Expression; + +// Warning: (ae-incompatible-release-tags) The symbol "join" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function join(arrayExpression: Expression, delimiterExpression: Expression): Expression; + +// Warning: (ae-incompatible-release-tags) The symbol "join" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function join(arrayExpression: Expression, delimiter: string): Expression; + +// Warning: (ae-incompatible-release-tags) The symbol "join" is marked as @public, but its signature references "Expression" which is marked as @beta +// +// @public +export function join(arrayFieldName: string, delimiterExpression: Expression): Expression; + +// Warning: (ae-incompatible-release-tags) The symbol "len" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function len(fieldName: string): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "len" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "len" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function len(expression: Expression): FunctionExpression; // @beta -export function logicalMaximum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(left: Expression, right: Expression): BooleanExpression; // @beta -export function logicalMaximum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(expression: Expression, value: unknown): BooleanExpression; // @beta -export function logicalMinimum(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function logicalMinimum(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function lessThan(fieldName: string, value: unknown): BooleanExpression; // @beta -export function lt(left: Expr, right: Expr): BooleanExpr; +export function lessThanOrEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function lt(expression: Expr, value: unknown): BooleanExpr; +export function lessThanOrEqual(expression: Expression, value: unknown): BooleanExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "lessThanOrEqual" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "lessThanOrEqual" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta +// +// @public +export function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression; + +// @beta +export function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression; // @beta -export function lt(fieldName: string, expression: Expr): BooleanExpr; +export function like(fieldName: string, pattern: string): BooleanExpression; // @beta -export function lt(fieldName: string, value: unknown): BooleanExpr; +export function like(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function lte(left: Expr, right: Expr): BooleanExpr; +export function like(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function lte(expression: Expr, value: unknown): BooleanExpr; +export function like(stringExpression: Expression, pattern: Expression): BooleanExpression; -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "Expr" which is marked as @beta -// Warning: (ae-incompatible-release-tags) The symbol "lte" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta +// @beta (undocumented) +export class Limit extends Stage { + constructor(limit: number, options: StageOptions); + } + +// @public +export type LimitStageOptions = StageOptions & { + limit: number; +}; + +// Warning: (ae-incompatible-release-tags) The symbol "ln" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta // // @public -export function lte(fieldName: string, expression: Expr): BooleanExpr; +export function ln(fieldName: string): FunctionExpression; -// @beta -export function lte(fieldName: string, value: unknown): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "ln" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "ln" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function ln(expression: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log(expression: Expression, base: number): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log(expression: Expression, base: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log(fieldName: string, base: number): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "log" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log(fieldName: string, base: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log10" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log10(fieldName: string): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "log10" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "log10" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function log10(expression: Expression): FunctionExpression; // @beta -export function manhattanDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpr; +export function logicalMaximum(first: Expression, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(fieldName: string, vectorExpression: Expr): FunctionExpr; +export function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(vectorExpression: Expr, vector: number[] | VectorValue): FunctionExpr; +export function logicalMinimum(first: Expression, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function manhattanDistance(vectorExpression: Expr, otherVectorExpression: Expr): FunctionExpr; +export function logicalMinimum(fieldName: string, second: Expression | unknown, ...others: Array): FunctionExpression; // @beta -export function map(elements: Record): FunctionExpr; +export function map(elements: Record): FunctionExpression; // @beta -export function mapGet(fieldName: string, subField: string): FunctionExpr; +export function mapGet(fieldName: string, subField: string): FunctionExpression; // @beta -export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; +export function mapGet(mapExpression: Expression, subField: string): FunctionExpression; // @beta -export function mapMerge(mapField: string, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; +export function mapMerge(mapField: string, secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; // @beta -export function mapMerge(firstMap: Record | Expr, secondMap: Record | Expr, ...otherMaps: Array | Expr>): FunctionExpr; +export function mapMerge(firstMap: Record | Expression, secondMap: Record | Expression, ...otherMaps: Array | Expression>): FunctionExpression; // @beta -export function mapRemove(mapField: string, key: string): FunctionExpr; +export function mapRemove(mapField: string, key: string): FunctionExpression; // @beta -export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; +export function mapRemove(mapExpr: Expression, key: string): FunctionExpression; // @beta -export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; +export function mapRemove(mapField: string, keyExpr: Expression): FunctionExpression; // @beta -export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; +export function mapRemove(mapExpr: Expression, keyExpr: Expression): FunctionExpression; // @beta -export function maximum(expression: Expr): AggregateFunction; +export function maximum(expression: Expression): AggregateFunction; // @beta export function maximum(fieldName: string): AggregateFunction; // @beta -export function minimum(expression: Expr): AggregateFunction; +export function minimum(expression: Expression): AggregateFunction; // @beta export function minimum(fieldName: string): AggregateFunction; // @beta -export function mod(left: Expr, right: Expr): FunctionExpr; +export function mod(left: Expression, right: Expression): FunctionExpression; // @beta -export function mod(expression: Expr, value: unknown): FunctionExpr; +export function mod(expression: Expression, value: unknown): FunctionExpression; // @beta -export function mod(fieldName: string, expression: Expr): FunctionExpr; +export function mod(fieldName: string, expression: Expression): FunctionExpression; // @beta -export function mod(fieldName: string, value: unknown): FunctionExpr; +export function mod(fieldName: string, value: unknown): FunctionExpression; // @beta -export function multiply(first: Expr, second: Expr | unknown, ...others: Array): FunctionExpr; +export function multiply(first: Expression, second: Expression | unknown): FunctionExpression; // @beta -export function multiply(fieldName: string, second: Expr | unknown, ...others: Array): FunctionExpr; +export function multiply(fieldName: string, second: Expression | unknown): FunctionExpression; // @beta -export function neq(left: Expr, right: Expr): BooleanExpr; +export function not(booleanExpr: BooleanExpression): BooleanExpression; // @beta -export function neq(expression: Expr, value: unknown): BooleanExpr; +export function notEqual(left: Expression, right: Expression): BooleanExpression; // @beta -export function neq(fieldName: string, expression: Expr): BooleanExpr; +export function notEqual(expression: Expression, value: unknown): BooleanExpression; // @beta -export function neq(fieldName: string, value: unknown): BooleanExpr; +export function notEqual(fieldName: string, expression: Expression): BooleanExpression; // @beta -export function not(booleanExpr: BooleanExpr): BooleanExpr; +export function notEqual(fieldName: string, value: unknown): BooleanExpression; // @beta -export function notEqAny(element: Expr, values: Array): BooleanExpr; +export function notEqualAny(element: Expression, values: Array): BooleanExpression; // @beta -export function notEqAny(fieldName: string, values: Array): BooleanExpr; +export function notEqualAny(fieldName: string, values: Array): BooleanExpression; // @beta -export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; +export function notEqualAny(element: Expression, arrayExpression: Expression): BooleanExpression; // @beta -export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function notEqualAny(fieldName: string, arrayExpression: Expression): BooleanExpression; // @beta (undocumented) -export class Offset implements Stage { - constructor(offset: number); - // (undocumented) - name: string; +export class Offset extends Stage { + constructor(offset: number, options: StageOptions); } +// @public +export type OffsetStageOptions = StageOptions & { + offset: number; +}; + +// @public +export type OneOf = { + [K in keyof T]: Pick & { + [P in Exclude]?: undefined; + }; +}[keyof T]; + // @beta -export function or(first: BooleanExpr, second: BooleanExpr, ...more: BooleanExpr[]): BooleanExpr; +export function or(first: BooleanExpression, second: BooleanExpression, ...more: BooleanExpression[]): BooleanExpression; // @beta export class Ordering { - constructor(expr: Expr, direction: 'ascending' | 'descending'); + constructor(expr: Expression, direction: 'ascending' | 'descending', _methodName: string | undefined); // (undocumented) readonly direction: 'ascending' | 'descending'; // (undocumented) - readonly expr: Expr; + readonly expr: Expression; } // @public (undocumented) export class Pipeline { // Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta - aggregate(accumulator: AggregateWithAlias, ...additionalAccumulators: AggregateWithAlias[]): Pipeline; - aggregate(options: { accumulators: AggregateWithAlias[]; groups?: Array; }): Pipeline; + // (undocumented) + addFields(options: AddFieldsStageOptions): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AliasedAggregate" which is marked as @beta + aggregate(accumulator: AliasedAggregate, ...additionalAccumulators: AliasedAggregate[]): Pipeline; + aggregate(options: AggregateStageOptions): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta distinct(group: string | Selectable, ...additionalGroups: Array): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta - // // (undocumented) - findNearest(options: FindNearestOptions): Pipeline; - genericStage(name: string, params: unknown[]): Pipeline; + distinct(options: DistinctStageOptions): Pipeline; + findNearest(options: FindNearestStageOptions): Pipeline; limit(limit: number): Pipeline; + // (undocumented) + limit(options: LimitStageOptions): Pipeline; offset(offset: number): Pipeline; - readUserData: any; + // (undocumented) + offset(options: OffsetStageOptions): Pipeline; + rawStage(name: string, params: unknown[], options?: { [key: string]: Expression | unknown; }): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "removeFields" is marked as @public, but its signature references "Field" which is marked as @beta removeFields(fieldValue: Field | string, ...additionalFields: Array): Pipeline; - // Warning: (ae-incompatible-release-tags) The symbol "replaceWith" is marked as @public, but its signature references "Field" which is marked as @beta - replaceWith(fieldValue: Field | string): Pipeline; + // (undocumented) + removeFields(options: RemoveFieldsStageOptions): Pipeline; + replaceWith(fieldName: string): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "replaceWith" is marked as @public, but its signature references "Expression" which is marked as @beta + replaceWith(expr: Expression): Pipeline; + // (undocumented) + replaceWith(options: ReplaceWithStageOptions): Pipeline; sample(documents: number): Pipeline; - sample(options: { percentage: number; } | { documents: number; }): Pipeline; + sample(options: SampleStageOptions): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta select(selection: Selectable | string, ...additionalSelections: Array): Pipeline; // (undocumented) - selectablesToMap: any; + select(options: SelectStageOptions): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; // (undocumented) + sort(options: SortStageOptions): Pipeline; + // (undocumented) stages: any; union(other: Pipeline): Pipeline; + // (undocumented) + union(options: UnionStageOptions): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "unnest" is marked as @public, but its signature references "Selectable" which is marked as @beta unnest(selectable: Selectable, indexField?: string): Pipeline; // (undocumented) + unnest(options: UnnestStageOptions): Pipeline; + // (undocumented) userDataReader: any; - // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "BooleanExpr" which is marked as @beta - where(condition: BooleanExpr): Pipeline; + // Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta + where(condition: BooleanExpression): Pipeline; + // (undocumented) + where(options: WhereStageOptions): Pipeline; +} + +// @public +export interface PipelineExecuteOptions { + indexMode?: 'recommended'; + pipeline: Pipeline; + rawOptions?: { + [name: string]: unknown; + }; } // Warning: (ae-forgotten-export) The symbol "DocumentData" needs to be exported by the entry point pipelines.d.ts @@ -1021,278 +1188,379 @@ export class PipelineResult { /* Excluded from this release type: _fields */ /* Excluded from this release type: __constructor */ get createTime(): Timestamp | undefined; - data(): AppModelType | undefined; + data(): AppModelType; get(fieldPath: string | FieldPath | Field): any; get id(): string | undefined; get ref(): DocumentReference | undefined; get updateTime(): Timestamp | undefined; } +// Warning: (ae-incompatible-release-tags) The symbol "pipelineResultEqual" is marked as @public, but its signature references "PipelineResult" which is marked as @beta +// +// @public (undocumented) +export function pipelineResultEqual(left: PipelineResult, right: PipelineResult): boolean; + // @public (undocumented) export class PipelineSnapshot { // Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "PipelineResult" which is marked as @beta constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp); get executionTime(): Timestamp; - get pipeline(): Pipeline; // Warning: (ae-incompatible-release-tags) The symbol "results" is marked as @public, but its signature references "PipelineResult" which is marked as @beta get results(): PipelineResult[]; } // @beta export class PipelineSource { - collection(collectionPath: string): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ - // Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts - collection(collectionReference: Query): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + collection(collection: string | Query): PipelineType; + collection(options: CollectionStageOptions): PipelineType; collectionGroup(collectionId: string): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + collectionGroup(options: CollectionGroupStageOptions): PipelineType; createFrom(query: Query): Pipeline; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ database(): PipelineType; - /* Excluded from this release type: _createPipeline */ - /* Excluded from this release type: __constructor */ + database(options: DatabaseStageOptions): PipelineType; documents(docs: Array): PipelineType; -} + documents(options: DocumentsStageOptions): PipelineType; + } -// @beta -export function rand(): FunctionExpr; +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function pow(base: Expression, exponent: Expression): FunctionExpression; -// @beta -export function regexContains(fieldName: string, pattern: string): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function pow(base: Expression, exponent: number): FunctionExpression; -// @beta -export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function pow(base: string, exponent: Expression): FunctionExpression; -// @beta -export function regexContains(stringExpression: Expr, pattern: string): BooleanExpr; +// Warning: (ae-incompatible-release-tags) The symbol "pow" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function pow(base: string, exponent: number): FunctionExpression; -// @beta -export function regexContains(stringExpression: Expr, pattern: Expr): BooleanExpr; +// @beta (undocumented) +export class RawStage extends Stage { + } // @beta -export function regexMatch(fieldName: string, pattern: string): BooleanExpr; +export function regexContains(fieldName: string, pattern: string): BooleanExpression; // @beta -export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; +export function regexContains(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function regexMatch(stringExpression: Expr, pattern: string): BooleanExpr; +export function regexContains(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; +export function regexContains(stringExpression: Expression, pattern: Expression): BooleanExpression; // @beta -export function replaceAll(value: Expr, find: string, replace: string): FunctionExpr; +export function regexMatch(fieldName: string, pattern: string): BooleanExpression; // @beta -export function replaceAll(value: Expr, find: Expr, replace: Expr): FunctionExpr; +export function regexMatch(fieldName: string, pattern: Expression): BooleanExpression; // @beta -export function replaceAll(fieldName: string, find: string, replace: string): FunctionExpr; +export function regexMatch(stringExpression: Expression, pattern: string): BooleanExpression; // @beta -export function replaceFirst(value: Expr, find: string, replace: string): FunctionExpr; +export function regexMatch(stringExpression: Expression, pattern: Expression): BooleanExpression; -// @beta -export function replaceFirst(value: Expr, find: Expr, replace: Expr): FunctionExpr; +// @public +export type RemoveFieldsStageOptions = StageOptions & { + fields: Array; +}; -// @beta -export function replaceFirst(fieldName: string, find: string, replace: string): FunctionExpr; +// @public +export type ReplaceWithStageOptions = StageOptions & { + map: Expression | string; +}; // @beta -export function reverse(stringExpression: Expr): FunctionExpr; +export function reverse(stringExpression: Expression): FunctionExpression; // @beta -export function reverse(field: string): FunctionExpr; +export function reverse(field: string): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function round(fieldName: string): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function round(expression: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function round(fieldName: string, decimalPlaces: number | Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "round" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function round(expression: Expression, decimalPlaces: number | Expression): FunctionExpression; + +// @public +export type SampleStageOptions = StageOptions & OneOf<{ + percentage: number; + documents: number; +}>; // @beta (undocumented) -export class Select implements Stage { - constructor(projections: Map); - // (undocumented) - name: string; +export class Select extends Stage { + constructor(selections: Map, options: StageOptions); } // @beta export interface Selectable { - // (undocumented) - readonly alias: string; - // (undocumented) - readonly expr: Expr; // (undocumented) selectable: true; } +// @public +export type SelectStageOptions = StageOptions & { + selections: Array; +}; + // @beta (undocumented) -export class Sort implements Stage { - constructor(orders: Ordering[]); - // (undocumented) - name: string; +export class Sort extends Stage { + constructor(orderings: Ordering[], options: StageOptions); } +// @public +export type SortStageOptions = StageOptions & { + orderings: Ordering[]; +}; + +// Warning: (ae-incompatible-release-tags) The symbol "sqrt" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "sqrt" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function sqrt(expression: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "sqrt" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function sqrt(fieldName: string): FunctionExpression; + // @beta (undocumented) -export interface Stage { +export abstract class Stage { + /* Excluded from this release type: optionsProto */ + constructor(options: StageOptions); + // (undocumented) + protected knownOptions: Record; // (undocumented) - name: string; + protected rawOptions?: Record; +} + +// @public +export interface StageOptions { + rawOptions?: { + [name: string]: unknown; + }; } // @beta -export function startsWith(fieldName: string, prefix: string): BooleanExpr; +export function startsWith(fieldName: string, prefix: string): BooleanExpression; // @beta -export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; +export function startsWith(fieldName: string, prefix: Expression): BooleanExpression; // @beta -export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; +export function startsWith(stringExpression: Expression, prefix: string): BooleanExpression; // @beta -export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; +export function startsWith(stringExpression: Expression, prefix: Expression): BooleanExpression; // @beta -export function strConcat(fieldName: string, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; +export function stringConcat(fieldName: string, secondString: Expression | string, ...otherStrings: Array): FunctionExpression; // @beta -export function strConcat(firstString: Expr, secondString: Expr | string, ...otherStrings: Array): FunctionExpr; +export function stringConcat(firstString: Expression, secondString: Expression | string, ...otherStrings: Array): FunctionExpression; // @beta -export function strContains(fieldName: string, substring: string): BooleanExpr; +export function stringContains(fieldName: string, substring: string): BooleanExpression; // @beta -export function strContains(fieldName: string, substring: Expr): BooleanExpr; +export function stringContains(fieldName: string, substring: Expression): BooleanExpression; // @beta -export function strContains(stringExpression: Expr, substring: string): BooleanExpr; +export function stringContains(stringExpression: Expression, substring: string): BooleanExpression; // @beta -export function strContains(stringExpression: Expr, substring: Expr): BooleanExpr; +export function stringContains(stringExpression: Expression, substring: Expression): BooleanExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "stringReverse" is marked as @public, but its signature references "Expression" which is marked as @beta +// Warning: (ae-incompatible-release-tags) The symbol "stringReverse" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function stringReverse(stringExpression: Expression): FunctionExpression; + +// Warning: (ae-incompatible-release-tags) The symbol "stringReverse" is marked as @public, but its signature references "FunctionExpression" which is marked as @beta +// +// @public +export function stringReverse(field: string): FunctionExpression; // @beta -export function substr(field: string, position: number, length?: number): FunctionExpr; +export function substring(field: string, position: number, length?: number): FunctionExpression; // @beta -export function substr(input: Expr, position: number, length?: number): FunctionExpr; +export function substring(input: Expression, position: number, length?: number): FunctionExpression; // @beta -export function substr(field: string, position: Expr, length?: Expr): FunctionExpr; +export function substring(field: string, position: Expression, length?: Expression): FunctionExpression; // @beta -export function substr(input: Expr, position: Expr, length?: Expr): FunctionExpr; +export function substring(input: Expression, position: Expression, length?: Expression): FunctionExpression; // @beta -export function subtract(left: Expr, right: Expr): FunctionExpr; +export function subtract(left: Expression, right: Expression): FunctionExpression; // @beta -export function subtract(expression: Expr, value: unknown): FunctionExpr; +export function subtract(expression: Expression, value: unknown): FunctionExpression; // @beta -export function subtract(fieldName: string, expression: Expr): FunctionExpr; +export function subtract(fieldName: string, expression: Expression): FunctionExpression; // @beta -export function subtract(fieldName: string, value: unknown): FunctionExpr; +export function subtract(fieldName: string, value: unknown): FunctionExpression; // @beta -export function sum(expression: Expr): AggregateFunction; +export function sum(expression: Expression): AggregateFunction; // @beta export function sum(fieldName: string): AggregateFunction; // @beta -export function timestampAdd(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; +export function timestampAdd(timestamp: Expression, unit: Expression, amount: Expression): FunctionExpression; // @beta -export function timestampAdd(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampAdd(timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampAdd(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampSub(timestamp: Expr, unit: Expr, amount: Expr): FunctionExpr; +export function timestampSubtract(timestamp: Expression, unit: Expression, amount: Expression): FunctionExpression; // @beta -export function timestampSub(timestamp: Expr, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampSubtract(timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampSub(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpr; +export function timestampSubtract(fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number): FunctionExpression; // @beta -export function timestampToUnixMicros(expr: Expr): FunctionExpr; +export function timestampToUnixMicros(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixMicros(fieldName: string): FunctionExpr; +export function timestampToUnixMicros(fieldName: string): FunctionExpression; // @beta -export function timestampToUnixMillis(expr: Expr): FunctionExpr; +export function timestampToUnixMillis(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixMillis(fieldName: string): FunctionExpr; +export function timestampToUnixMillis(fieldName: string): FunctionExpression; // @beta -export function timestampToUnixSeconds(expr: Expr): FunctionExpr; +export function timestampToUnixSeconds(expr: Expression): FunctionExpression; // @beta -export function timestampToUnixSeconds(fieldName: string): FunctionExpr; +export function timestampToUnixSeconds(fieldName: string): FunctionExpression; // @beta -export function toLower(fieldName: string): FunctionExpr; +export function toLower(fieldName: string): FunctionExpression; // @beta -export function toLower(stringExpression: Expr): FunctionExpr; +export function toLower(stringExpression: Expression): FunctionExpression; // @beta -export function toUpper(fieldName: string): FunctionExpr; +export function toUpper(fieldName: string): FunctionExpression; // @beta -export function toUpper(stringExpression: Expr): FunctionExpr; +export function toUpper(stringExpression: Expression): FunctionExpression; // @beta -export function trim(fieldName: string): FunctionExpr; +export function trim(fieldName: string): FunctionExpression; // @beta -export function trim(stringExpression: Expr): FunctionExpr; +export function trim(stringExpression: Expression): FunctionExpression; + +// @public +export type UnionStageOptions = StageOptions & { + other: Pipeline; +}; // @beta -export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; +export function unixMicrosToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; +export function unixMicrosToTimestamp(fieldName: string): FunctionExpression; // @beta -export function unixMillisToTimestamp(expr: Expr): FunctionExpr; +export function unixMillisToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixMillisToTimestamp(fieldName: string): FunctionExpr; +export function unixMillisToTimestamp(fieldName: string): FunctionExpression; // @beta -export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; +export function unixSecondsToTimestamp(expr: Expression): FunctionExpression; // @beta -export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; +export function unixSecondsToTimestamp(fieldName: string): FunctionExpression; + +// @public +export type UnnestStageOptions = StageOptions & { + selectable: Selectable; + indexField?: string; +}; // @beta -export function vectorLength(vectorExpression: Expr): FunctionExpr; +export function vectorLength(vectorExpression: Expression): FunctionExpression; // @beta -export function vectorLength(fieldName: string): FunctionExpr; +export function vectorLength(fieldName: string): FunctionExpression; // @beta (undocumented) -export class Where implements Stage { - constructor(condition: BooleanExpr); - // (undocumented) - name: string; -} +export class Where extends Stage { + constructor(condition: BooleanExpression, options: StageOptions); + } + +// @public +export type WhereStageOptions = StageOptions & { + condition: BooleanExpression; +}; // @beta -export function xor(first: BooleanExpr, second: BooleanExpr, ...additionalConditions: BooleanExpr[]): BooleanExpr; +export function xor(first: BooleanExpression, second: BooleanExpression, ...additionalConditions: BooleanExpression[]): BooleanExpression; // Warnings were encountered during analysis: // -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4552:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AggregateWithAlias" which is marked as @beta -// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:4552:62 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:73:5 - (ae-incompatible-release-tags) The symbol "fields" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:118:5 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AliasedAggregate" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:123:5 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:785:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point pipelines.d.ts +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:1100:5 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:3160:5 - (ae-incompatible-release-tags) The symbol "field" is marked as @public, but its signature references "Field" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:5041:59 - (ae-incompatible-release-tags) The symbol "__index" is marked as @public, but its signature references "Expression" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:5447:5 - (ae-incompatible-release-tags) The symbol "fields" is marked as @public, but its signature references "Field" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:5457:5 - (ae-incompatible-release-tags) The symbol "map" is marked as @public, but its signature references "Expression" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:5584:5 - (ae-incompatible-release-tags) The symbol "selections" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:5601:5 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:6337:5 - (ae-incompatible-release-tags) The symbol "selectable" is marked as @public, but its signature references "Selectable" which is marked as @beta +// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/pipelines.d.ts:6386:5 - (ae-incompatible-release-tags) The symbol "condition" is marked as @public, but its signature references "BooleanExpression" which is marked as @beta // (No @packageDocumentation comment for this package) diff --git a/packages/firestore/lite/pipelines/pipelines.ts b/packages/firestore/lite/pipelines/pipelines.ts index cc7f91e750c..1e5195c8e8c 100644 --- a/packages/firestore/lite/pipelines/pipelines.ts +++ b/packages/firestore/lite/pipelines/pipelines.ts @@ -50,6 +50,8 @@ export type { export { PipelineSource } from '../../src/lite-api/pipeline-source'; +export { OneOf } from '../../src/util/types'; + export { PipelineResult, PipelineSnapshot @@ -60,51 +62,45 @@ export { Pipeline } from '../../src/lite-api/pipeline'; export { execute } from '../../src/lite-api/pipeline_impl'; export { - Stage, - FindNearestOptions, - AddFields, - Aggregate, - Distinct, - CollectionSource, - CollectionGroupSource, - DatabaseSource, - DocumentsSource, - Where, - FindNearest, - Limit, - Offset, - Select, - Sort, - GenericStage -} from '../../src/lite-api/stage'; + StageOptions, + CollectionStageOptions, + CollectionGroupStageOptions, + DatabaseStageOptions, + DocumentsStageOptions, + AddFieldsStageOptions, + RemoveFieldsStageOptions, + SelectStageOptions, + WhereStageOptions, + OffsetStageOptions, + LimitStageOptions, + DistinctStageOptions, + AggregateStageOptions, + FindNearestStageOptions, + ReplaceWithStageOptions, + SampleStageOptions, + UnionStageOptions, + UnnestStageOptions, + SortStageOptions +} from '../../src/lite-api/stage_options'; export { - Expr, + Expression, field, and, array, - arrayOffset, constant, add, subtract, multiply, - avg, - bitAnd, - substr, - constantVector, - bitLeftShift, - bitNot, + average, + substring, count, mapMerge, mapRemove, - bitOr, ifError, isAbsent, isError, or, - rand, - bitRightShift, - bitXor, divide, isNotNan, map, @@ -112,42 +108,40 @@ export { isNull, mod, documentId, - eq, - neq, - lt, + equal, + notEqual, + lessThan, countIf, - lte, - gt, - gte, + lessThanOrEqual, + greaterThan, + greaterThanOrEqual, arrayConcat, arrayContains, arrayContainsAny, arrayContainsAll, arrayLength, - eqAny, - notEqAny, + equalAny, + notEqualAny, xor, - cond, + conditional, not, logicalMaximum, logicalMinimum, exists, isNan, reverse, - replaceFirst, - replaceAll, byteLength, charLength, like, regexContains, regexMatch, - strContains, + stringContains, startsWith, endsWith, toLower, toUpper, trim, - strConcat, + stringConcat, mapGet, countAll, minimum, @@ -163,17 +157,17 @@ export { unixSecondsToTimestamp, timestampToUnixSeconds, timestampAdd, - timestampSub, + timestampSubtract, ascending, descending, - ExprWithAlias, + AliasedExpression, Field, Constant, - FunctionExpr, + FunctionExpression, Ordering, - ExprType, - AggregateWithAlias, + ExpressionType, + AliasedAggregate, Selectable, - BooleanExpr, + BooleanExpression, AggregateFunction } from '../../src/lite-api/expressions'; diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 7c88da9343c..e0cde483041 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -8,6 +8,7 @@ "author": "Firebase (https://firebase.google.com/)", "scripts": { "bundle": "rollup -c", + "compile": "tsc --emitDeclarationOnly --declaration -p tsconfig.json", "prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json; yarn api-report", "build": "run-p --npm-path npm build:lite build:main", "build:release": "yarn build && yarn typings:public", @@ -95,12 +96,12 @@ "require": "./dist/lite/pipelines.node.cjs.js", "import": "./dist/lite/pipelines.node.mjs" }, - "react-native": "./dist/lite/pipelines.rn.esm2017.js", + "react-native": "./dist/lite/pipelines.rn.esm.js", "browser": { "require": "./dist/lite/pipelines.browser.cjs.js", - "import": "./dist/lite/pipelines.browser.esm2017.js" + "import": "./dist/lite/pipelines.browser.esm.js" }, - "default": "./dist/lite/pipelines.browser.esm2017.js" + "default": "./dist/lite/pipelines.browser.esm.js" }, "./pipelines": { "types": "./pipelines/pipelines.d.ts", @@ -108,24 +109,28 @@ "require": "./dist/pipelines.node.cjs.js", "import": "./dist/pipelines.node.mjs" }, - "react-native": "./dist/index.rn.esm2017.js", + "react-native": "./dist/index.rn.esm.js", "browser": { "require": "./dist/pipelines.cjs.js", - "import": "./dist/pipelines.esm2017.js" + "import": "./dist/pipelines.esm.js" }, - "default": "./dist/pipelines.esm2017.js" + "default": "./dist/pipelines.esm.js" }, "./package.json": "./package.json" }, - "main": "dist/node-cjs/index.node.cjs.js", - "main-esm": "dist/node-esm/index.node.mjs", + "main": "dist/index.node.cjs.js", + "main-esm": "dist/index.node.mjs", "react-native": "dist/index.rn.js", "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "license": "Apache-2.0", "files": [ "dist", - "lite/package.json" + "lite/package.json", + "pipelines/package.json", + "pipelines/pipelines.d.ts", + "lite/pipelines/package.json", + "lite/pipelines/pipelines.d.ts" ], "dependencies": { "@firebase/component": "0.7.0", @@ -168,7 +173,7 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "types": "dist/index.d.ts", + "types": "dist/firestore/src/index.d.ts", "nyc": { "extension": [ ".ts" diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index 1020e05be23..c9222f69ab4 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -178,8 +178,8 @@ const allBuilds = [ output: [ { dir: 'dist/', - entryFileNames: '[name].esm2017.js', - chunkFileNames: 'common-[hash].esm2017.js', + entryFileNames: '[name].esm.js', + chunkFileNames: 'common-[hash].esm.js', format: 'es', sourcemap: true } diff --git a/packages/firestore/rollup.config.lite.js b/packages/firestore/rollup.config.lite.js index 746502c7808..6bf9297e4d8 100644 --- a/packages/firestore/rollup.config.lite.js +++ b/packages/firestore/rollup.config.lite.js @@ -187,8 +187,8 @@ const allBuilds = [ output: [ { dir: 'dist/lite/', - entryFileNames: '[name].esm2017.js', - chunkFileNames: 'common-[hash].esm2017.js', + entryFileNames: '[name].esm.js', + chunkFileNames: 'common-[hash].esm.js', format: 'es', sourcemap: true } @@ -207,8 +207,8 @@ const allBuilds = [ input: ['./lite/index.ts', './lite/pipelines/pipelines.ts'], output: { dir: 'dist/lite/', - entryFileNames: '[name].rn.esm2017.js', - chunkFileNames: 'common-[hash].rn.esm2017.js', + entryFileNames: '[name].rn.esm.js', + chunkFileNames: 'common-[hash].rn.esm.js', format: 'es', sourcemap: true }, diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts index ba6e08105bb..843a3696f71 100644 --- a/packages/firestore/src/api/pipeline_impl.ts +++ b/packages/firestore/src/api/pipeline_impl.ts @@ -17,11 +17,20 @@ import { Pipeline } from '../api/pipeline'; import { firestoreClientExecutePipeline } from '../core/firestore_client'; +import { + StructuredPipeline, + StructuredPipelineOptions +} from '../core/structured_pipeline'; import { Pipeline as LitePipeline } from '../lite-api/pipeline'; import { PipelineResult, PipelineSnapshot } from '../lite-api/pipeline-result'; import { PipelineSource } from '../lite-api/pipeline-source'; +import { PipelineExecuteOptions } from '../lite-api/pipeline_options'; import { Stage } from '../lite-api/stage'; -import { newUserDataReader } from '../lite-api/user_data_reader'; +import { + newUserDataReader, + UserDataReader, + UserDataSource +} from '../lite-api/user_data_reader'; import { cast } from '../util/input_validation'; import { ensureFirestoreConfigured, Firestore } from './database'; @@ -68,45 +77,86 @@ declare module './database' { * @param pipeline The pipeline to execute. * @return A Promise representing the asynchronous pipeline execution. */ -export function execute(pipeline: LitePipeline): Promise { +export function execute(pipeline: LitePipeline): Promise; +export function execute( + options: PipelineExecuteOptions +): Promise; +export function execute( + pipelineOrOptions: LitePipeline | PipelineExecuteOptions +): Promise { + const options: PipelineExecuteOptions = !( + pipelineOrOptions instanceof LitePipeline + ) + ? pipelineOrOptions + : { + pipeline: pipelineOrOptions + }; + + const { pipeline, rawOptions, ...rest } = options; + const firestore = cast(pipeline._db, Firestore); const client = ensureFirestoreConfigured(firestore); - return firestoreClientExecutePipeline(client, pipeline).then(result => { - // Get the execution time from the first result. - // firestoreClientExecutePipeline returns at least one PipelineStreamElement - // even if the returned document set is empty. - const executionTime = - result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined; - const docs = result - // Currently ignore any response from ExecutePipeline that does - // not contain any document data in the `fields` property. - .filter(element => !!element.fields) - .map( - element => - new PipelineResult( - pipeline._userDataWriter, - element.key?.path - ? new DocumentReference(firestore, null, element.key) - : undefined, - element.fields, - element.createTime?.toTimestamp(), - element.updateTime?.toTimestamp() - ) - ); + const udr = new UserDataReader( + firestore._databaseId, + /* ignoreUndefinedProperties */ true + ); + const context = udr.createContext(UserDataSource.Argument, 'execute'); + + const structuredPipelineOptions = new StructuredPipelineOptions( + rest, + rawOptions + ); + structuredPipelineOptions._readUserData(context); - return new PipelineSnapshot(pipeline, docs, executionTime); - }); + const structuredPipeline: StructuredPipeline = new StructuredPipeline( + pipeline, + structuredPipelineOptions + ); + + return firestoreClientExecutePipeline(client, structuredPipeline).then( + result => { + // Get the execution time from the first result. + // firestoreClientExecutePipeline returns at least one PipelineStreamElement + // even if the returned document set is empty. + const executionTime = + result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined; + + const docs = result + // Currently ignore any response from ExecutePipeline that does + // not contain any document data in the `fields` property. + .filter(element => !!element.fields) + .map( + element => + new PipelineResult( + pipeline._userDataWriter, + element.fields!, + element.key?.path + ? new DocumentReference(firestore, null, element.key) + : undefined, + element.createTime?.toTimestamp(), + element.updateTime?.toTimestamp() + ) + ); + + return new PipelineSnapshot(pipeline, docs, executionTime); + } + ); } // Augment the Firestore class with the pipeline() factory method Firestore.prototype.pipeline = function (): PipelineSource { - return new PipelineSource(this._databaseId, (stages: Stage[]) => { - return new Pipeline( - this, - newUserDataReader(this), - new ExpUserDataWriter(this), - stages - ); - }); + const userDataReader = newUserDataReader(this); + return new PipelineSource( + this._databaseId, + userDataReader, + (stages: Stage[]) => { + return new Pipeline( + this, + userDataReader, + new ExpUserDataWriter(this), + stages + ); + } + ); }; diff --git a/packages/firestore/src/api/snapshot.ts b/packages/firestore/src/api/snapshot.ts index c82add0642a..86e075a4ca4 100644 --- a/packages/firestore/src/api/snapshot.ts +++ b/packages/firestore/src/api/snapshot.ts @@ -31,10 +31,12 @@ import { import { LiteUserDataWriter } from '../lite-api/reference_impl'; import { DocumentSnapshot as LiteDocumentSnapshot, - fieldPathFromArgument, FirestoreDataConverter as LiteFirestoreDataConverter } from '../lite-api/snapshot'; -import { UntypedFirestoreDataConverter } from '../lite-api/user_data_reader'; +import { + fieldPathFromArgument, + UntypedFirestoreDataConverter +} from '../lite-api/user_data_reader'; import { AbstractUserDataWriter } from '../lite-api/user_data_writer'; import { fromBundledQuery } from '../local/local_serializer'; import { documentKeySet } from '../model/collections'; diff --git a/packages/firestore/src/api_pipelines.ts b/packages/firestore/src/api_pipelines.ts index b632025f374..057695ab5f4 100644 --- a/packages/firestore/src/api_pipelines.ts +++ b/packages/firestore/src/api_pipelines.ts @@ -17,6 +17,8 @@ export { PipelineSource } from './lite-api/pipeline-source'; +export { OneOf } from './util/types'; + export { PipelineResult, PipelineSnapshot, @@ -27,9 +29,32 @@ export { Pipeline } from './api/pipeline'; export { execute } from './api/pipeline_impl'; +export { PipelineExecuteOptions } from './lite-api/pipeline_options'; + +export { + StageOptions, + CollectionStageOptions, + CollectionGroupStageOptions, + DatabaseStageOptions, + DocumentsStageOptions, + AddFieldsStageOptions, + RemoveFieldsStageOptions, + SelectStageOptions, + WhereStageOptions, + OffsetStageOptions, + LimitStageOptions, + DistinctStageOptions, + AggregateStageOptions, + FindNearestStageOptions, + ReplaceWithStageOptions, + SampleStageOptions, + UnionStageOptions, + UnnestStageOptions, + SortStageOptions +} from './lite-api/stage_options'; + export { Stage, - FindNearestOptions, AddFields, Aggregate, Distinct, @@ -43,7 +68,7 @@ export { Offset, Select, Sort, - GenericStage + RawStage } from './lite-api/stage'; export { @@ -54,46 +79,44 @@ export { multiply, divide, mod, - eq, - neq, - lt, - lte, - gt, - gte, + equal, + notEqual, + lessThan, + lessThanOrEqual, + greaterThan, + greaterThanOrEqual, arrayConcat, arrayContains, arrayContainsAny, arrayContainsAll, arrayLength, - eqAny, - notEqAny, + equalAny, + notEqualAny, xor, - cond, + conditional, not, logicalMaximum, logicalMinimum, exists, isNan, reverse, - replaceFirst, - replaceAll, byteLength, charLength, like, regexContains, regexMatch, - strContains, + stringContains, startsWith, endsWith, toLower, toUpper, trim, - strConcat, + stringConcat, mapGet, countAll, count, sum, - avg, + average, and, or, minimum, @@ -109,19 +132,12 @@ export { unixSecondsToTimestamp, timestampToUnixSeconds, timestampAdd, - timestampSub, + timestampSubtract, ascending, descending, countIf, - bitAnd, - bitOr, - bitXor, - bitNot, - bitLeftShift, - bitRightShift, - rand, array, - arrayOffset, + arrayGet, isError, ifError, isAbsent, @@ -132,21 +148,40 @@ export { mapRemove, mapMerge, documentId, - substr, - Expr, - ExprWithAlias, + substring, + countDistinct, + ceil, + floor, + exp, + pow, + round, + collectionId, + ln, + log, + sqrt, + stringReverse, + length as len, + abs, + concat, + currentTimestamp, + error, + ifAbsent, + join, + log10, + arraySum, + Expression, + AliasedExpression, Field, - Constant, - FunctionExpr, - Ordering + FunctionExpression, + Ordering, + BooleanExpression, + AggregateFunction } from './lite-api/expressions'; export type { - ExprType, - AggregateWithAlias, - Selectable, - BooleanExpr, - AggregateFunction + ExpressionType, + AliasedAggregate, + Selectable } from './lite-api/expressions'; export { _internalPipelineToExecutePipelineRequestProto } from './remote/internal_serializer'; diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index 775089178a3..009e7b2aba2 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -23,7 +23,6 @@ import { CredentialsProvider } from '../api/credentials'; import { User } from '../auth/user'; -import { Pipeline } from '../lite-api/pipeline'; import { LocalStore } from '../local/local_store'; import { localStoreConfigureFieldIndexes, @@ -88,6 +87,7 @@ import { removeSnapshotsInSyncListener } from './event_manager'; import { newQueryForPath, Query } from './query'; +import { StructuredPipeline } from './structured_pipeline'; import { SyncEngine } from './sync_engine'; import { syncEngineListen, @@ -558,7 +558,7 @@ export function firestoreClientRunAggregateQuery( export function firestoreClientExecutePipeline( client: FirestoreClient, - pipeline: Pipeline + pipeline: StructuredPipeline ): Promise { const deferred = new Deferred(); diff --git a/packages/firestore/src/core/options_util.ts b/packages/firestore/src/core/options_util.ts new file mode 100644 index 00000000000..f7233850641 --- /dev/null +++ b/packages/firestore/src/core/options_util.ts @@ -0,0 +1,95 @@ +/** + * @license + * Copyright 2025 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 { ParseContext } from '../api/parse_context'; +import { parseData } from '../lite-api/user_data_reader'; +import { ObjectValue } from '../model/object_value'; +import { FieldPath } from '../model/path'; +import { ApiClientObjectMap, Value } from '../protos/firestore_proto_api'; +import { isPlainObject } from '../util/input_validation'; +import { mapToArray } from '../util/obj'; +export type OptionsDefinitions = Record; +export interface OptionDefinition { + serverName: string; + nestedOptions?: OptionsDefinitions; +} + +export class OptionsUtil { + constructor(private optionDefinitions: OptionsDefinitions) {} + + private _getKnownOptions( + options: Record, + context: ParseContext + ): ObjectValue { + const knownOptions: ObjectValue = ObjectValue.empty(); + + // SERIALIZE KNOWN OPTIONS + for (const knownOptionKey in this.optionDefinitions) { + if (this.optionDefinitions.hasOwnProperty(knownOptionKey)) { + const optionDefinition: OptionDefinition = + this.optionDefinitions[knownOptionKey]; + + if (knownOptionKey in options) { + const optionValue: unknown = options[knownOptionKey]; + let protoValue: Value | undefined = undefined; + + if (optionDefinition.nestedOptions && isPlainObject(optionValue)) { + const nestedUtil = new OptionsUtil(optionDefinition.nestedOptions); + protoValue = { + mapValue: { + fields: nestedUtil.getOptionsProto(context, optionValue) + } + }; + } else if (optionValue) { + protoValue = parseData(optionValue, context) ?? undefined; + } + + if (protoValue) { + knownOptions.set( + FieldPath.fromServerFormat(optionDefinition.serverName), + protoValue + ); + } + } + } + } + + return knownOptions; + } + + getOptionsProto( + context: ParseContext, + knownOptions: Record, + optionsOverride?: Record + ): ApiClientObjectMap | undefined { + const result: ObjectValue = this._getKnownOptions(knownOptions, context); + + // APPLY OPTIONS OVERRIDES + if (optionsOverride) { + const optionsMap = new Map( + mapToArray(optionsOverride, (value, key) => [ + FieldPath.fromServerFormat(key), + value !== undefined ? parseData(value, context) : null + ]) + ); + result.setAll(optionsMap); + } + + // Return MapValue from `result` or empty map value + return result.value.mapValue.fields ?? {}; + } +} diff --git a/packages/firestore/src/core/pipeline-util.ts b/packages/firestore/src/core/pipeline-util.ts index cb3342eca4e..3cf754e46f8 100644 --- a/packages/firestore/src/core/pipeline-util.ts +++ b/packages/firestore/src/core/pipeline-util.ts @@ -18,12 +18,12 @@ import { Firestore } from '../lite-api/database'; import { Constant, - BooleanExpr, + BooleanExpression, and, or, Ordering, - lt, - gt, + lessThan, + greaterThan, field } from '../lite-api/expressions'; import { Pipeline } from '../lite-api/pipeline'; @@ -50,7 +50,7 @@ import { /* eslint @typescript-eslint/no-explicit-any: 0 */ -export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr { +export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpression { if (f instanceof FieldFilterInternal) { const fieldValue = field(f.field.toString()); if (isNanValue(f.value)) { @@ -72,32 +72,32 @@ export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr { case Operator.LESS_THAN: return and( fieldValue.exists(), - fieldValue.lt(Constant._fromProto(value)) + fieldValue.lessThan(Constant._fromProto(value)) ); case Operator.LESS_THAN_OR_EQUAL: return and( fieldValue.exists(), - fieldValue.lte(Constant._fromProto(value)) + fieldValue.lessThanOrEqual(Constant._fromProto(value)) ); case Operator.GREATER_THAN: return and( fieldValue.exists(), - fieldValue.gt(Constant._fromProto(value)) + fieldValue.greaterThan(Constant._fromProto(value)) ); case Operator.GREATER_THAN_OR_EQUAL: return and( fieldValue.exists(), - fieldValue.gte(Constant._fromProto(value)) + fieldValue.greaterThanOrEqual(Constant._fromProto(value)) ); case Operator.EQUAL: return and( fieldValue.exists(), - fieldValue.eq(Constant._fromProto(value)) + fieldValue.equal(Constant._fromProto(value)) ); case Operator.NOT_EQUAL: return and( fieldValue.exists(), - fieldValue.neq(Constant._fromProto(value)) + fieldValue.notEqual(Constant._fromProto(value)) ); case Operator.ARRAY_CONTAINS: return and( @@ -109,11 +109,11 @@ export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr { Constant._fromProto(val) ); if (!values) { - return and(fieldValue.exists(), fieldValue.eqAny([])); + return and(fieldValue.exists(), fieldValue.equalAny([])); } else if (values.length === 1) { - return and(fieldValue.exists(), fieldValue.eq(values[0])); + return and(fieldValue.exists(), fieldValue.equal(values[0])); } else { - return and(fieldValue.exists(), fieldValue.eqAny(values)); + return and(fieldValue.exists(), fieldValue.equalAny(values)); } } case Operator.ARRAY_CONTAINS_ANY: { @@ -127,11 +127,11 @@ export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr { Constant._fromProto(val) ); if (!values) { - return and(fieldValue.exists(), fieldValue.notEqAny([])); + return and(fieldValue.exists(), fieldValue.notEqualAny([])); } else if (values.length === 1) { - return and(fieldValue.exists(), fieldValue.neq(values[0])); + return and(fieldValue.exists(), fieldValue.notEqual(values[0])); } else { - return and(fieldValue.exists(), fieldValue.notEqAny(values)); + return and(fieldValue.exists(), fieldValue.notEqualAny(values)); } } default: @@ -161,7 +161,8 @@ function reverseOrderings(orderings: Ordering[]): Ordering[] { o => new Ordering( o.expr, - o.direction === 'ascending' ? 'descending' : 'ascending' + o.direction === 'ascending' ? 'descending' : 'ascending', + undefined ) ); } @@ -249,9 +250,9 @@ function whereConditionsFromCursor( bound: Bound, orderings: Ordering[], position: 'before' | 'after' -): BooleanExpr { +): BooleanExpression { // The filterFunc is either greater than or less than - const filterFunc = position === 'before' ? lt : gt; + const filterFunc = position === 'before' ? lessThan : greaterThan; const cursors = bound.position.map(value => Constant._fromProto(value)); const size = cursors.length; @@ -259,11 +260,11 @@ function whereConditionsFromCursor( let value = cursors[size - 1]; // Add condition for last bound - let condition: BooleanExpr = filterFunc(field, value); + let condition: BooleanExpression = filterFunc(field, value); if (bound.inclusive) { // When the cursor bound is inclusive, then the last bound // can be equal to the value, otherwise it's not equal - condition = or(condition, field.eq(value)); + condition = or(condition, field.equal(value)); } // Iterate backwards over the remaining bounds, adding @@ -275,7 +276,10 @@ function whereConditionsFromCursor( // For each field in the orderings, the condition is either // a) lt|gt the cursor value, // b) or equal the cursor value and lt|gt the cursor values for other fields - condition = or(filterFunc(field, value), and(field.eq(value), condition)); + condition = or( + filterFunc(field, value), + and(field.equal(value), condition) + ); } return condition; diff --git a/packages/firestore/src/core/structured_pipeline.ts b/packages/firestore/src/core/structured_pipeline.ts new file mode 100644 index 00000000000..ac8ee4284f6 --- /dev/null +++ b/packages/firestore/src/core/structured_pipeline.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2025 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 { ParseContext } from '../api/parse_context'; +import { UserData } from '../lite-api/user_data_reader'; +import { + ApiClientObjectMap, + firestoreV1ApiClientInterfaces, + Pipeline as PipelineProto, + StructuredPipeline as StructuredPipelineProto +} from '../protos/firestore_proto_api'; +import { JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; + +import { OptionsUtil } from './options_util'; + +export class StructuredPipelineOptions implements UserData { + proto: ApiClientObjectMap | undefined; + + readonly optionsUtil = new OptionsUtil({ + indexMode: { + serverName: 'index_mode' + } + }); + + constructor( + private _userOptions: Record = {}, + private _optionsOverride: Record = {} + ) {} + + _readUserData(context: ParseContext): void { + this.proto = this.optionsUtil.getOptionsProto( + context, + this._userOptions, + this._optionsOverride + ); + } +} + +export class StructuredPipeline + implements ProtoSerializable +{ + constructor( + private pipeline: ProtoSerializable, + private options: StructuredPipelineOptions + ) {} + + _toProto(serializer: JsonProtoSerializer): StructuredPipelineProto { + return { + pipeline: this.pipeline._toProto(serializer), + options: this.options.proto + }; + } +} diff --git a/packages/firestore/src/lite-api/expressions.ts b/packages/firestore/src/lite-api/expressions.ts index fa0fbf68064..c30b2444cf9 100644 --- a/packages/firestore/src/lite-api/expressions.ts +++ b/packages/firestore/src/lite-api/expressions.ts @@ -25,8 +25,7 @@ import { JsonProtoSerializer, ProtoValueSerializable, toMapValue, - toStringValue, - UserData + toStringValue } from '../remote/serializer'; import { hardAssert } from '../util/assert'; import { isPlainObject } from '../util/input_validation'; @@ -35,15 +34,11 @@ import { isString } from '../util/types'; import { Bytes } from './bytes'; import { documentId as documentIdFieldPath, FieldPath } from './field_path'; +import { vector } from './field_value_impl'; import { GeoPoint } from './geo_point'; import { DocumentReference } from './reference'; import { Timestamp } from './timestamp'; -import { - fieldPathFromArgument, - parseData, - UserDataReader, - UserDataSource -} from './user_data_reader'; +import { fieldPathFromArgument, parseData, UserData } from './user_data_reader'; import { VectorValue } from './vector_value'; /** @@ -51,13 +46,13 @@ import { VectorValue } from './vector_value'; * * An enumeration of the different types of expressions. */ -export type ExprType = +export type ExpressionType = | 'Field' | 'Constant' | 'Function' | 'AggregateFunction' - | 'ListOfExprs' - | 'ExprWithAlias'; + | 'ListOfExpressions' + | 'AliasedExpression'; /** * Converts a value to an Expr, Returning either a Constant, MapFunction, @@ -67,19 +62,18 @@ export type ExprType = * @internal * @param value */ -function valueToDefaultExpr(value: unknown): Expr { - let result: Expr | undefined; - if (value instanceof Expr) { +function valueToDefaultExpr(value: unknown): Expression { + let result: Expression | undefined; + if (value instanceof Expression) { return value; } else if (isPlainObject(value)) { - result = map(value as Record); + result = _map(value as Record, undefined); } else if (value instanceof Array) { result = array(value); } else { - result = new Constant(value); + result = _constant(value, undefined); } - result._createdFromLiteral = true; return result; } @@ -91,13 +85,15 @@ function valueToDefaultExpr(value: unknown): Expr { * @internal * @param value */ -function vectorToExpr(value: VectorValue | number[] | Expr): Expr { - if (value instanceof Expr) { +function vectorToExpr(value: VectorValue | number[] | Expression): Expression { + if (value instanceof Expression) { return value; + } else if (value instanceof VectorValue) { + return constant(value); + } else if (Array.isArray(value)) { + return constant(vector(value)); } else { - const result = constantVector(value); - result._createdFromLiteral = true; - return result; + throw new Error('Unsupported value: ' + typeof value); } } @@ -111,10 +107,9 @@ function vectorToExpr(value: VectorValue | number[] | Expr): Expr { * @internal * @param value */ -function fieldOrExpression(value: unknown): Expr { +function fieldOrExpression(value: unknown): Expression { if (isString(value)) { const result = field(value); - result._createdFromLiteral = true; return result; } else { return valueToDefaultExpr(value); @@ -137,16 +132,10 @@ function fieldOrExpression(value: unknown): Expr { * The `Expr` class provides a fluent API for building expressions. You can chain together * method calls to create complex expressions. */ -export abstract class Expr implements ProtoValueSerializable, UserData { - abstract readonly exprType: ExprType; +export abstract class Expression implements ProtoValueSerializable, UserData { + abstract readonly expressionType: ExpressionType; - /** - * @internal - * @private - * Indicates if this expression was created from a literal value passed - * by the caller. - */ - _createdFromLiteral: boolean = false; + abstract readonly _methodName?: string; /** * @private @@ -159,10 +148,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @private * @internal */ - abstract _readUserData( - dataReader: UserDataReader, - context?: ParseContext - ): void; + abstract _readUserData(context: ParseContext): void; /** * Creates an expression that adds this expression to another expression. @@ -176,12 +162,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param others Optional additional expressions or literals to add to this expression. * @return A new `Expr` representing the addition operation. */ - add(second: Expr | unknown, ...others: Array): FunctionExpr { - const values = [second, ...others]; - return new FunctionExpr('add', [ - this, - ...values.map(value => valueToDefaultExpr(value)) - ]); + add(second: Expression | unknown): FunctionExpression { + return new FunctionExpression( + 'add', + [this, valueToDefaultExpr(second)], + 'add' + ); } /** @@ -192,10 +178,10 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("price").subtract(field("discount")); * ``` * - * @param other The expression to subtract from this expression. + * @param subtrahend The expression to subtract from this expression. * @return A new `Expr` representing the subtraction operation. */ - subtract(other: Expr): FunctionExpr; + subtract(subtrahend: Expression): FunctionExpression; /** * Creates an expression that subtracts a constant value from this expression. @@ -205,12 +191,16 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("total").subtract(20); * ``` * - * @param other The constant value to subtract. + * @param subtrahend The constant value to subtract. * @return A new `Expr` representing the subtraction operation. */ - subtract(other: number): FunctionExpr; - subtract(other: number | Expr): FunctionExpr { - return new FunctionExpr('subtract', [this, valueToDefaultExpr(other)]); + subtract(subtrahend: number): FunctionExpression; + subtract(subtrahend: number | Expression): FunctionExpression { + return new FunctionExpression( + 'subtract', + [this, valueToDefaultExpr(subtrahend)], + 'subtract' + ); } /** @@ -225,15 +215,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param others Optional additional expressions or literals to multiply by. * @return A new `Expr` representing the multiplication operation. */ - multiply( - second: Expr | number, - ...others: Array - ): FunctionExpr { - return new FunctionExpr('multiply', [ - this, - valueToDefaultExpr(second), - ...others.map(value => valueToDefaultExpr(value)) - ]); + multiply(second: Expression | number): FunctionExpression { + return new FunctionExpression( + 'multiply', + [this, valueToDefaultExpr(second)], + 'multiply' + ); } /** @@ -244,10 +231,10 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("total").divide(field("count")); * ``` * - * @param other The expression to divide by. + * @param divisor The expression to divide by. * @return A new `Expr` representing the division operation. */ - divide(other: Expr): FunctionExpr; + divide(divisor: Expression): FunctionExpression; /** * Creates an expression that divides this expression by a constant value. @@ -257,12 +244,16 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("value").divide(10); * ``` * - * @param other The constant value to divide by. + * @param divisor The constant value to divide by. * @return A new `Expr` representing the division operation. */ - divide(other: number): FunctionExpr; - divide(other: number | Expr): FunctionExpr { - return new FunctionExpr('divide', [this, valueToDefaultExpr(other)]); + divide(divisor: number): FunctionExpression; + divide(divisor: number | Expression): FunctionExpression { + return new FunctionExpression( + 'divide', + [this, valueToDefaultExpr(divisor)], + 'divide' + ); } /** @@ -276,7 +267,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param expression The expression to divide by. * @return A new `Expr` representing the modulo operation. */ - mod(expression: Expr): FunctionExpr; + mod(expression: Expression): FunctionExpression; /** * Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. @@ -289,9 +280,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param value The constant value to divide by. * @return A new `Expr` representing the modulo operation. */ - mod(value: number): FunctionExpr; - mod(other: number | Expr): FunctionExpr { - return new FunctionExpr('mod', [this, valueToDefaultExpr(other)]); + mod(value: number): FunctionExpression; + mod(other: number | Expression): FunctionExpression { + return new FunctionExpression( + 'mod', + [this, valueToDefaultExpr(other)], + 'mod' + ); } /** @@ -299,28 +294,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'age' field is equal to 21 - * field("age").eq(21); + * field("age").equal(21); * ``` * * @param expression The expression to compare for equality. * @return A new `Expr` representing the equality comparison. */ - eq(expression: Expr): BooleanExpr; + equal(expression: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is equal to a constant value. * * ```typescript * // Check if the 'city' field is equal to "London" - * field("city").eq("London"); + * field("city").equal("London"); * ``` * * @param value The constant value to compare for equality. * @return A new `Expr` representing the equality comparison. */ - eq(value: unknown): BooleanExpr; - eq(other: unknown): BooleanExpr { - return new BooleanExpr('eq', [this, valueToDefaultExpr(other)]); + equal(value: unknown): BooleanExpression; + equal(other: unknown): BooleanExpression { + return new BooleanExpression( + 'equal', + [this, valueToDefaultExpr(other)], + 'equal' + ); } /** @@ -328,28 +327,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'status' field is not equal to "completed" - * field("status").neq("completed"); + * field("status").notEqual("completed"); * ``` * * @param expression The expression to compare for inequality. * @return A new `Expr` representing the inequality comparison. */ - neq(expression: Expr): BooleanExpr; + notEqual(expression: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is not equal to a constant value. * * ```typescript * // Check if the 'country' field is not equal to "USA" - * field("country").neq("USA"); + * field("country").notEqual("USA"); * ``` * * @param value The constant value to compare for inequality. * @return A new `Expr` representing the inequality comparison. */ - neq(value: unknown): BooleanExpr; - neq(other: unknown): BooleanExpr { - return new BooleanExpr('neq', [this, valueToDefaultExpr(other)]); + notEqual(value: unknown): BooleanExpression; + notEqual(other: unknown): BooleanExpression { + return new BooleanExpression( + 'not_equal', + [this, valueToDefaultExpr(other)], + 'notEqual' + ); } /** @@ -357,28 +360,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'age' field is less than 'limit' - * field("age").lt(field('limit')); + * field("age").lessThan(field('limit')); * ``` * * @param experession The expression to compare for less than. * @return A new `Expr` representing the less than comparison. */ - lt(experession: Expr): BooleanExpr; + lessThan(experession: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is less than a constant value. * * ```typescript * // Check if the 'price' field is less than 50 - * field("price").lt(50); + * field("price").lessThan(50); * ``` * * @param value The constant value to compare for less than. * @return A new `Expr` representing the less than comparison. */ - lt(value: unknown): BooleanExpr; - lt(other: unknown): BooleanExpr { - return new BooleanExpr('lt', [this, valueToDefaultExpr(other)]); + lessThan(value: unknown): BooleanExpression; + lessThan(other: unknown): BooleanExpression { + return new BooleanExpression( + 'less_than', + [this, valueToDefaultExpr(other)], + 'lessThan' + ); } /** @@ -387,28 +394,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * field("quantity").lte(constant(20)); + * field("quantity").lessThan(constant(20)); * ``` * * @param expression The expression to compare for less than or equal to. * @return A new `Expr` representing the less than or equal to comparison. */ - lte(expression: Expr): BooleanExpr; + lessThanOrEqual(expression: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is less than or equal to a constant value. * * ```typescript * // Check if the 'score' field is less than or equal to 70 - * field("score").lte(70); + * field("score").lessThan(70); * ``` * * @param value The constant value to compare for less than or equal to. * @return A new `Expr` representing the less than or equal to comparison. */ - lte(value: unknown): BooleanExpr; - lte(other: unknown): BooleanExpr { - return new BooleanExpr('lte', [this, valueToDefaultExpr(other)]); + lessThanOrEqual(value: unknown): BooleanExpression; + lessThanOrEqual(other: unknown): BooleanExpression { + return new BooleanExpression( + 'less_than_or_equal', + [this, valueToDefaultExpr(other)], + 'lessThanOrEqual' + ); } /** @@ -416,28 +427,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'age' field is greater than the 'limit' field - * field("age").gt(field("limit")); + * field("age").greaterThan(field("limit")); * ``` * * @param expression The expression to compare for greater than. * @return A new `Expr` representing the greater than comparison. */ - gt(expression: Expr): BooleanExpr; + greaterThan(expression: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is greater than a constant value. * * ```typescript * // Check if the 'price' field is greater than 100 - * field("price").gt(100); + * field("price").greaterThan(100); * ``` * * @param value The constant value to compare for greater than. * @return A new `Expr` representing the greater than comparison. */ - gt(value: unknown): BooleanExpr; - gt(other: unknown): BooleanExpr { - return new BooleanExpr('gt', [this, valueToDefaultExpr(other)]); + greaterThan(value: unknown): BooleanExpression; + greaterThan(other: unknown): BooleanExpression { + return new BooleanExpression( + 'greater_than', + [this, valueToDefaultExpr(other)], + 'greaterThan' + ); } /** @@ -446,13 +461,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1 - * field("quantity").gte(field('requirement').add(1)); + * field("quantity").greaterThanOrEqual(field('requirement').add(1)); * ``` * * @param expression The expression to compare for greater than or equal to. * @return A new `Expr` representing the greater than or equal to comparison. */ - gte(expression: Expr): BooleanExpr; + greaterThanOrEqual(expression: Expression): BooleanExpression; /** * Creates an expression that checks if this expression is greater than or equal to a constant @@ -460,15 +475,19 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'score' field is greater than or equal to 80 - * field("score").gte(80); + * field("score").greaterThanOrEqual(80); * ``` * * @param value The constant value to compare for greater than or equal to. * @return A new `Expr` representing the greater than or equal to comparison. */ - gte(value: unknown): BooleanExpr; - gte(other: unknown): BooleanExpr { - return new BooleanExpr('gte', [this, valueToDefaultExpr(other)]); + greaterThanOrEqual(value: unknown): BooleanExpression; + greaterThanOrEqual(other: unknown): BooleanExpression { + return new BooleanExpression( + 'greater_than_or_equal', + [this, valueToDefaultExpr(other)], + 'greaterThanOrEqual' + ); } /** @@ -483,12 +502,16 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @return A new `Expr` representing the concatenated array. */ arrayConcat( - secondArray: Expr | unknown[], - ...otherArrays: Array - ): FunctionExpr { + secondArray: Expression | unknown[], + ...otherArrays: Array + ): FunctionExpression { const elements = [secondArray, ...otherArrays]; const exprValues = elements.map(value => valueToDefaultExpr(value)); - return new FunctionExpr('array_concat', [this, ...exprValues]); + return new FunctionExpression( + 'array_concat', + [this, ...exprValues], + 'arrayConcat' + ); } /** @@ -502,7 +525,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param expression The element to search for in the array. * @return A new `Expr` representing the 'array_contains' comparison. */ - arrayContains(expression: Expr): BooleanExpr; + arrayContains(expression: Expression): BooleanExpression; /** * Creates an expression that checks if an array contains a specific value. @@ -515,12 +538,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param value The element to search for in the array. * @return A new `Expr` representing the 'array_contains' comparison. */ - arrayContains(value: unknown): BooleanExpr; - arrayContains(element: unknown): BooleanExpr { - return new BooleanExpr('array_contains', [ - this, - valueToDefaultExpr(element) - ]); + arrayContains(value: unknown): BooleanExpression; + arrayContains(element: unknown): BooleanExpression { + return new BooleanExpression( + 'array_contains', + [this, valueToDefaultExpr(element)], + 'arrayContains' + ); } /** @@ -534,7 +558,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param values The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_all' comparison. */ - arrayContainsAll(values: Array): BooleanExpr; + arrayContainsAll(values: Array): BooleanExpression; /** * Creates an expression that checks if an array contains all the specified elements. @@ -547,12 +571,16 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param arrayExpression The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_all' comparison. */ - arrayContainsAll(arrayExpression: Expr): BooleanExpr; - arrayContainsAll(values: unknown[] | Expr): BooleanExpr { + arrayContainsAll(arrayExpression: Expression): BooleanExpression; + arrayContainsAll(values: unknown[] | Expression): BooleanExpression { const normalizedExpr = Array.isArray(values) - ? new ListOfExprs(values.map(valueToDefaultExpr)) + ? new ListOfExprs(values.map(valueToDefaultExpr), 'arrayContainsAll') : values; - return new BooleanExpr('array_contains_all', [this, normalizedExpr]); + return new BooleanExpression( + 'array_contains_all', + [this, normalizedExpr], + 'arrayContainsAll' + ); } /** @@ -566,7 +594,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param values The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_any' comparison. */ - arrayContainsAny(values: Array): BooleanExpr; + arrayContainsAny(values: Array): BooleanExpression; /** * Creates an expression that checks if an array contains any of the specified elements. @@ -580,12 +608,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param arrayExpression The elements to check for in the array. * @return A new `Expr` representing the 'array_contains_any' comparison. */ - arrayContainsAny(arrayExpression: Expr): BooleanExpr; - arrayContainsAny(values: Array | Expr): BooleanExpr { + arrayContainsAny(arrayExpression: Expression): BooleanExpression; + arrayContainsAny( + values: Array | Expression + ): BooleanExpression { const normalizedExpr = Array.isArray(values) - ? new ListOfExprs(values.map(valueToDefaultExpr)) + ? new ListOfExprs(values.map(valueToDefaultExpr), 'arrayContainsAny') : values; - return new BooleanExpr('array_contains_any', [this, normalizedExpr]); + return new BooleanExpression( + 'array_contains_any', + [this, normalizedExpr], + 'arrayContainsAny' + ); + } + + /** + * Creates an expression that reverses an array. + * + * ```typescript + * // Reverse the value of the 'myArray' field. + * field("myArray").arrayReverse(); + * ``` + * + * @return A new {@code Expr} representing the reversed array. + */ + arrayReverse(): FunctionExpression { + return new FunctionExpression('array_reverse', [this]); } /** @@ -598,8 +646,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the length of the array. */ - arrayLength(): FunctionExpr { - return new FunctionExpr('array_length', [this]); + arrayLength(): FunctionExpression { + return new FunctionExpression('array_length', [this], 'arrayLength'); } /** @@ -608,13 +656,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * field("category").eqAny("Electronics", field("primaryType")); + * field("category").equalAny("Electronics", field("primaryType")); * ``` * * @param values The values or expressions to check against. * @return A new `Expr` representing the 'IN' comparison. */ - eqAny(values: Array): BooleanExpr; + equalAny(values: Array): BooleanExpression; /** * Creates an expression that checks if this expression is equal to any of the provided values or @@ -622,18 +670,18 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * field("category").eqAny(array(["Electronics", field("primaryType")])); + * field("category").equalAny(array(["Electronics", field("primaryType")])); * ``` * * @param arrayExpression An expression that evaluates to an array of values to check against. * @return A new `Expr` representing the 'IN' comparison. */ - eqAny(arrayExpression: Expr): BooleanExpr; - eqAny(others: unknown[] | Expr): BooleanExpr { + equalAny(arrayExpression: Expression): BooleanExpression; + equalAny(others: unknown[] | Expression): BooleanExpression { const exprOthers = Array.isArray(others) - ? new ListOfExprs(others.map(valueToDefaultExpr)) + ? new ListOfExprs(others.map(valueToDefaultExpr), 'equalAny') : others; - return new BooleanExpr('eq_any', [this, exprOthers]); + return new BooleanExpression('equal_any', [this, exprOthers], 'equalAny'); } /** @@ -642,31 +690,35 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * field("status").notEqAny(["pending", field("rejectedStatus")]); + * field("status").notEqualAny(["pending", field("rejectedStatus")]); * ``` * * @param values The values or expressions to check against. - * @return A new `Expr` representing the 'NotEqAny' comparison. + * @return A new `Expr` representing the 'notEqualAny' comparison. */ - notEqAny(values: Array): BooleanExpr; + notEqualAny(values: Array): BooleanExpression; /** * Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression. * * ```typescript * // Check if the 'status' field is not equal to any value in the field 'rejectedStatuses' - * field("status").notEqAny(field('rejectedStatuses')); + * field("status").notEqualAny(field('rejectedStatuses')); * ``` * * @param arrayExpression The values or expressions to check against. - * @return A new `Expr` representing the 'NotEqAny' comparison. + * @return A new `Expr` representing the 'notEqualAny' comparison. */ - notEqAny(arrayExpression: Expr): BooleanExpr; - notEqAny(others: unknown[] | Expr): BooleanExpr { + notEqualAny(arrayExpression: Expression): BooleanExpression; + notEqualAny(others: unknown[] | Expression): BooleanExpression { const exprOthers = Array.isArray(others) - ? new ListOfExprs(others.map(valueToDefaultExpr)) + ? new ListOfExprs(others.map(valueToDefaultExpr), 'notEqualAny') : others; - return new BooleanExpr('not_eq_any', [this, exprOthers]); + return new BooleanExpression( + 'not_equal_any', + [this, exprOthers], + 'notEqualAny' + ); } /** @@ -679,8 +731,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the 'isNaN' check. */ - isNan(): BooleanExpr { - return new BooleanExpr('is_nan', [this]); + isNan(): BooleanExpression { + return new BooleanExpression('is_nan', [this], 'isNan'); } /** @@ -693,8 +745,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the 'isNull' check. */ - isNull(): BooleanExpr { - return new BooleanExpr('is_null', [this]); + isNull(): BooleanExpression { + return new BooleanExpression('is_null', [this], 'isNull'); } /** @@ -707,8 +759,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the 'exists' check. */ - exists(): BooleanExpr { - return new BooleanExpr('exists', [this]); + exists(): BooleanExpression { + return new BooleanExpression('exists', [this], 'exists'); } /** @@ -721,8 +773,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the length of the string. */ - charLength(): FunctionExpr { - return new FunctionExpr('char_length', [this]); + charLength(): FunctionExpression { + return new FunctionExpression('char_length', [this], 'charLength'); } /** @@ -736,7 +788,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new `Expr` representing the 'like' comparison. */ - like(pattern: string): FunctionExpr; + like(pattern: string): BooleanExpression; /** * Creates an expression that performs a case-sensitive string comparison. @@ -749,9 +801,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new `Expr` representing the 'like' comparison. */ - like(pattern: Expr): FunctionExpr; - like(stringOrExpr: string | Expr): FunctionExpr { - return new FunctionExpr('like', [this, valueToDefaultExpr(stringOrExpr)]); + like(pattern: Expression): BooleanExpression; + like(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'like', + [this, valueToDefaultExpr(stringOrExpr)], + 'like' + ); } /** @@ -766,7 +822,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The regular expression to use for the search. * @return A new `Expr` representing the 'contains' comparison. */ - regexContains(pattern: string): BooleanExpr; + regexContains(pattern: string): BooleanExpression; /** * Creates an expression that checks if a string contains a specified regular expression as a @@ -780,12 +836,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The regular expression to use for the search. * @return A new `Expr` representing the 'contains' comparison. */ - regexContains(pattern: Expr): BooleanExpr; - regexContains(stringOrExpr: string | Expr): BooleanExpr { - return new BooleanExpr('regex_contains', [ - this, - valueToDefaultExpr(stringOrExpr) - ]); + regexContains(pattern: Expression): BooleanExpression; + regexContains(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'regex_contains', + [this, valueToDefaultExpr(stringOrExpr)], + 'regexContains' + ); } /** @@ -799,7 +856,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The regular expression to use for the match. * @return A new `Expr` representing the regular expression match. */ - regexMatch(pattern: string): BooleanExpr; + regexMatch(pattern: string): BooleanExpression; /** * Creates an expression that checks if a string matches a specified regular expression. @@ -812,12 +869,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param pattern The regular expression to use for the match. * @return A new `Expr` representing the regular expression match. */ - regexMatch(pattern: Expr): BooleanExpr; - regexMatch(stringOrExpr: string | Expr): BooleanExpr { - return new BooleanExpr('regex_match', [ - this, - valueToDefaultExpr(stringOrExpr) - ]); + regexMatch(pattern: Expression): BooleanExpression; + regexMatch(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'regex_match', + [this, valueToDefaultExpr(stringOrExpr)], + 'regexMatch' + ); } /** @@ -825,31 +883,32 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Check if the 'description' field contains "example". - * field("description").strContains("example"); + * field("description").stringContains("example"); * ``` * * @param substring The substring to search for. * @return A new `Expr` representing the 'contains' comparison. */ - strContains(substring: string): BooleanExpr; + stringContains(substring: string): BooleanExpression; /** * Creates an expression that checks if a string contains the string represented by another expression. * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * field("description").strContains(field("keyword")); + * field("description").stringContains(field("keyword")); * ``` * * @param expr The expression representing the substring to search for. * @return A new `Expr` representing the 'contains' comparison. */ - strContains(expr: Expr): BooleanExpr; - strContains(stringOrExpr: string | Expr): BooleanExpr { - return new BooleanExpr('str_contains', [ - this, - valueToDefaultExpr(stringOrExpr) - ]); + stringContains(expr: Expression): BooleanExpression; + stringContains(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'string_contains', + [this, valueToDefaultExpr(stringOrExpr)], + 'stringContains' + ); } /** @@ -863,7 +922,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param prefix The prefix to check for. * @return A new `Expr` representing the 'starts with' comparison. */ - startsWith(prefix: string): BooleanExpr; + startsWith(prefix: string): BooleanExpression; /** * Creates an expression that checks if a string starts with a given prefix (represented as an @@ -877,12 +936,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param prefix The prefix expression to check for. * @return A new `Expr` representing the 'starts with' comparison. */ - startsWith(prefix: Expr): BooleanExpr; - startsWith(stringOrExpr: string | Expr): BooleanExpr { - return new BooleanExpr('starts_with', [ - this, - valueToDefaultExpr(stringOrExpr) - ]); + startsWith(prefix: Expression): BooleanExpression; + startsWith(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'starts_with', + [this, valueToDefaultExpr(stringOrExpr)], + 'startsWith' + ); } /** @@ -896,7 +956,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param suffix The postfix to check for. * @return A new `Expr` representing the 'ends with' comparison. */ - endsWith(suffix: string): BooleanExpr; + endsWith(suffix: string): BooleanExpression; /** * Creates an expression that checks if a string ends with a given postfix (represented as an @@ -910,12 +970,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param suffix The postfix expression to check for. * @return A new `Expr` representing the 'ends with' comparison. */ - endsWith(suffix: Expr): BooleanExpr; - endsWith(stringOrExpr: string | Expr): BooleanExpr { - return new BooleanExpr('ends_with', [ - this, - valueToDefaultExpr(stringOrExpr) - ]); + endsWith(suffix: Expression): BooleanExpression; + endsWith(stringOrExpr: string | Expression): BooleanExpression { + return new BooleanExpression( + 'ends_with', + [this, valueToDefaultExpr(stringOrExpr)], + 'endsWith' + ); } /** @@ -928,8 +989,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the lowercase string. */ - toLower(): FunctionExpr { - return new FunctionExpr('to_lower', [this]); + toLower(): FunctionExpression { + return new FunctionExpression('to_lower', [this], 'toLower'); } /** @@ -942,8 +1003,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the uppercase string. */ - toUpper(): FunctionExpr { - return new FunctionExpr('to_upper', [this]); + toUpper(): FunctionExpression { + return new FunctionExpression('to_upper', [this], 'toUpper'); } /** @@ -956,8 +1017,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new `Expr` representing the trimmed string. */ - trim(): FunctionExpr { - return new FunctionExpr('trim', [this]); + trim(): FunctionExpression { + return new FunctionExpression('trim', [this], 'trim'); } /** @@ -965,20 +1026,45 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * field("firstName").strConcat(constant(" "), field("lastName")); + * field("firstName").stringConcat(constant(" "), field("lastName")); * ``` * * @param secondString The additional expression or string literal to concatenate. * @param otherStrings Optional additional expressions or string literals to concatenate. * @return A new `Expr` representing the concatenated string. */ - strConcat( - secondString: Expr | string, - ...otherStrings: Array - ): FunctionExpr { + stringConcat( + secondString: Expression | string, + ...otherStrings: Array + ): FunctionExpression { const elements = [secondString, ...otherStrings]; const exprs = elements.map(valueToDefaultExpr); - return new FunctionExpr('str_concat', [this, ...exprs]); + return new FunctionExpression( + 'string_concat', + [this, ...exprs], + 'stringConcat' + ); + } + + /** + * Creates an expression that concatenates expression results together. + * + * ```typescript + * // Combine the 'firstName', ' ', and 'lastName' fields into a single value. + * field("firstName").concat(constant(" "), field("lastName")); + * ``` + * + * @param second The additional expression or literal to concatenate. + * @param others Optional additional expressions or literals to concatenate. + * @return A new `Expr` representing the concatenated value. + */ + concat( + second: Expression | unknown, + ...others: Array + ): FunctionExpression { + const elements = [second, ...others]; + const exprs = elements.map(valueToDefaultExpr); + return new FunctionExpression('concat', [this, ...exprs], 'concat'); } /** @@ -991,94 +1077,78 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the reversed string. */ - reverse(): FunctionExpr { - return new FunctionExpr('reverse', [this]); + reverse(): FunctionExpression { + return new FunctionExpression('reverse', [this], 'reverse'); } /** - * Creates an expression that replaces the first occurrence of a substring within this string expression with another substring. + * Creates an expression that calculates the length of this string expression in bytes. * * ```typescript - * // Replace the first occurrence of "hello" with "hi" in the 'message' field - * field("message").replaceFirst("hello", "hi"); + * // Calculate the length of the 'myString' field in bytes. + * field("myString").byteLength(); * ``` * - * @param find The substring to search for. - * @param replace The substring to replace the first occurrence of 'find' with. - * @return A new {@code Expr} representing the string with the first occurrence replaced. + * @return A new {@code Expr} representing the length of the string in bytes. */ - replaceFirst(find: string, replace: string): FunctionExpr; + byteLength(): FunctionExpression { + return new FunctionExpression('byte_length', [this], 'byteLength'); + } /** - * Creates an expression that replaces the first occurrence of a substring within this string expression with another substring, - * where the substring to find and the replacement substring are specified by expressions. + * Creates an expression that computes the ceiling of a numeric value. * * ```typescript - * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field - * field("message").replaceFirst(field("findField"), field("replaceField")); + * // Compute the ceiling of the 'price' field. + * field("price").ceil(); * ``` * - * @param find The expression representing the substring to search for. - * @param replace The expression representing the substring to replace the first occurrence of 'find' with. - * @return A new {@code Expr} representing the string with the first occurrence replaced. - */ - replaceFirst(find: Expr, replace: Expr): FunctionExpr; - replaceFirst(find: Expr | string, replace: Expr | string): FunctionExpr { - return new FunctionExpr('replace_first', [ - this, - valueToDefaultExpr(find), - valueToDefaultExpr(replace) - ]); + * @return A new {@code Expr} representing the ceiling of the numeric value. + */ + ceil(): FunctionExpression { + return new FunctionExpression('ceil', [this]); } /** - * Creates an expression that replaces all occurrences of a substring within this string expression with another substring. + * Creates an expression that computes the floor of a numeric value. * * ```typescript - * // Replace all occurrences of "hello" with "hi" in the 'message' field - * field("message").replaceAll("hello", "hi"); + * // Compute the floor of the 'price' field. + * field("price").floor(); * ``` * - * @param find The substring to search for. - * @param replace The substring to replace all occurrences of 'find' with. - * @return A new {@code Expr} representing the string with all occurrences replaced. + * @return A new {@code Expr} representing the floor of the numeric value. */ - replaceAll(find: string, replace: string): FunctionExpr; + floor(): FunctionExpression { + return new FunctionExpression('floor', [this]); + } /** - * Creates an expression that replaces all occurrences of a substring within this string expression with another substring, - * where the substring to find and the replacement substring are specified by expressions. + * Creates an expression that computes the absolute value of a numeric value. * * ```typescript - * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field - * field("message").replaceAll(field("findField"), field("replaceField")); + * // Compute the absolute value of the 'price' field. + * field("price").abs(); * ``` * - * @param find The expression representing the substring to search for. - * @param replace The expression representing the substring to replace all occurrences of 'find' with. - * @return A new {@code Expr} representing the string with all occurrences replaced. - */ - replaceAll(find: Expr, replace: Expr): FunctionExpr; - replaceAll(find: Expr | string, replace: Expr | string): FunctionExpr { - return new FunctionExpr('replace_all', [ - this, - valueToDefaultExpr(find), - valueToDefaultExpr(replace) - ]); + * @return A new {@code Expr} representing the absolute value of the numeric value. + */ + abs(): FunctionExpression { + return new FunctionExpression('abs', [this]); } /** - * Creates an expression that calculates the length of this string expression in bytes. + * Creates an expression that computes e to the power of this expression. * * ```typescript - * // Calculate the length of the 'myString' field in bytes. - * field("myString").byteLength(); + * // Compute e to the power of the 'value' field. + * field("value").exp(); * ``` * - * @return A new {@code Expr} representing the length of the string in bytes. + * @return A new {@code Expr} representing the exp of the numeric value. */ - byteLength(): FunctionExpr { - return new FunctionExpr('byte_length', [this]); + exp(): FunctionExpression { + return new FunctionExpression('exp', [this]); } /** @@ -1092,8 +1162,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param subfield The key to access in the map. * @return A new `Expr` representing the value associated with the given key in the map. */ - mapGet(subfield: string): FunctionExpr { - return new FunctionExpr('map_get', [this, constant(subfield)]); + mapGet(subfield: string): FunctionExpression { + return new FunctionExpression( + 'map_get', + [this, constant(subfield)], + 'mapGet' + ); } /** @@ -1108,7 +1182,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @return A new `AggregateFunction` representing the 'count' aggregation. */ count(): AggregateFunction { - return new AggregateFunction('count', [this]); + return new AggregateFunction('count', [this], 'count'); } /** @@ -1122,7 +1196,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @return A new `AggregateFunction` representing the 'sum' aggregation. */ sum(): AggregateFunction { - return new AggregateFunction('sum', [this]); + return new AggregateFunction('sum', [this], 'sum'); } /** @@ -1131,13 +1205,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Calculate the average age of users - * field("age").avg().as("averageAge"); + * field("age").average().as("averageAge"); * ``` * - * @return A new `AggregateFunction` representing the 'avg' aggregation. + * @return A new `AggregateFunction` representing the 'average' aggregation. */ - avg(): AggregateFunction { - return new AggregateFunction('avg', [this]); + average(): AggregateFunction { + return new AggregateFunction('average', [this], 'average'); } /** @@ -1148,10 +1222,10 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("price").minimum().as("lowestPrice"); * ``` * - * @return A new `AggregateFunction` representing the 'min' aggregation. + * @return A new `AggregateFunction` representing the 'minimum' aggregation. */ minimum(): AggregateFunction { - return new AggregateFunction('minimum', [this]); + return new AggregateFunction('minimum', [this], 'minimum'); } /** @@ -1162,10 +1236,24 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * field("score").maximum().as("highestScore"); * ``` * - * @return A new `AggregateFunction` representing the 'max' aggregation. + * @return A new `AggregateFunction` representing the 'maximum' aggregation. */ maximum(): AggregateFunction { - return new AggregateFunction('maximum', [this]); + return new AggregateFunction('maximum', [this], 'maximum'); + } + + /** + * Creates an aggregation that counts the number of distinct values of the expression or field. + * + * ```typescript + * // Count the distinct number of products + * field("productId").countDistinct().as("distinctProducts"); + * ``` + * + * @return A new `AggregateFunction` representing the 'count_distinct' aggregation. + */ + countDistinct(): AggregateFunction { + return new AggregateFunction('count_distinct', [this], 'countDistinct'); } /** @@ -1178,17 +1266,18 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @param second The second expression or literal to compare with. * @param others Optional additional expressions or literals to compare with. - * @return A new {@code Expr} representing the logical max operation. + * @return A new {@code Expr} representing the logical maximum operation. */ logicalMaximum( - second: Expr | unknown, - ...others: Array - ): FunctionExpr { + second: Expression | unknown, + ...others: Array + ): FunctionExpression { const values = [second, ...others]; - return new FunctionExpr('logical_maximum', [ - this, - ...values.map(valueToDefaultExpr) - ]); + return new FunctionExpression( + 'maximum', + [this, ...values.map(valueToDefaultExpr)], + 'logicalMaximum' + ); } /** @@ -1201,17 +1290,18 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @param second The second expression or literal to compare with. * @param others Optional additional expressions or literals to compare with. - * @return A new {@code Expr} representing the logical min operation. + * @return A new {@code Expr} representing the logical minimum operation. */ logicalMinimum( - second: Expr | unknown, - ...others: Array - ): FunctionExpr { + second: Expression | unknown, + ...others: Array + ): FunctionExpression { const values = [second, ...others]; - return new FunctionExpr('logical_minimum', [ - this, - ...values.map(valueToDefaultExpr) - ]); + return new FunctionExpression( + 'minimum', + [this, ...values.map(valueToDefaultExpr)], + 'minimum' + ); } /** @@ -1224,8 +1314,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the length of the vector. */ - vectorLength(): FunctionExpr { - return new FunctionExpr('vector_length', [this]); + vectorLength(): FunctionExpression { + return new FunctionExpression('vector_length', [this], 'vectorLength'); } /** @@ -1239,7 +1329,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vectorExpression The other vector (represented as an Expr) to compare against. * @return A new `Expr` representing the cosine distance between the two vectors. */ - cosineDistance(vectorExpression: Expr): FunctionExpr; + cosineDistance(vectorExpression: Expression): FunctionExpression; /** * Calculates the Cosine distance between two vectors. * @@ -1251,9 +1341,15 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vector The other vector (as a VectorValue) to compare against. * @return A new `Expr` representing the Cosine* distance between the two vectors. */ - cosineDistance(vector: VectorValue | number[]): FunctionExpr; - cosineDistance(other: Expr | VectorValue | number[]): FunctionExpr { - return new FunctionExpr('cosine_distance', [this, vectorToExpr(other)]); + cosineDistance(vector: VectorValue | number[]): FunctionExpression; + cosineDistance( + other: Expression | VectorValue | number[] + ): FunctionExpression { + return new FunctionExpression( + 'cosine_distance', + [this, vectorToExpr(other)], + 'cosineDistance' + ); } /** @@ -1267,7 +1363,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vectorExpression The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the dot product between the two vectors. */ - dotProduct(vectorExpression: Expr): FunctionExpr; + dotProduct(vectorExpression: Expression): FunctionExpression; /** * Calculates the dot product between two vectors. @@ -1280,9 +1376,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vector The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the dot product between the two vectors. */ - dotProduct(vector: VectorValue | number[]): FunctionExpr; - dotProduct(other: Expr | VectorValue | number[]): FunctionExpr { - return new FunctionExpr('dot_product', [this, vectorToExpr(other)]); + dotProduct(vector: VectorValue | number[]): FunctionExpression; + dotProduct(other: Expression | VectorValue | number[]): FunctionExpression { + return new FunctionExpression( + 'dot_product', + [this, vectorToExpr(other)], + 'dotProduct' + ); } /** @@ -1296,7 +1396,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vectorExpression The other vector (as an array of numbers) to calculate with. * @return A new `Expr` representing the Euclidean distance between the two vectors. */ - euclideanDistance(vectorExpression: Expr): FunctionExpr; + euclideanDistance(vectorExpression: Expression): FunctionExpression; /** * Calculates the Euclidean distance between two vectors. @@ -1309,9 +1409,15 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param vector The other vector (as a VectorValue) to compare against. * @return A new `Expr` representing the Euclidean distance between the two vectors. */ - euclideanDistance(vector: VectorValue | number[]): FunctionExpr; - euclideanDistance(other: Expr | VectorValue | number[]): FunctionExpr { - return new FunctionExpr('euclidean_distance', [this, vectorToExpr(other)]); + euclideanDistance(vector: VectorValue | number[]): FunctionExpression; + euclideanDistance( + other: Expression | VectorValue | number[] + ): FunctionExpression { + return new FunctionExpression( + 'euclidean_distance', + [this, vectorToExpr(other)], + 'euclideanDistance' + ); } /** @@ -1325,8 +1431,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the timestamp. */ - unixMicrosToTimestamp(): FunctionExpr { - return new FunctionExpr('unix_micros_to_timestamp', [this]); + unixMicrosToTimestamp(): FunctionExpression { + return new FunctionExpression( + 'unix_micros_to_timestamp', + [this], + 'unixMicrosToTimestamp' + ); } /** @@ -1339,8 +1449,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the number of microseconds since epoch. */ - timestampToUnixMicros(): FunctionExpr { - return new FunctionExpr('timestamp_to_unix_micros', [this]); + timestampToUnixMicros(): FunctionExpression { + return new FunctionExpression( + 'timestamp_to_unix_micros', + [this], + 'timestampToUnixMicros' + ); } /** @@ -1354,8 +1468,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the timestamp. */ - unixMillisToTimestamp(): FunctionExpr { - return new FunctionExpr('unix_millis_to_timestamp', [this]); + unixMillisToTimestamp(): FunctionExpression { + return new FunctionExpression( + 'unix_millis_to_timestamp', + [this], + 'unixMillisToTimestamp' + ); } /** @@ -1368,8 +1486,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the number of milliseconds since epoch. */ - timestampToUnixMillis(): FunctionExpr { - return new FunctionExpr('timestamp_to_unix_millis', [this]); + timestampToUnixMillis(): FunctionExpression { + return new FunctionExpression( + 'timestamp_to_unix_millis', + [this], + 'timestampToUnixMillis' + ); } /** @@ -1383,8 +1505,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the timestamp. */ - unixSecondsToTimestamp(): FunctionExpr { - return new FunctionExpr('unix_seconds_to_timestamp', [this]); + unixSecondsToTimestamp(): FunctionExpression { + return new FunctionExpression( + 'unix_seconds_to_timestamp', + [this], + 'unixSecondsToTimestamp' + ); } /** @@ -1397,8 +1523,12 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the number of seconds since epoch. */ - timestampToUnixSeconds(): FunctionExpr { - return new FunctionExpr('timestamp_to_unix_seconds', [this]); + timestampToUnixSeconds(): FunctionExpression { + return new FunctionExpression( + 'timestamp_to_unix_seconds', + [this], + 'timestampToUnixSeconds' + ); } /** @@ -1413,7 +1543,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param amount The expression evaluates to amount of the unit. * @return A new {@code Expr} representing the resulting timestamp. */ - timestampAdd(unit: Expr, amount: Expr): FunctionExpr; + timestampAdd(unit: Expression, amount: Expression): FunctionExpression; /** * Creates an expression that adds a specified amount of time to this timestamp expression. @@ -1430,23 +1560,23 @@ export abstract class Expr implements ProtoValueSerializable, UserData { timestampAdd( unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number - ): FunctionExpr; + ): FunctionExpression; timestampAdd( unit: - | Expr + | Expression | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', - amount: Expr | number - ): FunctionExpr { - return new FunctionExpr('timestamp_add', [ - this, - valueToDefaultExpr(unit), - valueToDefaultExpr(amount) - ]); + amount: Expression | number + ): FunctionExpression { + return new FunctionExpression( + 'timestamp_add', + [this, valueToDefaultExpr(unit), valueToDefaultExpr(amount)], + 'timestampAdd' + ); } /** @@ -1454,238 +1584,47 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. - * field("timestamp").timestampSub(field("unit"), field("amount")); + * field("timestamp").timestampSubtract(field("unit"), field("amount")); * ``` * * @param unit The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. * @param amount The expression evaluates to amount of the unit. * @return A new {@code Expr} representing the resulting timestamp. */ - timestampSub(unit: Expr, amount: Expr): FunctionExpr; + timestampSubtract(unit: Expression, amount: Expression): FunctionExpression; /** * Creates an expression that subtracts a specified amount of time from this timestamp expression. * * ```typescript * // Subtract 1 day from the 'timestamp' field. - * field("timestamp").timestampSub("day", 1); + * field("timestamp").timestampSubtract("day", 1); * ``` * * @param unit The unit of time to subtract (e.g., "day", "hour"). * @param amount The amount of time to subtract. * @return A new {@code Expr} representing the resulting timestamp. */ - timestampSub( + timestampSubtract( unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number - ): FunctionExpr; - timestampSub( + ): FunctionExpression; + timestampSubtract( unit: - | Expr + | Expression | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', - amount: Expr | number - ): FunctionExpr { - return new FunctionExpr('timestamp_sub', [ - this, - valueToDefaultExpr(unit), - valueToDefaultExpr(amount) - ]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise AND operation between this expression and a constant. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 0xFF. - * field("field1").bitAnd(0xFF); - * ``` - * - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise AND operation. - */ - bitAnd(otherBits: number | Bytes): FunctionExpr; - /** - * @beta - * - * Creates an expression that applies a bitwise AND operation between two expressions. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 'field2'. - * field("field1").bitAnd(field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise AND operation. - */ - bitAnd(bitsExpression: Expr): FunctionExpr; - bitAnd(bitsOrExpression: number | Expr | Bytes): FunctionExpr { - return new FunctionExpr('bit_and', [ - this, - valueToDefaultExpr(bitsOrExpression) - ]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise OR operation between this expression and a constant. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 0xFF. - * field("field1").bitOr(0xFF); - * ``` - * - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise OR operation. - */ - bitOr(otherBits: number | Bytes): FunctionExpr; - /** - * @beta - * - * Creates an expression that applies a bitwise OR operation between two expressions. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 'field2'. - * field("field1").bitOr(field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise OR operation. - */ - bitOr(bitsExpression: Expr): FunctionExpr; - bitOr(bitsOrExpression: number | Expr | Bytes): FunctionExpr { - return new FunctionExpr('bit_or', [ - this, - valueToDefaultExpr(bitsOrExpression) - ]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between this expression and a constant. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 0xFF. - * field("field1").bitXor(0xFF); - * ``` - * - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ - bitXor(otherBits: number | Bytes): FunctionExpr; - /** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between two expressions. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 'field2'. - * field("field1").bitXor(field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ - bitXor(bitsExpression: Expr): FunctionExpr; - bitXor(bitsOrExpression: number | Expr | Bytes): FunctionExpr { - return new FunctionExpr('bit_xor', [ - this, - valueToDefaultExpr(bitsOrExpression) - ]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise NOT operation to this expression. - * - * ```typescript - * // Calculate the bitwise NOT of 'field1'. - * field("field1").bitNot(); - * ``` - * - * @return A new {@code Expr} representing the bitwise NOT operation. - */ - bitNot(): FunctionExpr { - return new FunctionExpr('bit_not', [this]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise left shift operation to this expression. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 2 bits. - * field("field1").bitLeftShift(2); - * ``` - * - * @param y The operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ - bitLeftShift(y: number): FunctionExpr; - /** - * @beta - * - * Creates an expression that applies a bitwise left shift operation to this expression. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 'field2' bits. - * field("field1").bitLeftShift(field("field2")); - * ``` - * - * @param numberExpr The operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ - bitLeftShift(numberExpr: Expr): FunctionExpr; - bitLeftShift(numberExpr: number | Expr): FunctionExpr { - return new FunctionExpr('bit_left_shift', [ - this, - valueToDefaultExpr(numberExpr) - ]); - } - - /** - * @beta - * - * Creates an expression that applies a bitwise right shift operation to this expression. - * - * ```typescript - * // Calculate the bitwise right shift of 'field1' by 2 bits. - * field("field1").bitRightShift(2); - * ``` - * - * @param right The operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. - */ - bitRightShift(y: number): FunctionExpr; - /** - * @beta - * - * Creates an expression that applies a bitwise right shift operation to this expression. - * - * ```typescript - * // Calculate the bitwise right shift of 'field1' by 'field2' bits. - * field("field1").bitRightShift(field("field2")); - * ``` - * - * @param numberExpr The operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. - */ - bitRightShift(numberExpr: Expr): FunctionExpr; - bitRightShift(numberExpr: number | Expr): FunctionExpr { - return new FunctionExpr('bit_right_shift', [ - this, - valueToDefaultExpr(numberExpr) - ]); + amount: Expression | number + ): FunctionExpression { + return new FunctionExpression( + 'timestamp_subtract', + [this, valueToDefaultExpr(unit), valueToDefaultExpr(amount)], + 'timestampSubtract' + ); } /** @@ -1700,8 +1639,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the documentId operation. */ - documentId(): FunctionExpr { - return new FunctionExpr('document_id', [this]); + documentId(): FunctionExpression { + return new FunctionExpression('document_id', [this], 'documentId'); } /** @@ -1713,7 +1652,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param length Length of the substring. If not provided, the substring will * end at the end of the input. */ - substr(position: number, length?: number): FunctionExpr; + substring(position: number, length?: number): FunctionExpression; /** * @beta @@ -1724,17 +1663,24 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param length An expression returning the length of the substring. If not provided the * substring will end at the end of the input. */ - substr(position: Expr, length?: Expr): FunctionExpr; - substr(position: Expr | number, length?: Expr | number): FunctionExpr { + substring(position: Expression, length?: Expression): FunctionExpression; + substring( + position: Expression | number, + length?: Expression | number + ): FunctionExpression { const positionExpr = valueToDefaultExpr(position); if (length === undefined) { - return new FunctionExpr('substr', [this, positionExpr]); + return new FunctionExpression( + 'substring', + [this, positionExpr], + 'substring' + ); } else { - return new FunctionExpr('substr', [ - this, - positionExpr, - valueToDefaultExpr(length) - ]); + return new FunctionExpression( + 'substring', + [this, positionExpr, valueToDefaultExpr(length)], + 'substring' + ); } } @@ -1746,13 +1692,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * ```typescript * // Return the value in the 'tags' field array at index `1`. - * field('tags').arrayOffset(1); + * field('tags').arrayGet(1); * ``` * * @param offset The index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. + * @return A new Expr representing the 'arrayGet' operation. */ - arrayOffset(offset: number): FunctionExpr; + arrayGet(offset: number): FunctionExpression; /** * @beta @@ -1763,15 +1709,19 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * ```typescript * // Return the value in the tags field array at index specified by field * // 'favoriteTag'. - * field('tags').arrayOffset(field('favoriteTag')); + * field('tags').arrayGet(field('favoriteTag')); * ``` * * @param offsetExpr An Expr evaluating to the index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. - */ - arrayOffset(offsetExpr: Expr): FunctionExpr; - arrayOffset(offset: Expr | number): FunctionExpr { - return new FunctionExpr('array_offset', [this, valueToDefaultExpr(offset)]); + * @return A new Expr representing the 'arrayGet' operation. + */ + arrayGet(offsetExpr: Expression): FunctionExpression; + arrayGet(offset: Expression | number): FunctionExpression { + return new FunctionExpression( + 'array_get', + [this, valueToDefaultExpr(offset)], + 'arrayGet' + ); } /** @@ -1786,8 +1736,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code BooleanExpr} representing the 'isError' check. */ - isError(): BooleanExpr { - return new BooleanExpr('is_error', [this]); + isError(): BooleanExpression { + return new BooleanExpression('is_error', [this], 'isError'); } /** @@ -1799,14 +1749,14 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * ```typescript * // Returns the first item in the title field arrays, or returns * // the entire title field if the array is empty or the field is another type. - * field("title").arrayOffset(0).ifError(field("title")); + * field("title").arrayGet(0).ifError(field("title")); * ``` * * @param catchExpr The catch expression that will be evaluated and * returned if this expression produces an error. * @return A new {@code Expr} representing the 'ifError' operation. */ - ifError(catchExpr: Expr): FunctionExpr; + ifError(catchExpr: Expression): FunctionExpression; /** * @beta @@ -1817,16 +1767,20 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * ```typescript * // Returns the first item in the title field arrays, or returns * // "Default Title" - * field("title").arrayOffset(0).ifError("Default Title"); + * field("title").arrayGet(0).ifError("Default Title"); * ``` * * @param catchValue The value that will be returned if this expression * produces an error. * @return A new {@code Expr} representing the 'ifError' operation. */ - ifError(catchValue: unknown): FunctionExpr; - ifError(catchValue: unknown): FunctionExpr { - return new FunctionExpr('if_error', [this, valueToDefaultExpr(catchValue)]); + ifError(catchValue: unknown): FunctionExpression; + ifError(catchValue: unknown): FunctionExpression { + return new FunctionExpression( + 'if_error', + [this, valueToDefaultExpr(catchValue)], + 'ifError' + ); } /** @@ -1842,8 +1796,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code BooleanExpr} representing the 'isAbsent' check. */ - isAbsent(): BooleanExpr { - return new BooleanExpr('is_absent', [this]); + isAbsent(): BooleanExpression { + return new BooleanExpression('is_absent', [this], 'isAbsent'); } /** @@ -1858,8 +1812,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code BooleanExpr} representing the 'isNotNull' check. */ - isNotNull(): BooleanExpr { - return new BooleanExpr('is_not_null', [this]); + isNotNull(): BooleanExpression { + return new BooleanExpression('is_not_null', [this], 'isNotNull'); } /** @@ -1874,8 +1828,8 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * * @return A new {@code Expr} representing the 'isNaN' check. */ - isNotNan(): BooleanExpr { - return new BooleanExpr('is_not_nan', [this]); + isNotNan(): BooleanExpression { + return new BooleanExpression('is_not_nan', [this], 'isNotNan'); } /** @@ -1891,7 +1845,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param key The name of the key to remove from the input map. * @returns A new {@code FirestoreFunction} representing the 'mapRemove' operation. */ - mapRemove(key: string): FunctionExpr; + mapRemove(key: string): FunctionExpression; /** * @beta * @@ -1905,12 +1859,13 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @param keyExpr An expression that produces the name of the key to remove from the input map. * @returns A new {@code FirestoreFunction} representing the 'mapRemove' operation. */ - mapRemove(keyExpr: Expr): FunctionExpr; - mapRemove(stringExpr: Expr | string): FunctionExpr { - return new FunctionExpr('map_remove', [ - this, - valueToDefaultExpr(stringExpr) - ]); + mapRemove(keyExpr: Expression): FunctionExpression; + mapRemove(stringExpr: Expression | string): FunctionExpression { + return new FunctionExpression( + 'map_remove', + [this, valueToDefaultExpr(stringExpr)], + 'mapRemove' + ); } /** @@ -1921,7 +1876,7 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * ``` * // Merges the map in the settings field with, a map literal, and a map in * // that is conditionally returned by another expression - * field('settings').mapMerge({ enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * field('settings').mapMerge({ enabled: true }, conditional(field('isAdmin'), { admin: true}, {}) * ``` * * @param secondMap A required second map to merge. Represented as a literal or @@ -1932,121 +1887,391 @@ export abstract class Expr implements ProtoValueSerializable, UserData { * @returns A new {@code FirestoreFunction} representing the 'mapMerge' operation. */ mapMerge( - secondMap: Record | Expr, - ...otherMaps: Array | Expr> - ): FunctionExpr { + secondMap: Record | Expression, + ...otherMaps: Array | Expression> + ): FunctionExpression { const secondMapExpr = valueToDefaultExpr(secondMap); const otherMapExprs = otherMaps.map(valueToDefaultExpr); - return new FunctionExpr('map_merge', [ - this, - secondMapExpr, - ...otherMapExprs - ]); + return new FunctionExpression( + 'map_merge', + [this, secondMapExpr, ...otherMapExprs], + 'mapMerge' + ); } /** - * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * Creates an expression that returns the value of this expression raised to the power of another expression. * * ```typescript - * // Sort documents by the 'name' field in ascending order - * pipeline().collection("users") - * .sort(field("name").ascending()); + * // Raise the value of the 'base' field to the power of the 'exponent' field. + * field("base").pow(field("exponent")); * ``` * - * @return A new `Ordering` for ascending sorting. + * @param exponent The expression to raise this expression to the power of. + * @return A new `Expr` representing the power operation. */ - ascending(): Ordering { - return ascending(this); - } + pow(exponent: Expression): FunctionExpression; /** - * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * Creates an expression that returns the value of this expression raised to the power of a constant value. * * ```typescript - * // Sort documents by the 'createdAt' field in descending order - * firestore.pipeline().collection("users") - * .sort(field("createdAt").descending()); + * // Raise the value of the 'base' field to the power of 2. + * field("base").pow(2); * ``` * - * @return A new `Ordering` for descending sorting. + * @param exponent The constant value to raise this expression to the power of. + * @return A new `Expr` representing the power operation. */ - descending(): Ordering { - return descending(this); + pow(exponent: number): FunctionExpression; + pow(exponent: number | Expression): FunctionExpression { + return new FunctionExpression('pow', [this, valueToDefaultExpr(exponent)]); } /** - * Assigns an alias to this expression. + * Creates an expression that rounds a numeric value to the nearest whole number. * - * Aliases are useful for renaming fields in the output of a stage or for giving meaningful - * names to calculated values. + * ```typescript + * // Round the value of the 'price' field. + * field("price").round(); + * ``` + * + * @return A new `Expr` representing the rounded value. + */ + round(): FunctionExpression; + /** + * Creates an expression that rounds a numeric value to the specified number of decimal places. * * ```typescript - * // Calculate the total price and assign it the alias "totalPrice" and add it to the output. - * firestore.pipeline().collection("items") - * .addFields(field("price").multiply(field("quantity")).as("totalPrice")); + * // Round the value of the 'price' field to two decimal places. + * field("price").round(2); * ``` * - * @param name The alias to assign to this expression. - * @return A new {@link ExprWithAlias} that wraps this - * expression and associates it with the provided alias. + * @param decimalPlaces A constant specifying the rounding precision in decimal places. + * + * @return A new `Expr` representing the rounded value. */ - as(name: string): ExprWithAlias { - return new ExprWithAlias(this, name); - } -} - -/** - * @beta - * - * An interface that represents a selectable expression. - */ -export interface Selectable { - selectable: true; - readonly alias: string; - readonly expr: Expr; -} - -/** - * @beta - * - * A class that represents an aggregate function. - */ -export class AggregateFunction implements ProtoValueSerializable, UserData { - exprType: ExprType = 'AggregateFunction'; - + round(decimalPlaces: number): FunctionExpression; /** - * @internal - * @private - * Indicates if this expression was created from a literal value passed - * by the caller. + * Creates an expression that rounds a numeric value to the specified number of decimal places. + * + * ```typescript + * // Round the value of the 'price' field to two decimal places. + * field("price").round(constant(2)); + * ``` + * + * @param decimalPlaces An expression specifying the rounding precision in decimal places. + * + * @return A new `Expr` representing the rounded value. */ - _createdFromLiteral: boolean = false; - - constructor(private name: string, private params: Expr[]) {} + round(decimalPlaces: Expression): FunctionExpression; + round(decimalPlaces?: number | Expression): FunctionExpression { + if (decimalPlaces === undefined) { + return new FunctionExpression('round', [this]); + } else { + return new FunctionExpression( + 'round', + [this, valueToDefaultExpr(decimalPlaces)], + 'round' + ); + } + } /** - * Assigns an alias to this AggregateFunction. The alias specifies the name that - * the aggregated value will have in the output document. + * Creates an expression that returns the collection ID from a path. * * ```typescript - * // Calculate the average price of all items and assign it the alias "averagePrice". - * firestore.pipeline().collection("items") - * .aggregate(field("price").avg().as("averagePrice")); + * // Get the collection ID from a path. + * field("__path__").collectionId(); * ``` * - * @param name The alias to assign to this AggregateFunction. - * @return A new {@link AggregateWithAlias} that wraps this - * AggregateFunction and associates it with the provided alias. + * @return A new {@code Expr} representing the collectionId operation. */ - as(name: string): AggregateWithAlias { - return new AggregateWithAlias(this, name); + collectionId(): FunctionExpression { + return new FunctionExpression('collection_id', [this]); } /** - * @private - * @internal - */ - _toProto(serializer: JsonProtoSerializer): ProtoValue { + * Creates an expression that calculates the length of a string, array, map, vector, or bytes. + * + * ```typescript + * // Get the length of the 'name' field. + * field("name").length(); + * + * // Get the number of items in the 'cart' array. + * field("cart").length(); + * ``` + * + * @return A new `Expr` representing the length of the string, array, map, vector, or bytes. + */ + length(): FunctionExpression { + return new FunctionExpression('length', [this]); + } + + /** + * Creates an expression that computes the natural logarithm of a numeric value. + * + * ```typescript + * // Compute the natural logarithm of the 'value' field. + * field("value").ln(); + * ``` + * + * @return A new {@code Expr} representing the natural logarithm of the numeric value. + */ + ln(): FunctionExpression { + return new FunctionExpression('ln', [this]); + } + + /** + * Creates an expression that computes the square root of a numeric value. + * + * ```typescript + * // Compute the square root of the 'value' field. + * field("value").sqrt(); + * ``` + * + * @return A new {@code Expr} representing the square root of the numeric value. + */ + sqrt(): FunctionExpression { + return new FunctionExpression('sqrt', [this]); + } + + /** + * Creates an expression that reverses a string. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * field("myString").stringReverse(); + * ``` + * + * @return A new {@code Expr} representing the reversed string. + */ + stringReverse(): FunctionExpression { + return new FunctionExpression('string_reverse', [this]); + } + + /** + * Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else + * return the result of the this expression evaluation. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or returns 'default_value' + * // if the field is absent. + * field("optional_field").ifAbsent("default_value") + * ``` + * + * @param elseValue The value that will be returned if this Expression evaluates to an absent value. + * @return A new [Expression] representing the ifAbsent operation. + */ + ifAbsent(elseValue: unknown): Expression; + + /** + * Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else + * return the result of this expression evaluation. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or if that is + * // absent, then returns the value of the field ` + * field("optional_field").ifAbsent(field('default_field')) + * ``` + * + * @param elseExpression The Expression that will be evaluated if this Expression evaluates to an absent value. + * @return A new [Expression] representing the ifAbsent operation. + */ + ifAbsent(elseExpression: unknown): Expression; + + ifAbsent(elseValueOrExpression: Expression | unknown): Expression { + return new FunctionExpression( + 'if_absent', + [this, valueToDefaultExpr(elseValueOrExpression)], + 'ifAbsent' + ); + } + + /** + * Creates an expression that joins the elements of an array into a string. + * + * ```typescript + * // Join the elements of the 'tags' field with the delimiter from the 'separator' field. + * field("tags").join(field("separator")) + * ``` + * + * @param delimiterExpression The expression that evaluates to the delimiter string. + * @return A new Expression representing the join operation. + */ + join(delimiterExpression: Expression): Expression; + + /** + * Creates an expression that joins the elements of an array field into a string. + * + * ```typescript + * // Join the elements of the 'tags' field with a comma and space. + * field("tags").join(", ") + * ``` + * + * @param delimiter The string to use as a delimiter. + * @return A new Expression representing the join operation. + */ + join(delimiter: string): Expression; + + join(delimeterValueOrExpression: string | Expression): Expression { + return new FunctionExpression( + 'join', + [this, valueToDefaultExpr(delimeterValueOrExpression)], + 'join' + ); + } + + /** + * Creates an expression that computes the base-10 logarithm of a numeric value. + * + * ```typescript + * // Compute the base-10 logarithm of the 'value' field. + * field("value").log10(); + * ``` + * + * @return A new {@code Expr} representing the base-10 logarithm of the numeric value. + */ + log10(): FunctionExpression { + return new FunctionExpression('log10', [this]); + } + + /** + * Creates an expression that computes the sum of the elements in an array. + * + * ```typescript + * // Compute the sum of the elements in the 'scores' field. + * field("scores").arraySum(); + * ``` + * + * @return A new {@code Expr} representing the sum of the elements in the array. + */ + arraySum(): FunctionExpression { + return new FunctionExpression('sum', [this]); + } + + // TODO(new-expression): Add new expression method definitions above this line + + /** + * Creates an {@link Ordering} that sorts documents in ascending order based on this expression. + * + * ```typescript + * // Sort documents by the 'name' field in ascending order + * pipeline().collection("users") + * .sort(field("name").ascending()); + * ``` + * + * @return A new `Ordering` for ascending sorting. + */ + ascending(): Ordering { + return ascending(this); + } + + /** + * Creates an {@link Ordering} that sorts documents in descending order based on this expression. + * + * ```typescript + * // Sort documents by the 'createdAt' field in descending order + * firestore.pipeline().collection("users") + * .sort(field("createdAt").descending()); + * ``` + * + * @return A new `Ordering` for descending sorting. + */ + descending(): Ordering { + return descending(this); + } + + /** + * Assigns an alias to this expression. + * + * Aliases are useful for renaming fields in the output of a stage or for giving meaningful + * names to calculated values. + * + * ```typescript + * // Calculate the total price and assign it the alias "totalPrice" and add it to the output. + * firestore.pipeline().collection("items") + * .addFields(field("price").multiply(field("quantity")).as("totalPrice")); + * ``` + * + * @param name The alias to assign to this expression. + * @return A new {@link AliasedExpression} that wraps this + * expression and associates it with the provided alias. + */ + as(name: string): AliasedExpression { + return new AliasedExpression(this, name, 'as'); + } +} + +/** + * @beta + * + * An interface that represents a selectable expression. + */ +export interface Selectable { + selectable: true; + /** + * @private + * @internal + */ + readonly alias: string; + /** + * @private + * @internal + */ + readonly expr: Expression; +} + +/** + * @beta + * + * A class that represents an aggregate function. + */ +export class AggregateFunction implements ProtoValueSerializable, UserData { + exprType: ExpressionType = 'AggregateFunction'; + + constructor(name: string, params: Expression[]); + /** + * INTERNAL Constructor with method name for validation. + * @hideconstructor + * @param name + * @param params + * @param _methodName + */ + constructor( + name: string, + params: Expression[], + _methodName: string | undefined + ); + constructor( + private name: string, + private params: Expression[], + readonly _methodName?: string + ) {} + + /** + * Assigns an alias to this AggregateFunction. The alias specifies the name that + * the aggregated value will have in the output document. + * + * ```typescript + * // Calculate the average price of all items and assign it the alias "averagePrice". + * firestore.pipeline().collection("items") + * .aggregate(field("price").average().as("averagePrice")); + * ``` + * + * @param name The alias to assign to this AggregateFunction. + * @return A new {@link AliasedAggregate} that wraps this + * AggregateFunction and associates it with the provided alias. + */ + as(name: string): AliasedAggregate { + return new AliasedAggregate(this, name, 'as'); + } + + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { return { functionValue: { name: this.name, @@ -2061,13 +2286,12 @@ export class AggregateFunction implements ProtoValueSerializable, UserData { * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, this.name); + _readUserData(context: ParseContext): void { + context = this._methodName + ? context.contextWith({ methodName: this._methodName }) + : context; this.params.forEach(expr => { - return expr._readUserData(dataReader, context); + return expr._readUserData(context); }); } } @@ -2077,67 +2301,54 @@ export class AggregateFunction implements ProtoValueSerializable, UserData { * * An AggregateFunction with alias. */ -export class AggregateWithAlias implements UserData { - constructor(readonly aggregate: AggregateFunction, readonly alias: string) {} - - /** - * @internal - * @private - * Indicates if this expression was created from a literal value passed - * by the caller. - */ - _createdFromLiteral: boolean = false; +export class AliasedAggregate implements UserData { + constructor( + readonly aggregate: AggregateFunction, + readonly alias: string, + readonly _methodName: string | undefined + ) {} /** * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, 'as'); - this.aggregate._readUserData(dataReader, context); + _readUserData(context: ParseContext): void { + this.aggregate._readUserData(context); } } /** * @beta */ -export class ExprWithAlias implements Selectable, UserData { - exprType: ExprType = 'ExprWithAlias'; +export class AliasedExpression implements Selectable, UserData { + exprType: ExpressionType = 'AliasedExpression'; selectable = true as const; - /** - * @internal - * @private - * Indicates if this expression was created from a literal value passed - * by the caller. - */ - _createdFromLiteral: boolean = false; - - constructor(readonly expr: Expr, readonly alias: string) {} + constructor( + readonly expr: Expression, + readonly alias: string, + readonly _methodName: string | undefined + ) {} /** * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, 'as'); - this.expr._readUserData(dataReader, context); + _readUserData(context: ParseContext): void { + this.expr._readUserData(context); } } /** * @internal */ -class ListOfExprs extends Expr implements UserData { - exprType: ExprType = 'ListOfExprs'; +class ListOfExprs extends Expression implements UserData { + expressionType: ExpressionType = 'ListOfExpressions'; - constructor(private exprs: Expr[]) { + constructor( + private exprs: Expression[], + readonly _methodName: string | undefined + ) { super(); } @@ -2157,8 +2368,8 @@ class ListOfExprs extends Expr implements UserData { * @private * @internal */ - _readUserData(dataReader: UserDataReader): void { - this.exprs.forEach((expr: Expr) => expr._readUserData(dataReader)); + _readUserData(context: ParseContext): void { + this.exprs.forEach((expr: Expression) => expr._readUserData(context)); } } @@ -2180,8 +2391,8 @@ class ListOfExprs extends Expr implements UserData { * const cityField = field("address.city"); * ``` */ -export class Field extends Expr implements Selectable { - readonly exprType: ExprType = 'Field'; +export class Field extends Expression implements Selectable { + readonly expressionType: ExpressionType = 'Field'; selectable = true as const; /** @@ -2190,19 +2401,22 @@ export class Field extends Expr implements Selectable { * @hideconstructor * @param fieldPath */ - constructor(private fieldPath: InternalFieldPath) { + constructor( + private fieldPath: InternalFieldPath, + readonly _methodName: string | undefined + ) { super(); } - fieldName(): string { + get fieldName(): string { return this.fieldPath.canonicalString(); } get alias(): string { - return this.fieldName(); + return this.fieldName; } - get expr(): Expr { + get expr(): Expression { return this; } @@ -2220,7 +2434,7 @@ export class Field extends Expr implements Selectable { * @private * @internal */ - _readUserData(dataReader: UserDataReader): void {} + _readUserData(context: ParseContext): void {} } /** @@ -2243,18 +2457,25 @@ export class Field extends Expr implements Selectable { export function field(name: string): Field; export function field(path: FieldPath): Field; export function field(nameOrPath: string | FieldPath): Field { + return _field(nameOrPath, 'field'); +} + +export function _field( + nameOrPath: string | FieldPath, + methodName: string | undefined +): Field { if (typeof nameOrPath === 'string') { if (DOCUMENT_KEY_NAME === nameOrPath) { - return new Field(documentIdFieldPath()._internalPath); + return new Field(documentIdFieldPath()._internalPath, methodName); } - return new Field(fieldPathFromArgument('field', nameOrPath)); + return new Field(fieldPathFromArgument('field', nameOrPath), methodName); } else { - return new Field(nameOrPath._internalPath); + return new Field(nameOrPath._internalPath, methodName); } } /** - * @beta + * @internal * * Represents a constant value that can be used in a Firestore pipeline expression. * @@ -2268,8 +2489,8 @@ export function field(nameOrPath: string | FieldPath): Field { * const hello = constant("hello"); * ``` */ -export class Constant extends Expr { - readonly exprType: ExprType = 'Constant'; +export class Constant extends Expression { + readonly expressionType: ExpressionType = 'Constant'; private _protoValue?: ProtoValue; @@ -2279,7 +2500,10 @@ export class Constant extends Expr { * @hideconstructor * @param value The value of the constant. */ - constructor(private value: unknown) { + constructor( + private value: unknown, + readonly _methodName: string | undefined + ) { super(); } @@ -2288,7 +2512,7 @@ export class Constant extends Expr { * @internal */ static _fromProto(value: ProtoValue): Constant { - const result = new Constant(value); + const result = new Constant(value, undefined); result._protoValue = value; return result; } @@ -2297,7 +2521,7 @@ export class Constant extends Expr { * @private * @internal */ - _toProto(serializer: JsonProtoSerializer): ProtoValue { + _toProto(_: JsonProtoSerializer): ProtoValue { hardAssert( this._protoValue !== undefined, 0x00ed, @@ -2310,12 +2534,10 @@ export class Constant extends Expr { * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, 'constant'); - + _readUserData(context: ParseContext): void { + context = this._methodName + ? context.contextWith({ methodName: this._methodName }) + : context; if (isFirestoreValue(this._protoValue)) { return; } else { @@ -2330,7 +2552,7 @@ export class Constant extends Expr { * @param value The number value. * @return A new `Constant` instance. */ -export function constant(value: number): Constant; +export function constant(value: number): Expression; /** * Creates a `Constant` instance for a string value. @@ -2338,15 +2560,15 @@ export function constant(value: number): Constant; * @param value The string value. * @return A new `Constant` instance. */ -export function constant(value: string): Constant; +export function constant(value: string): Expression; /** - * Creates a `Constant` instance for a boolean value. + * Creates a `BooleanExpression` instance for a boolean value. * * @param value The boolean value. * @return A new `Constant` instance. */ -export function constant(value: boolean): Constant; +export function constant(value: boolean): BooleanExpression; /** * Creates a `Constant` instance for a null value. @@ -2354,7 +2576,7 @@ export function constant(value: boolean): Constant; * @param value The null value. * @return A new `Constant` instance. */ -export function constant(value: null): Constant; +export function constant(value: null): Expression; /** * Creates a `Constant` instance for a GeoPoint value. @@ -2362,7 +2584,7 @@ export function constant(value: null): Constant; * @param value The GeoPoint value. * @return A new `Constant` instance. */ -export function constant(value: GeoPoint): Constant; +export function constant(value: GeoPoint): Expression; /** * Creates a `Constant` instance for a Timestamp value. @@ -2370,7 +2592,7 @@ export function constant(value: GeoPoint): Constant; * @param value The Timestamp value. * @return A new `Constant` instance. */ -export function constant(value: Timestamp): Constant; +export function constant(value: Timestamp): Expression; /** * Creates a `Constant` instance for a Date value. @@ -2378,7 +2600,7 @@ export function constant(value: Timestamp): Constant; * @param value The Date value. * @return A new `Constant` instance. */ -export function constant(value: Date): Constant; +export function constant(value: Date): Expression; /** * Creates a `Constant` instance for a Bytes value. @@ -2386,7 +2608,7 @@ export function constant(value: Date): Constant; * @param value The Bytes value. * @return A new `Constant` instance. */ -export function constant(value: Bytes): Constant; +export function constant(value: Bytes): Expression; /** * Creates a `Constant` instance for a DocumentReference value. @@ -2394,7 +2616,7 @@ export function constant(value: Bytes): Constant; * @param value The DocumentReference value. * @return A new `Constant` instance. */ -export function constant(value: DocumentReference): Constant; +export function constant(value: DocumentReference): Expression; /** * Creates a `Constant` instance for a Firestore proto value. @@ -2404,7 +2626,7 @@ export function constant(value: DocumentReference): Constant; * @param value The Firestore proto value. * @return A new `Constant` instance. */ -export function constant(value: ProtoValue): Constant; +export function constant(value: ProtoValue): Expression; /** * Creates a `Constant` instance for a VectorValue value. @@ -2412,28 +2634,26 @@ export function constant(value: ProtoValue): Constant; * @param value The VectorValue value. * @return A new `Constant` instance. */ -export function constant(value: VectorValue): Constant; +export function constant(value: VectorValue): Expression; -export function constant(value: unknown): Constant { - return new Constant(value); +export function constant(value: unknown): Expression | BooleanExpression { + return _constant(value, 'constant'); } /** - * Creates a `Constant` instance for a VectorValue value. - * - * ```typescript - * // Create a Constant instance for a vector value - * const vectorConstant = constantVector([1, 2, 3]); - * ``` - * - * @param value The VectorValue value. - * @return A new `Constant` instance. - */ -export function constantVector(value: number[] | VectorValue): Constant { - if (value instanceof VectorValue) { - return new Constant(value); + * @internal + * @private + * @param value + * @param methodName + */ +export function _constant( + value: unknown, + methodName: string | undefined +): Constant | BooleanExpression { + if (typeof value === 'boolean') { + return new BooleanConstant(value, methodName); } else { - return new Constant(new VectorValue(value as number[])); + return new Constant(value, methodName); } } @@ -2442,21 +2662,22 @@ export function constantVector(value: number[] | VectorValue): Constant { * @internal * @private */ -export class MapValue extends Expr { - constructor(private plainObject: Map) { +export class MapValue extends Expression { + constructor( + private plainObject: Map, + readonly _methodName: string | undefined + ) { super(); } - exprType: ExprType = 'Constant'; - - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, '_map'); + expressionType: ExpressionType = 'Constant'; + _readUserData(context: ParseContext): void { + context = this._methodName + ? context.contextWith({ methodName: this._methodName }) + : context; this.plainObject.forEach(expr => { - expr._readUserData(dataReader, context); + expr._readUserData(context); }); } @@ -2471,13 +2692,23 @@ export class MapValue extends Expr { * This class defines the base class for Firestore {@link Pipeline} functions, which can be evaluated within pipeline * execution. * - * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link eq}, - * or the methods on {@link Expr} ({@link Expr#eq}, {@link Expr#lt}, etc.) to construct new Function instances. + * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link equal}, + * or the methods on {@link Expression} ({@link Expression#equal}, {@link Expression#lessThan}, etc.) to construct new Function instances. */ -export class FunctionExpr extends Expr { - readonly exprType: ExprType = 'Function'; +export class FunctionExpression extends Expression { + readonly expressionType: ExpressionType = 'Function'; - constructor(private name: string, private params: Expr[]) { + constructor(name: string, params: Expression[]); + constructor( + name: string, + params: Expression[], + _methodName: string | undefined + ); + constructor( + private name: string, + private params: Expression[], + readonly _methodName?: string + ) { super(); } @@ -2498,13 +2729,12 @@ export class FunctionExpr extends Expr { * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, this.name); + _readUserData(context: ParseContext): void { + context = this._methodName + ? context.contextWith({ methodName: this._methodName }) + : context; this.params.forEach(expr => { - return expr._readUserData(dataReader, context); + return expr._readUserData(context); }); } } @@ -2514,7 +2744,7 @@ export class FunctionExpr extends Expr { * * An interface that represents a filter condition. */ -export class BooleanExpr extends FunctionExpr { +export class BooleanExpression extends FunctionExpression { filterable: true = true; /** @@ -2523,13 +2753,13 @@ export class BooleanExpr extends FunctionExpr { * * ```typescript * // Find the count of documents with a score greater than 90 - * field("score").gt(90).countIf().as("highestScore"); + * field("score").greaterThan(90).countIf().as("highestScore"); * ``` * * @return A new `AggregateFunction` representing the 'countIf' aggregation. */ countIf(): AggregateFunction { - return new AggregateFunction('count_if', [this]); + return new AggregateFunction('count_if', [this], 'countIf'); } /** @@ -2542,424 +2772,102 @@ export class BooleanExpr extends FunctionExpr { * * @return A new {@code Expr} representing the negated filter condition. */ - not(): BooleanExpr { - return new BooleanExpr('not', [this]); + not(): BooleanExpression { + return new BooleanExpression('not', [this], 'not'); + } + + /** + * Creates a conditional expression that evaluates to the 'then' expression + * if `this` expression evaluates to `true`, + * or evaluates to the 'else' expression if `this` expressions evaluates `false`. + * + * ```typescript + * // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". + * field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor")); + * ``` + * + * @param thenExpr The expression to evaluate if the condition is true. + * @param elseExpr The expression to evaluate if the condition is false. + * @return A new {@code Expr} representing the conditional expression. + */ + conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression { + return new FunctionExpression( + 'conditional', + [this, thenExpr, elseExpr], + 'conditional' + ); + } + + /** + * @beta + * + * Creates an expression that returns the `catch` argument if there is an + * error, else return the result of this expression. + * + * ```typescript + * // Create an expression that protects against a divide by zero error + * // but always returns a boolean expression. + * constant(50).divide('length').gt(1).ifError(constant(false)); + * ``` + * + * @param catchValue The value that will be returned if this expression + * produces an error. + * @return A new {@code Expr} representing the 'ifError' operation. + */ + ifError(catchValue: BooleanExpression): BooleanExpression { + return new BooleanExpression('if_error', [this, catchValue], 'ifError'); } } /** - * @beta - * Creates an aggregation that counts the number of stage inputs where the provided - * boolean expression evaluates to true. + * @private + * @internal * - * ```typescript - * // Count the number of documents where 'is_active' field equals true - * countIf(field("is_active").eq(true)).as("numActiveDocuments"); - * ``` - * - * @param booleanExpr - The boolean expression to evaluate on each input. - * @returns A new `AggregateFunction` representing the 'countIf' aggregation. - */ -export function countIf(booleanExpr: BooleanExpr): AggregateFunction { - return booleanExpr.countIf(); -} - -/** - * @beta - * Creates an expression that return a pseudo-random value of type double in the - * range of [0, 1), inclusive of 0 and exclusive of 1. - * - * @returns A new `Expr` representing the 'rand' function. - */ -export function rand(): FunctionExpr { - return new FunctionExpr('rand', []); -} - -/** - * @beta - * - * Creates an expression that applies a bitwise AND operation between a field and a constant. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 0xFF. - * bitAnd("field1", 0xFF); - * ``` - * - * @param field The left operand field name. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise AND operation. - */ -export function bitAnd(field: string, otherBits: number | Bytes): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise AND operation between a field and an expression. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 'field2'. - * bitAnd("field1", field("field2")); - * ``` - * - * @param field The left operand field name. - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise AND operation. - */ -export function bitAnd(field: string, bitsExpression: Expr): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise AND operation between an expression and a constant. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 0xFF. - * bitAnd(field("field1"), 0xFF); - * ``` - * - * @param bitsExpression An expression returning bits. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise AND operation. - */ -export function bitAnd( - bitsExpression: Expr, - otherBits: number | Bytes -): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise AND operation between two expressions. - * - * ```typescript - * // Calculate the bitwise AND of 'field1' and 'field2'. - * bitAnd(field("field1"), field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @param otherBitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise AND operation. + * To return a BooleanExpr as a constant, we need to break the pattern that expects a BooleanExpr to be a + * "pipeline function". Instead of building on serialization logic built into BooleanExpr, + * we override methods with those of an internally kept Constant value. */ -export function bitAnd( - bitsExpression: Expr, - otherBitsExpression: Expr -): FunctionExpr; -export function bitAnd( - bits: string | Expr, - bitsOrExpression: number | Expr | Bytes -): FunctionExpr { - return fieldOrExpression(bits).bitAnd(valueToDefaultExpr(bitsOrExpression)); -} +export class BooleanConstant extends BooleanExpression { + private readonly _internalConstant: Constant; -/** - * @beta - * - * Creates an expression that applies a bitwise OR operation between a field and a constant. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 0xFF. - * bitOr("field1", 0xFF); - * ``` - * - * @param field The left operand field name. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise OR operation. - */ -export function bitOr(field: string, otherBits: number | Bytes): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise OR operation between a field and an expression. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 'field2'. - * bitOr("field1", field("field2")); - * ``` - * - * @param field The left operand field name. - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise OR operation. - */ -export function bitOr(field: string, bitsExpression: Expr): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise OR operation between an expression and a constant. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 0xFF. - * bitOr(field("field1"), 0xFF); - * ``` - * - * @param bitsExpression An expression returning bits. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise OR operation. - */ -export function bitOr( - bitsExpression: Expr, - otherBits: number | Bytes -): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise OR operation between two expressions. - * - * ```typescript - * // Calculate the bitwise OR of 'field1' and 'field2'. - * bitOr(field("field1"), field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @param otherBitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise OR operation. - */ -export function bitOr( - bitsExpression: Expr, - otherBitsExpression: Expr -): FunctionExpr; -export function bitOr( - bits: string | Expr, - bitsOrExpression: number | Expr | Bytes -): FunctionExpr { - return fieldOrExpression(bits).bitOr(valueToDefaultExpr(bitsOrExpression)); -} + constructor(value: boolean, readonly _methodName?: string) { + super('', []); -/** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between a field and a constant. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 0xFF. - * bitXor("field1", 0xFF); - * ``` - * - * @param field The left operand field name. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ -export function bitXor(field: string, otherBits: number | Bytes): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between a field and an expression. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 'field2'. - * bitXor("field1", field("field2")); - * ``` - * - * @param field The left operand field name. - * @param bitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ -export function bitXor(field: string, bitsExpression: Expr): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between an expression and a constant. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 0xFF. - * bitXor(field("field1"), 0xFF); - * ``` - * - * @param bitsExpression An expression returning bits. - * @param otherBits A constant representing bits. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ -export function bitXor( - bitsExpression: Expr, - otherBits: number | Bytes -): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise XOR operation between two expressions. - * - * ```typescript - * // Calculate the bitwise XOR of 'field1' and 'field2'. - * bitXor(field("field1"), field("field2")); - * ``` - * - * @param bitsExpression An expression that returns bits when evaluated. - * @param otherBitsExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise XOR operation. - */ -export function bitXor( - bitsExpression: Expr, - otherBitsExpression: Expr -): FunctionExpr; -export function bitXor( - bits: string | Expr, - bitsOrExpression: number | Expr | Bytes -): FunctionExpr { - return fieldOrExpression(bits).bitXor(valueToDefaultExpr(bitsOrExpression)); -} + this._internalConstant = new Constant(value, _methodName); + } -/** - * @beta - * - * Creates an expression that applies a bitwise NOT operation to a field. - * - * ```typescript - * // Calculate the bitwise NOT of 'field1'. - * bitNot("field1"); - * ``` - * - * @param field The operand field name. - * @return A new {@code Expr} representing the bitwise NOT operation. - */ -export function bitNot(field: string): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise NOT operation to an expression. - * - * ```typescript - * // Calculate the bitwise NOT of 'field1'. - * bitNot(field("field1")); - * ``` - * - * @param bitsValueExpression An expression that returns bits when evaluated. - * @return A new {@code Expr} representing the bitwise NOT operation. - */ -export function bitNot(bitsValueExpression: Expr): FunctionExpr; -export function bitNot(bits: string | Expr): FunctionExpr { - return fieldOrExpression(bits).bitNot(); -} + /** + * @private + * @internal + */ + _toProto(serializer: JsonProtoSerializer): ProtoValue { + return this._internalConstant._toProto(serializer); + } -/** - * @beta - * - * Creates an expression that applies a bitwise left shift operation between a field and a constant. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 2 bits. - * bitLeftShift("field1", 2); - * ``` - * - * @param field The left operand field name. - * @param y The right operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ -export function bitLeftShift(field: string, y: number): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise left shift operation between a field and an expression. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 'field2' bits. - * bitLeftShift("field1", field("field2")); - * ``` - * - * @param field The left operand field name. - * @param numberExpr The right operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ -export function bitLeftShift(field: string, numberExpr: Expr): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise left shift operation between an expression and a constant. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 2 bits. - * bitLeftShift(field("field1"), 2); - * ``` - * - * @param xValue An expression returning bits. - * @param y The right operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ -export function bitLeftShift(xValue: Expr, y: number): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise left shift operation between two expressions. - * - * ```typescript - * // Calculate the bitwise left shift of 'field1' by 'field2' bits. - * bitLeftShift(field("field1"), field("field2")); - * ``` - * - * @param xValue An expression returning bits. - * @param numberExpr The right operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise left shift operation. - */ -export function bitLeftShift(xValue: Expr, numberExpr: Expr): FunctionExpr; -export function bitLeftShift( - xValue: string | Expr, - numberExpr: number | Expr -): FunctionExpr { - return fieldOrExpression(xValue).bitLeftShift(valueToDefaultExpr(numberExpr)); + /** + * @private + * @internal + */ + _readUserData(context: ParseContext): void { + return this._internalConstant._readUserData(context); + } } /** * @beta - * - * Creates an expression that applies a bitwise right shift operation between a field and a constant. - * - * ```typescript - * // Calculate the bitwise right shift of 'field1' by 2 bits. - * bitRightShift("field1", 2); - * ``` - * - * @param field The left operand field name. - * @param y The right operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. - */ -export function bitRightShift(field: string, y: number): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise right shift operation between a field and an expression. - * - * ```typescript - * // Calculate the bitwise right shift of 'field1' by 'field2' bits. - * bitRightShift("field1", field("field2")); - * ``` - * - * @param field The left operand field name. - * @param numberExpr The right operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. - */ -export function bitRightShift(field: string, numberExpr: Expr): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise right shift operation between an expression and a constant. - * - * ```typescript - * // Calculate the bitwise right shift of 'field1' by 2 bits. - * bitRightShift(field("field1"), 2); - * ``` - * - * @param xValue An expression returning bits. - * @param y The right operand constant representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. - */ -export function bitRightShift(xValue: Expr, y: number): FunctionExpr; -/** - * @beta - * - * Creates an expression that applies a bitwise right shift operation between two expressions. + * Creates an aggregation that counts the number of stage inputs where the provided + * boolean expression evaluates to true. * * ```typescript - * // Calculate the bitwise right shift of 'field1' by 'field2' bits. - * bitRightShift(field("field1"), field("field2")); + * // Count the number of documents where 'is_active' field equals true + * countIf(field("is_active").equal(true)).as("numActiveDocuments"); * ``` * - * @param xValue An expression returning bits. - * @param right The right operand expression representing the number of bits to shift. - * @return A new {@code Expr} representing the bitwise right shift operation. + * @param booleanExpr - The boolean expression to evaluate on each input. + * @returns A new `AggregateFunction` representing the 'countIf' aggregation. */ -export function bitRightShift(xValue: Expr, numberExpr: Expr): FunctionExpr; -export function bitRightShift( - xValue: string | Expr, - numberExpr: number | Expr -): FunctionExpr { - return fieldOrExpression(xValue).bitRightShift( - valueToDefaultExpr(numberExpr) - ); +export function countIf(booleanExpr: BooleanExpression): AggregateFunction { + return booleanExpr.countIf(); } /** @@ -2970,14 +2878,17 @@ export function bitRightShift( * * ```typescript * // Return the value in the tags field array at index 1. - * arrayOffset('tags', 1); + * arrayGet('tags', 1); * ``` * * @param arrayField The name of the array field. * @param offset The index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. + * @return A new Expr representing the 'arrayGet' operation. */ -export function arrayOffset(arrayField: string, offset: number): FunctionExpr; +export function arrayGet( + arrayField: string, + offset: number +): FunctionExpression; /** * @beta @@ -2988,14 +2899,17 @@ export function arrayOffset(arrayField: string, offset: number): FunctionExpr; * ```typescript * // Return the value in the tags field array at index specified by field * // 'favoriteTag'. - * arrayOffset('tags', field('favoriteTag')); + * arrayGet('tags', field('favoriteTag')); * ``` * * @param arrayField The name of the array field. * @param offsetExpr An Expr evaluating to the index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. + * @return A new Expr representing the 'arrayGet' operation. */ -export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; +export function arrayGet( + arrayField: string, + offsetExpr: Expression +): FunctionExpression; /** * @beta @@ -3005,17 +2919,17 @@ export function arrayOffset(arrayField: string, offsetExpr: Expr): FunctionExpr; * * ```typescript * // Return the value in the tags field array at index 1. - * arrayOffset(field('tags'), 1); + * arrayGet(field('tags'), 1); * ``` * * @param arrayExpression An Expr evaluating to an array. * @param offset The index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. + * @return A new Expr representing the 'arrayGet' operation. */ -export function arrayOffset( - arrayExpression: Expr, +export function arrayGet( + arrayExpression: Expression, offset: number -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -3026,22 +2940,22 @@ export function arrayOffset( * ```typescript * // Return the value in the tags field array at index specified by field * // 'favoriteTag'. - * arrayOffset(field('tags'), field('favoriteTag')); + * arrayGet(field('tags'), field('favoriteTag')); * ``` * * @param arrayExpression An Expr evaluating to an array. * @param offsetExpr An Expr evaluating to the index of the element to return. - * @return A new Expr representing the 'arrayOffset' operation. - */ -export function arrayOffset( - arrayExpression: Expr, - offsetExpr: Expr -): FunctionExpr; -export function arrayOffset( - array: Expr | string, - offset: Expr | number -): FunctionExpr { - return fieldOrExpression(array).arrayOffset(valueToDefaultExpr(offset)); + * @return A new Expr representing the 'arrayGet' operation. + */ +export function arrayGet( + arrayExpression: Expression, + offsetExpr: Expression +): FunctionExpression; +export function arrayGet( + array: Expression | string, + offset: Expression | number +): FunctionExpression { + return fieldOrExpression(array).arrayGet(valueToDefaultExpr(offset)); } /** @@ -3057,10 +2971,34 @@ export function arrayOffset( * @param value The expression to check. * @return A new {@code Expr} representing the 'isError' check. */ -export function isError(value: Expr): BooleanExpr { +export function isError(value: Expression): BooleanExpression { return value.isError(); } +/** + * @beta + * + * Creates an expression that returns the `catch` argument if there is an + * error, else return the result of the `try` argument evaluation. + * + * This overload is useful when a BooleanExpression is required. + * + * ```typescript + * // Create an expression that protects against a divide by zero error + * // but always returns a boolean expression. + * ifError(constant(50).divide('length').gt(1), constant(false)); + * ``` + * + * @param tryExpr The try expression. + * @param catchExpr The catch expression that will be evaluated and + * returned if the tryExpr produces an error. + * @return A new {@code Expr} representing the 'ifError' operation. + */ +export function ifError( + tryExpr: BooleanExpression, + catchExpr: BooleanExpression +): BooleanExpression; + /** * @beta * @@ -3070,7 +3008,7 @@ export function isError(value: Expr): BooleanExpr { * ```typescript * // Returns the first item in the title field arrays, or returns * // the entire title field if the array is empty or the field is another type. - * ifError(field("title").arrayOffset(0), field("title")); + * ifError(field("title").arrayGet(0), field("title")); * ``` * * @param tryExpr The try expression. @@ -3078,7 +3016,10 @@ export function isError(value: Expr): BooleanExpr { * returned if the tryExpr produces an error. * @return A new {@code Expr} representing the 'ifError' operation. */ -export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; +export function ifError( + tryExpr: Expression, + catchExpr: Expression +): FunctionExpression; /** * @beta @@ -3089,7 +3030,7 @@ export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; * ```typescript * // Returns the first item in the title field arrays, or returns * // "Default Title" - * ifError(field("title").arrayOffset(0), "Default Title"); + * ifError(field("title").arrayGet(0), "Default Title"); * ``` * * @param tryExpr The try expression. @@ -3097,9 +3038,22 @@ export function ifError(tryExpr: Expr, catchExpr: Expr): FunctionExpr; * error. * @return A new {@code Expr} representing the 'ifError' operation. */ -export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr; -export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr { - return tryExpr.ifError(valueToDefaultExpr(catchValue)); +export function ifError( + tryExpr: Expression, + catchValue: unknown +): FunctionExpression; +export function ifError( + tryExpr: Expression, + catchValue: unknown +): FunctionExpression { + if ( + tryExpr instanceof BooleanExpression && + catchValue instanceof BooleanExpression + ) { + return tryExpr.ifError(catchValue); + } else { + return tryExpr.ifError(valueToDefaultExpr(catchValue)); + } } /** @@ -3116,7 +3070,7 @@ export function ifError(tryExpr: Expr, catchValue: unknown): FunctionExpr { * @param value The expression to check. * @return A new {@code Expr} representing the 'isAbsent' check. */ -export function isAbsent(value: Expr): BooleanExpr; +export function isAbsent(value: Expression): BooleanExpression; /** * @beta @@ -3132,8 +3086,8 @@ export function isAbsent(value: Expr): BooleanExpr; * @param field The field to check. * @return A new {@code Expr} representing the 'isAbsent' check. */ -export function isAbsent(field: string): BooleanExpr; -export function isAbsent(value: Expr | string): BooleanExpr { +export function isAbsent(field: string): BooleanExpression; +export function isAbsent(value: Expression | string): BooleanExpression { return fieldOrExpression(value).isAbsent(); } @@ -3150,7 +3104,7 @@ export function isAbsent(value: Expr | string): BooleanExpr { * @param value The expression to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNull(value: Expr): BooleanExpr; +export function isNull(value: Expression): BooleanExpression; /** * @beta @@ -3165,8 +3119,8 @@ export function isNull(value: Expr): BooleanExpr; * @param value The name of the field to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNull(value: string): BooleanExpr; -export function isNull(value: Expr | string): BooleanExpr { +export function isNull(value: string): BooleanExpression; +export function isNull(value: Expression | string): BooleanExpression { return fieldOrExpression(value).isNull(); } @@ -3183,7 +3137,7 @@ export function isNull(value: Expr | string): BooleanExpr { * @param value The expression to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNotNull(value: Expr): BooleanExpr; +export function isNotNull(value: Expression): BooleanExpression; /** * @beta @@ -3198,8 +3152,8 @@ export function isNotNull(value: Expr): BooleanExpr; * @param value The name of the field to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNotNull(value: string): BooleanExpr; -export function isNotNull(value: Expr | string): BooleanExpr { +export function isNotNull(value: string): BooleanExpression; +export function isNotNull(value: Expression | string): BooleanExpression { return fieldOrExpression(value).isNotNull(); } @@ -3216,7 +3170,7 @@ export function isNotNull(value: Expr | string): BooleanExpr { * @param value The expression to check. * @return A new {@code Expr} representing the 'isNotNaN' check. */ -export function isNotNan(value: Expr): BooleanExpr; +export function isNotNan(value: Expression): BooleanExpression; /** * @beta @@ -3231,8 +3185,8 @@ export function isNotNan(value: Expr): BooleanExpr; * @param value The name of the field to check. * @return A new {@code Expr} representing the 'isNotNaN' check. */ -export function isNotNan(value: string): BooleanExpr; -export function isNotNan(value: Expr | string): BooleanExpr { +export function isNotNan(value: string): BooleanExpression; +export function isNotNan(value: Expression | string): BooleanExpression { return fieldOrExpression(value).isNotNan(); } @@ -3249,7 +3203,7 @@ export function isNotNan(value: Expr | string): BooleanExpr { * @param mapField The name of a field containing a map value. * @param key The name of the key to remove from the input map. */ -export function mapRemove(mapField: string, key: string): FunctionExpr; +export function mapRemove(mapField: string, key: string): FunctionExpression; /** * @beta * @@ -3263,7 +3217,7 @@ export function mapRemove(mapField: string, key: string): FunctionExpr; * @param mapExpr An expression return a map value. * @param key The name of the key to remove from the input map. */ -export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; +export function mapRemove(mapExpr: Expression, key: string): FunctionExpression; /** * @beta * @@ -3277,7 +3231,10 @@ export function mapRemove(mapExpr: Expr, key: string): FunctionExpr; * @param mapField The name of a field containing a map value. * @param keyExpr An expression that produces the name of the key to remove from the input map. */ -export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; +export function mapRemove( + mapField: string, + keyExpr: Expression +): FunctionExpression; /** * @beta * @@ -3291,12 +3248,15 @@ export function mapRemove(mapField: string, keyExpr: Expr): FunctionExpr; * @param mapExpr An expression return a map value. * @param keyExpr An expression that produces the name of the key to remove from the input map. */ -export function mapRemove(mapExpr: Expr, keyExpr: Expr): FunctionExpr; +export function mapRemove( + mapExpr: Expression, + keyExpr: Expression +): FunctionExpression; export function mapRemove( - mapExpr: Expr | string, - stringExpr: Expr | string -): FunctionExpr { + mapExpr: Expression | string, + stringExpr: Expression | string +): FunctionExpression { return fieldOrExpression(mapExpr).mapRemove(valueToDefaultExpr(stringExpr)); } @@ -3308,7 +3268,7 @@ export function mapRemove( * ``` * // Merges the map in the settings field with, a map literal, and a map in * // that is conditionally returned by another expression - * mapMerge('settings', { enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {}) * ``` * * @param mapField Name of a field containing a map value that will be merged. @@ -3319,9 +3279,9 @@ export function mapRemove( */ export function mapMerge( mapField: string, - secondMap: Record | Expr, - ...otherMaps: Array | Expr> -): FunctionExpr; + secondMap: Record | Expression, + ...otherMaps: Array | Expression> +): FunctionExpression; /** * @beta @@ -3331,7 +3291,7 @@ export function mapMerge( * ``` * // Merges the map in the settings field with, a map literal, and a map in * // that is conditionally returned by another expression - * mapMerge(field('settings'), { enabled: true }, cond(field('isAdmin'), { admin: true}, {}) + * mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {}) * ``` * * @param firstMap An expression or literal map value that will be merged. @@ -3341,16 +3301,16 @@ export function mapMerge( * as a literal or an expression that returns a map. */ export function mapMerge( - firstMap: Record | Expr, - secondMap: Record | Expr, - ...otherMaps: Array | Expr> -): FunctionExpr; + firstMap: Record | Expression, + secondMap: Record | Expression, + ...otherMaps: Array | Expression> +): FunctionExpression; export function mapMerge( - firstMap: string | Record | Expr, - secondMap: Record | Expr, - ...otherMaps: Array | Expr> -): FunctionExpr { + firstMap: string | Record | Expression, + secondMap: Record | Expression, + ...otherMaps: Array | Expression> +): FunctionExpression { const secondMapExpr = valueToDefaultExpr(secondMap); const otherMapExprs = otherMaps.map(valueToDefaultExpr); return fieldOrExpression(firstMap).mapMerge(secondMapExpr, ...otherMapExprs); @@ -3370,7 +3330,7 @@ export function mapMerge( */ export function documentId( documentPath: string | DocumentReference -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -3384,11 +3344,11 @@ export function documentId( * * @return A new {@code Expr} representing the documentId operation. */ -export function documentId(documentPathExpr: Expr): FunctionExpr; +export function documentId(documentPathExpr: Expression): FunctionExpression; export function documentId( - documentPath: Expr | string | DocumentReference -): FunctionExpr { + documentPath: Expression | string | DocumentReference +): FunctionExpression { // @ts-ignore const documentPathExpr = valueToDefaultExpr(documentPath); return documentPathExpr.documentId(); @@ -3403,11 +3363,11 @@ export function documentId( * @param position Index of the first character of the substring. * @param length Length of the substring. */ -export function substr( +export function substring( field: string, position: number, length?: number -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -3418,11 +3378,11 @@ export function substr( * @param position Index of the first character of the substring. * @param length Length of the substring. */ -export function substr( - input: Expr, +export function substring( + input: Expression, position: number, length?: number -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -3433,11 +3393,11 @@ export function substr( * @param position An expression that returns the index of the first character of the substring. * @param length An expression that returns the length of the substring. */ -export function substr( +export function substring( field: string, - position: Expr, - length?: Expr -): FunctionExpr; + position: Expression, + length?: Expression +): FunctionExpression; /** * @beta @@ -3448,22 +3408,22 @@ export function substr( * @param position An expression that returns the index of the first character of the substring. * @param length An expression that returns the length of the substring. */ -export function substr( - input: Expr, - position: Expr, - length?: Expr -): FunctionExpr; - -export function substr( - field: Expr | string, - position: Expr | number, - length?: Expr | number -): FunctionExpr { +export function substring( + input: Expression, + position: Expression, + length?: Expression +): FunctionExpression; + +export function substring( + field: Expression | string, + position: Expression | number, + length?: Expression | number +): FunctionExpression { const fieldExpr = fieldOrExpression(field); const positionExpr = valueToDefaultExpr(position); const lengthExpr = length === undefined ? undefined : valueToDefaultExpr(length); - return fieldExpr.substr(positionExpr, lengthExpr); + return fieldExpr.substring(positionExpr, lengthExpr); } /** @@ -3482,10 +3442,9 @@ export function substr( * @return A new {@code Expr} representing the addition operation. */ export function add( - first: Expr, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + first: Expression, + second: Expression | unknown +): FunctionExpression; /** * @beta @@ -3504,19 +3463,14 @@ export function add( */ export function add( fieldName: string, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + second: Expression | unknown +): FunctionExpression; export function add( - first: Expr | string, - second: Expr | unknown, - ...others: Array -): FunctionExpr { - return fieldOrExpression(first).add( - valueToDefaultExpr(second), - ...others.map(value => valueToDefaultExpr(value)) - ); + first: Expression | string, + second: Expression | unknown +): FunctionExpression { + return fieldOrExpression(first).add(valueToDefaultExpr(second)); } /** @@ -3533,7 +3487,10 @@ export function add( * @param right The expression to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(left: Expr, right: Expr): FunctionExpr; +export function subtract( + left: Expression, + right: Expression +): FunctionExpression; /** * @beta @@ -3549,7 +3506,10 @@ export function subtract(left: Expr, right: Expr): FunctionExpr; * @param value The constant value to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(expression: Expr, value: unknown): FunctionExpr; +export function subtract( + expression: Expression, + value: unknown +): FunctionExpression; /** * @beta @@ -3565,7 +3525,10 @@ export function subtract(expression: Expr, value: unknown): FunctionExpr; * @param expression The expression to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(fieldName: string, expression: Expr): FunctionExpr; +export function subtract( + fieldName: string, + expression: Expression +): FunctionExpression; /** * @beta @@ -3581,11 +3544,11 @@ export function subtract(fieldName: string, expression: Expr): FunctionExpr; * @param value The constant value to subtract. * @return A new {@code Expr} representing the subtraction operation. */ -export function subtract(fieldName: string, value: unknown): FunctionExpr; +export function subtract(fieldName: string, value: unknown): FunctionExpression; export function subtract( - left: Expr | string, - right: Expr | unknown -): FunctionExpr { + left: Expression | string, + right: Expression | unknown +): FunctionExpression { const normalizedLeft = typeof left === 'string' ? field(left) : left; const normalizedRight = valueToDefaultExpr(right); return normalizedLeft.subtract(normalizedRight); @@ -3607,10 +3570,9 @@ export function subtract( * @return A new {@code Expr} representing the multiplication operation. */ export function multiply( - first: Expr, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + first: Expression, + second: Expression | unknown +): FunctionExpression; /** * @beta @@ -3629,19 +3591,14 @@ export function multiply( */ export function multiply( fieldName: string, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + second: Expression | unknown +): FunctionExpression; export function multiply( - first: Expr | string, - second: Expr | unknown, - ...others: Array -): FunctionExpr { - return fieldOrExpression(first).multiply( - valueToDefaultExpr(second), - ...others.map(valueToDefaultExpr) - ); + first: Expression | string, + second: Expression | unknown +): FunctionExpression { + return fieldOrExpression(first).multiply(valueToDefaultExpr(second)); } /** @@ -3658,7 +3615,7 @@ export function multiply( * @param right The expression to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(left: Expr, right: Expr): FunctionExpr; +export function divide(left: Expression, right: Expression): FunctionExpression; /** * @beta @@ -3674,7 +3631,10 @@ export function divide(left: Expr, right: Expr): FunctionExpr; * @param value The constant value to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(expression: Expr, value: unknown): FunctionExpr; +export function divide( + expression: Expression, + value: unknown +): FunctionExpression; /** * @beta @@ -3690,7 +3650,10 @@ export function divide(expression: Expr, value: unknown): FunctionExpr; * @param expressions The expression to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(fieldName: string, expressions: Expr): FunctionExpr; +export function divide( + fieldName: string, + expressions: Expression +): FunctionExpression; /** * @beta @@ -3706,11 +3669,11 @@ export function divide(fieldName: string, expressions: Expr): FunctionExpr; * @param value The constant value to divide by. * @return A new {@code Expr} representing the division operation. */ -export function divide(fieldName: string, value: unknown): FunctionExpr; +export function divide(fieldName: string, value: unknown): FunctionExpression; export function divide( - left: Expr | string, - right: Expr | unknown -): FunctionExpr { + left: Expression | string, + right: Expression | unknown +): FunctionExpression { const normalizedLeft = typeof left === 'string' ? field(left) : left; const normalizedRight = valueToDefaultExpr(right); return normalizedLeft.divide(normalizedRight); @@ -3730,7 +3693,7 @@ export function divide( * @param right The divisor expression. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(left: Expr, right: Expr): FunctionExpr; +export function mod(left: Expression, right: Expression): FunctionExpression; /** * @beta @@ -3746,7 +3709,7 @@ export function mod(left: Expr, right: Expr): FunctionExpr; * @param value The divisor constant. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(expression: Expr, value: unknown): FunctionExpr; +export function mod(expression: Expression, value: unknown): FunctionExpression; /** * @beta @@ -3762,7 +3725,10 @@ export function mod(expression: Expr, value: unknown): FunctionExpr; * @param expression The divisor expression. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(fieldName: string, expression: Expr): FunctionExpr; +export function mod( + fieldName: string, + expression: Expression +): FunctionExpression; /** * @beta @@ -3778,8 +3744,11 @@ export function mod(fieldName: string, expression: Expr): FunctionExpr; * @param value The divisor constant. * @return A new {@code Expr} representing the modulo operation. */ -export function mod(fieldName: string, value: unknown): FunctionExpr; -export function mod(left: Expr | string, right: Expr | unknown): FunctionExpr { +export function mod(fieldName: string, value: unknown): FunctionExpression; +export function mod( + left: Expression | string, + right: Expression | unknown +): FunctionExpression { const normalizedLeft = typeof left === 'string' ? field(left) : left; const normalizedRight = valueToDefaultExpr(right); return normalizedLeft.mod(normalizedRight); @@ -3798,8 +3767,14 @@ export function mod(left: Expr | string, right: Expr | unknown): FunctionExpr { * @param elements The input map to evaluate in the expression. * @return A new {@code Expr} representing the map function. */ -export function map(elements: Record): FunctionExpr { - const result: Expr[] = []; +export function map(elements: Record): FunctionExpression { + return _map(elements, 'map'); +} +export function _map( + elements: Record, + methodName: string | undefined +): FunctionExpression { + const result: Expression[] = []; for (const key in elements) { if (Object.prototype.hasOwnProperty.call(elements, key)) { const value = elements[key]; @@ -3807,7 +3782,7 @@ export function map(elements: Record): FunctionExpr { result.push(valueToDefaultExpr(value)); } } - return new FunctionExpr('map', result); + return new FunctionExpression('map', result, 'map'); } /** @@ -3822,14 +3797,14 @@ export function map(elements: Record): FunctionExpr { * @param plainObject */ export function _mapValue(plainObject: Record): MapValue { - const result: Map = new Map(); + const result: Map = new Map(); for (const key in plainObject) { if (Object.prototype.hasOwnProperty.call(plainObject, key)) { const value = plainObject[key]; result.set(key, valueToDefaultExpr(value)); } } - return new MapValue(result); + return new MapValue(result, undefined); } /** @@ -3845,10 +3820,17 @@ export function _mapValue(plainObject: Record): MapValue { * @param elements The input array to evaluate in the expression. * @return A new {@code Expr} representing the array function. */ -export function array(elements: unknown[]): FunctionExpr { - return new FunctionExpr( +export function array(elements: unknown[]): FunctionExpression { + return _array(elements, 'array'); +} +export function _array( + elements: unknown[], + methodName: string | undefined +): FunctionExpression { + return new FunctionExpression( 'array', - elements.map(element => valueToDefaultExpr(element)) + elements.map(element => valueToDefaultExpr(element)), + methodName ); } @@ -3859,14 +3841,14 @@ export function array(elements: unknown[]): FunctionExpr { * * ```typescript * // Check if the 'age' field is equal to an expression - * eq(field("age"), field("minAge").add(10)); + * equal(field("age"), field("minAge").add(10)); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the equality comparison. */ -export function eq(left: Expr, right: Expr): BooleanExpr; +export function equal(left: Expression, right: Expression): BooleanExpression; /** * @beta @@ -3875,14 +3857,17 @@ export function eq(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'age' field is equal to 21 - * eq(field("age"), 21); + * equal(field("age"), 21); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(expression: Expr, value: unknown): BooleanExpr; +export function equal( + expression: Expression, + value: unknown +): BooleanExpression; /** * @beta @@ -3891,14 +3876,17 @@ export function eq(expression: Expr, value: unknown): BooleanExpr; * * ```typescript * // Check if the 'age' field is equal to the 'limit' field - * eq("age", field("limit")); + * equal("age", field("limit")); * ``` * * @param fieldName The field name to compare. * @param expression The expression to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(fieldName: string, expression: Expr): BooleanExpr; +export function equal( + fieldName: string, + expression: Expression +): BooleanExpression; /** * @beta @@ -3907,18 +3895,21 @@ export function eq(fieldName: string, expression: Expr): BooleanExpr; * * ```typescript * // Check if the 'city' field is equal to string constant "London" - * eq("city", "London"); + * equal("city", "London"); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the equality comparison. */ -export function eq(fieldName: string, value: unknown): BooleanExpr; -export function eq(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function equal(fieldName: string, value: unknown): BooleanExpression; +export function equal( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.eq(rightExpr); + return leftExpr.equal(rightExpr); } /** @@ -3928,14 +3919,17 @@ export function eq(left: Expr | string, right: unknown): BooleanExpr { * * ```typescript * // Check if the 'status' field is not equal to field 'finalState' - * neq(field("status"), field("finalState")); + * notEqual(field("status"), field("finalState")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the inequality comparison. */ -export function neq(left: Expr, right: Expr): BooleanExpr; +export function notEqual( + left: Expression, + right: Expression +): BooleanExpression; /** * @beta @@ -3944,14 +3938,17 @@ export function neq(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'status' field is not equal to "completed" - * neq(field("status"), "completed"); + * notEqual(field("status"), "completed"); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(expression: Expr, value: unknown): BooleanExpr; +export function notEqual( + expression: Expression, + value: unknown +): BooleanExpression; /** * @beta @@ -3960,14 +3957,17 @@ export function neq(expression: Expr, value: unknown): BooleanExpr; * * ```typescript * // Check if the 'status' field is not equal to the value of 'expectedStatus' - * neq("status", field("expectedStatus")); + * notEqual("status", field("expectedStatus")); * ``` * * @param fieldName The field name to compare. * @param expression The expression to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(fieldName: string, expression: Expr): BooleanExpr; +export function notEqual( + fieldName: string, + expression: Expression +): BooleanExpression; /** * @beta @@ -3976,18 +3976,21 @@ export function neq(fieldName: string, expression: Expr): BooleanExpr; * * ```typescript * // Check if the 'country' field is not equal to "USA" - * neq("country", "USA"); + * notEqual("country", "USA"); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the inequality comparison. */ -export function neq(fieldName: string, value: unknown): BooleanExpr; -export function neq(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function notEqual(fieldName: string, value: unknown): BooleanExpression; +export function notEqual( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.neq(rightExpr); + return leftExpr.notEqual(rightExpr); } /** @@ -3997,14 +4000,17 @@ export function neq(left: Expr | string, right: unknown): BooleanExpr { * * ```typescript * // Check if the 'age' field is less than 30 - * lt(field("age"), field("limit")); + * lessThan(field("age"), field("limit")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the less than comparison. */ -export function lt(left: Expr, right: Expr): BooleanExpr; +export function lessThan( + left: Expression, + right: Expression +): BooleanExpression; /** * @beta @@ -4013,14 +4019,17 @@ export function lt(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'age' field is less than 30 - * lt(field("age"), 30); + * lessThan(field("age"), 30); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(expression: Expr, value: unknown): BooleanExpr; +export function lessThan( + expression: Expression, + value: unknown +): BooleanExpression; /** * @beta @@ -4029,14 +4038,17 @@ export function lt(expression: Expr, value: unknown): BooleanExpr; * * ```typescript * // Check if the 'age' field is less than the 'limit' field - * lt("age", field("limit")); + * lessThan("age", field("limit")); * ``` * * @param fieldName The field name to compare. * @param expression The expression to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(fieldName: string, expression: Expr): BooleanExpr; +export function lessThan( + fieldName: string, + expression: Expression +): BooleanExpression; /** * @beta @@ -4045,18 +4057,21 @@ export function lt(fieldName: string, expression: Expr): BooleanExpr; * * ```typescript * // Check if the 'price' field is less than 50 - * lt("price", 50); + * lessThan("price", 50); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the less than comparison. */ -export function lt(fieldName: string, value: unknown): BooleanExpr; -export function lt(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function lessThan(fieldName: string, value: unknown): BooleanExpression; +export function lessThan( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.lt(rightExpr); + return leftExpr.lessThan(rightExpr); } /** @@ -4067,14 +4082,17 @@ export function lt(left: Expr | string, right: unknown): BooleanExpr { * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * lte(field("quantity"), field("limit")); + * lessThan(field("quantity"), field("limit")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(left: Expr, right: Expr): BooleanExpr; +export function lessThanOrEqual( + left: Expression, + right: Expression +): BooleanExpression; /** * @beta @@ -4083,28 +4101,34 @@ export function lte(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'quantity' field is less than or equal to 20 - * lte(field("quantity"), 20); + * lessThan(field("quantity"), 20); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(expression: Expr, value: unknown): BooleanExpr; +export function lessThanOrEqual( + expression: Expression, + value: unknown +): BooleanExpression; /** * Creates an expression that checks if a field's value is less than or equal to an expression. * * ```typescript * // Check if the 'quantity' field is less than or equal to the 'limit' field - * lte("quantity", field("limit")); + * lessThan("quantity", field("limit")); * ``` * * @param fieldName The field name to compare. * @param expression The expression to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(fieldName: string, expression: Expr): BooleanExpr; +export function lessThanOrEqual( + fieldName: string, + expression: Expression +): BooleanExpression; /** * @beta @@ -4113,18 +4137,24 @@ export function lte(fieldName: string, expression: Expr): BooleanExpr; * * ```typescript * // Check if the 'score' field is less than or equal to 70 - * lte("score", 70); + * lessThan("score", 70); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the less than or equal to comparison. */ -export function lte(fieldName: string, value: unknown): BooleanExpr; -export function lte(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function lessThanOrEqual( + fieldName: string, + value: unknown +): BooleanExpression; +export function lessThanOrEqual( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.lte(rightExpr); + return leftExpr.lessThanOrEqual(rightExpr); } /** @@ -4135,14 +4165,17 @@ export function lte(left: Expr | string, right: unknown): BooleanExpr { * * ```typescript * // Check if the 'age' field is greater than 18 - * gt(field("age"), Constant(9).add(9)); + * greaterThan(field("age"), Constant(9).add(9)); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the greater than comparison. */ -export function gt(left: Expr, right: Expr): BooleanExpr; +export function greaterThan( + left: Expression, + right: Expression +): BooleanExpression; /** * @beta @@ -4151,14 +4184,17 @@ export function gt(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'age' field is greater than 18 - * gt(field("age"), 18); + * greaterThan(field("age"), 18); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(expression: Expr, value: unknown): BooleanExpr; +export function greaterThan( + expression: Expression, + value: unknown +): BooleanExpression; /** * @beta @@ -4167,14 +4203,17 @@ export function gt(expression: Expr, value: unknown): BooleanExpr; * * ```typescript * // Check if the value of field 'age' is greater than the value of field 'limit' - * gt("age", field("limit")); + * greaterThan("age", field("limit")); * ``` * * @param fieldName The field name to compare. * @param expression The expression to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(fieldName: string, expression: Expr): BooleanExpr; +export function greaterThan( + fieldName: string, + expression: Expression +): BooleanExpression; /** * @beta @@ -4183,18 +4222,24 @@ export function gt(fieldName: string, expression: Expr): BooleanExpr; * * ```typescript * // Check if the 'price' field is greater than 100 - * gt("price", 100); + * greaterThan("price", 100); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the greater than comparison. */ -export function gt(fieldName: string, value: unknown): BooleanExpr; -export function gt(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function greaterThan( + fieldName: string, + value: unknown +): BooleanExpression; +export function greaterThan( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.gt(rightExpr); + return leftExpr.greaterThan(rightExpr); } /** @@ -4205,14 +4250,17 @@ export function gt(left: Expr | string, right: unknown): BooleanExpr { * * ```typescript * // Check if the 'quantity' field is greater than or equal to the field "threshold" - * gte(field("quantity"), field("threshold")); + * greaterThanOrEqual(field("quantity"), field("threshold")); * ``` * * @param left The first expression to compare. * @param right The second expression to compare. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(left: Expr, right: Expr): BooleanExpr; +export function greaterThanOrEqual( + left: Expression, + right: Expression +): BooleanExpression; /** * @beta @@ -4222,14 +4270,17 @@ export function gte(left: Expr, right: Expr): BooleanExpr; * * ```typescript * // Check if the 'quantity' field is greater than or equal to 10 - * gte(field("quantity"), 10); + * greaterThanOrEqual(field("quantity"), 10); * ``` * * @param expression The expression to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(expression: Expr, value: unknown): BooleanExpr; +export function greaterThanOrEqual( + expression: Expression, + value: unknown +): BooleanExpression; /** * @beta @@ -4238,14 +4289,17 @@ export function gte(expression: Expr, value: unknown): BooleanExpr; * * ```typescript * // Check if the value of field 'age' is greater than or equal to the value of field 'limit' - * gte("age", field("limit")); + * greaterThanOrEqual("age", field("limit")); * ``` * * @param fieldName The field name to compare. * @param value The expression to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(fieldName: string, value: Expr): BooleanExpr; +export function greaterThanOrEqual( + fieldName: string, + value: Expression +): BooleanExpression; /** * @beta @@ -4255,18 +4309,24 @@ export function gte(fieldName: string, value: Expr): BooleanExpr; * * ```typescript * // Check if the 'score' field is greater than or equal to 80 - * gte("score", 80); + * greaterThanOrEqual("score", 80); * ``` * * @param fieldName The field name to compare. * @param value The constant value to compare to. * @return A new `Expr` representing the greater than or equal to comparison. */ -export function gte(fieldName: string, value: unknown): BooleanExpr; -export function gte(left: Expr | string, right: unknown): BooleanExpr { - const leftExpr = left instanceof Expr ? left : field(left); +export function greaterThanOrEqual( + fieldName: string, + value: unknown +): BooleanExpression; +export function greaterThanOrEqual( + left: Expression | string, + right: unknown +): BooleanExpression { + const leftExpr = left instanceof Expression ? left : field(left); const rightExpr = valueToDefaultExpr(right); - return leftExpr.gte(rightExpr); + return leftExpr.greaterThanOrEqual(rightExpr); } /** @@ -4285,10 +4345,10 @@ export function gte(left: Expr | string, right: unknown): BooleanExpr { * @return A new {@code Expr} representing the concatenated array. */ export function arrayConcat( - firstArray: Expr, - secondArray: Expr | unknown[], - ...otherArrays: Array -): FunctionExpr; + firstArray: Expression, + secondArray: Expression | unknown[], + ...otherArrays: Array +): FunctionExpression; /** * @beta @@ -4307,15 +4367,15 @@ export function arrayConcat( */ export function arrayConcat( firstArrayField: string, - secondArray: Expr | unknown[], - ...otherArrays: Array -): FunctionExpr; + secondArray: Expression | unknown[], + ...otherArrays: Array +): FunctionExpression; export function arrayConcat( - firstArray: Expr | string, - secondArray: Expr | unknown[], - ...otherArrays: Array -): FunctionExpr { + firstArray: Expression | string, + secondArray: Expression | unknown[], + ...otherArrays: Array +): FunctionExpression { const exprValues = otherArrays.map(element => valueToDefaultExpr(element)); return fieldOrExpression(firstArray).arrayConcat( fieldOrExpression(secondArray), @@ -4337,7 +4397,10 @@ export function arrayConcat( * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: Expr, element: Expr): FunctionExpr; +export function arrayContains( + array: Expression, + element: Expression +): FunctionExpression; /** * @beta @@ -4353,7 +4416,10 @@ export function arrayContains(array: Expr, element: Expr): FunctionExpr; * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(array: Expr, element: unknown): FunctionExpr; +export function arrayContains( + array: Expression, + element: unknown +): FunctionExpression; /** * @beta @@ -4369,7 +4435,10 @@ export function arrayContains(array: Expr, element: unknown): FunctionExpr; * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(fieldName: string, element: Expr): FunctionExpr; +export function arrayContains( + fieldName: string, + element: Expression +): FunctionExpression; /** * @beta @@ -4385,11 +4454,14 @@ export function arrayContains(fieldName: string, element: Expr): FunctionExpr; * @param element The element to search for in the array. * @return A new {@code Expr} representing the 'array_contains' comparison. */ -export function arrayContains(fieldName: string, element: unknown): BooleanExpr; export function arrayContains( - array: Expr | string, + fieldName: string, + element: unknown +): BooleanExpression; +export function arrayContains( + array: Expression | string, element: unknown -): BooleanExpr { +): BooleanExpression { const arrayExpr = fieldOrExpression(array); const elementExpr = valueToDefaultExpr(element); return arrayExpr.arrayContains(elementExpr); @@ -4411,9 +4483,9 @@ export function arrayContains( * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ export function arrayContainsAny( - array: Expr, - values: Array -): BooleanExpr; + array: Expression, + values: Array +): BooleanExpression; /** * @beta @@ -4433,8 +4505,8 @@ export function arrayContainsAny( */ export function arrayContainsAny( fieldName: string, - values: Array -): BooleanExpr; + values: Array +): BooleanExpression; /** * @beta @@ -4451,7 +4523,10 @@ export function arrayContainsAny( * @param values An expression that evaluates to an array, whose elements to check for in the array. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; +export function arrayContainsAny( + array: Expression, + values: Expression +): BooleanExpression; /** * @beta @@ -4469,11 +4544,14 @@ export function arrayContainsAny(array: Expr, values: Expr): BooleanExpr; * @param values An expression that evaluates to an array, whose elements to check for in the array field. * @return A new {@code Expr} representing the 'array_contains_any' comparison. */ -export function arrayContainsAny(fieldName: string, values: Expr): BooleanExpr; export function arrayContainsAny( - array: Expr | string, - values: unknown[] | Expr -): BooleanExpr { + fieldName: string, + values: Expression +): BooleanExpression; +export function arrayContainsAny( + array: Expression | string, + values: unknown[] | Expression +): BooleanExpression { // @ts-ignore implementation accepts both types return fieldOrExpression(array).arrayContainsAny(values); } @@ -4493,9 +4571,9 @@ export function arrayContainsAny( * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ export function arrayContainsAll( - array: Expr, - values: Array -): BooleanExpr; + array: Expression, + values: Array +): BooleanExpression; /** * @beta @@ -4514,8 +4592,8 @@ export function arrayContainsAll( */ export function arrayContainsAll( fieldName: string, - values: Array -): BooleanExpr; + values: Array +): BooleanExpression; /** * @beta @@ -4532,9 +4610,9 @@ export function arrayContainsAll( * @return A new {@code Expr} representing the 'array_contains_all' comparison. */ export function arrayContainsAll( - array: Expr, - arrayExpression: Expr -): BooleanExpr; + array: Expression, + arrayExpression: Expression +): BooleanExpression; /** * @beta @@ -4553,12 +4631,12 @@ export function arrayContainsAll( */ export function arrayContainsAll( fieldName: string, - arrayExpression: Expr -): BooleanExpr; + arrayExpression: Expression +): BooleanExpression; export function arrayContainsAll( - array: Expr | string, - values: unknown[] | Expr -): BooleanExpr { + array: Expression | string, + values: unknown[] | Expression +): BooleanExpression { // @ts-ignore implementation accepts both types return fieldOrExpression(array).arrayContainsAll(values); } @@ -4576,7 +4654,7 @@ export function arrayContainsAll( * @param fieldName The name of the field containing an array to calculate the length of. * @return A new {@code Expr} representing the length of the array. */ -export function arrayLength(fieldName: string): FunctionExpr; +export function arrayLength(fieldName: string): FunctionExpression; /** * @beta @@ -4591,8 +4669,8 @@ export function arrayLength(fieldName: string): FunctionExpr; * @param array The array expression to calculate the length of. * @return A new {@code Expr} representing the length of the array. */ -export function arrayLength(array: Expr): FunctionExpr; -export function arrayLength(array: Expr | string): FunctionExpr { +export function arrayLength(array: Expression): FunctionExpression; +export function arrayLength(array: Expression | string): FunctionExpression { return fieldOrExpression(array).arrayLength(); } @@ -4604,17 +4682,17 @@ export function arrayLength(array: Expr | string): FunctionExpr { * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny(field("category"), [constant("Electronics"), field("primaryType")]); + * equalAny(field("category"), [constant("Electronics"), field("primaryType")]); * ``` * * @param expression The expression whose results to compare. * @param values The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny( - expression: Expr, - values: Array -): BooleanExpr; +export function equalAny( + expression: Expression, + values: Array +): BooleanExpression; /** * @beta @@ -4623,14 +4701,17 @@ export function eqAny( * * ```typescript * // Check if the 'category' field is set to a value in the disabledCategories field - * eqAny(field("category"), field('disabledCategories')); + * equalAny(field("category"), field('disabledCategories')); * ``` * * @param expression The expression whose results to compare. * @param arrayExpression An expression that evaluates to an array, whose elements to check for equality to the input. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; +export function equalAny( + expression: Expression, + arrayExpression: Expression +): BooleanExpression; /** * @beta @@ -4640,17 +4721,17 @@ export function eqAny(expression: Expr, arrayExpression: Expr): BooleanExpr; * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny("category", [constant("Electronics"), field("primaryType")]); + * equalAny("category", [constant("Electronics"), field("primaryType")]); * ``` * * @param fieldName The field to compare. * @param values The values to check against. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny( +export function equalAny( fieldName: string, - values: Array -): BooleanExpr; + values: Array +): BooleanExpression; /** * @beta @@ -4660,20 +4741,23 @@ export function eqAny( * * ```typescript * // Check if the 'category' field is either "Electronics" or value of field 'primaryType' - * eqAny("category", ["Electronics", field("primaryType")]); + * equalAny("category", ["Electronics", field("primaryType")]); * ``` * * @param fieldName The field to compare. * @param arrayExpression An expression that evaluates to an array, whose elements to check for equality to the input field. * @return A new {@code Expr} representing the 'IN' comparison. */ -export function eqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; -export function eqAny( - element: Expr | string, - values: unknown[] | Expr -): BooleanExpr { +export function equalAny( + fieldName: string, + arrayExpression: Expression +): BooleanExpression; +export function equalAny( + element: Expression | string, + values: unknown[] | Expression +): BooleanExpression { // @ts-ignore implementation accepts both types - return fieldOrExpression(element).eqAny(values); + return fieldOrExpression(element).equalAny(values); } /** @@ -4684,17 +4768,17 @@ export function eqAny( * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny(field("status"), ["pending", field("rejectedStatus")]); + * notEqualAny(field("status"), ["pending", field("rejectedStatus")]); * ``` * * @param element The expression to compare. * @param values The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny( - element: Expr, - values: Array -): BooleanExpr; +export function notEqualAny( + element: Expression, + values: Array +): BooleanExpression; /** * @beta @@ -4704,17 +4788,17 @@ export function notEqAny( * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus' - * notEqAny("status", [constant("pending"), field("rejectedStatus")]); + * notEqualAny("status", [constant("pending"), field("rejectedStatus")]); * ``` * * @param fieldName The field name to compare. * @param values The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny( +export function notEqualAny( fieldName: string, - values: Array -): BooleanExpr; + values: Array +): BooleanExpression; /** * @beta @@ -4724,14 +4808,17 @@ export function notEqAny( * * ```typescript * // Check if the 'status' field is neither "pending" nor the value of the field 'rejectedStatus' - * notEqAny(field("status"), ["pending", field("rejectedStatus")]); + * notEqualAny(field("status"), ["pending", field("rejectedStatus")]); * ``` * * @param element The expression to compare. * @param arrayExpression The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; +export function notEqualAny( + element: Expression, + arrayExpression: Expression +): BooleanExpression; /** * @beta @@ -4740,21 +4827,24 @@ export function notEqAny(element: Expr, arrayExpression: Expr): BooleanExpr; * * ```typescript * // Check if the 'status' field is not equal to any value in the field 'rejectedStatuses' - * notEqAny("status", field("rejectedStatuses")); + * notEqualAny("status", field("rejectedStatuses")); * ``` * * @param fieldName The field name to compare. * @param arrayExpression The values to check against. * @return A new {@code Expr} representing the 'NOT IN' comparison. */ -export function notEqAny(fieldName: string, arrayExpression: Expr): BooleanExpr; +export function notEqualAny( + fieldName: string, + arrayExpression: Expression +): BooleanExpression; -export function notEqAny( - element: Expr | string, - values: unknown[] | Expr -): BooleanExpr { +export function notEqualAny( + element: Expression | string, + values: unknown[] | Expression +): BooleanExpression { // @ts-ignore implementation accepts both types - return fieldOrExpression(element).notEqAny(values); + return fieldOrExpression(element).notEqualAny(values); } /** @@ -4766,9 +4856,9 @@ export function notEqAny( * // Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London", * // or 'status' is "active". * const condition = xor( - * gt("age", 18), - * eq("city", "London"), - * eq("status", "active")); + * greaterThan("age", 18), + * equal("city", "London"), + * equal("status", "active")); * ``` * * @param first The first condition. @@ -4777,11 +4867,15 @@ export function notEqAny( * @return A new {@code Expr} representing the logical 'XOR' operation. */ export function xor( - first: BooleanExpr, - second: BooleanExpr, - ...additionalConditions: BooleanExpr[] -): BooleanExpr { - return new BooleanExpr('xor', [first, second, ...additionalConditions]); + first: BooleanExpression, + second: BooleanExpression, + ...additionalConditions: BooleanExpression[] +): BooleanExpression { + return new BooleanExpression( + 'xor', + [first, second, ...additionalConditions], + 'xor' + ); } /** @@ -4792,8 +4886,8 @@ export function xor( * * ```typescript * // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor". - * cond( - * gt("age", 18), constant("Adult"), constant("Minor")); + * conditional( + * greaterThan("age", 18), constant("Adult"), constant("Minor")); * ``` * * @param condition The condition to evaluate. @@ -4801,12 +4895,16 @@ export function xor( * @param elseExpr The expression to evaluate if the condition is false. * @return A new {@code Expr} representing the conditional expression. */ -export function cond( - condition: BooleanExpr, - thenExpr: Expr, - elseExpr: Expr -): FunctionExpr { - return new FunctionExpr('cond', [condition, thenExpr, elseExpr]); +export function conditional( + condition: BooleanExpression, + thenExpr: Expression, + elseExpr: Expression +): FunctionExpression { + return new FunctionExpression( + 'conditional', + [condition, thenExpr, elseExpr], + 'conditional' + ); } /** @@ -4816,13 +4914,13 @@ export function cond( * * ```typescript * // Find documents where the 'completed' field is NOT true - * not(eq("completed", true)); + * not(equal("completed", true)); * ``` * * @param booleanExpr The filter condition to negate. * @return A new {@code Expr} representing the negated filter condition. */ -export function not(booleanExpr: BooleanExpr): BooleanExpr { +export function not(booleanExpr: BooleanExpression): BooleanExpression { return booleanExpr.not(); } @@ -4841,13 +4939,13 @@ export function not(booleanExpr: BooleanExpr): BooleanExpr { * @param first The first operand expression. * @param second The second expression or literal. * @param others Optional additional expressions or literals. - * @return A new {@code Expr} representing the logical max operation. + * @return A new {@code Expr} representing the logical maximum operation. */ export function logicalMaximum( - first: Expr, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + first: Expression, + second: Expression | unknown, + ...others: Array +): FunctionExpression; /** * @beta @@ -4864,19 +4962,19 @@ export function logicalMaximum( * @param fieldName The first operand field name. * @param second The second expression or literal. * @param others Optional additional expressions or literals. - * @return A new {@code Expr} representing the logical max operation. + * @return A new {@code Expr} representing the logical maximum operation. */ export function logicalMaximum( fieldName: string, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + second: Expression | unknown, + ...others: Array +): FunctionExpression; export function logicalMaximum( - first: Expr | string, - second: Expr | unknown, - ...others: Array -): FunctionExpr { + first: Expression | string, + second: Expression | unknown, + ...others: Array +): FunctionExpression { return fieldOrExpression(first).logicalMaximum( valueToDefaultExpr(second), ...others.map(value => valueToDefaultExpr(value)) @@ -4898,13 +4996,13 @@ export function logicalMaximum( * @param first The first operand expression. * @param second The second expression or literal. * @param others Optional additional expressions or literals. - * @return A new {@code Expr} representing the logical min operation. + * @return A new {@code Expr} representing the logical minimum operation. */ export function logicalMinimum( - first: Expr, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + first: Expression, + second: Expression | unknown, + ...others: Array +): FunctionExpression; /** * @beta @@ -4922,19 +5020,19 @@ export function logicalMinimum( * @param fieldName The first operand field name. * @param second The second expression or literal. * @param others Optional additional expressions or literals. - * @return A new {@code Expr} representing the logical min operation. + * @return A new {@code Expr} representing the logical minimum operation. */ export function logicalMinimum( fieldName: string, - second: Expr | unknown, - ...others: Array -): FunctionExpr; + second: Expression | unknown, + ...others: Array +): FunctionExpression; export function logicalMinimum( - first: Expr | string, - second: Expr | unknown, - ...others: Array -): FunctionExpr { + first: Expression | string, + second: Expression | unknown, + ...others: Array +): FunctionExpression { return fieldOrExpression(first).logicalMinimum( valueToDefaultExpr(second), ...others.map(value => valueToDefaultExpr(value)) @@ -4954,7 +5052,7 @@ export function logicalMinimum( * @param value An expression evaluates to the name of the field to check. * @return A new {@code Expr} representing the 'exists' check. */ -export function exists(value: Expr): BooleanExpr; +export function exists(value: Expression): BooleanExpression; /** * @beta @@ -4969,8 +5067,8 @@ export function exists(value: Expr): BooleanExpr; * @param fieldName The field name to check. * @return A new {@code Expr} representing the 'exists' check. */ -export function exists(fieldName: string): BooleanExpr; -export function exists(valueOrField: Expr | string): BooleanExpr { +export function exists(fieldName: string): BooleanExpression; +export function exists(valueOrField: Expression | string): BooleanExpression { return fieldOrExpression(valueOrField).exists(); } @@ -4987,7 +5085,7 @@ export function exists(valueOrField: Expr | string): BooleanExpr { * @param value The expression to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNan(value: Expr): BooleanExpr; +export function isNan(value: Expression): BooleanExpression; /** * @beta @@ -5002,8 +5100,8 @@ export function isNan(value: Expr): BooleanExpr; * @param fieldName The name of the field to check. * @return A new {@code Expr} representing the 'isNaN' check. */ -export function isNan(fieldName: string): BooleanExpr; -export function isNan(value: Expr | string): BooleanExpr { +export function isNan(fieldName: string): BooleanExpression; +export function isNan(value: Expression | string): BooleanExpression { return fieldOrExpression(value).isNan(); } @@ -5020,7 +5118,7 @@ export function isNan(value: Expr | string): BooleanExpr { * @param stringExpression An expression evaluating to a string value, which will be reversed. * @return A new {@code Expr} representing the reversed string. */ -export function reverse(stringExpression: Expr): FunctionExpr; +export function reverse(stringExpression: Expression): FunctionExpression; /** * @beta @@ -5035,191 +5133,160 @@ export function reverse(stringExpression: Expr): FunctionExpr; * @param field The name of the field representing the string to reverse. * @return A new {@code Expr} representing the reversed string. */ -export function reverse(field: string): FunctionExpr; -export function reverse(expr: Expr | string): FunctionExpr { +export function reverse(field: string): FunctionExpression; +export function reverse(expr: Expression | string): FunctionExpression { return fieldOrExpression(expr).reverse(); } /** * @beta * - * Creates an expression that replaces the first occurrence of a substring within a string with another substring. + * Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. * * ```typescript - * // Replace the first occurrence of "hello" with "hi" in the 'message' field. - * replaceFirst(field("message"), "hello", "hi"); + * // Calculate the length of the 'myString' field in bytes. + * byteLength(field("myString")); * ``` * - * @param value The expression representing the string to perform the replacement on. - * @param find The substring to search for. - * @param replace The substring to replace the first occurrence of 'find' with. - * @return A new {@code Expr} representing the string with the first occurrence replaced. + * @param expr The expression representing the string. + * @return A new {@code Expr} representing the length of the string in bytes. */ -export function replaceFirst( - value: Expr, - find: string, - replace: string -): FunctionExpr; +export function byteLength(expr: Expression): FunctionExpression; /** * @beta * - * Creates an expression that replaces the first occurrence of a substring within a string with another substring, - * where the substring to find and the replacement substring are specified by expressions. + * Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. * * ```typescript - * // Replace the first occurrence of the value in 'findField' with the value in 'replaceField' in the 'message' field. - * replaceFirst(field("message"), field("findField"), field("replaceField")); + * // Calculate the length of the 'myString' field in bytes. + * byteLength("myString"); * ``` * - * @param value The expression representing the string to perform the replacement on. - * @param find The expression representing the substring to search for. - * @param replace The expression representing the substring to replace the first occurrence of 'find' with. - * @return A new {@code Expr} representing the string with the first occurrence replaced. + * @param fieldName The name of the field containing the string. + * @return A new {@code Expr} representing the length of the string in bytes. */ -export function replaceFirst( - value: Expr, - find: Expr, - replace: Expr -): FunctionExpr; +export function byteLength(fieldName: string): FunctionExpression; +export function byteLength(expr: Expression | string): FunctionExpression { + const normalizedExpr = fieldOrExpression(expr); + return normalizedExpr.byteLength(); +} /** - * @beta - * - * Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring. + * Creates an expression that reverses an array. * * ```typescript - * // Replace the first occurrence of "hello" with "hi" in the 'message' field. - * replaceFirst("message", "hello", "hi"); + * // Reverse the value of the 'myArray' field. + * arrayReverse("myArray"); * ``` * - * @param fieldName The name of the field representing the string to perform the replacement on. - * @param find The substring to search for. - * @param replace The substring to replace the first occurrence of 'find' with. - * @return A new {@code Expr} representing the string with the first occurrence replaced. + * @param fieldName The name of the field to reverse. + * @return A new {@code Expr} representing the reversed array. */ -export function replaceFirst( - fieldName: string, - find: string, - replace: string -): FunctionExpr; -export function replaceFirst( - value: Expr | string, - find: Expr | string, - replace: Expr | string -): FunctionExpr { - const normalizedValue = fieldOrExpression(value); - const normalizedFind = valueToDefaultExpr(find); - const normalizedReplace = valueToDefaultExpr(replace); - return normalizedValue.replaceFirst(normalizedFind, normalizedReplace); -} +export function arrayReverse(fieldName: string): FunctionExpression; /** - * @beta - * - * Creates an expression that replaces all occurrences of a substring within a string with another substring. + * Creates an expression that reverses an array. * * ```typescript - * // Replace all occurrences of "hello" with "hi" in the 'message' field. - * replaceAll(field("message"), "hello", "hi"); + * // Reverse the value of the 'myArray' field. + * arrayReverse(field("myArray")); * ``` * - * @param value The expression representing the string to perform the replacement on. - * @param find The substring to search for. - * @param replace The substring to replace all occurrences of 'find' with. - * @return A new {@code Expr} representing the string with all occurrences replaced. + * @param arrayExpression An expression evaluating to an array value, which will be reversed. + * @return A new {@code Expr} representing the reversed array. */ -export function replaceAll( - value: Expr, - find: string, - replace: string -): FunctionExpr; +export function arrayReverse(arrayExpression: Expression): FunctionExpression; +export function arrayReverse(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).arrayReverse(); +} /** - * @beta - * - * Creates an expression that replaces all occurrences of a substring within a string with another substring, - * where the substring to find and the replacement substring are specified by expressions. + * Creates an expression that computes e to the power of the expression's result. * * ```typescript - * // Replace all occurrences of the value in 'findField' with the value in 'replaceField' in the 'message' field. - * replaceAll(field("message"), field("findField"), field("replaceField")); + * // Compute e to the power of 2. + * exp(constant(2)); * ``` * - * @param value The expression representing the string to perform the replacement on. - * @param find The expression representing the substring to search for. - * @param replace The expression representing the substring to replace all occurrences of 'find' with. - * @return A new {@code Expr} representing the string with all occurrences replaced. + * @return A new {@code Expr} representing the exp of the numeric value. */ -export function replaceAll( - value: Expr, - find: Expr, - replace: Expr -): FunctionExpr; +export function exp(expression: Expression): FunctionExpression; /** - * @beta - * - * Creates an expression that replaces all occurrences of a substring within a string represented by a field with another substring. + * Creates an expression that computes e to the power of the expression's result. * * ```typescript - * // Replace all occurrences of "hello" with "hi" in the 'message' field. - * replaceAll("message", "hello", "hi"); + * // Compute e to the power of the 'value' field. + * exp('value'); * ``` * - * @param fieldName The name of the field representing the string to perform the replacement on. - * @param find The substring to search for. - * @param replace The substring to replace all occurrences of 'find' with. - * @return A new {@code Expr} representing the string with all occurrences replaced. + * @return A new {@code Expr} representing the exp of the numeric value. */ -export function replaceAll( - fieldName: string, - find: string, - replace: string -): FunctionExpr; -export function replaceAll( - value: Expr | string, - find: Expr | string, - replace: Expr | string -): FunctionExpr { - const normalizedValue = fieldOrExpression(value); - const normalizedFind = valueToDefaultExpr(find); - const normalizedReplace = valueToDefaultExpr(replace); - return normalizedValue.replaceAll(normalizedFind, normalizedReplace); +export function exp(fieldName: string): FunctionExpression; + +export function exp( + expressionOrFieldName: Expression | string +): FunctionExpression { + return fieldOrExpression(expressionOrFieldName).exp(); } /** - * @beta - * - * Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. + * Creates an expression that computes the ceiling of a numeric value. * * ```typescript - * // Calculate the length of the 'myString' field in bytes. - * byteLength(field("myString")); + * // Compute the ceiling of the 'price' field. + * ceil("price"); * ``` * - * @param expr The expression representing the string. - * @return A new {@code Expr} representing the length of the string in bytes. + * @param fieldName The name of the field to compute the ceiling of. + * @return A new {@code Expr} representing the ceiling of the numeric value. */ -export function byteLength(expr: Expr): FunctionExpr; +export function ceil(fieldName: string): FunctionExpression; /** - * @beta - * - * Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. + * Creates an expression that computes the ceiling of a numeric value. * * ```typescript - * // Calculate the length of the 'myString' field in bytes. - * byteLength("myString"); + * // Compute the ceiling of the 'price' field. + * ceil(field("price")); * ``` * - * @param fieldName The name of the field containing the string. - * @return A new {@code Expr} representing the length of the string in bytes. + * @param expression An expression evaluating to a numeric value, which the ceiling will be computed for. + * @return A new {@code Expr} representing the ceiling of the numeric value. */ -export function byteLength(fieldName: string): FunctionExpr; -export function byteLength(expr: Expr | string): FunctionExpr { - const normalizedExpr = fieldOrExpression(expr); - return normalizedExpr.byteLength(); +export function ceil(expression: Expression): FunctionExpression; +export function ceil(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).ceil(); +} + +/** + * Creates an expression that computes the floor of a numeric value. + * + * @param expr The expression to compute the floor of. + * @return A new {@code Expr} representing the floor of the numeric value. + */ +export function floor(expr: Expression): FunctionExpression; + +/** + * Creates an expression that computes the floor of a numeric value. + * + * @param fieldName The name of the field to compute the floor of. + * @return A new {@code Expr} representing the floor of the numeric value. + */ +export function floor(fieldName: string): FunctionExpression; +export function floor(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).floor(); +} + +/** + * Creates an aggregation that counts the number of distinct values of a field. + * + * @param expr The expression or field to count distinct values of. + * @return A new `AggregateFunction` representing the 'count_distinct' aggregation. + */ +export function countDistinct(expr: Expression | string): AggregateFunction { + return fieldOrExpression(expr).countDistinct(); } /** @@ -5235,7 +5302,7 @@ export function byteLength(expr: Expr | string): FunctionExpr { * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the length of the string. */ -export function charLength(fieldName: string): FunctionExpr; +export function charLength(fieldName: string): FunctionExpression; /** * @beta @@ -5250,8 +5317,8 @@ export function charLength(fieldName: string): FunctionExpr; * @param stringExpression The expression representing the string to calculate the length of. * @return A new {@code Expr} representing the length of the string. */ -export function charLength(stringExpression: Expr): FunctionExpr; -export function charLength(value: Expr | string): FunctionExpr { +export function charLength(stringExpression: Expression): FunctionExpression; +export function charLength(value: Expression | string): FunctionExpression { const valueExpr = fieldOrExpression(value); return valueExpr.charLength(); } @@ -5271,7 +5338,7 @@ export function charLength(value: Expr | string): FunctionExpr { * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(fieldName: string, pattern: string): BooleanExpr; +export function like(fieldName: string, pattern: string): BooleanExpression; /** * @beta @@ -5288,7 +5355,7 @@ export function like(fieldName: string, pattern: string): BooleanExpr; * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(fieldName: string, pattern: Expr): BooleanExpr; +export function like(fieldName: string, pattern: Expression): BooleanExpression; /** * @beta @@ -5304,7 +5371,10 @@ export function like(fieldName: string, pattern: Expr): BooleanExpr; * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(stringExpression: Expr, pattern: string): BooleanExpr; +export function like( + stringExpression: Expression, + pattern: string +): BooleanExpression; /** * @beta @@ -5320,11 +5390,14 @@ export function like(stringExpression: Expr, pattern: string): BooleanExpr; * @param pattern The pattern to search for. You can use "%" as a wildcard character. * @return A new {@code Expr} representing the 'like' comparison. */ -export function like(stringExpression: Expr, pattern: Expr): BooleanExpr; export function like( - left: Expr | string, - pattern: Expr | string -): FunctionExpr { + stringExpression: Expression, + pattern: Expression +): BooleanExpression; +export function like( + left: Expression | string, + pattern: Expression | string +): BooleanExpression { const leftExpr = fieldOrExpression(left); const patternExpr = valueToDefaultExpr(pattern); return leftExpr.like(patternExpr); @@ -5345,7 +5418,10 @@ export function like( * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(fieldName: string, pattern: string): BooleanExpr; +export function regexContains( + fieldName: string, + pattern: string +): BooleanExpression; /** * @beta @@ -5362,7 +5438,10 @@ export function regexContains(fieldName: string, pattern: string): BooleanExpr; * @param pattern The regular expression to use for the search. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; +export function regexContains( + fieldName: string, + pattern: Expression +): BooleanExpression; /** * @beta @@ -5380,9 +5459,9 @@ export function regexContains(fieldName: string, pattern: Expr): BooleanExpr; * @return A new {@code Expr} representing the 'contains' comparison. */ export function regexContains( - stringExpression: Expr, + stringExpression: Expression, pattern: string -): BooleanExpr; +): BooleanExpression; /** * @beta @@ -5400,13 +5479,13 @@ export function regexContains( * @return A new {@code Expr} representing the 'contains' comparison. */ export function regexContains( - stringExpression: Expr, - pattern: Expr -): BooleanExpr; + stringExpression: Expression, + pattern: Expression +): BooleanExpression; export function regexContains( - left: Expr | string, - pattern: Expr | string -): BooleanExpr { + left: Expression | string, + pattern: Expression | string +): BooleanExpression { const leftExpr = fieldOrExpression(left); const patternExpr = valueToDefaultExpr(pattern); return leftExpr.regexContains(patternExpr); @@ -5426,7 +5505,10 @@ export function regexContains( * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(fieldName: string, pattern: string): BooleanExpr; +export function regexMatch( + fieldName: string, + pattern: string +): BooleanExpression; /** * @beta @@ -5442,7 +5524,10 @@ export function regexMatch(fieldName: string, pattern: string): BooleanExpr; * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; +export function regexMatch( + fieldName: string, + pattern: Expression +): BooleanExpression; /** * @beta @@ -5460,9 +5545,9 @@ export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr; * @return A new {@code Expr} representing the regular expression match. */ export function regexMatch( - stringExpression: Expr, + stringExpression: Expression, pattern: string -): BooleanExpr; +): BooleanExpression; /** * @beta @@ -5479,11 +5564,14 @@ export function regexMatch( * @param pattern The regular expression to use for the match. * @return A new {@code Expr} representing the regular expression match. */ -export function regexMatch(stringExpression: Expr, pattern: Expr): BooleanExpr; export function regexMatch( - left: Expr | string, - pattern: Expr | string -): BooleanExpr { + stringExpression: Expression, + pattern: Expression +): BooleanExpression; +export function regexMatch( + left: Expression | string, + pattern: Expression | string +): BooleanExpression { const leftExpr = fieldOrExpression(left); const patternExpr = valueToDefaultExpr(pattern); return leftExpr.regexMatch(patternExpr); @@ -5496,14 +5584,17 @@ export function regexMatch( * * ```typescript * // Check if the 'description' field contains "example". - * strContains("description", "example"); + * stringContains("description", "example"); * ``` * * @param fieldName The name of the field containing the string. * @param substring The substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(fieldName: string, substring: string): BooleanExpr; +export function stringContains( + fieldName: string, + substring: string +): BooleanExpression; /** * @beta @@ -5512,14 +5603,17 @@ export function strContains(fieldName: string, substring: string): BooleanExpr; * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * strContains("description", field("keyword")); + * stringContains("description", field("keyword")); * ``` * * @param fieldName The name of the field containing the string. * @param substring The expression representing the substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains(fieldName: string, substring: Expr): BooleanExpr; +export function stringContains( + fieldName: string, + substring: Expression +): BooleanExpression; /** * @beta @@ -5528,17 +5622,17 @@ export function strContains(fieldName: string, substring: Expr): BooleanExpr; * * ```typescript * // Check if the 'description' field contains "example". - * strContains(field("description"), "example"); + * stringContains(field("description"), "example"); * ``` * * @param stringExpression The expression representing the string to perform the comparison on. * @param substring The substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains( - stringExpression: Expr, +export function stringContains( + stringExpression: Expression, substring: string -): BooleanExpr; +): BooleanExpression; /** * @beta @@ -5547,24 +5641,24 @@ export function strContains( * * ```typescript * // Check if the 'description' field contains the value of the 'keyword' field. - * strContains(field("description"), field("keyword")); + * stringContains(field("description"), field("keyword")); * ``` * * @param stringExpression The expression representing the string to perform the comparison on. * @param substring The expression representing the substring to search for. * @return A new {@code Expr} representing the 'contains' comparison. */ -export function strContains( - stringExpression: Expr, - substring: Expr -): BooleanExpr; -export function strContains( - left: Expr | string, - substring: Expr | string -): BooleanExpr { +export function stringContains( + stringExpression: Expression, + substring: Expression +): BooleanExpression; +export function stringContains( + left: Expression | string, + substring: Expression | string +): BooleanExpression { const leftExpr = fieldOrExpression(left); const substringExpr = valueToDefaultExpr(substring); - return leftExpr.strContains(substringExpr); + return leftExpr.stringContains(substringExpr); } /** @@ -5581,7 +5675,10 @@ export function strContains( * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(fieldName: string, prefix: string): BooleanExpr; +export function startsWith( + fieldName: string, + prefix: string +): BooleanExpression; /** * @beta @@ -5597,7 +5694,10 @@ export function startsWith(fieldName: string, prefix: string): BooleanExpr; * @param prefix The expression representing the prefix. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; +export function startsWith( + fieldName: string, + prefix: Expression +): BooleanExpression; /** * @beta @@ -5613,7 +5713,10 @@ export function startsWith(fieldName: string, prefix: Expr): BooleanExpr; * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; +export function startsWith( + stringExpression: Expression, + prefix: string +): BooleanExpression; /** * @beta @@ -5629,11 +5732,14 @@ export function startsWith(stringExpression: Expr, prefix: string): BooleanExpr; * @param prefix The prefix to check for. * @return A new {@code Expr} representing the 'starts with' comparison. */ -export function startsWith(stringExpression: Expr, prefix: Expr): BooleanExpr; export function startsWith( - expr: Expr | string, - prefix: Expr | string -): BooleanExpr { + stringExpression: Expression, + prefix: Expression +): BooleanExpression; +export function startsWith( + expr: Expression | string, + prefix: Expression | string +): BooleanExpression { return fieldOrExpression(expr).startsWith(valueToDefaultExpr(prefix)); } @@ -5651,7 +5757,7 @@ export function startsWith( * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(fieldName: string, suffix: string): BooleanExpr; +export function endsWith(fieldName: string, suffix: string): BooleanExpression; /** * @beta @@ -5667,7 +5773,10 @@ export function endsWith(fieldName: string, suffix: string): BooleanExpr; * @param suffix The expression representing the postfix. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; +export function endsWith( + fieldName: string, + suffix: Expression +): BooleanExpression; /** * @beta @@ -5683,7 +5792,10 @@ export function endsWith(fieldName: string, suffix: Expr): BooleanExpr; * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; +export function endsWith( + stringExpression: Expression, + suffix: string +): BooleanExpression; /** * @beta @@ -5699,11 +5811,14 @@ export function endsWith(stringExpression: Expr, suffix: string): BooleanExpr; * @param suffix The postfix to check for. * @return A new {@code Expr} representing the 'ends with' comparison. */ -export function endsWith(stringExpression: Expr, suffix: Expr): BooleanExpr; export function endsWith( - expr: Expr | string, - suffix: Expr | string -): BooleanExpr { + stringExpression: Expression, + suffix: Expression +): BooleanExpression; +export function endsWith( + expr: Expression | string, + suffix: Expression | string +): BooleanExpression { return fieldOrExpression(expr).endsWith(valueToDefaultExpr(suffix)); } @@ -5720,7 +5835,7 @@ export function endsWith( * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the lowercase string. */ -export function toLower(fieldName: string): FunctionExpr; +export function toLower(fieldName: string): FunctionExpression; /** * @beta @@ -5735,8 +5850,8 @@ export function toLower(fieldName: string): FunctionExpr; * @param stringExpression The expression representing the string to convert to lowercase. * @return A new {@code Expr} representing the lowercase string. */ -export function toLower(stringExpression: Expr): FunctionExpr; -export function toLower(expr: Expr | string): FunctionExpr { +export function toLower(stringExpression: Expression): FunctionExpression; +export function toLower(expr: Expression | string): FunctionExpression { return fieldOrExpression(expr).toLower(); } @@ -5753,7 +5868,7 @@ export function toLower(expr: Expr | string): FunctionExpr { * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the uppercase string. */ -export function toUpper(fieldName: string): FunctionExpr; +export function toUpper(fieldName: string): FunctionExpression; /** * @beta @@ -5768,8 +5883,8 @@ export function toUpper(fieldName: string): FunctionExpr; * @param stringExpression The expression representing the string to convert to uppercase. * @return A new {@code Expr} representing the uppercase string. */ -export function toUpper(stringExpression: Expr): FunctionExpr; -export function toUpper(expr: Expr | string): FunctionExpr { +export function toUpper(stringExpression: Expression): FunctionExpression; +export function toUpper(expr: Expression | string): FunctionExpression { return fieldOrExpression(expr).toUpper(); } @@ -5786,7 +5901,7 @@ export function toUpper(expr: Expr | string): FunctionExpr { * @param fieldName The name of the field containing the string. * @return A new {@code Expr} representing the trimmed string. */ -export function trim(fieldName: string): FunctionExpr; +export function trim(fieldName: string): FunctionExpression; /** * @beta @@ -5801,8 +5916,8 @@ export function trim(fieldName: string): FunctionExpr; * @param stringExpression The expression representing the string to trim. * @return A new {@code Expr} representing the trimmed string. */ -export function trim(stringExpression: Expr): FunctionExpr; -export function trim(expr: Expr | string): FunctionExpr { +export function trim(stringExpression: Expression): FunctionExpression; +export function trim(expr: Expression | string): FunctionExpression { return fieldOrExpression(expr).trim(); } @@ -5813,7 +5928,7 @@ export function trim(expr: Expr | string): FunctionExpr { * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * strConcat("firstName", " ", field("lastName")); + * stringConcat("firstName", " ", field("lastName")); * ``` * * @param fieldName The field name containing the initial string value. @@ -5821,11 +5936,11 @@ export function trim(expr: Expr | string): FunctionExpr { * @param otherStrings Optional additional expressions or literals (typically strings) to concatenate. * @return A new {@code Expr} representing the concatenated string. */ -export function strConcat( +export function stringConcat( fieldName: string, - secondString: Expr | string, - ...otherStrings: Array -): FunctionExpr; + secondString: Expression | string, + ...otherStrings: Array +): FunctionExpression; /** * @beta @@ -5833,7 +5948,7 @@ export function strConcat( * * ```typescript * // Combine the 'firstName', " ", and 'lastName' fields into a single string - * strConcat(field("firstName"), " ", field("lastName")); + * stringConcat(field("firstName"), " ", field("lastName")); * ``` * * @param firstString The initial string expression to concatenate to. @@ -5841,17 +5956,17 @@ export function strConcat( * @param otherStrings Optional additional expressions or literals (typically strings) to concatenate. * @return A new {@code Expr} representing the concatenated string. */ -export function strConcat( - firstString: Expr, - secondString: Expr | string, - ...otherStrings: Array -): FunctionExpr; -export function strConcat( - first: string | Expr, - second: string | Expr, - ...elements: Array -): FunctionExpr { - return fieldOrExpression(first).strConcat( +export function stringConcat( + firstString: Expression, + secondString: Expression | string, + ...otherStrings: Array +): FunctionExpression; +export function stringConcat( + first: string | Expression, + second: string | Expression, + ...elements: Array +): FunctionExpression { + return fieldOrExpression(first).stringConcat( valueToDefaultExpr(second), ...elements.map(valueToDefaultExpr) ); @@ -5871,7 +5986,7 @@ export function strConcat( * @param subField The key to access in the map. * @return A new {@code Expr} representing the value associated with the given key in the map. */ -export function mapGet(fieldName: string, subField: string): FunctionExpr; +export function mapGet(fieldName: string, subField: string): FunctionExpression; /** * @beta @@ -5887,11 +6002,14 @@ export function mapGet(fieldName: string, subField: string): FunctionExpr; * @param subField The key to access in the map. * @return A new {@code Expr} representing the value associated with the given key in the map. */ -export function mapGet(mapExpression: Expr, subField: string): FunctionExpr; export function mapGet( - fieldOrExpr: string | Expr, + mapExpression: Expression, + subField: string +): FunctionExpression; +export function mapGet( + fieldOrExpr: string | Expression, subField: string -): FunctionExpr { +): FunctionExpression { return fieldOrExpression(fieldOrExpr).mapGet(subField); } @@ -5908,7 +6026,7 @@ export function mapGet( * @return A new {@code AggregateFunction} representing the 'countAll' aggregation. */ export function countAll(): AggregateFunction { - return new AggregateFunction('count', []); + return new AggregateFunction('count', [], 'count'); } /** @@ -5919,13 +6037,13 @@ export function countAll(): AggregateFunction { * * ```typescript * // Count the number of items where the price is greater than 10 - * count(field("price").gt(10)).as("expensiveItemCount"); + * count(field("price").greaterThan(10)).as("expensiveItemCount"); * ``` * * @param expression The expression to count. * @return A new {@code AggregateFunction} representing the 'count' aggregation. */ -export function count(expression: Expr): AggregateFunction; +export function count(expression: Expression): AggregateFunction; /** * Creates an aggregation that counts the number of stage inputs where the input field exists. @@ -5939,7 +6057,7 @@ export function count(expression: Expr): AggregateFunction; * @return A new {@code AggregateFunction} representing the 'count' aggregation. */ export function count(fieldName: string): AggregateFunction; -export function count(value: Expr | string): AggregateFunction { +export function count(value: Expression | string): AggregateFunction { return fieldOrExpression(value).count(); } @@ -5957,7 +6075,7 @@ export function count(value: Expr | string): AggregateFunction { * @param expression The expression to sum up. * @return A new {@code AggregateFunction} representing the 'sum' aggregation. */ -export function sum(expression: Expr): AggregateFunction; +export function sum(expression: Expression): AggregateFunction; /** * @beta @@ -5974,7 +6092,7 @@ export function sum(expression: Expr): AggregateFunction; * @return A new {@code AggregateFunction} representing the 'sum' aggregation. */ export function sum(fieldName: string): AggregateFunction; -export function sum(value: Expr | string): AggregateFunction { +export function sum(value: Expression | string): AggregateFunction { return fieldOrExpression(value).sum(); } @@ -5986,13 +6104,13 @@ export function sum(value: Expr | string): AggregateFunction { * * ```typescript * // Calculate the average age of users - * avg(field("age")).as("averageAge"); + * average(field("age")).as("averageAge"); * ``` * * @param expression The expression representing the values to average. - * @return A new {@code AggregateFunction} representing the 'avg' aggregation. + * @return A new {@code AggregateFunction} representing the 'average' aggregation. */ -export function avg(expression: Expr): AggregateFunction; +export function average(expression: Expression): AggregateFunction; /** * @beta @@ -6002,15 +6120,15 @@ export function avg(expression: Expr): AggregateFunction; * * ```typescript * // Calculate the average age of users - * avg("age").as("averageAge"); + * average("age").as("averageAge"); * ``` * * @param fieldName The name of the field containing numeric values to average. - * @return A new {@code AggregateFunction} representing the 'avg' aggregation. + * @return A new {@code AggregateFunction} representing the 'average' aggregation. */ -export function avg(fieldName: string): AggregateFunction; -export function avg(value: Expr | string): AggregateFunction { - return fieldOrExpression(value).avg(); +export function average(fieldName: string): AggregateFunction; +export function average(value: Expression | string): AggregateFunction { + return fieldOrExpression(value).average(); } /** @@ -6025,9 +6143,9 @@ export function avg(value: Expr | string): AggregateFunction { * ``` * * @param expression The expression to find the minimum value of. - * @return A new {@code AggregateFunction} representing the 'min' aggregation. + * @return A new {@code AggregateFunction} representing the 'minimum' aggregation. */ -export function minimum(expression: Expr): AggregateFunction; +export function minimum(expression: Expression): AggregateFunction; /** * @beta @@ -6040,10 +6158,10 @@ export function minimum(expression: Expr): AggregateFunction; * ``` * * @param fieldName The name of the field to find the minimum value of. - * @return A new {@code AggregateFunction} representing the 'min' aggregation. + * @return A new {@code AggregateFunction} representing the 'minimum' aggregation. */ export function minimum(fieldName: string): AggregateFunction; -export function minimum(value: Expr | string): AggregateFunction { +export function minimum(value: Expression | string): AggregateFunction { return fieldOrExpression(value).minimum(); } @@ -6059,9 +6177,9 @@ export function minimum(value: Expr | string): AggregateFunction { * ``` * * @param expression The expression to find the maximum value of. - * @return A new {@code AggregateFunction} representing the 'max' aggregation. + * @return A new {@code AggregateFunction} representing the 'maximum' aggregation. */ -export function maximum(expression: Expr): AggregateFunction; +export function maximum(expression: Expression): AggregateFunction; /** * @beta @@ -6074,10 +6192,10 @@ export function maximum(expression: Expr): AggregateFunction; * ``` * * @param fieldName The name of the field to find the maximum value of. - * @return A new {@code AggregateFunction} representing the 'max' aggregation. + * @return A new {@code AggregateFunction} representing the 'maximum' aggregation. */ export function maximum(fieldName: string): AggregateFunction; -export function maximum(value: Expr | string): AggregateFunction { +export function maximum(value: Expression | string): AggregateFunction { return fieldOrExpression(value).maximum(); } @@ -6098,7 +6216,7 @@ export function maximum(value: Expr | string): AggregateFunction { export function cosineDistance( fieldName: string, vector: number[] | VectorValue -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6116,8 +6234,8 @@ export function cosineDistance( */ export function cosineDistance( fieldName: string, - vectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression +): FunctionExpression; /** * @beta @@ -6134,9 +6252,9 @@ export function cosineDistance( * @return A new {@code Expr} representing the cosine distance between the two vectors. */ export function cosineDistance( - vectorExpression: Expr, - vector: number[] | Expr -): FunctionExpr; + vectorExpression: Expression, + vector: number[] | VectorValue +): FunctionExpression; /** * @beta @@ -6153,13 +6271,13 @@ export function cosineDistance( * @return A new {@code Expr} representing the cosine distance between the two vectors. */ export function cosineDistance( - vectorExpression: Expr, - otherVectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression, + otherVectorExpression: Expression +): FunctionExpression; export function cosineDistance( - expr: Expr | string, - other: Expr | number[] | VectorValue -): FunctionExpr { + expr: Expression | string, + other: Expression | number[] | VectorValue +): FunctionExpression { const expr1 = fieldOrExpression(expr); const expr2 = vectorToExpr(other); return expr1.cosineDistance(expr2); @@ -6182,7 +6300,7 @@ export function cosineDistance( export function dotProduct( fieldName: string, vector: number[] | VectorValue -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6200,8 +6318,8 @@ export function dotProduct( */ export function dotProduct( fieldName: string, - vectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression +): FunctionExpression; /** * @beta @@ -6218,9 +6336,9 @@ export function dotProduct( * @return A new {@code Expr} representing the dot product between the two vectors. */ export function dotProduct( - vectorExpression: Expr, + vectorExpression: Expression, vector: number[] | VectorValue -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6237,13 +6355,13 @@ export function dotProduct( * @return A new {@code Expr} representing the dot product between the two vectors. */ export function dotProduct( - vectorExpression: Expr, - otherVectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression, + otherVectorExpression: Expression +): FunctionExpression; export function dotProduct( - expr: Expr | string, - other: Expr | number[] | VectorValue -): FunctionExpr { + expr: Expression | string, + other: Expression | number[] | VectorValue +): FunctionExpression { const expr1 = fieldOrExpression(expr); const expr2 = vectorToExpr(other); return expr1.dotProduct(expr2); @@ -6266,7 +6384,7 @@ export function dotProduct( export function euclideanDistance( fieldName: string, vector: number[] | VectorValue -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6284,8 +6402,8 @@ export function euclideanDistance( */ export function euclideanDistance( fieldName: string, - vectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression +): FunctionExpression; /** * @beta @@ -6303,9 +6421,9 @@ export function euclideanDistance( * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ export function euclideanDistance( - vectorExpression: Expr, + vectorExpression: Expression, vector: number[] | VectorValue -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6322,13 +6440,13 @@ export function euclideanDistance( * @return A new {@code Expr} representing the Euclidean distance between the two vectors. */ export function euclideanDistance( - vectorExpression: Expr, - otherVectorExpression: Expr -): FunctionExpr; + vectorExpression: Expression, + otherVectorExpression: Expression +): FunctionExpression; export function euclideanDistance( - expr: Expr | string, - other: Expr | number[] | VectorValue -): FunctionExpr { + expr: Expression | string, + other: Expression | number[] | VectorValue +): FunctionExpression { const expr1 = fieldOrExpression(expr); const expr2 = vectorToExpr(other); return expr1.euclideanDistance(expr2); @@ -6347,7 +6465,7 @@ export function euclideanDistance( * @param vectorExpression The expression representing the Firestore Vector. * @return A new {@code Expr} representing the length of the array. */ -export function vectorLength(vectorExpression: Expr): FunctionExpr; +export function vectorLength(vectorExpression: Expression): FunctionExpression; /** * @beta @@ -6362,8 +6480,8 @@ export function vectorLength(vectorExpression: Expr): FunctionExpr; * @param fieldName The name of the field representing the Firestore Vector. * @return A new {@code Expr} representing the length of the array. */ -export function vectorLength(fieldName: string): FunctionExpr; -export function vectorLength(expr: Expr | string): FunctionExpr { +export function vectorLength(fieldName: string): FunctionExpression; +export function vectorLength(expr: Expression | string): FunctionExpression { return fieldOrExpression(expr).vectorLength(); } @@ -6381,7 +6499,7 @@ export function vectorLength(expr: Expr | string): FunctionExpr { * @param expr The expression representing the number of microseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; +export function unixMicrosToTimestamp(expr: Expression): FunctionExpression; /** * @beta @@ -6397,8 +6515,10 @@ export function unixMicrosToTimestamp(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the number of microseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMicrosToTimestamp(fieldName: string): FunctionExpr; -export function unixMicrosToTimestamp(expr: Expr | string): FunctionExpr { +export function unixMicrosToTimestamp(fieldName: string): FunctionExpression; +export function unixMicrosToTimestamp( + expr: Expression | string +): FunctionExpression { return fieldOrExpression(expr).unixMicrosToTimestamp(); } @@ -6415,7 +6535,7 @@ export function unixMicrosToTimestamp(expr: Expr | string): FunctionExpr { * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of microseconds since epoch. */ -export function timestampToUnixMicros(expr: Expr): FunctionExpr; +export function timestampToUnixMicros(expr: Expression): FunctionExpression; /** * @beta @@ -6430,8 +6550,10 @@ export function timestampToUnixMicros(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of microseconds since epoch. */ -export function timestampToUnixMicros(fieldName: string): FunctionExpr; -export function timestampToUnixMicros(expr: Expr | string): FunctionExpr { +export function timestampToUnixMicros(fieldName: string): FunctionExpression; +export function timestampToUnixMicros( + expr: Expression | string +): FunctionExpression { return fieldOrExpression(expr).timestampToUnixMicros(); } @@ -6449,7 +6571,7 @@ export function timestampToUnixMicros(expr: Expr | string): FunctionExpr { * @param expr The expression representing the number of milliseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMillisToTimestamp(expr: Expr): FunctionExpr; +export function unixMillisToTimestamp(expr: Expression): FunctionExpression; /** * @beta @@ -6465,8 +6587,10 @@ export function unixMillisToTimestamp(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the number of milliseconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixMillisToTimestamp(fieldName: string): FunctionExpr; -export function unixMillisToTimestamp(expr: Expr | string): FunctionExpr { +export function unixMillisToTimestamp(fieldName: string): FunctionExpression; +export function unixMillisToTimestamp( + expr: Expression | string +): FunctionExpression { const normalizedExpr = fieldOrExpression(expr); return normalizedExpr.unixMillisToTimestamp(); } @@ -6484,7 +6608,7 @@ export function unixMillisToTimestamp(expr: Expr | string): FunctionExpr { * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of milliseconds since epoch. */ -export function timestampToUnixMillis(expr: Expr): FunctionExpr; +export function timestampToUnixMillis(expr: Expression): FunctionExpression; /** * @beta @@ -6499,8 +6623,10 @@ export function timestampToUnixMillis(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of milliseconds since epoch. */ -export function timestampToUnixMillis(fieldName: string): FunctionExpr; -export function timestampToUnixMillis(expr: Expr | string): FunctionExpr { +export function timestampToUnixMillis(fieldName: string): FunctionExpression; +export function timestampToUnixMillis( + expr: Expression | string +): FunctionExpression { const normalizedExpr = fieldOrExpression(expr); return normalizedExpr.timestampToUnixMillis(); } @@ -6519,7 +6645,7 @@ export function timestampToUnixMillis(expr: Expr | string): FunctionExpr { * @param expr The expression representing the number of seconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; +export function unixSecondsToTimestamp(expr: Expression): FunctionExpression; /** * @beta @@ -6535,8 +6661,10 @@ export function unixSecondsToTimestamp(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the number of seconds since epoch. * @return A new {@code Expr} representing the timestamp. */ -export function unixSecondsToTimestamp(fieldName: string): FunctionExpr; -export function unixSecondsToTimestamp(expr: Expr | string): FunctionExpr { +export function unixSecondsToTimestamp(fieldName: string): FunctionExpression; +export function unixSecondsToTimestamp( + expr: Expression | string +): FunctionExpression { const normalizedExpr = fieldOrExpression(expr); return normalizedExpr.unixSecondsToTimestamp(); } @@ -6554,7 +6682,7 @@ export function unixSecondsToTimestamp(expr: Expr | string): FunctionExpr { * @param expr The expression representing the timestamp. * @return A new {@code Expr} representing the number of seconds since epoch. */ -export function timestampToUnixSeconds(expr: Expr): FunctionExpr; +export function timestampToUnixSeconds(expr: Expression): FunctionExpression; /** * @beta @@ -6569,8 +6697,10 @@ export function timestampToUnixSeconds(expr: Expr): FunctionExpr; * @param fieldName The name of the field representing the timestamp. * @return A new {@code Expr} representing the number of seconds since epoch. */ -export function timestampToUnixSeconds(fieldName: string): FunctionExpr; -export function timestampToUnixSeconds(expr: Expr | string): FunctionExpr { +export function timestampToUnixSeconds(fieldName: string): FunctionExpression; +export function timestampToUnixSeconds( + expr: Expression | string +): FunctionExpression { const normalizedExpr = fieldOrExpression(expr); return normalizedExpr.timestampToUnixSeconds(); } @@ -6591,10 +6721,10 @@ export function timestampToUnixSeconds(expr: Expr | string): FunctionExpr { * @return A new {@code Expr} representing the resulting timestamp. */ export function timestampAdd( - timestamp: Expr, - unit: Expr, - amount: Expr -): FunctionExpr; + timestamp: Expression, + unit: Expression, + amount: Expression +): FunctionExpression; /** * @beta @@ -6612,10 +6742,10 @@ export function timestampAdd( * @return A new {@code Expr} representing the resulting timestamp. */ export function timestampAdd( - timestamp: Expr, + timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6636,19 +6766,19 @@ export function timestampAdd( fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): FunctionExpr; +): FunctionExpression; export function timestampAdd( - timestamp: Expr | string, + timestamp: Expression | string, unit: - | Expr + | Expression | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', - amount: Expr | number -): FunctionExpr { + amount: Expression | number +): FunctionExpression { const normalizedTimestamp = fieldOrExpression(timestamp); const normalizedUnit = valueToDefaultExpr(unit); const normalizedAmount = valueToDefaultExpr(amount); @@ -6662,7 +6792,7 @@ export function timestampAdd( * * ```typescript * // Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field. - * timestampSub(field("timestamp"), field("unit"), field("amount")); + * timestampSubtract(field("timestamp"), field("unit"), field("amount")); * ``` * * @param timestamp The expression representing the timestamp. @@ -6670,11 +6800,11 @@ export function timestampAdd( * @param amount The expression evaluates to amount of the unit. * @return A new {@code Expr} representing the resulting timestamp. */ -export function timestampSub( - timestamp: Expr, - unit: Expr, - amount: Expr -): FunctionExpr; +export function timestampSubtract( + timestamp: Expression, + unit: Expression, + amount: Expression +): FunctionExpression; /** * @beta @@ -6683,7 +6813,7 @@ export function timestampSub( * * ```typescript * // Subtract 1 day from the 'timestamp' field. - * timestampSub(field("timestamp"), "day", 1); + * timestampSubtract(field("timestamp"), "day", 1); * ``` * * @param timestamp The expression representing the timestamp. @@ -6691,11 +6821,11 @@ export function timestampSub( * @param amount The amount of time to subtract. * @return A new {@code Expr} representing the resulting timestamp. */ -export function timestampSub( - timestamp: Expr, +export function timestampSubtract( + timestamp: Expression, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): FunctionExpr; +): FunctionExpression; /** * @beta @@ -6704,7 +6834,7 @@ export function timestampSub( * * ```typescript * // Subtract 1 day from the 'timestamp' field. - * timestampSub("timestamp", "day", 1); + * timestampSubtract("timestamp", "day", 1); * ``` * * @param fieldName The name of the field representing the timestamp. @@ -6712,27 +6842,65 @@ export function timestampSub( * @param amount The amount of time to subtract. * @return A new {@code Expr} representing the resulting timestamp. */ -export function timestampSub( +export function timestampSubtract( fieldName: string, unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', amount: number -): FunctionExpr; -export function timestampSub( - timestamp: Expr | string, +): FunctionExpression; +export function timestampSubtract( + timestamp: Expression | string, unit: - | Expr + | Expression | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day', - amount: Expr | number -): FunctionExpr { + amount: Expression | number +): FunctionExpression { const normalizedTimestamp = fieldOrExpression(timestamp); const normalizedUnit = valueToDefaultExpr(unit); const normalizedAmount = valueToDefaultExpr(amount); - return normalizedTimestamp.timestampSub(normalizedUnit, normalizedAmount); + return normalizedTimestamp.timestampSubtract( + normalizedUnit, + normalizedAmount + ); +} + +/** + * @beta + * + * Creates an expression that evaluates to the current server timestamp. + * + * ```typescript + * // Get the current server timestamp + * currentTimestamp() + * ``` + * + * @return A new Expression representing the current server timestamp. + */ +export function currentTimestamp(): FunctionExpression { + return new FunctionExpression('current_timestamp', [], 'currentTimestamp'); +} + +/** + * Creates an expression that raises an error with the given message. This could be useful for + * debugging purposes. + * + * ```typescript + * // Raise an error with the message "simulating an evaluation error". + * error("simulating an evaluation error") + * ``` + * + * @return A new Expression representing the error() operation. + */ +export function error(message: string): Expression { + return new FunctionExpression( + 'error', + [constant(message)], + 'currentTimestamp' + ); } /** @@ -6743,7 +6911,7 @@ export function timestampSub( * ```typescript * // Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND * // the 'status' field is "active" - * const condition = and(gt("age", 18), eq("city", "London"), eq("status", "active")); + * const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active")); * ``` * * @param first The first filter condition. @@ -6752,11 +6920,11 @@ export function timestampSub( * @return A new {@code Expr} representing the logical 'AND' operation. */ export function and( - first: BooleanExpr, - second: BooleanExpr, - ...more: BooleanExpr[] -): BooleanExpr { - return new BooleanExpr('and', [first, second, ...more]); + first: BooleanExpression, + second: BooleanExpression, + ...more: BooleanExpression[] +): BooleanExpression { + return new BooleanExpression('and', [first, second, ...more], 'and'); } /** @@ -6767,7 +6935,7 @@ export function and( * ```typescript * // Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR * // the 'status' field is "active" - * const condition = or(gt("age", 18), eq("city", "London"), eq("status", "active")); + * const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active")); * ``` * * @param first The first filter condition. @@ -6776,13 +6944,638 @@ export function and( * @return A new {@code Expr} representing the logical 'OR' operation. */ export function or( - first: BooleanExpr, - second: BooleanExpr, - ...more: BooleanExpr[] -): BooleanExpr { - return new BooleanExpr('or', [first, second, ...more]); + first: BooleanExpression, + second: BooleanExpression, + ...more: BooleanExpression[] +): BooleanExpression { + return new BooleanExpression('or', [first, second, ...more], 'xor'); +} + +/** + * Creates an expression that returns the value of the base expression raised to the power of the exponent expression. + * + * ```typescript + * // Raise the value of the 'base' field to the power of the 'exponent' field. + * pow(field("base"), field("exponent")); + * ``` + * + * @param base The expression to raise to the power of the exponent. + * @param exponent The expression to raise the base to the power of. + * @return A new `Expr` representing the power operation. + */ +export function pow(base: Expression, exponent: Expression): FunctionExpression; + +/** + * Creates an expression that returns the value of the base expression raised to the power of the exponent. + * + * ```typescript + * // Raise the value of the 'base' field to the power of 2. + * pow(field("base"), 2); + * ``` + * + * @param base The expression to raise to the power of the exponent. + * @param exponent The constant value to raise the base to the power of. + * @return A new `Expr` representing the power operation. + */ +export function pow(base: Expression, exponent: number): FunctionExpression; + +/** + * Creates an expression that returns the value of the base field raised to the power of the exponent expression. + * + * ```typescript + * // Raise the value of the 'base' field to the power of the 'exponent' field. + * pow("base", field("exponent")); + * ``` + * + * @param base The name of the field to raise to the power of the exponent. + * @param exponent The expression to raise the base to the power of. + * @return A new `Expr` representing the power operation. + */ +export function pow(base: string, exponent: Expression): FunctionExpression; + +/** + * Creates an expression that returns the value of the base field raised to the power of the exponent. + * + * ```typescript + * // Raise the value of the 'base' field to the power of 2. + * pow("base", 2); + * ``` + * + * @param base The name of the field to raise to the power of the exponent. + * @param exponent The constant value to raise the base to the power of. + * @return A new `Expr` representing the power operation. + */ +export function pow(base: string, exponent: number): FunctionExpression; +export function pow( + base: Expression | string, + exponent: Expression | number +): FunctionExpression { + return fieldOrExpression(base).pow(exponent as number); +} + +/** + * Creates an expression that rounds a numeric value to the nearest whole number. + * + * ```typescript + * // Round the value of the 'price' field. + * round("price"); + * ``` + * + * @param fieldName The name of the field to round. + * @return A new `Expr` representing the rounded value. + */ +export function round(fieldName: string): FunctionExpression; + +/** + * Creates an expression that rounds a numeric value to the nearest whole number. + * + * ```typescript + * // Round the value of the 'price' field. + * round(field("price")); + * ``` + * + * @param expression An expression evaluating to a numeric value, which will be rounded. + * @return A new `Expr` representing the rounded value. + */ +export function round(expression: Expression): FunctionExpression; + +/** + * Creates an expression that rounds a numeric value to the specified number of decimal places. + * + * ```typescript + * // Round the value of the 'price' field to two decimal places. + * round("price", 2); + * ``` + * + * @param fieldName The name of the field to round. + * @param decimalPlaces A constant or expression specifying the rounding precision in decimal places. + * @return A new `Expr` representing the rounded value. + */ +export function round( + fieldName: string, + decimalPlaces: number | Expression +): FunctionExpression; + +/** + * Creates an expression that rounds a numeric value to the specified number of decimal places. + * + * ```typescript + * // Round the value of the 'price' field to two decimal places. + * round(field("price"), constant(2)); + * ``` + * + * @param expression An expression evaluating to a numeric value, which will be rounded. + * @param decimalPlaces A constant or expression specifying the rounding precision in decimal places. + * @return A new `Expr` representing the rounded value. + */ +export function round( + expression: Expression, + decimalPlaces: number | Expression +): FunctionExpression; +export function round( + expr: Expression | string, + decimalPlaces?: number | Expression +): FunctionExpression { + if (decimalPlaces === undefined) { + return fieldOrExpression(expr).round(); + } else { + return fieldOrExpression(expr).round(valueToDefaultExpr(decimalPlaces)); + } +} + +/** + * Creates an expression that returns the collection ID from a path. + * + * ```typescript + * // Get the collection ID from a path. + * collectionId("__name__"); + * ``` + * + * @param fieldName The name of the field to get the collection ID from. + * @return A new {@code Expr} representing the collectionId operation. + */ +export function collectionId(fieldName: string): FunctionExpression; + +/** + * Creates an expression that returns the collection ID from a path. + * + * ```typescript + * // Get the collection ID from a path. + * collectionId(field("__name__")); + * ``` + * + * @param expression An expression evaluating to a path, which the collection ID will be extracted from. + * @return A new {@code Expr} representing the collectionId operation. + */ +export function collectionId(expression: Expression): FunctionExpression; +export function collectionId(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).collectionId(); +} + +/** + * Creates an expression that calculates the length of a string, array, map, vector, or bytes. + * + * ```typescript + * // Get the length of the 'name' field. + * length("name"); + * + * // Get the number of items in the 'cart' array. + * length("cart"); + * ``` + * + * @param fieldName The name of the field to calculate the length of. + * @return A new `Expr` representing the length of the string, array, map, vector, or bytes. + */ +export function length(fieldName: string): FunctionExpression; + +/** + * Creates an expression that calculates the length of a string, array, map, vector, or bytes. + * + * ```typescript + * // Get the length of the 'name' field. + * length(field("name")); + * + * // Get the number of items in the 'cart' array. + * length(field("cart")); + * ``` + * + * @param expression An expression evaluating to a string, array, map, vector, or bytes, which the length will be calculated for. + * @return A new `Expr` representing the length of the string, array, map, vector, or bytes. + */ +export function length(expression: Expression): FunctionExpression; +export function length(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).length(); +} + +/** + * Creates an expression that computes the natural logarithm of a numeric value. + * + * ```typescript + * // Compute the natural logarithm of the 'value' field. + * ln("value"); + * ``` + * + * @param fieldName The name of the field to compute the natural logarithm of. + * @return A new `Expr` representing the natural logarithm of the numeric value. + */ +export function ln(fieldName: string): FunctionExpression; + +/** + * Creates an expression that computes the natural logarithm of a numeric value. + * + * ```typescript + * // Compute the natural logarithm of the 'value' field. + * ln(field("value")); + * ``` + * + * @param expression An expression evaluating to a numeric value, which the natural logarithm will be computed for. + * @return A new `Expr` representing the natural logarithm of the numeric value. + */ +export function ln(expression: Expression): FunctionExpression; +export function ln(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).ln(); +} + +/** + * Creates an expression that computes the logarithm of an expression to a given base. + * + * ```typescript + * // Compute the logarithm of the 'value' field with base 10. + * log(field("value"), 10); + * ``` + * + * @param expression An expression evaluating to a numeric value, which the logarithm will be computed for. + * @param base The base of the logarithm. + * @return A new {@code Expr} representing the logarithm of the numeric value. + */ +export function log(expression: Expression, base: number): FunctionExpression; +/** + * Creates an expression that computes the logarithm of an expression to a given base. + * + * ```typescript + * // Compute the logarithm of the 'value' field with the base in the 'base' field. + * log(field("value"), field("base")); + * ``` + * + * @param expression An expression evaluating to a numeric value, which the logarithm will be computed for. + * @param base The base of the logarithm. + * @return A new {@code Expr} representing the logarithm of the numeric value. + */ +export function log( + expression: Expression, + base: Expression +): FunctionExpression; +/** + * Creates an expression that computes the logarithm of a field to a given base. + * + * ```typescript + * // Compute the logarithm of the 'value' field with base 10. + * log("value", 10); + * ``` + * + * @param fieldName The name of the field to compute the logarithm of. + * @param base The base of the logarithm. + * @return A new {@code Expr} representing the logarithm of the numeric value. + */ +export function log(fieldName: string, base: number): FunctionExpression; +/** + * Creates an expression that computes the logarithm of a field to a given base. + * + * ```typescript + * // Compute the logarithm of the 'value' field with the base in the 'base' field. + * log("value", field("base")); + * ``` + * + * @param fieldName The name of the field to compute the logarithm of. + * @param base The base of the logarithm. + * @return A new {@code Expr} representing the logarithm of the numeric value. + */ +export function log(fieldName: string, base: Expression): FunctionExpression; +export function log( + expr: Expression | string, + base: number | Expression +): FunctionExpression { + return new FunctionExpression('log', [ + fieldOrExpression(expr), + valueToDefaultExpr(base) + ]); +} + +/** + * Creates an expression that computes the square root of a numeric value. + * + * ```typescript + * // Compute the square root of the 'value' field. + * sqrt(field("value")); + * ``` + * + * @param expression An expression evaluating to a numeric value, which the square root will be computed for. + * @return A new {@code Expr} representing the square root of the numeric value. + */ +export function sqrt(expression: Expression): FunctionExpression; +/** + * Creates an expression that computes the square root of a numeric value. + * + * ```typescript + * // Compute the square root of the 'value' field. + * sqrt("value"); + * ``` + * + * @param fieldName The name of the field to compute the square root of. + * @return A new {@code Expr} representing the square root of the numeric value. + */ +export function sqrt(fieldName: string): FunctionExpression; +export function sqrt(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).sqrt(); +} + +/** + * Creates an expression that reverses a string. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * strReverse(field("myString")); + * ``` + * + * @param stringExpression An expression evaluating to a string value, which will be reversed. + * @return A new {@code Expr} representing the reversed string. + */ +export function stringReverse(stringExpression: Expression): FunctionExpression; + +/** + * Creates an expression that reverses a string value in the specified field. + * + * ```typescript + * // Reverse the value of the 'myString' field. + * strReverse("myString"); + * ``` + * + * @param field The name of the field representing the string to reverse. + * @return A new {@code Expr} representing the reversed string. + */ +export function stringReverse(field: string): FunctionExpression; +export function stringReverse(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).stringReverse(); +} + +/** + * Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. + * + * ```typescript + * // Concatenate the 'firstName' and 'lastName' fields with a space in between. + * concat(field("firstName"), " ", field("lastName")) + * ``` + * + * @param first The first expressions to concatenate. + * @param second The second literal or expression to concatenate. + * @param others Additional literals or expressions to concatenate. + * @return A new `Expression` representing the concatenation. + */ +export function concat( + first: Expression, + second: Expression | unknown, + ...others: Array +): FunctionExpression; + +/** + * Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. + * + * ```typescript + * // Concatenate a field with a literal string. + * concat(field("firstName"), "Doe") + * ``` + * + * @param fieldName The name of a field to concatenate. + * @param second The second literal or expression to concatenate. + * @param others Additional literal or expressions to concatenate. + * @return A new `Expression` representing the concatenation. + */ +export function concat( + fieldName: string, + second: Expression | unknown, + ...others: Array +): FunctionExpression; + +export function concat( + fieldNameOrExpression: string | Expression, + second: Expression | unknown, + ...others: Array +): FunctionExpression { + return new FunctionExpression('concat', [ + fieldOrExpression(fieldNameOrExpression), + valueToDefaultExpr(second), + ...others.map(valueToDefaultExpr) + ]); +} + +/** + * Creates an expression that computes the absolute value of a numeric value. + * + * @param expr The expression to compute the absolute value of. + * @return A new {@code Expr} representing the absolute value of the numeric value. + */ +export function abs(expr: Expression): FunctionExpression; + +/** + * Creates an expression that computes the absolute value of a numeric value. + * + * @param fieldName The field to compute the absolute value of. + * @return A new {@code Expr} representing the absolute value of the numeric value. + */ +export function abs(fieldName: string): FunctionExpression; +export function abs(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).abs(); +} + +/** + * Creates an expression that returns the `elseExpr` argument if `ifExpr` is absent, else return + * the result of the `ifExpr` argument evaluation. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or returns 'default_value' + * // if the field is absent. + * ifAbsent(field("optional_field"), constant("default_value")) + * ``` + * + * @param ifExpr The expression to check for absence. + * @param elseExpr The expression that will be evaluated and returned if [ifExpr] is absent. + * @return A new Expression representing the ifAbsent operation. + */ +export function ifAbsent(ifExpr: Expression, elseExpr: Expression): Expression; + +/** + * Creates an expression that returns the `elseValue` argument if `ifExpr` is absent, else + * return the result of the `ifExpr` argument evaluation. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or returns 'default_value' + * // if the field is absent. + * ifAbsent(field("optional_field"), "default_value") + * ``` + * + * @param ifExpr The expression to check for absence. + * @param elseValue The value that will be returned if `ifExpr` evaluates to an absent value. + * @return A new [Expression] representing the ifAbsent operation. + */ +export function ifAbsent(ifExpr: Expression, elseValue: unknown): Expression; + +/** + * Creates an expression that returns the `elseExpr` argument if `ifFieldName` is absent, else + * return the value of the field. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or returns the value of + * // 'default_field' if 'optional_field' is absent. + * ifAbsent("optional_field", field("default_field")) + * ``` + * + * @param ifFieldName The field to check for absence. + * @param elseExpr The expression that will be evaluated and returned if `ifFieldName` is + * absent. + * @return A new Expression representing the ifAbsent operation. + */ +export function ifAbsent(ifFieldName: string, elseExpr: Expression): Expression; + +/** + * Creates an expression that returns the `elseValue` argument if `ifFieldName` is absent, else + * return the value of the field. + * + * ```typescript + * // Returns the value of the optional field 'optional_field', or returns 'default_value' + * // if the field is absent. + * ifAbsent("optional_field", "default_value") + * ``` + * + * @param ifFieldName The field to check for absence. + * @param elseValue The value that will be returned if [ifFieldName] is absent. + * @return A new Expression representing the ifAbsent operation. + */ +export function ifAbsent( + ifFieldName: string | Expression, + elseValue: Expression | unknown +): Expression; +export function ifAbsent( + fieldNameOrExpression: string | Expression, + elseValue: Expression | unknown +): Expression { + return fieldOrExpression(fieldNameOrExpression).ifAbsent( + valueToDefaultExpr(elseValue) + ); +} + +/** + * Creates an expression that joins the elements of an array into a string. + * + * ```typescript + * // Join the elements of the 'tags' field with a comma and space. + * join("tags", ", ") + * ``` + * + * @param arrayFieldName The name of the field containing the array. + * @param delimiter The string to use as a delimiter. + * @return A new Expression representing the join operation. + */ +export function join(arrayFieldName: string, delimiter: string): Expression; + +/** + * Creates an expression that joins the elements of an array into a string. + * + * ```typescript + * // Join an array of string using the delimiter from the 'separator' field. + * join(array(['foo', 'bar']), field("separator")) + * ``` + * + * @param arrayExpression An expression that evaluates to an array. + * @param delimiterExpression The expression that evaluates to the delimiter string. + * @return A new Expression representing the join operation. + */ +export function join( + arrayExpression: Expression, + delimiterExpression: Expression +): Expression; + +/** + * Creates an expression that joins the elements of an array into a string. + * + * ```typescript + * // Join the elements of the 'tags' field with a comma and space. + * join(field("tags"), ", ") + * ``` + * + * @param arrayExpression An expression that evaluates to an array. + * @param delimiter The string to use as a delimiter. + * @return A new Expression representing the join operation. + */ +export function join( + arrayExpression: Expression, + delimiter: string +): Expression; + +/** + * Creates an expression that joins the elements of an array into a string. + * + * ```typescript + * // Join the elements of the 'tags' field with the delimiter from the 'separator' field. + * join('tags', field("separator")) + * ``` + * + * @param arrayFieldName The name of the field containing the array. + * @param delimiterExpression The expression that evaluates to the delimiter string. + * @return A new Expression representing the join operation. + */ +export function join( + arrayFieldName: string, + delimiterExpression: Expression +): Expression; +export function join( + fieldNameOrExpression: string | Expression, + delimiterValueOrExpression: Expression | string +): Expression { + return fieldOrExpression(fieldNameOrExpression).join( + valueToDefaultExpr(delimiterValueOrExpression) + ); +} + +/** + * Creates an expression that computes the base-10 logarithm of a numeric value. + * + * ```typescript + * // Compute the base-10 logarithm of the 'value' field. + * log10("value"); + * ``` + * + * @param fieldName The name of the field to compute the base-10 logarithm of. + * @return A new `Expr` representing the base-10 logarithm of the numeric value. + */ +export function log10(fieldName: string): FunctionExpression; + +/** + * Creates an expression that computes the base-10 logarithm of a numeric value. + * + * ```typescript + * // Compute the base-10 logarithm of the 'value' field. + * log10(field("value")); + * ``` + * + * @param expression An expression evaluating to a numeric value, which the base-10 logarithm will be computed for. + * @return A new `Expr` representing the base-10 logarithm of the numeric value. + */ +export function log10(expression: Expression): FunctionExpression; +export function log10(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).log10(); } +/** + * Creates an expression that computes the sum of the elements in an array. + * + * ```typescript + * // Compute the sum of the elements in the 'scores' field. + * arraySum("scores"); + * ``` + * + * @param fieldName The name of the field to compute the sum of. + * @return A new `Expr` representing the sum of the elements in the array. + */ +export function arraySum(fieldName: string): FunctionExpression; + +/** + * Creates an expression that computes the sum of the elements in an array. + * + * ```typescript + * // Compute the sum of the elements in the 'scores' field. + * arraySum(field("scores")); + * ``` + * + * @param expression An expression evaluating to a numeric array, which the sum will be computed for. + * @return A new `Expr` representing the sum of the elements in the array. + */ +export function arraySum(expression: Expression): FunctionExpression; +export function arraySum(expr: Expression | string): FunctionExpression { + return fieldOrExpression(expr).arraySum(); +} + +// TODO(new-expression): Add new top-level expression function definitions above this line + /** * @beta * @@ -6797,7 +7590,7 @@ export function or( * @param expr The expression to create an ascending ordering for. * @return A new `Ordering` for ascending sorting. */ -export function ascending(expr: Expr): Ordering; +export function ascending(expr: Expression): Ordering; /** * @beta @@ -6814,8 +7607,8 @@ export function ascending(expr: Expr): Ordering; * @return A new `Ordering` for ascending sorting. */ export function ascending(fieldName: string): Ordering; -export function ascending(field: Expr | string): Ordering { - return new Ordering(fieldOrExpression(field), 'ascending'); +export function ascending(field: Expression | string): Ordering { + return new Ordering(fieldOrExpression(field), 'ascending', 'ascending'); } /** @@ -6832,7 +7625,7 @@ export function ascending(field: Expr | string): Ordering { * @param expr The expression to create a descending ordering for. * @return A new `Ordering` for descending sorting. */ -export function descending(expr: Expr): Ordering; +export function descending(expr: Expression): Ordering; /** * @beta @@ -6849,8 +7642,8 @@ export function descending(expr: Expr): Ordering; * @return A new `Ordering` for descending sorting. */ export function descending(fieldName: string): Ordering; -export function descending(field: Expr | string): Ordering { - return new Ordering(fieldOrExpression(field), 'descending'); +export function descending(field: Expression | string): Ordering { + return new Ordering(fieldOrExpression(field), 'descending', 'descending'); } /** @@ -6862,18 +7655,11 @@ export function descending(field: Expr | string): Ordering { */ export class Ordering implements ProtoValueSerializable, UserData { constructor( - readonly expr: Expr, - readonly direction: 'ascending' | 'descending' + public readonly expr: Expression, + public readonly direction: 'ascending' | 'descending', + readonly _methodName: string | undefined ) {} - /** - * @internal - * @private - * Indicates if this expression was created from a literal value passed - * by the caller. - */ - _createdFromLiteral: boolean = false; - /** * @private * @internal @@ -6893,13 +7679,54 @@ export class Ordering implements ProtoValueSerializable, UserData { * @private * @internal */ - _readUserData(dataReader: UserDataReader, context?: ParseContext): void { - context = - this._createdFromLiteral && context - ? context - : dataReader.createContext(UserDataSource.Argument, 'constant'); - this.expr._readUserData(dataReader); + _readUserData(context: ParseContext): void { + this.expr._readUserData(context); } _protoValueType: 'ProtoValue' = 'ProtoValue'; } + +export function isSelectable(val: unknown): val is Selectable { + const candidate = val as Selectable; + return ( + candidate.selectable && isString(candidate.alias) && isExpr(candidate.expr) + ); +} + +export function isOrdering(val: unknown): val is Ordering { + const candidate = val as Ordering; + return ( + isExpr(candidate.expr) && + (candidate.direction === 'ascending' || + candidate.direction === 'descending') + ); +} + +export function isAliasedAggregate(val: unknown): val is AliasedAggregate { + const candidate = val as AliasedAggregate; + return ( + isString(candidate.alias) && + candidate.aggregate instanceof AggregateFunction + ); +} + +export function isExpr(val: unknown): val is Expression { + return val instanceof Expression; +} + +export function isBooleanExpr(val: unknown): val is BooleanExpression { + return val instanceof BooleanExpression; +} + +export function isField(val: unknown): val is Field { + return val instanceof Field; +} + +export function toField(value: string | Field): Field { + if (isString(value)) { + const result = field(value); + return result; + } else { + return value as Field; + } +} diff --git a/packages/firestore/src/lite-api/pipeline-result.ts b/packages/firestore/src/lite-api/pipeline-result.ts index 635636ac46b..c352ba48338 100644 --- a/packages/firestore/src/lite-api/pipeline-result.ts +++ b/packages/firestore/src/lite-api/pipeline-result.ts @@ -18,12 +18,12 @@ import { ObjectValue } from '../model/object_value'; import { isOptionalEqual } from '../util/misc'; -import { Field } from './expressions'; +import { Field, isField } from './expressions'; import { FieldPath } from './field_path'; import { Pipeline } from './pipeline'; import { DocumentData, DocumentReference, refEqual } from './reference'; -import { fieldPathFromArgument } from './snapshot'; import { Timestamp } from './timestamp'; +import { fieldPathFromArgument } from './user_data_reader'; import { AbstractUserDataWriter } from './user_data_writer'; export class PipelineSnapshot { @@ -40,14 +40,6 @@ export class PipelineSnapshot { this._results = results; } - /** - * The Pipeline on which you called `execute()` in order to get this - * `PipelineSnapshot`. - */ - get pipeline(): Pipeline { - return this._pipeline; - } - /** An array of all the results in the `PipelineSnapshot`. */ get results(): PipelineResult[] { return this._results; @@ -95,7 +87,7 @@ export class PipelineResult { * @internal * @private */ - readonly _fields: ObjectValue | undefined; + readonly _fields: ObjectValue; /** * @private @@ -104,16 +96,14 @@ export class PipelineResult { * @param userDataWriter The serializer used to encode/decode protobuf. * @param ref The reference to the document. * @param fields The fields of the Firestore `Document` Protobuf backing - * this document (or undefined if the document does not exist). - * @param readTime The time when this result was read (or undefined if - * the document exists only locally). + * this document. * @param createTime The time when the document was created if the result is a document, undefined otherwise. * @param updateTime The time when the document was last updated if the result is a document, undefined otherwise. */ constructor( userDataWriter: AbstractUserDataWriter, + fields: ObjectValue, ref?: DocumentReference, - fields?: ObjectValue, createTime?: Timestamp, updateTime?: Timestamp ) { @@ -164,10 +154,9 @@ export class PipelineResult { } /** - * Retrieves all fields in the result as an object. Returns 'undefined' if - * the document doesn't exist. + * Retrieves all fields in the result as an object. * - * @returns {T|undefined} An object containing all fields in the document or + * @returns {T} An object containing all fields in the document or * 'undefined' if the document doesn't exist. * * @example @@ -180,11 +169,7 @@ export class PipelineResult { * }); * ``` */ - data(): AppModelType | undefined { - if (this._fields === undefined) { - return undefined; - } - + data(): AppModelType { return this._userDataWriter.convertValue( this._fields.value ) as AppModelType; @@ -215,6 +200,9 @@ export class PipelineResult { if (this._fields === undefined) { return undefined; } + if (isField(fieldPath)) { + fieldPath = fieldPath.fieldName; + } const value = this._fields.field( fieldPathFromArgument('DocumentSnapshot.get', fieldPath) diff --git a/packages/firestore/src/lite-api/pipeline-source.ts b/packages/firestore/src/lite-api/pipeline-source.ts index 421fc759bfb..3f4d62cb0be 100644 --- a/packages/firestore/src/lite-api/pipeline-source.ts +++ b/packages/firestore/src/lite-api/pipeline-source.ts @@ -17,10 +17,16 @@ import { DatabaseId } from '../core/database_info'; import { toPipeline } from '../core/pipeline-util'; -import { FirestoreError, Code } from '../util/error'; +import { Code, FirestoreError } from '../util/error'; +import { isString } from '../util/types'; import { Pipeline } from './pipeline'; -import { CollectionReference, DocumentReference, Query } from './reference'; +import { + CollectionReference, + DocumentReference, + isCollectionReference, + Query +} from './reference'; import { CollectionGroupSource, CollectionSource, @@ -28,6 +34,13 @@ import { DocumentsSource, Stage } from './stage'; +import { + CollectionGroupStageOptions, + CollectionStageOptions, + DatabaseStageOptions, + DocumentsStageOptions +} from './stage_options'; +import { UserDataReader, UserDataSource } from './user_data_reader'; /** * Represents the source of a Firestore {@link Pipeline}. @@ -37,10 +50,13 @@ export class PipelineSource { /** * @internal * @private + * @param databaseId + * @param userDataReader * @param _createPipeline */ constructor( private databaseId: DatabaseId, + private userDataReader: UserDataReader, /** * @internal * @private @@ -49,44 +65,119 @@ export class PipelineSource { ) {} /** - * Set the pipeline's source to the collection specified by the given path. - * - * @param collectionPath A path to a collection that will be the source of this pipeline. + * Returns all documents from the entire collection. The collection can be nested. + * @param collection - Name or reference to the collection that will be used as the Pipeline source. */ - collection(collectionPath: string): PipelineType; - + collection(collection: string | CollectionReference): PipelineType; /** - * Set the pipeline's source to the collection specified by the given CollectionReference. - * - * @param collectionReference A CollectionReference for a collection that will be the source of this pipeline. - * The converter for this CollectionReference will be ignored and not have an effect on this pipeline. - * - * @throws {@FirestoreError} Thrown if the provided CollectionReference targets a different project or database than the pipeline. + * Returns all documents from the entire collection. The collection can be nested. + * @param options - Options defining how this CollectionStage is evaluated. */ - collection(collectionReference: CollectionReference): PipelineType; - collection(collection: CollectionReference | string): PipelineType { - if (collection instanceof CollectionReference) { - this._validateReference(collection); - return this._createPipeline([new CollectionSource(collection.path)]); - } else { - return this._createPipeline([new CollectionSource(collection)]); + collection(options: CollectionStageOptions): PipelineType; + collection( + collectionOrOptions: string | CollectionReference | CollectionStageOptions + ): PipelineType { + // Process argument union(s) from method overloads + const options = + isString(collectionOrOptions) || + isCollectionReference(collectionOrOptions) + ? {} + : collectionOrOptions; + const collectionRefOrString = + isString(collectionOrOptions) || + isCollectionReference(collectionOrOptions) + ? collectionOrOptions + : collectionOrOptions.collection; + + // Validate that a user provided reference is for the same Firestore DB + if (isCollectionReference(collectionRefOrString)) { + this._validateReference(collectionRefOrString); } + + // Convert user land convenience types to internal types + const normalizedCollection = isString(collectionRefOrString) + ? (collectionRefOrString as string) + : collectionRefOrString.path; + + // Create stage object + const stage = new CollectionSource(normalizedCollection, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'collection' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._createPipeline([stage]); } /** - * Set the pipeline's source to the collection group with the given id. - * - * @param collectionid The id of a collection group that will be the source of this pipeline. + * Returns all documents from a collection ID regardless of the parent. + * @param collectionId - ID of the collection group to use as the Pipeline source. + */ + collectionGroup(collectionId: string): PipelineType; + /** + * Returns all documents from a collection ID regardless of the parent. + * @param options - Options defining how this CollectionGroupStage is evaluated. */ - collectionGroup(collectionId: string): PipelineType { - return this._createPipeline([new CollectionGroupSource(collectionId)]); + collectionGroup(options: CollectionGroupStageOptions): PipelineType; + collectionGroup( + collectionIdOrOptions: string | CollectionGroupStageOptions + ): PipelineType { + // Process argument union(s) from method overloads + let collectionId: string; + let options: {}; + if (isString(collectionIdOrOptions)) { + collectionId = collectionIdOrOptions; + options = {}; + } else { + ({ collectionId, ...options } = collectionIdOrOptions); + } + + // Create stage object + const stage = new CollectionGroupSource(collectionId, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'collectionGroup' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._createPipeline([stage]); } /** - * Set the pipeline's source to be all documents in this database. + * Returns all documents from the entire database. */ - database(): PipelineType { - return this._createPipeline([new DatabaseSource()]); + database(): PipelineType; + /** + * Returns all documents from the entire database. + * @param options - Options defining how a DatabaseStage is evaluated. + */ + database(options: DatabaseStageOptions): PipelineType; + database(options?: DatabaseStageOptions): PipelineType { + // Process argument union(s) from method overloads + options = options ?? {}; + + // Create stage object + const stage = new DatabaseSource(options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'database' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._createPipeline([stage]); } /** @@ -97,14 +188,52 @@ export class PipelineSource { * * @throws {@FirestoreError} Thrown if any of the provided DocumentReferences target a different project or database than the pipeline. */ - documents(docs: Array): PipelineType { - docs.forEach(doc => { - if (doc instanceof DocumentReference) { - this._validateReference(doc); - } - }); - - return this._createPipeline([DocumentsSource.of(docs)]); + documents(docs: Array): PipelineType; + + /** + * Set the pipeline's source to the documents specified by the given paths and DocumentReferences. + * + * @param options - Options defining how this DocumentsStage is evaluated. + * + * @throws {@FirestoreError} Thrown if any of the provided DocumentReferences target a different project or database than the pipeline. + */ + documents(options: DocumentsStageOptions): PipelineType; + documents( + docsOrOptions: Array | DocumentsStageOptions + ): PipelineType { + // Process argument union(s) from method overloads + let options: {}; + let docs: Array; + if (Array.isArray(docsOrOptions)) { + docs = docsOrOptions; + options = {}; + } else { + ({ docs, ...options } = docsOrOptions); + } + + // Validate that all user provided references are for the same Firestore DB + docs + .filter(v => v instanceof DocumentReference) + .forEach(dr => this._validateReference(dr as DocumentReference)); + + // Convert user land convenience types to internal types + const normalizedDocs: string[] = docs.map(doc => + isString(doc) ? doc : doc.path + ); + + // Create stage object + const stage = new DocumentsSource(normalizedDocs, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'documents' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._createPipeline([stage]); } /** diff --git a/packages/firestore/src/lite-api/pipeline.ts b/packages/firestore/src/lite-api/pipeline.ts index 8b5bebeddb8..f4aae07b828 100644 --- a/packages/firestore/src/lite-api/pipeline.ts +++ b/packages/firestore/src/lite-api/pipeline.ts @@ -15,62 +15,79 @@ * limitations under the License. */ -import { ObjectValue } from '../model/object_value'; import { Pipeline as ProtoPipeline, Stage as ProtoStage } from '../protos/firestore_proto_api'; import { JsonProtoSerializer, ProtoSerializable } from '../remote/serializer'; import { isPlainObject } from '../util/input_validation'; +import { + aliasedAggregateToMap, + fieldOrExpression, + selectablesToMap, + vectorToExpr +} from '../util/pipeline_util'; +import { isNumber, isString } from '../util/types'; import { Firestore } from './database'; import { _mapValue, AggregateFunction, - AggregateWithAlias, - Expr, - ExprWithAlias, + AliasedAggregate, + BooleanExpression, + _constant, + Expression, Field, - BooleanExpr, + field, Ordering, Selectable, - field, - Constant + _field, + isSelectable, + isField, + isBooleanExpr, + isAliasedAggregate, + toField, + isOrdering, + isExpr } from './expressions'; import { AddFields, Aggregate, Distinct, FindNearest, - FindNearestOptions, - GenericStage, + RawStage, Limit, Offset, RemoveFields, Replace, + Sample, Select, Sort, - Sample, + Stage, Union, Unnest, - Stage, Where } from './stage'; import { - parseVectorValue, - UserDataReader, - UserDataSource -} from './user_data_reader'; + AddFieldsStageOptions, + AggregateStageOptions, + DistinctStageOptions, + FindNearestStageOptions, + LimitStageOptions, + OffsetStageOptions, + RemoveFieldsStageOptions, + ReplaceWithStageOptions, + SampleStageOptions, + SelectStageOptions, + SortStageOptions, + StageOptions, + UnionStageOptions, + UnnestStageOptions, + WhereStageOptions +} from './stage_options'; +import { UserDataReader, UserDataSource } from './user_data_reader'; import { AbstractUserDataWriter } from './user_data_writer'; -interface ReadableUserData { - _readUserData(dataReader: UserDataReader): void; -} - -function isReadableUserData(value: unknown): value is ReadableUserData { - return typeof (value as ReadableUserData)._readUserData === 'function'; -} - /** * @beta * @@ -110,10 +127,6 @@ function isReadableUserData(value: unknown): value is ReadableUserData { * .aggregate(avg(field("rating")).as("averageRating"))); * ``` */ - -/** - * Base-class implementation - */ export class Pipeline implements ProtoSerializable { /** * @internal @@ -148,8 +161,8 @@ export class Pipeline implements ProtoSerializable { * The added fields are defined using {@link Selectable}s, which can be: * * - {@link Field}: References an existing document field. - * - {@link Expr}: Either a literal value (see {@link Constant}) or a computed value - * (see {@FunctionExpr}) with an assigned alias using {@link Expr#as}. + * - {@link Expression}: Either a literal value (see {@link Constant}) or a computed value + * (see {@FunctionExpr}) with an assigned alias using {@link Expression#as}. * * Example: * @@ -165,15 +178,64 @@ export class Pipeline implements ProtoSerializable { * @param additionalFields Optional additional fields to add to the documents, specified as {@link Selectable}s. * @return A new Pipeline object with this stage appended to the stage list. */ - addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline { - return this._addStage( - new AddFields( - this.readUserData( - 'addFields', - this.selectablesToMap([field, ...additionalFields]) - ) - ) + addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline; + /** + * Adds new fields to outputs from previous stages. + * + * This stage allows you to compute values on-the-fly based on existing data from previous + * stages or constants. You can use this to create new fields or overwrite existing ones (if there + * is name overlaps). + * + * The added fields are defined using {@link Selectable}s, which can be: + * + * - {@link Field}: References an existing document field. + * - {@link Expression}: Either a literal value (see {@link Constant}) or a computed value + * (see {@FunctionExpr}) with an assigned alias using {@link Expression#as}. + * + * Example: + * + * ```typescript + * firestore.pipeline().collection("books") + * .addFields( + * field("rating").as("bookRating"), // Rename 'rating' to 'bookRating' + * add(5, field("quantity")).as("totalCost") // Calculate 'totalCost' + * ); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new Pipeline object with this stage appended to the stage list. + */ + addFields(options: AddFieldsStageOptions): Pipeline; + addFields( + fieldOrOptions: Selectable | AddFieldsStageOptions, + ...additionalFields: Selectable[] + ): Pipeline { + // Process argument union(s) from method overloads + let fields: Selectable[]; + let options: {}; + if (isSelectable(fieldOrOptions)) { + fields = [fieldOrOptions, ...additionalFields]; + options = {}; + } else { + ({ fields, ...options } = fieldOrOptions); + } + + // Convert user land convenience types to internal types + const normalizedFields: Map = selectablesToMap(fields); + + // Create stage object + const stage = new AddFields(normalizedFields, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'addFields' ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -197,12 +259,55 @@ export class Pipeline implements ProtoSerializable { removeFields( fieldValue: Field | string, ...additionalFields: Array + ): Pipeline; + /** + * Remove fields from outputs of previous stages. + * + * Example: + * + * ```typescript + * firestore.pipeline().collection('books') + * // removes field 'rating' and 'cost' from the previous stage outputs. + * .removeFields( + * field('rating'), + * 'cost' + * ); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new Pipeline object with this stage appended to the stage list. + */ + removeFields(options: RemoveFieldsStageOptions): Pipeline; + removeFields( + fieldValueOrOptions: Field | string | RemoveFieldsStageOptions, + ...additionalFields: Array ): Pipeline { - const fieldExpressions = [fieldValue, ...additionalFields].map(f => - typeof f === 'string' ? field(f) : (f as Field) + // Process argument union(s) from method overloads + const options = + isField(fieldValueOrOptions) || isString(fieldValueOrOptions) + ? {} + : fieldValueOrOptions; + const fields: Array = + isField(fieldValueOrOptions) || isString(fieldValueOrOptions) + ? [fieldValueOrOptions, ...additionalFields] + : fieldValueOrOptions.fields; + + // Convert user land convenience types to internal types + const convertedFields: Field[] = fields.map(f => + isString(f) ? field(f) : (f as Field) ); - this.readUserData('removeFields', fieldExpressions); - return this._addStage(new RemoveFields(fieldExpressions)); + + // Create stage object + const stage = new RemoveFields(convertedFields, options); + + // User data must be read in the context of the API method to + // provide contextual errors + stage._readUserData( + this.userDataReader.createContext(UserDataSource.Argument, 'removeFields') + ); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -214,7 +319,7 @@ export class Pipeline implements ProtoSerializable { *
    • {@code string}: Name of an existing field
    • *
    • {@link Field}: References an existing field.
    • *
    • {@link Function}: Represents the result of a function with an assigned alias name using - * {@link Expr#as}
    • + * {@link Expression#as} *
    * *

    If no selections are provided, the output of this stage is empty. Use {@link @@ -224,7 +329,7 @@ export class Pipeline implements ProtoSerializable { *

    Example: * * ```typescript - * firestore.pipeline().collection("books") + * db.pipeline().collection("books") * .select( * "firstName", * field("lastName"), @@ -241,22 +346,111 @@ export class Pipeline implements ProtoSerializable { select( selection: Selectable | string, ...additionalSelections: Array + ): Pipeline; + /** + * Selects or creates a set of fields from the outputs of previous stages. + * + *

    The selected fields are defined using {@link Selectable} expressions, which can be: + * + *

      + *
    • {@code string}: Name of an existing field
    • + *
    • {@link Field}: References an existing field.
    • + *
    • {@link Function}: Represents the result of a function with an assigned alias name using + * {@link Expression#as}
    • + *
    + * + *

    If no selections are provided, the output of this stage is empty. Use {@link + * Pipeline#addFields} instead if only additions are + * desired. + * + *

    Example: + * + * ```typescript + * db.pipeline().collection("books") + * .select( + * "firstName", + * field("lastName"), + * field("address").toUppercase().as("upperAddress"), + * ); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new Pipeline object with this stage appended to the stage list. + */ + select(options: SelectStageOptions): Pipeline; + select( + selectionOrOptions: Selectable | string | SelectStageOptions, + ...additionalSelections: Array ): Pipeline { - let projections: Map = this.selectablesToMap([ - selection, - ...additionalSelections - ]); - projections = this.readUserData('select', projections); - return this._addStage(new Select(projections)); + // Process argument union(s) from method overloads + const options = + isSelectable(selectionOrOptions) || isString(selectionOrOptions) + ? {} + : selectionOrOptions; + + const selections: Array = + isSelectable(selectionOrOptions) || isString(selectionOrOptions) + ? [selectionOrOptions, ...additionalSelections] + : selectionOrOptions.selections; + + // Convert user land convenience types to internal types + const normalizedSelections: Map = + selectablesToMap(selections); + + // Create stage object + const stage = new Select(normalizedSelections, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'select' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** * Filters the documents from previous stages to only include those matching the specified {@link - * BooleanExpr}. + * BooleanExpression}. + * + *

    This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. + * You can filter documents based on their field values, using implementations of {@link + * BooleanExpression}, typically including but not limited to: + * + *

      + *
    • field comparators: {@link Function#eq}, {@link Function#lt} (less than), {@link + * Function#gt} (greater than), etc.
    • + *
    • logical operators: {@link Function#and}, {@link Function#or}, {@link Function#not}, etc.
    • + *
    • advanced functions: {@link Function#regexMatch}, {@link + * Function#arrayContains}, etc.
    • + *
    + * + *

    Example: + * + * ```typescript + * firestore.pipeline().collection("books") + * .where( + * and( + * gt(field("rating"), 4.0), // Filter for ratings greater than 4.0 + * field("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction") + * ) + * ); + * ``` + * + * @param condition The {@link BooleanExpression} to apply. + * @return A new Pipeline object with this stage appended to the stage list. + */ + where(condition: BooleanExpression): Pipeline; + /** + * Filters the documents from previous stages to only include those matching the specified {@link + * BooleanExpression}. * *

    This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. * You can filter documents based on their field values, using implementations of {@link - * BooleanExpr}, typically including but not limited to: + * BooleanExpression}, typically including but not limited to: * *

      *
    • field comparators: {@link Function#eq}, {@link Function#lt} (less than), {@link @@ -278,12 +472,30 @@ export class Pipeline implements ProtoSerializable { * ); * ``` * - * @param condition The {@link BooleanExpr} to apply. + * @param options - An object that specifies required and optional parameters for the stage. * @return A new Pipeline object with this stage appended to the stage list. */ - where(condition: BooleanExpr): Pipeline { - this.readUserData('where', condition); - return this._addStage(new Where(condition)); + where(options: WhereStageOptions): Pipeline; + where(conditionOrOptions: BooleanExpression | WhereStageOptions): Pipeline { + // Process argument union(s) from method overloads + const options = isBooleanExpr(conditionOrOptions) ? {} : conditionOrOptions; + const condition: BooleanExpression = isBooleanExpr(conditionOrOptions) + ? conditionOrOptions + : conditionOrOptions.condition; + + // Create stage object + const stage = new Where(condition, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'where' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -297,8 +509,8 @@ export class Pipeline implements ProtoSerializable { * * ```typescript * // Retrieve the second page of 20 results - * firestore.pipeline().collection("books") - * .sort(field("published").descending()) + * firestore.pipeline().collection('books') + * .sort(field('published').descending()) * .offset(20) // Skip the first 20 results * .limit(20); // Take the next 20 results * ``` @@ -306,8 +518,53 @@ export class Pipeline implements ProtoSerializable { * @param offset The number of documents to skip. * @return A new Pipeline object with this stage appended to the stage list. */ - offset(offset: number): Pipeline { - return this._addStage(new Offset(offset)); + offset(offset: number): Pipeline; + /** + * Skips the first `offset` number of documents from the results of previous stages. + * + *

      This stage is useful for implementing pagination in your pipelines, allowing you to retrieve + * results in chunks. It is typically used in conjunction with {@link #limit} to control the + * size of each page. + * + *

      Example: + * + * ```typescript + * // Retrieve the second page of 20 results + * firestore.pipeline().collection('books') + * .sort(field('published').descending()) + * .offset(20) // Skip the first 20 results + * .limit(20); // Take the next 20 results + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new Pipeline object with this stage appended to the stage list. + */ + offset(options: OffsetStageOptions): Pipeline; + offset(offsetOrOptions: number | OffsetStageOptions): Pipeline { + // Process argument union(s) from method overloads + let options: {}; + let offset: number; + if (isNumber(offsetOrOptions)) { + options = {}; + offset = offsetOrOptions; + } else { + options = offsetOrOptions; + offset = offsetOrOptions.offset; + } + + // Create stage object + const stage = new Offset(offset, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'offset' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -327,30 +584,75 @@ export class Pipeline implements ProtoSerializable { * * ```typescript * // Limit the results to the top 10 highest-rated books - * firestore.pipeline().collection("books") - * .sort(field("rating").descending()) + * firestore.pipeline().collection('books') + * .sort(field('rating').descending()) * .limit(10); * ``` * * @param limit The maximum number of documents to return. * @return A new Pipeline object with this stage appended to the stage list. */ - limit(limit: number): Pipeline { - return this._addStage(new Limit(limit)); + limit(limit: number): Pipeline; + /** + * Limits the maximum number of documents returned by previous stages to `limit`. + * + *

      This stage is particularly useful when you want to retrieve a controlled subset of data from + * a potentially large result set. It's often used for: + * + *

        + *
      • **Pagination:** In combination with {@link #offset} to retrieve specific pages of + * results.
      • + *
      • **Limiting Data Retrieval:** To prevent excessive data transfer and improve performance, + * especially when dealing with large collections.
      • + *
      + * + *

      Example: + * + * ```typescript + * // Limit the results to the top 10 highest-rated books + * firestore.pipeline().collection('books') + * .sort(field('rating').descending()) + * .limit(10); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new Pipeline object with this stage appended to the stage list. + */ + limit(options: LimitStageOptions): Pipeline; + limit(limitOrOptions: number | LimitStageOptions): Pipeline { + // Process argument union(s) from method overloads + const options = isNumber(limitOrOptions) ? {} : limitOrOptions; + const limit: number = isNumber(limitOrOptions) + ? limitOrOptions + : limitOrOptions.limit; + + // Create stage object + const stage = new Limit(limit, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'limit' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** * Returns a set of distinct values from the inputs to this stage. * * This stage runs through the results from previous stages to include only results with - * unique combinations of {@link Expr} values ({@link Field}, {@link Function}, etc). + * unique combinations of {@link Expression} values ({@link Field}, {@link Function}, etc). * * The parameters to this stage are defined using {@link Selectable} expressions or strings: * * - {@code string}: Name of an existing field * - {@link Field}: References an existing document field. - * - {@link ExprWithAlias}: Represents the result of a function with an assigned alias name - * using {@link Expr#as}. + * - {@link AliasedExpr}: Represents the result of a function with an assigned alias name + * using {@link Expression#as}. * * Example: * @@ -370,23 +672,71 @@ export class Pipeline implements ProtoSerializable { distinct( group: string | Selectable, ...additionalGroups: Array + ): Pipeline; + /** + * Returns a set of distinct values from the inputs to this stage. + * + * This stage runs through the results from previous stages to include only results with + * unique combinations of {@link Expression} values ({@link Field}, {@link Function}, etc). + * + * The parameters to this stage are defined using {@link Selectable} expressions or strings: + * + * - {@code string}: Name of an existing field + * - {@link Field}: References an existing document field. + * - {@link AliasedExpr}: Represents the result of a function with an assigned alias name + * using {@link Expression#as}. + * + * Example: + * + * ```typescript + * // Get a list of unique author names in uppercase and genre combinations. + * firestore.pipeline().collection("books") + * .distinct(toUppercase(field("author")).as("authorName"), field("genre"), "publishedAt") + * .select("authorName"); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + distinct(options: DistinctStageOptions): Pipeline; + distinct( + groupOrOptions: string | Selectable | DistinctStageOptions, + ...additionalGroups: Array ): Pipeline { - return this._addStage( - new Distinct( - this.readUserData( - 'distinct', - this.selectablesToMap([group, ...additionalGroups]) - ) - ) + // Process argument union(s) from method overloads + const options = + isString(groupOrOptions) || isSelectable(groupOrOptions) + ? {} + : groupOrOptions; + const groups: Array = + isString(groupOrOptions) || isSelectable(groupOrOptions) + ? [groupOrOptions, ...additionalGroups] + : groupOrOptions.groups; + + // Convert user land convenience types to internal types + const convertedGroups: Map = selectablesToMap(groups); + + // Create stage object + const stage = new Distinct(convertedGroups, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'distinct' ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** * Performs aggregation operations on the documents from previous stages. * *

      This stage allows you to calculate aggregate values over a set of documents. You define the - * aggregations to perform using {@link AggregateWithAlias} expressions which are typically results of - * calling {@link Expr#as} on {@link AggregateFunction} instances. + * aggregations to perform using {@link AliasedAggregate} expressions which are typically results of + * calling {@link Expression#as} on {@link AggregateFunction} instances. * *

      Example: * @@ -399,15 +749,15 @@ export class Pipeline implements ProtoSerializable { * ); * ``` * - * @param accumulator The first {@link AggregateWithAlias}, wrapping an {@link AggregateFunction} + * @param accumulator The first {@link AliasedAggregate}, wrapping an {@link AggregateFunction} * and providing a name for the accumulated results. - * @param additionalAccumulators Optional additional {@link AggregateWithAlias}, each wrapping an {@link AggregateFunction} + * @param additionalAccumulators Optional additional {@link AliasedAggregate}, each wrapping an {@link AggregateFunction} * and providing a name for the accumulated results. * @return A new Pipeline object with this stage appended to the stage list. */ aggregate( - accumulator: AggregateWithAlias, - ...additionalAccumulators: AggregateWithAlias[] + accumulator: AliasedAggregate, + ...additionalAccumulators: AliasedAggregate[] ): Pipeline; /** * Performs optionally grouped aggregation operations on the documents from previous stages. @@ -421,8 +771,8 @@ export class Pipeline implements ProtoSerializable { * If no grouping fields are provided, a single group containing all documents is used. Not * specifying groups is the same as putting the entire inputs into one group.

    • *
    • **Accumulators:** One or more accumulation operations to perform within each group. These - * are defined using {@link AggregateWithAlias} expressions, which are typically created by - * calling {@link Expr#as} on {@link AggregateFunction} instances. Each aggregation + * are defined using {@link AliasedAggregate} expressions, which are typically created by + * calling {@link Expression#as} on {@link AggregateFunction} instances. Each aggregation * calculates a value (e.g., sum, average, count) based on the documents within its group.
    • *
    * @@ -437,79 +787,106 @@ export class Pipeline implements ProtoSerializable { * }); * ``` * - * @param options An object that specifies the accumulators - * and optional grouping fields to perform. + * @param options - An object that specifies required and optional parameters for the stage. * @return A new {@code Pipeline} object with this stage appended to the stage * list. */ - aggregate(options: { - accumulators: AggregateWithAlias[]; - groups?: Array; - }): Pipeline; + aggregate(options: AggregateStageOptions): Pipeline; aggregate( - optionsOrTarget: - | AggregateWithAlias - | { - accumulators: AggregateWithAlias[]; - groups?: Array; - }, - ...rest: AggregateWithAlias[] + targetOrOptions: AliasedAggregate | AggregateStageOptions, + ...rest: AliasedAggregate[] ): Pipeline { - if ('accumulators' in optionsOrTarget) { - return this._addStage( - new Aggregate( - new Map( - optionsOrTarget.accumulators.map((target: AggregateWithAlias) => { - this.readUserData( - 'aggregate', - target as unknown as AggregateWithAlias - ); - return [ - (target as unknown as AggregateWithAlias).alias, - (target as unknown as AggregateWithAlias).aggregate - ]; - }) - ), - this.readUserData( - 'aggregate', - this.selectablesToMap(optionsOrTarget.groups || []) - ) - ) - ); - } else { - return this._addStage( - new Aggregate( - new Map( - [optionsOrTarget, ...rest].map(target => [ - (target as unknown as AggregateWithAlias).alias, - this.readUserData( - 'aggregate', - (target as unknown as AggregateWithAlias).aggregate - ) - ]) - ), - new Map() - ) - ); - } - } + // Process argument union(s) from method overloads + const options = isAliasedAggregate(targetOrOptions) ? {} : targetOrOptions; + const accumulators: AliasedAggregate[] = isAliasedAggregate(targetOrOptions) + ? [targetOrOptions, ...rest] + : targetOrOptions.accumulators; + const groups: Array = isAliasedAggregate( + targetOrOptions + ) + ? [] + : targetOrOptions.groups ?? []; - findNearest(options: FindNearestOptions): Pipeline { + // Convert user land convenience types to internal types + const convertedAccumulators: Map = + aliasedAggregateToMap(accumulators); + const convertedGroups: Map = selectablesToMap(groups); + + // Create stage object + const stage = new Aggregate( + convertedGroups, + convertedAccumulators, + options + ); + + // User data must be read in the context of the API method to + // provide contextual errors const parseContext = this.userDataReader.createContext( UserDataSource.Argument, - 'findNearest' + 'aggregate' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); + } + + /** + * Performs a vector proximity search on the documents from the previous stage, returning the + * K-nearest documents based on the specified query `vectorValue` and `distanceMeasure`. The + * returned documents will be sorted in order from nearest to furthest from the query `vectorValue`. + * + *

    Example: + * + * ```typescript + * // Find the 10 most similar books based on the book description. + * const bookDescription = "Lorem ipsum..."; + * const queryVector: number[] = ...; // compute embedding of `bookDescription` + * + * firestore.pipeline().collection("books") + * .findNearest({ + * field: 'embedding', + * vectorValue: queryVector, + * distanceMeasure: 'euclidean', + * limit: 10, // optional + * distanceField: 'computedDistance' // optional + * }); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + findNearest(options: FindNearestStageOptions): Pipeline { + // Convert user land convenience types to internal types + const field = toField(options.field); + const vectorValue = vectorToExpr(options.vectorValue); + const distanceField = options.distanceField + ? toField(options.distanceField) + : undefined; + const internalOptions = { + distanceField, + limit: options.limit, + rawOptions: options.rawOptions + }; + + // Create stage object + const stage = new FindNearest( + vectorValue, + field, + options.distanceMeasure, + internalOptions ); - const value = parseVectorValue(options.vectorValue, parseContext); - const vectorObjectValue = new ObjectValue(value); - return this._addStage( - new FindNearest( - options.field instanceof Field ? options.field : field(options.field), - vectorObjectValue, - options.distanceMeasure, - options.limit, - options.distanceField - ) + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'addFields' ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -537,11 +914,55 @@ export class Pipeline implements ProtoSerializable { * @param additionalOrderings Optional additional {@link Ordering} instances specifying the additional sorting criteria. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline { - // Ordering object - return this._addStage( - new Sort(this.readUserData('sort', [ordering, ...additionalOrderings])) + sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline; + /** + * Sorts the documents from previous stages based on one or more {@link Ordering} criteria. + * + *

    This stage allows you to order the results of your pipeline. You can specify multiple {@link + * Ordering} instances to sort by multiple fields in ascending or descending order. If documents + * have the same value for a field used for sorting, the next specified ordering will be used. If + * all orderings result in equal comparison, the documents are considered equal and the order is + * unspecified. + * + *

    Example: + * + * ```typescript + * // Sort books by rating in descending order, and then by title in ascending order for books + * // with the same rating + * firestore.pipeline().collection("books") + * .sort( + * Ordering.of(field("rating")).descending(), + * Ordering.of(field("title")) // Ascending order is the default + * ); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + sort(options: SortStageOptions): Pipeline; + sort( + orderingOrOptions: Ordering | SortStageOptions, + ...additionalOrderings: Ordering[] + ): Pipeline { + // Process argument union(s) from method overloads + const options = isOrdering(orderingOrOptions) ? {} : orderingOrOptions; + const orderings: Ordering[] = isOrdering(orderingOrOptions) + ? [orderingOrOptions, ...additionalOrderings] + : orderingOrOptions.orderings; + + // Create stage object + const stage = new Sort(orderings, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'sort' ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -576,7 +997,6 @@ export class Pipeline implements ProtoSerializable { * @return A new {@code Pipeline} object with this stage appended to the stage list. */ replaceWith(fieldName: string): Pipeline; - /** * Fully overwrites all fields in a document with those coming from a map. * @@ -610,14 +1030,74 @@ export class Pipeline implements ProtoSerializable { * // } * ``` * - * @param expr An {@link Expr} that when returned evaluates to a map. + * @param expr An {@link Expression} that when returned evaluates to a map. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - replaceWith(expr: Expr): Pipeline; - replaceWith(value: Expr | string): Pipeline { - const fieldExpr = typeof value === 'string' ? field(value) : value; - this.readUserData('replaceWith', fieldExpr); - return this._addStage(new Replace(fieldExpr, 'full_replace')); + replaceWith(expr: Expression): Pipeline; + /** + * Fully overwrites all fields in a document with those coming from a map. + * + *

    This stage allows you to emit a map value as a document. Each key of the map becomes a field + * on the document that contains the corresponding value. + * + *

    Example: + * + * ```typescript + * // Input. + * // { + * // 'name': 'John Doe Jr.', + * // 'parents': { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * // } + * + * // Emit parents as document. + * firestore.pipeline().collection('people').replaceWith(map({ + * foo: 'bar', + * info: { + * name: field('name') + * } + * })); + * + * // Output + * // { + * // 'father': 'John Doe Sr.', + * // 'mother': 'Jane Doe' + * // } + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + replaceWith(options: ReplaceWithStageOptions): Pipeline; + replaceWith( + valueOrOptions: Expression | string | ReplaceWithStageOptions + ): Pipeline { + // Process argument union(s) from method overloads + const options = + isString(valueOrOptions) || isExpr(valueOrOptions) ? {} : valueOrOptions; + const fieldNameOrExpr: string | Expression = + isString(valueOrOptions) || isExpr(valueOrOptions) + ? valueOrOptions + : valueOrOptions.map; + + // Convert user land convenience types to internal types + const mapExpr = fieldOrExpression(fieldNameOrExpr); + + // Create stage object + const stage = new Replace(mapExpr, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'replaceWith' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -655,24 +1135,39 @@ export class Pipeline implements ProtoSerializable { * firestore.pipeline().collection("books") * .sample({ percentage: 0.5 }); * - * @param options The {@code SampleOptions} specifies how sampling is performed. + * @param options - An object that specifies required and optional parameters for the stage. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - sample(options: { percentage: number } | { documents: number }): Pipeline; - sample( - documentsOrOptions: number | { percentage: number } | { documents: number } - ): Pipeline { - if (typeof documentsOrOptions === 'number') { - return this._addStage(new Sample(documentsOrOptions, 'documents')); - } else if ('percentage' in documentsOrOptions) { - return this._addStage( - new Sample(documentsOrOptions.percentage, 'percent') - ); + sample(options: SampleStageOptions): Pipeline; + sample(documentsOrOptions: number | SampleStageOptions): Pipeline { + // Process argument union(s) from method overloads + const options = isNumber(documentsOrOptions) ? {} : documentsOrOptions; + let rate: number; + let mode: 'documents' | 'percent'; + if (isNumber(documentsOrOptions)) { + rate = documentsOrOptions; + mode = 'documents'; + } else if (isNumber(documentsOrOptions.documents)) { + rate = documentsOrOptions.documents; + mode = 'documents'; } else { - return this._addStage( - new Sample(documentsOrOptions.documents, 'documents') - ); + rate = documentsOrOptions.percentage!; + mode = 'percent'; } + + // Create stage object + const stage = new Sample(rate, mode, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'sample' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -693,8 +1188,50 @@ export class Pipeline implements ProtoSerializable { * @param other The other {@code Pipeline} that is part of union. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - union(other: Pipeline): Pipeline { - return this._addStage(new Union(other)); + union(other: Pipeline): Pipeline; + /** + * Performs union of all documents from two pipelines, including duplicates. + * + *

    This stage will pass through documents from previous stage, and also pass through documents + * from previous stage of the `other` {@code Pipeline} given in parameter. The order of documents + * emitted from this stage is undefined. + * + *

    Example: + * + * ```typescript + * // Emit documents from books collection and magazines collection. + * firestore.pipeline().collection('books') + * .union(firestore.pipeline().collection('magazines')); + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + union(options: UnionStageOptions): Pipeline; + union(otherOrOptions: Pipeline | UnionStageOptions): Pipeline { + // Process argument union(s) from method overloads + let options: {}; + let otherPipeline: Pipeline; + if (isPipeline(otherOrOptions)) { + options = {}; + otherPipeline = otherOrOptions; + } else { + ({ other: otherPipeline, ...options } = otherOrOptions); + } + + // Create stage object + const stage = new Union(otherPipeline, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'union' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -729,64 +1266,133 @@ export class Pipeline implements ProtoSerializable { * @param indexField An optional string value specifying the field path to write the offset (starting at zero) into the array the un-nested element is from * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - unnest(selectable: Selectable, indexField?: string): Pipeline { - this.readUserData('unnest', selectable.expr); - - const alias = field(selectable.alias); - this.readUserData('unnest', alias); - - if (indexField) { - return this._addStage( - new Unnest(selectable.expr, alias, field(indexField)) - ); + unnest(selectable: Selectable, indexField?: string): Pipeline; + /** + * Produces a document for each element in an input array. + * + * For each previous stage document, this stage will emit zero or more augmented documents. The + * input array specified by the `selectable` parameter, will emit an augmented document for each input array element. The input array element will + * augment the previous stage document by setting the `alias` field with the array element value. + * + * When `selectable` evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for + * the current input document, returning it as is with the `alias` field absent. + * + * No documents are emitted when `selectable` evaluates to an empty array. + * + * Example: + * + * ```typescript + * // Input: + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tags": [ "comedy", "space", "adventure" ], ... } + * + * // Emit a book document for each tag of the book. + * firestore.pipeline().collection("books") + * .unnest(field("tags").as('tag'), 'tagIndex'); + * + * // Output: + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "comedy", "tagIndex": 0, ... } + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "space", "tagIndex": 1, ... } + * // { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "adventure", "tagIndex": 2, ... } + * ``` + * + * @param options - An object that specifies required and optional parameters for the stage. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + unnest(options: UnnestStageOptions): Pipeline; + unnest( + selectableOrOptions: Selectable | UnnestStageOptions, + indexField?: string + ): Pipeline { + // Process argument union(s) from method overloads + let options: { indexField?: Field } & StageOptions; + let selectable: Selectable; + let indexFieldName: string | undefined; + if (isSelectable(selectableOrOptions)) { + options = {}; + selectable = selectableOrOptions; + indexFieldName = indexField; } else { - return this._addStage(new Unnest(selectable.expr, alias)); + ({ + selectable, + indexField: indexFieldName, + ...options + } = selectableOrOptions); + } + + // Convert user land convenience types to internal types + const alias = selectable.alias; + const expr = selectable.expr as Expression; + if (isString(indexFieldName)) { + options.indexField = _field(indexFieldName, 'unnest'); } + + // Create stage object + const stage = new Unnest(alias, expr, options); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'unnest' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** - * Adds a generic stage to the pipeline. + * Adds a raw stage to the pipeline. * *

    This method provides a flexible way to extend the pipeline's functionality by adding custom - * stages. Each generic stage is defined by a unique `name` and a set of `params` that control its + * stages. Each raw stage is defined by a unique `name` and a set of `params` that control its * behavior. * - *

    Example (Assuming there is no "where" stage available in SDK): + *

    Example (Assuming there is no 'where' stage available in SDK): * * ```typescript - * // Assume we don't have a built-in "where" stage - * firestore.pipeline().collection("books") - * .genericStage("where", [field("published").lt(1900)]) // Custom "where" stage - * .select("title", "author"); + * // Assume we don't have a built-in 'where' stage + * firestore.pipeline().collection('books') + * .rawStage('where', [field('published').lt(1900)]) // Custom 'where' stage + * .select('title', 'author'); * ``` * - * @param name The unique name of the generic stage to add. - * @param params A list of parameters to configure the generic stage's behavior. + * @param name - The unique name of the raw stage to add. + * @param params - A list of parameters to configure the raw stage's behavior. + * @param options - An object of key value pairs that specifies optional parameters for the stage. * @return A new {@code Pipeline} object with this stage appended to the stage list. */ - genericStage(name: string, params: unknown[]): Pipeline { - // Convert input values to Expressions. - // We treat objects as mapValues and arrays as arrayValues, - // this is unlike the default conversion for objects and arrays - // passed to an expression. + rawStage( + name: string, + params: unknown[], + options?: { [key: string]: Expression | unknown } + ): Pipeline { + // Convert user land convenience types to internal types const expressionParams = params.map((value: unknown) => { - if (value instanceof Expr) { + if (value instanceof Expression) { return value; } else if (value instanceof AggregateFunction) { return value; } else if (isPlainObject(value)) { return _mapValue(value as Record); } else { - return new Constant(value); + return _constant(value, 'rawStage'); } }); - expressionParams.forEach(param => { - if (isReadableUserData(param)) { - param._readUserData(this.userDataReader); - } - }); - return this._addStage(new GenericStage(name, expressionParams)); + // Create stage object + const stage = new RawStage(name, expressionParams, options ?? {}); + + // User data must be read in the context of the API method to + // provide contextual errors + const parseContext = this.userDataReader.createContext( + UserDataSource.Argument, + 'rawStage' + ); + stage._readUserData(parseContext); + + // Add stage to the pipeline + return this._addStage(stage); } /** @@ -811,47 +1417,6 @@ export class Pipeline implements ProtoSerializable { ); } - private selectablesToMap( - selectables: Array - ): Map { - const result = new Map(); - for (const selectable of selectables) { - if (typeof selectable === 'string') { - result.set(selectable as string, field(selectable)); - } else if (selectable instanceof Field) { - result.set(selectable.alias, selectable.expr); - } else if (selectable instanceof ExprWithAlias) { - result.set(selectable.alias, selectable.expr); - } - } - return result; - } - - /** - * Reads user data for each expression in the expressionMap. - * @param name Name of the calling function. Used for error messages when invalid user data is encountered. - * @param expressionMap - * @return the expressionMap argument. - * @private - */ - private readUserData< - T extends - | Map - | ReadableUserData[] - | ReadableUserData - >(name: string, expressionMap: T): T { - if (isReadableUserData(expressionMap)) { - expressionMap._readUserData(this.userDataReader); - } else if (Array.isArray(expressionMap)) { - expressionMap.forEach(readableData => - readableData._readUserData(this.userDataReader) - ); - } else { - expressionMap.forEach(expr => expr._readUserData(this.userDataReader)); - } - return expressionMap; - } - /** * @internal * @private @@ -870,3 +1435,7 @@ export class Pipeline implements ProtoSerializable { return new Pipeline(db, userDataReader, userDataWriter, stages); } } + +export function isPipeline(val: unknown): val is Pipeline { + return val instanceof Pipeline; +} diff --git a/packages/firestore/src/lite-api/pipeline_impl.ts b/packages/firestore/src/lite-api/pipeline_impl.ts index c1ca940a56b..397e27bc1b4 100644 --- a/packages/firestore/src/lite-api/pipeline_impl.ts +++ b/packages/firestore/src/lite-api/pipeline_impl.ts @@ -15,6 +15,10 @@ * limitations under the License. */ +import { + StructuredPipeline, + StructuredPipelineOptions +} from '../core/structured_pipeline'; import { invokeExecutePipeline } from '../remote/datastore'; import { getDatastore } from './components'; @@ -25,7 +29,11 @@ import { PipelineSource } from './pipeline-source'; import { DocumentReference } from './reference'; import { LiteUserDataWriter } from './reference_impl'; import { Stage } from './stage'; -import { newUserDataReader } from './user_data_reader'; +import { + newUserDataReader, + UserDataReader, + UserDataSource +} from './user_data_reader'; declare module './database' { interface Firestore { @@ -69,7 +77,22 @@ declare module './database' { */ export function execute(pipeline: Pipeline): Promise { const datastore = getDatastore(pipeline._db); - return invokeExecutePipeline(datastore, pipeline).then(result => { + + const udr = new UserDataReader( + pipeline._db._databaseId, + /* ignoreUndefinedProperties */ true + ); + const context = udr.createContext(UserDataSource.Argument, 'execute'); + + const structuredPipelineOptions = new StructuredPipelineOptions({}, {}); + structuredPipelineOptions._readUserData(context); + + const structuredPipeline: StructuredPipeline = new StructuredPipeline( + pipeline, + structuredPipelineOptions + ); + + return invokeExecutePipeline(datastore, structuredPipeline).then(result => { // Get the execution time from the first result. // firestoreClientExecutePipeline returns at least one PipelineStreamElement // even if the returned document set is empty. @@ -84,10 +107,10 @@ export function execute(pipeline: Pipeline): Promise { element => new PipelineResult( pipeline._userDataWriter, + element.fields!, element.key?.path ? new DocumentReference(pipeline._db, null, element.key) : undefined, - element.fields, element.createTime?.toTimestamp(), element.updateTime?.toTimestamp() ) @@ -100,7 +123,11 @@ export function execute(pipeline: Pipeline): Promise { Firestore.prototype.pipeline = function (): PipelineSource { const userDataWriter = new LiteUserDataWriter(this); const userDataReader = newUserDataReader(this); - return new PipelineSource(this._databaseId, (stages: Stage[]) => { - return new Pipeline(this, userDataReader, userDataWriter, stages); - }); + return new PipelineSource( + this._databaseId, + userDataReader, + (stages: Stage[]) => { + return new Pipeline(this, userDataReader, userDataWriter, stages); + } + ); }; diff --git a/packages/firestore/src/lite-api/pipeline_options.ts b/packages/firestore/src/lite-api/pipeline_options.ts new file mode 100644 index 00000000000..f464428fd64 --- /dev/null +++ b/packages/firestore/src/lite-api/pipeline_options.ts @@ -0,0 +1,78 @@ +/** + * @license + * Copyright 2025 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 type { Pipeline } from './pipeline'; + +/** + * Options defining Pipeline execution. + */ +export interface PipelineExecuteOptions { + /** + * Pipeline to be evaluated. + */ + pipeline: Pipeline; + + /** + * Specify the index mode. + */ + indexMode?: 'recommended'; + + /** + * An escape hatch to set options not known at SDK build time. These values + * will be passed directly to the Firestore backend and not used by the SDK. + * + * The option name will be used as provided. And must match the name + * format used by the backend (hint: use a snake_case_name). + * + * Custom option values can be any type supported + * by Firestore (for example: string, boolean, number, map, …). Value types + * not known to the SDK will be rejected. + * + * Values specified in rawOptions will take precedence over any options + * with the same name set by the SDK. + * + * Override the `example_option`: + * ``` + * execute({ + * pipeline: myPipeline, + * rawOptions: { + * // Override `example_option`. This will not + * // merge with the existing `example_option` object. + * "example_option": { + * foo: "bar" + * } + * } + * } + * ``` + * + * `rawOptions` supports dot notation, if you want to override + * a nested option. + * ``` + * execute({ + * pipeline: myPipeline, + * rawOptions: { + * // Override `example_option.foo` and do not override + * // any other properties of `example_option`. + * "example_option.foo": "bar" + * } + * } + * ``` + */ + rawOptions?: { + [name: string]: unknown; + }; +} diff --git a/packages/firestore/src/lite-api/query.ts b/packages/firestore/src/lite-api/query.ts index f0a357b828c..f019f0d0936 100644 --- a/packages/firestore/src/lite-api/query.ts +++ b/packages/firestore/src/lite-api/query.ts @@ -52,8 +52,9 @@ import { import { FieldPath } from './field_path'; import { DocumentData, DocumentReference, Query } from './reference'; -import { DocumentSnapshot, fieldPathFromArgument } from './snapshot'; +import { DocumentSnapshot } from './snapshot'; import { + fieldPathFromArgument, newUserDataReader, parseQueryValue, UserDataReader diff --git a/packages/firestore/src/lite-api/reference.ts b/packages/firestore/src/lite-api/reference.ts index e6c5fd7b056..43eedecf8b4 100644 --- a/packages/firestore/src/lite-api/reference.ts +++ b/packages/firestore/src/lite-api/reference.ts @@ -440,6 +440,12 @@ export class CollectionReference< } } +export function isCollectionReference( + val: unknown +): val is CollectionReference { + return val instanceof CollectionReference; +} + /** * Gets a `CollectionReference` instance that refers to the collection at * the specified absolute path. diff --git a/packages/firestore/src/lite-api/snapshot.ts b/packages/firestore/src/lite-api/snapshot.ts index 66c3a1422e9..ba7b08cf9dd 100644 --- a/packages/firestore/src/lite-api/snapshot.ts +++ b/packages/firestore/src/lite-api/snapshot.ts @@ -15,15 +15,13 @@ * limitations under the License. */ -import { Compat, getModularInstance } from '@firebase/util'; +import { getModularInstance } from '@firebase/util'; import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; -import { FieldPath as InternalFieldPath } from '../model/path'; import { arrayEquals } from '../util/misc'; import { Firestore } from './database'; -import { Field } from './expressions'; import { FieldPath } from './field_path'; import { DocumentData, @@ -35,7 +33,7 @@ import { WithFieldValue } from './reference'; import { - fieldPathFromDotSeparatedString, + fieldPathFromArgument, UntypedFirestoreDataConverter } from './user_data_reader'; import { AbstractUserDataWriter } from './user_data_writer'; @@ -510,21 +508,3 @@ export function snapshotEqual( return false; } - -/** - * Helper that calls `fromDotSeparatedString()` but wraps any error thrown. - */ -export function fieldPathFromArgument( - methodName: string, - arg: string | FieldPath | Compat | Field -): InternalFieldPath { - if (typeof arg === 'string') { - return fieldPathFromDotSeparatedString(methodName, arg); - } else if (arg instanceof FieldPath) { - return arg._internalPath; - } else if (arg instanceof Field) { - return fieldPathFromDotSeparatedString(methodName, arg.fieldName()); - } else { - return arg._delegate._internalPath; - } -} diff --git a/packages/firestore/src/lite-api/stage.ts b/packages/firestore/src/lite-api/stage.ts index 31faaa00e76..5dd30eedba7 100644 --- a/packages/firestore/src/lite-api/stage.ts +++ b/packages/firestore/src/lite-api/stage.ts @@ -15,10 +15,12 @@ * limitations under the License. */ -import { ObjectValue } from '../model/object_value'; +import { ParseContext } from '../api/parse_context'; +import { OptionsUtil } from '../core/options_util'; import { - Stage as ProtoStage, - Value as ProtoValue + ApiClientObjectMap, + firestoreV1ApiClientInterfaces, + Stage as ProtoStage } from '../protos/firestore_proto_api'; import { toNumber } from '../remote/number_serializer'; import { @@ -32,50 +34,98 @@ import { hardAssert } from '../util/assert'; import { AggregateFunction, - Expr, + BooleanExpression, + Expression, Field, - BooleanExpr, - Ordering, - field + field, + Ordering } from './expressions'; import { Pipeline } from './pipeline'; -import { DocumentReference } from './reference'; -import { VectorValue } from './vector_value'; +import { StageOptions } from './stage_options'; +import { isUserData, UserData } from './user_data_reader'; /** * @beta */ -export interface Stage extends ProtoSerializable { - name: string; +export abstract class Stage implements ProtoSerializable, UserData { + /** + * Store optionsProto parsed by _readUserData. + * @private + * @internal + * @protected + */ + protected optionsProto: + | ApiClientObjectMap + | undefined = undefined; + protected knownOptions: Record; + protected rawOptions?: Record; + + constructor(options: StageOptions) { + ({ rawOptions: this.rawOptions, ...this.knownOptions } = options); + } + + _readUserData(context: ParseContext): void { + this.optionsProto = this._optionsUtil.getOptionsProto( + context, + this.knownOptions, + this.rawOptions + ); + } + + _toProto(_: JsonProtoSerializer): ProtoStage { + return { + name: this._name, + options: this.optionsProto + }; + } + + abstract get _optionsUtil(): OptionsUtil; + abstract get _name(): string; } /** * @beta */ -export class AddFields implements Stage { - name = 'add_fields'; +export class AddFields extends Stage { + get _name(): string { + return 'add_fields'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private fields: Map) {} + constructor(private fields: Map, options: StageOptions) { + super(options); + } - /** - * @internal - * @private - */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [toMapValue(serializer, this.fields)] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.fields, context); + } } /** * @beta */ -export class RemoveFields implements Stage { - name = 'remove_fields'; +export class RemoveFields extends Stage { + get _name(): string { + return 'remove_fields'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private fields: Field[]) {} + constructor(private fields: Field[], options: StageOptions) { + super(options); + } /** * @internal @@ -83,22 +133,36 @@ export class RemoveFields implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: this.fields.map(f => f._toProto(serializer)) }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.fields, context); + } } /** * @beta */ -export class Aggregate implements Stage { - name = 'aggregate'; +export class Aggregate extends Stage { + get _name(): string { + return 'aggregate'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } constructor( + private groups: Map, private accumulators: Map, - private groups: Map - ) {} + options: StageOptions + ) { + super(options); + } /** * @internal @@ -106,22 +170,36 @@ export class Aggregate implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [ toMapValue(serializer, this.accumulators), toMapValue(serializer, this.groups) ] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.groups, context); + readUserDataHelper(this.accumulators, context); + } } /** * @beta */ -export class Distinct implements Stage { - name = 'distinct'; +export class Distinct extends Stage { + get _name(): string { + return 'distinct'; + } - constructor(private groups: Map) {} + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } + + constructor(private groups: Map, options: StageOptions) { + super(options); + } /** * @internal @@ -129,22 +207,42 @@ export class Distinct implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [toMapValue(serializer, this.groups)] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.groups, context); + } } /** * @beta */ -export class CollectionSource implements Stage { - name = 'collection'; +export class CollectionSource extends Stage { + get _name(): string { + return 'collection'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({ + forceIndex: { + serverName: 'force_index' + } + }); + } + + private formattedCollectionPath: string; + + constructor(collection: string, options: StageOptions) { + super(options); - constructor(private collectionPath: string) { - if (!this.collectionPath.startsWith('/')) { - this.collectionPath = '/' + this.collectionPath; - } + // prepend slash to collection string + this.formattedCollectionPath = collection.startsWith('/') + ? collection + : '/' + collection; } /** @@ -153,19 +251,35 @@ export class CollectionSource implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [{ referenceValue: this.collectionPath }] + ...super._toProto(serializer), + args: [{ referenceValue: this.formattedCollectionPath }] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class CollectionGroupSource implements Stage { - name = 'collection_group'; +export class CollectionGroupSource extends Stage { + get _name(): string { + return 'collection_group'; + } - constructor(private collectionId: string) {} + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({ + forceIndex: { + serverName: 'force_index' + } + }); + } + + constructor(private collectionId: string, options: StageOptions) { + super(options); + } /** * @internal @@ -173,17 +287,26 @@ export class CollectionGroupSource implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [{ referenceValue: '' }, { stringValue: this.collectionId }] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class DatabaseSource implements Stage { - name = 'database'; +export class DatabaseSource extends Stage { + get _name(): string { + return 'database'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } /** * @internal @@ -191,28 +314,33 @@ export class DatabaseSource implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name + ...super._toProto(serializer) }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class DocumentsSource implements Stage { - name = 'documents'; - - constructor(private docPaths: string[]) {} - - static of(refs: Array): DocumentsSource { - return new DocumentsSource( - refs.map(ref => - ref instanceof DocumentReference - ? '/' + ref.path - : ref.startsWith('/') - ? ref - : '/' + ref - ) +export class DocumentsSource extends Stage { + get _name(): string { + return 'documents'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } + + private formattedPaths: string[]; + + constructor(docPaths: string[], options: StageOptions) { + super(options); + this.formattedPaths = docPaths.map(path => + path.startsWith('/') ? path : '/' + path ); } @@ -222,21 +350,32 @@ export class DocumentsSource implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: this.docPaths.map(p => { + ...super._toProto(serializer), + args: this.formattedPaths.map(p => { return { referenceValue: p }; }) }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class Where implements Stage { - name = 'where'; +export class Where extends Stage { + get _name(): string { + return 'where'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private condition: BooleanExpr) {} + constructor(private condition: BooleanExpression, options: StageOptions) { + super(options); + } /** * @internal @@ -244,87 +383,85 @@ export class Where implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [(this.condition as unknown as Expr)._toProto(serializer)] + ...super._toProto(serializer), + args: [this.condition._toProto(serializer)] }; } -} -/** - * @beta - */ -export interface FindNearestOptions { - field: Field | string; - vectorValue: VectorValue | number[]; - distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; - limit?: number; - distanceField?: string; + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.condition, context); + } } /** * @beta */ -export class FindNearest implements Stage { - name = 'find_nearest'; +export class FindNearest extends Stage { + get _name(): string { + return 'find_nearest'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({ + limit: { + serverName: 'limit' + }, + distanceField: { + serverName: 'distance_field' + } + }); + } - /** - * @private - * @internal - * - * @param _field - * @param _vectorValue - * @param _distanceMeasure - * @param _limit - * @param _distanceField - */ constructor( - private _field: Field, - private _vectorValue: ObjectValue, - private _distanceMeasure: 'euclidean' | 'cosine' | 'dot_product', - private _limit?: number, - private _distanceField?: string - ) {} + private vectorValue: Expression, + private field: Field, + private distanceMeasure: 'euclidean' | 'cosine' | 'dot_product', + options: StageOptions + ) { + super(options); + } /** * @private * @internal */ _toProto(serializer: JsonProtoSerializer): ProtoStage { - const options: { [k: string]: ProtoValue } = {}; - - if (this._limit) { - options.limit = toNumber(serializer, this._limit)!; - } - - if (this._distanceField) { - // eslint-disable-next-line camelcase - options.distance_field = field(this._distanceField)._toProto(serializer); - } - return { - name: this.name, + ...super._toProto(serializer), args: [ - this._field._toProto(serializer), - this._vectorValue.value, - toStringValue(this._distanceMeasure) - ], - options + this.field._toProto(serializer), + this.vectorValue._toProto(serializer), + toStringValue(this.distanceMeasure) + ] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.vectorValue, context); + readUserDataHelper(this.field, context); + } } /** * @beta */ -export class Limit implements Stage { - name = 'limit'; +export class Limit extends Stage { + get _name(): string { + return 'limit'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(readonly limit: number) { + constructor(private limit: number, options: StageOptions) { hardAssert( !isNaN(limit) && limit !== Infinity && limit !== -Infinity, 0x882c, 'Invalid limit value' ); + super(options); } /** @@ -333,7 +470,7 @@ export class Limit implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [toNumber(serializer, this.limit)] }; } @@ -342,10 +479,17 @@ export class Limit implements Stage { /** * @beta */ -export class Offset implements Stage { - name = 'offset'; +export class Offset extends Stage { + get _name(): string { + return 'offset'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private offset: number) {} + constructor(private offset: number, options: StageOptions) { + super(options); + } /** * @internal @@ -353,7 +497,7 @@ export class Offset implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, + ...super._toProto(serializer), args: [toNumber(serializer, this.offset)] }; } @@ -362,10 +506,20 @@ export class Offset implements Stage { /** * @beta */ -export class Select implements Stage { - name = 'select'; +export class Select extends Stage { + get _name(): string { + return 'select'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private projections: Map) {} + constructor( + private selections: Map, + options: StageOptions + ) { + super(options); + } /** * @internal @@ -373,19 +527,32 @@ export class Select implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [toMapValue(serializer, this.projections)] + ...super._toProto(serializer), + args: [toMapValue(serializer, this.selections)] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.selections, context); + } } /** * @beta */ -export class Sort implements Stage { - name = 'sort'; +export class Sort extends Stage { + get _name(): string { + return 'sort'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private orders: Ordering[]) {} + constructor(private orderings: Ordering[], options: StageOptions) { + super(options); + } /** * @internal @@ -393,105 +560,162 @@ export class Sort implements Stage { */ _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: this.orders.map(o => o._toProto(serializer)) + ...super._toProto(serializer), + args: this.orderings.map(o => o._toProto(serializer)) }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.orderings, context); + } } /** * @beta */ -export class Sample implements Stage { - name = 'sample'; +export class Sample extends Stage { + get _name(): string { + return 'sample'; + } + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } - constructor(private limit: number, private mode: string) {} + constructor( + private rate: number, + private mode: 'percent' | 'documents', + options: StageOptions + ) { + super(options); + } _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [toNumber(serializer, this.limit)!, toStringValue(this.mode)!] + ...super._toProto(serializer), + args: [toNumber(serializer, this.rate)!, toStringValue(this.mode)!] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class Union implements Stage { - name = 'union'; +export class Union extends Stage { + get _name(): string { + return 'union'; + } - constructor(private _other: Pipeline) {} + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } + + constructor(private other: Pipeline, options: StageOptions) { + super(options); + } _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [toPipelineValue(this._other._toProto(serializer))] + ...super._toProto(serializer), + args: [toPipelineValue(this.other._toProto(serializer))] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + } } /** * @beta */ -export class Unnest implements Stage { - name = 'unnest'; +export class Unnest extends Stage { + get _name(): string { + return 'unnest'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({ + indexField: { + serverName: 'index_field' + } + }); + } + constructor( - private expr: Expr, - private alias: Field, - private indexField?: Field - ) {} + private alias: string, + private expr: Expression, + options: StageOptions + ) { + super(options); + } _toProto(serializer: JsonProtoSerializer): ProtoStage { - const stageProto: ProtoStage = { - name: this.name, - args: [this.expr._toProto(serializer), this.alias._toProto(serializer)] + return { + ...super._toProto(serializer), + args: [ + this.expr._toProto(serializer), + field(this.alias)._toProto(serializer) + ] }; + } - if (this.indexField) { - stageProto.options = { - ['index_field']: this.indexField._toProto(serializer) - }; - } - - return stageProto; + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.expr, context); } } /** * @beta */ -export class Replace implements Stage { - name = 'replace_with'; +export class Replace extends Stage { + static readonly MODE = 'full_replace'; - constructor( - private field: Expr, - private mode: - | 'full_replace' - | 'merge_prefer_nest' - | 'merge_prefer_parent' = 'full_replace' - ) {} + get _name(): string { + return 'replace_with'; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } + + constructor(private map: Expression, options: StageOptions) { + super(options); + } _toProto(serializer: JsonProtoSerializer): ProtoStage { return { - name: this.name, - args: [this.field._toProto(serializer), toStringValue(this.mode)] + ...super._toProto(serializer), + args: [this.map._toProto(serializer), toStringValue(Replace.MODE)] }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.map, context); + } } /** * @beta */ -export class GenericStage implements Stage { +export class RawStage extends Stage { /** * @private * @internal */ constructor( - public name: string, - private params: Array - ) {} + private name: string, + private params: Array, + rawOptions: Record + ) { + super({ rawOptions }); + } /** * @internal @@ -500,7 +724,41 @@ export class GenericStage implements Stage { _toProto(serializer: JsonProtoSerializer): ProtoStage { return { name: this.name, - args: this.params.map(o => o._toProto(serializer)) + args: this.params.map(o => o._toProto(serializer)), + options: this.optionsProto }; } + + _readUserData(context: ParseContext): void { + super._readUserData(context); + readUserDataHelper(this.params, context); + } + + get _name(): string { + return this.name; + } + + get _optionsUtil(): OptionsUtil { + return new OptionsUtil({}); + } +} + +/** + * Helper to read user data across a number of different formats. + * @param name Name of the calling function. Used for error messages when invalid user data is encountered. + * @param expressionMap + * @return the expressionMap argument. + * @private + */ +function readUserDataHelper< + T extends Map | UserData[] | UserData +>(expressionMap: T, context: ParseContext): T { + if (isUserData(expressionMap)) { + expressionMap._readUserData(context); + } else if (Array.isArray(expressionMap)) { + expressionMap.forEach(readableData => readableData._readUserData(context)); + } else { + expressionMap.forEach(expr => expr._readUserData(context)); + } + return expressionMap; } diff --git a/packages/firestore/src/lite-api/stage_options.ts b/packages/firestore/src/lite-api/stage_options.ts new file mode 100644 index 00000000000..828a81a2daa --- /dev/null +++ b/packages/firestore/src/lite-api/stage_options.ts @@ -0,0 +1,297 @@ +/** + * @license + * Copyright 2025 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 { OneOf } from '../util/types'; + +import { + AliasedAggregate, + BooleanExpression, + Expression, + Field, + Ordering, + Selectable +} from './expressions'; +import { Pipeline } from './pipeline'; +import { CollectionReference, DocumentReference } from './reference'; +import { VectorValue } from './vector_value'; + +/** + * Options defining how a Stage is evaluated. + */ +export interface StageOptions { + /** + * An escape hatch to set options not known at SDK build time. These values + * will be passed directly to the Firestore backend and not used by the SDK. + * + * The option name will be used as provided. And must match the name + * format used by the backend (hint: use a snake_case_name). + * + * Raw option values can be any type supported + * by Firestore (for example: string, boolean, number, map, …). Value types + * not known to the SDK will be rejected. + * + * Values specified in rawOptions will take precedence over any options + * with the same name set by the SDK. + * + * `rawOptions` supports dot notation, if you want to override + * a nested option. + */ + rawOptions?: { + [name: string]: unknown; + }; +} +/** + * Options defining how a CollectionStage is evaluated. See {@link PipelineSource.collection}. + */ +export type CollectionStageOptions = StageOptions & { + /** + * Name or reference to the collection that will be used as the Pipeline source. + */ + collection: string | CollectionReference; + + /** + * Specifies the name of an index to be used for a query, overriding the query optimizer's default choice. + * This can be useful for performance tuning in specific scenarios where the default index selection + * does not yield optimal performance. + * + * @remarks This property is optional. When provided, it should be the exact name of the index to force. + */ + forceIndex?: string; +}; + +/** + * Defines the configuration options for a {@link CollectionGroupStage} within a pipeline. + * This type extends {@link StageOptions} and provides specific settings for how a collection group + * is identified and processed during pipeline execution. + * + * @see {@link PipelineSource.collectionGroup} to create a collection group stage. + */ +export type CollectionGroupStageOptions = StageOptions & { + /** + * ID of the collection group to use as the Pipeline source. + */ + collectionId: string; + + /** + * Specifies the name of an index to be used for a query, overriding the query optimizer's default choice. + * This can be useful for performance tuning in specific scenarios where the default index selection + * does not yield optimal performance. + * + * @remarks This property is optional. When provided, it should be the exact name of the index to force. + */ + forceIndex?: string; +}; +/** + * Options defining how a DatabaseStage is evaluated. See {@link PipelineSource.database}. + */ +export type DatabaseStageOptions = StageOptions & {}; +/** + * Options defining how a DocumentsStage is evaluated. See {@link PipelineSource.documents}. + */ +export type DocumentsStageOptions = StageOptions & { + /** + * An array of paths and DocumentReferences specifying the individual documents that will be the source of this pipeline. + * The converters for these DocumentReferences will be ignored and not have an effect on this pipeline. + * There must be at least one document specified in the array. + */ + docs: Array; +}; +/** + * Options defining how an AddFieldsStage is evaluated. See {@link Pipeline.addFields}. + */ +export type AddFieldsStageOptions = StageOptions & { + /** + * The fields to add to each document, specified as a {@link Selectable}. + * At least one field is required. + */ + fields: Selectable[]; +}; +/** + * Options defining how a RemoveFieldsStage is evaluated. See {@link Pipeline.removeFields}. + */ +export type RemoveFieldsStageOptions = StageOptions & { + /** + * The fields to remove from each document. + */ + fields: Array; +}; +/** + * Options defining how a SelectStage is evaluated. See {@link Pipeline.select}. + */ +export type SelectStageOptions = StageOptions & { + /** + * The fields to include in the output documents, specified as {@link Selectable} expression + * or as a string value indicating the field name. + */ + selections: Array; +}; +/** + * Options defining how a WhereStage is evaluated. See {@link Pipeline.where}. + */ +export type WhereStageOptions = StageOptions & { + /** + * The {@link BooleanExpression} to apply as a filter for each input document to this stage. + */ + condition: BooleanExpression; +}; +/** + * Options defining how an OffsetStage is evaluated. See {@link Pipeline.offset}. + */ +export type OffsetStageOptions = StageOptions & { + /** + * The number of documents to skip. + */ + offset: number; +}; +/** + * Options defining how a LimitStage is evaluated. See {@link Pipeline.limit}. + */ +export type LimitStageOptions = StageOptions & { + /** + * The maximum number of documents to return. + */ + limit: number; +}; +/** + * Options defining how a DistinctStage is evaluated. See {@link Pipeline.distinct}. + */ +export type DistinctStageOptions = StageOptions & { + /** + * The {@link Selectable} expressions or field names to consider when determining + * distinct value combinations (groups). + */ + groups: Array; +}; + +/** + * Options defining how an AggregateStage is evaluated. See {@link Pipeline.aggregate}. + */ +export type AggregateStageOptions = StageOptions & { + /** + * The {@link AliasedAggregate} values specifying aggregate operations to + * perform on the input documents. + */ + accumulators: AliasedAggregate[]; + /** + * The {@link Selectable} expressions or field names to consider when determining + * distinct value combinations (groups), which will be aggregated over. + */ + groups?: Array; +}; +/** + * Options defining how a FindNearestStage is evaluated. See {@link Pipeline.findNearest}. + */ +export type FindNearestStageOptions = StageOptions & { + /** + * Specifies the field to be used. This can be a string representing the field path + * (e.g., 'fieldName', 'nested.fieldName') or an object of type {@link Field} + * representing a more complex field expression. + */ + field: Field | string; + /** + * Specifies the query vector value, to which the vector distance will be computed. + */ + vectorValue: VectorValue | number[]; + /** + * Specifies the method used to compute the distance between vectors. + * + * Possible values are: + * - `'euclidean'`: Euclidean distance. + * - `'cosine'`: Cosine similarity. + * - `'dot_product'`: Dot product. + */ + distanceMeasure: 'euclidean' | 'cosine' | 'dot_product'; + /** + * The maximum number of documents to return from the FindNearest stage. + */ + limit?: number; + /** + * If set, specifies the field on the output documents that will contain + * the computed vector distance for the document. If not set, the computed + * vector distance will not be returned. + */ + distanceField?: string; +}; +/** + * Options defining how a ReplaceWithStage is evaluated. See {@link Pipeline.replaceWith}. + */ +export type ReplaceWithStageOptions = StageOptions & { + /** + * The name of a field that contains a map or an {@link Expression} that + * evaluates to a map. + */ + map: Expression | string; +}; +/** + * Defines the options for evaluating a sample stage within a pipeline. + * This type combines common {@link StageOptions} with a specific configuration + * where only one of the defined sampling methods can be applied. + * + * See {@link Pipeline.sample} to create a sample stage.. + */ +export type SampleStageOptions = StageOptions & + OneOf<{ + /** + * If set, specifies the sample rate as a percentage of the + * input documents. + * + * Cannot be set when `documents: number` is set. + */ + percentage: number; + /** + * If set, specifies the sample rate as a total number of + * documents to sample from the input documents. + * + * Cannot be set when `percentage: number` is set. + */ + documents: number; + }>; +/** + * Options defining how a UnionStage is evaluated. See {@link Pipeline.union}. + */ +export type UnionStageOptions = StageOptions & { + /** + * Specifies the other Pipeline to union with. + */ + other: Pipeline; +}; + +/** + * Represents the specific options available for configuring an `UnnestStage` within a pipeline. + */ +export type UnnestStageOptions = StageOptions & { + /** + * A `Selectable` object that defines an array expression to be un-nested + * and the alias for the un-nested field. + */ + selectable: Selectable; + /** + * If set, specifies the field on the output documents that will contain the + * offset (starting at zero) that the element is from the original array. + */ + indexField?: string; +}; +/** + * Options defining how a SortStage is evaluated. See {@link Pipeline.sort}. + */ +export type SortStageOptions = StageOptions & { + /** + * Orderings specify how the input documents are sorted. + * One or more ordering are required. + */ + orderings: Ordering[]; +}; diff --git a/packages/firestore/src/lite-api/user_data_reader.ts b/packages/firestore/src/lite-api/user_data_reader.ts index 905b13edd6f..8ea2728b3a7 100644 --- a/packages/firestore/src/lite-api/user_data_reader.ts +++ b/packages/firestore/src/lite-api/user_data_reader.ts @@ -1079,3 +1079,11 @@ function fieldMaskContains( ): boolean { return haystack.some(v => v.isEqual(needle)); } + +export interface UserData { + _readUserData(context: ParseContext): void; +} + +export function isUserData(value: unknown): value is UserData { + return typeof (value as UserData)._readUserData === 'function'; +} diff --git a/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts b/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts index 709509c8a4e..0ccebd779f5 100644 --- a/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts +++ b/packages/firestore/src/platform/rn_lite/snapshot_to_json.ts @@ -16,3 +16,10 @@ */ export { toByteStreamReader } from '../browser/byte_stream_reader'; + +// This is not included in the RN lite-bundle, but the rollup build +// will fail if these exports are not defined. +export { + buildDocumentSnapshotJsonBundle, + buildQuerySnapshotJsonBundle +} from '../browser/snapshot_to_json'; diff --git a/packages/firestore/src/remote/datastore.ts b/packages/firestore/src/remote/datastore.ts index 10566503ca3..081b8cf5c9a 100644 --- a/packages/firestore/src/remote/datastore.ts +++ b/packages/firestore/src/remote/datastore.ts @@ -20,7 +20,7 @@ import { User } from '../auth/user'; import { Aggregate } from '../core/aggregate'; import { DatabaseId } from '../core/database_info'; import { queryToAggregateTarget, Query, queryToTarget } from '../core/query'; -import { Pipeline } from '../lite-api/pipeline'; +import { StructuredPipeline } from '../core/structured_pipeline'; import { Document } from '../model/document'; import { DocumentKey } from '../model/document_key'; import { Mutation } from '../model/mutation'; @@ -244,14 +244,12 @@ export async function invokeBatchGetDocumentsRpc( export async function invokeExecutePipeline( datastore: Datastore, - pipeline: Pipeline + structuredPipeline: StructuredPipeline ): Promise { const datastoreImpl = debugCast(datastore, DatastoreImpl); const executePipelineRequest: ProtoExecutePipelineRequest = { database: getEncodedDatabaseId(datastoreImpl.serializer), - structuredPipeline: { - pipeline: pipeline._toProto(datastoreImpl.serializer) - } + structuredPipeline: structuredPipeline._toProto(datastoreImpl.serializer) }; const response = await datastoreImpl.invokeStreamingRPC< @@ -264,17 +262,22 @@ export async function invokeExecutePipeline( executePipelineRequest ); - return response + const result: PipelineStreamElement[] = []; + response .filter(proto => !!proto.results) - .flatMap(proto => { + .forEach(proto => { if (proto.results!.length === 0) { - return fromPipelineResponse(datastoreImpl.serializer, proto); + result.push(fromPipelineResponse(datastoreImpl.serializer, proto)); } else { - return proto.results!.map(result => - fromPipelineResponse(datastoreImpl.serializer, proto, result) + return proto.results!.forEach(document => + result.push( + fromPipelineResponse(datastoreImpl.serializer, proto, document) + ) ); } }); + + return result; } export async function invokeRunQueryRpc( diff --git a/packages/firestore/src/remote/serializer.ts b/packages/firestore/src/remote/serializer.ts index d08e0d16874..f11781ac331 100644 --- a/packages/firestore/src/remote/serializer.ts +++ b/packages/firestore/src/remote/serializer.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { ParseContext } from '../api/parse_context'; import { Aggregate } from '../core/aggregate'; import { Bound } from '../core/bound'; import { DatabaseId } from '../core/database_info'; @@ -41,7 +40,6 @@ import { TargetId } from '../core/types'; import { Bytes } from '../lite-api/bytes'; import { GeoPoint } from '../lite-api/geo_point'; import { Timestamp } from '../lite-api/timestamp'; -import { UserDataReader } from '../lite-api/user_data_reader'; import { TargetData, TargetPurpose } from '../local/target_data'; import { MutableDocument } from '../model/document'; import { DocumentKey } from '../model/document_key'; @@ -1475,10 +1473,6 @@ export function isProtoValueSerializable( ); } -export interface UserData { - _readUserData(dataReader: UserDataReader, context?: ParseContext): void; -} - export function toMapValue( serializer: JsonProtoSerializer, input: Map> diff --git a/packages/firestore/src/util/input_validation.ts b/packages/firestore/src/util/input_validation.ts index 7fd9967b5a0..f3b5dda6985 100644 --- a/packages/firestore/src/util/input_validation.ts +++ b/packages/firestore/src/util/input_validation.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { DocumentData } from '../lite-api/reference'; import { DocumentKey } from '../model/document_key'; import { ResourcePath } from '../model/path'; @@ -92,7 +93,7 @@ export function validateCollectionPath(path: ResourcePath): void { * Returns true if it's a non-null object without a custom prototype * (i.e. excludes Array, Date, etc.). */ -export function isPlainObject(input: unknown): boolean { +export function isPlainObject(input: unknown): input is DocumentData { return ( typeof input === 'object' && input !== null && diff --git a/packages/firestore/src/util/pipeline_util.ts b/packages/firestore/src/util/pipeline_util.ts new file mode 100644 index 00000000000..0bc1906361c --- /dev/null +++ b/packages/firestore/src/util/pipeline_util.ts @@ -0,0 +1,132 @@ +/** + * @license + * Copyright 2025 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 { vector } from '../api'; +import { + _constant, + AggregateFunction, + AliasedAggregate, + array, + constant, + Expression, + AliasedExpression, + field, + Field, + map, + Selectable +} from '../lite-api/expressions'; +import { VectorValue } from '../lite-api/vector_value'; + +import { isPlainObject } from './input_validation'; +import { isFirestoreValue } from './proto'; +import { isString } from './types'; + +export function selectablesToMap( + selectables: Array +): Map { + const result = new Map(); + for (const selectable of selectables) { + if (typeof selectable === 'string') { + result.set(selectable as string, field(selectable)); + } else if (selectable instanceof Field) { + result.set(selectable.alias, selectable.expr); + } else if (selectable instanceof AliasedExpression) { + result.set(selectable.alias, selectable.expr); + } + } + return result; +} + +export function aliasedAggregateToMap( + aliasedAggregatees: AliasedAggregate[] +): Map { + return aliasedAggregatees.reduce( + (map: Map, selectable: AliasedAggregate) => { + map.set(selectable.alias, selectable.aggregate as AggregateFunction); + return map; + }, + new Map() as Map + ); +} + +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * + * @private + * @internal + * @param value + */ +export function vectorToExpr( + value: VectorValue | number[] | Expression +): Expression { + if (value instanceof Expression) { + return value; + } else if (value instanceof VectorValue) { + const result = constant(value); + return result; + } else if (Array.isArray(value)) { + const result = constant(vector(value)); + return result; + } else { + throw new Error('Unsupported value: ' + typeof value); + } +} + +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * If the input is a string, it is assumed to be a field name, and a + * field(value) is returned. + * + * @private + * @internal + * @param value + */ +export function fieldOrExpression(value: unknown): Expression { + if (isString(value)) { + const result = field(value); + return result; + } else { + return valueToDefaultExpr(value); + } +} +/** + * Converts a value to an Expr, Returning either a Constant, MapFunction, + * ArrayFunction, or the input itself (if it's already an expression). + * + * @private + * @internal + * @param value + */ +export function valueToDefaultExpr(value: unknown): Expression { + let result: Expression | undefined; + if (isFirestoreValue(value)) { + return constant(value); + } + if (value instanceof Expression) { + return value; + } else if (isPlainObject(value)) { + result = map(value as Record); + } else if (value instanceof Array) { + result = array(value); + } else { + result = _constant(value, undefined); + } + + return result; +} diff --git a/packages/firestore/src/util/types.ts b/packages/firestore/src/util/types.ts index 361ebda1935..89ed50a240b 100644 --- a/packages/firestore/src/util/types.ts +++ b/packages/firestore/src/util/types.ts @@ -37,6 +37,10 @@ export function isNegativeZero(value: number): boolean { return value === 0 && 1 / value === 1 / -0; } +export function isNumber(value: unknown): value is number { + return typeof value === 'number'; +} + /** * Returns whether a value is an integer and in the safe integer range * @param value - The value to test for being an integer and in the safe range @@ -69,3 +73,18 @@ export interface DocumentLike { addEventListener(type: string, listener: EventListener): void; removeEventListener(type: string, listener: EventListener): void; } + +/** + * Utility type to create an type that only allows one + * property of the Type param T to be set. + * + * type XorY = OneOf<{ x: unknown, y: unknown}> + * let a = { x: "foo" } // OK + * let b = { y: "foo" } // OK + * let c = { a: "foo", y: "foo" } // Not OK + */ +export type OneOf = { + [K in keyof T]: Pick & { + [P in Exclude]?: undefined; + }; +}[keyof T]; diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index fb04f775972..37f1f674142 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -15,25 +15,10 @@ * limitations under the License. */ +import { FirebaseError } from '@firebase/util'; import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { - AggregateFunction, - ascending, - BooleanExpr, - byteLength, - constantVector, - FunctionExpr, - timestampAdd, - timestampToUnixMicros, - timestampToUnixMillis, - timestampToUnixSeconds, - toLower, - unixMicrosToTimestamp, - unixMillisToTimestamp, - vectorLength -} from '../../../src/lite-api/expressions'; import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; @@ -53,16 +38,16 @@ import { collection, documentId as documentIdFieldPath, writeBatch, - addDoc + addDoc, + DocumentReference, + deleteDoc } from '../util/firebase_export'; -import { apiDescribe, withTestCollection, itIf } from '../util/helpers'; +import { apiDescribe, withTestCollection } from '../util/helpers'; import { array, mod, pipelineResultEqual, sum, - replaceFirst, - replaceAll, descending, isNan, map, @@ -74,48 +59,39 @@ import { arrayContains, arrayContainsAny, count, - avg, + average, cosineDistance, not, countAll, dotProduct, endsWith, - eq, + equal, reverse, toUpper, euclideanDistance, - gt, + greaterThan, like, - lt, - strContains, + lessThan, + stringContains, divide, - lte, + lessThanOrEqual, arrayLength, - arrayConcat, mapGet, - neq, + notEqual, or, regexContains, regexMatch, startsWith, - strConcat, + stringConcat, subtract, - cond, - eqAny, + conditional, + equalAny, logicalMaximum, - notEqAny, + notEqualAny, multiply, countIf, - bitAnd, - bitOr, - bitXor, - bitNot, exists, - bitLeftShift, charLength, - bitRightShift, - rand, - arrayOffset, minimum, maximum, isError, @@ -125,27 +101,60 @@ import { isNull, isNotNull, isNotNan, - timestampSub, + timestampSubtract, mapRemove, mapMerge, documentId, - substr, + substring, logicalMinimum, xor, field, constant, _internalPipelineToExecutePipelineRequestProto, - FindNearestOptions + FindNearestStageOptions, + AggregateFunction, + arrayGet, + ascending, + BooleanExpression, + byteLength, + FunctionExpression, + timestampAdd, + timestampToUnixMicros, + timestampToUnixMillis, + timestampToUnixSeconds, + toLower, + unixMicrosToTimestamp, + unixMillisToTimestamp, + vectorLength, + countDistinct, + ceil, + floor, + exp, + pow, + round, + collectionId, + ln, + log, + sqrt, + stringReverse, + len as length, + abs, + concat, + error, + currentTimestamp, + ifAbsent, + join, + log10, + arraySum } from '../util/pipeline_export'; use(chaiAsPromised); setLogLevel('debug'); -const testUnsupportedFeatures: boolean | 'only' = false; const timestampDeltaMS = 1000; -apiDescribe('Pipelines', persistence => { +apiDescribe.skip('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; @@ -333,6 +342,23 @@ apiDescribe('Pipelines', persistence => { await withTestCollectionPromise; }); + describe('console support', () => { + it('supports internal serialization to proto', async () => { + const pipeline = firestore + .pipeline() + .collection('books') + .where(equal('awards.hugo', true)) + .select( + 'title', + field('nestedField.level.1'), + mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + ); + + const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); + expect(proto).not.to.be.null; + }); + }); + describe('pipeline results', () => { it('empty snapshot as expected', async () => { const snapshot = await execute( @@ -348,7 +374,6 @@ apiDescribe('Pipelines', persistence => { .sort(ascending('__name__')); const snapshot = await execute(ppl); expect(snapshot.results.length).to.equal(10); - expect(snapshot.pipeline).to.equal(ppl); expectResults( snapshot, 'book1', @@ -448,7 +473,7 @@ apiDescribe('Pipelines', persistence => { const pipeline = firestore .pipeline() .collection(randomCol.path) - .aggregate(avg('rating').as('avgRating')); + .aggregate(average('rating').as('avgRating')); const snapshot = await execute(pipeline); const end = new Date().valueOf(); @@ -466,7 +491,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [average('rating').as('avgRating')], groups: ['genre'] }); @@ -524,31 +549,26 @@ apiDescribe('Pipelines', persistence => { await terminate(db2); }); - // Subcollections not currently supported in DBE - itIf(testUnsupportedFeatures)( - 'supports collection group as source', - async () => { - const randomSubCollectionId = Math.random().toString(16).slice(2); - const doc1 = await addDoc( - collection(randomCol, 'book1', randomSubCollectionId), - { order: 1 } - ); - const doc2 = await addDoc( - collection(randomCol, 'book2', randomSubCollectionId), - { order: 2 } - ); - const snapshot = await execute( - firestore - .pipeline() - .collectionGroup(randomSubCollectionId) - .sort(ascending('order')) - ); - expectResults(snapshot, doc1.id, doc2.id); - } - ); + it('supports collection group as source', async () => { + const randomSubCollectionId = Math.random().toString(16).slice(2); + const doc1 = await addDoc( + collection(randomCol, 'book1', randomSubCollectionId), + { order: 1 } + ); + const doc2 = await addDoc( + collection(randomCol, 'book2', randomSubCollectionId), + { order: 2 } + ); + const snapshot = await execute( + firestore + .pipeline() + .collectionGroup(randomSubCollectionId) + .sort(ascending('order')) + ); + expectResults(snapshot, doc1.id, doc2.id); + }); - // subcollections not currently supported in dbe - itIf(testUnsupportedFeatures)('supports database as source', async () => { + it('supports database as source', async () => { const randomId = Math.random().toString(16).slice(2); const doc1 = await addDoc(collection(randomCol, 'book1', 'sub'), { order: 1, @@ -562,7 +582,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .database() - .where(eq('randomId', randomId)) + .where(equal('randomId', randomId)) .sort(ascending('order')) ); expectResults(snapshot, doc1.id, doc2.id); @@ -585,8 +605,7 @@ apiDescribe('Pipelines', persistence => { Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) ).as('bytes'), constant(doc(firestore, 'foo', 'bar')).as('documentReference'), - constantVector(vector([1, 2, 3])).as('vectorValue'), - constantVector([1, 2, 3]).as('vectorValue2'), + constant(vector([1, 2, 3])).as('vectorValue'), map({ 'number': 1, 'string': 'a string', @@ -643,7 +662,6 @@ apiDescribe('Pipelines', persistence => { 'bytes': Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])), 'documentReference': doc(firestore, 'foo', 'bar'), 'vectorValue': vector([1, 2, 3]), - 'vectorValue2': vector([1, 2, 3]), 'map': { 'number': 1, 'string': 'a string', @@ -749,7 +767,7 @@ apiDescribe('Pipelines', persistence => { ) .where( and( - eq('metadataArray', [ + equal('metadataArray', [ 1, 2, field('genre'), @@ -759,7 +777,7 @@ apiDescribe('Pipelines', persistence => { published: field('published') } ]), - eq('metadata', { + equal('metadata', { genre: field('genre'), rating: multiply('rating', 10), nestedArray: [field('title')], @@ -801,6 +819,30 @@ apiDescribe('Pipelines', persistence => { } }); }); + + it('supports boolean value constants as a BooleanExpression', async () => { + const snapshots = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + conditional(constant(true), constant('TRUE'), constant('FALSE')).as( + 'true' + ), + conditional( + constant(false), + constant('TRUE'), + constant('FALSE') + ).as('false') + ) + ); + + expectResults(snapshots, { + 'true': 'TRUE', + 'false': 'FALSE' + }); + }); }); describe('stages', () => { @@ -818,10 +860,41 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('genre', 'Science Fiction')) + .where(equal('genre', 'Science Fiction')) + .aggregate( + countAll().as('count'), + average('rating').as('avgRating'), + maximum('rating').as('maxRating'), + sum('rating').as('sumRating') + ) + ); + expectResults(snapshot, { + count: 2, + avgRating: 4.4, + maxRating: 4.6, + sumRating: 8.8 + }); + }); + + it('supports aggregate options', async () => { + let snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate({ + accumulators: [countAll().as('count')] + }) + ); + expectResults(snapshot, { count: 10 }); + + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('genre', 'Science Fiction')) .aggregate( countAll().as('count'), - avg('rating').as('avgRating'), + average('rating').as('avgRating'), maximum('rating').as('maxRating'), sum('rating').as('sumRating') ) @@ -840,7 +913,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(lt('published', 1900)) + .where(lessThan('published', 1900)) .aggregate({ accumulators: [], groups: ['genre'] @@ -854,12 +927,12 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(lt(field('published'), 1984)) + .where(lessThan(field('published'), 1984)) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [average('rating').as('avgRating')], groups: ['genre'] }) - .where(gt('avgRating', 4.3)) + .where(greaterThan('avgRating', 4.3)) .sort(field('avgRating').descending()) ); expectResults( @@ -895,7 +968,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .aggregate(countIf(field('rating').gt(4.3)).as('count')) + .aggregate(countIf(field('rating').greaterThan(4.3)).as('count')) ); const expectedResults = { count: 3 @@ -906,10 +979,20 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .aggregate(field('rating').gt(4.3).countIf().as('count')) + .aggregate(field('rating').greaterThan(4.3).countIf().as('count')) ); expectResults(snapshot, expectedResults); }); + + it('returns countDistinct accumulation', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .aggregate(countDistinct('genre').as('distinctGenres')) + ); + expectResults(snapshot, { distinctGenres: 8 }); + }); }); describe('distinct stage', () => { @@ -935,6 +1018,34 @@ apiDescribe('Pipelines', persistence => { { genre: 'Southern Gothic', author: 'Harper Lee' } ); }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .distinct('genre', 'author') + .sort({ + orderings: [ + field('genre').ascending(), + field('author').ascending() + ] + }) + ); + expectResults( + snapshot, + { genre: 'Dystopian', author: 'George Orwell' }, + { genre: 'Dystopian', author: 'Margaret Atwood' }, + { genre: 'Fantasy', author: 'J.R.R. Tolkien' }, + { genre: 'Magical Realism', author: 'Gabriel García Márquez' }, + { genre: 'Modernist', author: 'F. Scott Fitzgerald' }, + { genre: 'Psychological Thriller', author: 'Fyodor Dostoevsky' }, + { genre: 'Romance', author: 'Jane Austen' }, + { genre: 'Science Fiction', author: 'Douglas Adams' }, + { genre: 'Science Fiction', author: 'Frank Herbert' }, + { genre: 'Southern Gothic', author: 'Harper Lee' } + ); + }); }); describe('select stage', () => { @@ -966,6 +1077,25 @@ apiDescribe('Pipelines', persistence => { { title: "The Handmaid's Tale", author: 'Margaret Atwood' } ); }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select({ selections: ['title', field('author').as('auth0r')] }) + .sort(field('auth0r').ascending()) + .limit(2) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + auth0r: 'Douglas Adams' + }, + { title: 'The Great Gatsby', auth0r: 'F. Scott Fitzgerald' } + ); + }); }); describe('addField stage', () => { @@ -1020,6 +1150,60 @@ apiDescribe('Pipelines', persistence => { } ); }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author') + .addFields({ + fields: [constant('bar').as('foo')] + }) + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + foo: 'bar' + }, + { + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald', + foo: 'bar' + }, + { title: 'Dune', author: 'Frank Herbert', foo: 'bar' }, + { + title: 'Crime and Punishment', + author: 'Fyodor Dostoevsky', + foo: 'bar' + }, + { + title: 'One Hundred Years of Solitude', + author: 'Gabriel García Márquez', + foo: 'bar' + }, + { title: '1984', author: 'George Orwell', foo: 'bar' }, + { + title: 'To Kill a Mockingbird', + author: 'Harper Lee', + foo: 'bar' + }, + { + title: 'The Lord of the Rings', + author: 'J.R.R. Tolkien', + foo: 'bar' + }, + { title: 'Pride and Prejudice', author: 'Jane Austen', foo: 'bar' }, + { + title: "The Handmaid's Tale", + author: 'Margaret Atwood', + foo: 'bar' + } + ); + }); }); describe('removeFields stage', () => { @@ -1061,76 +1245,201 @@ apiDescribe('Pipelines', persistence => { } ); }); - }); - describe('where stage', () => { - it('where with and (2 conditions)', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where( - and( - gt('rating', 4.5), - eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) - ) - ) - ); - expectResults(snapshot, 'book10', 'book4'); - }); - it('where with and (3 conditions)', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where( - and( - gt('rating', 4.5), - eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), - lt('published', 1965) - ) - ) - ); - expectResults(snapshot, 'book4'); - }); - it('where with or', async () => { + it('supports options', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where( - or( - eq('genre', 'Romance'), - eq('genre', 'Dystopian'), - eq('genre', 'Fantasy') - ) - ) - .sort(ascending('title')) - .select('title') + .select('title', 'author', 'genre') + .sort(field('author').ascending()) + .removeFields({ + fields: [field('author'), 'genre'] + }) + .sort(field('author').ascending()) ); expectResults( snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'The Great Gatsby' + }, + { title: 'Dune' }, + { + title: 'Crime and Punishment' + }, + { + title: 'One Hundred Years of Solitude' + }, { title: '1984' }, + { + title: 'To Kill a Mockingbird' + }, + { + title: 'The Lord of the Rings' + }, { title: 'Pride and Prejudice' }, - { title: "The Handmaid's Tale" }, - { title: 'The Lord of the Rings' } + { + title: "The Handmaid's Tale" + } ); }); + }); - it('where with xor', async () => { + describe('findNearest stage', () => { + it('can find nearest', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where( - xor( - eq('genre', 'Romance'), - eq('genre', 'Dystopian'), - eq('genre', 'Fantasy'), - eq('published', 1949) - ) - ) - .select('title') + .select('title', 'author') + .sort(field('author').ascending()) + .removeFields(field('author')) + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'The Great Gatsby' + }, + { title: 'Dune' }, + { + title: 'Crime and Punishment' + }, + { + title: 'One Hundred Years of Solitude' + }, + { title: '1984' }, + { + title: 'To Kill a Mockingbird' + }, + { + title: 'The Lord of the Rings' + }, + { title: 'Pride and Prejudice' }, + { + title: "The Handmaid's Tale" + } + ); + }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'author', 'genre') + .sort(field('author').ascending()) + .removeFields({ + fields: [field('author'), 'genre'] + }) + .sort(field('author').ascending()) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy" + }, + { + title: 'The Great Gatsby' + }, + { title: 'Dune' }, + { + title: 'Crime and Punishment' + }, + { + title: 'One Hundred Years of Solitude' + }, + { title: '1984' }, + { + title: 'To Kill a Mockingbird' + }, + { + title: 'The Lord of the Rings' + }, + { title: 'Pride and Prejudice' }, + { + title: "The Handmaid's Tale" + } + ); + }); + }); + + describe('where stage', () => { + it('where with and (2 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + greaterThan('rating', 4.5), + equalAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) + ) + ) + ); + expectResults(snapshot, 'book10', 'book4'); + }); + + it('where with and (3 conditions)', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + and( + greaterThan('rating', 4.5), + equalAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), + lessThan('published', 1965) + ) + ) + ); + expectResults(snapshot, 'book4'); + }); + + it('where with or', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + or( + equal('genre', 'Romance'), + equal('genre', 'Dystopian'), + equal('genre', 'Fantasy') + ) + ) + .sort(ascending('title')) + .select('title') + ); + expectResults( + snapshot, + { title: '1984' }, + { title: 'Pride and Prejudice' }, + { title: "The Handmaid's Tale" }, + { title: 'The Lord of the Rings' } + ); + }); + + it('where with xor', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where( + xor( + equal('genre', 'Romance'), + equal('genre', 'Dystopian'), + equal('genre', 'Fantasy'), + equal('published', 1949) + ) + ) + .select('title') ); expectResults( snapshot, @@ -1140,17 +1449,20 @@ apiDescribe('Pipelines', persistence => { ); }); - // it('where with boolean constant', async () => { - // const snapshot = await execute( - // firestore - // .pipeline() - // .collection(randomCol.path) - // .where(constant(true)) - // .sort(ascending('__name__')) - // .limit(2) - // ); - // expectResults(snapshot, 'book1', 'book10'); - // }); + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where({ + condition: and( + greaterThan('rating', 4.5), + equalAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) + ) + }) + ); + expectResults(snapshot, 'book10', 'book4'); + }); }); describe('sort, offset, and limit stages', () => { @@ -1171,19 +1483,39 @@ apiDescribe('Pipelines', persistence => { { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } ); }); + + it('sort, offset, and limit stages support options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort({ + orderings: [field('author').ascending()] + }) + .offset({ offset: 5 }) + .limit({ limit: 3 }) + .select('title', 'author') + ); + expectResults( + snapshot, + { title: '1984', author: 'George Orwell' }, + { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, + { title: 'The Lord of the Rings', author: 'J.R.R. Tolkien' } + ); + }); }); - describe('generic stage', () => { + describe('raw stage', () => { it('can select fields', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .genericStage('select', [ + .rawStage('select', [ { title: field('title'), metadata: { - 'author': field('author') + author: field('author') } } ]) @@ -1206,9 +1538,9 @@ apiDescribe('Pipelines', persistence => { .sort(field('author').ascending()) .limit(1) .select('title', 'author') - .genericStage('add_fields', [ + .rawStage('add_fields', [ { - display: strConcat('title', ' - ', field('author')) + display: stringConcat('title', ' - ', field('author')) } ]) ); @@ -1225,7 +1557,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select('title', 'author') - .genericStage('where', [field('author').eq('Douglas Adams')]) + .rawStage('where', [field('author').equal('Douglas Adams')]) ); expectResults(snapshot, { title: "The Hitchhiker's Guide to the Galaxy", @@ -1239,14 +1571,14 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select('title', 'author') - .genericStage('sort', [ + .rawStage('sort', [ { direction: 'ascending', expression: field('author') } ]) - .genericStage('offset', [3]) - .genericStage('limit', [1]) + .rawStage('offset', [3]) + .rawStage('limit', [1]) ); expectResults(snapshot, { author: 'Fyodor Dostoevsky', @@ -1260,8 +1592,8 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select('title', 'author', 'rating') - .genericStage('aggregate', [ - { averageRating: field('rating').avg() }, + .rawStage('aggregate', [ + { averageRating: field('rating').average() }, {} ]) ); @@ -1276,7 +1608,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select('title', 'author', 'rating') - .genericStage('distinct', [{ rating: field('rating') }]) + .rawStage('distinct', [{ rating: field('rating') }]) .sort(field('rating').descending()) ); expectResults( @@ -1304,6 +1636,38 @@ apiDescribe('Pipelines', persistence => { } ); }); + + it('can perform FindNearest query', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .rawStage( + 'find_nearest', + [ + field('embedding'), + vector([10, 1, 2, 1, 1, 1, 1, 1, 1, 1]), + 'euclidean' + ], + { + 'distance_field': field('computedDistance'), + limit: 2 + } + ) + .select('title', 'computedDistance') + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + computedDistance: 1 + }, + { + title: 'One Hundred Years of Solitude', + computedDistance: 12.041594578792296 + } + ); + }); }); describe('replaceWith stage', () => { @@ -1312,7 +1676,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .replaceWith('awards') ); expectResults(snapshot, { @@ -1327,7 +1691,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .replaceWith( map({ foo: 'bar', @@ -1342,6 +1706,21 @@ apiDescribe('Pipelines', persistence => { baz: { title: "The Hitchhiker's Guide to the Galaxy" } }); }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) + .replaceWith({ map: 'awards' }) + ); + expectResults(snapshot, { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }); + }); }); describe('sample stage', () => { @@ -1364,7 +1743,7 @@ apiDescribe('Pipelines', persistence => { it('run pipeline with sample limit of {percentage: 0.6}', async () => { let avgSize = 0; - const numIterations = 20; + const numIterations = 30; for (let i = 0; i < numIterations; i++) { const snapshot = await execute( firestore @@ -1413,6 +1792,39 @@ apiDescribe('Pipelines', persistence => { 'book9' ); }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .union({ other: firestore.pipeline().collection(randomCol.path) }) + .sort(field(documentIdFieldPath()).ascending()) + ); + expectResults( + snapshot, + 'book1', + 'book1', + 'book10', + 'book10', + 'book2', + 'book2', + 'book3', + 'book3', + 'book4', + 'book4', + 'book5', + 'book5', + 'book6', + 'book6', + 'book7', + 'book7', + 'book8', + 'book8', + 'book9', + 'book9' + ); + }); }); describe('unnest stage', () => { @@ -1421,8 +1833,8 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) - .unnest(field('tags').as('tag'), 'tagsIndex') + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(field('tags').as('tag')) .select( 'title', 'author', @@ -1484,13 +1896,14 @@ apiDescribe('Pipelines', persistence => { } ); }); - it('unnest an expr', async () => { + + it('unnest with index field', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) - .unnest(array([1, 2, 3]).as('copy')) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(field('tags').as('tag'), 'tagsIndex') .select( 'title', 'author', @@ -1498,9 +1911,10 @@ apiDescribe('Pipelines', persistence => { 'published', 'rating', 'tags', - 'copy', + 'tag', 'awards', - 'nestedField' + 'nestedField', + 'tagsIndex' ) ); expectResults( @@ -1512,13 +1926,14 @@ apiDescribe('Pipelines', persistence => { published: 1979, rating: 4.2, tags: ['comedy', 'space', 'adventure'], - copy: 1, + tag: 'comedy', awards: { hugo: true, nebula: false, others: { unknown: { year: 1980 } } }, - nestedField: { 'level.1': { 'level.2': true } } + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 0 }, { title: "The Hitchhiker's Guide to the Galaxy", @@ -1527,13 +1942,14 @@ apiDescribe('Pipelines', persistence => { published: 1979, rating: 4.2, tags: ['comedy', 'space', 'adventure'], - copy: 2, + tag: 'space', awards: { hugo: true, nebula: false, others: { unknown: { year: 1980 } } }, - nestedField: { 'level.1': { 'level.2': true } } + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 1 }, { title: "The Hitchhiker's Guide to the Galaxy", @@ -1542,38 +1958,184 @@ apiDescribe('Pipelines', persistence => { published: 1979, rating: 4.2, tags: ['comedy', 'space', 'adventure'], - copy: 3, + tag: 'adventure', awards: { hugo: true, nebula: false, others: { unknown: { year: 1980 } } }, - nestedField: { 'level.1': { 'level.2': true } } + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 2 } ); }); - }); - describe('findNearest stage', () => { - it('run pipeline with findNearest', async () => { - const measures: Array = [ - 'euclidean', - 'dot_product', - 'cosine' - ]; - for (const measure of measures) { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol) - .findNearest({ - field: 'embedding', - vectorValue: vector([10, 1, 3, 1, 2, 1, 1, 1, 1, 1]), - limit: 3, - distanceMeasure: measure - }) - .select('title') - ); + it('unnest an expr', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest(array([1, 2, 3]).as('copy')) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'copy', + 'awards', + 'nestedField' + ) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 1, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 2, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + copy: 3, + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } } + } + ); + }); + + it('supports options', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) + .unnest({ + selectable: field('tags').as('tag'), + indexField: 'tagsIndex' + }) + .select( + 'title', + 'author', + 'genre', + 'published', + 'rating', + 'tags', + 'tag', + 'awards', + 'nestedField', + 'tagsIndex' + ) + ); + expectResults( + snapshot, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'comedy', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 0 + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'space', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 1 + }, + { + title: "The Hitchhiker's Guide to the Galaxy", + author: 'Douglas Adams', + genre: 'Science Fiction', + published: 1979, + rating: 4.2, + tags: ['comedy', 'space', 'adventure'], + tag: 'adventure', + awards: { + hugo: true, + nebula: false, + others: { unknown: { year: 1980 } } + }, + nestedField: { 'level.1': { 'level.2': true } }, + tagsIndex: 2 + } + ); + }); + }); + + describe('findNearest stage', () => { + it('run pipeline with findNearest', async () => { + const measures: Array = [ + 'euclidean', + 'dot_product', + 'cosine' + ]; + for (const measure of measures) { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol) + .findNearest({ + field: 'embedding', + vectorValue: vector([10, 1, 3, 1, 2, 1, 1, 1, 1, 1]), + limit: 3, + distanceMeasure: measure + }) + .select('title') + ); expectResults( snapshot, { @@ -1618,6 +2180,31 @@ apiDescribe('Pipelines', persistence => { }); }); + describe('error handling', () => { + it('error properties are propagated from the firestore backend', async () => { + try { + const myPipeline = firestore + .pipeline() + .collection(randomCol.path) + .rawStage('select', [ + // incorrect parameter type + field('title') + ]); + + await execute(myPipeline); + + expect.fail('expected pipeline.execute() to throw'); + } catch (e: unknown) { + expect(e instanceof FirebaseError).to.be.true; + const err = e as FirebaseError; + expect(err['code']).to.equal('invalid-argument'); + expect(typeof err['message']).to.equal('string'); + + expect(err['message']).to.match(/^3 INVALID_ARGUMENT: .*$/); + } + }); + }); + describe('function expressions', () => { it('logical max works', async () => { const snapshot = await execute( @@ -1663,36 +2250,44 @@ apiDescribe('Pipelines', persistence => { ); }); - it('cond works', async () => { + it('conditional works', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .select( 'title', - cond( - lt(field('published'), 1960), + conditional( + lessThan(field('published'), 1960), constant(1960), field('published') - ).as('published-safe') + ).as('published-safe'), + field('rating') + .greaterThanOrEqual(4.5) + .conditional(constant('great'), constant('good')) + .as('rating') ) .sort(field('title').ascending()) .limit(3) ); expectResults( snapshot, - { title: '1984', 'published-safe': 1960 }, - { title: 'Crime and Punishment', 'published-safe': 1960 }, - { title: 'Dune', 'published-safe': 1965 } + { title: '1984', 'published-safe': 1960, rating: 'good' }, + { + title: 'Crime and Punishment', + 'published-safe': 1960, + rating: 'good' + }, + { title: 'Dune', 'published-safe': 1965, rating: 'great' } ); }); - it('eqAny works', async () => { + it('equalAny works', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where(eqAny('published', [1979, 1999, 1967])) + .where(equalAny('published', [1979, 1999, 1967])) .sort(descending('title')) .select('title') ); @@ -1703,13 +2298,13 @@ apiDescribe('Pipelines', persistence => { ); }); - it('notEqAny works', async () => { + it('notEqualAny works', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .where( - notEqAny( + notEqualAny( 'published', [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] ) @@ -1765,7 +2360,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select(arrayLength('tags').as('tagsCount')) - .where(eq('tagsCount', 3)) + .where(equal('tagsCount', 3)) ); expect(snapshot.results.length).to.equal(10); }); @@ -1777,7 +2372,7 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .sort(ascending('author')) .select( - field('author').strConcat(' - ', field('title')).as('bookInfo') + field('author').stringConcat(' - ', field('title')).as('bookInfo') ) .limit(1) ); @@ -1825,7 +2420,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(strContains('title', "'s")) + .where(stringContains('title', "'s")) .select('title') .sort(field('title').ascending()) ); @@ -1842,7 +2437,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select(charLength('title').as('titleLength'), field('title')) - .where(gt('titleLength', 20)) + .where(greaterThan('titleLength', 20)) .sort(field('title').ascending()) ); @@ -1906,14 +2501,14 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', 'To Kill a Mockingbird')) + .where(equal('title', 'To Kill a Mockingbird')) .select( add(field('rating'), 1).as('ratingPlusOne'), subtract(field('published'), 1900).as('yearsSince1900'), field('rating').multiply(10).as('ratingTimesTen'), divide('rating', 2).as('ratingDividedByTwo'), - multiply('rating', 10, 2).as('ratingTimes20'), - add('rating', 1, 2).as('ratingPlus3'), + multiply('rating', 20).as('ratingTimes20'), + add('rating', 3).as('ratingPlus3'), mod('rating', 2).as('ratingMod2') ) .limit(1) @@ -1936,9 +2531,9 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .where( and( - gt('rating', 4.2), - lte(field('rating'), 4.5), - neq('genre', 'Science Fiction') + greaterThan('rating', 4.2), + lessThanOrEqual(field('rating'), 4.5), + notEqual('genre', 'Science Fiction') ) ) .select('rating', 'title') @@ -1962,8 +2557,11 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .where( or( - and(gt('rating', 4.5), eq('genre', 'Science Fiction')), - lt('published', 1900) + and( + greaterThan('rating', 4.5), + equal('genre', 'Science Fiction') + ), + lessThan('published', 1900) ) ) .select('title') @@ -1987,10 +2585,16 @@ apiDescribe('Pipelines', persistence => { .select( isNull('rating').as('ratingIsNull'), isNan('rating').as('ratingIsNaN'), - isError(arrayOffset('title', 0)).as('isError'), - ifError(arrayOffset('title', 0), constant('was error')).as( + isError(divide(constant(1), constant(0))).as('isError'), + ifError(divide(constant(1), constant(0)), constant('was error')).as( 'ifError' ), + ifError( + divide(constant(1), constant(0)).greaterThan(1), + constant(true) + ) + .not() + .as('ifErrorBooleanExpression'), isAbsent('foo').as('isAbsent'), isNotNull('title').as('titleIsNotNull'), isNotNan('cost').as('costIsNotNan'), @@ -2003,6 +2607,7 @@ apiDescribe('Pipelines', persistence => { ratingIsNaN: false, isError: true, ifError: 'was error', + ifErrorBooleanExpression: false, isAbsent: true, titleIsNotNull: true, costIsNotNan: false, @@ -2019,10 +2624,15 @@ apiDescribe('Pipelines', persistence => { .select( field('rating').isNull().as('ratingIsNull'), field('rating').isNan().as('ratingIsNaN'), - arrayOffset('title', 0).isError().as('isError'), - arrayOffset('title', 0) + divide(constant(1), constant(0)).isError().as('isError'), + divide(constant(1), constant(0)) .ifError(constant('was error')) .as('ifError'), + divide(constant(1), constant(0)) + .greaterThan(1) + .ifError(constant(true)) + .not() + .as('ifErrorBooleanExpression'), field('foo').isAbsent().as('isAbsent'), field('title').isNotNull().as('titleIsNotNull'), field('cost').isNotNan().as('costIsNotNan') @@ -2033,6 +2643,7 @@ apiDescribe('Pipelines', persistence => { ratingIsNaN: false, isError: true, ifError: 'was error', + ifErrorBooleanExpression: false, isAbsent: true, titleIsNotNull: true, costIsNotNan: false @@ -2050,7 +2661,7 @@ apiDescribe('Pipelines', persistence => { field('awards').mapGet('others').as('others'), field('title') ) - .where(eq('hugoAward', true)) + .where(equal('hugoAward', true)) ); expectResults( snapshot, @@ -2059,25 +2670,25 @@ apiDescribe('Pipelines', persistence => { title: "The Hitchhiker's Guide to the Galaxy", others: { unknown: { year: 1980 } } }, - { hugoAward: true, title: 'Dune', others: null } + { hugoAward: true, title: 'Dune' } ); }); it('testDistanceFunctions', async () => { - const sourceVector = [0.1, 0.1]; - const targetVector = [0.5, 0.8]; + const sourceVector = vector([0.1, 0.1]); + const targetVector = vector([0.5, 0.8]); let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .select( - cosineDistance(constantVector(sourceVector), targetVector).as( + cosineDistance(constant(sourceVector), targetVector).as( 'cosineDistance' ), - dotProduct(constantVector(sourceVector), targetVector).as( + dotProduct(constant(sourceVector), targetVector).as( 'dotProductDistance' ), - euclideanDistance(constantVector(sourceVector), targetVector).as( + euclideanDistance(constant(sourceVector), targetVector).as( 'euclideanDistance' ) ) @@ -2095,13 +2706,13 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .select( - constantVector(sourceVector) + constant(sourceVector) .cosineDistance(targetVector) .as('cosineDistance'), - constantVector(sourceVector) + constant(sourceVector) .dotProduct(targetVector) .as('dotProductDistance'), - constantVector(sourceVector) + constant(sourceVector) .euclideanDistance(targetVector) .as('euclideanDistance') ) @@ -2121,7 +2732,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .limit(1) - .select(vectorLength(constantVector([1, 2, 3])).as('vectorLength')) + .select(vectorLength(constant(vector([1, 2, 3]))).as('vectorLength')) ); expectResults(snapshot, { vectorLength: 3 @@ -2133,7 +2744,7 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('awards.hugo', true)) + .where(equal('awards.hugo', true)) .sort(descending('title')) .select('title', 'awards.hugo') ); @@ -2152,26 +2763,34 @@ apiDescribe('Pipelines', persistence => { firestore .pipeline() .collection(randomCol.path) - .where(eq('awards.hugo', true)) + .limit(1) + .replaceWith( + map({ + title: 'foo', + nested: { + level: { + '1': 'bar' + }, + 'level.1': { + 'level.2': 'baz' + } + } + }) + ) .select( 'title', - field('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + field('nested.level.1'), + mapGet('nested', 'level.1').mapGet('level.2').as('nested') ) - .sort(descending('title')) - ); - expectResults( - snapshot, - { - title: "The Hitchhiker's Guide to the Galaxy", - 'nestedField.level.`1`': null, - nested: true - }, - { title: 'Dune', 'nestedField.level.`1`': null, nested: null } ); + expectResults(snapshot, { + title: 'foo', + 'nested.level.`1`': 'bar', + nested: 'baz' + }); }); - describe('genericFunction', () => { + describe('rawFunction', () => { it('add selectable', async () => { const snapshot = await execute( firestore @@ -2180,7 +2799,7 @@ apiDescribe('Pipelines', persistence => { .sort(descending('rating')) .limit(1) .select( - new FunctionExpr('add', [field('rating'), constant(1)]).as( + new FunctionExpression('add', [field('rating'), constant(1)]).as( 'rating' ) ) @@ -2196,9 +2815,9 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .where( - new BooleanExpr('and', [ - field('rating').gt(0), - field('title').charLength().lt(5), + new BooleanExpression('and', [ + field('rating').greaterThan(0), + field('title').charLength().lessThan(5), field('tags').arrayContains('propaganda') ]) ) @@ -2215,7 +2834,7 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .where( - new BooleanExpr('array_contains_any', [ + new BooleanExpression('array_contains_any', [ field('tags'), array(['politics']) ]) @@ -2233,9 +2852,9 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .aggregate( - new AggregateFunction('count_if', [field('rating').gte(4.5)]).as( - 'countOfBest' - ) + new AggregateFunction('count_if', [ + field('rating').greaterThanOrEqual(4.5) + ]).as('countOfBest') ) ); expectResults(snapshot, { @@ -2249,7 +2868,9 @@ apiDescribe('Pipelines', persistence => { .pipeline() .collection(randomCol.path) .sort( - new FunctionExpr('char_length', [field('title')]).ascending(), + new FunctionExpression('char_length', [ + field('title') + ]).ascending(), descending('__name__') ) .limit(3) @@ -2270,45 +2891,6 @@ apiDescribe('Pipelines', persistence => { }); }); - itIf(testUnsupportedFeatures)('testReplaceFirst', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(eq('title', 'The Lord of the Rings')) - .limit(1) - .select(replaceFirst('title', 'o', '0').as('newName')) - ); - expectResults(snapshot, { newName: 'The L0rd of the Rings' }); - }); - - itIf(testUnsupportedFeatures)('testReplaceAll', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(eq('title', 'The Lord of the Rings')) - .limit(1) - .select(replaceAll('title', 'o', '0').as('newName')) - ); - expectResults(snapshot, { newName: 'The L0rd 0f the Rings' }); - }); - - it('supports Rand', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(10) - .select(rand().as('result')) - ); - expect(snapshot.results.length).to.equal(10); - snapshot.results.forEach(d => { - expect(d.get('result')).to.be.lt(1); - expect(d.get('result')).to.be.gte(0); - }); - }); - it('supports array', async () => { const snapshot = await execute( firestore @@ -2341,14 +2923,14 @@ apiDescribe('Pipelines', persistence => { }); }); - it('supports arrayOffset', async () => { + it('supports arrayGet', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .sort(field('rating').descending()) .limit(3) - .select(arrayOffset('tags', 0).as('firstTag')) + .select(arrayGet('tags', 0).as('firstTag')) ); const expectedResults = [ { @@ -2369,7 +2951,7 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(3) - .select(field('tags').arrayOffset(0).as('firstTag')) + .select(field('tags').arrayGet(0).as('firstTag')) ); expectResults(snapshot, ...expectedResults); }); @@ -2521,12 +3103,16 @@ apiDescribe('Pipelines', persistence => { timestampAdd('timestamp', 'second', 10).as('plus10seconds'), timestampAdd('timestamp', 'microsecond', 10).as('plus10micros'), timestampAdd('timestamp', 'millisecond', 10).as('plus10millis'), - timestampSub('timestamp', 'day', 10).as('minus10days'), - timestampSub('timestamp', 'hour', 10).as('minus10hours'), - timestampSub('timestamp', 'minute', 10).as('minus10minutes'), - timestampSub('timestamp', 'second', 10).as('minus10seconds'), - timestampSub('timestamp', 'microsecond', 10).as('minus10micros'), - timestampSub('timestamp', 'millisecond', 10).as('minus10millis') + timestampSubtract('timestamp', 'day', 10).as('minus10days'), + timestampSubtract('timestamp', 'hour', 10).as('minus10hours'), + timestampSubtract('timestamp', 'minute', 10).as('minus10minutes'), + timestampSubtract('timestamp', 'second', 10).as('minus10seconds'), + timestampSubtract('timestamp', 'microsecond', 10).as( + 'minus10micros' + ), + timestampSubtract('timestamp', 'millisecond', 10).as( + 'minus10millis' + ) ) ); expectResults(snapshot, { @@ -2543,7 +3129,7 @@ apiDescribe('Pipelines', persistence => { minus10micros: new Timestamp(1741380234, 999990000), minus10millis: new Timestamp(1741380234, 990000000) }); - }); + }).timeout(10000); it('supports byteLength', async () => { const snapshot = await execute( @@ -2571,7 +3157,7 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol) .limit(1) .select(constant(true).as('trueField')) - .select('trueField', not(eq('trueField', true)).as('falseField')) + .select('trueField', not(equal('trueField', true)).as('falseField')) ); expectResults(snapshot, { @@ -2579,187 +3165,523 @@ apiDescribe('Pipelines', persistence => { falseField: false }); }); - }); - describe('not yet implemented in backend', () => { - itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + it('can reverse an array', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(bitAnd(constant(5), 12).as('result')) + .select(field('tags').arrayReverse().as('reversedTags')) ); expectResults(snapshot, { - result: 4 + reversedTags: ['adventure', 'space', 'comedy'] }); }); - itIf(testUnsupportedFeatures)('supports Bit_and', async () => { + it('can reverse an array with the top-level function', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(constant(5).bitAnd(12).as('result')) + .select(reverse('tags').as('reversedTags')) ); expectResults(snapshot, { - result: 4 + reversedTags: ['adventure', 'space', 'comedy'] }); }); - itIf(testUnsupportedFeatures)('supports Bit_or', async () => { - let snapshot = await execute( + it('can compute the ceiling of a numeric value', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(bitOr(constant(5), 12).as('result')) + .select(field('rating').ceil().as('ceilingRating')) ); expectResults(snapshot, { - result: 13 + ceilingRating: 5 }); - snapshot = await execute( + }); + + it('can compute the ceiling of a numeric value with the top-level function', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(constant(5).bitOr(12).as('result')) + .select(ceil('rating').as('ceilingRating')) ); expectResults(snapshot, { - result: 13 + ceilingRating: 5 }); }); - itIf(testUnsupportedFeatures)('supports Bit_xor', async () => { - let snapshot = await execute( + it('can compute the floor of a numeric value', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(bitXor(constant(5), 12).as('result')) + .select(field('rating').floor().as('floorRating')) ); expectResults(snapshot, { - result: 9 + floorRating: 4 }); - snapshot = await execute( + }); + + it('can compute the floor of a numeric value with the top-level function', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select(constant(5).bitXor(12).as('result')) + .select(floor('rating').as('floorRating')) ); expectResults(snapshot, { - result: 9 + floorRating: 4 }); }); - itIf(testUnsupportedFeatures)('supports Bit_not', async () => { - let snapshot = await execute( + it('can compute e to the power of a numeric value', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) .limit(1) - .select( - bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( - 'result' - ) - ) + .select(field('rating').exp().as('expRating')) ); expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) + expRating: 109.94717245212352 }); - snapshot = await execute( + }); + + it('can compute e to the power of a numeric value with the top-level function', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) - .bitNot() - .as('result') - ) + .select(exp('rating').as('expRating')) + ); + expect(snapshot.results[0].get('expRating')).to.be.approximately( + 109.94717245212351, + 0.000001 ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) - }); }); - itIf(testUnsupportedFeatures)('supports Bit_left_shift', async () => { - let snapshot = await execute( + it('can compute the power of a numeric value', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select( - bitLeftShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) + .select(field('rating').pow(2).as('powerRating')) ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); - snapshot = await execute( + expect(snapshot.results[0].get('powerRating')).to.be.approximately( + 17.64, + 0.0001 + ); + }); + + it('can compute the power of a numeric value with the top-level function', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitLeftShift(2) - .as('result') - ) + .select(pow('rating', 2).as('powerRating')) + ); + expect(snapshot.results[0].get('powerRating')).to.be.approximately( + 17.64, + 0.0001 ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); }); - itIf(testUnsupportedFeatures)('supports Bit_right_shift', async () => { - let snapshot = await execute( + it('can round a numeric value', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) - .select( - bitRightShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) + .select(field('rating').round().as('roundedRating')) ); expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + roundedRating: 4 }); - snapshot = await execute( + }); + + it('can round a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(round('rating').as('roundedRating')) + ); + expectResults(snapshot, { + roundedRating: 4 + }); + }); + + it('can round a numeric value away from zero for positive half-way values', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .addFields(constant(1.5).as('positiveHalf')) + .select(field('positiveHalf').round().as('roundedRating')) + ); + expectResults(snapshot, { + roundedRating: 2 + }); + }); + + it('can round a numeric value away from zero for negative half-way values', async () => { + const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) .limit(1) + .addFields(constant(-1.5).as('negativeHalf')) + .select(field('negativeHalf').round().as('roundedRating')) + ); + expectResults(snapshot, { + roundedRating: -2 + }); + }); + + it('can round a numeric value to specified precision', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .replaceWith( + map({ + foo: 4.123456 + }) + ) .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitRightShift(2) - .as('result') + field('foo').round(0).as('0'), + round('foo', 1).as('1'), + round('foo', constant(2)).as('2'), + round(field('foo'), 4).as('4') ) ); expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + '0': 4, + '1': 4.1, + '2': 4.12, + '4': 4.1235 + }); + }); + + it('can get the collectionId from a path', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(field('__name__').collectionId().as('collectionId')) + ); + expectResults(snapshot, { + collectionId: randomCol.id }); }); - itIf(testUnsupportedFeatures)('supports Document_id', async () => { + it('can get the collectionId from a path with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(collectionId('__name__').as('collectionId')) + ); + expectResults(snapshot, { + collectionId: randomCol.id + }); + }); + + it('can compute the length of a string value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('title').length().as('titleLength')) + ); + expectResults(snapshot, { + titleLength: 36 + }); + }); + + it('can compute the length of a string value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(length('title').as('titleLength')) + ); + expectResults(snapshot, { + titleLength: 36 + }); + }); + + it('can compute the length of an array value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('tags').length().as('tagsLength')) + ); + expectResults(snapshot, { + tagsLength: 3 + }); + }); + + it('can compute the length of an array value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(length('tags').as('tagsLength')) + ); + expectResults(snapshot, { + tagsLength: 3 + }); + }); + + it('can compute the length of a map value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('awards').length().as('awardsLength')) + ); + expectResults(snapshot, { + awardsLength: 3 + }); + }); + + it('can compute the length of a vector value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('embedding').length().as('embeddingLength')) + ); + expectResults(snapshot, { + embeddingLength: 10 + }); + }); + + it('can compute the length of a bytes value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .select(constant('12é').as('value')) + .limit(1) + .select(field('value').byteLength().as('valueLength')) + ); + expectResults(snapshot, { + valueLength: 4 + }); + }); + + it('can compute the natural logarithm of a numeric value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('rating').ln().as('lnRating')) + ); + expect(snapshot.results[0]!.data().lnRating).to.be.closeTo(1.435, 0.001); + }); + + it('can compute the natural logarithm of a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(ln('rating').as('lnRating')) + ); + expect(snapshot.results[0]!.data().lnRating).to.be.closeTo(1.435, 0.001); + }); + + it('can compute the natural logarithm of a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(ln('rating').as('lnRating')) + ); + expectResults(snapshot, { + lnRating: 1.4350845252893227 + }); + }); + + it('can compute the logarithm of a numeric value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(log(field('rating'), 10).as('logRating')) + ); + expectResults(snapshot, { + logRating: 0.6232492903979004 + }); + }); + + it('can compute the logarithm of a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(log('rating', 10).as('logRating')) + ); + expectResults(snapshot, { + logRating: 0.6232492903979004 + }); + }); + + it('can round a numeric value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('rating').round().as('roundedRating')) + ); + expectResults(snapshot, { + roundedRating: 4 + }); + }); + + it('can round a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(round('rating').as('roundedRating')) + ); + expectResults(snapshot, { + roundedRating: 4 + }); + }); + + it('can compute the square root of a numeric value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('rating').sqrt().as('sqrtRating')) + ); + expectResults(snapshot, { + sqrtRating: 2.04939015319192 + }); + }); + + it('can compute the square root of a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(sqrt('rating').as('sqrtRating')) + ); + expectResults(snapshot, { + sqrtRating: 2.04939015319192 + }); + }); + + it('can reverse a string', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(field('title').reverse().as('reversedTitle')) + ); + expectResults(snapshot, { + reversedTitle: "yxalaG eht ot ediuG s'rekihhctiH ehT" + }); + }); + + it('can reverse a string with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal("The Hitchhiker's Guide to the Galaxy")) + .limit(1) + .select(stringReverse('title').as('reversedTitle')) + ); + expectResults(snapshot, { + reversedTitle: "yxalaG eht ot ediuG s'rekihhctiH ehT" + }); + }); + + it('supports Document_id', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(documentId(field('__path__')).as('docId')) + .select( + documentId(field('__name__')).as('docId'), + documentId(field('__path__')).as('noDocId') + ) ); expectResults(snapshot, { - docId: 'book4' + docId: 'book4', + noDocId: null }); snapshot = await execute( firestore @@ -2767,21 +3689,21 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(field('__path__').documentId().as('docId')) + .select(field('__name__').documentId().as('docId')) ); expectResults(snapshot, { docId: 'book4' }); }); - itIf(testUnsupportedFeatures)('supports Substr', async () => { + it('supports substring', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(substr('title', 9, 2).as('of')) + .select(substring('title', 9, 2).as('of')) ); expectResults(snapshot, { of: 'of' @@ -2792,93 +3714,65 @@ apiDescribe('Pipelines', persistence => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(field('title').substr(9, 2).as('of')) + .select(field('title').substring(9, 2).as('of')) ); expectResults(snapshot, { of: 'of' }); }); - itIf(testUnsupportedFeatures)( - 'supports Substr without length', - async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(substr('title', 9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(field('title').substr(9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - } - ); - - itIf(testUnsupportedFeatures)('arrayConcat works', async () => { - const snapshot = await execute( + it('supports substring without length', async () => { + let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .select( - arrayConcat('tags', ['newTag1', 'newTag2'], field('tags'), [ - null - ]).as('modifiedTags') - ) + .sort(field('rating').descending()) .limit(1) + .select(substring('title', 9).as('of')) ); expectResults(snapshot, { - modifiedTags: [ - 'comedy', - 'space', - 'adventure', - 'newTag1', - 'newTag2', - 'comedy', - 'space', - 'adventure', - null - ] + of: 'of the Rings' + }); + snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .sort(field('rating').descending()) + .limit(1) + .select(field('title').substring(9).as('of')) + ); + expectResults(snapshot, { + of: 'of the Rings' }); }); - itIf(testUnsupportedFeatures)('testToLowercase', async () => { + it('test toLower', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .select(toLower('title').as('lowercaseTitle')) + .sort(ascending('title')) + .select(toLower('author').as('lowercaseAuthor')) .limit(1) ); expectResults(snapshot, { - lowercaseTitle: "the hitchhiker's guide to the galaxy" + lowercaseAuthor: 'george orwell' }); }); - itIf(testUnsupportedFeatures)('testToUppercase', async () => { + it('test toUpper', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .sort(ascending('title')) .select(toUpper('author').as('uppercaseAuthor')) .limit(1) ); - expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); + expectResults(snapshot, { uppercaseAuthor: 'GEORGE ORWELL' }); }); - itIf(testUnsupportedFeatures)('testTrim', async () => { + it('testTrim', async () => { const snapshot = await execute( firestore .pipeline() @@ -2895,20 +3789,204 @@ apiDescribe('Pipelines', persistence => { }); }); - itIf(testUnsupportedFeatures)('test reverse', async () => { + it('test reverse', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where(eq('title', '1984')) + .where(equal('title', '1984')) .limit(1) .select(reverse('title').as('reverseTitle')) ); - expectResults(snapshot, { title: '4891' }); + expectResults(snapshot, { reverseTitle: '4891' }); }); + + it('testAbs', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select( + constant(-10).as('neg10'), + constant(-22.22).as('neg22'), + constant(1).as('pos1') + ) + .select( + abs('neg10').as('10'), + abs(field('neg22')).as('22'), + field('pos1').as('1') + ) + ); + expectResults(snapshot, { + '10': 10, + '22': 22.22, + '1': 1 + }); + }); + + it('can compute the base-10 logarithm of a numeric value', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) + .limit(1) + .select(field('rating').log10().as('log10Rating')) + ); + expect(snapshot.results[0]!.data().log10Rating).to.be.closeTo( + 0.672, + 0.001 + ); + }); + + it('can compute the base-10 logarithm of a numeric value with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) + .limit(1) + .select(log10('rating').as('log10Rating')) + ); + expect(snapshot.results[0]!.data().log10Rating).to.be.closeTo( + 0.672, + 0.001 + ); + }); + + it('can concat fields', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .addFields( + concat('author', ' ', field('title')).as('display'), + field('author').concat(': ', field('title')).as('display2') + ) + .where(equal('author', 'Douglas Adams')) + .select('display', 'display2') + ); + expectResults(snapshot, { + display: "Douglas Adams The Hitchhiker's Guide to the Galaxy", + display2: "Douglas Adams: The Hitchhiker's Guide to the Galaxy" + }); + }); + + it('supports currentTimestamp', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .addFields(currentTimestamp().as('now')) + .select('now') + ); + const now = snapshot.results[0].get('now') as Timestamp; + expect(now).instanceof(Timestamp); + expect( + now.toDate().getUTCSeconds() - new Date().getUTCSeconds() + ).lessThan(5000); + }); + + // Not implemented in backend + // eslint-disable-next-line no-restricted-properties + it.skip('supports error', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .select(isError(error('test error')).as('error')) + ); + + expectResults(snapshot, { + 'error': true + }); + }); + + it('supports ifAbsent', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .replaceWith( + map({ + title: 'foo' + }) + ) + .select( + ifAbsent('title', 'default title').as('title'), + field('name').ifAbsent('default name').as('name'), + field('name').ifAbsent(field('title')).as('nameOrTitle') + ) + ); + + expectResults(snapshot, { + title: 'foo', + name: 'default name', + nameOrTitle: 'foo' + }); + }); + + it('supports join', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .limit(1) + .replaceWith( + map({ + tags: ['foo', 'bar', 'baz'], + delimeter: '|' + }) + ) + .select(join('tags', ',').as('csv'), field('tags').join('|').as('or')) + ); + + expectResults(snapshot, { + csv: 'foo,bar,baz', + or: 'foo|bar|baz' + }); + }); + + it('can compute the sum of the elements in an array', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) + .limit(1) + .addFields(array([150, 200]).as('sales')) + .select(field('sales').arraySum().as('totalSales')) + ); + expectResults(snapshot, { + totalSales: 350 + }); + }); + + it('can compute the sum of the elements in an array with the top-level function', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(field('title').equal('The Lord of the Rings')) + .limit(1) + .addFields(array([150, 200]).as('sales')) + .select(arraySum('sales').as('totalSales')) + ); + expectResults(snapshot, { + totalSales: 350 + }); + }); + + // TODO(new-expression): Add new expression tests above this line }); describe('pagination', () => { + let addedDocs: DocumentReference[] = []; + /** * Adds several books to the test collection. These * additional books support pagination test scenarios @@ -2919,7 +3997,9 @@ apiDescribe('Pipelines', persistence => { async function addBooks( collectionReference: CollectionReference ): Promise { - await setDoc(doc(collectionReference, 'book11'), { + let docRef = doc(collectionReference, 'book11'); + addedDocs.push(docRef); + await setDoc(docRef, { title: 'Jonathan Strange & Mr Norrell', author: 'Susanna Clarke', genre: 'Fantasy', @@ -2928,7 +4008,9 @@ apiDescribe('Pipelines', persistence => { tags: ['historical fantasy', 'magic', 'alternate history', 'england'], awards: { hugo: false, nebula: false } }); - await setDoc(doc(collectionReference, 'book12'), { + docRef = doc(collectionReference, 'book12'); + addedDocs.push(docRef); + await setDoc(docRef, { title: 'The Master and Margarita', author: 'Mikhail Bulgakov', genre: 'Satire', @@ -2942,7 +4024,9 @@ apiDescribe('Pipelines', persistence => { ], awards: {} }); - await setDoc(doc(collectionReference, 'book13'), { + docRef = doc(collectionReference, 'book13'); + addedDocs.push(docRef); + await setDoc(docRef, { title: 'A Long Way to a Small, Angry Planet', author: 'Becky Chambers', genre: 'Science Fiction', @@ -2953,125 +4037,135 @@ apiDescribe('Pipelines', persistence => { }); } - // sort on __name__ is not working, see b/409358591 - itIf(testUnsupportedFeatures)( - 'supports pagination with filters', - async () => { - await addBooks(randomCol); - const pageSize = 2; - const pipeline = firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'rating', '__name__') - .sort(field('rating').descending(), field('__name__').ascending()); + afterEach(async () => { + for (let i = 0; i < addedDocs.length; i++) { + await deleteDoc(addedDocs[i]); + } + addedDocs = []; + }); - let snapshot = await execute(pipeline.limit(pageSize)); - expectResults( - snapshot, - { title: 'The Lord of the Rings', rating: 4.7 }, - { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 } - ); + it('supports pagination with filters', async () => { + await addBooks(randomCol); + const pageSize = 2; + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', '__name__') + .sort(field('rating').descending(), field('__name__').ascending()); - const lastDoc = snapshot.results[snapshot.results.length - 1]; + let snapshot = await execute(pipeline.limit(pageSize)); + expectResults( + snapshot, + { title: 'The Lord of the Rings', rating: 4.7 }, + { title: 'Dune', rating: 4.6 } + ); - snapshot = await execute( - pipeline - .where( - or( - and( - field('rating').eq(lastDoc.get('rating')), - field('__path__').gt(lastDoc.ref?.id) - ), - field('rating').lt(lastDoc.get('rating')) - ) + const lastDoc = snapshot.results[snapshot.results.length - 1]; + + snapshot = await execute( + pipeline + .where( + or( + and( + field('rating').equal(lastDoc.get('rating')), + field('__name__').greaterThan(lastDoc.ref) + ), + field('rating').lessThan(lastDoc.get('rating')) ) - .limit(pageSize) - ); - expectResults( - snapshot, - { title: 'Pride and Prejudice', rating: 4.5 }, - { title: 'Crime and Punishment', rating: 4.3 } - ); - } - ); + ) + .limit(pageSize) + ); + expectResults( + snapshot, + { title: 'Jonathan Strange & Mr Norrell', rating: 4.6 }, + { title: 'The Master and Margarita', rating: 4.6 } + ); + }); - // sort on __name__ is not working, see b/409358591 - itIf(testUnsupportedFeatures)( - 'supports pagination with offsets', - async () => { - await addBooks(randomCol); + it('supports pagination with offsets', async () => { + await addBooks(randomCol); - const secondFilterField = '__path__'; + const secondFilterField = '__name__'; - const pipeline = firestore - .pipeline() - .collection(randomCol.path) - .select('title', 'rating', secondFilterField) - .sort( - field('rating').descending(), - field(secondFilterField).ascending() - ); + const pipeline = firestore + .pipeline() + .collection(randomCol.path) + .select('title', 'rating', secondFilterField) + .sort( + field('rating').descending(), + field(secondFilterField).ascending() + ); - const pageSize = 2; - let currPage = 0; + const pageSize = 2; + let currPage = 0; - let snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) - ); + let snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); - expectResults( - snapshot, - { - title: 'The Lord of the Rings', - rating: 4.7 - }, - { title: 'Dune', rating: 4.6 } - ); + expectResults( + snapshot, + { + title: 'The Lord of the Rings', + rating: 4.7 + }, + { title: 'Dune', rating: 4.6 } + ); - snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) - ); - expectResults( - snapshot, - { - title: 'Jonathan Strange & Mr Norrell', - rating: 4.6 - }, - { title: 'The Master and Margarita', rating: 4.6 } - ); + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'Jonathan Strange & Mr Norrell', + rating: 4.6 + }, + { title: 'The Master and Margarita', rating: 4.6 } + ); - snapshot = await execute( - pipeline.offset(currPage++ * pageSize).limit(pageSize) - ); - expectResults( - snapshot, - { - title: 'A Long Way to a Small, Angry Planet', - rating: 4.6 - }, - { - title: 'Pride and Prejudice', - rating: 4.5 - } - ); - } - ); + snapshot = await execute( + pipeline.offset(currPage++ * pageSize).limit(pageSize) + ); + expectResults( + snapshot, + { + title: 'A Long Way to a Small, Angry Planet', + rating: 4.6 + }, + { + title: 'Pride and Prejudice', + rating: 4.5 + } + ); + }); }); - describe('console support', () => { - it('supports internal serialization to proto', async () => { - const pipeline = firestore - .pipeline() - .collection('books') - .where(eq('awards.hugo', true)) - .select( - 'title', - field('nestedField.level.1'), - mapGet('nestedField', 'level.1').mapGet('level.2').as('nested') + describe('stage options', () => { + describe('forceIndex', () => { + // SKIP: requires pre-existing index + // eslint-disable-next-line no-restricted-properties + it.skip('Collection Stage', async () => { + const snapshot = await execute( + firestore.pipeline().collection({ + collection: randomCol, + forceIndex: 'unknown' + }) ); + expect(snapshot.results.length).to.equal(10); + }); - const proto = _internalPipelineToExecutePipelineRequestProto(pipeline); - expect(proto).not.to.be.null; + // SKIP: requires pre-existing index + // eslint-disable-next-line no-restricted-properties + it.skip('CollectionGroup Stage', async () => { + const snapshot = await execute( + firestore.pipeline().collectionGroup({ + collectionId: randomCol.id, + forceIndex: 'unknown' + }) + ); + expect(snapshot.results.length).to.equal(10); + }); }); }); }); diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index ac1d2e79007..4615f3c536a 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -59,7 +59,7 @@ const testUnsupportedFeatures: boolean | 'only' = false; // This is the Query integration tests from the lite API (no cache support) // with some additional test cases added for more complete coverage. -apiDescribe('Query to Pipeline', persistence => { +apiDescribe.skip('Query to Pipeline', persistence => { addEqualityMatcher(); function verifyResults( diff --git a/packages/firestore/test/lite/pipeline.test.ts b/packages/firestore/test/lite/pipeline.test.ts index f919e1aa9de..1633492b578 100644 --- a/packages/firestore/test/lite/pipeline.test.ts +++ b/packages/firestore/test/lite/pipeline.test.ts @@ -29,47 +29,38 @@ import { field, and, array, - arrayOffset, constant, add, subtract, multiply, - avg, - bitAnd, - substr, - constantVector, - bitLeftShift, - bitNot, + average, + substring, count, mapMerge, mapRemove, - bitOr, ifError, isAbsent, isError, or, - rand, - bitRightShift, - bitXor, isNotNan, map, isNotNull, isNull, mod, documentId, - eq, - neq, - lt, + equal, + notEqual, + lessThan, countIf, - lte, - gt, + lessThanOrEqual, + greaterThan, arrayConcat, arrayContains, arrayContainsAny, - eqAny, - notEqAny, + equalAny, + notEqualAny, xor, - cond, + conditional, logicalMaximum, logicalMinimum, exists, @@ -78,7 +69,7 @@ import { like, regexContains, regexMatch, - strContains, + stringContains, startsWith, endsWith, mapGet, @@ -96,25 +87,25 @@ import { unixSecondsToTimestamp, timestampToUnixSeconds, timestampAdd, - timestampSub, + timestampSubtract, ascending, descending, - FunctionExpr, - BooleanExpr, + FunctionExpression, + BooleanExpression, AggregateFunction, sum, - strConcat, + stringConcat, arrayContainsAll, arrayLength, charLength, divide, - replaceFirst, - replaceAll, - byteLength, + abs, not, toLower, toUpper, - trim + trim, + arrayGet, + byteLength } from '../../src/lite-api/expressions'; import { documentId as documentIdFieldPath } from '../../src/lite-api/field_path'; import { vector } from '../../src/lite-api/field_value_impl'; @@ -131,7 +122,7 @@ import { doc } from '../../src/lite-api/reference'; import { addDoc, setDoc } from '../../src/lite-api/reference_impl'; -import { FindNearestOptions } from '../../src/lite-api/stage'; +import { FindNearestStageOptions } from '../../src/lite-api/stage_options'; import { Timestamp } from '../../src/lite-api/timestamp'; import { writeBatch } from '../../src/lite-api/write_batch'; import { itIf } from '../integration/util/helpers'; @@ -345,7 +336,6 @@ describe('Firestore Pipelines', () => { .sort(ascending('__name__')); const snapshot = await execute(ppl); expect(snapshot.results.length).to.equal(10); - expect(snapshot.pipeline).to.equal(ppl); expectResults( snapshot, 'book1', @@ -388,7 +378,7 @@ describe('Firestore Pipelines', () => { ); }); - it.only('returns execution time for an empty query', async () => { + it('returns execution time for an empty query', async () => { const start = new Date().valueOf(); const pipeline = firestore.pipeline().collection(randomCol.path).limit(0); @@ -445,7 +435,7 @@ describe('Firestore Pipelines', () => { const pipeline = firestore .pipeline() .collection(randomCol.path) - .aggregate(avg('rating').as('avgRating')); + .aggregate(average('rating').as('avgRating')); const snapshot = await execute(pipeline); const end = new Date().valueOf(); @@ -463,7 +453,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [average('rating').as('avgRating')], groups: ['genre'] }); @@ -559,7 +549,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .database() - .where(eq('randomId', randomId)) + .where(equal('randomId', randomId)) .sort(ascending('order')) ); expectResults(snapshot, doc1.id, doc2.id); @@ -582,8 +572,7 @@ describe('Firestore Pipelines', () => { Bytes.fromUint8Array(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 0])) ).as('bytes'), constant(doc(firestore, 'foo', 'bar')).as('documentReference'), - constantVector(vector([1, 2, 3])).as('vectorValue'), - constantVector([1, 2, 3]).as('vectorValue2'), + constant(vector([1, 2, 3])).as('vectorValue'), map({ 'number': 1, 'string': 'a string', @@ -746,7 +735,7 @@ describe('Firestore Pipelines', () => { ) .where( and( - eq('metadataArray', [ + equal('metadataArray', [ 1, 2, field('genre'), @@ -756,7 +745,7 @@ describe('Firestore Pipelines', () => { published: field('published') } ]), - eq('metadata', { + equal('metadata', { genre: field('genre'), rating: multiply('rating', 10), nestedArray: [field('title')], @@ -815,10 +804,10 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('genre', 'Science Fiction')) + .where(equal('genre', 'Science Fiction')) .aggregate( countAll().as('count'), - avg('rating').as('avgRating'), + average('rating').as('avgRating'), maximum('rating').as('maxRating'), sum('rating').as('sumRating') ) @@ -837,7 +826,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(lt('published', 1900)) + .where(lessThan('published', 1900)) .aggregate({ accumulators: [], groups: ['genre'] @@ -851,12 +840,12 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(lt(field('published'), 1984)) + .where(lessThan(field('published'), 1984)) .aggregate({ - accumulators: [avg('rating').as('avgRating')], + accumulators: [average('rating').as('avgRating')], groups: ['genre'] }) - .where(gt('avgRating', 4.3)) + .where(greaterThan('avgRating', 4.3)) .sort(field('avgRating').descending()) ); expectResults( @@ -867,7 +856,7 @@ describe('Firestore Pipelines', () => { ); }); - it('returns min, max, count, and countAll accumulations', async () => { + it('returns minimum, maximum, count, and countAll accumulations', async () => { const snapshot = await execute( firestore .pipeline() @@ -892,7 +881,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .aggregate(countIf(field('rating').gt(4.3)).as('count')) + .aggregate(countIf(field('rating').greaterThan(4.3)).as('count')) ); const expectedResults = { count: 3 @@ -903,7 +892,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .aggregate(field('rating').gt(4.3).countIf().as('count')) + .aggregate(field('rating').greaterThan(4.3).countIf().as('count')) ); expectResults(snapshot, expectedResults); }); @@ -1068,8 +1057,8 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( and( - gt('rating', 4.5), - eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) + greaterThan('rating', 4.5), + equalAny('genre', ['Science Fiction', 'Romance', 'Fantasy']) ) ) ); @@ -1082,9 +1071,9 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( and( - gt('rating', 4.5), - eqAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), - lt('published', 1965) + greaterThan('rating', 4.5), + equalAny('genre', ['Science Fiction', 'Romance', 'Fantasy']), + lessThan('published', 1965) ) ) ); @@ -1097,9 +1086,9 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( or( - eq('genre', 'Romance'), - eq('genre', 'Dystopian'), - eq('genre', 'Fantasy') + equal('genre', 'Romance'), + equal('genre', 'Dystopian'), + equal('genre', 'Fantasy') ) ) .sort(ascending('title')) @@ -1121,10 +1110,10 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( xor( - eq('genre', 'Romance'), - eq('genre', 'Dystopian'), - eq('genre', 'Fantasy'), - eq('published', 1949) + equal('genre', 'Romance'), + equal('genre', 'Dystopian'), + equal('genre', 'Fantasy'), + equal('published', 1949) ) ) .select('title') @@ -1158,13 +1147,13 @@ describe('Firestore Pipelines', () => { }); }); - describe('generic stage', () => { + describe('raw stage', () => { it('can select fields', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .genericStage('select', [ + .rawStage('select', [ { title: field('title'), metadata: { @@ -1191,9 +1180,9 @@ describe('Firestore Pipelines', () => { .sort(field('author').ascending()) .limit(1) .select('title', 'author') - .genericStage('add_fields', [ + .rawStage('add_fields', [ { - display: strConcat('title', ' - ', field('author')) + display: stringConcat('title', ' - ', field('author')) } ]) ); @@ -1210,7 +1199,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select('title', 'author') - .genericStage('where', [field('author').eq('Douglas Adams')]) + .rawStage('where', [field('author').equal('Douglas Adams')]) ); expectResults(snapshot, { title: "The Hitchhiker's Guide to the Galaxy", @@ -1224,14 +1213,14 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select('title', 'author') - .genericStage('sort', [ + .rawStage('sort', [ { direction: 'ascending', expression: field('author') } ]) - .genericStage('offset', [3]) - .genericStage('limit', [1]) + .rawStage('offset', [3]) + .rawStage('limit', [1]) ); expectResults(snapshot, { author: 'Fyodor Dostoevsky', @@ -1245,8 +1234,8 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select('title', 'author', 'rating') - .genericStage('aggregate', [ - { averageRating: field('rating').avg() }, + .rawStage('aggregate', [ + { averageRating: field('rating').average() }, {} ]) ); @@ -1261,7 +1250,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select('title', 'author', 'rating') - .genericStage('distinct', [{ rating: field('rating') }]) + .rawStage('distinct', [{ rating: field('rating') }]) .sort(field('rating').descending()) ); expectResults( @@ -1297,7 +1286,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .replaceWith('awards') ); expectResults(snapshot, { @@ -1312,7 +1301,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .replaceWith( map({ foo: 'bar', @@ -1407,7 +1396,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .unnest(field('tags').as('tag')) .select( 'title', @@ -1475,7 +1464,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', "The Hitchhiker's Guide to the Galaxy")) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")) .unnest(array([1, 2, 3]).as('copy')) .select( 'title', @@ -1542,7 +1531,7 @@ describe('Firestore Pipelines', () => { describe('findNearest stage', () => { it('run pipeline with findNearest', async () => { - const measures: Array = [ + const measures: Array = [ 'euclidean', 'dot_product', 'cosine' @@ -1605,7 +1594,7 @@ describe('Firestore Pipelines', () => { }); describe('function expressions', () => { - it('logical max works', async () => { + it('logical maximum works', async () => { const snapshot = await execute( firestore .pipeline() @@ -1627,7 +1616,7 @@ describe('Firestore Pipelines', () => { ); }); - it('logical min works', async () => { + it('logical minimum works', async () => { const snapshot = await execute( firestore .pipeline() @@ -1649,15 +1638,15 @@ describe('Firestore Pipelines', () => { ); }); - it('cond works', async () => { + it('conditiona works', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .select( 'title', - cond( - lt(field('published'), 1960), + conditional( + lessThan(field('published'), 1960), constant(1960), field('published') ).as('published-safe') @@ -1678,7 +1667,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eqAny('published', [1979, 1999, 1967])) + .where(equalAny('published', [1979, 1999, 1967])) .sort(descending('title')) .select('title') ); @@ -1695,7 +1684,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where( - notEqAny( + notEqualAny( 'published', [1965, 1925, 1949, 1960, 1866, 1985, 1954, 1967, 1979] ) @@ -1751,7 +1740,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select(arrayLength('tags').as('tagsCount')) - .where(eq('tagsCount', 3)) + .where(equal('tagsCount', 3)) ); expect(snapshot.results.length).to.equal(10); }); @@ -1763,7 +1752,7 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .sort(ascending('author')) .select( - field('author').strConcat(' - ', field('title')).as('bookInfo') + field('author').stringConcat(' - ', field('title')).as('bookInfo') ) .limit(1) ); @@ -1811,7 +1800,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(strContains('title', "'s")) + .where(stringContains('title', "'s")) .select('title') .sort(field('title').ascending()) ); @@ -1828,7 +1817,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select(charLength('title').as('titleLength'), field('title')) - .where(gt('titleLength', 20)) + .where(greaterThan('titleLength', 20)) .sort(field('title').ascending()) ); @@ -1892,14 +1881,14 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('title', 'To Kill a Mockingbird')) + .where(equal('title', 'To Kill a Mockingbird')) .select( add(field('rating'), 1).as('ratingPlusOne'), subtract(field('published'), 1900).as('yearsSince1900'), field('rating').multiply(10).as('ratingTimesTen'), divide('rating', 2).as('ratingDividedByTwo'), - multiply('rating', 10, 2).as('ratingTimes20'), - add('rating', 1, 2).as('ratingPlus3'), + multiply('rating', 10).as('ratingTimes20'), + add('rating', 1).as('ratingPlus3'), mod('rating', 2).as('ratingMod2') ) .limit(1) @@ -1915,6 +1904,20 @@ describe('Firestore Pipelines', () => { }); }); + it('testAbs', async () => { + const snapshot = await execute( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('title', 'To Kill a Mockingbird')) + .select(abs(field('rating')).as('absRating')) + .limit(1) + ); + expectResults(snapshot, { + absRating: 4.2 + }); + }); + it('testComparisonOperators', async () => { const snapshot = await execute( firestore @@ -1922,9 +1925,9 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( and( - gt('rating', 4.2), - lte(field('rating'), 4.5), - neq('genre', 'Science Fiction') + greaterThan('rating', 4.2), + lessThanOrEqual(field('rating'), 4.5), + notEqual('genre', 'Science Fiction') ) ) .select('rating', 'title') @@ -1948,8 +1951,11 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .where( or( - and(gt('rating', 4.5), eq('genre', 'Science Fiction')), - lt('published', 1900) + and( + greaterThan('rating', 4.5), + equal('genre', 'Science Fiction') + ), + lessThan('published', 1900) ) ) .select('title') @@ -1963,7 +1969,7 @@ describe('Firestore Pipelines', () => { ); }); - it.only('testChecks', async () => { + it('testChecks', async () => { let snapshot = await execute( firestore .pipeline() @@ -1973,10 +1979,8 @@ describe('Firestore Pipelines', () => { .select( isNull('rating').as('ratingIsNull'), isNan('rating').as('ratingIsNaN'), - isError(arrayOffset('title', 0)).as('isError'), - ifError(arrayOffset('title', 0), constant('was error')).as( - 'ifError' - ), + isError(arrayGet('title', 0)).as('isError'), + ifError(arrayGet('title', 0), constant('was error')).as('ifError'), isAbsent('foo').as('isAbsent'), isNotNull('title').as('titleIsNotNull'), isNotNan('cost').as('costIsNotNan'), @@ -2005,10 +2009,8 @@ describe('Firestore Pipelines', () => { .select( field('rating').isNull().as('ratingIsNull'), field('rating').isNan().as('ratingIsNaN'), - arrayOffset('title', 0).isError().as('isError'), - arrayOffset('title', 0) - .ifError(constant('was error')) - .as('ifError'), + arrayGet('title', 0).isError().as('isError'), + arrayGet('title', 0).ifError(constant('was error')).as('ifError'), field('foo').isAbsent().as('isAbsent'), field('title').isNotNull().as('titleIsNotNull'), field('cost').isNotNan().as('costIsNotNan') @@ -2036,7 +2038,7 @@ describe('Firestore Pipelines', () => { field('awards').mapGet('others').as('others'), field('title') ) - .where(eq('hugoAward', true)) + .where(equal('hugoAward', true)) ); expectResults( snapshot, @@ -2050,20 +2052,20 @@ describe('Firestore Pipelines', () => { }); it('testDistanceFunctions', async () => { - const sourceVector = [0.1, 0.1]; - const targetVector = [0.5, 0.8]; + const sourceVector = vector([0.1, 0.1]); + const targetVector = vector([0.5, 0.8]); let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .select( - cosineDistance(constantVector(sourceVector), targetVector).as( + cosineDistance(constant(sourceVector), targetVector).as( 'cosineDistance' ), - dotProduct(constantVector(sourceVector), targetVector).as( + dotProduct(constant(sourceVector), targetVector).as( 'dotProductDistance' ), - euclideanDistance(constantVector(sourceVector), targetVector).as( + euclideanDistance(constant(sourceVector), targetVector).as( 'euclideanDistance' ) ) @@ -2081,13 +2083,13 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .select( - constantVector(sourceVector) + constant(sourceVector) .cosineDistance(targetVector) .as('cosineDistance'), - constantVector(sourceVector) + constant(sourceVector) .dotProduct(targetVector) .as('dotProductDistance'), - constantVector(sourceVector) + constant(sourceVector) .euclideanDistance(targetVector) .as('euclideanDistance') ) @@ -2107,7 +2109,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .limit(1) - .select(vectorLength(constantVector([1, 2, 3])).as('vectorLength')) + .select(vectorLength(constant(vector([1, 2, 3]))).as('vectorLength')) ); expectResults(snapshot, { vectorLength: 3 @@ -2119,7 +2121,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('awards.hugo', true)) + .where(equal('awards.hugo', true)) .sort(descending('title')) .select('title', 'awards.hugo') ); @@ -2138,7 +2140,7 @@ describe('Firestore Pipelines', () => { firestore .pipeline() .collection(randomCol.path) - .where(eq('awards.hugo', true)) + .where(equal('awards.hugo', true)) .select( 'title', field('nestedField.level.1'), @@ -2166,7 +2168,7 @@ describe('Firestore Pipelines', () => { .sort(descending('rating')) .limit(1) .select( - new FunctionExpr('add', [field('rating'), constant(1)]).as( + new FunctionExpression('add', [field('rating'), constant(1)]).as( 'rating' ) ) @@ -2182,9 +2184,9 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where( - new BooleanExpr('and', [ - field('rating').gt(0), - field('title').charLength().lt(5), + new BooleanExpression('and', [ + field('rating').greaterThan(0), + field('title').charLength().lessThan(5), field('tags').arrayContains('propaganda') ]) ) @@ -2201,7 +2203,7 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .where( - new BooleanExpr('array_contains_any', [ + new BooleanExpression('array_contains_any', [ field('tags'), array(['politics']) ]) @@ -2219,9 +2221,9 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .aggregate( - new AggregateFunction('count_if', [field('rating').gte(4.5)]).as( - 'countOfBest' - ) + new AggregateFunction('count_if', [ + field('rating').greaterThanOrEqual(4.5) + ]).as('countOfBest') ) ); expectResults(snapshot, { @@ -2235,7 +2237,9 @@ describe('Firestore Pipelines', () => { .pipeline() .collection(randomCol.path) .sort( - new FunctionExpr('char_length', [field('title')]).ascending(), + new FunctionExpression('char_length', [ + field('title') + ]).ascending(), descending('__name__') ) .limit(3) @@ -2256,45 +2260,6 @@ describe('Firestore Pipelines', () => { }); }); - itIf(testUnsupportedFeatures)('testReplaceFirst', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(eq('title', 'The Lord of the Rings')) - .limit(1) - .select(replaceFirst('title', 'o', '0').as('newName')) - ); - expectResults(snapshot, { newName: 'The L0rd of the Rings' }); - }); - - itIf(testUnsupportedFeatures)('testReplaceAll', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .where(eq('title', 'The Lord of the Rings')) - .limit(1) - .select(replaceAll('title', 'o', '0').as('newName')) - ); - expectResults(snapshot, { newName: 'The L0rd 0f the Rings' }); - }); - - it('supports Rand', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(10) - .select(rand().as('result')) - ); - expect(snapshot.results.length).to.equal(10); - snapshot.results.forEach(d => { - expect(d.get('result')).to.be.lt(1); - expect(d.get('result')).to.be.gte(0); - }); - }); - it('supports array', async () => { const snapshot = await execute( firestore @@ -2334,7 +2299,7 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(3) - .select(arrayOffset('tags', 0).as('firstTag')) + .select(arrayGet('tags', 0).as('firstTag')) ); const expectedResults = [ { @@ -2355,7 +2320,7 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(3) - .select(field('tags').arrayOffset(0).as('firstTag')) + .select(field('tags').arrayGet(0).as('firstTag')) ); expectResults(snapshot, ...expectedResults); }); @@ -2507,12 +2472,16 @@ describe('Firestore Pipelines', () => { timestampAdd('timestamp', 'second', 10).as('plus10seconds'), timestampAdd('timestamp', 'microsecond', 10).as('plus10micros'), timestampAdd('timestamp', 'millisecond', 10).as('plus10millis'), - timestampSub('timestamp', 'day', 10).as('minus10days'), - timestampSub('timestamp', 'hour', 10).as('minus10hours'), - timestampSub('timestamp', 'minute', 10).as('minus10minutes'), - timestampSub('timestamp', 'second', 10).as('minus10seconds'), - timestampSub('timestamp', 'microsecond', 10).as('minus10micros'), - timestampSub('timestamp', 'millisecond', 10).as('minus10millis') + timestampSubtract('timestamp', 'day', 10).as('minus10days'), + timestampSubtract('timestamp', 'hour', 10).as('minus10hours'), + timestampSubtract('timestamp', 'minute', 10).as('minus10minutes'), + timestampSubtract('timestamp', 'second', 10).as('minus10seconds'), + timestampSubtract('timestamp', 'microsecond', 10).as( + 'minus10micros' + ), + timestampSubtract('timestamp', 'millisecond', 10).as( + 'minus10millis' + ) ) ); expectResults(snapshot, { @@ -2529,7 +2498,7 @@ describe('Firestore Pipelines', () => { minus10micros: new Timestamp(1741380234, 999990000), minus10millis: new Timestamp(1741380234, 990000000) }); - }); + }).timeout(10000); it('supports byteLength', async () => { const snapshot = await execute( @@ -2557,7 +2526,7 @@ describe('Firestore Pipelines', () => { .collection(randomCol) .limit(1) .select(constant(true).as('trueField')) - .select('trueField', not(eq('trueField', true)).as('falseField')) + .select('trueField', not(equal('trueField', true)).as('falseField')) ); expectResults(snapshot, { @@ -2565,187 +2534,43 @@ describe('Firestore Pipelines', () => { falseField: false }); }); - }); - - describe('not yet implemented in backend', () => { - itIf(testUnsupportedFeatures)('supports Bit_and', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitAnd(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 4 - }); - }); - - itIf(testUnsupportedFeatures)('supports Bit_and', async () => { - const snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitAnd(12).as('result')) - ); - expectResults(snapshot, { - result: 4 - }); - }); - - itIf(testUnsupportedFeatures)('supports Bit_or', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitOr(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 13 - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitOr(12).as('result')) - ); - expectResults(snapshot, { - result: 13 - }); - }); - - itIf(testUnsupportedFeatures)('supports Bit_xor', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(bitXor(constant(5), 12).as('result')) - ); - expectResults(snapshot, { - result: 9 - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select(constant(5).bitXor(12).as('result')) - ); - expectResults(snapshot, { - result: 9 - }); - }); - - itIf(testUnsupportedFeatures)('supports Bit_not', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - bitNot(constant(Bytes.fromUint8Array(Uint8Array.of(0xfd)))).as( - 'result' - ) - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0xfd))) - .bitNot() - .as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x02)) - }); - }); - - itIf(testUnsupportedFeatures)('supports Bit_left_shift', async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - bitLeftShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitLeftShift(2) - .as('result') - ) - ); - expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x04)) - }); - }); - itIf(testUnsupportedFeatures)('supports Bit_right_shift', async () => { + it('supports Document_id', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .sort(field('rating').descending()) .limit(1) - .select( - bitRightShift( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))), - 2 - ).as('result') - ) + .select(documentId(field('__path__')).as('docId')) ); expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + docId: 'book4' }); snapshot = await execute( firestore .pipeline() .collection(randomCol.path) + .sort(field('rating').descending()) .limit(1) - .select( - constant(Bytes.fromUint8Array(Uint8Array.of(0x02))) - .bitRightShift(2) - .as('result') - ) + .select(field('__path__').documentId().as('docId')) ); expectResults(snapshot, { - result: Bytes.fromUint8Array(Uint8Array.of(0x01)) + docId: 'book4' }); }); - itIf(testUnsupportedFeatures)('supports Document_id', async () => { + it('supports Substr', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(documentId(field('__path__')).as('docId')) + .select(substring('title', 9, 2).as('of')) ); expectResults(snapshot, { - docId: 'book4' + of: 'of' }); snapshot = await execute( firestore @@ -2753,24 +2578,24 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(field('__path__').documentId().as('docId')) + .select(field('title').substring(9, 2).as('of')) ); expectResults(snapshot, { - docId: 'book4' + of: 'of' }); }); - itIf(testUnsupportedFeatures)('supports Substr', async () => { + it('supports Substr without length', async () => { let snapshot = await execute( firestore .pipeline() .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(substr('title', 9, 2).as('of')) + .select(substring('title', 9).as('of')) ); expectResults(snapshot, { - of: 'of' + of: 'of the Rings' }); snapshot = await execute( firestore @@ -2778,42 +2603,14 @@ describe('Firestore Pipelines', () => { .collection(randomCol.path) .sort(field('rating').descending()) .limit(1) - .select(field('title').substr(9, 2).as('of')) + .select(field('title').substring(9).as('of')) ); expectResults(snapshot, { - of: 'of' + of: 'of the Rings' }); }); - itIf(testUnsupportedFeatures)( - 'supports Substr without length', - async () => { - let snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(substr('title', 9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - snapshot = await execute( - firestore - .pipeline() - .collection(randomCol.path) - .sort(field('rating').descending()) - .limit(1) - .select(field('title').substr(9).as('of')) - ); - expectResults(snapshot, { - of: 'of the Rings' - }); - } - ); - - itIf(testUnsupportedFeatures)('arrayConcat works', async () => { + it('arrayConcat works', async () => { const snapshot = await execute( firestore .pipeline() @@ -2840,7 +2637,7 @@ describe('Firestore Pipelines', () => { }); }); - itIf(testUnsupportedFeatures)('testToLowercase', async () => { + it('testToLowercase', async () => { const snapshot = await execute( firestore .pipeline() @@ -2853,7 +2650,7 @@ describe('Firestore Pipelines', () => { }); }); - itIf(testUnsupportedFeatures)('testToUppercase', async () => { + it('testToUppercase', async () => { const snapshot = await execute( firestore .pipeline() @@ -2864,7 +2661,7 @@ describe('Firestore Pipelines', () => { expectResults(snapshot, { uppercaseAuthor: 'DOUGLAS ADAMS' }); }); - itIf(testUnsupportedFeatures)('testTrim', async () => { + it('testTrim', async () => { const snapshot = await execute( firestore .pipeline() @@ -2881,12 +2678,12 @@ describe('Firestore Pipelines', () => { }); }); - itIf(testUnsupportedFeatures)('test reverse', async () => { + it('test reverse', async () => { const snapshot = await execute( firestore .pipeline() .collection(randomCol.path) - .where(eq('title', '1984')) + .where(equal('title', '1984')) .limit(1) .select(reverse('title').as('reverseTitle')) ); @@ -2965,10 +2762,10 @@ describe('Firestore Pipelines', () => { .where( or( and( - field('rating').eq(lastDoc.get('rating')), - field('__path__').gt(lastDoc.ref?.id) + field('rating').equal(lastDoc.get('rating')), + field('__path__').greaterThan(lastDoc.ref?.id) ), - field('rating').lt(lastDoc.get('rating')) + field('rating').lessThan(lastDoc.get('rating')) ) ) .limit(pageSize) diff --git a/packages/firestore/test/unit/api/pipeline_impl.test.ts b/packages/firestore/test/unit/api/pipeline_impl.test.ts new file mode 100644 index 00000000000..f11db5a427e --- /dev/null +++ b/packages/firestore/test/unit/api/pipeline_impl.test.ts @@ -0,0 +1,202 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import * as sinon from 'sinon'; + +import { Timestamp } from '../../../src'; +import { Firestore } from '../../../src/api/database'; +import { execute } from '../../../src/api/pipeline_impl'; +import { + MemoryOfflineComponentProvider, + OnlineComponentProvider +} from '../../../src/core/component_provider'; +import { + ExecutePipelineRequest as ProtoExecutePipelineRequest, + ExecutePipelineResponse as ProtoExecutePipelineResponse +} from '../../../src/protos/firestore_proto_api'; +import { newTestFirestore } from '../../util/api_helpers'; + +const FIRST_CALL = 0; +const EXECUTE_PIPELINE_REQUEST = 3; + +function fakePipelineResponse( + firestore: Firestore, + response?: ProtoExecutePipelineResponse[] +): sinon.SinonSpy { + response = response ?? [ + { + executionTime: Timestamp.now().toDate().toISOString(), + results: [] + } + ]; + const fake = sinon.fake.resolves(response); + + firestore._componentsProvider = { + _offline: { + build: () => new MemoryOfflineComponentProvider() + }, + _online: { + build: () => { + const provider = new OnlineComponentProvider(); + const ogCreateDatastore = provider.createDatastore.bind(provider); + provider.createDatastore = config => { + const datastore = ogCreateDatastore(config); + // @ts-ignore + datastore.invokeStreamingRPC = fake; + return datastore; + }; + return provider; + } + } + }; + + return fake; +} + +describe('execute(Pipeline|PipelineOptions)', () => { + it('returns execution time with empty results', async () => { + const firestore = newTestFirestore(); + + const executeTime = Timestamp.now(); + const spy = fakePipelineResponse(firestore, [ + { + executionTime: executeTime.toDate().toISOString(), + results: [] + } + ]); + + const pipelineSnapshot = await execute( + firestore.pipeline().collection('foo') + ); + + expect(pipelineSnapshot.results.length).to.equal(0); + expect(spy.calledOnce); + + expect(pipelineSnapshot.executionTime.toJSON()).to.deep.equal( + executeTime.toJSON() + ); + }); + + it('serializes the pipeline', async () => { + const firestore = newTestFirestore(); + const spy = fakePipelineResponse(firestore); + + await execute({ + pipeline: firestore.pipeline().collection('foo') + }); + + const executePipelineRequest: ProtoExecutePipelineRequest = { + database: 'projects/new-project/databases/(default)', + structuredPipeline: { + 'options': {}, + 'pipeline': { + 'stages': [ + { + 'args': [ + { + 'referenceValue': '/foo' + } + ], + 'name': 'collection', + 'options': {} + } + ] + } + } + }; + expect(spy.args[FIRST_CALL][EXECUTE_PIPELINE_REQUEST]).to.deep.equal( + executePipelineRequest + ); + }); + + it('serializes the pipeline options', async () => { + const firestore = newTestFirestore(); + const spy = fakePipelineResponse(firestore); + + await execute({ + pipeline: firestore.pipeline().collection('foo'), + indexMode: 'recommended' + }); + + const executePipelineRequest: ProtoExecutePipelineRequest = { + database: 'projects/new-project/databases/(default)', + structuredPipeline: { + 'options': { + 'index_mode': { + 'stringValue': 'recommended' + } + }, + 'pipeline': { + 'stages': [ + { + 'args': [ + { + 'referenceValue': '/foo' + } + ], + 'name': 'collection', + 'options': {} + } + ] + } + } + }; + expect(spy.args[FIRST_CALL][EXECUTE_PIPELINE_REQUEST]).to.deep.equal( + executePipelineRequest + ); + }); + + it('serializes the pipeline raw options', async () => { + const firestore = newTestFirestore(); + const spy = fakePipelineResponse(firestore); + + await execute({ + pipeline: firestore.pipeline().collection('foo'), + rawOptions: { + 'foo': 'bar' + } + }); + + const executePipelineRequest: ProtoExecutePipelineRequest = { + database: 'projects/new-project/databases/(default)', + structuredPipeline: { + 'options': { + 'foo': { + 'stringValue': 'bar' + } + }, + 'pipeline': { + 'stages': [ + { + 'args': [ + { + 'referenceValue': '/foo' + } + ], + 'name': 'collection', + 'options': {} + } + ] + } + } + }; + expect(spy.args[FIRST_CALL][EXECUTE_PIPELINE_REQUEST]).to.deep.equal( + executePipelineRequest + ); + }); +}); diff --git a/packages/firestore/test/unit/core/options_util.test.ts b/packages/firestore/test/unit/core/options_util.test.ts new file mode 100644 index 00000000000..0549c2c8a9c --- /dev/null +++ b/packages/firestore/test/unit/core/options_util.test.ts @@ -0,0 +1,224 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; + +import { ParseContext } from '../../../src/api/parse_context'; +import { OptionsUtil } from '../../../src/core/options_util'; +import { UserDataSource } from '../../../src/lite-api/user_data_reader'; +import { testUserDataReader } from '../../util/helpers'; + +describe('OptionsUtil', () => { + let context: ParseContext | undefined; + beforeEach(async () => { + context = testUserDataReader(false).createContext( + UserDataSource.Argument, + 'beforeEach' + ); + }); + + afterEach(async () => { + context = undefined; + }); + + it('should support known options', () => { + const optionsUtil = new OptionsUtil({ + fooBar: { + serverName: 'foo_bar' + } + }); + const proto = optionsUtil.getOptionsProto(context!, { + fooBar: 'recommended' + }); + + expect(proto).deep.equal({ + 'foo_bar': { + stringValue: 'recommended' + } + }); + }); + + it('should support unknown options', () => { + const optionsUtil = new OptionsUtil({}); + const proto = optionsUtil.getOptionsProto(context!, {}, { baz: 'foo' }); + + expect(proto).to.deep.equal({ + baz: { + stringValue: 'foo' + } + }); + }); + + it('should support unknown nested options', () => { + const optionsUtil = new OptionsUtil({}); + const proto = optionsUtil.getOptionsProto( + context!, + {}, + { 'foo.bar': 'baz' } + ); + + expect(proto).to.deep.equal({ + foo: { + mapValue: { + fields: { + bar: { stringValue: 'baz' } + } + } + } + }); + }); + + it('should support options override', () => { + const optionsUtil = new OptionsUtil({ + indexMode: { + serverName: 'index_mode' + } + }); + const proto = optionsUtil.getOptionsProto( + context!, + { + indexMode: 'recommended' + }, + { + 'index_mode': 'baz' + } + ); + + expect(proto).to.deep.equal({ + 'index_mode': { + stringValue: 'baz' + } + }); + }); + + it('should support options override of nested field', () => { + const optionsUtil = new OptionsUtil({ + foo: { + serverName: 'foo', + nestedOptions: { + bar: { + serverName: 'bar' + }, + waldo: { + serverName: 'waldo' + } + } + } + }); + const proto = optionsUtil.getOptionsProto( + context!, + { + foo: { bar: 'yep', waldo: 'found' } + }, + { + 'foo.bar': 123, + 'foo.baz': true + } + ); + + expect(proto).to.deep.equal({ + foo: { + mapValue: { + fields: { + bar: { + integerValue: '123' + }, + waldo: { + stringValue: 'found' + }, + baz: { + booleanValue: true + } + } + } + } + }); + }); + + it('will replace a nested object if given a new object', () => { + const optionsUtil = new OptionsUtil({ + foo: { + serverName: 'foo', + nestedOptions: { + bar: { + serverName: 'bar' + }, + waldo: { + serverName: 'waldo' + } + } + } + }); + const proto = optionsUtil.getOptionsProto( + context!, + { + foo: { bar: 'yep', waldo: 'found' } + }, + { + foo: { + bar: 123 + } + } + ); + + expect(proto).to.deep.equal({ + foo: { + mapValue: { + fields: { + bar: { + integerValue: '123' + } + } + } + } + }); + }); + + it('will replace a top level property that is not an object if given a nested field with dot notation', () => { + const optionsUtil = new OptionsUtil({ + foo: { + serverName: 'foo' + } + }); + + const proto = optionsUtil.getOptionsProto( + context!, + { + foo: 'bar' + }, + { + 'foo.bar': '123', + 'foo.waldo': true + } + ); + + expect(proto).to.deep.equal({ + foo: { + mapValue: { + fields: { + bar: { + stringValue: '123' + }, + waldo: { + booleanValue: true + } + } + } + } + }); + }); +}); diff --git a/packages/firestore/test/unit/core/structured_pipeline.test.ts b/packages/firestore/test/unit/core/structured_pipeline.test.ts new file mode 100644 index 00000000000..759dfecea44 --- /dev/null +++ b/packages/firestore/test/unit/core/structured_pipeline.test.ts @@ -0,0 +1,187 @@ +/** + * @license + * Copyright 2025 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 { expect } from 'chai'; +import * as sinon from 'sinon'; + +import { DatabaseId } from '../../../src/core/database_info'; +import { + StructuredPipeline, + StructuredPipelineOptions +} from '../../../src/core/structured_pipeline'; +import { UserDataSource } from '../../../src/lite-api/user_data_reader'; +import { Pipeline as PipelineProto } from '../../../src/protos/firestore_proto_api'; +import { + JsonProtoSerializer, + ProtoSerializable +} from '../../../src/remote/serializer'; +import { testUserDataReader } from '../../util/helpers'; + +describe('StructuredPipeline', () => { + it('should serialize the pipeline argument', () => { + const pipeline: ProtoSerializable = { + _toProto: sinon.fake.returns({} as PipelineProto) + }; + const structuredPipelineOptions = new StructuredPipelineOptions(); + structuredPipelineOptions._readUserData( + testUserDataReader(false).createContext(UserDataSource.Argument, 'test') + ); + const structuredPipeline = new StructuredPipeline( + pipeline, + structuredPipelineOptions + ); + + const proto = structuredPipeline._toProto( + new JsonProtoSerializer(DatabaseId.empty(), false) + ); + + expect(proto).to.deep.equal({ + pipeline: {}, + options: {} + }); + + expect((pipeline._toProto as sinon.SinonSpy).calledOnce).to.be.true; + }); + + it('should support known options', () => { + const pipeline: ProtoSerializable = { + _toProto: sinon.fake.returns({} as PipelineProto) + }; + + const options = new StructuredPipelineOptions({ + indexMode: 'recommended' + }); + options._readUserData( + testUserDataReader(false).createContext(UserDataSource.Argument, 'test') + ); + const structuredPipeline = new StructuredPipeline(pipeline, options); + + const proto = structuredPipeline._toProto( + new JsonProtoSerializer(DatabaseId.empty(), false) + ); + + expect(proto).to.deep.equal({ + pipeline: {}, + options: { + 'index_mode': { + stringValue: 'recommended' + } + } + }); + + expect((pipeline._toProto as sinon.SinonSpy).calledOnce).to.be.true; + }); + + it('should support unknown options', () => { + const pipeline: ProtoSerializable = { + _toProto: sinon.fake.returns({} as PipelineProto) + }; + const options = new StructuredPipelineOptions( + {}, + { + 'foo_bar': 'baz' + } + ); + options._readUserData( + testUserDataReader(false).createContext(UserDataSource.Argument, 'test') + ); + const structuredPipeline = new StructuredPipeline(pipeline, options); + + const proto = structuredPipeline._toProto( + new JsonProtoSerializer(DatabaseId.empty(), false) + ); + + expect(proto).to.deep.equal({ + pipeline: {}, + options: { + 'foo_bar': { + stringValue: 'baz' + } + } + }); + + expect((pipeline._toProto as sinon.SinonSpy).calledOnce).to.be.true; + }); + + it('should support unknown nested options', () => { + const pipeline: ProtoSerializable = { + _toProto: sinon.fake.returns({} as PipelineProto) + }; + const options = new StructuredPipelineOptions( + {}, + { + 'foo.bar': 'baz' + } + ); + options._readUserData( + testUserDataReader(false).createContext(UserDataSource.Argument, 'test') + ); + const structuredPipeline = new StructuredPipeline(pipeline, options); + + const proto = structuredPipeline._toProto( + new JsonProtoSerializer(DatabaseId.empty(), false) + ); + + expect(proto).to.deep.equal({ + pipeline: {}, + options: { + 'foo': { + mapValue: { + fields: { + 'bar': { stringValue: 'baz' } + } + } + } + } + }); + + expect((pipeline._toProto as sinon.SinonSpy).calledOnce).to.be.true; + }); + + it('should support options override', () => { + const pipeline: ProtoSerializable = { + _toProto: sinon.fake.returns({} as PipelineProto) + }; + const options = new StructuredPipelineOptions( + { + indexMode: 'recommended' + }, + { + 'index_mode': 'baz' + } + ); + options._readUserData( + testUserDataReader(false).createContext(UserDataSource.Argument, 'test') + ); + const structuredPipeline = new StructuredPipeline(pipeline, options); + + const proto = structuredPipeline._toProto( + new JsonProtoSerializer(DatabaseId.empty(), false) + ); + + expect(proto).to.deep.equal({ + pipeline: {}, + options: { + 'index_mode': { + stringValue: 'baz' + } + } + }); + + expect((pipeline._toProto as sinon.SinonSpy).calledOnce).to.be.true; + }); +}); diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index f265521b08b..42b283f25c6 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -151,7 +151,7 @@ "path": "firestore", "imports": [ "getFirestore", - "lt", + "lessThan", "Field", "execute" ] @@ -183,7 +183,7 @@ "path": "firestore", "imports": [ "getFirestore", - "lt", + "lessThan", "Field", "useFirestorePipelines" ] @@ -215,7 +215,7 @@ "path": "firestore", "imports": [ "getFirestore", - "lt", + "lessThan", "Field", "useFirestorePipelines", "andFunction" diff --git a/yarn.lock b/yarn.lock index 213ecd4d2c9..caa33e3d218 100644 --- a/yarn.lock +++ b/yarn.lock @@ -223,11 +223,21 @@ resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + "@babel/helper-validator-identifier@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== +"@babel/helper-validator-identifier@^7.27.1": + version "7.27.1" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" + integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== + "@babel/helper-validator-option@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" @@ -257,6 +267,13 @@ dependencies: "@babel/types" "^7.26.7" +"@babel/parser@^7.20.15": + version "7.28.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz#da25d4643532890932cc03f7705fe19637e03fa8" + integrity sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg== + dependencies: + "@babel/types" "^7.28.4" + "@babel/parser@^7.26.8": version "7.26.8" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.8.tgz#deca2b4d99e5e1b1553843b99823f118da6107c2" @@ -1013,6 +1030,14 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" +"@babel/types@^7.28.4": + version "7.28.4" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz#0a4e618f4c60a7cd6c11cb2d48060e4dbe38ac3a" + integrity sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q== + dependencies: + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.27.1" + "@bazel/runfiles@^6.3.1": version "6.3.1" resolved "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz#3f8824b2d82853377799d42354b4df78ab0ace0b" @@ -1588,6 +1613,13 @@ resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== +"@jsdoc/salty@^0.2.1": + version "0.2.9" + resolved "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.9.tgz#4d8c147f7ca011532681ce86352a77a0178f1dec" + integrity sha512-yYxMVH7Dqw6nO0d5NIV8OQWnitU8k6vXH8NtgqAfIa/IUqRMxRv/NUJJ08VEKbAakwxlgBl5PJdrU0dMPStsnw== + dependencies: + lodash "^4.17.21" + "@kwsites/file-exists@^1.1.1": version "1.1.1" resolved "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99" @@ -3094,6 +3126,11 @@ dependencies: "@types/node" "*" +"@types/linkify-it@^5": + version "5.0.0" + resolved "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz#21413001973106cda1c3a9b91eedd4ccd5469d76" + integrity sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q== + "@types/listr@0.14.9": version "0.14.9" resolved "https://registry.npmjs.org/@types/listr/-/listr-0.14.9.tgz#736581cfdfcdb821bace0a3e5b05e91182e00c85" @@ -3107,6 +3144,19 @@ resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/markdown-it@^14.1.1": + version "14.1.2" + resolved "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz#57f2532a0800067d9b934f3521429a2e8bfb4c61" + integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== + dependencies: + "@types/linkify-it" "^5" + "@types/mdurl" "^2" + +"@types/mdurl@^2": + version "2.0.0" + resolved "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" + integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== + "@types/mime@^1": version "1.3.5" resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" @@ -4617,7 +4667,7 @@ blocking-proxy@^1.0.0: dependencies: minimist "^1.2.0" -bluebird@3.7.2: +bluebird@3.7.2, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -5030,6 +5080,13 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" + chai-as-promised@7.1.2: version "7.1.2" resolved "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz#70cd73b74afd519754161386421fb71832c6d041" @@ -6146,7 +6203,7 @@ deep-freeze@0.0.1: resolved "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" integrity sha512-Z+z8HiAvsGwmjqlphnHW5oz6yWlOwu6EQfFTjmeTWlDeda3FS2yv3jhq35TX/ewmsnqB+RX2IdsIOyjJCQN5tg== -deep-is@^0.1.3: +deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -6613,6 +6670,11 @@ ent@~2.2.0: punycode "^1.4.1" safe-regex-test "^1.1.0" +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -6841,6 +6903,18 @@ escape-string-regexp@^2.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escodegen@^1.13.0: + version "1.14.3" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escodegen@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" @@ -6980,7 +7054,7 @@ esniff@^2.0.1: event-emitter "^0.3.5" type "^2.7.2" -espree@^9.6.0, espree@^9.6.1: +espree@^9.0.0, espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== @@ -7008,7 +7082,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: +estraverse@^4.1.1, estraverse@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -7336,7 +7410,7 @@ fast-levenshtein@^1.0.0: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" integrity sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw== -fast-levenshtein@^2.0.6: +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== @@ -8253,6 +8327,17 @@ glob@^10.0.0, glob@^10.2.2, glob@^10.3.10, glob@^10.4.1: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" +glob@^8.0.0: + version "8.1.0" + resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global-dirs@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" @@ -8414,7 +8499,7 @@ graceful-fs@4.2.10: resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -10064,6 +10149,13 @@ js-yaml@~3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js2xmlparser@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + jsbn@1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" @@ -10074,6 +10166,27 @@ jsbn@~0.1.0: resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== +jsdoc@^4.0.0: + version "4.0.4" + resolved "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.4.tgz#86565a9e39cc723a3640465b3fb189a22d1206ca" + integrity sha512-zeFezwyXeG4syyYHbvh1A967IAqq/67yXtXvuL5wnqCkFZe8I0vKfm+EO+YEvLguo6w9CDUbrAXVtJSHh2E8rw== + dependencies: + "@babel/parser" "^7.20.15" + "@jsdoc/salty" "^0.2.1" + "@types/markdown-it" "^14.1.1" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^14.1.0" + markdown-it-anchor "^8.6.7" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + underscore "~1.13.2" + jsesc@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" @@ -10432,6 +10545,13 @@ klaw-sync@^6.0.0: dependencies: graceful-fs "^4.1.11" +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== + dependencies: + graceful-fs "^4.1.9" + kuler@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" @@ -10518,6 +10638,14 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + libnpmaccess@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz#dfb0e5b0a53c315a2610d300e46b4ddeb66e7eec" @@ -10577,6 +10705,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" @@ -11099,6 +11234,23 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +markdown-it-anchor@^8.6.7: + version "8.6.7" + resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" + integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA== + +markdown-it@^14.1.0: + version "14.1.0" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== + dependencies: + argparse "^2.0.1" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + marked-terminal@^7.0.0: version "7.2.1" resolved "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.2.1.tgz#9c1ae073a245a03c6a13e3eeac6f586f29856068" @@ -11122,6 +11274,11 @@ marked@^13.0.2: resolved "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz#5c5b4a5d0198060c7c9bc6ef9420a7fed30f822d" integrity sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA== +marked@^4.0.10: + version "4.3.0" + resolved "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== + matchdep@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" @@ -11146,6 +11303,11 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -11345,7 +11507,7 @@ minimatch@^3.0.0, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatc dependencies: brace-expansion "^1.1.7" -minimatch@^5.1.0: +minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.6" resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== @@ -12335,6 +12497,18 @@ optimist@~0.6.0: minimist "~0.0.1" wordwrap "~0.0.2" +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + optionator@^0.9.3: version "0.9.4" resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -13126,6 +13300,11 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + prettier@2.8.8, prettier@^2.7.1: version "2.8.8" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" @@ -13214,6 +13393,22 @@ proto3-json-serializer@^2.0.2: dependencies: protobufjs "^7.2.5" +protobufjs-cli@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.3.tgz#c58b8566784f0fa1aff11e8d875a31de999637fe" + integrity sha512-MqD10lqF+FMsOayFiNOdOGNlXc4iKDCf0ZQPkPR+gizYh9gqUeGTWulABUCdI+N67w5RfJ6xhgX4J8pa8qmMXQ== + dependencies: + chalk "^4.0.0" + escodegen "^1.13.0" + espree "^9.0.0" + estraverse "^5.1.0" + glob "^8.0.0" + jsdoc "^4.0.0" + minimist "^1.2.0" + semver "^7.1.2" + tmp "^0.2.1" + uglify-js "^3.7.7" + protobufjs@7.4.0, protobufjs@^7.2.5, protobufjs@^7.3.2: version "7.4.0" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" @@ -13344,6 +13539,11 @@ pumpify@^1.3.5: inherits "^2.0.3" pump "^2.0.0" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -13909,6 +14109,13 @@ requires-port@^1.0.0: resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== +requizzle@^0.2.3: + version "0.2.4" + resolved "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== + dependencies: + lodash "^4.17.21" + resolve-alpn@^1.0.0: version "1.2.1" resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" @@ -14374,6 +14581,11 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semve resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== +semver@^7.1.2: + version "7.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" + integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== + semver@~7.3.0: version "7.3.8" resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" @@ -15298,7 +15510,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@3.1.1, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -15935,6 +16147,13 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + type-detect@4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -16111,7 +16330,12 @@ ua-parser-js@^0.7.30: resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.40.tgz#c87d83b7bb25822ecfa6397a0da5903934ea1562" integrity sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ== -uglify-js@^3.1.4, uglify-js@^3.4.9: +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + +uglify-js@^3.1.4, uglify-js@^3.4.9, uglify-js@^3.7.7: version "3.19.3" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== @@ -16141,7 +16365,7 @@ unc-path-regex@^0.1.2: resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" integrity sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg== -underscore@>=1.8.3, underscore@^1.9.1: +underscore@>=1.8.3, underscore@^1.9.1, underscore@~1.13.2: version "1.13.7" resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10" integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g== @@ -16909,7 +17133,7 @@ winston@^3.0.0: triple-beam "^1.3.0" winston-transport "^4.9.0" -word-wrap@^1.2.5: +word-wrap@^1.2.5, word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== @@ -17088,6 +17312,11 @@ xmlbuilder@~11.0.0: resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== + xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From b7e18d0ff5cebb1b9e4f7c3a3743716337164587 Mon Sep 17 00:00:00 2001 From: Google Open Source Bot Date: Thu, 9 Oct 2025 04:47:27 -0700 Subject: [PATCH 289/295] Version Packages (#9300) release v12.4.0 For JS SDK release v12.4.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/hungry-tables-exercise.md | 6 ----- .changeset/lazy-donuts-agree.md | 9 ------- .changeset/loud-tigers-compare.md | 6 ----- .changeset/poor-cobras-dream.md | 5 ---- .changeset/poor-rings-admire.md | 6 ----- .changeset/tender-meals-clap.md | 5 ---- .changeset/young-timers-jump.md | 6 ----- integration/compat-interop/package.json | 8 +++--- integration/firestore/package.json | 2 +- integration/messaging/package.json | 2 +- packages/ai/CHANGELOG.md | 22 ++++++++++++++++ packages/ai/package.json | 4 +-- packages/analytics-compat/CHANGELOG.md | 7 ++++++ packages/analytics-compat/package.json | 6 ++--- packages/analytics-interop-types/CHANGELOG.md | 6 +++++ packages/analytics-interop-types/package.json | 2 +- packages/analytics/CHANGELOG.md | 6 +++++ packages/analytics/package.json | 4 +-- packages/app-check-compat/package.json | 2 +- packages/app-check/package.json | 2 +- packages/app-compat/CHANGELOG.md | 7 ++++++ packages/app-compat/package.json | 4 +-- packages/app/CHANGELOG.md | 6 +++++ packages/app/package.json | 2 +- packages/auth-compat/package.json | 2 +- packages/auth/package.json | 2 +- packages/data-connect/package.json | 2 +- packages/database-compat/package.json | 2 +- packages/database/package.json | 2 +- packages/firebase/CHANGELOG.md | 25 +++++++++++++++++++ packages/firebase/package.json | 12 ++++----- packages/firestore-compat/package.json | 2 +- packages/firestore/package.json | 4 +-- packages/functions-compat/package.json | 2 +- packages/functions/package.json | 2 +- packages/installations-compat/package.json | 2 +- packages/installations/package.json | 2 +- packages/messaging-compat/package.json | 2 +- packages/messaging/package.json | 2 +- packages/performance-compat/package.json | 2 +- packages/performance/package.json | 2 +- packages/remote-config-compat/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/storage-compat/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 2 +- repo-scripts/size-analysis/package.json | 2 +- 47 files changed, 126 insertions(+), 90 deletions(-) delete mode 100644 .changeset/hungry-tables-exercise.md delete mode 100644 .changeset/lazy-donuts-agree.md delete mode 100644 .changeset/loud-tigers-compare.md delete mode 100644 .changeset/poor-cobras-dream.md delete mode 100644 .changeset/poor-rings-admire.md delete mode 100644 .changeset/tender-meals-clap.md delete mode 100644 .changeset/young-timers-jump.md diff --git a/.changeset/hungry-tables-exercise.md b/.changeset/hungry-tables-exercise.md deleted file mode 100644 index 81f326b4f4a..00000000000 --- a/.changeset/hungry-tables-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': patch -'@firebase/ai': patch ---- - -Imagen Generation is now Generally Available (GA). diff --git a/.changeset/lazy-donuts-agree.md b/.changeset/lazy-donuts-agree.md deleted file mode 100644 index f2baca4dcab..00000000000 --- a/.changeset/lazy-donuts-agree.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Added a `sendFunctionResponses` method to `LiveSession`, allowing function responses to be sent during realtime sessions. -Fixed an issue where function responses during audio conversations caused the WebSocket connection to close. See [GitHub Issue #9264](https://github.com/firebase/firebase-js-sdk/issues/9264). - - **Breaking Change**: Changed the `functionCallingHandler` property in `StartAudioConversationOptions` so that it now must return a `Promise`. - This breaking change is allowed in a minor release since the Live API is in Public Preview. diff --git a/.changeset/loud-tigers-compare.md b/.changeset/loud-tigers-compare.md deleted file mode 100644 index cd4e5412311..00000000000 --- a/.changeset/loud-tigers-compare.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': patch -'@firebase/ai': patch ---- - -The Gemini Developer API is now Generally Available (GA). diff --git a/.changeset/poor-cobras-dream.md b/.changeset/poor-cobras-dream.md deleted file mode 100644 index 3ff9e7bc7bd..00000000000 --- a/.changeset/poor-cobras-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Updated SDK to handle empty parts when streaming. diff --git a/.changeset/poor-rings-admire.md b/.changeset/poor-rings-admire.md deleted file mode 100644 index 1b63c0138d0..00000000000 --- a/.changeset/poor-rings-admire.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'firebase': minor -'@firebase/ai': minor ---- - -Added support for the URL context tool, which allows the model to access content from provided public web URLs to inform and enhance its responses. diff --git a/.changeset/tender-meals-clap.md b/.changeset/tender-meals-clap.md deleted file mode 100644 index 44509f4f489..00000000000 --- a/.changeset/tender-meals-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/ai': patch ---- - -Tag code execution with beta tag (public preview). diff --git a/.changeset/young-timers-jump.md b/.changeset/young-timers-jump.md deleted file mode 100644 index 2c572813ae8..00000000000 --- a/.changeset/young-timers-jump.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@firebase/analytics-interop-types': patch -'@firebase/analytics': patch ---- - -Expose `setUserProperties` on internal Analytics instance. diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index d578466418a..a88d4734e57 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,10 +8,10 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.14.3", - "@firebase/app-compat": "0.5.3", - "@firebase/analytics": "0.10.18", - "@firebase/analytics-compat": "0.2.24", + "@firebase/app": "0.14.4", + "@firebase/app-compat": "0.5.4", + "@firebase/analytics": "0.10.19", + "@firebase/analytics-compat": "0.2.25", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", "@firebase/functions": "0.13.1", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 73fc72ec219..c050d38ec94 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,7 +14,7 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@firebase/firestore": "4.9.2" }, "devDependencies": { diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 704d2530a62..5c8358e6627 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,7 +9,7 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "12.3.0", + "firebase": "12.4.0", "chai": "4.5.0", "chromedriver": "119.0.1", "express": "4.21.2", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 7679505f722..af19b6f354e 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,27 @@ # @firebase/ai +## 2.4.0 + +### Minor Changes + +- [`0bb2fe6`](https://github.com/firebase/firebase-js-sdk/commit/0bb2fe636c456628feabd10387673f4980c7ba9e) [#9272](https://github.com/firebase/firebase-js-sdk/pull/9272) - Added a `sendFunctionResponses` method to `LiveSession`, allowing function responses to be sent during realtime sessions. + Fixed an issue where function responses during audio conversations caused the WebSocket connection to close. See [GitHub Issue #9264](https://github.com/firebase/firebase-js-sdk/issues/9264). + + - **Breaking Change**: Changed the `functionCallingHandler` property in `StartAudioConversationOptions` so that it now must return a `Promise`. + This breaking change is allowed in a minor release since the Live API is in Public Preview. + +- [`0ffcb26`](https://github.com/firebase/firebase-js-sdk/commit/0ffcb26af7c597820370fab1223da330728bbb36) [#9254](https://github.com/firebase/firebase-js-sdk/pull/9254) - Added support for the URL context tool, which allows the model to access content from provided public web URLs to inform and enhance its responses. + +### Patch Changes + +- [`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca) [#9255](https://github.com/firebase/firebase-js-sdk/pull/9255) - Imagen Generation is now Generally Available (GA). + +- [`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca) [#9255](https://github.com/firebase/firebase-js-sdk/pull/9255) - The Gemini Developer API is now Generally Available (GA). + +- [`ea85128`](https://github.com/firebase/firebase-js-sdk/commit/ea8512812b994e5de081cb55a951b627fa0183b3) [#9262](https://github.com/firebase/firebase-js-sdk/pull/9262) - Updated SDK to handle empty parts when streaming. + +- [`7a7634f`](https://github.com/firebase/firebase-js-sdk/commit/7a7634f79c4cb0d9389747068b39a7968b5628a0) [#9274](https://github.com/firebase/firebase-js-sdk/pull/9274) - Tag code execution with beta tag (public preview). + ## 2.3.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index b36081aa8f0..c5a27484c3d 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/ai", - "version": "2.3.0", + "version": "2.4.0", "description": "The Firebase AI SDK", "author": "Firebase (https://firebase.google.com/)", "engines": { @@ -60,7 +60,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index f2d4d39b618..a175e1a29eb 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/analytics-compat +## 0.2.25 + +### Patch Changes + +- Updated dependencies [[`1bcf83d`](https://github.com/firebase/firebase-js-sdk/commit/1bcf83d7f0640dff67c20939fb9af7bae6a941e0)]: + - @firebase/analytics@0.10.19 + ## 0.2.24 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index c978d3653cf..a4c07015feb 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.24", + "version": "0.2.25", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -22,7 +22,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", @@ -53,7 +53,7 @@ "typings": "dist/src/index.d.ts", "dependencies": { "@firebase/component": "0.7.0", - "@firebase/analytics": "0.10.18", + "@firebase/analytics": "0.10.19", "@firebase/analytics-types": "0.8.3", "@firebase/util": "1.13.0", "tslib": "^2.1.0" diff --git a/packages/analytics-interop-types/CHANGELOG.md b/packages/analytics-interop-types/CHANGELOG.md index 67178bd2cac..aeb3fe36a8d 100644 --- a/packages/analytics-interop-types/CHANGELOG.md +++ b/packages/analytics-interop-types/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/analytics-interop-types +## 0.3.4 + +### Patch Changes + +- [`1bcf83d`](https://github.com/firebase/firebase-js-sdk/commit/1bcf83d7f0640dff67c20939fb9af7bae6a941e0) [#9263](https://github.com/firebase/firebase-js-sdk/pull/9263) - Expose `setUserProperties` on internal Analytics instance. + ## 0.3.3 ### Patch Changes diff --git a/packages/analytics-interop-types/package.json b/packages/analytics-interop-types/package.json index d96eeff69d5..d06f0c36771 100644 --- a/packages/analytics-interop-types/package.json +++ b/packages/analytics-interop-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics-interop-types", - "version": "0.3.3", + "version": "0.3.4", "description": "@firebase/analytics Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index ccb9017314a..1e82d5d173a 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/analytics +## 0.10.19 + +### Patch Changes + +- [`1bcf83d`](https://github.com/firebase/firebase-js-sdk/commit/1bcf83d7f0640dff67c20939fb9af7bae6a941e0) [#9263](https://github.com/firebase/firebase-js-sdk/pull/9263) - Expose `setUserProperties` on internal Analytics instance. + ## 0.10.18 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index c8d359102f0..b5dd7e377e7 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/analytics", - "version": "0.10.18", + "version": "0.10.19", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "@rollup/plugin-commonjs": "21.1.0", diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index d2b13f78d39..a2fc5b7b785 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -43,7 +43,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-check/package.json b/packages/app-check/package.json index a0e03d895cd..5700ea8934b 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -44,7 +44,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index adcd3b62a59..5d1f234c05f 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/app-compat +## 0.5.4 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.14.4 + ## 0.5.3 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index a27c1627811..548e57cad5c 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app-compat", - "version": "0.5.3", + "version": "0.5.4", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -37,7 +37,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@firebase/util": "1.13.0", "@firebase/logger": "0.5.0", "@firebase/component": "0.7.0", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 5e283b1bef0..b72699ffe20 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/app +## 0.14.4 + +### Patch Changes + +- Update SDK_VERSION. + ## 0.14.3 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 9d9d9d3d89e..aef76c7da8b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/app", - "version": "0.14.3", + "version": "0.14.4", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index 83f02a17be4..0db3546ce95 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -57,7 +57,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "@rollup/plugin-json": "6.1.0", "rollup": "2.79.2", "rollup-plugin-replace": "2.2.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 9a49314e2c1..e21a6385dfb 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -131,7 +131,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@rollup/plugin-json": "6.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index 29459b94f4e..18dbb00e43d 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -55,7 +55,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 3c4460524be..8fd65a1efef 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "typescript": "5.5.4" }, "repository": { diff --git a/packages/database/package.json b/packages/database/package.json index 305c42aac23..411a6bcfcdc 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -57,7 +57,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index c21448da4f8..622cfef4d90 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,30 @@ # firebase +## 12.4.0 + +### Minor Changes + +- [`0bb2fe6`](https://github.com/firebase/firebase-js-sdk/commit/0bb2fe636c456628feabd10387673f4980c7ba9e) [#9272](https://github.com/firebase/firebase-js-sdk/pull/9272) - Added a `sendFunctionResponses` method to `LiveSession`, allowing function responses to be sent during realtime sessions. + Fixed an issue where function responses during audio conversations caused the WebSocket connection to close. See [GitHub Issue #9264](https://github.com/firebase/firebase-js-sdk/issues/9264). + + - **Breaking Change**: Changed the `functionCallingHandler` property in `StartAudioConversationOptions` so that it now must return a `Promise`. + This breaking change is allowed in a minor release since the Live API is in Public Preview. + +- [`0ffcb26`](https://github.com/firebase/firebase-js-sdk/commit/0ffcb26af7c597820370fab1223da330728bbb36) [#9254](https://github.com/firebase/firebase-js-sdk/pull/9254) - Added support for the URL context tool, which allows the model to access content from provided public web URLs to inform and enhance its responses. + +### Patch Changes + +- [`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca) [#9255](https://github.com/firebase/firebase-js-sdk/pull/9255) - Imagen Generation is now Generally Available (GA). + +- [`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca) [#9255](https://github.com/firebase/firebase-js-sdk/pull/9255) - The Gemini Developer API is now Generally Available (GA). + +- Updated dependencies [[`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca), [`0bb2fe6`](https://github.com/firebase/firebase-js-sdk/commit/0bb2fe636c456628feabd10387673f4980c7ba9e), [`2596dd1`](https://github.com/firebase/firebase-js-sdk/commit/2596dd1b5072298da8814844a312681174fc2dca), [`ea85128`](https://github.com/firebase/firebase-js-sdk/commit/ea8512812b994e5de081cb55a951b627fa0183b3), [`0ffcb26`](https://github.com/firebase/firebase-js-sdk/commit/0ffcb26af7c597820370fab1223da330728bbb36), [`7a7634f`](https://github.com/firebase/firebase-js-sdk/commit/7a7634f79c4cb0d9389747068b39a7968b5628a0), [`1bcf83d`](https://github.com/firebase/firebase-js-sdk/commit/1bcf83d7f0640dff67c20939fb9af7bae6a941e0)]: + - @firebase/app@0.14.4 + - @firebase/ai@2.4.0 + - @firebase/analytics@0.10.19 + - @firebase/app-compat@0.5.4 + - @firebase/analytics-compat@0.2.25 + ## 12.3.0 ### Minor Changes diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 7d4ab8682ac..ae6c20b239e 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "12.3.0", + "version": "12.4.0", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -399,9 +399,9 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/ai": "2.3.0", - "@firebase/app": "0.14.3", - "@firebase/app-compat": "0.5.3", + "@firebase/ai": "2.4.0", + "@firebase/app": "0.14.4", + "@firebase/app-compat": "0.5.4", "@firebase/app-types": "0.9.3", "@firebase/auth": "1.11.0", "@firebase/auth-compat": "0.6.0", @@ -422,8 +422,8 @@ "@firebase/performance-compat": "0.2.22", "@firebase/remote-config": "0.7.0", "@firebase/remote-config-compat": "0.2.20", - "@firebase/analytics": "0.10.18", - "@firebase/analytics-compat": "0.2.24", + "@firebase/analytics": "0.10.19", + "@firebase/analytics-compat": "0.2.25", "@firebase/app-check": "0.11.0", "@firebase/app-check-compat": "0.4.0", "@firebase/util": "1.13.0" diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 0787c21f397..be610b3b7d5 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -53,7 +53,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "@types/eslint": "7.29.0", "rollup": "2.79.2", "rollup-plugin-sourcemaps": "0.6.3", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 4001c19fe8c..fc04516212f 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -112,8 +112,8 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.3", - "@firebase/app-compat": "0.5.3", + "@firebase/app": "0.14.4", + "@firebase/app-compat": "0.5.4", "@firebase/auth": "1.11.0", "@rollup/plugin-alias": "5.1.1", "@rollup/plugin-json": "6.1.0", diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index fd5b482bb66..00f065b2b34 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -29,7 +29,7 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/functions/package.json b/packages/functions/package.json index 6099275f6cf..99f5059fb0d 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -49,7 +49,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index 058f690f237..c5ff66cd0d5 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/installations/package.json b/packages/installations/package.json index a1b5db5bdce..ced645951aa 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -49,7 +49,7 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 643e1bd73e9..2279cce7c2b 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", "ts-essentials": "9.4.2", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 4d475ebadfa..12a85d5045d 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -60,7 +60,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "@rollup/plugin-json": "6.1.0", diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 32c041916e2..b0d17ef5899 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -51,7 +51,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.3" + "@firebase/app-compat": "0.5.4" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance/package.json b/packages/performance/package.json index cfbd414c0a4..302a33531cc 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -47,7 +47,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index b733ab07582..07180167c40 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -50,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4", - "@firebase/app-compat": "0.5.3" + "@firebase/app-compat": "0.5.4" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 963b23acdcc..74cdac97568 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-dts": "5.3.1", "rollup-plugin-typescript2": "0.36.0", diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index cf86443967c..0ba6213cfa4 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -44,7 +44,7 @@ "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.5.3", + "@firebase/app-compat": "0.5.4", "@firebase/auth-compat": "0.6.0", "rollup": "2.79.2", "@rollup/plugin-json": "6.1.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index 6248ead4f5c..312f284fddf 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -54,7 +54,7 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@firebase/auth": "1.11.0", "rollup": "2.79.2", "@rollup/plugin-alias": "5.1.1", diff --git a/packages/template/package.json b/packages/template/package.json index 6ef9c2d81be..bad73496caa 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -48,7 +48,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "rollup": "2.79.2", "rollup-plugin-typescript2": "0.36.0", "typescript": "5.5.4" diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index dd71cc9a378..162a491eac7 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -40,7 +40,7 @@ "yargs": "17.7.2" }, "devDependencies": { - "@firebase/app": "0.14.3", + "@firebase/app": "0.14.4", "@firebase/logger": "0.5.0", "@types/webpack": "5.28.5" }, From beda76e80ac1b9f40d424842efa2dec60d983238 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:56:03 -0600 Subject: [PATCH 290/295] Fix pipelines CI (#9306) * Skip pipeline tests in lite, for now * update bundle definitions for size report * Fix size testing for pipelines bundles * fixed typings * Fixed package paths * Fix integration tests that run on the built packages --- integration/firestore/gulpfile.js | 17 +++++++ integration/firestore/pipeline_export.ts | 21 +++++++++ .../firestore/lite/pipelines/index.ts | 18 ++++++++ .../firestore/lite/pipelines/package.json | 7 +++ packages/firebase/firestore/package.json | 2 +- .../firebase/firestore/pipelines/package.json | 2 +- packages/firebase/package.json | 26 ++++++++--- .../firestore/lite/pipelines/package.json | 8 ++-- packages/firestore/package.json | 4 +- packages/firestore/pipelines/package.json | 10 ++--- .../test/integration/api/pipeline.test.ts | 4 +- .../integration/api/query_to_pipeline.test.ts | 6 ++- packages/firestore/test/lite/pipeline.test.ts | 3 +- .../bundle-definitions/firestore.json | 45 ++++++++++++++++--- 14 files changed, 142 insertions(+), 31 deletions(-) create mode 100644 integration/firestore/pipeline_export.ts create mode 100644 packages/firebase/firestore/lite/pipelines/index.ts create mode 100644 packages/firebase/firestore/lite/pipelines/package.json diff --git a/integration/firestore/gulpfile.js b/integration/firestore/gulpfile.js index 57dc674606b..6dfbeb20e5c 100644 --- a/integration/firestore/gulpfile.js +++ b/integration/firestore/gulpfile.js @@ -69,6 +69,23 @@ if (typeof process === 'undefined') { ` ) ) + .pipe( + replace( + /** + * This regex is designed to match the Firebase import in our + * integration tests. + */ + /\s+from '\.(\.\/util)?\/pipeline_export';/, + ` from '${resolve(__dirname, './pipeline_export')}'; + +if (typeof process === 'undefined') { + process = { env: { INCLUDE_FIRESTORE_PERSISTENCE: '${isPersistenceEnabled()}' } } as any; +} else { + process.env.INCLUDE_FIRESTORE_PERSISTENCE = '${isPersistenceEnabled()}'; +} +` + ) + ) .pipe( /** * Fixing the project.json require to properly reference the file diff --git a/integration/firestore/pipeline_export.ts b/integration/firestore/pipeline_export.ts new file mode 100644 index 00000000000..15383ae5580 --- /dev/null +++ b/integration/firestore/pipeline_export.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2025 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. + */ + +// This file replaces "packages/firestore/test/integration/util/pipeline_export" +// and depends on the minified sources. + +export * from '@firebase/firestore/pipelines'; diff --git a/packages/firebase/firestore/lite/pipelines/index.ts b/packages/firebase/firestore/lite/pipelines/index.ts new file mode 100644 index 00000000000..8ef0f25b906 --- /dev/null +++ b/packages/firebase/firestore/lite/pipelines/index.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2024 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. + */ + +export * from '@firebase/firestore/lite/pipelines'; diff --git a/packages/firebase/firestore/lite/pipelines/package.json b/packages/firebase/firestore/lite/pipelines/package.json new file mode 100644 index 00000000000..d0d28ab6afa --- /dev/null +++ b/packages/firebase/firestore/lite/pipelines/package.json @@ -0,0 +1,7 @@ +{ + "name": "firebase/firestore/lite/pipelines", + "main": "dist/pipelines.cjs.js", + "browser": "dist/esm/pipelines.esm.js", + "module": "dist/esm/pipelines.esm.js", + "typings": "dist/firestore/lite/pipelines/index.d.ts" +} diff --git a/packages/firebase/firestore/package.json b/packages/firebase/firestore/package.json index cf9bb8b2d79..4fe0292c9d4 100644 --- a/packages/firebase/firestore/package.json +++ b/packages/firebase/firestore/package.json @@ -4,4 +4,4 @@ "browser": "dist/esm/index.esm.js", "module": "dist/esm/index.esm.js", "typings": "dist/firestore/index.d.ts" -} \ No newline at end of file +} diff --git a/packages/firebase/firestore/pipelines/package.json b/packages/firebase/firestore/pipelines/package.json index e63cb928b0f..b52d1749ce7 100644 --- a/packages/firebase/firestore/pipelines/package.json +++ b/packages/firebase/firestore/pipelines/package.json @@ -3,5 +3,5 @@ "main": "dist/pipelines.cjs.js", "browser": "dist/esm/pipelines.esm.js", "module": "dist/esm/pipelines.esm.js", - "typings": "dist/firestore/lite/pipelines.d.ts" + "typings": "dist/firestore/pipelines/index.d.ts" } diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 9f7dbf9c22f..704b5395a40 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -132,16 +132,16 @@ "default": "./firestore/dist/esm/index.esm.js" }, "./firestore/pipelines": { - "types": "./firestore/dist/firestore/pipelines.d.ts", + "types": "./firestore/pipelines/dist/firestore/pipelines/index.d.ts", "node": { - "require": "./firestore/dist/pipelines.cjs.js", - "import": "./firestore/dist/pipelines.mjs" + "require": "./firestore/pipelines/dist/pipelines.cjs.js", + "import": "./firestore/pipelines/dist/pipelines.mjs" }, "browser": { - "require": "./firestore/dist/pipelines.cjs.js", - "import": "./firestore/dist/esm/pipelines.esm.js" + "require": "./firestore/pipelines/dist/pipelines.cjs.js", + "import": "./firestore/pipelines/dist/esm/pipelines.esm.js" }, - "default": "./firestore/dist/esm/pipelines.esm.js" + "default": "./firestore/pipelines/dist/esm/pipelines.esm.js" }, "./firestore/lite": { "types": "./firestore/lite/dist/firestore/lite/index.d.ts", @@ -155,6 +155,18 @@ }, "default": "./firestore/lite/dist/esm/index.esm.js" }, + "./firestore/lite/pipelines": { + "types": "./firestore/lite/pipelines/dist/firestore/lite/pipelines/index.d.ts", + "node": { + "require": "./firestore/lite/pipelines/dist/pipelines.cjs.js", + "import": "./firestore/lite/pipelines/dist/pipelines.mjs" + }, + "browser": { + "require": "./firestore/lite/pipelines/dist/pipelines.cjs.js", + "import": "./firestore/lite/pipelines/dist/esm/pipelines.esm.js" + }, + "default": "./firestore/lite/pipelines/dist/esm/pipelines.esm.js" + }, "./functions": { "types": "./functions/dist/functions/index.d.ts", "node": { @@ -464,7 +476,9 @@ "auth/web-extension", "functions", "firestore", + "firestore/pipelines", "firestore/lite", + "firestore/lite/pipelines", "installations", "storage", "performance", diff --git a/packages/firestore/lite/pipelines/package.json b/packages/firestore/lite/pipelines/package.json index e7989c2ea97..aff9ad66712 100644 --- a/packages/firestore/lite/pipelines/package.json +++ b/packages/firestore/lite/pipelines/package.json @@ -3,12 +3,12 @@ "description": "Pipelines for the lite Firestore SDK", "main": "../../dist/lite/pipelines.node.cjs.js", "main-esm": "../../dist/lite/pipelines.node.mjs", - "module": "../../dist/lite/pipelines.browser.esm2017.js", - "browser": "../../dist/lite/pipelines.browser.esm2017.js", - "react-native": "../../dist/lite/pipelines.rn.esm2017.js", + "module": "../../dist/lite/pipelines.browser.esm.js", + "browser": "../../dist/lite/pipelines.browser.esm.js", + "react-native": "../../dist/lite/pipelines.rn.esm.js", "typings": "./pipelines.d.ts", "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/firestore/package.json b/packages/firestore/package.json index e0cde483041..8c458acb3ab 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -109,7 +109,7 @@ "require": "./dist/pipelines.node.cjs.js", "import": "./dist/pipelines.node.mjs" }, - "react-native": "./dist/index.rn.esm.js", + "react-native": "./dist/index.rn.js", "browser": { "require": "./dist/pipelines.cjs.js", "import": "./dist/pipelines.esm.js" @@ -173,7 +173,7 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "types": "dist/firestore/src/index.d.ts", + "typings": "dist/firestore/src/index.d.ts", "nyc": { "extension": [ ".ts" diff --git a/packages/firestore/pipelines/package.json b/packages/firestore/pipelines/package.json index aab036bfdb0..aaf410ce36c 100644 --- a/packages/firestore/pipelines/package.json +++ b/packages/firestore/pipelines/package.json @@ -1,14 +1,14 @@ { - "name": "@firebase/firestore/pipelines", + "name": "@firebase/firestore-pipelines", "description": "pipelines", "main": "../dist/pipelines.node.cjs.js", "main-esm": "../dist/pipelines.node.mjs", - "module": "../dist/pipelines.browser.esm2017.js", - "browser": "../dist/pipelines.browser.esm2017.js", - "react-native": "../dist/pipelines.rn.esm2017.js", + "module": "../dist/pipelines.esm.js", + "browser": "../dist/pipelines.esm.js", + "react-native": "../dist/pipelines.rn.js", "typings": "./pipelines.d.ts", "private": true, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } } diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index 37f1f674142..afa763afa92 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -19,7 +19,6 @@ import { FirebaseError } from '@firebase/util'; import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { Deferred } from '../../util/promise'; import { @@ -145,7 +144,8 @@ import { ifAbsent, join, log10, - arraySum + arraySum, + PipelineSnapshot } from '../util/pipeline_export'; use(chaiAsPromised); diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index 4615f3c536a..44972fd34cb 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -18,7 +18,6 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { PipelineSnapshot } from '../../../src/lite-api/pipeline-result'; import { addEqualityMatcher } from '../../util/equality_matcher'; import { doc, @@ -49,7 +48,10 @@ import { withTestCollection, itIf } from '../util/helpers'; -import { execute } from '../util/pipeline_export'; +import { + execute, + PipelineSnapshot +} from '../util/pipeline_export'; use(chaiAsPromised); diff --git a/packages/firestore/test/lite/pipeline.test.ts b/packages/firestore/test/lite/pipeline.test.ts index 1633492b578..cc549dcda7e 100644 --- a/packages/firestore/test/lite/pipeline.test.ts +++ b/packages/firestore/test/lite/pipeline.test.ts @@ -136,7 +136,8 @@ use(chaiAsPromised); const testUnsupportedFeatures = false; const timestampDeltaMS = 1000; -describe('Firestore Pipelines', () => { +// eslint-disable-next-line no-restricted-properties +describe.skip('Firestore Pipelines', () => { addEqualityMatcher(); let firestore: Firestore; diff --git a/repo-scripts/size-analysis/bundle-definitions/firestore.json b/repo-scripts/size-analysis/bundle-definitions/firestore.json index 42b283f25c6..4f53991cec5 100644 --- a/repo-scripts/size-analysis/bundle-definitions/firestore.json +++ b/repo-scripts/size-analysis/bundle-definitions/firestore.json @@ -150,7 +150,18 @@ { "path": "firestore", "imports": [ - "getFirestore", + "getFirestore" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore/pipelines", + "imports": [ "lessThan", "Field", "execute" @@ -182,10 +193,20 @@ { "path": "firestore", "imports": [ - "getFirestore", + "getFirestore" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore/pipelines", + "imports": [ "lessThan", - "Field", - "useFirestorePipelines" + "Field" ] } ] @@ -214,11 +235,21 @@ { "path": "firestore", "imports": [ - "getFirestore", + "getFirestore" + ] + } + ] + }, + { + "packageName": "firebase", + "versionOrTag": "latest", + "imports": [ + { + "path": "firestore/pipelines", + "imports": [ "lessThan", "Field", - "useFirestorePipelines", - "andFunction" + "and" ] } ] From 99b2814d9302c58ac6d66a3e205ba49bd6280178 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 9 Oct 2025 15:10:39 -0600 Subject: [PATCH 291/295] only run pipeline tests when pointing to the enterprise db --- packages/firestore/test/integration/api/pipeline.test.ts | 4 +++- .../test/integration/api/query_to_pipeline.test.ts | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/firestore/test/integration/api/pipeline.test.ts b/packages/firestore/test/integration/api/pipeline.test.ts index afa763afa92..aab69008254 100644 --- a/packages/firestore/test/integration/api/pipeline.test.ts +++ b/packages/firestore/test/integration/api/pipeline.test.ts @@ -154,7 +154,9 @@ setLogLevel('debug'); const timestampDeltaMS = 1000; -apiDescribe.skip('Pipelines', persistence => { +(process.env.FIRESTORE_TARGET_DB_ID === 'enterprise' + ? apiDescribe.only + : apiDescribe.skip)('Pipelines', persistence => { addEqualityMatcher(); let firestore: Firestore; diff --git a/packages/firestore/test/integration/api/query_to_pipeline.test.ts b/packages/firestore/test/integration/api/query_to_pipeline.test.ts index 44972fd34cb..3cb3b765d41 100644 --- a/packages/firestore/test/integration/api/query_to_pipeline.test.ts +++ b/packages/firestore/test/integration/api/query_to_pipeline.test.ts @@ -48,10 +48,7 @@ import { withTestCollection, itIf } from '../util/helpers'; -import { - execute, - PipelineSnapshot -} from '../util/pipeline_export'; +import { execute, PipelineSnapshot } from '../util/pipeline_export'; use(chaiAsPromised); @@ -61,7 +58,9 @@ const testUnsupportedFeatures: boolean | 'only' = false; // This is the Query integration tests from the lite API (no cache support) // with some additional test cases added for more complete coverage. -apiDescribe.skip('Query to Pipeline', persistence => { +(process.env.FIRESTORE_TARGET_DB_ID === 'enterprise' + ? apiDescribe.only + : apiDescribe.skip)('Query to Pipeline', persistence => { addEqualityMatcher(); function verifyResults( From 33d4d76ffb4701d2d6855fa7308b92df448a466f Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Thu, 9 Oct 2025 08:08:14 -0600 Subject: [PATCH 292/295] Revert emulator overlay to allow import into g3 (#9307) * Revert emulator overlay * Re-add emitEmulatorWarning that was not part of the emulator overlay * formatting * remove other references to updateEmulatorBanner --- common/api-review/util.api.md | 3 - packages/auth/src/core/auth/emulator.ts | 10 +- packages/data-connect/src/api/DataConnect.ts | 7 +- packages/database/src/api/Database.ts | 4 +- packages/firestore/src/lite-api/database.ts | 4 +- packages/functions/src/service.ts | 7 +- packages/storage/src/service.ts | 4 +- packages/util/src/emulator.ts | 178 ------------------- 8 files changed, 7 insertions(+), 210 deletions(-) diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index 4ac51fda550..96695e78d73 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -487,9 +487,6 @@ export interface Subscribe { // @public (undocumented) export type Unsubscribe = () => void; -// @public -export function updateEmulatorBanner(name: string, isRunningEmulator: boolean): void; - // Warning: (ae-missing-release-tag) "validateArgCount" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 15da907286f..95345269553 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -18,12 +18,7 @@ import { Auth } from '../../model/public_types'; import { AuthErrorCode } from '../errors'; import { _assert } from '../util/assert'; import { _castAuth } from './auth_impl'; -import { - deepEqual, - isCloudWorkstation, - pingServer, - updateEmulatorBanner -} from '@firebase/util'; +import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util'; /** * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production @@ -102,10 +97,9 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; - // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { + // Workaround to get cookies in Firebase Studio void pingServer(`${protocol}//${host}${portStr}`); - updateEmulatorBanner('Auth', true); } else if (!disableWarnings) { emitEmulatorWarning(); } diff --git a/packages/data-connect/src/api/DataConnect.ts b/packages/data-connect/src/api/DataConnect.ts index b7311363784..c25a09039ac 100644 --- a/packages/data-connect/src/api/DataConnect.ts +++ b/packages/data-connect/src/api/DataConnect.ts @@ -24,11 +24,7 @@ import { import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { Provider } from '@firebase/component'; -import { - isCloudWorkstation, - pingServer, - updateEmulatorBanner -} from '@firebase/util'; +import { isCloudWorkstation, pingServer } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; import { Code, DataConnectError } from '../core/error'; @@ -245,7 +241,6 @@ export function connectDataConnectEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(`https://${host}${port ? `:${port}` : ''}`); - updateEmulatorBanner('Data Connect', true); } dc.enableEmulator({ host, port, sslEnabled }); } diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 338255be46f..515e278b5c5 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -31,8 +31,7 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer, - updateEmulatorBanner + pingServer } from '@firebase/util'; import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider'; @@ -394,7 +393,6 @@ export function connectDatabaseEmulator( // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { void pingServer(host); - updateEmulatorBanner('Database', true); } // Modify the repo to apply emulator settings diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 6af324e4ba4..8e7fdb27e90 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -28,8 +28,7 @@ import { EmulatorMockTokenOptions, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, - pingServer, - updateEmulatorBanner + pingServer } from '@firebase/util'; import { @@ -337,7 +336,6 @@ export function connectFirestoreEmulator( const newHostSetting = `${host}:${port}`; if (useSsl) { void pingServer(`https://${newHostSetting}`); - updateEmulatorBanner('Firestore', true); } if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index 6e2eddda3a2..6a0ddeaa8d3 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -30,11 +30,7 @@ import { Provider } from '@firebase/component'; import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { MessagingInternalComponentName } from '@firebase/messaging-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { - isCloudWorkstation, - pingServer, - updateEmulatorBanner -} from '@firebase/util'; +import { isCloudWorkstation, pingServer } from '@firebase/util'; export const DEFAULT_REGION = 'us-central1'; @@ -186,7 +182,6 @@ export function connectFunctionsEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(functionsInstance.emulatorOrigin + '/backends'); - updateEmulatorBanner('Functions', true); } } diff --git a/packages/storage/src/service.ts b/packages/storage/src/service.ts index a4252c77870..7e2090ccd2e 100644 --- a/packages/storage/src/service.ts +++ b/packages/storage/src/service.ts @@ -46,8 +46,7 @@ import { createMockUserToken, EmulatorMockTokenOptions, isCloudWorkstation, - pingServer, - updateEmulatorBanner + pingServer } from '@firebase/util'; import { Connection, ConnectionType } from './implementation/connection'; @@ -151,7 +150,6 @@ export function connectStorageEmulator( // Workaround to get cookies in Firebase Studio if (useSsl) { void pingServer(`https://${storage.host}/b`); - updateEmulatorBanner('Storage', true); } storage._isUsingEmulator = true; storage._protocol = useSsl ? 'https' : 'http'; diff --git a/packages/util/src/emulator.ts b/packages/util/src/emulator.ts index 1c4d4ae7a7d..2850b5be378 100644 --- a/packages/util/src/emulator.ts +++ b/packages/util/src/emulator.ts @@ -16,7 +16,6 @@ */ import { base64urlEncodeWithoutPadding } from './crypt'; -import { isCloudWorkstation } from './url'; // Firebase Auth tokens contain snake_case claims following the JWT standard / convention. /* eslint-disable camelcase */ @@ -141,180 +140,3 @@ export function createMockUserToken( signature ].join('.'); } - -interface EmulatorStatusMap { - [name: string]: boolean; -} -const emulatorStatus: EmulatorStatusMap = {}; - -interface EmulatorSummary { - prod: string[]; - emulator: string[]; -} - -// Checks whether any products are running on an emulator -function getEmulatorSummary(): EmulatorSummary { - const summary: EmulatorSummary = { - prod: [], - emulator: [] - }; - for (const key of Object.keys(emulatorStatus)) { - if (emulatorStatus[key]) { - summary.emulator.push(key); - } else { - summary.prod.push(key); - } - } - return summary; -} - -function getOrCreateEl(id: string): { created: boolean; element: HTMLElement } { - let parentDiv = document.getElementById(id); - let created = false; - if (!parentDiv) { - parentDiv = document.createElement('div'); - parentDiv.setAttribute('id', id); - created = true; - } - return { created, element: parentDiv }; -} - -let previouslyDismissed = false; -/** - * Updates Emulator Banner. Primarily used for Firebase Studio - * @param name - * @param isRunningEmulator - * @public - */ -export function updateEmulatorBanner( - name: string, - isRunningEmulator: boolean -): void { - if ( - typeof window === 'undefined' || - typeof document === 'undefined' || - !isCloudWorkstation(window.location.host) || - emulatorStatus[name] === isRunningEmulator || - emulatorStatus[name] || // If already set to use emulator, can't go back to prod. - previouslyDismissed - ) { - return; - } - - emulatorStatus[name] = isRunningEmulator; - - function prefixedId(id: string): string { - return `__firebase__banner__${id}`; - } - const bannerId = '__firebase__banner'; - const summary = getEmulatorSummary(); - const showError = summary.prod.length > 0; - - function tearDown(): void { - const element = document.getElementById(bannerId); - if (element) { - element.remove(); - } - } - - function setupBannerStyles(bannerEl: HTMLElement): void { - bannerEl.style.display = 'flex'; - bannerEl.style.background = '#7faaf0'; - bannerEl.style.position = 'fixed'; - bannerEl.style.bottom = '5px'; - bannerEl.style.left = '5px'; - bannerEl.style.padding = '.5em'; - bannerEl.style.borderRadius = '5px'; - bannerEl.style.alignItems = 'center'; - } - - function setupIconStyles(prependIcon: SVGElement, iconId: string): void { - prependIcon.setAttribute('width', '24'); - prependIcon.setAttribute('id', iconId); - prependIcon.setAttribute('height', '24'); - prependIcon.setAttribute('viewBox', '0 0 24 24'); - prependIcon.setAttribute('fill', 'none'); - prependIcon.style.marginLeft = '-6px'; - } - - function setupCloseBtn(): HTMLSpanElement { - const closeBtn = document.createElement('span'); - closeBtn.style.cursor = 'pointer'; - closeBtn.style.marginLeft = '16px'; - closeBtn.style.fontSize = '24px'; - closeBtn.innerHTML = ' ×'; - closeBtn.onclick = () => { - previouslyDismissed = true; - tearDown(); - }; - return closeBtn; - } - - function setupLinkStyles( - learnMoreLink: HTMLAnchorElement, - learnMoreId: string - ): void { - learnMoreLink.setAttribute('id', learnMoreId); - learnMoreLink.innerText = 'Learn more'; - learnMoreLink.href = - 'https://firebase.google.com/docs/studio/preview-apps#preview-backend'; - learnMoreLink.setAttribute('target', '__blank'); - learnMoreLink.style.paddingLeft = '5px'; - learnMoreLink.style.textDecoration = 'underline'; - } - - function setupDom(): void { - const banner = getOrCreateEl(bannerId); - const firebaseTextId = prefixedId('text'); - const firebaseText: HTMLSpanElement = - document.getElementById(firebaseTextId) || document.createElement('span'); - const learnMoreId = prefixedId('learnmore'); - const learnMoreLink: HTMLAnchorElement = - (document.getElementById(learnMoreId) as HTMLAnchorElement) || - document.createElement('a'); - const prependIconId = prefixedId('preprendIcon'); - const prependIcon: SVGElement = - (document.getElementById( - prependIconId - ) as HTMLOrSVGElement as SVGElement) || - document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - if (banner.created) { - // update styles - const bannerEl = banner.element; - setupBannerStyles(bannerEl); - setupLinkStyles(learnMoreLink, learnMoreId); - const closeBtn = setupCloseBtn(); - setupIconStyles(prependIcon, prependIconId); - bannerEl.append(prependIcon, firebaseText, learnMoreLink, closeBtn); - document.body.appendChild(bannerEl); - } - - if (showError) { - firebaseText.innerText = `Preview backend disconnected.`; - prependIcon.innerHTML = ` - - - - - - -`; - } else { - prependIcon.innerHTML = ` - - - - - - -`; - firebaseText.innerText = 'Preview backend running in this workspace.'; - } - firebaseText.setAttribute('id', firebaseTextId); - } - if (document.readyState === 'loading') { - window.addEventListener('DOMContentLoaded', setupDom); - } else { - setupDom(); - } -} From eea574fc83eb4b9c2ecf7ace517d653cb748afee Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 10 Oct 2025 08:30:25 -0600 Subject: [PATCH 293/295] Update emulator.ts --- packages/auth/src/core/auth/emulator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/src/core/auth/emulator.ts b/packages/auth/src/core/auth/emulator.ts index 95345269553..c4026e821a2 100644 --- a/packages/auth/src/core/auth/emulator.ts +++ b/packages/auth/src/core/auth/emulator.ts @@ -97,8 +97,8 @@ export function connectAuthEmulator( authInternal.emulatorConfig = emulatorConfig; authInternal.settings.appVerificationDisabledForTesting = true; + // Workaround to get cookies in Firebase Studio if (isCloudWorkstation(host)) { - // Workaround to get cookies in Firebase Studio void pingServer(`${protocol}//${host}${portStr}`); } else if (!disableWarnings) { emitEmulatorWarning(); From 13760ce861a2cf37b2a6c6c6115a9f19bb4cc250 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 10 Oct 2025 08:34:35 -0600 Subject: [PATCH 294/295] yarn format --- integration/firestore/gulpfile.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/integration/firestore/gulpfile.js b/integration/firestore/gulpfile.js index 6dfbeb20e5c..7dce242e6cc 100644 --- a/integration/firestore/gulpfile.js +++ b/integration/firestore/gulpfile.js @@ -70,13 +70,13 @@ if (typeof process === 'undefined') { ) ) .pipe( - replace( - /** - * This regex is designed to match the Firebase import in our - * integration tests. - */ - /\s+from '\.(\.\/util)?\/pipeline_export';/, - ` from '${resolve(__dirname, './pipeline_export')}'; + replace( + /** + * This regex is designed to match the Firebase import in our + * integration tests. + */ + /\s+from '\.(\.\/util)?\/pipeline_export';/, + ` from '${resolve(__dirname, './pipeline_export')}'; if (typeof process === 'undefined') { process = { env: { INCLUDE_FIRESTORE_PERSISTENCE: '${isPersistenceEnabled()}' } } as any; @@ -84,7 +84,7 @@ if (typeof process === 'undefined') { process.env.INCLUDE_FIRESTORE_PERSISTENCE = '${isPersistenceEnabled()}'; } ` - ) + ) ) .pipe( /** From c134f265d7a0ff225199fe2da099798719e875f8 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:31:12 -0400 Subject: [PATCH 295/295] fix typings:public script for firestore --- packages/firestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 9d90435bfe2..c660ee12b28 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -57,7 +57,7 @@ "api-report:api-json": "rm -rf temp && api-extractor run --local --verbose", "api-report": "run-s --npm-path npm api-report:main api-report:pipelines api-report:lite api-report:lite:pipelines && yarn api-report:api-json", "doc": "api-documenter markdown --input temp --output docs", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/all-packages.d.ts", + "typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts", "assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check", "assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new", "assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list",